knt-shared 1.10.1 → 1.10.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/components/Form/useForm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAC;AAEzF;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,OAAO,GAAE,cAAmB,GAC3B,CAAC,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../src/components/Form/useForm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,SAAS,CAAC;AAEzF;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,OAAO,GAAE,cAAmB,GAC3B,CAAC,CAAC,YAAY,EAAE,GAAG,KAAK,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAwXhE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAKpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,EAAE,GAAG,UAAU,EAAE,CAEzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../src/components/Table/useTable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAA0C,MAAM,SAAS,CAAC;AAGpH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG;IACvD,CAAC,aAAa,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,GAAG,KAAK,IAAI;IAChD,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;CACjC,
|
|
1
|
+
{"version":3,"file":"useTable.d.ts","sourceRoot":"","sources":["../../../src/components/Table/useTable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAA0C,MAAM,SAAS,CAAC;AAGpH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG;IACvD,CAAC,aAAa,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,GAAG,KAAK,IAAI;IAChD,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;CACjC,CA+iBA;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE,CAKxE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,WAAW,EAAE,EAAE,GAAG,WAAW,EAAE,CAE5E"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -5544,6 +5544,7 @@ function useForm(options = {}) {
|
|
|
5544
5544
|
});
|
|
5545
5545
|
};
|
|
5546
5546
|
const register = async (formInstance) => {
|
|
5547
|
+
var _a;
|
|
5547
5548
|
await vue.nextTick();
|
|
5548
5549
|
if (unwatchFormRef) {
|
|
5549
5550
|
unwatchFormRef();
|
|
@@ -5551,8 +5552,9 @@ function useForm(options = {}) {
|
|
|
5551
5552
|
}
|
|
5552
5553
|
formRef.value = formInstance;
|
|
5553
5554
|
loadedRef.value = true;
|
|
5554
|
-
|
|
5555
|
-
|
|
5555
|
+
const mergedProps = { ...options, ...propsRef.value };
|
|
5556
|
+
if (Object.keys(mergedProps).length > 0) {
|
|
5557
|
+
await setProps(mergedProps);
|
|
5556
5558
|
}
|
|
5557
5559
|
initFormModel();
|
|
5558
5560
|
if (formInstance.formRef) {
|
|
@@ -5573,8 +5575,12 @@ function useForm(options = {}) {
|
|
|
5573
5575
|
);
|
|
5574
5576
|
}
|
|
5575
5577
|
if (pendingValues.value) {
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
+
const registeredSchemas = (_a = formInstance.getSchema) == null ? void 0 : _a.call(formInstance);
|
|
5579
|
+
if (Array.isArray(registeredSchemas) && registeredSchemas.length > 0) {
|
|
5580
|
+
const pending = pendingValues.value;
|
|
5581
|
+
pendingValues.value = null;
|
|
5582
|
+
await setFieldsValue(pending);
|
|
5583
|
+
}
|
|
5578
5584
|
}
|
|
5579
5585
|
};
|
|
5580
5586
|
const getForm = () => {
|
|
@@ -5606,11 +5612,18 @@ function useForm(options = {}) {
|
|
|
5606
5612
|
return { ...formModel };
|
|
5607
5613
|
};
|
|
5608
5614
|
const setFieldsValue = async (values) => {
|
|
5615
|
+
var _a;
|
|
5609
5616
|
const form = getFormSafe();
|
|
5610
5617
|
if (!form) {
|
|
5611
5618
|
pendingValues.value = { ...pendingValues.value, ...values };
|
|
5612
5619
|
return;
|
|
5613
5620
|
}
|
|
5621
|
+
const currentSchemas = (_a = form.getSchema) == null ? void 0 : _a.call(form);
|
|
5622
|
+
const hasSchemas = Array.isArray(currentSchemas) && currentSchemas.length > 0;
|
|
5623
|
+
if (!hasSchemas) {
|
|
5624
|
+
pendingValues.value = { ...pendingValues.value, ...values };
|
|
5625
|
+
return;
|
|
5626
|
+
}
|
|
5614
5627
|
if (form.setFieldsValue) {
|
|
5615
5628
|
await form.setFieldsValue(values);
|
|
5616
5629
|
} else {
|
|
@@ -5738,6 +5751,11 @@ function useForm(options = {}) {
|
|
|
5738
5751
|
if (form.setProps) {
|
|
5739
5752
|
await form.setProps(formProps);
|
|
5740
5753
|
}
|
|
5754
|
+
if (formProps.schemas && pendingValues.value) {
|
|
5755
|
+
const pending = pendingValues.value;
|
|
5756
|
+
pendingValues.value = null;
|
|
5757
|
+
await setFieldsValue(pending);
|
|
5758
|
+
}
|
|
5741
5759
|
};
|
|
5742
5760
|
const scrollToField = async (name, options2) => {
|
|
5743
5761
|
const form = getFormSafe();
|
|
@@ -8340,8 +8358,9 @@ function useTable(options = {}) {
|
|
|
8340
8358
|
tableRef.value = tableInstance;
|
|
8341
8359
|
formRef.value = formInstance;
|
|
8342
8360
|
loadedRef.value = true;
|
|
8343
|
-
|
|
8344
|
-
|
|
8361
|
+
const mergedProps = { ...options, ...propsRef.value };
|
|
8362
|
+
if (Object.keys(mergedProps).length > 0) {
|
|
8363
|
+
await setProps(mergedProps);
|
|
8345
8364
|
}
|
|
8346
8365
|
if (options.immediate) {
|
|
8347
8366
|
if (options.api) {
|