@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,311 @@
|
|
|
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 { scrollParentOf } from "../../utils/scrollParent.js";
|
|
6
|
+
import { drawOf } from "@soxa-ui/core";
|
|
7
|
+
//#region src/custom/virtual/virtual.plugin.ts
|
|
8
|
+
/** Причина закрепления элемента в окне — в нём DOM-фокус. */
|
|
9
|
+
var FOCUS = "focus";
|
|
10
|
+
/** У узла есть коробка: скрытый список (`display: none` у предка) её не даёт. */
|
|
11
|
+
function hasBox(node) {
|
|
12
|
+
const rect = node.getBoundingClientRect();
|
|
13
|
+
return rect.width > 0 || rect.height > 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* TVirtualPlugin — the collection's window in the document: it measures the
|
|
17
|
+
* visible band and the step of the items, and tracks the item with DOM focus.
|
|
18
|
+
*
|
|
19
|
+
* What to draw is decided by the collection's drawing (`draw`); the plugin
|
|
20
|
+
* gives it what only the live document knows: which part of the list is
|
|
21
|
+
* visible (`notifyViewport`) and which item holds focus (the `focus` pin). The
|
|
22
|
+
* `Virtual` wrapper puts the plugin into the collection's bundle when the
|
|
23
|
+
* collection picks up its window: by then the engine is bound to the bundles
|
|
24
|
+
* registry, and the plugin takes item nodes from the registry of nodes. While
|
|
25
|
+
* there is no window, the plugin listens to nothing.
|
|
26
|
+
*
|
|
27
|
+
* **What scrolls the window.** The parent of the drawn items if it scrolls
|
|
28
|
+
* itself (ListBox with `maxRows`, the list in the Select panel), otherwise the
|
|
29
|
+
* nearest ancestor that scrolls vertically, otherwise the page. There is no
|
|
30
|
+
* prop: a block of limited height and the page work without setup. The
|
|
31
|
+
* container is looked up again when the size of the list or the container
|
|
32
|
+
* changes — with it changes whether the container scrolls.
|
|
33
|
+
*
|
|
34
|
+
* **One measurement a frame**, on scrolling of the container and the page, on
|
|
35
|
+
* resizing of the list and the container, on a change of what the collection
|
|
36
|
+
* draws, and when the first drawn item enters the document while none was in
|
|
37
|
+
* it: the markup may draw the entries later than the window has them — the
|
|
38
|
+
* Select panel builds its options from data on its first opening, and `drawn`
|
|
39
|
+
* does not change then. The band is the intersection of the container's
|
|
40
|
+
* window with the browser's, from the top of the list. The top of the list is
|
|
41
|
+
* the top of a drawn item minus its place times the step: the list may have no
|
|
42
|
+
* markup of its own at all (the header and footer of ListBox, the table
|
|
43
|
+
* body), and the items stand from its top a step apart. The step is the
|
|
44
|
+
* smallest distance between the tops of neighboring drawn items: no item is
|
|
45
|
+
* shorter than the step, the theme holds its height. With one item drawn — the
|
|
46
|
+
* previous step, and on the first measurement its height; no items in the
|
|
47
|
+
* document — no measurement. No box at the drawn item (the list is hidden) —
|
|
48
|
+
* no measurement either: from zero boxes the top of the list would slide to
|
|
49
|
+
* the start, and while the list is hidden the window would follow it frame
|
|
50
|
+
* after frame; this way it stays where it stood.
|
|
51
|
+
*
|
|
52
|
+
* **A tall item.** Items in the window share one height: an item taller than
|
|
53
|
+
* the step shifts the fillers, and scrolling drifts. The plugin finds such an
|
|
54
|
+
* item while measuring and warns in the console — once per mount.
|
|
55
|
+
*
|
|
56
|
+
* **Focus.** The item DOM focus came into is pinned in the window: scrolling
|
|
57
|
+
* does not take it out of the document while focus is in it. Focus moved to a
|
|
58
|
+
* node outside the component — no pin.
|
|
59
|
+
*/
|
|
60
|
+
var TVirtualPlugin = class extends TBasePlugin {
|
|
61
|
+
_root = null;
|
|
62
|
+
_draw = null;
|
|
63
|
+
_elements = null;
|
|
64
|
+
/** Родитель нарисованных элементов: за его размером плагин следит. */
|
|
65
|
+
_list = null;
|
|
66
|
+
/** Контейнер прокрутки; `null` — прокручивает страница. */
|
|
67
|
+
_container = null;
|
|
68
|
+
_resize = null;
|
|
69
|
+
/** За чьим размером наблюдатель следит сейчас: список и контейнер. */
|
|
70
|
+
_observed = /* @__PURE__ */ new Set();
|
|
71
|
+
/**
|
|
72
|
+
* Размер сменился — контейнер искать заново при замере. Не в колбэке
|
|
73
|
+
* наблюдателя: новый узел под наблюдением дал бы в том же кадре ещё одно
|
|
74
|
+
* уведомление, и браузер сообщил бы о петле.
|
|
75
|
+
*/
|
|
76
|
+
_containerStale = false;
|
|
77
|
+
_frame = null;
|
|
78
|
+
/** Stops waiting for the first drawn node (`_awaitDrawn`); `null` — not waiting. */
|
|
79
|
+
_waiting = null;
|
|
80
|
+
_listening = false;
|
|
81
|
+
/** Последний шаг элементов: пока замерить нечем, полосу меряют им. */
|
|
82
|
+
_step = 0;
|
|
83
|
+
/** О высоком элементе уже предупредили. */
|
|
84
|
+
_warned = false;
|
|
85
|
+
install(ctx) {
|
|
86
|
+
super.install(ctx);
|
|
87
|
+
this._elements = ctx.get(TCollectionElements) ?? null;
|
|
88
|
+
this._draw = drawOf(ctx.get(TCollectionBundlesPlugin)?.engine) ?? null;
|
|
89
|
+
const element = ctx.get(TElementPlugin);
|
|
90
|
+
element?.events.on("ready", (node) => this._bind(node));
|
|
91
|
+
element?.events.on("removed", () => this._bind(null));
|
|
92
|
+
this._listenTo(this._draw?.events, "change:virtual", this._sync);
|
|
93
|
+
this._listenTo(this._draw?.events, "change:drawn", this._onSchedule);
|
|
94
|
+
}
|
|
95
|
+
destroy() {
|
|
96
|
+
this._bind(null);
|
|
97
|
+
this._resize?.disconnect();
|
|
98
|
+
this._resize = null;
|
|
99
|
+
this._observed.clear();
|
|
100
|
+
this._draw = null;
|
|
101
|
+
this._elements = null;
|
|
102
|
+
super.destroy();
|
|
103
|
+
}
|
|
104
|
+
_bind(root) {
|
|
105
|
+
this._stop();
|
|
106
|
+
this._root = root;
|
|
107
|
+
this._sync();
|
|
108
|
+
}
|
|
109
|
+
/** Слушать документ — пока у компонента есть корень и стоит окно. */
|
|
110
|
+
_sync = () => {
|
|
111
|
+
const on = Boolean(this._root && this._draw?.virtual);
|
|
112
|
+
if (on && !this._listening) this._start();
|
|
113
|
+
else if (!on && this._listening) this._stop();
|
|
114
|
+
};
|
|
115
|
+
_start() {
|
|
116
|
+
const root = this._root;
|
|
117
|
+
if (!root) return;
|
|
118
|
+
this._listening = true;
|
|
119
|
+
this._resize ??= new ResizeObserver(this._onResize);
|
|
120
|
+
const first = this._firstDrawn();
|
|
121
|
+
this._watchList(first?.node ?? null, true);
|
|
122
|
+
if (!first) this._awaitDrawn();
|
|
123
|
+
const target = root;
|
|
124
|
+
target.addEventListener("focusin", this._onFocusIn);
|
|
125
|
+
target.addEventListener("focusout", this._onFocusOut);
|
|
126
|
+
root.ownerDocument.defaultView?.addEventListener("scroll", this._onSchedule, { passive: true });
|
|
127
|
+
this._schedule();
|
|
128
|
+
}
|
|
129
|
+
_stop() {
|
|
130
|
+
const root = this._root;
|
|
131
|
+
this._cancel();
|
|
132
|
+
this._waiting?.();
|
|
133
|
+
this._waiting = null;
|
|
134
|
+
if (!this._listening) return;
|
|
135
|
+
this._listening = false;
|
|
136
|
+
this._watchList(null, true);
|
|
137
|
+
this._draw?.pin(FOCUS, void 0);
|
|
138
|
+
if (!root) return;
|
|
139
|
+
const target = root;
|
|
140
|
+
target.removeEventListener("focusin", this._onFocusIn);
|
|
141
|
+
target.removeEventListener("focusout", this._onFocusOut);
|
|
142
|
+
root.ownerDocument.defaultView?.removeEventListener("scroll", this._onSchedule);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Узнать список по нарисованному элементу: за размером его родителя
|
|
146
|
+
* следить, а контейнер искать заново, если сменился родитель или просят.
|
|
147
|
+
*/
|
|
148
|
+
_watchList(node, findContainer) {
|
|
149
|
+
const list = node?.parentElement ?? null;
|
|
150
|
+
if (list !== this._list) {
|
|
151
|
+
this._list = list;
|
|
152
|
+
this._observe();
|
|
153
|
+
findContainer = true;
|
|
154
|
+
}
|
|
155
|
+
if (findContainer) this._watchContainer(node ? scrollParentOf(node, "y") : null);
|
|
156
|
+
}
|
|
157
|
+
/** Сменить контейнер прокрутки: прокрутку и размер слушать у нового. */
|
|
158
|
+
_watchContainer(container) {
|
|
159
|
+
if (this._container === container) return;
|
|
160
|
+
this._container?.removeEventListener("scroll", this._onSchedule);
|
|
161
|
+
this._container = container;
|
|
162
|
+
container?.addEventListener("scroll", this._onSchedule, { passive: true });
|
|
163
|
+
this._observe();
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Следить за размером списка и контейнера — пока слушаем документ. Узел,
|
|
167
|
+
* за которым уже следят, повторно не ставится: наблюдатель сообщил бы его
|
|
168
|
+
* размер заново.
|
|
169
|
+
*/
|
|
170
|
+
_observe() {
|
|
171
|
+
const resize = this._resize;
|
|
172
|
+
if (!resize) return;
|
|
173
|
+
const next = /* @__PURE__ */ new Set();
|
|
174
|
+
if (this._listening) {
|
|
175
|
+
for (const node of [this._list, this._container]) if (node) next.add(node);
|
|
176
|
+
}
|
|
177
|
+
for (const node of this._observed) if (!next.has(node)) resize.unobserve(node);
|
|
178
|
+
for (const node of next) if (!this._observed.has(node)) resize.observe(node);
|
|
179
|
+
this._observed = next;
|
|
180
|
+
}
|
|
181
|
+
/** Размер списка или контейнера сменился — может смениться и сам контейнер. */
|
|
182
|
+
_onResize = () => {
|
|
183
|
+
this._containerStale = true;
|
|
184
|
+
this._schedule();
|
|
185
|
+
};
|
|
186
|
+
_onSchedule = () => this._schedule();
|
|
187
|
+
/** Проход — раз в кадр: подряд идущие поводы схлопываются в один замер. */
|
|
188
|
+
_schedule() {
|
|
189
|
+
if (this._frame !== null || !this._listening) return;
|
|
190
|
+
this._frame = requestAnimationFrame(() => {
|
|
191
|
+
this._frame = null;
|
|
192
|
+
this._measure();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
_cancel() {
|
|
196
|
+
if (this._frame === null) return;
|
|
197
|
+
cancelAnimationFrame(this._frame);
|
|
198
|
+
this._frame = null;
|
|
199
|
+
}
|
|
200
|
+
_measure() {
|
|
201
|
+
const draw = this._draw;
|
|
202
|
+
const band = this._band();
|
|
203
|
+
if (!draw || !band) return;
|
|
204
|
+
const first = this._firstDrawn();
|
|
205
|
+
this._watchList(first?.node ?? null, this._containerStale);
|
|
206
|
+
this._containerStale = false;
|
|
207
|
+
if (!first) {
|
|
208
|
+
this._awaitDrawn();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (!hasBox(first.node)) return;
|
|
212
|
+
const step = this._measureStep();
|
|
213
|
+
if (step > 0) this._step = step;
|
|
214
|
+
const top = first.node.getBoundingClientRect().top - first.place * this._step;
|
|
215
|
+
draw.notifyViewport({
|
|
216
|
+
top: band.top - top,
|
|
217
|
+
bottom: band.bottom - top,
|
|
218
|
+
step: this._step
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Wait for the first drawn item to enter the document — its bundle
|
|
223
|
+
* registered and its node bound, in either order
|
|
224
|
+
* (`TCollectionElements.waitFor`), — and measure a frame later. The markup
|
|
225
|
+
* may draw the window's entries later than the window has them: the panel of
|
|
226
|
+
* a Select builds its options from data on its first opening, and `drawn`
|
|
227
|
+
* does not change then. Without a node there is no list to watch the size
|
|
228
|
+
* of, and nothing would schedule the measurement.
|
|
229
|
+
*/
|
|
230
|
+
_awaitDrawn() {
|
|
231
|
+
if (this._waiting || !this._elements) return;
|
|
232
|
+
this._waiting = this._elements.waitFor(() => {
|
|
233
|
+
if (!this._firstDrawn()) return false;
|
|
234
|
+
this._waiting = null;
|
|
235
|
+
this._schedule();
|
|
236
|
+
return true;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/** Первый нарисованный элемент, у которого есть узел в документе. */
|
|
240
|
+
_firstDrawn() {
|
|
241
|
+
for (const entry of this._draw?.drawn ?? []) {
|
|
242
|
+
if (entry.kind !== "item") continue;
|
|
243
|
+
const node = this._elements?.getElementByItem(entry.item);
|
|
244
|
+
if (node) return {
|
|
245
|
+
place: entry.place,
|
|
246
|
+
node
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
/** Видимая полоса: окно контейнера в окне браузера, без контейнера — окно браузера. */
|
|
252
|
+
_band() {
|
|
253
|
+
const view = this._root?.ownerDocument.defaultView;
|
|
254
|
+
if (!view) return null;
|
|
255
|
+
const page = {
|
|
256
|
+
top: 0,
|
|
257
|
+
bottom: view.innerHeight
|
|
258
|
+
};
|
|
259
|
+
const container = this._container;
|
|
260
|
+
if (!container) return page;
|
|
261
|
+
const top = container.getBoundingClientRect().top + container.clientTop;
|
|
262
|
+
return {
|
|
263
|
+
top: Math.max(top, page.top),
|
|
264
|
+
bottom: Math.min(top + container.clientHeight, page.bottom)
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Шаг элементов — наименьшее расстояние между верхами соседних
|
|
269
|
+
* нарисованных элементов. Нарисован один — шаг прежний, а без прежнего —
|
|
270
|
+
* его высота; элементов нет — ноль. Элемент выше шага — предупреждение.
|
|
271
|
+
*/
|
|
272
|
+
_measureStep() {
|
|
273
|
+
const tops = [];
|
|
274
|
+
let height = 0;
|
|
275
|
+
for (const entry of this._draw?.drawn ?? []) {
|
|
276
|
+
const rect = (entry.kind === "item" ? this._elements?.getElementByItem(entry.item) : null)?.getBoundingClientRect();
|
|
277
|
+
tops.push(rect ? rect.top : null);
|
|
278
|
+
height = rect ? rect.height : height;
|
|
279
|
+
}
|
|
280
|
+
const gaps = [];
|
|
281
|
+
for (let index = 1; index < tops.length; index++) {
|
|
282
|
+
const [above, below] = [tops[index - 1], tops[index]];
|
|
283
|
+
if (above !== null && below !== null && below > above) gaps.push(below - above);
|
|
284
|
+
}
|
|
285
|
+
if (gaps.length === 0) return tops.filter((top) => top !== null).length === 1 && this._step === 0 ? height : 0;
|
|
286
|
+
const step = Math.min(...gaps);
|
|
287
|
+
if (!this._warned && gaps.some((gap) => gap > step + .5)) {
|
|
288
|
+
this._warned = true;
|
|
289
|
+
console.warn("[soxa] Virtual: элемент выше остальных — в окне высота элементов должна быть одной на все, иначе прокрутка поедет. Держите содержимое элемента в одну строку.");
|
|
290
|
+
}
|
|
291
|
+
return step;
|
|
292
|
+
}
|
|
293
|
+
/** Нарисованный элемент, в узле которого лежит узел. */
|
|
294
|
+
_itemOf(node) {
|
|
295
|
+
if (!(node instanceof Node)) return void 0;
|
|
296
|
+
for (const entry of this._draw?.drawn ?? []) {
|
|
297
|
+
if (entry.kind !== "item") continue;
|
|
298
|
+
if (this._elements?.getElementByItem(entry.item)?.contains(node)) return entry.item;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
_onFocusIn = (event) => {
|
|
302
|
+
this._draw?.pin(FOCUS, this._itemOf(event.target));
|
|
303
|
+
};
|
|
304
|
+
/** Фокус ушёл на узел вне компонента — закрепления нет. Ушёл из окна браузера — осталось. */
|
|
305
|
+
_onFocusOut = (event) => {
|
|
306
|
+
const next = event.relatedTarget;
|
|
307
|
+
if (next instanceof Node && !this._root?.contains(next)) this._draw?.pin(FOCUS, void 0);
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
//#endregion
|
|
311
|
+
export { TVirtualPlugin };
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { TBasePlugin } from "./base/base.class.js";
|
|
2
|
+
import { extendLocale, formatName } from "./locale/locale.js";
|
|
3
|
+
import { enUS } from "./locale/locales/en.js";
|
|
4
|
+
import { TLocaleSource } from "./locale/source.class.js";
|
|
5
|
+
import { TPluginBundle } from "./base/bundle.class.js";
|
|
6
|
+
import { TIdPlugin } from "./custom/id/id.plugin.js";
|
|
7
|
+
import { TAccordionItemIdsPlugin } from "./custom/accordion/item-ids/item-ids.plugin.js";
|
|
8
|
+
import { TCollectionBundlesPlugin } from "./custom/collection/bundles.plugin.js";
|
|
9
|
+
import { TCollectionBundlesAccess } from "./custom/collection/collection-bundles-access.plugin.js";
|
|
10
|
+
import { TElementPlugin } from "./custom/element/element.plugin.js";
|
|
11
|
+
import { TCollectionElements } from "./custom/collection/collection-elements.plugin.js";
|
|
12
|
+
import { firstHeaderOf, headerIn } from "./custom/accordion/header.js";
|
|
13
|
+
import { toCssValue } from "./utils/toCssValue.js";
|
|
14
|
+
import { TActionPlugin } from "./custom/action/action.plugin.js";
|
|
15
|
+
import { TCalendarIdsPlugin } from "./custom/calendar/ids/ids.plugin.js";
|
|
16
|
+
import { listOf, rowIn } from "./custom/list/row.js";
|
|
17
|
+
import { TCalendarKeyboardPlugin } from "./custom/calendar/keyboard/keyboard.plugin.js";
|
|
18
|
+
import { TCalendarPointerPlugin } from "./custom/calendar/pointer/pointer.plugin.js";
|
|
19
|
+
import { TNamesPlugin } from "./locale/names.plugin.js";
|
|
20
|
+
import { TCalendarNamesPlugin } from "./custom/calendar/names/names.plugin.js";
|
|
21
|
+
import { gridStopOf } from "./custom/calendar/stop.js";
|
|
22
|
+
import { TClearableNamesPlugin } from "./custom/clearable/names/names.plugin.js";
|
|
23
|
+
import { TAriaPlugin } from "./custom/component-view/aria.plugin.js";
|
|
24
|
+
import { firstSegmentOf } from "./custom/date-input/parts.js";
|
|
25
|
+
import { TDateInputClipboardPlugin } from "./custom/date-input/clipboard/clipboard.plugin.js";
|
|
26
|
+
import { TDateInputIdsPlugin } from "./custom/date-input/ids/ids.plugin.js";
|
|
27
|
+
import { TDateInputKeyboardPlugin } from "./custom/date-input/keyboard/keyboard.plugin.js";
|
|
28
|
+
import { TDateInputPointerPlugin } from "./custom/date-input/pointer/pointer.plugin.js";
|
|
29
|
+
import { TDateInputTouchPlugin } from "./custom/date-input/touch/touch.plugin.js";
|
|
30
|
+
import { TDismissPlugin } from "./custom/dismiss/dismiss.plugin.js";
|
|
31
|
+
import { TOverlayFocusPlugin } from "./custom/overlay/focus/focus.plugin.js";
|
|
32
|
+
import { fieldSegmentOf } from "./custom/date-picker/field.js";
|
|
33
|
+
import { TDatePickerFocusPlugin } from "./custom/date-picker/focus/focus.plugin.js";
|
|
34
|
+
import { TDatePickerIdsPlugin } from "./custom/date-picker/ids/ids.plugin.js";
|
|
35
|
+
import { TDatePickerTriggerPlugin } from "./custom/date-picker/trigger/trigger.plugin.js";
|
|
36
|
+
import { TDatePickerNamesPlugin } from "./custom/date-picker/names/names.plugin.js";
|
|
37
|
+
import { TModalLayoutPlugin } from "./custom/overlay/modal-layout/modal-layout.plugin.js";
|
|
38
|
+
import { TDialogOffsetEvent } from "./custom/dialog/layout/offset-event.js";
|
|
39
|
+
import { TDialogLayoutPlugin } from "./custom/dialog/layout/layout.plugin.js";
|
|
40
|
+
import { TModalIdsPlugin } from "./custom/overlay/modal-ids/modal-ids.plugin.js";
|
|
41
|
+
import { TDialogIdsPlugin } from "./custom/dialog/ids/ids.plugin.js";
|
|
42
|
+
import { TModalNamesPlugin } from "./custom/overlay/modal-names/modal-names.plugin.js";
|
|
43
|
+
import { TDialogNamesPlugin } from "./custom/dialog/names/names.plugin.js";
|
|
44
|
+
import { TDragPlugin } from "./custom/drag-and-drop/drag.plugin.js";
|
|
45
|
+
import { TDrawerLayoutPlugin } from "./custom/drawer/layout/layout.plugin.js";
|
|
46
|
+
import { TFieldIdsPlugin } from "./custom/field/ids/ids.plugin.js";
|
|
47
|
+
import { TFrameLayoutPlugin } from "./custom/frame/layout/layout.plugin.js";
|
|
48
|
+
import { ANCHOR_PLACEMENT_ATTRIBUTE, TAnchorPlugin } from "./custom/frame/anchor/anchor.plugin.js";
|
|
49
|
+
import { TIconLayoutPlugin } from "./custom/icon/layout.plugin.js";
|
|
50
|
+
import { fieldOf } from "./custom/input/field.js";
|
|
51
|
+
import { TInputPlugin } from "./custom/input/input.plugin.js";
|
|
52
|
+
import { TInputBoolPlugin } from "./custom/input-bool/input-bool.plugin.js";
|
|
53
|
+
import { TInputControlPlugin } from "./custom/input-control/input-control.plugin.js";
|
|
54
|
+
import { TItemGroupIdsPlugin } from "./custom/item-group/ids/ids.plugin.js";
|
|
55
|
+
import { TLabelNestedWarnPlugin } from "./custom/label/nested-warn/nested-warn.plugin.js";
|
|
56
|
+
import { TListItemPlugin } from "./custom/list/item/item.plugin.js";
|
|
57
|
+
import { TListNavigationPlugin } from "./custom/list/navigation/navigation.plugin.js";
|
|
58
|
+
import { TListHeightPlugin } from "./custom/list/height/height.plugin.js";
|
|
59
|
+
import { TListKeyboardPlugin } from "./custom/list/keyboard/keyboard.plugin.js";
|
|
60
|
+
import { useMotion } from "./motion/motion.js";
|
|
61
|
+
import { TListScrollPlugin } from "./custom/list/scroll/scroll.plugin.js";
|
|
62
|
+
import { TOptionIdsPlugin } from "./custom/list/option-ids/option-ids.plugin.js";
|
|
63
|
+
import { TMenuNavigationPlugin } from "./custom/menu/navigation/navigation.plugin.js";
|
|
64
|
+
import { TMenuKeyboardPlugin } from "./custom/menu/keyboard/keyboard.plugin.js";
|
|
65
|
+
import { TMenuPointerPlugin } from "./custom/menu/pointer/pointer.plugin.js";
|
|
66
|
+
import { TMenuSubmenuKeyboardPlugin } from "./custom/menu/submenu-keyboard/keyboard.plugin.js";
|
|
67
|
+
import { TPopoverFocusPlugin } from "./custom/popover/focus/focus.plugin.js";
|
|
68
|
+
import { TMenuPopoverItemFocusPlugin } from "./custom/menu/popover-item-focus/focus.plugin.js";
|
|
69
|
+
import { TMenuHoverPlugin } from "./custom/menu/hover/hover.plugin.js";
|
|
70
|
+
import { TMenuSubmenuFocusPlugin } from "./custom/menu/submenu-focus/focus.plugin.js";
|
|
71
|
+
import { TMenuFocusPlugin } from "./custom/menu/focus/focus.plugin.js";
|
|
72
|
+
import { TMenuIdsPlugin } from "./custom/menu/ids/ids.plugin.js";
|
|
73
|
+
import { TMenuPopupIdsPlugin } from "./custom/menu/popup-ids/ids.plugin.js";
|
|
74
|
+
import { TMenuPopoverItemKeyboardPlugin } from "./custom/menu/popover-item-keyboard/keyboard.plugin.js";
|
|
75
|
+
import { TNumberInputKeyboardPlugin } from "./custom/number-input/keyboard/keyboard.plugin.js";
|
|
76
|
+
import { TNumberInputNamesPlugin } from "./custom/number-input/names/names.plugin.js";
|
|
77
|
+
import { TNumberInputStepperPlugin } from "./custom/number-input/stepper/stepper.plugin.js";
|
|
78
|
+
import { TNumberInputTouchPlugin } from "./custom/number-input/touch/touch.plugin.js";
|
|
79
|
+
import { TNumberInputTypingPlugin } from "./custom/number-input/typing/typing.plugin.js";
|
|
80
|
+
import { THideOutsidePlugin } from "./custom/overlay/hide-outside/hide-outside.plugin.js";
|
|
81
|
+
import { TModalFocusPlugin } from "./custom/overlay/modal-focus/modal-focus.plugin.js";
|
|
82
|
+
import { TScrollLockPlugin } from "./custom/overlay/scroll-lock/scroll-lock.plugin.js";
|
|
83
|
+
import { TSwipePlugin } from "./custom/overlay/swipe/swipe.plugin.js";
|
|
84
|
+
import { currentPageOf } from "./custom/pagination/current.js";
|
|
85
|
+
import { TPaginationFocusPlugin } from "./custom/pagination/focus/focus.plugin.js";
|
|
86
|
+
import { TPaginationNamesPlugin } from "./custom/pagination/names/names.plugin.js";
|
|
87
|
+
import { TPopoverPointerPlugin } from "./custom/popover/pointer/pointer.plugin.js";
|
|
88
|
+
import { TPopoverIdsPlugin } from "./custom/popover/ids/ids.plugin.js";
|
|
89
|
+
import { TPopoverNamesPlugin } from "./custom/popover/names/names.plugin.js";
|
|
90
|
+
import { TRadioGroupNamePlugin } from "./custom/radio-group/name/name.plugin.js";
|
|
91
|
+
import { TRadioGroupCheckedPlugin } from "./custom/radio-group/checked/checked.plugin.js";
|
|
92
|
+
import { radioStopOf } from "./custom/radio-group/stop.js";
|
|
93
|
+
import { arrowStep, fractionAt, lengthAlong, slideDirection } from "./custom/slide/direction.js";
|
|
94
|
+
import { TRatingHoverPlugin } from "./custom/rating/hover/hover.plugin.js";
|
|
95
|
+
import { TRatingNamesPlugin } from "./custom/rating/names/names.plugin.js";
|
|
96
|
+
import { TRatingValidityPlugin } from "./custom/rating/validity/validity.plugin.js";
|
|
97
|
+
import { TReadyPlugin } from "./custom/ready/ready.plugin.js";
|
|
98
|
+
import { resolveEdges } from "./custom/scroller/viewport/edges.js";
|
|
99
|
+
import { resolveFocusShift } from "./custom/scroller/viewport/focus.js";
|
|
100
|
+
import { viewportStopOf } from "./custom/scroller/viewport/stop.js";
|
|
101
|
+
import { TScrollerViewportPlugin } from "./custom/scroller/viewport/viewport.plugin.js";
|
|
102
|
+
import { TScrollerNamesPlugin } from "./custom/scroller/names/names.plugin.js";
|
|
103
|
+
import { TSelectKeyboardPlugin } from "./custom/select/keyboard/keyboard.plugin.js";
|
|
104
|
+
import { TEditablePlugin } from "./custom/select/editable/editable.plugin.js";
|
|
105
|
+
import { TSelectPointerPlugin } from "./custom/select/pointer/pointer.plugin.js";
|
|
106
|
+
import { TSelectBackspacePlugin } from "./custom/select/backspace/backspace.plugin.js";
|
|
107
|
+
import { TSelectIdsPlugin } from "./custom/select/ids/ids.plugin.js";
|
|
108
|
+
import { TSkeletonLayoutPlugin } from "./custom/skeleton/layout.plugin.js";
|
|
109
|
+
import { TSlidePointerPlugin } from "./custom/slide/pointer/pointer.plugin.js";
|
|
110
|
+
import { TSlideKeyboardPlugin } from "./custom/slide/keyboard/keyboard.plugin.js";
|
|
111
|
+
import { TTableRowIdsPlugin } from "./custom/table/row-ids/row-ids.plugin.js";
|
|
112
|
+
import { TTableColumnIdsPlugin } from "./custom/table/column-ids/column-ids.plugin.js";
|
|
113
|
+
import { TTableColumnResizePlugin } from "./custom/table/column-resize/column-resize.plugin.js";
|
|
114
|
+
import { TTableNamesPlugin } from "./custom/table/names/names.plugin.js";
|
|
115
|
+
import { TTableColumnNamesPlugin } from "./custom/table/column-names/column-names.plugin.js";
|
|
116
|
+
import { TTableColumnReorderPlugin } from "./custom/table/column-reorder/column-reorder.plugin.js";
|
|
117
|
+
import { TTableGridPlugin } from "./custom/table/grid/grid.plugin.js";
|
|
118
|
+
import { TTableLayoutPlugin } from "./custom/table/layout/layout.plugin.js";
|
|
119
|
+
import { TTabsLayoutPlugin } from "./custom/tabs/layout/layout.plugin.js";
|
|
120
|
+
import { TTabsActiveTabPlugin } from "./custom/tabs/active-tab/active-tab.plugin.js";
|
|
121
|
+
import { TTabsContentWarnPlugin } from "./custom/tabs/content-warn/content-warn.plugin.js";
|
|
122
|
+
import { TTabsItemIdsPlugin } from "./custom/tabs/item-ids/item-ids.plugin.js";
|
|
123
|
+
import { tabIn, tabStopOf } from "./custom/tabs/tab.js";
|
|
124
|
+
import { TTabsKeyboardPlugin } from "./custom/tabs/keyboard/keyboard.plugin.js";
|
|
125
|
+
import { TTabsItemNamesPlugin } from "./custom/tabs/item-names/item-names.plugin.js";
|
|
126
|
+
import { tagStopIn, tagStopOf } from "./custom/tags/tag.js";
|
|
127
|
+
import { TTagsKeyboardPlugin } from "./custom/tags/keyboard/keyboard.plugin.js";
|
|
128
|
+
import { TTagsScrollPlugin } from "./custom/tags/scroll/scroll.plugin.js";
|
|
129
|
+
import { TTagsItemNamesPlugin } from "./custom/tags/item-names/item-names.plugin.js";
|
|
130
|
+
import { TTextareaAutoresizePlugin } from "./custom/textarea/autoresize/autoresize.plugin.js";
|
|
131
|
+
import { TTextareaIdsPlugin } from "./custom/textarea/ids/ids.plugin.js";
|
|
132
|
+
import { TTextareaNamesPlugin } from "./custom/textarea/names/names.plugin.js";
|
|
133
|
+
import { TToastsTimerPlugin } from "./custom/toasts/timer/timer.plugin.js";
|
|
134
|
+
import { TToastsRemovalPlugin } from "./custom/toasts/removal/removal.plugin.js";
|
|
135
|
+
import { TToastsKeyboardPlugin } from "./custom/toasts/keyboard/keyboard.plugin.js";
|
|
136
|
+
import { TToastsCascadePlugin } from "./custom/toasts/cascade/cascade.plugin.js";
|
|
137
|
+
import { TToastsLayoutPlugin } from "./custom/toasts/layout/layout.plugin.js";
|
|
138
|
+
import { TToastsNamesPlugin } from "./custom/toasts/names/names.plugin.js";
|
|
139
|
+
import { TToastsItemNamesPlugin } from "./custom/toasts/item-names/item-names.plugin.js";
|
|
140
|
+
import { TTooltipTriggerPlugin } from "./custom/tooltip/trigger/trigger.plugin.js";
|
|
141
|
+
import { TTooltipIdsPlugin } from "./custom/tooltip/ids/ids.plugin.js";
|
|
142
|
+
import { TVirtualPlugin } from "./custom/virtual/virtual.plugin.js";
|
|
143
|
+
import { TLocalePlugin } from "./locale/locale.plugin.js";
|
|
144
|
+
import { ruRU } from "./locale/locales/ru.js";
|
|
145
|
+
import { zhCN } from "./locale/locales/zh.js";
|
|
146
|
+
import { frFR } from "./locale/locales/fr.js";
|
|
147
|
+
import { esES } from "./locale/locales/es.js";
|
|
148
|
+
import { arEG } from "./locale/locales/ar.js";
|
|
149
|
+
export { ANCHOR_PLACEMENT_ATTRIBUTE, TAccordionItemIdsPlugin, TActionPlugin, TAnchorPlugin, TAriaPlugin, TBasePlugin, TCalendarIdsPlugin, TCalendarKeyboardPlugin, TCalendarNamesPlugin, TCalendarPointerPlugin, TClearableNamesPlugin, TCollectionBundlesAccess, TCollectionBundlesPlugin, TCollectionElements, TDateInputClipboardPlugin, TDateInputIdsPlugin, TDateInputKeyboardPlugin, TDateInputPointerPlugin, TDateInputTouchPlugin, TDatePickerFocusPlugin, TDatePickerIdsPlugin, TDatePickerNamesPlugin, TDatePickerTriggerPlugin, TDialogIdsPlugin, TDialogLayoutPlugin, TDialogNamesPlugin, TDialogOffsetEvent, TDismissPlugin, TDragPlugin, TDrawerLayoutPlugin, TEditablePlugin, TElementPlugin, TFieldIdsPlugin, TFrameLayoutPlugin, THideOutsidePlugin, TIconLayoutPlugin, TIdPlugin, TInputBoolPlugin, TInputControlPlugin, TInputPlugin, TItemGroupIdsPlugin, TLabelNestedWarnPlugin, TListHeightPlugin, TListItemPlugin, TListKeyboardPlugin, TListNavigationPlugin, TListScrollPlugin, TLocalePlugin, TLocaleSource, TMenuFocusPlugin, TMenuHoverPlugin, TMenuIdsPlugin, TMenuKeyboardPlugin, TMenuNavigationPlugin, TMenuPointerPlugin, TMenuPopoverItemFocusPlugin, TMenuPopoverItemKeyboardPlugin, TMenuPopupIdsPlugin, TMenuSubmenuFocusPlugin, TMenuSubmenuKeyboardPlugin, TModalFocusPlugin, TModalIdsPlugin, TModalLayoutPlugin, TModalNamesPlugin, TNamesPlugin, TNumberInputKeyboardPlugin, TNumberInputNamesPlugin, TNumberInputStepperPlugin, TNumberInputTouchPlugin, TNumberInputTypingPlugin, TOptionIdsPlugin, TOverlayFocusPlugin, TPaginationFocusPlugin, TPaginationNamesPlugin, TPluginBundle, TPopoverFocusPlugin, TPopoverIdsPlugin, TPopoverNamesPlugin, TPopoverPointerPlugin, TRadioGroupCheckedPlugin, TRadioGroupNamePlugin, TRatingHoverPlugin, TRatingNamesPlugin, TRatingValidityPlugin, TReadyPlugin, TScrollLockPlugin, TScrollerNamesPlugin, TScrollerViewportPlugin, TSelectBackspacePlugin, TSelectIdsPlugin, TSelectKeyboardPlugin, TSelectPointerPlugin, TSkeletonLayoutPlugin, TSlideKeyboardPlugin, TSlidePointerPlugin, TSwipePlugin, TTableColumnIdsPlugin, TTableColumnNamesPlugin, TTableColumnReorderPlugin, TTableColumnResizePlugin, TTableGridPlugin, TTableLayoutPlugin, TTableNamesPlugin, TTableRowIdsPlugin, TTabsActiveTabPlugin, TTabsContentWarnPlugin, TTabsItemIdsPlugin, TTabsItemNamesPlugin, TTabsKeyboardPlugin, TTabsLayoutPlugin, TTagsItemNamesPlugin, TTagsKeyboardPlugin, TTagsScrollPlugin, TTextareaAutoresizePlugin, TTextareaIdsPlugin, TTextareaNamesPlugin, TToastsCascadePlugin, TToastsItemNamesPlugin, TToastsKeyboardPlugin, TToastsLayoutPlugin, TToastsNamesPlugin, TToastsRemovalPlugin, TToastsTimerPlugin, TTooltipIdsPlugin, TTooltipTriggerPlugin, TVirtualPlugin, arEG, arrowStep, currentPageOf, enUS, esES, extendLocale, fieldOf, fieldSegmentOf, firstHeaderOf, firstSegmentOf, formatName, frFR, fractionAt, gridStopOf, headerIn, lengthAlong, listOf, radioStopOf, resolveEdges, resolveFocusShift, rowIn, ruRU, slideDirection, tabIn, tabStopOf, tagStopIn, tagStopOf, toCssValue, useMotion, viewportStopOf, zhCN };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { extendLocale, formatName } from './locale';
|
|
2
|
+
export { TLocaleSource } from './source.class';
|
|
3
|
+
export { TLocalePlugin } from './locale.plugin';
|
|
4
|
+
export { TNamesPlugin } from './names.plugin';
|
|
5
|
+
export { enUS, ruRU, zhCN, frFR, esES, arEG } from './locales';
|
|
6
|
+
export type { ILocaleOwner, ILocaleSource, TLocale, TLocalePatch, TLocaleSourceEvents, TPartialTranslations, TTranslations, } from './types';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TLocale, TLocalePatch } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Строка с именем части: шаблон из локали, на месте `{name}` — имя.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* formatName('Закрыть {name}', 'Настройки') // 'Закрыть Настройки'
|
|
7
|
+
* formatName('Закрыть {name}', '') // 'Закрыть'
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* Имя приходит без пробелов по краям. Пустое имя — у части имени нет, и
|
|
11
|
+
* строка остаётся без него: пробел, который стоял при имени, не повисает ни
|
|
12
|
+
* по краям, ни двойным в середине.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatName(template: string, name: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Локаль поверх готовой: свой тег, свои строки, остальное — от `base`.
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const esMX = extendLocale(esES, { tag: 'es-MX' })
|
|
20
|
+
* const mn = extendLocale(enUS, {
|
|
21
|
+
* tag: 'mn-MN',
|
|
22
|
+
* translations: { modal: { close: 'Хаах' } },
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Так делают регион готового языка, свою формулировку строки и язык, который
|
|
27
|
+
* переведён не целиком: чего в правке нет, остаётся от `base`; ключ со
|
|
28
|
+
* значением `undefined` строку не задаёт. Результат заморожен, как и готовые
|
|
29
|
+
* локали: объект один на всё поддерево, и правка на месте молча
|
|
30
|
+
* переименовала бы кнопки у всех компонентов, не сообщив ни одному.
|
|
31
|
+
*/
|
|
32
|
+
export declare function extendLocale(base: TLocale, patch: TLocalePatch): TLocale;
|
|
33
|
+
/**
|
|
34
|
+
* Готовая локаль пакета — замороженной вместе с разделами, как результат
|
|
35
|
+
* `extendLocale`. Наружу не выходит: свою полную локаль приложение пишет
|
|
36
|
+
* обычным объектом.
|
|
37
|
+
*/
|
|
38
|
+
export declare function freezeLocale(locale: TLocale): TLocale;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//#region src/locale/locale.ts
|
|
2
|
+
/** Место для имени части в строке-шаблоне. */
|
|
3
|
+
var NAME = "{name}";
|
|
4
|
+
/**
|
|
5
|
+
* Строка с именем части: шаблон из локали, на месте `{name}` — имя.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* formatName('Закрыть {name}', 'Настройки') // 'Закрыть Настройки'
|
|
9
|
+
* formatName('Закрыть {name}', '') // 'Закрыть'
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Имя приходит без пробелов по краям. Пустое имя — у части имени нет, и
|
|
13
|
+
* строка остаётся без него: пробел, который стоял при имени, не повисает ни
|
|
14
|
+
* по краям, ни двойным в середине.
|
|
15
|
+
*/
|
|
16
|
+
function formatName(template, name) {
|
|
17
|
+
return template.split(NAME).join(name.trim()).replace(/ {2,}/g, " ").trim();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Локаль поверх готовой: свой тег, свои строки, остальное — от `base`.
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* const esMX = extendLocale(esES, { tag: 'es-MX' })
|
|
24
|
+
* const mn = extendLocale(enUS, {
|
|
25
|
+
* tag: 'mn-MN',
|
|
26
|
+
* translations: { modal: { close: 'Хаах' } },
|
|
27
|
+
* })
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Так делают регион готового языка, свою формулировку строки и язык, который
|
|
31
|
+
* переведён не целиком: чего в правке нет, остаётся от `base`; ключ со
|
|
32
|
+
* значением `undefined` строку не задаёт. Результат заморожен, как и готовые
|
|
33
|
+
* локали: объект один на всё поддерево, и правка на месте молча
|
|
34
|
+
* переименовала бы кнопки у всех компонентов, не сообщив ни одному.
|
|
35
|
+
*/
|
|
36
|
+
function extendLocale(base, patch) {
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
tag: patch.tag ?? base.tag,
|
|
39
|
+
translations: overlay(base.translations, patch.translations ?? {})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Готовая локаль пакета — замороженной вместе с разделами, как результат
|
|
44
|
+
* `extendLocale`. Наружу не выходит: свою полную локаль приложение пишет
|
|
45
|
+
* обычным объектом.
|
|
46
|
+
*/
|
|
47
|
+
function freezeLocale(locale) {
|
|
48
|
+
return extendLocale(locale, {});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Строки правки поверх строк `base`. Разделы перечислены поимённо: новый
|
|
52
|
+
* раздел без строки здесь — ошибка компиляции, а не молча строки `base`.
|
|
53
|
+
*/
|
|
54
|
+
function overlay(base, patch) {
|
|
55
|
+
return Object.freeze({
|
|
56
|
+
modal: section(base, patch, "modal"),
|
|
57
|
+
dialog: section(base, patch, "dialog"),
|
|
58
|
+
popover: section(base, patch, "popover"),
|
|
59
|
+
tabs: section(base, patch, "tabs"),
|
|
60
|
+
tags: section(base, patch, "tags"),
|
|
61
|
+
toasts: section(base, patch, "toasts"),
|
|
62
|
+
scroller: section(base, patch, "scroller"),
|
|
63
|
+
pagination: section(base, patch, "pagination"),
|
|
64
|
+
field: section(base, patch, "field"),
|
|
65
|
+
numberInput: section(base, patch, "numberInput"),
|
|
66
|
+
table: section(base, patch, "table"),
|
|
67
|
+
calendar: section(base, patch, "calendar"),
|
|
68
|
+
datePicker: section(base, patch, "datePicker"),
|
|
69
|
+
rating: section(base, patch, "rating"),
|
|
70
|
+
textarea: section(base, patch, "textarea")
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** Раздел `key`: строки `base`, поверх — заданные строки того же раздела правки. */
|
|
74
|
+
function section(base, patch, key) {
|
|
75
|
+
const result = {
|
|
76
|
+
...base[key],
|
|
77
|
+
...defined(patch[key])
|
|
78
|
+
};
|
|
79
|
+
Object.freeze(result);
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
/** Строки раздела без ключей со значением `undefined`: такой ключ строку не задаёт. */
|
|
83
|
+
function defined(part) {
|
|
84
|
+
const result = {};
|
|
85
|
+
if (part === void 0) return result;
|
|
86
|
+
for (const key in part) {
|
|
87
|
+
const value = part[key];
|
|
88
|
+
if (value !== void 0) result[key] = value;
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { extendLocale, formatName, freezeLocale };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TBasePlugin } from '../base';
|
|
2
|
+
import type { IPluginContext } from '../base';
|
|
3
|
+
import type { ILocaleOwner } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TLocalePlugin — язык монтирования компоненту: тег локали в `locale`.
|
|
6
|
+
*
|
|
7
|
+
* Пишет владельцу тег локали поддерева (`ctx.locale`) при установке,
|
|
8
|
+
* синхронно, — поэтому подписи дат на языке приложения есть уже в первой
|
|
9
|
+
* отрисовке, и в серверной тоже. Смену локали пишет на лету: компонент не
|
|
10
|
+
* перемонтируется. Подписка на источник живёт, пока жив набор, — её снимает
|
|
11
|
+
* `destroy()` базы.
|
|
12
|
+
*
|
|
13
|
+
* Язык — не строка разметки, а вход модели: календарь считает им сетку и
|
|
14
|
+
* первый день недели, поле даты — порядок частей, таблица — сравнение строк,
|
|
15
|
+
* пагинация — цифры номеров страниц. Поэтому он свойство ядра (без setup его
|
|
16
|
+
* задаёт код), а пишет его плагин: язык знает место компонента в дереве, а не
|
|
17
|
+
* экземпляр. Своего языка у компонента в разметке нет: плагин переписывает и
|
|
18
|
+
* `locale` внешнего `ctrl`.
|
|
19
|
+
*
|
|
20
|
+
* Владельца плагин знает по контракту (`ILocaleOwner`), а не по классу:
|
|
21
|
+
* календарь, поле даты, DatePicker, таблица и пагинация общего предка не
|
|
22
|
+
* имеют.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TLocalePlugin extends TBasePlugin<ILocaleOwner> {
|
|
25
|
+
install(ctx: IPluginContext, options?: unknown): void;
|
|
26
|
+
}
|