@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,214 @@
|
|
|
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 { isFocusableElement } from "../../../utils/isFocusableElement.js";
|
|
6
|
+
//#region src/custom/toasts/cascade/cascade.plugin.ts
|
|
7
|
+
/**
|
|
8
|
+
* Сколько прокрутить колесом, чтобы стопка сделала шаг, px. Щелчок колеса
|
|
9
|
+
* мыши — около сотни пикселей, и шаг он делает сразу. Тачпад шлёт события
|
|
10
|
+
* мелкими долями, и они копятся: случайное касание стопку не листает.
|
|
11
|
+
*/
|
|
12
|
+
var WHEEL_STEP = 50;
|
|
13
|
+
/**
|
|
14
|
+
* Тишина колеса, после которой жест кончился, мс. Инерция тачпада и щелчки,
|
|
15
|
+
* идущие подряд, — один жест и один шаг: стопка из трёх тостов иначе
|
|
16
|
+
* пролисталась бы одним взмахом по кругу.
|
|
17
|
+
*/
|
|
18
|
+
var WHEEL_GESTURE_END = 200;
|
|
19
|
+
/** Поле, которому стрелки нужны самому: ввод, выбор, редактируемый текст. */
|
|
20
|
+
var TAKES_ARROWS = "input, select, textarea, [contenteditable]:not([contenteditable=\"false\"])";
|
|
21
|
+
/**
|
|
22
|
+
* TToastsCascadePlugin — листание стопки тостов (`layout: 'cascade'`).
|
|
23
|
+
*
|
|
24
|
+
* В стопке тосты перекрывают друг друга. Передний — первый по порядку
|
|
25
|
+
* коллекции, а вывести задний вперёд — перестановка (`plain.move`): своего
|
|
26
|
+
* состояния «передний» у тоста нет, и экран со скринридером видят один
|
|
27
|
+
* порядок. Шаг стопки — поворот открытых показанных тостов по кругу:
|
|
28
|
+
*
|
|
29
|
+
* - **колесо** над регионом: вниз — передний уходит назад, вверх — задний
|
|
30
|
+
* выходит вперёд. Шаг один на жест колеса (`WHEEL_GESTURE_END`), прокрутка
|
|
31
|
+
* копится до порога (`WHEEL_STEP`), колесо жеста гасится — страница под
|
|
32
|
+
* стопкой не едет. Колесо с Ctrl — масштаб окна, а вбок — не наше;
|
|
33
|
+
* - **стрелки ↓ и ↑** при фокусе на тосте — то же самое, и фокус переходит на
|
|
34
|
+
* новый передний: тот, кого читают, всегда впереди. Стрелки поля ввода и
|
|
35
|
+
* списка в своём содержимом тоста не перехватываются, погашенные раньше —
|
|
36
|
+
* тоже.
|
|
37
|
+
*
|
|
38
|
+
* **Передний для шага — тост под фокусом.** Фокус Tab на заднем тосте выводит
|
|
39
|
+
* его вперёд темой, по `:focus-within`, без перестановки: перестановка на
|
|
40
|
+
* фокус ставила бы тост под фокусом первым в документе, и следующий Tab
|
|
41
|
+
* приходил бы в прежний передний — по кругу, без выхода из региона. Поэтому
|
|
42
|
+
* шаг считается от того, что видно: тост под фокусом впереди, остальные — за
|
|
43
|
+
* ним по порядку.
|
|
44
|
+
*
|
|
45
|
+
* Закрытые тосты, которые ещё гаснут, в повороте не участвуют и встают за
|
|
46
|
+
* открытыми; ждущие за пределом видимых не трогаются. Открытых меньше двух —
|
|
47
|
+
* листать нечего, и колесо со стрелками остаются странице.
|
|
48
|
+
*
|
|
49
|
+
* **Фокус после перерисовки.** Переставленный узел браузер переносит в
|
|
50
|
+
* документе, и фокус с него уходит. Поэтому, если фокус был на тосте, плагин
|
|
51
|
+
* ставит его новому переднему сразу и ещё раз кадром позже, когда разметка уже
|
|
52
|
+
* переставлена, — как перестановка колонки Table.
|
|
53
|
+
*
|
|
54
|
+
* Без стопки (`list`) плагин ничего не делает: колесо и стрелки остаются
|
|
55
|
+
* странице. Слушатели висят, пока есть узел региона.
|
|
56
|
+
*/
|
|
57
|
+
var TToastsCascadePlugin = class extends TBasePlugin {
|
|
58
|
+
_owner = null;
|
|
59
|
+
_engine = null;
|
|
60
|
+
_elements = null;
|
|
61
|
+
/** Узел региона: на нём слушатели колеса и клавиш. */
|
|
62
|
+
_region = null;
|
|
63
|
+
/** Жест колеса; `null` — колесо стоит. */
|
|
64
|
+
_gesture = null;
|
|
65
|
+
/** Конец жеста — по тишине колеса. */
|
|
66
|
+
_gestureTimer = null;
|
|
67
|
+
/** Возврат фокуса после перерисовки. */
|
|
68
|
+
_frame = null;
|
|
69
|
+
install(ctx) {
|
|
70
|
+
super.install(ctx);
|
|
71
|
+
this._owner = ctx.getInstance();
|
|
72
|
+
this._elements = ctx.get(TCollectionElements) ?? null;
|
|
73
|
+
const element = ctx.get(TElementPlugin);
|
|
74
|
+
element?.events.on("ready", (node) => this._attach(node));
|
|
75
|
+
element?.events.on("removed", () => this._detach());
|
|
76
|
+
ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => {
|
|
77
|
+
this._engine = engine;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
destroy() {
|
|
81
|
+
this._detach();
|
|
82
|
+
this._owner = null;
|
|
83
|
+
this._engine = null;
|
|
84
|
+
this._elements = null;
|
|
85
|
+
super.destroy();
|
|
86
|
+
}
|
|
87
|
+
_attach(node) {
|
|
88
|
+
this._detach();
|
|
89
|
+
const region = node;
|
|
90
|
+
region.addEventListener("wheel", this._onWheel, { passive: false });
|
|
91
|
+
region.addEventListener("keydown", this._onKeyDown);
|
|
92
|
+
this._region = region;
|
|
93
|
+
}
|
|
94
|
+
_detach() {
|
|
95
|
+
this._region?.removeEventListener("wheel", this._onWheel);
|
|
96
|
+
this._region?.removeEventListener("keydown", this._onKeyDown);
|
|
97
|
+
this._region = null;
|
|
98
|
+
this._endGesture();
|
|
99
|
+
this._cancelFrame();
|
|
100
|
+
}
|
|
101
|
+
/** Тосты стоят стопкой. */
|
|
102
|
+
get _cascade() {
|
|
103
|
+
return this._owner?.layout === "cascade";
|
|
104
|
+
}
|
|
105
|
+
_onWheel = (event) => {
|
|
106
|
+
if (!this._cascade || event.ctrlKey || event.defaultPrevented) return;
|
|
107
|
+
const distance = wheelDistance(event);
|
|
108
|
+
if (distance === 0 || this._open().length < 2) return;
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
const gesture = this._gesture ?? {
|
|
111
|
+
distance: 0,
|
|
112
|
+
stepped: false
|
|
113
|
+
};
|
|
114
|
+
this._gesture = gesture;
|
|
115
|
+
this._restartGesture();
|
|
116
|
+
if (gesture.stepped) return;
|
|
117
|
+
gesture.distance += distance;
|
|
118
|
+
if (Math.abs(gesture.distance) < WHEEL_STEP) return;
|
|
119
|
+
gesture.stepped = true;
|
|
120
|
+
const focused = this._toastOf(this._region?.ownerDocument?.activeElement ?? null);
|
|
121
|
+
const front = this._step(gesture.distance > 0 ? 1 : -1, focused);
|
|
122
|
+
if (front && focused) this._focus(front);
|
|
123
|
+
};
|
|
124
|
+
_onKeyDown = (event) => {
|
|
125
|
+
if (!this._cascade || event.defaultPrevented) return;
|
|
126
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
127
|
+
const step = arrowStep(event.key);
|
|
128
|
+
if (step === null || takesArrows(event.target)) return;
|
|
129
|
+
const toast = this._toastOf(event.target);
|
|
130
|
+
if (!toast) return;
|
|
131
|
+
const front = this._step(step, toast);
|
|
132
|
+
if (!front) return;
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
this._focus(front);
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Шаг стопки от тоста `reference` (под фокусом), а без него — от первого
|
|
138
|
+
* открытого. Новый порядок пишется перестановками одной пачкой: подписчики
|
|
139
|
+
* получают одно `change:items`. Отдаёт новый передний; листать нечего —
|
|
140
|
+
* `undefined`.
|
|
141
|
+
*
|
|
142
|
+
* Показанные — начало состава: предел видимых (`items:query:before`
|
|
143
|
+
* расширения `toasts`) берёт первые `max`, поэтому место тоста среди
|
|
144
|
+
* показанных и есть его индекс в коллекции.
|
|
145
|
+
*/
|
|
146
|
+
_step(direction, reference) {
|
|
147
|
+
const engine = this._engine;
|
|
148
|
+
const shown = engine?.extensions.batch.shown ?? [];
|
|
149
|
+
const open = shown.filter((toast) => toast.open);
|
|
150
|
+
const front = reference && open.includes(reference) ? reference : open[0];
|
|
151
|
+
if (!engine || !front || open.length < 2) return void 0;
|
|
152
|
+
const stack = [front, ...open.filter((toast) => toast !== front)];
|
|
153
|
+
const turned = direction === 1 ? [...stack.slice(1), front] : [...stack.slice(-1), ...stack.slice(0, -1)];
|
|
154
|
+
const order = [...turned, ...shown.filter((toast) => !toast.open)];
|
|
155
|
+
const { plain } = engine.extensions;
|
|
156
|
+
engine.batch(() => order.forEach((toast, index) => plain.move(toast, index)));
|
|
157
|
+
return turned[0];
|
|
158
|
+
}
|
|
159
|
+
/** Фокус — переднему, и ещё раз, когда разметка переставлена. */
|
|
160
|
+
_focus(toast) {
|
|
161
|
+
const node = this._elements?.getElementByItem(toast);
|
|
162
|
+
if (!isFocusableElement(node)) return;
|
|
163
|
+
node.focus();
|
|
164
|
+
this._cancelFrame();
|
|
165
|
+
this._frame = requestAnimationFrame(() => {
|
|
166
|
+
this._frame = null;
|
|
167
|
+
if (node.isConnected && node.ownerDocument.activeElement !== node) node.focus();
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/** Открытые показанные тосты — то, что листается. */
|
|
171
|
+
_open() {
|
|
172
|
+
return this._engine?.extensions.batch.shown.filter((toast) => toast.open) ?? [];
|
|
173
|
+
}
|
|
174
|
+
/** Открытый показанный тост, чей узел содержит цель. */
|
|
175
|
+
_toastOf(target) {
|
|
176
|
+
if (!(target instanceof Node)) return void 0;
|
|
177
|
+
return this._open().find((toast) => this._elements?.getElementByItem(toast)?.contains(target));
|
|
178
|
+
}
|
|
179
|
+
_restartGesture() {
|
|
180
|
+
if (this._gestureTimer !== null) clearTimeout(this._gestureTimer);
|
|
181
|
+
this._gestureTimer = setTimeout(() => this._endGesture(), WHEEL_GESTURE_END);
|
|
182
|
+
}
|
|
183
|
+
_endGesture() {
|
|
184
|
+
if (this._gestureTimer !== null) clearTimeout(this._gestureTimer);
|
|
185
|
+
this._gestureTimer = null;
|
|
186
|
+
this._gesture = null;
|
|
187
|
+
}
|
|
188
|
+
_cancelFrame() {
|
|
189
|
+
if (this._frame === null) return;
|
|
190
|
+
cancelAnimationFrame(this._frame);
|
|
191
|
+
this._frame = null;
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Прокрутка колесом по вертикали, px со знаком оси окна; `0` — колесо вбок
|
|
196
|
+
* (поперёк стопки) или стоит. Строки и страницы (`deltaMode` не пиксели)
|
|
197
|
+
* пикселей не знают: такой щелчок — сразу шаг.
|
|
198
|
+
*/
|
|
199
|
+
function wheelDistance(event) {
|
|
200
|
+
if (event.deltaY === 0 || Math.abs(event.deltaY) < Math.abs(event.deltaX)) return 0;
|
|
201
|
+
return event.deltaMode === 0 ? event.deltaY : Math.sign(event.deltaY) * WHEEL_STEP;
|
|
202
|
+
}
|
|
203
|
+
/** Шаг стрелки: ↓ — передний назад, ↑ — задний вперёд; другая клавиша — `null`. */
|
|
204
|
+
function arrowStep(key) {
|
|
205
|
+
if (key === "ArrowDown") return 1;
|
|
206
|
+
if (key === "ArrowUp") return -1;
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
/** Цель — поле, которому стрелки нужны самому. */
|
|
210
|
+
function takesArrows(target) {
|
|
211
|
+
return target instanceof Element && target.closest(TAKES_ARROWS) !== null;
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { TToastsCascadePlugin };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TPluginEvents } from '../../../base';
|
|
2
|
+
/**
|
|
3
|
+
* Своих событий у плагина нет: шаг стопки виден через коллекцию — перестановку
|
|
4
|
+
* сообщают `item:moved` и `change:order`, а фокус — DOM.
|
|
5
|
+
*/
|
|
6
|
+
export type TToastsCascadePluginEvents = TPluginEvents;
|
|
7
|
+
/** Шаг стопки: `1` — передний уходит назад, `-1` — задний выходит вперёд. */
|
|
8
|
+
export type TCascadeStep = 1 | -1;
|
|
9
|
+
/** Жест колеса: сколько прокрутили с его начала и был ли уже шаг. */
|
|
10
|
+
export type TWheelGesture = {
|
|
11
|
+
/** Прокрутка с начала жеста, px со знаком оси окна */
|
|
12
|
+
distance: number;
|
|
13
|
+
/** Шаг в этом жесте уже был: остаток жеста стопку не листает */
|
|
14
|
+
stepped: boolean;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './item-names.plugin';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IToastsItem } from '@soxa-ui/core';
|
|
2
|
+
import { TNamesPlugin } from '../../../locale/names.plugin';
|
|
3
|
+
import type { TTranslations } from '../../../locale/types';
|
|
4
|
+
/**
|
|
5
|
+
* TToastsItemNamesPlugin — имя кнопки закрытия тоста от локали: в `closeAria`,
|
|
6
|
+
* вместе с текстом тоста («Закрыть Сохранено»), как у тега. Пять одинаковых
|
|
7
|
+
* «Закрыть» в стопке скринридер не различил бы.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TToastsItemNamesPlugin extends TNamesPlugin<IToastsItem> {
|
|
10
|
+
protected _name(owner: IToastsItem, translations: TTranslations): void;
|
|
11
|
+
protected _watch(owner: IToastsItem, name: () => void): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { formatName } from "../../../locale/locale.js";
|
|
2
|
+
import { TNamesPlugin } from "../../../locale/names.plugin.js";
|
|
3
|
+
//#region src/custom/toasts/item-names/item-names.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TToastsItemNamesPlugin — имя кнопки закрытия тоста от локали: в `closeAria`,
|
|
6
|
+
* вместе с текстом тоста («Закрыть Сохранено»), как у тега. Пять одинаковых
|
|
7
|
+
* «Закрыть» в стопке скринридер не различил бы.
|
|
8
|
+
*/
|
|
9
|
+
var TToastsItemNamesPlugin = class extends TNamesPlugin {
|
|
10
|
+
_name(owner, translations) {
|
|
11
|
+
owner.closeAria.add("aria-label", formatName(translations.toasts.close, owner.text));
|
|
12
|
+
}
|
|
13
|
+
_watch(owner, name) {
|
|
14
|
+
this._listenTo(owner.events, "change:text", name);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { TToastsItemNamesPlugin };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IToasts } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TToastsKeyboardPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TToastsKeyboardPlugin — клавиатура тостов.
|
|
7
|
+
*
|
|
8
|
+
* Тосты фокус не забирают: появившееся уведомление не прерывает работу.
|
|
9
|
+
* Дойти до них с клавиатуры — F8 (как в Radix), её же называет имя региона
|
|
10
|
+
* («Уведомления (F8)»):
|
|
11
|
+
*
|
|
12
|
+
* - **F8** без модификаторов, если клавишу не погасили, поднимает регион над
|
|
13
|
+
* слоями (`raise`), запоминает, где был фокус вне региона, и ведёт фокус на
|
|
14
|
+
* новейший открытый тост. Тостов нет — клавиша не наша, и её никто не
|
|
15
|
+
* гасит;
|
|
16
|
+
* - **Escape** на тосте под фокусом (или на контроле в нём) закрывает его и
|
|
17
|
+
* гасится `preventDefault`. Погашенный раньше — например, поповером из
|
|
18
|
+
* содержимого тоста — тост не трогает: клавиша адресована верхнему слою;
|
|
19
|
+
* - **закрыли тост с фокусом** — крестиком, Escape, жестом или таймером, —
|
|
20
|
+
* фокус переходит соседнему открытому тосту, а если его нет — туда, где он
|
|
21
|
+
* был до перехода в регион. Иначе он остался бы на гаснущем тосте и ушёл бы
|
|
22
|
+
* на `body`, когда тост уйдёт из документа.
|
|
23
|
+
*
|
|
24
|
+
* Слушатели висят, пока есть узел региона.
|
|
25
|
+
*/
|
|
26
|
+
export declare class TToastsKeyboardPlugin extends TBasePlugin<IToasts, TToastsKeyboardPluginEvents> {
|
|
27
|
+
private _owner;
|
|
28
|
+
private _engine;
|
|
29
|
+
private _elements;
|
|
30
|
+
/** Узел региона: на нём слушатели Escape и входа фокуса. */
|
|
31
|
+
private _region;
|
|
32
|
+
private _document;
|
|
33
|
+
/** Где был фокус до перехода в регион: туда он вернётся, когда тостов не останется. */
|
|
34
|
+
private _return;
|
|
35
|
+
install(ctx: IPluginContext): void;
|
|
36
|
+
destroy(): void;
|
|
37
|
+
private _bindEngine;
|
|
38
|
+
private _attach;
|
|
39
|
+
private _detach;
|
|
40
|
+
/** F8 — фокус на новейший открытый тост. */
|
|
41
|
+
private readonly _onDocumentKeyDown;
|
|
42
|
+
/** Escape на тосте — закрыть его. */
|
|
43
|
+
private readonly _onRegionKeyDown;
|
|
44
|
+
/**
|
|
45
|
+
* Фокус пришёл в регион снаружи — запомнить откуда: Tab и нажатие тоже
|
|
46
|
+
* приводят к тостам, не только F8.
|
|
47
|
+
*/
|
|
48
|
+
private readonly _onFocusIn;
|
|
49
|
+
/** Закрыли тост с фокусом — фокус соседу, иначе туда, откуда пришли. */
|
|
50
|
+
private _passFocus;
|
|
51
|
+
/** Новейший открытый тост с узлом, который можно сфокусировать. */
|
|
52
|
+
private _newest;
|
|
53
|
+
/** Сосед закрытого тоста — следующий открытый, у последнего — предыдущий. */
|
|
54
|
+
private _neighbour;
|
|
55
|
+
/** Тост, чей узел содержит цель события. */
|
|
56
|
+
private _toastOf;
|
|
57
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
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 { isFocusableElement } from "../../../utils/isFocusableElement.js";
|
|
6
|
+
//#region src/custom/toasts/keyboard/keyboard.plugin.ts
|
|
7
|
+
/** Клавиша, которая ведёт фокус к тостам. F6 занят браузером — переход между панелями окна. */
|
|
8
|
+
var HOTKEY = "F8";
|
|
9
|
+
/**
|
|
10
|
+
* TToastsKeyboardPlugin — клавиатура тостов.
|
|
11
|
+
*
|
|
12
|
+
* Тосты фокус не забирают: появившееся уведомление не прерывает работу.
|
|
13
|
+
* Дойти до них с клавиатуры — F8 (как в Radix), её же называет имя региона
|
|
14
|
+
* («Уведомления (F8)»):
|
|
15
|
+
*
|
|
16
|
+
* - **F8** без модификаторов, если клавишу не погасили, поднимает регион над
|
|
17
|
+
* слоями (`raise`), запоминает, где был фокус вне региона, и ведёт фокус на
|
|
18
|
+
* новейший открытый тост. Тостов нет — клавиша не наша, и её никто не
|
|
19
|
+
* гасит;
|
|
20
|
+
* - **Escape** на тосте под фокусом (или на контроле в нём) закрывает его и
|
|
21
|
+
* гасится `preventDefault`. Погашенный раньше — например, поповером из
|
|
22
|
+
* содержимого тоста — тост не трогает: клавиша адресована верхнему слою;
|
|
23
|
+
* - **закрыли тост с фокусом** — крестиком, Escape, жестом или таймером, —
|
|
24
|
+
* фокус переходит соседнему открытому тосту, а если его нет — туда, где он
|
|
25
|
+
* был до перехода в регион. Иначе он остался бы на гаснущем тосте и ушёл бы
|
|
26
|
+
* на `body`, когда тост уйдёт из документа.
|
|
27
|
+
*
|
|
28
|
+
* Слушатели висят, пока есть узел региона.
|
|
29
|
+
*/
|
|
30
|
+
var TToastsKeyboardPlugin = class extends TBasePlugin {
|
|
31
|
+
_owner = null;
|
|
32
|
+
_engine = null;
|
|
33
|
+
_elements = null;
|
|
34
|
+
/** Узел региона: на нём слушатели Escape и входа фокуса. */
|
|
35
|
+
_region = null;
|
|
36
|
+
_document = null;
|
|
37
|
+
/** Где был фокус до перехода в регион: туда он вернётся, когда тостов не останется. */
|
|
38
|
+
_return = null;
|
|
39
|
+
install(ctx) {
|
|
40
|
+
super.install(ctx);
|
|
41
|
+
this._owner = ctx.getInstance();
|
|
42
|
+
this._elements = ctx.get(TCollectionElements) ?? null;
|
|
43
|
+
const element = ctx.get(TElementPlugin);
|
|
44
|
+
element?.events.on("ready", (node) => this._attach(node));
|
|
45
|
+
element?.events.on("removed", () => this._detach());
|
|
46
|
+
ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => this._bindEngine(engine));
|
|
47
|
+
}
|
|
48
|
+
destroy() {
|
|
49
|
+
this._detach();
|
|
50
|
+
this._owner = null;
|
|
51
|
+
this._engine = null;
|
|
52
|
+
this._elements = null;
|
|
53
|
+
super.destroy();
|
|
54
|
+
}
|
|
55
|
+
_bindEngine(engine) {
|
|
56
|
+
this._engine = engine;
|
|
57
|
+
this._listenTo(engine.extensions.toasts.events, "item:close", (toast) => this._passFocus(toast));
|
|
58
|
+
}
|
|
59
|
+
_attach(node) {
|
|
60
|
+
this._detach();
|
|
61
|
+
const region = node;
|
|
62
|
+
region.addEventListener("keydown", this._onRegionKeyDown);
|
|
63
|
+
region.addEventListener("focusin", this._onFocusIn);
|
|
64
|
+
node.ownerDocument.addEventListener("keydown", this._onDocumentKeyDown);
|
|
65
|
+
this._region = region;
|
|
66
|
+
this._document = node.ownerDocument;
|
|
67
|
+
}
|
|
68
|
+
_detach() {
|
|
69
|
+
this._region?.removeEventListener("keydown", this._onRegionKeyDown);
|
|
70
|
+
this._region?.removeEventListener("focusin", this._onFocusIn);
|
|
71
|
+
this._document?.removeEventListener("keydown", this._onDocumentKeyDown);
|
|
72
|
+
this._region = null;
|
|
73
|
+
this._document = null;
|
|
74
|
+
this._return = null;
|
|
75
|
+
}
|
|
76
|
+
/** F8 — фокус на новейший открытый тост. */
|
|
77
|
+
_onDocumentKeyDown = (event) => {
|
|
78
|
+
if (event.key !== HOTKEY || event.defaultPrevented) return;
|
|
79
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
80
|
+
const region = this._region;
|
|
81
|
+
const target = this._newest();
|
|
82
|
+
if (!region || !target) return;
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
this._owner?.raise();
|
|
85
|
+
const active = this._document?.activeElement;
|
|
86
|
+
if (active && !region.contains(active)) this._return = active;
|
|
87
|
+
target.focus();
|
|
88
|
+
};
|
|
89
|
+
/** Escape на тосте — закрыть его. */
|
|
90
|
+
_onRegionKeyDown = (event) => {
|
|
91
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
92
|
+
const toast = this._toastOf(event.target);
|
|
93
|
+
if (!toast?.open) return;
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
toast.close();
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Фокус пришёл в регион снаружи — запомнить откуда: Tab и нажатие тоже
|
|
99
|
+
* приводят к тостам, не только F8.
|
|
100
|
+
*/
|
|
101
|
+
_onFocusIn = (event) => {
|
|
102
|
+
const from = event.relatedTarget;
|
|
103
|
+
if (from instanceof Element && !this._region?.contains(from)) this._return = from;
|
|
104
|
+
};
|
|
105
|
+
/** Закрыли тост с фокусом — фокус соседу, иначе туда, откуда пришли. */
|
|
106
|
+
_passFocus(toast) {
|
|
107
|
+
const node = this._elements?.getElementByItem(toast);
|
|
108
|
+
const active = node?.ownerDocument.activeElement;
|
|
109
|
+
if (!node || !active || !node.contains(active)) return;
|
|
110
|
+
const neighbour = this._neighbour(toast);
|
|
111
|
+
const target = neighbour ? this._elements?.getElementByItem(neighbour) : this._return;
|
|
112
|
+
if (isFocusableElement(target) && target.isConnected) target.focus();
|
|
113
|
+
}
|
|
114
|
+
/** Новейший открытый тост с узлом, который можно сфокусировать. */
|
|
115
|
+
_newest() {
|
|
116
|
+
for (const toast of this._engine?.extensions.batch.shown ?? []) {
|
|
117
|
+
if (!toast.open) continue;
|
|
118
|
+
const node = this._elements?.getElementByItem(toast);
|
|
119
|
+
if (isFocusableElement(node)) return node;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
/** Сосед закрытого тоста — следующий открытый, у последнего — предыдущий. */
|
|
124
|
+
_neighbour(toast) {
|
|
125
|
+
const shown = this._engine?.extensions.batch.shown ?? [];
|
|
126
|
+
const index = shown.indexOf(toast);
|
|
127
|
+
return shown.slice(index + 1).find((item) => item.open) ?? shown.slice(0, Math.max(0, index)).reverse().find((item) => item.open);
|
|
128
|
+
}
|
|
129
|
+
/** Тост, чей узел содержит цель события. */
|
|
130
|
+
_toastOf(target) {
|
|
131
|
+
if (!(target instanceof Node)) return void 0;
|
|
132
|
+
return this._engine?.extensions.batch.shown.find((toast) => this._elements?.getElementByItem(toast)?.contains(target));
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
//#endregion
|
|
136
|
+
export { TToastsKeyboardPlugin };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TPluginEvents } from '../../../base';
|
|
2
|
+
/**
|
|
3
|
+
* Своих событий у плагина нет: результат клавиши виден и так — фокус
|
|
4
|
+
* сообщает DOM, закрытие — тост (`change:open`) и коллекция (`item:close`).
|
|
5
|
+
*/
|
|
6
|
+
export type TToastsKeyboardPluginEvents = TPluginEvents;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IToasts } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TToastsLayoutPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TToastsLayoutPlugin — раскладка региона тостов: номер слоя в стили.
|
|
7
|
+
*
|
|
8
|
+
* Регион ничего не меряет и координат не считает: место у края окна, отступы
|
|
9
|
+
* и стопку раскладывает тема по модификатору места. Плагину остаётся
|
|
10
|
+
* значение, которое в класс не уложить, — `z-index` слоя: регион поднимается
|
|
11
|
+
* в общем стеке на каждый новый тост и на F8, и номер у него каждый раз новый.
|
|
12
|
+
*
|
|
13
|
+
* Объект стилей заменяется целиком, а не мутируется: геттер отдаёт ссылку
|
|
14
|
+
* наружу, и без смены идентичности адаптер не увидит изменения.
|
|
15
|
+
* `change:styles` — только когда номер сменился.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TToastsLayoutPlugin extends TBasePlugin<IToasts, TToastsLayoutPluginEvents> {
|
|
18
|
+
private _styles;
|
|
19
|
+
install(ctx: IPluginContext): void;
|
|
20
|
+
/** Стили региона: `z-index` слоя. */
|
|
21
|
+
get styles(): Record<string, string | number>;
|
|
22
|
+
private _update;
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
//#region src/custom/toasts/layout/layout.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TToastsLayoutPlugin — раскладка региона тостов: номер слоя в стили.
|
|
5
|
+
*
|
|
6
|
+
* Регион ничего не меряет и координат не считает: место у края окна, отступы
|
|
7
|
+
* и стопку раскладывает тема по модификатору места. Плагину остаётся
|
|
8
|
+
* значение, которое в класс не уложить, — `z-index` слоя: регион поднимается
|
|
9
|
+
* в общем стеке на каждый новый тост и на F8, и номер у него каждый раз новый.
|
|
10
|
+
*
|
|
11
|
+
* Объект стилей заменяется целиком, а не мутируется: геттер отдаёт ссылку
|
|
12
|
+
* наружу, и без смены идентичности адаптер не увидит изменения.
|
|
13
|
+
* `change:styles` — только когда номер сменился.
|
|
14
|
+
*/
|
|
15
|
+
var TToastsLayoutPlugin = class extends TBasePlugin {
|
|
16
|
+
_styles = {};
|
|
17
|
+
install(ctx) {
|
|
18
|
+
super.install(ctx);
|
|
19
|
+
const owner = ctx.getInstance();
|
|
20
|
+
if (!owner) return;
|
|
21
|
+
this._listenTo(owner.events, "change:zIndex", () => this._update(owner));
|
|
22
|
+
this._update(owner);
|
|
23
|
+
}
|
|
24
|
+
/** Стили региона: `z-index` слоя. */
|
|
25
|
+
get styles() {
|
|
26
|
+
return this._styles;
|
|
27
|
+
}
|
|
28
|
+
_update(owner) {
|
|
29
|
+
const oldStyles = this.styles;
|
|
30
|
+
if (this._styles["z-index"] === owner.zIndex) return;
|
|
31
|
+
this._styles = { "z-index": owner.zIndex };
|
|
32
|
+
this.events.emit("change:styles", {
|
|
33
|
+
newValue: this._styles,
|
|
34
|
+
oldValue: oldStyles
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { TToastsLayoutPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './names.plugin';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IToasts } from '@soxa-ui/core';
|
|
2
|
+
import { TNamesPlugin } from '../../../locale/names.plugin';
|
|
3
|
+
import type { TTranslations } from '../../../locale/types';
|
|
4
|
+
/**
|
|
5
|
+
* TToastsNamesPlugin — имя региона тостов от локали: `aria-label` в `aria`
|
|
6
|
+
* владельца, вместе с клавишей, которая ведёт к тостам («Уведомления (F8)»).
|
|
7
|
+
*/
|
|
8
|
+
export declare class TToastsNamesPlugin extends TNamesPlugin<IToasts> {
|
|
9
|
+
protected _name(owner: IToasts, translations: TTranslations): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TNamesPlugin } from "../../../locale/names.plugin.js";
|
|
2
|
+
//#region src/custom/toasts/names/names.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TToastsNamesPlugin — имя региона тостов от локали: `aria-label` в `aria`
|
|
5
|
+
* владельца, вместе с клавишей, которая ведёт к тостам («Уведомления (F8)»).
|
|
6
|
+
*/
|
|
7
|
+
var TToastsNamesPlugin = class extends TNamesPlugin {
|
|
8
|
+
_name(owner, translations) {
|
|
9
|
+
owner.aria.add("aria-label", translations.toasts.region);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TToastsNamesPlugin };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IToasts } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TToastsRemovalPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TToastsRemovalPlugin — закрытый тост уходит из коллекции, когда догас.
|
|
7
|
+
*
|
|
8
|
+
* Закрытый тост из разметки не прячется: тема ведёт его переходом по
|
|
9
|
+
* `data-open="false"` — он гаснет, уезжает к стороне жеста, а место его
|
|
10
|
+
* схлопывается, — и коллекция держит его, пока переходы его узла не
|
|
11
|
+
* доиграли (`afterTransitions`), а потом удаляет (`plain.remove`). Сними его
|
|
12
|
+
* сразу — узел ушёл бы из документа посреди исчезания. Чисел темы плагин не
|
|
13
|
+
* знает: сколько ждать, решает переход; без движения и без переходов (jsdom)
|
|
14
|
+
* — тем же кадром.
|
|
15
|
+
*
|
|
16
|
+
* Узла у тоста нет — он не нарисован (вытеснен за предел видимых, региона нет
|
|
17
|
+
* или его ещё не отрисовали) — гаснуть нечему, и тост удаляется сразу.
|
|
18
|
+
*
|
|
19
|
+
* Закрытые до привязки движка — тосты, закрытые, пока компонента не было, —
|
|
20
|
+
* удаляются при привязке: их узлов в этом монтировании нет. Набор уничтожают,
|
|
21
|
+
* пока тост гаснет, — ожидание снимается, а тост удаляется сразу: он закрыт, а
|
|
22
|
+
* движок снаружи переживает компонент.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TToastsRemovalPlugin extends TBasePlugin<IToasts, TToastsRemovalPluginEvents> {
|
|
25
|
+
private _engine;
|
|
26
|
+
private _elements;
|
|
27
|
+
/** Тосты, которые гаснут: отмена ожидания — по тосту. */
|
|
28
|
+
private readonly _fading;
|
|
29
|
+
install(ctx: IPluginContext): void;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
private _bindEngine;
|
|
32
|
+
/** Закрытый тост: дождаться, пока его узел догаснет, и удалить. */
|
|
33
|
+
private _fade;
|
|
34
|
+
private _remove;
|
|
35
|
+
}
|