@tmagic/editor 1.5.1 → 1.5.2

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.
@@ -4811,15 +4811,15 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
4811
4811
  }
4812
4812
  return value ?? props.config.value === "key";
4813
4813
  });
4814
- const onChangeHandler = (value) => {
4814
+ const onChangeHandler = (value, eventData) => {
4815
4815
  if (!Array.isArray(value)) {
4816
- emit("change", value);
4816
+ emit("change", value, eventData);
4817
4817
  return;
4818
4818
  }
4819
4819
  const [dsId, ...keys] = value;
4820
4820
  const dataSource = dataSources.value.find((ds) => ds.id === removeDataSourceFieldPrefix(dsId));
4821
4821
  if (!dataSource) {
4822
- emit("change", value);
4822
+ emit("change", value, eventData);
4823
4823
  return;
4824
4824
  }
4825
4825
  let fields = dataSource.fields || [];
@@ -4833,10 +4833,10 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
4833
4833
  dataSourceFieldType.push("any");
4834
4834
  }
4835
4835
  if (!keys.length || field?.type && (field.type === "any" || dataSourceFieldType.includes("any") || dataSourceFieldType.includes(field.type))) {
4836
- emit("change", value);
4836
+ emit("change", value, eventData);
4837
4837
  } else {
4838
4838
  tMagicMessage.error(`请选择类型为${dataSourceFieldType.join("或")}的字段`);
4839
- emit("change", [dsId]);
4839
+ emit("change", [dsId], eventData);
4840
4840
  }
4841
4841
  };
4842
4842
  return (_ctx, _cache) => {
@@ -4807,15 +4807,15 @@
4807
4807
  }
4808
4808
  return value ?? props.config.value === "key";
4809
4809
  });
4810
- const onChangeHandler = (value) => {
4810
+ const onChangeHandler = (value, eventData) => {
4811
4811
  if (!Array.isArray(value)) {
4812
- emit("change", value);
4812
+ emit("change", value, eventData);
4813
4813
  return;
4814
4814
  }
4815
4815
  const [dsId, ...keys] = value;
4816
4816
  const dataSource = dataSources.value.find((ds) => ds.id === removeDataSourceFieldPrefix(dsId));
4817
4817
  if (!dataSource) {
4818
- emit("change", value);
4818
+ emit("change", value, eventData);
4819
4819
  return;
4820
4820
  }
4821
4821
  let fields = dataSource.fields || [];
@@ -4829,10 +4829,10 @@
4829
4829
  dataSourceFieldType.push("any");
4830
4830
  }
4831
4831
  if (!keys.length || field?.type && (field.type === "any" || dataSourceFieldType.includes("any") || dataSourceFieldType.includes(field.type))) {
4832
- emit("change", value);
4832
+ emit("change", value, eventData);
4833
4833
  } else {
4834
4834
  designPlugin.tMagicMessage.error(`请选择类型为${dataSourceFieldType.join("或")}的字段`);
4835
- emit("change", [dsId]);
4835
+ emit("change", [dsId], eventData);
4836
4836
  }
4837
4837
  };
4838
4838
  return (_ctx, _cache) => {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.1",
2
+ "version": "1.5.2",
3
3
  "name": "@tmagic/editor",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -58,11 +58,11 @@
58
58
  "moveable": "^0.53.0",
59
59
  "serialize-javascript": "^6.0.0",
60
60
  "sortablejs": "^1.15.2",
61
- "@tmagic/design": "1.5.1",
62
- "@tmagic/stage": "1.5.1",
63
- "@tmagic/form": "1.5.1",
64
- "@tmagic/table": "1.5.1",
65
- "@tmagic/utils": "1.5.1"
61
+ "@tmagic/design": "1.5.2",
62
+ "@tmagic/table": "1.5.2",
63
+ "@tmagic/stage": "1.5.2",
64
+ "@tmagic/utils": "1.5.2",
65
+ "@tmagic/form": "1.5.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/events": "^3.0.0",
@@ -83,7 +83,7 @@
83
83
  "monaco-editor": "^0.48.0",
84
84
  "typescript": "*",
85
85
  "vue": ">=3.5.0",
86
- "@tmagic/core": "1.5.1"
86
+ "@tmagic/core": "1.5.2"
87
87
  },
88
88
  "peerDependenciesMeta": {
89
89
  "typescript": {
@@ -44,7 +44,7 @@ import { Coin } from '@element-plus/icons-vue';
44
44
 
45
45
  import { DataSchema } from '@tmagic/core';
46
46
  import { TMagicButton, tMagicMessage, TMagicTooltip } from '@tmagic/design';
47
- import type { FieldProps, FormState } from '@tmagic/form';
47
+ import type { ContainerChangeEventData, FieldProps, FormState } from '@tmagic/form';
48
48
  import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX } from '@tmagic/utils';
49
49
 
50
50
  import MIcon from '@editor/components/Icon.vue';
@@ -129,9 +129,9 @@ const checkStrictly = computed(() => {
129
129
  return value ?? props.config.value === 'key';
130
130
  });
131
131
 
132
- const onChangeHandler = (value: string[]) => {
132
+ const onChangeHandler = (value: string[], eventData?: ContainerChangeEventData) => {
133
133
  if (!Array.isArray(value)) {
134
- emit('change', value);
134
+ emit('change', value, eventData);
135
135
  return;
136
136
  }
137
137
 
@@ -139,7 +139,7 @@ const onChangeHandler = (value: string[]) => {
139
139
  const dataSource = dataSources.value.find((ds) => ds.id === removeDataSourceFieldPrefix(dsId));
140
140
 
141
141
  if (!dataSource) {
142
- emit('change', value);
142
+ emit('change', value, eventData);
143
143
  return;
144
144
  }
145
145
 
@@ -160,10 +160,10 @@ const onChangeHandler = (value: string[]) => {
160
160
  (field?.type &&
161
161
  (field.type === 'any' || dataSourceFieldType.includes('any') || dataSourceFieldType.includes(field.type)))
162
162
  ) {
163
- emit('change', value);
163
+ emit('change', value, eventData);
164
164
  } else {
165
165
  tMagicMessage.error(`请选择类型为${dataSourceFieldType.join('或')}的字段`);
166
- emit('change', [dsId]);
166
+ emit('change', [dsId], eventData);
167
167
  }
168
168
  };
169
169
  </script>
File without changes