nuance-ui 0.1.38 → 0.1.39
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/dist/module.json +1 -1
- package/dist/runtime/components/action-icon/action-icon-group.d.vue.ts +2 -2
- package/dist/runtime/components/action-icon/action-icon-group.vue.d.ts +2 -2
- package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +2 -2
- package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +2 -2
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +2 -2
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +2 -2
- package/dist/runtime/components/alert.d.vue.ts +3 -3
- package/dist/runtime/components/alert.vue.d.ts +3 -3
- package/dist/runtime/components/app-shell/app-shell-aside.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-aside.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-footer.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-footer.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-header.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-header.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-main.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-main.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-navbar.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-navbar.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-section.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell-section.vue.d.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell.d.vue.ts +2 -2
- package/dist/runtime/components/app-shell/app-shell.vue.d.ts +2 -2
- package/dist/runtime/components/avatar/avatar-group.d.vue.ts +2 -2
- package/dist/runtime/components/avatar/avatar-group.vue.d.ts +2 -2
- package/dist/runtime/components/avatar/avatar.d.vue.ts +2 -2
- package/dist/runtime/components/avatar/avatar.vue.d.ts +2 -2
- package/dist/runtime/components/badge.d.vue.ts +4 -4
- package/dist/runtime/components/badge.vue +45 -24
- package/dist/runtime/components/badge.vue.d.ts +4 -4
- package/dist/runtime/components/box.d.vue.ts +2 -2
- package/dist/runtime/components/box.vue.d.ts +2 -2
- package/dist/runtime/components/breadcrumbs.d.vue.ts +4 -4
- package/dist/runtime/components/breadcrumbs.vue.d.ts +4 -4
- package/dist/runtime/components/button/button-group.d.vue.ts +2 -2
- package/dist/runtime/components/button/button-group.vue.d.ts +2 -2
- package/dist/runtime/components/button/button.d.vue.ts +8 -8
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue.d.ts +8 -8
- package/dist/runtime/components/button/unstyled-button.d.vue.ts +2 -2
- package/dist/runtime/components/button/unstyled-button.vue +2 -2
- package/dist/runtime/components/button/unstyled-button.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/calendar.d.vue.ts +20 -8
- package/dist/runtime/components/calendar/calendar.vue +1 -1
- package/dist/runtime/components/calendar/calendar.vue.d.ts +20 -8
- package/dist/runtime/components/calendar/lib/context.d.ts +1 -1
- package/dist/runtime/components/calendar/lib/use-calendar-selection.js +5 -4
- package/dist/runtime/components/calendar/model.d.ts +3 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +22 -13
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue +22 -17
- package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-root.d.vue.ts +19 -9
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue +6 -7
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue.d.ts +19 -9
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +1 -1
- package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +1 -1
- package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +3 -3
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -16
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +3 -3
- package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +1 -1
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +9 -5
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +1 -1
- package/dist/runtime/components/card/card-section.d.vue.ts +2 -2
- package/dist/runtime/components/card/card-section.vue.d.ts +2 -2
- package/dist/runtime/components/card/card.d.vue.ts +2 -2
- package/dist/runtime/components/card/card.vue.d.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-group.d.vue.ts +5 -5
- package/dist/runtime/components/checkbox/checkbox-group.vue.d.ts +5 -5
- package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox.d.vue.ts +2 -2
- package/dist/runtime/components/checkbox/checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/chip/chip-group.d.vue.ts +10 -6
- package/dist/runtime/components/chip/chip-group.vue.d.ts +10 -6
- package/dist/runtime/components/chip/chip.d.vue.ts +2 -2
- package/dist/runtime/components/chip/chip.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-dropdown.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-dropdown.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-empty.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-empty.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-group.d.vue.ts +10 -6
- package/dist/runtime/components/combobox/combobox-group.vue.d.ts +10 -6
- package/dist/runtime/components/combobox/combobox-option-list.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-option-list.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-option.d.vue.ts +8 -4
- package/dist/runtime/components/combobox/combobox-option.vue.d.ts +8 -4
- package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -7
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue +1 -3
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -7
- package/dist/runtime/components/combobox/combobox-root.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-root.vue +2 -2
- package/dist/runtime/components/combobox/combobox-root.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-target.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-target.vue +1 -1
- package/dist/runtime/components/combobox/combobox-target.vue.d.ts +2 -2
- package/dist/runtime/components/container.d.vue.ts +2 -2
- package/dist/runtime/components/container.vue.d.ts +2 -2
- package/dist/runtime/components/date-time-picker.d.vue.ts +47 -0
- package/dist/runtime/components/date-time-picker.vue +151 -0
- package/dist/runtime/components/date-time-picker.vue.d.ts +47 -0
- package/dist/runtime/components/dialog/index.d.ts +4 -4
- package/dist/runtime/components/dialog/{dialog-close-button.d.vue.ts → ui/dialog-close-button.d.vue.ts} +3 -3
- package/dist/runtime/components/dialog/{dialog-close-button.vue → ui/dialog-close-button.vue} +2 -2
- package/dist/runtime/components/dialog/{dialog-close-button.vue.d.ts → ui/dialog-close-button.vue.d.ts} +3 -3
- package/dist/runtime/components/dialog/{dialog-header.d.vue.ts → ui/dialog-header.d.vue.ts} +3 -3
- package/dist/runtime/components/dialog/{dialog-header.vue → ui/dialog-header.vue} +1 -1
- package/dist/runtime/components/dialog/{dialog-header.vue.d.ts → ui/dialog-header.vue.d.ts} +3 -3
- package/dist/runtime/components/dialog/{dialog-root.d.vue.ts → ui/dialog-root.d.vue.ts} +5 -5
- package/dist/runtime/components/dialog/{dialog-root.vue → ui/dialog-root.vue} +5 -5
- package/dist/runtime/components/dialog/{dialog-root.vue.d.ts → ui/dialog-root.vue.d.ts} +5 -5
- package/dist/runtime/components/dialog/{dialog-title.d.vue.ts → ui/dialog-title.d.vue.ts} +3 -3
- package/dist/runtime/components/dialog/{dialog-title.vue → ui/dialog-title.vue} +2 -2
- package/dist/runtime/components/dialog/{dialog-title.vue.d.ts → ui/dialog-title.vue.d.ts} +3 -3
- package/dist/runtime/components/dialog/ui/dialog.module.css +1 -0
- package/dist/runtime/components/drawer/drawer-close-button.d.vue.ts +2 -2
- package/dist/runtime/components/drawer/drawer-close-button.vue +1 -1
- package/dist/runtime/components/drawer/drawer-close-button.vue.d.ts +2 -2
- package/dist/runtime/components/drawer/drawer-header.d.vue.ts +2 -2
- package/dist/runtime/components/drawer/drawer-header.vue +1 -1
- package/dist/runtime/components/drawer/drawer-header.vue.d.ts +2 -2
- package/dist/runtime/components/drawer/drawer-root.d.vue.ts +2 -2
- package/dist/runtime/components/drawer/drawer-root.vue +3 -3
- package/dist/runtime/components/drawer/drawer-root.vue.d.ts +2 -2
- package/dist/runtime/components/drawer/drawer-title.d.vue.ts +2 -2
- package/dist/runtime/components/drawer/drawer-title.vue +2 -2
- package/dist/runtime/components/drawer/drawer-title.vue.d.ts +2 -2
- package/dist/runtime/components/drawer/drawer.module.css +1 -1
- package/dist/runtime/components/file-upload.d.vue.ts +9 -5
- package/dist/runtime/components/file-upload.vue.d.ts +9 -5
- package/dist/runtime/components/index.d.ts +1 -0
- package/dist/runtime/components/input/date-picker.d.vue.ts +44 -0
- package/dist/runtime/components/input/date-picker.vue +174 -0
- package/dist/runtime/components/input/date-picker.vue.d.ts +44 -0
- package/dist/runtime/components/input/email-input.d.vue.ts +6 -6
- package/dist/runtime/components/input/email-input.vue +9 -5
- package/dist/runtime/components/input/email-input.vue.d.ts +6 -6
- package/dist/runtime/components/input/index.d.ts +2 -1
- package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +2 -2
- package/dist/runtime/components/input/lib/input-wrapper.context.js +1 -2
- package/dist/runtime/components/input/number-input.d.vue.ts +5 -5
- package/dist/runtime/components/input/number-input.vue +19 -18
- package/dist/runtime/components/input/number-input.vue.d.ts +5 -5
- package/dist/runtime/components/input/password-input.d.vue.ts +6 -6
- package/dist/runtime/components/input/password-input.vue +8 -1
- package/dist/runtime/components/input/password-input.vue.d.ts +6 -6
- package/dist/runtime/components/input/text-input.d.vue.ts +21 -11
- package/dist/runtime/components/input/text-input.vue +34 -15
- package/dist/runtime/components/input/text-input.vue.d.ts +21 -11
- package/dist/runtime/components/input/types/index.d.ts +2 -0
- package/dist/runtime/components/input/ui/button-input.d.vue.ts +42 -0
- package/dist/runtime/components/input/ui/button-input.vue +103 -0
- package/dist/runtime/components/input/ui/button-input.vue.d.ts +42 -0
- package/dist/runtime/components/input/ui/input-base.d.vue.ts +11 -63
- package/dist/runtime/components/input/ui/input-base.vue +55 -78
- package/dist/runtime/components/input/ui/input-base.vue.d.ts +11 -63
- package/dist/runtime/components/input/ui/input-inline.d.vue.ts +5 -5
- package/dist/runtime/components/input/ui/input-inline.vue +2 -6
- package/dist/runtime/components/input/ui/input-inline.vue.d.ts +5 -5
- package/dist/runtime/components/input/ui/input-label.vue +2 -5
- package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -5
- package/dist/runtime/components/input/ui/input-wrapper.vue +11 -5
- package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -5
- package/dist/runtime/components/input/ui/spin-input.d.vue.ts +25 -0
- package/dist/runtime/components/input/ui/spin-input.vue +155 -0
- package/dist/runtime/components/input/ui/spin-input.vue.d.ts +25 -0
- package/dist/runtime/components/link/link-button.d.vue.ts +4 -4
- package/dist/runtime/components/link/link-button.vue.d.ts +4 -4
- package/dist/runtime/components/link/link.d.vue.ts +2 -2
- package/dist/runtime/components/link/link.vue +1 -1
- package/dist/runtime/components/link/link.vue.d.ts +2 -2
- package/dist/runtime/components/modal/modal-close-button.d.vue.ts +2 -2
- package/dist/runtime/components/modal/modal-close-button.vue +1 -1
- package/dist/runtime/components/modal/modal-close-button.vue.d.ts +2 -2
- package/dist/runtime/components/modal/modal-header.d.vue.ts +2 -2
- package/dist/runtime/components/modal/modal-header.vue +1 -1
- package/dist/runtime/components/modal/modal-header.vue.d.ts +2 -2
- package/dist/runtime/components/modal/modal-root.d.vue.ts +2 -2
- package/dist/runtime/components/modal/modal-root.vue +3 -3
- package/dist/runtime/components/modal/modal-root.vue.d.ts +2 -2
- package/dist/runtime/components/modal/modal-title.d.vue.ts +2 -2
- package/dist/runtime/components/modal/modal-title.vue +2 -2
- package/dist/runtime/components/modal/modal-title.vue.d.ts +2 -2
- package/dist/runtime/components/nav-link/nav-icon-link.d.vue.ts +2 -2
- package/dist/runtime/components/nav-link/nav-icon-link.vue.d.ts +2 -2
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +5 -5
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +5 -5
- package/dist/runtime/components/paper.d.vue.ts +2 -2
- package/dist/runtime/components/paper.vue.d.ts +2 -2
- package/dist/runtime/components/popover/lib/use-popover.d.ts +1 -0
- package/dist/runtime/components/popover/lib/use-popover.js +2 -1
- package/dist/runtime/components/popover/popover-dropdown.vue +2 -0
- package/dist/runtime/components/popover/popover-target.d.vue.ts +7 -3
- package/dist/runtime/components/popover/popover-target.vue +10 -2
- package/dist/runtime/components/popover/popover-target.vue.d.ts +7 -3
- package/dist/runtime/components/popover/popover.vue +1 -1
- package/dist/runtime/components/progress/progress-label.d.vue.ts +2 -2
- package/dist/runtime/components/progress/progress-label.vue.d.ts +2 -2
- package/dist/runtime/components/progress/progress-root.d.vue.ts +2 -2
- package/dist/runtime/components/progress/progress-root.vue.d.ts +2 -2
- package/dist/runtime/components/progress/progress-section.d.vue.ts +2 -2
- package/dist/runtime/components/progress/progress-section.vue.d.ts +2 -2
- package/dist/runtime/components/renderless/renderless.d.vue.ts +2 -2
- package/dist/runtime/components/renderless/renderless.vue.d.ts +2 -2
- package/dist/runtime/components/roving-focus/roving-focus-item.d.vue.ts +2 -2
- package/dist/runtime/components/roving-focus/roving-focus-item.vue.d.ts +2 -2
- package/dist/runtime/components/roving-focus/roving-focus.d.vue.ts +2 -2
- package/dist/runtime/components/roving-focus/roving-focus.vue.d.ts +2 -2
- package/dist/runtime/components/select/select.d.vue.ts +12 -8
- package/dist/runtime/components/select/select.vue +9 -11
- package/dist/runtime/components/select/select.vue.d.ts +12 -8
- package/dist/runtime/components/table/table.d.vue.ts +10 -6
- package/dist/runtime/components/table/table.vue +1 -1
- package/dist/runtime/components/table/table.vue.d.ts +10 -6
- package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -2
- package/dist/runtime/components/tabs/tabs-list.vue +1 -1
- package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -2
- package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +2 -2
- package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +2 -2
- package/dist/runtime/components/tabs/tabs-root.d.vue.ts +2 -2
- package/dist/runtime/components/tabs/tabs-root.vue.d.ts +2 -2
- package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +4 -4
- package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +4 -4
- package/dist/runtime/components/text.d.vue.ts +2 -2
- package/dist/runtime/components/text.vue +1 -1
- package/dist/runtime/components/text.vue.d.ts +2 -2
- package/dist/runtime/components/textarea.d.vue.ts +11 -9
- package/dist/runtime/components/textarea.vue +42 -30
- package/dist/runtime/components/textarea.vue.d.ts +11 -9
- package/dist/runtime/components/time-picker/index.d.ts +6 -0
- package/dist/runtime/components/time-picker/index.js +5 -0
- package/dist/runtime/components/time-picker/lib/clamp-time.d.ts +13 -0
- package/dist/runtime/components/time-picker/lib/clamp-time.js +23 -0
- package/dist/runtime/components/time-picker/lib/get-parsed-time.d.ts +16 -0
- package/dist/runtime/components/time-picker/lib/get-parsed-time.js +26 -0
- package/dist/runtime/components/time-picker/lib/get-time-string.d.ts +13 -0
- package/dist/runtime/components/time-picker/lib/get-time-string.js +41 -0
- package/dist/runtime/components/time-picker/lib/pad-time.d.ts +1 -0
- package/dist/runtime/components/time-picker/lib/pad-time.js +3 -0
- package/dist/runtime/components/time-picker/lib/split-time-string.d.ts +5 -0
- package/dist/runtime/components/time-picker/lib/split-time-string.js +4 -0
- package/dist/runtime/components/time-picker/lib/use-time-picker.d.ts +29 -0
- package/dist/runtime/components/time-picker/lib/use-time-picker.js +103 -0
- package/dist/runtime/components/time-picker/model.d.ts +17 -0
- package/dist/runtime/components/time-picker/model.js +0 -0
- package/dist/runtime/components/time-picker/time-picker.d.vue.ts +88 -0
- package/dist/runtime/components/time-picker/time-picker.vue +313 -0
- package/dist/runtime/components/time-picker/time-picker.vue.d.ts +88 -0
- package/dist/runtime/components/title.d.vue.ts +2 -2
- package/dist/runtime/components/title.vue +1 -1
- package/dist/runtime/components/title.vue.d.ts +2 -2
- package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +2 -2
- package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +2 -2
- package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +10 -6
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +10 -6
- package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +2 -2
- package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +2 -2
- package/dist/runtime/composals/use-date-config.d.ts +11 -1
- package/dist/runtime/composals/use-date-config.js +8 -5
- package/dist/runtime/helpers/date/create-months.d.ts +1 -7
- package/dist/runtime/helpers/date/create-months.js +1 -1
- package/dist/runtime/helpers/date/get-days-between.js +4 -1
- package/dist/runtime/types/index.d.ts +1 -1
- package/package.json +18 -18
- package/dist/runtime/components/dialog/dialog.module.css +0 -1
- package/dist/runtime/components/input/input.d.vue.ts +0 -38
- package/dist/runtime/components/input/input.vue +0 -47
- package/dist/runtime/components/input/input.vue.d.ts +0 -38
- /package/dist/runtime/components/dialog/{types/index.d.ts → model.d.ts} +0 -0
- /package/dist/runtime/components/dialog/{types/index.js → model.js} +0 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import ActionIcon from "../action-icon/action-icon.vue";
|
|
4
|
+
import InputBase from "../input/ui/input-base.vue";
|
|
5
|
+
import InputWrapper from "../input/ui/input-wrapper.vue";
|
|
6
|
+
import SpinInput from "../input/ui/spin-input.vue";
|
|
7
|
+
import { getParsedTime } from "./lib/get-parsed-time";
|
|
8
|
+
import { useTimePicker } from "./lib/use-time-picker";
|
|
9
|
+
const {
|
|
10
|
+
format = "24h",
|
|
11
|
+
pasteSplit = getParsedTime,
|
|
12
|
+
withSeconds = false,
|
|
13
|
+
placeholder = "--",
|
|
14
|
+
hoursInputLabel,
|
|
15
|
+
minutesInputLabel,
|
|
16
|
+
secondsInputLabel,
|
|
17
|
+
amPmLabels = { am: "AM", pm: "PM" },
|
|
18
|
+
amPmInputLabel: _,
|
|
19
|
+
step = 1,
|
|
20
|
+
name,
|
|
21
|
+
required,
|
|
22
|
+
clearable,
|
|
23
|
+
disabled,
|
|
24
|
+
readonly,
|
|
25
|
+
classes,
|
|
26
|
+
rightSectionPE = "all",
|
|
27
|
+
...props
|
|
28
|
+
} = defineProps({
|
|
29
|
+
clearable: { type: Boolean, required: false },
|
|
30
|
+
name: { type: String, required: false },
|
|
31
|
+
min: { type: String, required: false },
|
|
32
|
+
max: { type: String, required: false },
|
|
33
|
+
format: { type: String, required: false },
|
|
34
|
+
step: { type: [Number, Object], required: false },
|
|
35
|
+
placeholder: { type: [String, Object], required: false },
|
|
36
|
+
withSeconds: { type: Boolean, required: false },
|
|
37
|
+
hoursInputLabel: { type: String, required: false },
|
|
38
|
+
minutesInputLabel: { type: String, required: false },
|
|
39
|
+
secondsInputLabel: { type: String, required: false },
|
|
40
|
+
amPmInputLabel: { type: String, required: false },
|
|
41
|
+
amPmLabels: { type: Object, required: false },
|
|
42
|
+
pasteSplit: { type: Function, required: false },
|
|
43
|
+
classes: { type: Object, required: false },
|
|
44
|
+
error: { type: String, required: false },
|
|
45
|
+
description: { type: String, required: false },
|
|
46
|
+
label: { type: String, required: false },
|
|
47
|
+
required: { type: Boolean, required: false },
|
|
48
|
+
id: { type: [String, null], required: false },
|
|
49
|
+
radius: { type: String, required: false },
|
|
50
|
+
size: { type: String, required: false },
|
|
51
|
+
variant: { type: String, required: false },
|
|
52
|
+
multiline: { type: Boolean, required: false },
|
|
53
|
+
resize: { type: void 0, required: false },
|
|
54
|
+
leftSectionPE: { type: null, required: false },
|
|
55
|
+
rightSectionPE: { type: null, required: false },
|
|
56
|
+
readonly: { type: Boolean, required: false },
|
|
57
|
+
disabled: { type: Boolean, required: false }
|
|
58
|
+
});
|
|
59
|
+
const model = defineModel({ type: String, ...{ default: "" } });
|
|
60
|
+
const {
|
|
61
|
+
values: {
|
|
62
|
+
hours,
|
|
63
|
+
minutes,
|
|
64
|
+
seconds,
|
|
65
|
+
amPm
|
|
66
|
+
},
|
|
67
|
+
refs: { hoursRef, minutesRef, secondsRef },
|
|
68
|
+
clear,
|
|
69
|
+
focus
|
|
70
|
+
} = useTimePicker({
|
|
71
|
+
model,
|
|
72
|
+
amPmLabels,
|
|
73
|
+
format,
|
|
74
|
+
max: props.max,
|
|
75
|
+
min: props.min,
|
|
76
|
+
withSeconds,
|
|
77
|
+
pasteSplit
|
|
78
|
+
});
|
|
79
|
+
const isClearable = computed(() => clearable && !readonly && !disabled && (hours.value !== null || minutes.value !== null || seconds.value !== null || amPm.value !== null));
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<InputWrapper v-bind='props' :right-section-p-e :class='classes?.root'>
|
|
84
|
+
<InputBase
|
|
85
|
+
:classes='{
|
|
86
|
+
root: classes?.input,
|
|
87
|
+
section: classes?.section
|
|
88
|
+
}'
|
|
89
|
+
@click='focus("hours")'
|
|
90
|
+
>
|
|
91
|
+
<template #default='{ id, css }'>
|
|
92
|
+
<div :class='css'>
|
|
93
|
+
<div :class='$style.root' dir='ltr'>
|
|
94
|
+
<div :class='$style.group'>
|
|
95
|
+
<!-- Hours -->
|
|
96
|
+
<SpinInput
|
|
97
|
+
ref='hoursRef'
|
|
98
|
+
v-model='hours'
|
|
99
|
+
:min='0'
|
|
100
|
+
:max='23'
|
|
101
|
+
:step='typeof step === "object" ? step?.hours ?? 1 : step'
|
|
102
|
+
:placeholder='typeof placeholder === "object" ? placeholder?.hours : placeholder'
|
|
103
|
+
:class='classes?.field'
|
|
104
|
+
:aria-label='hoursInputLabel'
|
|
105
|
+
@next='focus("minutes")'
|
|
106
|
+
/>
|
|
107
|
+
<span>:</span>
|
|
108
|
+
<!-- Minutes -->
|
|
109
|
+
<SpinInput
|
|
110
|
+
ref='minutesRef'
|
|
111
|
+
v-model='minutes'
|
|
112
|
+
:min='0'
|
|
113
|
+
:max='59'
|
|
114
|
+
:step='typeof step === "object" ? step?.minutes ?? 1 : step'
|
|
115
|
+
:placeholder='typeof placeholder === "object" ? placeholder?.minutes : placeholder'
|
|
116
|
+
:class='classes?.field'
|
|
117
|
+
:aria-label='minutesInputLabel'
|
|
118
|
+
@next='focus("seconds")'
|
|
119
|
+
@prev='focus("hours")'
|
|
120
|
+
/>
|
|
121
|
+
<template v-if='withSeconds'>
|
|
122
|
+
<span>:</span>
|
|
123
|
+
<!-- Seconds -->
|
|
124
|
+
<SpinInput
|
|
125
|
+
v-if='withSeconds'
|
|
126
|
+
ref='secondsRef'
|
|
127
|
+
v-model='seconds'
|
|
128
|
+
:min='0'
|
|
129
|
+
:max='59'
|
|
130
|
+
:step='typeof step === "object" ? step?.seconds ?? 1 : step'
|
|
131
|
+
:placeholder='typeof placeholder === "object" ? placeholder?.seconds : placeholder'
|
|
132
|
+
:aria-label='secondsInputLabel'
|
|
133
|
+
:class='classes?.field'
|
|
134
|
+
@prev='focus("minutes")'
|
|
135
|
+
/>
|
|
136
|
+
</template>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<input
|
|
141
|
+
:id
|
|
142
|
+
v-model='model'
|
|
143
|
+
:name
|
|
144
|
+
type='hidden'
|
|
145
|
+
:required
|
|
146
|
+
:disabled
|
|
147
|
+
:readonly
|
|
148
|
+
>
|
|
149
|
+
</template>
|
|
150
|
+
|
|
151
|
+
<template #leftSection>
|
|
152
|
+
<slot name='leftSection'>
|
|
153
|
+
<Icon name='gravity-ui:clock' />
|
|
154
|
+
</slot>
|
|
155
|
+
</template>
|
|
156
|
+
|
|
157
|
+
<template
|
|
158
|
+
v-if='!$slots.rightSection && isClearable || !!$slots.rightSection'
|
|
159
|
+
#rightSection
|
|
160
|
+
>
|
|
161
|
+
<slot name='rightSection'>
|
|
162
|
+
<ActionIcon
|
|
163
|
+
icon='gravity-ui:xmark'
|
|
164
|
+
variant='subtle'
|
|
165
|
+
color='gray'
|
|
166
|
+
size='sm'
|
|
167
|
+
@click.stop='clear'
|
|
168
|
+
/>
|
|
169
|
+
</slot>
|
|
170
|
+
</template>
|
|
171
|
+
</InputBase>
|
|
172
|
+
|
|
173
|
+
<template v-if='$slots.label' #label>
|
|
174
|
+
<slot name='label' />
|
|
175
|
+
</template>
|
|
176
|
+
<template v-if='$slots.error' #error>
|
|
177
|
+
<slot name='error' />
|
|
178
|
+
</template>
|
|
179
|
+
<template v-if='$slots.description' #description>
|
|
180
|
+
<slot name='description' />
|
|
181
|
+
</template>
|
|
182
|
+
</InputWrapper>
|
|
183
|
+
</template>
|
|
184
|
+
|
|
185
|
+
<style lang="postcss" module>
|
|
186
|
+
.root {
|
|
187
|
+
overflow: hidden;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
|
|
191
|
+
height: 100%;
|
|
192
|
+
|
|
193
|
+
@mixin where-rtl {
|
|
194
|
+
flex-direction: row-reverse;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.group {
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
|
|
202
|
+
height: calc(var(--input-height) - rem(15px));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.controls {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: column;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.controlsGroup {
|
|
211
|
+
display: flex;
|
|
212
|
+
gap: .25rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.dropdown {
|
|
216
|
+
padding: .25rem;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.control {
|
|
220
|
+
width: max-content;
|
|
221
|
+
min-width: 2.5em;
|
|
222
|
+
height: 2em;
|
|
223
|
+
border-radius: var(--radius-default);
|
|
224
|
+
|
|
225
|
+
font-size: var(--control-font-size, var(--font-size-sm));
|
|
226
|
+
text-align: center;
|
|
227
|
+
|
|
228
|
+
&:where([data-active]) {
|
|
229
|
+
color: var(--color-white);
|
|
230
|
+
|
|
231
|
+
background-color: var(--color-primary-filled);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
@mixin hover {
|
|
235
|
+
&:where(:not([data-active])) {
|
|
236
|
+
color: var(--color-bright);
|
|
237
|
+
|
|
238
|
+
@mixin where-dark {
|
|
239
|
+
background-color: var(--color-dark-5);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@mixin where-light {
|
|
243
|
+
background-color: var(--color-gray-1);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.presetControl {
|
|
250
|
+
height: 2em;
|
|
251
|
+
padding-inline: 0.5em;
|
|
252
|
+
border-radius: var(--radius-default);
|
|
253
|
+
|
|
254
|
+
font-size: var(--control-font-size, var(--font-size-sm));
|
|
255
|
+
text-align: center;
|
|
256
|
+
|
|
257
|
+
&:where([data-active]) {
|
|
258
|
+
color: var(--color-white);
|
|
259
|
+
|
|
260
|
+
background-color: var(--color-primary-filled);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@mixin hover {
|
|
264
|
+
&:where(:not([data-active])) {
|
|
265
|
+
color: var(--color-bright);
|
|
266
|
+
|
|
267
|
+
@mixin where-dark {
|
|
268
|
+
background-color: var(--color-dark-5);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@mixin where-light {
|
|
272
|
+
background-color: var(--color-gray-1);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.presetsGroup {
|
|
279
|
+
&+& {
|
|
280
|
+
margin-top: var(--spacing-sm);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.presetsGroupLabel {
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
|
|
288
|
+
margin-bottom: .25rem;
|
|
289
|
+
padding-inline-start: 7px;
|
|
290
|
+
|
|
291
|
+
font-size: calc(var(--control-font-size, var(--font-size-sm)) - 2px);
|
|
292
|
+
font-weight: 500;
|
|
293
|
+
color: var(--color-dimmed);
|
|
294
|
+
|
|
295
|
+
&::after {
|
|
296
|
+
content: '';
|
|
297
|
+
|
|
298
|
+
flex: 1;
|
|
299
|
+
|
|
300
|
+
width: 100%;
|
|
301
|
+
height: 1px;
|
|
302
|
+
margin-inline-start: var(--spacing-xs);
|
|
303
|
+
|
|
304
|
+
@mixin where-light {
|
|
305
|
+
background-color: var(--color-gray-2);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
@mixin where-dark {
|
|
309
|
+
background-color: var(--color-dark-4);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Classes } from '@nui/types';
|
|
2
|
+
import type { InputBaseProps } from '../input/index.js';
|
|
3
|
+
import type { InputWrapperProps } from '../input/ui/input-wrapper.vue.js';
|
|
4
|
+
import type { TimePickerAmPmLabels, TimePickerFormat, TimePickerPasteSplit } from './model.js';
|
|
5
|
+
/**
|
|
6
|
+
* - presets
|
|
7
|
+
* - dropdown select
|
|
8
|
+
* - am/pm select
|
|
9
|
+
* - blur
|
|
10
|
+
* - paste
|
|
11
|
+
*/
|
|
12
|
+
interface FieldStep {
|
|
13
|
+
/** Number by which hours are incremented/decremented @default `1` */
|
|
14
|
+
hours?: number;
|
|
15
|
+
/** Number by which minutes are incremented/decremented @default `1` */
|
|
16
|
+
minutes?: number;
|
|
17
|
+
/** Number by which seconds are incremented/decremented @default `1` */
|
|
18
|
+
seconds?: number;
|
|
19
|
+
}
|
|
20
|
+
interface FieldPlaceholder {
|
|
21
|
+
/** Hours input placeholder, @default `--` */
|
|
22
|
+
hours?: string;
|
|
23
|
+
/** Minutes input placeholder, @default `--` */
|
|
24
|
+
minutes?: string;
|
|
25
|
+
/** Seconds input placeholder, @default `--` */
|
|
26
|
+
seconds?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TimePickerProps extends InputWrapperProps, InputBaseProps {
|
|
29
|
+
/** Determines whether the clear button should be displayed @default `false` */
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
/** `name` prop passed down to the hidden input */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Min possible time value in `hh:mm:ss` format @default `00:00:00` */
|
|
34
|
+
min?: string;
|
|
35
|
+
/** Max possible time value in `hh:mm:ss` format @default `23:59:59` */
|
|
36
|
+
max?: string;
|
|
37
|
+
/** Time format, @default `24h` */
|
|
38
|
+
format?: TimePickerFormat;
|
|
39
|
+
/** Number by which fields are incremented/decremented @default `1` */
|
|
40
|
+
step?: number | FieldStep;
|
|
41
|
+
/** Fields placeholder @default `--` */
|
|
42
|
+
placeholder?: string | FieldPlaceholder;
|
|
43
|
+
/** Determines whether the seconds input should be displayed @default `false` */
|
|
44
|
+
withSeconds?: boolean;
|
|
45
|
+
/** `aria-label` of hours input */
|
|
46
|
+
hoursInputLabel?: string;
|
|
47
|
+
/** `aria-label` of minutes input */
|
|
48
|
+
minutesInputLabel?: string;
|
|
49
|
+
/** `aria-label` of seconds input */
|
|
50
|
+
secondsInputLabel?: string;
|
|
51
|
+
/** `aria-label` of am/pm input @todo @deprecated */
|
|
52
|
+
amPmInputLabel?: string;
|
|
53
|
+
/** Labels used for am/pm values @default `{ am: 'AM', pm: 'PM' }` @todo @deprecated */
|
|
54
|
+
amPmLabels?: TimePickerAmPmLabels;
|
|
55
|
+
/** A function to transform pasted values, by default time in 24h format can be parsed on paste for example `23:34:22` */
|
|
56
|
+
pasteSplit?: TimePickerPasteSplit;
|
|
57
|
+
classes?: Classes<'root' | 'input' | 'section' | 'field'>;
|
|
58
|
+
}
|
|
59
|
+
type __VLS_Props = TimePickerProps;
|
|
60
|
+
type __VLS_ModelProps = {
|
|
61
|
+
modelValue?: string;
|
|
62
|
+
};
|
|
63
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
64
|
+
declare var __VLS_46: {}, __VLS_54: {}, __VLS_64: {}, __VLS_67: {}, __VLS_70: {};
|
|
65
|
+
type __VLS_Slots = {} & {
|
|
66
|
+
leftSection?: (props: typeof __VLS_46) => any;
|
|
67
|
+
} & {
|
|
68
|
+
rightSection?: (props: typeof __VLS_54) => any;
|
|
69
|
+
} & {
|
|
70
|
+
label?: (props: typeof __VLS_64) => any;
|
|
71
|
+
} & {
|
|
72
|
+
error?: (props: typeof __VLS_67) => any;
|
|
73
|
+
} & {
|
|
74
|
+
description?: (props: typeof __VLS_70) => any;
|
|
75
|
+
};
|
|
76
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
77
|
+
"update:modelValue": (value: string) => any;
|
|
78
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
79
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
80
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
81
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
82
|
+
declare const _default: typeof __VLS_export;
|
|
83
|
+
export default _default;
|
|
84
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
85
|
+
new (): {
|
|
86
|
+
$slots: S;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
@@ -3,9 +3,9 @@ export interface TitleProps extends Omit<TextProps, 'is'> {
|
|
|
3
3
|
order?: '1' | '2' | '3' | '4' | '5' | '6';
|
|
4
4
|
textWrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty' | 'stable';
|
|
5
5
|
}
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<TitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -18,7 +18,7 @@ const {
|
|
|
18
18
|
variant: { type: String, required: false },
|
|
19
19
|
fz: { type: null, required: false },
|
|
20
20
|
lh: { type: String, required: false },
|
|
21
|
-
fw: { type:
|
|
21
|
+
fw: { type: void 0, required: false },
|
|
22
22
|
c: { type: null, required: false },
|
|
23
23
|
mod: { type: [Object, Array, null], required: false }
|
|
24
24
|
});
|
|
@@ -3,9 +3,9 @@ export interface TitleProps extends Omit<TextProps, 'is'> {
|
|
|
3
3
|
order?: '1' | '2' | '3' | '4' | '5' | '6';
|
|
4
4
|
textWrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty' | 'stable';
|
|
5
5
|
}
|
|
6
|
-
declare var
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<TitleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TitleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -18,9 +18,9 @@ type __VLS_ModelProps = {
|
|
|
18
18
|
'expanded'?: TreeModels['expanded'];
|
|
19
19
|
};
|
|
20
20
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
-
declare var
|
|
21
|
+
declare var __VLS_18: {};
|
|
22
22
|
type __VLS_Slots = {} & {
|
|
23
|
-
default?: (props: typeof
|
|
23
|
+
default?: (props: typeof __VLS_18) => any;
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
26
|
delete: (path: string[]) => any;
|
|
@@ -18,9 +18,9 @@ type __VLS_ModelProps = {
|
|
|
18
18
|
'expanded'?: TreeModels['expanded'];
|
|
19
19
|
};
|
|
20
20
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
-
declare var
|
|
21
|
+
declare var __VLS_18: {};
|
|
22
22
|
type __VLS_Slots = {} & {
|
|
23
|
-
default?: (props: typeof
|
|
23
|
+
default?: (props: typeof __VLS_18) => any;
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
26
26
|
delete: (path: string[]) => any;
|
|
@@ -4,21 +4,25 @@ export interface VisuallyHiddenInputProps extends VisuallyHiddenProps {
|
|
|
4
4
|
required?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>,
|
|
8
|
-
props: __VLS_PrettifyLocal<(VisuallyHiddenInputProps & {
|
|
7
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(VisuallyHiddenInputProps & {
|
|
9
9
|
modelValue?: T;
|
|
10
10
|
}) & {
|
|
11
11
|
"onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
|
|
12
|
-
}> &
|
|
12
|
+
}> & (typeof globalThis extends {
|
|
13
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
14
|
+
} ? P : {});
|
|
13
15
|
expose: (exposed: {}) => void;
|
|
14
16
|
attrs: any;
|
|
15
17
|
slots: {};
|
|
16
|
-
emit: (
|
|
18
|
+
emit: (event: "update:modelValue", value: T | undefined) => void;
|
|
17
19
|
}>) => import("vue").VNode & {
|
|
18
20
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
21
|
};
|
|
20
22
|
declare const _default: typeof __VLS_export;
|
|
21
23
|
export default _default;
|
|
22
|
-
type __VLS_PrettifyLocal<T> = {
|
|
24
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
25
|
+
[K in keyof T]: T[K];
|
|
26
|
+
} : {
|
|
23
27
|
[K in keyof T as K]: T[K];
|
|
24
|
-
} & {};
|
|
28
|
+
}) & {};
|
|
@@ -4,21 +4,25 @@ export interface VisuallyHiddenInputProps extends VisuallyHiddenProps {
|
|
|
4
4
|
required?: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>,
|
|
8
|
-
props: __VLS_PrettifyLocal<(VisuallyHiddenInputProps & {
|
|
7
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
8
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(VisuallyHiddenInputProps & {
|
|
9
9
|
modelValue?: T;
|
|
10
10
|
}) & {
|
|
11
11
|
"onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
|
|
12
|
-
}> &
|
|
12
|
+
}> & (typeof globalThis extends {
|
|
13
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
14
|
+
} ? P : {});
|
|
13
15
|
expose: (exposed: {}) => void;
|
|
14
16
|
attrs: any;
|
|
15
17
|
slots: {};
|
|
16
|
-
emit: (
|
|
18
|
+
emit: (event: "update:modelValue", value: T | undefined) => void;
|
|
17
19
|
}>) => import("vue").VNode & {
|
|
18
20
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
19
21
|
};
|
|
20
22
|
declare const _default: typeof __VLS_export;
|
|
21
23
|
export default _default;
|
|
22
|
-
type __VLS_PrettifyLocal<T> = {
|
|
24
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
25
|
+
[K in keyof T]: T[K];
|
|
26
|
+
} : {
|
|
23
27
|
[K in keyof T as K]: T[K];
|
|
24
|
-
} & {};
|
|
28
|
+
}) & {};
|
|
@@ -2,9 +2,9 @@ import type { BoxProps } from '../box.vue.js';
|
|
|
2
2
|
export interface VisuallyHiddenProps extends BoxProps {
|
|
3
3
|
feature?: 'focusable' | 'fully-hidden';
|
|
4
4
|
}
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<VisuallyHiddenProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VisuallyHiddenProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,9 +2,9 @@ import type { BoxProps } from '../box.vue.js';
|
|
|
2
2
|
export interface VisuallyHiddenProps extends BoxProps {
|
|
3
3
|
feature?: 'focusable' | 'fully-hidden';
|
|
4
4
|
}
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_8: {};
|
|
6
6
|
type __VLS_Slots = {} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_8) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<VisuallyHiddenProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VisuallyHiddenProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -2,6 +2,13 @@ import type { FormatOptions } from '@formkit/tempo';
|
|
|
2
2
|
export type DateConfig = Omit<FormatOptions, 'date' | 'format'> & {
|
|
3
3
|
firstDayOfWeek: number;
|
|
4
4
|
};
|
|
5
|
+
declare const Inject: () => {
|
|
6
|
+
firstDayOfWeek: number;
|
|
7
|
+
locale?: string;
|
|
8
|
+
genitive?: boolean;
|
|
9
|
+
tz?: string;
|
|
10
|
+
partFilter?: (part: import("@formkit/tempo").Part) => boolean;
|
|
11
|
+
} | undefined;
|
|
5
12
|
/**
|
|
6
13
|
* Hook to provide the dates configuration in a root or parent component.
|
|
7
14
|
* Necessary for initializing the configuration that will be used by child components.
|
|
@@ -16,11 +23,14 @@ export declare const useProvideDatesConfig: (state?: Partial<DateConfig> | undef
|
|
|
16
23
|
/**
|
|
17
24
|
* Hook to inject the dates configuration in a component.
|
|
18
25
|
* Used in components that depend on the dates configuration.
|
|
26
|
+
*
|
|
27
|
+
* @param localValue merges new values with ctx with `defu`
|
|
19
28
|
*/
|
|
20
|
-
export declare
|
|
29
|
+
export declare function useDatesConfig(localValue?: ReturnType<typeof Inject>): {
|
|
21
30
|
firstDayOfWeek: number;
|
|
22
31
|
locale?: string;
|
|
23
32
|
genitive?: boolean;
|
|
24
33
|
tz?: string;
|
|
25
34
|
partFilter?: (part: import("@formkit/tempo").Part) => boolean;
|
|
26
35
|
};
|
|
36
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createInjectionState } from "@vueuse/core";
|
|
2
|
+
import defu from "defu";
|
|
2
3
|
const injectionKey = Symbol("dates-config");
|
|
3
4
|
function getFirstDayOfWeek(locale, forceDay) {
|
|
4
5
|
if (forceDay)
|
|
@@ -12,12 +13,14 @@ function getFirstDayOfWeek(locale, forceDay) {
|
|
|
12
13
|
return 1;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
const [Provide, Inject] =
|
|
16
|
+
const [Provide, Inject] = createInjectionState((state) => ({
|
|
16
17
|
...state,
|
|
17
18
|
firstDayOfWeek: getFirstDayOfWeek(state?.locale, state?.firstDayOfWeek)
|
|
18
19
|
}), {
|
|
19
|
-
injectionKey
|
|
20
|
-
name: "DatesConfig"
|
|
20
|
+
injectionKey
|
|
21
21
|
});
|
|
22
22
|
export const useProvideDatesConfig = Provide;
|
|
23
|
-
export
|
|
23
|
+
export function useDatesConfig(localValue) {
|
|
24
|
+
const injected = Inject();
|
|
25
|
+
return defu(localValue, injected);
|
|
26
|
+
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { DateInput } from '@formkit/tempo';
|
|
2
2
|
import type { DateConfig } from '@nui/composals';
|
|
3
|
-
|
|
4
|
-
date: DateInput;
|
|
5
|
-
fixedWeeks?: boolean;
|
|
6
|
-
config: DateConfig;
|
|
7
|
-
}
|
|
8
|
-
export declare function createMonth({ date, fixedWeeks, config }: CreateMonthProps): string[][];
|
|
9
|
-
export {};
|
|
3
|
+
export declare function createMonth(date: DateInput, config: DateConfig, fixedWeeks?: boolean): string[][];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addDay, monthEnd, monthStart, weekEnd, weekStart } from "@formkit/tempo";
|
|
2
2
|
import { chunk } from "@nui/utils";
|
|
3
3
|
import { getDaysBetween } from "./get-days-between.js";
|
|
4
|
-
export function createMonth(
|
|
4
|
+
export function createMonth(date, config, fixedWeeks) {
|
|
5
5
|
const startOfMonth = monthStart(date);
|
|
6
6
|
const endOfMonth = monthEnd(date);
|
|
7
7
|
const start = weekStart(startOfMonth, config.firstDayOfWeek);
|
|
@@ -3,7 +3,10 @@ export function getDaysBetween(start, end) {
|
|
|
3
3
|
const days = [];
|
|
4
4
|
let date = start;
|
|
5
5
|
while (isBefore(date, end)) {
|
|
6
|
-
|
|
6
|
+
const year = date.getFullYear();
|
|
7
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
8
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
9
|
+
days.push(`${year}-${month}-${day}`);
|
|
7
10
|
date = addDay(date, 1);
|
|
8
11
|
}
|
|
9
12
|
return days;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type * from './theme';
|
|
2
|
-
export type
|
|
2
|
+
export type Classes<Key extends string, Value = string | string[]> = Partial<Record<Key, Value>>;
|