当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript defaults.default函数代码示例

本文整理汇总了TypeScript中lodash/defaults.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: ellipsis

 ellipsis(options={}){
   this.push(defaults({ 
     key: "ellipsis-" + this.pages.length, 
     label: '...', 
     disabled: true 
   }, options))
 }
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:7,代码来源:PaginationUtils.ts

示例2: next

 next(options={}){
   this.push(defaults({
     key: "next",
     label: this.translate('pagination.next'),
     page: this.currentPage < this.totalPages - 1 ? (this.currentPage + 1) : undefined,
     disabled: this.currentPage === this.totalPages
   }, options))
 }
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:8,代码来源:PaginationUtils.ts

示例3: previous

 previous(options={}){
   this.push(defaults({
     key: "previous",
     label: this.translate('pagination.previous'),
     page: this.currentPage > 1 ? (this.currentPage - 1) : undefined,
     disabled: this.currentPage === 1
   }, options))
 }
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:8,代码来源:PaginationUtils.ts

示例4: page

 page(pageNumber, options={}){
   if (pageNumber > 0 && pageNumber <= this.totalPages){
     this.push(defaults({
       key: pageNumber,
       label: '' + pageNumber,
       page: pageNumber,
       active: pageNumber == this.currentPage
     }, options))
   }
 }
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:10,代码来源:PaginationUtils.ts

示例5: setupBasicContainer

export default function setupBasicContainer(options = {}) {
  options = defaults(options, {
    'orm-adapter:memory': MemoryAdapter,
    'serializer:application': FlatSerializer,
    'config:environment': { ormAdapter: 'memory' }
  });

  let container = new Container();
  forIn(options, (value, key) => {
    container.register(key, value);
  });

  return container;
}
开发者ID:davewasmer,项目名称:denali-auth,代码行数:14,代码来源:setup-basic-container.ts

示例6: renderComponent

export function renderComponent(component:RenderComponentType<any>, props={}, children=null){
  if (component["prototype"] instanceof React.Component || (component["prototype"] && component["prototype"].isReactComponent)){
    return React.createElement(component as React.ComponentClass<any>, props, children)
  } else if (React.isValidElement(component)){
    return React.cloneElement(component as Element, props, children);
  } else if ((typeof component) === 'function'){
    const funProps = (children != null) ? defaults(props, {children}) : props
    return React.createElement(FunctionComponent, {
      key: props["key"],
      fun: component,
      props: funProps
    })

  }
  console.warn("Invalid component", component)
  return null
}
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:17,代码来源:RenderComponent.ts

示例7: defaults

export const prepareConfig = (defaultConfig: ReporterConfig, overrides?: ReporterConfig): ReporterConfig => {
    const config: ReporterConfig = defaults({}, overrides, defaultConfig, {
        newLine: EOL,
        padding: 2,
    });

    if (typeof config.transformHeader !== 'function') {
        throw new TypeError('transformHeader must be a function');
    }
    if (typeof config.transformComment !== 'function') {
        throw new TypeError('transformComment must be a function');
    }
    // padding must be a minimum of 0
    // enforce padding to be a number as well
    config.padding = Math.max(0, config.padding);

    return config;
};
开发者ID:pgilad,项目名称:leasot,代码行数:18,代码来源:custom.ts

示例8: defaults

  orderDirection?: string
  include?: Array<string> | string
  exclude?: Array<string> | string
  showCount?: boolean
  showMore?:boolean
}

export const FacetFilterPropTypes = defaults({
  field: React.PropTypes.string.isRequired,
  operator: React.PropTypes.oneOf(["AND", "OR"]),
  size: React.PropTypes.number,
  title: React.PropTypes.string.isRequired,
  id: React.PropTypes.string.isRequired,
  containerComponent:RenderComponentPropType,
  listComponent:RenderComponentPropType,
  itemComponent:RenderComponentPropType,
  translations: SearchkitComponent.translationsPropType(
    FacetAccessor.translations
  ),
  orderKey: React.PropTypes.string,
  orderDirection: React.PropTypes.oneOf(["asc", "desc"]),
  include: React.PropTypes.oneOfType([
      React.PropTypes.string, React.PropTypes.array
  ]),
  exclude: React.PropTypes.oneOfType([
      React.PropTypes.string, React.PropTypes.array
  ]),
  showCount: React.PropTypes.bool,
  showMore: React.PropTypes.bool
},SearchkitComponent.propTypes)
开发者ID:BenJamesbabala,项目名称:searchkit,代码行数:30,代码来源:FacetFilterProps.ts

示例9: defaults

export const FacetFilterPropTypes = defaults({
  field: React.PropTypes.string.isRequired,
  operator: React.PropTypes.oneOf(["AND", "OR"]),
  size: React.PropTypes.number,
  title: React.PropTypes.string.isRequired,
  id: React.PropTypes.string.isRequired,
  containerComponent:RenderComponentPropType,
  listComponent:RenderComponentPropType,
  itemComponent:RenderComponentPropType,
  translations: SearchkitComponent.translationsPropType(
    FacetAccessor.translations
  ),
  orderKey: React.PropTypes.string,
  orderDirection: React.PropTypes.oneOf(["asc", "desc"]),
  include: React.PropTypes.oneOfType([
      React.PropTypes.string, React.PropTypes.array
  ]),
  exclude: React.PropTypes.oneOfType([
      React.PropTypes.string, React.PropTypes.array
  ]),
  showCount: React.PropTypes.bool,
  showMore: React.PropTypes.bool,
  fieldOptions:React.PropTypes.shape({
    type:React.PropTypes.oneOf(["embedded", "nested", "children"]).isRequired,
    options:React.PropTypes.object
  }),
  countFormatter:React.PropTypes.func,
  bucketsTransform:React.PropTypes.func
},SearchkitComponent.propTypes)
开发者ID:Nostres,项目名称:searchkit-redux,代码行数:29,代码来源:FacetFilterProps.ts


注:本文中的lodash/defaults.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。