@tmagic/form 1.5.0-beta.13 → 1.5.0-beta.14

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.
@@ -668,7 +668,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
668
668
  return (name.value ? _ctx.model[name.value] : _ctx.model) ? (openBlock(), createElementBlock("fieldset", {
669
669
  key: 0,
670
670
  class: "m-fieldset",
671
- style: normalizeStyle(show.value ? "padding: 15px 15px 0 5px;" : "border: 0")
671
+ style: normalizeStyle(show.value ? "padding: 15px" : "border: 0")
672
672
  }, [
673
673
  name.value && _ctx.config.checkbox ? (openBlock(), createBlock(resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
674
674
  default: withCtx(() => [
@@ -1024,7 +1024,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
1024
1024
  addable.value ? (openBlock(), createBlock(unref(TMagicButton), {
1025
1025
  key: 3,
1026
1026
  onClick: addHandler,
1027
- size: "small",
1027
+ type: "primary",
1028
1028
  disabled: _ctx.disabled
1029
1029
  }, {
1030
1030
  default: withCtx(() => _cache[2] || (_cache[2] = [
@@ -2616,9 +2616,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
2616
2616
  const props = __props;
2617
2617
  const emit = __emit;
2618
2618
  useAddField(props.prop);
2619
- const value = props.model?.[props.name].toString();
2619
+ const value = props.model?.[props.name]?.toString();
2620
2620
  if (props.model) {
2621
- if (value === "Invalid Date") {
2621
+ if (!value || value === "Invalid Date") {
2622
2622
  props.model[props.name] = "";
2623
2623
  } else {
2624
2624
  props.model[props.name] = datetimeFormatter(
@@ -665,7 +665,7 @@
665
665
  return (name.value ? _ctx.model[name.value] : _ctx.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
666
666
  key: 0,
667
667
  class: "m-fieldset",
668
- style: vue.normalizeStyle(show.value ? "padding: 15px 15px 0 5px;" : "border: 0")
668
+ style: vue.normalizeStyle(show.value ? "padding: 15px" : "border: 0")
669
669
  }, [
670
670
  name.value && _ctx.config.checkbox ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!show.value ? "div" : "legend"), { key: 0 }, {
671
671
  default: vue.withCtx(() => [
@@ -1021,7 +1021,7 @@
1021
1021
  addable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
1022
1022
  key: 3,
1023
1023
  onClick: addHandler,
1024
- size: "small",
1024
+ type: "primary",
1025
1025
  disabled: _ctx.disabled
1026
1026
  }, {
1027
1027
  default: vue.withCtx(() => _cache[2] || (_cache[2] = [
@@ -2613,9 +2613,9 @@
2613
2613
  const props = __props;
2614
2614
  const emit = __emit;
2615
2615
  useAddField(props.prop);
2616
- const value = props.model?.[props.name].toString();
2616
+ const value = props.model?.[props.name]?.toString();
2617
2617
  if (props.model) {
2618
- if (value === "Invalid Date") {
2618
+ if (!value || value === "Invalid Date") {
2619
2619
  props.model[props.name] = "";
2620
2620
  } else {
2621
2621
  props.model[props.name] = datetimeFormatter(
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.0-beta.13",
2
+ "version": "1.5.0-beta.14",
3
3
  "name": "@tmagic/form",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -55,8 +55,8 @@
55
55
  "peerDependencies": {
56
56
  "vue": "^3.5.0",
57
57
  "typescript": "*",
58
- "@tmagic/design": "1.5.0-beta.13",
59
- "@tmagic/utils": "1.5.0-beta.13"
58
+ "@tmagic/design": "1.5.0-beta.14",
59
+ "@tmagic/utils": "1.5.0-beta.14"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "typescript": {
@@ -1,9 +1,5 @@
1
1
  <template>
2
- <fieldset
3
- v-if="name ? model[name] : model"
4
- class="m-fieldset"
5
- :style="show ? 'padding: 15px 15px 0 5px;' : 'border: 0'"
6
- >
2
+ <fieldset v-if="name ? model[name] : model" class="m-fieldset" :style="show ? 'padding: 15px' : 'border: 0'">
7
3
  <component v-if="name && config.checkbox" :is="!show ? 'div' : 'legend'">
8
4
  <TMagicCheckbox
9
5
  v-model="model[name].value"
@@ -25,7 +25,7 @@
25
25
  @addDiffCount="onAddDiffCount()"
26
26
  ></MFieldsGroupListItem>
27
27
 
28
- <TMagicButton @click="addHandler" size="small" :disabled="disabled" v-if="addable">新增</TMagicButton>
28
+ <TMagicButton @click="addHandler" type="primary" :disabled="disabled" v-if="addable">新增</TMagicButton>
29
29
 
30
30
  <TMagicButton :icon="Grid" size="small" @click="toggleMode" v-if="config.enableToggleMode">切换为表格</TMagicButton>
31
31
  </div>
@@ -32,9 +32,9 @@ const emit = defineEmits<{
32
32
 
33
33
  useAddField(props.prop);
34
34
 
35
- const value = props.model?.[props.name].toString();
35
+ const value = props.model?.[props.name]?.toString();
36
36
  if (props.model) {
37
- if (value === 'Invalid Date') {
37
+ if (!value || value === 'Invalid Date') {
38
38
  props.model[props.name] = '';
39
39
  } else {
40
40
  props.model[props.name] = datetimeFormatter(