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


TypeScript Arr.contains方法代码示例

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


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

示例1: function

  const captureInput = DomEvent.bind(page, 'keydown', function (evt) {
    // Think about killing the event.
    if (! Arr.contains([ 'input', 'textarea' ], Node.name(evt.target()))) {

      // FIX: Close the menus
      // closeMenus()

      toEditing();
    }
  });
开发者ID:abstask,项目名称:tinymce,代码行数:10,代码来源:IosKeyboard.ts

示例2: onUrlChange

 const onChange = (getData: () => LinkDialogData, change: { name: string }): Option<Partial<LinkDialogData>> => {
   if (change.name === 'url') {
     return onUrlChange(getData());
   } else if (Arr.contains([ 'anchor', 'link' ], change.name)) {
     return onCatalogChange(getData(), change);
   } else if (change.name === 'text') {
     // Update the persistent text state, as a user has input custom text
     persistentText.set(getData().text);
     return Option.none();
   } else {
     return Option.none();
   }
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:13,代码来源:DialogChanges.ts

示例3: Error

 const register = (mode: string, api: ModeApi) => {
   if (Arr.contains(defaultModes, mode)) {
     throw new Error(`Cannot override default mode ${mode}`);
   }
   availableModes[mode] = {
     ...api,
     deactivate: () => {
       // wrap custom deactivate APIs so they can't break the editor
       try {
         api.deactivate();
       } catch (e) {
         console.error(`problem while deactivating editor mode ${mode}:`);
         console.error(e);
       }
     },
   };
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:17,代码来源:Mode.ts

示例4: doEnrich

    return Arr.map(items, (item) => {
      const keys = Obj.keys(item);
      // If it is a submenu, enrich all the subitems.
      if (Objects.hasKey(item, 'items')) {
        const newItems = doEnrich(item.items);
        return Merger.deepMerge(
          enrichMenu(item),
          {
            getStyleItems: () => newItems
          }
        ) as FormatItem;
      } else if (Objects.hasKey(item, 'format')) {
        return enrichSupported(item);

        // NOTE: This branch is added from the original StyleFormats in mobile
      } else if (keys.length === 1 && Arr.contains(keys, 'title')) {
        return Merger.deepMerge(item, { type: 'separator' }) as FormatItem;

      } else {
        return enrichCustom(item);
      }
    });
开发者ID:tinymce,项目名称:tinymce,代码行数:22,代码来源:FormatRegister.ts

示例5: function

 const isRoot = function (element) {
   const name = Node.name(element);
   return Compare.eq(element, body) || Arr.contains(rootElements, name);
 };
开发者ID:abstask,项目名称:tinymce,代码行数:4,代码来源:TabContext.ts

示例6: function

  const open = function (settings: NotificationSpec, closeCallback: () => void) {
    const close = () => {
      closeCallback();
      InlineView.hide(notificationWrapper);
    };

    const notification = GuiFactory.build(
      Notification.sketch({
        text: settings.text,
        level: Arr.contains(['success', 'error', 'warning', 'info'], settings.type) ? settings.type : undefined,
        progress: settings.progressBar === true,
        icon: Option.from(settings.icon),
        onAction: close,
        iconProvider: backstage.shared.providers.icons,
        translationProvider: backstage.shared.providers.translate
      })
    );

    const notificationWrapper = GuiFactory.build(
      InlineView.sketch({
        dom: {
          tag: 'div',
          classes: [ 'tox-notifications-container' ]
        },
        lazySink: extras.backstage.shared.getSink,
        fireDismissalEventInstead: { }
      })
    );

    uiMothership.add(notificationWrapper);

    if (settings.timeout) {
      Delay.setTimeout(() => {
        close();
      }, settings.timeout);
    }

    return {
      close,
      moveTo: (x: number, y: number) => {
        InlineView.showAt(notificationWrapper, {
          anchor: 'makeshift',
          x,
          y
        }, GuiFactory.premade(notification));
      },
      moveRel: (element: Element, rel) => {
        // TODO: this should stack, TC-TC, BC-TC
        InlineView.showAt(notificationWrapper, extras.backstage.shared.anchors.banner(), GuiFactory.premade(notification));
      },
      text: (nuText: string) => {
        // check if component is still mounted
        Notification.updateText(notification, nuText);
      },
      settings,
      getEl: () => {
        // TODO: this is required to make stacking banners, should refactor getEl when AP-174 is implemented

      },
      progressBar: {
        value: (percent: number) => {
          Notification.updateProgress(notification, percent);
        }
      }
    };
  };
开发者ID:tinymce,项目名称:tinymce,代码行数:66,代码来源:NotificationManagerImpl.ts

示例7:

 const needRtlClass = I18n.isRtl() && info.iconContent.exists((name) => Arr.contains(rtlTransform, name));
开发者ID:tinymce,项目名称:tinymce,代码行数:1,代码来源:ItemStructure.ts

示例8:

 const inInput = Focus.active().exists(function (elem) {
   return Arr.contains([ 'input', 'textarea' ], Node.name(elem));
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:3,代码来源:ResumeEditing.ts

示例9: function

 const result = Obj.bifilter(settings, function (value, key) {
   return Arr.contains(keys, key);
 });
开发者ID:danielpunkass,项目名称:tinymce,代码行数:3,代码来源:EditorSettings.ts


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