@groupteknology/vuno 1.0.0 → 2.0.0
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/README.md +53 -27
- package/dist/module.d.mts +14 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +80 -13
- package/dist/runtime/app/assets/css/dialog.css +1 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/assets/css/stylesheet.css +1 -0
- package/dist/runtime/app/assets/css/theme.css +1 -0
- package/dist/runtime/app/assets/css/tokens.css +1 -0
- package/dist/runtime/app/components/Alert/Alert.d.vue.ts +20 -0
- package/dist/runtime/app/components/Alert/Alert.theme.d.ts +13 -0
- package/dist/runtime/app/components/Alert/Alert.theme.js +13 -0
- package/dist/runtime/app/components/Alert/Alert.vue +59 -0
- package/dist/runtime/app/components/Alert/Alert.vue.d.ts +20 -0
- package/dist/runtime/app/components/App/App.d.vue.ts +52 -0
- package/dist/runtime/app/components/App/App.vue +150 -0
- package/dist/runtime/app/components/App/App.vue.d.ts +52 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.d.vue.ts +7 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue +39 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue.d.ts +7 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.d.vue.ts +8 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +19 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue.d.ts +8 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +13 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +18 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue +64 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue.d.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +15 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +16 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue +100 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue.d.ts +11 -0
- package/dist/runtime/app/components/Avatar/Avatar.d.vue.ts +27 -0
- package/dist/runtime/app/components/Avatar/Avatar.theme.d.ts +30 -0
- package/dist/runtime/app/components/Avatar/Avatar.theme.js +22 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue +51 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue.d.ts +27 -0
- package/dist/runtime/app/components/Badge/Badge.d.vue.ts +40 -0
- package/dist/runtime/app/components/Badge/Badge.theme.d.ts +40 -0
- package/dist/runtime/app/components/Badge/Badge.theme.js +22 -0
- package/dist/runtime/app/components/Badge/Badge.vue +28 -0
- package/dist/runtime/app/components/Badge/Badge.vue.d.ts +40 -0
- package/dist/runtime/app/components/Button/Button.d.vue.ts +49 -0
- package/dist/runtime/app/components/Button/Button.theme.d.ts +88 -0
- package/dist/runtime/app/components/Button/Button.theme.js +59 -0
- package/dist/runtime/app/components/Button/Button.vue +78 -0
- package/dist/runtime/app/components/Button/Button.vue.d.ts +49 -0
- package/dist/runtime/app/components/Card/Card.d.vue.ts +94 -0
- package/dist/runtime/app/components/Card/Card.theme.d.ts +57 -0
- package/dist/runtime/app/components/Card/Card.theme.js +62 -0
- package/dist/runtime/app/components/Card/Card.vue +45 -0
- package/dist/runtime/app/components/Card/Card.vue.d.ts +94 -0
- package/dist/runtime/app/components/Code/Code.d.vue.ts +19 -0
- package/dist/runtime/app/components/Code/Code.theme.d.ts +11 -0
- package/dist/runtime/app/components/Code/Code.theme.js +12 -0
- package/dist/runtime/app/components/Code/Code.vue +109 -0
- package/dist/runtime/app/components/Code/Code.vue.d.ts +19 -0
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +35 -0
- package/dist/runtime/app/components/Confirm/Confirm.theme.d.ts +12 -0
- package/dist/runtime/app/components/Confirm/Confirm.theme.js +13 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue +83 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +35 -0
- package/dist/runtime/app/components/Container/Container.d.vue.ts +42 -0
- package/dist/runtime/app/components/Container/Container.theme.d.ts +53 -0
- package/dist/runtime/app/components/Container/Container.theme.js +31 -0
- package/dist/runtime/app/components/Container/Container.vue +20 -0
- package/dist/runtime/app/components/Container/Container.vue.d.ts +42 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.d.ts +16 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.js +13 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.d.ts +12 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.js +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue +173 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.js +2 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +39 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.d.vue.ts +40 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.d.ts +30 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.js +10 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue +40 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue.d.ts +40 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.d.ts +27 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.js +18 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue +88 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.js +2 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +51 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.js +2 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue +99 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.d.vue.ts +66 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +88 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +55 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue +187 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue.d.ts +66 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +24 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.js +2 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue +61 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +24 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.js +2 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +47 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.js +2 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +62 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.js +2 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +41 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.d.vue.ts +32 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.d.ts +54 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.js +31 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue +80 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue.d.ts +32 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +17 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.d.ts +6 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.js +7 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +74 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +17 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.js +2 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +45 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +97 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.js +49 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +196 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +97 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/option.d.ts +25 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/option.js +6 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.d.ts +30 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.js +142 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.js +2 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue +113 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.js +2 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +37 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.d.ts +39 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.js +20 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue +46 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.js +2 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue +41 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.d.ts +34 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.js +20 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +97 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.js +2 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +45 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.d.vue.ts +34 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.js +37 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue +43 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue.d.ts +34 -0
- package/dist/runtime/app/components/Form/Form.d.vue.ts +52 -0
- package/dist/runtime/app/components/Form/Form.theme.d.ts +9 -0
- package/dist/runtime/app/components/Form/Form.theme.js +10 -0
- package/dist/runtime/app/components/Form/Form.vue +129 -0
- package/dist/runtime/app/components/Form/Form.vue.d.ts +52 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.d.vue.ts +7 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue +67 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue.d.ts +7 -0
- package/dist/runtime/app/components/Form/internal/grid.d.ts +9 -0
- package/dist/runtime/app/components/Form/internal/grid.js +91 -0
- package/dist/runtime/app/components/Form/internal/standard-schema.d.ts +29 -0
- package/dist/runtime/app/components/Form/internal/standard-schema.js +15 -0
- package/dist/runtime/app/components/Form/internal/useVunoFormState.d.ts +43 -0
- package/dist/runtime/app/components/Form/internal/useVunoFormState.js +81 -0
- package/dist/runtime/app/components/FormField/FormField.d.vue.ts +35 -0
- package/dist/runtime/app/components/FormField/FormField.theme.d.ts +62 -0
- package/dist/runtime/app/components/FormField/FormField.theme.js +28 -0
- package/dist/runtime/app/components/FormField/FormField.vue +124 -0
- package/dist/runtime/app/components/FormField/FormField.vue.d.ts +35 -0
- package/dist/runtime/app/components/FormModal/FormModal.d.vue.ts +63 -0
- package/dist/runtime/app/components/FormModal/FormModal.theme.d.ts +8 -0
- package/dist/runtime/app/components/FormModal/FormModal.theme.js +9 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue +95 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue.d.ts +63 -0
- package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +15 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.d.ts +12 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.js +14 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue +45 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +15 -0
- package/dist/runtime/app/components/Icon/Icon.d.vue.ts +6 -0
- package/dist/runtime/app/components/Icon/Icon.vue +32 -0
- package/dist/runtime/app/components/Icon/Icon.vue.d.ts +6 -0
- package/dist/runtime/app/components/Menu/Menu.d.vue.ts +36 -0
- package/dist/runtime/app/components/Menu/Menu.theme.d.ts +17 -0
- package/dist/runtime/app/components/Menu/Menu.theme.js +20 -0
- package/dist/runtime/app/components/Menu/Menu.vue +182 -0
- package/dist/runtime/app/components/Menu/Menu.vue.d.ts +36 -0
- package/dist/runtime/app/components/Modal/Modal.d.vue.ts +43 -0
- package/dist/runtime/app/components/Modal/Modal.theme.d.ts +59 -0
- package/dist/runtime/app/components/Modal/Modal.theme.js +47 -0
- package/dist/runtime/app/components/Modal/Modal.vue +215 -0
- package/dist/runtime/app/components/Modal/Modal.vue.d.ts +43 -0
- package/dist/runtime/app/components/Navbar/Navbar.d.vue.ts +45 -0
- package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +31 -0
- package/dist/runtime/app/components/Navbar/Navbar.theme.js +32 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue +47 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue.d.ts +45 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +38 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.d.ts +32 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.js +35 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue +187 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +38 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +31 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.d.ts +26 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.js +27 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +236 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +31 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +14 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.d.ts +9 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.js +10 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +81 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +14 -0
- package/dist/runtime/app/components/Page/Page.d.vue.ts +40 -0
- package/dist/runtime/app/components/Page/Page.theme.d.ts +32 -0
- package/dist/runtime/app/components/Page/Page.theme.js +31 -0
- package/dist/runtime/app/components/Page/Page.vue +132 -0
- package/dist/runtime/app/components/Page/Page.vue.d.ts +40 -0
- package/dist/runtime/app/components/Pagination/Pagination.d.vue.ts +33 -0
- package/dist/runtime/app/components/Pagination/Pagination.theme.d.ts +13 -0
- package/dist/runtime/app/components/Pagination/Pagination.theme.js +14 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue +129 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue.d.ts +33 -0
- package/dist/runtime/app/components/Slideover/Slideover.d.vue.ts +43 -0
- package/dist/runtime/app/components/Slideover/Slideover.theme.d.ts +35 -0
- package/dist/runtime/app/components/Slideover/Slideover.theme.js +24 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue +58 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue.d.ts +43 -0
- package/dist/runtime/app/components/State/State.d.vue.ts +14 -0
- package/dist/runtime/app/components/State/State.theme.d.ts +19 -0
- package/dist/runtime/app/components/State/State.theme.js +26 -0
- package/dist/runtime/app/components/State/State.vue +66 -0
- package/dist/runtime/app/components/State/State.vue.d.ts +14 -0
- package/dist/runtime/app/components/Table/Table.d.vue.ts +80 -0
- package/dist/runtime/app/components/Table/Table.theme.d.ts +50 -0
- package/dist/runtime/app/components/Table/Table.theme.js +64 -0
- package/dist/runtime/app/components/Table/Table.vue +483 -0
- package/dist/runtime/app/components/Table/Table.vue.d.ts +80 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue +26 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.js +11 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +32 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue +16 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue +21 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue +24 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue +17 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.d.ts +13 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.js +11 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue +16 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.d.vue.ts +22 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue +48 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue.d.ts +22 -0
- package/dist/runtime/app/components/Table/internal/column.d.ts +9 -0
- package/dist/runtime/app/components/Table/internal/column.js +5 -0
- package/dist/runtime/app/components/Table/internal/query.d.ts +18 -0
- package/dist/runtime/app/components/Table/internal/query.js +8 -0
- package/dist/runtime/app/components/Table/internal/selection.d.ts +29 -0
- package/dist/runtime/app/components/Table/internal/selection.js +10 -0
- package/dist/runtime/app/components/Table/internal/useVunoTable.d.ts +93 -0
- package/dist/runtime/app/components/Table/internal/useVunoTable.js +153 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.js +29 -0
- package/dist/runtime/app/components/Tabs/Tabs.d.vue.ts +49 -0
- package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +32 -0
- package/dist/runtime/app/components/Tabs/Tabs.theme.js +23 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue +119 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue.d.ts +49 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.d.vue.ts +40 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.d.ts +12 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.js +13 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue +139 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue.d.ts +40 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.d.vue.ts +41 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.d.ts +50 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.js +38 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue +33 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue.d.ts +41 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.d.vue.ts +23 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue +63 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue.d.ts +23 -0
- package/dist/runtime/app/components/internal/Input/Input.d.vue.ts +52 -0
- package/dist/runtime/app/components/internal/Input/Input.theme.d.ts +30 -0
- package/dist/runtime/app/components/internal/Input/Input.theme.js +21 -0
- package/dist/runtime/app/components/internal/Input/Input.vue +66 -0
- package/dist/runtime/app/components/internal/Input/Input.vue.d.ts +52 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.d.vue.ts +36 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.d.ts +31 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.js +26 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue +221 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue.d.ts +36 -0
- package/dist/runtime/app/components/internal/NumberInput/number.d.ts +42 -0
- package/dist/runtime/app/components/internal/NumberInput/number.js +64 -0
- package/dist/runtime/app/composables/defineShortcuts.d.ts +19 -0
- package/dist/runtime/app/composables/defineShortcuts.js +68 -0
- package/dist/runtime/app/composables/internal/useVunoAnchor.d.ts +45 -0
- package/dist/runtime/app/composables/internal/useVunoAnchor.js +35 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +17 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.js +18 -0
- package/dist/runtime/app/composables/internal/useVunoPortal.d.ts +18 -0
- package/dist/runtime/app/composables/internal/useVunoPortal.js +12 -0
- package/dist/runtime/app/composables/useConfirm.d.ts +15 -0
- package/dist/runtime/app/composables/useConfirm.js +5 -0
- package/dist/runtime/app/composables/useContext.d.ts +11 -0
- package/dist/runtime/app/composables/useContext.js +9 -0
- package/dist/runtime/app/composables/useCrud.d.ts +23 -0
- package/dist/runtime/app/composables/useCrud.js +153 -0
- package/dist/runtime/app/composables/useField.d.ts +10 -0
- package/dist/runtime/app/composables/useField.js +42 -0
- package/dist/runtime/app/composables/useForm.d.ts +5 -0
- package/dist/runtime/app/composables/useForm.js +9 -0
- package/dist/runtime/app/composables/useModal.d.ts +21 -0
- package/dist/runtime/app/composables/useModal.js +24 -0
- package/dist/runtime/app/composables/useOverlay.d.ts +22 -0
- package/dist/runtime/app/composables/useOverlay.js +10 -0
- package/dist/runtime/app/composables/useTableQuery.d.ts +10 -0
- package/dist/runtime/app/composables/useTableQuery.js +126 -0
- package/dist/runtime/app/composables/useTheme.d.ts +31 -0
- package/dist/runtime/app/composables/useTheme.js +29 -0
- package/dist/runtime/app/composables/useToast.d.ts +28 -0
- package/dist/runtime/app/composables/useToast.js +13 -0
- package/dist/runtime/app/internal/keys.d.ts +43 -0
- package/dist/runtime/app/internal/keys.js +8 -0
- package/dist/runtime/app/internal/slots.d.ts +22 -0
- package/dist/runtime/app/internal/slots.js +24 -0
- package/dist/runtime/app/plugins/vue-query.d.ts +8 -0
- package/dist/runtime/app/plugins/vue-query.js +13 -0
- package/dist/runtime/app/theme/icons.d.ts +2 -0
- package/dist/runtime/app/theme/icons.js +43 -0
- package/dist/runtime/app/theme/index.d.ts +1168 -0
- package/dist/runtime/app/theme/index.js +120 -0
- package/dist/runtime/app/theme/messages.d.ts +2 -0
- package/dist/runtime/app/theme/messages.js +70 -0
- package/dist/runtime/app/theme/shared.d.ts +42 -0
- package/dist/runtime/app/theme/shared.js +24 -0
- package/dist/runtime/app/types/alert.d.ts +13 -0
- package/dist/runtime/app/types/alert.js +0 -0
- package/dist/runtime/app/types/app-config.d.ts +8 -0
- package/dist/runtime/app/types/app-config.js +1 -0
- package/dist/runtime/app/types/app.d.ts +83 -0
- package/dist/runtime/app/types/app.js +0 -0
- package/dist/runtime/app/types/base.d.ts +78 -0
- package/dist/runtime/app/types/base.js +0 -0
- package/dist/runtime/app/types/confirm.d.ts +19 -0
- package/dist/runtime/app/types/confirm.js +0 -0
- package/dist/runtime/app/types/crud.d.ts +108 -0
- package/dist/runtime/app/types/crud.js +0 -0
- package/dist/runtime/app/types/field-type.d.ts +4 -0
- package/dist/runtime/app/types/field-type.js +0 -0
- package/dist/runtime/app/types/field.d.ts +233 -0
- package/dist/runtime/app/types/field.js +0 -0
- package/dist/runtime/app/types/form.d.ts +67 -0
- package/dist/runtime/app/types/form.js +0 -0
- package/dist/runtime/app/types/index.d.ts +16 -0
- package/dist/runtime/app/types/index.js +1 -0
- package/dist/runtime/app/types/page.d.ts +61 -0
- package/dist/runtime/app/types/page.js +0 -0
- package/dist/runtime/app/types/responsive.d.ts +8 -0
- package/dist/runtime/app/types/responsive.js +0 -0
- package/dist/runtime/app/types/shortcuts.d.ts +44 -0
- package/dist/runtime/app/types/shortcuts.js +0 -0
- package/dist/runtime/app/types/slots.d.ts +30 -0
- package/dist/runtime/app/types/slots.js +0 -0
- package/dist/runtime/app/types/state.d.ts +35 -0
- package/dist/runtime/app/types/state.js +0 -0
- package/dist/runtime/app/types/table.d.ts +287 -0
- package/dist/runtime/app/types/table.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +251 -0
- package/dist/runtime/app/types/theme.js +0 -0
- package/dist/runtime/app/utils/format.d.ts +18 -0
- package/dist/runtime/app/utils/format.js +36 -0
- package/dist/runtime/app/utils/pagination.d.ts +41 -0
- package/dist/runtime/app/utils/pagination.js +32 -0
- package/dist/runtime/app/utils/path.d.ts +16 -0
- package/dist/runtime/app/utils/path.js +76 -0
- package/dist/runtime/app/utils/query-key.d.ts +20 -0
- package/dist/runtime/app/utils/query-key.js +7 -0
- package/dist/runtime/app/utils/theme.d.ts +44 -0
- package/dist/runtime/app/utils/theme.js +43 -0
- package/dist/types.d.mts +3 -11
- package/package.json +18 -3
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const selectTheme = defineTheme("select", {
|
|
3
|
+
slots: {
|
|
4
|
+
/*
|
|
5
|
+
* La lista es a la vez la caja y lo que se desplaza: ya no hay un
|
|
6
|
+
* viewport dentro, así que el alto máximo y el `overflow` van en el
|
|
7
|
+
* mismo elemento y no hay dos cajas que sumar.
|
|
8
|
+
*
|
|
9
|
+
* Las dos medidas las publica el componente al colocarla:
|
|
10
|
+
* `--vuno-select-width` es el ancho del campo, para que la lista
|
|
11
|
+
* mida lo mismo, y `--vuno-select-available-height` es el hueco que
|
|
12
|
+
* queda hasta el borde —la ventana, o el diálogo si lo hay—. El
|
|
13
|
+
* respaldo de las dos importa: se leen antes del primer cálculo, y
|
|
14
|
+
* sin él la lista aparecería sin ancho durante un fotograma.
|
|
15
|
+
*/
|
|
16
|
+
content: "z-50 max-h-[min(18rem,var(--vuno-select-available-height,18rem))] w-(--vuno-select-width,16rem) overflow-y-auto rounded-sm border border-vuno-border bg-vuno-surface-1 p-1 shadow-lg",
|
|
17
|
+
empty: "px-2 py-3 text-center text-sm text-vuno-muted",
|
|
18
|
+
/*
|
|
19
|
+
* El control y su disparador. Estaban escritos en la plantilla, de
|
|
20
|
+
* modo que el color del texto de sugerencia y el relleno del campo
|
|
21
|
+
* donde se teclea no se podían tocar desde el proyecto.
|
|
22
|
+
*
|
|
23
|
+
* Es casi lo mismo que `input.base` —solo añade el relleno
|
|
24
|
+
* vertical—, y esa cercanía es a propósito: un combobox tiene que
|
|
25
|
+
* parecerse a un input hasta en el detalle. Si divergen, se unifican.
|
|
26
|
+
*/
|
|
27
|
+
input: "w-full min-w-0 bg-transparent py-1 outline-none placeholder:text-vuno-subtle disabled:cursor-not-allowed",
|
|
28
|
+
item: "flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-vuno-body outline-none data-disabled:cursor-not-allowed data-disabled:opacity-50 data-highlighted:bg-vuno-surface-2 data-highlighted:text-vuno-strong",
|
|
29
|
+
itemIcon: "size-4",
|
|
30
|
+
itemIndicator: "shrink-0 text-vuno-primary",
|
|
31
|
+
trigger: "ms-auto inline-flex shrink-0 items-center self-stretch text-vuno-muted transition-colors hover:text-vuno-body disabled:cursor-not-allowed",
|
|
32
|
+
triggerIcon: "size-4"
|
|
33
|
+
},
|
|
34
|
+
/*
|
|
35
|
+
* La opción y el margen del disparador siguen al tamaño del campo: con
|
|
36
|
+
* un texto fijo, un select `xs` abriría una lista con la letra más
|
|
37
|
+
* grande que su propio disparador; con un margen fijo, la flecha no
|
|
38
|
+
* conservaría la misma proporción respecto a la caja.
|
|
39
|
+
*/
|
|
40
|
+
variants: {
|
|
41
|
+
size: {
|
|
42
|
+
xs: { item: "text-xs", trigger: "me-2" },
|
|
43
|
+
sm: { item: "text-sm", trigger: "me-2.5" },
|
|
44
|
+
md: { item: "text-sm", trigger: "me-3" },
|
|
45
|
+
lg: { item: "text-base", trigger: "me-3.5" },
|
|
46
|
+
xl: { item: "text-base", trigger: "me-4" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { size as sizeMiddleware } from "@floating-ui/dom";
|
|
3
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, useId, useTemplateRef, watch } from "vue";
|
|
4
|
+
import { useVunoAnchor } from "#vuno/composables/internal/useVunoAnchor";
|
|
5
|
+
import { useVunoPortal } from "#vuno/composables/internal/useVunoPortal";
|
|
6
|
+
import { useIcons, useMessages, useTheme } from "#vuno/composables/useTheme";
|
|
7
|
+
import { toOptionKey } from "#vuno/components/FieldSelect/internal/Select/option";
|
|
8
|
+
import { useVunoSelectState } from "#vuno/components/FieldSelect/internal/Select/useVunoSelectState";
|
|
9
|
+
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
10
|
+
import ControlShell from "#vuno/components/internal/ControlShell/ControlShell.vue";
|
|
11
|
+
defineOptions({ name: "VunoSelect", inheritAttrs: false });
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
name: { default: void 0, type: String },
|
|
14
|
+
disabled: Boolean,
|
|
15
|
+
items: { required: true, type: Array },
|
|
16
|
+
modelValue: {
|
|
17
|
+
default: void 0,
|
|
18
|
+
type: [String, Number, Boolean, Array, Object]
|
|
19
|
+
},
|
|
20
|
+
multiple: Boolean,
|
|
21
|
+
placeholder: { default: void 0, type: String },
|
|
22
|
+
portal: { default: void 0, type: [String, Boolean] },
|
|
23
|
+
radius: { default: void 0, type: String },
|
|
24
|
+
required: Boolean,
|
|
25
|
+
searchable: Boolean,
|
|
26
|
+
size: { default: void 0, type: String },
|
|
27
|
+
ui: { default: void 0, type: Object }
|
|
28
|
+
});
|
|
29
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
30
|
+
const model = computed({
|
|
31
|
+
get: () => props.modelValue,
|
|
32
|
+
set: (value) => emit("update:modelValue", value)
|
|
33
|
+
});
|
|
34
|
+
const icons = useIcons();
|
|
35
|
+
const messages = useMessages();
|
|
36
|
+
const portalTarget = useVunoPortal(() => props.portal);
|
|
37
|
+
const uid = useId();
|
|
38
|
+
const listId = `${uid}-list`;
|
|
39
|
+
const boundary = shallowRef(void 0);
|
|
40
|
+
const control = useTemplateRef("control");
|
|
41
|
+
const input = useTemplateRef("input");
|
|
42
|
+
const list = useTemplateRef("list");
|
|
43
|
+
const mounted = shallowRef(false);
|
|
44
|
+
const fieldSize = computed(() => props.size ?? "md");
|
|
45
|
+
const ui = useTheme(
|
|
46
|
+
"select",
|
|
47
|
+
() => props.ui,
|
|
48
|
+
() => ({ size: fieldSize.value })
|
|
49
|
+
);
|
|
50
|
+
const optionId = (key) => `${uid}-${key.replace(/[^\w-]/g, "_")}`;
|
|
51
|
+
const { onInput, onKeydown, activeKey, choose, close, highlighted, isSelected, open, openList, text, toggle, visibleItems } = useVunoSelectState({
|
|
52
|
+
model,
|
|
53
|
+
optionId,
|
|
54
|
+
disabled: () => props.disabled,
|
|
55
|
+
input: () => input.value ?? void 0,
|
|
56
|
+
items: () => props.items,
|
|
57
|
+
list: () => list.value ?? void 0,
|
|
58
|
+
multiple: () => props.multiple,
|
|
59
|
+
searchable: () => props.searchable
|
|
60
|
+
});
|
|
61
|
+
const { anchor, release } = useVunoAnchor({
|
|
62
|
+
boundary: () => boundary.value,
|
|
63
|
+
middleware: () => [
|
|
64
|
+
sizeMiddleware({
|
|
65
|
+
boundary: boundary.value,
|
|
66
|
+
padding: 8,
|
|
67
|
+
apply: ({ availableHeight, elements, rects }) => {
|
|
68
|
+
elements.floating.style.setProperty("--vuno-select-width", `${rects.reference.width}px`);
|
|
69
|
+
elements.floating.style.setProperty("--vuno-select-available-height", `${availableHeight}px`);
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
function onPointerDownOutside(event) {
|
|
75
|
+
const target = event.target;
|
|
76
|
+
if (!target) return;
|
|
77
|
+
const inControl = control.value?.$el?.contains(target);
|
|
78
|
+
if (inControl || list.value?.contains(target)) return;
|
|
79
|
+
close();
|
|
80
|
+
}
|
|
81
|
+
function place() {
|
|
82
|
+
anchor(control.value?.$el, list.value ?? void 0);
|
|
83
|
+
}
|
|
84
|
+
watch(open, (isOpen) => {
|
|
85
|
+
if (!isOpen) {
|
|
86
|
+
release();
|
|
87
|
+
document.removeEventListener("pointerdown", onPointerDownOutside, true);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
boundary.value = control.value?.$el?.closest("dialog") ?? void 0;
|
|
91
|
+
void nextTick(() => {
|
|
92
|
+
place();
|
|
93
|
+
document.addEventListener("pointerdown", onPointerDownOutside, true);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
onMounted(() => mounted.value = true);
|
|
97
|
+
onBeforeUnmount(() => {
|
|
98
|
+
release();
|
|
99
|
+
document.removeEventListener("pointerdown", onPointerDownOutside, true);
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<ControlShell
|
|
105
|
+
ref="control"
|
|
106
|
+
:radius="props.radius"
|
|
107
|
+
:size="fieldSize"
|
|
108
|
+
:ui="props.ui"
|
|
109
|
+
>
|
|
110
|
+
<input
|
|
111
|
+
v-bind="$attrs"
|
|
112
|
+
ref="input"
|
|
113
|
+
:aria-activedescendant="open && activeKey ? optionId(activeKey) : void 0"
|
|
114
|
+
aria-autocomplete="list"
|
|
115
|
+
:aria-controls="listId"
|
|
116
|
+
:aria-expanded="open"
|
|
117
|
+
:aria-required="props.required || void 0"
|
|
118
|
+
autocomplete="off"
|
|
119
|
+
:class="[ui.input, { 'cursor-default': !props.searchable }]"
|
|
120
|
+
:disabled="props.disabled"
|
|
121
|
+
:name="props.name"
|
|
122
|
+
:placeholder="props.placeholder ?? messages.selectPlaceholder"
|
|
123
|
+
:readonly="!props.searchable"
|
|
124
|
+
role="combobox"
|
|
125
|
+
:value="text"
|
|
126
|
+
@input="onInput"
|
|
127
|
+
@keydown="onKeydown"
|
|
128
|
+
@pointerdown="!props.searchable && open ? close() : openList()"
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<template #trailing>
|
|
132
|
+
<button
|
|
133
|
+
:aria-controls="listId"
|
|
134
|
+
:aria-expanded="open"
|
|
135
|
+
:aria-label="messages.selectToggle"
|
|
136
|
+
:class="ui.trigger"
|
|
137
|
+
:disabled="props.disabled"
|
|
138
|
+
tabindex="-1"
|
|
139
|
+
type="button"
|
|
140
|
+
@click="toggle"
|
|
141
|
+
>
|
|
142
|
+
<Icon
|
|
143
|
+
:class="ui.triggerIcon"
|
|
144
|
+
:name="icons.selectOpen"
|
|
145
|
+
/>
|
|
146
|
+
</button>
|
|
147
|
+
</template>
|
|
148
|
+
</ControlShell>
|
|
149
|
+
|
|
150
|
+
<Teleport
|
|
151
|
+
v-if="mounted"
|
|
152
|
+
:to="portalTarget"
|
|
153
|
+
>
|
|
154
|
+
<ul
|
|
155
|
+
v-if="open"
|
|
156
|
+
:id="listId"
|
|
157
|
+
ref="list"
|
|
158
|
+
:class="ui.content"
|
|
159
|
+
role="listbox"
|
|
160
|
+
style="position: fixed; top: 0; left: 0"
|
|
161
|
+
>
|
|
162
|
+
<li
|
|
163
|
+
v-if="visibleItems.length === 0"
|
|
164
|
+
:class="ui.empty"
|
|
165
|
+
>
|
|
166
|
+
{{ messages.noMatches }}
|
|
167
|
+
</li>
|
|
168
|
+
|
|
169
|
+
<li
|
|
170
|
+
v-for="(item, index) in visibleItems"
|
|
171
|
+
:id="optionId(toOptionKey(item.value))"
|
|
172
|
+
:key="toOptionKey(item.value)"
|
|
173
|
+
:aria-disabled="item.disabled || void 0"
|
|
174
|
+
:aria-selected="isSelected(item)"
|
|
175
|
+
:class="ui.item"
|
|
176
|
+
:data-disabled="item.disabled || void 0"
|
|
177
|
+
:data-highlighted="index === highlighted || void 0"
|
|
178
|
+
role="option"
|
|
179
|
+
@click="choose(item)"
|
|
180
|
+
@pointermove="item.disabled ? void 0 : highlighted = index"
|
|
181
|
+
>
|
|
182
|
+
<span class="truncate">{{ item.label }}</span>
|
|
183
|
+
|
|
184
|
+
<span
|
|
185
|
+
v-if="isSelected(item)"
|
|
186
|
+
:class="ui.itemIndicator"
|
|
187
|
+
>
|
|
188
|
+
<Icon
|
|
189
|
+
:class="ui.itemIcon"
|
|
190
|
+
:name="icons.selectSelected"
|
|
191
|
+
/>
|
|
192
|
+
</span>
|
|
193
|
+
</li>
|
|
194
|
+
</ul>
|
|
195
|
+
</Teleport>
|
|
196
|
+
</template>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type PropType } from 'vue';
|
|
2
|
+
import type { VunoPortalTarget, VunoRadius, VunoSize } from '#vuno/types/base';
|
|
3
|
+
import type { VunoFieldOption, VunoFieldOptionValue } from '#vuno/types/field';
|
|
4
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
name: {
|
|
7
|
+
default: undefined;
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
};
|
|
10
|
+
disabled: BooleanConstructor;
|
|
11
|
+
items: {
|
|
12
|
+
required: true;
|
|
13
|
+
type: PropType<VunoFieldOption[]>;
|
|
14
|
+
};
|
|
15
|
+
modelValue: {
|
|
16
|
+
default: undefined;
|
|
17
|
+
type: PropType<undefined | VunoFieldOptionValue | VunoFieldOptionValue[]>;
|
|
18
|
+
};
|
|
19
|
+
multiple: BooleanConstructor;
|
|
20
|
+
placeholder: {
|
|
21
|
+
default: undefined;
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
portal: {
|
|
25
|
+
default: undefined;
|
|
26
|
+
type: PropType<VunoPortalTarget>;
|
|
27
|
+
};
|
|
28
|
+
radius: {
|
|
29
|
+
default: undefined;
|
|
30
|
+
type: PropType<VunoRadius>;
|
|
31
|
+
};
|
|
32
|
+
required: BooleanConstructor;
|
|
33
|
+
searchable: BooleanConstructor;
|
|
34
|
+
size: {
|
|
35
|
+
default: undefined;
|
|
36
|
+
type: PropType<VunoSize>;
|
|
37
|
+
};
|
|
38
|
+
ui: {
|
|
39
|
+
default: undefined;
|
|
40
|
+
type: PropType<VunoUi<"control" | "select">>;
|
|
41
|
+
};
|
|
42
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:modelValue": (value: VunoFieldOptionValue | VunoFieldOptionValue[] | undefined) => any;
|
|
44
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
+
name: {
|
|
46
|
+
default: undefined;
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
};
|
|
49
|
+
disabled: BooleanConstructor;
|
|
50
|
+
items: {
|
|
51
|
+
required: true;
|
|
52
|
+
type: PropType<VunoFieldOption[]>;
|
|
53
|
+
};
|
|
54
|
+
modelValue: {
|
|
55
|
+
default: undefined;
|
|
56
|
+
type: PropType<undefined | VunoFieldOptionValue | VunoFieldOptionValue[]>;
|
|
57
|
+
};
|
|
58
|
+
multiple: BooleanConstructor;
|
|
59
|
+
placeholder: {
|
|
60
|
+
default: undefined;
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
};
|
|
63
|
+
portal: {
|
|
64
|
+
default: undefined;
|
|
65
|
+
type: PropType<VunoPortalTarget>;
|
|
66
|
+
};
|
|
67
|
+
radius: {
|
|
68
|
+
default: undefined;
|
|
69
|
+
type: PropType<VunoRadius>;
|
|
70
|
+
};
|
|
71
|
+
required: BooleanConstructor;
|
|
72
|
+
searchable: BooleanConstructor;
|
|
73
|
+
size: {
|
|
74
|
+
default: undefined;
|
|
75
|
+
type: PropType<VunoSize>;
|
|
76
|
+
};
|
|
77
|
+
ui: {
|
|
78
|
+
default: undefined;
|
|
79
|
+
type: PropType<VunoUi<"control" | "select">>;
|
|
80
|
+
};
|
|
81
|
+
}>> & Readonly<{
|
|
82
|
+
"onUpdate:modelValue"?: ((value: VunoFieldOptionValue | VunoFieldOptionValue[] | undefined) => any) | undefined;
|
|
83
|
+
}>, {
|
|
84
|
+
radius: VunoRadius;
|
|
85
|
+
size: VunoSize;
|
|
86
|
+
name: string;
|
|
87
|
+
required: boolean;
|
|
88
|
+
ui: Partial<Record<"root" | ("input" | "item" | "content" | "empty" | "itemIcon" | "itemIndicator" | "trigger" | "triggerIcon"), string | string[] | undefined>>;
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
modelValue: VunoFieldOptionValue | VunoFieldOptionValue[] | undefined;
|
|
91
|
+
placeholder: string;
|
|
92
|
+
multiple: boolean;
|
|
93
|
+
portal: VunoPortalTarget;
|
|
94
|
+
searchable: boolean;
|
|
95
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
96
|
+
declare const _default: typeof __VLS_export;
|
|
97
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { VunoFieldOptionValue } from '#vuno/types/field';
|
|
2
|
+
/**
|
|
3
|
+
* Clave estable con la que un valor de opción viaja por dentro del combobox.
|
|
4
|
+
*
|
|
5
|
+
* vuno admite `string | number | boolean | bigint | object | null`, incluida la
|
|
6
|
+
* cadena vacía, en sus opciones. Los valores entran como una clave interna no
|
|
7
|
+
* vacía y se devuelven tal cual estaban al salir.
|
|
8
|
+
*
|
|
9
|
+
* La clave lleva el tipo delante porque sin él `1` y `'1'`, o `true` y
|
|
10
|
+
* `'true'`, compartirían clave: elegir una opción seleccionaría la otra, y no
|
|
11
|
+
* en todas las listas hay las dos como para que alguien lo note.
|
|
12
|
+
*
|
|
13
|
+
* `null` se nombra aparte porque su `typeof` es `'object'`, que no lo
|
|
14
|
+
* distingue de nada.
|
|
15
|
+
*/
|
|
16
|
+
export declare function toOptionKey(value: VunoFieldOptionValue): string;
|
|
17
|
+
/**
|
|
18
|
+
* El texto de un valor a partir de su clave, para cuando no hay etiqueta.
|
|
19
|
+
*
|
|
20
|
+
* Pasa con un valor que ya no está en la lista —un estado retirado del
|
|
21
|
+
* catálogo, un rol que se borró—: el modelo lo conserva y ninguna opción lo
|
|
22
|
+
* nombra. Enseñar el valor crudo es feo a propósito; dejar el campo en blanco
|
|
23
|
+
* sería peor, porque parecería vacío teniendo valor.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fromOptionKey(key: string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import type { VunoFieldOption, VunoFieldOptionValue } from '#vuno/types/field';
|
|
3
|
+
type SelectModel = undefined | VunoFieldOptionValue | VunoFieldOptionValue[];
|
|
4
|
+
type VunoSelectStateOptions = {
|
|
5
|
+
model: Ref<SelectModel>;
|
|
6
|
+
disabled: () => boolean;
|
|
7
|
+
input: () => HTMLInputElement | undefined;
|
|
8
|
+
items: () => VunoFieldOption[];
|
|
9
|
+
list: () => HTMLElement | undefined;
|
|
10
|
+
multiple: () => boolean;
|
|
11
|
+
optionId: (key: string) => string;
|
|
12
|
+
searchable: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
/** Estado e interacción del combobox, independiente de su disposición y portal. */
|
|
15
|
+
export declare function useVunoSelectState(options: VunoSelectStateOptions): {
|
|
16
|
+
onInput: (event: Event) => void;
|
|
17
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
18
|
+
activeKey: import("vue").ComputedRef<string | undefined>;
|
|
19
|
+
choose: (item: VunoFieldOption) => void;
|
|
20
|
+
close: (refocus?: boolean) => void;
|
|
21
|
+
highlighted: Ref<number, number>;
|
|
22
|
+
isSelected: (item: VunoFieldOption) => boolean;
|
|
23
|
+
open: Ref<boolean, boolean>;
|
|
24
|
+
openList: (edge?: "first" | "last") => void;
|
|
25
|
+
query: Ref<string, string>;
|
|
26
|
+
text: import("vue").ComputedRef<string>;
|
|
27
|
+
toggle: () => void;
|
|
28
|
+
visibleItems: import("vue").ComputedRef<VunoFieldOption[]>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { computed, nextTick, ref } from "vue";
|
|
2
|
+
import { fromOptionKey, toOptionKey } from "./option.js";
|
|
3
|
+
export function useVunoSelectState(options) {
|
|
4
|
+
const open = ref(false);
|
|
5
|
+
const query = ref("");
|
|
6
|
+
const highlighted = ref(-1);
|
|
7
|
+
const selectedKeys = computed(() => {
|
|
8
|
+
if (options.multiple()) return (Array.isArray(options.model.value) ? options.model.value : []).map(toOptionKey);
|
|
9
|
+
return options.model.value === void 0 ? [] : [toOptionKey(options.model.value)];
|
|
10
|
+
});
|
|
11
|
+
const isSelected = (item) => selectedKeys.value.includes(toOptionKey(item.value));
|
|
12
|
+
const displayValue = computed(() => {
|
|
13
|
+
const labelByKey = new Map(options.items().map((item) => [toOptionKey(item.value), item.label]));
|
|
14
|
+
return selectedKeys.value.map((key) => labelByKey.get(key) ?? fromOptionKey(key)).filter((label) => label !== "").join(", ");
|
|
15
|
+
});
|
|
16
|
+
const text = computed(() => open.value && options.searchable() ? query.value : displayValue.value);
|
|
17
|
+
const visibleItems = computed(() => {
|
|
18
|
+
if (!options.searchable() || query.value.trim() === "") return options.items();
|
|
19
|
+
const needle = normalize(query.value);
|
|
20
|
+
return options.items().filter((item) => normalize(item.label).includes(needle));
|
|
21
|
+
});
|
|
22
|
+
const selectableIndexes = computed(() => visibleItems.value.map((item, index) => item.disabled ? -1 : index).filter((index) => index >= 0));
|
|
23
|
+
const activeKey = computed(() => {
|
|
24
|
+
const item = visibleItems.value[highlighted.value];
|
|
25
|
+
return item ? toOptionKey(item.value) : void 0;
|
|
26
|
+
});
|
|
27
|
+
function scrollHighlightIntoView() {
|
|
28
|
+
void nextTick(() => {
|
|
29
|
+
const key = activeKey.value;
|
|
30
|
+
if (!key) return;
|
|
31
|
+
options.list()?.querySelector(`#${CSS.escape(options.optionId(key))}`)?.scrollIntoView({ block: "nearest" });
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function moveHighlight(step) {
|
|
35
|
+
const candidates = selectableIndexes.value;
|
|
36
|
+
if (candidates.length === 0) return;
|
|
37
|
+
const current = candidates.indexOf(highlighted.value);
|
|
38
|
+
const entry = step === 1 ? 0 : candidates.length - 1;
|
|
39
|
+
const next = current === -1 ? entry : (current + step + candidates.length) % candidates.length;
|
|
40
|
+
highlighted.value = candidates[next] ?? -1;
|
|
41
|
+
scrollHighlightIntoView();
|
|
42
|
+
}
|
|
43
|
+
function highlightEdge(edge) {
|
|
44
|
+
const candidates = selectableIndexes.value;
|
|
45
|
+
highlighted.value = (edge === "first" ? candidates[0] : candidates[candidates.length - 1]) ?? -1;
|
|
46
|
+
scrollHighlightIntoView();
|
|
47
|
+
}
|
|
48
|
+
function close(refocus = false) {
|
|
49
|
+
if (!open.value) return;
|
|
50
|
+
open.value = false;
|
|
51
|
+
query.value = "";
|
|
52
|
+
highlighted.value = -1;
|
|
53
|
+
if (refocus) options.input()?.focus();
|
|
54
|
+
}
|
|
55
|
+
function choose(item) {
|
|
56
|
+
if (item.disabled) return;
|
|
57
|
+
if (!options.multiple()) {
|
|
58
|
+
options.model.value = item.value;
|
|
59
|
+
close();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const key = toOptionKey(item.value);
|
|
63
|
+
const current = Array.isArray(options.model.value) ? options.model.value : [];
|
|
64
|
+
options.model.value = current.some((value) => toOptionKey(value) === key) ? current.filter((value) => toOptionKey(value) !== key) : [...current, item.value];
|
|
65
|
+
}
|
|
66
|
+
function openList(edge) {
|
|
67
|
+
if (options.disabled() || open.value) return;
|
|
68
|
+
open.value = true;
|
|
69
|
+
query.value = "";
|
|
70
|
+
const selected = visibleItems.value.findIndex(isSelected);
|
|
71
|
+
if (edge) highlightEdge(edge);
|
|
72
|
+
else highlighted.value = selected;
|
|
73
|
+
void nextTick(scrollHighlightIntoView);
|
|
74
|
+
}
|
|
75
|
+
function toggle() {
|
|
76
|
+
if (open.value) close(true);
|
|
77
|
+
else {
|
|
78
|
+
options.input()?.focus();
|
|
79
|
+
openList();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function onNavigationKey(event) {
|
|
83
|
+
switch (event.key) {
|
|
84
|
+
case "ArrowDown":
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
if (open.value) moveHighlight(1);
|
|
87
|
+
else openList("first");
|
|
88
|
+
return true;
|
|
89
|
+
case "ArrowUp":
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
if (open.value) moveHighlight(-1);
|
|
92
|
+
else openList("last");
|
|
93
|
+
return true;
|
|
94
|
+
case "End":
|
|
95
|
+
case "Home":
|
|
96
|
+
if (!open.value) return true;
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
highlightEdge(event.key === "Home" ? "first" : "last");
|
|
99
|
+
return true;
|
|
100
|
+
default:
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function onCommitKey(event) {
|
|
105
|
+
if (event.key === " " && options.searchable()) return false;
|
|
106
|
+
if (event.key !== "Enter" && event.key !== " ") return false;
|
|
107
|
+
if (!open.value) {
|
|
108
|
+
if (event.key === "Enter") return true;
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
openList();
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
const item = visibleItems.value[highlighted.value];
|
|
114
|
+
if (!item && event.key === " ") return true;
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
if (item) choose(item);
|
|
117
|
+
else close();
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
function onKeydown(event) {
|
|
121
|
+
if (options.disabled()) return;
|
|
122
|
+
if (onNavigationKey(event)) return;
|
|
123
|
+
if (onCommitKey(event)) return;
|
|
124
|
+
if (event.key === "Escape") {
|
|
125
|
+
if (!open.value) return;
|
|
126
|
+
event.preventDefault();
|
|
127
|
+
close(true);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (event.key === "Tab") close();
|
|
131
|
+
}
|
|
132
|
+
function onInput(event) {
|
|
133
|
+
if (!options.searchable()) return;
|
|
134
|
+
query.value = event.target.value;
|
|
135
|
+
highlighted.value = selectableIndexes.value[0] ?? -1;
|
|
136
|
+
if (!open.value) open.value = true;
|
|
137
|
+
}
|
|
138
|
+
return { onInput, onKeydown, activeKey, choose, close, highlighted, isSelected, open, openList, query, text, toggle, visibleItems };
|
|
139
|
+
}
|
|
140
|
+
function normalize(value) {
|
|
141
|
+
return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
142
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VunoFieldSlug } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldSlug, 'columns'>;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|