@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,276 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
3
|
+
import { isAppleTouch } from "../../../utils/isAppleTouch.js";
|
|
4
|
+
import { formatPartsOf, rowOf, rowSelection, segmentOf, segmentsOf, touchedSegments } from "../parts.js";
|
|
5
|
+
//#region src/custom/date-input/touch/touch.plugin.ts
|
|
6
|
+
/**
|
|
7
|
+
* Режим по указателю нажатия: палец и перо делают части редактируемыми, мышь —
|
|
8
|
+
* нет. Нажатие без указателя (`pointerType` пуст у нажатия, которое браузер
|
|
9
|
+
* собрал сам) режим не меняет.
|
|
10
|
+
*/
|
|
11
|
+
var POINTER_MODES = /* @__PURE__ */ new Map([
|
|
12
|
+
["touch", true],
|
|
13
|
+
["pen", true],
|
|
14
|
+
["mouse", false]
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Атрибуты редактируемой части без проверки орфографии и автозамены —
|
|
18
|
+
* подсказки клавиатуры шли бы композицией.
|
|
19
|
+
*/
|
|
20
|
+
var EDITABLE_ATTRS = {
|
|
21
|
+
contenteditable: "true",
|
|
22
|
+
spellcheck: "false",
|
|
23
|
+
autocorrect: "off"
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Экранная клавиатура части: цифры — у числа, буквы — у слова (период суток
|
|
27
|
+
* набирают буквой, `A` или `P`).
|
|
28
|
+
*/
|
|
29
|
+
var INPUT_MODES = {
|
|
30
|
+
numeric: "numeric",
|
|
31
|
+
word: "text"
|
|
32
|
+
};
|
|
33
|
+
/** Роль части на сенсорных устройствах Apple: счётчик VoiceOver на iOS не фокусирует. */
|
|
34
|
+
var APPLE_TOUCH_ROLE = "textbox";
|
|
35
|
+
/**
|
|
36
|
+
* Правки композиции в Safari: по её окончании браузер убирает её текст и
|
|
37
|
+
* вставляет итог. Гасятся без набора — набранное в композиции ядро получает на
|
|
38
|
+
* `compositionend`, одним путём во всех браузерах.
|
|
39
|
+
*/
|
|
40
|
+
var COMPOSITION_EDITS = /* @__PURE__ */ new Set(["deleteCompositionText", "insertFromComposition"]);
|
|
41
|
+
/**
|
|
42
|
+
* TDateInputTouchPlugin — сенсорный режим поля даты: на касание части
|
|
43
|
+
* редактируемые, и дату вводят с экранной клавиатуры.
|
|
44
|
+
*
|
|
45
|
+
* На компьютере части нередактируемые — так дату целиком выделяет протяжка
|
|
46
|
+
* мышью. Но экранная клавиатура открывается только над редактируемым узлом.
|
|
47
|
+
* Поэтому **режим выбирает нажатие**, а не устройство: палец и перо
|
|
48
|
+
* (`pointerType`) делают части редактируемыми (`contenteditable`; клавиатура
|
|
49
|
+
* цифр, у периода суток — букв: его набирают буквой), мышь — снова нет. Смена
|
|
50
|
+
* вида поля, точности времени и локали меняет состав частей, и наборы
|
|
51
|
+
* пересчитываются: новым частям — те же атрибуты. На ноутбуке с сенсорным экраном
|
|
52
|
+
* мышь сохраняет протяжку, а палец получает клавиатуру. Режим меняется на
|
|
53
|
+
* `pointerdown`, раньше фокуса: фокус браузер переводит после конца касания, а
|
|
54
|
+
* нажатие мышью начинает протяжку уже по нередактируемым частям. Атрибуты
|
|
55
|
+
* идут значениями в наборы частей (`segmentSets`), разметку рисует фреймворк;
|
|
56
|
+
* сервер рисует части нередактируемыми.
|
|
57
|
+
*
|
|
58
|
+
* **Текст части пишет ядро.** Правка браузера (`beforeinput`) гасится и
|
|
59
|
+
* становится командой: вставка — знаки по одному, как клавиши (`typeKey`;
|
|
60
|
+
* по выделению — вместо задетых частей), стирание назад — цифра
|
|
61
|
+
* (`eraseDigit`), другое удаление — часть или задетые выделением части. Чего
|
|
62
|
+
* отменить нельзя — композиции (IME, клавиатуры Android) — браузер пишет в
|
|
63
|
+
* часть сам; по `compositionend` набранное уходит ядру, а часть получает текст
|
|
64
|
+
* ядра обратно. Так же — после правки, которую браузер всё же сделал мимо
|
|
65
|
+
* отмены (SwiftKey стирает и после погашенного Backspace).
|
|
66
|
+
*
|
|
67
|
+
* **Сенсорные устройства Apple.** VoiceOver на iOS счётчик (`spinbutton`) не
|
|
68
|
+
* фокусирует — роль частей там `textbox`; а групп не объявляет — имя поля
|
|
69
|
+
* входит в имя каждой части: ссылкой на себя и на подпись поля
|
|
70
|
+
* (`aria-labelledby`), у поля, названного строкой, — строкой («день, Дата
|
|
71
|
+
* рождения»). Устройство плагин узнаёт после `ready`, у документа корня, и
|
|
72
|
+
* сервер рисует счётчики.
|
|
73
|
+
*
|
|
74
|
+
* Клавиши, которые экранная клавиатура шлёт как клавиши (`keydown` с цифрой),
|
|
75
|
+
* исполняет плагин клавиатуры, и правки за ними браузер не делает: клавиша
|
|
76
|
+
* погашена.
|
|
77
|
+
*/
|
|
78
|
+
var TDateInputTouchPlugin = class extends TBasePlugin {
|
|
79
|
+
_owner = null;
|
|
80
|
+
_root = null;
|
|
81
|
+
/** Последнее нажатие на поле — пальцем или пером: части редактируемые */
|
|
82
|
+
_touch = false;
|
|
83
|
+
/** Сенсорное устройство Apple: роль частей — `textbox`, имя поля — в имени части */
|
|
84
|
+
_appleTouch = false;
|
|
85
|
+
/** Идёт композиция: её текст в части вернёт `compositionend` */
|
|
86
|
+
_composing = false;
|
|
87
|
+
install(ctx) {
|
|
88
|
+
super.install(ctx);
|
|
89
|
+
this._owner = ctx.getInstance() ?? null;
|
|
90
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
91
|
+
elementPlugin?.events.on("ready", (element) => this._bind(element));
|
|
92
|
+
elementPlugin?.events.on("removed", () => this._bind(null));
|
|
93
|
+
this._listenTo(this._owner?.events, "change:disabled", this._syncEditable);
|
|
94
|
+
this._listenTo(this._owner?.events, "change:readonly", this._syncEditable);
|
|
95
|
+
this._listenTo(this._owner?.events, "change:aria", this._syncAppleTouch);
|
|
96
|
+
for (const event of [
|
|
97
|
+
"change:kind",
|
|
98
|
+
"change:timePrecision",
|
|
99
|
+
"change:locale"
|
|
100
|
+
]) {
|
|
101
|
+
this._listenTo(this._owner?.events, event, this._syncEditable);
|
|
102
|
+
this._listenTo(this._owner?.events, event, this._syncAppleTouch);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Записанное в наборы частей уходит вместе с плагином: наборы — у поля, а
|
|
107
|
+
* поле переживает монтирование.
|
|
108
|
+
*/
|
|
109
|
+
destroy() {
|
|
110
|
+
this._bind(null);
|
|
111
|
+
this._touch = false;
|
|
112
|
+
this._appleTouch = false;
|
|
113
|
+
this._syncEditable();
|
|
114
|
+
this._syncAppleTouch();
|
|
115
|
+
this._owner = null;
|
|
116
|
+
super.destroy();
|
|
117
|
+
}
|
|
118
|
+
/** Части редактируемые: нажатие пальцем или пером, и поле можно править. */
|
|
119
|
+
get _editable() {
|
|
120
|
+
const owner = this._owner;
|
|
121
|
+
return this._touch && owner !== null && !owner.disabled && !owner.readonly;
|
|
122
|
+
}
|
|
123
|
+
/** Корень сменился — слушатели переезжают; устройство — у документа корня. */
|
|
124
|
+
_bind(root) {
|
|
125
|
+
const previous = this._root;
|
|
126
|
+
previous?.removeEventListener("pointerdown", this._onPointerDown);
|
|
127
|
+
previous?.removeEventListener("beforeinput", this._onBeforeInput);
|
|
128
|
+
previous?.removeEventListener("input", this._onInput);
|
|
129
|
+
previous?.removeEventListener("compositionstart", this._onCompositionStart);
|
|
130
|
+
previous?.removeEventListener("compositionend", this._onCompositionEnd);
|
|
131
|
+
this._root = root;
|
|
132
|
+
this._composing = false;
|
|
133
|
+
const target = root;
|
|
134
|
+
target?.addEventListener("pointerdown", this._onPointerDown);
|
|
135
|
+
target?.addEventListener("beforeinput", this._onBeforeInput);
|
|
136
|
+
target?.addEventListener("input", this._onInput);
|
|
137
|
+
target?.addEventListener("compositionstart", this._onCompositionStart);
|
|
138
|
+
target?.addEventListener("compositionend", this._onCompositionEnd);
|
|
139
|
+
if (!root) return;
|
|
140
|
+
this._appleTouch = isAppleTouch(root.ownerDocument.defaultView?.navigator);
|
|
141
|
+
this._syncAppleTouch();
|
|
142
|
+
}
|
|
143
|
+
/** Нажатие на поле выбирает режим: палец и перо — части редактируемые, мышь — нет. */
|
|
144
|
+
_onPointerDown = (event) => {
|
|
145
|
+
const touch = POINTER_MODES.get(event.pointerType);
|
|
146
|
+
if (touch === void 0 || touch === this._touch) return;
|
|
147
|
+
this._touch = touch;
|
|
148
|
+
this._syncEditable();
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Правка браузера в части гасится и становится командой ядра. Правка
|
|
152
|
+
* приходит только туда, где можно править, — в части, которые плагин сделал
|
|
153
|
+
* редактируемыми.
|
|
154
|
+
*/
|
|
155
|
+
_onBeforeInput = (event) => {
|
|
156
|
+
const owner = this._owner;
|
|
157
|
+
const root = this._root;
|
|
158
|
+
if (!owner || !root || event.defaultPrevented || !this._editable) return;
|
|
159
|
+
const node = segmentOf(owner, root, event.target);
|
|
160
|
+
if (!node) return;
|
|
161
|
+
if (event.inputType === "insertCompositionText") return;
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
if (COMPOSITION_EDITS.has(event.inputType)) return;
|
|
164
|
+
this._edit(owner, root, node.part, event.inputType, event.data);
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Правка части — команда ядра. Вставка — знаки по одному, как клавиши, а
|
|
168
|
+
* если выделение задело части — вместо них. Удаление назад — цифра (с пустой
|
|
169
|
+
* части ядро уводит фокус на предыдущую), другое удаление — часть; задетые
|
|
170
|
+
* выделением части — целиком.
|
|
171
|
+
*/
|
|
172
|
+
_edit(owner, root, part, inputType, data) {
|
|
173
|
+
owner.focusSegment(part);
|
|
174
|
+
const row = rowOf(owner, root);
|
|
175
|
+
const range = row ? rowSelection(row) : null;
|
|
176
|
+
const touched = range ? touchedSegments(segmentsOf(owner, root), range) : [];
|
|
177
|
+
if (inputType.startsWith("delete")) {
|
|
178
|
+
if (touched.length > 0) owner.clearSegments(touched);
|
|
179
|
+
else if (inputType === "deleteContentBackward") owner.eraseDigit();
|
|
180
|
+
else owner.clearSegment();
|
|
181
|
+
} else if (data) typeText(owner, touched, data);
|
|
182
|
+
if (touched.length > 0) root.ownerDocument.getSelection()?.collapseToEnd();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Браузер поправил текст части мимо отмены — клавиатура не уважает
|
|
186
|
+
* погашенный `beforeinput`, — и часть получает текст ядра обратно. Пока
|
|
187
|
+
* идёт композиция, её текст часть показывает: его вернёт `compositionend`.
|
|
188
|
+
*/
|
|
189
|
+
_onInput = (event) => {
|
|
190
|
+
const owner = this._owner;
|
|
191
|
+
const root = this._root;
|
|
192
|
+
if (!owner || !root || this._composing) return;
|
|
193
|
+
const node = segmentOf(owner, root, event.target);
|
|
194
|
+
if (node) restoreText(owner, node.part, node.element);
|
|
195
|
+
};
|
|
196
|
+
_onCompositionStart = () => {
|
|
197
|
+
this._composing = true;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Композиция кончилась: набранное — в ядро знаками, как клавиши, а часть
|
|
201
|
+
* получает текст ядра обратно. Текст композиции браузер писал в часть мимо
|
|
202
|
+
* фреймворка, и тот его не перерисует, если текст ядра не сменился: набрали
|
|
203
|
+
* не цифры.
|
|
204
|
+
*/
|
|
205
|
+
_onCompositionEnd = (event) => {
|
|
206
|
+
this._composing = false;
|
|
207
|
+
const owner = this._owner;
|
|
208
|
+
const root = this._root;
|
|
209
|
+
if (!owner || !root) return;
|
|
210
|
+
const node = segmentOf(owner, root, event.target);
|
|
211
|
+
if (!node) return;
|
|
212
|
+
owner.focusSegment(node.part);
|
|
213
|
+
typeText(owner, [], event.data);
|
|
214
|
+
restoreText(owner, node.part, node.element);
|
|
215
|
+
};
|
|
216
|
+
/** Атрибуты редактируемости — в наборы частей: части редактируемы на касание. */
|
|
217
|
+
_syncEditable = () => {
|
|
218
|
+
const owner = this._owner;
|
|
219
|
+
if (!owner) return;
|
|
220
|
+
const editable = this._editable;
|
|
221
|
+
for (const { type, numeric } of formatPartsOf(owner)) {
|
|
222
|
+
const { attrs } = owner.segmentSets(type);
|
|
223
|
+
for (const [name, value] of Object.entries(EDITABLE_ATTRS)) attrs.add(name, editable ? value : null);
|
|
224
|
+
attrs.add("inputmode", editable ? INPUT_MODES[numeric ? "numeric" : "word"] : null);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Роль и имя частей на сенсорных устройствах Apple: `textbox` и имя поля в
|
|
229
|
+
* имени части. Подпись поля по `id` — ссылкой: часть называет себя (её
|
|
230
|
+
* `aria-label` — имя части) и подпись. Имя поля строкой — строкой, после
|
|
231
|
+
* имени части. Без своего `id` части сослаться на себя нельзя, и имя
|
|
232
|
+
* остаётся её собственным. На остальных устройствах набор пуст.
|
|
233
|
+
*/
|
|
234
|
+
_syncAppleTouch = () => {
|
|
235
|
+
const owner = this._owner;
|
|
236
|
+
if (!owner) return;
|
|
237
|
+
const apple = this._appleTouch;
|
|
238
|
+
const labelledBy = apple ? owner.aria.get("aria-labelledby") : void 0;
|
|
239
|
+
const label = apple && !labelledBy ? owner.aria.get("aria-label") : void 0;
|
|
240
|
+
for (const { type, name } of formatPartsOf(owner)) {
|
|
241
|
+
const { aria } = owner.segmentSets(type);
|
|
242
|
+
const id = aria.get("id");
|
|
243
|
+
aria.add("role", apple ? APPLE_TOUCH_ROLE : null);
|
|
244
|
+
aria.add("aria-labelledby", labelledBy && id ? `${id} ${labelledBy}` : null);
|
|
245
|
+
aria.add("aria-label", label ? `${name}, ${label}` : null);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Знаки текста — в ядро по одному, как клавиши: первый — вместо задетых
|
|
251
|
+
* выделением частей, если они есть. Часть, набранная до конца, переводит фокус
|
|
252
|
+
* ядра, и следующие знаки идут в следующую часть.
|
|
253
|
+
*/
|
|
254
|
+
function typeText(owner, touched, text) {
|
|
255
|
+
const [first, ...rest] = [...text];
|
|
256
|
+
if (first === void 0) return;
|
|
257
|
+
if (touched.length > 0) owner.replaceSegments(touched, first);
|
|
258
|
+
else owner.typeKey(first);
|
|
259
|
+
for (const key of rest) owner.typeKey(key);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Вернуть части текст ядра. Текстовый узел, если он один, остаётся тем же —
|
|
263
|
+
* ссылка на него бывает у фреймворка; иначе содержимое заменяется целиком.
|
|
264
|
+
*/
|
|
265
|
+
function restoreText(owner, part, element) {
|
|
266
|
+
const text = formatPartsOf(owner).find((segment) => segment.type === part)?.text;
|
|
267
|
+
if (text === void 0) return;
|
|
268
|
+
const [first, ...rest] = element.childNodes;
|
|
269
|
+
if (first?.nodeType === Node.TEXT_NODE && rest.length === 0) {
|
|
270
|
+
if (first.nodeValue !== text) first.nodeValue = text;
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
element.textContent = text;
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
export { TDateInputTouchPlugin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IDatePicker } from '@soxa-ui/core';
|
|
2
|
+
import type { IPluginContext } from '../../base';
|
|
3
|
+
/**
|
|
4
|
+
* Первая часть поля в корне DatePicker: у одной даты — поля `field`, у
|
|
5
|
+
* диапазона — поля начала `start`, оно стоит в корне раньше поля конца.
|
|
6
|
+
* `null` — части в корне нет.
|
|
7
|
+
*
|
|
8
|
+
* Одна на модель фокуса панели (куда вернуть фокус, когда открыли кнопкой
|
|
9
|
+
* календаря) и узел фокуса DatePicker (`fieldSegmentOf`): поле оба ищут одним
|
|
10
|
+
* правилом. Часть находят по классу экземпляра поля (`classes.resolve`), а не
|
|
11
|
+
* строкой.
|
|
12
|
+
*/
|
|
13
|
+
export declare function firstPartOf(owner: IDatePicker, root: Element): Element | null;
|
|
14
|
+
/**
|
|
15
|
+
* Узел фокуса DatePicker (`focusTarget` плагина действия) — первая часть
|
|
16
|
+
* поля, у диапазона — поля начала: запись `focused = true` ставит фокус туда
|
|
17
|
+
* же, куда его возвращает панель, а не на коробку корня. `null` — инстанса или
|
|
18
|
+
* части в корне нет.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fieldSegmentOf(root: Element, ctx: IPluginContext): Element | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/custom/date-picker/field.ts
|
|
2
|
+
/**
|
|
3
|
+
* Первая часть поля в корне DatePicker: у одной даты — поля `field`, у
|
|
4
|
+
* диапазона — поля начала `start`, оно стоит в корне раньше поля конца.
|
|
5
|
+
* `null` — части в корне нет.
|
|
6
|
+
*
|
|
7
|
+
* Одна на модель фокуса панели (куда вернуть фокус, когда открыли кнопкой
|
|
8
|
+
* календаря) и узел фокуса DatePicker (`fieldSegmentOf`): поле оба ищут одним
|
|
9
|
+
* правилом. Часть находят по классу экземпляра поля (`classes.resolve`), а не
|
|
10
|
+
* строкой.
|
|
11
|
+
*/
|
|
12
|
+
function firstPartOf(owner, root) {
|
|
13
|
+
const field = owner.mode === "range" ? owner.start : owner.field;
|
|
14
|
+
return root.querySelector(field.classes.resolve("__segment", { point: true }));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Узел фокуса DatePicker (`focusTarget` плагина действия) — первая часть
|
|
18
|
+
* поля, у диапазона — поля начала: запись `focused = true` ставит фокус туда
|
|
19
|
+
* же, куда его возвращает панель, а не на коробку корня. `null` — инстанса или
|
|
20
|
+
* части в корне нет.
|
|
21
|
+
*/
|
|
22
|
+
function fieldSegmentOf(root, ctx) {
|
|
23
|
+
const owner = ctx.getInstance();
|
|
24
|
+
return owner ? firstPartOf(owner, root) : null;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { fieldSegmentOf, firstPartOf };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { IPluginContext } from '../../../base';
|
|
2
|
+
import { TOverlayFocusPlugin } from '../../overlay/focus';
|
|
3
|
+
import type { IOverlayOpenOptions } from '../../overlay/types';
|
|
4
|
+
import type { TDatePickerFocusPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TDatePickerFocusPlugin — модель фокуса панели DatePicker, APG Date Picker
|
|
7
|
+
* Dialog.
|
|
8
|
+
*
|
|
9
|
+
* Общее с остальными оверлеями — запомнить, откуда открыли, увести фокус в
|
|
10
|
+
* панель кадром позже, вернуть его при закрытии, закрыть по Escape — берёт у
|
|
11
|
+
* `TOverlayFocusPlugin`. Своё у панели — смесь двух других моделей, поэтому
|
|
12
|
+
* и стратегия своя, а не флаг в одной из них:
|
|
13
|
+
*
|
|
14
|
+
* **Tab замкнут в панели, как у модальной** (`trapTab`): панель — диалог с
|
|
15
|
+
* `aria-modal`, фон спрятан от скринридера, и выйти из неё с клавиатуры можно
|
|
16
|
+
* только закрыв — выбором, Escape или кнопкой календаря.
|
|
17
|
+
*
|
|
18
|
+
* **Нажатие мимо фокус отпускает, как у немодальной.** Подложки у панели нет,
|
|
19
|
+
* и страница указателем остаётся рабочей: нажатие в соседнее поле закрывает
|
|
20
|
+
* панель, а фокус остаётся там, куда нажали, — с первого нажатия. Поэтому на
|
|
21
|
+
* `dismiss` плагин фокус не возвращает и `mousedown` этого нажатия не гасит,
|
|
22
|
+
* в отличие от модального окна.
|
|
23
|
+
*
|
|
24
|
+
* **Первый фокус — день сетки**, а не первая кнопка календаря: остановка
|
|
25
|
+
* сетки одна на все месяцы, и это день с фокусом коллекции — выбранная дата
|
|
26
|
+
* или сегодня (`resetFocus` при открытии). Сетки нет в панели — фокус встаёт
|
|
27
|
+
* на её первую остановку, как у любого оверлея.
|
|
28
|
+
*
|
|
29
|
+
* **Возврат — в поле.** Открыли с части поля (Alt+↓) — фокус возвращается
|
|
30
|
+
* на неё. Открыли кнопкой календаря — на первую часть поля, у диапазона —
|
|
31
|
+
* поля начала: кнопка местом возврата не считается (`_canReturnTo`). Туда
|
|
32
|
+
* же, если фокус при открытии был на `body`: так бывает после нажатия кнопки
|
|
33
|
+
* в Safari, где кнопка по нажатию фокус не получает, и фокус потерялся бы
|
|
34
|
+
* после выбора. APG возвращает фокус на кнопку; здесь — как у нативного
|
|
35
|
+
* `<input type="date">`, где кнопка календаря — часть поля: после выбора
|
|
36
|
+
* дату можно сразу поправить с клавиатуры. Часть поля плагин узнаёт по
|
|
37
|
+
* классу части (`__segment`) экземпляра поля DatePicker, как кнопку — по
|
|
38
|
+
* `__trigger`, а не строкой.
|
|
39
|
+
*/
|
|
40
|
+
export declare class TDatePickerFocusPlugin extends TOverlayFocusPlugin<TDatePickerFocusPluginEvents> {
|
|
41
|
+
private _owner;
|
|
42
|
+
install(ctx: IPluginContext, options?: IOverlayOpenOptions): void;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
/** Tab по кругу внутри панели. */
|
|
45
|
+
protected _onTab(event: KeyboardEvent): void;
|
|
46
|
+
/** Остановка сетки календаря — первой, перед остановками панели по порядку. */
|
|
47
|
+
protected _focusCandidates(panel: Element): readonly Element[];
|
|
48
|
+
/** Кнопка календаря в корне местом возврата не считается: фокус — в поле. */
|
|
49
|
+
protected _canReturnTo(element: Element, root: Element): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Запомненного элемента нет или это кнопка календаря — фокус на первую часть
|
|
52
|
+
* поля, у диапазона — поля начала (`firstPartOf`): туда же его ставит запись
|
|
53
|
+
* `focused = true`.
|
|
54
|
+
*/
|
|
55
|
+
protected _returnCandidates(root: Element): readonly Element[];
|
|
56
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { tabStops } from "../../../utils/tabStops.js";
|
|
2
|
+
import { trapTab } from "../../../utils/trapTab.js";
|
|
3
|
+
import { TDismissPlugin } from "../../dismiss/dismiss.plugin.js";
|
|
4
|
+
import { TOverlayFocusPlugin } from "../../overlay/focus/focus.plugin.js";
|
|
5
|
+
import { firstPartOf } from "../field.js";
|
|
6
|
+
//#region src/custom/date-picker/focus/focus.plugin.ts
|
|
7
|
+
/**
|
|
8
|
+
* TDatePickerFocusPlugin — модель фокуса панели DatePicker, APG Date Picker
|
|
9
|
+
* Dialog.
|
|
10
|
+
*
|
|
11
|
+
* Общее с остальными оверлеями — запомнить, откуда открыли, увести фокус в
|
|
12
|
+
* панель кадром позже, вернуть его при закрытии, закрыть по Escape — берёт у
|
|
13
|
+
* `TOverlayFocusPlugin`. Своё у панели — смесь двух других моделей, поэтому
|
|
14
|
+
* и стратегия своя, а не флаг в одной из них:
|
|
15
|
+
*
|
|
16
|
+
* **Tab замкнут в панели, как у модальной** (`trapTab`): панель — диалог с
|
|
17
|
+
* `aria-modal`, фон спрятан от скринридера, и выйти из неё с клавиатуры можно
|
|
18
|
+
* только закрыв — выбором, Escape или кнопкой календаря.
|
|
19
|
+
*
|
|
20
|
+
* **Нажатие мимо фокус отпускает, как у немодальной.** Подложки у панели нет,
|
|
21
|
+
* и страница указателем остаётся рабочей: нажатие в соседнее поле закрывает
|
|
22
|
+
* панель, а фокус остаётся там, куда нажали, — с первого нажатия. Поэтому на
|
|
23
|
+
* `dismiss` плагин фокус не возвращает и `mousedown` этого нажатия не гасит,
|
|
24
|
+
* в отличие от модального окна.
|
|
25
|
+
*
|
|
26
|
+
* **Первый фокус — день сетки**, а не первая кнопка календаря: остановка
|
|
27
|
+
* сетки одна на все месяцы, и это день с фокусом коллекции — выбранная дата
|
|
28
|
+
* или сегодня (`resetFocus` при открытии). Сетки нет в панели — фокус встаёт
|
|
29
|
+
* на её первую остановку, как у любого оверлея.
|
|
30
|
+
*
|
|
31
|
+
* **Возврат — в поле.** Открыли с части поля (Alt+↓) — фокус возвращается
|
|
32
|
+
* на неё. Открыли кнопкой календаря — на первую часть поля, у диапазона —
|
|
33
|
+
* поля начала: кнопка местом возврата не считается (`_canReturnTo`). Туда
|
|
34
|
+
* же, если фокус при открытии был на `body`: так бывает после нажатия кнопки
|
|
35
|
+
* в Safari, где кнопка по нажатию фокус не получает, и фокус потерялся бы
|
|
36
|
+
* после выбора. APG возвращает фокус на кнопку; здесь — как у нативного
|
|
37
|
+
* `<input type="date">`, где кнопка календаря — часть поля: после выбора
|
|
38
|
+
* дату можно сразу поправить с клавиатуры. Часть поля плагин узнаёт по
|
|
39
|
+
* классу части (`__segment`) экземпляра поля DatePicker, как кнопку — по
|
|
40
|
+
* `__trigger`, а не строкой.
|
|
41
|
+
*/
|
|
42
|
+
var TDatePickerFocusPlugin = class extends TOverlayFocusPlugin {
|
|
43
|
+
_owner = null;
|
|
44
|
+
install(ctx, options) {
|
|
45
|
+
super.install(ctx, options);
|
|
46
|
+
this._owner = ctx.getInstance() ?? null;
|
|
47
|
+
ctx.get(TDismissPlugin)?.events.on("dismiss", () => {
|
|
48
|
+
this._restore = false;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
destroy() {
|
|
52
|
+
this._owner = null;
|
|
53
|
+
super.destroy();
|
|
54
|
+
}
|
|
55
|
+
/** Tab по кругу внутри панели. */
|
|
56
|
+
_onTab(event) {
|
|
57
|
+
if (this._panel) trapTab(event, this._panel);
|
|
58
|
+
}
|
|
59
|
+
/** Остановка сетки календаря — первой, перед остановками панели по порядку. */
|
|
60
|
+
_focusCandidates(panel) {
|
|
61
|
+
const grid = this._owner?.calendar.classes.resolve("__grid", { point: true });
|
|
62
|
+
return [...grid ? [...panel.querySelectorAll(grid)].flatMap((node) => tabStops(node)) : [], ...super._focusCandidates(panel)];
|
|
63
|
+
}
|
|
64
|
+
/** Кнопка календаря в корне местом возврата не считается: фокус — в поле. */
|
|
65
|
+
_canReturnTo(element, root) {
|
|
66
|
+
const trigger = this._owner?.classes.resolve("__trigger", { point: true });
|
|
67
|
+
const button = trigger ? element.closest(trigger) : null;
|
|
68
|
+
return !button || !root.contains(button);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Запомненного элемента нет или это кнопка календаря — фокус на первую часть
|
|
72
|
+
* поля, у диапазона — поля начала (`firstPartOf`): туда же его ставит запись
|
|
73
|
+
* `focused = true`.
|
|
74
|
+
*/
|
|
75
|
+
_returnCandidates(root) {
|
|
76
|
+
const part = this._owner ? firstPartOf(this._owner, root) : null;
|
|
77
|
+
return part ? [part] : [];
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
//#endregion
|
|
81
|
+
export { TDatePickerFocusPlugin };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TDatePickerIdsPlugin — связка «кнопка календаря ↔ панель» DatePicker в
|
|
5
|
+
* документе.
|
|
6
|
+
*
|
|
7
|
+
* `id` панели — в `panelAria`, который разметка раскладывает на панель, и
|
|
8
|
+
* ссылка на него `aria-controls` — в `triggerAria` кнопки. Обе стороны
|
|
9
|
+
* пишутся здесь, от одного `id`: формула одна на обе, как у Popover.
|
|
10
|
+
*
|
|
11
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
12
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
13
|
+
* установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
|
|
14
|
+
* `aria-controls` стоит и у закрытой панели: она всегда в документе,
|
|
15
|
+
* закрытие её только прячет.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TDatePickerIdsPlugin extends TBasePlugin {
|
|
18
|
+
install(ctx: IPluginContext): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
//#region src/custom/date-picker/ids/ids.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TDatePickerIdsPlugin — связка «кнопка календаря ↔ панель» DatePicker в
|
|
5
|
+
* документе.
|
|
6
|
+
*
|
|
7
|
+
* `id` панели — в `panelAria`, который разметка раскладывает на панель, и
|
|
8
|
+
* ссылка на него `aria-controls` — в `triggerAria` кнопки. Обе стороны
|
|
9
|
+
* пишутся здесь, от одного `id`: формула одна на обе, как у Popover.
|
|
10
|
+
*
|
|
11
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
12
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
13
|
+
* установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
|
|
14
|
+
* `aria-controls` стоит и у закрытой панели: она всегда в документе,
|
|
15
|
+
* закрытие её только прячет.
|
|
16
|
+
*/
|
|
17
|
+
var TDatePickerIdsPlugin = class extends TBasePlugin {
|
|
18
|
+
install(ctx) {
|
|
19
|
+
super.install(ctx);
|
|
20
|
+
const picker = ctx.getInstance();
|
|
21
|
+
if (!picker) return;
|
|
22
|
+
const panelId = ctx.createId("panel");
|
|
23
|
+
picker.panelAria.add("id", panelId);
|
|
24
|
+
picker.triggerAria.add("aria-controls", panelId);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TDatePickerIdsPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ids.plugin';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IDatePicker, TEventSink } from '@soxa-ui/core';
|
|
2
|
+
import { TClearableNamesPlugin } from '../../clearable/names';
|
|
3
|
+
import type { TTranslations } from '../../../locale/types';
|
|
4
|
+
import type { TDatePickerNamesPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TDatePickerNamesPlugin — имена DatePicker от локали.
|
|
7
|
+
*
|
|
8
|
+
* Имя кнопки очистки — как у любого поля (`TClearableNamesPlugin`): DatePicker —
|
|
9
|
+
* поле, и имя его кнопки собирается с его именем (`field.clear`). Имя кнопки
|
|
10
|
+
* календаря — в её набор (`triggerAria`) и в набор панели (`panelAria`):
|
|
11
|
+
* панель называется так же, как кнопка, которая её открывает. Имена полей
|
|
12
|
+
* концов диапазона — выходами (`start`, `end`): поля — свои компоненты, и имя
|
|
13
|
+
* им разметка отдаёт пропом `aria_label`, который пишет их собственный
|
|
14
|
+
* `TAriaPlugin`. Текст кнопок подвала панели при `confirmable` — тоже выходами
|
|
15
|
+
* (`confirm`, `cancel`): кнопки — свои компоненты, и текст им разметка отдаёт
|
|
16
|
+
* пропом `text`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TDatePickerNamesPlugin extends TClearableNamesPlugin<IDatePicker, TDatePickerNamesPluginEvents> {
|
|
19
|
+
private _start;
|
|
20
|
+
private _end;
|
|
21
|
+
private _confirm;
|
|
22
|
+
private _cancel;
|
|
23
|
+
/** Имя поля начала диапазона. */
|
|
24
|
+
get start(): string;
|
|
25
|
+
/** Имя поля конца диапазона. */
|
|
26
|
+
get end(): string;
|
|
27
|
+
/** Текст кнопки «OK» подвала панели. */
|
|
28
|
+
get confirm(): string;
|
|
29
|
+
/** Текст кнопки «Отмена» подвала панели. */
|
|
30
|
+
get cancel(): string;
|
|
31
|
+
protected get _sink(): TEventSink<TDatePickerNamesPluginEvents>;
|
|
32
|
+
protected _name(owner: IDatePicker, translations: TTranslations): void;
|
|
33
|
+
}
|