@vinicunca/taman-ui 0.2.0 → 0.2.1
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.
|
@@ -4,9 +4,9 @@ import { getFormFieldSchemas } from "./form-render/form-render.schema.mjs";
|
|
|
4
4
|
import { DEFAULT_FORM_COMMON_CONFIG, getFormComponentMap } from "./form.config.mjs";
|
|
5
5
|
import _sfc_main$2 from "./form-render/form-render-form.mjs";
|
|
6
6
|
import { provideComponentRefMap, provideFormProps, useFormInitial } from "./form.use-form-context.mjs";
|
|
7
|
-
import { createBlock, createCommentVNode, createSlots, defineComponent, mergeProps, nextTick, onMounted, openBlock, readonly, renderList, renderSlot, unref, watch, withCtx, withKeys } from "vue";
|
|
7
|
+
import { computed, createBlock, createCommentVNode, createSlots, defineComponent, mergeProps, nextTick, onMounted, openBlock, readonly, renderList, renderSlot, unref, watch, withCtx, withKeys } from "vue";
|
|
8
8
|
import { useDebounceFn } from "@vueuse/core";
|
|
9
|
-
import { get, isDeepEqual } from "@vinicunca/taman-core/utils";
|
|
9
|
+
import { get, isDeepEqual, pick } from "@vinicunca/taman-core/utils";
|
|
10
10
|
import { useForwardPriorityValues } from "@vinicunca/taman-core/composables";
|
|
11
11
|
// src/form/taman-use-form.vue
|
|
12
12
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
@@ -49,6 +49,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
49
49
|
if (!formApi) throw new Error("Form api is required in <TamanUseForm />");
|
|
50
50
|
const state = formApi.useStore();
|
|
51
51
|
const forward = useForwardPriorityValues(props, state);
|
|
52
|
+
const renderPropKeys = Object.keys(_sfc_main$2.props ?? {});
|
|
53
|
+
const renderProps = computed(() => pick(forward.value, renderPropKeys));
|
|
52
54
|
const formComponentMap = getFormComponentMap();
|
|
53
55
|
const componentRefMap = /* @__PURE__ */ new Map();
|
|
54
56
|
const { delegatedSlots, form } = useFormInitial(forward);
|
|
@@ -68,7 +70,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
68
70
|
}
|
|
69
71
|
const handleValuesChangeDebounced = useDebounceFn(async () => {
|
|
70
72
|
state?.value.submitOnChange && forward.value.formApi?.validateAndSubmit();
|
|
71
|
-
}, state?.value?.changeDebouncedTime ??
|
|
73
|
+
}, state?.value?.changeDebouncedTime ?? 0);
|
|
72
74
|
let valuesChangeReady = false;
|
|
73
75
|
onMounted(async () => {
|
|
74
76
|
await nextTick();
|
|
@@ -89,7 +91,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
89
91
|
if (submitOnChange) handleValuesChangeDebounced();
|
|
90
92
|
});
|
|
91
93
|
return (_ctx, _cache) => {
|
|
92
|
-
return openBlock(), createBlock(unref(_sfc_main$2), mergeProps(
|
|
94
|
+
return openBlock(), createBlock(unref(_sfc_main$2), mergeProps(renderProps.value, {
|
|
93
95
|
collapsed: unref(state)?.collapsed,
|
|
94
96
|
"component-map": unref(formComponentMap),
|
|
95
97
|
form: unref(form),
|
|
@@ -32,9 +32,9 @@ declare const __VLS_template: () => {
|
|
|
32
32
|
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
33
33
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
34
34
|
appendToMain: boolean;
|
|
35
|
-
closeIconPlacement: CloseIconPlacement;
|
|
36
35
|
destroyOnClose: boolean;
|
|
37
36
|
submitting: boolean;
|
|
37
|
+
closeIconPlacement: CloseIconPlacement;
|
|
38
38
|
drawerApi: ExtendedDrawerApi;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/package.json
CHANGED