@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,133 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import type { TTooltipTriggerPluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TTooltipTriggerPlugin — когда подсказка показывается и когда прячется.
|
|
6
|
+
*
|
|
7
|
+
* Подсказку держат две причины: **курсор** — он на корне или на панели — и
|
|
8
|
+
* **фокус с клавиатуры** внутри корня. Показывается она, когда появилась
|
|
9
|
+
* первая, прячется, когда ушла последняя:
|
|
10
|
+
* - курсор (не касание) — показ через `openDelay`, уход — скрытие через
|
|
11
|
+
* `closeDelay`. Панель под курсором подсказку держит (WCAG 1.4.13): за
|
|
12
|
+
* задержку скрытия курсор пересекает зазор между триггером и панелью;
|
|
13
|
+
* - фокус с клавиатуры (`:focus-visible`) показывает сразу, уход фокуса из
|
|
14
|
+
* корня прячет сразу. Фокус от нажатия мышью на кнопку подсказку не
|
|
15
|
+
* показывает: её уже показало наведение, а нажатие закрыло. Текстовое
|
|
16
|
+
* поле браузер считает видимым и после клика — в нём печатают, — и
|
|
17
|
+
* подсказка поля показывается.
|
|
18
|
+
*
|
|
19
|
+
* **Уход курсора прячет, только если его приход засчитан**: причиной курсор
|
|
20
|
+
* становится на `pointerenter`, который услышал плагин. Подсказку, открытую
|
|
21
|
+
* разметкой или из кода, курсор не держит, и уход без прихода её не
|
|
22
|
+
* закрывает. Такой уход получает подсказка, открытая с первой отрисовки: до
|
|
23
|
+
* первого кадра её панель стоит там, где её поставила привязка по нулевому
|
|
24
|
+
* размеру, — поверх триггера, — а слушатели корня и панели встают с
|
|
25
|
+
* объявлением корня, в том же кадре, где привязка уводит панель на место.
|
|
26
|
+
* Наведение браузер пересчитывает и без движения мыши, по раскладке, и
|
|
27
|
+
* неподвижный курсор оказывается над панелью раньше, чем на ней встали
|
|
28
|
+
* слушатели, а её переезд на место — `pointerleave`. Без правила подсказка
|
|
29
|
+
* закрывалась через `closeDelay` сама, если курсор стоял там, где панель
|
|
30
|
+
* легла до своего места.
|
|
31
|
+
*
|
|
32
|
+
* **Нажатие** на корень и **Escape** закрывают подсказку и гасят обе причины
|
|
33
|
+
* вместе с отложенным показом: курсор так и остаётся на триггере, фокус — на
|
|
34
|
+
* нём же, и снова показать подсказку может только новый заход курсора или
|
|
35
|
+
* новый фокус.
|
|
36
|
+
*
|
|
37
|
+
* Escape слушается на документе в фазе перехвата и только пока подсказка
|
|
38
|
+
* открыта: её закрывают, не сдвигая ни курсор, ни фокус (WCAG 1.4.13), а
|
|
39
|
+
* фокус может быть где угодно. Клавиша гасится `preventDefault`, а не
|
|
40
|
+
* `stopPropagation`, — как у всего слоя оверлея: поповер под подсказкой
|
|
41
|
+
* видит, что Escape уже потрачен, и сам не закрывается.
|
|
42
|
+
*
|
|
43
|
+
* Слушатели — на корне, а не на элементе триггера: в корне лежит только
|
|
44
|
+
* триггер, и прямоугольник у них один. Так подсказка работает и у
|
|
45
|
+
* выключенной кнопки — у неё `pointer-events: none`, и курсор попадает в
|
|
46
|
+
* корень.
|
|
47
|
+
*
|
|
48
|
+
* Нажатие мимо закрывает `TDismissPlugin`, он же помечает панель и находит её
|
|
49
|
+
* (`findPanel()`): она телепортирована, и ссылки на неё у плагинов нет. Без
|
|
50
|
+
* него панель подсказку не держит.
|
|
51
|
+
*
|
|
52
|
+
* Открытость плагин ведёт по свойству владельца, а не по своим флагам:
|
|
53
|
+
* `open` пишут и разметка, и код через инстанс. Любое закрытие — снаружи, мимо,
|
|
54
|
+
* соседней подсказкой — сбрасывает причины и таймеры, а подсказку на экране
|
|
55
|
+
* видит документ (`document-state.ts`): одна открытая и окно без задержки.
|
|
56
|
+
*/
|
|
57
|
+
export declare class TTooltipTriggerPlugin extends TBasePlugin<any, TTooltipTriggerPluginEvents> {
|
|
58
|
+
private _owner;
|
|
59
|
+
private _dismiss;
|
|
60
|
+
/** Корень: наведение, фокус и нажатие слушаются на нём. */
|
|
61
|
+
private _root;
|
|
62
|
+
/** Документ корня: на нём Escape и общее состояние подсказок. */
|
|
63
|
+
private _doc;
|
|
64
|
+
/** Панель, найденная при открытии, — курсор на ней держит подсказку. */
|
|
65
|
+
private _panel;
|
|
66
|
+
/** Стоят ли слушатели открытой подсказки: Escape на документе, курсор на панели. */
|
|
67
|
+
private _active;
|
|
68
|
+
/** Причина «курсор»: он на корне или на панели. */
|
|
69
|
+
private _hovered;
|
|
70
|
+
/** Причина «фокус»: фокус с клавиатуры внутри корня. */
|
|
71
|
+
private _focused;
|
|
72
|
+
private _showTimer;
|
|
73
|
+
private _hideTimer;
|
|
74
|
+
/** Эта подсказка для документа: открылась соседка — закрыться. */
|
|
75
|
+
private readonly _entry;
|
|
76
|
+
install(ctx: IPluginContext): void;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
private _bindRoot;
|
|
79
|
+
private _unbindRoot;
|
|
80
|
+
private readonly _onOpenChange;
|
|
81
|
+
/**
|
|
82
|
+
* Подсказка открылась: слушать Escape и курсор на панели, закрыть соседку.
|
|
83
|
+
* Отложенный показ больше не нужен — открыли и без него.
|
|
84
|
+
*/
|
|
85
|
+
private _activate;
|
|
86
|
+
/**
|
|
87
|
+
* Подсказка закрылась (или корень ушёл): причины и таймеры сбрасываются,
|
|
88
|
+
* слушатели открытой снимаются. Снова показать её может только новый заход
|
|
89
|
+
* курсора или новый фокус.
|
|
90
|
+
*/
|
|
91
|
+
private _deactivate;
|
|
92
|
+
/**
|
|
93
|
+
* Курсор на корне или на панели. Касание не в счёт: наведения у пальца
|
|
94
|
+
* нет, а `pointerenter` перед нажатием показал бы подсказку на каждое
|
|
95
|
+
* касание.
|
|
96
|
+
*/
|
|
97
|
+
private readonly _onEnter;
|
|
98
|
+
/**
|
|
99
|
+
* Курсор ушёл с корня или с панели: без фокуса — скрытие с задержкой. Уход
|
|
100
|
+
* без засчитанного прихода причины не снимает и ничего не прячет (см.
|
|
101
|
+
* шапку): отложенного показа у него тоже нет — его заводит только приход.
|
|
102
|
+
*/
|
|
103
|
+
private readonly _onLeave;
|
|
104
|
+
/** Нажатие на корень закрывает — и тем, кто навёл, и тем, кто пришёл фокусом. */
|
|
105
|
+
private readonly _onPress;
|
|
106
|
+
/**
|
|
107
|
+
* Фокус с клавиатуры показывает сразу. `:focus-visible` — эвристика
|
|
108
|
+
* браузера: фокус от Tab её включает, от нажатия на кнопку — нет, у
|
|
109
|
+
* текстового поля — всегда: в нём печатают.
|
|
110
|
+
*/
|
|
111
|
+
private readonly _onFocusIn;
|
|
112
|
+
/** Фокус ушёл из корня: причина снята, без курсора — скрыть сразу. */
|
|
113
|
+
private readonly _onFocusOut;
|
|
114
|
+
/**
|
|
115
|
+
* Escape у открытой подсказки, где бы ни был фокус. Потраченную кем-то
|
|
116
|
+
* клавишу не трогает; свою гасит `preventDefault` (см. шапку).
|
|
117
|
+
*/
|
|
118
|
+
private readonly _onKeyDown;
|
|
119
|
+
/** Нажатие и Escape: подсказка закрыта, обе причины и отложенный показ погашены. */
|
|
120
|
+
private _cancel;
|
|
121
|
+
/**
|
|
122
|
+
* Показ после `openDelay`, а без задержки — если другая подсказка открыта
|
|
123
|
+
* или только что закрылась (`document-state.ts`). Задержка читается здесь:
|
|
124
|
+
* новое значение действует со следующего наведения.
|
|
125
|
+
*/
|
|
126
|
+
private _scheduleShow;
|
|
127
|
+
/** Скрытие после `closeDelay` — только у открытой. */
|
|
128
|
+
private _scheduleHide;
|
|
129
|
+
private _show;
|
|
130
|
+
private _hide;
|
|
131
|
+
private _cancelShow;
|
|
132
|
+
private _cancelHide;
|
|
133
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
3
|
+
import { TDismissPlugin } from "../../dismiss/dismiss.plugin.js";
|
|
4
|
+
import { tooltipClosed, tooltipOpened, tooltipSkipsDelay } from "./document-state.js";
|
|
5
|
+
//#region src/custom/tooltip/trigger/trigger.plugin.ts
|
|
6
|
+
/**
|
|
7
|
+
* TTooltipTriggerPlugin — когда подсказка показывается и когда прячется.
|
|
8
|
+
*
|
|
9
|
+
* Подсказку держат две причины: **курсор** — он на корне или на панели — и
|
|
10
|
+
* **фокус с клавиатуры** внутри корня. Показывается она, когда появилась
|
|
11
|
+
* первая, прячется, когда ушла последняя:
|
|
12
|
+
* - курсор (не касание) — показ через `openDelay`, уход — скрытие через
|
|
13
|
+
* `closeDelay`. Панель под курсором подсказку держит (WCAG 1.4.13): за
|
|
14
|
+
* задержку скрытия курсор пересекает зазор между триггером и панелью;
|
|
15
|
+
* - фокус с клавиатуры (`:focus-visible`) показывает сразу, уход фокуса из
|
|
16
|
+
* корня прячет сразу. Фокус от нажатия мышью на кнопку подсказку не
|
|
17
|
+
* показывает: её уже показало наведение, а нажатие закрыло. Текстовое
|
|
18
|
+
* поле браузер считает видимым и после клика — в нём печатают, — и
|
|
19
|
+
* подсказка поля показывается.
|
|
20
|
+
*
|
|
21
|
+
* **Уход курсора прячет, только если его приход засчитан**: причиной курсор
|
|
22
|
+
* становится на `pointerenter`, который услышал плагин. Подсказку, открытую
|
|
23
|
+
* разметкой или из кода, курсор не держит, и уход без прихода её не
|
|
24
|
+
* закрывает. Такой уход получает подсказка, открытая с первой отрисовки: до
|
|
25
|
+
* первого кадра её панель стоит там, где её поставила привязка по нулевому
|
|
26
|
+
* размеру, — поверх триггера, — а слушатели корня и панели встают с
|
|
27
|
+
* объявлением корня, в том же кадре, где привязка уводит панель на место.
|
|
28
|
+
* Наведение браузер пересчитывает и без движения мыши, по раскладке, и
|
|
29
|
+
* неподвижный курсор оказывается над панелью раньше, чем на ней встали
|
|
30
|
+
* слушатели, а её переезд на место — `pointerleave`. Без правила подсказка
|
|
31
|
+
* закрывалась через `closeDelay` сама, если курсор стоял там, где панель
|
|
32
|
+
* легла до своего места.
|
|
33
|
+
*
|
|
34
|
+
* **Нажатие** на корень и **Escape** закрывают подсказку и гасят обе причины
|
|
35
|
+
* вместе с отложенным показом: курсор так и остаётся на триггере, фокус — на
|
|
36
|
+
* нём же, и снова показать подсказку может только новый заход курсора или
|
|
37
|
+
* новый фокус.
|
|
38
|
+
*
|
|
39
|
+
* Escape слушается на документе в фазе перехвата и только пока подсказка
|
|
40
|
+
* открыта: её закрывают, не сдвигая ни курсор, ни фокус (WCAG 1.4.13), а
|
|
41
|
+
* фокус может быть где угодно. Клавиша гасится `preventDefault`, а не
|
|
42
|
+
* `stopPropagation`, — как у всего слоя оверлея: поповер под подсказкой
|
|
43
|
+
* видит, что Escape уже потрачен, и сам не закрывается.
|
|
44
|
+
*
|
|
45
|
+
* Слушатели — на корне, а не на элементе триггера: в корне лежит только
|
|
46
|
+
* триггер, и прямоугольник у них один. Так подсказка работает и у
|
|
47
|
+
* выключенной кнопки — у неё `pointer-events: none`, и курсор попадает в
|
|
48
|
+
* корень.
|
|
49
|
+
*
|
|
50
|
+
* Нажатие мимо закрывает `TDismissPlugin`, он же помечает панель и находит её
|
|
51
|
+
* (`findPanel()`): она телепортирована, и ссылки на неё у плагинов нет. Без
|
|
52
|
+
* него панель подсказку не держит.
|
|
53
|
+
*
|
|
54
|
+
* Открытость плагин ведёт по свойству владельца, а не по своим флагам:
|
|
55
|
+
* `open` пишут и разметка, и код через инстанс. Любое закрытие — снаружи, мимо,
|
|
56
|
+
* соседней подсказкой — сбрасывает причины и таймеры, а подсказку на экране
|
|
57
|
+
* видит документ (`document-state.ts`): одна открытая и окно без задержки.
|
|
58
|
+
*/
|
|
59
|
+
var TTooltipTriggerPlugin = class extends TBasePlugin {
|
|
60
|
+
_owner = null;
|
|
61
|
+
_dismiss = null;
|
|
62
|
+
/** Корень: наведение, фокус и нажатие слушаются на нём. */
|
|
63
|
+
_root = null;
|
|
64
|
+
/** Документ корня: на нём Escape и общее состояние подсказок. */
|
|
65
|
+
_doc = null;
|
|
66
|
+
/** Панель, найденная при открытии, — курсор на ней держит подсказку. */
|
|
67
|
+
_panel = null;
|
|
68
|
+
/** Стоят ли слушатели открытой подсказки: Escape на документе, курсор на панели. */
|
|
69
|
+
_active = false;
|
|
70
|
+
/** Причина «курсор»: он на корне или на панели. */
|
|
71
|
+
_hovered = false;
|
|
72
|
+
/** Причина «фокус»: фокус с клавиатуры внутри корня. */
|
|
73
|
+
_focused = false;
|
|
74
|
+
_showTimer = null;
|
|
75
|
+
_hideTimer = null;
|
|
76
|
+
/** Эта подсказка для документа: открылась соседка — закрыться. */
|
|
77
|
+
_entry = { close: () => this._hide() };
|
|
78
|
+
install(ctx) {
|
|
79
|
+
super.install(ctx);
|
|
80
|
+
this._owner = ctx.getInstance();
|
|
81
|
+
this._dismiss = ctx.get(TDismissPlugin) ?? null;
|
|
82
|
+
this._listenTo(this._owner?.events, "change:open", ({ newValue }) => this._onOpenChange(newValue));
|
|
83
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
84
|
+
elementPlugin?.events.on("ready", (element) => this._bindRoot(element));
|
|
85
|
+
elementPlugin?.events.on("removed", () => this._unbindRoot());
|
|
86
|
+
}
|
|
87
|
+
destroy() {
|
|
88
|
+
this._unbindRoot();
|
|
89
|
+
this._owner = null;
|
|
90
|
+
this._dismiss = null;
|
|
91
|
+
super.destroy();
|
|
92
|
+
}
|
|
93
|
+
_bindRoot(element) {
|
|
94
|
+
this._unbindRoot();
|
|
95
|
+
const target = element;
|
|
96
|
+
target.addEventListener("pointerenter", this._onEnter);
|
|
97
|
+
target.addEventListener("pointerleave", this._onLeave);
|
|
98
|
+
target.addEventListener("pointerdown", this._onPress);
|
|
99
|
+
target.addEventListener("focusin", this._onFocusIn);
|
|
100
|
+
target.addEventListener("focusout", this._onFocusOut);
|
|
101
|
+
this._root = element;
|
|
102
|
+
this._doc = element.ownerDocument;
|
|
103
|
+
if (this._owner?.open) this._activate();
|
|
104
|
+
}
|
|
105
|
+
_unbindRoot() {
|
|
106
|
+
const root = this._root;
|
|
107
|
+
if (!root) return;
|
|
108
|
+
const target = root;
|
|
109
|
+
target.removeEventListener("pointerenter", this._onEnter);
|
|
110
|
+
target.removeEventListener("pointerleave", this._onLeave);
|
|
111
|
+
target.removeEventListener("pointerdown", this._onPress);
|
|
112
|
+
target.removeEventListener("focusin", this._onFocusIn);
|
|
113
|
+
target.removeEventListener("focusout", this._onFocusOut);
|
|
114
|
+
this._deactivate();
|
|
115
|
+
this._root = null;
|
|
116
|
+
this._doc = null;
|
|
117
|
+
}
|
|
118
|
+
_onOpenChange = (open) => {
|
|
119
|
+
if (open) this._activate();
|
|
120
|
+
else this._deactivate();
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Подсказка открылась: слушать Escape и курсор на панели, закрыть соседку.
|
|
124
|
+
* Отложенный показ больше не нужен — открыли и без него.
|
|
125
|
+
*/
|
|
126
|
+
_activate() {
|
|
127
|
+
this._cancelShow();
|
|
128
|
+
const doc = this._doc;
|
|
129
|
+
if (!doc || this._active) return;
|
|
130
|
+
this._active = true;
|
|
131
|
+
doc.addEventListener("keydown", this._onKeyDown, true);
|
|
132
|
+
const panel = this._dismiss?.findPanel() ?? null;
|
|
133
|
+
panel?.addEventListener("pointerenter", this._onEnter);
|
|
134
|
+
panel?.addEventListener("pointerleave", this._onLeave);
|
|
135
|
+
this._panel = panel;
|
|
136
|
+
tooltipOpened(doc, this._entry);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Подсказка закрылась (или корень ушёл): причины и таймеры сбрасываются,
|
|
140
|
+
* слушатели открытой снимаются. Снова показать её может только новый заход
|
|
141
|
+
* курсора или новый фокус.
|
|
142
|
+
*/
|
|
143
|
+
_deactivate() {
|
|
144
|
+
this._hovered = false;
|
|
145
|
+
this._focused = false;
|
|
146
|
+
this._cancelShow();
|
|
147
|
+
this._cancelHide();
|
|
148
|
+
if (!this._active) return;
|
|
149
|
+
this._active = false;
|
|
150
|
+
this._doc?.removeEventListener("keydown", this._onKeyDown, true);
|
|
151
|
+
this._panel?.removeEventListener("pointerenter", this._onEnter);
|
|
152
|
+
this._panel?.removeEventListener("pointerleave", this._onLeave);
|
|
153
|
+
this._panel = null;
|
|
154
|
+
if (this._doc) tooltipClosed(this._doc, this._entry);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Курсор на корне или на панели. Касание не в счёт: наведения у пальца
|
|
158
|
+
* нет, а `pointerenter` перед нажатием показал бы подсказку на каждое
|
|
159
|
+
* касание.
|
|
160
|
+
*/
|
|
161
|
+
_onEnter = (event) => {
|
|
162
|
+
if (event.pointerType === "touch") return;
|
|
163
|
+
this._hovered = true;
|
|
164
|
+
this._cancelHide();
|
|
165
|
+
if (!this._owner?.open) this._scheduleShow();
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Курсор ушёл с корня или с панели: без фокуса — скрытие с задержкой. Уход
|
|
169
|
+
* без засчитанного прихода причины не снимает и ничего не прячет (см.
|
|
170
|
+
* шапку): отложенного показа у него тоже нет — его заводит только приход.
|
|
171
|
+
*/
|
|
172
|
+
_onLeave = (event) => {
|
|
173
|
+
if (event.pointerType === "touch" || !this._hovered) return;
|
|
174
|
+
this._hovered = false;
|
|
175
|
+
this._cancelShow();
|
|
176
|
+
if (!this._focused) this._scheduleHide();
|
|
177
|
+
};
|
|
178
|
+
/** Нажатие на корень закрывает — и тем, кто навёл, и тем, кто пришёл фокусом. */
|
|
179
|
+
_onPress = () => {
|
|
180
|
+
this._cancel();
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Фокус с клавиатуры показывает сразу. `:focus-visible` — эвристика
|
|
184
|
+
* браузера: фокус от Tab её включает, от нажатия на кнопку — нет, у
|
|
185
|
+
* текстового поля — всегда: в нём печатают.
|
|
186
|
+
*/
|
|
187
|
+
_onFocusIn = (event) => {
|
|
188
|
+
const target = event.target;
|
|
189
|
+
if (!(target instanceof Element) || !target.matches(":focus-visible")) return;
|
|
190
|
+
this._focused = true;
|
|
191
|
+
this._cancelShow();
|
|
192
|
+
this._cancelHide();
|
|
193
|
+
this._show();
|
|
194
|
+
};
|
|
195
|
+
/** Фокус ушёл из корня: причина снята, без курсора — скрыть сразу. */
|
|
196
|
+
_onFocusOut = (event) => {
|
|
197
|
+
const next = event.relatedTarget;
|
|
198
|
+
if (next instanceof Node && this._root?.contains(next)) return;
|
|
199
|
+
this._focused = false;
|
|
200
|
+
if (this._hovered) return;
|
|
201
|
+
this._cancelHide();
|
|
202
|
+
this._hide();
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Escape у открытой подсказки, где бы ни был фокус. Потраченную кем-то
|
|
206
|
+
* клавишу не трогает; свою гасит `preventDefault` (см. шапку).
|
|
207
|
+
*/
|
|
208
|
+
_onKeyDown = (event) => {
|
|
209
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
this._cancel();
|
|
212
|
+
};
|
|
213
|
+
/** Нажатие и Escape: подсказка закрыта, обе причины и отложенный показ погашены. */
|
|
214
|
+
_cancel() {
|
|
215
|
+
this._hovered = false;
|
|
216
|
+
this._focused = false;
|
|
217
|
+
this._cancelShow();
|
|
218
|
+
this._cancelHide();
|
|
219
|
+
this._hide();
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Показ после `openDelay`, а без задержки — если другая подсказка открыта
|
|
223
|
+
* или только что закрылась (`document-state.ts`). Задержка читается здесь:
|
|
224
|
+
* новое значение действует со следующего наведения.
|
|
225
|
+
*/
|
|
226
|
+
_scheduleShow() {
|
|
227
|
+
const owner = this._owner;
|
|
228
|
+
if (!owner || this._showTimer !== null) return;
|
|
229
|
+
const delay = this._doc && tooltipSkipsDelay(this._doc) ? 0 : owner.openDelay;
|
|
230
|
+
if (delay <= 0) {
|
|
231
|
+
this._show();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
this._showTimer = setTimeout(() => {
|
|
235
|
+
this._showTimer = null;
|
|
236
|
+
this._show();
|
|
237
|
+
}, delay);
|
|
238
|
+
}
|
|
239
|
+
/** Скрытие после `closeDelay` — только у открытой. */
|
|
240
|
+
_scheduleHide() {
|
|
241
|
+
const owner = this._owner;
|
|
242
|
+
if (!owner?.open || this._hideTimer !== null) return;
|
|
243
|
+
const delay = owner.closeDelay;
|
|
244
|
+
if (delay <= 0) {
|
|
245
|
+
this._hide();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
this._hideTimer = setTimeout(() => {
|
|
249
|
+
this._hideTimer = null;
|
|
250
|
+
this._hide();
|
|
251
|
+
}, delay);
|
|
252
|
+
}
|
|
253
|
+
_show() {
|
|
254
|
+
if (this._owner) this._owner.open = true;
|
|
255
|
+
}
|
|
256
|
+
_hide() {
|
|
257
|
+
if (this._owner) this._owner.open = false;
|
|
258
|
+
}
|
|
259
|
+
_cancelShow() {
|
|
260
|
+
if (this._showTimer === null) return;
|
|
261
|
+
clearTimeout(this._showTimer);
|
|
262
|
+
this._showTimer = null;
|
|
263
|
+
}
|
|
264
|
+
_cancelHide() {
|
|
265
|
+
if (this._hideTimer === null) return;
|
|
266
|
+
clearTimeout(this._hideTimer);
|
|
267
|
+
this._hideTimer = null;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
//#endregion
|
|
271
|
+
export { TTooltipTriggerPlugin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TPluginEvents } from '../../../base';
|
|
2
|
+
export type TTooltipTriggerPluginEvents = TPluginEvents;
|
|
3
|
+
/**
|
|
4
|
+
* Подсказка глазами документа (`document-state.ts`): открытую документ умеет
|
|
5
|
+
* только закрыть — когда открывается другая.
|
|
6
|
+
*/
|
|
7
|
+
export interface ITooltipEntry {
|
|
8
|
+
/** Закрыть подсказку: у неё открылась соседка. */
|
|
9
|
+
close(): void;
|
|
10
|
+
}
|
|
11
|
+
/** Что документ помнит о своих подсказках. */
|
|
12
|
+
export type TTooltipDocumentState = {
|
|
13
|
+
/** Открытая подсказка; `null` — открытой нет. */
|
|
14
|
+
open: ITooltipEntry | null;
|
|
15
|
+
/**
|
|
16
|
+
* Таймер окна после закрытия, в которое следующая подсказка показывается
|
|
17
|
+
* без задержки; `null` — окно прошло.
|
|
18
|
+
*/
|
|
19
|
+
warm: ReturnType<typeof setTimeout> | null;
|
|
20
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../base';
|
|
2
|
+
import type { IPluginContext } from '../../base';
|
|
3
|
+
import type { TVirtualPluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* TVirtualPlugin — the collection's window in the document: it measures the
|
|
6
|
+
* visible band and the step of the items, and tracks the item with DOM focus.
|
|
7
|
+
*
|
|
8
|
+
* What to draw is decided by the collection's drawing (`draw`); the plugin
|
|
9
|
+
* gives it what only the live document knows: which part of the list is
|
|
10
|
+
* visible (`notifyViewport`) and which item holds focus (the `focus` pin). The
|
|
11
|
+
* `Virtual` wrapper puts the plugin into the collection's bundle when the
|
|
12
|
+
* collection picks up its window: by then the engine is bound to the bundles
|
|
13
|
+
* registry, and the plugin takes item nodes from the registry of nodes. While
|
|
14
|
+
* there is no window, the plugin listens to nothing.
|
|
15
|
+
*
|
|
16
|
+
* **What scrolls the window.** The parent of the drawn items if it scrolls
|
|
17
|
+
* itself (ListBox with `maxRows`, the list in the Select panel), otherwise the
|
|
18
|
+
* nearest ancestor that scrolls vertically, otherwise the page. There is no
|
|
19
|
+
* prop: a block of limited height and the page work without setup. The
|
|
20
|
+
* container is looked up again when the size of the list or the container
|
|
21
|
+
* changes — with it changes whether the container scrolls.
|
|
22
|
+
*
|
|
23
|
+
* **One measurement a frame**, on scrolling of the container and the page, on
|
|
24
|
+
* resizing of the list and the container, on a change of what the collection
|
|
25
|
+
* draws, and when the first drawn item enters the document while none was in
|
|
26
|
+
* it: the markup may draw the entries later than the window has them — the
|
|
27
|
+
* Select panel builds its options from data on its first opening, and `drawn`
|
|
28
|
+
* does not change then. The band is the intersection of the container's
|
|
29
|
+
* window with the browser's, from the top of the list. The top of the list is
|
|
30
|
+
* the top of a drawn item minus its place times the step: the list may have no
|
|
31
|
+
* markup of its own at all (the header and footer of ListBox, the table
|
|
32
|
+
* body), and the items stand from its top a step apart. The step is the
|
|
33
|
+
* smallest distance between the tops of neighboring drawn items: no item is
|
|
34
|
+
* shorter than the step, the theme holds its height. With one item drawn — the
|
|
35
|
+
* previous step, and on the first measurement its height; no items in the
|
|
36
|
+
* document — no measurement. No box at the drawn item (the list is hidden) —
|
|
37
|
+
* no measurement either: from zero boxes the top of the list would slide to
|
|
38
|
+
* the start, and while the list is hidden the window would follow it frame
|
|
39
|
+
* after frame; this way it stays where it stood.
|
|
40
|
+
*
|
|
41
|
+
* **A tall item.** Items in the window share one height: an item taller than
|
|
42
|
+
* the step shifts the fillers, and scrolling drifts. The plugin finds such an
|
|
43
|
+
* item while measuring and warns in the console — once per mount.
|
|
44
|
+
*
|
|
45
|
+
* **Focus.** The item DOM focus came into is pinned in the window: scrolling
|
|
46
|
+
* does not take it out of the document while focus is in it. Focus moved to a
|
|
47
|
+
* node outside the component — no pin.
|
|
48
|
+
*/
|
|
49
|
+
export declare class TVirtualPlugin extends TBasePlugin<any, TVirtualPluginEvents> {
|
|
50
|
+
private _root;
|
|
51
|
+
private _draw;
|
|
52
|
+
private _elements;
|
|
53
|
+
/** Родитель нарисованных элементов: за его размером плагин следит. */
|
|
54
|
+
private _list;
|
|
55
|
+
/** Контейнер прокрутки; `null` — прокручивает страница. */
|
|
56
|
+
private _container;
|
|
57
|
+
private _resize;
|
|
58
|
+
/** За чьим размером наблюдатель следит сейчас: список и контейнер. */
|
|
59
|
+
private _observed;
|
|
60
|
+
/**
|
|
61
|
+
* Размер сменился — контейнер искать заново при замере. Не в колбэке
|
|
62
|
+
* наблюдателя: новый узел под наблюдением дал бы в том же кадре ещё одно
|
|
63
|
+
* уведомление, и браузер сообщил бы о петле.
|
|
64
|
+
*/
|
|
65
|
+
private _containerStale;
|
|
66
|
+
private _frame;
|
|
67
|
+
/** Stops waiting for the first drawn node (`_awaitDrawn`); `null` — not waiting. */
|
|
68
|
+
private _waiting;
|
|
69
|
+
private _listening;
|
|
70
|
+
/** Последний шаг элементов: пока замерить нечем, полосу меряют им. */
|
|
71
|
+
private _step;
|
|
72
|
+
/** О высоком элементе уже предупредили. */
|
|
73
|
+
private _warned;
|
|
74
|
+
install(ctx: IPluginContext): void;
|
|
75
|
+
destroy(): void;
|
|
76
|
+
private _bind;
|
|
77
|
+
/** Слушать документ — пока у компонента есть корень и стоит окно. */
|
|
78
|
+
private readonly _sync;
|
|
79
|
+
private _start;
|
|
80
|
+
private _stop;
|
|
81
|
+
/**
|
|
82
|
+
* Узнать список по нарисованному элементу: за размером его родителя
|
|
83
|
+
* следить, а контейнер искать заново, если сменился родитель или просят.
|
|
84
|
+
*/
|
|
85
|
+
private _watchList;
|
|
86
|
+
/** Сменить контейнер прокрутки: прокрутку и размер слушать у нового. */
|
|
87
|
+
private _watchContainer;
|
|
88
|
+
/**
|
|
89
|
+
* Следить за размером списка и контейнера — пока слушаем документ. Узел,
|
|
90
|
+
* за которым уже следят, повторно не ставится: наблюдатель сообщил бы его
|
|
91
|
+
* размер заново.
|
|
92
|
+
*/
|
|
93
|
+
private _observe;
|
|
94
|
+
/** Размер списка или контейнера сменился — может смениться и сам контейнер. */
|
|
95
|
+
private readonly _onResize;
|
|
96
|
+
private readonly _onSchedule;
|
|
97
|
+
/** Проход — раз в кадр: подряд идущие поводы схлопываются в один замер. */
|
|
98
|
+
private _schedule;
|
|
99
|
+
private _cancel;
|
|
100
|
+
private _measure;
|
|
101
|
+
/**
|
|
102
|
+
* Wait for the first drawn item to enter the document — its bundle
|
|
103
|
+
* registered and its node bound, in either order
|
|
104
|
+
* (`TCollectionElements.waitFor`), — and measure a frame later. The markup
|
|
105
|
+
* may draw the window's entries later than the window has them: the panel of
|
|
106
|
+
* a Select builds its options from data on its first opening, and `drawn`
|
|
107
|
+
* does not change then. Without a node there is no list to watch the size
|
|
108
|
+
* of, and nothing would schedule the measurement.
|
|
109
|
+
*/
|
|
110
|
+
private _awaitDrawn;
|
|
111
|
+
/** Первый нарисованный элемент, у которого есть узел в документе. */
|
|
112
|
+
private _firstDrawn;
|
|
113
|
+
/** Видимая полоса: окно контейнера в окне браузера, без контейнера — окно браузера. */
|
|
114
|
+
private _band;
|
|
115
|
+
/**
|
|
116
|
+
* Шаг элементов — наименьшее расстояние между верхами соседних
|
|
117
|
+
* нарисованных элементов. Нарисован один — шаг прежний, а без прежнего —
|
|
118
|
+
* его высота; элементов нет — ноль. Элемент выше шага — предупреждение.
|
|
119
|
+
*/
|
|
120
|
+
private _measureStep;
|
|
121
|
+
/** Нарисованный элемент, в узле которого лежит узел. */
|
|
122
|
+
private _itemOf;
|
|
123
|
+
private readonly _onFocusIn;
|
|
124
|
+
/** Фокус ушёл на узел вне компонента — закрепления нет. Ушёл из окна браузера — осталось. */
|
|
125
|
+
private readonly _onFocusOut;
|
|
126
|
+
}
|