@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,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* normalizeContribution — contribution в описания: пропсы (`TPropSpec`), события (`TName`) и слоты.
|
|
3
|
+
*
|
|
4
|
+
* Неймспейс применяется к каждому имени пропа, триггера и события. Слоты
|
|
5
|
+
* неймспейса не получают: они принадлежат компоненту, а у плагинов слотов нет
|
|
6
|
+
* вовсе — плагин не рендерит.
|
|
7
|
+
*
|
|
8
|
+
* Умолчаний у описаний здесь ещё нет: умолчание принадлежит классу владельца, и
|
|
9
|
+
* приставляет его тот, кто класс знает, — дескриптор (`TPropSpec.rebase`) или
|
|
10
|
+
* определение плагина.
|
|
11
|
+
*/
|
|
12
|
+
import type { IContribution } from './contribution.types';
|
|
13
|
+
import { TName } from './name.class';
|
|
14
|
+
import { TPropSpec } from './prop-spec.class';
|
|
15
|
+
import { TSlotDeclaration } from './slot-declaration.class';
|
|
16
|
+
export declare function normalizeContribution(contribution?: IContribution, namespace?: string): {
|
|
17
|
+
props: TPropSpec[];
|
|
18
|
+
events: TName[];
|
|
19
|
+
slots: TSlotDeclaration[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TName } from "./name.class.js";
|
|
2
|
+
import { TPropSpec } from "./prop-spec.class.js";
|
|
3
|
+
import { TSlotDeclaration } from "./slot-declaration.class.js";
|
|
4
|
+
//#region protected/define/contribution.ts
|
|
5
|
+
function normalizeContribution(contribution, namespace) {
|
|
6
|
+
if (!contribution) return {
|
|
7
|
+
props: [],
|
|
8
|
+
events: [],
|
|
9
|
+
slots: []
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
props: Object.entries(contribution.props ?? {}).map(([name, definition]) => new TPropSpec(new TName(name, namespace), Object.freeze((definition.triggers ?? []).map((trigger) => new TName(trigger, namespace))), definition)),
|
|
13
|
+
events: (contribution.events ?? []).map((event) => new TName(event, namespace)),
|
|
14
|
+
slots: Object.entries(contribution.slots ?? {}).map(([name, definition]) => new TSlotDeclaration(name, definition.scope, definition.description))
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { normalizeContribution };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Синтаксис объявления в дескрипторе: пропсы, события и слоты — то, что автор пишет в `contribution`.
|
|
3
|
+
*
|
|
4
|
+
* Это вход описания. Во что он превращается — `TPropSpec`, `TName` и
|
|
5
|
+
* `ISlotDeclaration` — решает `normalizeContribution`.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Объявление одного свойства. Ключ словаря `props` — имя свойства.
|
|
9
|
+
*
|
|
10
|
+
* `get`/`set` объявлены методами, а не свойствами-функциями: contribution пишет
|
|
11
|
+
* их под своего владельца — инстанс компонента или плагин (у `AnchorPluginDescriptor`
|
|
12
|
+
* это `set: (plugin: TAnchorPlugin, value: Element | null) => …`), а слой вызывает
|
|
13
|
+
* их с владельцем того же участника — эту связь держит дескриптор, а не тип. Метод
|
|
14
|
+
* принимает такую реализацию без приведения.
|
|
15
|
+
*/
|
|
16
|
+
export interface IPropDefinition {
|
|
17
|
+
type?: unknown;
|
|
18
|
+
/** Свойство вычисляет владелец, снаружи его только читают. */
|
|
19
|
+
protected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Owner events that refresh this property and its model binding.
|
|
22
|
+
* Triggers do not publish public component or plugin events.
|
|
23
|
+
*/
|
|
24
|
+
triggers?: readonly string[];
|
|
25
|
+
/** Нетривиальное чтение: вместо `owner[name]`. */
|
|
26
|
+
get?(instance: object): unknown;
|
|
27
|
+
/** Нетривиальная запись: вместо `owner[name] = value`. */
|
|
28
|
+
set?(instance: object, value: unknown): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Объявление одного слота. Ключ словаря `slots` — имя слота.
|
|
32
|
+
*
|
|
33
|
+
* Слоты — третья категория контракта рядом с пропсами и событиями. Синтаксис у
|
|
34
|
+
* каждого фреймворка свой (`<template #leading>`, `{#snippet}`, проп с JSX,
|
|
35
|
+
* `<ng-template>`, атрибут `slot`) — общими остаются имена, состав и scope.
|
|
36
|
+
*/
|
|
37
|
+
export interface ISlotDefinition {
|
|
38
|
+
/**
|
|
39
|
+
* Данные, которые компонент передаёт ВНУТРЬ слота (scoped slot):
|
|
40
|
+
* `v-slot="{ text }"`, `{#snippet children(scope)}`, `let-text`.
|
|
41
|
+
*
|
|
42
|
+
* **Это не тип содержимого и не ограничение на него.** В слот можно положить
|
|
43
|
+
* что угодно. Значения несут тип данных слота (`defineType<T>`): в рантайме
|
|
44
|
+
* нужен лишь состав ключей, тип живёт на уровне типов.
|
|
45
|
+
*/
|
|
46
|
+
scope?: Record<string, unknown>;
|
|
47
|
+
/** Одна строка для документации и генерации. */
|
|
48
|
+
description?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Нормализованное объявление слота: имя вынесено из ключа словаря. */
|
|
51
|
+
export interface ISlotDeclaration {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly scope?: Record<string, unknown>;
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Contribution: словарь пропсов (имя → объявление), события сырыми строками и слоты.
|
|
58
|
+
*
|
|
59
|
+
* Только для чтения, как и `IPropDefinition.triggers`: объявление после записи
|
|
60
|
+
* не меняется, а его литеральный тип — источник типов дескриптора.
|
|
61
|
+
*/
|
|
62
|
+
export interface IContribution {
|
|
63
|
+
readonly props?: Readonly<Record<string, IPropDefinition>>;
|
|
64
|
+
readonly events?: readonly string[];
|
|
65
|
+
readonly slots?: Readonly<Record<string, ISlotDefinition>>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defineDescriptor — дескриптор компонента строится один раз, а не на каждое монтирование.
|
|
3
|
+
*
|
|
4
|
+
* Фабрика дескриптора ленива намеренно: дескрипторы ссылаются друг на друга
|
|
5
|
+
* через `extends`, и у коллекций эти ссылки образуют цикл, который на уровне
|
|
6
|
+
* модулей не развязать. Но результат от вызова к вызову один и тот же:
|
|
7
|
+
* декларации собираются из contribution и родителя, умолчания — из статики
|
|
8
|
+
* класса ядра, и ничего из этого после сборки не меняется.
|
|
9
|
+
*
|
|
10
|
+
* export const ButtonDescriptor = defineDescriptor(() =>
|
|
11
|
+
* defineComponent({ ctor: TButton, extends: TextableDescriptor(), … }),
|
|
12
|
+
* )
|
|
13
|
+
*
|
|
14
|
+
* До этого `ButtonDescriptor()` на каждом монтировании пересобирал всю цепочку
|
|
15
|
+
* до `EntityDescriptor`, а адаптеры зовут фабрику дважды: при импорте модуля
|
|
16
|
+
* компонента (статические пропсы и события) и в `setup` на каждое монтирование.
|
|
17
|
+
* Теперь оба вызова получают один объект, и у дескриптора появляется
|
|
18
|
+
* устойчивая идентичность — по ней кэшируются состав и его публичная
|
|
19
|
+
* поверхность.
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineDescriptor<T extends object>(build: () => T): () => T;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region protected/define/descriptor.ts
|
|
2
|
+
/**
|
|
3
|
+
* defineDescriptor — дескриптор компонента строится один раз, а не на каждое монтирование.
|
|
4
|
+
*
|
|
5
|
+
* Фабрика дескриптора ленива намеренно: дескрипторы ссылаются друг на друга
|
|
6
|
+
* через `extends`, и у коллекций эти ссылки образуют цикл, который на уровне
|
|
7
|
+
* модулей не развязать. Но результат от вызова к вызову один и тот же:
|
|
8
|
+
* декларации собираются из contribution и родителя, умолчания — из статики
|
|
9
|
+
* класса ядра, и ничего из этого после сборки не меняется.
|
|
10
|
+
*
|
|
11
|
+
* export const ButtonDescriptor = defineDescriptor(() =>
|
|
12
|
+
* defineComponent({ ctor: TButton, extends: TextableDescriptor(), … }),
|
|
13
|
+
* )
|
|
14
|
+
*
|
|
15
|
+
* До этого `ButtonDescriptor()` на каждом монтировании пересобирал всю цепочку
|
|
16
|
+
* до `EntityDescriptor`, а адаптеры зовут фабрику дважды: при импорте модуля
|
|
17
|
+
* компонента (статические пропсы и события) и в `setup` на каждое монтирование.
|
|
18
|
+
* Теперь оба вызова получают один объект, и у дескриптора появляется
|
|
19
|
+
* устойчивая идентичность — по ней кэшируются состав и его публичная
|
|
20
|
+
* поверхность.
|
|
21
|
+
*/
|
|
22
|
+
function defineDescriptor(build) {
|
|
23
|
+
let descriptor;
|
|
24
|
+
return () => descriptor ??= build();
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { defineDescriptor };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { normalizeContribution } from './contribution';
|
|
2
|
+
export { definePlugin, pluginContractOf } from './plugin';
|
|
3
|
+
export { defineComponent } from './component';
|
|
4
|
+
export { defineDescriptor } from './descriptor';
|
|
5
|
+
export { defineType } from './prop-type';
|
|
6
|
+
export { TName } from './name.class';
|
|
7
|
+
export { TPropSpec } from './prop-spec.class';
|
|
8
|
+
export { TSlotDeclaration } from './slot-declaration.class';
|
|
9
|
+
export type { IContribution, IPropDefinition, ISlotDeclaration, ISlotDefinition, } from './contribution.types';
|
|
10
|
+
export type { IBundleContext, IComponentContract, IComponentContribution, IComponentDescriptor, IComponentOptions, IComponentPropDefinition, IComponentSlotDefinition, IDeclaration, IPluginContract, IPluginDefinition, IPluginsContract, TComponentCtor, TEmptySlotScope, TPluginCtor, TPropType, TSlotDefinitions, } from './types';
|
|
11
|
+
export type { DescriptorAllEvents, DescriptorAllProps, DescriptorEvents, DescriptorInstance, DescriptorPluginOutputs, DescriptorPluginProps, DescriptorProps, DescriptorSlots, TContractOf, TInstanceEvents, } from './inference.types';
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Вывод типов: контракт плагина и компонента из их объявлений и типы для адаптеров из контракта.
|
|
3
|
+
*
|
|
4
|
+
* Фабрика дескриптора — единственный источник типов: адаптер не импортирует
|
|
5
|
+
* интерфейсы пропсов и карты событий из ядра, а выводит их отсюда. Сам
|
|
6
|
+
* дескриптор их тоже не повторяет: `defineComponent` берёт пропсы у класса
|
|
7
|
+
* ядра (`ctor`), события — из его карты, суженной до имён, которые дескриптор
|
|
8
|
+
* публикует, а слоты — из их объявления. У плагина так же: `definePlugin`
|
|
9
|
+
* берёт типы пропсов и карту событий у класса плагина, а состав — у
|
|
10
|
+
* contribution.
|
|
11
|
+
*/
|
|
12
|
+
import type { IEntity, TEvented } from '@soxa-ui/core';
|
|
13
|
+
import type { TPluginInternalEvents } from '@soxa-ui/plugins';
|
|
14
|
+
import type { TUnderscorePropName } from '../naming';
|
|
15
|
+
import type { IComponentDescriptor, IPluginDefinition, IPluginsContract, TEmptySlotScope, TPropType } from './types';
|
|
16
|
+
/**
|
|
17
|
+
* Пропсы инстанса — параметр `TProps` его сущности ядра (`IEntity<TProps>`):
|
|
18
|
+
* интерфейс, который класс принимает конструктором и отдаёт `getProps()`.
|
|
19
|
+
* Класс не из ядра — словарь без типа, как у дескриптора без `ctor` и `extends`.
|
|
20
|
+
*
|
|
21
|
+
* У дженерик-класса на месте параметра стоит его констрейнт, а не дефолт, как
|
|
22
|
+
* и у самого инстанса: `IValueControlProps<unknown>` у `TValueControl`.
|
|
23
|
+
*/
|
|
24
|
+
type TInstanceProps<TInstance> = TInstance extends IEntity<infer P extends object> ? P : Record<string, unknown>;
|
|
25
|
+
/** События инстанса — карта его шины (`events: TEvented<TEvents>`); шины нет — событий нет. */
|
|
26
|
+
export type TInstanceEvents<TInstance> = TInstance extends {
|
|
27
|
+
readonly events: TEvented<infer E>;
|
|
28
|
+
} ? E : object;
|
|
29
|
+
/**
|
|
30
|
+
* Имя, которое дескриптор может объявить в `events` и `triggers`, — ключ карты
|
|
31
|
+
* событий инстанса. Шины нет (`EntityDescriptor` и `CollectionDescriptor` без
|
|
32
|
+
* класса ядра) — сверять не с чем, и имя любое: карту даст наследник.
|
|
33
|
+
*/
|
|
34
|
+
type TInstanceEventName<TInstance> = TInstance extends {
|
|
35
|
+
readonly events: TEvented<infer E>;
|
|
36
|
+
} ? Extract<keyof E, string> : string;
|
|
37
|
+
/** The instance event map narrowed to explicit declarations, including inherited events. */
|
|
38
|
+
type TPublishedEvents<TInstance, TName extends string> = TInstance extends {
|
|
39
|
+
readonly events: TEvented<infer E>;
|
|
40
|
+
} ? Pick<E, Extract<TName, keyof E>> : object;
|
|
41
|
+
/** Словарь `props` объявления; нет — пустой. */
|
|
42
|
+
type TDeclaredProps<TContribution> = TContribution extends {
|
|
43
|
+
readonly props: infer P extends object;
|
|
44
|
+
} ? P : object;
|
|
45
|
+
/** Only the explicit event list contributes to the public event contract. */
|
|
46
|
+
type TDeclaredEventName<TContribution> = TContribution extends {
|
|
47
|
+
readonly events: readonly (infer E extends string)[];
|
|
48
|
+
} ? E : never;
|
|
49
|
+
/**
|
|
50
|
+
* Имена, объявленные защищёнными: у плагина это его выходы, у компонента —
|
|
51
|
+
* то, что из пропсов уходит (`protected` значит «значение вычисляет владелец,
|
|
52
|
+
* разметка только читает»).
|
|
53
|
+
*/
|
|
54
|
+
type TProtectedKey<TProps> = Extract<{
|
|
55
|
+
[K in keyof TProps]: TProps[K] extends {
|
|
56
|
+
readonly protected: true;
|
|
57
|
+
} ? K : never;
|
|
58
|
+
}[keyof TProps], string>;
|
|
59
|
+
/**
|
|
60
|
+
* Имена, объявленные входами: ключ в объявлении есть, а `protected: true` в
|
|
61
|
+
* нём нет. Переобъявление наследника ходит в обе стороны, поэтому у
|
|
62
|
+
* защищённого пропа родителя такое имя возвращает вход.
|
|
63
|
+
*/
|
|
64
|
+
type TInputKey<TProps> = Extract<Exclude<keyof TProps, TProtectedKey<TProps>>, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Тип значения пропа плагина: что отдаёт его `get`, а без него — одноимённое
|
|
67
|
+
* свойство класса. Ни того ни другого — типа нет.
|
|
68
|
+
*/
|
|
69
|
+
type TPluginPropValue<TInstance, TDefinition, K> = TDefinition extends {
|
|
70
|
+
get(instance: never): infer TValue;
|
|
71
|
+
} ? TValue : K extends keyof TInstance ? TInstance[K] : unknown;
|
|
72
|
+
/** `{ label }` @ `aria` → `{ aria_label }` (naming — как в `underscorePropNaming`). */
|
|
73
|
+
type TNamespacedProps<T, N extends string | undefined> = {
|
|
74
|
+
[K in keyof T as K extends string ? TUnderscorePropName<N, K> : never]: T[K];
|
|
75
|
+
};
|
|
76
|
+
/** `{ ready }` @ `element` → `{ 'element:ready' }` (формат — как у `TName.getName()`). */
|
|
77
|
+
type TNamespacedEvents<T, N extends string | undefined> = {
|
|
78
|
+
[K in keyof T as K extends string ? (N extends string ? `${N}:${K}` : K) : never]: T[K];
|
|
79
|
+
};
|
|
80
|
+
/** Plugin lifecycle events stay internal when inferring the public contract. */
|
|
81
|
+
type TPublicPluginEvents<TInstance> = Omit<TInstanceEvents<TInstance>, keyof TPluginInternalEvents>;
|
|
82
|
+
/** Опции установки — второй параметр `install()` класса; не объявлен — любой объект. */
|
|
83
|
+
type TPluginOptions<TInstance> = TInstance extends {
|
|
84
|
+
install(ctx: never, options?: infer TOptions extends object): void;
|
|
85
|
+
} ? TOptions : object;
|
|
86
|
+
/**
|
|
87
|
+
* Контракт плагина: состав — из contribution, типы — из класса.
|
|
88
|
+
*
|
|
89
|
+
* Входы — незащищённые пропсы, выходы — защищённые, события — карта класса,
|
|
90
|
+
* суженная до опубликованных имён, как у компонента (`TPublishedEvents`).
|
|
91
|
+
* Второй записи пропсов и событий рядом с объявлением нет.
|
|
92
|
+
*/
|
|
93
|
+
export type TPluginContractFrom<TInstance, N extends string | undefined, TContribution> = {
|
|
94
|
+
options: TPluginOptions<TInstance>;
|
|
95
|
+
props: TNamespacedProps<{
|
|
96
|
+
-readonly [K in Exclude<keyof TDeclaredProps<TContribution>, TProtectedKey<TDeclaredProps<TContribution>>>]?: TPluginPropValue<TInstance, TDeclaredProps<TContribution>[K], K>;
|
|
97
|
+
}, N>;
|
|
98
|
+
events: TNamespacedEvents<Pick<TPublicPluginEvents<TInstance>, Extract<TDeclaredEventName<TContribution>, keyof TPublicPluginEvents<TInstance>>>, N>;
|
|
99
|
+
outputs: TNamespacedProps<{
|
|
100
|
+
readonly [K in TProtectedKey<TDeclaredProps<TContribution>>]: TPluginPropValue<TInstance, TDeclaredProps<TContribution>[K], K>;
|
|
101
|
+
}, N>;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Что наследник берёт у дескриптора без `extends`: ни инстанса, ни имён, ни
|
|
105
|
+
* плагинов. Слотов здесь нет — у родителя их не берут (`TContractFrom`).
|
|
106
|
+
*/
|
|
107
|
+
type TRootContract = {
|
|
108
|
+
instance: object;
|
|
109
|
+
eventName: never;
|
|
110
|
+
protectedName: never;
|
|
111
|
+
plugins: {
|
|
112
|
+
props: object;
|
|
113
|
+
events: object;
|
|
114
|
+
outputs: object;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
/** Контракт родителя из `extends`; нет — корневой. */
|
|
118
|
+
type TParentContract<TOptions> = TOptions extends {
|
|
119
|
+
readonly extends: IComponentDescriptor<infer C>;
|
|
120
|
+
} ? C : TRootContract;
|
|
121
|
+
/** Инстанс — из своего `ctor`, а без него родительский. */
|
|
122
|
+
type TOptionsInstance<TOptions> = TOptions extends {
|
|
123
|
+
readonly ctor: new (...args: any[]) => infer TInstance extends object;
|
|
124
|
+
} ? TInstance : TParentContract<TOptions>['instance'];
|
|
125
|
+
type TOptionsContribution<TOptions> = TOptions extends {
|
|
126
|
+
readonly contribution: infer C;
|
|
127
|
+
} ? C : object;
|
|
128
|
+
/** Scope слота из объявления: `defineType<T>` даёт `T`, слот без scope — `TEmptySlotScope`. */
|
|
129
|
+
type TSlotScope<TSlot> = TSlot extends {
|
|
130
|
+
readonly scope: infer TScope extends Readonly<Record<string, TPropType<unknown>>>;
|
|
131
|
+
} ? {
|
|
132
|
+
-readonly [K in keyof TScope]: TScope[K] extends TPropType<infer T> ? T : never;
|
|
133
|
+
} : TEmptySlotScope;
|
|
134
|
+
/** Слоты из объявления `contribution.slots`: имя слота → его scope; объявления нет — слотов нет. */
|
|
135
|
+
type TDeclaredSlots<TContribution> = TContribution extends {
|
|
136
|
+
readonly slots: infer S;
|
|
137
|
+
} ? {
|
|
138
|
+
-readonly [K in keyof S]: TSlotScope<S[K]>;
|
|
139
|
+
} : object;
|
|
140
|
+
/** Объединение → пересечение: сумма частей контрактов всех плагинов списка. */
|
|
141
|
+
type TIntersection<TUnion> = (TUnion extends unknown ? (part: TUnion) => void : never) extends (part: infer TPart) => void ? TPart : never;
|
|
142
|
+
/** Одна часть контракта (`props`, `events`, `outputs`) у всех плагинов списка разом. */
|
|
143
|
+
type TPluginsPart<TPlugin, K extends keyof IPluginsContract> = [TPlugin] extends [never] ? object : TIntersection<TPlugin extends IPluginDefinition<infer C> ? C[K] : never> extends infer TPart extends object ? TPart : object;
|
|
144
|
+
/** Сумма контрактов своих плагинов из `plugins`. */
|
|
145
|
+
type TOptionsPlugins<TOptions> = TOptions extends {
|
|
146
|
+
readonly plugins: readonly (infer TPlugin)[];
|
|
147
|
+
} ? {
|
|
148
|
+
props: TPluginsPart<TPlugin, 'props'>;
|
|
149
|
+
events: TPluginsPart<TPlugin, 'events'>;
|
|
150
|
+
outputs: TPluginsPart<TPlugin, 'outputs'>;
|
|
151
|
+
} : {
|
|
152
|
+
props: object;
|
|
153
|
+
events: object;
|
|
154
|
+
outputs: object;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Контракт дескриптора из опций `defineComponent`: своё поверх родительского.
|
|
158
|
+
*
|
|
159
|
+
* Слоты — только свои, как и в рантайме (`TComponentDescriptor`): они
|
|
160
|
+
* описывают разметку, а разметка у наследника своя, и слоты `extends` ей
|
|
161
|
+
* ничего не обещают.
|
|
162
|
+
*/
|
|
163
|
+
export type TContractFrom<TOptions> = {
|
|
164
|
+
instance: TOptionsInstance<TOptions>;
|
|
165
|
+
eventName: TParentContract<TOptions>['eventName'] | TDeclaredEventName<TOptionsContribution<TOptions>>;
|
|
166
|
+
protectedName: Exclude<TParentContract<TOptions>['protectedName'], TInputKey<TDeclaredProps<TOptionsContribution<TOptions>>>> | TProtectedKey<TDeclaredProps<TOptionsContribution<TOptions>>>;
|
|
167
|
+
slots: TDeclaredSlots<TOptionsContribution<TOptions>>;
|
|
168
|
+
plugins: {
|
|
169
|
+
props: TParentContract<TOptions>['plugins']['props'] & TOptionsPlugins<TOptions>['props'];
|
|
170
|
+
events: TParentContract<TOptions>['plugins']['events'] & TOptionsPlugins<TOptions>['events'];
|
|
171
|
+
outputs: TParentContract<TOptions>['plugins']['outputs'] & TOptionsPlugins<TOptions>['outputs'];
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Сверка имён событий: `events` и триггеры своих пропсов — ключи карты событий
|
|
176
|
+
* инстанса. Опечатка в триггере или событие, которого класс не шлёт, — ошибка
|
|
177
|
+
* компиляции дескриптора. Имена родителя приходят из `extends` готовыми: их
|
|
178
|
+
* сверил родитель, если у него был класс ядра. У родителя без класса
|
|
179
|
+
* (`EntityDescriptor`, `CollectionDescriptor`) их сверить было не с чем, и
|
|
180
|
+
* карту к ним прикладывает наследник.
|
|
181
|
+
*/
|
|
182
|
+
export type TCheckedEventNames<TOptions> = {
|
|
183
|
+
readonly contribution?: {
|
|
184
|
+
readonly events?: readonly TInstanceEventName<TOptionsInstance<TOptions>>[];
|
|
185
|
+
readonly props?: {
|
|
186
|
+
readonly [K in keyof TDeclaredProps<TOptionsContribution<TOptions>>]?: {
|
|
187
|
+
readonly triggers?: readonly TInstanceEventName<TOptionsInstance<TOptions>>[];
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
/** Контракт по фабрике дескриптора (`typeof ButtonDescriptor`) или по самому дескриптору. */
|
|
193
|
+
export type TContractOf<T> = T extends (...args: any[]) => IComponentDescriptor<infer C> ? C : T extends IComponentDescriptor<infer C> ? C : never;
|
|
194
|
+
/** Инстанс дескриптора: DescriptorInstance<typeof ButtonDescriptor> → TButton */
|
|
195
|
+
export type DescriptorInstance<T> = TContractOf<T>['instance'];
|
|
196
|
+
/**
|
|
197
|
+
* Интерфейс пропсов без защищённых имён.
|
|
198
|
+
*
|
|
199
|
+
* Вычитать нечего — тип остаётся тем же самым, а не структурной копией: у
|
|
200
|
+
* подавляющего большинства компонентов защищённый проп в интерфейс пропсов
|
|
201
|
+
* ядра и не входит (`classes`, `aria` — геттеры инстанса), и `Omit` там
|
|
202
|
+
* заменил бы именованный интерфейс перечислением ключей в declaration emit.
|
|
203
|
+
*/
|
|
204
|
+
type TOmitProtected<TProps, TName extends string> = [Extract<keyof TProps, TName>] extends [never] ? TProps : Omit<TProps, TName>;
|
|
205
|
+
/**
|
|
206
|
+
* Props компонента из дескриптора: DescriptorProps<typeof ButtonDescriptor> → IButtonProps
|
|
207
|
+
*
|
|
208
|
+
* Защищённое имя из пропсов уходит: `protected` значит «значение вычисляет
|
|
209
|
+
* владелец», и входа у разметки нет ни в рантайме (`exportProps` поверхности),
|
|
210
|
+
* ни в типе. Так переобъявление `size: { protected: true }` у элемента
|
|
211
|
+
* коллекции снимает вход, оставляя `size` в интерфейсе ядра: из данных и от
|
|
212
|
+
* владельца значение по-прежнему приходит.
|
|
213
|
+
*/
|
|
214
|
+
export type DescriptorProps<T> = TOmitProtected<TInstanceProps<DescriptorInstance<T>>, TContractOf<T>['protectedName']>;
|
|
215
|
+
/** Own component events declared in `events`, excluding namespaced plugin events. */
|
|
216
|
+
export type DescriptorEvents<T> = TPublishedEvents<DescriptorInstance<T>, TContractOf<T>['eventName']>;
|
|
217
|
+
/**
|
|
218
|
+
* Все события дескриптора — свои опубликованные и плагинные (namespaced):
|
|
219
|
+
* DescriptorAllEvents<typeof ButtonDescriptor> → DescriptorEvents<…> & { 'element:ready': ... }.
|
|
220
|
+
* Из неё React, Solid и Svelte выводят колбэк-пропы, поэтому в ней только то, что адаптер пробрасывает.
|
|
221
|
+
*/
|
|
222
|
+
export type DescriptorAllEvents<T> = DescriptorEvents<T> & TContractOf<T>['plugins']['events'];
|
|
223
|
+
/** Все пропсы дескриптора (свои + плагинные, namespaced): DescriptorAllProps<typeof ButtonDescriptor> → IButtonProps & { aria_label?: ... } */
|
|
224
|
+
export type DescriptorAllProps<T> = DescriptorProps<T> & TContractOf<T>['plugins']['props'];
|
|
225
|
+
/**
|
|
226
|
+
* Входы плагинов дескриптора — незащищённые пропсы плагинов:
|
|
227
|
+
* DescriptorPluginProps<typeof InputDescriptor> → { aria_label?: ...; id?: ... }
|
|
228
|
+
*
|
|
229
|
+
* Вход с триггером обмен держит в состоянии, как свойство инстанса, и
|
|
230
|
+
* разметка читает его оттуда же (`TAdapterState`): `id` поля — проп
|
|
231
|
+
* `TIdPlugin`, и, заданный полем формы, он есть только в состоянии.
|
|
232
|
+
*/
|
|
233
|
+
export type DescriptorPluginProps<T> = TContractOf<T>['plugins']['props'];
|
|
234
|
+
/**
|
|
235
|
+
* Выходы плагинов дескриптора — защищённые пропсы, которые плагины отдают
|
|
236
|
+
* разметке: DescriptorPluginOutputs<typeof FrameDescriptor> → { layout_styles: ... }
|
|
237
|
+
*
|
|
238
|
+
* Только плагинные, без «All»: свои выходы компонента (`classes`, `aria`) —
|
|
239
|
+
* геттеры инстанса, и их тип адаптер берёт у него (`TInstanceState`).
|
|
240
|
+
*/
|
|
241
|
+
export type DescriptorPluginOutputs<T> = TContractOf<T>['plugins']['outputs'];
|
|
242
|
+
/**
|
|
243
|
+
* Слоты дескриптора, имя → scope, — только объявленные им самим, без слотов `extends`:
|
|
244
|
+
* DescriptorSlots<typeof ButtonDescriptor> → { leading: TEmptySlotScope; default: { text: string }; trailing: TEmptySlotScope }
|
|
245
|
+
*/
|
|
246
|
+
export type DescriptorSlots<T> = TContractOf<T>['slots'];
|
|
247
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* inheritDeclarations — свои объявления поверх родительских, одним правилом на пропсы и плагины.
|
|
3
|
+
*
|
|
4
|
+
* Правило: объявление с тем же ключом ложится на родительское и остаётся на
|
|
5
|
+
* его месте, остальные встают следом. `Map.set` позицию ключа не меняет, и
|
|
6
|
+
* порядок объявлений публичен — его хранят сгенерированные метаданные Angular.
|
|
7
|
+
*
|
|
8
|
+
* Что значит «поверх», решает само объявление (`IDeclaration.inheritFrom`), а
|
|
9
|
+
* не эта функция: проп переобъявляет написанные факты, плагин встаёт
|
|
10
|
+
* целиком. Поэтому здесь нет ни ветки на категорию, ни функции извлечения
|
|
11
|
+
* ключа, а новая категория объявлений приносит своё правило с собой. Слоты
|
|
12
|
+
* сюда не ходят: они описывают разметку, а она не наследуется
|
|
13
|
+
* (`TComponentDescriptor`).
|
|
14
|
+
*
|
|
15
|
+
* Двух объявлений с одним ключом на выходе не бывает — по ключу их ровно одно.
|
|
16
|
+
* Столкновение разных источников (проп компонента и проп плагина) этим не
|
|
17
|
+
* прячется: у них разные списки, и сводит их дескриптор (`getProps`), сообщая
|
|
18
|
+
* о дубле.
|
|
19
|
+
*/
|
|
20
|
+
import type { IDeclaration } from './types';
|
|
21
|
+
export declare function inheritDeclarations<T extends IDeclaration<T>>(parent: readonly T[], own: readonly T[]): T[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region protected/define/inherit.ts
|
|
2
|
+
function inheritDeclarations(parent, own) {
|
|
3
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
4
|
+
for (const declaration of [...parent, ...own]) {
|
|
5
|
+
const base = byKey.get(declaration.key);
|
|
6
|
+
byKey.set(declaration.key, base ? declaration.inheritFrom(base) : declaration);
|
|
7
|
+
}
|
|
8
|
+
return [...byKey.values()];
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { inheritDeclarations };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TName — квалифицированное имя пропа или события: сырое имя и необязательный неймспейс плагина.
|
|
3
|
+
*
|
|
4
|
+
* - `name` — так к свойству и событию обращаются у владельца (`owner[name]`,
|
|
5
|
+
* `events.on(name)`);
|
|
6
|
+
* - `namespace` — чей это проп: у плагина он есть, у компонента нет;
|
|
7
|
+
* - `getName()` — полное имя (`aria:label`), уникальное в составе компонента.
|
|
8
|
+
*
|
|
9
|
+
* Имя во фреймворке из него строит стратегия адаптера (`INamingStrategy`).
|
|
10
|
+
*
|
|
11
|
+
* Полное имя склеивается один раз, в конструкторе. Имя создаётся на объявление
|
|
12
|
+
* и живёт, пока жив тип, а полное имя читают на каждом монтировании: по нему
|
|
13
|
+
* обмен раскладывает события по участникам.
|
|
14
|
+
*/
|
|
15
|
+
export declare class TName {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly namespace?: string | undefined;
|
|
18
|
+
private readonly _fullName;
|
|
19
|
+
constructor(name: string, namespace?: string | undefined);
|
|
20
|
+
getName(): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region protected/define/name.class.ts
|
|
2
|
+
/**
|
|
3
|
+
* TName — квалифицированное имя пропа или события: сырое имя и необязательный неймспейс плагина.
|
|
4
|
+
*
|
|
5
|
+
* - `name` — так к свойству и событию обращаются у владельца (`owner[name]`,
|
|
6
|
+
* `events.on(name)`);
|
|
7
|
+
* - `namespace` — чей это проп: у плагина он есть, у компонента нет;
|
|
8
|
+
* - `getName()` — полное имя (`aria:label`), уникальное в составе компонента.
|
|
9
|
+
*
|
|
10
|
+
* Имя во фреймворке из него строит стратегия адаптера (`INamingStrategy`).
|
|
11
|
+
*
|
|
12
|
+
* Полное имя склеивается один раз, в конструкторе. Имя создаётся на объявление
|
|
13
|
+
* и живёт, пока жив тип, а полное имя читают на каждом монтировании: по нему
|
|
14
|
+
* обмен раскладывает события по участникам.
|
|
15
|
+
*/
|
|
16
|
+
var TName = class {
|
|
17
|
+
name;
|
|
18
|
+
namespace;
|
|
19
|
+
_fullName;
|
|
20
|
+
constructor(name, namespace) {
|
|
21
|
+
this.name = name;
|
|
22
|
+
this.namespace = namespace;
|
|
23
|
+
this._fullName = namespace ? `${namespace}:${name}` : name;
|
|
24
|
+
Object.freeze(this);
|
|
25
|
+
}
|
|
26
|
+
getName() {
|
|
27
|
+
return this._fullName;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { TName };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TPluginDefinition — определение плагина: контракт класса и опции того места, где плагин поставили.
|
|
3
|
+
*
|
|
4
|
+
* Контракт один на класс плагина: пропсы, события и неймспейс объявляет
|
|
5
|
+
* `definePlugin`, один раз, константой модуля. Опции — свойство использования:
|
|
6
|
+
* `with(options)` отдаёт то же определение с опциями, а исходное не трогает —
|
|
7
|
+
* его делят все дескрипторы, которые плагин ставят.
|
|
8
|
+
*
|
|
9
|
+
* Умолчание пропа плагина — значение, с которым плагин стартует: заданная
|
|
10
|
+
* опция, иначе `defaultValues` класса. Опция впереди: плагин стартует с неё, и
|
|
11
|
+
* отдай адаптеру умолчание класса — Vue при монтировании перетёр бы им опцию
|
|
12
|
+
* автора дескриптора. Опция считается заданной, если она не `undefined`: так
|
|
13
|
+
* её читает сам плагин (`options?.flip ?? …`). У `defaultValues` значим ключ —
|
|
14
|
+
* см. `TPropSpec`.
|
|
15
|
+
*/
|
|
16
|
+
import type { TName } from './name.class';
|
|
17
|
+
import type { TPropSpec } from './prop-spec.class';
|
|
18
|
+
import type { IPluginContract, IPluginDefinition, TPluginCtor } from './types';
|
|
19
|
+
export declare class TPluginDefinition<C extends IPluginContract> implements IPluginDefinition<C> {
|
|
20
|
+
readonly ctor: TPluginCtor;
|
|
21
|
+
readonly namespace: string | undefined;
|
|
22
|
+
private readonly _specs;
|
|
23
|
+
readonly events: readonly TName[];
|
|
24
|
+
readonly options?: object | undefined;
|
|
25
|
+
readonly __contract?: C;
|
|
26
|
+
readonly props: readonly TPropSpec[];
|
|
27
|
+
/**
|
|
28
|
+
* @param _specs пропсы contribution без умолчаний: умолчание зависит от опций
|
|
29
|
+
*/
|
|
30
|
+
constructor(ctor: TPluginCtor, namespace: string | undefined, _specs: readonly TPropSpec[], events: readonly TName[], options?: object | undefined);
|
|
31
|
+
/** Ключ наследования — класс плагина: дважды один класс компоненту не ставят. */
|
|
32
|
+
get key(): TPluginCtor;
|
|
33
|
+
/**
|
|
34
|
+
* Родительское определение не читается: определение наследника заменяет его
|
|
35
|
+
* целиком. Опции — свойство места установки, а не накопленная сумма: у
|
|
36
|
+
* `DismissPluginDescriptor.with({ focusOutside: true })` наследник объявляет
|
|
37
|
+
* их заново, и наполовину родительских опций не бывает.
|
|
38
|
+
*/
|
|
39
|
+
inheritFrom(): IPluginDefinition<C>;
|
|
40
|
+
/** Полный список пропсов — как у дескриптора: определение плагина тоже источник поверхности. */
|
|
41
|
+
getProps(): readonly TPropSpec[];
|
|
42
|
+
getEvents(): readonly TName[];
|
|
43
|
+
with(options: C['options']): IPluginDefinition<C>;
|
|
44
|
+
private _withDefault;
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region protected/define/plugin-definition.class.ts
|
|
2
|
+
var TPluginDefinition = class TPluginDefinition {
|
|
3
|
+
ctor;
|
|
4
|
+
namespace;
|
|
5
|
+
_specs;
|
|
6
|
+
events;
|
|
7
|
+
options;
|
|
8
|
+
props;
|
|
9
|
+
/**
|
|
10
|
+
* @param _specs пропсы contribution без умолчаний: умолчание зависит от опций
|
|
11
|
+
*/
|
|
12
|
+
constructor(ctor, namespace, _specs, events, options) {
|
|
13
|
+
this.ctor = ctor;
|
|
14
|
+
this.namespace = namespace;
|
|
15
|
+
this._specs = _specs;
|
|
16
|
+
this.events = events;
|
|
17
|
+
this.options = options;
|
|
18
|
+
this.props = Object.freeze(_specs.map((spec) => this._withDefault(spec)));
|
|
19
|
+
}
|
|
20
|
+
/** Ключ наследования — класс плагина: дважды один класс компоненту не ставят. */
|
|
21
|
+
get key() {
|
|
22
|
+
return this.ctor;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Родительское определение не читается: определение наследника заменяет его
|
|
26
|
+
* целиком. Опции — свойство места установки, а не накопленная сумма: у
|
|
27
|
+
* `DismissPluginDescriptor.with({ focusOutside: true })` наследник объявляет
|
|
28
|
+
* их заново, и наполовину родительских опций не бывает.
|
|
29
|
+
*/
|
|
30
|
+
inheritFrom() {
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
/** Полный список пропсов — как у дескриптора: определение плагина тоже источник поверхности. */
|
|
34
|
+
getProps() {
|
|
35
|
+
return this.props;
|
|
36
|
+
}
|
|
37
|
+
getEvents() {
|
|
38
|
+
return this.events;
|
|
39
|
+
}
|
|
40
|
+
with(options) {
|
|
41
|
+
return new TPluginDefinition(this.ctor, this.namespace, this._specs, this.events, options);
|
|
42
|
+
}
|
|
43
|
+
_withDefault(spec) {
|
|
44
|
+
const option = this.options ? Reflect.get(this.options, spec.name.name) : void 0;
|
|
45
|
+
return option === void 0 ? spec.rebase(this.ctor.defaultValues) : spec.withDefault(option);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { TPluginDefinition };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* definePlugin infers and registers a plugin contract from its class and contribution.
|
|
3
|
+
* Public events come only from explicit `events`; property triggers refresh state and models.
|
|
4
|
+
*/
|
|
5
|
+
import type { IContribution } from './contribution.types';
|
|
6
|
+
import type { TPluginContractFrom } from './inference.types';
|
|
7
|
+
import type { IPluginDefinition, TPluginCtor } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Параметры типа выводятся из опций, явно их не передают. Неймспейс и
|
|
10
|
+
* contribution — `const`: из их литералов складываются имена в контракте.
|
|
11
|
+
*/
|
|
12
|
+
export declare function definePlugin<TCtor extends TPluginCtor, const N extends string | undefined = undefined, const TContribution extends IContribution = IContribution>(options: {
|
|
13
|
+
ctor: TCtor;
|
|
14
|
+
namespace?: N;
|
|
15
|
+
contribution?: TContribution;
|
|
16
|
+
}): IPluginDefinition<TPluginContractFrom<InstanceType<TCtor>, N, TContribution>>;
|
|
17
|
+
/** Контракт плагина — его объявление `definePlugin`; нет — пропсов и событий у плагина нет. */
|
|
18
|
+
export declare function pluginContractOf(ctor: TPluginCtor): IPluginDefinition | undefined;
|