@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,21 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TTableRowIdsPlugin — имя строки таблицы в документе: `id` её заголовка.
|
|
5
|
+
*
|
|
6
|
+
* Заголовок строки — ячейка колонки `rowHeader`, и по её тексту строку
|
|
7
|
+
* называют: чекбокс выбора строки ссылается на неё (`aria-labelledby`). Своего
|
|
8
|
+
* экземпляра у ячейки нет, поэтому `id` уходит в набор строки `headerAria`, а
|
|
9
|
+
* на ячейку набор кладёт проекция ячеек — только у первой показанной колонки
|
|
10
|
+
* заголовка. Ссылку чекбокса строит она же (`rowHeaderId`), поэтому формула
|
|
11
|
+
* одна — здесь.
|
|
12
|
+
*
|
|
13
|
+
* `id` — от монтирования строки (`createId`), а не от экземпляра: он нужен
|
|
14
|
+
* только документу, и на сервере и в браузере обязан совпасть. Строку таблица
|
|
15
|
+
* рисует с готовым экземпляром (`ctrl`), и его конструктор адаптер не зовёт, а
|
|
16
|
+
* монтирование у неё своё. Пишется при установке, синхронно, — имя есть уже в
|
|
17
|
+
* первой (и серверной) отрисовке.
|
|
18
|
+
*/
|
|
19
|
+
export declare class TTableRowIdsPlugin extends TBasePlugin {
|
|
20
|
+
install(ctx: IPluginContext): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
//#region src/custom/table/row-ids/row-ids.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TTableRowIdsPlugin — имя строки таблицы в документе: `id` её заголовка.
|
|
5
|
+
*
|
|
6
|
+
* Заголовок строки — ячейка колонки `rowHeader`, и по её тексту строку
|
|
7
|
+
* называют: чекбокс выбора строки ссылается на неё (`aria-labelledby`). Своего
|
|
8
|
+
* экземпляра у ячейки нет, поэтому `id` уходит в набор строки `headerAria`, а
|
|
9
|
+
* на ячейку набор кладёт проекция ячеек — только у первой показанной колонки
|
|
10
|
+
* заголовка. Ссылку чекбокса строит она же (`rowHeaderId`), поэтому формула
|
|
11
|
+
* одна — здесь.
|
|
12
|
+
*
|
|
13
|
+
* `id` — от монтирования строки (`createId`), а не от экземпляра: он нужен
|
|
14
|
+
* только документу, и на сервере и в браузере обязан совпасть. Строку таблица
|
|
15
|
+
* рисует с готовым экземпляром (`ctrl`), и его конструктор адаптер не зовёт, а
|
|
16
|
+
* монтирование у неё своё. Пишется при установке, синхронно, — имя есть уже в
|
|
17
|
+
* первой (и серверной) отрисовке.
|
|
18
|
+
*/
|
|
19
|
+
var TTableRowIdsPlugin = class extends TBasePlugin {
|
|
20
|
+
install(ctx) {
|
|
21
|
+
super.install(ctx);
|
|
22
|
+
const row = ctx.getInstance();
|
|
23
|
+
if (!row) return;
|
|
24
|
+
row.headerAria.add("id", ctx.createId("header"));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TTableRowIdsPlugin };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ITabs } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TActiveTabOffset, TTabsActiveTabPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TTabsActiveTabPlugin — вычисляет позицию/размер активного таба (offset).
|
|
7
|
+
*
|
|
8
|
+
* Использует:
|
|
9
|
+
* - корень набора (через TElementPlugin) и его ряд — ребёнка корня, от
|
|
10
|
+
* которого считаются `offset*` табов;
|
|
11
|
+
* - активный элемент коллекции (engine.extensions.activation);
|
|
12
|
+
* - DOM-элемент активного таба (через TCollectionElements).
|
|
13
|
+
*
|
|
14
|
+
* Пересчитывает offset при активации/деактивации, удалении/перемещении элементов,
|
|
15
|
+
* изменении view и изменении layout (resize).
|
|
16
|
+
*
|
|
17
|
+
* **Удаление и перемещение пересчитываются кадром позже — и только при узле
|
|
18
|
+
* корня**: между `ready` и `removed` своего `TElementPlugin`. Сборка вместе с
|
|
19
|
+
* подписками плагина идёт и на сервере, и табы там уходят из коллекции — Solid
|
|
20
|
+
* снимает собранный корень после `renderToString`, — а узла там нет, как нет и
|
|
21
|
+
* `requestAnimationFrame`. Без узла мерить нечего (`_computeOffset` отдаёт
|
|
22
|
+
* `null`), и кадр не планируется: место активного таба померит `ready`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TTabsActiveTabPlugin extends TBasePlugin<ITabs, TTabsActiveTabPluginEvents> {
|
|
25
|
+
private _element;
|
|
26
|
+
private _tabs;
|
|
27
|
+
private _collectionElements;
|
|
28
|
+
private _engine;
|
|
29
|
+
/** Last published measurement, retained by reference for the next notification. */
|
|
30
|
+
private _offset;
|
|
31
|
+
install(ctx: IPluginContext): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
getOffset(): TActiveTabOffset | null;
|
|
34
|
+
private _emitOffset;
|
|
35
|
+
/**
|
|
36
|
+
* Пересчитать offset кадром позже — пока у плагина есть узел корня: разметка
|
|
37
|
+
* после удаления или перемещения таба ещё не перерисована. Без узла повод
|
|
38
|
+
* ничего не планирует: место активного таба померит `ready`.
|
|
39
|
+
*/
|
|
40
|
+
private _emitOffsetNextFrame;
|
|
41
|
+
private _computeOffset;
|
|
42
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 { isMeasurableElement } from "../../../utils/isMeasurableElement.js";
|
|
6
|
+
import { barOf } from "../parts.js";
|
|
7
|
+
import { TTabsLayoutPlugin } from "../layout/layout.plugin.js";
|
|
8
|
+
//#region src/custom/tabs/active-tab/active-tab.plugin.ts
|
|
9
|
+
/**
|
|
10
|
+
* TTabsActiveTabPlugin — вычисляет позицию/размер активного таба (offset).
|
|
11
|
+
*
|
|
12
|
+
* Использует:
|
|
13
|
+
* - корень набора (через TElementPlugin) и его ряд — ребёнка корня, от
|
|
14
|
+
* которого считаются `offset*` табов;
|
|
15
|
+
* - активный элемент коллекции (engine.extensions.activation);
|
|
16
|
+
* - DOM-элемент активного таба (через TCollectionElements).
|
|
17
|
+
*
|
|
18
|
+
* Пересчитывает offset при активации/деактивации, удалении/перемещении элементов,
|
|
19
|
+
* изменении view и изменении layout (resize).
|
|
20
|
+
*
|
|
21
|
+
* **Удаление и перемещение пересчитываются кадром позже — и только при узле
|
|
22
|
+
* корня**: между `ready` и `removed` своего `TElementPlugin`. Сборка вместе с
|
|
23
|
+
* подписками плагина идёт и на сервере, и табы там уходят из коллекции — Solid
|
|
24
|
+
* снимает собранный корень после `renderToString`, — а узла там нет, как нет и
|
|
25
|
+
* `requestAnimationFrame`. Без узла мерить нечего (`_computeOffset` отдаёт
|
|
26
|
+
* `null`), и кадр не планируется: место активного таба померит `ready`.
|
|
27
|
+
*/
|
|
28
|
+
var TTabsActiveTabPlugin = class extends TBasePlugin {
|
|
29
|
+
_element = null;
|
|
30
|
+
_tabs = null;
|
|
31
|
+
_collectionElements = null;
|
|
32
|
+
_engine = null;
|
|
33
|
+
/** Last published measurement, retained by reference for the next notification. */
|
|
34
|
+
_offset = null;
|
|
35
|
+
install(ctx) {
|
|
36
|
+
super.install(ctx);
|
|
37
|
+
this._tabs = ctx.getInstance();
|
|
38
|
+
this._collectionElements = ctx.get(TCollectionElements) ?? null;
|
|
39
|
+
ctx.get(TElementPlugin)?.events.on("ready", (element) => {
|
|
40
|
+
this._element = element;
|
|
41
|
+
this._emitOffset();
|
|
42
|
+
});
|
|
43
|
+
ctx.get(TElementPlugin)?.events.on("removed", () => {
|
|
44
|
+
this._element = null;
|
|
45
|
+
this._offset = null;
|
|
46
|
+
});
|
|
47
|
+
ctx.get(TTabsLayoutPlugin)?.events.on("change:layout", () => this._emitOffset());
|
|
48
|
+
ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => {
|
|
49
|
+
this._engine = engine;
|
|
50
|
+
const emit = () => this._emitOffset();
|
|
51
|
+
const emitNextFrame = () => this._emitOffsetNextFrame();
|
|
52
|
+
this._listenTo(engine.extensions.activation.events, "item:activated", emit);
|
|
53
|
+
this._listenTo(engine.extensions.activation.events, "item:deactivated", emit);
|
|
54
|
+
this._listenTo(engine.extensions.plain.events, "item:removed", emitNextFrame);
|
|
55
|
+
this._listenTo(engine.extensions.plain.events, "item:moved", emitNextFrame);
|
|
56
|
+
});
|
|
57
|
+
this._listenTo(this._tabs?.events, "change:view", () => this._emitOffset());
|
|
58
|
+
}
|
|
59
|
+
destroy() {
|
|
60
|
+
this._element = null;
|
|
61
|
+
this._offset = null;
|
|
62
|
+
this._tabs = null;
|
|
63
|
+
this._collectionElements = null;
|
|
64
|
+
this._engine = null;
|
|
65
|
+
super.destroy();
|
|
66
|
+
}
|
|
67
|
+
getOffset() {
|
|
68
|
+
return this._computeOffset();
|
|
69
|
+
}
|
|
70
|
+
_emitOffset() {
|
|
71
|
+
const oldValue = this._offset;
|
|
72
|
+
this._offset = this._computeOffset();
|
|
73
|
+
this.events.emit("change:active-tab", {
|
|
74
|
+
newValue: this._offset,
|
|
75
|
+
oldValue
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Пересчитать offset кадром позже — пока у плагина есть узел корня: разметка
|
|
80
|
+
* после удаления или перемещения таба ещё не перерисована. Без узла повод
|
|
81
|
+
* ничего не планирует: место активного таба померит `ready`.
|
|
82
|
+
*/
|
|
83
|
+
_emitOffsetNextFrame() {
|
|
84
|
+
if (this._element) requestAnimationFrame(() => this._emitOffset());
|
|
85
|
+
}
|
|
86
|
+
_computeOffset() {
|
|
87
|
+
if (!this._element || !this._collectionElements || !this._engine || !this._tabs) return null;
|
|
88
|
+
const barEl = barOf(this._tabs, this._element);
|
|
89
|
+
if (!isMeasurableElement(barEl)) return null;
|
|
90
|
+
const activeItem = this._engine.extensions.activation.activeItem;
|
|
91
|
+
const activeEl = activeItem ? this._collectionElements.getElementByUid(activeItem.uid) : null;
|
|
92
|
+
const activeBox = isMeasurableElement(activeEl) ? activeEl : null;
|
|
93
|
+
return {
|
|
94
|
+
barEl,
|
|
95
|
+
offsetLeft: activeBox ? activeBox.offsetLeft : 0,
|
|
96
|
+
offsetWidth: activeBox ? activeBox.offsetWidth : 0,
|
|
97
|
+
offsetTop: activeBox ? activeBox.offsetTop : 0,
|
|
98
|
+
offsetHeight: activeBox ? activeBox.offsetHeight : 0
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { TTabsActiveTabPlugin };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TValuePayload } from '@soxa-ui/core';
|
|
2
|
+
import type { TPluginEvents } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* Место активного таба: `offset*` его узла — от ряда набора (`barEl`), его
|
|
5
|
+
* ближайшего позиционированного предка в разметке темы. Нет активного таба —
|
|
6
|
+
* нули.
|
|
7
|
+
*/
|
|
8
|
+
export type TActiveTabOffset = {
|
|
9
|
+
barEl: HTMLElement;
|
|
10
|
+
offsetLeft: number;
|
|
11
|
+
offsetWidth: number;
|
|
12
|
+
offsetTop: number;
|
|
13
|
+
offsetHeight: number;
|
|
14
|
+
};
|
|
15
|
+
export type TTabsActiveTabPluginEvents = TPluginEvents & {
|
|
16
|
+
'change:active-tab': (payload: TValuePayload<TActiveTabOffset | null>) => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TTabsContentWarnPlugin — предупреждает, если DOM-узел панели `Tabs.Content`
|
|
5
|
+
* оказался внутри `[role="tablist"]`.
|
|
6
|
+
*
|
|
7
|
+
* Верный знак, что панель положили в слот `default` вместо `content`: `default`
|
|
8
|
+
* рендерится внутри списка табов (`[role=tablist]`), `content` — снаружи.
|
|
9
|
+
* Перепутанный слот иначе виден только глазами.
|
|
10
|
+
*
|
|
11
|
+
* Диагностика, не защита: исключение не бросаем — позиция панели не мешает
|
|
12
|
+
* работе, связка с табом по `value` и ARIA остаются корректными независимо от
|
|
13
|
+
* того, куда панель попала в разметке.
|
|
14
|
+
*
|
|
15
|
+
* Узел берётся у `TElementPlugin` из общего bundle: сразу, если элемент уже
|
|
16
|
+
* готов, иначе по событию `ready`. До монтирования (в т.ч. SSR) узла нет —
|
|
17
|
+
* проверка молчит.
|
|
18
|
+
*/
|
|
19
|
+
export declare class TTabsContentWarnPlugin extends TBasePlugin {
|
|
20
|
+
install(ctx: IPluginContext): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
3
|
+
//#region src/custom/tabs/content-warn/content-warn.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TTabsContentWarnPlugin — предупреждает, если DOM-узел панели `Tabs.Content`
|
|
6
|
+
* оказался внутри `[role="tablist"]`.
|
|
7
|
+
*
|
|
8
|
+
* Верный знак, что панель положили в слот `default` вместо `content`: `default`
|
|
9
|
+
* рендерится внутри списка табов (`[role=tablist]`), `content` — снаружи.
|
|
10
|
+
* Перепутанный слот иначе виден только глазами.
|
|
11
|
+
*
|
|
12
|
+
* Диагностика, не защита: исключение не бросаем — позиция панели не мешает
|
|
13
|
+
* работе, связка с табом по `value` и ARIA остаются корректными независимо от
|
|
14
|
+
* того, куда панель попала в разметке.
|
|
15
|
+
*
|
|
16
|
+
* Узел берётся у `TElementPlugin` из общего bundle: сразу, если элемент уже
|
|
17
|
+
* готов, иначе по событию `ready`. До монтирования (в т.ч. SSR) узла нет —
|
|
18
|
+
* проверка молчит.
|
|
19
|
+
*/
|
|
20
|
+
var TTabsContentWarnPlugin = class extends TBasePlugin {
|
|
21
|
+
install(ctx) {
|
|
22
|
+
super.install(ctx);
|
|
23
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
24
|
+
if (!elementPlugin) return;
|
|
25
|
+
const check = (el) => {
|
|
26
|
+
if (!el || !el.closest("[role=\"tablist\"]")) return;
|
|
27
|
+
console.warn("[soxa] Tabs.Content оказался внутри [role=\"tablist\"]: панель нужно класть в слот `content`, а не в `default`.");
|
|
28
|
+
};
|
|
29
|
+
if (elementPlugin.element) {
|
|
30
|
+
check(elementPlugin.element);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const onReady = (el) => {
|
|
34
|
+
elementPlugin.events.off("ready", onReady);
|
|
35
|
+
check(el);
|
|
36
|
+
};
|
|
37
|
+
elementPlugin.events.on("ready", onReady);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { TTabsContentWarnPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './content-warn.plugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './item-ids.plugin';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import { TIdPlugin } from '../../id';
|
|
4
|
+
/**
|
|
5
|
+
* TTabsItemIdsPlugin — связка «таб ↔ панель» в документе со стороны таба.
|
|
6
|
+
*
|
|
7
|
+
* Пишет в `aria` таба его `id` и `aria-controls` — `id` его панели; других
|
|
8
|
+
* писателей у этих атрибутов нет. Панель своей формулы не держит: проводка
|
|
9
|
+
* `Tabs.Content` (`TTabsContentBindingExtension`) берёт у таба, которого нашла
|
|
10
|
+
* по `value`, его `id` себе в `aria-labelledby`, а `id` себе — из
|
|
11
|
+
* `aria-controls`, если своего у неё нет, — и идёт за ними на каждую смену
|
|
12
|
+
* набора таба (`change:aria`).
|
|
13
|
+
*
|
|
14
|
+
* `id`, заданный приложением, главнее `id` от монтирования — с обеих сторон
|
|
15
|
+
* связки. Свой `id` таба (`TIdPlugin` таба) встаёт на строку таба, и на него
|
|
16
|
+
* ссылается панель. Свой `id` панели (`TIdPlugin` панели) таб узнаёт от
|
|
17
|
+
* связки: принятая панель отдаёт плагину свой `TIdPlugin` (`bindPanel`), и
|
|
18
|
+
* `aria-controls` ведёт на `id` из него, отвязанная (`unbindPanel`) — снова на
|
|
19
|
+
* формулу. Сменили или сняли `id` с любой стороны — плагин переписывает набор,
|
|
20
|
+
* и панель идёт следом.
|
|
21
|
+
*
|
|
22
|
+
* Без них — `id` от монтирования, а не от экземпляра: он нужен только
|
|
23
|
+
* документу, и на сервере и в браузере обязан совпасть. Таб из данных
|
|
24
|
+
* рисуется с готовым экземпляром (`ctrl`), и его конструктор адаптер не зовёт,
|
|
25
|
+
* а монтирование у него своё. Пишется при установке, синхронно, — связка таба
|
|
26
|
+
* есть уже в первой (и серверной) отрисовке. Свой `id` панели приходит позже,
|
|
27
|
+
* со входом панели: таб в разметке раньше неё, и в разметке сервера его
|
|
28
|
+
* `aria-controls` ведёт на формулу, а у панели уже свой `id` — ссылка сходится
|
|
29
|
+
* после гидратации. Плата: `aria-controls` стоит и тогда, когда `Tabs.Content`
|
|
30
|
+
* в разметке нет вовсе; в паттерне вкладок панель обязательна.
|
|
31
|
+
*/
|
|
32
|
+
export declare class TTabsItemIdsPlugin extends TBasePlugin {
|
|
33
|
+
/** Таб — с установки; после `destroy()` писать некуда. */
|
|
34
|
+
private _tab;
|
|
35
|
+
/** `id` панели от монтирования таба — пока своего у панели нет. */
|
|
36
|
+
private _formula;
|
|
37
|
+
/** `TIdPlugin` привязанной панели: `id`, который ей задало приложение. */
|
|
38
|
+
private _panel;
|
|
39
|
+
install(ctx: IPluginContext): void;
|
|
40
|
+
/**
|
|
41
|
+
* Панель таба отдаёт свой `TIdPlugin`: `aria-controls` ведёт на `id`,
|
|
42
|
+
* который ей задало приложение, и идёт за его сменой; не задан — на
|
|
43
|
+
* формулу. Зовёт связка панели, когда принятая панель нашла таб. Панель у
|
|
44
|
+
* таба одна: привязанная следом заменяет прежнюю.
|
|
45
|
+
*/
|
|
46
|
+
bindPanel(panel: TIdPlugin): void;
|
|
47
|
+
/**
|
|
48
|
+
* Панель отвязалась: `aria-controls` — снова на формулу. Чужую панель
|
|
49
|
+
* отвязка не трогает: новое монтирование панели бывает принято раньше,
|
|
50
|
+
* чем снято прежнее.
|
|
51
|
+
*/
|
|
52
|
+
unbindPanel(panel: TIdPlugin): void;
|
|
53
|
+
/**
|
|
54
|
+
* Шина `TIdPlugin` панели плагину чужая: панель переживает монтирование
|
|
55
|
+
* таба — таб из данных монтируется заново, когда его показывают снова.
|
|
56
|
+
*/
|
|
57
|
+
destroy(): void;
|
|
58
|
+
/** `aria-controls` — на `id` панели: свой, если его задали, иначе формула. */
|
|
59
|
+
private readonly _writeControls;
|
|
60
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TIdPlugin } from "../../id/id.plugin.js";
|
|
3
|
+
//#region src/custom/tabs/item-ids/item-ids.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TTabsItemIdsPlugin — связка «таб ↔ панель» в документе со стороны таба.
|
|
6
|
+
*
|
|
7
|
+
* Пишет в `aria` таба его `id` и `aria-controls` — `id` его панели; других
|
|
8
|
+
* писателей у этих атрибутов нет. Панель своей формулы не держит: проводка
|
|
9
|
+
* `Tabs.Content` (`TTabsContentBindingExtension`) берёт у таба, которого нашла
|
|
10
|
+
* по `value`, его `id` себе в `aria-labelledby`, а `id` себе — из
|
|
11
|
+
* `aria-controls`, если своего у неё нет, — и идёт за ними на каждую смену
|
|
12
|
+
* набора таба (`change:aria`).
|
|
13
|
+
*
|
|
14
|
+
* `id`, заданный приложением, главнее `id` от монтирования — с обеих сторон
|
|
15
|
+
* связки. Свой `id` таба (`TIdPlugin` таба) встаёт на строку таба, и на него
|
|
16
|
+
* ссылается панель. Свой `id` панели (`TIdPlugin` панели) таб узнаёт от
|
|
17
|
+
* связки: принятая панель отдаёт плагину свой `TIdPlugin` (`bindPanel`), и
|
|
18
|
+
* `aria-controls` ведёт на `id` из него, отвязанная (`unbindPanel`) — снова на
|
|
19
|
+
* формулу. Сменили или сняли `id` с любой стороны — плагин переписывает набор,
|
|
20
|
+
* и панель идёт следом.
|
|
21
|
+
*
|
|
22
|
+
* Без них — `id` от монтирования, а не от экземпляра: он нужен только
|
|
23
|
+
* документу, и на сервере и в браузере обязан совпасть. Таб из данных
|
|
24
|
+
* рисуется с готовым экземпляром (`ctrl`), и его конструктор адаптер не зовёт,
|
|
25
|
+
* а монтирование у него своё. Пишется при установке, синхронно, — связка таба
|
|
26
|
+
* есть уже в первой (и серверной) отрисовке. Свой `id` панели приходит позже,
|
|
27
|
+
* со входом панели: таб в разметке раньше неё, и в разметке сервера его
|
|
28
|
+
* `aria-controls` ведёт на формулу, а у панели уже свой `id` — ссылка сходится
|
|
29
|
+
* после гидратации. Плата: `aria-controls` стоит и тогда, когда `Tabs.Content`
|
|
30
|
+
* в разметке нет вовсе; в паттерне вкладок панель обязательна.
|
|
31
|
+
*/
|
|
32
|
+
var TTabsItemIdsPlugin = class extends TBasePlugin {
|
|
33
|
+
/** Таб — с установки; после `destroy()` писать некуда. */
|
|
34
|
+
_tab = null;
|
|
35
|
+
/** `id` панели от монтирования таба — пока своего у панели нет. */
|
|
36
|
+
_formula = "";
|
|
37
|
+
/** `TIdPlugin` привязанной панели: `id`, который ей задало приложение. */
|
|
38
|
+
_panel;
|
|
39
|
+
install(ctx) {
|
|
40
|
+
super.install(ctx);
|
|
41
|
+
const tab = ctx.getInstance();
|
|
42
|
+
if (!tab) return;
|
|
43
|
+
const idPlugin = ctx.get(TIdPlugin);
|
|
44
|
+
const mountId = ctx.createId("tab");
|
|
45
|
+
const write = () => {
|
|
46
|
+
tab.aria.add("id", idPlugin?.id ?? mountId);
|
|
47
|
+
};
|
|
48
|
+
this._tab = tab;
|
|
49
|
+
this._formula = ctx.createId("panel");
|
|
50
|
+
write();
|
|
51
|
+
this._writeControls();
|
|
52
|
+
idPlugin?.events.on("change:id", write);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Панель таба отдаёт свой `TIdPlugin`: `aria-controls` ведёт на `id`,
|
|
56
|
+
* который ей задало приложение, и идёт за его сменой; не задан — на
|
|
57
|
+
* формулу. Зовёт связка панели, когда принятая панель нашла таб. Панель у
|
|
58
|
+
* таба одна: привязанная следом заменяет прежнюю.
|
|
59
|
+
*/
|
|
60
|
+
bindPanel(panel) {
|
|
61
|
+
if (this._panel === panel) return;
|
|
62
|
+
this._panel?.events.off("change:id", this._writeControls);
|
|
63
|
+
this._panel = panel;
|
|
64
|
+
panel.events.on("change:id", this._writeControls);
|
|
65
|
+
this._writeControls();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Панель отвязалась: `aria-controls` — снова на формулу. Чужую панель
|
|
69
|
+
* отвязка не трогает: новое монтирование панели бывает принято раньше,
|
|
70
|
+
* чем снято прежнее.
|
|
71
|
+
*/
|
|
72
|
+
unbindPanel(panel) {
|
|
73
|
+
if (this._panel !== panel) return;
|
|
74
|
+
panel.events.off("change:id", this._writeControls);
|
|
75
|
+
this._panel = void 0;
|
|
76
|
+
this._writeControls();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Шина `TIdPlugin` панели плагину чужая: панель переживает монтирование
|
|
80
|
+
* таба — таб из данных монтируется заново, когда его показывают снова.
|
|
81
|
+
*/
|
|
82
|
+
destroy() {
|
|
83
|
+
this._panel?.events.off("change:id", this._writeControls);
|
|
84
|
+
this._panel = void 0;
|
|
85
|
+
this._tab = null;
|
|
86
|
+
super.destroy();
|
|
87
|
+
}
|
|
88
|
+
/** `aria-controls` — на `id` панели: свой, если его задали, иначе формула. */
|
|
89
|
+
_writeControls = () => {
|
|
90
|
+
this._tab?.aria.add("aria-controls", this._panel?.id ?? this._formula);
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { TTabsItemIdsPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './item-names.plugin';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ITabsItem } from '@soxa-ui/core';
|
|
2
|
+
import { TNamesPlugin } from '../../../locale/names.plugin';
|
|
3
|
+
import type { TTranslations } from '../../../locale/types';
|
|
4
|
+
/**
|
|
5
|
+
* TTabsItemNamesPlugin — имя кнопки закрытия таба от локали: в `closeAria`,
|
|
6
|
+
* вместе с текстом таба — «Close Настройки».
|
|
7
|
+
*
|
|
8
|
+
* Без текста все кнопки закрытия в наборе назывались бы одинаково, и по
|
|
9
|
+
* списку элементов скринридера («Close, кнопка» пять раз подряд) выбрать
|
|
10
|
+
* нужную было бы невозможно. Как имя складывается с текстом, решает шаблон
|
|
11
|
+
* локали (`tabs.close`): порядок слов у каждого языка свой. Сменился текст —
|
|
12
|
+
* имя переписывается.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TTabsItemNamesPlugin extends TNamesPlugin<ITabsItem> {
|
|
15
|
+
protected _name(owner: ITabsItem, translations: TTranslations): void;
|
|
16
|
+
protected _watch(owner: ITabsItem, name: () => void): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { formatName } from "../../../locale/locale.js";
|
|
2
|
+
import { TNamesPlugin } from "../../../locale/names.plugin.js";
|
|
3
|
+
//#region src/custom/tabs/item-names/item-names.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TTabsItemNamesPlugin — имя кнопки закрытия таба от локали: в `closeAria`,
|
|
6
|
+
* вместе с текстом таба — «Close Настройки».
|
|
7
|
+
*
|
|
8
|
+
* Без текста все кнопки закрытия в наборе назывались бы одинаково, и по
|
|
9
|
+
* списку элементов скринридера («Close, кнопка» пять раз подряд) выбрать
|
|
10
|
+
* нужную было бы невозможно. Как имя складывается с текстом, решает шаблон
|
|
11
|
+
* локали (`tabs.close`): порядок слов у каждого языка свой. Сменился текст —
|
|
12
|
+
* имя переписывается.
|
|
13
|
+
*/
|
|
14
|
+
var TTabsItemNamesPlugin = class extends TNamesPlugin {
|
|
15
|
+
_name(owner, translations) {
|
|
16
|
+
owner.closeAria.add("aria-label", formatName(translations.tabs.close, owner.text));
|
|
17
|
+
}
|
|
18
|
+
_watch(owner, name) {
|
|
19
|
+
this._listenTo(owner.events, "change:text", name);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TTabsItemNamesPlugin };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ITabs } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TTabsKeyboardPluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TTabsKeyboardPlugin — клавиатура Tabs по паттерну APG Tabs и фокус после
|
|
7
|
+
* закрытия таба.
|
|
8
|
+
*
|
|
9
|
+
* Стрелки по оси списка (у горизонтального ←/→, у вертикального ↑/↓) ведут к
|
|
10
|
+
* соседнему табу по кругу, `Home`/`End` — к первому и последнему. Табы, на
|
|
11
|
+
* которые нельзя перейти (`TTabsExtension.isEnabledTab`), пропускаются.
|
|
12
|
+
* `Delete` закрывает таб, если его можно закрыть.
|
|
13
|
+
*
|
|
14
|
+
* **Активация автоматическая**: переход сразу активирует таб. APG советует
|
|
15
|
+
* так, когда панель показывается без задержки, а `Tabs.Content` рисуется
|
|
16
|
+
* локально. Поэтому фокус и активный таб не расходятся, и остановка Tab —
|
|
17
|
+
* активный таб — считается в коллекции без знания о фокусе. `Enter` и пробел
|
|
18
|
+
* здесь не обрабатываются: таб — нативная `<button>`, и активирует её клик.
|
|
19
|
+
*
|
|
20
|
+
* **Закрытый таб отдаёт фокус остановке Tab** — любым закрытием: клавишей,
|
|
21
|
+
* крестиком, из кода. Крестик фокус от клика принимает, и узел таба уходит из
|
|
22
|
+
* документа вместе с ним: фокус ушёл бы на страницу, и следующий Tab начинал
|
|
23
|
+
* бы обход заново. Переносится только фокус из узла закрываемого таба — на
|
|
24
|
+
* таб-остановку после удаления (`tabStop`): закрыли активный — это сосед,
|
|
25
|
+
* которого уже активировал `TTabsExtension`; закрыли неактивный — прежний
|
|
26
|
+
* активный, соседа такое закрытие не активирует. Остановки нет — к первой
|
|
27
|
+
* остановке Tab после списка; нет и её — фокус не трогается.
|
|
28
|
+
*
|
|
29
|
+
* Когда переносить фокус, решает помощник коллекции (`TLeavingFocus`), общий с
|
|
30
|
+
* Tags: таб бывает снят ещё до того, как закрытие дойдёт до плагина, —
|
|
31
|
+
* подписчиком `item:close`, который стоит раньше, например приложением в
|
|
32
|
+
* обработчике события фасада. Удаление, отменённое в `item:remove:before`, и
|
|
33
|
+
* уход таба без закрытия фокус не трогают. Закрыть таб из кода можно и на
|
|
34
|
+
* сервере, поэтому фокус читается только при узле корня.
|
|
35
|
+
*
|
|
36
|
+
* Сами `tabindex` плагин не пишет: roving tabindex ставит `TTabsExtension`,
|
|
37
|
+
* потому что атрибут обязан стоять с первой отрисовки, включая серверную.
|
|
38
|
+
* Здесь только то, что требует DOM: слушатель клавиш и перенос фокуса.
|
|
39
|
+
*
|
|
40
|
+
* От `TListNavigationPlugin` не наследуется: там модель подсветки при фокусе
|
|
41
|
+
* на контейнере, а у табов по APG фокус ходит по самим табам (см. AGENTS.md,
|
|
42
|
+
* «Граница переиспользования между похожими компонентами»).
|
|
43
|
+
*/
|
|
44
|
+
export declare class TTabsKeyboardPlugin extends TBasePlugin<ITabs, TTabsKeyboardPluginEvents> {
|
|
45
|
+
private _owner;
|
|
46
|
+
/** Корень: на нём слушатель, по нему же направление письма. */
|
|
47
|
+
private _element;
|
|
48
|
+
private _elements;
|
|
49
|
+
private _engine;
|
|
50
|
+
/** Фокус закрываемого таба — ждёт, пока таб закроют и он уйдёт из списка. */
|
|
51
|
+
private _leaving;
|
|
52
|
+
install(ctx: IPluginContext): void;
|
|
53
|
+
destroy(): void;
|
|
54
|
+
private _attach;
|
|
55
|
+
private _detach;
|
|
56
|
+
/** Движок сменился — закрытие табов и их уход слушаются у нового. */
|
|
57
|
+
private _bindEngine;
|
|
58
|
+
private readonly _onKeyDown;
|
|
59
|
+
/**
|
|
60
|
+
* Таб, с которого пришла клавиша, — тот, чей узел содержит цель события.
|
|
61
|
+
*
|
|
62
|
+
* Слушатель висит на корне, и до него всплывают клавиши панелей, слотов
|
|
63
|
+
* списка и вложенных Tabs: их перехватывать нельзя. Кнопка закрытия лежит
|
|
64
|
+
* внутри узла таба и считается его частью.
|
|
65
|
+
*/
|
|
66
|
+
private _tabOf;
|
|
67
|
+
/**
|
|
68
|
+
* Куда ведёт клавиша — табы по порядку, от первого кандидата; пусто —
|
|
69
|
+
* клавиша не наша или перейти некуда. `Home` идёт от первого вперёд,
|
|
70
|
+
* `End` — от последнего назад, стрелка — от соседа в своём направлении.
|
|
71
|
+
*/
|
|
72
|
+
private _candidates;
|
|
73
|
+
/**
|
|
74
|
+
* Шаг по списку от стрелки; клавиши чужой оси не перехватываются. В RTL
|
|
75
|
+
* горизонтальный список идёт справа налево, и ←/→ меняются местами.
|
|
76
|
+
*/
|
|
77
|
+
private _step;
|
|
78
|
+
/**
|
|
79
|
+
* Направление письма берётся вычисленным: `direction` компонента бывает
|
|
80
|
+
* `inherit`, и тогда его задаёт предок.
|
|
81
|
+
*/
|
|
82
|
+
private get _rtl();
|
|
83
|
+
/** Табы в порядке списка, на которые можно перейти. */
|
|
84
|
+
private _available;
|
|
85
|
+
/**
|
|
86
|
+
* Табы в направлении шага, по кругу, от ближайшего: с последнего вперёд —
|
|
87
|
+
* на первый. Отсчёт от позиции таба в списке, а не среди доступных: таб
|
|
88
|
+
* могли выключить, пока на нём фокус.
|
|
89
|
+
*/
|
|
90
|
+
private _neighbours;
|
|
91
|
+
/** Фокус на узел таба с ролью. Гард нужен: узел плагину приходит `Element`. */
|
|
92
|
+
private _focus;
|
|
93
|
+
/**
|
|
94
|
+
* Таб закрывают — любым путём: клавишей, крестиком, из кода. Переносить
|
|
95
|
+
* ли фокус, решает помощник: фокус мог стоять и не в этом табе.
|
|
96
|
+
*/
|
|
97
|
+
private readonly _onClose;
|
|
98
|
+
/**
|
|
99
|
+
* Фокус закрытого таба — на таб-остановку. Остановка берётся по модели
|
|
100
|
+
* (`tabStop`), а не по `[tabindex="0"]`: в такте закрытия разметка ещё
|
|
101
|
+
* старая. Остановки нет — на первую остановку Tab после списка: за ним
|
|
102
|
+
* слот `trailing` и панели; нет и её — фокус остаётся, где был.
|
|
103
|
+
*/
|
|
104
|
+
private _pass;
|
|
105
|
+
}
|