@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,12 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../base';
|
|
2
|
+
import type { IPluginContext } from '../../base';
|
|
3
|
+
import type { TInputControlPluginEvents } from './types';
|
|
4
|
+
export declare class TInputControlPlugin extends TBasePlugin<any, TInputControlPluginEvents> {
|
|
5
|
+
private _input;
|
|
6
|
+
private _instance;
|
|
7
|
+
private _onClick;
|
|
8
|
+
install(ctx: IPluginContext): void;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
private _handleClick;
|
|
11
|
+
private _removeClickListener;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../element/element.plugin.js";
|
|
3
|
+
import { fieldOf } from "../input/field.js";
|
|
4
|
+
//#region src/custom/input-control/input-control.plugin.ts
|
|
5
|
+
var TInputControlPlugin = class extends TBasePlugin {
|
|
6
|
+
_input = null;
|
|
7
|
+
_instance = null;
|
|
8
|
+
_onClick = this._handleClick.bind(this);
|
|
9
|
+
install(ctx) {
|
|
10
|
+
super.install(ctx);
|
|
11
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
12
|
+
elementPlugin?.events.on("ready", () => {
|
|
13
|
+
const el = elementPlugin.element;
|
|
14
|
+
if (!el) return;
|
|
15
|
+
const input = fieldOf(el);
|
|
16
|
+
if (!(input instanceof HTMLInputElement)) return;
|
|
17
|
+
this._input = input;
|
|
18
|
+
input.addEventListener("click", this._onClick);
|
|
19
|
+
});
|
|
20
|
+
elementPlugin?.events.on("removed", () => {
|
|
21
|
+
this._removeClickListener();
|
|
22
|
+
this._input = null;
|
|
23
|
+
});
|
|
24
|
+
this._instance = ctx.getInstance();
|
|
25
|
+
}
|
|
26
|
+
destroy() {
|
|
27
|
+
this._removeClickListener();
|
|
28
|
+
this._input = null;
|
|
29
|
+
this._instance = null;
|
|
30
|
+
super.destroy();
|
|
31
|
+
}
|
|
32
|
+
_handleClick(event) {
|
|
33
|
+
if (this._instance?.readonly || this._input?.disabled) event.preventDefault();
|
|
34
|
+
}
|
|
35
|
+
_removeClickListener() {
|
|
36
|
+
if (this._input) this._input.removeEventListener("click", this._onClick);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { TInputControlPlugin };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TItemGroupIdsPlugin — имя группы элементов от её подписи: у групп меню,
|
|
5
|
+
* ListBox и Select (`Menu.Group`, `ListBox.Group`, `Select.Group`) — один на
|
|
6
|
+
* все три, формула связки у них одна.
|
|
7
|
+
*
|
|
8
|
+
* `id` подписи — в её набор (`labelAria`), ссылка на него — `aria-labelledby`
|
|
9
|
+
* группы, пока подпись не пуста: без подписи разметка её не рисует, и ссылка
|
|
10
|
+
* указывала бы в пустоту. Пишется при установке, синхронно, и на смену
|
|
11
|
+
* подписи — связка есть уже в первой (и серверной) отрисовке. `id` — от
|
|
12
|
+
* монтирования (`createId`): он нужен только документу.
|
|
13
|
+
*
|
|
14
|
+
* Шина группы бывает долговечнее плагина — приложение передаёт свой `ctrl`,
|
|
15
|
+
* — поэтому подписка через `_listenTo`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TItemGroupIdsPlugin extends TBasePlugin {
|
|
18
|
+
install(ctx: IPluginContext): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
//#region src/custom/item-group/ids/ids.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* TItemGroupIdsPlugin — имя группы элементов от её подписи: у групп меню,
|
|
5
|
+
* ListBox и Select (`Menu.Group`, `ListBox.Group`, `Select.Group`) — один на
|
|
6
|
+
* все три, формула связки у них одна.
|
|
7
|
+
*
|
|
8
|
+
* `id` подписи — в её набор (`labelAria`), ссылка на него — `aria-labelledby`
|
|
9
|
+
* группы, пока подпись не пуста: без подписи разметка её не рисует, и ссылка
|
|
10
|
+
* указывала бы в пустоту. Пишется при установке, синхронно, и на смену
|
|
11
|
+
* подписи — связка есть уже в первой (и серверной) отрисовке. `id` — от
|
|
12
|
+
* монтирования (`createId`): он нужен только документу.
|
|
13
|
+
*
|
|
14
|
+
* Шина группы бывает долговечнее плагина — приложение передаёт свой `ctrl`,
|
|
15
|
+
* — поэтому подписка через `_listenTo`.
|
|
16
|
+
*/
|
|
17
|
+
var TItemGroupIdsPlugin = class extends TBasePlugin {
|
|
18
|
+
install(ctx) {
|
|
19
|
+
super.install(ctx);
|
|
20
|
+
const group = ctx.getInstance();
|
|
21
|
+
if (!group) return;
|
|
22
|
+
const labelId = ctx.createId("label");
|
|
23
|
+
group.labelAria.add("id", labelId);
|
|
24
|
+
const refer = () => {
|
|
25
|
+
group.aria.add("aria-labelledby", group.label ? labelId : null);
|
|
26
|
+
};
|
|
27
|
+
refer();
|
|
28
|
+
this._listenTo(group.events, "change:label", refer);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { TItemGroupIdsPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TItemGroupIdsPlugin } from './ids.plugin';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ids';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './nested-warn';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './nested-warn.plugin';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TLabelNestedWarnPlugin — предупреждает, если внутри корня-`label` подписи
|
|
5
|
+
* `Label` оказался другой `label`.
|
|
6
|
+
*
|
|
7
|
+
* HTML запрещает `label` внутри `label`. Верный знак такой ошибки — радио,
|
|
8
|
+
* положенное в подпись без `tag="span"`: корень `RadioGroup.Item` — тоже
|
|
9
|
+
* `label`. Разметка при этом выглядит правильно, поэтому без предупреждения
|
|
10
|
+
* ошибку видно только валидатором.
|
|
11
|
+
*
|
|
12
|
+
* Диагностика, не защита: исключение не бросаем. Корень подписи — не `label`
|
|
13
|
+
* (задан другой `tag`) — вкладывать нечего, проверка молчит.
|
|
14
|
+
*
|
|
15
|
+
* Узел берётся у `TElementPlugin` из общего bundle: сразу, если элемент уже
|
|
16
|
+
* есть, иначе по событию `ready`. К `ready` контрол из слота уже в DOM. До
|
|
17
|
+
* монтирования (в т.ч. SSR) узла нет — проверка молчит.
|
|
18
|
+
*/
|
|
19
|
+
export declare class TLabelNestedWarnPlugin 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/label/nested-warn/nested-warn.plugin.ts
|
|
4
|
+
/**
|
|
5
|
+
* TLabelNestedWarnPlugin — предупреждает, если внутри корня-`label` подписи
|
|
6
|
+
* `Label` оказался другой `label`.
|
|
7
|
+
*
|
|
8
|
+
* HTML запрещает `label` внутри `label`. Верный знак такой ошибки — радио,
|
|
9
|
+
* положенное в подпись без `tag="span"`: корень `RadioGroup.Item` — тоже
|
|
10
|
+
* `label`. Разметка при этом выглядит правильно, поэтому без предупреждения
|
|
11
|
+
* ошибку видно только валидатором.
|
|
12
|
+
*
|
|
13
|
+
* Диагностика, не защита: исключение не бросаем. Корень подписи — не `label`
|
|
14
|
+
* (задан другой `tag`) — вкладывать нечего, проверка молчит.
|
|
15
|
+
*
|
|
16
|
+
* Узел берётся у `TElementPlugin` из общего bundle: сразу, если элемент уже
|
|
17
|
+
* есть, иначе по событию `ready`. К `ready` контрол из слота уже в DOM. До
|
|
18
|
+
* монтирования (в т.ч. SSR) узла нет — проверка молчит.
|
|
19
|
+
*/
|
|
20
|
+
var TLabelNestedWarnPlugin = 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.localName !== "label" || !el.querySelector("label")) return;
|
|
27
|
+
console.warn("[soxa] Label: внутри подписи оказался ещё один <label> — HTML запрещает вкладывать их друг в друга. Корень RadioGroup.Item — <label>: внутри Label рисуйте его с tag=\"span\".");
|
|
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 { TLabelNestedWarnPlugin };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import type { TListHeightPluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TListHeightPlugin — высота контейнера списка по `maxRows`.
|
|
6
|
+
*
|
|
7
|
+
* Единственное списочное свойство, которому нужен плагин. `contentFit` ядро
|
|
8
|
+
* применяет само (`data-*`), `scrollBehavior` только читают — а `maxRows`
|
|
9
|
+
* требует измерений: высоту строк без DOM не узнать. Ради этого здесь и живут
|
|
10
|
+
* `ResizeObserver`ы.
|
|
11
|
+
*
|
|
12
|
+
* Оба наблюдателя — за корнем и за каждой строкой — смотрят border-box:
|
|
13
|
+
* наблюдать надо ровно то, что меряем, а строки меряются `offsetHeight`.
|
|
14
|
+
* Умолчание `content-box` пропустило бы смену одного паддинга или рамки
|
|
15
|
+
* строки (паддинг по размеру, толщина рамки по состоянию): content-box строки
|
|
16
|
+
* от неё не меняется, а контейнер, уже зажатый `max-height`, не меняется
|
|
17
|
+
* вовсе. Предел держался бы по старой высоте строк до ближайшего пересчёта по
|
|
18
|
+
* другой причине.
|
|
19
|
+
*
|
|
20
|
+
* Само свойство лежит на инстансе (`IList`), плагин его читает и подписан на
|
|
21
|
+
* `change:maxRows`. Так устроены и остальные плагины пакета: свойство —
|
|
22
|
+
* ядру, применение — плагину.
|
|
23
|
+
*
|
|
24
|
+
* Строки считаются по показанным элементам коллекции (`batch.shown`), а не по
|
|
25
|
+
* узлам в документе: в окне (обёртка `Virtual`) нарисованы только видимые, и
|
|
26
|
+
* их число и порядок не говорят ни сколько строк в списке, ни нужна ли
|
|
27
|
+
* прокрутка. Высоту строки дают нарисованные: показанный, но не нарисованный
|
|
28
|
+
* элемент — той же высоты, высота строк в окне одна на все.
|
|
29
|
+
*
|
|
30
|
+
* **Строки в группах** (`ListBox.Group`, `Select.Group`) — не дети
|
|
31
|
+
* контейнера, а между ними стоят подписи групп и разделители, и суммой высот
|
|
32
|
+
* строк предел не сосчитать. Тогда он — по месту последней из первых строк:
|
|
33
|
+
* от верха содержимого списка до её низа, с подписью первой группы и всем, что
|
|
34
|
+
* между строками. Окна у списка с группами нет — нарисованы все строки, и
|
|
35
|
+
* место есть у каждой.
|
|
36
|
+
*
|
|
37
|
+
* **Строки измерены** (`measured`) — у нарисованной строки есть высота. У
|
|
38
|
+
* скрытого списка — закрытой панели Select, ListBox в скрытой вкладке или
|
|
39
|
+
* поповере — её нет: предел из нулевых высот — не предел строк, и плагин не
|
|
40
|
+
* пишет ничего, а прежний предел остаётся до замера. Показ списка плагин
|
|
41
|
+
* узнаёт от наблюдателя строк и мерит их кадром позже, тогда же пишет предел.
|
|
42
|
+
* Признак считается на каждом пересчёте, при любом `maxRows`, и о смене плагин
|
|
43
|
+
* сообщает `change:measured` — после записи предела. Слушает его прокрутка
|
|
44
|
+
* списка (`TListScrollPlugin`): к элементу скрытого списка она крутит, когда
|
|
45
|
+
* строки измерятся, — уже в пределе строк. Событие — соседу по набору, в
|
|
46
|
+
* дескриптор оно не публикуется. Без узла корня строки не мерятся, и признак —
|
|
47
|
+
* по последнему замеру: следующий `ready` мерит заново.
|
|
48
|
+
*
|
|
49
|
+
* **Пересчёт на кадр — только при узле корня**: между `ready` и `removed`
|
|
50
|
+
* своего `TElementPlugin`. Сборка вместе с подписками плагина идёт и на
|
|
51
|
+
* сервере, и состав, `maxRows` и строки меняются уже тогда, а узла там нет,
|
|
52
|
+
* как нет и `requestAnimationFrame`. Без узла мерить нечего, и повод кадра не
|
|
53
|
+
* планирует: всё, что сменилось до узла, применяет `ready` — предел он ставит
|
|
54
|
+
* сразу. Кадр, запланированный до `removed`, без узла ничего не мерит.
|
|
55
|
+
*/
|
|
56
|
+
export declare class TListHeightPlugin extends TBasePlugin<any, TListHeightPluginEvents> {
|
|
57
|
+
private _element;
|
|
58
|
+
private _list;
|
|
59
|
+
private _engine;
|
|
60
|
+
private _collectionElements;
|
|
61
|
+
private _rootObserver;
|
|
62
|
+
private readonly _itemObservers;
|
|
63
|
+
/**
|
|
64
|
+
* Узел, которому плагин ставил предел последним. Контейнер бывает и другим
|
|
65
|
+
* узлом — у списка без строк это корень, — и с прежнего предел снимается:
|
|
66
|
+
* иначе узел списка ListBox, опустев, остался бы в пределе прежних строк.
|
|
67
|
+
*/
|
|
68
|
+
private _container;
|
|
69
|
+
/** Строки измерены — у нарисованной строки есть высота (`measured`). */
|
|
70
|
+
private _measured;
|
|
71
|
+
/** Пересчёт в следующем кадре; прежний отложенный отменяется. */
|
|
72
|
+
private readonly _updateNextFrame;
|
|
73
|
+
constructor();
|
|
74
|
+
install(ctx: IPluginContext): void;
|
|
75
|
+
destroy(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Строки измерены: у нарисованной строки есть высота. Скрытый список, пустой
|
|
78
|
+
* и ещё не нарисованный — `false`: предел строк плагину считать не из чего
|
|
79
|
+
* (см. описание класса). Смена — `change:measured`.
|
|
80
|
+
*/
|
|
81
|
+
get measured(): boolean;
|
|
82
|
+
private _observeItem;
|
|
83
|
+
private _unobserveItem;
|
|
84
|
+
/**
|
|
85
|
+
* Пересчитать предел кадром позже — пока у плагина есть узел корня. Без
|
|
86
|
+
* узла повод ничего не планирует, какой бы он ни был: всё, что сменилось до
|
|
87
|
+
* узла, пересчитает `ready`.
|
|
88
|
+
*/
|
|
89
|
+
private _scheduleUpdate;
|
|
90
|
+
/**
|
|
91
|
+
* Пересчёт: предел строк и признак «строки измерены» (`measured`). О смене
|
|
92
|
+
* признака — `change:measured`, после записи предела: подписчик видит список
|
|
93
|
+
* уже в пределе строк. Кадр, пришедший без узла корня (запланирован до
|
|
94
|
+
* `removed`), ничего не мерит.
|
|
95
|
+
*/
|
|
96
|
+
private _update;
|
|
97
|
+
/**
|
|
98
|
+
* Ограничивает высоту прокручиваемого контейнера по `maxRows`. `rows` — узлы
|
|
99
|
+
* показанных элементов по порядку, `null` — не нарисованный окном.
|
|
100
|
+
*
|
|
101
|
+
* Контейнер — **список, в котором стоят элементы** (`closestList`), а не
|
|
102
|
+
* корень компонента. У Select его корень — поле, а список лежит в
|
|
103
|
+
* телепортированной панели: пока плагин писал в корень, Select получал
|
|
104
|
+
* `max-height` на поле и схлопывался в полосу. У ListBox это узел списка
|
|
105
|
+
* внутри корня: шапка и подвал стоят рядом с ним и в предел строк не входят.
|
|
106
|
+
* Не родитель элемента: у элемента группы родитель — группа, и предел
|
|
107
|
+
* получила бы она.
|
|
108
|
+
*/
|
|
109
|
+
private _limit;
|
|
110
|
+
/**
|
|
111
|
+
* Высота первых `count` строк вместе с промежутками между ними.
|
|
112
|
+
*
|
|
113
|
+
* Строки — дети контейнера: сумма их высот и зазоров. Строку, которую окно
|
|
114
|
+
* не нарисовало, считаем высотой нарисованной: в окне высота строк одна на
|
|
115
|
+
* все. Не нарисовано ни одной — строки ещё не измерены, и писать нечего.
|
|
116
|
+
* Последняя из первых строк стоит в группе — по её месту (`_measureByPlace`).
|
|
117
|
+
*
|
|
118
|
+
* `max-height` пишется в контейнер, а не в область строк, поэтому в неё идёт
|
|
119
|
+
* и то, что контейнер берёт сверх строк (`boxExtra`).
|
|
120
|
+
*/
|
|
121
|
+
private _measure;
|
|
122
|
+
/**
|
|
123
|
+
* Высота до низа последней из первых строк по её месту — у строк в группах:
|
|
124
|
+
* от верха содержимого контейнера, с подписями групп и разделителями между
|
|
125
|
+
* строками. Верх — без прокрутки: место строки считается от начала списка, а
|
|
126
|
+
* не от того, что сейчас видно.
|
|
127
|
+
*/
|
|
128
|
+
private _measureByPlace;
|
|
129
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
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 { closestList } from "../row.js";
|
|
7
|
+
import { batchOf, frameDebounce } from "@soxa-ui/core";
|
|
8
|
+
//#region src/custom/list/height/height.plugin.ts
|
|
9
|
+
/** Снять с узла предел строк: потолок и прокрутка возвращаются теме. */
|
|
10
|
+
function release(container) {
|
|
11
|
+
container.style.maxHeight = "";
|
|
12
|
+
container.style.overflowY = "";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Строка измерена: у её узла есть высота. У строки скрытого списка — закрытой
|
|
16
|
+
* панели, ListBox в скрытой обёртке — высоты нет, как и у строки без
|
|
17
|
+
* layout-бокса.
|
|
18
|
+
*/
|
|
19
|
+
function hasHeight(row) {
|
|
20
|
+
return isMeasurableElement(row) && row.offsetHeight > 0;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Что `max-height` контейнера берёт сверх строк: при `box-sizing: border-box`
|
|
24
|
+
* — вертикальные паддинги и рамки, иначе тема, добавившая отступы, теряла бы
|
|
25
|
+
* последнюю строку. При `content-box` добавлять нечего, поэтому решаем по
|
|
26
|
+
* факту стиля, а не по допущению про конкретную тему.
|
|
27
|
+
*/
|
|
28
|
+
function boxExtra(style) {
|
|
29
|
+
if (style.boxSizing !== "border-box") return 0;
|
|
30
|
+
return (parseFloat(style.paddingTop) || 0) + (parseFloat(style.paddingBottom) || 0) + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.borderBottomWidth) || 0);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* TListHeightPlugin — высота контейнера списка по `maxRows`.
|
|
34
|
+
*
|
|
35
|
+
* Единственное списочное свойство, которому нужен плагин. `contentFit` ядро
|
|
36
|
+
* применяет само (`data-*`), `scrollBehavior` только читают — а `maxRows`
|
|
37
|
+
* требует измерений: высоту строк без DOM не узнать. Ради этого здесь и живут
|
|
38
|
+
* `ResizeObserver`ы.
|
|
39
|
+
*
|
|
40
|
+
* Оба наблюдателя — за корнем и за каждой строкой — смотрят border-box:
|
|
41
|
+
* наблюдать надо ровно то, что меряем, а строки меряются `offsetHeight`.
|
|
42
|
+
* Умолчание `content-box` пропустило бы смену одного паддинга или рамки
|
|
43
|
+
* строки (паддинг по размеру, толщина рамки по состоянию): content-box строки
|
|
44
|
+
* от неё не меняется, а контейнер, уже зажатый `max-height`, не меняется
|
|
45
|
+
* вовсе. Предел держался бы по старой высоте строк до ближайшего пересчёта по
|
|
46
|
+
* другой причине.
|
|
47
|
+
*
|
|
48
|
+
* Само свойство лежит на инстансе (`IList`), плагин его читает и подписан на
|
|
49
|
+
* `change:maxRows`. Так устроены и остальные плагины пакета: свойство —
|
|
50
|
+
* ядру, применение — плагину.
|
|
51
|
+
*
|
|
52
|
+
* Строки считаются по показанным элементам коллекции (`batch.shown`), а не по
|
|
53
|
+
* узлам в документе: в окне (обёртка `Virtual`) нарисованы только видимые, и
|
|
54
|
+
* их число и порядок не говорят ни сколько строк в списке, ни нужна ли
|
|
55
|
+
* прокрутка. Высоту строки дают нарисованные: показанный, но не нарисованный
|
|
56
|
+
* элемент — той же высоты, высота строк в окне одна на все.
|
|
57
|
+
*
|
|
58
|
+
* **Строки в группах** (`ListBox.Group`, `Select.Group`) — не дети
|
|
59
|
+
* контейнера, а между ними стоят подписи групп и разделители, и суммой высот
|
|
60
|
+
* строк предел не сосчитать. Тогда он — по месту последней из первых строк:
|
|
61
|
+
* от верха содержимого списка до её низа, с подписью первой группы и всем, что
|
|
62
|
+
* между строками. Окна у списка с группами нет — нарисованы все строки, и
|
|
63
|
+
* место есть у каждой.
|
|
64
|
+
*
|
|
65
|
+
* **Строки измерены** (`measured`) — у нарисованной строки есть высота. У
|
|
66
|
+
* скрытого списка — закрытой панели Select, ListBox в скрытой вкладке или
|
|
67
|
+
* поповере — её нет: предел из нулевых высот — не предел строк, и плагин не
|
|
68
|
+
* пишет ничего, а прежний предел остаётся до замера. Показ списка плагин
|
|
69
|
+
* узнаёт от наблюдателя строк и мерит их кадром позже, тогда же пишет предел.
|
|
70
|
+
* Признак считается на каждом пересчёте, при любом `maxRows`, и о смене плагин
|
|
71
|
+
* сообщает `change:measured` — после записи предела. Слушает его прокрутка
|
|
72
|
+
* списка (`TListScrollPlugin`): к элементу скрытого списка она крутит, когда
|
|
73
|
+
* строки измерятся, — уже в пределе строк. Событие — соседу по набору, в
|
|
74
|
+
* дескриптор оно не публикуется. Без узла корня строки не мерятся, и признак —
|
|
75
|
+
* по последнему замеру: следующий `ready` мерит заново.
|
|
76
|
+
*
|
|
77
|
+
* **Пересчёт на кадр — только при узле корня**: между `ready` и `removed`
|
|
78
|
+
* своего `TElementPlugin`. Сборка вместе с подписками плагина идёт и на
|
|
79
|
+
* сервере, и состав, `maxRows` и строки меняются уже тогда, а узла там нет,
|
|
80
|
+
* как нет и `requestAnimationFrame`. Без узла мерить нечего, и повод кадра не
|
|
81
|
+
* планирует: всё, что сменилось до узла, применяет `ready` — предел он ставит
|
|
82
|
+
* сразу. Кадр, запланированный до `removed`, без узла ничего не мерит.
|
|
83
|
+
*/
|
|
84
|
+
var TListHeightPlugin = class extends TBasePlugin {
|
|
85
|
+
_element = null;
|
|
86
|
+
_list = null;
|
|
87
|
+
_engine = null;
|
|
88
|
+
_collectionElements = null;
|
|
89
|
+
_rootObserver = null;
|
|
90
|
+
_itemObservers = /* @__PURE__ */ new Map();
|
|
91
|
+
/**
|
|
92
|
+
* Узел, которому плагин ставил предел последним. Контейнер бывает и другим
|
|
93
|
+
* узлом — у списка без строк это корень, — и с прежнего предел снимается:
|
|
94
|
+
* иначе узел списка ListBox, опустев, остался бы в пределе прежних строк.
|
|
95
|
+
*/
|
|
96
|
+
_container = null;
|
|
97
|
+
/** Строки измерены — у нарисованной строки есть высота (`measured`). */
|
|
98
|
+
_measured = false;
|
|
99
|
+
/** Пересчёт в следующем кадре; прежний отложенный отменяется. */
|
|
100
|
+
_updateNextFrame;
|
|
101
|
+
constructor() {
|
|
102
|
+
super();
|
|
103
|
+
this._updateNextFrame = frameDebounce(() => this._update());
|
|
104
|
+
}
|
|
105
|
+
install(ctx) {
|
|
106
|
+
super.install(ctx);
|
|
107
|
+
this._list = ctx.getInstance();
|
|
108
|
+
this._collectionElements = ctx.get(TCollectionElements) ?? null;
|
|
109
|
+
this._listenTo(this._list?.events, "change:maxRows", () => this._scheduleUpdate());
|
|
110
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
111
|
+
elementPlugin?.events.on("ready", (element) => {
|
|
112
|
+
this._element = element;
|
|
113
|
+
this._rootObserver?.disconnect();
|
|
114
|
+
this._rootObserver = new ResizeObserver(() => this._scheduleUpdate());
|
|
115
|
+
this._rootObserver.observe(element, { box: "border-box" });
|
|
116
|
+
this._update();
|
|
117
|
+
});
|
|
118
|
+
elementPlugin?.events.on("removed", () => {
|
|
119
|
+
this._rootObserver?.disconnect();
|
|
120
|
+
this._rootObserver = null;
|
|
121
|
+
this._element = null;
|
|
122
|
+
this._container = null;
|
|
123
|
+
});
|
|
124
|
+
const bundles = ctx.get(TCollectionBundlesPlugin);
|
|
125
|
+
bundles?.events.on("engine:bound", (engine) => {
|
|
126
|
+
this._engine = engine;
|
|
127
|
+
this._listenTo(batchOf(engine)?.events, "change:shown", () => this._scheduleUpdate());
|
|
128
|
+
});
|
|
129
|
+
bundles?.events.on("bundle:registered", ({ uid, bundle }) => {
|
|
130
|
+
const itemElement = bundle.get(TElementPlugin);
|
|
131
|
+
itemElement?.events.on("ready", (element) => {
|
|
132
|
+
this._observeItem(uid, element);
|
|
133
|
+
});
|
|
134
|
+
itemElement?.events.on("removed", () => this._unobserveItem(uid));
|
|
135
|
+
});
|
|
136
|
+
bundles?.events.on("bundle:unregistered", ({ uid }) => this._unobserveItem(uid));
|
|
137
|
+
}
|
|
138
|
+
destroy() {
|
|
139
|
+
this._rootObserver?.disconnect();
|
|
140
|
+
this._rootObserver = null;
|
|
141
|
+
for (const observer of this._itemObservers.values()) observer.disconnect();
|
|
142
|
+
this._itemObservers.clear();
|
|
143
|
+
this._element = null;
|
|
144
|
+
this._container = null;
|
|
145
|
+
this._list = null;
|
|
146
|
+
this._engine = null;
|
|
147
|
+
this._collectionElements = null;
|
|
148
|
+
super.destroy();
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Строки измерены: у нарисованной строки есть высота. Скрытый список, пустой
|
|
152
|
+
* и ещё не нарисованный — `false`: предел строк плагину считать не из чего
|
|
153
|
+
* (см. описание класса). Смена — `change:measured`.
|
|
154
|
+
*/
|
|
155
|
+
get measured() {
|
|
156
|
+
return this._measured;
|
|
157
|
+
}
|
|
158
|
+
_observeItem(uid, element) {
|
|
159
|
+
this._itemObservers.get(uid)?.disconnect();
|
|
160
|
+
const observer = new ResizeObserver(() => this._scheduleUpdate());
|
|
161
|
+
observer.observe(element, { box: "border-box" });
|
|
162
|
+
this._itemObservers.set(uid, observer);
|
|
163
|
+
this._scheduleUpdate();
|
|
164
|
+
}
|
|
165
|
+
_unobserveItem(uid) {
|
|
166
|
+
this._itemObservers.get(uid)?.disconnect();
|
|
167
|
+
this._itemObservers.delete(uid);
|
|
168
|
+
this._scheduleUpdate();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Пересчитать предел кадром позже — пока у плагина есть узел корня. Без
|
|
172
|
+
* узла повод ничего не планирует, какой бы он ни был: всё, что сменилось до
|
|
173
|
+
* узла, пересчитает `ready`.
|
|
174
|
+
*/
|
|
175
|
+
_scheduleUpdate() {
|
|
176
|
+
if (this._element) this._updateNextFrame();
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Пересчёт: предел строк и признак «строки измерены» (`measured`). О смене
|
|
180
|
+
* признака — `change:measured`, после записи предела: подписчик видит список
|
|
181
|
+
* уже в пределе строк. Кадр, пришедший без узла корня (запланирован до
|
|
182
|
+
* `removed`), ничего не мерит.
|
|
183
|
+
*/
|
|
184
|
+
_update() {
|
|
185
|
+
const oldMeasured = this.measured;
|
|
186
|
+
if (!this._element) return;
|
|
187
|
+
const rows = (batchOf(this._engine)?.shown ?? []).map((item) => this._collectionElements?.getElementByItem(item) ?? null);
|
|
188
|
+
const measured = rows.some(hasHeight);
|
|
189
|
+
this._limit(rows, measured);
|
|
190
|
+
if (this._measured === measured) return;
|
|
191
|
+
this._measured = measured;
|
|
192
|
+
this.events.emit("change:measured", {
|
|
193
|
+
newValue: measured,
|
|
194
|
+
oldValue: oldMeasured
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Ограничивает высоту прокручиваемого контейнера по `maxRows`. `rows` — узлы
|
|
199
|
+
* показанных элементов по порядку, `null` — не нарисованный окном.
|
|
200
|
+
*
|
|
201
|
+
* Контейнер — **список, в котором стоят элементы** (`closestList`), а не
|
|
202
|
+
* корень компонента. У Select его корень — поле, а список лежит в
|
|
203
|
+
* телепортированной панели: пока плагин писал в корень, Select получал
|
|
204
|
+
* `max-height` на поле и схлопывался в полосу. У ListBox это узел списка
|
|
205
|
+
* внутри корня: шапка и подвал стоят рядом с ним и в предел строк не входят.
|
|
206
|
+
* Не родитель элемента: у элемента группы родитель — группа, и предел
|
|
207
|
+
* получила бы она.
|
|
208
|
+
*/
|
|
209
|
+
_limit(rows, measured) {
|
|
210
|
+
const row = rows.find((candidate) => candidate !== null);
|
|
211
|
+
const container = (row ? closestList(row) : null) ?? this._element;
|
|
212
|
+
if (!isMeasurableElement(container)) return;
|
|
213
|
+
if (this._container !== container) {
|
|
214
|
+
if (this._container) release(this._container);
|
|
215
|
+
this._container = container;
|
|
216
|
+
}
|
|
217
|
+
const maxRows = this._list?.maxRows ?? 0;
|
|
218
|
+
if (maxRows === 0) {
|
|
219
|
+
release(container);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (row && !measured) return;
|
|
223
|
+
const visibleCount = Math.min(maxRows, rows.length);
|
|
224
|
+
const totalHeight = this._measure(container, rows, visibleCount);
|
|
225
|
+
if (totalHeight === 0) {
|
|
226
|
+
release(container);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
container.style.maxHeight = `${totalHeight}px`;
|
|
230
|
+
container.style.overflowY = visibleCount >= rows.length ? "hidden" : "auto";
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Высота первых `count` строк вместе с промежутками между ними.
|
|
234
|
+
*
|
|
235
|
+
* Строки — дети контейнера: сумма их высот и зазоров. Строку, которую окно
|
|
236
|
+
* не нарисовало, считаем высотой нарисованной: в окне высота строк одна на
|
|
237
|
+
* все. Не нарисовано ни одной — строки ещё не измерены, и писать нечего.
|
|
238
|
+
* Последняя из первых строк стоит в группе — по её месту (`_measureByPlace`).
|
|
239
|
+
*
|
|
240
|
+
* `max-height` пишется в контейнер, а не в область строк, поэтому в неё идёт
|
|
241
|
+
* и то, что контейнер берёт сверх строк (`boxExtra`).
|
|
242
|
+
*/
|
|
243
|
+
_measure(container, rows, count) {
|
|
244
|
+
if (count === 0) return 0;
|
|
245
|
+
const last = rows[count - 1];
|
|
246
|
+
if (last && last.parentElement !== container) return this._measureByPlace(container, last);
|
|
247
|
+
const drawn = rows.find((row) => row !== null && isMeasurableElement(row));
|
|
248
|
+
if (!isMeasurableElement(drawn)) return 0;
|
|
249
|
+
const style = getComputedStyle(container);
|
|
250
|
+
const gap = parseFloat(style.rowGap) || 0;
|
|
251
|
+
let total = 0;
|
|
252
|
+
for (let i = 0; i < count; i++) {
|
|
253
|
+
const row = rows[i] ?? drawn;
|
|
254
|
+
if (isMeasurableElement(row)) total += row.offsetHeight;
|
|
255
|
+
}
|
|
256
|
+
total += (count - 1) * gap;
|
|
257
|
+
return total + boxExtra(style);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Высота до низа последней из первых строк по её месту — у строк в группах:
|
|
261
|
+
* от верха содержимого контейнера, с подписями групп и разделителями между
|
|
262
|
+
* строками. Верх — без прокрутки: место строки считается от начала списка, а
|
|
263
|
+
* не от того, что сейчас видно.
|
|
264
|
+
*/
|
|
265
|
+
_measureByPlace(container, last) {
|
|
266
|
+
const style = getComputedStyle(container);
|
|
267
|
+
const top = container.getBoundingClientRect().top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0) - container.scrollTop;
|
|
268
|
+
return last.getBoundingClientRect().bottom - top + boxExtra(style);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
export { TListHeightPlugin };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TValuePayload } from '@soxa-ui/core';
|
|
2
|
+
import type { TPluginEvents } from '../../../base';
|
|
3
|
+
export type TListHeightPluginEvents = TPluginEvents & {
|
|
4
|
+
/**
|
|
5
|
+
* Строки списка измерились или перестали мериться — `measured` сменился.
|
|
6
|
+
* Нужно соседу по набору (`TListScrollPlugin`), а не потребителю: в
|
|
7
|
+
* дескриптор событие не публикуется.
|
|
8
|
+
*/
|
|
9
|
+
'change:measured': (payload: TValuePayload<boolean>) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import type { TListItemPluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TListItemPlugin — состояние подсветки элемента списка (клавиатурная навигация).
|
|
6
|
+
*
|
|
7
|
+
* Не управляет выбором: выбор элемента выполняется selection-расширением коллекции.
|
|
8
|
+
* Плагин лишь хранит флаг `highlighted`, которым управляет TListKeyboardPlugin.
|
|
9
|
+
*
|
|
10
|
+
* Подсветку отдаёт теме сам — через `data-highlighted`. Раньше это делал
|
|
11
|
+
* шаблон, и два компонента успели разойтись: ListBox отдавал значение сырым,
|
|
12
|
+
* Select приводил его через `String(!!value)`. Оба варианта работали по
|
|
13
|
+
* случайности; здесь преобразование одно и живёт рядом с состоянием.
|
|
14
|
+
*
|
|
15
|
+
* В DOM плагин не ходит — пишет в набор, а раскладывает его шаблон, синхронно.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TListItemPlugin extends TBasePlugin<any, TListItemPluginEvents> {
|
|
18
|
+
private _instance;
|
|
19
|
+
private _highlighted;
|
|
20
|
+
install(ctx: IPluginContext, options?: object): void;
|
|
21
|
+
get highlighted(): boolean;
|
|
22
|
+
set highlighted(value: boolean);
|
|
23
|
+
private _apply;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
}
|