@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,176 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TElementPlugin } from "../../element/element.plugin.js";
|
|
3
|
+
import { fieldOf } from "../../input/field.js";
|
|
4
|
+
import { frameDebounce } from "@soxa-ui/core";
|
|
5
|
+
//#region src/custom/textarea/autoresize/autoresize.plugin.ts
|
|
6
|
+
/** Число из вычисленного стиля в px; не число (`normal`) — 0. */
|
|
7
|
+
var px = (value) => parseFloat(value) || 0;
|
|
8
|
+
/**
|
|
9
|
+
* Запомнить прокрутку предков поля перед замером; вернуть её — функция,
|
|
10
|
+
* которую отдаёт вызов.
|
|
11
|
+
*
|
|
12
|
+
* Замер на миг сжимает поле до `rows`, и всё, что под ним, становится
|
|
13
|
+
* короче. Прокрутку, упёртую в конец, браузер при этом прижимает к новому
|
|
14
|
+
* концу, и после замера поле вставало на место, а страница уезжала вверх —
|
|
15
|
+
* на каждую клавишу в поле у низа страницы. Chromium возвращает её сам
|
|
16
|
+
* привязкой прокрутки (`overflow-anchor`), но без привязки — её выключило
|
|
17
|
+
* приложение или её нет у браузера — страница уезжала бы. Сдвиги предков,
|
|
18
|
+
* которые не изменились, возврат не трогает.
|
|
19
|
+
*/
|
|
20
|
+
function holdScroll(field) {
|
|
21
|
+
const held = [];
|
|
22
|
+
for (let node = field.parentElement; node; node = node.parentElement) if (node.scrollTop !== 0) held.push([node, node.scrollTop]);
|
|
23
|
+
return () => {
|
|
24
|
+
for (const [node, top] of held) if (node.scrollTop !== top) node.scrollTo({
|
|
25
|
+
top,
|
|
26
|
+
behavior: "instant"
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* TTextareaAutoresizePlugin — высота многострочного поля по содержимому: от
|
|
32
|
+
* `rows` до `maxRows` строк.
|
|
33
|
+
*
|
|
34
|
+
* Нативная `<textarea>` не растёт, поэтому авторост — флаг `autoresize`, а
|
|
35
|
+
* пока он выключен, плагин поле не трогает: высоту дают `rows` и ручка.
|
|
36
|
+
* Свойства лежат на инстансе (`ITextarea`), плагин их читает — так же, как
|
|
37
|
+
* `TListHeightPlugin` читает `maxRows` списка: свойство — ядру, применение —
|
|
38
|
+
* плагину.
|
|
39
|
+
*
|
|
40
|
+
* Высота — инлайновый `height` самой `<textarea>` (корень растёт за ней сам:
|
|
41
|
+
* в нём ещё счётчик), в единицах её `box-sizing`. Строку меряет вычисленный
|
|
42
|
+
* интерлиньяж поля, к строкам добавляются его поля и рамка по оси блока, а
|
|
43
|
+
* высоту текста отдаёт `scrollHeight` — на миг сжатого до `rows` поля без
|
|
44
|
+
* прокрутки: так текст переносится по всей ширине, как после замера.
|
|
45
|
+
* Прокрутку предков, которую сжатие могло сбить, замер возвращает. Пока
|
|
46
|
+
* потолок не набран, прокрутки у поля нет (`overflow-y: hidden`): иначе под
|
|
47
|
+
* курсором мелькала бы полоса, которой вот-вот не станет. На потолке плагин
|
|
48
|
+
* этот запрет снимает, и поле прокручивается. Ручку (`resize: none`) плагин
|
|
49
|
+
* гасит на всё время автороста: высоту ведёт он. Выключили авторост — стили
|
|
50
|
+
* снимает, чужих не трогает. Перехода у высоты нет: поле растёт вместе с
|
|
51
|
+
* набором.
|
|
52
|
+
*
|
|
53
|
+
* **Ввод пользователя — синхронно**, в слушателе `input` поля: значение в
|
|
54
|
+
* узле уже новое, и высота встаёт до отрисовки. Остальное — значение из кода,
|
|
55
|
+
* `rows`, `maxRows`, `autoresize`, `size`, ширина поля и подгруженный шрифт
|
|
56
|
+
* (текст переносится иначе) — **кадром**: значение из кода фреймворк пишет в
|
|
57
|
+
* узел позже, чем ядро о нём сообщает, а размер меняет поля и кегль через
|
|
58
|
+
* класс. Ширину сообщает `ResizeObserver` — плагину важна только она: высоту
|
|
59
|
+
* поля меняет он сам.
|
|
60
|
+
*
|
|
61
|
+
* **Кадр — только при узле**: между `ready` и `removed` своего
|
|
62
|
+
* `TElementPlugin`. Сборка идёт и на сервере, и значение там меняется, а узла
|
|
63
|
+
* и `requestAnimationFrame` нет. Что сменилось до узла, применяет `ready` —
|
|
64
|
+
* сразу.
|
|
65
|
+
*/
|
|
66
|
+
var TTextareaAutoresizePlugin = class extends TBasePlugin {
|
|
67
|
+
_owner = null;
|
|
68
|
+
/** Поле — `<textarea>` корня, пока узел корня объявлен */
|
|
69
|
+
_field = null;
|
|
70
|
+
_observer = null;
|
|
71
|
+
/** Ширина поля, о которой уже знает плагин: высоту меняет он сам */
|
|
72
|
+
_width = void 0;
|
|
73
|
+
/** Стили поля писал плагин: при выключении автороста есть что снять */
|
|
74
|
+
_applied = false;
|
|
75
|
+
/** Замер в следующем кадре; прежний отложенный отменяется. */
|
|
76
|
+
_fitNextFrame;
|
|
77
|
+
_onInput = () => this._fit();
|
|
78
|
+
_onFonts = () => this._schedule();
|
|
79
|
+
constructor() {
|
|
80
|
+
super();
|
|
81
|
+
this._fitNextFrame = frameDebounce(() => this._fit());
|
|
82
|
+
}
|
|
83
|
+
install(ctx, options) {
|
|
84
|
+
super.install(ctx, options);
|
|
85
|
+
const owner = ctx.getInstance();
|
|
86
|
+
if (!owner) return;
|
|
87
|
+
this._owner = owner;
|
|
88
|
+
const element = ctx.get(TElementPlugin);
|
|
89
|
+
element?.events.on("ready", (root) => this._attach(root));
|
|
90
|
+
element?.events.on("removed", () => this._detach());
|
|
91
|
+
const schedule = () => this._schedule();
|
|
92
|
+
this._listenTo(owner.events, "change:value", schedule);
|
|
93
|
+
this._listenTo(owner.events, "change:rows", schedule);
|
|
94
|
+
this._listenTo(owner.events, "change:maxRows", schedule);
|
|
95
|
+
this._listenTo(owner.events, "change:autoresize", schedule);
|
|
96
|
+
this._listenTo(owner.events, "change:size", schedule);
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
this._detach();
|
|
100
|
+
this._owner = null;
|
|
101
|
+
super.destroy();
|
|
102
|
+
}
|
|
103
|
+
_attach(root) {
|
|
104
|
+
this._detach();
|
|
105
|
+
const field = fieldOf(root);
|
|
106
|
+
if (!(field instanceof HTMLTextAreaElement)) return;
|
|
107
|
+
this._field = field;
|
|
108
|
+
field.addEventListener("input", this._onInput);
|
|
109
|
+
field.ownerDocument.fonts?.addEventListener("loadingdone", this._onFonts);
|
|
110
|
+
this._observer = new ResizeObserver((entries) => this._resized(entries));
|
|
111
|
+
this._observer.observe(field, { box: "border-box" });
|
|
112
|
+
this._fit();
|
|
113
|
+
}
|
|
114
|
+
_detach() {
|
|
115
|
+
const field = this._field;
|
|
116
|
+
field?.removeEventListener("input", this._onInput);
|
|
117
|
+
field?.ownerDocument.fonts?.removeEventListener("loadingdone", this._onFonts);
|
|
118
|
+
this._observer?.disconnect();
|
|
119
|
+
this._observer = null;
|
|
120
|
+
this._field = null;
|
|
121
|
+
this._width = void 0;
|
|
122
|
+
this._applied = false;
|
|
123
|
+
}
|
|
124
|
+
/** Наблюдатель сообщил размер поля: замер нужен, только если сменилась ширина. */
|
|
125
|
+
_resized(entries) {
|
|
126
|
+
const size = entries.at(-1)?.borderBoxSize?.at(0);
|
|
127
|
+
if (!size || size.inlineSize === this._width) return;
|
|
128
|
+
this._width = size.inlineSize;
|
|
129
|
+
this._schedule();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Замерить кадром позже — пока у плагина есть поле. Без узла повод ничего
|
|
133
|
+
* не планирует: всё, что сменилось до узла, применит `ready`.
|
|
134
|
+
*/
|
|
135
|
+
_schedule() {
|
|
136
|
+
if (this._field) this._fitNextFrame();
|
|
137
|
+
}
|
|
138
|
+
/** Высота поля по тексту — или снять стили, если авторост выключен. */
|
|
139
|
+
_fit() {
|
|
140
|
+
const field = this._field;
|
|
141
|
+
const owner = this._owner;
|
|
142
|
+
if (!field || !owner) return;
|
|
143
|
+
if (!owner.autoresize) {
|
|
144
|
+
this._release(field);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const restore = holdScroll(field);
|
|
148
|
+
const style = getComputedStyle(field);
|
|
149
|
+
field.style.overflowY = "hidden";
|
|
150
|
+
field.style.height = "auto";
|
|
151
|
+
const padding = px(style.paddingTop) + px(style.paddingBottom);
|
|
152
|
+
const border = px(style.borderTopWidth) + px(style.borderBottomWidth);
|
|
153
|
+
const line = px(style.lineHeight) || (field.clientHeight - padding) / field.rows;
|
|
154
|
+
const frame = style.boxSizing === "border-box" ? padding + border : 0;
|
|
155
|
+
const rows = Math.max(1, owner.rows);
|
|
156
|
+
const min = rows * line + frame;
|
|
157
|
+
const max = owner.maxRows > 0 ? Math.max(rows, owner.maxRows) * line + frame : Infinity;
|
|
158
|
+
const content = field.scrollHeight - padding + frame;
|
|
159
|
+
const overflows = content - max >= 1;
|
|
160
|
+
field.style.height = `${Math.min(Math.max(content, min), max)}px`;
|
|
161
|
+
field.style.overflowY = overflows ? "" : "hidden";
|
|
162
|
+
field.style.resize = "none";
|
|
163
|
+
this._applied = true;
|
|
164
|
+
restore();
|
|
165
|
+
}
|
|
166
|
+
/** Авторост выключен — снять то, что писал плагин; без его стилей — ничего. */
|
|
167
|
+
_release(field) {
|
|
168
|
+
if (!this._applied) return;
|
|
169
|
+
field.style.height = "";
|
|
170
|
+
field.style.overflowY = "";
|
|
171
|
+
field.style.resize = "";
|
|
172
|
+
this._applied = false;
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
//#endregion
|
|
176
|
+
export { TTextareaAutoresizePlugin };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TBasePlugin } from '../../../base';
|
|
2
|
+
import type { IPluginContext } from '../../../base';
|
|
3
|
+
/**
|
|
4
|
+
* TTextareaIdsPlugin — связка «поле ↔ счётчик символов» Textarea в документе.
|
|
5
|
+
*
|
|
6
|
+
* Пока счётчик включён (`counter`), его `id` — в его набор (`counterAria`), а
|
|
7
|
+
* ссылка на него — в `aria-describedby` поля: скринридер читает «12 / 200»
|
|
8
|
+
* вместе с полем, на фокусе, а не на каждый символ — живого региона у
|
|
9
|
+
* счётчика нет. Выключили — сняты оба: счётчика нет в документе, и ссылка
|
|
10
|
+
* вела бы в пустоту.
|
|
11
|
+
*
|
|
12
|
+
* Ссылку плагин пишет не в набор поля сам, а третьим входом его `TAriaPlugin`
|
|
13
|
+
* (`parts`): `aria-describedby` сливает он — справка поля формы, свои части,
|
|
14
|
+
* своё `aria_describedBy`, — и второй писатель того же атрибута стёр бы чужое.
|
|
15
|
+
*
|
|
16
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
17
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
18
|
+
* установке, синхронно, и на смену `counter` — связка есть уже в первой (и
|
|
19
|
+
* серверной) отрисовке.
|
|
20
|
+
*
|
|
21
|
+
* Шина поля бывает долговечнее плагина — приложение передаёт свой `ctrl`, —
|
|
22
|
+
* поэтому подписка через `_listenTo`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class TTextareaIdsPlugin extends TBasePlugin {
|
|
25
|
+
install(ctx: IPluginContext): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { TBasePlugin } from "../../../base/base.class.js";
|
|
2
|
+
import { TAriaPlugin } from "../../component-view/aria.plugin.js";
|
|
3
|
+
//#region src/custom/textarea/ids/ids.plugin.ts
|
|
4
|
+
/** Ссылок на свои части нет: счётчик не рисуется. */
|
|
5
|
+
var NO_PARTS = {};
|
|
6
|
+
/**
|
|
7
|
+
* TTextareaIdsPlugin — связка «поле ↔ счётчик символов» Textarea в документе.
|
|
8
|
+
*
|
|
9
|
+
* Пока счётчик включён (`counter`), его `id` — в его набор (`counterAria`), а
|
|
10
|
+
* ссылка на него — в `aria-describedby` поля: скринридер читает «12 / 200»
|
|
11
|
+
* вместе с полем, на фокусе, а не на каждый символ — живого региона у
|
|
12
|
+
* счётчика нет. Выключили — сняты оба: счётчика нет в документе, и ссылка
|
|
13
|
+
* вела бы в пустоту.
|
|
14
|
+
*
|
|
15
|
+
* Ссылку плагин пишет не в набор поля сам, а третьим входом его `TAriaPlugin`
|
|
16
|
+
* (`parts`): `aria-describedby` сливает он — справка поля формы, свои части,
|
|
17
|
+
* своё `aria_describedBy`, — и второй писатель того же атрибута стёр бы чужое.
|
|
18
|
+
*
|
|
19
|
+
* `id` — от монтирования (`createId`), а не от экземпляра: он нужен только
|
|
20
|
+
* документу, и на сервере и в браузере обязан совпасть. Пишется при
|
|
21
|
+
* установке, синхронно, и на смену `counter` — связка есть уже в первой (и
|
|
22
|
+
* серверной) отрисовке.
|
|
23
|
+
*
|
|
24
|
+
* Шина поля бывает долговечнее плагина — приложение передаёт свой `ctrl`, —
|
|
25
|
+
* поэтому подписка через `_listenTo`.
|
|
26
|
+
*/
|
|
27
|
+
var TTextareaIdsPlugin = class extends TBasePlugin {
|
|
28
|
+
install(ctx) {
|
|
29
|
+
super.install(ctx);
|
|
30
|
+
const textarea = ctx.getInstance();
|
|
31
|
+
if (!textarea) return;
|
|
32
|
+
const counterId = ctx.createId("counter");
|
|
33
|
+
const aria = ctx.get(TAriaPlugin);
|
|
34
|
+
const link = () => {
|
|
35
|
+
const shown = textarea.counter;
|
|
36
|
+
textarea.counterAria.add("id", shown ? counterId : null);
|
|
37
|
+
if (aria) aria.parts = shown ? { describedBy: counterId } : NO_PARTS;
|
|
38
|
+
};
|
|
39
|
+
link();
|
|
40
|
+
this._listenTo(textarea.events, "change:counter", link);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { TTextareaIdsPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TTextareaIdsPlugin } from './ids.plugin';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ITextarea, TEventSink } from '@soxa-ui/core';
|
|
2
|
+
import { TNamesPlugin } from '../../../locale/names.plugin';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TTranslations } from '../../../locale/types';
|
|
5
|
+
import type { TTextareaNamesPluginEvents } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* TTextareaNamesPlugin — текст счётчика символов Textarea от локали: «12 / 200».
|
|
8
|
+
*
|
|
9
|
+
* Счётчик рисует библиотека, и его текст — строка языка, как значение оценки
|
|
10
|
+
* Rating: при пределе `maxlength` — шаблон локали `textarea.counter`, без
|
|
11
|
+
* предела — одно число. Числа — по тегу локали (`toLocaleString`): «1 234»,
|
|
12
|
+
* а не «1234», и цифрами языка. Набранное считает ядро (`textLength`) — тем
|
|
13
|
+
* же счётом, что `data-limit` и браузер у `maxlength`.
|
|
14
|
+
*
|
|
15
|
+
* Текст — выходом (`counter`), а не в набор: у счётчика своего экземпляра
|
|
16
|
+
* нет, его разметку рисует шаблон поля. Пишет при установке, синхронно, —
|
|
17
|
+
* счётчик есть уже в первой и серверной отрисовке, — и на смену локали,
|
|
18
|
+
* значения и предела. Живым регионом счётчик не объявляется — тот шумел бы
|
|
19
|
+
* на каждый символ: поле ссылается на него `aria-describedby`
|
|
20
|
+
* (`TTextareaIdsPlugin`), и скринридер читает текст на фокусе поля.
|
|
21
|
+
*/
|
|
22
|
+
export declare class TTextareaNamesPlugin extends TNamesPlugin<ITextarea, TTextareaNamesPluginEvents> {
|
|
23
|
+
/** Источник локали набора — за тегом для чисел: строки база отдаёт сама */
|
|
24
|
+
private _locale;
|
|
25
|
+
private _counter;
|
|
26
|
+
/** Текст счётчика: «12 / 200», без предела — «12». */
|
|
27
|
+
get counter(): string;
|
|
28
|
+
protected get _sink(): TEventSink<TTextareaNamesPluginEvents>;
|
|
29
|
+
install(ctx: IPluginContext, options?: unknown): void;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
protected _name(owner: ITextarea, translations: TTranslations): void;
|
|
32
|
+
protected _watch(owner: ITextarea, name: () => void): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TNamesPlugin } from "../../../locale/names.plugin.js";
|
|
2
|
+
//#region src/custom/textarea/names/names.plugin.ts
|
|
3
|
+
/**
|
|
4
|
+
* Счётчик с пределом: шаблон из локали, на месте `{count}` — набранное, на
|
|
5
|
+
* месте `{max}` — предел. Порядок у каждого языка свой, поэтому места в
|
|
6
|
+
* шаблоне, а не склейка.
|
|
7
|
+
*/
|
|
8
|
+
function counterText(template, count, max) {
|
|
9
|
+
return template.split("{count}").join(count).split("{max}").join(max);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* TTextareaNamesPlugin — текст счётчика символов Textarea от локали: «12 / 200».
|
|
13
|
+
*
|
|
14
|
+
* Счётчик рисует библиотека, и его текст — строка языка, как значение оценки
|
|
15
|
+
* Rating: при пределе `maxlength` — шаблон локали `textarea.counter`, без
|
|
16
|
+
* предела — одно число. Числа — по тегу локали (`toLocaleString`): «1 234»,
|
|
17
|
+
* а не «1234», и цифрами языка. Набранное считает ядро (`textLength`) — тем
|
|
18
|
+
* же счётом, что `data-limit` и браузер у `maxlength`.
|
|
19
|
+
*
|
|
20
|
+
* Текст — выходом (`counter`), а не в набор: у счётчика своего экземпляра
|
|
21
|
+
* нет, его разметку рисует шаблон поля. Пишет при установке, синхронно, —
|
|
22
|
+
* счётчик есть уже в первой и серверной отрисовке, — и на смену локали,
|
|
23
|
+
* значения и предела. Живым регионом счётчик не объявляется — тот шумел бы
|
|
24
|
+
* на каждый символ: поле ссылается на него `aria-describedby`
|
|
25
|
+
* (`TTextareaIdsPlugin`), и скринридер читает текст на фокусе поля.
|
|
26
|
+
*/
|
|
27
|
+
var TTextareaNamesPlugin = class extends TNamesPlugin {
|
|
28
|
+
/** Источник локали набора — за тегом для чисел: строки база отдаёт сама */
|
|
29
|
+
_locale = null;
|
|
30
|
+
_counter = "";
|
|
31
|
+
/** Текст счётчика: «12 / 200», без предела — «12». */
|
|
32
|
+
get counter() {
|
|
33
|
+
return this._counter;
|
|
34
|
+
}
|
|
35
|
+
get _sink() {
|
|
36
|
+
return this.events;
|
|
37
|
+
}
|
|
38
|
+
install(ctx, options) {
|
|
39
|
+
this._locale = ctx.locale;
|
|
40
|
+
super.install(ctx, options);
|
|
41
|
+
}
|
|
42
|
+
destroy() {
|
|
43
|
+
this._locale = null;
|
|
44
|
+
super.destroy();
|
|
45
|
+
}
|
|
46
|
+
_name(owner, translations) {
|
|
47
|
+
const oldCounter = this.counter;
|
|
48
|
+
const tag = this._locale?.locale.tag;
|
|
49
|
+
const count = owner.textLength.toLocaleString(tag);
|
|
50
|
+
const max = owner.maxlength;
|
|
51
|
+
const counter = max === void 0 ? count : counterText(translations.textarea.counter, count, max.toLocaleString(tag));
|
|
52
|
+
if (this._counter === counter) return;
|
|
53
|
+
this._counter = counter;
|
|
54
|
+
this._sink.emit("change:counter", {
|
|
55
|
+
newValue: counter,
|
|
56
|
+
oldValue: oldCounter
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
_watch(owner, name) {
|
|
60
|
+
this._listenTo(owner.events, "change:value", name);
|
|
61
|
+
this._listenTo(owner.events, "change:maxlength", name);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { TTextareaNamesPlugin };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TValuePayload } from '@soxa-ui/core';
|
|
2
|
+
import type { TPluginEvents } from '../../../base';
|
|
3
|
+
export type TTextareaNamesPluginEvents = TPluginEvents & {
|
|
4
|
+
/**
|
|
5
|
+
* change:counter — текст счётчика сменился: набранное, предел или локаль
|
|
6
|
+
*/
|
|
7
|
+
'change:counter': (payload: TValuePayload<string>) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { IToasts } from '@soxa-ui/core';
|
|
2
|
+
import { TBasePlugin } from '../../../base';
|
|
3
|
+
import type { IPluginContext } from '../../../base';
|
|
4
|
+
import type { TToastsCascadePluginEvents } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* TToastsCascadePlugin — листание стопки тостов (`layout: 'cascade'`).
|
|
7
|
+
*
|
|
8
|
+
* В стопке тосты перекрывают друг друга. Передний — первый по порядку
|
|
9
|
+
* коллекции, а вывести задний вперёд — перестановка (`plain.move`): своего
|
|
10
|
+
* состояния «передний» у тоста нет, и экран со скринридером видят один
|
|
11
|
+
* порядок. Шаг стопки — поворот открытых показанных тостов по кругу:
|
|
12
|
+
*
|
|
13
|
+
* - **колесо** над регионом: вниз — передний уходит назад, вверх — задний
|
|
14
|
+
* выходит вперёд. Шаг один на жест колеса (`WHEEL_GESTURE_END`), прокрутка
|
|
15
|
+
* копится до порога (`WHEEL_STEP`), колесо жеста гасится — страница под
|
|
16
|
+
* стопкой не едет. Колесо с Ctrl — масштаб окна, а вбок — не наше;
|
|
17
|
+
* - **стрелки ↓ и ↑** при фокусе на тосте — то же самое, и фокус переходит на
|
|
18
|
+
* новый передний: тот, кого читают, всегда впереди. Стрелки поля ввода и
|
|
19
|
+
* списка в своём содержимом тоста не перехватываются, погашенные раньше —
|
|
20
|
+
* тоже.
|
|
21
|
+
*
|
|
22
|
+
* **Передний для шага — тост под фокусом.** Фокус Tab на заднем тосте выводит
|
|
23
|
+
* его вперёд темой, по `:focus-within`, без перестановки: перестановка на
|
|
24
|
+
* фокус ставила бы тост под фокусом первым в документе, и следующий Tab
|
|
25
|
+
* приходил бы в прежний передний — по кругу, без выхода из региона. Поэтому
|
|
26
|
+
* шаг считается от того, что видно: тост под фокусом впереди, остальные — за
|
|
27
|
+
* ним по порядку.
|
|
28
|
+
*
|
|
29
|
+
* Закрытые тосты, которые ещё гаснут, в повороте не участвуют и встают за
|
|
30
|
+
* открытыми; ждущие за пределом видимых не трогаются. Открытых меньше двух —
|
|
31
|
+
* листать нечего, и колесо со стрелками остаются странице.
|
|
32
|
+
*
|
|
33
|
+
* **Фокус после перерисовки.** Переставленный узел браузер переносит в
|
|
34
|
+
* документе, и фокус с него уходит. Поэтому, если фокус был на тосте, плагин
|
|
35
|
+
* ставит его новому переднему сразу и ещё раз кадром позже, когда разметка уже
|
|
36
|
+
* переставлена, — как перестановка колонки Table.
|
|
37
|
+
*
|
|
38
|
+
* Без стопки (`list`) плагин ничего не делает: колесо и стрелки остаются
|
|
39
|
+
* странице. Слушатели висят, пока есть узел региона.
|
|
40
|
+
*/
|
|
41
|
+
export declare class TToastsCascadePlugin extends TBasePlugin<IToasts, TToastsCascadePluginEvents> {
|
|
42
|
+
private _owner;
|
|
43
|
+
private _engine;
|
|
44
|
+
private _elements;
|
|
45
|
+
/** Узел региона: на нём слушатели колеса и клавиш. */
|
|
46
|
+
private _region;
|
|
47
|
+
/** Жест колеса; `null` — колесо стоит. */
|
|
48
|
+
private _gesture;
|
|
49
|
+
/** Конец жеста — по тишине колеса. */
|
|
50
|
+
private _gestureTimer;
|
|
51
|
+
/** Возврат фокуса после перерисовки. */
|
|
52
|
+
private _frame;
|
|
53
|
+
install(ctx: IPluginContext): void;
|
|
54
|
+
destroy(): void;
|
|
55
|
+
private _attach;
|
|
56
|
+
private _detach;
|
|
57
|
+
/** Тосты стоят стопкой. */
|
|
58
|
+
private get _cascade();
|
|
59
|
+
private readonly _onWheel;
|
|
60
|
+
private readonly _onKeyDown;
|
|
61
|
+
/**
|
|
62
|
+
* Шаг стопки от тоста `reference` (под фокусом), а без него — от первого
|
|
63
|
+
* открытого. Новый порядок пишется перестановками одной пачкой: подписчики
|
|
64
|
+
* получают одно `change:items`. Отдаёт новый передний; листать нечего —
|
|
65
|
+
* `undefined`.
|
|
66
|
+
*
|
|
67
|
+
* Показанные — начало состава: предел видимых (`items:query:before`
|
|
68
|
+
* расширения `toasts`) берёт первые `max`, поэтому место тоста среди
|
|
69
|
+
* показанных и есть его индекс в коллекции.
|
|
70
|
+
*/
|
|
71
|
+
private _step;
|
|
72
|
+
/** Фокус — переднему, и ещё раз, когда разметка переставлена. */
|
|
73
|
+
private _focus;
|
|
74
|
+
/** Открытые показанные тосты — то, что листается. */
|
|
75
|
+
private _open;
|
|
76
|
+
/** Открытый показанный тост, чей узел содержит цель. */
|
|
77
|
+
private _toastOf;
|
|
78
|
+
private _restartGesture;
|
|
79
|
+
private _endGesture;
|
|
80
|
+
private _cancelFrame;
|
|
81
|
+
}
|