@soxa-ui/webc 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 +622 -2
- package/dist/adapter/common/attributes.d.ts +22 -0
- package/dist/adapter/common/attributes.js +74 -0
- package/dist/adapter/common/createWebcAdapterContext.d.ts +8 -0
- package/dist/adapter/common/createWebcAdapterContext.js +17 -0
- package/dist/adapter/common/icon.d.ts +9 -0
- package/dist/adapter/common/icon.js +25 -0
- package/dist/adapter/common/index.d.ts +5 -0
- package/dist/adapter/common/index.js +6 -0
- package/dist/adapter/common/naming.d.ts +7 -0
- package/dist/adapter/common/naming.js +9 -0
- package/dist/adapter/common/profile.d.ts +3 -0
- package/dist/adapter/common/profile.js +6 -0
- package/dist/adapter/context/index.d.ts +1 -0
- package/dist/adapter/context/place-context.class.d.ts +22 -0
- package/dist/adapter/context/place-context.class.js +40 -0
- package/dist/adapter/elevator/elevator.class.d.ts +13 -0
- package/dist/adapter/elevator/elevator.class.js +34 -0
- package/dist/adapter/elevator/factory.d.ts +3 -0
- package/dist/adapter/elevator/factory.js +8 -0
- package/dist/adapter/elevator/index.d.ts +2 -0
- package/dist/adapter/elevator/index.js +2 -0
- package/dist/adapter/index.d.ts +5 -0
- package/dist/adapter/index.js +21 -0
- package/dist/adapter/locale/LocaleProvider.element.d.ts +26 -0
- package/dist/adapter/locale/LocaleProvider.element.js +51 -0
- package/dist/adapter/locale/context.d.ts +4 -0
- package/dist/adapter/locale/context.js +12 -0
- package/dist/adapter/locale/index.d.ts +2 -0
- package/dist/adapter/locale/index.js +1 -0
- package/dist/adapter/runtime/content.d.ts +6 -0
- package/dist/adapter/runtime/content.js +13 -0
- package/dist/adapter/runtime/deferral.d.ts +22 -0
- package/dist/adapter/runtime/deferral.js +100 -0
- package/dist/adapter/runtime/defineElement.d.ts +23 -0
- package/dist/adapter/runtime/defineElement.js +97 -0
- package/dist/adapter/runtime/display-contents.d.ts +5 -0
- package/dist/adapter/runtime/display-contents.js +14 -0
- package/dist/adapter/runtime/element.base.d.ts +84 -0
- package/dist/adapter/runtime/element.base.js +347 -0
- package/dist/adapter/runtime/index.d.ts +4 -0
- package/dist/adapter/runtime/index.js +4 -0
- package/dist/adapter/runtime/light.d.ts +33 -0
- package/dist/adapter/runtime/light.js +131 -0
- package/dist/adapter/runtime/marks.d.ts +19 -0
- package/dist/adapter/runtime/marks.js +46 -0
- package/dist/adapter/runtime/paint.d.ts +91 -0
- package/dist/adapter/runtime/paint.js +208 -0
- package/dist/adapter/runtime/props.d.ts +36 -0
- package/dist/adapter/runtime/props.js +58 -0
- package/dist/adapter/runtime/relocation.d.ts +16 -0
- package/dist/adapter/runtime/relocation.js +58 -0
- package/dist/adapter/runtime/root.d.ts +77 -0
- package/dist/adapter/runtime/root.js +77 -0
- package/dist/adapter/runtime/subtree.d.ts +22 -0
- package/dist/adapter/runtime/subtree.js +44 -0
- package/dist/adapter/runtime/teleport.d.ts +57 -0
- package/dist/adapter/runtime/teleport.js +190 -0
- package/dist/adapter/runtime/useAdapter.d.ts +45 -0
- package/dist/adapter/runtime/useAdapter.js +151 -0
- package/dist/adapter/runtime/waiting.d.ts +10 -0
- package/dist/adapter/runtime/waiting.js +53 -0
- package/dist/adapter/template/index.d.ts +6 -0
- package/dist/adapter/template/index.js +6 -0
- package/dist/adapter/template/lend.d.ts +13 -0
- package/dist/adapter/template/lend.js +30 -0
- package/dist/adapter/template/loop.d.ts +21 -0
- package/dist/adapter/template/loop.js +59 -0
- package/dist/adapter/template/owner.d.ts +13 -0
- package/dist/adapter/template/owner.js +15 -0
- package/dist/adapter/template/parts.d.ts +37 -0
- package/dist/adapter/template/parts.js +61 -0
- package/dist/adapter/template/types.d.ts +69 -0
- package/dist/adapter/template/types.js +9 -0
- package/dist/adapter/toasts/index.d.ts +1 -0
- package/dist/adapter/toasts/index.js +1 -0
- package/dist/adapter/toasts/toastsOf.d.ts +12 -0
- package/dist/adapter/toasts/toastsOf.js +21 -0
- package/dist/components/accordion/Accordion.element.d.ts +9 -0
- package/dist/components/accordion/Accordion.element.js +27 -0
- package/dist/components/accordion/accordion.template.d.ts +10 -0
- package/dist/components/accordion/accordion.template.js +44 -0
- package/dist/components/accordion/index.d.ts +5 -0
- package/dist/components/accordion/index.js +3 -0
- package/dist/components/accordion/item/AccordionItem.element.d.ts +10 -0
- package/dist/components/accordion/item/AccordionItem.element.js +25 -0
- package/dist/components/accordion/item/accordion-item.template.d.ts +8 -0
- package/dist/components/accordion/item/accordion-item.template.js +123 -0
- package/dist/components/accordion/item/index.d.ts +3 -0
- package/dist/components/accordion/item/index.js +3 -0
- package/dist/components/accordion/item/setup.component.d.ts +3 -0
- package/dist/components/accordion/item/setup.component.js +22 -0
- package/dist/components/accordion/setup.component.d.ts +3 -0
- package/dist/components/accordion/setup.component.js +26 -0
- package/dist/components/button/Button.element.d.ts +12 -0
- package/dist/components/button/Button.element.js +22 -0
- package/dist/components/button/button.template.d.ts +8 -0
- package/dist/components/button/button.template.js +30 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/setup.component.d.ts +3 -0
- package/dist/components/button/setup.component.js +14 -0
- package/dist/components/calendar/Calendar.element.d.ts +9 -0
- package/dist/components/calendar/Calendar.element.js +23 -0
- package/dist/components/calendar/calendar.template.d.ts +10 -0
- package/dist/components/calendar/calendar.template.js +309 -0
- package/dist/components/calendar/index.d.ts +5 -0
- package/dist/components/calendar/index.js +3 -0
- package/dist/components/calendar/item/CalendarItem.element.d.ts +10 -0
- package/dist/components/calendar/item/CalendarItem.element.js +19 -0
- package/dist/components/calendar/item/calendar-item.template.d.ts +7 -0
- package/dist/components/calendar/item/calendar-item.template.js +22 -0
- package/dist/components/calendar/item/index.d.ts +3 -0
- package/dist/components/calendar/item/index.js +3 -0
- package/dist/components/calendar/item/setup.component.d.ts +3 -0
- package/dist/components/calendar/item/setup.component.js +22 -0
- package/dist/components/calendar/setup.component.d.ts +3 -0
- package/dist/components/calendar/setup.component.js +25 -0
- package/dist/components/check-box/CheckBox.element.d.ts +9 -0
- package/dist/components/check-box/CheckBox.element.js +24 -0
- package/dist/components/check-box/check-box.template.d.ts +10 -0
- package/dist/components/check-box/check-box.template.js +94 -0
- package/dist/components/check-box/index.d.ts +3 -0
- package/dist/components/check-box/index.js +1 -0
- package/dist/components/check-box/setup.component.d.ts +7 -0
- package/dist/components/check-box/setup.component.js +16 -0
- package/dist/components/common/clear.d.ts +34 -0
- package/dist/components/common/clear.js +67 -0
- package/dist/components/common/drawn-rows.d.ts +35 -0
- package/dist/components/common/drawn-rows.js +79 -0
- package/dist/components/common/icon-button.d.ts +24 -0
- package/dist/components/common/icon-button.js +42 -0
- package/dist/components/component/index.d.ts +1 -0
- package/dist/components/component/index.js +1 -0
- package/dist/components/component/setup.component.d.ts +3 -0
- package/dist/components/component/setup.component.js +2 -0
- package/dist/components/component-view/ComponentView.element.d.ts +6 -0
- package/dist/components/component-view/ComponentView.element.js +16 -0
- package/dist/components/component-view/component-view.template.d.ts +4 -0
- package/dist/components/component-view/component-view.template.js +10 -0
- package/dist/components/component-view/index.d.ts +3 -0
- package/dist/components/component-view/index.js +1 -0
- package/dist/components/component-view/setup.component.d.ts +3 -0
- package/dist/components/component-view/setup.component.js +14 -0
- package/dist/components/control/index.d.ts +1 -0
- package/dist/components/control/index.js +1 -0
- package/dist/components/control/setup.component.d.ts +3 -0
- package/dist/components/control/setup.component.js +2 -0
- package/dist/components/date-input/DateInput.element.d.ts +11 -0
- package/dist/components/date-input/DateInput.element.js +21 -0
- package/dist/components/date-input/date-input.template.d.ts +11 -0
- package/dist/components/date-input/date-input.template.js +102 -0
- package/dist/components/date-input/index.d.ts +3 -0
- package/dist/components/date-input/index.js +1 -0
- package/dist/components/date-input/setup.component.d.ts +8 -0
- package/dist/components/date-input/setup.component.js +16 -0
- package/dist/components/date-picker/DatePicker.element.d.ts +11 -0
- package/dist/components/date-picker/DatePicker.element.js +24 -0
- package/dist/components/date-picker/date-picker.template.d.ts +15 -0
- package/dist/components/date-picker/date-picker.template.js +310 -0
- package/dist/components/date-picker/index.d.ts +3 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/setup.component.d.ts +9 -0
- package/dist/components/date-picker/setup.component.js +16 -0
- package/dist/components/dialog/Dialog.element.d.ts +11 -0
- package/dist/components/dialog/Dialog.element.js +25 -0
- package/dist/components/dialog/dialog.template.d.ts +9 -0
- package/dist/components/dialog/dialog.template.js +148 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/index.js +1 -0
- package/dist/components/dialog/setup.component.d.ts +5 -0
- package/dist/components/dialog/setup.component.js +14 -0
- package/dist/components/drag-and-drop/DragAndDrop.element.d.ts +10 -0
- package/dist/components/drag-and-drop/DragAndDrop.element.js +20 -0
- package/dist/components/drag-and-drop/drag-and-drop.template.d.ts +4 -0
- package/dist/components/drag-and-drop/drag-and-drop.template.js +14 -0
- package/dist/components/drag-and-drop/index.d.ts +3 -0
- package/dist/components/drag-and-drop/index.js +1 -0
- package/dist/components/drag-and-drop/setup.component.d.ts +4 -0
- package/dist/components/drag-and-drop/setup.component.js +17 -0
- package/dist/components/drawer/Drawer.element.d.ts +10 -0
- package/dist/components/drawer/Drawer.element.js +27 -0
- package/dist/components/drawer/drawer.template.d.ts +11 -0
- package/dist/components/drawer/drawer.template.js +100 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/drawer/setup.component.d.ts +6 -0
- package/dist/components/drawer/setup.component.js +14 -0
- package/dist/components/field/Field.element.d.ts +10 -0
- package/dist/components/field/Field.element.js +20 -0
- package/dist/components/field/field.template.d.ts +9 -0
- package/dist/components/field/field.template.js +110 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/field/setup.component.d.ts +4 -0
- package/dist/components/field/setup.component.js +17 -0
- package/dist/components/frame/Frame.element.d.ts +10 -0
- package/dist/components/frame/Frame.element.js +27 -0
- package/dist/components/frame/frame.template.d.ts +4 -0
- package/dist/components/frame/frame.template.js +10 -0
- package/dist/components/frame/index.d.ts +3 -0
- package/dist/components/frame/index.js +1 -0
- package/dist/components/frame/setup.component.d.ts +3 -0
- package/dist/components/frame/setup.component.js +14 -0
- package/dist/components/icon/Icon.element.d.ts +10 -0
- package/dist/components/icon/Icon.element.js +21 -0
- package/dist/components/icon/icon.template.d.ts +7 -0
- package/dist/components/icon/icon.template.js +32 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/icon/index.js +3 -0
- package/dist/components/icon/setup.component.d.ts +3 -0
- package/dist/components/icon/setup.component.js +14 -0
- package/dist/components/index.d.ts +44 -0
- package/dist/components/index.js +104 -0
- package/dist/components/input/Input.element.d.ts +9 -0
- package/dist/components/input/Input.element.js +24 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.template.d.ts +10 -0
- package/dist/components/input/input.template.js +82 -0
- package/dist/components/input/setup.component.d.ts +7 -0
- package/dist/components/input/setup.component.js +16 -0
- package/dist/components/input-control/index.d.ts +1 -0
- package/dist/components/input-control/index.js +1 -0
- package/dist/components/input-control/setup.component.d.ts +4 -0
- package/dist/components/input-control/setup.component.js +2 -0
- package/dist/components/interactive/index.d.ts +1 -0
- package/dist/components/interactive/index.js +1 -0
- package/dist/components/interactive/setup.component.d.ts +3 -0
- package/dist/components/interactive/setup.component.js +2 -0
- package/dist/components/item-row/ItemRow.element.d.ts +26 -0
- package/dist/components/item-row/ItemRow.element.js +53 -0
- package/dist/components/item-row/index.d.ts +1 -0
- package/dist/components/item-row/index.js +1 -0
- package/dist/components/item-row/setup.component.d.ts +3 -0
- package/dist/components/item-row/setup.component.js +14 -0
- package/dist/components/label/Label.element.d.ts +9 -0
- package/dist/components/label/Label.element.js +19 -0
- package/dist/components/label/index.d.ts +3 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.template.d.ts +8 -0
- package/dist/components/label/label.template.js +33 -0
- package/dist/components/label/setup.component.d.ts +3 -0
- package/dist/components/label/setup.component.js +14 -0
- package/dist/components/list-box/ListBox.element.d.ts +10 -0
- package/dist/components/list-box/ListBox.element.js +32 -0
- package/dist/components/list-box/group/ListBoxGroup.element.d.ts +9 -0
- package/dist/components/list-box/group/ListBoxGroup.element.js +17 -0
- package/dist/components/list-box/group/index.d.ts +3 -0
- package/dist/components/list-box/group/index.js +3 -0
- package/dist/components/list-box/group/list-box-group.template.d.ts +8 -0
- package/dist/components/list-box/group/list-box-group.template.js +32 -0
- package/dist/components/list-box/group/setup.component.d.ts +3 -0
- package/dist/components/list-box/group/setup.component.js +16 -0
- package/dist/components/list-box/index.d.ts +7 -0
- package/dist/components/list-box/index.js +4 -0
- package/dist/components/list-box/item/ListBoxItem.element.d.ts +10 -0
- package/dist/components/list-box/item/ListBoxItem.element.js +25 -0
- package/dist/components/list-box/item/index.d.ts +3 -0
- package/dist/components/list-box/item/index.js +3 -0
- package/dist/components/list-box/item/list-box-item.template.d.ts +8 -0
- package/dist/components/list-box/item/list-box-item.template.js +116 -0
- package/dist/components/list-box/item/setup.component.d.ts +3 -0
- package/dist/components/list-box/item/setup.component.js +22 -0
- package/dist/components/list-box/list-box.template.d.ts +11 -0
- package/dist/components/list-box/list-box.template.js +77 -0
- package/dist/components/list-box/setup.component.d.ts +3 -0
- package/dist/components/list-box/setup.component.js +26 -0
- package/dist/components/menu/Menu.element.d.ts +10 -0
- package/dist/components/menu/Menu.element.js +49 -0
- package/dist/components/menu/checkbox-item/MenuCheckboxItem.element.d.ts +10 -0
- package/dist/components/menu/checkbox-item/MenuCheckboxItem.element.js +24 -0
- package/dist/components/menu/checkbox-item/index.d.ts +3 -0
- package/dist/components/menu/checkbox-item/index.js +3 -0
- package/dist/components/menu/checkbox-item/menu-checkbox-item.template.d.ts +8 -0
- package/dist/components/menu/checkbox-item/menu-checkbox-item.template.js +58 -0
- package/dist/components/menu/checkbox-item/setup.component.d.ts +3 -0
- package/dist/components/menu/checkbox-item/setup.component.js +22 -0
- package/dist/components/menu/group/MenuGroup.element.d.ts +9 -0
- package/dist/components/menu/group/MenuGroup.element.js +17 -0
- package/dist/components/menu/group/index.d.ts +3 -0
- package/dist/components/menu/group/index.js +3 -0
- package/dist/components/menu/group/menu-group.template.d.ts +12 -0
- package/dist/components/menu/group/menu-group.template.js +37 -0
- package/dist/components/menu/group/setup.component.d.ts +3 -0
- package/dist/components/menu/group/setup.component.js +16 -0
- package/dist/components/menu/index.d.ts +19 -0
- package/dist/components/menu/index.js +10 -0
- package/dist/components/menu/item/MenuItem.element.d.ts +10 -0
- package/dist/components/menu/item/MenuItem.element.js +24 -0
- package/dist/components/menu/item/index.d.ts +3 -0
- package/dist/components/menu/item/index.js +3 -0
- package/dist/components/menu/item/menu-item.template.d.ts +8 -0
- package/dist/components/menu/item/menu-item.template.js +36 -0
- package/dist/components/menu/item/setup.component.d.ts +3 -0
- package/dist/components/menu/item/setup.component.js +22 -0
- package/dist/components/menu/items.d.ts +25 -0
- package/dist/components/menu/items.js +112 -0
- package/dist/components/menu/menu.template.d.ts +17 -0
- package/dist/components/menu/menu.template.js +100 -0
- package/dist/components/menu/popover-item/MenuPopoverItem.element.d.ts +10 -0
- package/dist/components/menu/popover-item/MenuPopoverItem.element.js +24 -0
- package/dist/components/menu/popover-item/index.d.ts +3 -0
- package/dist/components/menu/popover-item/index.js +3 -0
- package/dist/components/menu/popover-item/menu-popover-item.template.d.ts +14 -0
- package/dist/components/menu/popover-item/menu-popover-item.template.js +83 -0
- package/dist/components/menu/popover-item/setup.component.d.ts +6 -0
- package/dist/components/menu/popover-item/setup.component.js +22 -0
- package/dist/components/menu/radio-group/MenuRadioGroup.element.d.ts +9 -0
- package/dist/components/menu/radio-group/MenuRadioGroup.element.js +17 -0
- package/dist/components/menu/radio-group/index.d.ts +3 -0
- package/dist/components/menu/radio-group/index.js +3 -0
- package/dist/components/menu/radio-group/menu-radio-group.template.d.ts +7 -0
- package/dist/components/menu/radio-group/menu-radio-group.template.js +10 -0
- package/dist/components/menu/radio-group/setup.component.d.ts +3 -0
- package/dist/components/menu/radio-group/setup.component.js +17 -0
- package/dist/components/menu/radio-item/MenuRadioItem.element.d.ts +10 -0
- package/dist/components/menu/radio-item/MenuRadioItem.element.js +24 -0
- package/dist/components/menu/radio-item/index.d.ts +3 -0
- package/dist/components/menu/radio-item/index.js +3 -0
- package/dist/components/menu/radio-item/menu-radio-item.template.d.ts +7 -0
- package/dist/components/menu/radio-item/menu-radio-item.template.js +54 -0
- package/dist/components/menu/radio-item/setup.component.d.ts +3 -0
- package/dist/components/menu/radio-item/setup.component.js +23 -0
- package/dist/components/menu/row.d.ts +27 -0
- package/dist/components/menu/row.js +72 -0
- package/dist/components/menu/separator/MenuSeparator.element.d.ts +9 -0
- package/dist/components/menu/separator/MenuSeparator.element.js +17 -0
- package/dist/components/menu/separator/index.d.ts +3 -0
- package/dist/components/menu/separator/index.js +3 -0
- package/dist/components/menu/separator/menu-separator.template.d.ts +4 -0
- package/dist/components/menu/separator/menu-separator.template.js +7 -0
- package/dist/components/menu/separator/setup.component.d.ts +3 -0
- package/dist/components/menu/separator/setup.component.js +14 -0
- package/dist/components/menu/setup.component.d.ts +6 -0
- package/dist/components/menu/setup.component.js +25 -0
- package/dist/components/menu/submenu/MenuSubmenu.element.d.ts +11 -0
- package/dist/components/menu/submenu/MenuSubmenu.element.js +26 -0
- package/dist/components/menu/submenu/index.d.ts +3 -0
- package/dist/components/menu/submenu/index.js +3 -0
- package/dist/components/menu/submenu/menu-submenu.template.d.ts +13 -0
- package/dist/components/menu/submenu/menu-submenu.template.js +103 -0
- package/dist/components/menu/submenu/setup.component.d.ts +11 -0
- package/dist/components/menu/submenu/setup.component.js +36 -0
- package/dist/components/number-input/NumberInput.element.d.ts +11 -0
- package/dist/components/number-input/NumberInput.element.js +26 -0
- package/dist/components/number-input/index.d.ts +3 -0
- package/dist/components/number-input/index.js +1 -0
- package/dist/components/number-input/number-input.template.d.ts +9 -0
- package/dist/components/number-input/number-input.template.js +166 -0
- package/dist/components/number-input/setup.component.d.ts +7 -0
- package/dist/components/number-input/setup.component.js +16 -0
- package/dist/components/pagination/Pagination.element.d.ts +10 -0
- package/dist/components/pagination/Pagination.element.js +24 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/item/PaginationItem.element.d.ts +11 -0
- package/dist/components/pagination/item/PaginationItem.element.js +23 -0
- package/dist/components/pagination/item/index.d.ts +3 -0
- package/dist/components/pagination/item/index.js +3 -0
- package/dist/components/pagination/item/pagination-item.template.d.ts +8 -0
- package/dist/components/pagination/item/pagination-item.template.js +55 -0
- package/dist/components/pagination/item/setup.component.d.ts +3 -0
- package/dist/components/pagination/item/setup.component.js +22 -0
- package/dist/components/pagination/pagination.template.d.ts +11 -0
- package/dist/components/pagination/pagination.template.js +109 -0
- package/dist/components/pagination/setup.component.d.ts +3 -0
- package/dist/components/pagination/setup.component.js +25 -0
- package/dist/components/popover/Popover.element.d.ts +16 -0
- package/dist/components/popover/Popover.element.js +46 -0
- package/dist/components/popover/index.d.ts +6 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/popover/popover.template.d.ts +9 -0
- package/dist/components/popover/popover.template.js +126 -0
- package/dist/components/popover/setup.component.d.ts +5 -0
- package/dist/components/popover/setup.component.js +14 -0
- package/dist/components/progress-linear/ProgressLinear.element.d.ts +10 -0
- package/dist/components/progress-linear/ProgressLinear.element.js +24 -0
- package/dist/components/progress-linear/index.d.ts +3 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/progress-linear/progress-linear.template.d.ts +8 -0
- package/dist/components/progress-linear/progress-linear.template.js +12 -0
- package/dist/components/progress-linear/setup.component.d.ts +3 -0
- package/dist/components/progress-linear/setup.component.js +14 -0
- package/dist/components/progress-spinner/ProgressSpinner.element.d.ts +10 -0
- package/dist/components/progress-spinner/ProgressSpinner.element.js +24 -0
- package/dist/components/progress-spinner/index.d.ts +3 -0
- package/dist/components/progress-spinner/index.js +1 -0
- package/dist/components/progress-spinner/progress-spinner.template.d.ts +8 -0
- package/dist/components/progress-spinner/progress-spinner.template.js +41 -0
- package/dist/components/progress-spinner/setup.component.d.ts +3 -0
- package/dist/components/progress-spinner/setup.component.js +14 -0
- package/dist/components/radio-group/RadioGroup.element.d.ts +9 -0
- package/dist/components/radio-group/RadioGroup.element.js +23 -0
- package/dist/components/radio-group/index.d.ts +5 -0
- package/dist/components/radio-group/index.js +3 -0
- package/dist/components/radio-group/item/RadioGroupItem.element.d.ts +11 -0
- package/dist/components/radio-group/item/RadioGroupItem.element.js +25 -0
- package/dist/components/radio-group/item/index.d.ts +3 -0
- package/dist/components/radio-group/item/index.js +3 -0
- package/dist/components/radio-group/item/radio-group-item.template.d.ts +8 -0
- package/dist/components/radio-group/item/radio-group-item.template.js +61 -0
- package/dist/components/radio-group/item/setup.component.d.ts +3 -0
- package/dist/components/radio-group/item/setup.component.js +22 -0
- package/dist/components/radio-group/radio-group.template.d.ts +10 -0
- package/dist/components/radio-group/radio-group.template.js +34 -0
- package/dist/components/radio-group/setup.component.d.ts +3 -0
- package/dist/components/radio-group/setup.component.js +25 -0
- package/dist/components/rating/Rating.element.d.ts +10 -0
- package/dist/components/rating/Rating.element.js +25 -0
- package/dist/components/rating/index.d.ts +3 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/rating/rating.template.d.ts +12 -0
- package/dist/components/rating/rating.template.js +89 -0
- package/dist/components/rating/setup.component.d.ts +7 -0
- package/dist/components/rating/setup.component.js +16 -0
- package/dist/components/scroller/Scroller.element.d.ts +9 -0
- package/dist/components/scroller/Scroller.element.js +19 -0
- package/dist/components/scroller/index.d.ts +3 -0
- package/dist/components/scroller/index.js +1 -0
- package/dist/components/scroller/scroller.template.d.ts +9 -0
- package/dist/components/scroller/scroller.template.js +82 -0
- package/dist/components/scroller/setup.component.d.ts +3 -0
- package/dist/components/scroller/setup.component.js +14 -0
- package/dist/components/select/Select.element.d.ts +12 -0
- package/dist/components/select/Select.element.js +33 -0
- package/dist/components/select/group/SelectGroup.element.d.ts +9 -0
- package/dist/components/select/group/SelectGroup.element.js +17 -0
- package/dist/components/select/group/index.d.ts +3 -0
- package/dist/components/select/group/index.js +3 -0
- package/dist/components/select/group/select-group.template.d.ts +7 -0
- package/dist/components/select/group/select-group.template.js +32 -0
- package/dist/components/select/group/setup.component.d.ts +4 -0
- package/dist/components/select/group/setup.component.js +17 -0
- package/dist/components/select/index.d.ts +7 -0
- package/dist/components/select/index.js +4 -0
- package/dist/components/select/item/SelectItem.element.d.ts +11 -0
- package/dist/components/select/item/SelectItem.element.js +26 -0
- package/dist/components/select/item/index.d.ts +3 -0
- package/dist/components/select/item/index.js +3 -0
- package/dist/components/select/item/select-item.template.d.ts +9 -0
- package/dist/components/select/item/select-item.template.js +113 -0
- package/dist/components/select/item/setup.component.d.ts +3 -0
- package/dist/components/select/item/setup.component.js +22 -0
- package/dist/components/select/select.template.d.ts +12 -0
- package/dist/components/select/select.template.js +216 -0
- package/dist/components/select/setup.component.d.ts +9 -0
- package/dist/components/select/setup.component.js +26 -0
- package/dist/components/skeleton/Skeleton.element.d.ts +10 -0
- package/dist/components/skeleton/Skeleton.element.js +24 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/setup.component.d.ts +3 -0
- package/dist/components/skeleton/setup.component.js +14 -0
- package/dist/components/skeleton/skeleton.template.d.ts +8 -0
- package/dist/components/skeleton/skeleton.template.js +25 -0
- package/dist/components/slider/Slider.element.d.ts +11 -0
- package/dist/components/slider/Slider.element.js +25 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/setup.component.d.ts +3 -0
- package/dist/components/slider/setup.component.js +16 -0
- package/dist/components/slider/slider.template.d.ts +8 -0
- package/dist/components/slider/slider.template.js +149 -0
- package/dist/components/stylable/index.d.ts +1 -0
- package/dist/components/stylable/index.js +1 -0
- package/dist/components/stylable/setup.component.d.ts +3 -0
- package/dist/components/stylable/setup.component.js +2 -0
- package/dist/components/switch/Switch.element.d.ts +9 -0
- package/dist/components/switch/Switch.element.js +24 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/setup.component.d.ts +7 -0
- package/dist/components/switch/setup.component.js +16 -0
- package/dist/components/switch/switch.template.d.ts +9 -0
- package/dist/components/switch/switch.template.js +63 -0
- package/dist/components/table/Table.element.d.ts +11 -0
- package/dist/components/table/Table.element.js +29 -0
- package/dist/components/table/column/TableColumn.element.d.ts +10 -0
- package/dist/components/table/column/TableColumn.element.js +22 -0
- package/dist/components/table/column/index.d.ts +3 -0
- package/dist/components/table/column/index.js +3 -0
- package/dist/components/table/column/setup.component.d.ts +4 -0
- package/dist/components/table/column/setup.component.js +15 -0
- package/dist/components/table/column/table-column.template.d.ts +8 -0
- package/dist/components/table/column/table-column.template.js +123 -0
- package/dist/components/table/index.d.ts +7 -0
- package/dist/components/table/index.js +4 -0
- package/dist/components/table/row/TableRow.element.d.ts +10 -0
- package/dist/components/table/row/TableRow.element.js +19 -0
- package/dist/components/table/row/index.d.ts +3 -0
- package/dist/components/table/row/index.js +3 -0
- package/dist/components/table/row/setup.component.d.ts +3 -0
- package/dist/components/table/row/setup.component.js +22 -0
- package/dist/components/table/row/table-row.template.d.ts +8 -0
- package/dist/components/table/row/table-row.template.js +98 -0
- package/dist/components/table/setup.component.d.ts +3 -0
- package/dist/components/table/setup.component.js +26 -0
- package/dist/components/table/table.template.d.ts +12 -0
- package/dist/components/table/table.template.js +164 -0
- package/dist/components/tabs/Tabs.element.d.ts +10 -0
- package/dist/components/tabs/Tabs.element.js +32 -0
- package/dist/components/tabs/content/TabsContent.element.d.ts +10 -0
- package/dist/components/tabs/content/TabsContent.element.js +24 -0
- package/dist/components/tabs/content/index.d.ts +3 -0
- package/dist/components/tabs/content/index.js +3 -0
- package/dist/components/tabs/content/setup.component.d.ts +3 -0
- package/dist/components/tabs/content/setup.component.js +22 -0
- package/dist/components/tabs/content/tabs-content.template.d.ts +4 -0
- package/dist/components/tabs/content/tabs-content.template.js +15 -0
- package/dist/components/tabs/index.d.ts +7 -0
- package/dist/components/tabs/index.js +4 -0
- package/dist/components/tabs/item/TabsItem.element.d.ts +10 -0
- package/dist/components/tabs/item/TabsItem.element.js +25 -0
- package/dist/components/tabs/item/index.d.ts +3 -0
- package/dist/components/tabs/item/index.js +3 -0
- package/dist/components/tabs/item/setup.component.d.ts +3 -0
- package/dist/components/tabs/item/setup.component.js +22 -0
- package/dist/components/tabs/item/tabs-item.template.d.ts +8 -0
- package/dist/components/tabs/item/tabs-item.template.js +113 -0
- package/dist/components/tabs/setup.component.d.ts +3 -0
- package/dist/components/tabs/setup.component.js +26 -0
- package/dist/components/tabs/tabs.template.d.ts +12 -0
- package/dist/components/tabs/tabs.template.js +76 -0
- package/dist/components/tags/Tags.element.d.ts +10 -0
- package/dist/components/tags/Tags.element.js +24 -0
- package/dist/components/tags/index.d.ts +5 -0
- package/dist/components/tags/index.js +3 -0
- package/dist/components/tags/item/TagsItem.element.d.ts +11 -0
- package/dist/components/tags/item/TagsItem.element.js +26 -0
- package/dist/components/tags/item/index.d.ts +3 -0
- package/dist/components/tags/item/index.js +3 -0
- package/dist/components/tags/item/setup.component.d.ts +3 -0
- package/dist/components/tags/item/setup.component.js +22 -0
- package/dist/components/tags/item/tags-item.template.d.ts +9 -0
- package/dist/components/tags/item/tags-item.template.js +115 -0
- package/dist/components/tags/setup.component.d.ts +3 -0
- package/dist/components/tags/setup.component.js +25 -0
- package/dist/components/tags/tags.template.d.ts +10 -0
- package/dist/components/tags/tags.template.js +43 -0
- package/dist/components/textable/index.d.ts +1 -0
- package/dist/components/textable/index.js +1 -0
- package/dist/components/textable/setup.component.d.ts +3 -0
- package/dist/components/textable/setup.component.js +2 -0
- package/dist/components/textarea/Textarea.element.d.ts +9 -0
- package/dist/components/textarea/Textarea.element.js +24 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/index.js +1 -0
- package/dist/components/textarea/setup.component.d.ts +7 -0
- package/dist/components/textarea/setup.component.js +16 -0
- package/dist/components/textarea/textarea.template.d.ts +9 -0
- package/dist/components/textarea/textarea.template.js +81 -0
- package/dist/components/toasts/Toasts.element.d.ts +11 -0
- package/dist/components/toasts/Toasts.element.js +29 -0
- package/dist/components/toasts/index.d.ts +5 -0
- package/dist/components/toasts/index.js +3 -0
- package/dist/components/toasts/item/ToastsItem.element.d.ts +11 -0
- package/dist/components/toasts/item/ToastsItem.element.js +19 -0
- package/dist/components/toasts/item/index.d.ts +3 -0
- package/dist/components/toasts/item/index.js +3 -0
- package/dist/components/toasts/item/setup.component.d.ts +3 -0
- package/dist/components/toasts/item/setup.component.js +22 -0
- package/dist/components/toasts/item/toasts-item.template.d.ts +9 -0
- package/dist/components/toasts/item/toasts-item.template.js +133 -0
- package/dist/components/toasts/setup.component.d.ts +3 -0
- package/dist/components/toasts/setup.component.js +26 -0
- package/dist/components/toasts/toasts.template.d.ts +11 -0
- package/dist/components/toasts/toasts.template.js +53 -0
- package/dist/components/tooltip/Tooltip.element.d.ts +10 -0
- package/dist/components/tooltip/Tooltip.element.js +24 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/tooltip/setup.component.d.ts +6 -0
- package/dist/components/tooltip/setup.component.js +14 -0
- package/dist/components/tooltip/tooltip.template.d.ts +11 -0
- package/dist/components/tooltip/tooltip.template.js +68 -0
- package/dist/components/value-control/index.d.ts +1 -0
- package/dist/components/value-control/index.js +1 -0
- package/dist/components/value-control/setup.component.d.ts +4 -0
- package/dist/components/value-control/setup.component.js +2 -0
- package/dist/components/virtual/Virtual.element.d.ts +10 -0
- package/dist/components/virtual/Virtual.element.js +20 -0
- package/dist/components/virtual/index.d.ts +3 -0
- package/dist/components/virtual/index.js +1 -0
- package/dist/components/virtual/setup.component.d.ts +4 -0
- package/dist/components/virtual/setup.component.js +17 -0
- package/dist/components/virtual/virtual.template.d.ts +4 -0
- package/dist/components/virtual/virtual.template.js +14 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +65 -0
- package/package.json +200 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yuri Soldatov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,623 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @soxa-ui/webc
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**The Web Components adapter: Soxa UI as Custom Elements on the headless models of the core.**
|
|
4
|
+
|
|
5
|
+
Part of [Soxa UI](https://github.com/youra-h/soxa-ui) — UI components with the logic written once: a
|
|
6
|
+
framework-agnostic core and thin adapters that render it in Vue, React, Angular, Svelte, Solid and
|
|
7
|
+
Web Components.
|
|
8
|
+
|
|
9
|
+
The adapter is wiring, not behavior: it defines a Custom Element per component and renders the
|
|
10
|
+
markup — BEM classes `so-*` and `data-*` state attributes. Props, events and slots come from the
|
|
11
|
+
component descriptor, so they match the other five adapters; only the spelling is the platform's:
|
|
12
|
+
props are attributes or element properties, and events are DOM events named `so:` + the core name
|
|
13
|
+
(`so:show`, `so:show:before`, `so:action:press`, `so:change:disabled`). Every event has the prefix:
|
|
14
|
+
events bubble from your element through the DOM, and the prefix tells a component's event from the
|
|
15
|
+
browser's and your own. A "before" event (`so:show:before`, `so:hide:before`) is cancelable, as a
|
|
16
|
+
DOM event is: `event.preventDefault()` in a listener on the element or above it cancels the action.
|
|
17
|
+
Its `detail` is the core event itself, so `event.detail.preventDefault()` cancels it too. Any other
|
|
18
|
+
event's `detail` is the argument of the core event, or an array of them when there are several: an
|
|
19
|
+
item's `so:change:selected` carries its new mark and comes only to the item whose mark changed; its
|
|
20
|
+
owner's `so:change:selection` carries `[selected, changed]`, the selected items and the items whose
|
|
21
|
+
mark changed; `so:change:activation` of tabs and radio groups carries `[active, previous]`.
|
|
22
|
+
|
|
23
|
+
Each component is a native element of its tag extended by Soxa (a customized built-in):
|
|
24
|
+
`<button is="so-button">` is a real `<button>`, `<div is="so-component-view">` a real `<div>`.
|
|
25
|
+
Whatever the browser does for the tag it does for the component — a button submits and resets its
|
|
26
|
+
form, is the event's `submitter`, works with `new FormData(form, submitter)`, Enter in a form
|
|
27
|
+
field, `formaction`, `<fieldset disabled>`, `<label for>` and `popovertarget`. `class`, `style`,
|
|
28
|
+
attributes and listeners on it take effect directly, and an attribute you set (`aria-label`,
|
|
29
|
+
`tabindex`) wins over what the component writes. There is no `tag` prop — the root is always the
|
|
30
|
+
element you wrote.
|
|
31
|
+
|
|
32
|
+
Safari does not support customized built-ins, so the package imports the
|
|
33
|
+
[`@ungap/custom-elements`](https://github.com/ungap/custom-elements) polyfill (3 KB gzipped); it
|
|
34
|
+
does nothing where the browser supports them natively. With the polyfill an element comes to life a
|
|
35
|
+
microtask after it is inserted, so right after `innerHTML` its `ctrl` is not there yet. Elements
|
|
36
|
+
already in the page when the package is imported are assembled a microtask after the import in every
|
|
37
|
+
browser (with the polyfill, once it has brought them all to life), so the theme, icons and plugins
|
|
38
|
+
your entry point sets up right after the import (before any top-level `await`) apply to them too.
|
|
39
|
+
They are assembled in document order, each owner before the items inside it, whatever order their
|
|
40
|
+
names are registered in; an element your code puts inside such markup before then waits for it.
|
|
41
|
+
|
|
42
|
+
Shadow DOM is not used — a theme styles global BEM classes, so light DOM is distributed by the
|
|
43
|
+
`slot` attribute by hand. Content for a slot the component does not have is not rendered, and slots
|
|
44
|
+
get no scope: slot content is the element's own light DOM, so component data (the `text` of
|
|
45
|
+
Button's `default` slot) cannot be passed into it — slot content reads it from the element,
|
|
46
|
+
`el.ctrl`.
|
|
47
|
+
|
|
48
|
+
> **Status:** the Web Components adapter is in progress — Button, Icon, Label, Input, NumberInput
|
|
49
|
+
> (`<div is="so-number-input">`: a number in the locale's format with − and + step buttons; the
|
|
50
|
+
> form gets the number), Textarea (`<div is="so-textarea">`: multi-line, growing with its text,
|
|
51
|
+
> with a character counter), CheckBox, Switch, Slider (`<span is="so-slider">`), Rating
|
|
52
|
+
> (`<span is="so-rating">`), the form field `<div is="so-field">` (label, helper and error linked
|
|
53
|
+
> to the control inside it), ProgressSpinner, ProgressLinear (`<span is="so-progress-linear">`),
|
|
54
|
+
> Skeleton, Frame, Popover (`<span is="so-popover">`), Tooltip (`<span is="so-tooltip">`),
|
|
55
|
+
> Menu (`<span is="so-menu">`: an action menu at a button or a context menu, with submenus,
|
|
56
|
+
> checkbox and radio items and items with a panel), Dialog (`<div is="so-dialog">`), Drawer
|
|
57
|
+
> (`<div is="so-drawer">`), Toasts (`<so-toasts>`
|
|
58
|
+
> around the application, a toast from code — `toastsOf(element).show(…)`),
|
|
59
|
+
> Scroller (`<div is="so-scroller">`), RadioGroup, ListBox, Tabs, Accordion, Tags
|
|
60
|
+
> (`<div is="so-tags">`), Select (`<div is="so-select">`: a field with a list in a panel, tags in
|
|
61
|
+
> the field for multiple selection), Pagination (`<nav is="so-pagination">`), Table, the date
|
|
62
|
+
> field DateInput (`<div is="so-date-input">`: a date and time typed in parts in the locale's
|
|
63
|
+
> format), Calendar (`<div is="so-calendar">`: month grids with a month and year picker),
|
|
64
|
+
> DatePicker (`<div is="so-date-picker">`: a date field and a calendar in a panel, a single date
|
|
65
|
+
> or a range), the `<so-virtual>` window for long lists and the
|
|
66
|
+
> `<so-drag-and-drop>` wrapper that lets users reorder the items of Tabs, ListBox and Accordion by
|
|
67
|
+
> dragging (`so:move`; `so:move:before` can cancel with `event.preventDefault()`) are ported, the
|
|
68
|
+
> rest of the set is on its way. See [the adapter table](https://github.com/youra-h/soxa-ui#components).
|
|
69
|
+
|
|
70
|
+
## Install
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install @soxa-ui/webc @soxa-ui/setup @soxa-ui/theme-oren @soxa-ui/icons-material
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Install `@soxa-ui/setup` as a direct dependency for the `useIcons` and `useTheme` imports below.
|
|
77
|
+
Keep it on the same version as `@soxa-ui/webc`.
|
|
78
|
+
|
|
79
|
+
A theme and an icon pack are separate packages — pick the ones you want.
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
Importing the package defines every element:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
import '@soxa-ui/webc'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
A page that uses a few components can import just theirs. Every element has an entry of its own,
|
|
90
|
+
named as the element without `so-`; importing it defines the element with its parts, the elements
|
|
91
|
+
its markup draws (a select brings its field, panel and tags) and the locale provider, and the
|
|
92
|
+
application's bundle carries only those:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import '@soxa-ui/webc/button' // <button is="so-button">
|
|
96
|
+
import '@soxa-ui/webc/check-box' // <span is="so-check-box">
|
|
97
|
+
import '@soxa-ui/webc/tabs' // <div is="so-tabs"> with so-tabs-item and so-tabs-content
|
|
98
|
+
import { toastsOf } from '@soxa-ui/webc/toasts' // <so-toasts> and the queue of its toasts
|
|
99
|
+
import { TLocaleProviderElement } from '@soxa-ui/webc/locale-provider'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
An element you write without importing its entry is not an error: the browser says nothing about
|
|
103
|
+
an unknown `is`, so `<button is="so-button">` stays a plain `<button>` — no classes, no behavior.
|
|
104
|
+
That is why the package root, where there is nothing to forget, is the default, and the entries are
|
|
105
|
+
a choice for size. Take the values of an element from its entry as well — `TButtonElement` from
|
|
106
|
+
`@soxa-ui/webc/button`, `toastsOf` from `@soxa-ui/webc/toasts`, `roleIcon` from
|
|
107
|
+
`@soxa-ui/webc/icon`: the same name from the root brings every element along.
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<button is="so-button" text="Save" class="toolbar-action"><i slot="leading">★</i></button>
|
|
111
|
+
<button is="so-button"><i slot="leading">★</i> Save</button>
|
|
112
|
+
<span is="so-progress-spinner" value="40" aria_label="Uploading"></span>
|
|
113
|
+
<span is="so-progress-linear" value="40" aria_label="Uploading"></span>
|
|
114
|
+
<div is="so-skeleton" width="160" height="16"><p>Loaded content</p></div>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
An icon from the icon pack is `<span is="so-icon">` with the role in its `icon` attribute (`el.icon`
|
|
118
|
+
from code). The role is the element's own attribute, not a component prop: the element draws the
|
|
119
|
+
role's `<svg>` inside itself, stretched to its box. The `span` is the icon's root — size, classes
|
|
120
|
+
and the accessible name are on it, as with any element. Without a name the icon is hidden from
|
|
121
|
+
screen readers:
|
|
122
|
+
|
|
123
|
+
```html
|
|
124
|
+
<span is="so-icon" icon="close" size="lg"></span>
|
|
125
|
+
<span is="so-icon" icon="close" aria_label="Close"></span>
|
|
126
|
+
<button is="so-button" text="Next">
|
|
127
|
+
<span is="so-icon" icon="arrowRight" slot="trailing"></span>
|
|
128
|
+
</button>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The icon is always a `span`: `is` extends HTML elements only, so it cannot be an `<svg>`, and one
|
|
132
|
+
name extends one tag, so `<i is="so-icon">` does not come to life. A bare `<svg>` with a role's
|
|
133
|
+
picture, for markup of your own, is `roleIcon(role)` from the package.
|
|
134
|
+
|
|
135
|
+
Attributes, classes and inline styles you write on an element win over what the component writes
|
|
136
|
+
there itself: `style="width: 40px"` on a skeleton beats the width it computes, and a property a
|
|
137
|
+
script sets on the element directly survives the component's updates.
|
|
138
|
+
|
|
139
|
+
A frame is a layer above the page: the element you wrote moves itself to its `target` (`body` by
|
|
140
|
+
default), out from under `overflow` and stacking contexts, with your class, attributes and
|
|
141
|
+
listeners on it, and a comment stays in its place. It is hidden until `visible`, and `contained`
|
|
142
|
+
keeps it in place, inside the nearest positioned ancestor:
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<div class="card">
|
|
146
|
+
<div is="so-frame" visible target="#layers" class="menu-panel" x="40" y="120">
|
|
147
|
+
<button is="so-button" text="Rename"></button>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Moving the panel rebuilds neither the frame nor anything inside it, and the panel keeps the place it
|
|
153
|
+
was written in: the button above takes its language from the `<so-locale-provider>` around the
|
|
154
|
+
card, not around `#layers`. Removing the card from the page takes the panel out of the target with
|
|
155
|
+
it, and moving the card elsewhere — even with a single call, `other.appendChild(card)` — rebuilds
|
|
156
|
+
the panel for the new place: under another provider the button takes that provider's language.
|
|
157
|
+
|
|
158
|
+
A popover is a panel with any content at a trigger — a non-modal dialog — and a tooltip is a hint
|
|
159
|
+
shown on hover and on keyboard focus. The trigger is your element in the `trigger` slot, the
|
|
160
|
+
content is the default slot, and the panel is a frame of their own, moved to `body`. Slots get no
|
|
161
|
+
scope, so the trigger receives its side of the link by itself: the component writes it onto the
|
|
162
|
+
first element of the `trigger` slot — `aria-haspopup`, `aria-expanded`, `aria-controls` and
|
|
163
|
+
`data-selected` at a popover's trigger, `aria-describedby` (`aria-labelledby` with `type="label"`)
|
|
164
|
+
at a tooltip's. Clicking the trigger, pressing outside, Escape and Tab are handled for you:
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<span is="so-popover" aria_label="Filters">
|
|
168
|
+
<button is="so-button" slot="trigger" text="Filters"></button>
|
|
169
|
+
<p>Any content: text, fields, buttons</p>
|
|
170
|
+
<button is="so-button" text="Apply"></button>
|
|
171
|
+
</span>
|
|
172
|
+
|
|
173
|
+
<span is="so-tooltip">
|
|
174
|
+
<button is="so-button" slot="trigger" text="Save"></button>
|
|
175
|
+
Save a draft
|
|
176
|
+
</span>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The trigger stays the node you wrote, and the panel's content is not rebuilt when the panel moves
|
|
180
|
+
to `body` or back with `contained` (the panel stays in place, at an `edge` of the nearest
|
|
181
|
+
positioned ancestor). `lazy-mount` keeps the content out of the document until the panel is opened
|
|
182
|
+
for the first time. The close button in the panel's corner shows the `close-icon` slot or a close
|
|
183
|
+
icon; `el.closable = false` removes it — the attribute of a flag can only turn it on.
|
|
184
|
+
|
|
185
|
+
A menu is an action menu at a button — or, with `open-on="contextmenu"`, a context menu of the area
|
|
186
|
+
in its `trigger` slot, opened by the right button, a long touch or Shift+F10 at the point where it
|
|
187
|
+
was called. The trigger gets its side of the link by itself, as at a popover (`aria-haspopup="menu"`,
|
|
188
|
+
`aria-expanded`, `aria-controls`, `data-selected`; an area of a context menu gets no link). Items
|
|
189
|
+
are the menu's own elements: an action `<div is="so-menu-item">`, a checkbox
|
|
190
|
+
`<div is="so-menu-checkbox-item">` (`selected`), radio items `<div is="so-menu-radio-item">` in
|
|
191
|
+
`<div is="so-menu-radio-group">` (its `value`), a submenu `<div is="so-menu-submenu">` with items
|
|
192
|
+
of its own, an item with a panel of any content `<div is="so-menu-popover-item">` (its row text is
|
|
193
|
+
the `header` slot), groups `<div is="so-menu-group">` with a `label` and separators
|
|
194
|
+
`<div is="so-menu-separator">`. A shortcut hint goes to an item's `trailing` slot. Arrows, letters,
|
|
195
|
+
the pointer, focus, Escape and Tab are handled for you; choosing an action closes the whole menu
|
|
196
|
+
and reports `so:choose`, a checkbox and a radio item keep it open:
|
|
197
|
+
|
|
198
|
+
```html
|
|
199
|
+
<span is="so-menu">
|
|
200
|
+
<button is="so-button" slot="trigger" text="Actions"></button>
|
|
201
|
+
<div is="so-menu-group" label="View">
|
|
202
|
+
<div is="so-menu-checkbox-item" value="grid" text="Grid" selected></div>
|
|
203
|
+
</div>
|
|
204
|
+
<div is="so-menu-separator"></div>
|
|
205
|
+
<div is="so-menu-item" value="edit" text="Edit"><span slot="trailing">Ctrl+E</span></div>
|
|
206
|
+
<div is="so-menu-submenu" value="share" text="Share">
|
|
207
|
+
<div is="so-menu-item" value="link" text="Copy link"></div>
|
|
208
|
+
</div>
|
|
209
|
+
</span>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Items given as data (`el.items = [...]`, or an `engine`) are actions, and an item with an `items`
|
|
213
|
+
array of its own is a submenu, at any depth; groups come from `_.group` in the data or `groupBy`,
|
|
214
|
+
and `groups` sets their order and labels. The `item-*` slots are templates, as in a list box, and a
|
|
215
|
+
submenu drawn from data gets them too, under the same names — one set of templates for every
|
|
216
|
+
level; `item-content` gives each submenu drawn from data items in markup instead of its own. The
|
|
217
|
+
panels move to `body`, each a layer above the one it was opened from; a submenu's items join the
|
|
218
|
+
submenu, not the menu above it.
|
|
219
|
+
|
|
220
|
+
A dialog and a drawer are modal: the element you wrote is the panel, and it moves to `body` itself,
|
|
221
|
+
like a frame, with its backdrop right before it — the component draws the backdrop, keeps it next
|
|
222
|
+
to the panel wherever the panel goes and hides it with the panel. Nothing opens them for you: there
|
|
223
|
+
is no trigger, so `el.visible = true` (or `el.ctrl.show()`) opens one, and the close button, the
|
|
224
|
+
backdrop, Escape and a swipe ask it to close — `so:close:before` with `event.preventDefault()`
|
|
225
|
+
keeps it open, and `el.dismissible = false` leaves only the close button and the swipe. The title,
|
|
226
|
+
the content and the footer are the `title`, default and `footer` slots. A dialog can be
|
|
227
|
+
maximized (`maximizable`, the `maximize-icon` and `restore-icon` slots); a drawer slides in at an
|
|
228
|
+
edge (`placement`), can be swiped away (`swipe`) and with `contained` stays in the nearest
|
|
229
|
+
positioned ancestor, together with its backdrop:
|
|
230
|
+
|
|
231
|
+
```html
|
|
232
|
+
<button id="open-settings">Settings</button>
|
|
233
|
+
<div is="so-dialog" id="settings">
|
|
234
|
+
<span slot="title">Settings</span>
|
|
235
|
+
<p>Any content: text, fields, buttons</p>
|
|
236
|
+
<button is="so-button" slot="footer" text="Done"></button>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<script type="module">
|
|
240
|
+
const dialog = document.getElementById('settings')
|
|
241
|
+
|
|
242
|
+
document.getElementById('open-settings').addEventListener('click', () => {
|
|
243
|
+
dialog.visible = true
|
|
244
|
+
})
|
|
245
|
+
</script>
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Toasts are shown from code. `<so-toasts>` wraps the application and has no box of its own, like
|
|
249
|
+
the locale provider: the application inside it stays in place, and the region with the toasts is
|
|
250
|
+
moved to `body`, with the attributes, class and style you wrote on `<so-toasts>`. A node under the
|
|
251
|
+
manager gets the queue with `toastsOf(node)` — the nearest manager above the node, also from inside
|
|
252
|
+
a dialog moved to `body` — and `show` takes a text or options; content of your own is a function
|
|
253
|
+
that receives the toast and returns a node. The `item`, `item-icon`, `item-content` and
|
|
254
|
+
`item-close-icon` slots are templates, as in collections: every toast gets a copy, and a copy finds
|
|
255
|
+
its toast on the nearest `.so-toasts-item` (`el.ctrl`). A toast is the manager's markup, like an
|
|
256
|
+
item drawn from data, so its events do not bubble: the manager reports a closed toast with
|
|
257
|
+
`so:item:close`.
|
|
258
|
+
|
|
259
|
+
```html
|
|
260
|
+
<so-toasts placement="top-end">
|
|
261
|
+
<main>
|
|
262
|
+
<button id="save">Save</button>
|
|
263
|
+
</main>
|
|
264
|
+
</so-toasts>
|
|
265
|
+
|
|
266
|
+
<script type="module">
|
|
267
|
+
import { toastsOf } from '@soxa-ui/webc'
|
|
268
|
+
|
|
269
|
+
const save = document.getElementById('save')
|
|
270
|
+
|
|
271
|
+
save.addEventListener('click', () => {
|
|
272
|
+
toastsOf(save).show({
|
|
273
|
+
text: 'Draft saved',
|
|
274
|
+
type: 'success',
|
|
275
|
+
render: (toast) => {
|
|
276
|
+
const undo = document.createElement('button', { is: 'so-button' })
|
|
277
|
+
|
|
278
|
+
undo.text = 'Undo'
|
|
279
|
+
undo.addEventListener('click', () => toast.close())
|
|
280
|
+
|
|
281
|
+
return undo
|
|
282
|
+
},
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
</script>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
In a form it is simply a button:
|
|
289
|
+
|
|
290
|
+
```html
|
|
291
|
+
<form>
|
|
292
|
+
<input name="q" />
|
|
293
|
+
<button is="so-button" name="action" value="search" text="Search"></button>
|
|
294
|
+
<button is="so-button" type="reset" text="Clear"></button>
|
|
295
|
+
</form>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
A field — `<div is="so-input">`, `<div is="so-number-input">`, `<div is="so-textarea">`,
|
|
299
|
+
`<span is="so-check-box">`, `<span is="so-switch">` — is your element with a real `<input>` (a
|
|
300
|
+
`<textarea>`) inside, in the page's ordinary DOM. The form sees that field by itself: `FormData`,
|
|
301
|
+
`<fieldset disabled>`, validation and `<label>` work as with any input, no form-associated element
|
|
302
|
+
involved. A number field sends the number, not the text it shows: its `name` goes to a hidden
|
|
303
|
+
`<input>` with `1234.5` while the field reads `1,234.5`. A checkbox
|
|
304
|
+
and a switch get their visible name from `<label is="so-label">` around them: clicking the text
|
|
305
|
+
toggles the control, and the text becomes its accessible name.
|
|
306
|
+
|
|
307
|
+
```html
|
|
308
|
+
<form>
|
|
309
|
+
<div is="so-input" name="city" placeholder="City" autocomplete="address-level2"></div>
|
|
310
|
+
<label is="so-label" text="Send me news">
|
|
311
|
+
<span is="so-check-box" name="news"></span>
|
|
312
|
+
</label>
|
|
313
|
+
<label is="so-label" text="Dark theme">
|
|
314
|
+
<span is="so-switch" name="dark"></span>
|
|
315
|
+
</label>
|
|
316
|
+
</form>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Attributes you write on a field are split as in the other adapters: `class`, `style` and the
|
|
320
|
+
component's own props (`name`, `disabled`, `placeholder`) stay on the element, and every other
|
|
321
|
+
attribute in the markup — `autocomplete`, `aria-label`, `tabindex`, `data-*` — moves to the
|
|
322
|
+
`<input>` when the element is built. An attribute you set from code later stays on the element.
|
|
323
|
+
`id` is the input's: `id="city"` in the markup lands on the `<input>`, so `<label for="city">`
|
|
324
|
+
finds it. From code it is the same: `el.id = 'city'` (or `setAttribute('id', …)`) moves the id to
|
|
325
|
+
the `<input>`, and `el.id = ''` removes it; the element itself never keeps an `id`. Read the
|
|
326
|
+
current one as `el.state.id`.
|
|
327
|
+
|
|
328
|
+
Slot content gets no scope, so your own clear button (the `clear` slot) clears the field through
|
|
329
|
+
the element: `el.ctrl.clear()`. The built-in clear button and its icon are part of the field's
|
|
330
|
+
markup, so their events (`so:action:press`, `so:change:focused`) do not bubble — listeners on the
|
|
331
|
+
field and delegation on the form hear the field's own events only.
|
|
332
|
+
|
|
333
|
+
A slider and a rating are fields as well: `<span is="so-slider">` has a native
|
|
334
|
+
`<input type="range">` in each thumb, `<span is="so-rating">` one under its row of stars, and the
|
|
335
|
+
form gets their values under `name`. A number is one thumb, an array is a thumb per item
|
|
336
|
+
(`value="[20,80]"`, or `el.value = [20, 80]`). The pointer works on the track, never on the inputs,
|
|
337
|
+
so attributes you write on these two stay on the element; only a rating's `id` goes to its input,
|
|
338
|
+
where `<label for>` finds it. With several thumbs the slider is a group named by `aria_label`, and
|
|
339
|
+
each thumb takes its own name from `thumbLabels`:
|
|
340
|
+
|
|
341
|
+
```html
|
|
342
|
+
<label is="so-label" text="Volume" position="top">
|
|
343
|
+
<span is="so-slider" value="40" name="volume"></span>
|
|
344
|
+
</label>
|
|
345
|
+
<span is="so-slider" value="[20,80]" aria_label="Price" thumb-labels='["From","To"]'></span>
|
|
346
|
+
<span is="so-rating" value="3.5" step="0.5" name="score" aria_label="Score"></span>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Marks as a list are a property, `el.marks = [{ value: 0, label: 'Min' }]`: the `marks` attribute
|
|
350
|
+
is a flag that marks every point of the scale. The `mark` and `thumb` slots of a slider and the
|
|
351
|
+
`icon` slot of a rating are templates, like the `item-*` slots of a list below: each mark, each
|
|
352
|
+
thumb's tooltip and both layers of each star get a copy of their own. A copy finds its data by its
|
|
353
|
+
place — a mark by its index among the `.so-slider__mark` nodes in `el.state.shownMarks`, a thumb by
|
|
354
|
+
its index among the `.so-slider__thumb` nodes in `el.state.thumbs`, a star by its place among the
|
|
355
|
+
stars (counting from one) and its layer by whether it is inside `.so-rating__star-fill`.
|
|
356
|
+
|
|
357
|
+
A collection is an owner element with item elements inside: tabs with their panels, an accordion
|
|
358
|
+
with its sections, a radio group with its radios, a list box with its options. An item joins the
|
|
359
|
+
collection of the nearest owner above it in the document when it is connected — in document order,
|
|
360
|
+
however the markup got onto the page (`innerHTML`, markup written before the package was imported).
|
|
361
|
+
The owner's collection props (`items`, `engine`, `trackBy`, `mode`) and the item's (`active`,
|
|
362
|
+
`selected`) are attributes and properties of the same elements:
|
|
363
|
+
|
|
364
|
+
```html
|
|
365
|
+
<div is="so-tabs" closable aria_label="Settings">
|
|
366
|
+
<div is="so-tabs-item" value="general" text="General" active></div>
|
|
367
|
+
<div is="so-tabs-item" value="mail" text="Mail"><i slot="leading">✉</i></div>
|
|
368
|
+
<div is="so-tabs-content" slot="content" value="general">…</div>
|
|
369
|
+
<div is="so-tabs-content" slot="content" value="mail">…</div>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div is="so-accordion" mode="multiple">
|
|
373
|
+
<div is="so-accordion-item" value="a" text="First" selected><p>First section</p></div>
|
|
374
|
+
<div is="so-accordion-item" value="b" text="Second"><b slot="header">Second</b>…</div>
|
|
375
|
+
</div>
|
|
376
|
+
|
|
377
|
+
<div is="so-radio-group" name="delivery" value="courier">
|
|
378
|
+
<label is="so-radio-group-item" value="courier">Courier</label>
|
|
379
|
+
<label is="so-radio-group-item" value="pickup">Pickup</label>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
<div is="so-list-box" mode="multiple" indicator="start" aria_label="Cities">
|
|
383
|
+
<div is="so-list-box-item" value="msk" text="Moscow" selected></div>
|
|
384
|
+
<div is="so-list-box-item" value="spb" text="Saint Petersburg" disabled></div>
|
|
385
|
+
</div>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Panels go to the `content` slot: the default slot of tabs is the tab list, `[role=tablist]`. An
|
|
389
|
+
inactive panel is hidden, and its content is out of the document — its fields are not submitted
|
|
390
|
+
with the form. A radio is a real `<input type="radio">` inside a `<label>` root; attributes you
|
|
391
|
+
write on it (`id`, `aria-label`, `data-*`) move to the input, as on a field, and on a tab, a
|
|
392
|
+
section or a list box option they move to its row — the button that carries the item's state. On
|
|
393
|
+
a list box and on tabs they move to the list itself, `[role=listbox]` or `[role=tablist]`: the
|
|
394
|
+
element is a frame around it, next to the header and footer of a list box or the panels of tabs,
|
|
395
|
+
so `aria-label` names the list and `tabindex="-1"` takes a list box out of the Tab order.
|
|
396
|
+
|
|
397
|
+
A list box is a single Tab stop: the arrows move through its options, Enter and Space choose. An
|
|
398
|
+
option's row is a button on a `<div>` — `<div is="so-item-row-div">`, a row element with Button's
|
|
399
|
+
markup under a name of its own, since one element name extends one tag: a disabled option stays focusable and is announced
|
|
400
|
+
as unavailable (`aria-disabled`), which a disabled `<button>` would not allow. Its selected mark
|
|
401
|
+
(`indicator`) is the `indicator-icon` slot or a check icon, and it shows on selected options only —
|
|
402
|
+
slot content has no scope to tell selected from not.
|
|
403
|
+
|
|
404
|
+
Items given as data (`el.items = [...]`, or an `engine`) are drawn by the owner. Slots of those
|
|
405
|
+
items have no scope either, so the owner's `item-*` slots are templates: each item drawn from data
|
|
406
|
+
gets its own copy, in its own slot — `<template slot="item-leading">★</template>` puts a star before
|
|
407
|
+
every tab's text. The item's data is on the item element, `el.ctrl`.
|
|
408
|
+
|
|
409
|
+
An item drawn from data is part of the owner's markup, like the built-in clear button of a field:
|
|
410
|
+
its events (`so:element:ready`, `so:change:selected`) do not bubble to the owner and above. Listen
|
|
411
|
+
on the item element itself, or take the owner's event, which is usually what an application needs
|
|
412
|
+
— `so:change:value`, `so:item:activated`, `so:item:close`. Items you write in the markup are yours,
|
|
413
|
+
and their events bubble as any element's.
|
|
414
|
+
|
|
415
|
+
A radio is always a `<label>` root, so a radio cannot go inside `<label is="so-label">` the way
|
|
416
|
+
other adapters write it with `tag="span"`. An item element you add after its owner is built joins
|
|
417
|
+
the collection, but the owner does not move it into its markup — put a tab into `.so-tabs__list`
|
|
418
|
+
yourself. Moving a collection in the document rebuilds it, as any element is rebuilt when it moves:
|
|
419
|
+
markup items join again with what their attributes and properties say, so a choice the user made
|
|
420
|
+
(the active tab, an open section) does not survive the move. Items given as data in your own
|
|
421
|
+
`engine` keep it.
|
|
422
|
+
|
|
423
|
+
A menu's items live in its panel, and the panel is in `body`: it follows the menu. A removed menu
|
|
424
|
+
takes the panel out of `body`, and a menu moved elsewhere — even with a single DOM call — is rebuilt
|
|
425
|
+
together with its panel, so the items join the rebuilt menu and the keyboard and the pointer reach
|
|
426
|
+
them as before.
|
|
427
|
+
|
|
428
|
+
A tag set draws its tags — markup items `<div is="so-tags-item">` or data — in a row, and
|
|
429
|
+
`overflow` (`wrap`, `scroll`) tells the theme what to do with the tags that do not fit. A tag's row
|
|
430
|
+
is a button on a `<div>`, and its close button stands next to the row, not inside it. With a
|
|
431
|
+
selection mode (`mode="single"` or `"multiple"`) the set is a single Tab stop and the arrows move
|
|
432
|
+
through the tags; without one, the close buttons are the stops.
|
|
433
|
+
|
|
434
|
+
A select is a field with a list in a panel, and the panel follows the select as a menu's does.
|
|
435
|
+
Options are markup (`<div is="so-select-item">`, groups `<div is="so-select-group">`) or data.
|
|
436
|
+
Focus stays on the field's `<input>`, and the arrows highlight options through
|
|
437
|
+
`aria-activedescendant`; an option's row is a button on a `<span>` — `<span is="so-item-row-span">`.
|
|
438
|
+
Attributes you write on the select (`aria-label`, `id`, `autocomplete`, `data-*`) go to that
|
|
439
|
+
`<input>`, and so do the select's own accessible name and the links of a form field around it. With
|
|
440
|
+
`mode="multiple"` the chosen options are tags in the field. The field's slots have no scope either:
|
|
441
|
+
your own `field`, `tags` row and `clear` button take what they need from the element —
|
|
442
|
+
`el.ctrl.field` (the input's instance: text, placeholder, `clear()`), `el.state.tags` and
|
|
443
|
+
`el.state.tags_engine`.
|
|
444
|
+
|
|
445
|
+
```html
|
|
446
|
+
<div is="so-tags" closable mode="multiple">
|
|
447
|
+
<div is="so-tags-item" value="new" text="New" selected></div>
|
|
448
|
+
<div is="so-tags-item" value="sale" text="On sale"></div>
|
|
449
|
+
</div>
|
|
450
|
+
|
|
451
|
+
<div is="so-select" name="city" placeholder="Choose a city" clearable>
|
|
452
|
+
<div is="so-select-item" value="msk" text="Moscow"></div>
|
|
453
|
+
<div is="so-select-group" label="North-West">
|
|
454
|
+
<div is="so-select-item" value="spb" text="Saint Petersburg"></div>
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Dates are three elements. The date field `<div is="so-date-input">` is a group of parts — day,
|
|
460
|
+
month and year in the locale's order, with `kind="datetime"` also the hour and the minute — and
|
|
461
|
+
each part is a Tab stop of its own; the form gets the date as `YYYY-MM-DD` from a hidden field
|
|
462
|
+
under `name`. The calendar `<div is="so-calendar">` has no content of its own: it draws the days of
|
|
463
|
+
the months on screen (`months`) itself, each a `<td is="so-calendar-item">`, and the title of a
|
|
464
|
+
month is a popover on a `<div>` — `<div is="so-popover-div">`, the same Popover under a name of its
|
|
465
|
+
own — with the month and year picker in its panel. The date picker `<div is="so-date-picker">` is
|
|
466
|
+
a date field and a calendar in a panel at the field, with `mode="range"` the fields of the start
|
|
467
|
+
and the end; the fields and the calendar are its own instances (`el.ctrl.field`, `el.ctrl.start`,
|
|
468
|
+
`el.ctrl.end`, `el.ctrl.calendar`). The language, the first day of the week and the names of the
|
|
469
|
+
months and parts come from the locale provider.
|
|
470
|
+
|
|
471
|
+
```html
|
|
472
|
+
<div is="so-date-input" name="birthday" aria_label="Date of birth"></div>
|
|
473
|
+
<div is="so-calendar" mode="range"></div>
|
|
474
|
+
<div is="so-date-picker" name="arrival" clearable aria_label="Arrival"></div>
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Several dates and a range are not strings, so they are properties:
|
|
478
|
+
`el.value = ['2026-09-10', '2026-09-14']` — the `value` attribute is a single date. A day is the
|
|
479
|
+
calendar's markup, like an item drawn from data: its events do not bubble, and the calendar reports
|
|
480
|
+
the choice with `so:change:value`. The `item` slot is a template, as in a list: each day gets a
|
|
481
|
+
copy, and a copy finds its day on the nearest `.so-calendar-item` (`el.ctrl.date`, `el.ctrl.text`);
|
|
482
|
+
a date picker hands its `item` template on to its calendar.
|
|
483
|
+
|
|
484
|
+
Pagination draws its pages itself — from `total` and `pageSize`, or from a list of `pages`
|
|
485
|
+
(`el.pages = [{ text: 'Admin' }, …]`) — and has no content of its own. A page is an inner part,
|
|
486
|
+
`<li is="so-pagination-item">` with a button in it; its `item` slot is a template too, and a copy
|
|
487
|
+
finds its page on the nearest `.so-pagination-item` (`el.ctrl`). A page's events do not bubble,
|
|
488
|
+
as with items drawn from data: the pagination reports the page chosen with `so:change:value`. A
|
|
489
|
+
scroller lays its content out in its viewport, between the two buttons; a role for the row and
|
|
490
|
+
what goes with it comes to the viewport as `viewportAria` (`viewport-aria` with JSON, or a
|
|
491
|
+
property):
|
|
492
|
+
|
|
493
|
+
```html
|
|
494
|
+
<nav is="so-pagination" total="200" value="5" aria_label="Result pages"></nav>
|
|
495
|
+
|
|
496
|
+
<div is="so-scroller">
|
|
497
|
+
<button is="so-button" text="First"></button>
|
|
498
|
+
<button is="so-button" text="Second"></button>
|
|
499
|
+
</div>
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
A table takes its columns and rows as data only — `columns` and `items` (`el.columns = [...]`, or
|
|
503
|
+
JSON in the attribute), or an `engine` — and draws the column headers and rows itself:
|
|
504
|
+
`<th is="so-table-column">` and `<tr is="so-table-row">` over the core column and row. The element
|
|
505
|
+
you write is the table's viewport, its outer box: your class and style and hiding go there, while
|
|
506
|
+
the `table` inside is the root that the classes, `data-*` and roles go to — and so do the other
|
|
507
|
+
attributes of your markup, `aria-label` and `id` among them, which name the table. Sorting
|
|
508
|
+
buttons, row selection with "select all" (`mode`), column resizing and reordering, the grid mode
|
|
509
|
+
(`grid`) and the sticky head (`sticky-head`) work as in the other adapters; a resized or moved
|
|
510
|
+
column is reported by `so:column:resize` and `so:column:move`.
|
|
511
|
+
|
|
512
|
+
```html
|
|
513
|
+
<div
|
|
514
|
+
is="so-table"
|
|
515
|
+
mode="multiple"
|
|
516
|
+
aria_label="Staff"
|
|
517
|
+
columns='[{"field":"name","text":"Name","rowHeader":true,"sortable":true},{"field":"age","text":"Age","align":"end"}]'
|
|
518
|
+
>
|
|
519
|
+
<template slot="cell"><my-cell></my-cell></template>
|
|
520
|
+
<p slot="empty">Nobody here yet</p>
|
|
521
|
+
</div>
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
The `header` and `cell` slots are templates, like the `item-*` slots of a list: each header gets a
|
|
525
|
+
copy of `header` and each cell a copy of `cell`. Without `cell` a cell shows its value as text. A
|
|
526
|
+
copy finds its data on the elements around it: the column on its header (`el.ctrl` of the nearest
|
|
527
|
+
`<th is="so-table-column">`), the row on its row (`el.ctrl` of the nearest `<tr is="so-table-row">`)
|
|
528
|
+
and a cell's column by the cell's place among the row's column cells (`.so-table-row__cell`) in
|
|
529
|
+
the table's `state.shownColumns`; the value is the row's `data[column.field]`. Copies of a row's
|
|
530
|
+
cells are built anew when its record or the columns change; selecting rows leaves them alone.
|
|
531
|
+
|
|
532
|
+
For thousands of rows or options given as data (`items`, `engine`), put the table, list box or
|
|
533
|
+
select into the `<so-virtual>` window: it draws only the visible ones, with spacers in place of the
|
|
534
|
+
rest. The window is an element of its own tag, without `is` and without a box of its own — the
|
|
535
|
+
list or table inside is laid out as if it were not there; `el.enabled = false` turns it off. A
|
|
536
|
+
list taken out of the window draws all of its items again.
|
|
537
|
+
|
|
538
|
+
```html
|
|
539
|
+
<so-virtual>
|
|
540
|
+
<div is="so-list-box" max-rows="8" aria_label="Items"></div>
|
|
541
|
+
</so-virtual>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
From JavaScript the element is the component: props are its properties, events are DOM events, and
|
|
545
|
+
a core instance can be handed over as `ctrl` before the element is connected. `instanceof` with the
|
|
546
|
+
element class gives the node with its props typed (TypeScript 5.3+):
|
|
547
|
+
|
|
548
|
+
```ts
|
|
549
|
+
import { TButton } from '@soxa-ui/core'
|
|
550
|
+
import { TButtonElement } from '@soxa-ui/webc'
|
|
551
|
+
|
|
552
|
+
const el = document.createElement('button', { is: 'so-button' })
|
|
553
|
+
|
|
554
|
+
if (el instanceof TButtonElement) {
|
|
555
|
+
el.ctrl = new TButton({ text: 'Save' })
|
|
556
|
+
el.addEventListener('so:action:press', () => console.log('pressed'))
|
|
557
|
+
document.body.append(el)
|
|
558
|
+
}
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
The language of the strings the library renders itself and the locale for `Intl` come from the
|
|
562
|
+
nearest `<so-locale-provider>` above an element; without one, components are in English. The
|
|
563
|
+
provider has no box of its own (its children lay out as if it were not there), and its `locale` is a
|
|
564
|
+
property — a locale is an object, so there is no attribute. Changing it updates the components in
|
|
565
|
+
place, and a nested provider gives its subtree a language of its own:
|
|
566
|
+
|
|
567
|
+
```html
|
|
568
|
+
<so-locale-provider>
|
|
569
|
+
<button is="so-button" text="Save"></button>
|
|
570
|
+
</so-locale-provider>
|
|
571
|
+
|
|
572
|
+
<script type="module">
|
|
573
|
+
import { ruRU } from '@soxa-ui/plugins'
|
|
574
|
+
|
|
575
|
+
document.querySelector('so-locale-provider').locale = ruRU
|
|
576
|
+
</script>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
The application plugs in a theme and an icon pack once, in its entry point:
|
|
580
|
+
|
|
581
|
+
```ts
|
|
582
|
+
import { useIcons, useTheme } from '@soxa-ui/setup'
|
|
583
|
+
import * as material from '@soxa-ui/icons-material'
|
|
584
|
+
import oren from '@soxa-ui/theme-oren/setup'
|
|
585
|
+
|
|
586
|
+
import '@soxa-ui/theme-oren'
|
|
587
|
+
|
|
588
|
+
useIcons(material)
|
|
589
|
+
useTheme(oren)
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
`@soxa-ui/theme-oren` is the stylesheet of every component. To take only the components your
|
|
593
|
+
pages use, import their stylesheets instead — `@soxa-ui/theme-oren/button.css`,
|
|
594
|
+
`@soxa-ui/theme-oren/select.css`, one per component, each with the shared part of the theme: the stylesheet of a component goes along with the entry of its element (`@soxa-ui/webc/button`)
|
|
595
|
+
(the theme's README, [Only the components you use](https://github.com/youra-h/soxa-ui/tree/main/packages/themes/oren#only-the-components-you-use)).
|
|
596
|
+
|
|
597
|
+
## Documentation
|
|
598
|
+
|
|
599
|
+
- [Soxa UI README](https://github.com/youra-h/soxa-ui#readme) — the component set and what each
|
|
600
|
+
adapter implements so far.
|
|
601
|
+
- [Architecture overview](https://github.com/youra-h/soxa-ui/blob/main/docs/architecture.md) —
|
|
602
|
+
layers, descriptors, plugins, collections, adapters.
|
|
603
|
+
|
|
604
|
+
## Public API
|
|
605
|
+
|
|
606
|
+
The package entry exports application components, their consumer types, the locale provider,
|
|
607
|
+
and the supported icon and toast helpers. Component props, slots, events, refs and core models
|
|
608
|
+
passed through `ctrl` remain the supported ways to customize the UI. Models come from
|
|
609
|
+
`@soxa-ui/core`; theme, icon and external-plugin registration comes from `@soxa-ui/setup`.
|
|
610
|
+
|
|
611
|
+
Assembly functions, adapter profiles, bindings, generated metadata and rendering templates
|
|
612
|
+
are private implementation details. They are no longer exported from the package entry, and
|
|
613
|
+
there is no public `/internal` entry. Code that imported them must use the component contract
|
|
614
|
+
instead. Building a new adapter component from Soxa's assembly helpers is not a supported
|
|
615
|
+
public SDK.
|
|
616
|
+
|
|
617
|
+
The same boundary applies to individual element entries such as `@soxa-ui/webc/button`.
|
|
618
|
+
They export the element classes and consumer types, and the documented helpers associated
|
|
619
|
+
with that entry. Importing an entry still registers its elements and required parts.
|
|
620
|
+
|
|
621
|
+
## License
|
|
622
|
+
|
|
623
|
+
[MIT](https://github.com/youra-h/soxa-ui/blob/main/LICENSE)
|