nuance-ui 0.2.6 → 0.2.7
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/module.mjs +4 -5
- package/dist/runtime/components/action-icon/action-icon-group.d.vue.ts +4 -0
- package/dist/runtime/components/action-icon/action-icon-group.vue +3 -3
- package/dist/runtime/components/action-icon/action-icon-group.vue.d.ts +4 -0
- package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +9 -0
- package/dist/runtime/components/action-icon/action-icon-section.vue +4 -4
- package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +9 -0
- package/dist/runtime/components/action-icon/action-icon.d.vue.ts +14 -5
- package/dist/runtime/components/action-icon/action-icon.vue +24 -23
- package/dist/runtime/components/action-icon/action-icon.vue.d.ts +14 -5
- package/dist/runtime/components/alert.d.vue.ts +10 -14
- package/dist/runtime/components/alert.vue +129 -129
- package/dist/runtime/components/alert.vue.d.ts +10 -14
- package/dist/runtime/components/app-shell/app-shell-main.vue +18 -18
- package/dist/runtime/components/app-shell/app-shell-section.d.vue.ts +4 -1
- package/dist/runtime/components/app-shell/app-shell-section.vue.d.ts +4 -1
- package/dist/runtime/components/app-shell/app-shell.d.vue.ts +11 -3
- package/dist/runtime/components/app-shell/app-shell.vue +1 -1
- package/dist/runtime/components/app-shell/app-shell.vue.d.ts +11 -3
- package/dist/runtime/components/app-shell/context.d.ts +5 -0
- package/dist/runtime/components/avatar/avatar-group.d.vue.ts +1 -1
- package/dist/runtime/components/avatar/avatar-group.vue +4 -4
- package/dist/runtime/components/avatar/avatar-group.vue.d.ts +1 -1
- package/dist/runtime/components/avatar/avatar.d.vue.ts +13 -9
- package/dist/runtime/components/avatar/avatar.vue +4 -4
- package/dist/runtime/components/avatar/avatar.vue.d.ts +13 -9
- package/dist/runtime/components/avatar/index.d.ts +1 -0
- package/dist/runtime/components/avatar/index.js +1 -0
- package/dist/runtime/components/background-image.d.vue.ts +2 -1
- package/dist/runtime/components/background-image.vue +18 -18
- package/dist/runtime/components/background-image.vue.d.ts +2 -1
- package/dist/runtime/components/badge.d.vue.ts +21 -8
- package/dist/runtime/components/badge.vue +161 -162
- package/dist/runtime/components/badge.vue.d.ts +21 -8
- package/dist/runtime/components/box.d.vue.ts +5 -1
- package/dist/runtime/components/box.vue.d.ts +5 -1
- package/dist/runtime/components/breadcrumbs.d.vue.ts +23 -3
- package/dist/runtime/components/breadcrumbs.vue +2 -2
- package/dist/runtime/components/breadcrumbs.vue.d.ts +23 -3
- package/dist/runtime/components/button/button-group.d.vue.ts +4 -0
- package/dist/runtime/components/button/button-group.vue +3 -3
- package/dist/runtime/components/button/button-group.vue.d.ts +4 -0
- package/dist/runtime/components/button/button.d.vue.ts +22 -9
- package/dist/runtime/components/button/button.module.css +1 -1
- package/dist/runtime/components/button/button.vue +39 -38
- package/dist/runtime/components/button/button.vue.d.ts +22 -9
- package/dist/runtime/components/calendar/calendar.d.vue.ts +1 -1
- package/dist/runtime/components/calendar/calendar.vue +60 -60
- package/dist/runtime/components/calendar/calendar.vue.d.ts +1 -1
- package/dist/runtime/components/calendar/index.d.ts +1 -1
- package/dist/runtime/components/calendar/index.js +1 -1
- package/dist/runtime/components/calendar/lib/context.d.ts +2 -2
- package/dist/runtime/components/calendar/lib/context.js +1 -1
- package/dist/runtime/components/calendar/lib/use-calendar-navigation.d.ts +2 -2
- package/dist/runtime/components/calendar/lib/use-calendar-navigation.js +1 -1
- package/dist/runtime/components/calendar/lib/use-calendar-selection.d.ts +3 -3
- package/dist/runtime/components/calendar/lib/use-calendar-selection.js +2 -2
- package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +1 -0
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +115 -115
- package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +1 -0
- package/dist/runtime/components/calendar/ui/core/calendar-root.d.vue.ts +3 -3
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue +1 -1
- package/dist/runtime/components/calendar/ui/core/calendar-root.vue.d.ts +3 -3
- package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +78 -78
- package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +1 -1
- package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +3 -0
- package/dist/runtime/components/checkbox/checkbox-card.vue +63 -48
- package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +3 -0
- package/dist/runtime/components/checkbox/checkbox-group.d.vue.ts +12 -1
- package/dist/runtime/components/checkbox/checkbox-group.vue +29 -19
- package/dist/runtime/components/checkbox/checkbox-group.vue.d.ts +12 -1
- package/dist/runtime/components/checkbox/checkbox-indicator.vue +7 -6
- package/dist/runtime/components/checkbox/checkbox.d.vue.ts +6 -2
- package/dist/runtime/components/checkbox/checkbox.vue +166 -149
- package/dist/runtime/components/checkbox/checkbox.vue.d.ts +6 -2
- package/dist/runtime/components/checkbox/lib/group.context.d.ts +15 -3
- package/dist/runtime/components/checkbox/lib/group.context.js +9 -7
- package/dist/runtime/components/chip/chip.d.vue.ts +1 -0
- package/dist/runtime/components/chip/chip.vue +201 -201
- package/dist/runtime/components/chip/chip.vue.d.ts +1 -0
- package/dist/runtime/components/chip/lib.js +1 -1
- package/dist/runtime/components/combobox/combobox-dropdown.vue +14 -14
- package/dist/runtime/components/combobox/combobox-group.d.vue.ts +2 -2
- package/dist/runtime/components/combobox/combobox-group.vue +21 -21
- package/dist/runtime/components/combobox/combobox-group.vue.d.ts +2 -2
- package/dist/runtime/components/combobox/combobox-option.d.vue.ts +1 -1
- package/dist/runtime/components/combobox/combobox-option.vue +22 -22
- package/dist/runtime/components/combobox/combobox-option.vue.d.ts +1 -1
- package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +1 -1
- package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +1 -1
- package/dist/runtime/components/combobox/combobox-root.d.vue.ts +6 -6
- package/dist/runtime/components/combobox/combobox-root.vue.d.ts +6 -6
- package/dist/runtime/components/combobox/lib/context.d.ts +2 -2
- package/dist/runtime/components/combobox/lib/context.js +1 -1
- package/dist/runtime/components/combobox/lib/use-combobox/index.d.ts +70 -1
- package/dist/runtime/components/combobox/lib/use-combobox/index.js +104 -1
- package/dist/runtime/components/combobox/lib/use-combobox-data/get-parsed-combobox-data.d.ts +1 -1
- package/dist/runtime/components/combobox/lib/use-combobox-data/index.d.ts +7 -1
- package/dist/runtime/components/combobox/lib/use-combobox-data/index.js +24 -1
- package/dist/runtime/components/combobox/lib/utils/default-option-filter.d.ts +1 -1
- package/dist/runtime/components/combobox/lib/utils/is-empty-combobox-data.d.ts +1 -1
- package/dist/runtime/components/combobox/lib/utils/is-guards.d.ts +1 -1
- package/dist/runtime/components/combobox/types.d.ts +34 -0
- package/dist/runtime/components/date-time-picker.d.vue.ts +3 -0
- package/dist/runtime/components/date-time-picker.vue +1 -1
- package/dist/runtime/components/date-time-picker.vue.d.ts +3 -0
- package/dist/runtime/components/dialog/index.d.ts +1 -1
- package/dist/runtime/components/dialog/lib.js +1 -1
- package/dist/runtime/components/dialog/ui/dialog-root.d.vue.ts +3 -2
- package/dist/runtime/components/dialog/ui/dialog-root.vue +21 -21
- package/dist/runtime/components/dialog/ui/dialog-root.vue.d.ts +3 -2
- package/dist/runtime/components/files/file-upload-button.vue +12 -12
- package/dist/runtime/components/files/file-upload-icon.vue +1 -1
- package/dist/runtime/components/index.d.ts +12 -11
- package/dist/runtime/components/index.js +1 -10
- package/dist/runtime/components/input/date-picker.vue +1 -1
- package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +2 -1
- package/dist/runtime/components/input/number-input.d.vue.ts +1 -1
- package/dist/runtime/components/input/number-input.vue.d.ts +1 -1
- package/dist/runtime/components/input/text-input.d.vue.ts +2 -1
- package/dist/runtime/components/input/text-input.vue +33 -33
- package/dist/runtime/components/input/text-input.vue.d.ts +2 -1
- package/dist/runtime/components/input/ui/button-input.d.vue.ts +7 -2
- package/dist/runtime/components/input/ui/button-input.vue +64 -64
- package/dist/runtime/components/input/ui/button-input.vue.d.ts +7 -2
- package/dist/runtime/components/input/ui/input-base.d.vue.ts +1 -0
- package/dist/runtime/components/input/ui/input-base.vue +283 -283
- package/dist/runtime/components/input/ui/input-base.vue.d.ts +1 -0
- package/dist/runtime/components/input/ui/input-inline.d.vue.ts +12 -5
- package/dist/runtime/components/input/ui/input-inline.vue +111 -107
- package/dist/runtime/components/input/ui/input-inline.vue.d.ts +12 -5
- package/dist/runtime/components/input/ui/input-label.d.vue.ts +2 -0
- package/dist/runtime/components/input/ui/input-label.vue +4 -4
- package/dist/runtime/components/input/ui/input-label.vue.d.ts +2 -0
- package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +1 -0
- package/dist/runtime/components/input/ui/input-wrapper.vue +54 -54
- package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +1 -0
- package/dist/runtime/components/input/ui/spin-input.vue +69 -69
- package/dist/runtime/components/link/link.d.vue.ts +1 -0
- package/dist/runtime/components/link/link.vue.d.ts +1 -0
- package/dist/runtime/components/loader/loader.d.vue.ts +6 -0
- package/dist/runtime/components/loader/loader.vue +2 -2
- package/dist/runtime/components/loader/loader.vue.d.ts +6 -0
- package/dist/runtime/components/nav-link/nav-icon-link.d.vue.ts +11 -4
- package/dist/runtime/components/nav-link/nav-icon-link.vue.d.ts +11 -4
- package/dist/runtime/components/nav-link/nav-link.d.vue.ts +10 -6
- package/dist/runtime/components/nav-link/nav-link.vue +1 -1
- package/dist/runtime/components/nav-link/nav-link.vue.d.ts +10 -6
- package/dist/runtime/components/paper.d.vue.ts +1 -0
- package/dist/runtime/components/paper.vue +33 -33
- package/dist/runtime/components/paper.vue.d.ts +1 -0
- package/dist/runtime/components/popover/lib/context.js +1 -1
- package/dist/runtime/components/popover/lib/get-arrow-position.d.ts +1 -1
- package/dist/runtime/components/popover/lib/use-popover.d.ts +1 -1
- package/dist/runtime/components/popover/popover.d.vue.ts +1 -1
- package/dist/runtime/components/popover/popover.vue.d.ts +1 -1
- package/dist/runtime/components/popover/{types/index.d.ts → types.d.ts} +7 -6
- package/dist/runtime/components/progress/progress-root.d.vue.ts +4 -4
- package/dist/runtime/components/progress/progress-root.vue.d.ts +4 -4
- package/dist/runtime/components/progress/progress-section.vue +1 -1
- package/dist/runtime/components/roving-focus/index.d.ts +1 -1
- package/dist/runtime/components/roving-focus/index.js +1 -1
- package/dist/runtime/components/roving-focus/roving-focus-item.vue +1 -1
- package/dist/runtime/components/roving-focus/roving-focus.vue +4 -4
- package/dist/runtime/components/{select/select.d.vue.ts → select.d.vue.ts} +6 -6
- package/dist/runtime/components/{select/select.vue → select.vue} +6 -6
- package/dist/runtime/components/{select/select.vue.d.ts → select.vue.d.ts} +6 -6
- package/dist/runtime/components/switch/index.d.ts +3 -0
- package/dist/runtime/components/switch/index.js +1 -0
- package/dist/runtime/components/switch/lib/group.context.d.ts +34 -0
- package/dist/runtime/components/switch/lib/group.context.js +25 -0
- package/dist/runtime/components/switch/switch-group.d.vue.ts +42 -0
- package/dist/runtime/components/switch/switch-group.vue +50 -0
- package/dist/runtime/components/switch/switch-group.vue.d.ts +42 -0
- package/dist/runtime/components/switch/switch.d.vue.ts +50 -0
- package/dist/runtime/components/switch/switch.vue +328 -0
- package/dist/runtime/components/switch/switch.vue.d.ts +50 -0
- package/dist/runtime/components/table/index.d.ts +1 -1
- package/dist/runtime/components/table/index.js +1 -1
- package/dist/runtime/components/table/lib.d.ts +1 -1
- package/dist/runtime/components/table/{model.d.ts → types.d.ts} +3 -15
- package/dist/runtime/components/table/ui/table-sort-icon.d.vue.ts +1 -1
- package/dist/runtime/components/table/ui/table-sort-icon.vue +1 -1
- package/dist/runtime/components/table/ui/table-sort-icon.vue.d.ts +1 -1
- package/dist/runtime/components/table/ui/table-sortable-header.d.vue.ts +1 -1
- package/dist/runtime/components/table/ui/table-sortable-header.vue.d.ts +1 -1
- package/dist/runtime/components/table/ui/table.d.vue.ts +1 -1
- package/dist/runtime/components/table/ui/table.vue +296 -296
- package/dist/runtime/components/table/ui/table.vue.d.ts +1 -1
- package/dist/runtime/components/tabs/index.d.ts +4 -0
- package/dist/runtime/components/tabs/lib.d.ts +1 -0
- package/dist/runtime/components/tabs/lib.js +9 -1
- package/dist/runtime/components/tabs/tabs-root.vue +4 -3
- package/dist/runtime/components/text.vue +1 -1
- package/dist/runtime/components/time-picker/index.d.ts +1 -1
- package/dist/runtime/components/time-picker/index.js +1 -1
- package/dist/runtime/components/time-picker/lib/get-parsed-time.d.ts +1 -1
- package/dist/runtime/components/time-picker/lib/get-time-string.d.ts +1 -1
- package/dist/runtime/components/time-picker/lib/use-time-picker.d.ts +1 -1
- package/dist/runtime/components/time-picker/time-picker.d.vue.ts +8 -7
- package/dist/runtime/components/time-picker/time-picker.vue +230 -230
- package/dist/runtime/components/time-picker/time-picker.vue.d.ts +8 -7
- package/dist/runtime/components/time-picker/{model.d.ts → types.d.ts} +13 -0
- package/dist/runtime/components/tree/_ui/tree-item.d.vue.ts +1 -1
- package/dist/runtime/components/tree/_ui/tree-item.vue +2 -2
- package/dist/runtime/components/tree/_ui/tree-item.vue.d.ts +1 -1
- package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +1 -1
- package/dist/runtime/components/tree/_ui/tree-root.vue +1 -1
- package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +1 -1
- package/dist/runtime/components/tree/index.d.ts +1 -1
- package/dist/runtime/components/tree/index.js +1 -1
- package/dist/runtime/components/tree/lib/context.d.ts +1 -1
- package/dist/runtime/components/tree/lib/context.js +1 -1
- package/dist/runtime/components/tree/lib/filter-tree-items.d.ts +1 -1
- package/dist/runtime/components/tree/tree.d.vue.ts +1 -1
- package/dist/runtime/components/tree/tree.vue +20 -20
- package/dist/runtime/components/tree/tree.vue.d.ts +1 -1
- package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +2 -1
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue +2 -2
- package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +2 -1
- package/dist/runtime/composables/create-strict-injection.d.ts +42 -0
- package/dist/runtime/{composals → composables}/index.d.ts +2 -0
- package/dist/runtime/{composals → composables}/index.js +2 -0
- package/dist/runtime/composables/use-active-link.d.ts +15 -0
- package/dist/runtime/{composals → composables}/use-date-config.d.ts +10 -5
- package/dist/runtime/composables/use-selectable-group.d.ts +23 -0
- package/dist/runtime/composables/use-selectable-group.js +20 -0
- package/dist/runtime/{composals → composables}/use-style-resolver.d.ts +3 -0
- package/dist/runtime/composables/use-theme.d.ts +16 -0
- package/dist/runtime/modals/_confirm-modal/confirm-modal.d.vue.ts +1 -1
- package/dist/runtime/modals/_confirm-modal/confirm-modal.vue +31 -31
- package/dist/runtime/modals/_confirm-modal/confirm-modal.vue.d.ts +1 -1
- package/dist/runtime/modals/modal-manager.d.ts +28 -45
- package/dist/runtime/modals/modal-manager.js +8 -28
- package/dist/runtime/modals/modals-provider.d.vue.ts +1 -7
- package/dist/runtime/modals/modals-provider.vue +10 -16
- package/dist/runtime/modals/modals-provider.vue.d.ts +1 -7
- package/dist/runtime/modals/use-modal.d.ts +5 -14
- package/dist/runtime/modals/use-modal.js +3 -6
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/theme.d.ts +9 -0
- package/dist/runtime/utils/boolean/index.d.ts +2 -0
- package/dist/runtime/utils/boolean/index.js +2 -0
- package/dist/runtime/utils/boolean/is-falsy.d.ts +6 -0
- package/dist/runtime/utils/boolean/is-number-like.d.ts +8 -0
- package/dist/runtime/{const/index.d.ts → utils/color/const.d.ts} +1 -0
- package/dist/runtime/utils/{color-functions → color}/get-color-var.d.ts +3 -0
- package/dist/runtime/utils/color/get-gradient.d.ts +15 -0
- package/dist/runtime/utils/{color-functions → color}/get-gradient.js +1 -1
- package/dist/runtime/utils/color/index.d.ts +4 -0
- package/dist/runtime/utils/color/index.js +4 -0
- package/dist/runtime/utils/color/parse-theme-color.d.ts +36 -0
- package/dist/runtime/utils/css/get-mod.d.ts +9 -0
- package/dist/runtime/utils/{get-mod.js → css/get-mod.js} +1 -1
- package/dist/runtime/utils/css/get-size.d.ts +27 -0
- package/dist/runtime/utils/{get-size.js → css/get-size.js} +2 -2
- package/dist/runtime/utils/css/index.d.ts +3 -0
- package/dist/runtime/utils/css/index.js +3 -0
- package/dist/runtime/utils/css/rem.d.ts +10 -0
- package/dist/runtime/utils/date/create-months.d.ts +12 -0
- package/dist/runtime/utils/date/get-days-between.d.ts +5 -0
- package/dist/runtime/{helpers → utils}/date/is-weekend.d.ts +3 -0
- package/dist/runtime/utils/date/types.d.ts +10 -0
- package/dist/runtime/utils/index.d.ts +5 -7
- package/dist/runtime/utils/index.js +5 -7
- package/dist/runtime/utils/{create-variant-color-resolver.d.ts → style/create-variant-color-resolver.d.ts} +12 -0
- package/dist/runtime/utils/{create-variant-color-resolver.js → style/create-variant-color-resolver.js} +3 -3
- package/dist/runtime/utils/style/index.d.ts +1 -0
- package/dist/runtime/utils/style/index.js +1 -0
- package/dist/runtime/utils/tree.d.ts +20 -84
- package/package.json +6 -10
- package/dist/runtime/components/combobox/lib/use-combobox/use-combobox.d.ts +0 -70
- package/dist/runtime/components/combobox/lib/use-combobox/use-combobox.js +0 -104
- package/dist/runtime/components/combobox/lib/use-combobox-data/use-combobox-data.d.ts +0 -7
- package/dist/runtime/components/combobox/lib/use-combobox-data/use-combobox-data.js +0 -24
- package/dist/runtime/components/combobox/types/index.d.ts +0 -19
- package/dist/runtime/components/combobox/types/index.js +0 -1
- package/dist/runtime/components/combobox/types/item.d.ts +0 -17
- package/dist/runtime/components/select/index.d.ts +0 -1
- package/dist/runtime/components/transition/index.d.ts +0 -1
- package/dist/runtime/components/transition/index.js +0 -0
- package/dist/runtime/components/tree/model.js +0 -0
- package/dist/runtime/composals/use-active-link.d.ts +0 -5
- package/dist/runtime/composals/use-theme.d.ts +0 -9
- package/dist/runtime/helpers/create-strict-injection.d.ts +0 -94
- package/dist/runtime/helpers/date/create-months.d.ts +0 -3
- package/dist/runtime/helpers/date/get-days-between.d.ts +0 -1
- package/dist/runtime/helpers/date/types.d.ts +0 -19
- package/dist/runtime/helpers/index.d.ts +0 -1
- package/dist/runtime/helpers/index.js +0 -1
- package/dist/runtime/utils/color-functions/get-gradient.d.ts +0 -3
- package/dist/runtime/utils/color-functions/parse-theme-color.d.ts +0 -14
- package/dist/runtime/utils/converters/rem.d.ts +0 -2
- package/dist/runtime/utils/get-mod.d.ts +0 -2
- package/dist/runtime/utils/get-size.d.ts +0 -6
- /package/dist/runtime/components/avatar/{_lib → lib}/context.d.ts +0 -0
- /package/dist/runtime/components/avatar/{_lib → lib}/context.js +0 -0
- /package/dist/runtime/components/avatar/{_lib → lib}/get-initials-color.d.ts +0 -0
- /package/dist/runtime/components/avatar/{_lib → lib}/get-initials-color.js +0 -0
- /package/dist/runtime/components/avatar/{_lib → lib}/get-initials.d.ts +0 -0
- /package/dist/runtime/components/avatar/{_lib → lib}/get-initials.js +0 -0
- /package/dist/runtime/components/calendar/{model.d.ts → types.d.ts} +0 -0
- /package/dist/runtime/{helpers/date → components/calendar}/types.js +0 -0
- /package/dist/runtime/components/{calendar/model.js → combobox/types.js} +0 -0
- /package/dist/runtime/components/dialog/{model.d.ts → types.d.ts} +0 -0
- /package/dist/runtime/components/{combobox/types/item.js → dialog/types.js} +0 -0
- /package/dist/runtime/components/input/{types/index.d.ts → types.d.ts} +0 -0
- /package/dist/runtime/components/{dialog/model.js → input/types.js} +0 -0
- /package/dist/runtime/components/{input/types/index.js → popover/types.js} +0 -0
- /package/dist/runtime/components/roving-focus/{_lib → lib}/context.d.ts +0 -0
- /package/dist/runtime/components/roving-focus/{_lib → lib}/context.js +0 -0
- /package/dist/runtime/components/{popover/types/index.js → table/types.js} +0 -0
- /package/dist/runtime/components/{select/index.js → time-picker/types.js} +0 -0
- /package/dist/runtime/components/{transition/transition.d.vue.ts → transition.d.vue.ts} +0 -0
- /package/dist/runtime/components/{transition/transition.vue → transition.vue} +0 -0
- /package/dist/runtime/components/{transition/transition.vue.d.ts → transition.vue.d.ts} +0 -0
- /package/dist/runtime/components/tree/{model.d.ts → types.d.ts} +0 -0
- /package/dist/runtime/components/{table/model.js → tree/types.js} +0 -0
- /package/dist/runtime/{helpers → composables}/create-strict-injection.js +0 -0
- /package/dist/runtime/{composals → composables}/use-active-link.js +0 -0
- /package/dist/runtime/{composals → composables}/use-date-config.js +0 -0
- /package/dist/runtime/{composals → composables}/use-style-resolver.js +0 -0
- /package/dist/runtime/{composals → composables}/use-theme.js +0 -0
- /package/dist/runtime/{const/index.js → utils/color/const.js} +0 -0
- /package/dist/runtime/utils/{color-functions → color}/get-color-var.js +0 -0
- /package/dist/runtime/utils/{color-functions → color}/parse-theme-color.js +0 -0
- /package/dist/runtime/utils/{converters → css}/rem.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/create-months.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/get-days-between.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/get-week-number.d.ts +0 -0
- /package/dist/runtime/{helpers → utils}/date/get-week-number.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/index.d.ts +0 -0
- /package/dist/runtime/{helpers → utils}/date/index.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/is-same-month.d.ts +0 -0
- /package/dist/runtime/{helpers → utils}/date/is-same-month.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/is-same-week.d.ts +0 -0
- /package/dist/runtime/{helpers → utils}/date/is-same-week.js +0 -0
- /package/dist/runtime/{helpers → utils}/date/is-weekend.js +0 -0
- /package/dist/runtime/{components/time-picker/model.js → utils/date/types.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from '@nui/components';
|
|
2
2
|
import type { RovingFocusProps } from '../../roving-focus/roving-focus.vue.js';
|
|
3
|
-
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../
|
|
3
|
+
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../types.js';
|
|
4
4
|
export type TreeRootProps = RovingFocusProps & {
|
|
5
5
|
iconResolver?: TreeIconResolver;
|
|
6
6
|
removable?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from '@nui/components';
|
|
2
2
|
import type { RovingFocusProps } from '../../roving-focus/roving-focus.vue.js';
|
|
3
|
-
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../
|
|
3
|
+
import type { TreeFilter, TreeIconResolver, TreeLoader, TreeModels } from '../types.js';
|
|
4
4
|
export type TreeRootProps = RovingFocusProps & {
|
|
5
5
|
iconResolver?: TreeIconResolver;
|
|
6
6
|
removable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./types.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from '@nui/components';
|
|
2
2
|
import type { ModelRef, ShallowRef } from 'vue';
|
|
3
|
-
import type { TreeFilter, TreeIconResolver, TreeLoader } from '../
|
|
3
|
+
import type { TreeFilter, TreeIconResolver, TreeLoader } from '../types.js';
|
|
4
4
|
type EventType = 'select' | 'expand';
|
|
5
5
|
type SelectMode = 'single' | 'multiple' | 'range';
|
|
6
6
|
export interface TreeContext {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TreeFilter, TreeItem } from '../
|
|
1
|
+
import type { TreeFilter, TreeItem } from '../types.js';
|
|
2
2
|
export declare function filterTreeItems(items: TreeItem[] | undefined, filter?: TreeFilter): TreeItem[] | undefined;
|
|
@@ -33,24 +33,24 @@ onMounted(execute);
|
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
36
|
-
<TreeRoot
|
|
37
|
-
v-bind='props'
|
|
38
|
-
v-model:active='active'
|
|
39
|
-
v-model:selected='selected'
|
|
40
|
-
v-model:expanded='expanded'
|
|
41
|
-
:load-branch
|
|
42
|
-
:size
|
|
43
|
-
:color
|
|
44
|
-
:variant
|
|
45
|
-
:filter
|
|
46
|
-
@delete='(path) => $emit("delete", path)'
|
|
47
|
-
>
|
|
48
|
-
<UTreeItem
|
|
49
|
-
v-for='item in root'
|
|
50
|
-
:key='item.path'
|
|
51
|
-
v-bind='item'
|
|
52
|
-
:path='item.path'
|
|
53
|
-
:level='1'
|
|
54
|
-
/>
|
|
55
|
-
</TreeRoot>
|
|
36
|
+
<TreeRoot
|
|
37
|
+
v-bind='props'
|
|
38
|
+
v-model:active='active'
|
|
39
|
+
v-model:selected='selected'
|
|
40
|
+
v-model:expanded='expanded'
|
|
41
|
+
:load-branch
|
|
42
|
+
:size
|
|
43
|
+
:color
|
|
44
|
+
:variant
|
|
45
|
+
:filter
|
|
46
|
+
@delete='(path) => $emit("delete", path)'
|
|
47
|
+
>
|
|
48
|
+
<UTreeItem
|
|
49
|
+
v-for='item in root'
|
|
50
|
+
:key='item.path'
|
|
51
|
+
v-bind='item'
|
|
52
|
+
:path='item.path'
|
|
53
|
+
:level='1'
|
|
54
|
+
/>
|
|
55
|
+
</TreeRoot>
|
|
56
56
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import VisuallyHidden from "./visually-hidden.vue";
|
|
3
3
|
const props = defineProps({
|
|
4
|
-
name: { type: String, required:
|
|
4
|
+
name: { type: String, required: false },
|
|
5
5
|
required: { type: Boolean, required: false },
|
|
6
6
|
disabled: { type: Boolean, required: false },
|
|
7
7
|
feature: { type: String, required: false },
|
|
@@ -12,5 +12,5 @@ const value = defineModel({ type: null });
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<VisuallyHidden v-bind='{ ...props, ...$attrs }' is='input' v-model='value' />
|
|
15
|
+
<VisuallyHidden v-bind='{ ...props, ...$attrs }' is='input' v-model='value' />
|
|
16
16
|
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { InjectionKey } from '@vue/runtime-core';
|
|
2
|
+
import type { CreateInjectionStateOptions } from '@vueuse/core';
|
|
3
|
+
interface StrictInjectionOptions<Return> extends Omit<CreateInjectionStateOptions<Return>, 'injectionKey'> {
|
|
4
|
+
/** Human-readable context name embedded into the missing-provider error message. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Vue injection key used to store and read the provided state. */
|
|
7
|
+
injectionKey: InjectionKey<Return>;
|
|
8
|
+
}
|
|
9
|
+
type StrictInjectionReturn<Arguments extends Array<any>, Return> = Readonly<[
|
|
10
|
+
/**
|
|
11
|
+
* Provider function to be called in a parent component.
|
|
12
|
+
* Creates and provides the state to all descendant components.
|
|
13
|
+
*/
|
|
14
|
+
useProvidingState: (...args: Arguments) => Return,
|
|
15
|
+
/**
|
|
16
|
+
* Consumer function to be called in a child component.
|
|
17
|
+
* Injects the state provided by the nearest parent provider.
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} When called outside of a provider context
|
|
20
|
+
*/
|
|
21
|
+
useInjectedState: () => Return
|
|
22
|
+
]>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a strict provide/inject.
|
|
25
|
+
*
|
|
26
|
+
* Unlike Vue's standard `inject`, the returned consumer hook throws a
|
|
27
|
+
* descriptive error when called outside of a provider, so misuse surfaces
|
|
28
|
+
* immediately instead of producing silent `undefined` values downstream.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const [useProvideComboboxState, useComboboxState] = createStrictInjection(
|
|
33
|
+
* (state: ComboboxState) => ({
|
|
34
|
+
* ...state,
|
|
35
|
+
* select: (item: string) => { state.selected.value = item },
|
|
36
|
+
* }),
|
|
37
|
+
* { name: 'ComboboxState', injectionKey: Symbol('combobox-state') },
|
|
38
|
+
* )
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function createStrictInjection<Arguments extends Array<any>, Return>(composable: (...args: Arguments) => Return, options: StrictInjectionOptions<Return>): StrictInjectionReturn<Arguments, Return>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { RouteLocationRaw } from 'vue-router';
|
|
3
|
+
/**
|
|
4
|
+
* Computes whether a given route target matches the current route.
|
|
5
|
+
*
|
|
6
|
+
* By default the link is active when its resolved path equals the current
|
|
7
|
+
* path or is a prefix of it, so parent routes stay highlighted while
|
|
8
|
+
* browsing nested children.
|
|
9
|
+
*
|
|
10
|
+
* Pass `exact: true` to disable prefix matching.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useActiveLink(href: RouteLocationRaw | undefined, options?: {
|
|
13
|
+
/** Require a strict path equality instead of prefix matching. */
|
|
14
|
+
exact?: boolean;
|
|
15
|
+
}): ComputedRef<boolean>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FormatOptions } from '@formkit/tempo';
|
|
2
|
+
/** Locale configuration for date-aware features. */
|
|
2
3
|
export type DateConfig = Omit<FormatOptions, 'date' | 'format'> & {
|
|
4
|
+
/** Index of the first day of the week (0 = Sunday, 1 = Monday, ...). */
|
|
3
5
|
firstDayOfWeek: number;
|
|
4
6
|
};
|
|
5
7
|
declare const Inject: () => {
|
|
@@ -10,8 +12,11 @@ declare const Inject: () => {
|
|
|
10
12
|
partFilter?: (part: import("@formkit/tempo").Part) => boolean;
|
|
11
13
|
} | undefined;
|
|
12
14
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* Provides the shared date configuration to the component subtree.
|
|
16
|
+
*
|
|
17
|
+
* Call once in a root or layout component.
|
|
18
|
+
*
|
|
19
|
+
* When `firstDayOfWeek` is omitted, it is resolved from the locale.
|
|
15
20
|
*/
|
|
16
21
|
export declare const useProvideDatesConfig: (state?: Partial<DateConfig> | undefined) => {
|
|
17
22
|
firstDayOfWeek: number;
|
|
@@ -21,10 +26,10 @@ export declare const useProvideDatesConfig: (state?: Partial<DateConfig> | undef
|
|
|
21
26
|
partFilter?: (part: import("@formkit/tempo").Part) => boolean;
|
|
22
27
|
};
|
|
23
28
|
/**
|
|
24
|
-
*
|
|
25
|
-
* Used in components that depend on the dates configuration.
|
|
29
|
+
* Reads the shared date configuration provided by `useProvideDatesConfig`.
|
|
26
30
|
*
|
|
27
|
-
*
|
|
31
|
+
* A local override can be passed in and will be shallow-merged on top of the
|
|
32
|
+
* injected config.
|
|
28
33
|
*/
|
|
29
34
|
export declare function useDatesConfig(localValue?: ReturnType<typeof Inject>): {
|
|
30
35
|
firstDayOfWeek: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ModelRef } from 'vue';
|
|
2
|
+
export interface UseSelectableGroupOptions {
|
|
3
|
+
/** When `true`, the value cannot be changed. */
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
/** When `true`, all items in the group are disabled. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Maximum number of items that can be selected. When reached, unselected items become disabled. */
|
|
8
|
+
maxSelectedValues?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface UseSelectableGroupReturn<T> {
|
|
11
|
+
/** Toggles the given value in the selection array. */
|
|
12
|
+
update: (value: T) => void;
|
|
13
|
+
/** Returns `true` when the value is currently selected. */
|
|
14
|
+
isSelected: (value: T) => boolean;
|
|
15
|
+
/** Returns `true` when an item with the given value should be disabled. */
|
|
16
|
+
isDisabled: (value: T) => boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Shared selection logic for multi-select group components.
|
|
20
|
+
*
|
|
21
|
+
* Centralizes the add/remove, max-limit and read-only rules.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useSelectableGroup<T extends string = string>(value: ModelRef<T[]>, options?: UseSelectableGroupOptions): UseSelectableGroupReturn<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function useSelectableGroup(value, options = {}) {
|
|
2
|
+
const isSelected = (item) => value.value.includes(item);
|
|
3
|
+
const update = (item) => {
|
|
4
|
+
if (options.readOnly)
|
|
5
|
+
return;
|
|
6
|
+
const selected = isSelected(item);
|
|
7
|
+
if (!selected && options.maxSelectedValues !== void 0 && value.value.length >= options.maxSelectedValues) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
value.value = selected ? value.value.filter((i) => i !== item) : [...value.value, item];
|
|
11
|
+
};
|
|
12
|
+
const isDisabled = (item) => {
|
|
13
|
+
if (options.disabled)
|
|
14
|
+
return true;
|
|
15
|
+
if (options.maxSelectedValues === void 0)
|
|
16
|
+
return false;
|
|
17
|
+
return !isSelected(item) && value.value.length >= options.maxSelectedValues;
|
|
18
|
+
};
|
|
19
|
+
return { update, isSelected, isDisabled };
|
|
20
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { NuanceTheme } from '@nui/types';
|
|
2
2
|
import type { CSSProperties } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* Builds a style object from a factory that receives the current theme.
|
|
5
|
+
*/
|
|
3
6
|
export declare function useStyleResolver<T extends CSSProperties>(factory: (theme: NuanceTheme) => T): T;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NuanceTheme } from '@nui/types';
|
|
2
|
+
interface ThemeInstance {
|
|
3
|
+
/** User-selected theme preference, including `system`. Writable. */
|
|
4
|
+
preference: NuanceTheme;
|
|
5
|
+
/** Resolved theme currently applied to the document. */
|
|
6
|
+
readonly value: NuanceTheme;
|
|
7
|
+
/** `true` while the theme has not yet been determined on the client. */
|
|
8
|
+
unknown: boolean;
|
|
9
|
+
/** `true` when the theme is forced by the application and cannot be changed by the user. */
|
|
10
|
+
forced: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the current Nuance theme instance
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTheme(): ThemeInstance;
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { MaybePromise } from '@nui/types';
|
|
1
2
|
import type { ButtonProps, ModalRootProps } from '../../components/index.js';
|
|
2
|
-
import type { MaybePromise } from '../../types/index.js';
|
|
3
3
|
type ConfirmLabels = Record<'confirm' | 'cancel', string>;
|
|
4
4
|
export interface ConfirmModalProps extends /* @vue-ignore */ ModalRootProps {
|
|
5
5
|
/** Modal title */
|
|
@@ -45,37 +45,37 @@ async function hanleConfirm() {
|
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
47
|
<template>
|
|
48
|
-
<ModalRoot v-model:open='opened' v-bind='rest' :close-on-click-outside size='sm'>
|
|
49
|
-
<ModalHeader>
|
|
50
|
-
<Title order='4'>
|
|
51
|
-
{{ title }}
|
|
52
|
-
</Title>
|
|
53
|
-
<ModalCloseButton />
|
|
54
|
-
</ModalHeader>
|
|
55
|
-
|
|
56
|
-
<p v-if='body' :class='$style.body'>
|
|
57
|
-
{{ body }}
|
|
58
|
-
</p>
|
|
59
|
-
|
|
60
|
-
<footer :class='$style.footer'>
|
|
61
|
-
<Button
|
|
62
|
-
variant='default'
|
|
63
|
-
v-bind='cancelProps'
|
|
64
|
-
@click='handleCancel()'
|
|
65
|
-
>
|
|
66
|
-
{{ labels?.cancel ?? "Cancel" }}
|
|
67
|
-
</Button>
|
|
68
|
-
<Button
|
|
69
|
-
variant='filled'
|
|
70
|
-
v-bind='confirmProps'
|
|
71
|
-
:color="variant === 'danger' ? 'red' : void 0"
|
|
72
|
-
:loading
|
|
73
|
-
@click='hanleConfirm()'
|
|
74
|
-
>
|
|
75
|
-
{{ labels?.confirm ?? "Confirm" }}
|
|
76
|
-
</Button>
|
|
77
|
-
</footer>
|
|
78
|
-
</ModalRoot>
|
|
48
|
+
<ModalRoot v-model:open='opened' v-bind='rest' :close-on-click-outside size='sm'>
|
|
49
|
+
<ModalHeader>
|
|
50
|
+
<Title order='4'>
|
|
51
|
+
{{ title }}
|
|
52
|
+
</Title>
|
|
53
|
+
<ModalCloseButton />
|
|
54
|
+
</ModalHeader>
|
|
55
|
+
|
|
56
|
+
<p v-if='body' :class='$style.body'>
|
|
57
|
+
{{ body }}
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
<footer :class='$style.footer'>
|
|
61
|
+
<Button
|
|
62
|
+
variant='default'
|
|
63
|
+
v-bind='cancelProps'
|
|
64
|
+
@click='handleCancel()'
|
|
65
|
+
>
|
|
66
|
+
{{ labels?.cancel ?? "Cancel" }}
|
|
67
|
+
</Button>
|
|
68
|
+
<Button
|
|
69
|
+
variant='filled'
|
|
70
|
+
v-bind='confirmProps'
|
|
71
|
+
:color="variant === 'danger' ? 'red' : void 0"
|
|
72
|
+
:loading
|
|
73
|
+
@click='hanleConfirm()'
|
|
74
|
+
>
|
|
75
|
+
{{ labels?.confirm ?? "Confirm" }}
|
|
76
|
+
</Button>
|
|
77
|
+
</footer>
|
|
78
|
+
</ModalRoot>
|
|
79
79
|
</template>
|
|
80
80
|
|
|
81
81
|
<style module>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { MaybePromise } from '@nui/types';
|
|
1
2
|
import type { ButtonProps, ModalRootProps } from '../../components/index.js';
|
|
2
|
-
import type { MaybePromise } from '../../types/index.js';
|
|
3
3
|
type ConfirmLabels = Record<'confirm' | 'cancel', string>;
|
|
4
4
|
export interface ConfirmModalProps extends /* @vue-ignore */ ModalRootProps {
|
|
5
5
|
/** Modal title */
|
|
@@ -1,68 +1,51 @@
|
|
|
1
1
|
import type { Component } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Reactive state of a single modal within {@link ModalManager}.
|
|
4
|
-
*/
|
|
2
|
+
/** Reactive state of a single active modal. */
|
|
5
3
|
export interface ModalState<Props extends object = object, Resolve = unknown, Reject = unknown> {
|
|
6
|
-
/** Unique modal identifier */
|
|
4
|
+
/** Unique modal identifier. */
|
|
7
5
|
id: string;
|
|
8
|
-
/** Vue component rendered as the modal */
|
|
6
|
+
/** Vue component rendered as the modal. */
|
|
9
7
|
component: Component;
|
|
10
|
-
/** Props passed when
|
|
8
|
+
/** Props passed when opening the modal. */
|
|
11
9
|
props: Props;
|
|
12
|
-
/** Current visibility state */
|
|
10
|
+
/** Current visibility state. */
|
|
13
11
|
opened: boolean;
|
|
14
|
-
/** Resolves the promise created when the modal was opened */
|
|
12
|
+
/** Resolves the promise created when the modal was opened. */
|
|
15
13
|
resolve: (value?: Resolve) => void;
|
|
16
|
-
/** Rejects the promise created when the modal was opened */
|
|
14
|
+
/** Rejects the promise created when the modal was opened. */
|
|
17
15
|
reject: (reason?: Reject) => void;
|
|
18
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Global modal manager.
|
|
19
|
+
*
|
|
20
|
+
* Maintains a component registry and a reactive map of active modals.
|
|
21
|
+
* Opening a modal returns a promise that resolves via `resolve` or rejects
|
|
22
|
+
* via `reject` / user dismissal.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const open = $modals.create<MyProps, string>('my-modal', MyModal)
|
|
27
|
+
* const result = await open({ foo: 'bar' }) // result: string
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
19
30
|
export declare class ModalManager {
|
|
20
31
|
#private;
|
|
21
32
|
/** Reactive map of active modals */
|
|
22
33
|
readonly modals: import("vue").Reactive<Map<string, ModalState<object, unknown, unknown>>>;
|
|
23
34
|
private constructor();
|
|
24
35
|
static get instance(): ModalManager;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/** unique modal identifier */
|
|
30
|
-
id: string,
|
|
31
|
-
/** Vue component for the modal */
|
|
32
|
-
component: Component): (props?: TProps) => Promise<TResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Registers a lazy modal — the component is loaded on first open.
|
|
35
|
-
*/
|
|
36
|
-
createLazy<TProps extends object = object, TResult = void>(
|
|
37
|
-
/** unique modal identifier */
|
|
38
|
-
id: string,
|
|
39
|
-
/** dynamic import function (`() => import('./my-modal.vue')`) */
|
|
40
|
-
loader: () => Promise<{
|
|
36
|
+
/** Registers a modal component and returns a typed opener function. */
|
|
37
|
+
create<TProps extends object = object, TResult = void>(id: string, component: Component): (props?: TProps) => Promise<TResult>;
|
|
38
|
+
/** Registers a lazy modal. The component is loaded on first open. */
|
|
39
|
+
createLazy<TProps extends object = object, TResult = void>(id: string, loader: () => Promise<{
|
|
41
40
|
default: Component;
|
|
42
41
|
}>): (props?: Omit<TProps, 'modalId'>) => Promise<TResult>;
|
|
43
|
-
/**
|
|
44
|
-
* Opens a previously registered modal by its identifier.
|
|
45
|
-
*/
|
|
42
|
+
/** Opens a previously registered modal by its identifier. */
|
|
46
43
|
show<T = unknown>(id: string, props?: object): Promise<T>;
|
|
47
|
-
/**
|
|
48
|
-
* Closes the modal and resolves its promise with the given result.
|
|
49
|
-
*
|
|
50
|
-
* @param id — modal identifier
|
|
51
|
-
* @param result — value the promise resolves with
|
|
52
|
-
*/
|
|
44
|
+
/** Closes the modal and resolves its promise with the given result. */
|
|
53
45
|
resolve(id: string, result?: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* Closes the modal and rejects its promise with the given reason.
|
|
56
|
-
*
|
|
57
|
-
* @param id — modal identifier
|
|
58
|
-
* @param reason — rejection reason
|
|
59
|
-
*/
|
|
46
|
+
/** Closes the modal and rejects its promise with the given reason. */
|
|
60
47
|
reject(id: string, reason?: any): void;
|
|
61
|
-
/**
|
|
62
|
-
* Returns the reactive state of a specific modal as `ComputedRef<ModalState>`.
|
|
63
|
-
*
|
|
64
|
-
* Used inside a modal component (via {@link useModal}).
|
|
65
|
-
*/
|
|
48
|
+
/** Returns the reactive state of a specific modal. */
|
|
66
49
|
state<Props extends object = object, Resolve = unknown, Reject = unknown>(id: string): ModalState<Props, Resolve, Reject>;
|
|
67
50
|
}
|
|
68
51
|
export declare const $modals: import("vue").Raw<ModalManager>;
|
|
@@ -3,9 +3,9 @@ const GLOBAL_KEY = "__nui_modal_manager__";
|
|
|
3
3
|
export class ModalManager {
|
|
4
4
|
/** Reactive map of active modals */
|
|
5
5
|
modals = reactive(/* @__PURE__ */ new Map());
|
|
6
|
-
/** Eagerly registered components
|
|
6
|
+
/** Eagerly registered components */
|
|
7
7
|
#registered = /* @__PURE__ */ new Map();
|
|
8
|
-
/** Lazily registered loaders
|
|
8
|
+
/** Lazily registered loaders */
|
|
9
9
|
#lazy = /* @__PURE__ */ new Map();
|
|
10
10
|
constructor() {
|
|
11
11
|
}
|
|
@@ -15,49 +15,29 @@ export class ModalManager {
|
|
|
15
15
|
globalThis[GLOBAL_KEY] = new ModalManager();
|
|
16
16
|
return globalThis[GLOBAL_KEY];
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Registers a modal component and returns a typed function to open it.
|
|
20
|
-
*/
|
|
18
|
+
/** Registers a modal component and returns a typed opener function. */
|
|
21
19
|
create(id, component) {
|
|
22
20
|
this.#registered.set(id, component);
|
|
23
21
|
return (props) => this.#show(id, props ?? {});
|
|
24
22
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Registers a lazy modal — the component is loaded on first open.
|
|
27
|
-
*/
|
|
23
|
+
/** Registers a lazy modal. The component is loaded on first open. */
|
|
28
24
|
createLazy(id, loader) {
|
|
29
25
|
this.#lazy.set(id, loader);
|
|
30
26
|
return (props) => this.#show(id, props ?? {});
|
|
31
27
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Opens a previously registered modal by its identifier.
|
|
34
|
-
*/
|
|
28
|
+
/** Opens a previously registered modal by its identifier. */
|
|
35
29
|
async show(id, props = {}) {
|
|
36
30
|
return this.#show(id, props);
|
|
37
31
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Closes the modal and resolves its promise with the given result.
|
|
40
|
-
*
|
|
41
|
-
* @param id — modal identifier
|
|
42
|
-
* @param result — value the promise resolves with
|
|
43
|
-
*/
|
|
32
|
+
/** Closes the modal and resolves its promise with the given result. */
|
|
44
33
|
resolve(id, result) {
|
|
45
34
|
this.#resolve(id, result);
|
|
46
35
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Closes the modal and rejects its promise with the given reason.
|
|
49
|
-
*
|
|
50
|
-
* @param id — modal identifier
|
|
51
|
-
* @param reason — rejection reason
|
|
52
|
-
*/
|
|
36
|
+
/** Closes the modal and rejects its promise with the given reason. */
|
|
53
37
|
reject(id, reason) {
|
|
54
38
|
this.#reject(id, reason);
|
|
55
39
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Returns the reactive state of a specific modal as `ComputedRef<ModalState>`.
|
|
58
|
-
*
|
|
59
|
-
* Used inside a modal component (via {@link useModal}).
|
|
60
|
-
*/
|
|
40
|
+
/** Returns the reactive state of a specific modal. */
|
|
61
41
|
state(id) {
|
|
62
42
|
return this.modals.get(id);
|
|
63
43
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
manager?: ModalManager;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
6
|
-
manager: import("vue").Raw<ModalManager>;
|
|
7
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
2
|
declare const _default: typeof __VLS_export;
|
|
9
3
|
export default _default;
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { $modals } from "./modal-manager";
|
|
3
|
-
defineProps({
|
|
4
|
-
manager: { type: Object, required: false }
|
|
5
|
-
});
|
|
6
|
-
defineExpose({
|
|
7
|
-
manager: $modals
|
|
8
|
-
});
|
|
9
3
|
</script>
|
|
10
4
|
|
|
11
5
|
<template>
|
|
12
|
-
<ClientOnly>
|
|
13
|
-
<div id='nui-modals-root'>
|
|
14
|
-
<component
|
|
15
|
-
:is='entry.component'
|
|
16
|
-
v-for='[id, entry] in $
|
|
17
|
-
:key='id'
|
|
18
|
-
v-bind='entry.props'
|
|
19
|
-
/>
|
|
20
|
-
</div>
|
|
21
|
-
</ClientOnly>
|
|
6
|
+
<ClientOnly>
|
|
7
|
+
<div id='nui-modals-root'>
|
|
8
|
+
<component
|
|
9
|
+
:is='entry.component'
|
|
10
|
+
v-for='[id, entry] in $modals.modals'
|
|
11
|
+
:key='id'
|
|
12
|
+
v-bind='entry.props'
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</ClientOnly>
|
|
22
16
|
</template>
|