@movk/nuxt 1.1.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/movk-ui.css +3 -0
- package/README.md +75 -104
- package/dist/module.d.mts +59 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +136 -56
- package/dist/runtime/components/AutoForm.d.vue.ts +10 -31
- package/dist/runtime/components/AutoForm.vue +114 -148
- package/dist/runtime/components/AutoForm.vue.d.ts +10 -31
- package/dist/runtime/components/ColorChooser.d.vue.ts +20 -17
- package/dist/runtime/components/ColorChooser.vue +305 -31
- package/dist/runtime/components/ColorChooser.vue.d.ts +20 -17
- package/dist/runtime/components/DataTable.d.vue.ts +57 -0
- package/dist/runtime/components/DataTable.vue +584 -0
- package/dist/runtime/components/DataTable.vue.d.ts +57 -0
- package/dist/runtime/components/DatePicker.d.vue.ts +15 -22
- package/dist/runtime/components/DatePicker.vue +173 -65
- package/dist/runtime/components/DatePicker.vue.d.ts +15 -22
- package/dist/runtime/components/MessageBox.d.vue.ts +36 -0
- package/dist/runtime/components/MessageBox.vue +113 -0
- package/dist/runtime/components/MessageBox.vue.d.ts +36 -0
- package/dist/runtime/components/PillGroup.d.vue.ts +33 -0
- package/dist/runtime/components/PillGroup.vue +291 -0
- package/dist/runtime/components/PillGroup.vue.d.ts +33 -0
- package/dist/runtime/components/Popconfirm.d.vue.ts +30 -0
- package/dist/runtime/components/Popconfirm.vue +143 -0
- package/dist/runtime/components/Popconfirm.vue.d.ts +30 -0
- package/dist/runtime/components/SearchForm.d.vue.ts +43 -0
- package/dist/runtime/components/SearchForm.vue +274 -0
- package/dist/runtime/components/SearchForm.vue.d.ts +43 -0
- package/dist/runtime/components/SlideVerify.d.vue.ts +13 -79
- package/dist/runtime/components/SlideVerify.vue +117 -90
- package/dist/runtime/components/SlideVerify.vue.d.ts +13 -79
- package/dist/runtime/components/StarRating.d.vue.ts +25 -82
- package/dist/runtime/components/StarRating.vue +128 -99
- package/dist/runtime/components/StarRating.vue.d.ts +25 -82
- package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +32 -0
- package/dist/runtime/components/input/AsPhoneNumberInput.vue +48 -0
- package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +32 -0
- package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +13 -7
- package/dist/runtime/components/input/WithCharacterLimit.vue +27 -15
- package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +13 -7
- package/dist/runtime/components/input/WithClear.d.vue.ts +11 -5
- package/dist/runtime/components/input/WithClear.vue +29 -10
- package/dist/runtime/components/input/WithClear.vue.d.ts +11 -5
- package/dist/runtime/components/input/WithCopy.d.vue.ts +13 -7
- package/dist/runtime/components/input/WithCopy.vue +28 -11
- package/dist/runtime/components/input/WithCopy.vue.d.ts +13 -7
- package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +33 -0
- package/dist/runtime/components/input/WithFloatingLabel.vue +75 -0
- package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +33 -0
- package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +13 -7
- package/dist/runtime/components/input/WithPasswordToggle.vue +27 -10
- package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +13 -7
- package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePicker.vue +37 -28
- package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +5 -6
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue +4 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +5 -6
- package/dist/runtime/composables/index.d.ts +9 -8
- package/dist/runtime/composables/index.js +2 -1
- package/dist/runtime/composables/useApiFetch.d.ts +23 -15
- package/dist/runtime/composables/useApiFetch.js +21 -28
- package/dist/runtime/composables/useAutoForm.d.ts +14 -98
- package/dist/runtime/composables/useAutoForm.js +55 -161
- package/dist/runtime/composables/useClientApiFetch.d.ts +7 -7
- package/dist/runtime/composables/useDateFormatter.d.ts +16 -3
- package/dist/runtime/composables/useDateFormatter.js +89 -30
- package/dist/runtime/composables/useDownloadWithProgress.d.ts +26 -27
- package/dist/runtime/composables/useDownloadWithProgress.js +143 -42
- package/dist/runtime/composables/useLazyApiFetch.d.ts +19 -0
- package/dist/runtime/composables/useLazyApiFetch.js +4 -0
- package/dist/runtime/composables/useMessageBox.d.ts +6 -0
- package/dist/runtime/composables/useMessageBox.js +16 -0
- package/dist/runtime/composables/useTheme.d.ts +21 -8
- package/dist/runtime/composables/useTheme.js +109 -86
- package/dist/runtime/composables/useUploadWithProgress.d.ts +22 -28
- package/dist/runtime/composables/useUploadWithProgress.js +79 -68
- package/dist/runtime/domains/api/auth.d.ts +2 -0
- package/dist/runtime/domains/api/auth.js +31 -0
- package/dist/runtime/domains/api/endpoint-config.d.ts +11 -0
- package/dist/runtime/domains/api/endpoint-config.js +17 -0
- package/dist/runtime/domains/api/errors.d.ts +2 -0
- package/dist/runtime/domains/api/errors.js +10 -0
- package/dist/runtime/domains/api/fetch-key.d.ts +20 -0
- package/dist/runtime/domains/api/fetch-key.js +23 -0
- package/dist/runtime/domains/api/interceptors/error.d.ts +13 -0
- package/dist/runtime/domains/api/interceptors/error.js +49 -0
- package/dist/runtime/domains/api/interceptors/request.d.ts +12 -0
- package/dist/runtime/domains/api/interceptors/request.js +46 -0
- package/dist/runtime/domains/api/interceptors/response.d.ts +17 -0
- package/dist/runtime/domains/api/interceptors/response.js +27 -0
- package/dist/runtime/domains/api/response.d.ts +4 -0
- package/dist/runtime/domains/api/response.js +14 -0
- package/dist/runtime/domains/api/toast.d.ts +15 -0
- package/dist/runtime/domains/api/toast.js +46 -0
- package/dist/runtime/domains/api/transfer.d.ts +69 -0
- package/dist/runtime/domains/api/transfer.js +81 -0
- package/dist/runtime/domains/auto-form/actions.d.ts +2 -0
- package/dist/runtime/domains/auto-form/actions.js +4 -0
- package/dist/runtime/domains/auto-form/components/Array.d.vue.ts +13 -0
- package/dist/runtime/{components/auto-form-renderer/AutoFormRendererArray.vue → domains/auto-form/components/Array.vue} +37 -48
- package/dist/runtime/domains/auto-form/components/Array.vue.d.ts +13 -0
- package/dist/runtime/domains/auto-form/components/Children.d.vue.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Children.vue +50 -0
- package/dist/runtime/domains/auto-form/components/Children.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Field.d.vue.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Field.vue +56 -0
- package/dist/runtime/domains/auto-form/components/Field.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Layout.d.vue.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Layout.vue +89 -0
- package/dist/runtime/domains/auto-form/components/Layout.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Nested.d.vue.ts +11 -0
- package/dist/runtime/domains/auto-form/components/Nested.vue +47 -0
- package/dist/runtime/domains/auto-form/components/Nested.vue.d.ts +11 -0
- package/dist/runtime/{constants/auto-form.d.ts → domains/auto-form/constants.d.ts} +0 -2
- package/dist/runtime/{constants/auto-form.js → domains/auto-form/constants.js} +0 -25
- package/dist/runtime/domains/auto-form/controls.d.ts +41 -0
- package/dist/runtime/domains/auto-form/controls.js +73 -0
- package/dist/runtime/{utils/field-utils.d.ts → domains/auto-form/fields.d.ts} +7 -21
- package/dist/runtime/{utils/field-utils.js → domains/auto-form/fields.js} +19 -4
- package/dist/runtime/domains/auto-form/metadata.d.ts +22 -0
- package/dist/runtime/domains/auto-form/metadata.js +53 -0
- package/dist/runtime/domains/auto-form/provider.d.ts +62 -0
- package/dist/runtime/{internal/useAutoFormProvider.js → domains/auto-form/provider.js} +6 -3
- package/dist/runtime/domains/auto-form/reactive.d.ts +12 -0
- package/dist/runtime/{utils/reactive-utils.js → domains/auto-form/reactive.js} +1 -1
- package/dist/runtime/domains/auto-form/schema.d.ts +7 -0
- package/dist/runtime/{utils/schema-introspector.js → domains/auto-form/schema.js} +12 -10
- package/dist/runtime/domains/data-table/columns/constants.d.ts +50 -0
- package/dist/runtime/domains/data-table/columns/constants.js +19 -0
- package/dist/runtime/domains/data-table/columns/resolve-columns.d.ts +4 -0
- package/dist/runtime/domains/data-table/columns/resolve-columns.js +59 -0
- package/dist/runtime/domains/data-table/columns/resolve-data-column.d.ts +9 -0
- package/dist/runtime/domains/data-table/columns/resolve-data-column.js +164 -0
- package/dist/runtime/domains/data-table/columns/resolve-group-column.d.ts +4 -0
- package/dist/runtime/domains/data-table/columns/resolve-group-column.js +19 -0
- package/dist/runtime/domains/data-table/columns/resolve-special-columns.d.ts +8 -0
- package/dist/runtime/domains/data-table/columns/resolve-special-columns.js +232 -0
- package/dist/runtime/domains/data-table/columns/style.d.ts +11 -0
- package/dist/runtime/domains/data-table/columns/style.js +67 -0
- package/dist/runtime/domains/data-table/columns/utils.d.ts +6 -0
- package/dist/runtime/domains/data-table/columns/utils.js +16 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.d.vue.ts +10 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.vue +39 -0
- package/dist/runtime/domains/data-table/components/ActionConfirm.vue.d.ts +10 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.d.vue.ts +11 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.vue +91 -0
- package/dist/runtime/domains/data-table/components/ActionsCell.vue.d.ts +11 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.d.vue.ts +9 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.vue +40 -0
- package/dist/runtime/domains/data-table/components/CellTooltip.vue.d.ts +9 -0
- package/dist/runtime/domains/data-table/components/Pagination.d.vue.ts +26 -0
- package/dist/runtime/domains/data-table/components/Pagination.vue +132 -0
- package/dist/runtime/domains/data-table/components/Pagination.vue.d.ts +26 -0
- package/dist/runtime/domains/data-table/indent.d.ts +8 -0
- package/dist/runtime/domains/data-table/indent.js +19 -0
- package/dist/runtime/domains/data-table/tree-selection.d.ts +9 -0
- package/dist/runtime/domains/data-table/tree-selection.js +76 -0
- package/dist/runtime/{utils/theme.d.ts → domains/theme/theme-icons.d.ts} +0 -1
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/api.factory.js +28 -171
- package/dist/runtime/plugins/theme.js +72 -70
- package/dist/runtime/types/api/config.d.ts +127 -0
- package/dist/runtime/types/api/fetch.d.ts +50 -0
- package/dist/runtime/types/api/index.d.ts +5 -0
- package/dist/runtime/types/api/module.d.ts +94 -0
- package/dist/runtime/types/api/response.d.ts +62 -0
- package/dist/runtime/types/api/transfer.d.ts +32 -0
- package/dist/runtime/types/api/transfer.js +0 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/auto-form/base.d.ts +26 -0
- package/dist/runtime/types/auto-form/base.js +0 -0
- package/dist/runtime/types/auto-form/component.d.ts +28 -0
- package/dist/runtime/types/auto-form/component.js +0 -0
- package/dist/runtime/types/auto-form/controls.d.ts +45 -0
- package/dist/runtime/types/auto-form/controls.js +0 -0
- package/dist/runtime/types/auto-form/fields.d.ts +68 -0
- package/dist/runtime/types/auto-form/fields.js +0 -0
- package/dist/runtime/types/auto-form/index.d.ts +7 -0
- package/dist/runtime/types/auto-form/index.js +0 -0
- package/dist/runtime/types/auto-form/search-form.d.ts +84 -0
- package/dist/runtime/types/auto-form/search-form.js +0 -0
- package/dist/runtime/types/auto-form/slots.d.ts +85 -0
- package/dist/runtime/types/auto-form/slots.js +0 -0
- package/dist/runtime/types/auto-form/zod-factory.d.ts +127 -0
- package/dist/runtime/types/auto-form/zod-factory.js +0 -0
- package/dist/runtime/types/components/color-chooser.d.ts +109 -0
- package/dist/runtime/types/components/color-chooser.js +0 -0
- package/dist/runtime/types/components/date-picker.d.ts +41 -0
- package/dist/runtime/types/components/date-picker.js +0 -0
- package/dist/runtime/types/components/index.d.ts +8 -0
- package/dist/runtime/types/components/index.js +0 -0
- package/dist/runtime/types/components/input/as-phone-number-input.d.ts +17 -0
- package/dist/runtime/types/components/input/as-phone-number-input.js +0 -0
- package/dist/runtime/types/components/input/index.d.ts +6 -0
- package/dist/runtime/types/components/input/index.js +0 -0
- package/dist/runtime/types/components/input/with-character-limit.d.ts +11 -0
- package/dist/runtime/types/components/input/with-character-limit.js +0 -0
- package/dist/runtime/types/components/input/with-clear.d.ts +10 -0
- package/dist/runtime/types/components/input/with-clear.js +0 -0
- package/dist/runtime/types/components/input/with-copy.d.ts +11 -0
- package/dist/runtime/types/components/input/with-copy.js +0 -0
- package/dist/runtime/types/components/input/with-floating-label.d.ts +12 -0
- package/dist/runtime/types/components/input/with-floating-label.js +0 -0
- package/dist/runtime/types/components/input/with-password-toggle.d.ts +7 -0
- package/dist/runtime/types/components/input/with-password-toggle.js +0 -0
- package/dist/runtime/types/components/message-box.d.ts +69 -0
- package/dist/runtime/types/components/message-box.js +0 -0
- package/dist/runtime/types/components/pill-group.d.ts +103 -0
- package/dist/runtime/types/components/pill-group.js +0 -0
- package/dist/runtime/types/components/popconfirm.d.ts +74 -0
- package/dist/runtime/types/components/popconfirm.js +0 -0
- package/dist/runtime/types/components/slide-verify.d.ts +54 -0
- package/dist/runtime/types/components/slide-verify.js +0 -0
- package/dist/runtime/types/components/star-rating.d.ts +55 -0
- package/dist/runtime/types/components/star-rating.js +0 -0
- package/dist/runtime/types/data-table/columns.d.ts +236 -0
- package/dist/runtime/types/data-table/columns.js +6 -0
- package/dist/runtime/types/data-table/component.d.ts +190 -0
- package/dist/runtime/types/data-table/component.js +0 -0
- package/dist/runtime/types/data-table/contexts.d.ts +44 -0
- package/dist/runtime/types/data-table/contexts.js +0 -0
- package/dist/runtime/types/data-table/index.d.ts +6 -0
- package/dist/runtime/types/data-table/index.js +1 -0
- package/dist/runtime/types/data-table/pagination.d.ts +87 -0
- package/dist/runtime/types/data-table/pagination.js +0 -0
- package/dist/runtime/types/index.d.ts +6 -5
- package/dist/runtime/types/index.js +5 -5
- package/dist/runtime/types/shared.d.ts +5 -0
- package/dist/runtime/types/shared.js +0 -0
- package/dist/runtime/types/zod.d.ts +19 -17
- package/dist/runtime/utils/extend-theme.d.ts +19 -0
- package/dist/runtime/utils/extend-theme.js +44 -0
- package/dist/runtime/utils/form-control.d.ts +33 -0
- package/dist/runtime/utils/form-control.js +54 -0
- package/dist/runtime/utils/meta.d.ts +4 -0
- package/dist/runtime/utils/meta.js +14 -0
- package/dist/runtime/utils/theme-defaults.d.ts +27 -0
- package/dist/runtime/utils/theme-defaults.js +28 -0
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/composables/useSiteConfig.d.ts +13 -0
- package/dist/runtime/vue/composables/useSiteConfig.js +11 -0
- package/dist/runtime/vue/plugins/theme.d.ts +6 -0
- package/dist/runtime/vue/plugins/theme.js +14 -0
- package/dist/runtime/vue/stubs/base.d.ts +2 -0
- package/dist/runtime/vue/stubs/base.js +2 -0
- package/dist/runtime/vue/stubs/inertia.d.ts +2 -0
- package/dist/runtime/vue/stubs/inertia.js +2 -0
- package/dist/runtime/vue/stubs/movk-extra.d.ts +2 -0
- package/dist/runtime/vue/stubs/movk-extra.js +2 -0
- package/dist/runtime/vue/stubs/none.d.ts +2 -0
- package/dist/runtime/vue/stubs/none.js +2 -0
- package/dist/runtime/vue/stubs/vue-router.d.ts +2 -0
- package/dist/runtime/vue/stubs/vue-router.js +2 -0
- package/dist/shared/nuxt.DfBEyjld.mjs +667 -0
- package/dist/types.d.mts +2 -6
- package/dist/unplugin.d.mts +28 -0
- package/dist/unplugin.mjs +292 -0
- package/dist/vite.d.mts +12 -0
- package/dist/vite.mjs +20 -0
- package/package.json +82 -42
- package/vue-plugin.d.ts +5 -0
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue +0 -55
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue +0 -125
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +0 -20
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue +0 -105
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +0 -20
- package/dist/runtime/composables/useApiAuth.d.ts +0 -47
- package/dist/runtime/composables/useApiAuth.js +0 -66
- package/dist/runtime/internal/useAutoFormProvider.d.ts +0 -50
- package/dist/runtime/schemas/api.d.ts +0 -590
- package/dist/runtime/schemas/api.js +0 -228
- package/dist/runtime/server/api/_movk/session.post.d.ts +0 -10
- package/dist/runtime/server/api/_movk/session.post.js +0 -18
- package/dist/runtime/style.css +0 -1
- package/dist/runtime/types/api.d.ts +0 -218
- package/dist/runtime/types/auth.d.ts +0 -34
- package/dist/runtime/types/auto-form-renderer.d.ts +0 -22
- package/dist/runtime/types/auto-form.d.ts +0 -548
- package/dist/runtime/types/components.d.ts +0 -43
- package/dist/runtime/types/module.d.ts +0 -39
- package/dist/runtime/utils/api-utils.d.ts +0 -79
- package/dist/runtime/utils/api-utils.js +0 -127
- package/dist/runtime/utils/auto-form.d.ts +0 -3
- package/dist/runtime/utils/auto-form.js +0 -18
- package/dist/runtime/utils/reactive-utils.d.ts +0 -30
- package/dist/runtime/utils/schema-introspector.d.ts +0 -13
- /package/dist/runtime/{utils/theme.js → domains/theme/theme-icons.js} +0 -0
- /package/dist/runtime/types/{api.js → api/config.js} +0 -0
- /package/dist/runtime/types/{auto-form-renderer.js → api/fetch.js} +0 -0
- /package/dist/runtime/types/{auto-form.js → api/index.js} +0 -0
- /package/dist/runtime/types/{module.js → api/module.js} +0 -0
- /package/dist/runtime/types/{components.js → api/response.js} +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { FieldGroupReset } from "@nuxt/ui/composables/useFieldGroup";
|
|
4
|
+
import { UButton } from "#components";
|
|
5
|
+
import { useAppConfig } from "#imports";
|
|
6
|
+
import { createEqualsBy, getPath } from "@movk/core";
|
|
7
|
+
import theme from "#build/movk-ui/pill-group";
|
|
8
|
+
import { useExtendedTv } from "../utils/extend-theme";
|
|
9
|
+
import { useFieldControl } from "../utils/form-control";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
items: { type: Array, required: false },
|
|
12
|
+
valueKey: { type: null, required: false },
|
|
13
|
+
labelKey: { type: null, required: false, default: "label" },
|
|
14
|
+
descriptionKey: { type: null, required: false, default: "description" },
|
|
15
|
+
by: { type: [String, Function], required: false },
|
|
16
|
+
orientation: { type: String, required: false, default: "horizontal" },
|
|
17
|
+
size: { type: null, required: false },
|
|
18
|
+
color: { type: null, required: false },
|
|
19
|
+
activeVariant: { type: null, required: false, default: "solid" },
|
|
20
|
+
inactiveVariant: { type: null, required: false, default: "soft" },
|
|
21
|
+
disabled: { type: Boolean, required: false },
|
|
22
|
+
multiple: { type: Boolean, required: false },
|
|
23
|
+
deselectable: { type: Boolean, required: false, default: false },
|
|
24
|
+
max: { type: Number, required: false },
|
|
25
|
+
min: { type: Number, required: false },
|
|
26
|
+
defaultValue: { type: null, required: false },
|
|
27
|
+
modelValue: { type: null, required: false },
|
|
28
|
+
class: { type: null, required: false },
|
|
29
|
+
ui: { type: Object, required: false }
|
|
30
|
+
});
|
|
31
|
+
const modelValue = defineModel({ type: null });
|
|
32
|
+
const emits = defineEmits(["blur", "focus", "change", "update:modelValue", "select"]);
|
|
33
|
+
const slots = defineSlots();
|
|
34
|
+
const appConfig = useAppConfig();
|
|
35
|
+
const {
|
|
36
|
+
id,
|
|
37
|
+
size: effectiveSize,
|
|
38
|
+
color: effectiveColor,
|
|
39
|
+
disabled: effectiveDisabled,
|
|
40
|
+
fieldGroupOrientation,
|
|
41
|
+
ariaAttrs,
|
|
42
|
+
emitFormChange,
|
|
43
|
+
emitFormFocus,
|
|
44
|
+
emitFormBlur,
|
|
45
|
+
emitFormInput
|
|
46
|
+
} = useFieldControl(props);
|
|
47
|
+
const focusWithin = ref(false);
|
|
48
|
+
const { extendUi } = useExtendedTv(
|
|
49
|
+
{ slots: {} },
|
|
50
|
+
theme,
|
|
51
|
+
() => appConfig.movk?.pillGroup,
|
|
52
|
+
() => ({
|
|
53
|
+
ui: {
|
|
54
|
+
...props.ui,
|
|
55
|
+
root: [props.ui?.root, props.class]
|
|
56
|
+
},
|
|
57
|
+
variants: {
|
|
58
|
+
orientation: props.orientation,
|
|
59
|
+
fieldGroup: fieldGroupOrientation.value
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
function isSelectItem(item) {
|
|
64
|
+
return typeof item === "object" && item !== null;
|
|
65
|
+
}
|
|
66
|
+
function getItemValue(item) {
|
|
67
|
+
if (!isSelectItem(item)) return item;
|
|
68
|
+
if (!props.valueKey) return item;
|
|
69
|
+
return getPath(item, props.valueKey);
|
|
70
|
+
}
|
|
71
|
+
function getItemKey(item, idx) {
|
|
72
|
+
if (!isSelectItem(item)) return `v:${String(item)}`;
|
|
73
|
+
if (props.valueKey) {
|
|
74
|
+
const v = getPath(item, props.valueKey);
|
|
75
|
+
if (v != null && typeof v !== "object") return `v:${String(v)}`;
|
|
76
|
+
}
|
|
77
|
+
const valueField = getPath(item, "value");
|
|
78
|
+
if (valueField != null && typeof valueField !== "object") return `v:${String(valueField)}`;
|
|
79
|
+
const label = getPath(item, props.labelKey ?? "label");
|
|
80
|
+
if (label) return `l:${label}`;
|
|
81
|
+
return `i:${idx}`;
|
|
82
|
+
}
|
|
83
|
+
function getItemLabel(item) {
|
|
84
|
+
if (!isSelectItem(item)) return String(item);
|
|
85
|
+
const label = getPath(item, props.labelKey ?? "label");
|
|
86
|
+
if (label != null) return String(label);
|
|
87
|
+
const value = getPath(item, "value");
|
|
88
|
+
return value != null ? String(value) : "";
|
|
89
|
+
}
|
|
90
|
+
function getItemDescription(item) {
|
|
91
|
+
if (!isSelectItem(item)) return void 0;
|
|
92
|
+
const desc = getPath(item, props.descriptionKey ?? "description");
|
|
93
|
+
return desc == null ? void 0 : String(desc);
|
|
94
|
+
}
|
|
95
|
+
const itemEquals = computed(() => createEqualsBy({
|
|
96
|
+
by: props.by,
|
|
97
|
+
keys: [props.valueKey, "value", props.labelKey ?? "label"]
|
|
98
|
+
}));
|
|
99
|
+
const selectedArray = computed(() => {
|
|
100
|
+
if (!props.multiple) return [];
|
|
101
|
+
const v = modelValue.value;
|
|
102
|
+
return Array.isArray(v) ? v : [];
|
|
103
|
+
});
|
|
104
|
+
const selectedKeyMap = computed(() => {
|
|
105
|
+
if (!props.multiple || !props.by || typeof props.by !== "string") return null;
|
|
106
|
+
const m = /* @__PURE__ */ new Map();
|
|
107
|
+
for (const v of selectedArray.value) {
|
|
108
|
+
const key = isSelectItem(v) ? getPath(v, props.by) : v;
|
|
109
|
+
m.set(key, true);
|
|
110
|
+
}
|
|
111
|
+
return m;
|
|
112
|
+
});
|
|
113
|
+
function isSelected(item) {
|
|
114
|
+
const target = getItemValue(item);
|
|
115
|
+
if (props.multiple) {
|
|
116
|
+
if (selectedKeyMap.value) {
|
|
117
|
+
const key = isSelectItem(target) ? getPath(target, props.by) : target;
|
|
118
|
+
return selectedKeyMap.value.has(key);
|
|
119
|
+
}
|
|
120
|
+
return selectedArray.value.some((v) => itemEquals.value(v, target));
|
|
121
|
+
}
|
|
122
|
+
if (modelValue.value === void 0) return false;
|
|
123
|
+
return itemEquals.value(modelValue.value, target);
|
|
124
|
+
}
|
|
125
|
+
function isItemDisabled(item) {
|
|
126
|
+
return isSelectItem(item) && item.disabled === true;
|
|
127
|
+
}
|
|
128
|
+
const reachedMax = computed(
|
|
129
|
+
() => !!(props.multiple && props.max != null && selectedArray.value.length >= props.max)
|
|
130
|
+
);
|
|
131
|
+
function isItemLocked(item) {
|
|
132
|
+
return reachedMax.value && !isSelected(item);
|
|
133
|
+
}
|
|
134
|
+
function isClickBlocked(item) {
|
|
135
|
+
if (!props.multiple || props.min == null) return false;
|
|
136
|
+
return isSelected(item) && selectedArray.value.length <= props.min;
|
|
137
|
+
}
|
|
138
|
+
function emitSelect(item, index, selected) {
|
|
139
|
+
emits("select", {
|
|
140
|
+
item,
|
|
141
|
+
value: getItemValue(item),
|
|
142
|
+
selected,
|
|
143
|
+
index
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function handleClick(e, item, index) {
|
|
147
|
+
if (effectiveDisabled.value || isItemDisabled(item)) return;
|
|
148
|
+
if (props.multiple && (isItemLocked(item) || isClickBlocked(item))) return;
|
|
149
|
+
if (isSelectItem(item) && typeof item.onSelect === "function") {
|
|
150
|
+
item.onSelect(e);
|
|
151
|
+
}
|
|
152
|
+
if (props.multiple) {
|
|
153
|
+
const arr = selectedArray.value;
|
|
154
|
+
const target = getItemValue(item);
|
|
155
|
+
const wasSelected = isSelected(item);
|
|
156
|
+
const next = wasSelected ? arr.filter((v) => !itemEquals.value(v, target)) : [...arr, target];
|
|
157
|
+
modelValue.value = next;
|
|
158
|
+
emits("change", next);
|
|
159
|
+
emitSelect(item, index, !wasSelected);
|
|
160
|
+
} else {
|
|
161
|
+
const next = getItemValue(item);
|
|
162
|
+
const wasSelected = isSelected(item);
|
|
163
|
+
const finalValue = props.deselectable && wasSelected ? void 0 : next;
|
|
164
|
+
if (itemEquals.value(modelValue.value, finalValue)) return;
|
|
165
|
+
modelValue.value = finalValue;
|
|
166
|
+
emits("change", finalValue);
|
|
167
|
+
emitSelect(item, index, !wasSelected);
|
|
168
|
+
}
|
|
169
|
+
emitFormChange();
|
|
170
|
+
emitFormInput();
|
|
171
|
+
}
|
|
172
|
+
function isDisabledItem(item) {
|
|
173
|
+
return effectiveDisabled.value || isItemDisabled(item) || isItemLocked(item);
|
|
174
|
+
}
|
|
175
|
+
function handleFocusIn() {
|
|
176
|
+
if (focusWithin.value) return;
|
|
177
|
+
focusWithin.value = true;
|
|
178
|
+
emitFormFocus();
|
|
179
|
+
}
|
|
180
|
+
function handleFocusOut(event) {
|
|
181
|
+
const nextTarget = event.relatedTarget;
|
|
182
|
+
if (nextTarget instanceof Node && event.currentTarget.contains(nextTarget)) return;
|
|
183
|
+
focusWithin.value = false;
|
|
184
|
+
emitFormBlur();
|
|
185
|
+
}
|
|
186
|
+
function hasLeading(item) {
|
|
187
|
+
return isSelectItem(item) && (!!item.icon || !!item.avatar);
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
<template>
|
|
192
|
+
<div :class="extendUi.root" data-slot="root">
|
|
193
|
+
<FieldGroupReset>
|
|
194
|
+
<slot name="leading" :model-value="modelValue" :items="items ?? []" />
|
|
195
|
+
|
|
196
|
+
<slot :model-value="modelValue" :items="items ?? []">
|
|
197
|
+
<div
|
|
198
|
+
:id="id"
|
|
199
|
+
:role="props.multiple ? 'group' : void 0"
|
|
200
|
+
:class="extendUi.list"
|
|
201
|
+
data-slot="list"
|
|
202
|
+
v-bind="ariaAttrs"
|
|
203
|
+
@focusin="handleFocusIn"
|
|
204
|
+
@focusout="handleFocusOut"
|
|
205
|
+
>
|
|
206
|
+
<template v-for="(item, idx) in items" :key="getItemKey(item, idx)">
|
|
207
|
+
<slot
|
|
208
|
+
name="item"
|
|
209
|
+
:item="item"
|
|
210
|
+
:index="idx"
|
|
211
|
+
:selected="isSelected(item)"
|
|
212
|
+
>
|
|
213
|
+
<UButton
|
|
214
|
+
:color="isSelectItem(item) && item.color ? item.color : effectiveColor"
|
|
215
|
+
:size="effectiveSize"
|
|
216
|
+
:disabled="isDisabledItem(item)"
|
|
217
|
+
:variant="isSelected(item) ? isSelectItem(item) && item.variant ? item.variant : props.activeVariant : props.inactiveVariant"
|
|
218
|
+
:class="[extendUi.item, isSelectItem(item) ? item.class : void 0]"
|
|
219
|
+
@click="handleClick($event, item, idx)"
|
|
220
|
+
>
|
|
221
|
+
<span
|
|
222
|
+
v-if="!!slots['item-leading'] || hasLeading(item)"
|
|
223
|
+
:class="extendUi.leading"
|
|
224
|
+
data-slot="leading"
|
|
225
|
+
>
|
|
226
|
+
<slot
|
|
227
|
+
name="item-leading"
|
|
228
|
+
:item="item"
|
|
229
|
+
:index="idx"
|
|
230
|
+
:selected="isSelected(item)"
|
|
231
|
+
>
|
|
232
|
+
<UIcon
|
|
233
|
+
v-if="isSelectItem(item) && item.icon"
|
|
234
|
+
:name="item.icon"
|
|
235
|
+
:class="extendUi.leadingIcon"
|
|
236
|
+
/>
|
|
237
|
+
<UAvatar
|
|
238
|
+
v-else-if="isSelectItem(item) && item.avatar"
|
|
239
|
+
v-bind="item.avatar"
|
|
240
|
+
/>
|
|
241
|
+
</slot>
|
|
242
|
+
</span>
|
|
243
|
+
|
|
244
|
+
<span :class="extendUi.itemWrapper">
|
|
245
|
+
<span :class="extendUi.itemLabel">
|
|
246
|
+
<slot
|
|
247
|
+
name="item-label"
|
|
248
|
+
:item="item"
|
|
249
|
+
:index="idx"
|
|
250
|
+
:selected="isSelected(item)"
|
|
251
|
+
>
|
|
252
|
+
{{ getItemLabel(item) }}
|
|
253
|
+
</slot>
|
|
254
|
+
</span>
|
|
255
|
+
<span
|
|
256
|
+
v-if="getItemDescription(item) || !!slots['item-description']"
|
|
257
|
+
:class="extendUi.itemDescription"
|
|
258
|
+
>
|
|
259
|
+
<slot
|
|
260
|
+
name="item-description"
|
|
261
|
+
:item="item"
|
|
262
|
+
:index="idx"
|
|
263
|
+
:selected="isSelected(item)"
|
|
264
|
+
>
|
|
265
|
+
{{ getItemDescription(item) }}
|
|
266
|
+
</slot>
|
|
267
|
+
</span>
|
|
268
|
+
</span>
|
|
269
|
+
|
|
270
|
+
<span
|
|
271
|
+
v-if="!!slots['item-trailing']"
|
|
272
|
+
:class="extendUi.trailing"
|
|
273
|
+
data-slot="trailing"
|
|
274
|
+
>
|
|
275
|
+
<slot
|
|
276
|
+
name="item-trailing"
|
|
277
|
+
:item="item"
|
|
278
|
+
:index="idx"
|
|
279
|
+
:selected="isSelected(item)"
|
|
280
|
+
/>
|
|
281
|
+
</span>
|
|
282
|
+
</UButton>
|
|
283
|
+
</slot>
|
|
284
|
+
</template>
|
|
285
|
+
</div>
|
|
286
|
+
</slot>
|
|
287
|
+
|
|
288
|
+
<slot name="trailing" :model-value="modelValue" :items="items ?? []" />
|
|
289
|
+
</FieldGroupReset>
|
|
290
|
+
</div>
|
|
291
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { GetItemKeys, GetModelValue } from '@nuxt/ui';
|
|
2
|
+
import type { PillGroupProps, PillGroupSlots, PillItem } from '../types/components/pill-group';
|
|
3
|
+
declare const __VLS_export: <T extends PillItem, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false>(__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<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(PillGroupProps<T, VK, M> & {
|
|
5
|
+
orientation?: string | number | symbol;
|
|
6
|
+
ui?: {
|
|
7
|
+
[x: string]: import("tailwind-variants").ClassValue;
|
|
8
|
+
};
|
|
9
|
+
} & {
|
|
10
|
+
modelValue?: GetModelValue<T, VK, M>;
|
|
11
|
+
}) & {
|
|
12
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
13
|
+
onChange?: ((value: GetModelValue<T, VK, M, undefined>) => any) | undefined;
|
|
14
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
15
|
+
onSelect?: ((payload: import("../types").PillSelectPayload<T>) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: GetModelValue<T, VK, M, undefined> | undefined) => any) | undefined;
|
|
17
|
+
}> & (typeof globalThis extends {
|
|
18
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
19
|
+
} ? P : {});
|
|
20
|
+
expose: (exposed: {}) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
slots: PillGroupSlots<T, VK, M>;
|
|
23
|
+
emit: (((evt: "blur", event: FocusEvent) => void) & ((evt: "change", value: GetModelValue<T, VK, M, undefined>) => void) & ((evt: "focus", event: FocusEvent) => void) & ((evt: "select", payload: import("../types").PillSelectPayload<T>) => void) & ((evt: "update:modelValue", value: GetModelValue<T, VK, M, undefined>) => void)) & ((event: "update:modelValue", value: GetModelValue<T, VK, M> | undefined) => void);
|
|
24
|
+
}>) => import("vue").VNode & {
|
|
25
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
26
|
+
};
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
30
|
+
[K in keyof T]: T[K];
|
|
31
|
+
} : {
|
|
32
|
+
[K in keyof T as K]: T[K];
|
|
33
|
+
}) & {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@nuxt/ui';
|
|
2
|
+
import theme from '#build/movk-ui/popconfirm';
|
|
3
|
+
import popoverTheme from '#build/ui/popover';
|
|
4
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
5
|
+
import type { PopconfirmProps, PopconfirmSlots } from '../types/components/popconfirm';
|
|
6
|
+
declare const __VLS_export: <M extends "click" | "hover">(__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<{
|
|
7
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(PopconfirmProps<"click" | "hover"> & {
|
|
8
|
+
type?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, "popconfirm">["variants"]["type"];
|
|
9
|
+
ui?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, "popconfirm">["slots"];
|
|
10
|
+
}) & {
|
|
11
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
12
|
+
onCancel?: (() => any) | undefined;
|
|
13
|
+
onConfirm?: (() => any) | undefined;
|
|
14
|
+
}> & (typeof globalThis extends {
|
|
15
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
16
|
+
} ? P : {});
|
|
17
|
+
expose: (exposed: {}) => void;
|
|
18
|
+
attrs: any;
|
|
19
|
+
slots: PopconfirmSlots<"click" | "hover">;
|
|
20
|
+
emit: ((evt: "error", error: unknown) => void) & ((evt: "cancel") => void) & ((evt: "confirm") => void);
|
|
21
|
+
}>) => import("vue").VNode & {
|
|
22
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
23
|
+
};
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
27
|
+
[K in keyof T]: T[K];
|
|
28
|
+
} : {
|
|
29
|
+
[K in keyof T as K]: T[K];
|
|
30
|
+
}) & {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { isObject } from "@movk/core";
|
|
3
|
+
import { UPopover, UButton, UIcon } from "#components";
|
|
4
|
+
import { computed, ref, useAttrs } from "vue";
|
|
5
|
+
import { useAppConfig } from "#imports";
|
|
6
|
+
import { useExtendedTv } from "../utils/extend-theme";
|
|
7
|
+
import theme from "#build/movk-ui/popconfirm";
|
|
8
|
+
import popoverTheme from "#build/ui/popover";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
title: { type: String, required: false, default: "\u786E\u8BA4\u64CD\u4F5C" },
|
|
11
|
+
description: { type: String, required: false, default: "\u8BF7\u786E\u8BA4\u662F\u5426\u6267\u884C\u6B64\u64CD\u4F5C?" },
|
|
12
|
+
type: { type: String, required: false, default: "neutral" },
|
|
13
|
+
icon: { type: null, required: false, default: "i-lucide-circle-question-mark" },
|
|
14
|
+
arrow: { type: Boolean, required: false, default: true },
|
|
15
|
+
confirmButton: { type: null, required: false },
|
|
16
|
+
cancelButton: { type: [Object, Boolean], required: false, default: true },
|
|
17
|
+
dismissible: { type: Boolean, required: false },
|
|
18
|
+
onConfirm: { type: Function, required: false },
|
|
19
|
+
ui: { type: Object, required: false }
|
|
20
|
+
});
|
|
21
|
+
const emits = defineEmits(["confirm", "cancel", "error"]);
|
|
22
|
+
const slots = defineSlots();
|
|
23
|
+
defineOptions({ inheritAttrs: false });
|
|
24
|
+
const attrs = useAttrs();
|
|
25
|
+
const appConfig = useAppConfig();
|
|
26
|
+
const openState = ref(false);
|
|
27
|
+
const { baseUi, extraUi } = useExtendedTv(
|
|
28
|
+
popoverTheme,
|
|
29
|
+
theme,
|
|
30
|
+
() => appConfig.movk?.popconfirm,
|
|
31
|
+
() => ({ ui: props.ui, variants: { type: props.type } })
|
|
32
|
+
);
|
|
33
|
+
const confirmLoading = ref(false);
|
|
34
|
+
const iconMap = {
|
|
35
|
+
primary: "i-lucide-bell",
|
|
36
|
+
info: "i-lucide-info",
|
|
37
|
+
success: "i-lucide-circle-check",
|
|
38
|
+
warning: "i-lucide-triangle-alert",
|
|
39
|
+
error: "i-lucide-circle-x",
|
|
40
|
+
neutral: "i-lucide-circle-question-mark"
|
|
41
|
+
};
|
|
42
|
+
const resolvedIcon = computed(() => props.icon ?? iconMap[props.type]);
|
|
43
|
+
const cancelButtonAttrs = computed(() => ({
|
|
44
|
+
color: "neutral",
|
|
45
|
+
size: "xs",
|
|
46
|
+
label: "\u53D6\u6D88",
|
|
47
|
+
variant: "soft",
|
|
48
|
+
...isObject(props.cancelButton) ? props.cancelButton : {}
|
|
49
|
+
}));
|
|
50
|
+
const confirmButtonAttrs = computed(() => ({
|
|
51
|
+
color: "primary",
|
|
52
|
+
size: "xs",
|
|
53
|
+
label: "\u786E\u8BA4",
|
|
54
|
+
...props.confirmButton ?? {}
|
|
55
|
+
}));
|
|
56
|
+
function handleCancel(close) {
|
|
57
|
+
if (confirmLoading.value) return;
|
|
58
|
+
emits("cancel");
|
|
59
|
+
close();
|
|
60
|
+
}
|
|
61
|
+
async function handleConfirm(close) {
|
|
62
|
+
if (confirmLoading.value) return;
|
|
63
|
+
try {
|
|
64
|
+
const result = props.onConfirm?.();
|
|
65
|
+
if (result instanceof Promise) {
|
|
66
|
+
confirmLoading.value = true;
|
|
67
|
+
await result;
|
|
68
|
+
}
|
|
69
|
+
emits("confirm");
|
|
70
|
+
close();
|
|
71
|
+
} catch (err) {
|
|
72
|
+
emits("error", err);
|
|
73
|
+
} finally {
|
|
74
|
+
confirmLoading.value = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<UPopover
|
|
81
|
+
v-bind="attrs"
|
|
82
|
+
v-model:open="openState"
|
|
83
|
+
:dismissible="props.dismissible"
|
|
84
|
+
:arrow="props.arrow"
|
|
85
|
+
:ui="baseUi"
|
|
86
|
+
>
|
|
87
|
+
<template #default="{ open }">
|
|
88
|
+
<slot :open="open" />
|
|
89
|
+
</template>
|
|
90
|
+
|
|
91
|
+
<template #content="{ close }">
|
|
92
|
+
<div
|
|
93
|
+
v-if="!!slots.header || (props.title || !!slots.title) || (props.description || !!slots.description)"
|
|
94
|
+
data-slot="header"
|
|
95
|
+
:class="extraUi.header"
|
|
96
|
+
>
|
|
97
|
+
<slot name="header" :close="close">
|
|
98
|
+
<span
|
|
99
|
+
v-if="props.title || !!slots.title"
|
|
100
|
+
data-slot="title"
|
|
101
|
+
:class="extraUi.title"
|
|
102
|
+
>
|
|
103
|
+
<slot name="title" :close="close">
|
|
104
|
+
<UIcon :name="resolvedIcon" :class="extraUi.icon" />
|
|
105
|
+
{{ props.title }}
|
|
106
|
+
</slot>
|
|
107
|
+
</span>
|
|
108
|
+
|
|
109
|
+
<p
|
|
110
|
+
v-if="props.description || !!slots.description"
|
|
111
|
+
data-slot="description"
|
|
112
|
+
:class="extraUi.description"
|
|
113
|
+
>
|
|
114
|
+
<slot name="description" :close="close">
|
|
115
|
+
{{ props.description }}
|
|
116
|
+
</slot>
|
|
117
|
+
</p>
|
|
118
|
+
</slot>
|
|
119
|
+
|
|
120
|
+
<slot name="actions" :close="close" />
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div v-if="!!slots.body" data-slot="body" :class="extraUi.body">
|
|
124
|
+
<slot name="body" :close="close" />
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<div data-slot="footer" :class="extraUi.footer">
|
|
128
|
+
<slot name="footer" :close="close">
|
|
129
|
+
<UButton
|
|
130
|
+
v-if="props.cancelButton !== false"
|
|
131
|
+
v-bind="cancelButtonAttrs"
|
|
132
|
+
@click="handleCancel(close)"
|
|
133
|
+
/>
|
|
134
|
+
<UButton
|
|
135
|
+
v-bind="confirmButtonAttrs"
|
|
136
|
+
:loading="confirmLoading"
|
|
137
|
+
@click="handleConfirm(close)"
|
|
138
|
+
/>
|
|
139
|
+
</slot>
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
</UPopover>
|
|
143
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@nuxt/ui';
|
|
2
|
+
import theme from '#build/movk-ui/popconfirm';
|
|
3
|
+
import popoverTheme from '#build/ui/popover';
|
|
4
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
5
|
+
import type { PopconfirmProps, PopconfirmSlots } from '../types/components/popconfirm';
|
|
6
|
+
declare const __VLS_export: <M extends "click" | "hover">(__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<{
|
|
7
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(PopconfirmProps<"click" | "hover"> & {
|
|
8
|
+
type?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, "popconfirm">["variants"]["type"];
|
|
9
|
+
ui?: ComponentConfig<typeof popoverTheme & typeof theme, AppConfig, "popconfirm">["slots"];
|
|
10
|
+
}) & {
|
|
11
|
+
onError?: ((error: unknown) => any) | undefined;
|
|
12
|
+
onCancel?: (() => any) | undefined;
|
|
13
|
+
onConfirm?: (() => any) | undefined;
|
|
14
|
+
}> & (typeof globalThis extends {
|
|
15
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
16
|
+
} ? P : {});
|
|
17
|
+
expose: (exposed: {}) => void;
|
|
18
|
+
attrs: any;
|
|
19
|
+
slots: PopconfirmSlots<"click" | "hover">;
|
|
20
|
+
emit: ((evt: "error", error: unknown) => void) & ((evt: "cancel") => void) & ((evt: "confirm") => void);
|
|
21
|
+
}>) => import("vue").VNode & {
|
|
22
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
23
|
+
};
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
27
|
+
[K in keyof T]: T[K];
|
|
28
|
+
} : {
|
|
29
|
+
[K in keyof T as K]: T[K];
|
|
30
|
+
}) & {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentConfig, InferInput } from '@nuxt/ui';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
4
|
+
import theme from '#build/movk-ui/search-form';
|
|
5
|
+
import type { SearchFormProps, SearchFormSlots } from '../types/auto-form/search-form';
|
|
6
|
+
declare const __VLS_export: <S extends z.ZodObject>(__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<{
|
|
7
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(SearchFormProps<S> & {
|
|
8
|
+
ui?: ComponentConfig<typeof theme, AppConfig, "searchForm">["slots"];
|
|
9
|
+
} & {
|
|
10
|
+
modelValue?: Partial<InferInput<S>>;
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
}) & {
|
|
13
|
+
onError?: ((event: import("@nuxt/ui").FormErrorEvent) => any) | undefined;
|
|
14
|
+
onClear?: (() => any) | undefined;
|
|
15
|
+
onReset?: (() => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: Partial<InferInput<S>>) => any) | undefined;
|
|
17
|
+
onExpand?: ((expanded: boolean) => any) | undefined;
|
|
18
|
+
"onUpdate:expanded"?: ((value: boolean | undefined) => any) | undefined;
|
|
19
|
+
}> & (typeof globalThis extends {
|
|
20
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
21
|
+
} ? P : {});
|
|
22
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
23
|
+
formRef: Readonly<import("vue").ShallowRef<any, any>>;
|
|
24
|
+
submit: () => void;
|
|
25
|
+
reset: () => void;
|
|
26
|
+
clear: () => void;
|
|
27
|
+
setBaseline: (value?: Partial<InferInput<S>>) => void;
|
|
28
|
+
expanded: import("vue").WritableComputedRef<boolean, boolean>;
|
|
29
|
+
toggle: () => void;
|
|
30
|
+
}>) => void;
|
|
31
|
+
attrs: any;
|
|
32
|
+
slots: SearchFormSlots<S>;
|
|
33
|
+
emit: (((evt: "error", event: import("@nuxt/ui").FormErrorEvent) => void) & ((evt: "clear") => void) & ((evt: "reset") => void) & ((evt: "expand", expanded: boolean) => void) & ((evt: "update:expanded", expanded: boolean) => void)) & (((event: "update:modelValue", value: Partial<InferInput<S>>) => void) & ((event: "update:expanded", value: boolean | undefined) => void));
|
|
34
|
+
}>) => import("vue").VNode & {
|
|
35
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
36
|
+
};
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
40
|
+
[K in keyof T]: T[K];
|
|
41
|
+
} : {
|
|
42
|
+
[K in keyof T as K]: T[K];
|
|
43
|
+
}) & {};
|