@volverjs/ui-vue 0.0.10-beta.3 → 0.0.10-beta.31
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/LICENSE +1 -1
- package/README.md +106 -10
- package/auto-imports.d.ts +7 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +22 -15
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +192 -103
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +160 -8
- package/dist/components/VvAccordion/index.d.ts +8 -9
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +451 -172
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +58 -13
- package/dist/components/VvAccordionGroup/index.d.ts +14 -6
- package/dist/components/VvAction/VvAction.es.js +78 -27
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +57 -22
- package/dist/components/VvAction/index.d.ts +25 -9
- package/dist/components/VvAlert/VvAlert.es.js +204 -171
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +24 -14
- package/dist/components/VvAlert/index.d.ts +17 -9
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +250 -188
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +16 -9
- package/dist/components/VvAlertGroup/index.d.ts +6 -14
- package/dist/components/VvAvatar/VvAvatar.es.js +61 -21
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +118 -48
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +78 -28
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +276 -60
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +291 -252
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +94 -40
- package/dist/components/VvButton/index.d.ts +51 -29
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +81 -40
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +24 -11
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +86 -36
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +177 -120
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +105 -33
- package/dist/components/VvCheckbox/index.d.ts +47 -14
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +190 -107
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +101 -30
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +806 -581
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +171 -104
- package/dist/components/VvCombobox/index.d.ts +62 -26
- package/dist/components/VvDialog/VvDialog.es.js +140 -153
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +138 -71
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +101 -75
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +66 -25
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +13 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +35 -7
- package/dist/components/VvDropdown/index.d.ts +52 -10
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +152 -39
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +335 -8
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +63 -20
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +188 -80
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +33 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1777 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +359 -0
- package/dist/components/VvInputFile/index.d.ts +200 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +7 -5
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +10 -8
- package/dist/components/VvInputText/VvInputStepAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputText.es.js +1237 -324
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +207 -57
- package/dist/components/VvInputText/index.d.ts +99 -29
- package/dist/components/VvNav/VvNav.es.js +135 -56
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +32 -9
- package/dist/components/VvNav/VvNavItem.vue.d.ts +1 -1
- package/dist/components/VvNav/VvNavSeparator.vue.d.ts +1 -1
- package/dist/components/VvNav/index.d.ts +5 -2
- package/dist/components/VvNavItem/VvNavItem.es.js +91 -33
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +72 -26
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +160 -103
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +103 -31
- package/dist/components/VvRadio/index.d.ts +50 -17
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +190 -107
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +101 -30
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +251 -238
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +117 -44
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +191 -75
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +31 -7
- package/dist/components/VvTab/index.d.ts +4 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +232 -224
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +156 -49
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +79 -29
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +13 -6
- package/dist/components/VvTooltip/index.d.ts +5 -2
- package/dist/components/common/HintSlot.d.ts +1 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +3534 -1650
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +99 -4
- package/dist/composables/alert/useInjectAlert.d.ts +1 -6
- package/dist/composables/dropdown/useInjectDropdown.d.ts +3 -23
- package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -4
- package/dist/composables/group/useInjectedGroupState.d.ts +4 -5
- package/dist/composables/group/useProvideGroupState.d.ts +3 -3
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +92 -3
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/usePersistence.d.ts +2 -0
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/constants.d.ts +34 -32
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +99 -43
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +97 -38
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +267 -267
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +90 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +272 -81
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +87 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +143 -89
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +1075 -492
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Button/Button.settings.d.ts +0 -1
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +12 -0
- package/dist/stories/InputFile/InputFileDropArea.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileIconPosition.stories.d.ts +8 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +7 -0
- package/dist/stories/Tab/Tab.settings.d.ts +2 -15
- package/dist/test/expect.d.ts +1 -1
- package/dist/types/alert.d.ts +9 -7
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/generic.d.ts +1 -2
- package/dist/types/group.d.ts +37 -15
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +16 -0
- package/dist/types/nav.d.ts +2 -2
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +78 -78
- package/src/Volver.ts +31 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +121 -58
- package/src/components/VvAccordion/index.ts +8 -23
- package/src/components/VvAccordionGroup/VvAccordionGroup.vue +164 -47
- package/src/components/VvAccordionGroup/index.ts +6 -6
- package/src/components/VvAction/VvAction.vue +17 -5
- package/src/components/VvAlert/index.ts +14 -9
- package/src/components/VvAlertGroup/index.ts +3 -15
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +17 -7
- package/src/components/VvButton/index.ts +9 -16
- package/src/components/VvButtonGroup/VvButtonGroup.vue +1 -2
- package/src/components/VvCheckbox/index.ts +2 -2
- package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +1 -2
- package/src/components/VvCombobox/VvCombobox.vue +15 -12
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvDropdown/VvDropdown.vue +11 -2
- package/src/components/VvDropdown/VvDropdownItem.vue +4 -1
- package/src/components/VvDropdown/VvDropdownOption.vue +4 -21
- package/src/components/VvDropdown/index.ts +35 -1
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +35 -48
- package/src/components/VvInputFile/VvInputFile.vue +395 -0
- package/src/components/VvInputFile/index.ts +135 -0
- package/src/components/VvInputText/VvInputClearAction.ts +10 -6
- package/src/components/VvInputText/VvInputPasswordAction.ts +13 -9
- package/src/components/VvInputText/VvInputText.vue +141 -33
- package/src/components/VvInputText/index.ts +31 -16
- package/src/components/VvNav/VvNav.vue +4 -2
- package/src/components/VvRadio/index.ts +5 -5
- package/src/components/VvRadioGroup/VvRadioGroup.vue +1 -2
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +5 -1
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/alert/useAlert.ts +12 -9
- package/src/composables/dropdown/useProvideDropdown.ts +4 -4
- package/src/composables/group/useInjectedGroupState.ts +20 -16
- package/src/composables/group/useProvideGroupState.ts +10 -15
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/usePersistence.ts +76 -0
- package/src/composables/useUniqueId.ts +2 -2
- package/src/constants.ts +47 -32
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +108 -31
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/Accordion/Accordion.test.ts +1 -1
- package/src/stories/AccordionGroup/AccordionGroup.settings.ts +2 -2
- package/src/stories/AccordionGroup/AccordionGroup.test.ts +17 -11
- package/src/stories/AccordionGroup/AccordionGroupSlots.stories.ts +1 -1
- package/src/stories/Alert/Alert.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroup.test.ts +1 -1
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Avatar/Avatar.test.ts +1 -1
- package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -1
- package/src/stories/Badge/Badge.test.ts +1 -1
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Button/Button.settings.ts +1 -4
- package/src/stories/Button/Button.test.ts +1 -1
- package/src/stories/ButtonGroup/ButtonGroup.test.ts +1 -1
- package/src/stories/Card/Card.test.ts +1 -1
- package/src/stories/Checkbox/Checkbox.test.ts +1 -1
- package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +1 -1
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Combobox/Combobox.test.ts +1 -1
- package/src/stories/Dialog/Dialog.test.ts +2 -2
- package/src/stories/Dropdown/Dropdown.test.ts +1 -1
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +89 -0
- package/src/stories/InputFile/InputFileDropArea.stories.ts +56 -0
- package/src/stories/InputFile/InputFileIconPosition.stories.ts +43 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +33 -0
- package/src/stories/InputText/InputText.test.ts +1 -1
- package/src/stories/Nav/Nav.test.ts +1 -1
- package/src/stories/Progress/Progress.test.ts +1 -1
- package/src/stories/Radio/Radio.test.ts +1 -1
- package/src/stories/RadioGroup/RadioGroup.test.ts +1 -1
- package/src/stories/Select/Select.test.ts +1 -1
- package/src/stories/Tab/Tab.settings.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +1 -1
- package/src/stories/Textarea/Textarea.test.ts +1 -1
- package/src/stories/Tooltip/Tooltip.test.ts +1 -1
- package/src/stories/argTypes.ts +1 -1
- package/src/test/expect.ts +2 -4
- package/src/types/alert.ts +11 -7
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +3 -3
- package/src/types/group.ts +22 -14
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +18 -0
- package/src/types/nav.ts +2 -3
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
package/src/stories/argTypes.ts
CHANGED
package/src/test/expect.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { expect } from '@storybook/
|
|
2
|
-
import { userEvent } from '@storybook/testing-library'
|
|
1
|
+
import { userEvent, expect } from '@storybook/test'
|
|
3
2
|
import { axe } from 'jest-axe'
|
|
4
3
|
import { sleep } from '@/test/sleep'
|
|
5
4
|
|
|
@@ -79,8 +78,7 @@ expect.extend({
|
|
|
79
78
|
const img = element.getElementsByTagName(imgTag)
|
|
80
79
|
return {
|
|
81
80
|
pass: img.length === 1,
|
|
82
|
-
message: () =>
|
|
83
|
-
`${imgTag} not exist!`,
|
|
81
|
+
message: () => `${imgTag} not exist!`,
|
|
84
82
|
}
|
|
85
83
|
},
|
|
86
84
|
})
|
package/src/types/alert.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import type { VvIconProps } from '@/components/VvIcon'
|
|
2
|
+
import { AlertRole } from '@/constants'
|
|
3
|
+
|
|
4
|
+
export type AlertModifier =
|
|
2
5
|
| 'success'
|
|
3
6
|
| 'info'
|
|
4
7
|
| 'warning'
|
|
5
8
|
| 'danger'
|
|
6
9
|
| 'brand'
|
|
7
10
|
| 'accent'
|
|
11
|
+
| string
|
|
8
12
|
|
|
9
13
|
export type Alert = {
|
|
10
14
|
id: string | number
|
|
11
|
-
group: string
|
|
12
15
|
title?: string
|
|
13
|
-
icon
|
|
16
|
+
icon?: string | VvIconProps
|
|
14
17
|
content?: string
|
|
15
18
|
footer?: string
|
|
16
|
-
modifiers
|
|
17
|
-
dismissable
|
|
18
|
-
autoClose
|
|
19
|
-
|
|
19
|
+
modifiers?: AlertModifier | AlertModifier[]
|
|
20
|
+
dismissable?: boolean
|
|
21
|
+
autoClose?: number
|
|
22
|
+
closeLabel?: string
|
|
23
|
+
role?: AlertRole
|
|
20
24
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class ValidationError extends Error {}
|
|
2
|
+
export type BlurhashWorkerType = {
|
|
3
|
+
encode: (
|
|
4
|
+
pixels: Uint8ClampedArray,
|
|
5
|
+
width: number,
|
|
6
|
+
height: number,
|
|
7
|
+
componentX: number,
|
|
8
|
+
componentY: number,
|
|
9
|
+
) => string
|
|
10
|
+
decode: (
|
|
11
|
+
blurhash: string,
|
|
12
|
+
width: number,
|
|
13
|
+
height: number,
|
|
14
|
+
punch?: number,
|
|
15
|
+
) => Uint8ClampedArray
|
|
16
|
+
isBlurhashValid: (blurhash: string) => {
|
|
17
|
+
result: boolean
|
|
18
|
+
errorReason?: string
|
|
19
|
+
}
|
|
20
|
+
ValidationError: ValidationError
|
|
21
|
+
}
|
package/src/types/generic.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type Nullable<T> = T | null | undefined
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
export type Option = Record<string | number | symbol, any> & {
|
|
5
|
+
options?: Option[]
|
|
6
6
|
}
|
package/src/types/group.ts
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* State shared for a group of elements
|
|
5
|
-
*/
|
|
6
|
-
export default interface GroupState {
|
|
7
|
-
// The key of the group
|
|
8
|
-
[itemKey: string]: Ref<unknown> | unknown | undefined
|
|
9
|
-
key: string | number | symbol
|
|
10
|
-
}
|
|
2
|
+
import type { Emitter } from 'mitt'
|
|
11
3
|
|
|
12
4
|
/**
|
|
13
5
|
* State shared in a group of inputs
|
|
14
6
|
*/
|
|
15
|
-
export
|
|
7
|
+
export type InputGroupState = {
|
|
8
|
+
modelValue: Ref<unknown>
|
|
16
9
|
readonly: Ref<boolean>
|
|
17
10
|
disabled: Ref<boolean>
|
|
18
11
|
valid: Ref<boolean>
|
|
@@ -22,7 +15,7 @@ export interface InputGroupState extends GroupState {
|
|
|
22
15
|
/**
|
|
23
16
|
* State shared in a group of buttons
|
|
24
17
|
*/
|
|
25
|
-
export
|
|
18
|
+
export type ButtonGroupState = {
|
|
26
19
|
modelValue: Ref<
|
|
27
20
|
string | number | boolean | (string | number | boolean)[] | undefined
|
|
28
21
|
>
|
|
@@ -36,9 +29,24 @@ export interface ButtonGroupState extends GroupState {
|
|
|
36
29
|
/**
|
|
37
30
|
* State shared in a group of accordions
|
|
38
31
|
*/
|
|
39
|
-
export
|
|
40
|
-
|
|
32
|
+
export type AccordionGroupBusEvents = {
|
|
33
|
+
toggle: { name: string; value: boolean }
|
|
34
|
+
register: { name: string }
|
|
35
|
+
unregister: { name: string }
|
|
36
|
+
expand: { name?: string | string[] }
|
|
37
|
+
collapse: { name?: string | string[] }
|
|
38
|
+
}
|
|
39
|
+
export type AccordionGroupState = {
|
|
41
40
|
disabled: Ref<boolean>
|
|
42
41
|
modifiers: Ref<string[] | string | undefined>
|
|
43
|
-
|
|
42
|
+
bus: Emitter<AccordionGroupBusEvents>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* State shared in a group of alerts
|
|
47
|
+
*/
|
|
48
|
+
export type AlertGroupBusEvents = { close: string }
|
|
49
|
+
export type AlertGroupState = {
|
|
50
|
+
name?: Ref<string | undefined>
|
|
51
|
+
bus?: Emitter<AlertGroupBusEvents>
|
|
44
52
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type UploadedFile<Source = undefined> = Source extends undefined
|
|
2
|
+
? {
|
|
3
|
+
name: string
|
|
4
|
+
size: number
|
|
5
|
+
type: string
|
|
6
|
+
url: string
|
|
7
|
+
thumbnailUrl?: string
|
|
8
|
+
lastModified?: number
|
|
9
|
+
}
|
|
10
|
+
: {
|
|
11
|
+
name: string
|
|
12
|
+
size: number
|
|
13
|
+
type: string
|
|
14
|
+
url: string
|
|
15
|
+
thumbnailUrl?: string
|
|
16
|
+
lastModified?: number
|
|
17
|
+
source: Source
|
|
18
|
+
}
|
package/src/types/nav.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { AnchorTarget } from '@/constants'
|
|
2
|
-
|
|
3
1
|
export type NavItem = {
|
|
4
2
|
label: string
|
|
5
3
|
ariaLabel?: string
|
|
6
4
|
title?: string
|
|
7
5
|
to?: string | Record<string, unknown>
|
|
8
6
|
href?: string
|
|
9
|
-
target?:
|
|
7
|
+
target?: string
|
|
10
8
|
rel?: string
|
|
11
9
|
disabled?: boolean
|
|
12
10
|
current?: boolean
|
|
13
11
|
class?: string | string[]
|
|
14
12
|
on?: Record<'click' | string, () => void>
|
|
13
|
+
data?: Record<string, unknown>
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
export type NavItemTab = NavItem & {
|
|
@@ -275,14 +275,3 @@ export function filterArray<T = Record<string, unknown>>(
|
|
|
275
275
|
})
|
|
276
276
|
})
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
export function kebabCase(value: string) {
|
|
280
|
-
if (value) {
|
|
281
|
-
return value
|
|
282
|
-
.match(
|
|
283
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,
|
|
284
|
-
)
|
|
285
|
-
?.join('-')
|
|
286
|
-
?.toLowerCase()
|
|
287
|
-
}
|
|
288
|
-
}
|