@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,150 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext, TPluginEvents } from '../../../base';
|
|
3
|
+
import { TDismissPlugin } from '../../dismiss';
|
|
4
|
+
import type { IOverlayOpenOptions } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* TOverlayFocusPlugin — общая часть модели фокуса всего, что открывается
|
|
7
|
+
* поверх страницы.
|
|
8
|
+
*
|
|
9
|
+
* Одинаково у модального и немодального оверлея всё, кроме Tab: запомнить,
|
|
10
|
+
* откуда открыли, увести фокус в панель, вернуть его при закрытии и закрыться
|
|
11
|
+
* по Escape. Стратегий Tab две, и различаются они целиком, а не деталью:
|
|
12
|
+
* немодальная панель пропускает фокус дальше по странице
|
|
13
|
+
* (`TPopoverFocusPlugin`), модальная замыкает его в себе
|
|
14
|
+
* (`TModalFocusPlugin`). Поэтому здесь база, а не флаг `modal` в одном
|
|
15
|
+
* плагине. Третья модель — панель DatePicker (`TDatePickerFocusPlugin`): Tab
|
|
16
|
+
* замкнут, как у модальной (ловушка — общая утилита `trapTab`), а нажатие
|
|
17
|
+
* мимо фокус отпускает, как у немодальной.
|
|
18
|
+
*
|
|
19
|
+
* **Открытие.** Запоминает элемент, на котором был фокус, и кадром позже
|
|
20
|
+
* ставит фокус на первую остановку Tab в панели, а если её нет — на саму
|
|
21
|
+
* панель (`tabindex="-1"`). Кадр — потому что содержимое панели монтирует
|
|
22
|
+
* рендер адаптера, а он идёт после смены открытости. Оверлей, открытый со
|
|
23
|
+
* старта, обрабатывается так же, как только корень объявлен. Своё место
|
|
24
|
+
* первого фокуса наследник подставляет точкой `_focusCandidates`: панель
|
|
25
|
+
* DatePicker ставит его на день сетки, а не на первую кнопку календаря.
|
|
26
|
+
* Обе операции открытия наследнику доступны: снять кадр этого открытия
|
|
27
|
+
* (`_cancelFocusFrame`) — фокус остаётся, где был, — и увести фокус в
|
|
28
|
+
* открытую панель сейчас (`_focusPanel`). Так пункт меню с панелью оставляет
|
|
29
|
+
* фокус на строке, когда панель открыл указатель, и ведёт его в панель
|
|
30
|
+
* клавишей.
|
|
31
|
+
*
|
|
32
|
+
* **Закрытие.** Фокус возвращается на запомненный элемент, а если там был
|
|
33
|
+
* `body` или элемент уже отсоединён — на то, что подставит наследник
|
|
34
|
+
* (`_returnCandidates`). Годится ли запомненный элемент для возврата, тоже
|
|
35
|
+
* решает наследник (`_canReturnTo`): по умолчанию годится любой — так у
|
|
36
|
+
* Popover, Menu и модального окна, — а панель DatePicker на свою кнопку
|
|
37
|
+
* календаря фокус не возвращает, она возвращает его в поле. Не возвращать
|
|
38
|
+
* фокус вовсе (`_restore`) решает стратегия: у немодального оверлея нажатие
|
|
39
|
+
* и уход фокуса мимо — выбор пользователя, он уже там, куда нажал; у
|
|
40
|
+
* модального фокус возвращается при любом закрытии.
|
|
41
|
+
*
|
|
42
|
+
* **Escape** закрывает оверлей, если его ещё никто не обработал
|
|
43
|
+
* (`defaultPrevented`). Сам плагин гасит его `preventDefault`, а не
|
|
44
|
+
* `stopPropagation`: так Escape в открытом Select или во вложенной панели
|
|
45
|
+
* закрывает только их слой, а внешний видит, что клавиша уже потрачена.
|
|
46
|
+
* Закрывает с причиной `escape`: владелец, который принимает запрос закрытия
|
|
47
|
+
* (модальное окно), может его отклонить — клавиша всё равно потрачена, она
|
|
48
|
+
* адресована верхнему слою.
|
|
49
|
+
*
|
|
50
|
+
* Слушатели клавиш — на корне и на панели, пока оверлей открыт. Корень берёт
|
|
51
|
+
* у `TElementPlugin`, панель — у `TDismissPlugin`: панель телепортирована, и
|
|
52
|
+
* найти её можно только по его пометке владельцем. Панели по пометке нет (её
|
|
53
|
+
* не пометили или `TDismissPlugin` не поставлен) — подставляет её наследник
|
|
54
|
+
* (`_panelFallback`): у модального окна корень и есть панель, а у
|
|
55
|
+
* немодального панели просто нет.
|
|
56
|
+
*/
|
|
57
|
+
export declare abstract class TOverlayFocusPlugin<TEvents extends TPluginEvents = TPluginEvents> extends TBasePlugin<any, TEvents> {
|
|
58
|
+
/** Открытость владельца: по ней плагин включается и ею же закрывает. */
|
|
59
|
+
private _open;
|
|
60
|
+
protected _dismiss: TDismissPlugin | null;
|
|
61
|
+
/** Корень компонента — на нём висит слушатель клавиш. */
|
|
62
|
+
protected _root: Element | null;
|
|
63
|
+
/** Панель, найденная при открытии, — на ней тоже висит слушатель клавиш. */
|
|
64
|
+
protected _panel: Element | null;
|
|
65
|
+
/**
|
|
66
|
+
* Возвращать ли фокус при закрытии. Снимает стратегия — у немодального
|
|
67
|
+
* оверлея нажатие мимо, уход фокуса и Tab из панели.
|
|
68
|
+
*/
|
|
69
|
+
protected _restore: boolean;
|
|
70
|
+
/** Узлы со слушателем клавиш: корень и панель, если это разные узлы. */
|
|
71
|
+
private _targets;
|
|
72
|
+
/** Открытие обработано: элемент возврата запомнен, фокус уводится в панель. */
|
|
73
|
+
private _engaged;
|
|
74
|
+
/** Элемент, на котором был фокус при открытии, — на него фокус вернётся. */
|
|
75
|
+
private _returnTo;
|
|
76
|
+
/** Кадр, в котором фокус уйдёт в панель; `null` — уводить некуда. */
|
|
77
|
+
private _focusFrame;
|
|
78
|
+
install(ctx: IPluginContext, options?: IOverlayOpenOptions): void;
|
|
79
|
+
destroy(): void;
|
|
80
|
+
/** Что делает Tab: наружу из панели у немодального, по кругу — у модального. */
|
|
81
|
+
protected abstract _onTab(event: KeyboardEvent): void;
|
|
82
|
+
/**
|
|
83
|
+
* Панель, когда её не нашлось по пометке владельца. У модального оверлея
|
|
84
|
+
* панель и есть корень, у немодального панели без пометки нет.
|
|
85
|
+
*/
|
|
86
|
+
protected _panelFallback(_root: Element): Element | null;
|
|
87
|
+
/**
|
|
88
|
+
* Куда уводить фокус при открытии — по порядку, до первого, кто его примет:
|
|
89
|
+
* первая остановка Tab в панели, а если её нет — сама панель.
|
|
90
|
+
*/
|
|
91
|
+
protected _focusCandidates(panel: Element): readonly Element[];
|
|
92
|
+
/**
|
|
93
|
+
* Годится ли запомненный элемент для возврата фокуса. По умолчанию — да:
|
|
94
|
+
* фокус возвращается туда, откуда открыли. Не годится — фокус уходит туда
|
|
95
|
+
* же, куда при пропавшем элементе (`_returnCandidates`).
|
|
96
|
+
*/
|
|
97
|
+
protected _canReturnTo(_element: Element, _root: Element): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Куда вернуть фокус, когда запомненный элемент пропал или для возврата не
|
|
100
|
+
* годится (`_canReturnTo`). У немодального оверлея это триггер внутри
|
|
101
|
+
* корня, у модального возвращать некуда.
|
|
102
|
+
*/
|
|
103
|
+
protected _returnCandidates(_root: Element): readonly Element[];
|
|
104
|
+
/**
|
|
105
|
+
* Возвращать ли фокус при этом закрытии — сверх того, что решила стратегия
|
|
106
|
+
* (`_restore`): у той ответ один на причину закрытия, а здесь наследник
|
|
107
|
+
* смотрит, где фокус сейчас. По умолчанию — да. Подменю отказывает, когда
|
|
108
|
+
* фокус уже не в нём: закрылось оно вместе с меню, а фокус меню вернуло на
|
|
109
|
+
* триггер, — и строка спрятанной панели его не перехватывает.
|
|
110
|
+
*/
|
|
111
|
+
protected _returnsFocus(_root: Element): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Закрыть владельца записью — у немодального оверлея Tab из панели. Это
|
|
114
|
+
* не просьба пользователя закрыть: фокус ушёл дальше по странице, и
|
|
115
|
+
* держать панель открытой за ним незачем.
|
|
116
|
+
*/
|
|
117
|
+
protected _close(): void;
|
|
118
|
+
/** Открытие: запомнить, куда вернуть фокус, увести его в панель, слушать клавиши. */
|
|
119
|
+
private _engage;
|
|
120
|
+
/** Закрытие: снять слушатели и вернуть фокус, если закрыло не нажатие мимо. */
|
|
121
|
+
private _release;
|
|
122
|
+
/**
|
|
123
|
+
* Фокус — в панель, на первого из кандидатов, кто его примет. Панели нет —
|
|
124
|
+
* оверлей закрыт или корня ещё нет — ничего.
|
|
125
|
+
*
|
|
126
|
+
* Окно к нему не прокручивается (`preventScroll`): место панели решает её
|
|
127
|
+
* раскладка, а не фокус. Кадр фокуса идёт раньше наблюдателей размера, и
|
|
128
|
+
* панель у якоря, которая лежит в документе, ещё стоит там, где её
|
|
129
|
+
* поставил расчёт по нулевой высоте, — под полем у нижнего края окна.
|
|
130
|
+
* Прокрутка к ней увела бы страницу, и панель осталась бы внизу, а не
|
|
131
|
+
* встала над полем.
|
|
132
|
+
*/
|
|
133
|
+
protected _focusPanel(): void;
|
|
134
|
+
/**
|
|
135
|
+
* На запомненный элемент, если он годится для возврата (`_canReturnTo`),
|
|
136
|
+
* иначе — туда, куда указал наследник. `body` не в счёт: на нём фокус,
|
|
137
|
+
* когда его нет нигде (открыли не с клавиатуры и не кликом по кнопке), и
|
|
138
|
+
* вернуть его туда значило бы потерять.
|
|
139
|
+
*/
|
|
140
|
+
private _returnFocus;
|
|
141
|
+
private _listen;
|
|
142
|
+
private _unlisten;
|
|
143
|
+
private readonly _onKeyDown;
|
|
144
|
+
/**
|
|
145
|
+
* Снять кадр, которым фокус уйдёт в панель при этом открытии: фокус
|
|
146
|
+
* остаётся, где был. Кадра нет — оверлей закрыт или фокус уже увели —
|
|
147
|
+
* ничего.
|
|
148
|
+
*/
|
|
149
|
+
protected _cancelFocusFrame(): void;
|
|
150
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
3
|
+
import { tabStops } from "../../../utils/tabStops.js";
|
|
4
|
+
import { focusFirst } from "../../../utils/focusFirst.js";
|
|
5
|
+
import { bindOverlayOpen } from "../open-state.js";
|
|
6
|
+
import { TDismissPlugin } from "../../dismiss/dismiss.plugin.js";
|
|
7
|
+
//#region src/custom/overlay/focus/focus.plugin.ts
|
|
8
|
+
/**
|
|
9
|
+
* TOverlayFocusPlugin — общая часть модели фокуса всего, что открывается
|
|
10
|
+
* поверх страницы.
|
|
11
|
+
*
|
|
12
|
+
* Одинаково у модального и немодального оверлея всё, кроме Tab: запомнить,
|
|
13
|
+
* откуда открыли, увести фокус в панель, вернуть его при закрытии и закрыться
|
|
14
|
+
* по Escape. Стратегий Tab две, и различаются они целиком, а не деталью:
|
|
15
|
+
* немодальная панель пропускает фокус дальше по странице
|
|
16
|
+
* (`TPopoverFocusPlugin`), модальная замыкает его в себе
|
|
17
|
+
* (`TModalFocusPlugin`). Поэтому здесь база, а не флаг `modal` в одном
|
|
18
|
+
* плагине. Третья модель — панель DatePicker (`TDatePickerFocusPlugin`): Tab
|
|
19
|
+
* замкнут, как у модальной (ловушка — общая утилита `trapTab`), а нажатие
|
|
20
|
+
* мимо фокус отпускает, как у немодальной.
|
|
21
|
+
*
|
|
22
|
+
* **Открытие.** Запоминает элемент, на котором был фокус, и кадром позже
|
|
23
|
+
* ставит фокус на первую остановку Tab в панели, а если её нет — на саму
|
|
24
|
+
* панель (`tabindex="-1"`). Кадр — потому что содержимое панели монтирует
|
|
25
|
+
* рендер адаптера, а он идёт после смены открытости. Оверлей, открытый со
|
|
26
|
+
* старта, обрабатывается так же, как только корень объявлен. Своё место
|
|
27
|
+
* первого фокуса наследник подставляет точкой `_focusCandidates`: панель
|
|
28
|
+
* DatePicker ставит его на день сетки, а не на первую кнопку календаря.
|
|
29
|
+
* Обе операции открытия наследнику доступны: снять кадр этого открытия
|
|
30
|
+
* (`_cancelFocusFrame`) — фокус остаётся, где был, — и увести фокус в
|
|
31
|
+
* открытую панель сейчас (`_focusPanel`). Так пункт меню с панелью оставляет
|
|
32
|
+
* фокус на строке, когда панель открыл указатель, и ведёт его в панель
|
|
33
|
+
* клавишей.
|
|
34
|
+
*
|
|
35
|
+
* **Закрытие.** Фокус возвращается на запомненный элемент, а если там был
|
|
36
|
+
* `body` или элемент уже отсоединён — на то, что подставит наследник
|
|
37
|
+
* (`_returnCandidates`). Годится ли запомненный элемент для возврата, тоже
|
|
38
|
+
* решает наследник (`_canReturnTo`): по умолчанию годится любой — так у
|
|
39
|
+
* Popover, Menu и модального окна, — а панель DatePicker на свою кнопку
|
|
40
|
+
* календаря фокус не возвращает, она возвращает его в поле. Не возвращать
|
|
41
|
+
* фокус вовсе (`_restore`) решает стратегия: у немодального оверлея нажатие
|
|
42
|
+
* и уход фокуса мимо — выбор пользователя, он уже там, куда нажал; у
|
|
43
|
+
* модального фокус возвращается при любом закрытии.
|
|
44
|
+
*
|
|
45
|
+
* **Escape** закрывает оверлей, если его ещё никто не обработал
|
|
46
|
+
* (`defaultPrevented`). Сам плагин гасит его `preventDefault`, а не
|
|
47
|
+
* `stopPropagation`: так Escape в открытом Select или во вложенной панели
|
|
48
|
+
* закрывает только их слой, а внешний видит, что клавиша уже потрачена.
|
|
49
|
+
* Закрывает с причиной `escape`: владелец, который принимает запрос закрытия
|
|
50
|
+
* (модальное окно), может его отклонить — клавиша всё равно потрачена, она
|
|
51
|
+
* адресована верхнему слою.
|
|
52
|
+
*
|
|
53
|
+
* Слушатели клавиш — на корне и на панели, пока оверлей открыт. Корень берёт
|
|
54
|
+
* у `TElementPlugin`, панель — у `TDismissPlugin`: панель телепортирована, и
|
|
55
|
+
* найти её можно только по его пометке владельцем. Панели по пометке нет (её
|
|
56
|
+
* не пометили или `TDismissPlugin` не поставлен) — подставляет её наследник
|
|
57
|
+
* (`_panelFallback`): у модального окна корень и есть панель, а у
|
|
58
|
+
* немодального панели просто нет.
|
|
59
|
+
*/
|
|
60
|
+
var TOverlayFocusPlugin = class extends TBasePlugin {
|
|
61
|
+
/** Открытость владельца: по ней плагин включается и ею же закрывает. */
|
|
62
|
+
_open = null;
|
|
63
|
+
_dismiss = null;
|
|
64
|
+
/** Корень компонента — на нём висит слушатель клавиш. */
|
|
65
|
+
_root = null;
|
|
66
|
+
/** Панель, найденная при открытии, — на ней тоже висит слушатель клавиш. */
|
|
67
|
+
_panel = null;
|
|
68
|
+
/**
|
|
69
|
+
* Возвращать ли фокус при закрытии. Снимает стратегия — у немодального
|
|
70
|
+
* оверлея нажатие мимо, уход фокуса и Tab из панели.
|
|
71
|
+
*/
|
|
72
|
+
_restore = true;
|
|
73
|
+
/** Узлы со слушателем клавиш: корень и панель, если это разные узлы. */
|
|
74
|
+
_targets = [];
|
|
75
|
+
/** Открытие обработано: элемент возврата запомнен, фокус уводится в панель. */
|
|
76
|
+
_engaged = false;
|
|
77
|
+
/** Элемент, на котором был фокус при открытии, — на него фокус вернётся. */
|
|
78
|
+
_returnTo = null;
|
|
79
|
+
/** Кадр, в котором фокус уйдёт в панель; `null` — уводить некуда. */
|
|
80
|
+
_focusFrame = null;
|
|
81
|
+
install(ctx, options) {
|
|
82
|
+
super.install(ctx, options);
|
|
83
|
+
this._dismiss = ctx.get(TDismissPlugin) ?? null;
|
|
84
|
+
const elementPlugin = ctx.get(TElementPlugin);
|
|
85
|
+
elementPlugin?.events.on("ready", (element) => {
|
|
86
|
+
this._root = element;
|
|
87
|
+
if (this._open?.read()) this._engage();
|
|
88
|
+
});
|
|
89
|
+
elementPlugin?.events.on("removed", () => {
|
|
90
|
+
this._unlisten();
|
|
91
|
+
this._root = null;
|
|
92
|
+
});
|
|
93
|
+
this._open = bindOverlayOpen(ctx, options, (open) => {
|
|
94
|
+
if (open) this._engage();
|
|
95
|
+
else this._release();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
this._cancelFocusFrame();
|
|
100
|
+
this._unlisten();
|
|
101
|
+
this._open?.unbind();
|
|
102
|
+
this._open = null;
|
|
103
|
+
this._dismiss = null;
|
|
104
|
+
this._root = null;
|
|
105
|
+
this._returnTo = null;
|
|
106
|
+
super.destroy();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Панель, когда её не нашлось по пометке владельца. У модального оверлея
|
|
110
|
+
* панель и есть корень, у немодального панели без пометки нет.
|
|
111
|
+
*/
|
|
112
|
+
_panelFallback(_root) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Куда уводить фокус при открытии — по порядку, до первого, кто его примет:
|
|
117
|
+
* первая остановка Tab в панели, а если её нет — сама панель.
|
|
118
|
+
*/
|
|
119
|
+
_focusCandidates(panel) {
|
|
120
|
+
return [...tabStops(panel), panel];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Годится ли запомненный элемент для возврата фокуса. По умолчанию — да:
|
|
124
|
+
* фокус возвращается туда, откуда открыли. Не годится — фокус уходит туда
|
|
125
|
+
* же, куда при пропавшем элементе (`_returnCandidates`).
|
|
126
|
+
*/
|
|
127
|
+
_canReturnTo(_element, _root) {
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Куда вернуть фокус, когда запомненный элемент пропал или для возврата не
|
|
132
|
+
* годится (`_canReturnTo`). У немодального оверлея это триггер внутри
|
|
133
|
+
* корня, у модального возвращать некуда.
|
|
134
|
+
*/
|
|
135
|
+
_returnCandidates(_root) {
|
|
136
|
+
return [];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Возвращать ли фокус при этом закрытии — сверх того, что решила стратегия
|
|
140
|
+
* (`_restore`): у той ответ один на причину закрытия, а здесь наследник
|
|
141
|
+
* смотрит, где фокус сейчас. По умолчанию — да. Подменю отказывает, когда
|
|
142
|
+
* фокус уже не в нём: закрылось оно вместе с меню, а фокус меню вернуло на
|
|
143
|
+
* триггер, — и строка спрятанной панели его не перехватывает.
|
|
144
|
+
*/
|
|
145
|
+
_returnsFocus(_root) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Закрыть владельца записью — у немодального оверлея Tab из панели. Это
|
|
150
|
+
* не просьба пользователя закрыть: фокус ушёл дальше по странице, и
|
|
151
|
+
* держать панель открытой за ним незачем.
|
|
152
|
+
*/
|
|
153
|
+
_close() {
|
|
154
|
+
this._open?.write(false);
|
|
155
|
+
}
|
|
156
|
+
/** Открытие: запомнить, куда вернуть фокус, увести его в панель, слушать клавиши. */
|
|
157
|
+
_engage() {
|
|
158
|
+
const root = this._root;
|
|
159
|
+
if (!root) return;
|
|
160
|
+
this._listen(root);
|
|
161
|
+
if (this._engaged) return;
|
|
162
|
+
this._engaged = true;
|
|
163
|
+
this._restore = true;
|
|
164
|
+
this._returnTo = root.ownerDocument.activeElement;
|
|
165
|
+
this._cancelFocusFrame();
|
|
166
|
+
this._focusFrame = requestAnimationFrame(() => {
|
|
167
|
+
this._focusFrame = null;
|
|
168
|
+
this._focusPanel();
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/** Закрытие: снять слушатели и вернуть фокус, если закрыло не нажатие мимо. */
|
|
172
|
+
_release() {
|
|
173
|
+
this._cancelFocusFrame();
|
|
174
|
+
this._unlisten();
|
|
175
|
+
if (!this._engaged) return;
|
|
176
|
+
const root = this._root;
|
|
177
|
+
const returnTo = this._returnTo;
|
|
178
|
+
const restore = this._restore;
|
|
179
|
+
this._engaged = false;
|
|
180
|
+
this._returnTo = null;
|
|
181
|
+
this._restore = true;
|
|
182
|
+
if (restore && root && this._returnsFocus(root)) this._returnFocus(root, returnTo);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Фокус — в панель, на первого из кандидатов, кто его примет. Панели нет —
|
|
186
|
+
* оверлей закрыт или корня ещё нет — ничего.
|
|
187
|
+
*
|
|
188
|
+
* Окно к нему не прокручивается (`preventScroll`): место панели решает её
|
|
189
|
+
* раскладка, а не фокус. Кадр фокуса идёт раньше наблюдателей размера, и
|
|
190
|
+
* панель у якоря, которая лежит в документе, ещё стоит там, где её
|
|
191
|
+
* поставил расчёт по нулевой высоте, — под полем у нижнего края окна.
|
|
192
|
+
* Прокрутка к ней увела бы страницу, и панель осталась бы внизу, а не
|
|
193
|
+
* встала над полем.
|
|
194
|
+
*/
|
|
195
|
+
_focusPanel() {
|
|
196
|
+
const panel = this._panel;
|
|
197
|
+
if (panel) focusFirst(this._focusCandidates(panel), { preventScroll: true });
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* На запомненный элемент, если он годится для возврата (`_canReturnTo`),
|
|
201
|
+
* иначе — туда, куда указал наследник. `body` не в счёт: на нём фокус,
|
|
202
|
+
* когда его нет нигде (открыли не с клавиатуры и не кликом по кнопке), и
|
|
203
|
+
* вернуть его туда значило бы потерять.
|
|
204
|
+
*/
|
|
205
|
+
_returnFocus(root, returnTo) {
|
|
206
|
+
const doc = root.ownerDocument;
|
|
207
|
+
const remembered = returnTo && returnTo.isConnected && returnTo !== doc.body && returnTo !== doc.documentElement && this._canReturnTo(returnTo, root) ? [returnTo] : [];
|
|
208
|
+
focusFirst([...remembered, ...this._returnCandidates(root)]);
|
|
209
|
+
}
|
|
210
|
+
_listen(root) {
|
|
211
|
+
this._unlisten();
|
|
212
|
+
this._panel = this._dismiss?.findPanel() ?? this._panelFallback(root);
|
|
213
|
+
this._targets = this._panel && !root.contains(this._panel) ? [root, this._panel] : [root];
|
|
214
|
+
for (const target of this._targets) target.addEventListener("keydown", this._onKeyDown);
|
|
215
|
+
}
|
|
216
|
+
_unlisten() {
|
|
217
|
+
for (const target of this._targets) target.removeEventListener("keydown", this._onKeyDown);
|
|
218
|
+
this._targets = [];
|
|
219
|
+
this._panel = null;
|
|
220
|
+
}
|
|
221
|
+
_onKeyDown = (event) => {
|
|
222
|
+
if (event.defaultPrevented) return;
|
|
223
|
+
if (event.key === "Escape") {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
this._open?.close("escape");
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (event.key === "Tab") this._onTab(event);
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Снять кадр, которым фокус уйдёт в панель при этом открытии: фокус
|
|
232
|
+
* остаётся, где был. Кадра нет — оверлей закрыт или фокус уже увели —
|
|
233
|
+
* ничего.
|
|
234
|
+
*/
|
|
235
|
+
_cancelFocusFrame() {
|
|
236
|
+
if (this._focusFrame === null) return;
|
|
237
|
+
cancelAnimationFrame(this._focusFrame);
|
|
238
|
+
this._focusFrame = null;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
//#endregion
|
|
242
|
+
export { TOverlayFocusPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TOverlayFocusPlugin } from './focus.plugin';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
import type { IHideOutsidePluginOptions, THideOutsidePluginEvents } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* THideOutsidePlugin — пока владелец открыт, фон под ним спрятан от
|
|
6
|
+
* скринридера.
|
|
7
|
+
*
|
|
8
|
+
* Вторая половина модальности. Фокус в модальной панели держит
|
|
9
|
+
* `TModalFocusPlugin`, но скринридер читает страницу и без фокуса — режимом
|
|
10
|
+
* чтения, стрелками. APG требует, чтобы фон модального окна был для него
|
|
11
|
+
* недоступен: `aria-modal="true"` на панели (его пишет ядро окна в свой
|
|
12
|
+
* `aria`) закрывает это только у современных скринридеров, а режим чтения
|
|
13
|
+
* браузера и старые AT уважают лишь пометку на самих узлах фона.
|
|
14
|
+
*
|
|
15
|
+
* **Пометка — `aria-hidden="true"`, а не `inert`.** `inert` отнимает у фона
|
|
16
|
+
* ещё и фокус, а фокусом владеет модель фокуса: при закрытии она сразу
|
|
17
|
+
* возвращает его в фон, и пока фон `inert`, `focus()` молча не срабатывает.
|
|
18
|
+
* Работа зависела бы от того, какой из двух плагинов раньше узнал о
|
|
19
|
+
* закрытии. Здесь — только то, что видит скринридер.
|
|
20
|
+
*
|
|
21
|
+
* **Что остаётся доступным.** Панель — узел с пометкой владельцем
|
|
22
|
+
* (`TDismissPlugin.findPanel()`), а без неё корень: у модального окна корень
|
|
23
|
+
* телепортирован целиком (то же правило, что у `TModalFocusPlugin`). И
|
|
24
|
+
* слои, открытые поверх панели: список Select в окне — тоже панель в `body`,
|
|
25
|
+
* соседка окна, а не его потомок. Слой выше — по номеру слоя `TLayer`
|
|
26
|
+
* (`data-layer`) и тем же правилом, по которому `TDismissPlugin` считает
|
|
27
|
+
* нажатие в такой список нажатием внутри (`isAboveLayer`): панель, в которую
|
|
28
|
+
* можно нажать, не должна быть немой.
|
|
29
|
+
*
|
|
30
|
+
* **Что прячется** — соседи оставленных узлов и соседи их предков вплоть до
|
|
31
|
+
* `body`. Вверх, а не только дети `body`: `TFrame` телепортируют и глубже
|
|
32
|
+
* (`target`), и тогда соседи панели внутри своего контейнера — тоже фон.
|
|
33
|
+
*
|
|
34
|
+
* **Набор пересчитывается, а не снимается при открытии.** Скрытый `TFrame`
|
|
35
|
+
* лежит в `body` уже смонтированным, а номер слоя пишет только показ, и
|
|
36
|
+
* скрытие его не снимает: у скрытой панели номера нет или он остался от
|
|
37
|
+
* прошлого показа. Список Select, открытый из окна, получает номер выше уже
|
|
38
|
+
* при открытом окне. Поэтому, пока фон спрятан, `MutationObserver` на `body`
|
|
39
|
+
* следит за составом поддерева и за `data-layer`: панель и её слой читаются
|
|
40
|
+
* на каждом пересчёте заново, а в DOM пишется только разница.
|
|
41
|
+
*
|
|
42
|
+
* **Слоёв бывает несколько** — окно поверх окна прячет и нижнее вместе с
|
|
43
|
+
* фоном, — поэтому пометка у узла одна на всех, со счётчиком (`marks.ts`):
|
|
44
|
+
* закрытие одного окна не снимает пометок другого, в каком бы порядке их ни
|
|
45
|
+
* закрывали, а последнее снятие возвращает то `aria-hidden`, что было у узла
|
|
46
|
+
* до первой пометки. Свои пометки плагин снимает при закрытии, при
|
|
47
|
+
* размонтировании корня и в `destroy()`.
|
|
48
|
+
*
|
|
49
|
+
* Открытость плагин ведёт сам — по свойству владельца (`property`, по
|
|
50
|
+
* умолчанию `open`), как `TScrollLockPlugin`; вручную — `enabled` при
|
|
51
|
+
* `property: null`. Документ берётся у корня, а не из `globalThis`:
|
|
52
|
+
* компонент живёт и в `iframe`.
|
|
53
|
+
*
|
|
54
|
+
* Чего плагин не делает: `aria-modal` пишет в свой набор ядро окна — это
|
|
55
|
+
* значение, а не операция; исключений для живых областей нет — фон
|
|
56
|
+
* прячется целиком, как у нативного `<dialog>`.
|
|
57
|
+
*/
|
|
58
|
+
export declare class THideOutsidePlugin extends TBasePlugin<any, THideOutsidePluginEvents> {
|
|
59
|
+
/** Умолчания опций, объявленных пропами, — см. `TDismissPlugin.defaultValues`. */
|
|
60
|
+
static defaultValues: Required<Pick<IHideOutsidePluginOptions, 'enabled'>>;
|
|
61
|
+
private _open;
|
|
62
|
+
private _dismiss;
|
|
63
|
+
private _element;
|
|
64
|
+
private _enabled;
|
|
65
|
+
/** `body` под наблюдением; `null` — фон не спрятан. */
|
|
66
|
+
private _body;
|
|
67
|
+
private _observer;
|
|
68
|
+
/** Узлы, которые пометил этот плагин: снимает он ровно их. */
|
|
69
|
+
private readonly _hidden;
|
|
70
|
+
install(ctx: IPluginContext, options?: IHideOutsidePluginOptions): void;
|
|
71
|
+
/**
|
|
72
|
+
* Спрятан ли фон. Владелец взводит это открытием; своё значение плагин
|
|
73
|
+
* держит и без корня — фон спрячется, как только корень объявят.
|
|
74
|
+
*/
|
|
75
|
+
get enabled(): boolean;
|
|
76
|
+
set enabled(value: boolean);
|
|
77
|
+
destroy(): void;
|
|
78
|
+
/** Фон спрятан ровно тогда, когда владелец открыт и корень объявлен. */
|
|
79
|
+
private _sync;
|
|
80
|
+
/** Пересчитать, что спрятать, и записать в DOM только разницу. */
|
|
81
|
+
private readonly _refresh;
|
|
82
|
+
/** Фон панели: всё в `body`, кроме неё и слоёв выше неё. */
|
|
83
|
+
private _outside;
|
|
84
|
+
}
|