@tmagic/form 1.5.16 → 1.5.18

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.
@@ -7,6 +7,7 @@ import dayjs from 'dayjs';
7
7
  import utc from 'dayjs/plugin/utc';
8
8
  import Sortable from 'sortablejs';
9
9
  import { createPopper } from '@popperjs/core';
10
+ export * from '@tmagic/form-schema';
10
11
 
11
12
  const isTableSelect = (type) => typeof type === "string" && ["table-select", "tableSelect"].includes(type);
12
13
  const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
@@ -4095,7 +4096,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4095
4096
  if (typeof option.beforeRequest === "function") {
4096
4097
  postOptions = option.beforeRequest(mForm, postOptions, {
4097
4098
  model: props.model,
4098
- formValue: mForm?.values
4099
+ formValue: mForm?.values,
4100
+ formValues: mForm?.values,
4101
+ prop: props.prop,
4102
+ config: props.config
4099
4103
  });
4100
4104
  }
4101
4105
  if (option.method?.toLocaleLowerCase() === "jsonp") {
@@ -4108,6 +4112,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4108
4112
  formValue: mForm?.values,
4109
4113
  formValues: mForm?.values,
4110
4114
  config: props.config,
4115
+ prop: props.prop,
4111
4116
  postOptions
4112
4117
  });
4113
4118
  }
@@ -4193,7 +4198,10 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4193
4198
  if (typeof option.beforeInitRequest === "function") {
4194
4199
  postOptions = option.beforeInitRequest(mForm, postOptions, {
4195
4200
  model: props.model,
4196
- formValue: mForm?.values
4201
+ formValue: mForm?.values,
4202
+ formValues: mForm?.values,
4203
+ config: props.config,
4204
+ prop: props.prop
4197
4205
  });
4198
4206
  }
4199
4207
  if (option.method?.toLocaleLowerCase() === "jsonp") {
@@ -4207,6 +4215,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
4207
4215
  formValue: mForm?.values,
4208
4216
  formValues: mForm?.values,
4209
4217
  config: props.config,
4218
+ prop: props.prop,
4210
4219
  postOptions
4211
4220
  });
4212
4221
  }
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('@tmagic/utils'), require('dayjs'), require('dayjs/plugin/utc'), require('sortablejs'), require('@popperjs/core')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', '@tmagic/design', '@tmagic/utils', 'dayjs', 'dayjs/plugin/utc', 'sortablejs', '@popperjs/core'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.design, global.utils, global.dayjs, global.utc, global.Sortable, global.core));
5
- })(this, (function (exports, vue, iconsVue, design, utils, dayjs, utc, Sortable, core) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('@tmagic/utils'), require('dayjs'), require('dayjs/plugin/utc'), require('sortablejs'), require('@popperjs/core'), require('@tmagic/form-schema')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', '@tmagic/design', '@tmagic/utils', 'dayjs', 'dayjs/plugin/utc', 'sortablejs', '@popperjs/core', '@tmagic/form-schema'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.design, global.utils, global.dayjs, global.utc, global.Sortable, global.core, global.formSchema));
5
+ })(this, (function (exports, vue, iconsVue, design, utils, dayjs, utc, Sortable, core, formSchema) { 'use strict';
6
6
 
7
7
  /** Detect free variable `global` from Node.js. */
8
8
  var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
@@ -7026,7 +7026,10 @@
7026
7026
  if (typeof option.beforeRequest === "function") {
7027
7027
  postOptions = option.beforeRequest(mForm, postOptions, {
7028
7028
  model: props.model,
7029
- formValue: mForm?.values
7029
+ formValue: mForm?.values,
7030
+ formValues: mForm?.values,
7031
+ prop: props.prop,
7032
+ config: props.config
7030
7033
  });
7031
7034
  }
7032
7035
  if (option.method?.toLocaleLowerCase() === "jsonp") {
@@ -7039,6 +7042,7 @@
7039
7042
  formValue: mForm?.values,
7040
7043
  formValues: mForm?.values,
7041
7044
  config: props.config,
7045
+ prop: props.prop,
7042
7046
  postOptions
7043
7047
  });
7044
7048
  }
@@ -7124,7 +7128,10 @@
7124
7128
  if (typeof option.beforeInitRequest === "function") {
7125
7129
  postOptions = option.beforeInitRequest(mForm, postOptions, {
7126
7130
  model: props.model,
7127
- formValue: mForm?.values
7131
+ formValue: mForm?.values,
7132
+ formValues: mForm?.values,
7133
+ config: props.config,
7134
+ prop: props.prop
7128
7135
  });
7129
7136
  }
7130
7137
  if (option.method?.toLocaleLowerCase() === "jsonp") {
@@ -7138,6 +7145,7 @@
7138
7145
  formValue: mForm?.values,
7139
7146
  formValues: mForm?.values,
7140
7147
  config: props.config,
7148
+ prop: props.prop,
7141
7149
  postOptions
7142
7150
  });
7143
7151
  }
@@ -8245,6 +8253,12 @@
8245
8253
  exports.getRules = getRules;
8246
8254
  exports.initValue = initValue;
8247
8255
  exports.useAddField = useAddField;
8256
+ Object.keys(formSchema).forEach(k => {
8257
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
8258
+ enumerable: true,
8259
+ get: () => formSchema[k]
8260
+ });
8261
+ });
8248
8262
 
8249
8263
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
8250
8264
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.16",
2
+ "version": "1.5.18",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -51,8 +51,9 @@
51
51
  "peerDependencies": {
52
52
  "vue": ">=3.5.0",
53
53
  "typescript": "*",
54
- "@tmagic/design": "1.5.16",
55
- "@tmagic/utils": "1.5.16"
54
+ "@tmagic/form-schema": "1.5.18",
55
+ "@tmagic/design": "1.5.18",
56
+ "@tmagic/utils": "1.5.18"
56
57
  },
57
58
  "peerDependenciesMeta": {
58
59
  "typescript": {
package/src/Form.vue CHANGED
@@ -13,7 +13,7 @@
13
13
  <Container
14
14
  v-for="(item, index) in config"
15
15
  :disabled="disabled"
16
- :key="item[keyProp] ?? index"
16
+ :key="(item as Record<string, any>)[keyProp] ?? index"
17
17
  :config="item"
18
18
  :model="values"
19
19
  :last-values="lastValuesProcessed"
@@ -20,7 +20,7 @@
20
20
  <div style="flex: 1">
21
21
  <Container
22
22
  v-for="(item, index) in items"
23
- :key="item[mForm?.keyProp || '__key'] ?? index"
23
+ :key="(item as Record<string, any>)[mForm?.keyProp || '__key'] ?? index"
24
24
  :config="item"
25
25
  :model="name ? model[name] : model"
26
26
  :lastValues="name ? lastValues[name] : lastValues"
@@ -40,7 +40,7 @@
40
40
  <template v-else>
41
41
  <Container
42
42
  v-for="(item, index) in items"
43
- :key="item[mForm?.keyProp || '__key'] ?? index"
43
+ :key="(item as Record<string, any>)[mForm?.keyProp || '__key'] ?? index"
44
44
  :config="item"
45
45
  :model="name ? model[name] : model"
46
46
  :lastValues="name ? lastValues[name] : lastValues"
@@ -2,7 +2,7 @@
2
2
  <TMagicRow :gutter="10">
3
3
  <Col
4
4
  v-for="(col, index) in config.items"
5
- :key="col[mForm?.keyProp || '__key'] ?? index"
5
+ :key="(col as Record<string, any>)[mForm?.keyProp || '__key'] ?? index"
6
6
  :span="col.span || config.span || 24 / config.items.length"
7
7
  :config="col"
8
8
  :labelWidth="config.labelWidth || labelWidth"
@@ -15,7 +15,7 @@
15
15
  <Container
16
16
  v-if="item"
17
17
  v-show="active - 1 === index"
18
- :key="item[mForm?.keyProp || '__key']"
18
+ :key="(item as Record<string, any>)[mForm?.keyProp || '__key']"
19
19
  :config="item"
20
20
  :model="step.name ? model[step.name] : model"
21
21
  :lastValues="step.name ? lastValues[step.name] : lastValues"
@@ -34,7 +34,7 @@
34
34
  </template>
35
35
  <Container
36
36
  v-for="item in tabItems(tab)"
37
- :key="item[mForm?.keyProp || '__key']"
37
+ :key="(item as Record<string, any>)[mForm?.keyProp || '__key']"
38
38
  :config="item"
39
39
  :disabled="disabled"
40
40
  :model="
@@ -191,6 +191,9 @@ const getOptions = async () => {
191
191
  postOptions = option.beforeRequest(mForm, postOptions, {
192
192
  model: props.model,
193
193
  formValue: mForm?.values,
194
+ formValues: mForm?.values,
195
+ prop: props.prop,
196
+ config: props.config,
194
197
  });
195
198
  }
196
199
 
@@ -206,6 +209,7 @@ const getOptions = async () => {
206
209
  formValue: mForm?.values,
207
210
  formValues: mForm?.values,
208
211
  config: props.config,
212
+ prop: props.prop,
209
213
  postOptions,
210
214
  });
211
215
  }
@@ -315,6 +319,9 @@ const getInitOption = async () => {
315
319
  postOptions = option.beforeInitRequest(mForm, postOptions, {
316
320
  model: props.model,
317
321
  formValue: mForm?.values,
322
+ formValues: mForm?.values,
323
+ config: props.config,
324
+ prop: props.prop,
318
325
  });
319
326
  }
320
327
 
@@ -331,6 +338,7 @@ const getInitOption = async () => {
331
338
  formValue: mForm?.values,
332
339
  formValues: mForm?.values,
333
340
  config: props.config,
341
+ prop: props.prop,
334
342
  postOptions,
335
343
  });
336
344
  }