@tmagic/form 1.3.4 → 1.3.6

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.
Files changed (39) hide show
  1. package/dist/tmagic-form.js +24 -20
  2. package/dist/tmagic-form.js.map +1 -1
  3. package/dist/tmagic-form.umd.cjs +24 -20
  4. package/dist/tmagic-form.umd.cjs.map +1 -1
  5. package/package.json +9 -9
  6. package/src/containers/Container.vue +1 -0
  7. package/src/fields/Cascader.vue +6 -2
  8. package/types/Form.vue.d.ts +5 -1
  9. package/types/FormBox.vue.d.ts +14 -6
  10. package/types/FormDialog.vue.d.ts +15 -6
  11. package/types/FormDrawer.vue.d.ts +18 -6
  12. package/types/containers/Col.vue.d.ts +4 -1
  13. package/types/containers/Container.vue.d.ts +4 -1
  14. package/types/containers/Fieldset.vue.d.ts +4 -1
  15. package/types/containers/GroupList.vue.d.ts +4 -1
  16. package/types/containers/GroupListItem.vue.d.ts +6 -1
  17. package/types/containers/Panel.vue.d.ts +4 -1
  18. package/types/containers/Row.vue.d.ts +4 -1
  19. package/types/containers/Step.vue.d.ts +4 -1
  20. package/types/containers/Table.vue.d.ts +8 -4
  21. package/types/containers/Tabs.vue.d.ts +4 -1
  22. package/types/fields/Cascader.vue.d.ts +3 -1
  23. package/types/fields/Checkbox.vue.d.ts +3 -1
  24. package/types/fields/CheckboxGroup.vue.d.ts +3 -1
  25. package/types/fields/ColorPicker.vue.d.ts +5 -1
  26. package/types/fields/Date.vue.d.ts +5 -1
  27. package/types/fields/DateTime.vue.d.ts +5 -1
  28. package/types/fields/Daterange.vue.d.ts +3 -1
  29. package/types/fields/DynamicField.vue.d.ts +3 -1
  30. package/types/fields/Link.vue.d.ts +3 -1
  31. package/types/fields/Number.vue.d.ts +7 -1
  32. package/types/fields/NumberRange.vue.d.ts +5 -1
  33. package/types/fields/RadioGroup.vue.d.ts +3 -1
  34. package/types/fields/Select.vue.d.ts +3 -1
  35. package/types/fields/Switch.vue.d.ts +5 -1
  36. package/types/fields/Text.vue.d.ts +7 -1
  37. package/types/fields/Textarea.vue.d.ts +7 -1
  38. package/types/fields/Time.vue.d.ts +5 -1
  39. package/types/fields/Timerange.vue.d.ts +3 -1
@@ -165,7 +165,7 @@
165
165
  return valuesTmp || {};
166
166
  };
167
167
 
168
- const _hoisted_1$e = ["innerHTML"];
168
+ const _hoisted_1$e = ["id"];
169
169
  const _hoisted_2$8 = ["innerHTML"];
170
170
  const _hoisted_3$4 = ["innerHTML"];
171
171
  const _hoisted_4$4 = ["innerHTML"];
@@ -177,7 +177,8 @@
177
177
  const _hoisted_10 = ["innerHTML"];
178
178
  const _hoisted_11 = ["innerHTML"];
179
179
  const _hoisted_12 = ["innerHTML"];
180
- const _hoisted_13 = {
180
+ const _hoisted_13 = ["innerHTML"];
181
+ const _hoisted_14 = {
181
182
  key: 5,
182
183
  style: { "text-align": "center" }
183
184
  };
@@ -330,6 +331,7 @@
330
331
  const _component_Container = vue.resolveComponent("Container", true);
331
332
  return _ctx.config ? (vue.openBlock(), vue.createElementBlock("div", {
332
333
  key: 0,
334
+ id: _ctx.config.id,
333
335
  style: vue.normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
334
336
  class: vue.normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
335
337
  }, [
@@ -366,12 +368,12 @@
366
368
  label: vue.withCtx(() => [
367
369
  vue.createElementVNode("span", {
368
370
  innerHTML: type.value === "checkbox" ? "" : text.value
369
- }, null, 8, _hoisted_1$e)
371
+ }, null, 8, _hoisted_2$8)
370
372
  ]),
371
373
  default: vue.withCtx(() => [
372
374
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
373
375
  content: vue.withCtx(() => [
374
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$8)
376
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$4)
375
377
  ]),
376
378
  default: vue.withCtx(() => [
377
379
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -404,7 +406,7 @@
404
406
  key: 2,
405
407
  innerHTML: extra.value,
406
408
  class: "m-form-tip"
407
- }, null, 8, _hoisted_3$4)) : vue.createCommentVNode("", true)
409
+ }, null, 8, _hoisted_4$4)) : vue.createCommentVNode("", true)
408
410
  ]),
409
411
  _: 1
410
412
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -415,7 +417,7 @@
415
417
  content: vue.withCtx(() => [
416
418
  vue.createElementVNode("div", {
417
419
  innerHTML: _ctx.config.tip
418
- }, null, 8, _hoisted_4$4)
420
+ }, null, 8, _hoisted_5$4)
419
421
  ]),
420
422
  default: vue.withCtx(() => [
421
423
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -438,12 +440,12 @@
438
440
  label: vue.withCtx(() => [
439
441
  vue.createElementVNode("span", {
440
442
  innerHTML: type.value === "checkbox" ? "" : text.value
441
- }, null, 8, _hoisted_5$4)
443
+ }, null, 8, _hoisted_6$1)
442
444
  ]),
443
445
  default: vue.withCtx(() => [
444
446
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
445
447
  content: vue.withCtx(() => [
446
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_6$1)
448
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
447
449
  ]),
448
450
  default: vue.withCtx(() => [
449
451
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -472,7 +474,7 @@
472
474
  key: 2,
473
475
  innerHTML: extra.value,
474
476
  class: "m-form-tip"
475
- }, null, 8, _hoisted_7$1)) : vue.createCommentVNode("", true)
477
+ }, null, 8, _hoisted_8$1)) : vue.createCommentVNode("", true)
476
478
  ]),
477
479
  _: 1
478
480
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -483,7 +485,7 @@
483
485
  content: vue.withCtx(() => [
484
486
  vue.createElementVNode("div", {
485
487
  innerHTML: _ctx.config.tip
486
- }, null, 8, _hoisted_8$1)
488
+ }, null, 8, _hoisted_9)
487
489
  ]),
488
490
  default: vue.withCtx(() => [
489
491
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -505,12 +507,12 @@
505
507
  label: vue.withCtx(() => [
506
508
  vue.createElementVNode("span", {
507
509
  innerHTML: type.value === "checkbox" ? "" : text.value
508
- }, null, 8, _hoisted_9)
510
+ }, null, 8, _hoisted_10)
509
511
  ]),
510
512
  default: vue.withCtx(() => [
511
513
  tooltip.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), { key: 0 }, {
512
514
  content: vue.withCtx(() => [
513
- vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_10)
515
+ vue.createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
514
516
  ]),
515
517
  default: vue.withCtx(() => [
516
518
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
@@ -539,7 +541,7 @@
539
541
  key: 2,
540
542
  innerHTML: extra.value,
541
543
  class: "m-form-tip"
542
- }, null, 8, _hoisted_11)) : vue.createCommentVNode("", true)
544
+ }, null, 8, _hoisted_12)) : vue.createCommentVNode("", true)
543
545
  ]),
544
546
  _: 1
545
547
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -550,7 +552,7 @@
550
552
  content: vue.withCtx(() => [
551
553
  vue.createElementVNode("div", {
552
554
  innerHTML: _ctx.config.tip
553
- }, null, 8, _hoisted_12)
555
+ }, null, 8, _hoisted_13)
554
556
  ]),
555
557
  default: vue.withCtx(() => [
556
558
  vue.createVNode(vue.unref(design.TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -581,7 +583,7 @@
581
583
  }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
582
584
  }), 128)) : vue.createCommentVNode("", true)
583
585
  ], 64)) : vue.createCommentVNode("", true),
584
- _ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
586
+ _ctx.config.expand && type.value !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
585
587
  vue.createVNode(vue.unref(design.TMagicButton), {
586
588
  type: "primary",
587
589
  size: "small",
@@ -595,7 +597,7 @@
595
597
  _: 1
596
598
  })
597
599
  ])) : vue.createCommentVNode("", true)
598
- ], 6)) : vue.createCommentVNode("", true);
600
+ ], 14, _hoisted_1$e)) : vue.createCommentVNode("", true);
599
601
  };
600
602
  }
601
603
  });
@@ -2174,7 +2176,7 @@
2174
2176
  useAddField(props.prop);
2175
2177
  const requestFunc = getConfig("request");
2176
2178
  const tMagicCascader = vue.ref();
2177
- const options = Array.isArray(props.config.options) ? vue.ref(props.config.options) : vue.ref([]);
2179
+ const options = vue.ref([]);
2178
2180
  const remoteData = vue.ref(null);
2179
2181
  const setRemoteOptions = async function() {
2180
2182
  const { config } = props;
@@ -2211,6 +2213,10 @@
2211
2213
  );
2212
2214
  } else if (!props.config.options?.length || props.config.remote) {
2213
2215
  Promise.resolve(setRemoteOptions());
2216
+ } else if (Array.isArray(props.config.options)) {
2217
+ vue.watchEffect(() => {
2218
+ options.value = props.config.options;
2219
+ });
2214
2220
  }
2215
2221
  const changeHandler = (value) => {
2216
2222
  if (!tMagicCascader.value)
@@ -2231,7 +2237,7 @@
2231
2237
  size: _ctx.size,
2232
2238
  placeholder: _ctx.config.placeholder,
2233
2239
  disabled: _ctx.disabled,
2234
- options: vue.unref(options),
2240
+ options: options.value,
2235
2241
  props: {
2236
2242
  multiple: _ctx.config.multiple ?? false,
2237
2243
  emitPath: _ctx.config.emitPath ?? true,
@@ -4139,8 +4145,6 @@
4139
4145
  }
4140
4146
  });
4141
4147
 
4142
- const index$1 = '';
4143
-
4144
4148
  const _hoisted_1$1 = { style: { "min-height": "1px" } };
4145
4149
  const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
4146
4150
  ...{