當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。