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


TypeScript Obj.get方法代码示例

本文整理汇总了TypeScript中@ephox/katamari.Obj.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Obj.get方法的具体用法?TypeScript Obj.get怎么用?TypeScript Obj.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/katamari.Obj的用法示例。


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

示例1:

 const getCellPaddingCellSpacing  = () => {
   const spacing = Obj.get(style, 'border-spacing').or(Obj.get(attrs, 'cellspacing')).fold( () => ({}), (cellspacing) => ({ cellspacing }));
   const padding = Obj.get(style, 'border-padding').or(Obj.get(attrs, 'cellpadding')).fold( () => ({}), (cellpadding) => ({ cellpadding }));
   return {
     ...spacing,
     ...padding
   };
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:Helpers.ts

示例2: rgbToHex

  const extractAdvancedStyleData = (dom) => {
    const rgbToHex = (value: string) => Strings.startsWith(value, 'rgb') ? dom.toHex(value) : value;

    const borderStyle = Obj.get(style, 'border-style').getOr('');
    const borderColor = Obj.get(style, 'border-color').getOr('');
    const bgColor = Obj.get(style, 'background-color').getOr('');

    return {
      borderstyle: borderStyle,
      bordercolor: rgbToHex(borderColor),
      backgroundcolor: rgbToHex(bgColor)
    };
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:Helpers.ts

示例3:

 Arr.each([ 'width', 'height' ], (prop) => {
   Obj.get(snippetData, prop).each((value) => {
     const dimensions = nuData.dimensions || {};
     dimensions[prop] = value;
     nuData.dimensions = dimensions;
   });
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:7,代码来源:Dialog.ts

示例4: tooltipWorker

const tooltipBehaviour = (meta: Record<string, any>, sharedBackstage: UiFactoryBackstageShared): Behaviour.NamedConfiguredBehaviour<Behaviour.BehaviourConfigSpec, Behaviour.BehaviourConfigDetail>[] => {
  return Obj.get(meta, 'tooltipWorker').map((tooltipWorker: TooltipWorker) => {
    return [
      Tooltipping.config({
        lazySink: sharedBackstage.getSink,
        tooltipDom: {
          tag: 'div',
          classes: [ 'tox-tooltip-worker-container' ]
        },
        tooltipComponents: [
        ],
        anchor: (comp) => ({
          anchor: 'submenu',
          item: comp,
          overrides: {
            // NOTE: this avoids it setting overflow and max-height.
            maxHeightFunction: MaxHeight.expandable
          }
        }),
        mode: 'follow-highlight',
        onShow: (component, _tooltip) => {
          tooltipWorker((elm) => {
            Tooltipping.setComponents(component, [
              GuiFactory.external({element: Element.fromDom(elm) })
            ]);
          });
        }
      })
    ];
  }).getOr([]);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:31,代码来源:AutocompleteMenuItem.ts

示例5: r

 () => {
   return Obj.get(bespokeButtons, toolbarItem.toLowerCase()).map((r) => {
     return r(editor, extras);
   }).orThunk(() => {
     // TODO: Add back after TINY-3232 is implemented
     // console.error('No representation for toolbarItem: ' + toolbarItem);
     return Option.none();
   });
 },
开发者ID:tinymce,项目名称:tinymce,代码行数:9,代码来源:Integration.ts

示例6: createPatternSet

const getPatternSet = (editorSettings): PatternSet => {
  const patterns = Obj.get(editorSettings, 'textpattern_patterns').getOr(defaultPatterns);
  if (!Type.isArray(patterns)) {
    error('The setting textpattern_patterns should be an array');
    return {
      inlinePatterns: [],
      blockPatterns: [],
    };
  }
  const normalized = Results.partition(Arr.map(patterns, normalizePattern));
  Arr.each(normalized.errors, (err) => error(err.message, err.pattern));
  return createPatternSet(normalized.values);
};
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:Settings.ts

示例7: render

const extractFrom = (spec: ToolbarButton, extras: Extras): Option<AlloySpec> => {
  return Obj.get(types, spec.type).fold(
    () => {
      console.error('skipping button defined by', spec);
      return Option.none();
    },
    (render) => {
      return Option.some(
        render(spec, extras)
      );
    }
  );
};
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:Integration.ts

示例8:

 return Options.findMap(ps, (prefix) => {
   return Obj.get(buttons, prefix + toolbarItem.toLowerCase());
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:Integration.ts


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