3h1-ui 3.0.0-next.244 → 3.0.0-next.246

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);
@@ -12620,31 +12622,35 @@ function useFormEvents({
12620
12622
  (item) => item.field === schemaItem.field
12621
12623
  );
12622
12624
  const merged = matched ? deepMerge$2(schemaItem, matched) : { ...schemaItem };
12623
- let originalProps = merged.componentProps;
12624
- if (typeof originalProps === "function" && merged.component === "Group") {
12625
- const resultProps = originalProps(context);
12626
- if (Array.isArray(resultProps == null ? void 0 : resultProps.schemas)) {
12627
- processSchemas(resultProps.schemas, context);
12628
- merged.componentProps = (ctx) => {
12629
- const finalProps = originalProps(ctx);
12630
- return {
12631
- ...finalProps,
12632
- schemas: processSchemas(finalProps.schemas || [], ctx)
12633
- };
12625
+ const rawComponentProps = merged.componentProps;
12626
+ if (typeof rawComponentProps === "function" && merged.component === "Group") {
12627
+ merged.componentProps = (ctx) => {
12628
+ const originalResult = rawComponentProps(ctx);
12629
+ const rawSchemas2 = originalResult.schemas || [];
12630
+ const updatedSchemas = processSchemas(rawSchemas2, ctx);
12631
+ return {
12632
+ ...originalResult,
12633
+ schemas: updatedSchemas
12634
12634
  };
12635
- }
12635
+ };
12636
12636
  }
12637
- if (typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps == null ? void 0 : originalProps.schemas)) {
12637
+ if (typeof rawComponentProps === "object" && merged.component === "Group" && Array.isArray(rawComponentProps == null ? void 0 : rawComponentProps.schemas)) {
12638
12638
  merged.componentProps = {
12639
- ...originalProps,
12640
- schemas: processSchemas(originalProps.schemas, context)
12639
+ ...rawComponentProps,
12640
+ schemas: processSchemas(rawComponentProps.schemas, context)
12641
12641
  };
12642
12642
  }
12643
12643
  return merged;
12644
12644
  });
12645
12645
  }
12646
12646
  const rawSchemas = unref(getSchema);
12647
- schema.push(...processSchemas(rawSchemas));
12647
+ schema.push(
12648
+ ...processSchemas(rawSchemas, {
12649
+ formModel,
12650
+ formActionType,
12651
+ tableAction: tableAction2
12652
+ })
12653
+ );
12648
12654
  _setDefaultValue(schema);
12649
12655
  schemaRef.value = uniqBy(schema, "field");
12650
12656
  }
@@ -25843,7 +25849,8 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25843
25849
  formElRef,
25844
25850
  //@ts-ignore
25845
25851
  schemaRef,
25846
- handleFormValues
25852
+ handleFormValues,
25853
+ tableAction: props2.tableAction
25847
25854
  });
25848
25855
  createFormContext({
25849
25856
  resetAction: resetFields,
@@ -25901,7 +25908,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25901
25908
  schema: {},
25902
25909
  // 每次赋值
25903
25910
  formModel,
25904
- formActionType,
25911
+ formActionType: formActionType2,
25905
25912
  tableAction: props2.tableAction
25906
25913
  };
25907
25914
  handleSchemas(unref(getProps).schemas);
@@ -25940,7 +25947,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25940
25947
  ;
25941
25948
  }
25942
25949
  }
25943
- const formActionType = {
25950
+ const formActionType2 = {
25944
25951
  getFieldsValue,
25945
25952
  setFieldsValue,
25946
25953
  resetFields,
@@ -25955,7 +25962,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
25955
25962
  validate,
25956
25963
  scrollToField
25957
25964
  };
25958
- provide("formActionType", formActionType);
25965
+ provide("formActionType", formActionType2);
25959
25966
  const isTableForm = computed(() => {
25960
25967
  return !!unref(getBindValue).tableAction;
25961
25968
  });
@@ -26045,7 +26052,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
26045
26052
  };
26046
26053
  onMounted(() => {
26047
26054
  initDefault();
26048
- emit("register", formActionType);
26055
+ emit("register", formActionType2);
26049
26056
  });
26050
26057
  return () => {
26051
26058
  const ignoreKeys = ["resetBefore", "submitBefore", "advanceBefore", "advanceAfter", "advancedSearch"];
@@ -26083,7 +26090,7 @@ const ShyForm = /* @__PURE__ */ defineComponent({
26083
26090
  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
26091
  return createVNode(FormItem$2, {
26085
26092
  "tableAction": props2.tableAction,
26086
- "formActionType": formActionType,
26093
+ "formActionType": formActionType2,
26087
26094
  "schema": schema,
26088
26095
  "formProps": getProps.value,
26089
26096
  "allDefaultValues": defaultValueRef.value,
@@ -28263,7 +28270,7 @@ const EQUAL_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28263
28270
  const CONTAIN_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28264
28271
  (item) => ["ct"].includes(item.value)
28265
28272
  );
28266
- const useAdvancedSearch = (schemas, formActionType) => {
28273
+ const useAdvancedSearch = (schemas, formActionType2) => {
28267
28274
  const getSchemaOptions = (type4) => {
28268
28275
  switch (type4) {
28269
28276
  case "number":
@@ -28351,7 +28358,7 @@ const useAdvancedSearch = (schemas, formActionType) => {
28351
28358
  removeSchemaByField,
28352
28359
  updateSchema,
28353
28360
  setFieldsValue
28354
- } = formActionType;
28361
+ } = formActionType2;
28355
28362
  const {
28356
28363
  schemas: [operatorSchema, valueSchema]
28357
28364
  } = componentProps;
@@ -32079,7 +32086,7 @@ const ShyFormTable = /* @__PURE__ */ defineComponent({
32079
32086
  const {
32080
32087
  prefixCls: prefixCls2
32081
32088
  } = useDesign$1("ant-form-table-children");
32082
- const formActionType = inject("formActionType");
32089
+ const formActionType2 = inject("formActionType");
32083
32090
  const tableWrapperRef = ref();
32084
32091
  const tableElRef = ref();
32085
32092
  const curIndex = ref(0);
@@ -32405,7 +32412,7 @@ const ShyFormTable = /* @__PURE__ */ defineComponent({
32405
32412
  column: column2,
32406
32413
  record,
32407
32414
  ...args
32408
- }, formActionType);
32415
+ }, formActionType2);
32409
32416
  } catch (error2) {
32410
32417
  rulesRef[errKey].show = true;
32411
32418
  rulesRef[errKey].msg = error2;
@@ -35743,7 +35750,7 @@ const Group = /* @__PURE__ */ defineComponent({
35743
35750
  schema,
35744
35751
  tableAction: tableAction2,
35745
35752
  formModel,
35746
- formActionType
35753
+ formActionType: formActionType2
35747
35754
  } = props2;
35748
35755
  let {
35749
35756
  componentProps: _componentProps,
@@ -35755,7 +35762,7 @@ const Group = /* @__PURE__ */ defineComponent({
35755
35762
  schema,
35756
35763
  tableAction: tableAction2,
35757
35764
  formModel,
35758
- formActionType
35765
+ formActionType: formActionType2
35759
35766
  }) ?? {};
35760
35767
  }
35761
35768
  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 +35913,7 @@ const FormItem = /* @__PURE__ */ defineComponent({
35906
35913
  const {
35907
35914
  schema,
35908
35915
  formModel,
35909
- formActionType
35916
+ formActionType: formActionType2
35910
35917
  } = props2;
35911
35918
  let {
35912
35919
  componentProps = {}
@@ -35915,7 +35922,7 @@ const FormItem = /* @__PURE__ */ defineComponent({
35915
35922
  componentProps = componentProps({
35916
35923
  schema,
35917
35924
  formModel,
35918
- formActionType
35925
+ formActionType: formActionType2
35919
35926
  }) ?? {};
35920
35927
  }
35921
35928
  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);
@@ -12644,31 +12646,35 @@ function useFormEvents({
12644
12646
  (item) => item.field === schemaItem.field
12645
12647
  );
12646
12648
  const merged = matched ? utils$1.deepMerge(schemaItem, matched) : { ...schemaItem };
12647
- let originalProps = merged.componentProps;
12648
- if (typeof originalProps === "function" && merged.component === "Group") {
12649
- const resultProps = originalProps(context);
12650
- if (Array.isArray(resultProps == null ? void 0 : resultProps.schemas)) {
12651
- processSchemas(resultProps.schemas, context);
12652
- merged.componentProps = (ctx) => {
12653
- const finalProps = originalProps(ctx);
12654
- return {
12655
- ...finalProps,
12656
- schemas: processSchemas(finalProps.schemas || [], ctx)
12657
- };
12649
+ const rawComponentProps = merged.componentProps;
12650
+ if (typeof rawComponentProps === "function" && merged.component === "Group") {
12651
+ merged.componentProps = (ctx) => {
12652
+ const originalResult = rawComponentProps(ctx);
12653
+ const rawSchemas2 = originalResult.schemas || [];
12654
+ const updatedSchemas = processSchemas(rawSchemas2, ctx);
12655
+ return {
12656
+ ...originalResult,
12657
+ schemas: updatedSchemas
12658
12658
  };
12659
- }
12659
+ };
12660
12660
  }
12661
- if (typeof originalProps === "object" && merged.component === "Group" && Array.isArray(originalProps == null ? void 0 : originalProps.schemas)) {
12661
+ if (typeof rawComponentProps === "object" && merged.component === "Group" && Array.isArray(rawComponentProps == null ? void 0 : rawComponentProps.schemas)) {
12662
12662
  merged.componentProps = {
12663
- ...originalProps,
12664
- schemas: processSchemas(originalProps.schemas, context)
12663
+ ...rawComponentProps,
12664
+ schemas: processSchemas(rawComponentProps.schemas, context)
12665
12665
  };
12666
12666
  }
12667
12667
  return merged;
12668
12668
  });
12669
12669
  }
12670
12670
  const rawSchemas = vue.unref(getSchema);
12671
- schema.push(...processSchemas(rawSchemas));
12671
+ schema.push(
12672
+ ...processSchemas(rawSchemas, {
12673
+ formModel,
12674
+ formActionType,
12675
+ tableAction: tableAction2
12676
+ })
12677
+ );
12672
12678
  _setDefaultValue(schema);
12673
12679
  schemaRef.value = uniqBy(schema, "field");
12674
12680
  }
@@ -25867,7 +25873,8 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25867
25873
  formElRef,
25868
25874
  //@ts-ignore
25869
25875
  schemaRef,
25870
- handleFormValues
25876
+ handleFormValues,
25877
+ tableAction: props2.tableAction
25871
25878
  });
25872
25879
  createFormContext({
25873
25880
  resetAction: resetFields,
@@ -25925,7 +25932,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25925
25932
  schema: {},
25926
25933
  // 每次赋值
25927
25934
  formModel,
25928
- formActionType,
25935
+ formActionType: formActionType2,
25929
25936
  tableAction: props2.tableAction
25930
25937
  };
25931
25938
  handleSchemas(vue.unref(getProps).schemas);
@@ -25964,7 +25971,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25964
25971
  ;
25965
25972
  }
25966
25973
  }
25967
- const formActionType = {
25974
+ const formActionType2 = {
25968
25975
  getFieldsValue,
25969
25976
  setFieldsValue,
25970
25977
  resetFields,
@@ -25979,7 +25986,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
25979
25986
  validate,
25980
25987
  scrollToField
25981
25988
  };
25982
- vue.provide("formActionType", formActionType);
25989
+ vue.provide("formActionType", formActionType2);
25983
25990
  const isTableForm = vue.computed(() => {
25984
25991
  return !!vue.unref(getBindValue).tableAction;
25985
25992
  });
@@ -26069,7 +26076,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
26069
26076
  };
26070
26077
  vue.onMounted(() => {
26071
26078
  initDefault();
26072
- emit("register", formActionType);
26079
+ emit("register", formActionType2);
26073
26080
  });
26074
26081
  return () => {
26075
26082
  const ignoreKeys = ["resetBefore", "submitBefore", "advanceBefore", "advanceAfter", "advancedSearch"];
@@ -26107,7 +26114,7 @@ const ShyForm = /* @__PURE__ */ vue.defineComponent({
26107
26114
  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
26115
  return vue.createVNode(FormItem$2, {
26109
26116
  "tableAction": props2.tableAction,
26110
- "formActionType": formActionType,
26117
+ "formActionType": formActionType2,
26111
26118
  "schema": schema,
26112
26119
  "formProps": getProps.value,
26113
26120
  "allDefaultValues": defaultValueRef.value,
@@ -28287,7 +28294,7 @@ const EQUAL_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28287
28294
  const CONTAIN_OPERATOR_OPTIONS = ALL_OPERATOR_OPTION.filter(
28288
28295
  (item) => ["ct"].includes(item.value)
28289
28296
  );
28290
- const useAdvancedSearch = (schemas, formActionType) => {
28297
+ const useAdvancedSearch = (schemas, formActionType2) => {
28291
28298
  const getSchemaOptions = (type4) => {
28292
28299
  switch (type4) {
28293
28300
  case "number":
@@ -28375,7 +28382,7 @@ const useAdvancedSearch = (schemas, formActionType) => {
28375
28382
  removeSchemaByField,
28376
28383
  updateSchema,
28377
28384
  setFieldsValue
28378
- } = formActionType;
28385
+ } = formActionType2;
28379
28386
  const {
28380
28387
  schemas: [operatorSchema, valueSchema]
28381
28388
  } = componentProps;
@@ -32103,7 +32110,7 @@ const ShyFormTable = /* @__PURE__ */ vue.defineComponent({
32103
32110
  const {
32104
32111
  prefixCls: prefixCls2
32105
32112
  } = use.useDesign("ant-form-table-children");
32106
- const formActionType = vue.inject("formActionType");
32113
+ const formActionType2 = vue.inject("formActionType");
32107
32114
  const tableWrapperRef = vue.ref();
32108
32115
  const tableElRef = vue.ref();
32109
32116
  const curIndex = vue.ref(0);
@@ -32429,7 +32436,7 @@ const ShyFormTable = /* @__PURE__ */ vue.defineComponent({
32429
32436
  column: column2,
32430
32437
  record,
32431
32438
  ...args
32432
- }, formActionType);
32439
+ }, formActionType2);
32433
32440
  } catch (error2) {
32434
32441
  rulesRef[errKey].show = true;
32435
32442
  rulesRef[errKey].msg = error2;
@@ -35767,7 +35774,7 @@ const Group = /* @__PURE__ */ vue.defineComponent({
35767
35774
  schema,
35768
35775
  tableAction: tableAction2,
35769
35776
  formModel,
35770
- formActionType
35777
+ formActionType: formActionType2
35771
35778
  } = props2;
35772
35779
  let {
35773
35780
  componentProps: _componentProps,
@@ -35779,7 +35786,7 @@ const Group = /* @__PURE__ */ vue.defineComponent({
35779
35786
  schema,
35780
35787
  tableAction: tableAction2,
35781
35788
  formModel,
35782
- formActionType
35789
+ formActionType: formActionType2
35783
35790
  }) ?? {};
35784
35791
  }
35785
35792
  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 +35937,7 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
35930
35937
  const {
35931
35938
  schema,
35932
35939
  formModel,
35933
- formActionType
35940
+ formActionType: formActionType2
35934
35941
  } = props2;
35935
35942
  let {
35936
35943
  componentProps = {}
@@ -35939,7 +35946,7 @@ const FormItem = /* @__PURE__ */ vue.defineComponent({
35939
35946
  componentProps = componentProps({
35940
35947
  schema,
35941
35948
  formModel,
35942
- formActionType
35949
+ formActionType: formActionType2
35943
35950
  }) ?? {};
35944
35951
  }
35945
35952
  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.244",
3
+ "version": "3.0.0-next.246",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -29,9 +29,9 @@
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",
32
33
  "@shy-plugins/utils": "1.0.0-next.1",
33
- "@shy-plugins/use": "1.0.1-next.5",
34
- "@shy-plugins/tinymce": "^1.0.6"
34
+ "@shy-plugins/use": "1.0.1-next.5"
35
35
  },
36
36
  "types": "es/ui/index.d.ts",
37
37
  "devDependencies": {