@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
|
+
import { normalizeContribution } from "./contribution.js";
|
|
2
|
+
import { TPluginDefinition } from "./plugin-definition.class.js";
|
|
3
|
+
//#region protected/define/plugin.ts
|
|
4
|
+
var contracts = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
/**
|
|
6
|
+
* Параметры типа выводятся из опций, явно их не передают. Неймспейс и
|
|
7
|
+
* contribution — `const`: из их литералов складываются имена в контракте.
|
|
8
|
+
*/
|
|
9
|
+
function definePlugin(options) {
|
|
10
|
+
const { props, events } = normalizeContribution(options.contribution, options.namespace);
|
|
11
|
+
const definition = new TPluginDefinition(options.ctor, options.namespace, props, events);
|
|
12
|
+
contracts.set(options.ctor, definition);
|
|
13
|
+
return definition;
|
|
14
|
+
}
|
|
15
|
+
/** Контракт плагина — его объявление `definePlugin`; нет — пропсов и событий у плагина нет. */
|
|
16
|
+
function pluginContractOf(ctor) {
|
|
17
|
+
return contracts.get(ctor);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { definePlugin, pluginContractOf };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TPropSpec — неизменяемое описание свойства: одна запись на тип, которую делят все монтирования.
|
|
3
|
+
*
|
|
4
|
+
* Приспособленец (Flyweight): в описании нет ни владельца, ни памяти — только
|
|
5
|
+
* то, что верно для типа. Но оно не анемично: как прочитать и как записать
|
|
6
|
+
* свойство у владельца, знает само описание, поэтому `get`/`set` объявления
|
|
7
|
+
* больше нигде не разбираются. Владельца к описанию приставляет линия обмена
|
|
8
|
+
* (`TLine`) на время монтирования.
|
|
9
|
+
*
|
|
10
|
+
* **Умолчание: значим ключ, а не значение.** Поля `default` у описания нет
|
|
11
|
+
* вовсе, пока умолчание не объявлено; `closable: undefined` у `TTabsItem` —
|
|
12
|
+
* это «объявлено и равно `undefined`» («как у владельца»). Проверка
|
|
13
|
+
* `default !== undefined` сломала бы этот случай молча, поэтому спрашивают
|
|
14
|
+
* `hasDefault` (или `Object.hasOwn(spec, 'default')` — так читает стенд).
|
|
15
|
+
*
|
|
16
|
+
* Умолчание принадлежит классу владельца, а не объявлению, поэтому наследник
|
|
17
|
+
* дескриптора и `with()` плагина получают своё описание — `rebase` и
|
|
18
|
+
* `withDefault` возвращают новый объект, исходный не меняется: его делят
|
|
19
|
+
* родитель и все, кто от него наследуется.
|
|
20
|
+
*
|
|
21
|
+
* По той же разнице «ключ есть / ключа нет» описание переобъявляется:
|
|
22
|
+
* `inheritFrom` кладёт объявление наследника на родительское, и написанные
|
|
23
|
+
* факты побеждают, а ненаписанные остаются родительскими. Это правило самого
|
|
24
|
+
* описания — общий контракт наследования (`IDeclaration`) у него с
|
|
25
|
+
* определением плагина, а складывает списки `inheritDeclarations`.
|
|
26
|
+
*/
|
|
27
|
+
import type { IPropDefinition } from './contribution.types';
|
|
28
|
+
import type { TName } from './name.class';
|
|
29
|
+
import type { IDeclaration } from './types';
|
|
30
|
+
export declare class TPropSpec implements IDeclaration<TPropSpec> {
|
|
31
|
+
readonly name: TName;
|
|
32
|
+
readonly triggers: readonly TName[];
|
|
33
|
+
private readonly _definition;
|
|
34
|
+
readonly type: unknown;
|
|
35
|
+
readonly protected: boolean;
|
|
36
|
+
/** Ключ есть, только если умолчание объявлено. */
|
|
37
|
+
readonly default?: unknown;
|
|
38
|
+
/**
|
|
39
|
+
* @param _definition объявление из contribution: из него берутся `get` и `set`
|
|
40
|
+
* @param defaults умолчания класса владельца; нет ключа с именем пропа — нет и умолчания
|
|
41
|
+
*/
|
|
42
|
+
constructor(name: TName, triggers: readonly TName[], _definition: IPropDefinition, defaults?: Readonly<Record<string, unknown>>);
|
|
43
|
+
get hasDefault(): boolean;
|
|
44
|
+
/** Ключ наследования — полное имя: по нему свойство находят и во фреймворке, и в ядре. */
|
|
45
|
+
get key(): string;
|
|
46
|
+
/** Свои `get`/`set` объявления — для интроспекции; читать и писать надо через `read`/`assign`. */
|
|
47
|
+
get get(): IPropDefinition['get'];
|
|
48
|
+
get set(): IPropDefinition['set'];
|
|
49
|
+
/** Прочитать у владельца: `get` объявления, а без него `owner[name]`; составное — снимком. */
|
|
50
|
+
read(owner: object): unknown;
|
|
51
|
+
/** Записать владельцу: `set` объявления, а без него сеттер `owner[name]`. */
|
|
52
|
+
assign(owner: object, value: unknown): void;
|
|
53
|
+
/** То же описание с умолчанием от другого класса: наследник пересчитывает, а не копирует. */
|
|
54
|
+
rebase(defaults: Readonly<Record<string, unknown>> | undefined): TPropSpec;
|
|
55
|
+
/**
|
|
56
|
+
* Своё описание поверх одноимённого родительского: переобъявлены ровно те
|
|
57
|
+
* факты, которые автор написал, остальные — родительские.
|
|
58
|
+
*
|
|
59
|
+
* Значим ключ объявления, а не значение, как у умолчания: `protected: true`
|
|
60
|
+
* у элемента коллекции снимает вход, а `type` и `triggers` остаются
|
|
61
|
+
* объявленными один раз, у того, кто проп завёл. Ключ `protected: false`
|
|
62
|
+
* поэтому тоже переобъявление — им наследник возвращает вход.
|
|
63
|
+
*
|
|
64
|
+
* Новое описание, исходные не меняются: родительское делят все наследники.
|
|
65
|
+
* Умолчание не переносится — его пересчитывает `rebase` от итогового класса.
|
|
66
|
+
*/
|
|
67
|
+
inheritFrom(base: TPropSpec): TPropSpec;
|
|
68
|
+
/** То же описание с заданным умолчанием: опция `with()` плагина идёт впереди умолчания класса. */
|
|
69
|
+
withDefault(value: unknown): TPropSpec;
|
|
70
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//#region protected/define/prop-spec.class.ts
|
|
2
|
+
/** Составное значение пересекает границу снимком: свой `valueOf()` даёт новый простой объект. */
|
|
3
|
+
function snapshotOf(value) {
|
|
4
|
+
if (typeof value !== "object" || value === null) return value;
|
|
5
|
+
return value.valueOf === Object.prototype.valueOf ? value : value.valueOf();
|
|
6
|
+
}
|
|
7
|
+
var TPropSpec = class TPropSpec {
|
|
8
|
+
name;
|
|
9
|
+
triggers;
|
|
10
|
+
_definition;
|
|
11
|
+
type;
|
|
12
|
+
protected;
|
|
13
|
+
/**
|
|
14
|
+
* @param _definition объявление из contribution: из него берутся `get` и `set`
|
|
15
|
+
* @param defaults умолчания класса владельца; нет ключа с именем пропа — нет и умолчания
|
|
16
|
+
*/
|
|
17
|
+
constructor(name, triggers, _definition, defaults) {
|
|
18
|
+
this.name = name;
|
|
19
|
+
this.triggers = triggers;
|
|
20
|
+
this._definition = _definition;
|
|
21
|
+
this.type = _definition.type;
|
|
22
|
+
this.protected = !!_definition.protected;
|
|
23
|
+
if (defaults && Object.hasOwn(defaults, name.name)) this.default = defaults[name.name];
|
|
24
|
+
Object.freeze(this);
|
|
25
|
+
}
|
|
26
|
+
get hasDefault() {
|
|
27
|
+
return Object.hasOwn(this, "default");
|
|
28
|
+
}
|
|
29
|
+
/** Ключ наследования — полное имя: по нему свойство находят и во фреймворке, и в ядре. */
|
|
30
|
+
get key() {
|
|
31
|
+
return this.name.getName();
|
|
32
|
+
}
|
|
33
|
+
/** Свои `get`/`set` объявления — для интроспекции; читать и писать надо через `read`/`assign`. */
|
|
34
|
+
get get() {
|
|
35
|
+
return this._definition.get;
|
|
36
|
+
}
|
|
37
|
+
get set() {
|
|
38
|
+
return this._definition.set;
|
|
39
|
+
}
|
|
40
|
+
/** Прочитать у владельца: `get` объявления, а без него `owner[name]`; составное — снимком. */
|
|
41
|
+
read(owner) {
|
|
42
|
+
const { get } = this._definition;
|
|
43
|
+
return snapshotOf(get ? get(owner) : Reflect.get(owner, this.name.name));
|
|
44
|
+
}
|
|
45
|
+
/** Записать владельцу: `set` объявления, а без него сеттер `owner[name]`. */
|
|
46
|
+
assign(owner, value) {
|
|
47
|
+
const { set } = this._definition;
|
|
48
|
+
if (set) set(owner, value);
|
|
49
|
+
else Reflect.set(owner, this.name.name, value);
|
|
50
|
+
}
|
|
51
|
+
/** То же описание с умолчанием от другого класса: наследник пересчитывает, а не копирует. */
|
|
52
|
+
rebase(defaults) {
|
|
53
|
+
return new TPropSpec(this.name, this.triggers, this._definition, defaults);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Своё описание поверх одноимённого родительского: переобъявлены ровно те
|
|
57
|
+
* факты, которые автор написал, остальные — родительские.
|
|
58
|
+
*
|
|
59
|
+
* Значим ключ объявления, а не значение, как у умолчания: `protected: true`
|
|
60
|
+
* у элемента коллекции снимает вход, а `type` и `triggers` остаются
|
|
61
|
+
* объявленными один раз, у того, кто проп завёл. Ключ `protected: false`
|
|
62
|
+
* поэтому тоже переобъявление — им наследник возвращает вход.
|
|
63
|
+
*
|
|
64
|
+
* Новое описание, исходные не меняются: родительское делят все наследники.
|
|
65
|
+
* Умолчание не переносится — его пересчитывает `rebase` от итогового класса.
|
|
66
|
+
*/
|
|
67
|
+
inheritFrom(base) {
|
|
68
|
+
return new TPropSpec(this.name, Object.hasOwn(this._definition, "triggers") ? this.triggers : base.triggers, {
|
|
69
|
+
...base._definition,
|
|
70
|
+
...this._definition
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** То же описание с заданным умолчанием: опция `with()` плагина идёт впереди умолчания класса. */
|
|
74
|
+
withDefault(value) {
|
|
75
|
+
return new TPropSpec(this.name, this.triggers, this._definition, { [this.name.name]: value });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { TPropSpec };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defineType — значение scope слота: конструктор для рантайма, `T` — тип данных слота.
|
|
3
|
+
*
|
|
4
|
+
* default: { scope: { text: defineType<string>(String) } }
|
|
5
|
+
*
|
|
6
|
+
* Из `T` выводится scope слота (`DescriptorSlots`), значение без него не
|
|
7
|
+
* компилируется. У пропа второй записи типа нет: тип значения даёт интерфейс
|
|
8
|
+
* пропсов ядра (`TProps` класса `ctor`), а `type` в contribution — голый
|
|
9
|
+
* конструктор для рантайма (`type: String`).
|
|
10
|
+
*/
|
|
11
|
+
import type { TPropType } from './types';
|
|
12
|
+
export declare function defineType<T>(ctor: unknown): TPropType<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TSlotDeclaration — объявление слота: имя, scope и строка документации.
|
|
3
|
+
*
|
|
4
|
+
* Третья категория контракта рядом с пропсами и событиями: имя вынесено из
|
|
5
|
+
* ключа словаря `slots`, как у пропа. В отличие от пропа и плагина, слот не
|
|
6
|
+
* наследуется: он описывает разметку компонента, а не экземпляр ядра, и
|
|
7
|
+
* дескриптор держит только свои слоты (`TComponentDescriptor`). Поэтому
|
|
8
|
+
* контракта наследования (`IDeclaration`) у слота нет — класть его поверх
|
|
9
|
+
* родительского некуда.
|
|
10
|
+
*
|
|
11
|
+
* Неизменяемо и заморожено: объявление строится один раз на тип, и его делят
|
|
12
|
+
* все монтирования.
|
|
13
|
+
*/
|
|
14
|
+
import type { ISlotDeclaration } from './contribution.types';
|
|
15
|
+
export declare class TSlotDeclaration implements ISlotDeclaration {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly scope?: Record<string, unknown> | undefined;
|
|
18
|
+
readonly description?: string | undefined;
|
|
19
|
+
constructor(name: string, scope?: Record<string, unknown> | undefined, description?: string | undefined);
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region protected/define/slot-declaration.class.ts
|
|
2
|
+
var TSlotDeclaration = class {
|
|
3
|
+
name;
|
|
4
|
+
scope;
|
|
5
|
+
description;
|
|
6
|
+
constructor(name, scope, description) {
|
|
7
|
+
this.name = name;
|
|
8
|
+
this.scope = scope;
|
|
9
|
+
this.description = description;
|
|
10
|
+
Object.freeze(this);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { TSlotDeclaration };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Контракт дескриптора компонента и определения плагина.
|
|
3
|
+
*
|
|
4
|
+
* Дескриптор отдаёт декларации: props, events, slots и состав плагинов
|
|
5
|
+
* библиотеки. Собирает по ним компонент сборка (`assemble/`).
|
|
6
|
+
*
|
|
7
|
+
* Типы едут одним параметром — контрактом (`IComponentContract`,
|
|
8
|
+
* `IPluginContract`): что адаптеру нужно знать о компоненте в типах, лежит в
|
|
9
|
+
* нём по ключам. Новый факт — новый ключ, сигнатуры функций над дескриптором
|
|
10
|
+
* при этом не меняются.
|
|
11
|
+
*/
|
|
12
|
+
import type { IContribution, IPropDefinition, ISlotDefinition } from './contribution.types';
|
|
13
|
+
import type { TName } from './name.class';
|
|
14
|
+
import type { TPropSpec } from './prop-spec.class';
|
|
15
|
+
import type { TSlotDeclaration } from './slot-declaration.class';
|
|
16
|
+
import type { IPluginConstructor } from '@soxa-ui/plugins';
|
|
17
|
+
/**
|
|
18
|
+
* Конструктор инстанса компонента.
|
|
19
|
+
*
|
|
20
|
+
* Параметры стёрты: пропсы и опции приходят от фреймворка в рантайме, и сверять
|
|
21
|
+
* их здесь не с чем. Тип инстанса не стёрт — его дескриптор несёт дальше, в
|
|
22
|
+
* контракте (см. AGENTS.md, «`any`: где он честный»), и из него же выводятся
|
|
23
|
+
* типы пропсов и событий (`TInstanceProps`, `TInstanceEvents`).
|
|
24
|
+
*
|
|
25
|
+
* `defaultValues` — статика класса ядра (`TComponentView.defaultValues`): из неё
|
|
26
|
+
* `defineComponent` собирает умолчания пропов в декларации. Объявлена в типе,
|
|
27
|
+
* чтобы читать её без рефлексии; у класса без статики её просто нет.
|
|
28
|
+
*/
|
|
29
|
+
export type TComponentCtor<TInstance extends object = object> = (new (...args: any[]) => TInstance) & {
|
|
30
|
+
readonly defaultValues?: Readonly<Record<string, unknown>>;
|
|
31
|
+
};
|
|
32
|
+
/** Класс плагина. Параметры стёрты по той же причине, что у `TComponentCtor`. */
|
|
33
|
+
export type TPluginCtor = IPluginConstructor<any, any, any>;
|
|
34
|
+
/**
|
|
35
|
+
* Объявление, которое наследуется: проп и определение плагина.
|
|
36
|
+
*
|
|
37
|
+
* Наследование у обоих одно: своё объявление ложится на одноимённое
|
|
38
|
+
* родительское и остаётся на его месте (`inheritDeclarations`). Различается
|
|
39
|
+
* только смысл слова «поверх», и знает его само объявление, а не тот, кто
|
|
40
|
+
* складывает списки: проп переобъявляет написанные факты
|
|
41
|
+
* (`TPropSpec.inheritFrom`), плагин встаёт целиком — опции задаёт место
|
|
42
|
+
* установки.
|
|
43
|
+
*
|
|
44
|
+
* Поэтому у дескриптора нет ни ветки на категорию, ни функции извлечения
|
|
45
|
+
* ключа: новая категория объявлений приносит своё правило с собой. Слот
|
|
46
|
+
* такого контракта не имеет: он описывает разметку, а она не наследуется
|
|
47
|
+
* (`TComponentDescriptor`).
|
|
48
|
+
*/
|
|
49
|
+
export interface IDeclaration<T> {
|
|
50
|
+
/** Одно объявление на ключ: полное имя пропа, класс плагина. */
|
|
51
|
+
readonly key: unknown;
|
|
52
|
+
/** Своё поверх родительского. Результат — новое объявление; оба исходных не меняются. */
|
|
53
|
+
inheritFrom(base: T): T;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Что плагины добавляют компоненту в типах, уже под именами с неймспейсом:
|
|
57
|
+
* `aria_label`, `element:ready`, `layout_styles`. У одного плагина это часть
|
|
58
|
+
* его контракта, у компонента — сумма по всем плагинам дескриптора.
|
|
59
|
+
*/
|
|
60
|
+
export interface IPluginsContract {
|
|
61
|
+
/** Входы — незащищённые пропсы, их пишет потребитель. */
|
|
62
|
+
props: object;
|
|
63
|
+
/**
|
|
64
|
+
* Explicitly declared public plugin events.
|
|
65
|
+
*/
|
|
66
|
+
events: object;
|
|
67
|
+
/** Выходы — защищённые пропсы: их вычисляет плагин, разметка только читает. */
|
|
68
|
+
outputs: object;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Контракт плагина в типах. Выводит его `definePlugin` из класса плагина и его
|
|
72
|
+
* contribution; руками контракт не пишут.
|
|
73
|
+
*/
|
|
74
|
+
export interface IPluginContract extends IPluginsContract {
|
|
75
|
+
/** Опции установки — второй параметр `install()` класса плагина. */
|
|
76
|
+
options: object;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Определение плагина: его контракт и, в составе дескриптора, опции установки.
|
|
80
|
+
*
|
|
81
|
+
* Контракт — свойство класса плагина, и объявляют его один раз, константой.
|
|
82
|
+
* Опции — свойство места, где плагин поставили: дескриптор берёт определение
|
|
83
|
+
* как есть или с опциями — `DismissPluginDescriptor.with({ focusOutside: true })`.
|
|
84
|
+
*/
|
|
85
|
+
export interface IPluginDefinition<C extends IPluginContract = IPluginContract> extends IDeclaration<IPluginDefinition<C>> {
|
|
86
|
+
/** Фантомное поле: в рантайме его нет, оно только несёт контракт в типе. */
|
|
87
|
+
readonly __contract?: C;
|
|
88
|
+
readonly ctor: TPluginCtor;
|
|
89
|
+
/** Ключ наследования — класс плагина: дважды один класс компоненту не ставят. */
|
|
90
|
+
readonly key: TPluginCtor;
|
|
91
|
+
/** Нормализованные props из contribution, с умолчаниями. */
|
|
92
|
+
readonly props: readonly TPropSpec[];
|
|
93
|
+
/** Нормализованные events из contribution */
|
|
94
|
+
readonly events: readonly TName[];
|
|
95
|
+
/** Опции, передаваемые в plugin.install(ctx, options) */
|
|
96
|
+
readonly options?: object;
|
|
97
|
+
/** Namespace плагина. */
|
|
98
|
+
readonly namespace?: string;
|
|
99
|
+
/** Те же пропсы и события — в форме, общей с дескриптором: по ней строится поверхность. */
|
|
100
|
+
getProps(): readonly TPropSpec[];
|
|
101
|
+
getEvents(): readonly TName[];
|
|
102
|
+
/**
|
|
103
|
+
* То же определение с опциями установки. Исходное не меняется: его делят
|
|
104
|
+
* все дескрипторы, которые плагин ставят. Умолчания пропсов пересчитываются —
|
|
105
|
+
* заданная опция идёт впереди `defaultValues` класса.
|
|
106
|
+
*/
|
|
107
|
+
with(options: C['options']): IPluginDefinition<C>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Объявление слота в опциях `defineComponent`.
|
|
111
|
+
*
|
|
112
|
+
* Уже `ISlotDefinition` аксессора: там scope — любой словарь, рантайму нужен
|
|
113
|
+
* только состав ключей. Здесь значение scope — `defineType<T>`, и из него
|
|
114
|
+
* выводится тип данных слота (`DescriptorSlots`). Значение без типа (`String`)
|
|
115
|
+
* поэтому не компилируется, а не превращается в `unknown` в типах адаптеров.
|
|
116
|
+
*/
|
|
117
|
+
export interface IComponentSlotDefinition extends ISlotDefinition {
|
|
118
|
+
readonly scope?: Readonly<Record<string, TPropType<unknown>>>;
|
|
119
|
+
}
|
|
120
|
+
/** Слоты в опциях `defineComponent`: имя слота — ключ словаря, как у `slots` в `IContribution`. */
|
|
121
|
+
export type TSlotDefinitions = Readonly<Record<string, IComponentSlotDefinition>>;
|
|
122
|
+
/**
|
|
123
|
+
* Property triggers refresh state and models; they do not publish component events.
|
|
124
|
+
* Each trigger must name an event from the instance event map.
|
|
125
|
+
*/
|
|
126
|
+
export interface IComponentPropDefinition<TEventName extends string = string> extends IPropDefinition {
|
|
127
|
+
readonly triggers?: readonly TEventName[];
|
|
128
|
+
}
|
|
129
|
+
/** Contribution компонента: то же, что `IContribution`, но у слотов scope с типами. */
|
|
130
|
+
export interface IComponentContribution extends IContribution {
|
|
131
|
+
readonly props?: Readonly<Record<string, IComponentPropDefinition>>;
|
|
132
|
+
readonly slots?: TSlotDefinitions;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Component options infer the instance from `ctor` or `extends`, public event names
|
|
136
|
+
* from explicit `events`, own slots from `slots`, and plugin contracts from `plugins`.
|
|
137
|
+
*/
|
|
138
|
+
export interface IComponentOptions {
|
|
139
|
+
/** Конструктор core-компонента. Без него инстанс наследуется от `extends`. */
|
|
140
|
+
readonly ctor?: TComponentCtor;
|
|
141
|
+
/** Родительский дескриптор: наследуются props, events и plugins, слоты — нет */
|
|
142
|
+
readonly extends?: IComponentDescriptor;
|
|
143
|
+
/** Собственная контрибуция компонента */
|
|
144
|
+
readonly contribution?: IComponentContribution;
|
|
145
|
+
/** Плагины (каждый — результат definePlugin) */
|
|
146
|
+
readonly plugins?: readonly IPluginDefinition[];
|
|
147
|
+
}
|
|
148
|
+
/** Контекст сборки набора: что знает о компоненте тот, кто его собирает. */
|
|
149
|
+
export interface IBundleContext {
|
|
150
|
+
/** Имя места во вложенной разметке; нет — компонент поставил пользователь. */
|
|
151
|
+
embedded?: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Контракт компонента в типах — всё, что адаптер выводит из дескриптора.
|
|
155
|
+
*
|
|
156
|
+
* Здесь только то, чего не вывести из остального: пропсы и карта событий —
|
|
157
|
+
* свойства инстанса (`TInstanceProps`, `TInstanceEvents`), поэтому отдельных
|
|
158
|
+
* ключей у них нет. Руками контракт не пишут: его выводит `defineComponent`.
|
|
159
|
+
*/
|
|
160
|
+
export interface IComponentContract {
|
|
161
|
+
/** Инстанс, который строит `ctor`. */
|
|
162
|
+
instance: object;
|
|
163
|
+
/**
|
|
164
|
+
* Explicit event names declared here or inherited through `extends`.
|
|
165
|
+
* They narrow the instance event map, including declarations without their own class.
|
|
166
|
+
*/
|
|
167
|
+
eventName: string;
|
|
168
|
+
/**
|
|
169
|
+
* Имена защищённых пропсов — свои поверх `extends`, как и в рантайме:
|
|
170
|
+
* наследник переобъявляет унаследованный проп в обе стороны, поэтому
|
|
171
|
+
* `protected: true` имя сюда добавляет, а объявление без него — убирает.
|
|
172
|
+
* Из пропсов компонента эти имена вычитаются (`DescriptorProps`): значение
|
|
173
|
+
* вычисляет владелец, входа у разметки нет.
|
|
174
|
+
*/
|
|
175
|
+
protectedName: string;
|
|
176
|
+
/** Слоты, имя → scope: только свои, слоты `extends` сюда не входят. */
|
|
177
|
+
slots: object;
|
|
178
|
+
/** Сумма контрактов плагинов — своих и `extends`. */
|
|
179
|
+
plugins: IPluginsContract;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Дескриптор компонента — единственный источник истины.
|
|
183
|
+
*
|
|
184
|
+
* Контракт `C` — фантом: в рантайме его нет, но из него адаптеры выводят типы
|
|
185
|
+
* прямо из фабрики дескриптора (`DescriptorAllProps<typeof ButtonDescriptor>`
|
|
186
|
+
* → `IButtonProps & { aria_label?: … }`).
|
|
187
|
+
*/
|
|
188
|
+
export interface IComponentDescriptor<C extends IComponentContract = IComponentContract> {
|
|
189
|
+
/** Фантомное поле: в рантайме его нет, оно только несёт контракт в типе. */
|
|
190
|
+
readonly __contract?: C;
|
|
191
|
+
readonly ctor: TComponentCtor<C['instance']>;
|
|
192
|
+
/** Own component props (excluding plugin props). */
|
|
193
|
+
readonly props: readonly TPropSpec[];
|
|
194
|
+
/** Own component events (excluding plugin events). */
|
|
195
|
+
readonly events: readonly TName[];
|
|
196
|
+
/**
|
|
197
|
+
* Слоты — только свои: они описывают разметку, а она не наследуется (см.
|
|
198
|
+
* `TComponentDescriptor`). Плагины слотов не имеют, поэтому отдельного
|
|
199
|
+
* «полного» списка, как у пропсов и событий, у слотов нет.
|
|
200
|
+
*/
|
|
201
|
+
readonly slots: readonly TSlotDeclaration[];
|
|
202
|
+
readonly plugins: readonly IPluginDefinition[];
|
|
203
|
+
/** All props: own + all plugin props (flat). */
|
|
204
|
+
getProps(): readonly TPropSpec[];
|
|
205
|
+
/** All events: own + all plugin events (flat). */
|
|
206
|
+
getEvents(): readonly TName[];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Значение scope слота: конструктор для рантайма и фантомный `T` — тип данных,
|
|
210
|
+
* которые получает слот (из него `DescriptorSlots` выводит scope). Собирает его
|
|
211
|
+
* `defineType`.
|
|
212
|
+
*
|
|
213
|
+
* Имя осталось от пропсов, но у пропа такой записи нет: тип его значения даёт
|
|
214
|
+
* интерфейс пропсов ядра, а `type` декларации — голый конструктор.
|
|
215
|
+
*/
|
|
216
|
+
export type TPropType<T> = {
|
|
217
|
+
/**
|
|
218
|
+
* Фантомное поле: в рантайме его нет, оно только несёт `T` в типе.
|
|
219
|
+
* Необязательное, поэтому `defineType` собирает значение без приведения.
|
|
220
|
+
*/
|
|
221
|
+
readonly __type?: T;
|
|
222
|
+
/** JS-конструктор значения: `String`, `Object`, … Рантайму слота нужны лишь ключи scope. */
|
|
223
|
+
readonly ctor: unknown;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Scope слота, который ничего не передаёт внутрь.
|
|
227
|
+
*
|
|
228
|
+
* Именно `object`, а не `Record<string, never>`: адаптеры отличают слот без
|
|
229
|
+
* scope по `keyof S extends never` (см. TSnippetSlots в ui/svelte). У
|
|
230
|
+
* `Record<string, never>` есть индексная сигнатура, поэтому его `keyof` —
|
|
231
|
+
* это `string`, и проверка ломается: сниппет начинает требовать аргумент.
|
|
232
|
+
* У `object` же `keyof` пуст, как и у прежнего `{}`, но без его дыры,
|
|
233
|
+
* пропускавшей `0` и `""`.
|
|
234
|
+
*/
|
|
235
|
+
export type TEmptySlotScope = object;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommonProfile — общий формат имён, не принадлежащий ни одному фреймворку.
|
|
3
|
+
*
|
|
4
|
+
* Им говорит всё, что устроено одинаково во всех адаптерах: ключи мешка
|
|
5
|
+
* `pluginProps` (`timer_ms`), имя в конверте `plugin:event` (`timer:tick`) и
|
|
6
|
+
* начальные значения при сборке — имя пропа во всех фреймворках одно, поэтому
|
|
7
|
+
* сборке профиль адаптера не нужен.
|
|
8
|
+
*/
|
|
9
|
+
import type { IAdapterProfile } from './strategy.types';
|
|
10
|
+
export declare const CommonProfile: IAdapterProfile;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { underscorePropNaming } from "./naming.js";
|
|
2
|
+
//#region protected/naming/common-profile.ts
|
|
3
|
+
/**
|
|
4
|
+
* CommonProfile — общий формат имён, не принадлежащий ни одному фреймворку.
|
|
5
|
+
*
|
|
6
|
+
* Им говорит всё, что устроено одинаково во всех адаптерах: ключи мешка
|
|
7
|
+
* `pluginProps` (`timer_ms`), имя в конверте `plugin:event` (`timer:tick`) и
|
|
8
|
+
* начальные значения при сборке — имя пропа во всех фреймворках одно, поэтому
|
|
9
|
+
* сборке профиль адаптера не нужен.
|
|
10
|
+
*/
|
|
11
|
+
var CommonProfile = { naming: {
|
|
12
|
+
prop: underscorePropNaming,
|
|
13
|
+
event: (name) => name.getName()
|
|
14
|
+
} };
|
|
15
|
+
//#endregion
|
|
16
|
+
export { CommonProfile };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CommonProfile } from './common-profile';
|
|
2
|
+
export { underscorePropNaming, callbackEventNaming, PLUGIN_PROPS } from './naming';
|
|
3
|
+
export type { TCallbackEventName, TCallbackEventProps, TUnderscorePropName } from './naming.types';
|
|
4
|
+
export type { IAdapterProfile, INamingStrategy } from './strategy.types';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Общая часть стратегий именования, одинаковая во всех фреймворках.
|
|
3
|
+
*
|
|
4
|
+
* Различается только `event`: Vue сохраняет двоеточие (`element:ready`),
|
|
5
|
+
* React делает колбэк-проп (`onElementReady`), Angular — camelCase-аутпут с
|
|
6
|
+
* префиксом `so` (`soElementReady`), Web Components — имя ядра с префиксом
|
|
7
|
+
* `so:` (`so:element:ready`). Имя пропа же везде одно и то же, потому что
|
|
8
|
+
* публичный API компонентов должен читаться одинаково на всех фреймворках.
|
|
9
|
+
*/
|
|
10
|
+
import type { TName } from '../define/name.class';
|
|
11
|
+
/**
|
|
12
|
+
* `styles` @ ns `icon-styles` → `iconStyles_styles`; без namespace — как есть.
|
|
13
|
+
*
|
|
14
|
+
* Двоеточие в имени пропа недопустимо (это не валидный JS-идентификатор
|
|
15
|
+
* и не биндится в шаблонах), поэтому namespace склеивается через `_`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function underscorePropNaming(name: TName): string;
|
|
18
|
+
/**
|
|
19
|
+
* `element:ready` → `onElementReady`.
|
|
20
|
+
*
|
|
21
|
+
* Общая стратегия для фреймворков, где события — это колбэк-пропы: React,
|
|
22
|
+
* Svelte 5 и Solid. Колбэк строится из `TName.getName()`: своей копии формата
|
|
23
|
+
* `namespace:name` здесь нет. Тип-зеркало живёт в naming.types.ts и обязано
|
|
24
|
+
* меняться синхронно.
|
|
25
|
+
*/
|
|
26
|
+
export declare function callbackEventNaming(name: TName): string;
|
|
27
|
+
/**
|
|
28
|
+
* Проп со значениями для пропсов плагинов, поставленных снаружи:
|
|
29
|
+
* `{ timer_ms: 500 }`. Один на все компоненты и одинаковый во всех адаптерах —
|
|
30
|
+
* статический слой Vue, Angular и Web Components объявляет его заранее, а
|
|
31
|
+
* пропсы внешнего плагина узнаются только в рантайме.
|
|
32
|
+
*/
|
|
33
|
+
export declare const PLUGIN_PROPS = "pluginProps";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region protected/naming/naming.ts
|
|
2
|
+
/**
|
|
3
|
+
* `styles` @ ns `icon-styles` → `iconStyles_styles`; без namespace — как есть.
|
|
4
|
+
*
|
|
5
|
+
* Двоеточие в имени пропа недопустимо (это не валидный JS-идентификатор
|
|
6
|
+
* и не биндится в шаблонах), поэтому namespace склеивается через `_`.
|
|
7
|
+
*/
|
|
8
|
+
function underscorePropNaming(name) {
|
|
9
|
+
if (!name.namespace) return name.name;
|
|
10
|
+
return `${name.namespace.replace(/-(\w)/g, (_, char) => char.toUpperCase())}_${name.name}`;
|
|
11
|
+
}
|
|
12
|
+
function toPascalCase(input) {
|
|
13
|
+
return input.split(/[-:]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `element:ready` → `onElementReady`.
|
|
17
|
+
*
|
|
18
|
+
* Общая стратегия для фреймворков, где события — это колбэк-пропы: React,
|
|
19
|
+
* Svelte 5 и Solid. Колбэк строится из `TName.getName()`: своей копии формата
|
|
20
|
+
* `namespace:name` здесь нет. Тип-зеркало живёт в naming.types.ts и обязано
|
|
21
|
+
* меняться синхронно.
|
|
22
|
+
*/
|
|
23
|
+
function callbackEventNaming(name) {
|
|
24
|
+
return `on${toPascalCase(name.getName())}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Проп со значениями для пропсов плагинов, поставленных снаружи:
|
|
28
|
+
* `{ timer_ms: 500 }`. Один на все компоненты и одинаковый во всех адаптерах —
|
|
29
|
+
* статический слой Vue, Angular и Web Components объявляет его заранее, а
|
|
30
|
+
* пропсы внешнего плагина узнаются только в рантайме.
|
|
31
|
+
*/
|
|
32
|
+
var PLUGIN_PROPS = "pluginProps";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { PLUGIN_PROPS, callbackEventNaming, underscorePropNaming };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Тип-зеркало стратегии именования событий из naming.ts (`callbackEventNaming`).
|
|
3
|
+
*
|
|
4
|
+
* TypeScript не умеет применять рантайм-функции на уровне типов, поэтому логика
|
|
5
|
+
* продублирована условными типами. Оба определения обязаны меняться СИНХРОННО.
|
|
6
|
+
*
|
|
7
|
+
* Благодаря этому событийные пропы компонентов выводятся автоматически из
|
|
8
|
+
* дескрипторов, без ручного перечисления:
|
|
9
|
+
*
|
|
10
|
+
* TCallbackEventProps<DescriptorAllEvents<typeof ComponentViewDescriptor>>
|
|
11
|
+
* → { onShow?, onChangeVisible?, onElementReady?, ... }
|
|
12
|
+
*
|
|
13
|
+
* Используется React-, Svelte- и Solid-адаптерами: во всех трёх события —
|
|
14
|
+
* колбэк-пропы.
|
|
15
|
+
*/
|
|
16
|
+
/** Split<'show:before', '-' | ':'> → ['show', 'before'] */
|
|
17
|
+
type Split<S extends string, D extends string> = S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] : [S];
|
|
18
|
+
/** Join<['Show', 'Before'], ''> → 'ShowBefore' */
|
|
19
|
+
type Join<P extends string[], Sep extends string> = P extends [
|
|
20
|
+
infer F extends string,
|
|
21
|
+
...infer R extends string[]
|
|
22
|
+
] ? R extends [] ? F : `${F}${Sep}${Join<R, Sep>}` : '';
|
|
23
|
+
/** CapitalizeAll<['show', 'before']> → ['Show', 'Before'] */
|
|
24
|
+
type CapitalizeAll<T extends string[]> = T extends [
|
|
25
|
+
infer F extends string,
|
|
26
|
+
...infer R extends string[]
|
|
27
|
+
] ? [Capitalize<F>, ...CapitalizeAll<R>] : [];
|
|
28
|
+
/** ToPascalCase<'show:before'> → 'ShowBefore' */
|
|
29
|
+
type ToPascalCase<S extends string> = Join<CapitalizeAll<Split<S, '-' | ':'>>, ''>;
|
|
30
|
+
/** TCallbackEventName<'show:before'> → 'onShowBefore' */
|
|
31
|
+
export type TCallbackEventName<T extends string> = `on${ToPascalCase<T>}`;
|
|
32
|
+
/** TCallbackEventProps<DescriptorAllEvents<...>> → { onShow?: ..., onChangeVisible?: ... } */
|
|
33
|
+
export type TCallbackEventProps<T extends object> = {
|
|
34
|
+
[K in keyof T as K extends string ? TCallbackEventName<K> : never]?: T[K];
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Тип-зеркало стратегии именования пропов из naming.ts (`underscorePropNaming`).
|
|
38
|
+
*
|
|
39
|
+
* Как и выше, TypeScript не умеет применять рантайм-функцию на уровне типов —
|
|
40
|
+
* логика продублирована. Оба определения обязаны меняться СИНХРОННО.
|
|
41
|
+
*
|
|
42
|
+
* Используется `DescriptorAllProps` в `packages/setup/protected/define/inference.types.ts`
|
|
43
|
+
* для вывода пропов плагинов из их `namespace` (`aria` + `label` → `aria_label`).
|
|
44
|
+
*/
|
|
45
|
+
/** CamelCaseNamespace<'input-bool'> → 'inputBool' */
|
|
46
|
+
type CamelCaseNamespace<S extends string> = S extends `${infer Head}-${infer Rest}` ? `${Head}${CamelCaseNamespace<Capitalize<Rest>>}` : S;
|
|
47
|
+
/** TUnderscorePropName<'aria', 'label'> → 'aria_label'; TUnderscorePropName<undefined, 'text'> → 'text' */
|
|
48
|
+
export type TUnderscorePropName<N extends string | undefined, K extends string> = N extends string ? `${CamelCaseNamespace<N>}_${K}` : K;
|
|
49
|
+
export {};
|