@soxa-ui/setup 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 +63 -2
- package/dist/content/descriptors/components/accordion/accordion.descriptor.d.ts +205 -0
- package/dist/content/descriptors/components/accordion/accordion.descriptor.js +80 -0
- package/dist/content/descriptors/components/accordion/collection.descriptor.d.ts +76 -0
- package/dist/content/descriptors/components/accordion/collection.descriptor.js +60 -0
- package/dist/content/descriptors/components/accordion/index.d.ts +3 -0
- package/dist/content/descriptors/components/accordion/item.descriptor.d.ts +244 -0
- package/dist/content/descriptors/components/accordion/item.descriptor.js +93 -0
- package/dist/content/descriptors/components/button.descriptor.d.ts +192 -0
- package/dist/content/descriptors/components/button.descriptor.js +39 -0
- package/dist/content/descriptors/components/calendar/calendar.descriptor.d.ts +261 -0
- package/dist/content/descriptors/components/calendar/calendar.descriptor.js +142 -0
- package/dist/content/descriptors/components/calendar/collection.descriptor.d.ts +85 -0
- package/dist/content/descriptors/components/calendar/collection.descriptor.js +88 -0
- package/dist/content/descriptors/components/calendar/index.d.ts +3 -0
- package/dist/content/descriptors/components/calendar/item.descriptor.d.ts +154 -0
- package/dist/content/descriptors/components/calendar/item.descriptor.js +65 -0
- package/dist/content/descriptors/components/check-box.descriptor.d.ts +227 -0
- package/dist/content/descriptors/components/check-box.descriptor.js +65 -0
- package/dist/content/descriptors/components/clearable.descriptor.d.ts +213 -0
- package/dist/content/descriptors/components/clearable.descriptor.js +51 -0
- package/dist/content/descriptors/components/collection/collection.descriptor.d.ts +47 -0
- package/dist/content/descriptors/components/collection/collection.descriptor.js +67 -0
- package/dist/content/descriptors/components/collection/index.d.ts +1 -0
- package/dist/content/descriptors/components/component-view.descriptor.d.ts +110 -0
- package/dist/content/descriptors/components/component-view.descriptor.js +103 -0
- package/dist/content/descriptors/components/component.descriptor.d.ts +31 -0
- package/dist/content/descriptors/components/component.descriptor.js +22 -0
- package/dist/content/descriptors/components/control.descriptor.d.ts +135 -0
- package/dist/content/descriptors/components/control.descriptor.js +33 -0
- package/dist/content/descriptors/components/date-input.descriptor.d.ts +319 -0
- package/dist/content/descriptors/components/date-input.descriptor.js +171 -0
- package/dist/content/descriptors/components/date-picker.descriptor.d.ts +445 -0
- package/dist/content/descriptors/components/date-picker.descriptor.js +255 -0
- package/dist/content/descriptors/components/dialog.descriptor.d.ts +256 -0
- package/dist/content/descriptors/components/dialog.descriptor.js +94 -0
- package/dist/content/descriptors/components/drag-and-drop.descriptor.d.ts +49 -0
- package/dist/content/descriptors/components/drag-and-drop.descriptor.js +32 -0
- package/dist/content/descriptors/components/drawer.descriptor.d.ts +244 -0
- package/dist/content/descriptors/components/drawer.descriptor.js +83 -0
- package/dist/content/descriptors/components/entity.descriptor.d.ts +39 -0
- package/dist/content/descriptors/components/entity.descriptor.js +37 -0
- package/dist/content/descriptors/components/field.descriptor.d.ts +192 -0
- package/dist/content/descriptors/components/field.descriptor.js +109 -0
- package/dist/content/descriptors/components/frame.descriptor.d.ts +191 -0
- package/dist/content/descriptors/components/frame.descriptor.js +66 -0
- package/dist/content/descriptors/components/icon.descriptor.d.ts +129 -0
- package/dist/content/descriptors/components/icon.descriptor.js +41 -0
- package/dist/content/descriptors/components/index.d.ts +50 -0
- package/dist/content/descriptors/components/input-control.descriptor.d.ts +176 -0
- package/dist/content/descriptors/components/input-control.descriptor.js +32 -0
- package/dist/content/descriptors/components/input.descriptor.d.ts +241 -0
- package/dist/content/descriptors/components/input.descriptor.js +62 -0
- package/dist/content/descriptors/components/interactive.descriptor.d.ts +100 -0
- package/dist/content/descriptors/components/interactive.descriptor.js +30 -0
- package/dist/content/descriptors/components/item-group.descriptor.d.ts +113 -0
- package/dist/content/descriptors/components/item-group.descriptor.js +44 -0
- package/dist/content/descriptors/components/item-row.descriptor.d.ts +199 -0
- package/dist/content/descriptors/components/item-row.descriptor.js +25 -0
- package/dist/content/descriptors/components/label.descriptor.d.ts +130 -0
- package/dist/content/descriptors/components/label.descriptor.js +41 -0
- package/dist/content/descriptors/components/layer.descriptor.d.ts +99 -0
- package/dist/content/descriptors/components/layer.descriptor.js +27 -0
- package/dist/content/descriptors/components/list-box/collection.descriptor.d.ts +113 -0
- package/dist/content/descriptors/components/list-box/collection.descriptor.js +96 -0
- package/dist/content/descriptors/components/list-box/group.descriptor.d.ts +115 -0
- package/dist/content/descriptors/components/list-box/group.descriptor.js +21 -0
- package/dist/content/descriptors/components/list-box/index.d.ts +4 -0
- package/dist/content/descriptors/components/list-box/item.descriptor.d.ts +219 -0
- package/dist/content/descriptors/components/list-box/item.descriptor.js +66 -0
- package/dist/content/descriptors/components/list-box/list-box.descriptor.d.ts +253 -0
- package/dist/content/descriptors/components/list-box/list-box.descriptor.js +106 -0
- package/dist/content/descriptors/components/list.d.ts +40 -0
- package/dist/content/descriptors/components/list.js +38 -0
- package/dist/content/descriptors/components/menu/checkbox-item.descriptor.d.ts +226 -0
- package/dist/content/descriptors/components/menu/checkbox-item.descriptor.js +43 -0
- package/dist/content/descriptors/components/menu/collection.descriptor.d.ts +201 -0
- package/dist/content/descriptors/components/menu/collection.descriptor.js +101 -0
- package/dist/content/descriptors/components/menu/group.descriptor.d.ts +112 -0
- package/dist/content/descriptors/components/menu/group.descriptor.js +18 -0
- package/dist/content/descriptors/components/menu/index.d.ts +10 -0
- package/dist/content/descriptors/components/menu/item.descriptor.d.ts +195 -0
- package/dist/content/descriptors/components/menu/item.descriptor.js +45 -0
- package/dist/content/descriptors/components/menu/menu.descriptor.d.ts +262 -0
- package/dist/content/descriptors/components/menu/menu.descriptor.js +177 -0
- package/dist/content/descriptors/components/menu/popover-item.descriptor.d.ts +278 -0
- package/dist/content/descriptors/components/menu/popover-item.descriptor.js +87 -0
- package/dist/content/descriptors/components/menu/radio-group.descriptor.d.ts +134 -0
- package/dist/content/descriptors/components/menu/radio-group.descriptor.js +30 -0
- package/dist/content/descriptors/components/menu/radio-item.descriptor.d.ts +236 -0
- package/dist/content/descriptors/components/menu/radio-item.descriptor.js +51 -0
- package/dist/content/descriptors/components/menu/separator.descriptor.d.ts +87 -0
- package/dist/content/descriptors/components/menu/separator.descriptor.js +17 -0
- package/dist/content/descriptors/components/menu/submenu.descriptor.d.ts +336 -0
- package/dist/content/descriptors/components/menu/submenu.descriptor.js +144 -0
- package/dist/content/descriptors/components/modal-layer.descriptor.d.ts +197 -0
- package/dist/content/descriptors/components/modal-layer.descriptor.js +101 -0
- package/dist/content/descriptors/components/number-input.descriptor.d.ts +353 -0
- package/dist/content/descriptors/components/number-input.descriptor.js +209 -0
- package/dist/content/descriptors/components/pagination/collection.descriptor.d.ts +54 -0
- package/dist/content/descriptors/components/pagination/collection.descriptor.js +55 -0
- package/dist/content/descriptors/components/pagination/index.d.ts +3 -0
- package/dist/content/descriptors/components/pagination/item.descriptor.d.ts +156 -0
- package/dist/content/descriptors/components/pagination/item.descriptor.js +68 -0
- package/dist/content/descriptors/components/pagination/pagination.descriptor.d.ts +265 -0
- package/dist/content/descriptors/components/pagination/pagination.descriptor.js +152 -0
- package/dist/content/descriptors/components/popover.descriptor.d.ts +231 -0
- package/dist/content/descriptors/components/popover.descriptor.js +156 -0
- package/dist/content/descriptors/components/progress-linear.descriptor.d.ts +165 -0
- package/dist/content/descriptors/components/progress-linear.descriptor.js +43 -0
- package/dist/content/descriptors/components/progress-spinner.descriptor.d.ts +161 -0
- package/dist/content/descriptors/components/progress-spinner.descriptor.js +36 -0
- package/dist/content/descriptors/components/progress.descriptor.d.ts +149 -0
- package/dist/content/descriptors/components/progress.descriptor.js +53 -0
- package/dist/content/descriptors/components/radio-group/collection.descriptor.d.ts +70 -0
- package/dist/content/descriptors/components/radio-group/collection.descriptor.js +56 -0
- package/dist/content/descriptors/components/radio-group/index.d.ts +3 -0
- package/dist/content/descriptors/components/radio-group/item.descriptor.d.ts +193 -0
- package/dist/content/descriptors/components/radio-group/item.descriptor.js +47 -0
- package/dist/content/descriptors/components/radio-group/radio-group.descriptor.d.ts +197 -0
- package/dist/content/descriptors/components/radio-group/radio-group.descriptor.js +66 -0
- package/dist/content/descriptors/components/rating.descriptor.d.ts +233 -0
- package/dist/content/descriptors/components/rating.descriptor.js +89 -0
- package/dist/content/descriptors/components/scroller.descriptor.d.ts +208 -0
- package/dist/content/descriptors/components/scroller.descriptor.js +91 -0
- package/dist/content/descriptors/components/select/collection.descriptor.d.ts +135 -0
- package/dist/content/descriptors/components/select/collection.descriptor.js +119 -0
- package/dist/content/descriptors/components/select/group.descriptor.d.ts +115 -0
- package/dist/content/descriptors/components/select/group.descriptor.js +21 -0
- package/dist/content/descriptors/components/select/index.d.ts +4 -0
- package/dist/content/descriptors/components/select/item.descriptor.d.ts +210 -0
- package/dist/content/descriptors/components/select/item.descriptor.js +56 -0
- package/dist/content/descriptors/components/select/select.descriptor.d.ts +454 -0
- package/dist/content/descriptors/components/select/select.descriptor.js +267 -0
- package/dist/content/descriptors/components/skeleton.descriptor.d.ts +127 -0
- package/dist/content/descriptors/components/skeleton.descriptor.js +53 -0
- package/dist/content/descriptors/components/slider.descriptor.d.ts +298 -0
- package/dist/content/descriptors/components/slider.descriptor.js +205 -0
- package/dist/content/descriptors/components/stylable.descriptor.d.ts +126 -0
- package/dist/content/descriptors/components/stylable.descriptor.js +52 -0
- package/dist/content/descriptors/components/switch.descriptor.d.ts +217 -0
- package/dist/content/descriptors/components/switch.descriptor.js +53 -0
- package/dist/content/descriptors/components/table/collection.descriptor.d.ts +183 -0
- package/dist/content/descriptors/components/table/collection.descriptor.js +178 -0
- package/dist/content/descriptors/components/table/column.descriptor.d.ts +237 -0
- package/dist/content/descriptors/components/table/column.descriptor.js +173 -0
- package/dist/content/descriptors/components/table/index.d.ts +4 -0
- package/dist/content/descriptors/components/table/row.descriptor.d.ts +166 -0
- package/dist/content/descriptors/components/table/row.descriptor.js +75 -0
- package/dist/content/descriptors/components/table/table.descriptor.d.ts +271 -0
- package/dist/content/descriptors/components/table/table.descriptor.js +164 -0
- package/dist/content/descriptors/components/tabs/collection.descriptor.d.ts +72 -0
- package/dist/content/descriptors/components/tabs/collection.descriptor.js +59 -0
- package/dist/content/descriptors/components/tabs/content.descriptor.d.ts +136 -0
- package/dist/content/descriptors/components/tabs/content.descriptor.js +52 -0
- package/dist/content/descriptors/components/tabs/index.d.ts +4 -0
- package/dist/content/descriptors/components/tabs/item.descriptor.d.ts +213 -0
- package/dist/content/descriptors/components/tabs/item.descriptor.js +67 -0
- package/dist/content/descriptors/components/tabs/tabs.descriptor.d.ts +220 -0
- package/dist/content/descriptors/components/tabs/tabs.descriptor.js +105 -0
- package/dist/content/descriptors/components/tags/collection.descriptor.d.ts +79 -0
- package/dist/content/descriptors/components/tags/collection.descriptor.js +63 -0
- package/dist/content/descriptors/components/tags/index.d.ts +3 -0
- package/dist/content/descriptors/components/tags/item.descriptor.d.ts +216 -0
- package/dist/content/descriptors/components/tags/item.descriptor.js +73 -0
- package/dist/content/descriptors/components/tags/tags.descriptor.d.ts +240 -0
- package/dist/content/descriptors/components/tags/tags.descriptor.js +109 -0
- package/dist/content/descriptors/components/textable.descriptor.d.ts +147 -0
- package/dist/content/descriptors/components/textable.descriptor.js +24 -0
- package/dist/content/descriptors/components/textarea.descriptor.d.ts +249 -0
- package/dist/content/descriptors/components/textarea.descriptor.js +95 -0
- package/dist/content/descriptors/components/toasts/collection.descriptor.d.ts +59 -0
- package/dist/content/descriptors/components/toasts/collection.descriptor.js +39 -0
- package/dist/content/descriptors/components/toasts/index.d.ts +3 -0
- package/dist/content/descriptors/components/toasts/item.descriptor.d.ts +173 -0
- package/dist/content/descriptors/components/toasts/item.descriptor.js +106 -0
- package/dist/content/descriptors/components/toasts/toasts.descriptor.d.ts +167 -0
- package/dist/content/descriptors/components/toasts/toasts.descriptor.js +94 -0
- package/dist/content/descriptors/components/tooltip.descriptor.d.ts +156 -0
- package/dist/content/descriptors/components/tooltip.descriptor.js +83 -0
- package/dist/content/descriptors/components/value-control.descriptor.d.ts +151 -0
- package/dist/content/descriptors/components/value-control.descriptor.js +36 -0
- package/dist/content/descriptors/components/virtual.descriptor.d.ts +55 -0
- package/dist/content/descriptors/components/virtual.descriptor.js +37 -0
- package/dist/content/descriptors/index.d.ts +2 -0
- package/dist/content/descriptors/plugins/accordion-item-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/accordion-item-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/action.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/action.plugin.js +27 -0
- package/dist/content/descriptors/plugins/anchor.plugin.d.ts +47 -0
- package/dist/content/descriptors/plugins/anchor.plugin.js +73 -0
- package/dist/content/descriptors/plugins/aria.plugin.d.ts +34 -0
- package/dist/content/descriptors/plugins/aria.plugin.js +55 -0
- package/dist/content/descriptors/plugins/calendar-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/calendar-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/calendar-keyboard.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/calendar-keyboard.plugin.js +18 -0
- package/dist/content/descriptors/plugins/calendar-names.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/calendar-names.plugin.js +17 -0
- package/dist/content/descriptors/plugins/calendar-pointer.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/calendar-pointer.plugin.js +18 -0
- package/dist/content/descriptors/plugins/clearable-names.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/clearable-names.plugin.js +17 -0
- package/dist/content/descriptors/plugins/collection-bundles.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/collection-bundles.plugin.js +14 -0
- package/dist/content/descriptors/plugins/collection-elements.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/collection-elements.plugin.js +14 -0
- package/dist/content/descriptors/plugins/date-input-clipboard.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/date-input-clipboard.plugin.js +16 -0
- package/dist/content/descriptors/plugins/date-input-ids.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/date-input-ids.plugin.js +15 -0
- package/dist/content/descriptors/plugins/date-input-keyboard.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/date-input-keyboard.plugin.js +18 -0
- package/dist/content/descriptors/plugins/date-input-pointer.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/date-input-pointer.plugin.js +17 -0
- package/dist/content/descriptors/plugins/date-input-touch.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/date-input-touch.plugin.js +19 -0
- package/dist/content/descriptors/plugins/date-picker-focus.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/date-picker-focus.plugin.js +25 -0
- package/dist/content/descriptors/plugins/date-picker-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/date-picker-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/date-picker-names.plugin.d.ts +32 -0
- package/dist/content/descriptors/plugins/date-picker-names.plugin.js +38 -0
- package/dist/content/descriptors/plugins/date-picker-trigger.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/date-picker-trigger.plugin.js +20 -0
- package/dist/content/descriptors/plugins/dialog-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/dialog-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/dialog-layout.plugin.d.ts +26 -0
- package/dist/content/descriptors/plugins/dialog-layout.plugin.js +34 -0
- package/dist/content/descriptors/plugins/dialog-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/dialog-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/dismiss.plugin.d.ts +34 -0
- package/dist/content/descriptors/plugins/dismiss.plugin.js +51 -0
- package/dist/content/descriptors/plugins/drag.plugin.d.ts +5 -0
- package/dist/content/descriptors/plugins/drag.plugin.js +12 -0
- package/dist/content/descriptors/plugins/drawer-layout.plugin.d.ts +22 -0
- package/dist/content/descriptors/plugins/drawer-layout.plugin.js +28 -0
- package/dist/content/descriptors/plugins/element.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/element.plugin.js +15 -0
- package/dist/content/descriptors/plugins/field-ids.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/field-ids.plugin.js +19 -0
- package/dist/content/descriptors/plugins/frame-layout.plugin.d.ts +14 -0
- package/dist/content/descriptors/plugins/frame-layout.plugin.js +18 -0
- package/dist/content/descriptors/plugins/hide-outside.plugin.d.ts +19 -0
- package/dist/content/descriptors/plugins/hide-outside.plugin.js +29 -0
- package/dist/content/descriptors/plugins/icon-layout.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/icon-layout.plugin.js +19 -0
- package/dist/content/descriptors/plugins/id.plugin.d.ts +26 -0
- package/dist/content/descriptors/plugins/id.plugin.js +31 -0
- package/dist/content/descriptors/plugins/index.d.ts +114 -0
- package/dist/content/descriptors/plugins/input-bool.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/input-bool.plugin.js +14 -0
- package/dist/content/descriptors/plugins/input-control.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/input-control.plugin.js +14 -0
- package/dist/content/descriptors/plugins/input.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/input.plugin.js +16 -0
- package/dist/content/descriptors/plugins/item-group-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/item-group-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/label-nested-warn.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/label-nested-warn.plugin.js +15 -0
- package/dist/content/descriptors/plugins/list-height.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/list-height.plugin.js +15 -0
- package/dist/content/descriptors/plugins/list-item.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/list-item.plugin.js +19 -0
- package/dist/content/descriptors/plugins/list-keyboard.plugin.d.ts +5 -0
- package/dist/content/descriptors/plugins/list-keyboard.plugin.js +12 -0
- package/dist/content/descriptors/plugins/list-scroll.plugin.d.ts +16 -0
- package/dist/content/descriptors/plugins/list-scroll.plugin.js +23 -0
- package/dist/content/descriptors/plugins/locale.plugin.d.ts +13 -0
- package/dist/content/descriptors/plugins/locale.plugin.js +20 -0
- package/dist/content/descriptors/plugins/menu-focus.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/menu-focus.plugin.js +18 -0
- package/dist/content/descriptors/plugins/menu-hover.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/menu-hover.plugin.js +19 -0
- package/dist/content/descriptors/plugins/menu-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/menu-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/menu-keyboard.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/menu-keyboard.plugin.js +22 -0
- package/dist/content/descriptors/plugins/menu-pointer.plugin.d.ts +13 -0
- package/dist/content/descriptors/plugins/menu-pointer.plugin.js +20 -0
- package/dist/content/descriptors/plugins/menu-popover-item-focus.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/menu-popover-item-focus.plugin.js +22 -0
- package/dist/content/descriptors/plugins/menu-popover-item-keyboard.plugin.d.ts +13 -0
- package/dist/content/descriptors/plugins/menu-popover-item-keyboard.plugin.js +20 -0
- package/dist/content/descriptors/plugins/menu-popup-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/menu-popup-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/menu-submenu-focus.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/menu-submenu-focus.plugin.js +19 -0
- package/dist/content/descriptors/plugins/menu-submenu-keyboard.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/menu-submenu-keyboard.plugin.js +22 -0
- package/dist/content/descriptors/plugins/modal-focus.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/modal-focus.plugin.js +24 -0
- package/dist/content/descriptors/plugins/modal-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/modal-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/modal-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/modal-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/number-input-keyboard.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/number-input-keyboard.plugin.js +17 -0
- package/dist/content/descriptors/plugins/number-input-names.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/number-input-names.plugin.js +17 -0
- package/dist/content/descriptors/plugins/number-input-stepper.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/number-input-stepper.plugin.js +19 -0
- package/dist/content/descriptors/plugins/number-input-touch.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/number-input-touch.plugin.js +17 -0
- package/dist/content/descriptors/plugins/number-input-typing.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/number-input-typing.plugin.js +18 -0
- package/dist/content/descriptors/plugins/option-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/option-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/pagination-focus.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/pagination-focus.plugin.js +17 -0
- package/dist/content/descriptors/plugins/pagination-names.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/pagination-names.plugin.js +17 -0
- package/dist/content/descriptors/plugins/popover-focus.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/popover-focus.plugin.js +23 -0
- package/dist/content/descriptors/plugins/popover-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/popover-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/popover-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/popover-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/popover-pointer.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/popover-pointer.plugin.js +21 -0
- package/dist/content/descriptors/plugins/radio-group-checked.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/radio-group-checked.plugin.js +16 -0
- package/dist/content/descriptors/plugins/radio-group-name.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/radio-group-name.plugin.js +16 -0
- package/dist/content/descriptors/plugins/rating-hover.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/rating-hover.plugin.js +17 -0
- package/dist/content/descriptors/plugins/rating-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/rating-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/rating-validity.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/rating-validity.plugin.js +17 -0
- package/dist/content/descriptors/plugins/ready.plugin.d.ts +7 -0
- package/dist/content/descriptors/plugins/ready.plugin.js +14 -0
- package/dist/content/descriptors/plugins/scroll-lock.plugin.d.ts +18 -0
- package/dist/content/descriptors/plugins/scroll-lock.plugin.js +29 -0
- package/dist/content/descriptors/plugins/scroller-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/scroller-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/scroller-viewport.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/scroller-viewport.plugin.js +16 -0
- package/dist/content/descriptors/plugins/select-backspace.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/select-backspace.plugin.js +25 -0
- package/dist/content/descriptors/plugins/select-editable.plugin.d.ts +18 -0
- package/dist/content/descriptors/plugins/select-editable.plugin.js +31 -0
- package/dist/content/descriptors/plugins/select-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/select-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/select-keyboard.plugin.d.ts +21 -0
- package/dist/content/descriptors/plugins/select-keyboard.plugin.js +33 -0
- package/dist/content/descriptors/plugins/select-pointer.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/select-pointer.plugin.js +24 -0
- package/dist/content/descriptors/plugins/skeleton-layout.plugin.d.ts +14 -0
- package/dist/content/descriptors/plugins/skeleton-layout.plugin.js +18 -0
- package/dist/content/descriptors/plugins/slide-keyboard.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/slide-keyboard.plugin.js +16 -0
- package/dist/content/descriptors/plugins/slide-pointer.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/slide-pointer.plugin.js +19 -0
- package/dist/content/descriptors/plugins/swipe.plugin.d.ts +13 -0
- package/dist/content/descriptors/plugins/swipe.plugin.js +20 -0
- package/dist/content/descriptors/plugins/table-column-ids.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/table-column-ids.plugin.js +17 -0
- package/dist/content/descriptors/plugins/table-column-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/table-column-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/table-column-reorder.plugin.d.ts +13 -0
- package/dist/content/descriptors/plugins/table-column-reorder.plugin.js +20 -0
- package/dist/content/descriptors/plugins/table-column-resize.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/table-column-resize.plugin.js +19 -0
- package/dist/content/descriptors/plugins/table-grid.plugin.d.ts +15 -0
- package/dist/content/descriptors/plugins/table-grid.plugin.js +22 -0
- package/dist/content/descriptors/plugins/table-layout.plugin.d.ts +12 -0
- package/dist/content/descriptors/plugins/table-layout.plugin.js +19 -0
- package/dist/content/descriptors/plugins/table-names.plugin.d.ts +16 -0
- package/dist/content/descriptors/plugins/table-names.plugin.js +20 -0
- package/dist/content/descriptors/plugins/table-row-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/table-row-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tabs-active-tab.plugin.d.ts +5 -0
- package/dist/content/descriptors/plugins/tabs-active-tab.plugin.js +12 -0
- package/dist/content/descriptors/plugins/tabs-content-warn.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/tabs-content-warn.plugin.js +15 -0
- package/dist/content/descriptors/plugins/tabs-item-ids.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/tabs-item-ids.plugin.js +15 -0
- package/dist/content/descriptors/plugins/tabs-item-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/tabs-item-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tabs-keyboard.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/tabs-keyboard.plugin.js +15 -0
- package/dist/content/descriptors/plugins/tabs-layout.plugin.d.ts +5 -0
- package/dist/content/descriptors/plugins/tabs-layout.plugin.js +12 -0
- package/dist/content/descriptors/plugins/tags-item-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/tags-item-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tags-keyboard.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/tags-keyboard.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tags-scroll.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/tags-scroll.plugin.js +17 -0
- package/dist/content/descriptors/plugins/textarea-autoresize.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/textarea-autoresize.plugin.js +17 -0
- package/dist/content/descriptors/plugins/textarea-ids.plugin.d.ts +11 -0
- package/dist/content/descriptors/plugins/textarea-ids.plugin.js +18 -0
- package/dist/content/descriptors/plugins/textarea-names.plugin.d.ts +17 -0
- package/dist/content/descriptors/plugins/textarea-names.plugin.js +21 -0
- package/dist/content/descriptors/plugins/toasts-cascade.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/toasts-cascade.plugin.js +17 -0
- package/dist/content/descriptors/plugins/toasts-item-names.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/toasts-item-names.plugin.js +16 -0
- package/dist/content/descriptors/plugins/toasts-keyboard.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/toasts-keyboard.plugin.js +16 -0
- package/dist/content/descriptors/plugins/toasts-layout.plugin.d.ts +16 -0
- package/dist/content/descriptors/plugins/toasts-layout.plugin.js +20 -0
- package/dist/content/descriptors/plugins/toasts-names.plugin.d.ts +8 -0
- package/dist/content/descriptors/plugins/toasts-names.plugin.js +15 -0
- package/dist/content/descriptors/plugins/toasts-removal.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/toasts-removal.plugin.js +16 -0
- package/dist/content/descriptors/plugins/toasts-timer.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/toasts-timer.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tooltip-ids.plugin.d.ts +9 -0
- package/dist/content/descriptors/plugins/tooltip-ids.plugin.js +16 -0
- package/dist/content/descriptors/plugins/tooltip-trigger.plugin.d.ts +10 -0
- package/dist/content/descriptors/plugins/tooltip-trigger.plugin.js +23 -0
- package/dist/content/extensions/collection/collection-item.extension.class.d.ts +64 -0
- package/dist/content/extensions/collection/collection-item.extension.class.js +111 -0
- package/dist/content/extensions/collection/collection.extension.class.d.ts +21 -0
- package/dist/content/extensions/collection/collection.extension.class.js +57 -0
- package/dist/content/extensions/collection/index.d.ts +3 -0
- package/dist/content/extensions/collection/item-props.d.ts +13 -0
- package/dist/content/extensions/collection/item-props.js +20 -0
- package/dist/content/extensions/collection/keys.d.ts +23 -0
- package/dist/content/extensions/collection/keys.js +17 -0
- package/dist/content/extensions/collection/members.class.d.ts +24 -0
- package/dist/content/extensions/collection/members.class.js +18 -0
- package/dist/content/extensions/collection/types.d.ts +41 -0
- package/dist/content/extensions/drag-and-drop/drag-and-drop-collection.extension.class.d.ts +26 -0
- package/dist/content/extensions/drag-and-drop/drag-and-drop-collection.extension.class.js +34 -0
- package/dist/content/extensions/drag-and-drop/drag-and-drop.extension.class.d.ts +21 -0
- package/dist/content/extensions/drag-and-drop/drag-and-drop.extension.class.js +9 -0
- package/dist/content/extensions/drag-and-drop/index.d.ts +3 -0
- package/dist/content/extensions/drag-and-drop/keys.d.ts +15 -0
- package/dist/content/extensions/drag-and-drop/keys.js +9 -0
- package/dist/content/extensions/drag-and-drop/types.d.ts +10 -0
- package/dist/content/extensions/field/field-control.extension.class.d.ts +63 -0
- package/dist/content/extensions/field/field-control.extension.class.js +172 -0
- package/dist/content/extensions/field/field.extension.class.d.ts +21 -0
- package/dist/content/extensions/field/field.extension.class.js +14 -0
- package/dist/content/extensions/field/index.d.ts +3 -0
- package/dist/content/extensions/field/keys.d.ts +14 -0
- package/dist/content/extensions/field/keys.js +8 -0
- package/dist/content/extensions/field/types.d.ts +36 -0
- package/dist/content/extensions/index.d.ts +8 -0
- package/dist/content/extensions/item-group/index.d.ts +2 -0
- package/dist/content/extensions/item-group/item-group.extension.class.d.ts +49 -0
- package/dist/content/extensions/item-group/item-group.extension.class.js +91 -0
- package/dist/content/extensions/item-group/keys.d.ts +15 -0
- package/dist/content/extensions/item-group/keys.js +9 -0
- package/dist/content/extensions/item-group/types.d.ts +34 -0
- package/dist/content/extensions/menu/index.d.ts +3 -0
- package/dist/content/extensions/menu/keys.d.ts +10 -0
- package/dist/content/extensions/menu/keys.js +5 -0
- package/dist/content/extensions/menu/radio-group.extension.class.d.ts +22 -0
- package/dist/content/extensions/menu/radio-group.extension.class.js +9 -0
- package/dist/content/extensions/menu/radio-item.extension.class.d.ts +20 -0
- package/dist/content/extensions/menu/radio-item.extension.class.js +10 -0
- package/dist/content/extensions/menu/types.d.ts +10 -0
- package/dist/content/extensions/tabs/index.d.ts +2 -0
- package/dist/content/extensions/tabs/tabs-content-binding.extension.class.d.ts +69 -0
- package/dist/content/extensions/tabs/tabs-content-binding.extension.class.js +184 -0
- package/dist/content/extensions/tabs/types.d.ts +11 -0
- package/dist/content/extensions/toasts/index.d.ts +3 -0
- package/dist/content/extensions/toasts/keys.d.ts +11 -0
- package/dist/content/extensions/toasts/keys.js +5 -0
- package/dist/content/extensions/toasts/toasts-api.extension.class.d.ts +23 -0
- package/dist/content/extensions/toasts/toasts-api.extension.class.js +9 -0
- package/dist/content/extensions/toasts/types.d.ts +19 -0
- package/dist/content/extensions/virtual/index.d.ts +3 -0
- package/dist/content/extensions/virtual/keys.d.ts +15 -0
- package/dist/content/extensions/virtual/keys.js +8 -0
- package/dist/content/extensions/virtual/types.d.ts +40 -0
- package/dist/content/extensions/virtual/virtual-collection.extension.class.d.ts +33 -0
- package/dist/content/extensions/virtual/virtual-collection.extension.class.js +15 -0
- package/dist/content/extensions/virtual/virtual.extension.class.d.ts +36 -0
- package/dist/content/extensions/virtual/virtual.extension.class.js +74 -0
- package/dist/content/icons/index.d.ts +2 -0
- package/dist/content/icons/roles.d.ts +29 -0
- package/dist/content/icons/roles.js +36 -0
- package/dist/content/index.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +236 -0
- package/dist/protected/adapter/common/index.d.ts +6 -0
- package/dist/protected/adapter/common/parts.d.ts +30 -0
- package/dist/protected/adapter/common/parts.js +35 -0
- package/dist/protected/adapter/common/props.types.d.ts +48 -0
- package/dist/protected/adapter/common/slots.d.ts +25 -0
- package/dist/protected/adapter/common/slots.js +25 -0
- package/dist/protected/adapter/common/slots.types.d.ts +37 -0
- package/dist/protected/adapter/common/state.d.ts +14 -0
- package/dist/protected/adapter/common/state.js +14 -0
- package/dist/protected/adapter/common/state.types.d.ts +39 -0
- package/dist/protected/adapter/context/adapter-context.class.d.ts +68 -0
- package/dist/protected/adapter/context/adapter-context.class.js +118 -0
- package/dist/protected/adapter/context/create-adapter-context.d.ts +34 -0
- package/dist/protected/adapter/context/create-adapter-context.js +91 -0
- package/dist/protected/adapter/context/external-plugins.class.d.ts +51 -0
- package/dist/protected/adapter/context/external-plugins.class.js +80 -0
- package/dist/protected/adapter/context/index.d.ts +2 -0
- package/dist/protected/adapter/context/own-bundle.class.d.ts +25 -0
- package/dist/protected/adapter/context/own-bundle.class.js +86 -0
- package/dist/protected/adapter/context/shared-bundle.class.d.ts +25 -0
- package/dist/protected/adapter/context/shared-bundle.class.js +24 -0
- package/dist/protected/adapter/context/types.d.ts +184 -0
- package/dist/protected/adapter/elevator/elevator.class.d.ts +21 -0
- package/dist/protected/adapter/elevator/elevator.class.js +19 -0
- package/dist/protected/adapter/elevator/index.d.ts +3 -0
- package/dist/protected/adapter/elevator/keys.d.ts +12 -0
- package/dist/protected/adapter/elevator/keys.js +7 -0
- package/dist/protected/adapter/elevator/types.d.ts +31 -0
- package/dist/protected/adapter/exchange/assembling.class.d.ts +39 -0
- package/dist/protected/adapter/exchange/assembling.class.js +55 -0
- package/dist/protected/adapter/exchange/cell.class.d.ts +31 -0
- package/dist/protected/adapter/exchange/cell.class.js +37 -0
- package/dist/protected/adapter/exchange/event-relay.class.d.ts +29 -0
- package/dist/protected/adapter/exchange/event-relay.class.js +53 -0
- package/dist/protected/adapter/exchange/exchange.class.d.ts +78 -0
- package/dist/protected/adapter/exchange/exchange.class.js +129 -0
- package/dist/protected/adapter/exchange/index.d.ts +8 -0
- package/dist/protected/adapter/exchange/input-port.class.d.ts +64 -0
- package/dist/protected/adapter/exchange/input-port.class.js +68 -0
- package/dist/protected/adapter/exchange/line.class.d.ts +53 -0
- package/dist/protected/adapter/exchange/line.class.js +39 -0
- package/dist/protected/adapter/exchange/member.class.d.ts +20 -0
- package/dist/protected/adapter/exchange/member.class.js +11 -0
- package/dist/protected/adapter/exchange/routing.class.d.ts +25 -0
- package/dist/protected/adapter/exchange/routing.class.js +94 -0
- package/dist/protected/adapter/exchange/state-store.class.d.ts +57 -0
- package/dist/protected/adapter/exchange/state-store.class.js +76 -0
- package/dist/protected/adapter/exchange/tap.class.d.ts +54 -0
- package/dist/protected/adapter/exchange/tap.class.js +51 -0
- package/dist/protected/adapter/exchange/types.d.ts +55 -0
- package/dist/protected/adapter/exchange/update-port.class.d.ts +25 -0
- package/dist/protected/adapter/exchange/update-port.class.js +26 -0
- package/dist/protected/adapter/exchange/value.d.ts +17 -0
- package/dist/protected/adapter/exchange/value.js +31 -0
- package/dist/protected/adapter/index.d.ts +5 -0
- package/dist/protected/adapter/surface/index.d.ts +2 -0
- package/dist/protected/adapter/surface/surface.class.d.ts +34 -0
- package/dist/protected/adapter/surface/surface.class.js +87 -0
- package/dist/protected/adapter/surface/types.d.ts +29 -0
- package/dist/protected/define/component-descriptor.class.d.ts +55 -0
- package/dist/protected/define/component-descriptor.class.js +112 -0
- package/dist/protected/define/component.d.ts +14 -0
- package/dist/protected/define/component.js +12 -0
- package/dist/protected/define/contribution.d.ts +20 -0
- package/dist/protected/define/contribution.js +18 -0
- package/dist/protected/define/contribution.types.d.ts +66 -0
- package/dist/protected/define/descriptor.d.ts +21 -0
- package/dist/protected/define/descriptor.js +27 -0
- package/dist/protected/define/index.d.ts +11 -0
- package/dist/protected/define/inference.types.d.ts +247 -0
- package/dist/protected/define/inherit.d.ts +21 -0
- package/dist/protected/define/inherit.js +11 -0
- package/dist/protected/define/name.class.d.ts +21 -0
- package/dist/protected/define/name.class.js +31 -0
- package/dist/protected/define/plugin-definition.class.d.ts +45 -0
- package/dist/protected/define/plugin-definition.class.js +49 -0
- package/dist/protected/define/plugin.d.ts +18 -0
- package/dist/protected/define/plugin.js +20 -0
- package/dist/protected/define/prop-spec.class.d.ts +70 -0
- package/dist/protected/define/prop-spec.class.js +79 -0
- package/dist/protected/define/prop-type.d.ts +12 -0
- package/dist/protected/define/prop-type.js +6 -0
- package/dist/protected/define/slot-declaration.class.d.ts +20 -0
- package/dist/protected/define/slot-declaration.class.js +14 -0
- package/dist/protected/define/types.d.ts +235 -0
- package/dist/protected/index.d.ts +4 -0
- package/dist/protected/naming/common-profile.d.ts +10 -0
- package/dist/protected/naming/common-profile.js +16 -0
- package/dist/protected/naming/index.d.ts +4 -0
- package/dist/protected/naming/naming.d.ts +33 -0
- package/dist/protected/naming/naming.js +34 -0
- package/dist/protected/naming/naming.types.d.ts +49 -0
- package/dist/protected/naming/strategy.types.d.ts +27 -0
- package/dist/protected/registry/extensions.d.ts +29 -0
- package/dist/protected/registry/extensions.js +28 -0
- package/dist/protected/registry/icons.d.ts +44 -0
- package/dist/protected/registry/icons.js +59 -0
- package/dist/protected/registry/index.d.ts +5 -0
- package/dist/protected/registry/plugins.d.ts +40 -0
- package/dist/protected/registry/plugins.js +29 -0
- package/dist/protected/registry/registrations.d.ts +15 -0
- package/dist/protected/registry/registrations.js +30 -0
- package/dist/protected/registry/theme.d.ts +29 -0
- package/dist/protected/registry/theme.js +40 -0
- package/dist/protected/registry/types.d.ts +85 -0
- package/package.json +44 -4
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TAdapterContext — a component for the time of its mount: instance, bundle,
|
|
3
|
+
* exchange and extensions. Extensions are keyed by their class, as
|
|
4
|
+
* `TPluginBundle` keys plugins.
|
|
5
|
+
*
|
|
6
|
+
* `bindElement` is a method of the context, not an extension: all six adapters
|
|
7
|
+
* bind the root to `TElementPlugin`, and an extension each of them would have
|
|
8
|
+
* to remember to install.
|
|
9
|
+
*
|
|
10
|
+
* The context's life is four phases: assembled, accepted by the framework
|
|
11
|
+
* (`attach`), being removed (`detach`), destroyed. When the second and the
|
|
12
|
+
* third come only the adapter's runtime knows: acceptance is the assembly
|
|
13
|
+
* itself for Vue, Solid, Svelte, Angular and Web Components and the commit for
|
|
14
|
+
* React; removal begins before the children go. So a phase is a method of the
|
|
15
|
+
* context, as `bindElement` is, not a step every component remembers. The
|
|
16
|
+
* context reports a phase and does nothing on it: what follows is up to those
|
|
17
|
+
* who listen.
|
|
18
|
+
*
|
|
19
|
+
* The exchange members and the assembly props are held until the first
|
|
20
|
+
* `connect()`: extensions read the props in their constructors (a collection
|
|
21
|
+
* item's `meta`), the exchange starts its input memory from them and finds
|
|
22
|
+
* its routes and owners by the members. From then on the exchange lives on
|
|
23
|
+
* its own values, and the context lets both go: the props may be a snapshot
|
|
24
|
+
* of one framework pass, and held until unmount they would keep stale values —
|
|
25
|
+
* a table's previous row list with all its records.
|
|
26
|
+
*
|
|
27
|
+
* One exchange per mount: the first `connect()` creates it, a repeat with the
|
|
28
|
+
* same profile returns it — a framework may call the binding's initializer
|
|
29
|
+
* twice, and there are no assembly props left to start a second one. Another
|
|
30
|
+
* profile is an error: one mount, one framework.
|
|
31
|
+
*
|
|
32
|
+
* The event bus and the extension list are created on first access: a
|
|
33
|
+
* collection facade and a component without extensions have none.
|
|
34
|
+
*/
|
|
35
|
+
import { TEvented } from '@soxa-ui/core';
|
|
36
|
+
import type { IPluginBundle } from '@soxa-ui/plugins';
|
|
37
|
+
import type { IComponentContract, IComponentDescriptor } from '../../define';
|
|
38
|
+
import type { IAdapterProfile } from '../../naming';
|
|
39
|
+
import { TExchange } from '../exchange/exchange.class';
|
|
40
|
+
import type { TMember } from '../exchange/member.class';
|
|
41
|
+
import type { IAdapterContext, IBundleTenancy, TAdapterEvents, TAnyExtensionCtor } from './types';
|
|
42
|
+
export declare class TAdapterContext<C extends IComponentContract> implements IAdapterContext<C> {
|
|
43
|
+
readonly descriptor: IComponentDescriptor;
|
|
44
|
+
readonly instance: C['instance'];
|
|
45
|
+
private readonly _tenancy;
|
|
46
|
+
readonly embedded: string | undefined;
|
|
47
|
+
private _events?;
|
|
48
|
+
/**
|
|
49
|
+
* Extensions, from the first one. A list, not a map by class: a context
|
|
50
|
+
* usually has one extension, and a map would cost three times as much.
|
|
51
|
+
*/
|
|
52
|
+
private _extensions?;
|
|
53
|
+
/** Before the first `connect()` — the members and assembly props, after it — the mount's exchange. */
|
|
54
|
+
private _link;
|
|
55
|
+
/** `detach` came: it comes once, from the runtime or from the collection. */
|
|
56
|
+
private _detached;
|
|
57
|
+
constructor(descriptor: IComponentDescriptor, instance: C['instance'], _tenancy: IBundleTenancy, members: readonly TMember[], props: object, embedded: string | undefined);
|
|
58
|
+
get events(): TEvented<TAdapterEvents>;
|
|
59
|
+
get bundle(): IPluginBundle | null;
|
|
60
|
+
get props(): object | undefined;
|
|
61
|
+
connect(profile: IAdapterProfile): TExchange;
|
|
62
|
+
use(ExtensionCtor: TAnyExtensionCtor, options?: unknown): this;
|
|
63
|
+
get<T>(ExtensionCtor: new (...args: any[]) => T): T | undefined;
|
|
64
|
+
bindElement(element: Element | null): void;
|
|
65
|
+
attach(): void;
|
|
66
|
+
detach(): void;
|
|
67
|
+
destroy(): void;
|
|
68
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { TSurface } from "../surface/surface.class.js";
|
|
2
|
+
import { TExchange } from "../exchange/exchange.class.js";
|
|
3
|
+
import { TEvented } from "@soxa-ui/core";
|
|
4
|
+
import { TElementPlugin } from "@soxa-ui/plugins";
|
|
5
|
+
//#region protected/adapter/context/adapter-context.class.ts
|
|
6
|
+
/**
|
|
7
|
+
* TAdapterContext — a component for the time of its mount: instance, bundle,
|
|
8
|
+
* exchange and extensions. Extensions are keyed by their class, as
|
|
9
|
+
* `TPluginBundle` keys plugins.
|
|
10
|
+
*
|
|
11
|
+
* `bindElement` is a method of the context, not an extension: all six adapters
|
|
12
|
+
* bind the root to `TElementPlugin`, and an extension each of them would have
|
|
13
|
+
* to remember to install.
|
|
14
|
+
*
|
|
15
|
+
* The context's life is four phases: assembled, accepted by the framework
|
|
16
|
+
* (`attach`), being removed (`detach`), destroyed. When the second and the
|
|
17
|
+
* third come only the adapter's runtime knows: acceptance is the assembly
|
|
18
|
+
* itself for Vue, Solid, Svelte, Angular and Web Components and the commit for
|
|
19
|
+
* React; removal begins before the children go. So a phase is a method of the
|
|
20
|
+
* context, as `bindElement` is, not a step every component remembers. The
|
|
21
|
+
* context reports a phase and does nothing on it: what follows is up to those
|
|
22
|
+
* who listen.
|
|
23
|
+
*
|
|
24
|
+
* The exchange members and the assembly props are held until the first
|
|
25
|
+
* `connect()`: extensions read the props in their constructors (a collection
|
|
26
|
+
* item's `meta`), the exchange starts its input memory from them and finds
|
|
27
|
+
* its routes and owners by the members. From then on the exchange lives on
|
|
28
|
+
* its own values, and the context lets both go: the props may be a snapshot
|
|
29
|
+
* of one framework pass, and held until unmount they would keep stale values —
|
|
30
|
+
* a table's previous row list with all its records.
|
|
31
|
+
*
|
|
32
|
+
* One exchange per mount: the first `connect()` creates it, a repeat with the
|
|
33
|
+
* same profile returns it — a framework may call the binding's initializer
|
|
34
|
+
* twice, and there are no assembly props left to start a second one. Another
|
|
35
|
+
* profile is an error: one mount, one framework.
|
|
36
|
+
*
|
|
37
|
+
* The event bus and the extension list are created on first access: a
|
|
38
|
+
* collection facade and a component without extensions have none.
|
|
39
|
+
*/
|
|
40
|
+
/** The extension was created by this very class, not by a subclass or a base. */
|
|
41
|
+
function isExact(extension, ExtensionCtor) {
|
|
42
|
+
return typeof extension === "object" && extension !== null && Object.getPrototypeOf(extension) === ExtensionCtor.prototype;
|
|
43
|
+
}
|
|
44
|
+
var TAdapterContext = class {
|
|
45
|
+
descriptor;
|
|
46
|
+
instance;
|
|
47
|
+
_tenancy;
|
|
48
|
+
embedded;
|
|
49
|
+
_events;
|
|
50
|
+
/**
|
|
51
|
+
* Extensions, from the first one. A list, not a map by class: a context
|
|
52
|
+
* usually has one extension, and a map would cost three times as much.
|
|
53
|
+
*/
|
|
54
|
+
_extensions;
|
|
55
|
+
/** Before the first `connect()` — the members and assembly props, after it — the mount's exchange. */
|
|
56
|
+
_link;
|
|
57
|
+
/** `detach` came: it comes once, from the runtime or from the collection. */
|
|
58
|
+
_detached = false;
|
|
59
|
+
constructor(descriptor, instance, _tenancy, members, props, embedded) {
|
|
60
|
+
this.descriptor = descriptor;
|
|
61
|
+
this.instance = instance;
|
|
62
|
+
this._tenancy = _tenancy;
|
|
63
|
+
this.embedded = embedded;
|
|
64
|
+
this._link = {
|
|
65
|
+
members,
|
|
66
|
+
props
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
get events() {
|
|
70
|
+
return this._events ??= new TEvented();
|
|
71
|
+
}
|
|
72
|
+
get bundle() {
|
|
73
|
+
return this._tenancy.bundle;
|
|
74
|
+
}
|
|
75
|
+
get props() {
|
|
76
|
+
return this._link instanceof TExchange ? void 0 : this._link.props;
|
|
77
|
+
}
|
|
78
|
+
connect(profile) {
|
|
79
|
+
const surface = TSurface.of(this.descriptor, profile);
|
|
80
|
+
const link = this._link;
|
|
81
|
+
const exchange = link instanceof TExchange ? link : new TExchange(link.members, surface, link.props);
|
|
82
|
+
if (exchange.surface !== surface) throw new Error(`Обмен ${this.descriptor.ctor.name} уже заведён в другом профиле: одно монтирование — один фреймворк`);
|
|
83
|
+
this._link = exchange;
|
|
84
|
+
return exchange;
|
|
85
|
+
}
|
|
86
|
+
use(ExtensionCtor, options) {
|
|
87
|
+
const extension = new ExtensionCtor(this, options);
|
|
88
|
+
const extensions = this._extensions ??= [];
|
|
89
|
+
const index = extensions.findIndex((current) => isExact(current, ExtensionCtor));
|
|
90
|
+
if (index === -1) extensions.push(extension);
|
|
91
|
+
else extensions[index] = extension;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
get(ExtensionCtor) {
|
|
95
|
+
const extension = this._extensions?.find((current) => isExact(current, ExtensionCtor));
|
|
96
|
+
return extension instanceof ExtensionCtor ? extension : void 0;
|
|
97
|
+
}
|
|
98
|
+
bindElement(element) {
|
|
99
|
+
const plugin = this.bundle?.get(TElementPlugin);
|
|
100
|
+
if (plugin) plugin.element = element;
|
|
101
|
+
}
|
|
102
|
+
attach() {
|
|
103
|
+
this._events?.emit("attach");
|
|
104
|
+
}
|
|
105
|
+
detach() {
|
|
106
|
+
if (this._detached) return;
|
|
107
|
+
this._detached = true;
|
|
108
|
+
this._events?.emit("detach");
|
|
109
|
+
}
|
|
110
|
+
destroy() {
|
|
111
|
+
this.detach();
|
|
112
|
+
this._events?.emit("destroy");
|
|
113
|
+
this._extensions = void 0;
|
|
114
|
+
this._tenancy.destroy();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
//#endregion
|
|
118
|
+
export { TAdapterContext };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createAdapterContext — сборка компонента на монтирование: шесть шагов, сверху вниз.
|
|
3
|
+
*
|
|
4
|
+
* 1. Инстанс — `ctrl` или конструктор дескриптора.
|
|
5
|
+
* 2–3. Набор плагинов: свой (`TOwnBundle`, с id монтирования `mountId` и
|
|
6
|
+
* локалью поддерева `locale`) или не свой (`TSharedBundle`).
|
|
7
|
+
* 4. Участники обмена: инстанс, затем то, что даёт набор.
|
|
8
|
+
* 5. Начальные значения — здесь и только здесь, одинаково для всех адаптеров:
|
|
9
|
+
* свой инстанс получил пропсы конструктором, и второй раз они не пишутся
|
|
10
|
+
* (сеттер `items` фасада пересоздал бы элементы); внешнему `ctrl` пишутся
|
|
11
|
+
* сеттерами; участникам набора — если набор свой. Порядок: инстанс, плагины
|
|
12
|
+
* дескриптора, связка — а плагины снаружи получают своё, когда встают.
|
|
13
|
+
* Обмен для этого не заводится: записи нужны только линии участников и
|
|
14
|
+
* пропсы сборки, а состояние, входы и события соберёт `connect()`.
|
|
15
|
+
* 6. Завершение набора: плагины реестра и объявление наружу на микрозадаче.
|
|
16
|
+
*
|
|
17
|
+
* Шаги 2–6 идут над инстансом атомарно для остальных его монтирований
|
|
18
|
+
* (`TAssembling`): их состояние перечитается после сборки, а не посреди неё.
|
|
19
|
+
*
|
|
20
|
+
* Имя пропа одно во всех фреймворках, поэтому профиль адаптера сборке не нужен:
|
|
21
|
+
* начальные значения идут в общем формате имён (`CommonProfile`).
|
|
22
|
+
*/
|
|
23
|
+
import type { IComponentDescriptor, IPluginsContract } from '../../define';
|
|
24
|
+
import type { IAdapterContext, IAdapterContextConfig, IAdapterContextOptions, TContextContract } from './types';
|
|
25
|
+
/**
|
|
26
|
+
* Тип контекста выводится из дескриптора, дженерики адаптер не пишет.
|
|
27
|
+
*
|
|
28
|
+
* Инстанс сводится из двух источников — `ctor` дескриптора и `ctrl`. Адаптер
|
|
29
|
+
* объявляет `ctrl` интерфейсом ядра (`IButton`), класс дескриптора
|
|
30
|
+
* (`TButton`) его реализует, и контекст обещает интерфейс: под `ctrl` приходит
|
|
31
|
+
* любая его реализация. `ctrl` чужого компонента не компилируется — класс
|
|
32
|
+
* дескриптора его тип не реализует.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createAdapterContext<TInstance extends object, TPlugins extends IPluginsContract>(descriptor: IComponentDescriptor<TContextContract<TInstance, TPlugins>>, options: IAdapterContextOptions<TInstance>, config?: IAdapterContextConfig): IAdapterContext<TContextContract<TInstance, TPlugins>>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { PLUGIN_PROPS } from "../../naming/naming.js";
|
|
2
|
+
import { CommonProfile } from "../../naming/common-profile.js";
|
|
3
|
+
import { assembling } from "../exchange/assembling.class.js";
|
|
4
|
+
import { TInputPort } from "../exchange/input-port.class.js";
|
|
5
|
+
import { TMember } from "../exchange/member.class.js";
|
|
6
|
+
import { TSurface } from "../surface/surface.class.js";
|
|
7
|
+
import { TAdapterContext } from "./adapter-context.class.js";
|
|
8
|
+
import { TOwnBundle } from "./own-bundle.class.js";
|
|
9
|
+
import { TSharedBundle } from "./shared-bundle.class.js";
|
|
10
|
+
//#region protected/adapter/context/create-adapter-context.ts
|
|
11
|
+
/**
|
|
12
|
+
* createAdapterContext — сборка компонента на монтирование: шесть шагов, сверху вниз.
|
|
13
|
+
*
|
|
14
|
+
* 1. Инстанс — `ctrl` или конструктор дескриптора.
|
|
15
|
+
* 2–3. Набор плагинов: свой (`TOwnBundle`, с id монтирования `mountId` и
|
|
16
|
+
* локалью поддерева `locale`) или не свой (`TSharedBundle`).
|
|
17
|
+
* 4. Участники обмена: инстанс, затем то, что даёт набор.
|
|
18
|
+
* 5. Начальные значения — здесь и только здесь, одинаково для всех адаптеров:
|
|
19
|
+
* свой инстанс получил пропсы конструктором, и второй раз они не пишутся
|
|
20
|
+
* (сеттер `items` фасада пересоздал бы элементы); внешнему `ctrl` пишутся
|
|
21
|
+
* сеттерами; участникам набора — если набор свой. Порядок: инстанс, плагины
|
|
22
|
+
* дескриптора, связка — а плагины снаружи получают своё, когда встают.
|
|
23
|
+
* Обмен для этого не заводится: записи нужны только линии участников и
|
|
24
|
+
* пропсы сборки, а состояние, входы и события соберёт `connect()`.
|
|
25
|
+
* 6. Завершение набора: плагины реестра и объявление наружу на микрозадаче.
|
|
26
|
+
*
|
|
27
|
+
* Шаги 2–6 идут над инстансом атомарно для остальных его монтирований
|
|
28
|
+
* (`TAssembling`): их состояние перечитается после сборки, а не посреди неё.
|
|
29
|
+
*
|
|
30
|
+
* Имя пропа одно во всех фреймворках, поэтому профиль адаптера сборке не нужен:
|
|
31
|
+
* начальные значения идут в общем формате имён (`CommonProfile`).
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Пропсы связки, а не инстанса: `ctrl` и `embedded` читаются один раз при
|
|
35
|
+
* сборке и в обмене не участвуют, `pluginProps` принимает связка
|
|
36
|
+
* (`TExternalPlugins`). Это имена опций самого `createAdapterContext`.
|
|
37
|
+
*/
|
|
38
|
+
var MOUNT_PROPS = /* @__PURE__ */ new Set([
|
|
39
|
+
"ctrl",
|
|
40
|
+
"embedded",
|
|
41
|
+
PLUGIN_PROPS
|
|
42
|
+
]);
|
|
43
|
+
var instanceSpecs = /* @__PURE__ */ new WeakMap();
|
|
44
|
+
/**
|
|
45
|
+
* Описание участника-инстанса: пропсы и события дескриптора без пропсов
|
|
46
|
+
* связки. Одно на дескриптор, а не фильтр на каждое монтирование: по нему
|
|
47
|
+
* обмен находит таблицу маршрутов своего типа (`TRouting`).
|
|
48
|
+
*/
|
|
49
|
+
function instanceSpecOf(descriptor) {
|
|
50
|
+
let spec = instanceSpecs.get(descriptor);
|
|
51
|
+
if (!spec) {
|
|
52
|
+
spec = Object.freeze({
|
|
53
|
+
props: Object.freeze(descriptor.props.filter((prop) => !MOUNT_PROPS.has(prop.name.name))),
|
|
54
|
+
events: descriptor.events
|
|
55
|
+
});
|
|
56
|
+
instanceSpecs.set(descriptor, spec);
|
|
57
|
+
}
|
|
58
|
+
return spec;
|
|
59
|
+
}
|
|
60
|
+
/** Не задан опцией — читается из пропсов: проп объявлен у всех компонентов, и помнить отдельный шаг не обязан ни один адаптер. */
|
|
61
|
+
function embeddedOf(options) {
|
|
62
|
+
if (options.embedded !== void 0) return options.embedded;
|
|
63
|
+
const value = options.props ? Reflect.get(options.props, "embedded") : void 0;
|
|
64
|
+
return typeof value === "string" ? value : void 0;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Тип контекста выводится из дескриптора, дженерики адаптер не пишет.
|
|
68
|
+
*
|
|
69
|
+
* Инстанс сводится из двух источников — `ctor` дескриптора и `ctrl`. Адаптер
|
|
70
|
+
* объявляет `ctrl` интерфейсом ядра (`IButton`), класс дескриптора
|
|
71
|
+
* (`TButton`) его реализует, и контекст обещает интерфейс: под `ctrl` приходит
|
|
72
|
+
* любая его реализация. `ctrl` чужого компонента не компилируется — класс
|
|
73
|
+
* дескриптора его тип не реализует.
|
|
74
|
+
*/
|
|
75
|
+
function createAdapterContext(descriptor, options, config = {}) {
|
|
76
|
+
const props = options.props ?? {};
|
|
77
|
+
const embedded = embeddedOf(options);
|
|
78
|
+
const instance = options.ctrl ?? new descriptor.ctor(props, options.options ?? {});
|
|
79
|
+
return assembling.run(instance, () => {
|
|
80
|
+
const tenancy = config.bundle === void 0 && descriptor.plugins.length > 0 ? new TOwnBundle(descriptor, instance, { embedded }, options) : new TSharedBundle(descriptor, config.bundle ?? null);
|
|
81
|
+
const owner = new TMember(instance, instanceSpecOf(descriptor));
|
|
82
|
+
const own = tenancy.members();
|
|
83
|
+
const members = [owner, ...own];
|
|
84
|
+
const seeded = options.ctrl ? [owner, ...tenancy.seeded(own)] : tenancy.seeded(own);
|
|
85
|
+
if (seeded.length > 0) TInputPort.seed(seeded, TSurface.of(descriptor, CommonProfile), props);
|
|
86
|
+
tenancy.complete();
|
|
87
|
+
return new TAdapterContext(descriptor, instance, tenancy, members, props, embedded);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { createAdapterContext };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TExternalPlugins — плагины, поставленные снаружи: владелец пропа `pluginProps` и источник `plugin:event`.
|
|
3
|
+
*
|
|
4
|
+
* Поверхность компонента объявляет только дескриптор, и внешний плагин в неё
|
|
5
|
+
* не попадает: статический слой объявляет её раньше регистрации, а поставить
|
|
6
|
+
* плагин можно и после монтирования. Поэтому на все внешние плагины у
|
|
7
|
+
* компонента один проп (`pluginProps`) и одно событие (`plugin:event`).
|
|
8
|
+
*
|
|
9
|
+
* Своих правил записи, сброса и проброса у класса нет. На каждый пришедший
|
|
10
|
+
* плагин с контрактом он заводит тот же `TExchange`, что обслуживает компонент,
|
|
11
|
+
* — только «фреймворком» для него служит мешок `pluginProps` (общий профиль
|
|
12
|
+
* имён), а приёмником событий — конверт на шине инстанса. Поэтому «правила
|
|
13
|
+
* записи — те же, что у пропсов компонента» выполняется не дисциплиной, а тем,
|
|
14
|
+
* что код один: «ключ пропал из мешка — проп вернулся к умолчанию» — обычное
|
|
15
|
+
* поведение полного набора.
|
|
16
|
+
*
|
|
17
|
+
* Путь один, когда бы плагин ни встал: реестр ставит плагины через
|
|
18
|
+
* `bundle.use` уже после того, как этот класс подписался на набор, и они
|
|
19
|
+
* приходят тем же событием `use`, что и плагин из обработчика `bundle:create`.
|
|
20
|
+
*
|
|
21
|
+
* Для обмена компонента этот объект — обычный участник: у него есть свойство
|
|
22
|
+
* `pluginProps`, и линия пишет в него обычным сеттером. Ветки «а если это
|
|
23
|
+
* pluginProps» в порту входов нет.
|
|
24
|
+
*/
|
|
25
|
+
import type { IPluginBundle } from '@soxa-ui/plugins';
|
|
26
|
+
import type { TPluginCtor } from '../../define';
|
|
27
|
+
export declare class TExternalPlugins {
|
|
28
|
+
private readonly _bundle;
|
|
29
|
+
private readonly _instance;
|
|
30
|
+
private readonly _own;
|
|
31
|
+
/** Умолчание `pluginProps`: снятый проп возвращает плагины к их умолчаниям. */
|
|
32
|
+
static readonly defaultValues: {
|
|
33
|
+
pluginProps: {};
|
|
34
|
+
};
|
|
35
|
+
private readonly _bag;
|
|
36
|
+
/** Отвязки плагинов, поставленных снаружи, — с первого такого плагина. */
|
|
37
|
+
private _detach?;
|
|
38
|
+
/**
|
|
39
|
+
* @param _bundle набор компонента: слушатель снимается с его шины по ссылке
|
|
40
|
+
* @param _own плагины дескриптора: через `pluginProps` они не пишутся — их пропсы уже в поверхности
|
|
41
|
+
*/
|
|
42
|
+
constructor(_bundle: IPluginBundle, _instance: object, _own: ReadonlySet<TPluginCtor>);
|
|
43
|
+
get pluginProps(): object;
|
|
44
|
+
set pluginProps(bag: object);
|
|
45
|
+
destroy(): void;
|
|
46
|
+
private readonly _onBundle;
|
|
47
|
+
private _use;
|
|
48
|
+
private _remove;
|
|
49
|
+
/** Конверт — на шину инстанса: его видят и адаптер, и тот, у кого на руках только `ctrl`. */
|
|
50
|
+
private _announce;
|
|
51
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { pluginContractOf } from "../../define/plugin.js";
|
|
2
|
+
import { CommonProfile } from "../../naming/common-profile.js";
|
|
3
|
+
import { sameValue } from "../exchange/value.js";
|
|
4
|
+
import { TInputPort } from "../exchange/input-port.class.js";
|
|
5
|
+
import { TMember } from "../exchange/member.class.js";
|
|
6
|
+
import { TSurface } from "../surface/surface.class.js";
|
|
7
|
+
import { TExchange } from "../exchange/exchange.class.js";
|
|
8
|
+
import { TCell } from "../exchange/cell.class.js";
|
|
9
|
+
//#region protected/adapter/context/external-plugins.class.ts
|
|
10
|
+
function hasEmit(value) {
|
|
11
|
+
return typeof value === "object" && value !== null && "emit" in value && typeof value.emit === "function";
|
|
12
|
+
}
|
|
13
|
+
var TExternalPlugins = class {
|
|
14
|
+
_bundle;
|
|
15
|
+
_instance;
|
|
16
|
+
_own;
|
|
17
|
+
/** Умолчание `pluginProps`: снятый проп возвращает плагины к их умолчаниям. */
|
|
18
|
+
static defaultValues = { pluginProps: {} };
|
|
19
|
+
_bag = new TCell({}, sameValue);
|
|
20
|
+
/** Отвязки плагинов, поставленных снаружи, — с первого такого плагина. */
|
|
21
|
+
_detach;
|
|
22
|
+
/**
|
|
23
|
+
* @param _bundle набор компонента: слушатель снимается с его шины по ссылке
|
|
24
|
+
* @param _own плагины дескриптора: через `pluginProps` они не пишутся — их пропсы уже в поверхности
|
|
25
|
+
*/
|
|
26
|
+
constructor(_bundle, _instance, _own) {
|
|
27
|
+
this._bundle = _bundle;
|
|
28
|
+
this._instance = _instance;
|
|
29
|
+
this._own = _own;
|
|
30
|
+
_bundle.events.listen(this._onBundle);
|
|
31
|
+
}
|
|
32
|
+
get pluginProps() {
|
|
33
|
+
return this._bag.value;
|
|
34
|
+
}
|
|
35
|
+
set pluginProps(bag) {
|
|
36
|
+
this._bag.set(bag);
|
|
37
|
+
}
|
|
38
|
+
destroy() {
|
|
39
|
+
this._bundle.events.unlisten(this._onBundle);
|
|
40
|
+
const detach = this._detach;
|
|
41
|
+
this._detach = void 0;
|
|
42
|
+
for (const off of detach?.values() ?? []) off();
|
|
43
|
+
}
|
|
44
|
+
_onBundle = (event, [ctor, plugin]) => {
|
|
45
|
+
if (event === "use") this._use(ctor, plugin);
|
|
46
|
+
else this._remove(ctor);
|
|
47
|
+
};
|
|
48
|
+
_use(ctor, plugin) {
|
|
49
|
+
if (this._own.has(ctor)) return;
|
|
50
|
+
this._detach?.get(ctor)?.();
|
|
51
|
+
const contract = pluginContractOf(ctor);
|
|
52
|
+
if (!contract) return;
|
|
53
|
+
const member = new TMember(plugin, contract);
|
|
54
|
+
const bag = this._bag.value;
|
|
55
|
+
const surface = TSurface.of(contract, CommonProfile);
|
|
56
|
+
const exchange = new TExchange([member], surface, bag);
|
|
57
|
+
TInputPort.seed([member], surface, bag);
|
|
58
|
+
const offBag = this._bag.listen((bag) => exchange.inputs.full(bag));
|
|
59
|
+
const offEvents = exchange.events.listen((name, args) => this._announce({
|
|
60
|
+
name,
|
|
61
|
+
args
|
|
62
|
+
}));
|
|
63
|
+
this._detach ??= /* @__PURE__ */ new Map();
|
|
64
|
+
this._detach.set(ctor, () => {
|
|
65
|
+
offBag();
|
|
66
|
+
offEvents();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
_remove(ctor) {
|
|
70
|
+
this._detach?.get(ctor)?.();
|
|
71
|
+
this._detach?.delete(ctor);
|
|
72
|
+
}
|
|
73
|
+
/** Конверт — на шину инстанса: его видят и адаптер, и тот, у кого на руках только `ctrl`. */
|
|
74
|
+
_announce(event) {
|
|
75
|
+
const bus = Reflect.get(this._instance, "events");
|
|
76
|
+
if (hasEmit(bus)) bus.emit("plugin:event", event);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
export { TExternalPlugins };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { createAdapterContext } from './create-adapter-context';
|
|
2
|
+
export type { IAdapterContext, IAdapterContextConfig, IAdapterContextOptions, TAdapterEvents, TContextContract, TInstanceContext, IAdapterExtensionCtor, IAdapterExtensionCtorNoOpts, TAnyExtensionCtor, } from './types';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owns the descriptor and registered plugins for one mount.
|
|
3
|
+
* Announces bundle:create on a microtask before running plugin created() hooks.
|
|
4
|
+
* A destroyed bundle is never announced; nodes are detached before destruction.
|
|
5
|
+
*/
|
|
6
|
+
import type { IPluginBundle } from '@soxa-ui/plugins';
|
|
7
|
+
import type { IBundleContext, IComponentDescriptor } from '../../define';
|
|
8
|
+
import { TMember } from '../exchange/member.class';
|
|
9
|
+
import type { IBundleTenancy, TBundleMount } from './types';
|
|
10
|
+
type TBundleDescriptor = Pick<IComponentDescriptor, 'ctor' | 'plugins' | 'props'>;
|
|
11
|
+
export declare class TOwnBundle implements IBundleTenancy {
|
|
12
|
+
private readonly _descriptor;
|
|
13
|
+
private readonly _instance;
|
|
14
|
+
private readonly _context;
|
|
15
|
+
readonly bundle: IPluginBundle;
|
|
16
|
+
private readonly _external;
|
|
17
|
+
constructor(_descriptor: TBundleDescriptor, _instance: object, _context: IBundleContext, mount?: TBundleMount);
|
|
18
|
+
members(): readonly TMember[];
|
|
19
|
+
/** Своим плагинам и связке начальные значения пишет эта сборка. */
|
|
20
|
+
seeded(members: readonly TMember[]): readonly TMember[];
|
|
21
|
+
complete(): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
private _announce;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { PLUGIN_PROPS } from "../../naming/naming.js";
|
|
2
|
+
import { resolveRegisteredPlugins } from "../../registry/plugins.js";
|
|
3
|
+
import { TMember } from "../exchange/member.class.js";
|
|
4
|
+
import { TExternalPlugins } from "./external-plugins.class.js";
|
|
5
|
+
import { TElementPlugin, TPluginBundle } from "@soxa-ui/plugins";
|
|
6
|
+
//#region protected/adapter/context/own-bundle.class.ts
|
|
7
|
+
function hasEmit(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && "emit" in value && typeof value.emit === "function";
|
|
9
|
+
}
|
|
10
|
+
var externalSpecs = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
var ownPlugins = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
/**
|
|
13
|
+
* Описание участника-связки: `pluginProps` — с умолчанием от класса его
|
|
14
|
+
* владельца, как у любого другого пропа. Одно на дескриптор, а не пересчёт на
|
|
15
|
+
* каждое монтирование: по нему обмен находит таблицу маршрутов своего типа.
|
|
16
|
+
*/
|
|
17
|
+
function externalSpecOf(descriptor) {
|
|
18
|
+
let spec = externalSpecs.get(descriptor);
|
|
19
|
+
if (!spec) {
|
|
20
|
+
spec = Object.freeze({
|
|
21
|
+
props: Object.freeze(descriptor.props.filter((prop) => prop.name.name === PLUGIN_PROPS).map((prop) => prop.rebase(TExternalPlugins.defaultValues))),
|
|
22
|
+
events: []
|
|
23
|
+
});
|
|
24
|
+
externalSpecs.set(descriptor, spec);
|
|
25
|
+
}
|
|
26
|
+
return spec;
|
|
27
|
+
}
|
|
28
|
+
/** Классы плагинов дескриптора — один набор на дескриптор, а не на монтирование. */
|
|
29
|
+
function ownPluginsOf(descriptor) {
|
|
30
|
+
let own = ownPlugins.get(descriptor);
|
|
31
|
+
if (!own) {
|
|
32
|
+
own = new Set(descriptor.plugins.map((plugin) => plugin.ctor));
|
|
33
|
+
ownPlugins.set(descriptor, own);
|
|
34
|
+
}
|
|
35
|
+
return own;
|
|
36
|
+
}
|
|
37
|
+
var TOwnBundle = class {
|
|
38
|
+
_descriptor;
|
|
39
|
+
_instance;
|
|
40
|
+
_context;
|
|
41
|
+
bundle;
|
|
42
|
+
_external;
|
|
43
|
+
constructor(_descriptor, _instance, _context, mount = {}) {
|
|
44
|
+
this._descriptor = _descriptor;
|
|
45
|
+
this._instance = _instance;
|
|
46
|
+
this._context = _context;
|
|
47
|
+
const bundle = new TPluginBundle(_instance, mount.mountId, mount.locale);
|
|
48
|
+
for (const plugin of _descriptor.plugins) bundle.use(plugin.ctor, plugin.options ?? {});
|
|
49
|
+
this.bundle = bundle;
|
|
50
|
+
this._external = new TExternalPlugins(bundle, _instance, ownPluginsOf(_descriptor));
|
|
51
|
+
}
|
|
52
|
+
members() {
|
|
53
|
+
return [...this._descriptor.plugins.flatMap((plugin) => {
|
|
54
|
+
const owner = this.bundle.get(plugin.ctor);
|
|
55
|
+
return owner ? [new TMember(owner, plugin)] : [];
|
|
56
|
+
}), new TMember(this._external, externalSpecOf(this._descriptor))];
|
|
57
|
+
}
|
|
58
|
+
/** Своим плагинам и связке начальные значения пишет эта сборка. */
|
|
59
|
+
seeded(members) {
|
|
60
|
+
return members;
|
|
61
|
+
}
|
|
62
|
+
complete() {
|
|
63
|
+
for (const plugin of resolveRegisteredPlugins(this._instance, this._context)) {
|
|
64
|
+
if (this._descriptor.plugins.some((own) => own.ctor === plugin.ctor)) throw new Error(`${plugin.ctor.name} уже входит в состав ${this._descriptor.ctor.name}: плагин реестра только добавляет`);
|
|
65
|
+
this.bundle.use(plugin.ctor, plugin.options ?? {});
|
|
66
|
+
}
|
|
67
|
+
this._announce();
|
|
68
|
+
}
|
|
69
|
+
destroy() {
|
|
70
|
+
this._external.destroy();
|
|
71
|
+
const element = this.bundle.get(TElementPlugin);
|
|
72
|
+
if (element) element.element = null;
|
|
73
|
+
this.bundle.destroy();
|
|
74
|
+
}
|
|
75
|
+
_announce() {
|
|
76
|
+
const { bundle } = this;
|
|
77
|
+
Promise.resolve().then(() => {
|
|
78
|
+
if (bundle.destroyed) return;
|
|
79
|
+
const events = Reflect.get(this._instance, "events");
|
|
80
|
+
if (hasEmit(events)) events.emit("bundle:create", bundle);
|
|
81
|
+
bundle.created();
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { TOwnBundle };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TSharedBundle — набор не наш: чужой (фасад коллекции делит набор с компонентом) или никакого.
|
|
3
|
+
*
|
|
4
|
+
* Участники — только плагины дескриптора, которые в наборе нашлись; плагин,
|
|
5
|
+
* которого там нет, молча пропускается. Регистрации приложения не
|
|
6
|
+
* пересматриваются — иначе фасад получил бы плагин реестра второй раз.
|
|
7
|
+
* Начальные значения плагинам не пишутся, плагины снаружи не ведутся, набор и
|
|
8
|
+
* узел при `destroy()` не трогаются: всё это делает владелец набора.
|
|
9
|
+
*
|
|
10
|
+
* Компонент без плагинов сюда же: набора у него нет, и вести нечего.
|
|
11
|
+
*/
|
|
12
|
+
import type { IPluginBundle } from '@soxa-ui/plugins';
|
|
13
|
+
import type { IComponentDescriptor } from '../../define';
|
|
14
|
+
import { TMember } from '../exchange/member.class';
|
|
15
|
+
import type { IBundleTenancy } from './types';
|
|
16
|
+
export declare class TSharedBundle implements IBundleTenancy {
|
|
17
|
+
private readonly _descriptor;
|
|
18
|
+
readonly bundle: IPluginBundle | null;
|
|
19
|
+
constructor(_descriptor: Pick<IComponentDescriptor, 'plugins'>, bundle: IPluginBundle | null);
|
|
20
|
+
members(): readonly TMember[];
|
|
21
|
+
/** Чужим плагинам начальные значения пишет владелец набора. */
|
|
22
|
+
seeded(): readonly TMember[];
|
|
23
|
+
complete(): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TMember } from "../exchange/member.class.js";
|
|
2
|
+
//#region protected/adapter/context/shared-bundle.class.ts
|
|
3
|
+
var TSharedBundle = class {
|
|
4
|
+
_descriptor;
|
|
5
|
+
bundle;
|
|
6
|
+
constructor(_descriptor, bundle) {
|
|
7
|
+
this._descriptor = _descriptor;
|
|
8
|
+
this.bundle = bundle;
|
|
9
|
+
}
|
|
10
|
+
members() {
|
|
11
|
+
return this._descriptor.plugins.flatMap((plugin) => {
|
|
12
|
+
const owner = this.bundle?.get(plugin.ctor);
|
|
13
|
+
return owner ? [new TMember(owner, plugin)] : [];
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Чужим плагинам начальные значения пишет владелец набора. */
|
|
17
|
+
seeded() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
complete() {}
|
|
21
|
+
destroy() {}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { TSharedBundle };
|