3h1-ui 3.0.0-next.241 → 3.0.0-next.243
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/es/index.js
CHANGED
|
@@ -12614,20 +12614,37 @@ function useFormEvents({
|
|
|
12614
12614
|
return;
|
|
12615
12615
|
}
|
|
12616
12616
|
const schema = [];
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12620
|
-
|
|
12621
|
-
|
|
12617
|
+
function processSchemas(schemas, context = {}) {
|
|
12618
|
+
return schemas.map((schemaItem) => {
|
|
12619
|
+
const matched = updateData.find(
|
|
12620
|
+
(item) => item.field === schemaItem.field
|
|
12621
|
+
);
|
|
12622
|
+
let merged = matched ? deepMerge$2(schemaItem, matched) : schemaItem;
|
|
12623
|
+
const originalProps = merged.componentProps;
|
|
12624
|
+
if (typeof originalProps === "function") {
|
|
12625
|
+
const resultProps = originalProps(context);
|
|
12626
|
+
if (merged.component === "Group" && resultProps && Array.isArray(resultProps.schemas)) {
|
|
12627
|
+
const processedSchemas = processSchemas(
|
|
12628
|
+
resultProps.schemas,
|
|
12629
|
+
context
|
|
12630
|
+
);
|
|
12631
|
+
merged.componentProps = (ctx) => ({
|
|
12632
|
+
...originalProps(ctx),
|
|
12633
|
+
schemas: processedSchemas
|
|
12634
|
+
});
|
|
12635
|
+
}
|
|
12622
12636
|
}
|
|
12637
|
+
if (merged.componentProps && typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps.schemas)) {
|
|
12638
|
+
merged.componentProps.schemas = processSchemas(
|
|
12639
|
+
originalProps.schemas,
|
|
12640
|
+
context
|
|
12641
|
+
);
|
|
12642
|
+
}
|
|
12643
|
+
return merged;
|
|
12623
12644
|
});
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
} else {
|
|
12628
|
-
schema.push(val);
|
|
12629
|
-
}
|
|
12630
|
-
});
|
|
12645
|
+
}
|
|
12646
|
+
const rawSchemas = unref(getSchema);
|
|
12647
|
+
schema.push(...processSchemas(rawSchemas));
|
|
12631
12648
|
_setDefaultValue(schema);
|
|
12632
12649
|
schemaRef.value = uniqBy(schema, "field");
|
|
12633
12650
|
}
|
|
@@ -25866,28 +25883,27 @@ const ShyForm = /* @__PURE__ */ defineComponent({
|
|
|
25866
25883
|
for (const key2 in val) {
|
|
25867
25884
|
let handleSchemas = function(schemas = []) {
|
|
25868
25885
|
schemas.forEach((item) => {
|
|
25869
|
-
|
|
25870
|
-
|
|
25871
|
-
|
|
25872
|
-
|
|
25873
|
-
|
|
25874
|
-
|
|
25875
|
-
schema: item,
|
|
25876
|
-
formModel,
|
|
25877
|
-
formActionType,
|
|
25878
|
-
tableAction: props2.tableAction
|
|
25879
|
-
});
|
|
25880
|
-
if (modelProps.onModelChange) {
|
|
25881
|
-
modelProps.onModelChange(val[key2]);
|
|
25882
|
-
}
|
|
25886
|
+
const isTargetField = item.field === key2;
|
|
25887
|
+
context.schema = item;
|
|
25888
|
+
const rawComponentProps = item.componentProps;
|
|
25889
|
+
const resolvedProps = isFunction$5(rawComponentProps) ? rawComponentProps(context) : rawComponentProps;
|
|
25890
|
+
if (isTargetField && (resolvedProps == null ? void 0 : resolvedProps.onModelChange)) {
|
|
25891
|
+
resolvedProps.onModelChange(val[key2]);
|
|
25883
25892
|
}
|
|
25884
|
-
if (item.component === "Group" &&
|
|
25885
|
-
handleSchemas(
|
|
25893
|
+
if (item.component === "Group" && resolvedProps && Array.isArray(resolvedProps.schemas)) {
|
|
25894
|
+
handleSchemas(resolvedProps.schemas);
|
|
25886
25895
|
}
|
|
25887
25896
|
});
|
|
25888
25897
|
};
|
|
25889
25898
|
if (isEqual(toRaw(val[key2]), toRaw(tempFormModel[key2])))
|
|
25890
25899
|
continue;
|
|
25900
|
+
const context = {
|
|
25901
|
+
schema: {},
|
|
25902
|
+
// 每次赋值
|
|
25903
|
+
formModel,
|
|
25904
|
+
formActionType,
|
|
25905
|
+
tableAction: props2.tableAction
|
|
25906
|
+
};
|
|
25891
25907
|
handleSchemas(unref(getProps).schemas);
|
|
25892
25908
|
}
|
|
25893
25909
|
Object.assign(tempFormModel, cloneDeep(formModel));
|
package/es/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function useShyDescriptions(props?: Partial<
|
|
1
|
+
import type { DescriptionsProps, UseDescReturnType } from './typing';
|
|
2
|
+
export declare function useShyDescriptions(props?: Partial<DescriptionsProps>): UseDescReturnType;
|
package/lib/index.js
CHANGED
|
@@ -12638,20 +12638,37 @@ function useFormEvents({
|
|
|
12638
12638
|
return;
|
|
12639
12639
|
}
|
|
12640
12640
|
const schema = [];
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12641
|
+
function processSchemas(schemas, context = {}) {
|
|
12642
|
+
return schemas.map((schemaItem) => {
|
|
12643
|
+
const matched = updateData.find(
|
|
12644
|
+
(item) => item.field === schemaItem.field
|
|
12645
|
+
);
|
|
12646
|
+
let merged = matched ? utils$1.deepMerge(schemaItem, matched) : schemaItem;
|
|
12647
|
+
const originalProps = merged.componentProps;
|
|
12648
|
+
if (typeof originalProps === "function") {
|
|
12649
|
+
const resultProps = originalProps(context);
|
|
12650
|
+
if (merged.component === "Group" && resultProps && Array.isArray(resultProps.schemas)) {
|
|
12651
|
+
const processedSchemas = processSchemas(
|
|
12652
|
+
resultProps.schemas,
|
|
12653
|
+
context
|
|
12654
|
+
);
|
|
12655
|
+
merged.componentProps = (ctx) => ({
|
|
12656
|
+
...originalProps(ctx),
|
|
12657
|
+
schemas: processedSchemas
|
|
12658
|
+
});
|
|
12659
|
+
}
|
|
12646
12660
|
}
|
|
12661
|
+
if (merged.componentProps && typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps.schemas)) {
|
|
12662
|
+
merged.componentProps.schemas = processSchemas(
|
|
12663
|
+
originalProps.schemas,
|
|
12664
|
+
context
|
|
12665
|
+
);
|
|
12666
|
+
}
|
|
12667
|
+
return merged;
|
|
12647
12668
|
});
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
} else {
|
|
12652
|
-
schema.push(val);
|
|
12653
|
-
}
|
|
12654
|
-
});
|
|
12669
|
+
}
|
|
12670
|
+
const rawSchemas = vue.unref(getSchema);
|
|
12671
|
+
schema.push(...processSchemas(rawSchemas));
|
|
12655
12672
|
_setDefaultValue(schema);
|
|
12656
12673
|
schemaRef.value = uniqBy(schema, "field");
|
|
12657
12674
|
}
|
|
@@ -25890,28 +25907,27 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
|
|
|
25890
25907
|
for (const key2 in val) {
|
|
25891
25908
|
let handleSchemas = function(schemas = []) {
|
|
25892
25909
|
schemas.forEach((item) => {
|
|
25893
|
-
|
|
25894
|
-
|
|
25895
|
-
|
|
25896
|
-
|
|
25897
|
-
|
|
25898
|
-
|
|
25899
|
-
schema: item,
|
|
25900
|
-
formModel,
|
|
25901
|
-
formActionType,
|
|
25902
|
-
tableAction: props2.tableAction
|
|
25903
|
-
});
|
|
25904
|
-
if (modelProps.onModelChange) {
|
|
25905
|
-
modelProps.onModelChange(val[key2]);
|
|
25906
|
-
}
|
|
25910
|
+
const isTargetField = item.field === key2;
|
|
25911
|
+
context.schema = item;
|
|
25912
|
+
const rawComponentProps = item.componentProps;
|
|
25913
|
+
const resolvedProps = isFunction$5(rawComponentProps) ? rawComponentProps(context) : rawComponentProps;
|
|
25914
|
+
if (isTargetField && (resolvedProps == null ? void 0 : resolvedProps.onModelChange)) {
|
|
25915
|
+
resolvedProps.onModelChange(val[key2]);
|
|
25907
25916
|
}
|
|
25908
|
-
if (item.component === "Group" &&
|
|
25909
|
-
handleSchemas(
|
|
25917
|
+
if (item.component === "Group" && resolvedProps && Array.isArray(resolvedProps.schemas)) {
|
|
25918
|
+
handleSchemas(resolvedProps.schemas);
|
|
25910
25919
|
}
|
|
25911
25920
|
});
|
|
25912
25921
|
};
|
|
25913
25922
|
if (isEqual(vue.toRaw(val[key2]), vue.toRaw(tempFormModel[key2])))
|
|
25914
25923
|
continue;
|
|
25924
|
+
const context = {
|
|
25925
|
+
schema: {},
|
|
25926
|
+
// 每次赋值
|
|
25927
|
+
formModel,
|
|
25928
|
+
formActionType,
|
|
25929
|
+
tableAction: props2.tableAction
|
|
25930
|
+
};
|
|
25915
25931
|
handleSchemas(vue.unref(getProps).schemas);
|
|
25916
25932
|
}
|
|
25917
25933
|
Object.assign(tempFormModel, cloneDeep(formModel));
|
package/lib/style.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function useShyDescriptions(props?: Partial<
|
|
1
|
+
import type { DescriptionsProps, UseDescReturnType } from './typing';
|
|
2
|
+
export declare function useShyDescriptions(props?: Partial<DescriptionsProps>): UseDescReturnType;
|