@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
@@ -166,7 +166,7 @@ const initValue = async (mForm, { initValues, config }) => {
166
166
  return valuesTmp || {};
167
167
  };
168
168
 
169
- const _hoisted_1$e = ["innerHTML"];
169
+ const _hoisted_1$e = ["id"];
170
170
  const _hoisted_2$8 = ["innerHTML"];
171
171
  const _hoisted_3$4 = ["innerHTML"];
172
172
  const _hoisted_4$4 = ["innerHTML"];
@@ -178,7 +178,8 @@ const _hoisted_9 = ["innerHTML"];
178
178
  const _hoisted_10 = ["innerHTML"];
179
179
  const _hoisted_11 = ["innerHTML"];
180
180
  const _hoisted_12 = ["innerHTML"];
181
- const _hoisted_13 = {
181
+ const _hoisted_13 = ["innerHTML"];
182
+ const _hoisted_14 = {
182
183
  key: 5,
183
184
  style: { "text-align": "center" }
184
185
  };
@@ -331,6 +332,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
331
332
  const _component_Container = resolveComponent("Container", true);
332
333
  return _ctx.config ? (openBlock(), createElementBlock("div", {
333
334
  key: 0,
335
+ id: _ctx.config.id,
334
336
  style: normalizeStyle(_ctx.config.tip ? "display: flex;align-items: baseline;" : ""),
335
337
  class: normalizeClass(`m-form-container m-container-${type.value || ""} ${_ctx.config.className || ""}`)
336
338
  }, [
@@ -367,12 +369,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
367
369
  label: withCtx(() => [
368
370
  createElementVNode("span", {
369
371
  innerHTML: type.value === "checkbox" ? "" : text.value
370
- }, null, 8, _hoisted_1$e)
372
+ }, null, 8, _hoisted_2$8)
371
373
  ]),
372
374
  default: withCtx(() => [
373
375
  tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
374
376
  content: withCtx(() => [
375
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_2$8)
377
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_3$4)
376
378
  ]),
377
379
  default: withCtx(() => [
378
380
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
@@ -405,7 +407,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
405
407
  key: 2,
406
408
  innerHTML: extra.value,
407
409
  class: "m-form-tip"
408
- }, null, 8, _hoisted_3$4)) : createCommentVNode("", true)
410
+ }, null, 8, _hoisted_4$4)) : createCommentVNode("", true)
409
411
  ]),
410
412
  _: 1
411
413
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -416,7 +418,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
416
418
  content: withCtx(() => [
417
419
  createElementVNode("div", {
418
420
  innerHTML: _ctx.config.tip
419
- }, null, 8, _hoisted_4$4)
421
+ }, null, 8, _hoisted_5$4)
420
422
  ]),
421
423
  default: withCtx(() => [
422
424
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -439,12 +441,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
439
441
  label: withCtx(() => [
440
442
  createElementVNode("span", {
441
443
  innerHTML: type.value === "checkbox" ? "" : text.value
442
- }, null, 8, _hoisted_5$4)
444
+ }, null, 8, _hoisted_6$1)
443
445
  ]),
444
446
  default: withCtx(() => [
445
447
  tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
446
448
  content: withCtx(() => [
447
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_6$1)
449
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_7$1)
448
450
  ]),
449
451
  default: withCtx(() => [
450
452
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
@@ -473,7 +475,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
473
475
  key: 2,
474
476
  innerHTML: extra.value,
475
477
  class: "m-form-tip"
476
- }, null, 8, _hoisted_7$1)) : createCommentVNode("", true)
478
+ }, null, 8, _hoisted_8$1)) : createCommentVNode("", true)
477
479
  ]),
478
480
  _: 1
479
481
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -484,7 +486,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
484
486
  content: withCtx(() => [
485
487
  createElementVNode("div", {
486
488
  innerHTML: _ctx.config.tip
487
- }, null, 8, _hoisted_8$1)
489
+ }, null, 8, _hoisted_9)
488
490
  ]),
489
491
  default: withCtx(() => [
490
492
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -506,12 +508,12 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
506
508
  label: withCtx(() => [
507
509
  createElementVNode("span", {
508
510
  innerHTML: type.value === "checkbox" ? "" : text.value
509
- }, null, 8, _hoisted_9)
511
+ }, null, 8, _hoisted_10)
510
512
  ]),
511
513
  default: withCtx(() => [
512
514
  tooltip.value ? (openBlock(), createBlock(unref(TMagicTooltip), { key: 0 }, {
513
515
  content: withCtx(() => [
514
- createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_10)
516
+ createElementVNode("div", { innerHTML: tooltip.value }, null, 8, _hoisted_11)
515
517
  ]),
516
518
  default: withCtx(() => [
517
519
  (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
@@ -540,7 +542,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
540
542
  key: 2,
541
543
  innerHTML: extra.value,
542
544
  class: "m-form-tip"
543
- }, null, 8, _hoisted_11)) : createCommentVNode("", true)
545
+ }, null, 8, _hoisted_12)) : createCommentVNode("", true)
544
546
  ]),
545
547
  _: 1
546
548
  }, 8, ["style", "class", "prop", "label-width", "rules"]),
@@ -551,7 +553,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
551
553
  content: withCtx(() => [
552
554
  createElementVNode("div", {
553
555
  innerHTML: _ctx.config.tip
554
- }, null, 8, _hoisted_12)
556
+ }, null, 8, _hoisted_13)
555
557
  ]),
556
558
  default: withCtx(() => [
557
559
  createVNode(unref(TMagicIcon), { style: { "line-height": "40px", "margin-left": "5px" } }, {
@@ -582,7 +584,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
582
584
  }, null, 8, ["model", "last-values", "is-compare", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
583
585
  }), 128)) : createCommentVNode("", true)
584
586
  ], 64)) : createCommentVNode("", true),
585
- _ctx.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_13, [
587
+ _ctx.config.expand && type.value !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_14, [
586
588
  createVNode(unref(TMagicButton), {
587
589
  type: "primary",
588
590
  size: "small",
@@ -596,7 +598,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
596
598
  _: 1
597
599
  })
598
600
  ])) : createCommentVNode("", true)
599
- ], 6)) : createCommentVNode("", true);
601
+ ], 14, _hoisted_1$e)) : createCommentVNode("", true);
600
602
  };
601
603
  }
602
604
  });
@@ -2175,7 +2177,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2175
2177
  useAddField(props.prop);
2176
2178
  const requestFunc = getConfig("request");
2177
2179
  const tMagicCascader = ref();
2178
- const options = Array.isArray(props.config.options) ? ref(props.config.options) : ref([]);
2180
+ const options = ref([]);
2179
2181
  const remoteData = ref(null);
2180
2182
  const setRemoteOptions = async function() {
2181
2183
  const { config } = props;
@@ -2212,6 +2214,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2212
2214
  );
2213
2215
  } else if (!props.config.options?.length || props.config.remote) {
2214
2216
  Promise.resolve(setRemoteOptions());
2217
+ } else if (Array.isArray(props.config.options)) {
2218
+ watchEffect(() => {
2219
+ options.value = props.config.options;
2220
+ });
2215
2221
  }
2216
2222
  const changeHandler = (value) => {
2217
2223
  if (!tMagicCascader.value)
@@ -2232,7 +2238,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
2232
2238
  size: _ctx.size,
2233
2239
  placeholder: _ctx.config.placeholder,
2234
2240
  disabled: _ctx.disabled,
2235
- options: unref(options),
2241
+ options: options.value,
2236
2242
  props: {
2237
2243
  multiple: _ctx.config.multiple ?? false,
2238
2244
  emitPath: _ctx.config.emitPath ?? true,
@@ -4140,8 +4146,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
4140
4146
  }
4141
4147
  });
4142
4148
 
4143
- const index$1 = '';
4144
-
4145
4149
  const _hoisted_1$1 = { style: { "min-height": "1px" } };
4146
4150
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4147
4151
  ...{