@groupteknology/vuno 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -27
- package/dist/module.d.mts +14 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +80 -13
- package/dist/runtime/app/assets/css/dialog.css +1 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/assets/css/stylesheet.css +1 -0
- package/dist/runtime/app/assets/css/theme.css +1 -0
- package/dist/runtime/app/assets/css/tokens.css +1 -0
- package/dist/runtime/app/components/Alert/Alert.d.vue.ts +20 -0
- package/dist/runtime/app/components/Alert/Alert.theme.d.ts +13 -0
- package/dist/runtime/app/components/Alert/Alert.theme.js +13 -0
- package/dist/runtime/app/components/Alert/Alert.vue +59 -0
- package/dist/runtime/app/components/Alert/Alert.vue.d.ts +20 -0
- package/dist/runtime/app/components/App/App.d.vue.ts +52 -0
- package/dist/runtime/app/components/App/App.vue +150 -0
- package/dist/runtime/app/components/App/App.vue.d.ts +52 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.d.vue.ts +7 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue +39 -0
- package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue.d.ts +7 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.d.vue.ts +8 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +19 -0
- package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue.d.ts +8 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +13 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +18 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue +64 -0
- package/dist/runtime/app/components/App/internal/Toast/Toast.vue.d.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.d.vue.ts +11 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +15 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +16 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue +100 -0
- package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue.d.ts +11 -0
- package/dist/runtime/app/components/Avatar/Avatar.d.vue.ts +27 -0
- package/dist/runtime/app/components/Avatar/Avatar.theme.d.ts +30 -0
- package/dist/runtime/app/components/Avatar/Avatar.theme.js +22 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue +51 -0
- package/dist/runtime/app/components/Avatar/Avatar.vue.d.ts +27 -0
- package/dist/runtime/app/components/Badge/Badge.d.vue.ts +40 -0
- package/dist/runtime/app/components/Badge/Badge.theme.d.ts +40 -0
- package/dist/runtime/app/components/Badge/Badge.theme.js +22 -0
- package/dist/runtime/app/components/Badge/Badge.vue +28 -0
- package/dist/runtime/app/components/Badge/Badge.vue.d.ts +40 -0
- package/dist/runtime/app/components/Button/Button.d.vue.ts +49 -0
- package/dist/runtime/app/components/Button/Button.theme.d.ts +88 -0
- package/dist/runtime/app/components/Button/Button.theme.js +59 -0
- package/dist/runtime/app/components/Button/Button.vue +78 -0
- package/dist/runtime/app/components/Button/Button.vue.d.ts +49 -0
- package/dist/runtime/app/components/Card/Card.d.vue.ts +94 -0
- package/dist/runtime/app/components/Card/Card.theme.d.ts +57 -0
- package/dist/runtime/app/components/Card/Card.theme.js +62 -0
- package/dist/runtime/app/components/Card/Card.vue +45 -0
- package/dist/runtime/app/components/Card/Card.vue.d.ts +94 -0
- package/dist/runtime/app/components/Code/Code.d.vue.ts +19 -0
- package/dist/runtime/app/components/Code/Code.theme.d.ts +11 -0
- package/dist/runtime/app/components/Code/Code.theme.js +12 -0
- package/dist/runtime/app/components/Code/Code.vue +109 -0
- package/dist/runtime/app/components/Code/Code.vue.d.ts +19 -0
- package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +35 -0
- package/dist/runtime/app/components/Confirm/Confirm.theme.d.ts +12 -0
- package/dist/runtime/app/components/Confirm/Confirm.theme.js +13 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue +83 -0
- package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +35 -0
- package/dist/runtime/app/components/Container/Container.d.vue.ts +42 -0
- package/dist/runtime/app/components/Container/Container.theme.d.ts +53 -0
- package/dist/runtime/app/components/Container/Container.theme.js +31 -0
- package/dist/runtime/app/components/Container/Container.vue +20 -0
- package/dist/runtime/app/components/Container/Container.vue.d.ts +42 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.d.ts +16 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.js +13 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue +26 -0
- package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.d.ts +12 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.theme.js +13 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue +173 -0
- package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.js +2 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +39 -0
- package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.d.vue.ts +40 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.d.ts +30 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.js +10 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue +40 -0
- package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue.d.ts +40 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.d.ts +27 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.theme.js +18 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue +88 -0
- package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.js +2 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +51 -0
- package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.theme.js +2 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue +99 -0
- package/dist/runtime/app/components/FieldFile/FieldFile.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.d.vue.ts +66 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +88 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +55 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue +187 -0
- package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue.d.ts +66 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +24 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.theme.js +2 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue +61 -0
- package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +24 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.js +2 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +47 -0
- package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.js +2 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +62 -0
- package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.js +2 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +41 -0
- package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.d.vue.ts +32 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.d.ts +54 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.js +31 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue +80 -0
- package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue.d.ts +32 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +17 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.d.ts +6 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.js +7 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +74 -0
- package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +17 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.js +2 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +45 -0
- package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +97 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.js +49 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +196 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +97 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/option.d.ts +25 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/option.js +6 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.d.ts +30 -0
- package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.js +142 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.js +2 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue +113 -0
- package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.js +2 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +37 -0
- package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.d.ts +39 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.js +20 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue +46 -0
- package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +13 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.theme.js +2 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue +41 -0
- package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +13 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.d.ts +34 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.js +20 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +97 -0
- package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.d.vue.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.d.ts +5 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.js +2 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +45 -0
- package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue.d.ts +26 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.d.vue.ts +34 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.d.ts +36 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.js +37 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue +43 -0
- package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue.d.ts +34 -0
- package/dist/runtime/app/components/Form/Form.d.vue.ts +52 -0
- package/dist/runtime/app/components/Form/Form.theme.d.ts +9 -0
- package/dist/runtime/app/components/Form/Form.theme.js +10 -0
- package/dist/runtime/app/components/Form/Form.vue +129 -0
- package/dist/runtime/app/components/Form/Form.vue.d.ts +52 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.d.vue.ts +7 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue +67 -0
- package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue.d.ts +7 -0
- package/dist/runtime/app/components/Form/internal/grid.d.ts +9 -0
- package/dist/runtime/app/components/Form/internal/grid.js +91 -0
- package/dist/runtime/app/components/Form/internal/standard-schema.d.ts +29 -0
- package/dist/runtime/app/components/Form/internal/standard-schema.js +15 -0
- package/dist/runtime/app/components/Form/internal/useVunoFormState.d.ts +43 -0
- package/dist/runtime/app/components/Form/internal/useVunoFormState.js +81 -0
- package/dist/runtime/app/components/FormField/FormField.d.vue.ts +35 -0
- package/dist/runtime/app/components/FormField/FormField.theme.d.ts +62 -0
- package/dist/runtime/app/components/FormField/FormField.theme.js +28 -0
- package/dist/runtime/app/components/FormField/FormField.vue +124 -0
- package/dist/runtime/app/components/FormField/FormField.vue.d.ts +35 -0
- package/dist/runtime/app/components/FormModal/FormModal.d.vue.ts +63 -0
- package/dist/runtime/app/components/FormModal/FormModal.theme.d.ts +8 -0
- package/dist/runtime/app/components/FormModal/FormModal.theme.js +9 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue +95 -0
- package/dist/runtime/app/components/FormModal/FormModal.vue.d.ts +63 -0
- package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +15 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.d.ts +12 -0
- package/dist/runtime/app/components/FormSection/FormSection.theme.js +14 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue +45 -0
- package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +15 -0
- package/dist/runtime/app/components/Icon/Icon.d.vue.ts +6 -0
- package/dist/runtime/app/components/Icon/Icon.vue +32 -0
- package/dist/runtime/app/components/Icon/Icon.vue.d.ts +6 -0
- package/dist/runtime/app/components/Menu/Menu.d.vue.ts +36 -0
- package/dist/runtime/app/components/Menu/Menu.theme.d.ts +17 -0
- package/dist/runtime/app/components/Menu/Menu.theme.js +20 -0
- package/dist/runtime/app/components/Menu/Menu.vue +182 -0
- package/dist/runtime/app/components/Menu/Menu.vue.d.ts +36 -0
- package/dist/runtime/app/components/Modal/Modal.d.vue.ts +43 -0
- package/dist/runtime/app/components/Modal/Modal.theme.d.ts +59 -0
- package/dist/runtime/app/components/Modal/Modal.theme.js +47 -0
- package/dist/runtime/app/components/Modal/Modal.vue +215 -0
- package/dist/runtime/app/components/Modal/Modal.vue.d.ts +43 -0
- package/dist/runtime/app/components/Navbar/Navbar.d.vue.ts +45 -0
- package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +31 -0
- package/dist/runtime/app/components/Navbar/Navbar.theme.js +32 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue +47 -0
- package/dist/runtime/app/components/Navbar/Navbar.vue.d.ts +45 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +38 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.d.ts +32 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.theme.js +35 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue +187 -0
- package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +38 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +31 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.d.ts +26 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.js +27 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +236 -0
- package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +31 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +14 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.d.ts +9 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.js +10 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +81 -0
- package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +14 -0
- package/dist/runtime/app/components/Page/Page.d.vue.ts +40 -0
- package/dist/runtime/app/components/Page/Page.theme.d.ts +32 -0
- package/dist/runtime/app/components/Page/Page.theme.js +31 -0
- package/dist/runtime/app/components/Page/Page.vue +132 -0
- package/dist/runtime/app/components/Page/Page.vue.d.ts +40 -0
- package/dist/runtime/app/components/Pagination/Pagination.d.vue.ts +33 -0
- package/dist/runtime/app/components/Pagination/Pagination.theme.d.ts +13 -0
- package/dist/runtime/app/components/Pagination/Pagination.theme.js +14 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue +129 -0
- package/dist/runtime/app/components/Pagination/Pagination.vue.d.ts +33 -0
- package/dist/runtime/app/components/Slideover/Slideover.d.vue.ts +43 -0
- package/dist/runtime/app/components/Slideover/Slideover.theme.d.ts +35 -0
- package/dist/runtime/app/components/Slideover/Slideover.theme.js +24 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue +58 -0
- package/dist/runtime/app/components/Slideover/Slideover.vue.d.ts +43 -0
- package/dist/runtime/app/components/State/State.d.vue.ts +14 -0
- package/dist/runtime/app/components/State/State.theme.d.ts +19 -0
- package/dist/runtime/app/components/State/State.theme.js +26 -0
- package/dist/runtime/app/components/State/State.vue +66 -0
- package/dist/runtime/app/components/State/State.vue.d.ts +14 -0
- package/dist/runtime/app/components/Table/Table.d.vue.ts +80 -0
- package/dist/runtime/app/components/Table/Table.theme.d.ts +50 -0
- package/dist/runtime/app/components/Table/Table.theme.js +64 -0
- package/dist/runtime/app/components/Table/Table.vue +483 -0
- package/dist/runtime/app/components/Table/Table.vue.d.ts +80 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue +26 -0
- package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.js +11 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +32 -0
- package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue +16 -0
- package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue +21 -0
- package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue +24 -0
- package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.js +4 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue +17 -0
- package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.d.vue.ts +5 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.d.ts +13 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.js +11 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue +16 -0
- package/dist/runtime/app/components/Table/internal/CellText/CellText.vue.d.ts +5 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.d.vue.ts +22 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue +48 -0
- package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue.d.ts +22 -0
- package/dist/runtime/app/components/Table/internal/column.d.ts +9 -0
- package/dist/runtime/app/components/Table/internal/column.js +5 -0
- package/dist/runtime/app/components/Table/internal/query.d.ts +18 -0
- package/dist/runtime/app/components/Table/internal/query.js +8 -0
- package/dist/runtime/app/components/Table/internal/selection.d.ts +29 -0
- package/dist/runtime/app/components/Table/internal/selection.js +10 -0
- package/dist/runtime/app/components/Table/internal/useVunoTable.d.ts +93 -0
- package/dist/runtime/app/components/Table/internal/useVunoTable.js +153 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +21 -0
- package/dist/runtime/app/components/Table/internal/useVunoTableSelection.js +29 -0
- package/dist/runtime/app/components/Tabs/Tabs.d.vue.ts +49 -0
- package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +32 -0
- package/dist/runtime/app/components/Tabs/Tabs.theme.js +23 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue +119 -0
- package/dist/runtime/app/components/Tabs/Tabs.vue.d.ts +49 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.d.vue.ts +40 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.d.ts +12 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.theme.js +13 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue +139 -0
- package/dist/runtime/app/components/Tooltip/Tooltip.vue.d.ts +40 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.d.vue.ts +41 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.d.ts +50 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.js +38 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue +33 -0
- package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue.d.ts +41 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.d.vue.ts +23 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue +63 -0
- package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue.d.ts +23 -0
- package/dist/runtime/app/components/internal/Input/Input.d.vue.ts +52 -0
- package/dist/runtime/app/components/internal/Input/Input.theme.d.ts +30 -0
- package/dist/runtime/app/components/internal/Input/Input.theme.js +21 -0
- package/dist/runtime/app/components/internal/Input/Input.vue +66 -0
- package/dist/runtime/app/components/internal/Input/Input.vue.d.ts +52 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.d.vue.ts +36 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.d.ts +31 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.js +26 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue +221 -0
- package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue.d.ts +36 -0
- package/dist/runtime/app/components/internal/NumberInput/number.d.ts +42 -0
- package/dist/runtime/app/components/internal/NumberInput/number.js +64 -0
- package/dist/runtime/app/composables/defineShortcuts.d.ts +19 -0
- package/dist/runtime/app/composables/defineShortcuts.js +68 -0
- package/dist/runtime/app/composables/internal/useVunoAnchor.d.ts +45 -0
- package/dist/runtime/app/composables/internal/useVunoAnchor.js +35 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +17 -0
- package/dist/runtime/app/composables/internal/useVunoControlGroup.js +18 -0
- package/dist/runtime/app/composables/internal/useVunoPortal.d.ts +18 -0
- package/dist/runtime/app/composables/internal/useVunoPortal.js +12 -0
- package/dist/runtime/app/composables/useConfirm.d.ts +15 -0
- package/dist/runtime/app/composables/useConfirm.js +5 -0
- package/dist/runtime/app/composables/useContext.d.ts +11 -0
- package/dist/runtime/app/composables/useContext.js +9 -0
- package/dist/runtime/app/composables/useCrud.d.ts +23 -0
- package/dist/runtime/app/composables/useCrud.js +153 -0
- package/dist/runtime/app/composables/useField.d.ts +10 -0
- package/dist/runtime/app/composables/useField.js +42 -0
- package/dist/runtime/app/composables/useForm.d.ts +5 -0
- package/dist/runtime/app/composables/useForm.js +9 -0
- package/dist/runtime/app/composables/useModal.d.ts +21 -0
- package/dist/runtime/app/composables/useModal.js +24 -0
- package/dist/runtime/app/composables/useOverlay.d.ts +22 -0
- package/dist/runtime/app/composables/useOverlay.js +10 -0
- package/dist/runtime/app/composables/useTableQuery.d.ts +10 -0
- package/dist/runtime/app/composables/useTableQuery.js +126 -0
- package/dist/runtime/app/composables/useTheme.d.ts +31 -0
- package/dist/runtime/app/composables/useTheme.js +29 -0
- package/dist/runtime/app/composables/useToast.d.ts +28 -0
- package/dist/runtime/app/composables/useToast.js +13 -0
- package/dist/runtime/app/internal/keys.d.ts +43 -0
- package/dist/runtime/app/internal/keys.js +8 -0
- package/dist/runtime/app/internal/slots.d.ts +22 -0
- package/dist/runtime/app/internal/slots.js +24 -0
- package/dist/runtime/app/plugins/vue-query.d.ts +8 -0
- package/dist/runtime/app/plugins/vue-query.js +13 -0
- package/dist/runtime/app/theme/icons.d.ts +2 -0
- package/dist/runtime/app/theme/icons.js +43 -0
- package/dist/runtime/app/theme/index.d.ts +1168 -0
- package/dist/runtime/app/theme/index.js +120 -0
- package/dist/runtime/app/theme/messages.d.ts +2 -0
- package/dist/runtime/app/theme/messages.js +70 -0
- package/dist/runtime/app/theme/shared.d.ts +42 -0
- package/dist/runtime/app/theme/shared.js +24 -0
- package/dist/runtime/app/types/alert.d.ts +13 -0
- package/dist/runtime/app/types/alert.js +0 -0
- package/dist/runtime/app/types/app-config.d.ts +8 -0
- package/dist/runtime/app/types/app-config.js +1 -0
- package/dist/runtime/app/types/app.d.ts +83 -0
- package/dist/runtime/app/types/app.js +0 -0
- package/dist/runtime/app/types/base.d.ts +78 -0
- package/dist/runtime/app/types/base.js +0 -0
- package/dist/runtime/app/types/confirm.d.ts +19 -0
- package/dist/runtime/app/types/confirm.js +0 -0
- package/dist/runtime/app/types/crud.d.ts +108 -0
- package/dist/runtime/app/types/crud.js +0 -0
- package/dist/runtime/app/types/field-type.d.ts +4 -0
- package/dist/runtime/app/types/field-type.js +0 -0
- package/dist/runtime/app/types/field.d.ts +233 -0
- package/dist/runtime/app/types/field.js +0 -0
- package/dist/runtime/app/types/form.d.ts +67 -0
- package/dist/runtime/app/types/form.js +0 -0
- package/dist/runtime/app/types/index.d.ts +16 -0
- package/dist/runtime/app/types/index.js +1 -0
- package/dist/runtime/app/types/page.d.ts +61 -0
- package/dist/runtime/app/types/page.js +0 -0
- package/dist/runtime/app/types/responsive.d.ts +8 -0
- package/dist/runtime/app/types/responsive.js +0 -0
- package/dist/runtime/app/types/shortcuts.d.ts +44 -0
- package/dist/runtime/app/types/shortcuts.js +0 -0
- package/dist/runtime/app/types/slots.d.ts +30 -0
- package/dist/runtime/app/types/slots.js +0 -0
- package/dist/runtime/app/types/state.d.ts +35 -0
- package/dist/runtime/app/types/state.js +0 -0
- package/dist/runtime/app/types/table.d.ts +287 -0
- package/dist/runtime/app/types/table.js +0 -0
- package/dist/runtime/app/types/theme.d.ts +251 -0
- package/dist/runtime/app/types/theme.js +0 -0
- package/dist/runtime/app/utils/format.d.ts +18 -0
- package/dist/runtime/app/utils/format.js +36 -0
- package/dist/runtime/app/utils/pagination.d.ts +41 -0
- package/dist/runtime/app/utils/pagination.js +32 -0
- package/dist/runtime/app/utils/path.d.ts +16 -0
- package/dist/runtime/app/utils/path.js +76 -0
- package/dist/runtime/app/utils/query-key.d.ts +20 -0
- package/dist/runtime/app/utils/query-key.js +7 -0
- package/dist/runtime/app/utils/theme.d.ts +44 -0
- package/dist/runtime/app/utils/theme.js +43 -0
- package/dist/types.d.mts +3 -11
- package/package.json +18 -3
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const containerTheme = defineTheme("container", {
|
|
3
|
+
/**
|
|
4
|
+
* El contenedor. El ancho sale de la variante y no de una clase suelta: dos
|
|
5
|
+
* `max-w-*` sobre el mismo elemento no se resuelven, conviven.
|
|
6
|
+
*/
|
|
7
|
+
slots: {
|
|
8
|
+
root: "mx-auto w-full"
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
/* Se quita en un contenedor dentro de otro, donde se sumaría dos veces. */
|
|
12
|
+
padding: {
|
|
13
|
+
false: {},
|
|
14
|
+
true: { root: "px-4 sm:px-6 lg:px-8" }
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: { root: "max-w-sm" },
|
|
18
|
+
md: { root: "max-w-md" },
|
|
19
|
+
lg: { root: "max-w-lg" },
|
|
20
|
+
xl: { root: "max-w-xl" },
|
|
21
|
+
"2xl": { root: "max-w-2xl" },
|
|
22
|
+
"3xl": { root: "max-w-3xl" },
|
|
23
|
+
"4xl": { root: "max-w-4xl" },
|
|
24
|
+
"5xl": { root: "max-w-5xl" },
|
|
25
|
+
"6xl": { root: "max-w-6xl" },
|
|
26
|
+
"7xl": { root: "max-w-7xl" },
|
|
27
|
+
"8xl": { root: "max-w-8xl" },
|
|
28
|
+
full: {}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
3
|
+
defineOptions({ name: "VunoContainer" });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
flush: { type: Boolean, required: false, default: false },
|
|
6
|
+
size: { type: String, required: false, default: "8xl" },
|
|
7
|
+
ui: { type: Object, required: false, default: void 0 }
|
|
8
|
+
});
|
|
9
|
+
const ui = useTheme(
|
|
10
|
+
"container",
|
|
11
|
+
() => props.ui,
|
|
12
|
+
() => ({ padding: String(!props.flush), size: props.size })
|
|
13
|
+
);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div :class="ui.root">
|
|
18
|
+
<slot />
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { VunoContainerSize } from '#vuno/types/page';
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
|
+
/**
|
|
4
|
+
* Centra el contenido y le pone un ancho máximo.
|
|
5
|
+
*
|
|
6
|
+
* **El ancho es una variante del tema y no una clase que se pasa.** Escribirlo
|
|
7
|
+
* como `class="max-w-lg"` sobre el componente sería el defecto de siempre: una
|
|
8
|
+
* clase puesta sobre un componente no pasa por tailwind-merge, así que
|
|
9
|
+
* convive con la del tema y gana el orden de la hoja — dos anchos declarados
|
|
10
|
+
* y el que se aplica depende de en qué orden salieran compilados. Por la
|
|
11
|
+
* variante hay uno solo, y un proyecto puede cambiar la escala entera desde
|
|
12
|
+
* su `app.config`.
|
|
13
|
+
*
|
|
14
|
+
* Los tamaños son los de Tailwind, de `sm` a `7xl`, más `full` para cuando lo
|
|
15
|
+
* que se quiere es solo el relleno lateral y no el tope.
|
|
16
|
+
*/
|
|
17
|
+
type Props = {
|
|
18
|
+
/**
|
|
19
|
+
* Quita el relleno lateral. Para un contenedor dentro de otro que ya
|
|
20
|
+
* lo tiene, donde el relleno se sumaría dos veces.
|
|
21
|
+
*/
|
|
22
|
+
flush?: boolean;
|
|
23
|
+
size?: VunoContainerSize;
|
|
24
|
+
ui?: VunoUi<'container'>;
|
|
25
|
+
};
|
|
26
|
+
declare var __VLS_1: {};
|
|
27
|
+
type __VLS_Slots = {} & {
|
|
28
|
+
default?: (props: typeof __VLS_1) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
31
|
+
size: VunoContainerSize;
|
|
32
|
+
ui: VunoUi<"container">;
|
|
33
|
+
flush: boolean;
|
|
34
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoControlOrientation } from '#vuno/types/field';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
4
|
+
type Props = {
|
|
5
|
+
/** Dirección en la que se unen los controles. */
|
|
6
|
+
orientation?: VunoControlOrientation;
|
|
7
|
+
/** Tamaño que heredan los hijos que no declaran uno propio. */
|
|
8
|
+
size?: VunoSize;
|
|
9
|
+
ui?: VunoUi<'controlGroup'>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
|
+
size: VunoSize;
|
|
16
|
+
orientation: VunoControlOrientation;
|
|
17
|
+
ui: VunoUi<"controlGroup">;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const controlGroupTheme: Record<"controlGroup", {
|
|
2
|
+
/** Une bordes y radios; cada hijo compatible decide cómo responde al contexto. */
|
|
3
|
+
readonly slots: {
|
|
4
|
+
readonly root: "relative inline-flex";
|
|
5
|
+
};
|
|
6
|
+
readonly variants: {
|
|
7
|
+
readonly orientation: {
|
|
8
|
+
readonly horizontal: {
|
|
9
|
+
readonly root: "-space-x-px";
|
|
10
|
+
};
|
|
11
|
+
readonly vertical: {
|
|
12
|
+
readonly root: "flex-col -space-y-px";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const controlGroupTheme = defineTheme("controlGroup", {
|
|
3
|
+
/** Une bordes y radios; cada hijo compatible decide cómo responde al contexto. */
|
|
4
|
+
slots: {
|
|
5
|
+
root: "relative inline-flex"
|
|
6
|
+
},
|
|
7
|
+
variants: {
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: { root: "-space-x-px" },
|
|
10
|
+
vertical: { root: "flex-col -space-y-px" }
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { provideVunoControlGroup } from "#vuno/composables/internal/useVunoControlGroup";
|
|
3
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
defineOptions({ name: "VunoControlGroup" });
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
orientation: { type: String, required: false, default: "horizontal" },
|
|
7
|
+
size: { type: String, required: false, default: void 0 },
|
|
8
|
+
ui: { type: Object, required: false, default: void 0 }
|
|
9
|
+
});
|
|
10
|
+
defineSlots();
|
|
11
|
+
provideVunoControlGroup(() => ({ orientation: props.orientation, size: props.size }));
|
|
12
|
+
const ui = useTheme(
|
|
13
|
+
"controlGroup",
|
|
14
|
+
() => props.ui,
|
|
15
|
+
() => ({ orientation: props.orientation })
|
|
16
|
+
);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div
|
|
21
|
+
:class="ui.root"
|
|
22
|
+
:data-orientation="props.orientation"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoControlOrientation } from '#vuno/types/field';
|
|
3
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
4
|
+
type Props = {
|
|
5
|
+
/** Dirección en la que se unen los controles. */
|
|
6
|
+
orientation?: VunoControlOrientation;
|
|
7
|
+
/** Tamaño que heredan los hijos que no declaran uno propio. */
|
|
8
|
+
size?: VunoSize;
|
|
9
|
+
ui?: VunoUi<'controlGroup'>;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {
|
|
12
|
+
default?: () => unknown;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
15
|
+
size: VunoSize;
|
|
16
|
+
orientation: VunoControlOrientation;
|
|
17
|
+
ui: VunoUi<"controlGroup">;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VunoFieldArray } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldArray, 'columns'>;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: Record<string, unknown>[] | undefined;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: Record<string, unknown>[] | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>[] | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const fieldArrayTheme: Record<"fieldArray", {
|
|
2
|
+
readonly slots: {
|
|
3
|
+
readonly empty: "rounded-sm border border-dashed border-vuno-border px-4 py-6 text-center text-sm text-vuno-muted";
|
|
4
|
+
readonly item: "flex flex-col gap-3 rounded-sm border border-vuno-border p-4";
|
|
5
|
+
readonly itemAction: "pointer-coarse:size-11";
|
|
6
|
+
readonly itemActions: "flex items-center gap-1";
|
|
7
|
+
readonly itemFields: "grid w-full grid-cols-12 gap-x-4 gap-y-5";
|
|
8
|
+
readonly itemHeader: "flex items-center justify-between gap-2";
|
|
9
|
+
readonly itemLabel: "text-xs font-medium text-vuno-muted";
|
|
10
|
+
readonly root: "flex w-full flex-col gap-3";
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
2
|
+
export const fieldArrayTheme = defineTheme("fieldArray", {
|
|
3
|
+
slots: {
|
|
4
|
+
empty: "rounded-sm border border-dashed border-vuno-border px-4 py-6 text-center text-sm text-vuno-muted",
|
|
5
|
+
item: "flex flex-col gap-3 rounded-sm border border-vuno-border p-4",
|
|
6
|
+
itemAction: "pointer-coarse:size-11",
|
|
7
|
+
itemActions: "flex items-center gap-1",
|
|
8
|
+
itemFields: "grid w-full grid-cols-12 gap-x-4 gap-y-5",
|
|
9
|
+
itemHeader: "flex items-center justify-between gap-2",
|
|
10
|
+
itemLabel: "text-xs font-medium text-vuno-muted",
|
|
11
|
+
root: "flex w-full flex-col gap-3"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, provide, reactive } from "vue";
|
|
3
|
+
import { useField } from "#vuno/composables/useField";
|
|
4
|
+
import { useForm } from "#vuno/composables/useForm";
|
|
5
|
+
import { useIcons, useMessages, useTheme } from "#vuno/composables/useTheme";
|
|
6
|
+
import { vunoFormInjectionKey } from "#vuno/internal/keys";
|
|
7
|
+
import { cloneValue, getPath, isEqual, setPath } from "#vuno/utils/path";
|
|
8
|
+
import Button from "#vuno/components/Button/Button.vue";
|
|
9
|
+
import FormFieldRenderer from "#vuno/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue";
|
|
10
|
+
import { getColumnSpanClass } from "#vuno/components/Form/internal/grid";
|
|
11
|
+
import FieldShell from "#vuno/components/internal/FieldShell/FieldShell.vue";
|
|
12
|
+
defineOptions({ name: "VunoFieldArray" });
|
|
13
|
+
const model = defineModel({ type: null, ...{ default: void 0 } });
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
name: { type: String, required: false },
|
|
16
|
+
class: { type: String, required: false },
|
|
17
|
+
description: { type: String, required: false },
|
|
18
|
+
disabled: { type: Boolean, required: false },
|
|
19
|
+
error: { type: String, required: false },
|
|
20
|
+
help: { type: String, required: false },
|
|
21
|
+
hint: { type: String, required: false },
|
|
22
|
+
label: { type: String, required: false },
|
|
23
|
+
orientation: { type: String, required: false },
|
|
24
|
+
required: { type: Boolean, required: false },
|
|
25
|
+
size: { type: String, required: false },
|
|
26
|
+
ui: { type: Object, required: false },
|
|
27
|
+
addLabel: { type: String, required: false },
|
|
28
|
+
fields: { type: Array, required: true },
|
|
29
|
+
max: { type: Number, required: false },
|
|
30
|
+
min: { type: Number, required: false },
|
|
31
|
+
sortable: { type: Boolean, required: false }
|
|
32
|
+
});
|
|
33
|
+
const parentForm = useForm({ optional: true });
|
|
34
|
+
const { value } = useField(() => props.name, model);
|
|
35
|
+
const icons = useIcons();
|
|
36
|
+
const messages = useMessages();
|
|
37
|
+
const ui = useTheme("fieldArray", () => props.ui);
|
|
38
|
+
const items = computed(() => value.value ?? []);
|
|
39
|
+
const initialItems = cloneValue(items.value);
|
|
40
|
+
const touched = reactive({});
|
|
41
|
+
const standaloneForm = {
|
|
42
|
+
dirty: computed(() => !isEqual(items.value, initialItems)),
|
|
43
|
+
initialState: { items: initialItems },
|
|
44
|
+
size: computed(() => props.size),
|
|
45
|
+
touched,
|
|
46
|
+
errorFor: () => void 0,
|
|
47
|
+
getValue: (name) => getPath({ items: items.value }, name),
|
|
48
|
+
isDirty: () => false,
|
|
49
|
+
isTouched: (name) => touched[name] ?? false,
|
|
50
|
+
reset: () => value.value = cloneValue(initialItems),
|
|
51
|
+
resetField: () => {
|
|
52
|
+
},
|
|
53
|
+
setTouched: (name, next = true) => {
|
|
54
|
+
if (next) touched[name] = true;
|
|
55
|
+
else delete touched[name];
|
|
56
|
+
},
|
|
57
|
+
setValue: (name, next) => {
|
|
58
|
+
const state = { items: cloneValue(items.value) };
|
|
59
|
+
setPath(state, name, next);
|
|
60
|
+
value.value = state.items;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
provide(vunoFormInjectionKey, parentForm ?? standaloneForm);
|
|
64
|
+
const canAdd = computed(() => props.max === void 0 || items.value.length < props.max);
|
|
65
|
+
const canRemove = computed(() => items.value.length > (props.min ?? 0));
|
|
66
|
+
function emptyItem() {
|
|
67
|
+
const item = {};
|
|
68
|
+
for (const field of props.fields) {
|
|
69
|
+
if (field.type === "checkbox") item[field.name] = false;
|
|
70
|
+
else if (field.type === "currency" || field.type === "number") item[field.name] = void 0;
|
|
71
|
+
else if (field.type === "array" || field.type === "file" || field.type === "tags") item[field.name] = [];
|
|
72
|
+
else item[field.name] = "";
|
|
73
|
+
}
|
|
74
|
+
return item;
|
|
75
|
+
}
|
|
76
|
+
function fieldAt(field, index) {
|
|
77
|
+
const prefix = parentForm ? props.name : "items";
|
|
78
|
+
return { ...field, name: `${prefix}.${index}.${field.name}` };
|
|
79
|
+
}
|
|
80
|
+
function add() {
|
|
81
|
+
if (!canAdd.value) return;
|
|
82
|
+
value.value = [...items.value, emptyItem()];
|
|
83
|
+
}
|
|
84
|
+
function remove(index) {
|
|
85
|
+
if (!canRemove.value) return;
|
|
86
|
+
value.value = items.value.filter((_, position) => position !== index);
|
|
87
|
+
}
|
|
88
|
+
function move(index, offset) {
|
|
89
|
+
const next = [...items.value];
|
|
90
|
+
const target = index + offset;
|
|
91
|
+
if (target < 0 || target >= next.length) return;
|
|
92
|
+
const [moved] = next.splice(index, 1);
|
|
93
|
+
if (!moved) return;
|
|
94
|
+
next.splice(target, 0, moved);
|
|
95
|
+
value.value = next;
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<FieldShell v-bind="props">
|
|
101
|
+
<div :class="ui.root">
|
|
102
|
+
<div
|
|
103
|
+
v-for="(item, index) in items"
|
|
104
|
+
:key="index"
|
|
105
|
+
:class="ui.item"
|
|
106
|
+
>
|
|
107
|
+
<div :class="ui.itemHeader">
|
|
108
|
+
<span :class="ui.itemLabel">{{ index + 1 }}</span>
|
|
109
|
+
|
|
110
|
+
<div :class="ui.itemActions">
|
|
111
|
+
<Button
|
|
112
|
+
v-if="props.sortable && index > 0"
|
|
113
|
+
:aria-label="`${messages.fileMoveUp} ${index + 1}`"
|
|
114
|
+
color="neutral"
|
|
115
|
+
:icon="icons.fileMoveUp"
|
|
116
|
+
size="xs"
|
|
117
|
+
:ui="{ base: ui.itemAction }"
|
|
118
|
+
variant="ghost"
|
|
119
|
+
@click="move(index, -1)"
|
|
120
|
+
/>
|
|
121
|
+
<Button
|
|
122
|
+
v-if="props.sortable && index < items.length - 1"
|
|
123
|
+
:aria-label="`${messages.fileMoveDown} ${index + 1}`"
|
|
124
|
+
color="neutral"
|
|
125
|
+
:icon="icons.fileMoveDown"
|
|
126
|
+
size="xs"
|
|
127
|
+
:ui="{ base: ui.itemAction }"
|
|
128
|
+
variant="ghost"
|
|
129
|
+
@click="move(index, 1)"
|
|
130
|
+
/>
|
|
131
|
+
<Button
|
|
132
|
+
:aria-label="`${messages.removeItem} ${index + 1}`"
|
|
133
|
+
color="error"
|
|
134
|
+
:disabled="!canRemove"
|
|
135
|
+
:icon="icons.removeItem"
|
|
136
|
+
size="xs"
|
|
137
|
+
:ui="{ base: ui.itemAction }"
|
|
138
|
+
variant="ghost"
|
|
139
|
+
@click="remove(index)"
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div :class="ui.itemFields">
|
|
145
|
+
<div
|
|
146
|
+
v-for="field in props.fields"
|
|
147
|
+
:key="`${index}-${field.name}`"
|
|
148
|
+
:class="getColumnSpanClass(field.columns)"
|
|
149
|
+
>
|
|
150
|
+
<FormFieldRenderer :field="fieldAt(field, index)" />
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div
|
|
156
|
+
v-if="items.length === 0"
|
|
157
|
+
:class="ui.empty"
|
|
158
|
+
>
|
|
159
|
+
{{ messages.emptyArray }}
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<Button
|
|
163
|
+
class="self-start"
|
|
164
|
+
color="neutral"
|
|
165
|
+
:disabled="!canAdd"
|
|
166
|
+
:icon="icons.addItem"
|
|
167
|
+
:label="props.addLabel ?? messages.addItem"
|
|
168
|
+
variant="outline"
|
|
169
|
+
@click="add"
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
</FieldShell>
|
|
173
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VunoFieldArray } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldArray, 'columns'>;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: Record<string, unknown>[] | undefined;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: Record<string, unknown>[] | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>[] | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VunoFieldCheckbox } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldCheckbox, 'columns'>;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useField } from "#vuno/composables/useField";
|
|
3
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
import Checkbox from "#vuno/components/FieldCheckbox/internal/Checkbox/Checkbox.vue";
|
|
5
|
+
import FieldShell from "#vuno/components/internal/FieldShell/FieldShell.vue";
|
|
6
|
+
defineOptions({ name: "VunoFieldCheckbox" });
|
|
7
|
+
const model = defineModel({ type: Boolean });
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
name: { type: String, required: false },
|
|
10
|
+
class: { type: String, required: false },
|
|
11
|
+
description: { type: String, required: false },
|
|
12
|
+
disabled: { type: Boolean, required: false },
|
|
13
|
+
error: { type: String, required: false },
|
|
14
|
+
help: { type: String, required: false },
|
|
15
|
+
hint: { type: String, required: false },
|
|
16
|
+
label: { type: String, required: false },
|
|
17
|
+
orientation: { type: String, required: false },
|
|
18
|
+
required: { type: Boolean, required: false },
|
|
19
|
+
size: { type: String, required: false },
|
|
20
|
+
ui: { type: Object, required: false },
|
|
21
|
+
indeterminate: { type: Boolean, required: false }
|
|
22
|
+
});
|
|
23
|
+
const { value } = useField(() => props.name, model);
|
|
24
|
+
const ui = useTheme("fieldCheckbox", () => props.ui);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<FieldShell v-bind="props">
|
|
29
|
+
<template #default="control">
|
|
30
|
+
<Checkbox
|
|
31
|
+
v-bind="control"
|
|
32
|
+
v-model="value"
|
|
33
|
+
:disabled="props.disabled"
|
|
34
|
+
:indeterminate="props.indeterminate"
|
|
35
|
+
:ui="ui"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
</FieldShell>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VunoFieldCheckbox } from '#vuno/types/field';
|
|
2
|
+
type __VLS_Props = Omit<VunoFieldCheckbox, 'columns'>;
|
|
3
|
+
type __VLS_ModelProps = {
|
|
4
|
+
modelValue?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { VunoColor, VunoRadius, VunoSize } from '#vuno/types/base';
|
|
2
|
+
import type { VunoUi } from '#vuno/types/slots';
|
|
3
|
+
/**
|
|
4
|
+
* La casilla, nativa.
|
|
5
|
+
*
|
|
6
|
+
* Su raíz **es** el `<input>`, así que no apaga la herencia de atributos
|
|
7
|
+
* como hacen el input de texto o el área: lo que le llegue —el `id` y los
|
|
8
|
+
* `aria-*` del envoltorio de campo, el `name`, el `disabled`— cae en el
|
|
9
|
+
* elemento correcto sin reenviarlo a mano.
|
|
10
|
+
*/
|
|
11
|
+
type Props = {
|
|
12
|
+
color?: VunoColor;
|
|
13
|
+
/**
|
|
14
|
+
* Ni marcada ni sin marcar: la selección de una tabla donde solo
|
|
15
|
+
* hay algunas filas elegidas.
|
|
16
|
+
*/
|
|
17
|
+
indeterminate?: boolean;
|
|
18
|
+
/** La curvatura. Sin valor, la que traiga el tema. */
|
|
19
|
+
radius?: VunoRadius;
|
|
20
|
+
size?: VunoSize;
|
|
21
|
+
ui?: VunoUi<'checkbox' | 'fieldCheckbox'>;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_Props = Props;
|
|
24
|
+
type __VLS_ModelProps = {
|
|
25
|
+
modelValue?: boolean | undefined;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
28
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
30
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
31
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
color: VunoColor;
|
|
34
|
+
radius: VunoRadius;
|
|
35
|
+
size: VunoSize;
|
|
36
|
+
ui: VunoUi<"checkbox" | "fieldCheckbox">;
|
|
37
|
+
indeterminate: boolean;
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const _default: typeof __VLS_export;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Casilla nativa. El marcado se pinta con `accent-color`, así que toma el
|
|
3
|
+
* color del tema sin dibujar ningún SVG encima.
|
|
4
|
+
*/
|
|
5
|
+
export declare const checkboxTheme: Record<"checkbox", {
|
|
6
|
+
readonly slots: {
|
|
7
|
+
readonly base: "shrink-0 cursor-pointer rounded-sm border border-vuno-border-strong bg-vuno-surface accent-(--vuno-accent) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent) disabled:cursor-not-allowed disabled:opacity-50";
|
|
8
|
+
};
|
|
9
|
+
readonly variants: {
|
|
10
|
+
readonly color: Record<import("../../../../types/base.js").VunoColor, Record<"base", string>>;
|
|
11
|
+
readonly radius: Record<import("../../../../types/base.js").VunoRadius, Record<"base", string>>;
|
|
12
|
+
readonly size: {
|
|
13
|
+
readonly xs: {
|
|
14
|
+
readonly base: "size-3.5";
|
|
15
|
+
};
|
|
16
|
+
readonly sm: {
|
|
17
|
+
readonly base: "size-4";
|
|
18
|
+
};
|
|
19
|
+
readonly md: {
|
|
20
|
+
readonly base: "size-4";
|
|
21
|
+
};
|
|
22
|
+
readonly lg: {
|
|
23
|
+
readonly base: "size-5";
|
|
24
|
+
};
|
|
25
|
+
readonly xl: {
|
|
26
|
+
readonly base: "size-5";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { accentByColor, radiusByStep } from "#vuno/theme/shared";
|
|
2
|
+
import { defineTheme } from "#vuno/utils/theme";
|
|
3
|
+
export const checkboxTheme = defineTheme("checkbox", {
|
|
4
|
+
slots: { base: "shrink-0 cursor-pointer rounded-sm border border-vuno-border-strong bg-vuno-surface accent-(--vuno-accent) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--vuno-accent) disabled:cursor-not-allowed disabled:opacity-50" },
|
|
5
|
+
variants: {
|
|
6
|
+
color: accentByColor("base"),
|
|
7
|
+
radius: radiusByStep("base"),
|
|
8
|
+
size: { xs: { base: "size-3.5" }, sm: { base: "size-4" }, md: { base: "size-4" }, lg: { base: "size-5" }, xl: { base: "size-5" } }
|
|
9
|
+
}
|
|
10
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useTemplateRef, watchEffect } from "vue";
|
|
3
|
+
import { useTheme } from "#vuno/composables/useTheme";
|
|
4
|
+
defineOptions({ name: "VunoCheckbox" });
|
|
5
|
+
const model = defineModel({ type: Boolean, skipCheck: true, ...{ default: void 0 } });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
color: { type: String, required: false, default: "primary" },
|
|
8
|
+
indeterminate: { type: Boolean, required: false, default: false },
|
|
9
|
+
radius: { type: String, required: false, default: void 0 },
|
|
10
|
+
size: { type: String, required: false, default: "md" },
|
|
11
|
+
ui: { type: Object, required: false, default: void 0 }
|
|
12
|
+
});
|
|
13
|
+
const ui = useTheme(
|
|
14
|
+
"checkbox",
|
|
15
|
+
() => props.ui,
|
|
16
|
+
() => ({
|
|
17
|
+
color: props.color,
|
|
18
|
+
radius: props.radius,
|
|
19
|
+
size: props.size
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
const control = useTemplateRef("control");
|
|
23
|
+
function onChange(event) {
|
|
24
|
+
model.value = event.target.checked;
|
|
25
|
+
}
|
|
26
|
+
watchEffect(() => {
|
|
27
|
+
const el = control.value;
|
|
28
|
+
if (el) el.indeterminate = props.indeterminate;
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<input
|
|
34
|
+
ref="control"
|
|
35
|
+
:checked="model === true"
|
|
36
|
+
:class="ui.base"
|
|
37
|
+
type="checkbox"
|
|
38
|
+
@change="onChange"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|