3h1-ui 3.0.0-next.243 → 3.0.0-next.245

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
@@ -11737,7 +11737,7 @@ const FormItem$2 = /* @__PURE__ */ defineComponent({
11737
11737
  schema: schema2,
11738
11738
  tableAction: tableAction2,
11739
11739
  formModel,
11740
- formActionType
11740
+ formActionType: formActionType2
11741
11741
  } = props2;
11742
11742
  let {
11743
11743
  componentProps = {}
@@ -11747,7 +11747,7 @@ const FormItem$2 = /* @__PURE__ */ defineComponent({
11747
11747
  schema: schema2,
11748
11748
  tableAction: tableAction2,
11749
11749
  formModel,
11750
- formActionType
11750
+ formActionType: formActionType2
11751
11751
  }) ?? {};
11752
11752
  }
11753
11753
  if (schema2.component === "Divider") {
@@ -12410,6 +12410,7 @@ function useFormValues({
12410
12410
  }
12411
12411
  return { handleFormValues, initDefault };
12412
12412
  }
12413
+ const formActionType = inject("formActionType");
12413
12414
  function useFormEvents({
12414
12415
  emit,
12415
12416
  getProps,
@@ -12418,7 +12419,8 @@ function useFormEvents({
12418
12419
  defaultValueRef,
12419
12420
  formElRef,
12420
12421
  schemaRef,
12421
- handleFormValues
12422
+ handleFormValues,
12423
+ tableAction: tableAction2
12422
12424
  }) {
12423
12425
  async function resetFields() {
12424
12426
  const { resetFunc, submitOnReset } = unref(getProps);
@@ -12619,32 +12621,38 @@ function useFormEvents({
12619
12621
  const matched = updateData.find(
12620
12622
  (item) => item.field === schemaItem.field
12621
12623
  );
12622
- let merged = matched ? deepMerge$2(schemaItem, matched) : schemaItem;
12623
- const originalProps = merged.componentProps;
12624
- if (typeof originalProps === "function") {
12624
+ const merged = matched ? deepMerge$2(schemaItem, matched) : { ...schemaItem };
12625
+ let originalProps = merged.componentProps;
12626
+ if (typeof originalProps === "function" && merged.component === "Group") {
12625
12627
  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
- });
12628
+ if (Array.isArray(resultProps == null ? void 0 : resultProps.schemas)) {
12629
+ processSchemas(resultProps.schemas, context);
12630
+ merged.componentProps = (ctx) => {
12631
+ const finalProps = originalProps(ctx);
12632
+ return {
12633
+ ...finalProps,
12634
+ schemas: processSchemas(finalProps.schemas || [], ctx)
12635
+ };
12636
+ };
12635
12637
  }
12636
12638
  }
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
- );
12639
+ if (typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps == null ? void 0 : originalProps.schemas)) {
12640
+ merged.componentProps = {
12641
+ ...originalProps,
12642
+ schemas: processSchemas(originalProps.schemas, context)
12643
+ };
12642
12644
  }
12643
12645
  return merged;
12644
12646
  });
12645
12647
  }
12646
12648
  const rawSchemas = unref(getSchema);
12647
- schema.push(...processSchemas(rawSchemas));
12649
+ schema.push(
12650
+ ...processSchemas(rawSchemas, {
12651
+ formModel,
12652
+ formActionType,
12653
+ tableAction: tableAction2
12654
+ })
12655
+ );
12648
12656
  _setDefaultValue(schema);
12649
12657
  schemaRef.value = uniqBy(schema, "field");
12650
12658
  }
@@ -25843,7 +25851,8 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25843
25851
  formElRef,
25844
25852
  //@ts-ignore
25845
25853
  schemaRef,
25846
- handleFormValues
25854
+ handleFormValues,
25855
+ tableAction: props2.tableAction
25847
25856
  });
25848
25857
  createFormContext({
25849
25858
  resetAction: resetFields,
@@ -25901,7 +25910,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25901
25910
  schema: {},
25902
25911
  // 每次赋值
25903
25912
  formModel,
25904
- formActionType,
25913
+ formActionType: formActionType2,
25905
25914
  tableAction: props2.tableAction
25906
25915
  };
25907
25916
  handleSchemas(unref(getProps).schemas);
@@ -25940,7 +25949,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25940
25949
  ;
25941
25950
  }
25942
25951
  }
25943
- const formActionType = {
25952
+ const formActionType2 = {
25944
25953
  getFieldsValue,
25945
25954
  setFieldsValue,
25946
25955
  resetFields,
@@ -25955,7 +25964,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25955
25964
  validate,
25956
25965
  scrollToField
25957
25966
  };
25958
- provide("formActionType", formActionType);
25967
+ provide("formActionType", formActionType2);
25959
25968
  const isTableForm = computed(() => {
25960
25969
  return !!unref(getBindValue).tableAction;
25961
25970
  });
@@ -26045,7 +26054,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
26045
26054
  };
26046
26055
  onMounted(() => {
26047
26056
  initDefault();
26048
- emit("register", formActionType);
26057
+ emit("register", formActionType2);
26049
26058
  });
26050
26059
  return () => {
26051
26060
  const ignoreKeys = ["resetBefore", "submitBefore", "advanceBefore", "advanceAfter", "advancedSearch"];
@@ -26083,7 +26092,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
26083
26092
  const realSpan = (((_a2 = schema.colProps) == null ? void 0 : _a2.span) ?? ((_c = (_b = unref(getBindValue)) == null ? void 0 : _b.baseColProps) == null ? void 0 : _c.span)) / (unref(ROW_SLICE2) + unref(ACTION_COL2));
26084
26093
  return createVNode(FormItem$2, {
26085
26094
  "tableAction": props2.tableAction,
26086
- "formActionType": formActionType,
26095
+ "formActionType": formActionType2,
26087
26096
  "schema": schema,
26088
26097
  "formProps": getProps.value,
26089
26098
  "allDefaultValues": defaultValueRef.value,
@@ -28263,7 +28272,7 @@ const EQUAL_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28263
28272
  const CONTAIN_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28264
28273
  (item) => ["ct"].includes(item.value)
28265
28274
  );
28266
- const useAdvancedSearch = (schemas, formActionType) => {
28275
+ const useAdvancedSearch = (schemas, formActionType2) => {
28267
28276
  const getSchemaOptions = (type4) => {
28268
28277
  switch (type4) {
28269
28278
  case "number":
@@ -28351,7 +28360,7 @@ const useAdvancedSearch = (schemas, formActionType) => {
28351
28360
  removeSchemaByField,
28352
28361
  updateSchema,
28353
28362
  setFieldsValue
28354
- } = formActionType;
28363
+ } = formActionType2;
28355
28364
  const {
28356
28365
  schemas: [operatorSchema, valueSchema]
28357
28366
  } = componentProps;
@@ -32079,7 +32088,7 @@ const ShyFormTable = /* @__PURE__ */ defineComponent({
32079
32088
  const {
32080
32089
  prefixCls: prefixCls2
32081
32090
  } = useDesign$1("ant-form-table-children");
32082
- const formActionType = inject("formActionType");
32091
+ const formActionType2 = inject("formActionType");
32083
32092
  const tableWrapperRef = ref();
32084
32093
  const tableElRef = ref();
32085
32094
  const curIndex = ref(0);
@@ -32405,7 +32414,7 @@ const ShyFormTable = /* @__PURE__ */ defineComponent({
32405
32414
  column: column2,
32406
32415
  record,
32407
32416
  ...args
32408
- }, formActionType);
32417
+ }, formActionType2);
32409
32418
  } catch (error2) {
32410
32419
  rulesRef[errKey].show = true;
32411
32420
  rulesRef[errKey].msg = error2;
@@ -35743,7 +35752,7 @@ const Group = /* @__PURE__ */ defineComponent({
35743
35752
  schema,
35744
35753
  tableAction: tableAction2,
35745
35754
  formModel,
35746
- formActionType
35755
+ formActionType: formActionType2
35747
35756
  } = props2;
35748
35757
  let {
35749
35758
  componentProps: _componentProps,
@@ -35755,7 +35764,7 @@ const Group = /* @__PURE__ */ defineComponent({
35755
35764
  schema,
35756
35765
  tableAction: tableAction2,
35757
35766
  formModel,
35758
- formActionType
35767
+ formActionType: formActionType2
35759
35768
  }) ?? {};
35760
35769
  }
35761
35770
  const realSpan = (((_a2 = schema.colProps) == null ? void 0 : _a2.span) ?? ((_c = (_b = unref(contextBindValue)) == null ? void 0 : _b.baseColProps) == null ? void 0 : _c.span)) / (unref(ROW_SLICE) + unref(ACTION_COL));
@@ -35906,7 +35915,7 @@ const FormItem = /* @__PURE__ */ defineComponent({
35906
35915
  const {
35907
35916
  schema,
35908
35917
  formModel,
35909
- formActionType
35918
+ formActionType: formActionType2
35910
35919
  } = props2;
35911
35920
  let {
35912
35921
  componentProps = {}
@@ -35915,7 +35924,7 @@ const FormItem = /* @__PURE__ */ defineComponent({
35915
35924
  componentProps = componentProps({
35916
35925
  schema,
35917
35926
  formModel,
35918
- formActionType
35927
+ formActionType: formActionType2
35919
35928
  }) ?? {};
35920
35929
  }
35921
35930
  if (schema.component === "Divider") {
@@ -10,8 +10,9 @@ interface UseFormActionContext {
10
10
  formElRef: Ref<FormActionType>;
11
11
  schemaRef: Ref<FormSchema[]>;
12
12
  handleFormValues: Fn;
13
+ tableAction?: any;
13
14
  }
14
- export declare function useFormEvents({ emit, getProps, formModel, getSchema, defaultValueRef, formElRef, schemaRef, handleFormValues }: UseFormActionContext): {
15
+ export declare function useFormEvents({ emit, getProps, formModel, getSchema, defaultValueRef, formElRef, schemaRef, handleFormValues, tableAction }: UseFormActionContext): {
15
16
  handleSubmit: (e?: Event) => Promise<void>;
16
17
  clearValidate: (name?: string | string[]) => Promise<void>;
17
18
  validate: (nameList?: NamePath[] | undefined) => Promise<any>;
package/lib/index.js CHANGED
@@ -11761,7 +11761,7 @@ const FormItem$2 = /* @__PURE__ */ vue.defineComponent({
11761
11761
  schema: schema2,
11762
11762
  tableAction: tableAction2,
11763
11763
  formModel,
11764
- formActionType
11764
+ formActionType: formActionType2
11765
11765
  } = props2;
11766
11766
  let {
11767
11767
  componentProps = {}
@@ -11771,7 +11771,7 @@ const FormItem$2 = /* @__PURE__ */ vue.defineComponent({
11771
11771
  schema: schema2,
11772
11772
  tableAction: tableAction2,
11773
11773
  formModel,
11774
- formActionType
11774
+ formActionType: formActionType2
11775
11775
  }) ?? {};
11776
11776
  }
11777
11777
  if (schema2.component === "Divider") {
@@ -12434,6 +12434,7 @@ function useFormValues({
12434
12434
  }
12435
12435
  return { handleFormValues, initDefault };
12436
12436
  }
12437
+ const formActionType = vue.inject("formActionType");
12437
12438
  function useFormEvents({
12438
12439
  emit,
12439
12440
  getProps,
@@ -12442,7 +12443,8 @@ function useFormEvents({
12442
12443
  defaultValueRef,
12443
12444
  formElRef,
12444
12445
  schemaRef,
12445
- handleFormValues
12446
+ handleFormValues,
12447
+ tableAction: tableAction2
12446
12448
  }) {
12447
12449
  async function resetFields() {
12448
12450
  const { resetFunc, submitOnReset } = vue.unref(getProps);
@@ -12643,32 +12645,38 @@ function useFormEvents({
12643
12645
  const matched = updateData.find(
12644
12646
  (item) => item.field === schemaItem.field
12645
12647
  );
12646
- let merged = matched ? utils$1.deepMerge(schemaItem, matched) : schemaItem;
12647
- const originalProps = merged.componentProps;
12648
- if (typeof originalProps === "function") {
12648
+ const merged = matched ? utils$1.deepMerge(schemaItem, matched) : { ...schemaItem };
12649
+ let originalProps = merged.componentProps;
12650
+ if (typeof originalProps === "function" && merged.component === "Group") {
12649
12651
  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
- });
12652
+ if (Array.isArray(resultProps == null ? void 0 : resultProps.schemas)) {
12653
+ processSchemas(resultProps.schemas, context);
12654
+ merged.componentProps = (ctx) => {
12655
+ const finalProps = originalProps(ctx);
12656
+ return {
12657
+ ...finalProps,
12658
+ schemas: processSchemas(finalProps.schemas || [], ctx)
12659
+ };
12660
+ };
12659
12661
  }
12660
12662
  }
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
- );
12663
+ if (typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps == null ? void 0 : originalProps.schemas)) {
12664
+ merged.componentProps = {
12665
+ ...originalProps,
12666
+ schemas: processSchemas(originalProps.schemas, context)
12667
+ };
12666
12668
  }
12667
12669
  return merged;
12668
12670
  });
12669
12671
  }
12670
12672
  const rawSchemas = vue.unref(getSchema);
12671
- schema.push(...processSchemas(rawSchemas));
12673
+ schema.push(
12674
+ ...processSchemas(rawSchemas, {
12675
+ formModel,
12676
+ formActionType,
12677
+ tableAction: tableAction2
12678
+ })
12679
+ );
12672
12680
  _setDefaultValue(schema);
12673
12681
  schemaRef.value = uniqBy(schema, "field");
12674
12682
  }
@@ -25867,7 +25875,8 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25867
25875
  formElRef,
25868
25876
  //@ts-ignore
25869
25877
  schemaRef,
25870
- handleFormValues
25878
+ handleFormValues,
25879
+ tableAction: props2.tableAction
25871
25880
  });
25872
25881
  createFormContext({
25873
25882
  resetAction: resetFields,
@@ -25925,7 +25934,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25925
25934
  schema: {},
25926
25935
  // 每次赋值
25927
25936
  formModel,
25928
- formActionType,
25937
+ formActionType: formActionType2,
25929
25938
  tableAction: props2.tableAction
25930
25939
  };
25931
25940
  handleSchemas(vue.unref(getProps).schemas);
@@ -25964,7 +25973,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25964
25973
  ;
25965
25974
  }
25966
25975
  }
25967
- const formActionType = {
25976
+ const formActionType2 = {
25968
25977
  getFieldsValue,
25969
25978
  setFieldsValue,
25970
25979
  resetFields,
@@ -25979,7 +25988,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25979
25988
  validate,
25980
25989
  scrollToField
25981
25990
  };
25982
- vue.provide("formActionType", formActionType);
25991
+ vue.provide("formActionType", formActionType2);
25983
25992
  const isTableForm = vue.computed(() => {
25984
25993
  return !!vue.unref(getBindValue).tableAction;
25985
25994
  });
@@ -26069,7 +26078,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
26069
26078
  };
26070
26079
  vue.onMounted(() => {
26071
26080
  initDefault();
26072
- emit("register", formActionType);
26081
+ emit("register", formActionType2);
26073
26082
  });
26074
26083
  return () => {
26075
26084
  const ignoreKeys = ["resetBefore", "submitBefore", "advanceBefore", "advanceAfter", "advancedSearch"];
@@ -26107,7 +26116,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
26107
26116
  const realSpan = (((_a2 = schema.colProps) == null ? void 0 : _a2.span) ?? ((_c = (_b = vue.unref(getBindValue)) == null ? void 0 : _b.baseColProps) == null ? void 0 : _c.span)) / (vue.unref(ROW_SLICE2) + vue.unref(ACTION_COL2));
26108
26117
  return vue.createVNode(FormItem$2, {
26109
26118
  "tableAction": props2.tableAction,
26110
- "formActionType": formActionType,
26119
+ "formActionType": formActionType2,
26111
26120
  "schema": schema,
26112
26121
  "formProps": getProps.value,
26113
26122
  "allDefaultValues": defaultValueRef.value,
@@ -28287,7 +28296,7 @@ const EQUAL_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28287
28296
  const CONTAIN_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28288
28297
  (item) => ["ct"].includes(item.value)
28289
28298
  );
28290
- const useAdvancedSearch = (schemas, formActionType) => {
28299
+ const useAdvancedSearch = (schemas, formActionType2) => {
28291
28300
  const getSchemaOptions = (type4) => {
28292
28301
  switch (type4) {
28293
28302
  case "number":
@@ -28375,7 +28384,7 @@ const useAdvancedSearch = (schemas, formActionType) => {
28375
28384
  removeSchemaByField,
28376
28385
  updateSchema,
28377
28386
  setFieldsValue
28378
- } = formActionType;
28387
+ } = formActionType2;
28379
28388
  const {
28380
28389
  schemas: [operatorSchema, valueSchema]
28381
28390
  } = componentProps;
@@ -32103,7 +32112,7 @@ const ShyFormTable = /* @__PURE__ */ vue.defineComponent({
32103
32112
  const {
32104
32113
  prefixCls: prefixCls2
32105
32114
  } = use.useDesign("ant-form-table-children");
32106
- const formActionType = vue.inject("formActionType");
32115
+ const formActionType2 = vue.inject("formActionType");
32107
32116
  const tableWrapperRef = vue.ref();
32108
32117
  const tableElRef = vue.ref();
32109
32118
  const curIndex = vue.ref(0);
@@ -32429,7 +32438,7 @@ const ShyFormTable = /* @__PURE__ */ vue.defineComponent({
32429
32438
  column: column2,
32430
32439
  record,
32431
32440
  ...args
32432
- }, formActionType);
32441
+ }, formActionType2);
32433
32442
  } catch (error2) {
32434
32443
  rulesRef[errKey].show = true;
32435
32444
  rulesRef[errKey].msg = error2;
@@ -35767,7 +35776,7 @@ const Group = /* @__PURE__ */ vue.defineComponent({
35767
35776
  schema,
35768
35777
  tableAction: tableAction2,
35769
35778
  formModel,
35770
- formActionType
35779
+ formActionType: formActionType2
35771
35780
  } = props2;
35772
35781
  let {
35773
35782
  componentProps: _componentProps,
@@ -35779,7 +35788,7 @@ const Group = /* @__PURE__ */ vue.defineComponent({
35779
35788
  schema,
35780
35789
  tableAction: tableAction2,
35781
35790
  formModel,
35782
- formActionType
35791
+ formActionType: formActionType2
35783
35792
  }) ?? {};
35784
35793
  }
35785
35794
  const realSpan = (((_a2 = schema.colProps) == null ? void 0 : _a2.span) ?? ((_c = (_b = vue.unref(contextBindValue)) == null ? void 0 : _b.baseColProps) == null ? void 0 : _c.span)) / (vue.unref(ROW_SLICE) + vue.unref(ACTION_COL));
@@ -35930,7 +35939,7 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
35930
35939
  const {
35931
35940
  schema,
35932
35941
  formModel,
35933
- formActionType
35942
+ formActionType: formActionType2
35934
35943
  } = props2;
35935
35944
  let {
35936
35945
  componentProps = {}
@@ -35939,7 +35948,7 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
35939
35948
  componentProps = componentProps({
35940
35949
  schema,
35941
35950
  formModel,
35942
- formActionType
35951
+ formActionType: formActionType2
35943
35952
  }) ?? {};
35944
35953
  }
35945
35954
  if (schema.component === "Divider") {
@@ -10,8 +10,9 @@ interface UseFormActionContext {
10
10
  formElRef: Ref<FormActionType>;
11
11
  schemaRef: Ref<FormSchema[]>;
12
12
  handleFormValues: Fn;
13
+ tableAction?: any;
13
14
  }
14
- export declare function useFormEvents({ emit, getProps, formModel, getSchema, defaultValueRef, formElRef, schemaRef, handleFormValues }: UseFormActionContext): {
15
+ export declare function useFormEvents({ emit, getProps, formModel, getSchema, defaultValueRef, formElRef, schemaRef, handleFormValues, tableAction }: UseFormActionContext): {
15
16
  handleSubmit: (e?: Event) => Promise<void>;
16
17
  clearValidate: (name?: string | string[]) => Promise<void>;
17
18
  validate: (nameList?: NamePath[] | undefined) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "3.0.0-next.243",
3
+ "version": "3.0.0-next.245",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -29,8 +29,8 @@
29
29
  "vue-json-pretty": "^2.2.3",
30
30
  "vxe-table": "4.3.6",
31
31
  "xe-utils": "^3.5.7",
32
- "@shy-plugins/tinymce": "^1.0.6",
33
32
  "@shy-plugins/use": "1.0.1-next.5",
33
+ "@shy-plugins/tinymce": "^1.0.6",
34
34
  "@shy-plugins/utils": "1.0.0-next.1"
35
35
  },
36
36
  "types": "es/ui/index.d.ts",