@movk/nuxt 1.2.0 → 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 +74 -79
- package/dist/module.d.mts +57 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +120 -126
- package/dist/runtime/components/AutoForm.d.vue.ts +10 -30
- package/dist/runtime/components/AutoForm.vue +114 -125
- package/dist/runtime/components/AutoForm.vue.d.ts +10 -30
- package/dist/runtime/components/ColorChooser.d.vue.ts +21 -22
- package/dist/runtime/components/ColorChooser.vue +304 -27
- package/dist/runtime/components/ColorChooser.vue.d.ts +21 -22
- 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 +20 -33
- package/dist/runtime/components/DatePicker.vue +173 -65
- package/dist/runtime/components/DatePicker.vue.d.ts +20 -33
- 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 +21 -149
- package/dist/runtime/components/SearchForm.vue +211 -153
- package/dist/runtime/components/SearchForm.vue.d.ts +21 -149
- package/dist/runtime/components/SlideVerify.d.vue.ts +31 -70
- package/dist/runtime/components/SlideVerify.vue +117 -90
- package/dist/runtime/components/SlideVerify.vue.d.ts +31 -70
- package/dist/runtime/components/StarRating.d.vue.ts +38 -87
- package/dist/runtime/components/StarRating.vue +118 -74
- package/dist/runtime/components/StarRating.vue.d.ts +38 -87
- package/dist/runtime/components/input/AsPhoneNumberInput.d.vue.ts +11 -15
- package/dist/runtime/components/input/AsPhoneNumberInput.vue +22 -9
- package/dist/runtime/components/input/AsPhoneNumberInput.vue.d.ts +11 -15
- package/dist/runtime/components/input/WithCharacterLimit.d.vue.ts +11 -13
- package/dist/runtime/components/input/WithCharacterLimit.vue +23 -11
- package/dist/runtime/components/input/WithCharacterLimit.vue.d.ts +11 -13
- package/dist/runtime/components/input/WithClear.d.vue.ts +13 -11
- package/dist/runtime/components/input/WithClear.vue +27 -8
- package/dist/runtime/components/input/WithClear.vue.d.ts +13 -11
- package/dist/runtime/components/input/WithCopy.d.vue.ts +13 -13
- package/dist/runtime/components/input/WithCopy.vue +25 -8
- package/dist/runtime/components/input/WithCopy.vue.d.ts +13 -13
- package/dist/runtime/components/input/WithFloatingLabel.d.vue.ts +13 -16
- package/dist/runtime/components/input/WithFloatingLabel.vue +35 -27
- package/dist/runtime/components/input/WithFloatingLabel.vue.d.ts +13 -16
- package/dist/runtime/components/input/WithPasswordToggle.d.vue.ts +11 -7
- package/dist/runtime/components/input/WithPasswordToggle.vue +24 -7
- package/dist/runtime/components/input/WithPasswordToggle.vue.d.ts +11 -7
- package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePicker.vue +27 -12
- package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +8 -1
- package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +9 -4
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue +4 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +9 -4
- package/dist/runtime/composables/index.d.ts +9 -8
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useApiFetch.d.ts +10 -5
- package/dist/runtime/composables/useApiFetch.js +20 -2
- package/dist/runtime/composables/useAutoForm.d.ts +4 -4
- package/dist/runtime/composables/useAutoForm.js +23 -9
- package/dist/runtime/composables/useClientApiFetch.d.ts +3 -2
- 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 +142 -40
- package/dist/runtime/composables/useLazyApiFetch.d.ts +3 -2
- package/dist/runtime/composables/useMessageBox.d.ts +6 -0
- package/dist/runtime/composables/useMessageBox.js +16 -0
- package/dist/runtime/composables/useTheme.d.ts +26 -16
- package/dist/runtime/composables/useTheme.js +98 -71
- package/dist/runtime/composables/useUploadWithProgress.d.ts +23 -29
- package/dist/runtime/composables/useUploadWithProgress.js +78 -67
- 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} +25 -29
- 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/{components/auto-form-renderer/AutoFormRendererChildren.vue → domains/auto-form/components/Children.vue} +18 -18
- 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/{components/auto-form-renderer/AutoFormRendererLayout.vue → domains/auto-form/components/Layout.vue} +24 -25
- 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/{components/auto-form-renderer/AutoFormRendererNested.vue → domains/auto-form/components/Nested.vue} +17 -21
- package/dist/runtime/domains/auto-form/components/Nested.vue.d.ts +11 -0
- package/dist/runtime/domains/auto-form/controls.d.ts +41 -0
- package/dist/runtime/{auto-form → domains/auto-form}/controls.js +27 -24
- package/dist/runtime/{auto-form/field-utils.d.ts → domains/auto-form/fields.d.ts} +3 -1
- package/dist/runtime/{auto-form/field-utils.js → domains/auto-form/fields.js} +18 -2
- package/dist/runtime/{auto-form → domains/auto-form}/metadata.js +1 -1
- package/dist/runtime/domains/auto-form/provider.d.ts +62 -0
- package/dist/runtime/{auto-form → domains/auto-form}/provider.js +6 -3
- package/dist/runtime/{auto-form/reactive-utils.d.ts → domains/auto-form/reactive.d.ts} +5 -5
- package/dist/runtime/{auto-form/reactive-utils.js → domains/auto-form/reactive.js} +1 -1
- package/dist/runtime/{auto-form/schema-introspector.d.ts → domains/auto-form/schema.d.ts} +2 -2
- package/dist/runtime/{auto-form/schema-introspector.js → domains/auto-form/schema.js} +1 -1
- 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 +17 -117
- package/dist/runtime/plugins/theme.js +49 -27
- 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/response.js +0 -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 +11 -10
- 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 +2 -5
- package/dist/runtime/utils/meta.js +1 -3
- 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 +75 -36
- package/vue-plugin.d.ts +5 -0
- package/dist/runtime/auto-form/controls.d.ts +0 -221
- package/dist/runtime/auto-form/provider.d.ts +0 -27
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.d.vue.ts +0 -28
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue.d.ts +0 -28
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererChildren.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue +0 -55
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererField.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererLayout.vue.d.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.d.vue.ts +0 -26
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererNested.vue.d.ts +0 -26
- package/dist/runtime/constants/api-defaults.d.ts +0 -9
- package/dist/runtime/constants/api-defaults.js +0 -32
- package/dist/runtime/constants/grid-cols.d.ts +0 -7
- package/dist/runtime/constants/grid-cols.js +0 -44
- package/dist/runtime/style.css +0 -1
- package/dist/runtime/types/api.d.ts +0 -349
- package/dist/runtime/types/auto-form.d.ts +0 -259
- package/dist/runtime/types/module.d.ts +0 -96
- package/dist/runtime/types/theme.d.ts +0 -2
- package/dist/runtime/utils/api-utils.d.ts +0 -58
- package/dist/runtime/utils/api-utils.js +0 -98
- /package/dist/runtime/{constants/auto-form.d.ts → domains/auto-form/constants.d.ts} +0 -0
- /package/dist/runtime/{constants/auto-form.js → domains/auto-form/constants.js} +0 -0
- /package/dist/runtime/{auto-form → domains/auto-form}/metadata.d.ts +0 -0
- /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.js → api/fetch.js} +0 -0
- /package/dist/runtime/types/{module.js → api/index.js} +0 -0
- /package/dist/runtime/types/{theme.js → api/module.js} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { ClassNameValue } from '../types';
|
|
3
|
+
type SlotsLike = {
|
|
4
|
+
slots: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
type MergeParams = {
|
|
7
|
+
ui?: Record<string, ClassNameValue>;
|
|
8
|
+
variants?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
type BaseKeys<P extends SlotsLike> = string & keyof P['slots'];
|
|
11
|
+
type ExtraKeys<P extends SlotsLike, M extends SlotsLike> = string & Exclude<keyof M['slots'], keyof P['slots']>;
|
|
12
|
+
type AllKeys<P extends SlotsLike, M extends SlotsLike> = string & (keyof P['slots'] | keyof M['slots']);
|
|
13
|
+
interface ExtendedTv<P extends SlotsLike, M extends SlotsLike> {
|
|
14
|
+
extendUi: ComputedRef<Record<AllKeys<P, M>, string>>;
|
|
15
|
+
baseUi: ComputedRef<Record<BaseKeys<P>, string>>;
|
|
16
|
+
extraUi: ComputedRef<Record<ExtraKeys<P, M>, string>>;
|
|
17
|
+
}
|
|
18
|
+
export declare function useExtendedTv<P extends SlotsLike, M extends SlotsLike>(parentTheme: P, movkTheme: M, getOverride?: () => unknown, getParams?: () => MergeParams): ExtendedTv<P, M>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { tv } from "./tv.js";
|
|
3
|
+
export function useExtendedTv(parentTheme, movkTheme, getOverride = () => ({}), getParams = () => ({})) {
|
|
4
|
+
const parentSlotKeys = new Set(Object.keys(parentTheme.slots));
|
|
5
|
+
const emptySlots = Object.fromEntries(
|
|
6
|
+
Object.keys(parentTheme.slots).map((key) => [key, ""])
|
|
7
|
+
);
|
|
8
|
+
const extendUi = computed(() => {
|
|
9
|
+
const ov = getOverride() ?? {};
|
|
10
|
+
const { ui: uiOverride, variants } = getParams();
|
|
11
|
+
const tvFn = tv({
|
|
12
|
+
slots: { ...emptySlots, ...ov.slots },
|
|
13
|
+
...ov.variants ? { variants: ov.variants } : {},
|
|
14
|
+
...ov.compoundVariants ? { compoundVariants: ov.compoundVariants } : {},
|
|
15
|
+
...ov.defaultVariants ? { defaultVariants: ov.defaultVariants } : {},
|
|
16
|
+
extend: tv(movkTheme)
|
|
17
|
+
});
|
|
18
|
+
const cls = tvFn(variants);
|
|
19
|
+
const slotKeys = new Set(Object.keys(cls));
|
|
20
|
+
const result = Object.fromEntries(
|
|
21
|
+
Object.entries(uiOverride ?? {}).filter(
|
|
22
|
+
([key]) => !slotKeys.has(key)
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
for (const key of slotKeys) {
|
|
26
|
+
const slotFn = cls[key];
|
|
27
|
+
if (!slotFn) continue;
|
|
28
|
+
const merged = slotFn({ class: uiOverride?.[key] || void 0 });
|
|
29
|
+
if (merged) result[key] = merged;
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
33
|
+
const baseUi = computed(
|
|
34
|
+
() => Object.fromEntries(
|
|
35
|
+
Object.entries(extendUi.value).filter(([k]) => parentSlotKeys.has(k))
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
const extraUi = computed(
|
|
39
|
+
() => Object.fromEntries(
|
|
40
|
+
Object.entries(extendUi.value).filter(([k]) => !parentSlotKeys.has(k))
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
return { extendUi, baseUi, extraUi };
|
|
44
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare function omitProps<T extends object, K extends keyof T>(props: T, keys: readonly K[]): Omit<T, K>;
|
|
2
|
+
export declare function useForwardedProps<T extends object, K extends keyof T>(props: T, keys: readonly K[]): import("vue").ComputedRef<Omit<T, K>>;
|
|
3
|
+
type SizeProps = {
|
|
4
|
+
size?: unknown;
|
|
5
|
+
};
|
|
6
|
+
export declare function useFormFieldBridge<S = unknown, T extends SizeProps = SizeProps>(props?: T): {
|
|
7
|
+
size: import("vue").ComputedRef<S | undefined>;
|
|
8
|
+
emitFormInput: () => void;
|
|
9
|
+
emitFormBlur: () => void;
|
|
10
|
+
emitFormChange: () => void;
|
|
11
|
+
emitFormFocus: () => void;
|
|
12
|
+
};
|
|
13
|
+
type FieldControlProps = {
|
|
14
|
+
size?: unknown;
|
|
15
|
+
color?: unknown;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function useFieldControl<T extends FieldControlProps>(props: T): {
|
|
19
|
+
size: import("vue").ComputedRef<NonNullable<T["size"]> | undefined>;
|
|
20
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
21
|
+
color: import("vue").ComputedRef<"error" | NonNullable<T["color"]> | undefined>;
|
|
22
|
+
fieldGroupSize: import("vue").ComputedRef<"xs" | "sm" | "md" | "lg" | "xl" | NonNullable<import("@nuxt/ui").GetObjectField<T, "size">> | undefined>;
|
|
23
|
+
fieldGroupOrientation: import("vue").ComputedRef<"horizontal" | "vertical" | undefined>;
|
|
24
|
+
id: import("vue").ComputedRef<string | undefined>;
|
|
25
|
+
name: import("vue").ComputedRef<string | undefined>;
|
|
26
|
+
highlight: import("vue").ComputedRef<boolean | undefined>;
|
|
27
|
+
emitFormBlur: () => void;
|
|
28
|
+
emitFormInput: import("@vueuse/core").UseDebounceFnReturn<() => void>;
|
|
29
|
+
emitFormChange: () => void;
|
|
30
|
+
emitFormFocus: () => void;
|
|
31
|
+
ariaAttrs: import("vue").ComputedRef<Record<string, any> | undefined>;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { computed, inject } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
formBusInjectionKey,
|
|
4
|
+
formFieldInjectionKey,
|
|
5
|
+
useFormField
|
|
6
|
+
} from "@nuxt/ui/composables/useFormField";
|
|
7
|
+
import { fieldGroupInjectionKey, useFieldGroup } from "@nuxt/ui/composables/useFieldGroup";
|
|
8
|
+
export function omitProps(props, keys) {
|
|
9
|
+
const omitted = new Set(keys);
|
|
10
|
+
return Object.fromEntries(
|
|
11
|
+
Object.entries(props).filter(([key, value]) => !omitted.has(key) && value !== void 0)
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
export function useForwardedProps(props, keys) {
|
|
15
|
+
return computed(() => omitProps(props, keys));
|
|
16
|
+
}
|
|
17
|
+
export function useFormFieldBridge(props) {
|
|
18
|
+
const formBus = inject(formBusInjectionKey, void 0);
|
|
19
|
+
const formField = inject(formFieldInjectionKey, void 0);
|
|
20
|
+
const fieldGroup = inject(fieldGroupInjectionKey, void 0);
|
|
21
|
+
function emitFormEvent(type) {
|
|
22
|
+
const field = formField?.value;
|
|
23
|
+
if (!formBus || !field?.name) return;
|
|
24
|
+
formBus.emit({
|
|
25
|
+
type,
|
|
26
|
+
name: field.name,
|
|
27
|
+
...type === "input" ? { eager: field.eagerValidation } : {}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
size: computed(
|
|
32
|
+
() => props?.size ?? fieldGroup?.value.size ?? formField?.value.size
|
|
33
|
+
),
|
|
34
|
+
emitFormInput: () => emitFormEvent("input"),
|
|
35
|
+
emitFormBlur: () => emitFormEvent("blur"),
|
|
36
|
+
emitFormChange: () => emitFormEvent("change"),
|
|
37
|
+
emitFormFocus: () => emitFormEvent("focus")
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function useFieldControl(props) {
|
|
41
|
+
const formField = useFormField(props);
|
|
42
|
+
const fieldGroup = useFieldGroup(props);
|
|
43
|
+
const size = computed(() => fieldGroup.size.value || formField.size.value);
|
|
44
|
+
const disabled = computed(() => formField.disabled.value ?? props.disabled ?? false);
|
|
45
|
+
const color = computed(() => formField.color.value ?? props.color);
|
|
46
|
+
return {
|
|
47
|
+
...formField,
|
|
48
|
+
size,
|
|
49
|
+
disabled,
|
|
50
|
+
color,
|
|
51
|
+
fieldGroupSize: fieldGroup.size,
|
|
52
|
+
fieldGroupOrientation: fieldGroup.orientation
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Direction } from '@nuxt/ui';
|
|
2
|
+
import type { ModuleOptions } from '../../module';
|
|
3
|
+
/**
|
|
4
|
+
* movk 主题默认 app.config(Nuxt 模式 addTheme 与 Vue 模式 unplugin 共用)。
|
|
5
|
+
* 放在 runtime 内,避免 runtime 反向依赖构建期 `src/utils`(dist 运行时无法解析)。
|
|
6
|
+
*/
|
|
7
|
+
export declare function getDefaultConfig(theme?: ModuleOptions['theme']): {
|
|
8
|
+
dir: Direction;
|
|
9
|
+
radius: number;
|
|
10
|
+
blackAsPrimary: boolean;
|
|
11
|
+
font: string;
|
|
12
|
+
icons: string;
|
|
13
|
+
prefix: string | undefined;
|
|
14
|
+
tv: {
|
|
15
|
+
twMergeConfig: {
|
|
16
|
+
prefix: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
picker: {
|
|
20
|
+
fonts: {
|
|
21
|
+
name: string;
|
|
22
|
+
href?: string;
|
|
23
|
+
}[];
|
|
24
|
+
radiuses: number[];
|
|
25
|
+
neutralColors: string[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function getDefaultConfig(theme) {
|
|
2
|
+
const pickerFonts = theme?.fonts ?? [
|
|
3
|
+
{ name: "Alibaba PuHuiTi", href: "https://cdn.mhaibaraai.cn/fonts/alibaba-puhuiti.css" },
|
|
4
|
+
{ name: "Public Sans" },
|
|
5
|
+
{ name: "DM Sans" },
|
|
6
|
+
{ name: "Geist" },
|
|
7
|
+
{ name: "Inter" },
|
|
8
|
+
{ name: "Poppins" },
|
|
9
|
+
{ name: "Outfit" },
|
|
10
|
+
{ name: "Raleway" }
|
|
11
|
+
];
|
|
12
|
+
const pickerRadiuses = theme?.radiuses ?? [0, 0.125, 0.25, 0.375, 0.5];
|
|
13
|
+
const pickerNeutralColors = theme?.neutralColors ?? ["slate", "gray", "zinc", "neutral", "stone", "taupe", "mauve", "mist", "olive"];
|
|
14
|
+
return {
|
|
15
|
+
dir: "ltr",
|
|
16
|
+
radius: 0.25,
|
|
17
|
+
blackAsPrimary: false,
|
|
18
|
+
font: "Alibaba PuHuiTi",
|
|
19
|
+
icons: "lucide",
|
|
20
|
+
prefix: theme?.prefix,
|
|
21
|
+
tv: {
|
|
22
|
+
twMergeConfig: {
|
|
23
|
+
prefix: theme?.prefix
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
picker: { fonts: pickerFonts, radiuses: pickerRadiuses, neutralColors: pickerNeutralColors }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tv: import("tailwind-variants").TV;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface SiteConfigStub {
|
|
2
|
+
url: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultLocale: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Vue 模式下 `nuxt-site-config` 的 useSiteConfig 桩。
|
|
9
|
+
* name 经 unplugin 的 options.site 注入 app.config(movkSite),默认非空以避免
|
|
10
|
+
* useTheme/theme 插件的 localStorage key 前缀退化。
|
|
11
|
+
*/
|
|
12
|
+
export declare function useSiteConfig(): SiteConfigStub;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineNuxtPlugin, useAppConfig, useSiteConfig } from "#imports";
|
|
2
|
+
import { kebabCase } from "@movk/core";
|
|
3
|
+
import { themeIcons } from "../../domains/theme/theme-icons.js";
|
|
4
|
+
export default defineNuxtPlugin(() => {
|
|
5
|
+
const appConfig = useAppConfig();
|
|
6
|
+
const site = useSiteConfig();
|
|
7
|
+
const name = kebabCase(site.name);
|
|
8
|
+
const primary = localStorage.getItem(`${name}-ui-primary`);
|
|
9
|
+
if (primary) appConfig.ui.colors.primary = primary;
|
|
10
|
+
const neutral = localStorage.getItem(`${name}-ui-neutral`);
|
|
11
|
+
if (neutral) appConfig.ui.colors.neutral = neutral;
|
|
12
|
+
const icons = localStorage.getItem(`${name}-ui-icons`);
|
|
13
|
+
if (icons) appConfig.ui.icons = themeIcons[icons];
|
|
14
|
+
});
|