@soxa-ui/plugins 0.0.0-stage → 0.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +125 -2
- package/dist/base/base.class.d.ts +54 -0
- package/dist/base/base.class.js +69 -0
- package/dist/base/bundle.class.d.ts +25 -0
- package/dist/base/bundle.class.js +68 -0
- package/dist/base/index.d.ts +3 -0
- package/dist/base/types.d.ts +147 -0
- package/dist/custom/accordion/header.d.ts +19 -0
- package/dist/custom/accordion/header.js +38 -0
- package/dist/custom/accordion/index.d.ts +2 -0
- package/dist/custom/accordion/item-ids/index.d.ts +1 -0
- package/dist/custom/accordion/item-ids/item-ids.plugin.d.ts +24 -0
- package/dist/custom/accordion/item-ids/item-ids.plugin.js +44 -0
- package/dist/custom/action/action.plugin.d.ts +178 -0
- package/dist/custom/action/action.plugin.js +339 -0
- package/dist/custom/action/index.d.ts +2 -0
- package/dist/custom/action/types.d.ts +65 -0
- package/dist/custom/calendar/ids/ids.plugin.d.ts +25 -0
- package/dist/custom/calendar/ids/ids.plugin.js +44 -0
- package/dist/custom/calendar/ids/index.d.ts +1 -0
- package/dist/custom/calendar/index.d.ts +5 -0
- package/dist/custom/calendar/keyboard/index.d.ts +2 -0
- package/dist/custom/calendar/keyboard/keyboard.plugin.d.ts +114 -0
- package/dist/custom/calendar/keyboard/keyboard.plugin.js +249 -0
- package/dist/custom/calendar/keyboard/types.d.ts +16 -0
- package/dist/custom/calendar/names/index.d.ts +1 -0
- package/dist/custom/calendar/names/names.plugin.d.ts +24 -0
- package/dist/custom/calendar/names/names.plugin.js +45 -0
- package/dist/custom/calendar/parts.d.ts +58 -0
- package/dist/custom/calendar/parts.js +119 -0
- package/dist/custom/calendar/pointer/index.d.ts +2 -0
- package/dist/custom/calendar/pointer/pointer.plugin.d.ts +58 -0
- package/dist/custom/calendar/pointer/pointer.plugin.js +144 -0
- package/dist/custom/calendar/pointer/types.d.ts +6 -0
- package/dist/custom/calendar/stop.d.ts +20 -0
- package/dist/custom/calendar/stop.js +32 -0
- package/dist/custom/calendar/types.d.ts +16 -0
- package/dist/custom/clearable/index.d.ts +1 -0
- package/dist/custom/clearable/names/index.d.ts +1 -0
- package/dist/custom/clearable/names/names.plugin.d.ts +24 -0
- package/dist/custom/clearable/names/names.plugin.js +29 -0
- package/dist/custom/collection/bundles.plugin.d.ts +55 -0
- package/dist/custom/collection/bundles.plugin.js +100 -0
- package/dist/custom/collection/collection-bundles-access.plugin.d.ts +29 -0
- package/dist/custom/collection/collection-bundles-access.plugin.js +44 -0
- package/dist/custom/collection/collection-elements.plugin.d.ts +55 -0
- package/dist/custom/collection/collection-elements.plugin.js +100 -0
- package/dist/custom/collection/index.d.ts +4 -0
- package/dist/custom/collection/leaving-focus.d.ts +119 -0
- package/dist/custom/collection/leaving-focus.js +164 -0
- package/dist/custom/collection/reachable.d.ts +14 -0
- package/dist/custom/collection/reachable.js +18 -0
- package/dist/custom/collection/types.d.ts +14 -0
- package/dist/custom/component-view/aria.plugin.d.ts +102 -0
- package/dist/custom/component-view/aria.plugin.js +190 -0
- package/dist/custom/component-view/index.d.ts +2 -0
- package/dist/custom/component-view/types.d.ts +62 -0
- package/dist/custom/date-input/clipboard/clipboard.plugin.d.ts +41 -0
- package/dist/custom/date-input/clipboard/clipboard.plugin.js +98 -0
- package/dist/custom/date-input/clipboard/index.d.ts +2 -0
- package/dist/custom/date-input/clipboard/types.d.ts +6 -0
- package/dist/custom/date-input/ids/ids.plugin.d.ts +21 -0
- package/dist/custom/date-input/ids/ids.plugin.js +28 -0
- package/dist/custom/date-input/ids/index.d.ts +1 -0
- package/dist/custom/date-input/index.d.ts +6 -0
- package/dist/custom/date-input/keyboard/index.d.ts +2 -0
- package/dist/custom/date-input/keyboard/keyboard.plugin.d.ts +54 -0
- package/dist/custom/date-input/keyboard/keyboard.plugin.js +154 -0
- package/dist/custom/date-input/keyboard/types.d.ts +9 -0
- package/dist/custom/date-input/parts.d.ts +49 -0
- package/dist/custom/date-input/parts.js +127 -0
- package/dist/custom/date-input/pointer/index.d.ts +2 -0
- package/dist/custom/date-input/pointer/pointer.plugin.d.ts +51 -0
- package/dist/custom/date-input/pointer/pointer.plugin.js +141 -0
- package/dist/custom/date-input/pointer/types.d.ts +6 -0
- package/dist/custom/date-input/touch/index.d.ts +2 -0
- package/dist/custom/date-input/touch/touch.plugin.d.ts +100 -0
- package/dist/custom/date-input/touch/touch.plugin.js +276 -0
- package/dist/custom/date-input/touch/types.d.ts +6 -0
- package/dist/custom/date-input/types.d.ts +6 -0
- package/dist/custom/date-picker/field.d.ts +20 -0
- package/dist/custom/date-picker/field.js +27 -0
- package/dist/custom/date-picker/focus/focus.plugin.d.ts +56 -0
- package/dist/custom/date-picker/focus/focus.plugin.js +81 -0
- package/dist/custom/date-picker/focus/index.d.ts +2 -0
- package/dist/custom/date-picker/focus/types.d.ts +3 -0
- package/dist/custom/date-picker/ids/ids.plugin.d.ts +19 -0
- package/dist/custom/date-picker/ids/ids.plugin.js +28 -0
- package/dist/custom/date-picker/ids/index.d.ts +1 -0
- package/dist/custom/date-picker/index.d.ts +5 -0
- package/dist/custom/date-picker/names/index.d.ts +2 -0
- package/dist/custom/date-picker/names/names.plugin.d.ts +33 -0
- package/dist/custom/date-picker/names/names.plugin.js +80 -0
- package/dist/custom/date-picker/names/types.d.ts +12 -0
- package/dist/custom/date-picker/trigger/index.d.ts +2 -0
- package/dist/custom/date-picker/trigger/trigger.plugin.d.ts +37 -0
- package/dist/custom/date-picker/trigger/trigger.plugin.js +69 -0
- package/dist/custom/date-picker/trigger/types.d.ts +3 -0
- package/dist/custom/dialog/ids/ids.plugin.d.ts +15 -0
- package/dist/custom/dialog/ids/ids.plugin.js +28 -0
- package/dist/custom/dialog/ids/index.d.ts +1 -0
- package/dist/custom/dialog/index.d.ts +3 -0
- package/dist/custom/dialog/layout/index.d.ts +3 -0
- package/dist/custom/dialog/layout/layout.plugin.d.ts +42 -0
- package/dist/custom/dialog/layout/layout.plugin.js +78 -0
- package/dist/custom/dialog/layout/offset-event.d.ts +35 -0
- package/dist/custom/dialog/layout/offset-event.js +44 -0
- package/dist/custom/dialog/layout/types.d.ts +12 -0
- package/dist/custom/dialog/names/index.d.ts +1 -0
- package/dist/custom/dialog/names/names.plugin.d.ts +13 -0
- package/dist/custom/dialog/names/names.plugin.js +17 -0
- package/dist/custom/dismiss/dismiss.plugin.d.ts +174 -0
- package/dist/custom/dismiss/dismiss.plugin.js +287 -0
- package/dist/custom/dismiss/index.d.ts +2 -0
- package/dist/custom/dismiss/types.d.ts +59 -0
- package/dist/custom/drag-and-drop/drag.plugin.d.ts +87 -0
- package/dist/custom/drag-and-drop/drag.plugin.js +310 -0
- package/dist/custom/drag-and-drop/index.d.ts +2 -0
- package/dist/custom/drag-and-drop/types.d.ts +13 -0
- package/dist/custom/drawer/index.d.ts +1 -0
- package/dist/custom/drawer/layout/index.d.ts +2 -0
- package/dist/custom/drawer/layout/layout.plugin.d.ts +17 -0
- package/dist/custom/drawer/layout/layout.plugin.js +22 -0
- package/dist/custom/drawer/layout/types.d.ts +3 -0
- package/dist/custom/element/element.plugin.d.ts +35 -0
- package/dist/custom/element/element.plugin.js +58 -0
- package/dist/custom/element/index.d.ts +2 -0
- package/dist/custom/element/types.d.ts +18 -0
- package/dist/custom/field/ids/ids.plugin.d.ts +64 -0
- package/dist/custom/field/ids/ids.plugin.js +126 -0
- package/dist/custom/field/ids/index.d.ts +2 -0
- package/dist/custom/field/ids/types.d.ts +28 -0
- package/dist/custom/field/index.d.ts +1 -0
- package/dist/custom/frame/anchor/anchor.plugin.d.ts +483 -0
- package/dist/custom/frame/anchor/anchor.plugin.js +820 -0
- package/dist/custom/frame/anchor/index.d.ts +2 -0
- package/dist/custom/frame/anchor/types.d.ts +83 -0
- package/dist/custom/frame/index.d.ts +2 -0
- package/dist/custom/frame/layout/index.d.ts +2 -0
- package/dist/custom/frame/layout/layout.plugin.d.ts +24 -0
- package/dist/custom/frame/layout/layout.plugin.js +65 -0
- package/dist/custom/frame/layout/types.d.ts +5 -0
- package/dist/custom/icon/index.d.ts +2 -0
- package/dist/custom/icon/layout.plugin.d.ts +21 -0
- package/dist/custom/icon/layout.plugin.js +51 -0
- package/dist/custom/icon/types.d.ts +5 -0
- package/dist/custom/id/id.plugin.d.ts +32 -0
- package/dist/custom/id/id.plugin.js +42 -0
- package/dist/custom/id/index.d.ts +2 -0
- package/dist/custom/id/types.d.ts +6 -0
- package/dist/custom/index.d.ts +42 -0
- package/dist/custom/input/field.d.ts +16 -0
- package/dist/custom/input/field.js +27 -0
- package/dist/custom/input/index.d.ts +3 -0
- package/dist/custom/input/input.plugin.d.ts +12 -0
- package/dist/custom/input/input.plugin.js +46 -0
- package/dist/custom/input/types.d.ts +2 -0
- package/dist/custom/input-bool/index.d.ts +2 -0
- package/dist/custom/input-bool/input-bool.plugin.d.ts +30 -0
- package/dist/custom/input-bool/input-bool.plugin.js +77 -0
- package/dist/custom/input-bool/types.d.ts +5 -0
- package/dist/custom/input-control/index.d.ts +2 -0
- package/dist/custom/input-control/input-control.plugin.d.ts +12 -0
- package/dist/custom/input-control/input-control.plugin.js +40 -0
- package/dist/custom/input-control/types.d.ts +2 -0
- package/dist/custom/item-group/ids/ids.plugin.d.ts +19 -0
- package/dist/custom/item-group/ids/ids.plugin.js +32 -0
- package/dist/custom/item-group/ids/index.d.ts +1 -0
- package/dist/custom/item-group/index.d.ts +1 -0
- package/dist/custom/label/index.d.ts +1 -0
- package/dist/custom/label/nested-warn/index.d.ts +1 -0
- package/dist/custom/label/nested-warn/nested-warn.plugin.d.ts +21 -0
- package/dist/custom/label/nested-warn/nested-warn.plugin.js +41 -0
- package/dist/custom/list/height/height.plugin.d.ts +129 -0
- package/dist/custom/list/height/height.plugin.js +272 -0
- package/dist/custom/list/height/index.d.ts +2 -0
- package/dist/custom/list/height/types.d.ts +10 -0
- package/dist/custom/list/index.d.ts +7 -0
- package/dist/custom/list/item/index.d.ts +2 -0
- package/dist/custom/list/item/item.plugin.d.ts +25 -0
- package/dist/custom/list/item/item.plugin.js +46 -0
- package/dist/custom/list/item/types.d.ts +5 -0
- package/dist/custom/list/keyboard/index.d.ts +2 -0
- package/dist/custom/list/keyboard/keyboard.plugin.d.ts +133 -0
- package/dist/custom/list/keyboard/keyboard.plugin.js +199 -0
- package/dist/custom/list/keyboard/types.d.ts +3 -0
- package/dist/custom/list/navigation/index.d.ts +2 -0
- package/dist/custom/list/navigation/navigation.plugin.d.ts +262 -0
- package/dist/custom/list/navigation/navigation.plugin.js +402 -0
- package/dist/custom/list/navigation/types.d.ts +25 -0
- package/dist/custom/list/newly-selected.d.ts +17 -0
- package/dist/custom/list/newly-selected.js +22 -0
- package/dist/custom/list/option-ids/index.d.ts +1 -0
- package/dist/custom/list/option-ids/option-ids.plugin.d.ts +29 -0
- package/dist/custom/list/option-ids/option-ids.plugin.js +43 -0
- package/dist/custom/list/row.d.ts +50 -0
- package/dist/custom/list/row.js +99 -0
- package/dist/custom/list/scroll/index.d.ts +2 -0
- package/dist/custom/list/scroll/scroll.plugin.d.ts +132 -0
- package/dist/custom/list/scroll/scroll.plugin.js +286 -0
- package/dist/custom/list/scroll/types.d.ts +21 -0
- package/dist/custom/list/typeahead.d.ts +53 -0
- package/dist/custom/list/typeahead.js +58 -0
- package/dist/custom/menu/focus/focus.plugin.d.ts +61 -0
- package/dist/custom/menu/focus/focus.plugin.js +105 -0
- package/dist/custom/menu/focus/index.d.ts +2 -0
- package/dist/custom/menu/focus/types.d.ts +2 -0
- package/dist/custom/menu/hover/hover.plugin.d.ts +99 -0
- package/dist/custom/menu/hover/hover.plugin.js +235 -0
- package/dist/custom/menu/hover/index.d.ts +2 -0
- package/dist/custom/menu/hover/types.d.ts +2 -0
- package/dist/custom/menu/ids/ids.plugin.d.ts +29 -0
- package/dist/custom/menu/ids/ids.plugin.js +46 -0
- package/dist/custom/menu/ids/index.d.ts +1 -0
- package/dist/custom/menu/index.d.ts +11 -0
- package/dist/custom/menu/keyboard/index.d.ts +2 -0
- package/dist/custom/menu/keyboard/keyboard.plugin.d.ts +41 -0
- package/dist/custom/menu/keyboard/keyboard.plugin.js +68 -0
- package/dist/custom/menu/keyboard/types.d.ts +2 -0
- package/dist/custom/menu/navigation/index.d.ts +2 -0
- package/dist/custom/menu/navigation/navigation.plugin.d.ts +116 -0
- package/dist/custom/menu/navigation/navigation.plugin.js +222 -0
- package/dist/custom/menu/navigation/types.d.ts +2 -0
- package/dist/custom/menu/nested-layer.d.ts +13 -0
- package/dist/custom/menu/nested-layer.js +20 -0
- package/dist/custom/menu/pointer/index.d.ts +2 -0
- package/dist/custom/menu/pointer/pointer.plugin.d.ts +45 -0
- package/dist/custom/menu/pointer/pointer.plugin.js +95 -0
- package/dist/custom/menu/pointer/strategies/context.strategy.d.ts +70 -0
- package/dist/custom/menu/pointer/strategies/context.strategy.js +170 -0
- package/dist/custom/menu/pointer/strategies/index.d.ts +3 -0
- package/dist/custom/menu/pointer/strategies/press.strategy.d.ts +23 -0
- package/dist/custom/menu/pointer/strategies/press.strategy.js +33 -0
- package/dist/custom/menu/pointer/strategies/types.d.ts +49 -0
- package/dist/custom/menu/pointer/types.d.ts +2 -0
- package/dist/custom/menu/popover-item-focus/focus.plugin.d.ts +54 -0
- package/dist/custom/menu/popover-item-focus/focus.plugin.js +70 -0
- package/dist/custom/menu/popover-item-focus/index.d.ts +2 -0
- package/dist/custom/menu/popover-item-focus/types.d.ts +10 -0
- package/dist/custom/menu/popover-item-keyboard/index.d.ts +2 -0
- package/dist/custom/menu/popover-item-keyboard/keyboard.plugin.d.ts +43 -0
- package/dist/custom/menu/popover-item-keyboard/keyboard.plugin.js +79 -0
- package/dist/custom/menu/popover-item-keyboard/types.d.ts +2 -0
- package/dist/custom/menu/popup-ids/ids.plugin.d.ts +27 -0
- package/dist/custom/menu/popup-ids/ids.plugin.js +47 -0
- package/dist/custom/menu/popup-ids/index.d.ts +1 -0
- package/dist/custom/menu/submenu-focus/focus.plugin.d.ts +53 -0
- package/dist/custom/menu/submenu-focus/focus.plugin.js +84 -0
- package/dist/custom/menu/submenu-focus/index.d.ts +2 -0
- package/dist/custom/menu/submenu-focus/types.d.ts +10 -0
- package/dist/custom/menu/submenu-keyboard/index.d.ts +2 -0
- package/dist/custom/menu/submenu-keyboard/keyboard.plugin.d.ts +43 -0
- package/dist/custom/menu/submenu-keyboard/keyboard.plugin.js +74 -0
- package/dist/custom/menu/submenu-keyboard/types.d.ts +2 -0
- package/dist/custom/number-input/index.d.ts +5 -0
- package/dist/custom/number-input/keyboard/index.d.ts +2 -0
- package/dist/custom/number-input/keyboard/keyboard.plugin.d.ts +36 -0
- package/dist/custom/number-input/keyboard/keyboard.plugin.js +80 -0
- package/dist/custom/number-input/keyboard/types.d.ts +3 -0
- package/dist/custom/number-input/names/index.d.ts +1 -0
- package/dist/custom/number-input/names/names.plugin.d.ts +17 -0
- package/dist/custom/number-input/names/names.plugin.js +24 -0
- package/dist/custom/number-input/parts.d.ts +21 -0
- package/dist/custom/number-input/parts.js +39 -0
- package/dist/custom/number-input/stepper/index.d.ts +2 -0
- package/dist/custom/number-input/stepper/stepper.plugin.d.ts +59 -0
- package/dist/custom/number-input/stepper/stepper.plugin.js +166 -0
- package/dist/custom/number-input/stepper/types.d.ts +19 -0
- package/dist/custom/number-input/touch/index.d.ts +2 -0
- package/dist/custom/number-input/touch/touch.plugin.d.ts +25 -0
- package/dist/custom/number-input/touch/touch.plugin.js +53 -0
- package/dist/custom/number-input/touch/types.d.ts +3 -0
- package/dist/custom/number-input/types.d.ts +8 -0
- package/dist/custom/number-input/typing/index.d.ts +2 -0
- package/dist/custom/number-input/typing/types.d.ts +6 -0
- package/dist/custom/number-input/typing/typing.plugin.d.ts +47 -0
- package/dist/custom/number-input/typing/typing.plugin.js +149 -0
- package/dist/custom/overlay/focus/focus.plugin.d.ts +150 -0
- package/dist/custom/overlay/focus/focus.plugin.js +242 -0
- package/dist/custom/overlay/focus/index.d.ts +1 -0
- package/dist/custom/overlay/hide-outside/hide-outside.plugin.d.ts +84 -0
- package/dist/custom/overlay/hide-outside/hide-outside.plugin.js +187 -0
- package/dist/custom/overlay/hide-outside/index.d.ts +2 -0
- package/dist/custom/overlay/hide-outside/marks.d.ts +19 -0
- package/dist/custom/overlay/hide-outside/marks.js +43 -0
- package/dist/custom/overlay/hide-outside/types.d.ts +17 -0
- package/dist/custom/overlay/index.d.ts +9 -0
- package/dist/custom/overlay/modal-focus/index.d.ts +1 -0
- package/dist/custom/overlay/modal-focus/modal-focus.plugin.d.ts +72 -0
- package/dist/custom/overlay/modal-focus/modal-focus.plugin.js +109 -0
- package/dist/custom/overlay/modal-ids/index.d.ts +1 -0
- package/dist/custom/overlay/modal-ids/modal-ids.plugin.d.ts +21 -0
- package/dist/custom/overlay/modal-ids/modal-ids.plugin.js +30 -0
- package/dist/custom/overlay/modal-layout/index.d.ts +2 -0
- package/dist/custom/overlay/modal-layout/modal-layout.plugin.d.ts +66 -0
- package/dist/custom/overlay/modal-layout/modal-layout.plugin.js +119 -0
- package/dist/custom/overlay/modal-layout/types.d.ts +13 -0
- package/dist/custom/overlay/modal-names/index.d.ts +1 -0
- package/dist/custom/overlay/modal-names/modal-names.plugin.d.ts +14 -0
- package/dist/custom/overlay/modal-names/modal-names.plugin.js +17 -0
- package/dist/custom/overlay/open-state.d.ts +12 -0
- package/dist/custom/overlay/open-state.js +42 -0
- package/dist/custom/overlay/scroll-lock/index.d.ts +2 -0
- package/dist/custom/overlay/scroll-lock/lock.d.ts +17 -0
- package/dist/custom/overlay/scroll-lock/lock.js +83 -0
- package/dist/custom/overlay/scroll-lock/scroll-lock.plugin.d.ts +78 -0
- package/dist/custom/overlay/scroll-lock/scroll-lock.plugin.js +134 -0
- package/dist/custom/overlay/scroll-lock/types.d.ts +17 -0
- package/dist/custom/overlay/swipe/index.d.ts +2 -0
- package/dist/custom/overlay/swipe/swipe.plugin.d.ts +150 -0
- package/dist/custom/overlay/swipe/swipe.plugin.js +432 -0
- package/dist/custom/overlay/swipe/types.d.ts +62 -0
- package/dist/custom/overlay/types.d.ts +40 -0
- package/dist/custom/pagination/current.d.ts +24 -0
- package/dist/custom/pagination/current.js +34 -0
- package/dist/custom/pagination/focus/focus.plugin.d.ts +57 -0
- package/dist/custom/pagination/focus/focus.plugin.js +106 -0
- package/dist/custom/pagination/focus/index.d.ts +2 -0
- package/dist/custom/pagination/focus/types.d.ts +8 -0
- package/dist/custom/pagination/index.d.ts +3 -0
- package/dist/custom/pagination/names/index.d.ts +1 -0
- package/dist/custom/pagination/names/names.plugin.d.ts +15 -0
- package/dist/custom/pagination/names/names.plugin.js +19 -0
- package/dist/custom/popover/focus/focus.plugin.d.ts +69 -0
- package/dist/custom/popover/focus/focus.plugin.js +107 -0
- package/dist/custom/popover/focus/index.d.ts +2 -0
- package/dist/custom/popover/focus/types.d.ts +2 -0
- package/dist/custom/popover/ids/ids.plugin.d.ts +18 -0
- package/dist/custom/popover/ids/ids.plugin.js +27 -0
- package/dist/custom/popover/ids/index.d.ts +1 -0
- package/dist/custom/popover/index.d.ts +4 -0
- package/dist/custom/popover/names/index.d.ts +1 -0
- package/dist/custom/popover/names/names.plugin.d.ts +7 -0
- package/dist/custom/popover/names/names.plugin.js +10 -0
- package/dist/custom/popover/pointer/index.d.ts +2 -0
- package/dist/custom/popover/pointer/pointer.plugin.d.ts +35 -0
- package/dist/custom/popover/pointer/pointer.plugin.js +65 -0
- package/dist/custom/popover/pointer/types.d.ts +2 -0
- package/dist/custom/radio-group/checked/checked.plugin.d.ts +45 -0
- package/dist/custom/radio-group/checked/checked.plugin.js +81 -0
- package/dist/custom/radio-group/checked/index.d.ts +1 -0
- package/dist/custom/radio-group/index.d.ts +3 -0
- package/dist/custom/radio-group/name/index.d.ts +1 -0
- package/dist/custom/radio-group/name/name.plugin.d.ts +21 -0
- package/dist/custom/radio-group/name/name.plugin.js +39 -0
- package/dist/custom/radio-group/stop.d.ts +17 -0
- package/dist/custom/radio-group/stop.js +30 -0
- package/dist/custom/rating/hover/hover.plugin.d.ts +36 -0
- package/dist/custom/rating/hover/hover.plugin.js +71 -0
- package/dist/custom/rating/hover/index.d.ts +2 -0
- package/dist/custom/rating/hover/types.d.ts +7 -0
- package/dist/custom/rating/index.d.ts +3 -0
- package/dist/custom/rating/names/index.d.ts +1 -0
- package/dist/custom/rating/names/names.plugin.d.ts +25 -0
- package/dist/custom/rating/names/names.plugin.js +45 -0
- package/dist/custom/rating/validity/index.d.ts +2 -0
- package/dist/custom/rating/validity/types.d.ts +7 -0
- package/dist/custom/rating/validity/validity.plugin.d.ts +48 -0
- package/dist/custom/rating/validity/validity.plugin.js +91 -0
- package/dist/custom/ready/index.d.ts +1 -0
- package/dist/custom/ready/ready.plugin.d.ts +14 -0
- package/dist/custom/ready/ready.plugin.js +28 -0
- package/dist/custom/scroller/index.d.ts +2 -0
- package/dist/custom/scroller/names/index.d.ts +1 -0
- package/dist/custom/scroller/names/names.plugin.d.ts +11 -0
- package/dist/custom/scroller/names/names.plugin.js +15 -0
- package/dist/custom/scroller/viewport/edges.d.ts +34 -0
- package/dist/custom/scroller/viewport/edges.js +29 -0
- package/dist/custom/scroller/viewport/focus.d.ts +39 -0
- package/dist/custom/scroller/viewport/focus.js +61 -0
- package/dist/custom/scroller/viewport/index.d.ts +6 -0
- package/dist/custom/scroller/viewport/stop.d.ts +24 -0
- package/dist/custom/scroller/viewport/stop.js +34 -0
- package/dist/custom/scroller/viewport/types.d.ts +31 -0
- package/dist/custom/scroller/viewport/viewport.plugin.d.ts +163 -0
- package/dist/custom/scroller/viewport/viewport.plugin.js +352 -0
- package/dist/custom/select/backspace/backspace.plugin.d.ts +50 -0
- package/dist/custom/select/backspace/backspace.plugin.js +125 -0
- package/dist/custom/select/backspace/index.d.ts +2 -0
- package/dist/custom/select/backspace/types.d.ts +2 -0
- package/dist/custom/select/editable/editable.plugin.d.ts +193 -0
- package/dist/custom/select/editable/editable.plugin.js +347 -0
- package/dist/custom/select/editable/index.d.ts +2 -0
- package/dist/custom/select/editable/types.d.ts +6 -0
- package/dist/custom/select/ids/ids.plugin.d.ts +22 -0
- package/dist/custom/select/ids/ids.plugin.js +31 -0
- package/dist/custom/select/ids/index.d.ts +1 -0
- package/dist/custom/select/index.d.ts +5 -0
- package/dist/custom/select/keyboard/index.d.ts +2 -0
- package/dist/custom/select/keyboard/keyboard.plugin.d.ts +125 -0
- package/dist/custom/select/keyboard/keyboard.plugin.js +205 -0
- package/dist/custom/select/keyboard/strategies/base.strategy.d.ts +37 -0
- package/dist/custom/select/keyboard/strategies/base.strategy.js +81 -0
- package/dist/custom/select/keyboard/strategies/editable.strategy.d.ts +16 -0
- package/dist/custom/select/keyboard/strategies/editable.strategy.js +20 -0
- package/dist/custom/select/keyboard/strategies/index.d.ts +4 -0
- package/dist/custom/select/keyboard/strategies/select-only.strategy.d.ts +13 -0
- package/dist/custom/select/keyboard/strategies/select-only.strategy.js +59 -0
- package/dist/custom/select/keyboard/strategies/types.d.ts +29 -0
- package/dist/custom/select/keyboard/types.d.ts +18 -0
- package/dist/custom/select/pointer/index.d.ts +2 -0
- package/dist/custom/select/pointer/pointer.plugin.d.ts +59 -0
- package/dist/custom/select/pointer/pointer.plugin.js +104 -0
- package/dist/custom/select/pointer/types.d.ts +2 -0
- package/dist/custom/skeleton/index.d.ts +2 -0
- package/dist/custom/skeleton/layout.plugin.d.ts +18 -0
- package/dist/custom/skeleton/layout.plugin.js +47 -0
- package/dist/custom/skeleton/types.d.ts +5 -0
- package/dist/custom/slide/direction.d.ts +30 -0
- package/dist/custom/slide/direction.js +75 -0
- package/dist/custom/slide/index.d.ts +4 -0
- package/dist/custom/slide/keyboard/index.d.ts +2 -0
- package/dist/custom/slide/keyboard/keyboard.plugin.d.ts +46 -0
- package/dist/custom/slide/keyboard/keyboard.plugin.js +106 -0
- package/dist/custom/slide/keyboard/types.d.ts +6 -0
- package/dist/custom/slide/parts.d.ts +7 -0
- package/dist/custom/slide/parts.js +26 -0
- package/dist/custom/slide/pointer/index.d.ts +2 -0
- package/dist/custom/slide/pointer/pointer.plugin.d.ts +100 -0
- package/dist/custom/slide/pointer/pointer.plugin.js +268 -0
- package/dist/custom/slide/pointer/strategies/base.strategy.d.ts +16 -0
- package/dist/custom/slide/pointer/strategies/base.strategy.js +23 -0
- package/dist/custom/slide/pointer/strategies/hold.strategy.d.ts +28 -0
- package/dist/custom/slide/pointer/strategies/hold.strategy.js +48 -0
- package/dist/custom/slide/pointer/strategies/index.d.ts +7 -0
- package/dist/custom/slide/pointer/strategies/magnet.strategy.d.ts +11 -0
- package/dist/custom/slide/pointer/strategies/magnet.strategy.js +17 -0
- package/dist/custom/slide/pointer/strategies/none.strategy.d.ts +7 -0
- package/dist/custom/slide/pointer/strategies/none.strategy.js +9 -0
- package/dist/custom/slide/pointer/strategies/plateau.strategy.d.ts +24 -0
- package/dist/custom/slide/pointer/strategies/plateau.strategy.js +81 -0
- package/dist/custom/slide/pointer/strategies/points.d.ts +16 -0
- package/dist/custom/slide/pointer/strategies/points.js +32 -0
- package/dist/custom/slide/pointer/strategies/settle.strategy.d.ts +11 -0
- package/dist/custom/slide/pointer/strategies/settle.strategy.js +17 -0
- package/dist/custom/slide/pointer/strategies/types.d.ts +57 -0
- package/dist/custom/slide/pointer/types.d.ts +46 -0
- package/dist/custom/slide/types.d.ts +14 -0
- package/dist/custom/table/column-ids/column-ids.plugin.d.ts +26 -0
- package/dist/custom/table/column-ids/column-ids.plugin.js +36 -0
- package/dist/custom/table/column-ids/index.d.ts +1 -0
- package/dist/custom/table/column-names/column-names.plugin.d.ts +18 -0
- package/dist/custom/table/column-names/column-names.plugin.js +24 -0
- package/dist/custom/table/column-names/index.d.ts +1 -0
- package/dist/custom/table/column-reorder/column-reorder.plugin.d.ts +169 -0
- package/dist/custom/table/column-reorder/column-reorder.plugin.js +465 -0
- package/dist/custom/table/column-reorder/index.d.ts +2 -0
- package/dist/custom/table/column-reorder/types.d.ts +81 -0
- package/dist/custom/table/column-resize/column-resize.plugin.d.ts +96 -0
- package/dist/custom/table/column-resize/column-resize.plugin.js +271 -0
- package/dist/custom/table/column-resize/index.d.ts +2 -0
- package/dist/custom/table/column-resize/types.d.ts +38 -0
- package/dist/custom/table/grid/grid.plugin.d.ts +119 -0
- package/dist/custom/table/grid/grid.plugin.js +356 -0
- package/dist/custom/table/grid/index.d.ts +2 -0
- package/dist/custom/table/grid/types.d.ts +22 -0
- package/dist/custom/table/index.d.ts +8 -0
- package/dist/custom/table/layout/index.d.ts +2 -0
- package/dist/custom/table/layout/layout.plugin.d.ts +52 -0
- package/dist/custom/table/layout/layout.plugin.js +122 -0
- package/dist/custom/table/layout/types.d.ts +7 -0
- package/dist/custom/table/names/index.d.ts +2 -0
- package/dist/custom/table/names/names.plugin.d.ts +18 -0
- package/dist/custom/table/names/names.plugin.js +31 -0
- package/dist/custom/table/names/types.d.ts +6 -0
- package/dist/custom/table/row-ids/index.d.ts +1 -0
- package/dist/custom/table/row-ids/row-ids.plugin.d.ts +21 -0
- package/dist/custom/table/row-ids/row-ids.plugin.js +28 -0
- package/dist/custom/tabs/active-tab/active-tab.plugin.d.ts +42 -0
- package/dist/custom/tabs/active-tab/active-tab.plugin.js +103 -0
- package/dist/custom/tabs/active-tab/index.d.ts +2 -0
- package/dist/custom/tabs/active-tab/types.d.ts +17 -0
- package/dist/custom/tabs/content-warn/content-warn.plugin.d.ts +21 -0
- package/dist/custom/tabs/content-warn/content-warn.plugin.js +41 -0
- package/dist/custom/tabs/content-warn/index.d.ts +1 -0
- package/dist/custom/tabs/index.d.ts +7 -0
- package/dist/custom/tabs/item-ids/index.d.ts +1 -0
- package/dist/custom/tabs/item-ids/item-ids.plugin.d.ts +60 -0
- package/dist/custom/tabs/item-ids/item-ids.plugin.js +94 -0
- package/dist/custom/tabs/item-names/index.d.ts +1 -0
- package/dist/custom/tabs/item-names/item-names.plugin.d.ts +17 -0
- package/dist/custom/tabs/item-names/item-names.plugin.js +23 -0
- package/dist/custom/tabs/keyboard/index.d.ts +2 -0
- package/dist/custom/tabs/keyboard/keyboard.plugin.d.ts +105 -0
- package/dist/custom/tabs/keyboard/keyboard.plugin.js +206 -0
- package/dist/custom/tabs/keyboard/types.d.ts +6 -0
- package/dist/custom/tabs/layout/index.d.ts +2 -0
- package/dist/custom/tabs/layout/layout.plugin.d.ts +37 -0
- package/dist/custom/tabs/layout/layout.plugin.js +81 -0
- package/dist/custom/tabs/layout/types.d.ts +4 -0
- package/dist/custom/tabs/parts.d.ts +15 -0
- package/dist/custom/tabs/parts.js +21 -0
- package/dist/custom/tabs/tab.d.ts +29 -0
- package/dist/custom/tabs/tab.js +44 -0
- package/dist/custom/tags/index.d.ts +4 -0
- package/dist/custom/tags/item-names/index.d.ts +1 -0
- package/dist/custom/tags/item-names/item-names.plugin.d.ts +12 -0
- package/dist/custom/tags/item-names/item-names.plugin.js +18 -0
- package/dist/custom/tags/keyboard/index.d.ts +2 -0
- package/dist/custom/tags/keyboard/keyboard.plugin.d.ts +133 -0
- package/dist/custom/tags/keyboard/keyboard.plugin.js +253 -0
- package/dist/custom/tags/keyboard/types.d.ts +6 -0
- package/dist/custom/tags/scroll/index.d.ts +2 -0
- package/dist/custom/tags/scroll/scroll.plugin.d.ts +68 -0
- package/dist/custom/tags/scroll/scroll.plugin.js +120 -0
- package/dist/custom/tags/scroll/types.d.ts +6 -0
- package/dist/custom/tags/tag.d.ts +41 -0
- package/dist/custom/tags/tag.js +66 -0
- package/dist/custom/textarea/autoresize/autoresize.plugin.d.ts +70 -0
- package/dist/custom/textarea/autoresize/autoresize.plugin.js +176 -0
- package/dist/custom/textarea/autoresize/index.d.ts +2 -0
- package/dist/custom/textarea/autoresize/types.d.ts +6 -0
- package/dist/custom/textarea/ids/ids.plugin.d.ts +26 -0
- package/dist/custom/textarea/ids/ids.plugin.js +44 -0
- package/dist/custom/textarea/ids/index.d.ts +1 -0
- package/dist/custom/textarea/index.d.ts +3 -0
- package/dist/custom/textarea/names/index.d.ts +2 -0
- package/dist/custom/textarea/names/names.plugin.d.ts +33 -0
- package/dist/custom/textarea/names/names.plugin.js +65 -0
- package/dist/custom/textarea/names/types.d.ts +8 -0
- package/dist/custom/toasts/cascade/cascade.plugin.d.ts +81 -0
- package/dist/custom/toasts/cascade/cascade.plugin.js +214 -0
- package/dist/custom/toasts/cascade/index.d.ts +2 -0
- package/dist/custom/toasts/cascade/types.d.ts +15 -0
- package/dist/custom/toasts/index.d.ts +7 -0
- package/dist/custom/toasts/item-names/index.d.ts +1 -0
- package/dist/custom/toasts/item-names/item-names.plugin.d.ts +12 -0
- package/dist/custom/toasts/item-names/item-names.plugin.js +18 -0
- package/dist/custom/toasts/keyboard/index.d.ts +2 -0
- package/dist/custom/toasts/keyboard/keyboard.plugin.d.ts +57 -0
- package/dist/custom/toasts/keyboard/keyboard.plugin.js +136 -0
- package/dist/custom/toasts/keyboard/types.d.ts +6 -0
- package/dist/custom/toasts/layout/index.d.ts +2 -0
- package/dist/custom/toasts/layout/layout.plugin.d.ts +23 -0
- package/dist/custom/toasts/layout/layout.plugin.js +39 -0
- package/dist/custom/toasts/layout/types.d.ts +5 -0
- package/dist/custom/toasts/names/index.d.ts +1 -0
- package/dist/custom/toasts/names/names.plugin.d.ts +10 -0
- package/dist/custom/toasts/names/names.plugin.js +13 -0
- package/dist/custom/toasts/removal/index.d.ts +2 -0
- package/dist/custom/toasts/removal/removal.plugin.d.ts +35 -0
- package/dist/custom/toasts/removal/removal.plugin.js +69 -0
- package/dist/custom/toasts/removal/types.d.ts +6 -0
- package/dist/custom/toasts/timer/index.d.ts +2 -0
- package/dist/custom/toasts/timer/timer.plugin.d.ts +71 -0
- package/dist/custom/toasts/timer/timer.plugin.js +213 -0
- package/dist/custom/toasts/timer/types.d.ts +15 -0
- package/dist/custom/tooltip/ids/ids.plugin.d.ts +22 -0
- package/dist/custom/tooltip/ids/ids.plugin.js +42 -0
- package/dist/custom/tooltip/ids/index.d.ts +1 -0
- package/dist/custom/tooltip/index.d.ts +2 -0
- package/dist/custom/tooltip/trigger/document-state.d.ts +42 -0
- package/dist/custom/tooltip/trigger/document-state.js +50 -0
- package/dist/custom/tooltip/trigger/index.d.ts +2 -0
- package/dist/custom/tooltip/trigger/trigger.plugin.d.ts +133 -0
- package/dist/custom/tooltip/trigger/trigger.plugin.js +271 -0
- package/dist/custom/tooltip/trigger/types.d.ts +20 -0
- package/dist/custom/virtual/index.d.ts +2 -0
- package/dist/custom/virtual/types.d.ts +6 -0
- package/dist/custom/virtual/virtual.plugin.d.ts +126 -0
- package/dist/custom/virtual/virtual.plugin.js +311 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +149 -0
- package/dist/locale/index.d.ts +6 -0
- package/dist/locale/locale.d.ts +38 -0
- package/dist/locale/locale.js +93 -0
- package/dist/locale/locale.plugin.d.ts +26 -0
- package/dist/locale/locale.plugin.js +35 -0
- package/dist/locale/locales/ar.d.ts +5 -0
- package/dist/locale/locales/ar.js +59 -0
- package/dist/locale/locales/en.d.ts +7 -0
- package/dist/locale/locales/en.js +61 -0
- package/dist/locale/locales/es.d.ts +2 -0
- package/dist/locale/locales/es.js +56 -0
- package/dist/locale/locales/fr.d.ts +2 -0
- package/dist/locale/locales/fr.js +56 -0
- package/dist/locale/locales/index.d.ts +6 -0
- package/dist/locale/locales/ru.d.ts +2 -0
- package/dist/locale/locales/ru.js +56 -0
- package/dist/locale/locales/zh.d.ts +2 -0
- package/dist/locale/locales/zh.js +56 -0
- package/dist/locale/names.plugin.d.ts +32 -0
- package/dist/locale/names.plugin.js +39 -0
- package/dist/locale/source.class.d.ts +22 -0
- package/dist/locale/source.class.js +32 -0
- package/dist/locale/types.d.ts +197 -0
- package/dist/motion/index.d.ts +2 -0
- package/dist/motion/motion.d.ts +28 -0
- package/dist/motion/motion.js +67 -0
- package/dist/motion/types.d.ts +14 -0
- package/dist/utils/afterTransitions.d.ts +49 -0
- package/dist/utils/afterTransitions.js +79 -0
- package/dist/utils/focusFirst.d.ts +13 -0
- package/dist/utils/focusFirst.js +24 -0
- package/dist/utils/graceArea.d.ts +21 -0
- package/dist/utils/graceArea.js +66 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/isAboveLayer.d.ts +14 -0
- package/dist/utils/isAboveLayer.js +24 -0
- package/dist/utils/isAppleTouch.d.ts +10 -0
- package/dist/utils/isAppleTouch.js +17 -0
- package/dist/utils/isFocusableElement.d.ts +8 -0
- package/dist/utils/isFocusableElement.js +13 -0
- package/dist/utils/isMeasurableElement.d.ts +11 -0
- package/dist/utils/isMeasurableElement.js +16 -0
- package/dist/utils/isPrintableKey.d.ts +7 -0
- package/dist/utils/isPrintableKey.js +12 -0
- package/dist/utils/layerOf.d.ts +12 -0
- package/dist/utils/layerOf.js +21 -0
- package/dist/utils/nearestShift.d.ts +19 -0
- package/dist/utils/nearestShift.js +58 -0
- package/dist/utils/positionOrigin.d.ts +34 -0
- package/dist/utils/positionOrigin.js +71 -0
- package/dist/utils/scrollParent.d.ts +12 -0
- package/dist/utils/scrollParent.js +23 -0
- package/dist/utils/scrollWindow.d.ts +27 -0
- package/dist/utils/scrollWindow.js +50 -0
- package/dist/utils/tabStops.d.ts +44 -0
- package/dist/utils/tabStops.js +102 -0
- package/dist/utils/tabStopsAfter.d.ts +10 -0
- package/dist/utils/tabStopsAfter.js +16 -0
- package/dist/utils/tabStopsBefore.d.ts +11 -0
- package/dist/utils/tabStopsBefore.js +17 -0
- package/dist/utils/toCssValue.d.ts +8 -0
- package/dist/utils/toCssValue.js +17 -0
- package/dist/utils/trapTab.d.ts +16 -0
- package/dist/utils/trapTab.js +36 -0
- package/dist/utils/types.d.ts +64 -0
- package/package.json +43 -4
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { ISelectItem, TCollectionEngine } from '@soxa-ui/core';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import { TListNavigationPlugin } from '../../list/navigation';
|
|
4
|
+
import type { TListEdge } from '../../list/navigation';
|
|
5
|
+
import type { ISelectKeyboardHost } from './strategies';
|
|
6
|
+
import type { ISelectKeyboardPluginOptions, TSelectKeyboardPluginEvents } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* TSelectKeyboardPlugin — клавиатура поля выбора по паттерну APG Combobox.
|
|
9
|
+
*
|
|
10
|
+
* Общая механика — подписка на `keydown`, привязка к коллекции, учёт
|
|
11
|
+
* подсветки, циклический сдвиг, пропуск недоступных опций — в
|
|
12
|
+
* `TListNavigationPlugin`. Что делают конкретные клавиши, решает выбранная
|
|
13
|
+
* стратегия (`strategies/`):
|
|
14
|
+
* `TSelectOnlyKeyboardStrategy` и `TEditableKeyboardStrategy` — обе поверх
|
|
15
|
+
* общей части `TSelectKeyboardStrategy`. Плагин сам не проверяет
|
|
16
|
+
* `owner.editable` нигде — режим выражен подпиской на `change:editable`,
|
|
17
|
+
* которая переключает стратегию, а не веткой внутри обработчика.
|
|
18
|
+
*
|
|
19
|
+
* Ключевое свойство паттерна: **DOM-фокус никогда не уходит с поля**. Поэтому
|
|
20
|
+
* `keydown` слушается на корне Select, а не на списке, и панель может быть
|
|
21
|
+
* телепортирована куда угодно — на навигацию это не влияет. Подсветку для
|
|
22
|
+
* скринридера передаёт `aria-activedescendant` на поле.
|
|
23
|
+
*
|
|
24
|
+
* Слушатель висит на корне, но клавишу комбобокс берёт только с `<input>`
|
|
25
|
+
* поля. До корня всплывают и клавиши кнопки очистки, крестиков тегов и
|
|
26
|
+
* содержимого слотов — что с ними делать, эти элементы знают сами: кнопка
|
|
27
|
+
* делает из Enter и пробела клик. Правило отвечает на вопрос «чья клавиша», а
|
|
28
|
+
* не «какая», исключений нет: с кнопки очистки не работают ни стрелки, ни
|
|
29
|
+
* `Escape`. Проверка цели — здесь, а не в `TListNavigationPlugin`: база общая
|
|
30
|
+
* с ListBox, у которого фокус на самом списке.
|
|
31
|
+
*
|
|
32
|
+
* Набор по первым буквам — правило, общее с меню (`TTypeahead`,
|
|
33
|
+
* `list/typeahead.ts`): следующая за подсвеченной опция на набранное, повтор
|
|
34
|
+
* буквы — по опциям на неё, без совпадения подсветка на месте. Набор живёт,
|
|
35
|
+
* пока открыта панель: закрытие начинает следующий заново, как у меню.
|
|
36
|
+
*
|
|
37
|
+
* Прокрутки здесь нет: к подсвеченной опции и к выбранной список докручивает
|
|
38
|
+
* `TListScrollPlugin` — тот же, что у ListBox и меню, — по событию подсветки
|
|
39
|
+
* этого плагина (`change:highlight`) и по смене выбора.
|
|
40
|
+
*
|
|
41
|
+
* **В окне** (обёртка `Virtual`) клавиши ходят по всем показанным опциям, а
|
|
42
|
+
* подсветка, уведённая к опции вне окна, закрепляет её в рисовании (база).
|
|
43
|
+
* Своего `id` у такой опции нет, пока окно её не нарисует: ссылка
|
|
44
|
+
* `aria-activedescendant` ждёт, когда опция войдёт в документ
|
|
45
|
+
* (`onHighlightedMounted`), — ссылка в пустоту оставила бы скринридер немым.
|
|
46
|
+
*/
|
|
47
|
+
export declare class TSelectKeyboardPlugin extends TListNavigationPlugin<TSelectKeyboardPluginEvents, ISelectItem> implements ISelectKeyboardHost {
|
|
48
|
+
private _owner;
|
|
49
|
+
/** `<input>` поля — единственный источник клавиш комбобокса. */
|
|
50
|
+
private _input;
|
|
51
|
+
private _strategy;
|
|
52
|
+
/** Набор по первым буквам; паузу набора задают опции установки. */
|
|
53
|
+
private _typeahead;
|
|
54
|
+
install(ctx: IPluginContext, options?: ISelectKeyboardPluginOptions): void;
|
|
55
|
+
destroy(): void;
|
|
56
|
+
/** Стратегия по режиму `editable` — выбор класса, а не проверка внутри. */
|
|
57
|
+
private _syncStrategy;
|
|
58
|
+
/**
|
|
59
|
+
* Подсветка сама по открытию не появляется — только по клавиатуре (см.
|
|
60
|
+
* `highlightSelected`, вызываемый из стратегий). Но раз подсветка может
|
|
61
|
+
* быть выставлена, а выдача — сузиться под отбором (`filter.query`),
|
|
62
|
+
* откуда бы он ни пришёл — из ввода в поле или из кода, — нужно следить,
|
|
63
|
+
* чтобы она не осталась на опции, которой на экране больше нет. Тогда
|
|
64
|
+
* `Enter` выбрал бы скрытое, а `aria-activedescendant` указывал бы в
|
|
65
|
+
* пустоту, поэтому подсветка переезжает на первую из оставшихся.
|
|
66
|
+
*
|
|
67
|
+
* Чинит это сам плагин, а не тот, кто поменял отбор: подсветка — его
|
|
68
|
+
* состояние, и знать о ней отбору незачем.
|
|
69
|
+
*/
|
|
70
|
+
protected onEngineBound(engine: TCollectionEngine<any, any>): void;
|
|
71
|
+
/** Видимая подсветка сменилась — ссылка поля за ней. */
|
|
72
|
+
protected onHighlightChanged(_uid: string | number | null): void;
|
|
73
|
+
/**
|
|
74
|
+
* Подсвеченная опция вошла в документ: окно дорисовало её уже после
|
|
75
|
+
* подсветки. Теперь у неё есть `id` этого монтирования — на него ссылка.
|
|
76
|
+
*/
|
|
77
|
+
protected onHighlightedMounted(_uid: string | number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Набор подсвеченной опции сменился — с ним мог смениться её `id` (`id`
|
|
80
|
+
* опции в `TIdPlugin` задали, сменили или сняли): ссылка поля за ним. Подсветка та
|
|
81
|
+
* же, и прокручивать к опции снова незачем.
|
|
82
|
+
*/
|
|
83
|
+
protected onHighlightedAriaChanged(_uid: string | number): void;
|
|
84
|
+
/**
|
|
85
|
+
* `aria-activedescendant` поля — на `id` подсвеченной опции, пока она в
|
|
86
|
+
* документе (`highlightedId` базы): фокус у комбобокса на поле. Опция вне
|
|
87
|
+
* окна своего `id` не имеет, а оставшийся от прошлого монтирования указывал
|
|
88
|
+
* бы в пустоту — тогда ссылки нет, пока окно опцию не нарисует
|
|
89
|
+
* (`onHighlightedMounted`). `id` опции пишет `TOptionIdsPlugin`.
|
|
90
|
+
*/
|
|
91
|
+
private _refer;
|
|
92
|
+
protected onKeyDown(e: KeyboardEvent): void;
|
|
93
|
+
navigate(step: number): void;
|
|
94
|
+
jumpTo(edge: TListEdge): void;
|
|
95
|
+
chooseHighlighted(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Буква набора по первым буквам: подсветка — на опцию, которую нашёл
|
|
98
|
+
* набор, а нет такой — остаётся на месте. Подсветки нет (панель открыла
|
|
99
|
+
* эта же буква) — поиск с первой опции.
|
|
100
|
+
*/
|
|
101
|
+
typeaheadTo(char: string): void;
|
|
102
|
+
emitClosedEscape(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Подсветка встаёт на выбранную опцию — иначе на первую.
|
|
105
|
+
*
|
|
106
|
+
* Публичный метод: стратегии зовут его из закрытия и навигации, а
|
|
107
|
+
* `TEditablePlugin` — при первом открытии панели набором фильтра
|
|
108
|
+
* (`editableMode: 'filter'`), где своей клавиатурной подсказки нет. Клик и
|
|
109
|
+
* любое другое открытие без явного участника подсветку не ставят.
|
|
110
|
+
*/
|
|
111
|
+
highlightSelected(): void;
|
|
112
|
+
/**
|
|
113
|
+
* Подсветить первую опцию, в чьём тексте есть `needle` — в любом месте и
|
|
114
|
+
* без учёта регистра. Пустая строка и текст без совпадения снимают
|
|
115
|
+
* подсветку.
|
|
116
|
+
*
|
|
117
|
+
* Так ищет ввод в поле в режиме `search` (`TEditablePlugin`) — как отбор в
|
|
118
|
+
* режиме `filter`. Подсветка и `aria-activedescendant` и для ввода
|
|
119
|
+
* остаются здесь, в одной точке.
|
|
120
|
+
*
|
|
121
|
+
* Набор по первым буквам сюда не ходит: у него свои правила —
|
|
122
|
+
* `typeaheadTo`.
|
|
123
|
+
*/
|
|
124
|
+
highlightByText(needle: string): void;
|
|
125
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
2
|
+
import { fieldOf } from "../../input/field.js";
|
|
3
|
+
import { TListNavigationPlugin } from "../../list/navigation/navigation.plugin.js";
|
|
4
|
+
import { TTypeahead, itemText } from "../../list/typeahead.js";
|
|
5
|
+
import { TSelectOnlyKeyboardStrategy } from "./strategies/select-only.strategy.js";
|
|
6
|
+
import { TEditableKeyboardStrategy } from "./strategies/editable.strategy.js";
|
|
7
|
+
import { batchOf, selectOf, selectionOf } from "@soxa-ui/core";
|
|
8
|
+
//#region src/custom/select/keyboard/keyboard.plugin.ts
|
|
9
|
+
/**
|
|
10
|
+
* TSelectKeyboardPlugin — клавиатура поля выбора по паттерну APG Combobox.
|
|
11
|
+
*
|
|
12
|
+
* Общая механика — подписка на `keydown`, привязка к коллекции, учёт
|
|
13
|
+
* подсветки, циклический сдвиг, пропуск недоступных опций — в
|
|
14
|
+
* `TListNavigationPlugin`. Что делают конкретные клавиши, решает выбранная
|
|
15
|
+
* стратегия (`strategies/`):
|
|
16
|
+
* `TSelectOnlyKeyboardStrategy` и `TEditableKeyboardStrategy` — обе поверх
|
|
17
|
+
* общей части `TSelectKeyboardStrategy`. Плагин сам не проверяет
|
|
18
|
+
* `owner.editable` нигде — режим выражен подпиской на `change:editable`,
|
|
19
|
+
* которая переключает стратегию, а не веткой внутри обработчика.
|
|
20
|
+
*
|
|
21
|
+
* Ключевое свойство паттерна: **DOM-фокус никогда не уходит с поля**. Поэтому
|
|
22
|
+
* `keydown` слушается на корне Select, а не на списке, и панель может быть
|
|
23
|
+
* телепортирована куда угодно — на навигацию это не влияет. Подсветку для
|
|
24
|
+
* скринридера передаёт `aria-activedescendant` на поле.
|
|
25
|
+
*
|
|
26
|
+
* Слушатель висит на корне, но клавишу комбобокс берёт только с `<input>`
|
|
27
|
+
* поля. До корня всплывают и клавиши кнопки очистки, крестиков тегов и
|
|
28
|
+
* содержимого слотов — что с ними делать, эти элементы знают сами: кнопка
|
|
29
|
+
* делает из Enter и пробела клик. Правило отвечает на вопрос «чья клавиша», а
|
|
30
|
+
* не «какая», исключений нет: с кнопки очистки не работают ни стрелки, ни
|
|
31
|
+
* `Escape`. Проверка цели — здесь, а не в `TListNavigationPlugin`: база общая
|
|
32
|
+
* с ListBox, у которого фокус на самом списке.
|
|
33
|
+
*
|
|
34
|
+
* Набор по первым буквам — правило, общее с меню (`TTypeahead`,
|
|
35
|
+
* `list/typeahead.ts`): следующая за подсвеченной опция на набранное, повтор
|
|
36
|
+
* буквы — по опциям на неё, без совпадения подсветка на месте. Набор живёт,
|
|
37
|
+
* пока открыта панель: закрытие начинает следующий заново, как у меню.
|
|
38
|
+
*
|
|
39
|
+
* Прокрутки здесь нет: к подсвеченной опции и к выбранной список докручивает
|
|
40
|
+
* `TListScrollPlugin` — тот же, что у ListBox и меню, — по событию подсветки
|
|
41
|
+
* этого плагина (`change:highlight`) и по смене выбора.
|
|
42
|
+
*
|
|
43
|
+
* **В окне** (обёртка `Virtual`) клавиши ходят по всем показанным опциям, а
|
|
44
|
+
* подсветка, уведённая к опции вне окна, закрепляет её в рисовании (база).
|
|
45
|
+
* Своего `id` у такой опции нет, пока окно её не нарисует: ссылка
|
|
46
|
+
* `aria-activedescendant` ждёт, когда опция войдёт в документ
|
|
47
|
+
* (`onHighlightedMounted`), — ссылка в пустоту оставила бы скринридер немым.
|
|
48
|
+
*/
|
|
49
|
+
var TSelectKeyboardPlugin = class extends TListNavigationPlugin {
|
|
50
|
+
_owner = null;
|
|
51
|
+
/** `<input>` поля — единственный источник клавиш комбобокса. */
|
|
52
|
+
_input = null;
|
|
53
|
+
_strategy = new TSelectOnlyKeyboardStrategy();
|
|
54
|
+
/** Набор по первым буквам; паузу набора задают опции установки. */
|
|
55
|
+
_typeahead = new TTypeahead();
|
|
56
|
+
install(ctx, options) {
|
|
57
|
+
super.install(ctx, options);
|
|
58
|
+
this._typeahead = new TTypeahead(options?.typeaheadTimeout);
|
|
59
|
+
this._owner = ctx.getInstance() ?? null;
|
|
60
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
61
|
+
elementPlugin?.events.on("ready", (element) => {
|
|
62
|
+
const field = fieldOf(element);
|
|
63
|
+
this._input = field instanceof HTMLInputElement ? field : null;
|
|
64
|
+
});
|
|
65
|
+
elementPlugin?.events.on("removed", () => {
|
|
66
|
+
this._input = null;
|
|
67
|
+
});
|
|
68
|
+
this._syncStrategy();
|
|
69
|
+
this._listenTo(this._owner?.events, "change:editable", () => this._syncStrategy());
|
|
70
|
+
this._listenTo(this._owner?.events, "close", () => {
|
|
71
|
+
this._typeahead.reset();
|
|
72
|
+
this.clearHighlight();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
76
|
+
super.destroy();
|
|
77
|
+
this._owner = null;
|
|
78
|
+
this._input = null;
|
|
79
|
+
}
|
|
80
|
+
/** Стратегия по режиму `editable` — выбор класса, а не проверка внутри. */
|
|
81
|
+
_syncStrategy() {
|
|
82
|
+
this._strategy = this._owner?.editable ? new TEditableKeyboardStrategy() : new TSelectOnlyKeyboardStrategy();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Подсветка сама по открытию не появляется — только по клавиатуре (см.
|
|
86
|
+
* `highlightSelected`, вызываемый из стратегий). Но раз подсветка может
|
|
87
|
+
* быть выставлена, а выдача — сузиться под отбором (`filter.query`),
|
|
88
|
+
* откуда бы он ни пришёл — из ввода в поле или из кода, — нужно следить,
|
|
89
|
+
* чтобы она не осталась на опции, которой на экране больше нет. Тогда
|
|
90
|
+
* `Enter` выбрал бы скрытое, а `aria-activedescendant` указывал бы в
|
|
91
|
+
* пустоту, поэтому подсветка переезжает на первую из оставшихся.
|
|
92
|
+
*
|
|
93
|
+
* Чинит это сам плагин, а не тот, кто поменял отбор: подсветка — его
|
|
94
|
+
* состояние, и знать о ней отбору незачем.
|
|
95
|
+
*/
|
|
96
|
+
onEngineBound(engine) {
|
|
97
|
+
this._listenTo(batchOf(engine)?.events, "change:shown", () => {
|
|
98
|
+
if (this._highlightedUid == null) return;
|
|
99
|
+
if (this.indexOf(this._highlightedUid) !== -1) return;
|
|
100
|
+
const first = this.items()[0];
|
|
101
|
+
if (first) this.highlight(first.uid);
|
|
102
|
+
else this.clearHighlight();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/** Видимая подсветка сменилась — ссылка поля за ней. */
|
|
106
|
+
onHighlightChanged(_uid) {
|
|
107
|
+
this._refer();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Подсвеченная опция вошла в документ: окно дорисовало её уже после
|
|
111
|
+
* подсветки. Теперь у неё есть `id` этого монтирования — на него ссылка.
|
|
112
|
+
*/
|
|
113
|
+
onHighlightedMounted(_uid) {
|
|
114
|
+
this._refer();
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Набор подсвеченной опции сменился — с ним мог смениться её `id` (`id`
|
|
118
|
+
* опции в `TIdPlugin` задали, сменили или сняли): ссылка поля за ним. Подсветка та
|
|
119
|
+
* же, и прокручивать к опции снова незачем.
|
|
120
|
+
*/
|
|
121
|
+
onHighlightedAriaChanged(_uid) {
|
|
122
|
+
this._refer();
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* `aria-activedescendant` поля — на `id` подсвеченной опции, пока она в
|
|
126
|
+
* документе (`highlightedId` базы): фокус у комбобокса на поле. Опция вне
|
|
127
|
+
* окна своего `id` не имеет, а оставшийся от прошлого монтирования указывал
|
|
128
|
+
* бы в пустоту — тогда ссылки нет, пока окно опцию не нарисует
|
|
129
|
+
* (`onHighlightedMounted`). `id` опции пишет `TOptionIdsPlugin`.
|
|
130
|
+
*/
|
|
131
|
+
_refer() {
|
|
132
|
+
this._owner?.field.aria.add("aria-activedescendant", this.highlightedId());
|
|
133
|
+
}
|
|
134
|
+
onKeyDown(e) {
|
|
135
|
+
if (e.target !== this._input) return;
|
|
136
|
+
const owner = this._owner;
|
|
137
|
+
if (!owner) return;
|
|
138
|
+
if (owner.open) this._strategy.handleOpen(e, owner, this);
|
|
139
|
+
else this._strategy.handleClosed(e, owner, this);
|
|
140
|
+
}
|
|
141
|
+
navigate(step) {
|
|
142
|
+
this.move(step);
|
|
143
|
+
}
|
|
144
|
+
jumpTo(edge) {
|
|
145
|
+
this.highlightEdge(edge);
|
|
146
|
+
}
|
|
147
|
+
chooseHighlighted() {
|
|
148
|
+
if (this._highlightedUid == null) return;
|
|
149
|
+
const item = this.itemByUid(this._highlightedUid);
|
|
150
|
+
if (item) selectOf(this._engine)?.chooseItem(item);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Буква набора по первым буквам: подсветка — на опцию, которую нашёл
|
|
154
|
+
* набор, а нет такой — остаётся на месте. Подсветки нет (панель открыла
|
|
155
|
+
* эта же буква) — поиск с первой опции.
|
|
156
|
+
*/
|
|
157
|
+
typeaheadTo(char) {
|
|
158
|
+
const current = this._highlightedUid == null ? null : this.itemByUid(this._highlightedUid);
|
|
159
|
+
const match = this._typeahead.next(char, this.items(), current, itemText);
|
|
160
|
+
if (match) this.highlight(match.uid);
|
|
161
|
+
}
|
|
162
|
+
emitClosedEscape() {
|
|
163
|
+
this.events.emit("escape");
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Подсветка встаёт на выбранную опцию — иначе на первую.
|
|
167
|
+
*
|
|
168
|
+
* Публичный метод: стратегии зовут его из закрытия и навигации, а
|
|
169
|
+
* `TEditablePlugin` — при первом открытии панели набором фильтра
|
|
170
|
+
* (`editableMode: 'filter'`), где своей клавиатурной подсказки нет. Клик и
|
|
171
|
+
* любое другое открытие без явного участника подсветку не ставят.
|
|
172
|
+
*/
|
|
173
|
+
highlightSelected() {
|
|
174
|
+
const [selected] = selectionOf(this._engine)?.selected ?? [];
|
|
175
|
+
if (selected && this.indexOf(selected.uid) !== -1) {
|
|
176
|
+
this.highlight(selected.uid);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
this.highlightEdge("first");
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Подсветить первую опцию, в чьём тексте есть `needle` — в любом месте и
|
|
183
|
+
* без учёта регистра. Пустая строка и текст без совпадения снимают
|
|
184
|
+
* подсветку.
|
|
185
|
+
*
|
|
186
|
+
* Так ищет ввод в поле в режиме `search` (`TEditablePlugin`) — как отбор в
|
|
187
|
+
* режиме `filter`. Подсветка и `aria-activedescendant` и для ввода
|
|
188
|
+
* остаются здесь, в одной точке.
|
|
189
|
+
*
|
|
190
|
+
* Набор по первым буквам сюда не ходит: у него свои правила —
|
|
191
|
+
* `typeaheadTo`.
|
|
192
|
+
*/
|
|
193
|
+
highlightByText(needle) {
|
|
194
|
+
if (!needle) {
|
|
195
|
+
this.clearHighlight();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const lower = needle.toLowerCase();
|
|
199
|
+
const match = this.items().find((item) => itemText(item).toLowerCase().includes(lower));
|
|
200
|
+
if (match) this.highlight(match.uid);
|
|
201
|
+
else this.clearHighlight();
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
//#endregion
|
|
205
|
+
export { TSelectKeyboardPlugin };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ISelect } from '@soxa-ui/core';
|
|
2
|
+
import type { ISelectKeyboardHost, ISelectKeyboardStrategy } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* TSelectKeyboardStrategy — общая часть клавиатурной модели Select, одна на
|
|
5
|
+
* оба режима `editable`.
|
|
6
|
+
*
|
|
7
|
+
* Здесь то, что не зависит от режима: открытие стрелками/Enter, жест
|
|
8
|
+
* `Alt+↓`/`Alt+↑` из APG, навигация и закрытие открытой панели. Что
|
|
9
|
+
* добавляется поверх — решают `_extraClosed`/`_extraOpen` наследника
|
|
10
|
+
* (`TSelectOnlyKeyboardStrategy`, `TEditableKeyboardStrategy`): режим выражен
|
|
11
|
+
* выбором класса, а не `if (owner.editable)` внутри общего метода.
|
|
12
|
+
*/
|
|
13
|
+
export declare abstract class TSelectKeyboardStrategy implements ISelectKeyboardStrategy {
|
|
14
|
+
handleClosed(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
15
|
+
handleOpen(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
16
|
+
/** Что режим добавляет к закрытой панели — Home/End/пробел/набор по буквам. */
|
|
17
|
+
protected abstract _extraClosed(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
18
|
+
/** Что режим добавляет к открытой панели. */
|
|
19
|
+
protected abstract _extraOpen(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
20
|
+
/**
|
|
21
|
+
* `Alt+↓` открывает закрытую панель без подсветки — жест APG, одинаковый
|
|
22
|
+
* в обоих режимах.
|
|
23
|
+
*/
|
|
24
|
+
private _altOpen;
|
|
25
|
+
/**
|
|
26
|
+
* `ArrowDown`/`ArrowUp`/`Enter` открывают закрытую панель. `↑` встаёт на
|
|
27
|
+
* последнюю опцию — так пользователь попадает в конец списка одним
|
|
28
|
+
* нажатием, остальные — на выбранную или на первую.
|
|
29
|
+
*/
|
|
30
|
+
private _openCommon;
|
|
31
|
+
/**
|
|
32
|
+
* Открытая панель: стрелки двигают подсветку, `Enter` выбирает,
|
|
33
|
+
* `Escape`/`Tab` закрывают. `Alt+↑` — второй APG-жест: выбирает
|
|
34
|
+
* подсвеченное и закрывает, тем же движением, что и `Enter`.
|
|
35
|
+
*/
|
|
36
|
+
private _navigateOpen;
|
|
37
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//#region src/custom/select/keyboard/strategies/base.strategy.ts
|
|
2
|
+
/**
|
|
3
|
+
* TSelectKeyboardStrategy — общая часть клавиатурной модели Select, одна на
|
|
4
|
+
* оба режима `editable`.
|
|
5
|
+
*
|
|
6
|
+
* Здесь то, что не зависит от режима: открытие стрелками/Enter, жест
|
|
7
|
+
* `Alt+↓`/`Alt+↑` из APG, навигация и закрытие открытой панели. Что
|
|
8
|
+
* добавляется поверх — решают `_extraClosed`/`_extraOpen` наследника
|
|
9
|
+
* (`TSelectOnlyKeyboardStrategy`, `TEditableKeyboardStrategy`): режим выражен
|
|
10
|
+
* выбором класса, а не `if (owner.editable)` внутри общего метода.
|
|
11
|
+
*/
|
|
12
|
+
var TSelectKeyboardStrategy = class {
|
|
13
|
+
handleClosed(e, owner, host) {
|
|
14
|
+
if (!owner.openable) return;
|
|
15
|
+
if (this._altOpen(e, owner)) return;
|
|
16
|
+
if (this._openCommon(e, owner, host)) return;
|
|
17
|
+
this._extraClosed(e, owner, host);
|
|
18
|
+
}
|
|
19
|
+
handleOpen(e, owner, host) {
|
|
20
|
+
if (this._navigateOpen(e, owner, host)) return;
|
|
21
|
+
this._extraOpen(e, owner, host);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `Alt+↓` открывает закрытую панель без подсветки — жест APG, одинаковый
|
|
25
|
+
* в обоих режимах.
|
|
26
|
+
*/
|
|
27
|
+
_altOpen(e, owner) {
|
|
28
|
+
if (!e.altKey || e.key !== "ArrowDown") return false;
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
owner.open = true;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `ArrowDown`/`ArrowUp`/`Enter` открывают закрытую панель. `↑` встаёт на
|
|
35
|
+
* последнюю опцию — так пользователь попадает в конец списка одним
|
|
36
|
+
* нажатием, остальные — на выбранную или на первую.
|
|
37
|
+
*/
|
|
38
|
+
_openCommon(e, owner, host) {
|
|
39
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Enter") return false;
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
owner.open = true;
|
|
42
|
+
if (e.key === "ArrowUp") host.jumpTo("last");
|
|
43
|
+
else host.highlightSelected();
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Открытая панель: стрелки двигают подсветку, `Enter` выбирает,
|
|
48
|
+
* `Escape`/`Tab` закрывают. `Alt+↑` — второй APG-жест: выбирает
|
|
49
|
+
* подсвеченное и закрывает, тем же движением, что и `Enter`.
|
|
50
|
+
*/
|
|
51
|
+
_navigateOpen(e, owner, host) {
|
|
52
|
+
switch (e.key) {
|
|
53
|
+
case "ArrowDown":
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
if (host.highlightedUid == null) host.highlightSelected();
|
|
56
|
+
else host.navigate(1);
|
|
57
|
+
return true;
|
|
58
|
+
case "ArrowUp":
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
if (e.altKey) {
|
|
61
|
+
host.chooseHighlighted();
|
|
62
|
+
owner.open = false;
|
|
63
|
+
} else host.navigate(-1);
|
|
64
|
+
return true;
|
|
65
|
+
case "Enter":
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
host.chooseHighlighted();
|
|
68
|
+
return true;
|
|
69
|
+
case "Escape":
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
owner.open = false;
|
|
72
|
+
return true;
|
|
73
|
+
case "Tab":
|
|
74
|
+
owner.open = false;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { TSelectKeyboardStrategy };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ISelect } from '@soxa-ui/core';
|
|
2
|
+
import { TSelectKeyboardStrategy } from './base.strategy';
|
|
3
|
+
import type { ISelectKeyboardHost } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TEditableKeyboardStrategy — клавиатура `editable` поверх общей части.
|
|
6
|
+
*
|
|
7
|
+
* `Home`/`End`, пробел и печатные символы не перехватываются вовсе — они
|
|
8
|
+
* принадлежат тексту поля. Единственное добавление — `Escape` на уже
|
|
9
|
+
* закрытой панели: сам он ничего не открывает и не выбирает, а сообщает
|
|
10
|
+
* событием, что дальше решает `TEditablePlugin` (двойной Escape и возврат
|
|
11
|
+
* текста, см. `AGENTS.md`).
|
|
12
|
+
*/
|
|
13
|
+
export declare class TEditableKeyboardStrategy extends TSelectKeyboardStrategy {
|
|
14
|
+
protected _extraClosed(e: KeyboardEvent, _owner: ISelect, host: ISelectKeyboardHost): void;
|
|
15
|
+
protected _extraOpen(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TSelectKeyboardStrategy } from "./base.strategy.js";
|
|
2
|
+
//#region src/custom/select/keyboard/strategies/editable.strategy.ts
|
|
3
|
+
/**
|
|
4
|
+
* TEditableKeyboardStrategy — клавиатура `editable` поверх общей части.
|
|
5
|
+
*
|
|
6
|
+
* `Home`/`End`, пробел и печатные символы не перехватываются вовсе — они
|
|
7
|
+
* принадлежат тексту поля. Единственное добавление — `Escape` на уже
|
|
8
|
+
* закрытой панели: сам он ничего не открывает и не выбирает, а сообщает
|
|
9
|
+
* событием, что дальше решает `TEditablePlugin` (двойной Escape и возврат
|
|
10
|
+
* текста, см. `AGENTS.md`).
|
|
11
|
+
*/
|
|
12
|
+
var TEditableKeyboardStrategy = class extends TSelectKeyboardStrategy {
|
|
13
|
+
_extraClosed(e, _owner, host) {
|
|
14
|
+
if (e.key !== "Escape") return;
|
|
15
|
+
host.emitClosedEscape();
|
|
16
|
+
}
|
|
17
|
+
_extraOpen() {}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { TEditableKeyboardStrategy };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { TSelectKeyboardStrategy } from './base.strategy';
|
|
2
|
+
export { TSelectOnlyKeyboardStrategy } from './select-only.strategy';
|
|
3
|
+
export { TEditableKeyboardStrategy } from './editable.strategy';
|
|
4
|
+
export type { ISelectKeyboardHost, ISelectKeyboardStrategy } from './types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ISelect } from '@soxa-ui/core';
|
|
2
|
+
import { TSelectKeyboardStrategy } from './base.strategy';
|
|
3
|
+
import type { ISelectKeyboardHost } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TSelectOnlyKeyboardStrategy — клавиатура select-only поверх общей части.
|
|
6
|
+
*
|
|
7
|
+
* Добавляет то, что в `editable` принадлежит тексту поля: `Home`/`End`,
|
|
8
|
+
* пробел и набор по буквам.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TSelectOnlyKeyboardStrategy extends TSelectKeyboardStrategy {
|
|
11
|
+
protected _extraClosed(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
12
|
+
protected _extraOpen(e: KeyboardEvent, _owner: ISelect, host: ISelectKeyboardHost): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isPrintableKey } from "../../../../utils/isPrintableKey.js";
|
|
2
|
+
import { TSelectKeyboardStrategy } from "./base.strategy.js";
|
|
3
|
+
//#region src/custom/select/keyboard/strategies/select-only.strategy.ts
|
|
4
|
+
/**
|
|
5
|
+
* TSelectOnlyKeyboardStrategy — клавиатура select-only поверх общей части.
|
|
6
|
+
*
|
|
7
|
+
* Добавляет то, что в `editable` принадлежит тексту поля: `Home`/`End`,
|
|
8
|
+
* пробел и набор по буквам.
|
|
9
|
+
*/
|
|
10
|
+
var TSelectOnlyKeyboardStrategy = class extends TSelectKeyboardStrategy {
|
|
11
|
+
_extraClosed(e, owner, host) {
|
|
12
|
+
if (e.key === "Home") {
|
|
13
|
+
e.preventDefault();
|
|
14
|
+
owner.open = true;
|
|
15
|
+
host.jumpTo("first");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (e.key === "End") {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
owner.open = true;
|
|
21
|
+
host.jumpTo("last");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (e.key === " ") {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
owner.open = true;
|
|
27
|
+
host.highlightSelected();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (isPrintableKey(e)) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
owner.open = true;
|
|
33
|
+
host.typeaheadTo(e.key);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
_extraOpen(e, _owner, host) {
|
|
37
|
+
if (e.key === "Home") {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
host.jumpTo("first");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (e.key === "End") {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
host.jumpTo("last");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (e.key === " ") {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
host.chooseHighlighted();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (isPrintableKey(e)) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
host.typeaheadTo(e.key);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { TSelectOnlyKeyboardStrategy };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ISelect } from '@soxa-ui/core';
|
|
2
|
+
import type { TListEdge } from '../../../list/navigation';
|
|
3
|
+
/**
|
|
4
|
+
* Срез клавиатурного плагина, который видят стратегии — не весь его API.
|
|
5
|
+
*
|
|
6
|
+
* Имена намеренно не совпадают с внутренними методами `TSelectKeyboardPlugin`
|
|
7
|
+
* (`move`, `highlightEdge`, …): стратегии — публичный контракт плагина для
|
|
8
|
+
* посторонних классов, а не доступ к его защищённым внутренностям.
|
|
9
|
+
*/
|
|
10
|
+
export interface ISelectKeyboardHost {
|
|
11
|
+
readonly highlightedUid: string | number | null;
|
|
12
|
+
/** Сдвинуть подсветку на `step` с цикличным переходом через край. */
|
|
13
|
+
navigate(step: number): void;
|
|
14
|
+
/** Поставить подсветку на край списка. */
|
|
15
|
+
jumpTo(edge: TListEdge): void;
|
|
16
|
+
/** Подсветка на выбранную опцию — иначе на первую. */
|
|
17
|
+
highlightSelected(): void;
|
|
18
|
+
/** Выбрать подсвеченную опцию. */
|
|
19
|
+
chooseHighlighted(): void;
|
|
20
|
+
/** Буква набора по первым буквам: подсветка — на найденную опцию, нет такой — на месте. */
|
|
21
|
+
typeaheadTo(char: string): void;
|
|
22
|
+
/** Escape нажат на уже закрытой панели — сигнал `TEditablePlugin`. */
|
|
23
|
+
emitClosedEscape(): void;
|
|
24
|
+
}
|
|
25
|
+
/** Клавиатурная модель для одного режима `editable`. */
|
|
26
|
+
export interface ISelectKeyboardStrategy {
|
|
27
|
+
handleClosed(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
28
|
+
handleOpen(e: KeyboardEvent, owner: ISelect, host: ISelectKeyboardHost): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TListNavigationPluginEvents } from '../../list/navigation';
|
|
2
|
+
export interface ISelectKeyboardPluginOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Пауза набора по первым буквам, мс; по умолчанию 500, как у меню.
|
|
5
|
+
*
|
|
6
|
+
* Буквы, набранные быстрее неё, — одно слово: «мо» находит «Москва».
|
|
7
|
+
* После паузы следующая буква начинает набор заново.
|
|
8
|
+
*/
|
|
9
|
+
typeaheadTimeout?: number;
|
|
10
|
+
}
|
|
11
|
+
export type TSelectKeyboardPluginEvents = TListNavigationPluginEvents & {
|
|
12
|
+
/**
|
|
13
|
+
* `Escape` нажат на уже закрытой панели — только в `editable`. Сам плагин
|
|
14
|
+
* ничего не делает: слушает `TEditablePlugin` (двойной Escape и возврат
|
|
15
|
+
* текста).
|
|
16
|
+
*/
|
|
17
|
+
escape: () => void;
|
|
18
|
+
};
|