@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,193 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import type { TEditablePluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TEditablePlugin — реакция на ввод текста в поле Select при `editable: true`.
|
|
6
|
+
*
|
|
7
|
+
* Подписка, а не проверка на каждый ввод: плагин слушает `change:editable` и
|
|
8
|
+
* `change:editableMode` и вешает обработчик `input` только тогда, когда ввод
|
|
9
|
+
* вообще на что-то влияет — `editable: true` и режим не `none`. В остальное
|
|
10
|
+
* время слушателя нет, и никакой логики не выполняется вовсе. Так состояние
|
|
11
|
+
* поля выражено подпиской, а не условием внутри обработчика, который иначе
|
|
12
|
+
* звали бы на каждое нажатие впустую.
|
|
13
|
+
*
|
|
14
|
+
* `editableMode` (см. `TSelect`) — значение с тремя состояниями, а этот плагин
|
|
15
|
+
* — операция над ним, по одной функции на режим:
|
|
16
|
+
*
|
|
17
|
+
* - `search` — {@link _highlight}: подсвечивает первую опцию, чей текст
|
|
18
|
+
* содержит набранное в любом месте, без учёта регистра, — методом
|
|
19
|
+
* клавиатуры (`TSelectKeyboardPlugin.highlightByText`): подсветка и
|
|
20
|
+
* `aria-activedescendant` остаются у неё. Правила набора по первым буквам
|
|
21
|
+
* (`TTypeahead`) сюда не идут: там буквы ищут опцию по началу текста от
|
|
22
|
+
* подсвеченной (WAI-ARIA), а здесь вводят произвольный фрагмент текста.
|
|
23
|
+
* Список остаётся целым, ничего не скрывается.
|
|
24
|
+
* - `filter` — {@link _filter}: отдаёт набранное в `filter.query` коллекции.
|
|
25
|
+
* Отбор уже умеет `TFilterExtension` — сузить выдачу, не трогая хранилище;
|
|
26
|
+
* плагину остаётся передать текст. Отсюда и одна строка вместо второго
|
|
27
|
+
* значения поля: ни ядру, ни шести адаптерам не пришлось ничего узнать.
|
|
28
|
+
*
|
|
29
|
+
* Слушает `input` вложенного `<input>`, а не `keydown`: текст меняется не
|
|
30
|
+
* только с клавиатуры, но и вставкой, автозаполнением, IME или очисткой поля
|
|
31
|
+
* — всё это `input`-событие ловит одинаково. Узел — по общему правилу полей
|
|
32
|
+
* (`fieldOf`), так же, как у `TInputPlugin`, — разметку и адаптеры трогать не
|
|
33
|
+
* пришлось.
|
|
34
|
+
*
|
|
35
|
+
* **Возврат поля** — одна точка (`_returnField`): снимает набранное и отбор и
|
|
36
|
+
* пишет текст возврата в `owner.field.value` — экземпляр `TInput`, которым
|
|
37
|
+
* владеет Select (не `<input>` напрямую: DOM больше нигде здесь не
|
|
38
|
+
* трогается). Закрытие панели её не вызывает (владелец закрывает панель
|
|
39
|
+
* кликом по стрелке, оставляя набранное как есть); точку вызывают два повода:
|
|
40
|
+
*
|
|
41
|
+
* - второй `Escape` на уже закрытой панели (первый только закрывает —
|
|
42
|
+
* событие `escape` шлёт клавиатурная стратегия `TEditableKeyboardStrategy`,
|
|
43
|
+
* слушать `close` напрямую было бы циклом: клавиатура сама зависит от
|
|
44
|
+
* `TSelectKeyboardPlugin`);
|
|
45
|
+
* - `focusout`, когда фокус ушёл и с корня, и с телепортированной панели —
|
|
46
|
+
* границы те же, что у нажатия мимо (`TDismissPlugin.isInside`), и переход
|
|
47
|
+
* внутрь панели ничего не меняет.
|
|
48
|
+
*
|
|
49
|
+
* Смена `editable`/`editableMode` пишет в поле тот же текст возврата: режим
|
|
50
|
+
* сменился, значит набранное и отбор относились к прежнему режиму и больше
|
|
51
|
+
* не актуальны. Никакой умной логики (что оставить, а что сбросить) для
|
|
52
|
+
* этого редкого перехода нет намеренно: сбрасывается всё, как при обычном
|
|
53
|
+
* возврате поля, только отбор — сразу (см. ниже).
|
|
54
|
+
*
|
|
55
|
+
* Выбор сюда не входит: текст выбранного (`single`) и очистку поля
|
|
56
|
+
* (`multiple`) пишет сама `TSelectExtension` — `owner.field.value` меняется
|
|
57
|
+
* реактивно, и вложенный `Input` перерисуется сам. Этому плагину на выбор
|
|
58
|
+
* остаётся сбросить то, что относится только к вводу: набранное (`query`) и
|
|
59
|
+
* отбор (`filter`) — иначе после выбора в `multiple` панель осталась бы
|
|
60
|
+
* сужена прежним запросом.
|
|
61
|
+
*
|
|
62
|
+
* Слушает он для этого событие `choose` расширения `select`, а не
|
|
63
|
+
* `change:selection`. Набор прерывает то же, что безусловно пишет поле, —
|
|
64
|
+
* выбор пользователя (`chooseItem`, `clear`). Смена `value` или состава,
|
|
65
|
+
* закрытие тега во время ввода поле не трогают, и сброс на
|
|
66
|
+
* `change:selection` оставил бы набранное в поле, развернув список целиком.
|
|
67
|
+
*
|
|
68
|
+
* **Отбор снимается, когда закрытая панель догасла.** Набор обычно кончается
|
|
69
|
+
* закрытием панели — выбором в `single`, Tab с поля, нажатием мимо, — а
|
|
70
|
+
* панель гаснет переходом темы и до его конца остаётся на экране. Сними
|
|
71
|
+
* плагин отбор тем же действием, гаснущая панель на миг показала бы весь
|
|
72
|
+
* список и вытянулась бы до его высоты. Поэтому выбор, второй `Escape` и
|
|
73
|
+
* уход фокуса снимают набранное и пишут поле сразу — это поле, а не панель, —
|
|
74
|
+
* а отбор (`filter.query`) снимают, когда панель доиграла свои переходы
|
|
75
|
+
* (`afterTransitions` — то же ожидание, что у замка прокрутки). Закрытая
|
|
76
|
+
* панель показывает то, что показывала. Панель открыта (выбор в `multiple`,
|
|
77
|
+
* `closeOnSelect: false`) или её узла нет (нет `TDismissPlugin`, корень не
|
|
78
|
+
* объявлен, рендер на сервере) — ждать нечего, и отбор снимается сразу.
|
|
79
|
+
* Ожидание одно: новый повод заменяет прежнее.
|
|
80
|
+
*
|
|
81
|
+
* Пока плагин ждёт:
|
|
82
|
+
*
|
|
83
|
+
* - панель открыли снова — отбор снимается сразу: поле уже показывает
|
|
84
|
+
* выбранное или возвращённый текст, и суженная панель не дала бы увидеть
|
|
85
|
+
* остальные опции без нового ввода;
|
|
86
|
+
* - в поле снова печатают — ожидание отменяется до записи набранного: отбор
|
|
87
|
+
* теперь пишет ввод, а открытие панели из него иначе сняло бы только что
|
|
88
|
+
* набранное;
|
|
89
|
+
* - отбор сменил кто-то другой (в `none` отбором ведает приложение) —
|
|
90
|
+
* ожидание отменяется: это уже не тот отбор, который плагин собирался
|
|
91
|
+
* снять;
|
|
92
|
+
* - `destroy()` — отбор снимается сразу: движок снаружи переживает
|
|
93
|
+
* компонент, и ждать исчезания панели больше некому.
|
|
94
|
+
*
|
|
95
|
+
* Смена `editable`/`editableMode` снимает отбор сразу: это не закрытие
|
|
96
|
+
* панели, а отложенная запись стёрла бы отбор, который приложение ставит
|
|
97
|
+
* после перехода в `none`.
|
|
98
|
+
*
|
|
99
|
+
* Реакция на сам ввод (`_handleInput`) слушает DOM-событие `input`
|
|
100
|
+
* вложенного `<input>`, а не `change:value` у `field`: `_returnField` тоже
|
|
101
|
+
* пишет в `field.value`, и слушай плагин это событие, собственная запись
|
|
102
|
+
* возврата запустила бы повторный поиск и открыла панель.
|
|
103
|
+
*/
|
|
104
|
+
export declare class TEditablePlugin extends TBasePlugin<any, TEditablePluginEvents> {
|
|
105
|
+
private _owner;
|
|
106
|
+
private _dismiss;
|
|
107
|
+
private _keyboard;
|
|
108
|
+
private _engine;
|
|
109
|
+
private _input;
|
|
110
|
+
private _listening;
|
|
111
|
+
private _focusListening;
|
|
112
|
+
private _query;
|
|
113
|
+
/** Отмена ожидания, пока закрытая панель догаснет; `null` — плагин не ждёт. */
|
|
114
|
+
private _stopWaiting;
|
|
115
|
+
private readonly _onInput;
|
|
116
|
+
private readonly _onFocusOut;
|
|
117
|
+
install(ctx: IPluginContext): void;
|
|
118
|
+
destroy(): void;
|
|
119
|
+
/** Что сейчас набрано в поле — до выбора или закрытия панели. */
|
|
120
|
+
get query(): string;
|
|
121
|
+
/** Слушаем ввод ровно тогда, когда ему есть на что влиять. */
|
|
122
|
+
private _syncListener;
|
|
123
|
+
private _listen;
|
|
124
|
+
private _unlisten;
|
|
125
|
+
private _handleInput;
|
|
126
|
+
/** `search` — подсветка совпадения, список остаётся целым. */
|
|
127
|
+
private _highlight;
|
|
128
|
+
/**
|
|
129
|
+
* `filter` — скрытие несовпавших.
|
|
130
|
+
*
|
|
131
|
+
* Пустая строка сюда доходит и снимает отбор: в отличие от подсветки,
|
|
132
|
+
* «ничего не набрано» — это состояние, а не отсутствие события.
|
|
133
|
+
*
|
|
134
|
+
* Подсветку `filter` не расставляет по вводу, как `search`: набранное
|
|
135
|
+
* сужает выдачу, а не ищет конкретную опцию. Но у неё нет и своей
|
|
136
|
+
* клавиатурной подсказки, поэтому при первом открытии панель встаёт на
|
|
137
|
+
* выбранное или на первую из отфильтрованных сама, тем же методом, что и
|
|
138
|
+
* стрелка вниз (`TSelectKeyboardPlugin.highlightSelected`). Дальше, пока
|
|
139
|
+
* панель уже открыта, подсветка следит за сузившейся выдачей сама
|
|
140
|
+
* (`onEngineBound` в `TSelectKeyboardPlugin`).
|
|
141
|
+
*/
|
|
142
|
+
private _filter;
|
|
143
|
+
private _open;
|
|
144
|
+
private _setQuery;
|
|
145
|
+
/**
|
|
146
|
+
* Слушаем `focusout`, только пока поле принимает ввод — независимо от
|
|
147
|
+
* `editableMode`: в select-only фокус на панель не переключается вовсе
|
|
148
|
+
* (панель не фокусируемая часть), поэтому там слушать нечего.
|
|
149
|
+
*/
|
|
150
|
+
private _syncFocusListener;
|
|
151
|
+
private _listenFocus;
|
|
152
|
+
private _unlistenFocus;
|
|
153
|
+
/**
|
|
154
|
+
* Фокус ушёл — но не в панель: она телепортирована и лежит вне поддерева
|
|
155
|
+
* поля, поэтому одного `contains()` мало. Границы — те же, что у нажатия
|
|
156
|
+
* мимо: их знает `TDismissPlugin` (корень, панель по пометке, слои выше).
|
|
157
|
+
*/
|
|
158
|
+
private _handleFocusOut;
|
|
159
|
+
/**
|
|
160
|
+
* Единая точка возврата поля: снимает набранное и отбор, пишет текст
|
|
161
|
+
* возврата в `owner.field.value`. Вызывают второй `Escape` на закрытой
|
|
162
|
+
* панели и уход фокуса — см. JSDoc класса. Отбор — когда закрытая панель
|
|
163
|
+
* догаснет.
|
|
164
|
+
*/
|
|
165
|
+
private _returnField;
|
|
166
|
+
/** Текст возврата — в `owner.field.value`; набранное и отбор не трогает. */
|
|
167
|
+
private _writeFieldText;
|
|
168
|
+
/** Сбросить набранное и отбор сразу, не трогая текст поля. */
|
|
169
|
+
private _resetQuery;
|
|
170
|
+
/**
|
|
171
|
+
* Сбросить набранное сразу, а отбор — когда закрытая панель доиграет свои
|
|
172
|
+
* переходы (см. JSDoc класса). Панель открыта или её узла нет — ждать
|
|
173
|
+
* нечего, и отбор снимается сразу. Ожидание одно: новый вызов заменяет
|
|
174
|
+
* прежнее.
|
|
175
|
+
*/
|
|
176
|
+
private _resetQueryAfterPanel;
|
|
177
|
+
/** Снять отбор сейчас; ожидание исчезания панели, если шло, больше не нужно. */
|
|
178
|
+
private _clearFilter;
|
|
179
|
+
/** Плагин ждёт исчезания панели — снять отбор сейчас, не дожидаясь. */
|
|
180
|
+
private _flushFilterReset;
|
|
181
|
+
/** Перестать ждать: отбор остаётся, каким его застали. */
|
|
182
|
+
private _cancelFilterReset;
|
|
183
|
+
private get _filterExtension();
|
|
184
|
+
private get _selectionExtension();
|
|
185
|
+
private get _selectExtension();
|
|
186
|
+
/**
|
|
187
|
+
* Текст, который встаёт в поле при возврате. `multiple` всегда пуст —
|
|
188
|
+
* значение там показывают теги, а не текст поля; `single` — текст
|
|
189
|
+
* выбранного, пусто, если ничего не выбрано.
|
|
190
|
+
*/
|
|
191
|
+
private _fieldText;
|
|
192
|
+
private _selectedText;
|
|
193
|
+
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TCollectionBundlesPlugin } from "../../collection/bundles.plugin.js";
|
|
3
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
4
|
+
import { afterTransitions } from "../../../utils/afterTransitions.js";
|
|
5
|
+
import { TDismissPlugin } from "../../dismiss/dismiss.plugin.js";
|
|
6
|
+
import { fieldOf } from "../../input/field.js";
|
|
7
|
+
import { TSelectKeyboardPlugin } from "../keyboard/keyboard.plugin.js";
|
|
8
|
+
import { filterOf, selectOf, selectionOf } from "@soxa-ui/core";
|
|
9
|
+
//#region src/custom/select/editable/editable.plugin.ts
|
|
10
|
+
/**
|
|
11
|
+
* TEditablePlugin — реакция на ввод текста в поле Select при `editable: true`.
|
|
12
|
+
*
|
|
13
|
+
* Подписка, а не проверка на каждый ввод: плагин слушает `change:editable` и
|
|
14
|
+
* `change:editableMode` и вешает обработчик `input` только тогда, когда ввод
|
|
15
|
+
* вообще на что-то влияет — `editable: true` и режим не `none`. В остальное
|
|
16
|
+
* время слушателя нет, и никакой логики не выполняется вовсе. Так состояние
|
|
17
|
+
* поля выражено подпиской, а не условием внутри обработчика, который иначе
|
|
18
|
+
* звали бы на каждое нажатие впустую.
|
|
19
|
+
*
|
|
20
|
+
* `editableMode` (см. `TSelect`) — значение с тремя состояниями, а этот плагин
|
|
21
|
+
* — операция над ним, по одной функции на режим:
|
|
22
|
+
*
|
|
23
|
+
* - `search` — {@link _highlight}: подсвечивает первую опцию, чей текст
|
|
24
|
+
* содержит набранное в любом месте, без учёта регистра, — методом
|
|
25
|
+
* клавиатуры (`TSelectKeyboardPlugin.highlightByText`): подсветка и
|
|
26
|
+
* `aria-activedescendant` остаются у неё. Правила набора по первым буквам
|
|
27
|
+
* (`TTypeahead`) сюда не идут: там буквы ищут опцию по началу текста от
|
|
28
|
+
* подсвеченной (WAI-ARIA), а здесь вводят произвольный фрагмент текста.
|
|
29
|
+
* Список остаётся целым, ничего не скрывается.
|
|
30
|
+
* - `filter` — {@link _filter}: отдаёт набранное в `filter.query` коллекции.
|
|
31
|
+
* Отбор уже умеет `TFilterExtension` — сузить выдачу, не трогая хранилище;
|
|
32
|
+
* плагину остаётся передать текст. Отсюда и одна строка вместо второго
|
|
33
|
+
* значения поля: ни ядру, ни шести адаптерам не пришлось ничего узнать.
|
|
34
|
+
*
|
|
35
|
+
* Слушает `input` вложенного `<input>`, а не `keydown`: текст меняется не
|
|
36
|
+
* только с клавиатуры, но и вставкой, автозаполнением, IME или очисткой поля
|
|
37
|
+
* — всё это `input`-событие ловит одинаково. Узел — по общему правилу полей
|
|
38
|
+
* (`fieldOf`), так же, как у `TInputPlugin`, — разметку и адаптеры трогать не
|
|
39
|
+
* пришлось.
|
|
40
|
+
*
|
|
41
|
+
* **Возврат поля** — одна точка (`_returnField`): снимает набранное и отбор и
|
|
42
|
+
* пишет текст возврата в `owner.field.value` — экземпляр `TInput`, которым
|
|
43
|
+
* владеет Select (не `<input>` напрямую: DOM больше нигде здесь не
|
|
44
|
+
* трогается). Закрытие панели её не вызывает (владелец закрывает панель
|
|
45
|
+
* кликом по стрелке, оставляя набранное как есть); точку вызывают два повода:
|
|
46
|
+
*
|
|
47
|
+
* - второй `Escape` на уже закрытой панели (первый только закрывает —
|
|
48
|
+
* событие `escape` шлёт клавиатурная стратегия `TEditableKeyboardStrategy`,
|
|
49
|
+
* слушать `close` напрямую было бы циклом: клавиатура сама зависит от
|
|
50
|
+
* `TSelectKeyboardPlugin`);
|
|
51
|
+
* - `focusout`, когда фокус ушёл и с корня, и с телепортированной панели —
|
|
52
|
+
* границы те же, что у нажатия мимо (`TDismissPlugin.isInside`), и переход
|
|
53
|
+
* внутрь панели ничего не меняет.
|
|
54
|
+
*
|
|
55
|
+
* Смена `editable`/`editableMode` пишет в поле тот же текст возврата: режим
|
|
56
|
+
* сменился, значит набранное и отбор относились к прежнему режиму и больше
|
|
57
|
+
* не актуальны. Никакой умной логики (что оставить, а что сбросить) для
|
|
58
|
+
* этого редкого перехода нет намеренно: сбрасывается всё, как при обычном
|
|
59
|
+
* возврате поля, только отбор — сразу (см. ниже).
|
|
60
|
+
*
|
|
61
|
+
* Выбор сюда не входит: текст выбранного (`single`) и очистку поля
|
|
62
|
+
* (`multiple`) пишет сама `TSelectExtension` — `owner.field.value` меняется
|
|
63
|
+
* реактивно, и вложенный `Input` перерисуется сам. Этому плагину на выбор
|
|
64
|
+
* остаётся сбросить то, что относится только к вводу: набранное (`query`) и
|
|
65
|
+
* отбор (`filter`) — иначе после выбора в `multiple` панель осталась бы
|
|
66
|
+
* сужена прежним запросом.
|
|
67
|
+
*
|
|
68
|
+
* Слушает он для этого событие `choose` расширения `select`, а не
|
|
69
|
+
* `change:selection`. Набор прерывает то же, что безусловно пишет поле, —
|
|
70
|
+
* выбор пользователя (`chooseItem`, `clear`). Смена `value` или состава,
|
|
71
|
+
* закрытие тега во время ввода поле не трогают, и сброс на
|
|
72
|
+
* `change:selection` оставил бы набранное в поле, развернув список целиком.
|
|
73
|
+
*
|
|
74
|
+
* **Отбор снимается, когда закрытая панель догасла.** Набор обычно кончается
|
|
75
|
+
* закрытием панели — выбором в `single`, Tab с поля, нажатием мимо, — а
|
|
76
|
+
* панель гаснет переходом темы и до его конца остаётся на экране. Сними
|
|
77
|
+
* плагин отбор тем же действием, гаснущая панель на миг показала бы весь
|
|
78
|
+
* список и вытянулась бы до его высоты. Поэтому выбор, второй `Escape` и
|
|
79
|
+
* уход фокуса снимают набранное и пишут поле сразу — это поле, а не панель, —
|
|
80
|
+
* а отбор (`filter.query`) снимают, когда панель доиграла свои переходы
|
|
81
|
+
* (`afterTransitions` — то же ожидание, что у замка прокрутки). Закрытая
|
|
82
|
+
* панель показывает то, что показывала. Панель открыта (выбор в `multiple`,
|
|
83
|
+
* `closeOnSelect: false`) или её узла нет (нет `TDismissPlugin`, корень не
|
|
84
|
+
* объявлен, рендер на сервере) — ждать нечего, и отбор снимается сразу.
|
|
85
|
+
* Ожидание одно: новый повод заменяет прежнее.
|
|
86
|
+
*
|
|
87
|
+
* Пока плагин ждёт:
|
|
88
|
+
*
|
|
89
|
+
* - панель открыли снова — отбор снимается сразу: поле уже показывает
|
|
90
|
+
* выбранное или возвращённый текст, и суженная панель не дала бы увидеть
|
|
91
|
+
* остальные опции без нового ввода;
|
|
92
|
+
* - в поле снова печатают — ожидание отменяется до записи набранного: отбор
|
|
93
|
+
* теперь пишет ввод, а открытие панели из него иначе сняло бы только что
|
|
94
|
+
* набранное;
|
|
95
|
+
* - отбор сменил кто-то другой (в `none` отбором ведает приложение) —
|
|
96
|
+
* ожидание отменяется: это уже не тот отбор, который плагин собирался
|
|
97
|
+
* снять;
|
|
98
|
+
* - `destroy()` — отбор снимается сразу: движок снаружи переживает
|
|
99
|
+
* компонент, и ждать исчезания панели больше некому.
|
|
100
|
+
*
|
|
101
|
+
* Смена `editable`/`editableMode` снимает отбор сразу: это не закрытие
|
|
102
|
+
* панели, а отложенная запись стёрла бы отбор, который приложение ставит
|
|
103
|
+
* после перехода в `none`.
|
|
104
|
+
*
|
|
105
|
+
* Реакция на сам ввод (`_handleInput`) слушает DOM-событие `input`
|
|
106
|
+
* вложенного `<input>`, а не `change:value` у `field`: `_returnField` тоже
|
|
107
|
+
* пишет в `field.value`, и слушай плагин это событие, собственная запись
|
|
108
|
+
* возврата запустила бы повторный поиск и открыла панель.
|
|
109
|
+
*/
|
|
110
|
+
var TEditablePlugin = class extends TBasePlugin {
|
|
111
|
+
_owner = null;
|
|
112
|
+
_dismiss = null;
|
|
113
|
+
_keyboard = null;
|
|
114
|
+
_engine = null;
|
|
115
|
+
_input = null;
|
|
116
|
+
_listening = false;
|
|
117
|
+
_focusListening = false;
|
|
118
|
+
_query = "";
|
|
119
|
+
/** Отмена ожидания, пока закрытая панель догаснет; `null` — плагин не ждёт. */
|
|
120
|
+
_stopWaiting = null;
|
|
121
|
+
_onInput = this._handleInput.bind(this);
|
|
122
|
+
_onFocusOut = this._handleFocusOut.bind(this);
|
|
123
|
+
install(ctx) {
|
|
124
|
+
super.install(ctx);
|
|
125
|
+
this._owner = ctx.getInstance() ?? null;
|
|
126
|
+
this._keyboard = ctx.get(TSelectKeyboardPlugin) ?? null;
|
|
127
|
+
this._dismiss = ctx.get(TDismissPlugin) ?? null;
|
|
128
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
129
|
+
elementPlugin?.events.on("ready", () => {
|
|
130
|
+
const el = elementPlugin.element;
|
|
131
|
+
if (!el) return;
|
|
132
|
+
const field = fieldOf(el);
|
|
133
|
+
this._input = field instanceof HTMLInputElement ? field : null;
|
|
134
|
+
this._syncListener();
|
|
135
|
+
this._syncFocusListener();
|
|
136
|
+
});
|
|
137
|
+
elementPlugin?.events.on("removed", () => {
|
|
138
|
+
this._unlisten();
|
|
139
|
+
this._unlistenFocus();
|
|
140
|
+
this._input = null;
|
|
141
|
+
});
|
|
142
|
+
ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => {
|
|
143
|
+
this._engine = engine;
|
|
144
|
+
this._listenTo(this._selectExtension?.events, "choose", () => {
|
|
145
|
+
if (this._owner?.editable) this._resetQueryAfterPanel();
|
|
146
|
+
});
|
|
147
|
+
this._listenTo(this._filterExtension?.events, "change:query", () => this._cancelFilterReset());
|
|
148
|
+
});
|
|
149
|
+
this._listenTo(this._owner?.events, "change:editable", () => {
|
|
150
|
+
this._syncListener();
|
|
151
|
+
this._syncFocusListener();
|
|
152
|
+
this._resetQuery();
|
|
153
|
+
this._writeFieldText();
|
|
154
|
+
});
|
|
155
|
+
this._listenTo(this._owner?.events, "change:editableMode", () => {
|
|
156
|
+
this._syncListener();
|
|
157
|
+
this._resetQuery();
|
|
158
|
+
this._writeFieldText();
|
|
159
|
+
});
|
|
160
|
+
this._listenTo(this._owner?.events, "change:open", ({ newValue: open }) => {
|
|
161
|
+
if (open) this._flushFilterReset();
|
|
162
|
+
});
|
|
163
|
+
this._keyboard?.events.on("escape", () => this._returnField());
|
|
164
|
+
}
|
|
165
|
+
destroy() {
|
|
166
|
+
this._flushFilterReset();
|
|
167
|
+
this._unlisten();
|
|
168
|
+
this._unlistenFocus();
|
|
169
|
+
this._input = null;
|
|
170
|
+
this._owner = null;
|
|
171
|
+
this._keyboard = null;
|
|
172
|
+
this._dismiss = null;
|
|
173
|
+
this._engine = null;
|
|
174
|
+
super.destroy();
|
|
175
|
+
}
|
|
176
|
+
/** Что сейчас набрано в поле — до выбора или закрытия панели. */
|
|
177
|
+
get query() {
|
|
178
|
+
return this._query;
|
|
179
|
+
}
|
|
180
|
+
/** Слушаем ввод ровно тогда, когда ему есть на что влиять. */
|
|
181
|
+
_syncListener() {
|
|
182
|
+
const owner = this._owner;
|
|
183
|
+
if (Boolean(owner?.editable) && owner?.editableMode !== "none") this._listen();
|
|
184
|
+
else this._unlisten();
|
|
185
|
+
}
|
|
186
|
+
_listen() {
|
|
187
|
+
if (this._listening || !this._input) return;
|
|
188
|
+
this._input.addEventListener("input", this._onInput);
|
|
189
|
+
this._listening = true;
|
|
190
|
+
}
|
|
191
|
+
_unlisten() {
|
|
192
|
+
if (!this._listening) return;
|
|
193
|
+
this._input?.removeEventListener("input", this._onInput);
|
|
194
|
+
this._listening = false;
|
|
195
|
+
}
|
|
196
|
+
_handleInput() {
|
|
197
|
+
this._cancelFilterReset();
|
|
198
|
+
const value = this._input?.value ?? "";
|
|
199
|
+
this._setQuery(value);
|
|
200
|
+
if (this._owner?.editableMode === "filter") this._filter(value);
|
|
201
|
+
else this._highlight(value);
|
|
202
|
+
}
|
|
203
|
+
/** `search` — подсветка совпадения, список остаётся целым. */
|
|
204
|
+
_highlight(value) {
|
|
205
|
+
if (!value) return;
|
|
206
|
+
this._open();
|
|
207
|
+
this._keyboard?.highlightByText(value);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* `filter` — скрытие несовпавших.
|
|
211
|
+
*
|
|
212
|
+
* Пустая строка сюда доходит и снимает отбор: в отличие от подсветки,
|
|
213
|
+
* «ничего не набрано» — это состояние, а не отсутствие события.
|
|
214
|
+
*
|
|
215
|
+
* Подсветку `filter` не расставляет по вводу, как `search`: набранное
|
|
216
|
+
* сужает выдачу, а не ищет конкретную опцию. Но у неё нет и своей
|
|
217
|
+
* клавиатурной подсказки, поэтому при первом открытии панель встаёт на
|
|
218
|
+
* выбранное или на первую из отфильтрованных сама, тем же методом, что и
|
|
219
|
+
* стрелка вниз (`TSelectKeyboardPlugin.highlightSelected`). Дальше, пока
|
|
220
|
+
* панель уже открыта, подсветка следит за сузившейся выдачей сама
|
|
221
|
+
* (`onEngineBound` в `TSelectKeyboardPlugin`).
|
|
222
|
+
*/
|
|
223
|
+
_filter(value) {
|
|
224
|
+
const filter = this._filterExtension;
|
|
225
|
+
if (!filter) return;
|
|
226
|
+
filter.query = value;
|
|
227
|
+
if (!value) return;
|
|
228
|
+
const wasOpen = Boolean(this._owner?.open);
|
|
229
|
+
this._open();
|
|
230
|
+
if (!wasOpen) this._keyboard?.highlightSelected();
|
|
231
|
+
}
|
|
232
|
+
_open() {
|
|
233
|
+
if (this._owner) this._owner.open = true;
|
|
234
|
+
}
|
|
235
|
+
_setQuery(value) {
|
|
236
|
+
const oldQuery = this.query;
|
|
237
|
+
if (this._query === value) return;
|
|
238
|
+
this._query = value;
|
|
239
|
+
this.events.emit("change:query", {
|
|
240
|
+
newValue: value,
|
|
241
|
+
oldValue: oldQuery
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Слушаем `focusout`, только пока поле принимает ввод — независимо от
|
|
246
|
+
* `editableMode`: в select-only фокус на панель не переключается вовсе
|
|
247
|
+
* (панель не фокусируемая часть), поэтому там слушать нечего.
|
|
248
|
+
*/
|
|
249
|
+
_syncFocusListener() {
|
|
250
|
+
if (this._owner?.editable) this._listenFocus();
|
|
251
|
+
else this._unlistenFocus();
|
|
252
|
+
}
|
|
253
|
+
_listenFocus() {
|
|
254
|
+
if (this._focusListening || !this._input) return;
|
|
255
|
+
this._input.addEventListener("focusout", this._onFocusOut);
|
|
256
|
+
this._focusListening = true;
|
|
257
|
+
}
|
|
258
|
+
_unlistenFocus() {
|
|
259
|
+
if (!this._focusListening) return;
|
|
260
|
+
this._input?.removeEventListener("focusout", this._onFocusOut);
|
|
261
|
+
this._focusListening = false;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Фокус ушёл — но не в панель: она телепортирована и лежит вне поддерева
|
|
265
|
+
* поля, поэтому одного `contains()` мало. Границы — те же, что у нажатия
|
|
266
|
+
* мимо: их знает `TDismissPlugin` (корень, панель по пометке, слои выше).
|
|
267
|
+
*/
|
|
268
|
+
_handleFocusOut(event) {
|
|
269
|
+
if (this._dismiss?.isInside(event.relatedTarget)) return;
|
|
270
|
+
this._returnField();
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Единая точка возврата поля: снимает набранное и отбор, пишет текст
|
|
274
|
+
* возврата в `owner.field.value`. Вызывают второй `Escape` на закрытой
|
|
275
|
+
* панели и уход фокуса — см. JSDoc класса. Отбор — когда закрытая панель
|
|
276
|
+
* догаснет.
|
|
277
|
+
*/
|
|
278
|
+
_returnField() {
|
|
279
|
+
this._resetQueryAfterPanel();
|
|
280
|
+
this._writeFieldText();
|
|
281
|
+
}
|
|
282
|
+
/** Текст возврата — в `owner.field.value`; набранное и отбор не трогает. */
|
|
283
|
+
_writeFieldText() {
|
|
284
|
+
if (this._owner) this._owner.field.value = this._fieldText();
|
|
285
|
+
}
|
|
286
|
+
/** Сбросить набранное и отбор сразу, не трогая текст поля. */
|
|
287
|
+
_resetQuery() {
|
|
288
|
+
this._setQuery("");
|
|
289
|
+
this._clearFilter();
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Сбросить набранное сразу, а отбор — когда закрытая панель доиграет свои
|
|
293
|
+
* переходы (см. JSDoc класса). Панель открыта или её узла нет — ждать
|
|
294
|
+
* нечего, и отбор снимается сразу. Ожидание одно: новый вызов заменяет
|
|
295
|
+
* прежнее.
|
|
296
|
+
*/
|
|
297
|
+
_resetQueryAfterPanel() {
|
|
298
|
+
const panel = this._owner?.open ? null : this._dismiss?.findPanel() ?? null;
|
|
299
|
+
if (!panel) {
|
|
300
|
+
this._resetQuery();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this._setQuery("");
|
|
304
|
+
this._cancelFilterReset();
|
|
305
|
+
this._stopWaiting = afterTransitions(panel, () => {
|
|
306
|
+
this._stopWaiting = null;
|
|
307
|
+
this._filterExtension?.clear();
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
/** Снять отбор сейчас; ожидание исчезания панели, если шло, больше не нужно. */
|
|
311
|
+
_clearFilter() {
|
|
312
|
+
this._cancelFilterReset();
|
|
313
|
+
this._filterExtension?.clear();
|
|
314
|
+
}
|
|
315
|
+
/** Плагин ждёт исчезания панели — снять отбор сейчас, не дожидаясь. */
|
|
316
|
+
_flushFilterReset() {
|
|
317
|
+
if (this._stopWaiting) this._clearFilter();
|
|
318
|
+
}
|
|
319
|
+
/** Перестать ждать: отбор остаётся, каким его застали. */
|
|
320
|
+
_cancelFilterReset() {
|
|
321
|
+
this._stopWaiting?.();
|
|
322
|
+
this._stopWaiting = null;
|
|
323
|
+
}
|
|
324
|
+
get _filterExtension() {
|
|
325
|
+
return filterOf(this._engine);
|
|
326
|
+
}
|
|
327
|
+
get _selectionExtension() {
|
|
328
|
+
return selectionOf(this._engine);
|
|
329
|
+
}
|
|
330
|
+
get _selectExtension() {
|
|
331
|
+
return selectOf(this._engine);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Текст, который встаёт в поле при возврате. `multiple` всегда пуст —
|
|
335
|
+
* значение там показывают теги, а не текст поля; `single` — текст
|
|
336
|
+
* выбранного, пусто, если ничего не выбрано.
|
|
337
|
+
*/
|
|
338
|
+
_fieldText() {
|
|
339
|
+
if (this._selectionExtension?.multiple) return "";
|
|
340
|
+
return this._selectedText();
|
|
341
|
+
}
|
|
342
|
+
_selectedText() {
|
|
343
|
+
return this._selectExtension?.text ?? "";
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
//#endregion
|
|
347
|
+
export { TEditablePlugin };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TValuePayload } from '@soxa-ui/core';
|
|
2
|
+
import type { TPluginEvents } from '../../../base';
|
|
3
|
+
export type TEditablePluginEvents = TPluginEvents & {
|
|
4
|
+
/** change:query — сменился текст, набранный в поле */
|
|
5
|
+
'change:query': (payload: TValuePayload<string>) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TSelectIdsPlugin — связка «поле ↔ список» Select в документе.
|
|
5
|
+
*
|
|
6
|
+
* `id` списка — в `listAria`, который разметка раскладывает на список, и
|
|
7
|
+
* ссылка на него `aria-controls` — в `aria` поля (`field.aria`): связку со
|
|
8
|
+
* списком объявляет поле с `role="combobox"`, а не корень Select. Список
|
|
9
|
+
* существует всегда — в отличие от панели у Tabs, которой может и не быть, —
|
|
10
|
+
* поэтому ссылка стоит всегда.
|
|
11
|
+
*
|
|
12
|
+
* Сторона опций — у самих опций (`TOptionIdsPlugin`, общий с элементами
|
|
13
|
+
* ListBox): у каждой своё монтирование. `aria-activedescendant` берёт `id`
|
|
14
|
+
* подсвеченной опции из её набора (`TSelectKeyboardPlugin`).
|
|
15
|
+
*
|
|
16
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
17
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
18
|
+
* установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
|
|
19
|
+
*/
|
|
20
|
+
export declare class TSelectIdsPlugin extends TBasePlugin {
|
|
21
|
+
install(ctx: IPluginContext): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
//#region src/custom/select/ids/ids.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TSelectIdsPlugin — связка «поле ↔ список» Select в документе.
|
|
5
|
+
*
|
|
6
|
+
* `id` списка — в `listAria`, который разметка раскладывает на список, и
|
|
7
|
+
* ссылка на него `aria-controls` — в `aria` поля (`field.aria`): связку со
|
|
8
|
+
* списком объявляет поле с `role="combobox"`, а не корень Select. Список
|
|
9
|
+
* существует всегда — в отличие от панели у Tabs, которой может и не быть, —
|
|
10
|
+
* поэтому ссылка стоит всегда.
|
|
11
|
+
*
|
|
12
|
+
* Сторона опций — у самих опций (`TOptionIdsPlugin`, общий с элементами
|
|
13
|
+
* ListBox): у каждой своё монтирование. `aria-activedescendant` берёт `id`
|
|
14
|
+
* подсвеченной опции из её набора (`TSelectKeyboardPlugin`).
|
|
15
|
+
*
|
|
16
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
17
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
18
|
+
* установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
|
|
19
|
+
*/
|
|
20
|
+
var TSelectIdsPlugin = class extends TBasePlugin {
|
|
21
|
+
install(ctx) {
|
|
22
|
+
super.install(ctx);
|
|
23
|
+
const select = ctx.getInstance();
|
|
24
|
+
if (!select) return;
|
|
25
|
+
const listId = ctx.createId("list");
|
|
26
|
+
select.listAria.add("id", listId);
|
|
27
|
+
select.field.aria.add("aria-controls", listId);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TSelectIdsPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ids.plugin';
|