@groupteknology/vuno 2.0.0 → 3.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 +193 -175
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -1
- package/dist/runtime/app/assets/css/dialog.css +1 -1
- package/dist/runtime/app/assets/css/main.css +1 -1
- package/dist/runtime/app/assets/css/theme.css +1 -1
- package/dist/runtime/app/assets/css/tokens.css +1 -1
- package/dist/runtime/app/components/Alert/Alert.d.vue.ts +2 -2
- package/dist/runtime/app/components/Alert/Alert.theme.d.ts +7 -6
- package/dist/runtime/app/components/Alert/Alert.theme.js +7 -6
- package/dist/runtime/app/components/Alert/Alert.types.d.ts +10 -0
- package/dist/runtime/app/components/Alert/Alert.vue +17 -8
- package/dist/runtime/app/components/Alert/Alert.vue.d.ts +2 -2
- package/dist/runtime/app/components/App/App.d.vue.ts +3 -19
- package/dist/runtime/app/components/App/App.types.d.ts +4 -0
- package/dist/runtime/app/components/App/App.vue +48 -29
- package/dist/runtime/app/components/App/App.vue.d.ts +3 -19
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +2 -3
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +5 -5
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +7 -9
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue +27 -36
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +3 -3
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +3 -3
- package/dist/runtime/app/components/Avatar/Avatar.d.vue.ts +5 -22
- package/dist/runtime/app/components/Avatar/Avatar.types.d.ts +10 -0
- package/dist/runtime/app/components/Avatar/Avatar.types.js +0 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue.d.ts +5 -22
- package/dist/runtime/app/components/Badge/Badge.d.vue.ts +7 -26
- package/dist/runtime/app/components/Badge/Badge.types.d.ts +12 -0
- package/dist/runtime/app/components/Badge/Badge.types.js +0 -0
- package/dist/runtime/app/components/Badge/Badge.vue.d.ts +7 -26
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.d.vue.ts +7 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.theme.d.ts +15 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.theme.js +16 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.types.d.ts +7 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.types.js +0 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.vue +109 -0
- package/dist/runtime/app/components/Breadcrumb/Breadcrumb.vue.d.ts +7 -0
- package/dist/runtime/app/components/Button/Button.d.vue.ts +11 -31
- package/dist/runtime/app/components/Button/Button.theme.d.ts +36 -22
- package/dist/runtime/app/components/Button/Button.theme.js +28 -20
- package/dist/runtime/app/components/Button/Button.types.d.ts +24 -0
- package/dist/runtime/app/components/Button/Button.types.js +0 -0
- package/dist/runtime/app/components/Button/Button.vue +84 -33
- package/dist/runtime/app/components/Button/Button.vue.d.ts +11 -31
- package/dist/runtime/app/components/Card/Card.d.vue.ts +7 -69
- package/dist/runtime/app/components/Card/Card.theme.d.ts +56 -13
- package/dist/runtime/app/components/Card/Card.theme.js +39 -19
- package/dist/runtime/app/components/Card/Card.types.d.ts +12 -0
- package/dist/runtime/app/components/Card/Card.types.js +0 -0
- package/dist/runtime/app/components/Card/Card.vue +17 -11
- package/dist/runtime/app/components/Card/Card.vue.d.ts +7 -69
- package/dist/runtime/app/components/Code/Code.d.vue.ts +3 -13
- package/dist/runtime/app/components/Code/Code.theme.d.ts +1 -1
- package/dist/runtime/app/components/Code/Code.theme.js +1 -1
- package/dist/runtime/app/components/Code/Code.types.d.ts +8 -0
- package/dist/runtime/app/components/Code/Code.types.js +0 -0
- package/dist/runtime/app/components/Code/Code.vue +12 -5
- package/dist/runtime/app/components/Code/Code.vue.d.ts +3 -13
- package/dist/runtime/app/components/Collapsible/Collapsible.d.vue.ts +31 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.theme.d.ts +6 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.theme.js +7 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.types.d.ts +4 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.types.js +0 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.vue +72 -0
- package/dist/runtime/app/components/Collapsible/Collapsible.vue.d.ts +31 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.d.vue.ts +12 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.types.d.ts +13 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.types.js +0 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.vue +55 -0
- package/dist/runtime/app/components/ColorModeButton/ColorModeButton.vue.d.ts +12 -0
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +2 -6
- package/dist/runtime/app/components/Confirm/Confirm.types.d.ts +6 -0
- package/dist/runtime/app/components/Confirm/Confirm.types.js +0 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +2 -6
- package/dist/runtime/app/components/Container/Container.d.vue.ts +4 -28
- package/dist/runtime/app/components/Container/Container.types.d.ts +9 -0
- package/dist/runtime/app/components/Container/Container.types.js +0 -0
- package/dist/runtime/app/components/Container/Container.vue +1 -1
- package/dist/runtime/app/components/Container/Container.vue.d.ts +4 -28
- package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +5 -14
- package/dist/runtime/app/components/ControlGroup/ControlGroup.types.d.ts +9 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.types.js +0 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +5 -14
- package/dist/runtime/app/components/DataTable/DataTable.d.vue.ts +64 -0
- package/dist/runtime/app/components/DataTable/DataTable.theme.d.ts +17 -0
- package/dist/runtime/app/components/DataTable/DataTable.theme.js +19 -0
- package/dist/runtime/app/components/DataTable/DataTable.types.d.ts +13 -0
- package/dist/runtime/app/components/DataTable/DataTable.types.js +0 -0
- package/dist/runtime/app/components/DataTable/DataTable.vue +356 -0
- package/dist/runtime/app/components/DataTable/DataTable.vue.d.ts +64 -0
- package/dist/runtime/app/components/{Table/internal/useVunoTable.d.ts → DataTable/internal/useVunoDataTable.d.ts} +6 -29
- package/dist/runtime/app/components/{Table/internal/useVunoTable.js → DataTable/internal/useVunoDataTable.js} +2 -29
- package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldArray/FieldArray.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.types.js +0 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue +12 -5
- package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.types.js +0 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +1 -1
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldColor/FieldColor.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.types.js +0 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue +3 -3
- package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.types.js +0 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +3 -3
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldFile/FieldFile.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldFile/FieldFile.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.types.js +0 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue +1 -1
- package/dist/runtime/app/components/FieldFile/FieldFile.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +1 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +1 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue +26 -5
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldInput/FieldInput.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.types.js +0 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue +3 -3
- package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldNumber/FieldNumber.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.types.js +0 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +3 -3
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldPassword/FieldPassword.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.types.js +0 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +4 -4
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +3 -2
- package/dist/runtime/app/components/FieldRadio/FieldRadio.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.types.js +0 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +1 -1
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +3 -2
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue +6 -2
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +3 -3
- package/dist/runtime/app/components/FieldSearch/FieldSearch.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.types.js +0 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +4 -4
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +3 -3
- package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +3 -2
- package/dist/runtime/app/components/FieldSelect/FieldSelect.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.types.js +0 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +1 -1
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +3 -2
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +7 -7
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +16 -6
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +7 -7
- package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldSlug/FieldSlug.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.types.js +0 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue +4 -4
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.types.js +0 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +1 -1
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue.d.ts +4 -3
- package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldTags/FieldTags.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.types.js +0 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue +1 -1
- package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +4 -4
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +16 -6
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +4 -4
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.d.vue.ts +2 -2
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.types.d.ts +2 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.types.js +0 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +1 -1
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue.d.ts +2 -2
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.d.vue.ts +4 -3
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue +4 -4
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue.d.ts +4 -3
- package/dist/runtime/app/components/Form/Form.d.vue.ts +3 -19
- package/dist/runtime/app/components/Form/Form.types.d.ts +8 -0
- package/dist/runtime/app/components/Form/Form.types.js +0 -0
- package/dist/runtime/app/components/Form/Form.vue +3 -3
- package/dist/runtime/app/components/Form/Form.vue.d.ts +3 -19
- package/dist/runtime/app/components/FormField/FormField.d.vue.ts +4 -18
- package/dist/runtime/app/components/FormField/FormField.types.d.ts +14 -0
- package/dist/runtime/app/components/FormField/FormField.types.js +0 -0
- package/dist/runtime/app/components/FormField/FormField.vue +26 -10
- package/dist/runtime/app/components/FormField/FormField.vue.d.ts +4 -18
- package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.d.vue.ts +2 -3
- package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.vue.d.ts +2 -3
- package/dist/runtime/app/components/FormModal/FormModal.d.vue.ts +6 -25
- package/dist/runtime/app/components/FormModal/FormModal.types.d.ts +14 -0
- package/dist/runtime/app/components/FormModal/FormModal.types.js +0 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue +12 -2
- package/dist/runtime/app/components/FormModal/FormModal.vue.d.ts +6 -25
- package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +2 -13
- package/dist/runtime/app/components/FormSection/FormSection.types.d.ts +7 -0
- package/dist/runtime/app/components/FormSection/FormSection.types.js +0 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue +11 -4
- package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +2 -13
- package/dist/runtime/app/components/Icon/Icon.d.vue.ts +2 -4
- package/dist/runtime/app/components/Icon/Icon.types.d.ts +3 -0
- package/dist/runtime/app/components/Icon/Icon.types.js +0 -0
- package/dist/runtime/app/components/Icon/Icon.vue.d.ts +2 -4
- package/dist/runtime/app/components/Menu/Menu.d.vue.ts +4 -21
- package/dist/runtime/app/components/Menu/Menu.types.d.ts +7 -0
- package/dist/runtime/app/components/Menu/Menu.types.js +0 -0
- package/dist/runtime/app/components/Menu/Menu.vue +18 -110
- package/dist/runtime/app/components/Menu/Menu.vue.d.ts +4 -21
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.d.vue.ts +26 -0
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.vue +167 -0
- package/dist/runtime/app/components/Menu/internal/MenuLevel/MenuLevel.vue.d.ts +26 -0
- package/dist/runtime/app/components/Modal/Modal.d.vue.ts +6 -18
- package/dist/runtime/app/components/Modal/Modal.theme.d.ts +18 -14
- package/dist/runtime/app/components/Modal/Modal.theme.js +17 -21
- package/dist/runtime/app/components/Modal/Modal.types.d.ts +12 -0
- package/dist/runtime/app/components/Modal/Modal.types.js +0 -0
- package/dist/runtime/app/components/Modal/Modal.vue +99 -65
- package/dist/runtime/app/components/Modal/Modal.vue.d.ts +6 -18
- package/dist/runtime/app/components/Navbar/Navbar.d.vue.ts +3 -28
- package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +2 -3
- package/dist/runtime/app/components/Navbar/Navbar.theme.js +2 -3
- package/dist/runtime/app/components/Navbar/Navbar.types.d.ts +4 -0
- package/dist/runtime/app/components/Navbar/Navbar.types.js +0 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue.d.ts +3 -28
- package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +4 -33
- package/dist/runtime/app/components/NavigationList/NavigationList.keys.d.ts +3 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.keys.js +1 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.types.d.ts +9 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.types.js +0 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue +65 -19
- package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +4 -33
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +3 -24
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.keys.d.ts +7 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.keys.js +3 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.types.d.ts +10 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.types.js +0 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +45 -13
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +3 -24
- package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +3 -10
- package/dist/runtime/app/components/NavigationToc/NavigationToc.types.d.ts +7 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.types.js +0 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +8 -1
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +3 -10
- package/dist/runtime/app/components/Pagination/Pagination.d.vue.ts +5 -23
- package/dist/runtime/app/components/Pagination/Pagination.types.d.ts +11 -0
- package/dist/runtime/app/components/Pagination/Pagination.types.js +0 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue +6 -2
- package/dist/runtime/app/components/Pagination/Pagination.vue.d.ts +5 -23
- package/dist/runtime/app/components/Slideover/Slideover.d.vue.ts +4 -13
- package/dist/runtime/app/components/Slideover/Slideover.types.d.ts +12 -0
- package/dist/runtime/app/components/Slideover/Slideover.types.js +0 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue.d.ts +4 -13
- package/dist/runtime/app/components/State/State.d.vue.ts +2 -2
- package/dist/runtime/app/components/State/State.types.d.ts +15 -0
- package/dist/runtime/app/components/State/State.types.js +0 -0
- package/dist/runtime/app/components/State/State.vue +13 -3
- package/dist/runtime/app/components/State/State.vue.d.ts +2 -2
- package/dist/runtime/app/components/Table/Table.d.vue.ts +8 -55
- package/dist/runtime/app/components/Table/Table.theme.d.ts +17 -35
- package/dist/runtime/app/components/Table/Table.theme.js +15 -48
- package/dist/runtime/app/components/Table/Table.types.d.ts +9 -0
- package/dist/runtime/app/components/Table/Table.types.js +0 -0
- package/dist/runtime/app/components/Table/Table.vue +143 -415
- package/dist/runtime/app/components/Table/Table.vue.d.ts +8 -55
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +13 -3
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue +8 -1
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue +8 -1
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.d.vue.ts +2 -2
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue.d.ts +2 -2
- package/dist/runtime/app/components/Table/internal/column.d.ts +9 -0
- package/dist/runtime/app/components/Table/internal/column.js +15 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +1 -1
- package/dist/runtime/app/components/Tabs/Tabs.d.vue.ts +5 -24
- package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +15 -6
- package/dist/runtime/app/components/Tabs/Tabs.theme.js +15 -6
- package/dist/runtime/app/components/Tabs/Tabs.types.d.ts +10 -0
- package/dist/runtime/app/components/Tabs/Tabs.types.js +0 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue +91 -17
- package/dist/runtime/app/components/Tabs/Tabs.vue.d.ts +5 -24
- package/dist/runtime/app/components/Text/Text.d.vue.ts +19 -0
- package/dist/runtime/app/components/Text/Text.theme.d.ts +55 -0
- package/dist/runtime/app/components/Text/Text.theme.js +28 -0
- package/dist/runtime/app/components/Text/Text.types.d.ts +9 -0
- package/dist/runtime/app/components/Text/Text.types.js +0 -0
- package/dist/runtime/app/components/Text/Text.vue +37 -0
- package/dist/runtime/app/components/Text/Text.vue.d.ts +19 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.d.vue.ts +17 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.theme.d.ts +5 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.theme.js +6 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.types.d.ts +9 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.types.js +0 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.vue +76 -0
- package/dist/runtime/app/components/Toolbar/Toolbar.vue.d.ts +17 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.d.vue.ts +5 -26
- package/dist/runtime/app/components/Tooltip/Tooltip.types.d.ts +11 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.types.js +0 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue +1 -1
- package/dist/runtime/app/components/Tooltip/Tooltip.vue.d.ts +5 -26
- package/dist/runtime/app/composables/internal/useVunoContext.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoContext.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +3 -4
- package/dist/runtime/app/composables/internal/useVunoDirection.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoDirection.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoFormContext.d.ts +5 -0
- package/dist/runtime/app/composables/internal/useVunoFormContext.js +8 -0
- package/dist/runtime/app/composables/internal/useVunoOverlayBehind.d.ts +6 -0
- package/dist/runtime/app/composables/internal/useVunoOverlayBehind.js +8 -0
- package/dist/runtime/app/composables/useContext.js +2 -3
- package/dist/runtime/app/composables/useForm.js +2 -3
- package/dist/runtime/app/composables/useTableQuery.d.ts +1 -1
- package/dist/runtime/app/composables/useTheme.js +6 -3
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.vue.d.ts → primitives/PrimitiveControl/PrimitiveControl.d.vue.ts} +4 -3
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.theme.d.ts → primitives/PrimitiveControl/PrimitiveControl.theme.d.ts} +1 -1
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.vue → primitives/PrimitiveControl/PrimitiveControl.vue} +1 -1
- package/dist/runtime/app/{components/internal/ControlShell/ControlShell.d.vue.ts → primitives/PrimitiveControl/PrimitiveControl.vue.d.ts} +4 -3
- package/dist/runtime/app/{components/internal/Input/Input.d.vue.ts → primitives/PrimitiveInput/PrimitiveInput.d.vue.ts} +4 -3
- package/dist/runtime/app/{components/internal/Input/Input.vue → primitives/PrimitiveInput/PrimitiveInput.vue} +4 -4
- package/dist/runtime/app/{components/internal/Input/Input.vue.d.ts → primitives/PrimitiveInput/PrimitiveInput.vue.d.ts} +4 -3
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.d.vue.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.d.vue.ts} +3 -4
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.theme.d.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.theme.d.ts} +3 -0
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.theme.js → primitives/PrimitiveNumberInput/PrimitiveNumberInput.theme.js} +4 -1
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.vue → primitives/PrimitiveNumberInput/PrimitiveNumberInput.vue} +7 -5
- package/dist/runtime/app/{components/internal/NumberInput/NumberInput.vue.d.ts → primitives/PrimitiveNumberInput/PrimitiveNumberInput.vue.d.ts} +3 -4
- package/dist/runtime/app/theme/index.d.ts +254 -96
- package/dist/runtime/app/theme/index.js +13 -5
- package/dist/runtime/app/theme/messages.js +1 -0
- package/dist/runtime/app/theme/shared.d.ts +3 -2
- package/dist/runtime/app/theme/shared.js +2 -1
- package/dist/runtime/app/types/app.d.ts +4 -2
- package/dist/runtime/app/types/base.d.ts +5 -23
- package/dist/runtime/app/types/field.d.ts +3 -1
- package/dist/runtime/app/types/form.d.ts +3 -4
- package/dist/runtime/app/types/index.d.ts +55 -7
- package/dist/runtime/app/types/menu.d.ts +22 -0
- package/dist/runtime/app/types/menu.js +0 -0
- package/dist/runtime/app/types/page.d.ts +6 -10
- package/dist/runtime/app/types/slots.d.ts +8 -4
- package/dist/runtime/app/types/table.d.ts +28 -28
- package/dist/runtime/app/types/text.d.ts +6 -0
- package/dist/runtime/app/types/text.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +15 -6
- package/dist/runtime/app/utils/format.js +3 -2
- package/dist/runtime/app/utils/path.js +1 -1
- package/dist/runtime/app/{internal → utils}/slots.d.ts +2 -2
- package/dist/runtime/app/utils/theme.d.ts +8 -41
- package/dist/runtime/app/utils/theme.js +31 -29
- package/package.json +9 -9
- package/dist/runtime/app/components/Page/Page.d.vue.ts +0 -40
- package/dist/runtime/app/components/Page/Page.theme.d.ts +0 -32
- package/dist/runtime/app/components/Page/Page.theme.js +0 -31
- package/dist/runtime/app/components/Page/Page.vue +0 -132
- package/dist/runtime/app/components/Page/Page.vue.d.ts +0 -40
- package/dist/runtime/app/internal/keys.d.ts +0 -43
- package/dist/runtime/app/internal/keys.js +0 -8
- package/dist/runtime/app/types/alert.d.ts +0 -13
- package/dist/runtime/app/types/state.d.ts +0 -35
- /package/dist/runtime/app/{types/alert.js → components/Alert/Alert.types.js} +0 -0
- /package/dist/runtime/app/{types/state.js → components/App/App.types.js} +0 -0
- /package/dist/runtime/app/components/{Table → DataTable}/internal/query.d.ts +0 -0
- /package/dist/runtime/app/components/{Table → DataTable}/internal/query.js +0 -0
- /package/dist/runtime/app/components/{internal → FormField/internal}/FieldShell/FieldShell.vue +0 -0
- /package/dist/runtime/app/{components/internal/ControlShell/ControlShell.theme.js → primitives/PrimitiveControl/PrimitiveControl.theme.js} +0 -0
- /package/dist/runtime/app/{components/internal/Input/Input.theme.d.ts → primitives/PrimitiveInput/PrimitiveInput.theme.d.ts} +0 -0
- /package/dist/runtime/app/{components/internal/Input/Input.theme.js → primitives/PrimitiveInput/PrimitiveInput.theme.js} +0 -0
- /package/dist/runtime/app/{components/internal/NumberInput → primitives/PrimitiveNumberInput}/number.d.ts +0 -0
- /package/dist/runtime/app/{components/internal/NumberInput → primitives/PrimitiveNumberInput}/number.js +0 -0
- /package/dist/runtime/app/{internal → utils}/slots.js +0 -0
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
declare const __VLS_export: <TState extends VunoFormState>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
-
props: import("vue").PublicProps & __VLS_PrettifyLocal<({
|
|
6
|
-
/**
|
|
7
|
-
* Cierra el modal nada más enviar. Déjalo apagado si guardas contra una
|
|
8
|
-
* API: querrás cerrar tú al confirmar, y mientras tanto usar `loading`.
|
|
9
|
-
*/
|
|
10
|
-
closeOnSubmit?: boolean;
|
|
11
|
-
definition: VunoFormDefinition;
|
|
12
|
-
description?: string;
|
|
13
|
-
/** Slots del formulario que va dentro. */
|
|
14
|
-
formUi?: VunoUi<"form">;
|
|
15
|
-
/** Marca el botón de guardar como ocupado y bloquea el cierre. */
|
|
16
|
-
loading?: boolean;
|
|
17
|
-
/** Opcional, igual que en `VForm`: cualquier esquema Standard Schema. */
|
|
18
|
-
schema?: VunoSchema;
|
|
19
|
-
/** Ancho del diálogo; el formulario usa `3xl` de forma predeterminada. */
|
|
20
|
-
size?: VunoModalSize;
|
|
21
|
-
title?: string;
|
|
22
|
-
/** Slots del modal (`content`, `body`, ...). */
|
|
23
|
-
ui?: VunoUi<"formModal">;
|
|
24
|
-
} & {
|
|
1
|
+
import type { VunoFormModalProps } from './FormModal.types.js';
|
|
2
|
+
declare const __VLS_export: <TState extends import("#vuno/types/form").VunoFormState>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(VunoFormModalProps & {
|
|
25
4
|
open?: boolean;
|
|
26
5
|
state: TState;
|
|
27
6
|
}) & {
|
|
@@ -48,7 +27,9 @@ declare const __VLS_export: <TState extends VunoFormState>(__VLS_props: NonNulla
|
|
|
48
27
|
reset: () => void;
|
|
49
28
|
}) => unknown;
|
|
50
29
|
/** Elemento que abre el modal, si prefieres eso a controlar `open`. */
|
|
51
|
-
trigger?: (
|
|
30
|
+
trigger?: (props: {
|
|
31
|
+
open: () => void;
|
|
32
|
+
}) => unknown;
|
|
52
33
|
};
|
|
53
34
|
emit: (((evt: "close") => void) & ((evt: "submit", state: TState) => void)) & (((event: "update:open", value: boolean) => void) & ((event: "update:state", value: TState) => void));
|
|
54
35
|
}>) => import("vue").VNode & {
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
type Props = {
|
|
4
|
-
/**
|
|
5
|
-
* Sin marco ni título: es lo que se usa dentro de una pestaña, donde
|
|
6
|
-
* el rótulo ya lo pone la propia pestaña.
|
|
7
|
-
*/
|
|
8
|
-
plain?: boolean;
|
|
9
|
-
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
10
|
-
radius?: VunoRadius;
|
|
11
|
-
section: VunoFormSection;
|
|
12
|
-
};
|
|
13
|
-
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { VunoFormSectionProps } from './FormSection.types.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<VunoFormSectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoFormSectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
3
|
declare const _default: typeof __VLS_export;
|
|
15
4
|
export default _default;
|
|
File without changes
|
|
@@ -3,6 +3,7 @@ import { computed } from "vue";
|
|
|
3
3
|
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
4
|
import FormFieldRenderer from "#vuno/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue";
|
|
5
5
|
import { getColumnSpanClass } from "#vuno/components/Form/internal/grid";
|
|
6
|
+
import Text from "#vuno/components/Text/Text.vue";
|
|
6
7
|
defineOptions({ name: "VunoFormSection" });
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
plain: { type: Boolean, required: false },
|
|
@@ -20,18 +21,24 @@ const showHeader = computed(() => props.plain ? Boolean(props.section.descriptio
|
|
|
20
21
|
v-if="showHeader"
|
|
21
22
|
:class="ui.header"
|
|
22
23
|
>
|
|
23
|
-
<
|
|
24
|
+
<Text
|
|
24
25
|
v-if="props.section.title && !props.plain"
|
|
25
26
|
:class="ui.title"
|
|
27
|
+
tag="p"
|
|
28
|
+
tone="inherit"
|
|
29
|
+
variant="inherit"
|
|
26
30
|
>
|
|
27
31
|
{{ props.section.title }}
|
|
28
|
-
</
|
|
29
|
-
<
|
|
32
|
+
</Text>
|
|
33
|
+
<Text
|
|
30
34
|
v-if="props.section.description"
|
|
31
35
|
:class="ui.description"
|
|
36
|
+
tag="p"
|
|
37
|
+
tone="inherit"
|
|
38
|
+
variant="inherit"
|
|
32
39
|
>
|
|
33
40
|
{{ props.section.description }}
|
|
34
|
-
</
|
|
41
|
+
</Text>
|
|
35
42
|
</div>
|
|
36
43
|
|
|
37
44
|
<div
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
type Props = {
|
|
4
|
-
/**
|
|
5
|
-
* Sin marco ni título: es lo que se usa dentro de una pestaña, donde
|
|
6
|
-
* el rótulo ya lo pone la propia pestaña.
|
|
7
|
-
*/
|
|
8
|
-
plain?: boolean;
|
|
9
|
-
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
10
|
-
radius?: VunoRadius;
|
|
11
|
-
section: VunoFormSection;
|
|
12
|
-
};
|
|
13
|
-
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { VunoFormSectionProps } from './FormSection.types.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<VunoFormSectionProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoFormSectionProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
3
|
declare const _default: typeof __VLS_export;
|
|
15
4
|
export default _default;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { VunoIconProps } from './Icon.types.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<VunoIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
3
|
declare const _default: typeof __VLS_export;
|
|
6
4
|
export default _default;
|
|
File without changes
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
import type { VunoIconProps } from './Icon.types.js';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<VunoIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoIconProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
3
|
declare const _default: typeof __VLS_export;
|
|
6
4
|
export default _default;
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** Una entrada del menú. Es la forma que ya tienen las acciones de fila. */
|
|
3
|
-
type VunoMenuItem = {
|
|
4
|
-
onSelect: () => void;
|
|
5
|
-
color?: VunoColor;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
icon?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
/** Dibuja una línea encima, para separar lo destructivo del resto. */
|
|
10
|
-
separator?: boolean;
|
|
11
|
-
};
|
|
12
|
-
type Props = {
|
|
13
|
-
items: VunoMenuItem[];
|
|
14
|
-
/** Ubicación preferida; cambia automáticamente si no cabe. */
|
|
15
|
-
placement?: VunoPlacement;
|
|
16
|
-
/** Dónde montar el menú. Por defecto, lo que provea el modal que envuelva. */
|
|
17
|
-
portal?: VunoPortalTarget;
|
|
18
|
-
};
|
|
1
|
+
import type { VunoMenuProps } from './Menu.types.js';
|
|
19
2
|
type __VLS_Slots = {
|
|
20
3
|
/** El disparador. Recibe el estado abierto por si quiere pintarlo. */
|
|
21
4
|
default?: (props: {
|
|
22
5
|
open: boolean;
|
|
23
6
|
}) => unknown;
|
|
24
7
|
};
|
|
25
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
26
|
-
placement: VunoPlacement;
|
|
27
|
-
portal: VunoPortalTarget;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<VunoMenuProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoMenuProps> & Readonly<{}>, {
|
|
9
|
+
placement: import("../../types/base.js").VunoPlacement;
|
|
10
|
+
portal: import("../../types/base.js").VunoPortalTarget;
|
|
28
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
13
|
declare const _default: typeof __VLS_export;
|
|
File without changes
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { cloneVNode,
|
|
3
|
-
import { useVunoAnchor } from "#vuno/composables/internal/useVunoAnchor";
|
|
2
|
+
import { cloneVNode, nextTick, onBeforeUnmount, ref, useId } from "vue";
|
|
4
3
|
import { useVunoPortal } from "#vuno/composables/internal/useVunoPortal";
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
4
|
+
import { firstElement } from "#vuno/utils/slots";
|
|
5
|
+
import MenuLevel from "./internal/MenuLevel/MenuLevel.vue";
|
|
8
6
|
defineOptions({ name: "VunoMenu" });
|
|
9
7
|
const props = defineProps({
|
|
10
8
|
items: { type: Array, required: true },
|
|
@@ -13,43 +11,18 @@ const props = defineProps({
|
|
|
13
11
|
});
|
|
14
12
|
const slots = defineSlots();
|
|
15
13
|
const portalTarget = useVunoPortal(() => props.portal);
|
|
16
|
-
const
|
|
17
|
-
const colors = ["error", "info", "neutral", "primary", "secondary", "success", "warning"];
|
|
18
|
-
const themeByColor = colors.map((color) => [color, useTheme("menu", void 0, () => ({ color }))]);
|
|
19
|
-
const itemByColor = computed(() => Object.fromEntries(themeByColor.map(([color, theme]) => [color, theme.value.item])));
|
|
14
|
+
const initialFocus = ref("panel");
|
|
20
15
|
const menuId = useId();
|
|
21
|
-
const active = ref(-1);
|
|
22
|
-
const contentEl = ref(null);
|
|
23
|
-
const itemEls = ref([]);
|
|
24
16
|
const open = ref(false);
|
|
25
17
|
const triggerEl = ref(null);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
29
|
-
const captureItem = (index, el) => {
|
|
30
|
-
itemEls.value[index] = el ?? null;
|
|
31
|
-
};
|
|
32
|
-
const { anchor, release } = useVunoAnchor({ placement: () => props.placement });
|
|
33
|
-
const follow = () => anchor(triggerEl.value ?? void 0, contentEl.value ?? void 0);
|
|
34
|
-
const unfollow = () => release();
|
|
35
|
-
async function focusItem(index) {
|
|
36
|
-
active.value = index;
|
|
37
|
-
await nextTick();
|
|
38
|
-
itemEls.value[index]?.focus();
|
|
39
|
-
}
|
|
40
|
-
async function show(from) {
|
|
18
|
+
async function show(focus) {
|
|
19
|
+
initialFocus.value = focus;
|
|
41
20
|
open.value = true;
|
|
42
21
|
await nextTick();
|
|
43
|
-
follow();
|
|
44
|
-
if (from === "none") return contentEl.value?.focus();
|
|
45
|
-
const order = from === "first" ? enabled.value : [...enabled.value].reverse();
|
|
46
|
-
if (order.length > 0) await focusItem(order[0]);
|
|
47
22
|
}
|
|
48
23
|
function hide(returnFocus = true) {
|
|
49
24
|
if (!open.value) return;
|
|
50
25
|
open.value = false;
|
|
51
|
-
active.value = -1;
|
|
52
|
-
unfollow();
|
|
53
26
|
if (returnFocus) triggerEl.value?.focus();
|
|
54
27
|
}
|
|
55
28
|
function choose(item) {
|
|
@@ -57,14 +30,6 @@ function choose(item) {
|
|
|
57
30
|
item.onSelect();
|
|
58
31
|
hide();
|
|
59
32
|
}
|
|
60
|
-
function step(delta) {
|
|
61
|
-
const order = enabled.value;
|
|
62
|
-
if (order.length === 0) return;
|
|
63
|
-
const current = order.indexOf(active.value);
|
|
64
|
-
const entry = delta > 0 ? 0 : order.length - 1;
|
|
65
|
-
const next = current === -1 ? entry : (current + delta + order.length) % order.length;
|
|
66
|
-
void focusItem(order[next]);
|
|
67
|
-
}
|
|
68
33
|
function onTriggerKeydown(event) {
|
|
69
34
|
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
70
35
|
event.preventDefault();
|
|
@@ -75,24 +40,10 @@ function onTriggerKeydown(event) {
|
|
|
75
40
|
return void show("last");
|
|
76
41
|
}
|
|
77
42
|
}
|
|
78
|
-
function onContentKeydown(event) {
|
|
79
|
-
const keys = {
|
|
80
|
-
ArrowDown: () => step(1),
|
|
81
|
-
ArrowUp: () => step(-1),
|
|
82
|
-
End: () => void focusItem(enabled.value.at(-1) ?? -1),
|
|
83
|
-
Escape: () => hide(),
|
|
84
|
-
Home: () => void focusItem(enabled.value[0] ?? -1),
|
|
85
|
-
/* Tabular fuera cierra: dejarlo abierto deja un menú huérfano. */
|
|
86
|
-
Tab: () => hide(false)
|
|
87
|
-
};
|
|
88
|
-
const run = keys[event.key];
|
|
89
|
-
if (!run) return;
|
|
90
|
-
if (event.key !== "Tab") event.preventDefault();
|
|
91
|
-
run();
|
|
92
|
-
}
|
|
93
43
|
function onPointerDown(event) {
|
|
94
44
|
const target = event.target;
|
|
95
|
-
|
|
45
|
+
const content = typeof document === "undefined" ? null : document.getElementById(menuId);
|
|
46
|
+
if (!target || content?.contains(target) || triggerEl.value?.contains(target)) return;
|
|
96
47
|
hide(false);
|
|
97
48
|
}
|
|
98
49
|
if (typeof document !== "undefined") {
|
|
@@ -103,15 +54,10 @@ const Trigger = () => {
|
|
|
103
54
|
const node = firstElement(slots.default?.({ open: open.value }));
|
|
104
55
|
if (!node) return null;
|
|
105
56
|
return cloneVNode(node, {
|
|
106
|
-
/*
|
|
107
|
-
* El `stop` es de la tabla pero se queda aquí: sin él, abrir el
|
|
108
|
-
* menú dispara también el clic de la fila y se acaban abriendo dos
|
|
109
|
-
* cosas a la vez.
|
|
110
|
-
*/
|
|
111
57
|
onClick: (event) => {
|
|
112
58
|
event.stopPropagation();
|
|
113
59
|
if (open.value) hide();
|
|
114
|
-
else void show("
|
|
60
|
+
else void show("panel");
|
|
115
61
|
},
|
|
116
62
|
onKeydown: onTriggerKeydown,
|
|
117
63
|
"aria-controls": open.value ? menuId : void 0,
|
|
@@ -122,7 +68,6 @@ const Trigger = () => {
|
|
|
122
68
|
}
|
|
123
69
|
});
|
|
124
70
|
};
|
|
125
|
-
onBeforeUnmount(unfollow);
|
|
126
71
|
</script>
|
|
127
72
|
|
|
128
73
|
<template>
|
|
@@ -132,51 +77,14 @@ onBeforeUnmount(unfollow);
|
|
|
132
77
|
v-if="open"
|
|
133
78
|
:to="portalTarget"
|
|
134
79
|
>
|
|
135
|
-
<
|
|
136
|
-
:
|
|
137
|
-
|
|
138
|
-
:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
@
|
|
143
|
-
|
|
144
|
-
<template
|
|
145
|
-
v-for="(item, index) in props.items"
|
|
146
|
-
:key="`${item.label}-${index}`"
|
|
147
|
-
>
|
|
148
|
-
<!--
|
|
149
|
-
`<hr>` y no un `<div role="separator">`: el elemento ya
|
|
150
|
-
significa eso, así que la línea existe aunque el CSS no
|
|
151
|
-
cargue y no depende de que el papel esté bien escrito.
|
|
152
|
-
-->
|
|
153
|
-
<hr
|
|
154
|
-
v-if="item.separator && index > 0"
|
|
155
|
-
:class="ui.separator"
|
|
156
|
-
/>
|
|
157
|
-
|
|
158
|
-
<div
|
|
159
|
-
:ref="(el) => captureItem(index, el)"
|
|
160
|
-
:aria-disabled="item.disabled ? 'true' : void 0"
|
|
161
|
-
:class="item.color ? itemByColor[item.color] : ui.item"
|
|
162
|
-
:data-disabled="item.disabled ? '' : void 0"
|
|
163
|
-
:data-highlighted="active === index ? '' : void 0"
|
|
164
|
-
role="menuitem"
|
|
165
|
-
:tabindex="active === index ? 0 : -1"
|
|
166
|
-
@click="choose(item)"
|
|
167
|
-
@keydown.enter.prevent="choose(item)"
|
|
168
|
-
@keydown.space.prevent="choose(item)"
|
|
169
|
-
@pointermove="!item.disabled && (active = index)"
|
|
170
|
-
>
|
|
171
|
-
<Icon
|
|
172
|
-
v-if="item.icon"
|
|
173
|
-
:class="ui.icon"
|
|
174
|
-
:name="item.icon"
|
|
175
|
-
/>
|
|
176
|
-
|
|
177
|
-
<span class="truncate">{{ item.label }}</span>
|
|
178
|
-
</div>
|
|
179
|
-
</template>
|
|
180
|
-
</div>
|
|
80
|
+
<MenuLevel
|
|
81
|
+
:initialFocus="initialFocus"
|
|
82
|
+
:items="props.items"
|
|
83
|
+
:menuId="menuId"
|
|
84
|
+
:placement="props.placement"
|
|
85
|
+
:reference="() => triggerEl ?? void 0"
|
|
86
|
+
@dismiss="hide"
|
|
87
|
+
@select="choose"
|
|
88
|
+
/>
|
|
181
89
|
</Teleport>
|
|
182
90
|
</template>
|
|
@@ -1,30 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/** Una entrada del menú. Es la forma que ya tienen las acciones de fila. */
|
|
3
|
-
type VunoMenuItem = {
|
|
4
|
-
onSelect: () => void;
|
|
5
|
-
color?: VunoColor;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
icon?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
/** Dibuja una línea encima, para separar lo destructivo del resto. */
|
|
10
|
-
separator?: boolean;
|
|
11
|
-
};
|
|
12
|
-
type Props = {
|
|
13
|
-
items: VunoMenuItem[];
|
|
14
|
-
/** Ubicación preferida; cambia automáticamente si no cabe. */
|
|
15
|
-
placement?: VunoPlacement;
|
|
16
|
-
/** Dónde montar el menú. Por defecto, lo que provea el modal que envuelva. */
|
|
17
|
-
portal?: VunoPortalTarget;
|
|
18
|
-
};
|
|
1
|
+
import type { VunoMenuProps } from './Menu.types.js';
|
|
19
2
|
type __VLS_Slots = {
|
|
20
3
|
/** El disparador. Recibe el estado abierto por si quiere pintarlo. */
|
|
21
4
|
default?: (props: {
|
|
22
5
|
open: boolean;
|
|
23
6
|
}) => unknown;
|
|
24
7
|
};
|
|
25
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
26
|
-
placement: VunoPlacement;
|
|
27
|
-
portal: VunoPortalTarget;
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<VunoMenuProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoMenuProps> & Readonly<{}>, {
|
|
9
|
+
placement: import("../../types/base.js").VunoPlacement;
|
|
10
|
+
portal: import("../../types/base.js").VunoPortalTarget;
|
|
28
11
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
13
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VunoPlacement } from '#vuno/types/base';
|
|
2
|
+
import type { VunoMenuAction, VunoMenuItem } from '#vuno/types/menu';
|
|
3
|
+
type InitialFocus = 'first' | 'last' | 'none' | 'panel';
|
|
4
|
+
type Props = {
|
|
5
|
+
depth?: number;
|
|
6
|
+
initialFocus?: InitialFocus;
|
|
7
|
+
items: VunoMenuItem[];
|
|
8
|
+
menuId: string;
|
|
9
|
+
placement: VunoPlacement;
|
|
10
|
+
reference?: () => HTMLElement | undefined;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
select: (item: VunoMenuAction) => any;
|
|
14
|
+
dismiss: (returnFocus?: boolean | undefined) => any;
|
|
15
|
+
back: () => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
17
|
+
onSelect?: ((item: VunoMenuAction) => any) | undefined;
|
|
18
|
+
onDismiss?: ((returnFocus?: boolean | undefined) => any) | undefined;
|
|
19
|
+
onBack?: (() => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
reference: () => HTMLElement | undefined;
|
|
22
|
+
depth: number;
|
|
23
|
+
initialFocus: InitialFocus;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, onMounted, ref, useId } from "vue";
|
|
3
|
+
import { useVunoAnchor } from "#vuno/composables/internal/useVunoAnchor";
|
|
4
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
5
|
+
import Icon from "#vuno/components/Icon/Icon.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
depth: { type: Number, required: false, default: 0 },
|
|
8
|
+
initialFocus: { type: String, required: false, default: "none" },
|
|
9
|
+
items: { type: Array, required: true },
|
|
10
|
+
menuId: { type: String, required: true },
|
|
11
|
+
placement: { type: String, required: true },
|
|
12
|
+
reference: { type: Function, required: false, default: void 0 }
|
|
13
|
+
});
|
|
14
|
+
const emit = defineEmits(["back", "dismiss", "select"]);
|
|
15
|
+
const active = ref(-1);
|
|
16
|
+
const childFocus = ref("none");
|
|
17
|
+
const childMenuId = useId();
|
|
18
|
+
const contentEl = ref(null);
|
|
19
|
+
const itemEls = ref([]);
|
|
20
|
+
const openChild = ref(-1);
|
|
21
|
+
const ui = useTheme("menu");
|
|
22
|
+
const colors = ["error", "info", "neutral", "primary", "secondary", "success", "warning"];
|
|
23
|
+
const themeByColor = colors.map((color) => [color, useTheme("menu", void 0, () => ({ color }))]);
|
|
24
|
+
const itemByColor = computed(() => Object.fromEntries(themeByColor.map(([color, theme]) => [color, theme.value.item])));
|
|
25
|
+
const enabled = computed(
|
|
26
|
+
() => props.items.map((item, index) => ({ index, usable: !item.disabled })).filter((entry) => entry.usable).map((entry) => entry.index)
|
|
27
|
+
);
|
|
28
|
+
const isSubmenu = (item) => Array.isArray(item.children);
|
|
29
|
+
const submenuId = (index) => `${childMenuId}-${index}`;
|
|
30
|
+
const captureItem = (index, el) => {
|
|
31
|
+
itemEls.value[index] = el ?? null;
|
|
32
|
+
};
|
|
33
|
+
const { anchor } = useVunoAnchor({ placement: () => props.placement });
|
|
34
|
+
async function focusItem(index) {
|
|
35
|
+
openChild.value = -1;
|
|
36
|
+
active.value = index;
|
|
37
|
+
await nextTick();
|
|
38
|
+
itemEls.value[index]?.focus();
|
|
39
|
+
}
|
|
40
|
+
function step(delta) {
|
|
41
|
+
const order = enabled.value;
|
|
42
|
+
if (order.length === 0) return;
|
|
43
|
+
const current = order.indexOf(active.value);
|
|
44
|
+
const entry = delta > 0 ? 0 : order.length - 1;
|
|
45
|
+
const next = current === -1 ? entry : (current + delta + order.length) % order.length;
|
|
46
|
+
void focusItem(order[next]);
|
|
47
|
+
}
|
|
48
|
+
function openSubmenu(index, focus) {
|
|
49
|
+
const item = props.items[index];
|
|
50
|
+
if (!item || item.disabled || !isSubmenu(item) || item.children.length === 0) return;
|
|
51
|
+
active.value = index;
|
|
52
|
+
childFocus.value = focus;
|
|
53
|
+
openChild.value = index;
|
|
54
|
+
}
|
|
55
|
+
async function closeSubmenu(returnFocus = false) {
|
|
56
|
+
const index = openChild.value;
|
|
57
|
+
openChild.value = -1;
|
|
58
|
+
if (!returnFocus || index < 0) return;
|
|
59
|
+
await nextTick();
|
|
60
|
+
itemEls.value[index]?.focus();
|
|
61
|
+
}
|
|
62
|
+
function activate(item, index) {
|
|
63
|
+
if (item.disabled) return;
|
|
64
|
+
if (isSubmenu(item)) return openSubmenu(index, "first");
|
|
65
|
+
emit("select", item);
|
|
66
|
+
}
|
|
67
|
+
function highlight(item, index) {
|
|
68
|
+
if (item.disabled) return;
|
|
69
|
+
active.value = index;
|
|
70
|
+
if (isSubmenu(item)) openSubmenu(index, "none");
|
|
71
|
+
else openChild.value = -1;
|
|
72
|
+
}
|
|
73
|
+
function onContentKeydown(event) {
|
|
74
|
+
const keys = {
|
|
75
|
+
ArrowDown: () => step(1),
|
|
76
|
+
ArrowLeft: () => props.depth > 0 && emit("back"),
|
|
77
|
+
ArrowRight: () => openSubmenu(active.value, "first"),
|
|
78
|
+
ArrowUp: () => step(-1),
|
|
79
|
+
End: () => void focusItem(enabled.value.at(-1) ?? -1),
|
|
80
|
+
Escape: () => props.depth > 0 ? emit("back") : emit("dismiss"),
|
|
81
|
+
Home: () => void focusItem(enabled.value[0] ?? -1),
|
|
82
|
+
Tab: () => emit("dismiss", false)
|
|
83
|
+
};
|
|
84
|
+
const run = keys[event.key];
|
|
85
|
+
if (!run) return;
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
if (event.key !== "Tab") event.preventDefault();
|
|
88
|
+
run();
|
|
89
|
+
}
|
|
90
|
+
onMounted(async () => {
|
|
91
|
+
anchor(props.reference?.(), contentEl.value ?? void 0);
|
|
92
|
+
if (props.initialFocus === "panel") return contentEl.value?.focus();
|
|
93
|
+
if (props.initialFocus === "none") return;
|
|
94
|
+
const order = props.initialFocus === "first" ? enabled.value : [...enabled.value].reverse();
|
|
95
|
+
if (order.length > 0) await focusItem(order[0]);
|
|
96
|
+
});
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<div
|
|
101
|
+
:id="props.menuId"
|
|
102
|
+
ref="contentEl"
|
|
103
|
+
:class="ui.content"
|
|
104
|
+
role="menu"
|
|
105
|
+
style="position: fixed; top: 0; left: 0"
|
|
106
|
+
tabindex="-1"
|
|
107
|
+
@keydown="onContentKeydown"
|
|
108
|
+
>
|
|
109
|
+
<template
|
|
110
|
+
v-for="(item, index) in props.items"
|
|
111
|
+
:key="`${item.label}-${index}`"
|
|
112
|
+
>
|
|
113
|
+
<hr
|
|
114
|
+
v-if="item.separator && index > 0"
|
|
115
|
+
:class="ui.separator"
|
|
116
|
+
/>
|
|
117
|
+
|
|
118
|
+
<div role="presentation">
|
|
119
|
+
<div
|
|
120
|
+
:ref="(el) => captureItem(index, el)"
|
|
121
|
+
:aria-controls="isSubmenu(item) && openChild === index ? submenuId(index) : void 0"
|
|
122
|
+
:aria-disabled="item.disabled ? 'true' : void 0"
|
|
123
|
+
:aria-expanded="isSubmenu(item) ? openChild === index ? 'true' : 'false' : void 0"
|
|
124
|
+
:aria-haspopup="isSubmenu(item) ? 'menu' : void 0"
|
|
125
|
+
:class="item.color ? itemByColor[item.color] : ui.item"
|
|
126
|
+
:data-disabled="item.disabled ? '' : void 0"
|
|
127
|
+
:data-highlighted="active === index ? '' : void 0"
|
|
128
|
+
role="menuitem"
|
|
129
|
+
:tabindex="active === index ? 0 : -1"
|
|
130
|
+
@click="activate(item, index)"
|
|
131
|
+
@focus="active = index"
|
|
132
|
+
@keydown.enter.prevent.stop="activate(item, index)"
|
|
133
|
+
@keydown.space.prevent.stop="activate(item, index)"
|
|
134
|
+
@pointermove="highlight(item, index)"
|
|
135
|
+
>
|
|
136
|
+
<Icon
|
|
137
|
+
v-if="item.icon"
|
|
138
|
+
:class="ui.icon"
|
|
139
|
+
:name="item.icon"
|
|
140
|
+
/>
|
|
141
|
+
|
|
142
|
+
<span class="truncate">{{ item.label }}</span>
|
|
143
|
+
|
|
144
|
+
<Icon
|
|
145
|
+
v-if="isSubmenu(item)"
|
|
146
|
+
aria-hidden="true"
|
|
147
|
+
:class="[ui.icon, 'ml-auto']"
|
|
148
|
+
name="lucide:chevron-right"
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<MenuLevel
|
|
153
|
+
v-if="isSubmenu(item) && item.children.length > 0 && openChild === index"
|
|
154
|
+
:depth="props.depth + 1"
|
|
155
|
+
:initialFocus="childFocus"
|
|
156
|
+
:items="item.children"
|
|
157
|
+
:menuId="submenuId(index)"
|
|
158
|
+
placement="right-start"
|
|
159
|
+
:reference="() => itemEls[index] ?? void 0"
|
|
160
|
+
@back="closeSubmenu(true)"
|
|
161
|
+
@dismiss="emit('dismiss', $event)"
|
|
162
|
+
@select="emit('select', $event)"
|
|
163
|
+
/>
|
|
164
|
+
</div>
|
|
165
|
+
</template>
|
|
166
|
+
</div>
|
|
167
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VunoPlacement } from '#vuno/types/base';
|
|
2
|
+
import type { VunoMenuAction, VunoMenuItem } from '#vuno/types/menu';
|
|
3
|
+
type InitialFocus = 'first' | 'last' | 'none' | 'panel';
|
|
4
|
+
type Props = {
|
|
5
|
+
depth?: number;
|
|
6
|
+
initialFocus?: InitialFocus;
|
|
7
|
+
items: VunoMenuItem[];
|
|
8
|
+
menuId: string;
|
|
9
|
+
placement: VunoPlacement;
|
|
10
|
+
reference?: () => HTMLElement | undefined;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
select: (item: VunoMenuAction) => any;
|
|
14
|
+
dismiss: (returnFocus?: boolean | undefined) => any;
|
|
15
|
+
back: () => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
17
|
+
onSelect?: ((item: VunoMenuAction) => any) | undefined;
|
|
18
|
+
onDismiss?: ((returnFocus?: boolean | undefined) => any) | undefined;
|
|
19
|
+
onBack?: (() => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
reference: () => HTMLElement | undefined;
|
|
22
|
+
depth: number;
|
|
23
|
+
initialFocus: InitialFocus;
|
|
24
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|