@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,153 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import { clampPage } from "#vuno/utils/pagination";
|
|
3
|
+
import { getPath } from "#vuno/utils/path";
|
|
4
|
+
import { hasActiveQuery, hasFilterValue } from "#vuno/components/Table/internal/query";
|
|
5
|
+
export function useVunoTable(options) {
|
|
6
|
+
const { query, selection } = options;
|
|
7
|
+
const definition = computed(() => options.definition());
|
|
8
|
+
const total = computed(() => options.total());
|
|
9
|
+
const rowKey = computed(() => definition.value.rowKey ?? "id");
|
|
10
|
+
const pageSizes = computed(() => definition.value.pageSizes ?? [25, 50, 100]);
|
|
11
|
+
const searchable = computed(() => definition.value.searchable ?? true);
|
|
12
|
+
const paginated = computed(() => definition.value.paginated ?? true);
|
|
13
|
+
const getRowId = (row) => String(getPath(row, rowKey.value) ?? "");
|
|
14
|
+
const search = ref(query.value.search);
|
|
15
|
+
let searchTimer;
|
|
16
|
+
watch(search, (value) => {
|
|
17
|
+
clearTimeout(searchTimer);
|
|
18
|
+
searchTimer = setTimeout(() => {
|
|
19
|
+
if (value === query.value.search) return;
|
|
20
|
+
query.value = { ...query.value, page: 1, search: value };
|
|
21
|
+
}, 300);
|
|
22
|
+
});
|
|
23
|
+
watch(
|
|
24
|
+
() => query.value.search,
|
|
25
|
+
(value) => {
|
|
26
|
+
if (value !== search.value) search.value = value;
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
onBeforeUnmount(() => clearTimeout(searchTimer));
|
|
30
|
+
function clearSearch() {
|
|
31
|
+
clearTimeout(searchTimer);
|
|
32
|
+
search.value = "";
|
|
33
|
+
query.value = { ...query.value, page: 1, search: "" };
|
|
34
|
+
}
|
|
35
|
+
function sortDirectionFor(key) {
|
|
36
|
+
return query.value.sort?.column === key ? query.value.sort.direction : null;
|
|
37
|
+
}
|
|
38
|
+
function toggleSort(key) {
|
|
39
|
+
const current = sortDirectionFor(key);
|
|
40
|
+
const sort = current === null ? { column: key, direction: "asc" } : current === "asc" ? { column: key, direction: "desc" } : null;
|
|
41
|
+
query.value = { ...query.value, page: 1, sort };
|
|
42
|
+
}
|
|
43
|
+
const filtersOpen = ref(false);
|
|
44
|
+
const filterState = ref({ ...query.value.filters });
|
|
45
|
+
watch(
|
|
46
|
+
() => query.value.filters,
|
|
47
|
+
(value) => {
|
|
48
|
+
filterState.value = { ...value };
|
|
49
|
+
},
|
|
50
|
+
{ deep: true }
|
|
51
|
+
);
|
|
52
|
+
const filtersDefinition = computed(() => ({
|
|
53
|
+
sections: [{ id: "filters", fields: definition.value.filters ?? [] }]
|
|
54
|
+
}));
|
|
55
|
+
const activeFilters = computed(
|
|
56
|
+
() => (definition.value.filters ?? []).filter((field) => hasFilterValue(query.value.filters[field.name])).map((field) => {
|
|
57
|
+
const value = query.value.filters[field.name];
|
|
58
|
+
const option = "items" in field ? field.items?.find((item) => String(item.value) === String(value)) : void 0;
|
|
59
|
+
return {
|
|
60
|
+
name: field.name,
|
|
61
|
+
label: field.label ?? field.name,
|
|
62
|
+
value: option?.label ?? String(value)
|
|
63
|
+
};
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
function applyFilters() {
|
|
67
|
+
query.value = { ...query.value, filters: { ...filterState.value }, page: 1 };
|
|
68
|
+
filtersOpen.value = false;
|
|
69
|
+
}
|
|
70
|
+
function clearFilters() {
|
|
71
|
+
filterState.value = {};
|
|
72
|
+
query.value = { ...query.value, filters: {}, page: 1 };
|
|
73
|
+
filtersOpen.value = false;
|
|
74
|
+
}
|
|
75
|
+
function removeFilter(name) {
|
|
76
|
+
const filters = { ...query.value.filters };
|
|
77
|
+
delete filters[name];
|
|
78
|
+
query.value = { ...query.value, filters, page: 1 };
|
|
79
|
+
}
|
|
80
|
+
const isFiltered = computed(() => hasActiveQuery(query.value));
|
|
81
|
+
function clearQuery() {
|
|
82
|
+
clearTimeout(searchTimer);
|
|
83
|
+
search.value = "";
|
|
84
|
+
filterState.value = {};
|
|
85
|
+
filtersOpen.value = false;
|
|
86
|
+
query.value = { ...query.value, filters: {}, page: 1, search: "" };
|
|
87
|
+
}
|
|
88
|
+
const clearSelection = () => {
|
|
89
|
+
selection.value = [];
|
|
90
|
+
};
|
|
91
|
+
const alignClass = (align) => align === "end" ? "text-end" : align === "center" ? "text-center" : "";
|
|
92
|
+
const columns = computed(
|
|
93
|
+
() => definition.value.columns.map((column) => ({
|
|
94
|
+
cellClass: [alignClass(column.align), column.class].filter(Boolean).join(" "),
|
|
95
|
+
column,
|
|
96
|
+
headerClass: [alignClass(column.align), column.width].filter(Boolean).join(" "),
|
|
97
|
+
key: column.key,
|
|
98
|
+
// La columna de acciones no lleva rótulo salvo que se pida uno.
|
|
99
|
+
label: column.type === "actions" ? column.label ?? "" : column.label ?? column.key,
|
|
100
|
+
sortable: column.sortable ?? false
|
|
101
|
+
}))
|
|
102
|
+
);
|
|
103
|
+
const lastPage = computed(() => Math.max(1, Math.ceil(total.value / query.value.pageSize)));
|
|
104
|
+
watch(
|
|
105
|
+
[total, lastPage],
|
|
106
|
+
() => {
|
|
107
|
+
const page = clampPage(query.value.page, total.value, query.value.pageSize);
|
|
108
|
+
if (page === query.value.page) return;
|
|
109
|
+
query.value = { ...query.value, page };
|
|
110
|
+
},
|
|
111
|
+
// `immediate` es imprescindible: con el listado resuelto en servidor,
|
|
112
|
+
// `total` ya viene puesto en el primer render y nunca cambia, así que
|
|
113
|
+
// un `watch` normal no llegaría a ejecutarse en el caso que corrige.
|
|
114
|
+
{ immediate: true }
|
|
115
|
+
);
|
|
116
|
+
const shownPage = computed(() => Math.min(query.value.page, lastPage.value));
|
|
117
|
+
const rangeStart = computed(() => total.value === 0 ? 0 : (shownPage.value - 1) * query.value.pageSize + 1);
|
|
118
|
+
const rangeEnd = computed(() => Math.min(shownPage.value * query.value.pageSize, total.value));
|
|
119
|
+
function goToPage(page) {
|
|
120
|
+
query.value = { ...query.value, page };
|
|
121
|
+
}
|
|
122
|
+
function setPageSize(size) {
|
|
123
|
+
query.value = { ...query.value, page: 1, pageSize: size };
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
activeFilters,
|
|
127
|
+
applyFilters,
|
|
128
|
+
clearFilters,
|
|
129
|
+
clearQuery,
|
|
130
|
+
clearSearch,
|
|
131
|
+
clearSelection,
|
|
132
|
+
columns,
|
|
133
|
+
filtersDefinition,
|
|
134
|
+
filtersOpen,
|
|
135
|
+
filterState,
|
|
136
|
+
getRowId,
|
|
137
|
+
goToPage,
|
|
138
|
+
isFiltered,
|
|
139
|
+
lastPage,
|
|
140
|
+
pageSizes,
|
|
141
|
+
paginated,
|
|
142
|
+
rangeEnd,
|
|
143
|
+
rangeStart,
|
|
144
|
+
removeFilter,
|
|
145
|
+
search,
|
|
146
|
+
searchable,
|
|
147
|
+
setPageSize,
|
|
148
|
+
shownPage,
|
|
149
|
+
sortDirectionFor,
|
|
150
|
+
toggleSort,
|
|
151
|
+
total
|
|
152
|
+
};
|
|
153
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { VunoTableDefinition, VunoTableRow } from '#vuno/types/table';
|
|
3
|
+
import type { VunoTableRenderColumn } from './useVunoTable.js';
|
|
4
|
+
type VunoTableSelectionOptions<TRow extends VunoTableRow> = {
|
|
5
|
+
columns: ComputedRef<VunoTableRenderColumn<TRow>[]>;
|
|
6
|
+
selection: Ref<(number | string)[]>;
|
|
7
|
+
definition: () => VunoTableDefinition<TRow>;
|
|
8
|
+
getRowId: (row: TRow) => string;
|
|
9
|
+
rowName: () => string;
|
|
10
|
+
rows: () => TRow[];
|
|
11
|
+
};
|
|
12
|
+
/** Selección de la página actual y nombres accesibles de sus filas. */
|
|
13
|
+
export declare function useVunoTableSelection<TRow extends VunoTableRow>(options: VunoTableSelectionOptions<TRow>): {
|
|
14
|
+
allSelected: ComputedRef<boolean>;
|
|
15
|
+
isSelected: (row: TRow) => boolean;
|
|
16
|
+
rowLabel: (row: TRow, index: number) => string;
|
|
17
|
+
someSelected: ComputedRef<boolean>;
|
|
18
|
+
toggleAll: (checked: boolean) => void;
|
|
19
|
+
toggleRow: (row: TRow, checked: boolean) => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { getPath } from "#vuno/utils/path";
|
|
3
|
+
import { resolveColumnValue } from "./column.js";
|
|
4
|
+
import { addKeys, hasKey, removeKeys } from "./selection.js";
|
|
5
|
+
export function useVunoTableSelection(options) {
|
|
6
|
+
const isSelected = (row) => hasKey(options.selection.value, options.getRowId(row));
|
|
7
|
+
const labelColumn = computed(() => options.columns.value.find((item) => item.column.type === "text"));
|
|
8
|
+
function rowLabel(row, index) {
|
|
9
|
+
const declared = options.definition().rowLabel;
|
|
10
|
+
let value;
|
|
11
|
+
if (declared === void 0) value = labelColumn.value && resolveColumnValue(labelColumn.value.column, row);
|
|
12
|
+
else value = typeof declared === "function" ? declared(row) : getPath(row, declared);
|
|
13
|
+
return asText(value) || `${options.rowName()} ${index + 1}`;
|
|
14
|
+
}
|
|
15
|
+
function toggleRow(row, checked) {
|
|
16
|
+
const keys = [options.getRowId(row)];
|
|
17
|
+
options.selection.value = checked ? addKeys(options.selection.value, keys) : removeKeys(options.selection.value, keys);
|
|
18
|
+
}
|
|
19
|
+
function toggleAll(checked) {
|
|
20
|
+
const keys = options.rows().map((row) => options.getRowId(row));
|
|
21
|
+
options.selection.value = checked ? addKeys(options.selection.value, keys) : removeKeys(options.selection.value, keys);
|
|
22
|
+
}
|
|
23
|
+
const allSelected = computed(() => options.rows().length > 0 && options.rows().every((row) => isSelected(row)));
|
|
24
|
+
const someSelected = computed(() => !allSelected.value && options.rows().some((row) => isSelected(row)));
|
|
25
|
+
return { allSelected, isSelected, rowLabel, someSelected, toggleAll, toggleRow };
|
|
26
|
+
}
|
|
27
|
+
function asText(value) {
|
|
28
|
+
return typeof value === "string" || typeof value === "number" ? String(value).trim() : "";
|
|
29
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoTabItem } from '#vuno/types/page';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
4
|
+
/**
|
|
5
|
+
* Las pestañas, escritas a mano sobre el patrón de ARIA.
|
|
6
|
+
*
|
|
7
|
+
* No hacía falta una librería: aquí no hay nada que colocar, solo marcado y
|
|
8
|
+
* teclado. Lo que sí hay que hacer bien —y lo que la versión anterior no
|
|
9
|
+
* hacía— es el **tabindex móvil**: una sola pestaña está en el recorrido del
|
|
10
|
+
* tabulador, la activa, y dentro de la lista se anda con las flechas. Es lo
|
|
11
|
+
* que distingue una lista de pestañas de una fila de botones, donde el
|
|
12
|
+
* tabulador para en cada una.
|
|
13
|
+
*
|
|
14
|
+
* La activación es **manual**: las flechas mueven el foco y la selección
|
|
15
|
+
* espera a `Enter` o al espacio. Es una decisión explícita del contrato:
|
|
16
|
+
* cambiarla alteraría cómo se cargan los paneles costosos.
|
|
17
|
+
*/
|
|
18
|
+
type Props = {
|
|
19
|
+
items: VunoTabItem[];
|
|
20
|
+
size?: VunoSize;
|
|
21
|
+
ui?: VunoUi<'tabs'>;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_Props = Props;
|
|
24
|
+
type __VLS_Slots = {
|
|
25
|
+
/** El contenido de cada pestaña; recibe su item. */
|
|
26
|
+
content?: (props: {
|
|
27
|
+
item: VunoTabItem;
|
|
28
|
+
}) => unknown;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
modelValue?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
size: VunoSize;
|
|
40
|
+
ui: VunoUi<"tabs">;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const tabsTheme: Record<"tabs", {
|
|
2
|
+
/**
|
|
3
|
+
* Pestañas con subrayado en la activa. El `-mb-px` hace que ese subrayado
|
|
4
|
+
* se coma la línea de la lista en vez de quedar encima de ella.
|
|
5
|
+
*/
|
|
6
|
+
readonly slots: {
|
|
7
|
+
readonly content: "w-full";
|
|
8
|
+
readonly icon: "size-4 shrink-0";
|
|
9
|
+
readonly list: "flex items-center gap-1 border-b border-vuno-border";
|
|
10
|
+
readonly root: "flex w-full flex-col";
|
|
11
|
+
readonly trigger: "-mb-px flex cursor-pointer items-center gap-1.5 border-b-2 border-transparent px-3 py-2 font-medium text-vuno-muted transition-colors [--vuno-accent:var(--color-vuno-primary)] hover:text-vuno-body focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent) data-[state=active]:border-vuno-primary data-[state=active]:text-vuno-primary";
|
|
12
|
+
};
|
|
13
|
+
readonly variants: {
|
|
14
|
+
readonly size: {
|
|
15
|
+
readonly xs: {
|
|
16
|
+
readonly trigger: "text-xs";
|
|
17
|
+
};
|
|
18
|
+
readonly sm: {
|
|
19
|
+
readonly trigger: "text-sm";
|
|
20
|
+
};
|
|
21
|
+
readonly md: {
|
|
22
|
+
readonly trigger: "text-sm";
|
|
23
|
+
};
|
|
24
|
+
readonly lg: {
|
|
25
|
+
readonly trigger: "text-base";
|
|
26
|
+
};
|
|
27
|
+
readonly xl: {
|
|
28
|
+
readonly trigger: "text-base";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const tabsTheme = defineTheme("tabs", {
|
|
3
|
+
/**
|
|
4
|
+
* Pestañas con subrayado en la activa. El `-mb-px` hace que ese subrayado
|
|
5
|
+
* se coma la línea de la lista en vez de quedar encima de ella.
|
|
6
|
+
*/
|
|
7
|
+
slots: {
|
|
8
|
+
content: "w-full",
|
|
9
|
+
icon: "size-4 shrink-0",
|
|
10
|
+
list: "flex items-center gap-1 border-b border-vuno-border",
|
|
11
|
+
root: "flex w-full flex-col",
|
|
12
|
+
trigger: "-mb-px flex cursor-pointer items-center gap-1.5 border-b-2 border-transparent px-3 py-2 font-medium text-vuno-muted transition-colors [--vuno-accent:var(--color-vuno-primary)] hover:text-vuno-body focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent) data-[state=active]:border-vuno-primary data-[state=active]:text-vuno-primary"
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
xs: { trigger: "text-xs" },
|
|
17
|
+
sm: { trigger: "text-sm" },
|
|
18
|
+
md: { trigger: "text-sm" },
|
|
19
|
+
lg: { trigger: "text-base" },
|
|
20
|
+
xl: { trigger: "text-base" }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, inject, useId, useTemplateRef } from "vue";
|
|
3
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
import { vunoDirectionInjectionKey } from "#vuno/internal/keys";
|
|
5
|
+
import Badge from "#vuno/components/Badge/Badge.vue";
|
|
6
|
+
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
7
|
+
defineOptions({ name: "VunoTabs" });
|
|
8
|
+
const model = defineModel({ type: null, ...{ default: void 0 } });
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
items: { type: Array, required: true },
|
|
11
|
+
size: { type: String, required: false, default: "md" },
|
|
12
|
+
ui: { type: Object, required: false, default: void 0 }
|
|
13
|
+
});
|
|
14
|
+
defineSlots();
|
|
15
|
+
const ui = useTheme(
|
|
16
|
+
"tabs",
|
|
17
|
+
() => props.ui,
|
|
18
|
+
() => ({ size: props.size })
|
|
19
|
+
);
|
|
20
|
+
const uid = useId().replaceAll(/[^\w-]/g, "");
|
|
21
|
+
const list = useTemplateRef("list");
|
|
22
|
+
const active = computed(() => {
|
|
23
|
+
const current = props.items.find((item) => item.value === model.value);
|
|
24
|
+
return current?.value ?? props.items[0]?.value;
|
|
25
|
+
});
|
|
26
|
+
const safe = (value) => value.replaceAll(/[^\w-]/g, "");
|
|
27
|
+
const tabId = (value) => `${uid}-tab-${safe(value)}`;
|
|
28
|
+
const panelId = (value) => `${uid}-panel-${safe(value)}`;
|
|
29
|
+
function focusTab(index) {
|
|
30
|
+
const total = props.items.length;
|
|
31
|
+
if (total === 0) return;
|
|
32
|
+
const item = props.items[(index + total) % total];
|
|
33
|
+
if (item) list.value?.querySelector(`#${tabId(item.value)}`)?.focus();
|
|
34
|
+
}
|
|
35
|
+
const direction = inject(vunoDirectionInjectionKey, () => "ltr");
|
|
36
|
+
function onKeydown(event, index) {
|
|
37
|
+
const forward = direction() === "rtl" ? -1 : 1;
|
|
38
|
+
const keys = {
|
|
39
|
+
ArrowLeft: () => focusTab(index - forward),
|
|
40
|
+
ArrowRight: () => focusTab(index + forward),
|
|
41
|
+
End: () => focusTab(props.items.length - 1),
|
|
42
|
+
Home: () => focusTab(0)
|
|
43
|
+
};
|
|
44
|
+
const handler = keys[event.key];
|
|
45
|
+
if (!handler) return;
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
handler();
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<div :class="ui.root">
|
|
53
|
+
<div
|
|
54
|
+
ref="list"
|
|
55
|
+
aria-orientation="horizontal"
|
|
56
|
+
:class="ui.list"
|
|
57
|
+
role="tablist"
|
|
58
|
+
>
|
|
59
|
+
<button
|
|
60
|
+
v-for="(item, index) in props.items"
|
|
61
|
+
:id="tabId(item.value)"
|
|
62
|
+
:key="item.value"
|
|
63
|
+
:aria-controls="panelId(item.value)"
|
|
64
|
+
:aria-selected="item.value === active"
|
|
65
|
+
:class="ui.trigger"
|
|
66
|
+
:data-state="item.value === active ? 'active' : 'inactive'"
|
|
67
|
+
role="tab"
|
|
68
|
+
:tabindex="item.value === active ? 0 : -1"
|
|
69
|
+
type="button"
|
|
70
|
+
@click="model = item.value"
|
|
71
|
+
@keydown="onKeydown($event, index)"
|
|
72
|
+
>
|
|
73
|
+
<Icon
|
|
74
|
+
v-if="item.icon"
|
|
75
|
+
:class="ui.icon"
|
|
76
|
+
:name="item.icon"
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
<span class="truncate">{{ item.label }}</span>
|
|
80
|
+
|
|
81
|
+
<!--
|
|
82
|
+
El contador de errores va aquí y no al lado del formulario:
|
|
83
|
+
un fallo en una pestaña que no estás mirando deja el envío
|
|
84
|
+
parado sin explicación visible.
|
|
85
|
+
-->
|
|
86
|
+
<Badge
|
|
87
|
+
v-if="item.badge"
|
|
88
|
+
:color="item.badge.color ?? 'error'"
|
|
89
|
+
:label="item.badge.label"
|
|
90
|
+
size="xs"
|
|
91
|
+
/>
|
|
92
|
+
</button>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<!--
|
|
96
|
+
Los paneles que no se ven siguen montados y solo se ocultan, y no es
|
|
97
|
+
un detalle: las pestañas de un formulario llevan campos dentro, y
|
|
98
|
+
desmontar los de la que no se mira tira su valor y sus errores. Con
|
|
99
|
+
`hidden` lo que no se ve tampoco se anuncia ni se tabula, que es
|
|
100
|
+
justo lo que hace falta.
|
|
101
|
+
-->
|
|
102
|
+
<div
|
|
103
|
+
v-for="item in props.items"
|
|
104
|
+
:id="panelId(item.value)"
|
|
105
|
+
:key="item.value"
|
|
106
|
+
:aria-labelledby="tabId(item.value)"
|
|
107
|
+
:class="ui.content"
|
|
108
|
+
:data-state="item.value === active ? 'active' : 'inactive'"
|
|
109
|
+
:hidden="item.value !== active"
|
|
110
|
+
role="tabpanel"
|
|
111
|
+
tabindex="0"
|
|
112
|
+
>
|
|
113
|
+
<slot
|
|
114
|
+
:item="item"
|
|
115
|
+
name="content"
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoTabItem } from '#vuno/types/page';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
4
|
+
/**
|
|
5
|
+
* Las pestañas, escritas a mano sobre el patrón de ARIA.
|
|
6
|
+
*
|
|
7
|
+
* No hacía falta una librería: aquí no hay nada que colocar, solo marcado y
|
|
8
|
+
* teclado. Lo que sí hay que hacer bien —y lo que la versión anterior no
|
|
9
|
+
* hacía— es el **tabindex móvil**: una sola pestaña está en el recorrido del
|
|
10
|
+
* tabulador, la activa, y dentro de la lista se anda con las flechas. Es lo
|
|
11
|
+
* que distingue una lista de pestañas de una fila de botones, donde el
|
|
12
|
+
* tabulador para en cada una.
|
|
13
|
+
*
|
|
14
|
+
* La activación es **manual**: las flechas mueven el foco y la selección
|
|
15
|
+
* espera a `Enter` o al espacio. Es una decisión explícita del contrato:
|
|
16
|
+
* cambiarla alteraría cómo se cargan los paneles costosos.
|
|
17
|
+
*/
|
|
18
|
+
type Props = {
|
|
19
|
+
items: VunoTabItem[];
|
|
20
|
+
size?: VunoSize;
|
|
21
|
+
ui?: VunoUi<'tabs'>;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_Props = Props;
|
|
24
|
+
type __VLS_Slots = {
|
|
25
|
+
/** El contenido de cada pestaña; recibe su item. */
|
|
26
|
+
content?: (props: {
|
|
27
|
+
item: VunoTabItem;
|
|
28
|
+
}) => unknown;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
modelValue?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
size: VunoSize;
|
|
40
|
+
ui: VunoUi<"tabs">;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { VunoPortalTarget } from '#vuno/types/base';
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
|
+
/**
|
|
4
|
+
* El aviso que aparece al posar el ratón o al llegar con el teclado.
|
|
5
|
+
*
|
|
6
|
+
* Las cuatro cosas fáciles de dejarse y difíciles de notar que faltan son
|
|
7
|
+
* el retardo al abrir, cerrarlo con Escape, **abrirlo también al enfocar**
|
|
8
|
+
* —si solo abre al posar el ratón, para quien navega con el teclado no
|
|
9
|
+
* existe— y describir el disparador con `aria-describedby`, que es lo que
|
|
10
|
+
* hace que un lector de pantalla lo lea en vez de dejarlo suelto en la
|
|
11
|
+
* página. Las cuatro están abajo, cada una con su prueba.
|
|
12
|
+
*/
|
|
13
|
+
type Props = {
|
|
14
|
+
/** Milisegundos antes de abrirse al posar el ratón. */
|
|
15
|
+
delay?: number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Dónde montar el aviso. Por defecto, lo que provea el modal que envuelva. */
|
|
18
|
+
portal?: VunoPortalTarget;
|
|
19
|
+
side?: 'bottom' | 'left' | 'right' | 'top';
|
|
20
|
+
text?: string;
|
|
21
|
+
ui?: VunoUi<'tooltip'>;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_Slots = {
|
|
24
|
+
default?: () => unknown;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
27
|
+
text: string;
|
|
28
|
+
ui: VunoUi<"tooltip">;
|
|
29
|
+
delay: number;
|
|
30
|
+
portal: VunoPortalTarget;
|
|
31
|
+
side: "bottom" | "left" | "right" | "top";
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const tooltipTheme: Record<"tooltip", {
|
|
2
|
+
/**
|
|
3
|
+
* El área de texto. Comparte caja con el input, así que aquí solo queda el
|
|
4
|
+
* `<textarea>`: transparente, sin contorno propio y con su relleno vertical
|
|
5
|
+
* —el de la caja es horizontal, porque un control de una línea se centra y
|
|
6
|
+
* este no—.
|
|
7
|
+
*/
|
|
8
|
+
readonly slots: {
|
|
9
|
+
readonly arrow: "size-2 rotate-45 bg-vuno-surface-inverse";
|
|
10
|
+
readonly content: "z-50 max-w-xs rounded-sm bg-vuno-surface-inverse px-2 py-1 text-xs font-medium text-vuno-inverse shadow-sm select-none";
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const tooltipTheme = defineTheme("tooltip", {
|
|
3
|
+
/**
|
|
4
|
+
* El área de texto. Comparte caja con el input, así que aquí solo queda el
|
|
5
|
+
* `<textarea>`: transparente, sin contorno propio y con su relleno vertical
|
|
6
|
+
* —el de la caja es horizontal, porque un control de una línea se centra y
|
|
7
|
+
* este no—.
|
|
8
|
+
*/
|
|
9
|
+
slots: {
|
|
10
|
+
arrow: "size-2 rotate-45 bg-vuno-surface-inverse",
|
|
11
|
+
content: "z-50 max-w-xs rounded-sm bg-vuno-surface-inverse px-2 py-1 text-xs font-medium text-vuno-inverse shadow-sm select-none"
|
|
12
|
+
}
|
|
13
|
+
});
|