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