@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,119 @@
|
|
|
1
|
+
import { listOf } from "../list/row.js";
|
|
2
|
+
//#region src/custom/calendar/parts.ts
|
|
3
|
+
/** Кнопки листания — по частям разметки владельца (`__prev`, `__next`). */
|
|
4
|
+
var PAGERS = ["prev", "next"];
|
|
5
|
+
/** Кнопки шапки панели выбора — `__picker-prev`, `__picker-next`, `__picker-heading`. */
|
|
6
|
+
var PICKER_PARTS = [
|
|
7
|
+
"prev",
|
|
8
|
+
"next",
|
|
9
|
+
"heading"
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* День календаря, в узле которого лежит `target`, — один поиск на оба плагина
|
|
13
|
+
* календаря: клавиша, фокус, нажатие и наведение находят день одинаково.
|
|
14
|
+
*
|
|
15
|
+
* Узел дня — его корень, ячейка сетки; внутри неё плитка и содержимое слота,
|
|
16
|
+
* и событие с них — тоже событие дня. Кому нужна сама ячейка (клавиши берутся
|
|
17
|
+
* только с неё), сверяет `element` с целью события. Заполнитель соседнего
|
|
18
|
+
* месяца днём не бывает: элемента коллекции у него нет, и узла среди узлов
|
|
19
|
+
* дней — тоже.
|
|
20
|
+
*/
|
|
21
|
+
function dayOf(engine, elements, target) {
|
|
22
|
+
if (!elements || !(target instanceof Node)) return void 0;
|
|
23
|
+
for (const item of engine.extensions.batch.items) {
|
|
24
|
+
const element = elements.getElementByItem(item);
|
|
25
|
+
if (element?.contains(target)) return {
|
|
26
|
+
item,
|
|
27
|
+
element
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Узел дня с такой датой, пока он в документе. */
|
|
32
|
+
function dayElementOf(engine, elements, date) {
|
|
33
|
+
const item = engine.extensions.batch.items.find((candidate) => candidate.date === date);
|
|
34
|
+
const element = item ? elements?.getElementByItem(item) ?? null : null;
|
|
35
|
+
return element?.isConnected ? element : null;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Лежит ли в узле шапка места `picker` — по ней панель выбора и узнаётся своей.
|
|
39
|
+
*
|
|
40
|
+
* Своей и своего места панель делает не место в DOM, а шапка: `id` шапки
|
|
41
|
+
* места пишет плагин связок календаря, и панель, в которой его нет, чужая —
|
|
42
|
+
* например, панель календаря, вложенного в этот.
|
|
43
|
+
*/
|
|
44
|
+
function holdsHeading(node, { labelledBy }) {
|
|
45
|
+
const heading = labelledBy ? node.ownerDocument.getElementById(labelledBy) : null;
|
|
46
|
+
return heading !== null && node.contains(heading);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Кнопка шапки панели выбора месяца и года, в которой лежит `target`, панель
|
|
50
|
+
* этой кнопки и место панели среди `pickers` — один поиск на оба плагина
|
|
51
|
+
* календаря.
|
|
52
|
+
*
|
|
53
|
+
* Своей панель делает шапка места (`holdsHeading`). Части находят по классам
|
|
54
|
+
* владельца (`classes.resolve`), как кнопки листания.
|
|
55
|
+
*/
|
|
56
|
+
function pickerPartOf(owner, pickers, target) {
|
|
57
|
+
if (!(target instanceof Element)) return void 0;
|
|
58
|
+
for (const part of PICKER_PARTS) {
|
|
59
|
+
const panel = target.closest(owner.classes.resolve(`__picker-${part}`, { point: true }))?.closest(owner.classes.resolve("__picker", { point: true }));
|
|
60
|
+
if (!panel) continue;
|
|
61
|
+
const index = pickers.findIndex((picker) => holdsHeading(panel, picker));
|
|
62
|
+
return index === -1 ? void 0 : {
|
|
63
|
+
part,
|
|
64
|
+
index,
|
|
65
|
+
panel
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Карточка панели выбора места `picker` в корне — ту же карточку отдаёт
|
|
71
|
+
* `pickerPartOf` от кнопки её шапки. Своей её делает шапка места
|
|
72
|
+
* (`holdsHeading`), часть находят по классу владельца (`classes.resolve`).
|
|
73
|
+
* `null` — карточки в документе нет: содержимое поповера не смонтировано до
|
|
74
|
+
* первого открытия.
|
|
75
|
+
*/
|
|
76
|
+
function pickerPanelOf(owner, root, picker) {
|
|
77
|
+
for (const panel of root.querySelectorAll(owner.classes.resolve("__picker", { point: true }))) if (holdsHeading(panel, picker)) return panel;
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Список карточки панели выбора — узел списка ListBox (`listOf`): остановка
|
|
82
|
+
* Tab у списка — он, а не корень ListBox с классом части календаря. `null` —
|
|
83
|
+
* карточки или списка в ней нет.
|
|
84
|
+
*
|
|
85
|
+
* Один на клавиатуру календаря (кому отдать фокус со стрелки, погасшей у
|
|
86
|
+
* границы лет) и остановку календаря, пока панель открыта (`gridStopOf`).
|
|
87
|
+
*/
|
|
88
|
+
function pickerListOf(owner, panel) {
|
|
89
|
+
const list = panel?.querySelector(owner.classes.resolve("__picker-list", { point: true }));
|
|
90
|
+
return listOf(list ?? null);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Место, чья подложка — `target`; `target` не подложка — `undefined`.
|
|
94
|
+
*
|
|
95
|
+
* Подложка — сама панель поповера места, а не узел в ней: панель накрывает
|
|
96
|
+
* календарь, а выбирают в её содержимом, и у нажатия мимо содержимого цель —
|
|
97
|
+
* панель. Псевдоэлемент панели — тоже панель: у нажатия по нему та же цель.
|
|
98
|
+
* Панель находят по классу её поповера (`classes.resolve`), своей её делает
|
|
99
|
+
* шапка места (`holdsHeading`).
|
|
100
|
+
*/
|
|
101
|
+
function pickerBackdropOf(pickers, target) {
|
|
102
|
+
if (!(target instanceof Element)) return void 0;
|
|
103
|
+
const index = pickers.findIndex((picker) => target.matches(picker.popover.classes.resolve("__panel", { point: true })) && holdsHeading(target, picker));
|
|
104
|
+
return index === -1 ? void 0 : index;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Кнопка листания, в которой лежит `target`. Кнопки находят по классам
|
|
108
|
+
* владельца (`classes.resolve`), а не строкой в плагине, и только внутри его
|
|
109
|
+
* корня.
|
|
110
|
+
*/
|
|
111
|
+
function pagerOf(owner, root, target) {
|
|
112
|
+
if (!(target instanceof Element)) return void 0;
|
|
113
|
+
return PAGERS.find((pager) => {
|
|
114
|
+
const button = target.closest(owner.classes.resolve(`__${pager}`, { point: true }));
|
|
115
|
+
return button !== null && root.contains(button);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { dayElementOf, dayOf, pagerOf, pickerBackdropOf, pickerListOf, pickerPanelOf, pickerPartOf };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ICalendar } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TCalendarPointerPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TCalendarPointerPlugin — указатель календаря: нажатия по дням и кнопкам
|
|
7
|
+
* листания и наведение для предпросмотра диапазона.
|
|
8
|
+
*
|
|
9
|
+
* Слушатели — на корне, в разметке обработчиков нет: связка «нажали ⇄
|
|
10
|
+
* выбрали» и «нажали ⇄ листаем» повторялась бы в каждом из шести адаптеров
|
|
11
|
+
* (приём ленты Scroller). Дат плагин не считает, только зовёт команды
|
|
12
|
+
* расширений коллекции.
|
|
13
|
+
*
|
|
14
|
+
* - Нажатие по кнопке листания — `showPrev`/`showNext` вида. Enter и пробел на
|
|
15
|
+
* кнопке дают тот же `click` — браузер делает его у `<button>` сам.
|
|
16
|
+
* - Нажатие по кнопке шапки панели выбора месяца и года — команда расширения
|
|
17
|
+
* `picker` для места панели: стрелки листают год или страницу лет, кнопка
|
|
18
|
+
* года меняет уровень. Панель — поповер внутри календаря (`contained`), и
|
|
19
|
+
* её нажатия всплывают до корня; выбор в её списке ловит само расширение.
|
|
20
|
+
* - Нажатие по подложке панели выбора — по самой панели вокруг её
|
|
21
|
+
* содержимого — `close` расширения `picker` для места; фокус на заголовок
|
|
22
|
+
* возвращает плагин фокуса поповера. В счёт идёт только нажатие, которое
|
|
23
|
+
* началось и кончилось на подложке, и только `click`, который никто не
|
|
24
|
+
* погасил. `click` с целью «панель» дают и протяжка из содержимого за его
|
|
25
|
+
* край — панель общий предок нажатия и отпускания, — и жест за полосу:
|
|
26
|
+
* панель захватила указатель, а свой `click` жест гасит. Закрывает `click`,
|
|
27
|
+
* а не `pointerdown`: иначе действие `mousedown` того же нажатия унесло бы
|
|
28
|
+
* фокус, возвращённый на заголовок, на `body`.
|
|
29
|
+
* - Нажатие по дню — где угодно в ячейке, с плиткой и содержимым слота, —
|
|
30
|
+
* `chooseDate` выбора. Недоступный и выключенный день выбор отклоняет сам,
|
|
31
|
+
* по заполнителю соседнего месяца не происходит ничего: дня у него нет.
|
|
32
|
+
* - Наведение (не касание: палец над днём — это уже нажатие) — день под
|
|
33
|
+
* указателем для предпросмотра (`notifyHover`); указатель на не-дне или
|
|
34
|
+
* ушёл с корня — `undefined`.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TCalendarPointerPlugin extends TBasePlugin<ICalendar, TCalendarPointerPluginEvents> {
|
|
37
|
+
private _owner;
|
|
38
|
+
private _root;
|
|
39
|
+
private _elements;
|
|
40
|
+
private _engine;
|
|
41
|
+
/**
|
|
42
|
+
* Место, по подложке которого нажали и не отпустили мимо неё, — до `click`
|
|
43
|
+
* этого нажатия; нажали не по подложке — `undefined`.
|
|
44
|
+
*/
|
|
45
|
+
private _pressedBackdrop;
|
|
46
|
+
install(ctx: IPluginContext): void;
|
|
47
|
+
destroy(): void;
|
|
48
|
+
/** Корень сменился — вместе с ним переезжают слушатели. */
|
|
49
|
+
private _bind;
|
|
50
|
+
private readonly _onClick;
|
|
51
|
+
/** Нажатие началось — по подложке ли: в счёт идёт только начатое на ней. */
|
|
52
|
+
private readonly _onPointerDown;
|
|
53
|
+
/** Отпустили не на той подложке, где нажали, — это уже не нажатие по ней. */
|
|
54
|
+
private readonly _onPointerUp;
|
|
55
|
+
private _backdropOf;
|
|
56
|
+
private readonly _onPointerOver;
|
|
57
|
+
private readonly _onPointerLeave;
|
|
58
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
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 { TCollectionElements } from "../../collection/collection-elements.plugin.js";
|
|
5
|
+
import { dayOf, pagerOf, pickerBackdropOf, pickerPartOf } from "../parts.js";
|
|
6
|
+
//#region src/custom/calendar/pointer/pointer.plugin.ts
|
|
7
|
+
/** Листание по кнопке — команда вида коллекции. */
|
|
8
|
+
var PAGE = {
|
|
9
|
+
prev: (view) => view.showPrev(),
|
|
10
|
+
next: (view) => view.showNext()
|
|
11
|
+
};
|
|
12
|
+
/** Кнопки шапки панели выбора месяца и года — команды расширения `picker` для места. */
|
|
13
|
+
var PICK = {
|
|
14
|
+
prev: (picker, index) => picker.showPrev(index),
|
|
15
|
+
next: (picker, index) => picker.showNext(index),
|
|
16
|
+
heading: (picker, index) => picker.toggleLevel(index)
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* TCalendarPointerPlugin — указатель календаря: нажатия по дням и кнопкам
|
|
20
|
+
* листания и наведение для предпросмотра диапазона.
|
|
21
|
+
*
|
|
22
|
+
* Слушатели — на корне, в разметке обработчиков нет: связка «нажали ⇄
|
|
23
|
+
* выбрали» и «нажали ⇄ листаем» повторялась бы в каждом из шести адаптеров
|
|
24
|
+
* (приём ленты Scroller). Дат плагин не считает, только зовёт команды
|
|
25
|
+
* расширений коллекции.
|
|
26
|
+
*
|
|
27
|
+
* - Нажатие по кнопке листания — `showPrev`/`showNext` вида. Enter и пробел на
|
|
28
|
+
* кнопке дают тот же `click` — браузер делает его у `<button>` сам.
|
|
29
|
+
* - Нажатие по кнопке шапки панели выбора месяца и года — команда расширения
|
|
30
|
+
* `picker` для места панели: стрелки листают год или страницу лет, кнопка
|
|
31
|
+
* года меняет уровень. Панель — поповер внутри календаря (`contained`), и
|
|
32
|
+
* её нажатия всплывают до корня; выбор в её списке ловит само расширение.
|
|
33
|
+
* - Нажатие по подложке панели выбора — по самой панели вокруг её
|
|
34
|
+
* содержимого — `close` расширения `picker` для места; фокус на заголовок
|
|
35
|
+
* возвращает плагин фокуса поповера. В счёт идёт только нажатие, которое
|
|
36
|
+
* началось и кончилось на подложке, и только `click`, который никто не
|
|
37
|
+
* погасил. `click` с целью «панель» дают и протяжка из содержимого за его
|
|
38
|
+
* край — панель общий предок нажатия и отпускания, — и жест за полосу:
|
|
39
|
+
* панель захватила указатель, а свой `click` жест гасит. Закрывает `click`,
|
|
40
|
+
* а не `pointerdown`: иначе действие `mousedown` того же нажатия унесло бы
|
|
41
|
+
* фокус, возвращённый на заголовок, на `body`.
|
|
42
|
+
* - Нажатие по дню — где угодно в ячейке, с плиткой и содержимым слота, —
|
|
43
|
+
* `chooseDate` выбора. Недоступный и выключенный день выбор отклоняет сам,
|
|
44
|
+
* по заполнителю соседнего месяца не происходит ничего: дня у него нет.
|
|
45
|
+
* - Наведение (не касание: палец над днём — это уже нажатие) — день под
|
|
46
|
+
* указателем для предпросмотра (`notifyHover`); указатель на не-дне или
|
|
47
|
+
* ушёл с корня — `undefined`.
|
|
48
|
+
*/
|
|
49
|
+
var TCalendarPointerPlugin = class extends TBasePlugin {
|
|
50
|
+
_owner = null;
|
|
51
|
+
_root = null;
|
|
52
|
+
_elements = null;
|
|
53
|
+
_engine = null;
|
|
54
|
+
/**
|
|
55
|
+
* Место, по подложке которого нажали и не отпустили мимо неё, — до `click`
|
|
56
|
+
* этого нажатия; нажали не по подложке — `undefined`.
|
|
57
|
+
*/
|
|
58
|
+
_pressedBackdrop = void 0;
|
|
59
|
+
install(ctx) {
|
|
60
|
+
super.install(ctx);
|
|
61
|
+
this._owner = ctx.getInstance() ?? null;
|
|
62
|
+
this._elements = ctx.get(TCollectionElements) ?? null;
|
|
63
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
64
|
+
elementPlugin?.events.on("ready", (element) => this._bind(element));
|
|
65
|
+
elementPlugin?.events.on("removed", () => this._bind(null));
|
|
66
|
+
ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => {
|
|
67
|
+
this._engine = engine;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
destroy() {
|
|
71
|
+
this._bind(null);
|
|
72
|
+
this._owner = null;
|
|
73
|
+
this._elements = null;
|
|
74
|
+
this._engine = null;
|
|
75
|
+
super.destroy();
|
|
76
|
+
}
|
|
77
|
+
/** Корень сменился — вместе с ним переезжают слушатели. */
|
|
78
|
+
_bind(root) {
|
|
79
|
+
const previous = this._root;
|
|
80
|
+
previous?.removeEventListener("click", this._onClick);
|
|
81
|
+
previous?.removeEventListener("pointerdown", this._onPointerDown);
|
|
82
|
+
previous?.removeEventListener("pointerup", this._onPointerUp);
|
|
83
|
+
previous?.removeEventListener("pointerover", this._onPointerOver);
|
|
84
|
+
previous?.removeEventListener("pointerleave", this._onPointerLeave);
|
|
85
|
+
this._root = root;
|
|
86
|
+
this._pressedBackdrop = void 0;
|
|
87
|
+
const target = root;
|
|
88
|
+
target?.addEventListener("click", this._onClick);
|
|
89
|
+
target?.addEventListener("pointerdown", this._onPointerDown);
|
|
90
|
+
target?.addEventListener("pointerup", this._onPointerUp);
|
|
91
|
+
target?.addEventListener("pointerover", this._onPointerOver);
|
|
92
|
+
target?.addEventListener("pointerleave", this._onPointerLeave);
|
|
93
|
+
}
|
|
94
|
+
_onClick = (event) => {
|
|
95
|
+
const engine = this._engine;
|
|
96
|
+
const owner = this._owner;
|
|
97
|
+
const root = this._root;
|
|
98
|
+
const pressed = this._pressedBackdrop;
|
|
99
|
+
this._pressedBackdrop = void 0;
|
|
100
|
+
if (!engine || !owner || !root) return;
|
|
101
|
+
const picker = engine.extensions.picker;
|
|
102
|
+
const pickers = picker.pickers;
|
|
103
|
+
const hit = pickerPartOf(owner, pickers, event.target);
|
|
104
|
+
if (hit) {
|
|
105
|
+
PICK[hit.part](picker, hit.index);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const backdrop = pickerBackdropOf(pickers, event.target);
|
|
109
|
+
if (backdrop !== void 0) {
|
|
110
|
+
if (backdrop === pressed && !event.defaultPrevented) picker.close(backdrop);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const pager = pagerOf(owner, root, event.target);
|
|
114
|
+
if (pager) {
|
|
115
|
+
PAGE[pager](engine.extensions.view);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const day = dayOf(engine, this._elements, event.target);
|
|
119
|
+
if (day) engine.extensions.selection.chooseDate(day.item.date);
|
|
120
|
+
};
|
|
121
|
+
/** Нажатие началось — по подложке ли: в счёт идёт только начатое на ней. */
|
|
122
|
+
_onPointerDown = (event) => {
|
|
123
|
+
this._pressedBackdrop = this._backdropOf(event.target);
|
|
124
|
+
};
|
|
125
|
+
/** Отпустили не на той подложке, где нажали, — это уже не нажатие по ней. */
|
|
126
|
+
_onPointerUp = (event) => {
|
|
127
|
+
if (this._backdropOf(event.target) !== this._pressedBackdrop) this._pressedBackdrop = void 0;
|
|
128
|
+
};
|
|
129
|
+
_backdropOf(target) {
|
|
130
|
+
const engine = this._engine;
|
|
131
|
+
return engine ? pickerBackdropOf(engine.extensions.picker.pickers, target) : void 0;
|
|
132
|
+
}
|
|
133
|
+
_onPointerOver = (event) => {
|
|
134
|
+
const engine = this._engine;
|
|
135
|
+
if (!engine || event.pointerType === "touch") return;
|
|
136
|
+
const day = dayOf(engine, this._elements, event.target);
|
|
137
|
+
engine.extensions.selection.notifyHover(day?.item.date);
|
|
138
|
+
};
|
|
139
|
+
_onPointerLeave = () => {
|
|
140
|
+
this._engine?.extensions.selection.notifyHover(void 0);
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { TCalendarPointerPlugin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IPluginContext } from '../../base';
|
|
2
|
+
/**
|
|
3
|
+
* Остановка календаря — узел фокуса Calendar (`focusTarget` плагина
|
|
4
|
+
* действия): запись `focused = true` ставит фокус туда же, куда ведёт Tab.
|
|
5
|
+
*
|
|
6
|
+
* Все сетки — одна остановка, день с фокусом коллекции (`focusedDate`), и
|
|
7
|
+
* узел дня — тот же, на который фокус переносит клавиатура календаря
|
|
8
|
+
* (`dayElementOf`). День берётся по модели, а не по `[tabindex="0"]`: в такте
|
|
9
|
+
* смены фокуса коллекции разметка ещё старая, и фокус ушёл бы на прежний день.
|
|
10
|
+
* Пока открыта панель выбора месяца и года, сетка под её подложкой, а
|
|
11
|
+
* остановка — список панели (`pickerListOf`), как у стрелки панели, погасшей
|
|
12
|
+
* под фокусом.
|
|
13
|
+
*
|
|
14
|
+
* `null` — узла нет в документе: день нового месяца в такте листания ещё не
|
|
15
|
+
* нарисован, содержимое панели не смонтировано до первого открытия. День
|
|
16
|
+
* запись `focused` дождётся: его узел приносит элемент коллекции календаря, и
|
|
17
|
+
* плагин действия зовёт правило снова. Список панели — нет: он не элемент
|
|
18
|
+
* этой коллекции, и о его узле календарь не узнаёт.
|
|
19
|
+
*/
|
|
20
|
+
export declare function gridStopOf(root: Element, ctx: IPluginContext): Element | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TCollectionElements } from "../collection/collection-elements.plugin.js";
|
|
2
|
+
import { dayElementOf, pickerListOf, pickerPanelOf } from "./parts.js";
|
|
3
|
+
//#region src/custom/calendar/stop.ts
|
|
4
|
+
/**
|
|
5
|
+
* Остановка календаря — узел фокуса Calendar (`focusTarget` плагина
|
|
6
|
+
* действия): запись `focused = true` ставит фокус туда же, куда ведёт Tab.
|
|
7
|
+
*
|
|
8
|
+
* Все сетки — одна остановка, день с фокусом коллекции (`focusedDate`), и
|
|
9
|
+
* узел дня — тот же, на который фокус переносит клавиатура календаря
|
|
10
|
+
* (`dayElementOf`). День берётся по модели, а не по `[tabindex="0"]`: в такте
|
|
11
|
+
* смены фокуса коллекции разметка ещё старая, и фокус ушёл бы на прежний день.
|
|
12
|
+
* Пока открыта панель выбора месяца и года, сетка под её подложкой, а
|
|
13
|
+
* остановка — список панели (`pickerListOf`), как у стрелки панели, погасшей
|
|
14
|
+
* под фокусом.
|
|
15
|
+
*
|
|
16
|
+
* `null` — узла нет в документе: день нового месяца в такте листания ещё не
|
|
17
|
+
* нарисован, содержимое панели не смонтировано до первого открытия. День
|
|
18
|
+
* запись `focused` дождётся: его узел приносит элемент коллекции календаря, и
|
|
19
|
+
* плагин действия зовёт правило снова. Список панели — нет: он не элемент
|
|
20
|
+
* этой коллекции, и о его узле календарь не узнаёт.
|
|
21
|
+
*/
|
|
22
|
+
function gridStopOf(root, ctx) {
|
|
23
|
+
const owner = ctx.getInstance();
|
|
24
|
+
const elements = ctx.get(TCollectionElements) ?? null;
|
|
25
|
+
const engine = elements?.engine ?? null;
|
|
26
|
+
if (!owner || !engine) return null;
|
|
27
|
+
const picker = engine.extensions.picker.pickers.find((place) => place.popover.open);
|
|
28
|
+
if (picker) return pickerListOf(owner, pickerPanelOf(owner, root, picker));
|
|
29
|
+
return dayElementOf(engine, elements, engine.extensions.focus.focusedDate);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { gridStopOf };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ICalendarItem } from '@soxa-ui/core';
|
|
2
|
+
/** Кнопка листания календаря: «предыдущий месяц» или «следующий». */
|
|
3
|
+
export type TCalendarPager = 'prev' | 'next';
|
|
4
|
+
/** Кнопка шапки панели выбора месяца и года: стрелка или кнопка уровня. */
|
|
5
|
+
export type TCalendarPickerPart = TCalendarPager | 'heading';
|
|
6
|
+
/** Кнопка шапки панели выбора, место панели и её узел. */
|
|
7
|
+
export type TCalendarPickerHit = {
|
|
8
|
+
part: TCalendarPickerPart;
|
|
9
|
+
index: number;
|
|
10
|
+
panel: Element;
|
|
11
|
+
};
|
|
12
|
+
/** День календаря и его узел — корень дня, ячейка сетки. */
|
|
13
|
+
export type TCalendarDay = {
|
|
14
|
+
item: ICalendarItem;
|
|
15
|
+
element: Element;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './names';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './names.plugin';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IClearable } from '@soxa-ui/core';
|
|
2
|
+
import type { TPluginEvents } from '../../../base';
|
|
3
|
+
import { TNamesPlugin } from '../../../locale/names.plugin';
|
|
4
|
+
import type { TTranslations } from '../../../locale/types';
|
|
5
|
+
/**
|
|
6
|
+
* TClearableNamesPlugin — имя кнопки очистки поля от локали: в `clearAria`,
|
|
7
|
+
* вместе с именем поля — «Clear Город».
|
|
8
|
+
*
|
|
9
|
+
* Без имени поля на форме с пятью полями в списке элементов скринридера было
|
|
10
|
+
* бы пять одинаковых «Clear, кнопка». Как имя складывается с именем поля,
|
|
11
|
+
* решает шаблон локали (`field.clear`). Сменилось имя — имя кнопки
|
|
12
|
+
* переписывается.
|
|
13
|
+
*
|
|
14
|
+
* Ставится наследникам базы очистки (`TClearable`) — текстовому полю и полю
|
|
15
|
+
* даты, — а через наследников — DatePicker (`TDatePickerNamesPlugin`) и полю
|
|
16
|
+
* числа (`TNumberInputNamesPlugin`): плагин имён у компонента один, и самой
|
|
17
|
+
* базе он не ставится. Дженерик по владельцу и событиям — для наследника, у
|
|
18
|
+
* которого кнопок больше. Строка — из раздела локали `field`: формат локали
|
|
19
|
+
* публичный, и имя раздела осталось прежним.
|
|
20
|
+
*/
|
|
21
|
+
export declare class TClearableNamesPlugin<TOwner extends IClearable<any, any, any> = IClearable<unknown>, TEvents extends TPluginEvents = TPluginEvents> extends TNamesPlugin<TOwner, TEvents> {
|
|
22
|
+
protected _name(owner: TOwner, translations: TTranslations): void;
|
|
23
|
+
protected _watch(owner: TOwner, name: () => void): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { formatName } from "../../../locale/locale.js";
|
|
2
|
+
import { TNamesPlugin } from "../../../locale/names.plugin.js";
|
|
3
|
+
//#region src/custom/clearable/names/names.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TClearableNamesPlugin — имя кнопки очистки поля от локали: в `clearAria`,
|
|
6
|
+
* вместе с именем поля — «Clear Город».
|
|
7
|
+
*
|
|
8
|
+
* Без имени поля на форме с пятью полями в списке элементов скринридера было
|
|
9
|
+
* бы пять одинаковых «Clear, кнопка». Как имя складывается с именем поля,
|
|
10
|
+
* решает шаблон локали (`field.clear`). Сменилось имя — имя кнопки
|
|
11
|
+
* переписывается.
|
|
12
|
+
*
|
|
13
|
+
* Ставится наследникам базы очистки (`TClearable`) — текстовому полю и полю
|
|
14
|
+
* даты, — а через наследников — DatePicker (`TDatePickerNamesPlugin`) и полю
|
|
15
|
+
* числа (`TNumberInputNamesPlugin`): плагин имён у компонента один, и самой
|
|
16
|
+
* базе он не ставится. Дженерик по владельцу и событиям — для наследника, у
|
|
17
|
+
* которого кнопок больше. Строка — из раздела локали `field`: формат локали
|
|
18
|
+
* публичный, и имя раздела осталось прежним.
|
|
19
|
+
*/
|
|
20
|
+
var TClearableNamesPlugin = class extends TNamesPlugin {
|
|
21
|
+
_name(owner, translations) {
|
|
22
|
+
owner.clearAria.add("aria-label", formatName(translations.field.clear, owner.name));
|
|
23
|
+
}
|
|
24
|
+
_watch(owner, name) {
|
|
25
|
+
this._listenTo(owner.events, "change:name", name);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { TClearableNamesPlugin };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../base';
|
|
2
|
+
import type { IPluginBundle } from '../../base';
|
|
3
|
+
import type { TCollectionEngine } from '@soxa-ui/core';
|
|
4
|
+
import type { TBundlesEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TCollectionBundlesPlugin — реестр plugin-bundles элементов коллекции.
|
|
7
|
+
*
|
|
8
|
+
* Держит ссылку на коллекцию (`engine`), поэтому любой плагин имеет доступ
|
|
9
|
+
* ко всему состоянию коллекции (активный элемент, порядок, элементы) без костылей
|
|
10
|
+
* для каждого отдельного свойства.
|
|
11
|
+
*
|
|
12
|
+
* Накапливает ТОЛЬКО bundles: Map<uid, IPluginBundle>. Реестр синхронизируется с
|
|
13
|
+
* жизненным циклом элементов коллекции через события `plain` (`item:removed`, `reset`).
|
|
14
|
+
* Порядок bundles всегда берётся из коллекции, поэтому `item:moved` не требует
|
|
15
|
+
* дополнительной обработки.
|
|
16
|
+
*
|
|
17
|
+
* Запись живёт, пока набор элемента в документе, и о каждой снятой записи
|
|
18
|
+
* реестр сообщает `bundle:unregistered` — кончилось ли монтирование элемента
|
|
19
|
+
* из данных (`release`) или элемент ушёл из коллекции: убран из данных, снят
|
|
20
|
+
* из разметки, коллекцию очистили. Иначе подписчик, который держит что-то за
|
|
21
|
+
* набором элемента (ссылку `aria-activedescendant` на его `id`, наблюдатель
|
|
22
|
+
* его узла), узнавал бы только об одном из путей.
|
|
23
|
+
*
|
|
24
|
+
* Устанавливается на owner-компоненте коллекции (например, Tabs). Коллекция
|
|
25
|
+
* привязывается через {@link bindEngine} из adapter-слоя после её создания.
|
|
26
|
+
*/
|
|
27
|
+
export declare class TCollectionBundlesPlugin extends TBasePlugin<any, TBundlesEvents> {
|
|
28
|
+
private _engine;
|
|
29
|
+
private readonly _bundles;
|
|
30
|
+
/** Привязать коллекцию. Вызывается adapter-слоем после создания коллекции. */
|
|
31
|
+
bindEngine(engine: TCollectionEngine<any, any>): void;
|
|
32
|
+
/** Ссылка на коллекцию, к которой привязан реестр. */
|
|
33
|
+
get engine(): TCollectionEngine<any, any> | null;
|
|
34
|
+
/** Зарегистрировать bundle элемента коллекции (ключ — uid элемента). */
|
|
35
|
+
register(bundle: IPluginBundle, item: unknown): void;
|
|
36
|
+
/**
|
|
37
|
+
* Отпустить bundle элемента, чьё монтирование кончилось: запись снимается,
|
|
38
|
+
* только если она всё ещё его. Элемент из данных остаётся в коллекции и
|
|
39
|
+
* после размонтирования — отбор или окно таблицы его прячут, — и без этого
|
|
40
|
+
* запись держала бы bundle с отсоединённым узлом, пока элемент не удалят.
|
|
41
|
+
* Новое монтирование того же элемента регистрирует свой bundle раньше, чем
|
|
42
|
+
* прежнее снимается (React пересобирает до очистки), — его запись не
|
|
43
|
+
* трогается.
|
|
44
|
+
*/
|
|
45
|
+
release(bundle: IPluginBundle, item: unknown): void;
|
|
46
|
+
/** Снять регистрацию bundle элемента коллекции. */
|
|
47
|
+
unregister(uid: string | number): void;
|
|
48
|
+
/** Bundle элемента по uid. */
|
|
49
|
+
getByUid(uid: string | number): IPluginBundle | undefined;
|
|
50
|
+
/** Bundle по элементу коллекции. */
|
|
51
|
+
getByItem(item: unknown): IPluginBundle | undefined;
|
|
52
|
+
/** Все bundles в порядке элементов коллекции. */
|
|
53
|
+
getAll(): IPluginBundle[];
|
|
54
|
+
private _uid;
|
|
55
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../base/base.class.js";
|
|
2
|
+
import { batchOf, plainOf } from "@soxa-ui/core";
|
|
3
|
+
//#region src/custom/collection/bundles.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TCollectionBundlesPlugin — реестр plugin-bundles элементов коллекции.
|
|
6
|
+
*
|
|
7
|
+
* Держит ссылку на коллекцию (`engine`), поэтому любой плагин имеет доступ
|
|
8
|
+
* ко всему состоянию коллекции (активный элемент, порядок, элементы) без костылей
|
|
9
|
+
* для каждого отдельного свойства.
|
|
10
|
+
*
|
|
11
|
+
* Накапливает ТОЛЬКО bundles: Map<uid, IPluginBundle>. Реестр синхронизируется с
|
|
12
|
+
* жизненным циклом элементов коллекции через события `plain` (`item:removed`, `reset`).
|
|
13
|
+
* Порядок bundles всегда берётся из коллекции, поэтому `item:moved` не требует
|
|
14
|
+
* дополнительной обработки.
|
|
15
|
+
*
|
|
16
|
+
* Запись живёт, пока набор элемента в документе, и о каждой снятой записи
|
|
17
|
+
* реестр сообщает `bundle:unregistered` — кончилось ли монтирование элемента
|
|
18
|
+
* из данных (`release`) или элемент ушёл из коллекции: убран из данных, снят
|
|
19
|
+
* из разметки, коллекцию очистили. Иначе подписчик, который держит что-то за
|
|
20
|
+
* набором элемента (ссылку `aria-activedescendant` на его `id`, наблюдатель
|
|
21
|
+
* его узла), узнавал бы только об одном из путей.
|
|
22
|
+
*
|
|
23
|
+
* Устанавливается на owner-компоненте коллекции (например, Tabs). Коллекция
|
|
24
|
+
* привязывается через {@link bindEngine} из adapter-слоя после её создания.
|
|
25
|
+
*/
|
|
26
|
+
var TCollectionBundlesPlugin = class extends TBasePlugin {
|
|
27
|
+
_engine = null;
|
|
28
|
+
_bundles = /* @__PURE__ */ new Map();
|
|
29
|
+
/** Привязать коллекцию. Вызывается adapter-слоем после создания коллекции. */
|
|
30
|
+
bindEngine(engine) {
|
|
31
|
+
if (this._engine === engine) return;
|
|
32
|
+
this._engine = engine;
|
|
33
|
+
const plain = plainOf(engine);
|
|
34
|
+
this._listenTo(plain?.events, "item:removed", (e) => {
|
|
35
|
+
const uid = this._uid(e.item);
|
|
36
|
+
if (uid !== void 0 && this._bundles.has(uid)) this.unregister(uid);
|
|
37
|
+
});
|
|
38
|
+
this._listenTo(plain?.events, "reset", () => {
|
|
39
|
+
for (const uid of [...this._bundles.keys()]) this.unregister(uid);
|
|
40
|
+
});
|
|
41
|
+
this.events.emit("engine:bound", engine);
|
|
42
|
+
}
|
|
43
|
+
/** Ссылка на коллекцию, к которой привязан реестр. */
|
|
44
|
+
get engine() {
|
|
45
|
+
return this._engine;
|
|
46
|
+
}
|
|
47
|
+
/** Зарегистрировать bundle элемента коллекции (ключ — uid элемента). */
|
|
48
|
+
register(bundle, item) {
|
|
49
|
+
const uid = this._uid(item);
|
|
50
|
+
if (uid === void 0) return;
|
|
51
|
+
this._bundles.set(uid, bundle);
|
|
52
|
+
this.events.emit("bundle:registered", {
|
|
53
|
+
uid,
|
|
54
|
+
bundle
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Отпустить bundle элемента, чьё монтирование кончилось: запись снимается,
|
|
59
|
+
* только если она всё ещё его. Элемент из данных остаётся в коллекции и
|
|
60
|
+
* после размонтирования — отбор или окно таблицы его прячут, — и без этого
|
|
61
|
+
* запись держала бы bundle с отсоединённым узлом, пока элемент не удалят.
|
|
62
|
+
* Новое монтирование того же элемента регистрирует свой bundle раньше, чем
|
|
63
|
+
* прежнее снимается (React пересобирает до очистки), — его запись не
|
|
64
|
+
* трогается.
|
|
65
|
+
*/
|
|
66
|
+
release(bundle, item) {
|
|
67
|
+
const uid = this._uid(item);
|
|
68
|
+
if (uid === void 0 || this._bundles.get(uid) !== bundle) return;
|
|
69
|
+
this.unregister(uid);
|
|
70
|
+
}
|
|
71
|
+
/** Снять регистрацию bundle элемента коллекции. */
|
|
72
|
+
unregister(uid) {
|
|
73
|
+
this._bundles.delete(uid);
|
|
74
|
+
this.events.emit("bundle:unregistered", { uid });
|
|
75
|
+
}
|
|
76
|
+
/** Bundle элемента по uid. */
|
|
77
|
+
getByUid(uid) {
|
|
78
|
+
return this._bundles.get(uid);
|
|
79
|
+
}
|
|
80
|
+
/** Bundle по элементу коллекции. */
|
|
81
|
+
getByItem(item) {
|
|
82
|
+
const uid = this._uid(item);
|
|
83
|
+
return uid === void 0 ? void 0 : this._bundles.get(uid);
|
|
84
|
+
}
|
|
85
|
+
/** Все bundles в порядке элементов коллекции. */
|
|
86
|
+
getAll() {
|
|
87
|
+
if (!this._engine) return Array.from(this._bundles.values());
|
|
88
|
+
const result = [];
|
|
89
|
+
for (const item of batchOf(this._engine)?.items ?? []) {
|
|
90
|
+
const bundle = this.getByItem(item);
|
|
91
|
+
if (bundle) result.push(bundle);
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
_uid(item) {
|
|
96
|
+
return item?.uid;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { TCollectionBundlesPlugin };
|