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


TypeScript Keying.focusIn方法代码示例

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


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

示例1:

 memOverflow.getOpt(sink).fold(() => {
   // overflow isn't there yet ... so add it, and return the built thing
   const builtoverFlow = GuiFactory.build(memOverflow.asSpec());
   Attachment.attach(sink, builtoverFlow);
   Positioning.position(sink, toolbarSpec.backstage.shared.anchors.toolbarOverflow(), builtoverFlow);
   SplitAlloyToolbar.refresh(toolbar);
   SplitAlloyToolbar.getMoreButton(toolbar).each(Focusing.focus);
   Keying.focusIn(builtoverFlow);
   // return builtoverFlow;
 }, (builtOverflow) => {
开发者ID:tinymce,项目名称:tinymce,代码行数:10,代码来源:CommonToolbar.ts

示例2:

 Step.sync(() => {
   const groups = Arr.map([
     {
       title: Option.none(), items: Arr.map([ 'A', 'B' ], makeButton)
     },
     {
       title: Option.none(), items: Arr.map([ 'C' ], makeButton)
     }
   ], renderToolbarGroup);
   Toolbar.setGroups(toolbar, groups);
   Keying.focusIn(toolbar);
 })
开发者ID:tinymce,项目名称:tinymce,代码行数:12,代码来源:ToolbarTest.ts

示例3: closeWindow

    const factory = (contents: Types.Dialog.Dialog<T>, internalInitialData: T, dataValidator: Processor): Types.Dialog.DialogInstanceApi<T> => {
      const initialData = validateData<T>(internalInitialData, dataValidator);

      const dialogInit = {
        dataValidator,
        initialData,
        internalDialog: contents
      };

      const dialogUi = renderInlineDialog<T>(
        dialogInit,
        {
          redial: DialogManager.DialogManager.redial,
          closeWindow: () => {
            InlineView.hide(inlineDialog);
            closeWindow(dialogUi.instanceApi);
          }
        },
        extras.backstage, ariaAttrs
      );

      const inlineDialog = GuiFactory.build(InlineView.sketch({
        lazySink: extras.backstage.shared.getSink,
        dom: {
          tag: 'div',
          classes: [ ]
        },
        // Fires the default dismiss event.
        fireDismissalEventInstead: { },
        inlineBehaviours: Behaviour.derive([
          AddEventsBehaviour.config('window-manager-inline-events', [
            // Can't just fireDimissalEvent formCloseEvent, because it is on the parent component of the dialog
            AlloyEvents.run(SystemEvents.dismissRequested(), (comp, se) => {
              AlloyTriggers.emit(dialogUi.dialog, formCancelEvent);
            })
          ])
        ])
      }));
      InlineView.showAt(
        inlineDialog,
        anchor,
        GuiFactory.premade(dialogUi.dialog)
      );
      dialogUi.instanceApi.setData(initialData);
      Keying.focusIn(dialogUi.dialog);
      return dialogUi.instanceApi;
    };
开发者ID:tinymce,项目名称:tinymce,代码行数:47,代码来源:WindowManager.ts

示例4: function

 const focus = function () {
   Keying.focusIn(toolbar);
 };
开发者ID:abstask,项目名称:tinymce,代码行数:3,代码来源:ScrollingToolbar.ts

示例5: function

const sketch = function (rawSpec) {
  const navigateEvent = 'navigateEvent';

  const wrapperAdhocEvents = 'serializer-wrapper-events';
  const formAdhocEvents = 'form-events';

  const schema = ValueSchema.objOf([
    FieldSchema.strict('fields'),
    // Used for when datafields are present.
    FieldSchema.defaulted('maxFieldIndex', rawSpec.fields.length - 1),
    FieldSchema.strict('onExecute'),
    FieldSchema.strict('getInitialValue'),
    FieldSchema.state('state', function () {
      return {
        dialogSwipeState: Singleton.value(),
        currentScreen: Cell(0)
      };
    })
  ]);

  const spec = ValueSchema.asRawOrDie('SerialisedDialog', schema, rawSpec);

  const navigationButton = function (direction, directionName, enabled) {
    return Button.sketch({
      dom: UiDomFactory.dom('<span class="${prefix}-icon-' + directionName + ' ${prefix}-icon"></span>'),
      action (button) {
        AlloyTriggers.emitWith(button, navigateEvent, { direction });
      },
      buttonBehaviours: Behaviour.derive([
        Disabling.config({
          disableClass: Styles.resolve('toolbar-navigation-disabled'),
          disabled: !enabled
        })
      ])
    });
  };

  const reposition = function (dialog, message) {
    SelectorFind.descendant(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) {
      Css.set(parent, 'left', (-spec.state.currentScreen.get() * message.width) + 'px');
    });
  };

  const navigate = function (dialog, direction) {
    const screens = SelectorFilter.descendants(dialog.element(), '.' + Styles.resolve('serialised-dialog-screen'));
    SelectorFind.descendant(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) {
      if ((spec.state.currentScreen.get() + direction) >= 0 && (spec.state.currentScreen.get() + direction) < screens.length) {
        Css.getRaw(parent, 'left').each(function (left) {
          const currentLeft = parseInt(left, 10);
          const w = Width.get(screens[0]);
          Css.set(parent, 'left', (currentLeft - (direction * w)) + 'px');
        });
        spec.state.currentScreen.set(spec.state.currentScreen.get() + direction);
      }
    });
  };

  // Unfortunately we need to inspect the DOM to find the input that is currently on screen
  const focusInput = function (dialog) {
    const inputs = SelectorFilter.descendants(dialog.element(), 'input');
    const optInput = Option.from(inputs[spec.state.currentScreen.get()]);
    optInput.each(function (input) {
      dialog.getSystem().getByDom(input).each(function (inputComp) {
        AlloyTriggers.dispatchFocus(dialog, inputComp.element());
      });
    });
    const dotitems = memDots.get(dialog);
    Highlighting.highlightAt(dotitems, spec.state.currentScreen.get());
  };

  const resetState = function () {
    spec.state.currentScreen.set(0);
    spec.state.dialogSwipeState.clear();
  };

  const memForm = Memento.record(
    Form.sketch(function (parts) {
      return {
        dom: UiDomFactory.dom('<div class="${prefix}-serialised-dialog"></div>'),
        components: [
          Container.sketch({
            dom: UiDomFactory.dom('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),
            components: Arr.map(spec.fields, function (field, i) {
              return i <= spec.maxFieldIndex ? Container.sketch({
                dom: UiDomFactory.dom('<div class="${prefix}-serialised-dialog-screen"></div>'),
                components: [
                  navigationButton(-1, 'previous', (i > 0)),
                  parts.field(field.name, field.spec),
                  navigationButton(+1, 'next', (i < spec.maxFieldIndex))
                ]
              }) : parts.field(field.name, field.spec);
            })
          })
        ],

        formBehaviours: Behaviour.derive([
          Receivers.orientation(function (dialog, message) {
            reposition(dialog, message);
          }),
          Keying.config({
//.........这里部分代码省略.........
开发者ID:tinymce,项目名称:tinymce,代码行数:101,代码来源:SerialisedDialog.ts

示例6:

 }).orThunk(() => {
   Keying.focusIn(newContents);
   return Focus.active();
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:4,代码来源:ContextUi.ts

示例7:

 Composite.parts.getPart(comp, detail, 'toolbar').each(function (toolbar) {
   Keying.focusIn(toolbar);
 });
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:OuterContainer.ts

示例8:

 editor.shortcuts.add('ctrl+F9', 'focus statusbar', () => Keying.focusIn(comp));
开发者ID:tinymce,项目名称:tinymce,代码行数:1,代码来源:ContextToolbar.ts

示例9:

 AlloyEvents.runOnSource(NativeEvents.focusin(), (comp, se) => {
   Keying.focusIn(comp);
 })
开发者ID:tinymce,项目名称:tinymce,代码行数:3,代码来源:SilverDialogCommon.ts


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