@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,323 +1,169 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from "vue";
|
|
3
3
|
import { useIcons, useMessages, useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
import { getPath } from "#vuno/utils/path";
|
|
4
5
|
import { cn } from "#vuno/utils/theme";
|
|
5
|
-
import Badge from "#vuno/components/Badge/Badge.vue";
|
|
6
6
|
import Button from "#vuno/components/Button/Button.vue";
|
|
7
7
|
import Checkbox from "#vuno/components/FieldCheckbox/internal/Checkbox/Checkbox.vue";
|
|
8
|
-
import FieldSearch from "#vuno/components/FieldSearch/FieldSearch.vue";
|
|
9
|
-
import Form from "#vuno/components/Form/Form.vue";
|
|
10
|
-
import ControlShell from "#vuno/components/internal/ControlShell/ControlShell.vue";
|
|
11
8
|
import Menu from "#vuno/components/Menu/Menu.vue";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import State from "#vuno/components/State/State.vue";
|
|
15
|
-
import { resolveColumnValue } from "./internal/column";
|
|
9
|
+
import Text from "#vuno/components/Text/Text.vue";
|
|
10
|
+
import { resolveColumns, resolveColumnValue } from "./internal/column";
|
|
16
11
|
import TableCell from "./internal/TableCell/TableCell.vue";
|
|
17
|
-
import { useVunoTable } from "./internal/useVunoTable";
|
|
18
12
|
import { useVunoTableSelection } from "./internal/useVunoTableSelection";
|
|
19
13
|
defineOptions({ name: "VunoTable" });
|
|
20
|
-
const query = defineModel("query", { type: Object, ...{ required: true } });
|
|
21
14
|
const selection = defineModel("selection", { type: Array, ...{ default: () => [] } });
|
|
15
|
+
const sort = defineModel("sort", { type: [null, Object], ...{ default: null } });
|
|
22
16
|
const props = defineProps({
|
|
23
17
|
data: { type: Array, required: true },
|
|
24
18
|
definition: { type: Object, required: true },
|
|
25
|
-
failure: { type: Object, required: false },
|
|
26
|
-
loading: { type: Boolean, required: false },
|
|
27
19
|
radius: { type: String, required: false },
|
|
28
|
-
total: { type: Number, required: false },
|
|
29
20
|
ui: { type: Object, required: false }
|
|
30
21
|
});
|
|
31
22
|
const emit = defineEmits(["rowClick"]);
|
|
32
23
|
defineSlots();
|
|
33
|
-
const total = computed(() => props.total ?? 0);
|
|
34
|
-
const hasFailure = computed(() => Boolean(props.failure));
|
|
35
24
|
const icons = useIcons();
|
|
36
25
|
const messages = useMessages();
|
|
37
26
|
const ui = useTheme(
|
|
38
27
|
"table",
|
|
39
28
|
() => props.ui,
|
|
40
|
-
() => ({ radius: props.radius })
|
|
29
|
+
() => ({ density: props.definition.density, radius: props.radius })
|
|
41
30
|
);
|
|
42
|
-
const
|
|
43
|
-
query,
|
|
44
|
-
selection,
|
|
45
|
-
definition: () => props.definition,
|
|
46
|
-
total: () => total.value
|
|
47
|
-
});
|
|
48
|
-
const { activeFilters, applyFilters, clearFilters, clearQuery, clearSelection, columns, filtersDefinition, filtersOpen, filterState, getRowId, goToPage, isFiltered, pageSizes, paginated, rangeEnd, rangeStart, removeFilter, search, searchable, setPageSize, sortDirectionFor, toggleSort } = table;
|
|
49
|
-
const searchField = useTemplateRef("searchField");
|
|
50
|
-
const rows = computed(() => hasFailure.value ? [] : props.data);
|
|
51
|
-
const footerId = useId();
|
|
52
|
-
const skippable = computed(() => rows.value.length > 3 && total.value > 0 && !hasFailure.value);
|
|
31
|
+
const columns = computed(() => resolveColumns(props.definition.columns));
|
|
53
32
|
const columnCount = computed(() => Math.max(columns.value.length + (props.definition.selectable ? 1 : 0), 1));
|
|
33
|
+
const getRowId = (row) => String(getPath(row, props.definition.rowKey ?? "id") ?? "");
|
|
54
34
|
const { allSelected, isSelected, rowLabel, someSelected, toggleAll, toggleRow } = useVunoTableSelection({
|
|
55
35
|
columns,
|
|
56
36
|
getRowId,
|
|
57
37
|
selection,
|
|
58
38
|
definition: () => props.definition,
|
|
59
39
|
rowName: () => messages.value.row,
|
|
60
|
-
rows: () =>
|
|
40
|
+
rows: () => props.data
|
|
61
41
|
});
|
|
42
|
+
function sortDirectionFor(key) {
|
|
43
|
+
return sort.value?.column === key ? sort.value.direction : null;
|
|
44
|
+
}
|
|
45
|
+
function toggleSort(key) {
|
|
46
|
+
const current = sortDirectionFor(key);
|
|
47
|
+
if (current === null) {
|
|
48
|
+
sort.value = { column: key, direction: "asc" };
|
|
49
|
+
} else if (current === "asc") {
|
|
50
|
+
sort.value = { column: key, direction: "desc" };
|
|
51
|
+
} else {
|
|
52
|
+
sort.value = null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
62
55
|
function ariaSortFor(key) {
|
|
63
|
-
|
|
64
|
-
if (!column?.sortable) return void 0;
|
|
56
|
+
if (!columns.value.find((item) => item.key === key)?.sortable) return void 0;
|
|
65
57
|
const direction = sortDirectionFor(key);
|
|
66
58
|
if (direction === "asc") return "ascending";
|
|
67
59
|
if (direction === "desc") return "descending";
|
|
68
60
|
return "none";
|
|
69
61
|
}
|
|
70
|
-
function clearSearch() {
|
|
71
|
-
table.clearSearch();
|
|
72
|
-
searchField.value?.focus();
|
|
73
|
-
}
|
|
74
|
-
function updateSearch(value) {
|
|
75
|
-
if (value === "") {
|
|
76
|
-
clearSearch();
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
search.value = value ?? "";
|
|
80
|
-
}
|
|
81
62
|
function sortIcon(key) {
|
|
82
63
|
const direction = sortDirectionFor(key);
|
|
83
64
|
if (direction === "asc") return icons.value.sortAsc;
|
|
84
65
|
if (direction === "desc") return icons.value.sortDesc;
|
|
85
66
|
return icons.value.sort;
|
|
86
67
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
clearSearch,
|
|
91
|
-
clearSelection,
|
|
92
|
-
goToPage
|
|
93
|
-
});
|
|
68
|
+
function activateRow(row) {
|
|
69
|
+
if (props.definition.interactive) emit("rowClick", row);
|
|
70
|
+
}
|
|
94
71
|
</script>
|
|
95
72
|
|
|
96
73
|
<template>
|
|
97
|
-
<div
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
74
|
+
<div
|
|
75
|
+
:class="ui.tableRoot"
|
|
76
|
+
tabindex="0"
|
|
77
|
+
>
|
|
78
|
+
<table
|
|
79
|
+
:aria-labelledby="props.definition.labelledBy"
|
|
80
|
+
:class="ui.table"
|
|
101
81
|
>
|
|
102
|
-
<
|
|
103
|
-
v-if="
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
variant="outline"
|
|
118
|
-
@click="filtersOpen = true"
|
|
119
|
-
>
|
|
120
|
-
<!-- `UButton` no admite `badge`: el contador va en el slot. -->
|
|
121
|
-
<template
|
|
122
|
-
v-if="activeFilters.length > 0"
|
|
123
|
-
#trailing
|
|
82
|
+
<caption
|
|
83
|
+
v-if="props.definition.caption"
|
|
84
|
+
:class="ui.caption"
|
|
85
|
+
>
|
|
86
|
+
{{
|
|
87
|
+
props.definition.caption
|
|
88
|
+
}}
|
|
89
|
+
</caption>
|
|
90
|
+
|
|
91
|
+
<thead :class="ui.thead">
|
|
92
|
+
<tr :class="ui.headRow">
|
|
93
|
+
<th
|
|
94
|
+
v-if="props.definition.selectable"
|
|
95
|
+
:class="cn(ui.th, ui.selectCell, props.definition.stickyHeader && ui.stickyHeader)"
|
|
96
|
+
scope="col"
|
|
124
97
|
>
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
:
|
|
128
|
-
|
|
129
|
-
|
|
98
|
+
<Checkbox
|
|
99
|
+
:aria-label="messages.selectAll"
|
|
100
|
+
:indeterminate="someSelected"
|
|
101
|
+
:modelValue="allSelected"
|
|
102
|
+
@update:model-value="(checked) => toggleAll(checked === true)"
|
|
130
103
|
/>
|
|
131
|
-
</
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
<div
|
|
142
|
-
v-if="props.definition.selectable && selection.length > 0"
|
|
143
|
-
:class="ui.selection"
|
|
144
|
-
>
|
|
145
|
-
<slot
|
|
146
|
-
:clear="clearSelection"
|
|
147
|
-
:count="selection.length"
|
|
148
|
-
:keys="selection"
|
|
149
|
-
name="selection"
|
|
150
|
-
>
|
|
151
|
-
<span>{{ selection.length }} {{ selection.length === 1 ? messages.rowSelected : messages.rowsSelected }}</span>
|
|
152
|
-
<Button
|
|
153
|
-
color="neutral"
|
|
154
|
-
:label="messages.clearSelection"
|
|
155
|
-
size="xs"
|
|
156
|
-
variant="ghost"
|
|
157
|
-
@click="clearSelection"
|
|
158
|
-
/>
|
|
159
|
-
</slot>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
<div
|
|
163
|
-
v-if="activeFilters.length > 0"
|
|
164
|
-
:class="ui.chips"
|
|
165
|
-
>
|
|
166
|
-
<Badge
|
|
167
|
-
v-for="filter in activeFilters"
|
|
168
|
-
:key="filter.name"
|
|
169
|
-
color="neutral"
|
|
170
|
-
variant="subtle"
|
|
171
|
-
>
|
|
172
|
-
<span>{{ filter.label }}: {{ filter.value }}</span>
|
|
173
|
-
<Button
|
|
174
|
-
:aria-label="`${messages.clearFilters}: ${filter.label}`"
|
|
175
|
-
color="neutral"
|
|
176
|
-
:icon="icons.fileRemove"
|
|
177
|
-
size="xs"
|
|
178
|
-
variant="link"
|
|
179
|
-
@click="removeFilter(filter.name)"
|
|
180
|
-
/>
|
|
181
|
-
</Badge>
|
|
182
|
-
|
|
183
|
-
<Button
|
|
184
|
-
color="neutral"
|
|
185
|
-
:label="messages.clearFilters"
|
|
186
|
-
size="xs"
|
|
187
|
-
variant="ghost"
|
|
188
|
-
@click="clearFilters"
|
|
189
|
-
/>
|
|
190
|
-
</div>
|
|
191
|
-
|
|
192
|
-
<!-- El panel comparte el `<dialog>` nativo de `VModal`: así hereda el
|
|
193
|
-
foco, el portal y la capa superior sin mezclar geometrías. -->
|
|
194
|
-
<Slideover
|
|
195
|
-
v-model:open="filtersOpen"
|
|
196
|
-
position="end"
|
|
197
|
-
:title="messages.filtersTitle"
|
|
198
|
-
>
|
|
199
|
-
<template #body>
|
|
200
|
-
<Form
|
|
201
|
-
v-model:state="filterState"
|
|
202
|
-
:definition="filtersDefinition"
|
|
203
|
-
:ui="{ sections: ui.filtersBody }"
|
|
204
|
-
/>
|
|
205
|
-
</template>
|
|
206
|
-
|
|
207
|
-
<template #footer>
|
|
208
|
-
<div :class="ui.filtersFooter">
|
|
209
|
-
<Button
|
|
210
|
-
color="neutral"
|
|
211
|
-
:label="messages.clearFilters"
|
|
212
|
-
variant="ghost"
|
|
213
|
-
@click="clearFilters"
|
|
214
|
-
/>
|
|
215
|
-
<Button
|
|
216
|
-
:label="messages.applyFilters"
|
|
217
|
-
@click="applyFilters"
|
|
218
|
-
/>
|
|
219
|
-
</div>
|
|
220
|
-
</template>
|
|
221
|
-
</Slideover>
|
|
222
|
-
|
|
223
|
-
<!--
|
|
224
|
-
La tabla se pinta aquí y no la pinta `UTable`. Lo único que aportaba
|
|
225
|
-
era el `rowSelection`, y esa ya no es la fuente de verdad: lo es
|
|
226
|
-
`selection`, la lista de claves que sale por `v-model:selection`. El
|
|
227
|
-
`Record<string, boolean>` existía solo para hablar con TanStack, que
|
|
228
|
-
además corría con su motor apagado —`manualPagination` y
|
|
229
|
-
`manualSorting`—, porque quien pagina y ordena es el servidor.
|
|
230
|
-
|
|
231
|
-
El marco va en el contenedor, que es quien tiene el desplazamiento
|
|
232
|
-
horizontal: en la `<table>` obligaría a `border-separate` y con eso
|
|
233
|
-
el navegador deja de pintar las líneas entre filas.
|
|
234
|
-
-->
|
|
235
|
-
<a
|
|
236
|
-
v-if="skippable"
|
|
237
|
-
:class="ui.skip"
|
|
238
|
-
:href="`#${footerId}`"
|
|
239
|
-
>{{ messages.skipTable }}</a
|
|
240
|
-
>
|
|
241
|
-
|
|
242
|
-
<div
|
|
243
|
-
:class="ui.tableRoot"
|
|
244
|
-
tabindex="0"
|
|
245
|
-
>
|
|
246
|
-
<table :class="ui.table">
|
|
247
|
-
<thead :class="ui.thead">
|
|
248
|
-
<tr :class="ui.headRow">
|
|
249
|
-
<th
|
|
250
|
-
v-if="props.definition.selectable"
|
|
251
|
-
:class="[ui.th, ui.selectCell]"
|
|
252
|
-
scope="col"
|
|
253
|
-
>
|
|
254
|
-
<Checkbox
|
|
255
|
-
:aria-label="messages.selectAll"
|
|
256
|
-
:indeterminate="someSelected"
|
|
257
|
-
:modelValue="allSelected"
|
|
258
|
-
@update:model-value="(checked) => toggleAll(checked === true)"
|
|
259
|
-
/>
|
|
260
|
-
</th>
|
|
261
|
-
|
|
262
|
-
<!--
|
|
263
|
-
`aria-sort` lo pone la tabla y no lo ponía `UTable`:
|
|
264
|
-
sin él, quien no ve la pantalla oye el nombre de la
|
|
265
|
-
columna y el botón, pero no por cuál está ordenada la
|
|
266
|
-
lista ni en qué sentido. Es una mejora, no paridad.
|
|
267
|
-
-->
|
|
268
|
-
<th
|
|
269
|
-
v-for="item in columns"
|
|
270
|
-
:key="item.key"
|
|
271
|
-
:aria-sort="ariaSortFor(item.key)"
|
|
272
|
-
:class="cn(ui.th, item.headerClass)"
|
|
273
|
-
scope="col"
|
|
274
|
-
>
|
|
275
|
-
<Button
|
|
276
|
-
v-if="item.sortable"
|
|
277
|
-
color="neutral"
|
|
278
|
-
:icon="sortIcon(item.key)"
|
|
279
|
-
:label="item.label"
|
|
280
|
-
size="xs"
|
|
281
|
-
trailing
|
|
282
|
-
:ui="{ base: ui.sortButton }"
|
|
283
|
-
variant="ghost"
|
|
284
|
-
@click="toggleSort(item.key)"
|
|
285
|
-
/>
|
|
286
|
-
<span v-else>{{ item.label }}</span>
|
|
287
|
-
</th>
|
|
288
|
-
</tr>
|
|
289
|
-
</thead>
|
|
290
|
-
|
|
291
|
-
<tbody :class="ui.tbody">
|
|
292
|
-
<tr
|
|
293
|
-
v-for="(row, index) in rows"
|
|
294
|
-
:key="getRowId(row)"
|
|
295
|
-
:class="ui.tr"
|
|
296
|
-
:data-selected="isSelected(row) ? 'true' : void 0"
|
|
297
|
-
@click="emit('rowClick', row)"
|
|
104
|
+
</th>
|
|
105
|
+
|
|
106
|
+
<th
|
|
107
|
+
v-for="item in columns"
|
|
108
|
+
:key="item.key"
|
|
109
|
+
:aria-sort="ariaSortFor(item.key)"
|
|
110
|
+
:class="cn(ui.th, item.headerClass, props.definition.stickyHeader && ui.stickyHeader, item.column.sticky && ui.stickyColumn, item.column.sticky === 'start' && ui.stickyColumnStart, item.column.sticky === 'end' && ui.stickyColumnEnd, props.definition.stickyHeader && item.column.sticky && ui.stickyIntersection)"
|
|
111
|
+
scope="col"
|
|
298
112
|
>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
:
|
|
303
|
-
|
|
113
|
+
<Button
|
|
114
|
+
v-if="item.sortable"
|
|
115
|
+
color="neutral"
|
|
116
|
+
:icon="sortIcon(item.key)"
|
|
117
|
+
:label="item.label"
|
|
118
|
+
size="xs"
|
|
119
|
+
trailing
|
|
120
|
+
:ui="{ base: ui.sortButton }"
|
|
121
|
+
variant="ghost"
|
|
122
|
+
@click="toggleSort(item.key)"
|
|
123
|
+
/>
|
|
124
|
+
<Text
|
|
125
|
+
v-else
|
|
126
|
+
tag="span"
|
|
127
|
+
tone="inherit"
|
|
128
|
+
variant="inherit"
|
|
129
|
+
>{{ item.label }}</Text
|
|
304
130
|
>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
131
|
+
</th>
|
|
132
|
+
</tr>
|
|
133
|
+
</thead>
|
|
134
|
+
|
|
135
|
+
<tbody :class="ui.tbody">
|
|
136
|
+
<tr
|
|
137
|
+
v-for="(row, index) in props.data"
|
|
138
|
+
:key="getRowId(row)"
|
|
139
|
+
:aria-label="props.definition.interactive ? `${messages.openRow} ${rowLabel(row, index)}` : void 0"
|
|
140
|
+
:class="cn(ui.tr, props.definition.interactive && ui.interactiveRow)"
|
|
141
|
+
:data-selected="isSelected(row) ? 'true' : void 0"
|
|
142
|
+
:tabindex="props.definition.interactive ? 0 : void 0"
|
|
143
|
+
@click="emit('rowClick', row)"
|
|
144
|
+
@keydown.enter.self="activateRow(row)"
|
|
145
|
+
@keydown.space.self.prevent="activateRow(row)"
|
|
146
|
+
>
|
|
147
|
+
<td
|
|
148
|
+
v-if="props.definition.selectable"
|
|
149
|
+
:class="[ui.td, ui.selectCell]"
|
|
150
|
+
@click.stop
|
|
151
|
+
>
|
|
152
|
+
<Checkbox
|
|
153
|
+
:aria-label="`${messages.selectRow} ${rowLabel(row, index)}`"
|
|
154
|
+
:modelValue="isSelected(row)"
|
|
155
|
+
@update:model-value="(checked) => toggleRow(row, checked === true)"
|
|
156
|
+
/>
|
|
157
|
+
</td>
|
|
312
158
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
159
|
+
<td
|
|
160
|
+
v-for="item in columns"
|
|
161
|
+
:key="item.key"
|
|
162
|
+
:class="cn(ui.td, item.cellClass, item.column.sticky && ui.stickyColumn, item.column.sticky === 'start' && ui.stickyColumnStart, item.column.sticky === 'end' && ui.stickyColumnEnd)"
|
|
163
|
+
>
|
|
164
|
+
<Menu
|
|
165
|
+
v-if="item.column.type === 'actions'"
|
|
166
|
+
:items="
|
|
321
167
|
item.column.actions.filter((action) => !action.hidden?.(row)).map((action) => ({
|
|
322
168
|
onSelect: () => action.onSelect(row),
|
|
323
169
|
color: action.color,
|
|
@@ -327,157 +173,39 @@ defineExpose({
|
|
|
327
173
|
separator: action.separator
|
|
328
174
|
}))
|
|
329
175
|
"
|
|
330
|
-
>
|
|
331
|
-
<Button
|
|
332
|
-
:aria-label="`${messages.rowActions} ${rowLabel(row, index)}`"
|
|
333
|
-
color="neutral"
|
|
334
|
-
:icon="icons.actions"
|
|
335
|
-
size="xs"
|
|
336
|
-
variant="ghost"
|
|
337
|
-
/>
|
|
338
|
-
</Menu>
|
|
339
|
-
|
|
340
|
-
<slot
|
|
341
|
-
v-else
|
|
342
|
-
:name="`cell-${item.key}`"
|
|
343
|
-
:row="row"
|
|
344
|
-
:value="resolveColumnValue(item.column, row)"
|
|
345
|
-
>
|
|
346
|
-
<TableCell
|
|
347
|
-
:column="item.column"
|
|
348
|
-
:row="row"
|
|
349
|
-
/>
|
|
350
|
-
</slot>
|
|
351
|
-
</td>
|
|
352
|
-
</tr>
|
|
353
|
-
|
|
354
|
-
<tr v-if="rows.length === 0">
|
|
355
|
-
<td
|
|
356
|
-
:class="ui.emptyCell"
|
|
357
|
-
:colspan="columnCount"
|
|
358
176
|
>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
tone="failure"
|
|
177
|
+
<Button
|
|
178
|
+
:aria-label="`${messages.rowActions} ${rowLabel(row, index)}`"
|
|
179
|
+
color="neutral"
|
|
180
|
+
:icon="icons.actions"
|
|
181
|
+
size="xs"
|
|
182
|
+
variant="ghost"
|
|
366
183
|
/>
|
|
184
|
+
</Menu>
|
|
367
185
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
<!-- Con `total` por encima de cero y sin filas, lo
|
|
374
|
-
que falta es la página, no los datos. Se corrige
|
|
375
|
-
sola arriba; entretanto no se afirma que no
|
|
376
|
-
haya nada. -->
|
|
377
|
-
<div v-else-if="total > 0" />
|
|
378
|
-
|
|
379
|
-
<!-- Buscando o filtrando, «no hay nada» sería falso:
|
|
380
|
-
lo que no hay es nada que case. Lo primero
|
|
381
|
-
invita a crear el primer registro y lo segundo
|
|
382
|
-
a quitar el filtro. -->
|
|
383
|
-
<slot
|
|
384
|
-
v-else-if="isFiltered"
|
|
385
|
-
:clear="clearQuery"
|
|
386
|
-
name="no-matches"
|
|
387
|
-
>
|
|
388
|
-
<State
|
|
389
|
-
:hint="messages.noMatchesHint"
|
|
390
|
-
:icon="icons.noMatches"
|
|
391
|
-
:title="messages.noMatches"
|
|
392
|
-
>
|
|
393
|
-
<template #actions>
|
|
394
|
-
<slot
|
|
395
|
-
:clear="clearQuery"
|
|
396
|
-
name="no-matches-actions"
|
|
397
|
-
>
|
|
398
|
-
<Button
|
|
399
|
-
color="neutral"
|
|
400
|
-
:label="messages.clearQuery"
|
|
401
|
-
variant="outline"
|
|
402
|
-
@click="clearQuery"
|
|
403
|
-
/>
|
|
404
|
-
</slot>
|
|
405
|
-
</template>
|
|
406
|
-
</State>
|
|
407
|
-
</slot>
|
|
408
|
-
|
|
409
|
-
<slot
|
|
410
|
-
v-else
|
|
411
|
-
name="empty"
|
|
412
|
-
>
|
|
413
|
-
<State
|
|
414
|
-
:hint="props.definition.empty?.hint"
|
|
415
|
-
:icon="props.definition.empty?.icon"
|
|
416
|
-
:title="props.definition.empty?.title"
|
|
417
|
-
>
|
|
418
|
-
<template #actions>
|
|
419
|
-
<slot name="empty-actions" />
|
|
420
|
-
</template>
|
|
421
|
-
</State>
|
|
422
|
-
</slot>
|
|
423
|
-
</td>
|
|
424
|
-
</tr>
|
|
425
|
-
</tbody>
|
|
426
|
-
</table>
|
|
427
|
-
</div>
|
|
428
|
-
|
|
429
|
-
<div
|
|
430
|
-
v-if="total > 0 && !hasFailure"
|
|
431
|
-
:id="footerId"
|
|
432
|
-
:class="ui.footer"
|
|
433
|
-
tabindex="-1"
|
|
434
|
-
>
|
|
435
|
-
<div :class="ui.meta">
|
|
436
|
-
<span v-if="paginated">{{ messages.showing }} {{ rangeStart }}–{{ rangeEnd }} {{ messages.of }} {{ total }}</span>
|
|
437
|
-
|
|
438
|
-
<!-- Sin paginar, un rango «1–30 de 30» sugiere que hay más. -->
|
|
439
|
-
<span v-else>{{ total }} {{ messages.results }}</span>
|
|
440
|
-
|
|
441
|
-
<!--
|
|
442
|
-
Un `<select>` nativo y no un combobox: son cinco números sin
|
|
443
|
-
búsqueda ni selección múltiple, y el navegador ya resuelve
|
|
444
|
-
el teclado, el foco y la lista —en el móvil, con su propia
|
|
445
|
-
rueda—. La caja la pone `ControlShell` para que se vea como
|
|
446
|
-
los demás controles.
|
|
447
|
-
|
|
448
|
-
El ancho va por `ui` porque pelea con el `w-full` del tema;
|
|
449
|
-
puesto como `class` sobre el componente convivirían los dos.
|
|
450
|
-
-->
|
|
451
|
-
|
|
452
|
-
<ControlShell
|
|
453
|
-
v-if="paginated"
|
|
454
|
-
size="xs"
|
|
455
|
-
:ui="{ root: ui.pageSizeControl }"
|
|
456
|
-
>
|
|
457
|
-
<select
|
|
458
|
-
:aria-label="messages.pageSize"
|
|
459
|
-
:class="ui.pageSizeSelect"
|
|
460
|
-
:value="query.pageSize"
|
|
461
|
-
@change="(event) => setPageSize(Number(event.target.value))"
|
|
462
|
-
>
|
|
463
|
-
<option
|
|
464
|
-
v-for="size in pageSizes"
|
|
465
|
-
:key="size"
|
|
466
|
-
:value="size"
|
|
186
|
+
<slot
|
|
187
|
+
v-else
|
|
188
|
+
:name="`cell-${item.key}`"
|
|
189
|
+
:row="row"
|
|
190
|
+
:value="resolveColumnValue(item.column, row)"
|
|
467
191
|
>
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
192
|
+
<TableCell
|
|
193
|
+
:column="item.column"
|
|
194
|
+
:row="row"
|
|
195
|
+
/>
|
|
196
|
+
</slot>
|
|
197
|
+
</td>
|
|
198
|
+
</tr>
|
|
199
|
+
|
|
200
|
+
<tr v-if="props.data.length === 0">
|
|
201
|
+
<td
|
|
202
|
+
:class="ui.emptyCell"
|
|
203
|
+
:colspan="columnCount"
|
|
204
|
+
>
|
|
205
|
+
<slot name="empty" />
|
|
206
|
+
</td>
|
|
207
|
+
</tr>
|
|
208
|
+
</tbody>
|
|
209
|
+
</table>
|
|
482
210
|
</div>
|
|
483
211
|
</template>
|