@fangzhongya/fang-ui 0.1.55 → 0.1.56

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 (232) hide show
  1. package/dist/components/audios/src/index2.cjs +16 -10
  2. package/dist/components/audios/src/index2.js +16 -10
  3. package/dist/components/box-adjust/src/index2.cjs +6 -4
  4. package/dist/components/box-adjust/src/index2.js +6 -4
  5. package/dist/components/box-title/src/index2.cjs +3 -2
  6. package/dist/components/box-title/src/index2.js +3 -2
  7. package/dist/components/buttons/src/data.d.ts +5 -5
  8. package/dist/components/buttons/src/index2.cjs +2 -2
  9. package/dist/components/buttons/src/index2.js +2 -2
  10. package/dist/components/cascaders/src/data.d.ts +5 -5
  11. package/dist/components/checks/src/data.d.ts +5 -5
  12. package/dist/components/common/list.d.ts +1 -1
  13. package/dist/components/common/use.cjs +1 -1
  14. package/dist/components/common/use.js +1 -1
  15. package/dist/components/dates/src/data.d.ts +5 -5
  16. package/dist/components/dates2/src/data.d.ts +5 -5
  17. package/dist/components/double/src/index2.cjs +3 -2
  18. package/dist/components/double/src/index2.js +3 -2
  19. package/dist/components/edit/src/index2.cjs +3 -2
  20. package/dist/components/edit/src/index2.js +3 -2
  21. package/dist/components/edit-data/src/area/array-json2.cjs +8 -4
  22. package/dist/components/edit-data/src/area/array-json2.js +8 -4
  23. package/dist/components/edit-data/src/area/array2.cjs +46 -8
  24. package/dist/components/edit-data/src/area/array2.js +47 -9
  25. package/dist/components/edit-data/src/area/editor2.cjs +22 -4
  26. package/dist/components/edit-data/src/area/editor2.js +22 -4
  27. package/dist/components/edit-data/src/area/general2.cjs +8 -1
  28. package/dist/components/edit-data/src/area/general2.js +8 -1
  29. package/dist/components/edit-data/src/area/object-json2.cjs +5 -1
  30. package/dist/components/edit-data/src/area/object-json2.js +5 -1
  31. package/dist/components/edit-data/src/area/object2.cjs +48 -11
  32. package/dist/components/edit-data/src/area/object2.js +49 -12
  33. package/dist/components/edit-data/src/data/array2.cjs +9 -5
  34. package/dist/components/edit-data/src/data/array2.js +9 -5
  35. package/dist/components/edit-data/src/data/bigint2.cjs +7 -3
  36. package/dist/components/edit-data/src/data/bigint2.js +7 -3
  37. package/dist/components/edit-data/src/data/boolean2.cjs +7 -3
  38. package/dist/components/edit-data/src/data/boolean2.js +7 -3
  39. package/dist/components/edit-data/src/data/date.cjs +4 -0
  40. package/dist/components/edit-data/src/data/date.js +4 -0
  41. package/dist/components/edit-data/src/data/date2.cjs +48 -0
  42. package/dist/components/edit-data/src/data/date2.js +48 -0
  43. package/dist/components/edit-data/src/data/function2.cjs +16 -7
  44. package/dist/components/edit-data/src/data/function2.js +17 -8
  45. package/dist/components/edit-data/src/data/null2.cjs +3 -1
  46. package/dist/components/edit-data/src/data/null2.js +4 -2
  47. package/dist/components/edit-data/src/data/number2.cjs +7 -3
  48. package/dist/components/edit-data/src/data/number2.js +7 -3
  49. package/dist/components/edit-data/src/data/object2.cjs +9 -5
  50. package/dist/components/edit-data/src/data/object2.js +9 -5
  51. package/dist/components/edit-data/src/data/other2.cjs +13 -5
  52. package/dist/components/edit-data/src/data/other2.js +14 -6
  53. package/dist/components/edit-data/src/data/string2.cjs +7 -3
  54. package/dist/components/edit-data/src/data/string2.js +7 -3
  55. package/dist/components/edit-data/src/data/symbol2.cjs +7 -3
  56. package/dist/components/edit-data/src/data/symbol2.js +7 -3
  57. package/dist/components/edit-data/src/data/undefined2.cjs +3 -1
  58. package/dist/components/edit-data/src/data/undefined2.js +4 -2
  59. package/dist/components/edit-data/src/data.cjs +10 -0
  60. package/dist/components/edit-data/src/data.d.ts +20 -0
  61. package/dist/components/edit-data/src/data.js +10 -0
  62. package/dist/components/edit-data/src/index2.cjs +31 -2
  63. package/dist/components/edit-data/src/index2.js +45 -16
  64. package/dist/components/edit-data-add/src/index2.cjs +2 -0
  65. package/dist/components/edit-data-add/src/index2.js +2 -0
  66. package/dist/components/edit-float/src/index2.cjs +3 -2
  67. package/dist/components/edit-float/src/index2.js +3 -2
  68. package/dist/components/history/src/index2.cjs +6 -4
  69. package/dist/components/history/src/index2.js +6 -4
  70. package/dist/components/input-array/src/index2.cjs +3 -2
  71. package/dist/components/input-array/src/index2.js +3 -2
  72. package/dist/components/input-history/src/index2.cjs +3 -2
  73. package/dist/components/input-history/src/index2.js +3 -2
  74. package/dist/components/input-select/src/index2.cjs +6 -4
  75. package/dist/components/input-select/src/index2.js +6 -4
  76. package/dist/components/labels/src/data.d.ts +5 -5
  77. package/dist/components/message/index.d.ts +11 -4
  78. package/dist/components/message/src/function.d.ts +11 -4
  79. package/dist/components/message-box/index.d.ts +2 -3
  80. package/dist/components/message-box/src/function.d.ts +2 -3
  81. package/dist/components/retract/index.css +23 -20
  82. package/dist/components/retract/index.scss +39 -20
  83. package/dist/components/retract/src/data.cjs +4 -1
  84. package/dist/components/retract/src/data.d.ts +4 -1
  85. package/dist/components/retract/src/data.js +4 -1
  86. package/dist/components/retract/src/index2.cjs +12 -10
  87. package/dist/components/retract/src/index2.js +9 -7
  88. package/dist/components/right-key/index.css +2 -1
  89. package/dist/components/right-key/index.scss +2 -1
  90. package/dist/components/right-key/src/data.cjs +7 -2
  91. package/dist/components/right-key/src/data.d.ts +5 -0
  92. package/dist/components/right-key/src/data.js +7 -2
  93. package/dist/components/right-key/src/index2.cjs +134 -60
  94. package/dist/components/right-key/src/index2.js +135 -61
  95. package/dist/components/selects/src/data.d.ts +5 -5
  96. package/dist/components/stick-window/src/index2.cjs +3 -2
  97. package/dist/components/stick-window/src/index2.js +3 -2
  98. package/dist/components/switchs/src/data.d.ts +5 -4
  99. package/dist/components/uploads/src/data.d.ts +5 -5
  100. package/dist/components/uploads/src/index2.cjs +26 -21
  101. package/dist/components/uploads/src/index2.js +15 -10
  102. package/dist/components/videos/src/index2.cjs +30 -19
  103. package/dist/components/videos/src/index2.js +30 -19
  104. package/dist/components/window/src/index2.cjs +9 -6
  105. package/dist/components/window/src/index2.js +9 -6
  106. package/dist/css/index.css +25 -21
  107. package/dist/css/retract.css +23 -20
  108. package/dist/css/right-key.css +2 -1
  109. package/dist/hooks/model/index.cjs +25 -0
  110. package/dist/hooks/model/index.d.ts +2 -0
  111. package/dist/hooks/model/index.js +25 -0
  112. package/dist/icons/index.json +1 -1
  113. package/dist/icons/vue/bar.cjs +2 -18
  114. package/dist/icons/vue/bar.js +1 -17
  115. package/dist/icons/vue/bar2.cjs +21 -2
  116. package/dist/icons/vue/bar2.js +21 -2
  117. package/dist/icons/vue/below.cjs +2 -18
  118. package/dist/icons/vue/below.js +1 -17
  119. package/dist/icons/vue/below2.cjs +21 -2
  120. package/dist/icons/vue/below2.js +21 -2
  121. package/dist/icons/vue/bicycle.cjs +2 -15
  122. package/dist/icons/vue/bicycle.js +1 -14
  123. package/dist/icons/vue/bicycle2.cjs +18 -2
  124. package/dist/icons/vue/bicycle2.js +18 -2
  125. package/dist/icons/vue/bottom-left.cjs +2 -22
  126. package/dist/icons/vue/bottom-left.js +1 -21
  127. package/dist/icons/vue/bottom-left2.cjs +25 -2
  128. package/dist/icons/vue/bottom-left2.js +25 -2
  129. package/dist/icons/vue/bottom-right.cjs +2 -22
  130. package/dist/icons/vue/bottom-right.js +1 -21
  131. package/dist/icons/vue/bottom-right2.cjs +25 -2
  132. package/dist/icons/vue/bottom-right2.js +25 -2
  133. package/dist/icons/vue/bottom.cjs +2 -18
  134. package/dist/icons/vue/bottom.js +1 -17
  135. package/dist/icons/vue/bottom2.cjs +21 -2
  136. package/dist/icons/vue/bottom2.js +21 -2
  137. package/dist/icons/vue/catalogue.cjs +2 -23
  138. package/dist/icons/vue/catalogue.js +1 -22
  139. package/dist/icons/vue/catalogue2.cjs +26 -2
  140. package/dist/icons/vue/catalogue2.js +26 -2
  141. package/dist/icons/vue/clear.cjs +2 -23
  142. package/dist/icons/vue/clear.js +1 -22
  143. package/dist/icons/vue/clear2.cjs +26 -2
  144. package/dist/icons/vue/clear2.js +26 -2
  145. package/dist/icons/vue/close.cjs +2 -18
  146. package/dist/icons/vue/close.js +1 -17
  147. package/dist/icons/vue/close2.cjs +21 -2
  148. package/dist/icons/vue/close2.js +21 -2
  149. package/dist/icons/vue/delete.cjs +2 -18
  150. package/dist/icons/vue/delete.js +1 -17
  151. package/dist/icons/vue/delete2.cjs +21 -2
  152. package/dist/icons/vue/delete2.js +21 -2
  153. package/dist/icons/vue/document.cjs +2 -23
  154. package/dist/icons/vue/document.js +1 -22
  155. package/dist/icons/vue/document2.cjs +26 -2
  156. package/dist/icons/vue/document2.js +26 -2
  157. package/dist/icons/vue/down.cjs +2 -18
  158. package/dist/icons/vue/down.js +1 -17
  159. package/dist/icons/vue/down2.cjs +21 -2
  160. package/dist/icons/vue/down2.js +21 -2
  161. package/dist/icons/vue/download.cjs +2 -18
  162. package/dist/icons/vue/download.js +1 -17
  163. package/dist/icons/vue/download2.cjs +21 -2
  164. package/dist/icons/vue/download2.js +21 -2
  165. package/dist/icons/vue/edit.cjs +2 -23
  166. package/dist/icons/vue/edit.js +1 -22
  167. package/dist/icons/vue/edit2.cjs +26 -2
  168. package/dist/icons/vue/edit2.js +26 -2
  169. package/dist/icons/vue/enter.cjs +2 -19
  170. package/dist/icons/vue/enter.js +1 -18
  171. package/dist/icons/vue/enter2.cjs +22 -2
  172. package/dist/icons/vue/enter2.js +22 -2
  173. package/dist/icons/vue/frame.cjs +2 -15
  174. package/dist/icons/vue/frame.js +1 -14
  175. package/dist/icons/vue/frame2.cjs +18 -2
  176. package/dist/icons/vue/frame2.js +18 -2
  177. package/dist/icons/vue/index.cjs +81 -54
  178. package/dist/icons/vue/index.js +54 -27
  179. package/dist/icons/vue/left.cjs +2 -18
  180. package/dist/icons/vue/left.js +1 -17
  181. package/dist/icons/vue/left2.cjs +21 -2
  182. package/dist/icons/vue/left2.js +21 -2
  183. package/dist/icons/vue/mute.cjs +2 -18
  184. package/dist/icons/vue/mute.js +1 -17
  185. package/dist/icons/vue/mute2.cjs +21 -2
  186. package/dist/icons/vue/mute2.js +21 -2
  187. package/dist/icons/vue/pause.cjs +2 -24
  188. package/dist/icons/vue/pause.js +1 -23
  189. package/dist/icons/vue/pause2.cjs +27 -2
  190. package/dist/icons/vue/pause2.js +27 -2
  191. package/dist/icons/vue/play.cjs +2 -19
  192. package/dist/icons/vue/play.js +1 -18
  193. package/dist/icons/vue/play2.cjs +22 -2
  194. package/dist/icons/vue/play2.js +22 -2
  195. package/dist/icons/vue/plus.cjs +2 -18
  196. package/dist/icons/vue/plus.js +1 -17
  197. package/dist/icons/vue/plus2.cjs +21 -2
  198. package/dist/icons/vue/plus2.js +21 -2
  199. package/dist/icons/vue/retreat.cjs +2 -19
  200. package/dist/icons/vue/retreat.js +1 -18
  201. package/dist/icons/vue/retreat2.cjs +22 -2
  202. package/dist/icons/vue/retreat2.js +22 -2
  203. package/dist/icons/vue/right.cjs +2 -18
  204. package/dist/icons/vue/right.js +1 -17
  205. package/dist/icons/vue/right2.cjs +21 -2
  206. package/dist/icons/vue/right2.js +21 -2
  207. package/dist/icons/vue/sound.cjs +2 -22
  208. package/dist/icons/vue/sound.js +1 -21
  209. package/dist/icons/vue/sound2.cjs +25 -2
  210. package/dist/icons/vue/sound2.js +25 -2
  211. package/dist/icons/vue/star.cjs +2 -22
  212. package/dist/icons/vue/star.js +1 -21
  213. package/dist/icons/vue/star2.cjs +25 -2
  214. package/dist/icons/vue/star2.js +25 -2
  215. package/dist/icons/vue/up.cjs +2 -18
  216. package/dist/icons/vue/up.js +1 -17
  217. package/dist/icons/vue/up2.cjs +21 -2
  218. package/dist/icons/vue/up2.js +21 -2
  219. package/dist/icons/vue/views.cjs +2 -18
  220. package/dist/icons/vue/views.js +1 -17
  221. package/dist/icons/vue/views2.cjs +21 -2
  222. package/dist/icons/vue/views2.js +21 -2
  223. package/dist/index.css +25 -21
  224. package/dist/utils/vues/index.d.ts +1 -0
  225. package/dist/utils/vues/shared.cjs +19 -0
  226. package/dist/utils/vues/shared.d.ts +5 -0
  227. package/dist/utils/vues/shared.js +19 -0
  228. package/package.json +12 -13
  229. package/dist/_virtual/_plugin-vue_export-helper.cjs +0 -10
  230. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  231. /package/dist/components/{box-fun → box}/index.css +0 -0
  232. /package/dist/css/{box-fun.css → box.css} +0 -0
@@ -1,7 +1,8 @@
1
- import { defineComponent, ref, computed, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createVNode, withCtx, createTextVNode, Fragment, renderList, createElementVNode, toDisplayString, mergeProps } from "vue";
1
+ import { defineComponent, reactive, computed, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, createBlock, createVNode, withCtx, createTextVNode, Fragment, renderList, createElementVNode, toDisplayString, mergeProps } from "vue";
2
2
  import { NoData } from "../../../no-data/index.js";
3
3
  import { Icon } from "../../../icon/index.js";
4
- import Delete from "../../../../icons/vue/delete.js";
4
+ import "../../../../icons/vue/edit.js";
5
+ import "../../../../icons/vue/delete.js";
5
6
  import { dataDataEmits, dataDataProps, name } from "../data.js";
6
7
  import { useCssName } from "../../../../hooks/cssname/index.js";
7
8
  import { useLocale } from "../../../../hooks/locale/index.js";
@@ -9,16 +10,22 @@ import "../index.js";
9
10
  import { Button } from "../../../button/index.js";
10
11
  import { EditDataAdd } from "../../../edit-data-add/index.js";
11
12
  import _sfc_main$1 from "../index2.js";
13
+ import _sfc_main$2 from "../../../../icons/vue/edit2.js";
14
+ import _sfc_main$3 from "../../../../icons/vue/delete2.js";
12
15
  const _sfc_main = /* @__PURE__ */ defineComponent({
13
16
  __name: "object",
14
17
  props: dataDataProps,
15
18
  emits: dataDataEmits,
16
- setup(__props, { expose: __expose, emit: __emit }) {
19
+ setup(__props, { emit: __emit }) {
17
20
  const cs = useCssName(name);
18
21
  const { getLocale } = useLocale();
19
22
  const props = __props;
20
23
  const emit = __emit;
21
- const box = ref(false);
24
+ const box = reactive({
25
+ value: false,
26
+ type: 0,
27
+ row: ""
28
+ });
22
29
  const value = computed({
23
30
  get() {
24
31
  return props.modelValue;
@@ -32,15 +39,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32
39
  };
33
40
  const onAdd = () => {
34
41
  box.value = true;
42
+ box.type = 0;
43
+ box.row = "";
35
44
  };
36
45
  const onSubmit = (v) => {
37
- value.value[v.label] = v.value;
46
+ if (value.value === void 0) {
47
+ value.value = { [v.label]: v.value };
48
+ } else {
49
+ if (box.type == 0) {
50
+ value.value[v.label] = v.value;
51
+ } else {
52
+ value.value[box.row] = v.value;
53
+ }
54
+ }
38
55
  };
39
56
  const onDelete = (index) => {
40
57
  value.value[index] = void 0;
41
58
  delete value.value[index];
42
59
  };
43
- __expose({});
60
+ const onEdit = (index) => {
61
+ box.value = true;
62
+ box.type = 1;
63
+ box.row = index;
64
+ };
44
65
  return (_ctx, _cache) => {
45
66
  return openBlock(), createElementBlock("div", {
46
67
  class: normalizeClass(unref(cs).z("area-object"))
@@ -77,8 +98,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
77
98
  }), null, 16, ["modelValue", "onUpdate:modelValue"])
78
99
  ], 2),
79
100
  createElementVNode("div", null, [
80
- props.editable ? (openBlock(), createBlock(unref(Button), {
101
+ props.isEmpty && item === void 0 ? (openBlock(), createBlock(unref(Button), {
81
102
  key: 0,
103
+ type: "primary",
104
+ onClick: ($event) => onEdit(index),
105
+ text: ""
106
+ }, {
107
+ default: withCtx(() => [
108
+ createVNode(unref(Icon), { title: "修改" }, {
109
+ default: withCtx(() => [
110
+ createVNode(_sfc_main$2)
111
+ ]),
112
+ _: 1
113
+ })
114
+ ]),
115
+ _: 1
116
+ }, 8, ["onClick"])) : createCommentVNode("", true),
117
+ props.editable ? (openBlock(), createBlock(unref(Button), {
118
+ key: 1,
82
119
  type: "danger",
83
120
  onClick: ($event) => onDelete(index),
84
121
  text: ""
@@ -86,7 +123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
86
123
  default: withCtx(() => [
87
124
  createVNode(unref(Icon), { title: "删除" }, {
88
125
  default: withCtx(() => [
89
- createVNode(Delete)
126
+ createVNode(_sfc_main$3)
90
127
  ]),
91
128
  _: 1
92
129
  })
@@ -96,17 +133,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
133
  ])
97
134
  ], 2);
98
135
  }), 128)),
99
- Object.keys(value.value).length == 0 ? (openBlock(), createBlock(unref(NoData), {
136
+ (value.value ? Object.keys(value.value).length == 0 : true) ? (openBlock(), createBlock(unref(NoData), {
100
137
  key: 1,
101
138
  value: "空对象"
102
139
  })) : createCommentVNode("", true),
103
140
  createVNode(unref(EditDataAdd), mergeProps(props, {
104
- type: "object",
105
- title: "新增对象",
141
+ type: box.type == 1 ? "array" : "object",
142
+ title: box.type == 1 ? "修改对象" : "新增对象",
106
143
  modelValue: box.value,
107
144
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => box.value = $event),
108
145
  onSubmit
109
- }), null, 16, ["modelValue"])
146
+ }), null, 16, ["type", "title", "modelValue"])
110
147
  ], 2);
111
148
  };
112
149
  }
@@ -21,8 +21,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
21
  return v;
22
22
  } else {
23
23
  if (v) {
24
- return json5.parse(v) || [];
25
- } else {
24
+ return json5.parse(v);
25
+ } else if (!props.isEmpty) {
26
26
  return [];
27
27
  }
28
28
  }
@@ -40,9 +40,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
40
  get() {
41
41
  if (props.modelValue) {
42
42
  return props.modelValue;
43
- } else {
44
- emit("update:modelValue", []);
45
- return [];
43
+ } else if (!props.isEmpty) {
44
+ if (props.default) {
45
+ return props.default;
46
+ } else {
47
+ emit("update:modelValue", []);
48
+ return [];
49
+ }
46
50
  }
47
51
  },
48
52
  set(value2) {
@@ -19,8 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  return v;
20
20
  } else {
21
21
  if (v) {
22
- return json5.parse(v) || [];
23
- } else {
22
+ return json5.parse(v);
23
+ } else if (!props.isEmpty) {
24
24
  return [];
25
25
  }
26
26
  }
@@ -38,9 +38,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  get() {
39
39
  if (props.modelValue) {
40
40
  return props.modelValue;
41
- } else {
42
- emit("update:modelValue", []);
43
- return [];
41
+ } else if (!props.isEmpty) {
42
+ if (props.default) {
43
+ return props.default;
44
+ } else {
45
+ emit("update:modelValue", []);
46
+ return [];
47
+ }
44
48
  }
45
49
  },
46
50
  set(value2) {
@@ -18,9 +18,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
18
18
  get() {
19
19
  if (props.modelValue || props.modelValue === 0) {
20
20
  return props.modelValue;
21
- } else {
22
- emit("update:modelValue", BigInt(0));
23
- return 0;
21
+ } else if (!props.isEmpty) {
22
+ if (props.default) {
23
+ return props.default;
24
+ } else {
25
+ emit("update:modelValue", BigInt(0));
26
+ return 0;
27
+ }
24
28
  }
25
29
  },
26
30
  set(value2) {
@@ -16,9 +16,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  get() {
17
17
  if (props.modelValue || props.modelValue === 0) {
18
18
  return props.modelValue;
19
- } else {
20
- emit("update:modelValue", BigInt(0));
21
- return 0;
19
+ } else if (!props.isEmpty) {
20
+ if (props.default) {
21
+ return props.default;
22
+ } else {
23
+ emit("update:modelValue", BigInt(0));
24
+ return 0;
25
+ }
22
26
  }
23
27
  },
24
28
  set(value2) {
@@ -28,9 +28,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28
28
  get() {
29
29
  if (props.modelValue || props.modelValue === false) {
30
30
  return props.modelValue;
31
- } else {
32
- emit("update:modelValue", false);
33
- return false;
31
+ } else if (!props.isEmpty) {
32
+ if (props.default) {
33
+ return props.default;
34
+ } else {
35
+ emit("update:modelValue", false);
36
+ return false;
37
+ }
34
38
  }
35
39
  },
36
40
  set(value2) {
@@ -26,9 +26,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
26
  get() {
27
27
  if (props.modelValue || props.modelValue === false) {
28
28
  return props.modelValue;
29
- } else {
30
- emit("update:modelValue", false);
31
- return false;
29
+ } else if (!props.isEmpty) {
30
+ if (props.default) {
31
+ return props.default;
32
+ } else {
33
+ emit("update:modelValue", false);
34
+ return false;
35
+ }
32
36
  }
33
37
  },
34
38
  set(value2) {
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const date_vue_vue_type_script_setup_true_lang = require("./date2.cjs");
4
+ exports.default = date_vue_vue_type_script_setup_true_lang.default;
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./date2.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const vue = require("vue");
4
+ const data = require("../data.cjs");
5
+ const index$2 = require("../../../dates/index.cjs");
6
+ const index = require("../../../../hooks/cssname/index.cjs");
7
+ const index$1 = require("../../../../hooks/locale/index.cjs");
8
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
+ __name: "date",
10
+ props: data.dataDataProps,
11
+ emits: data.dataDataEmits,
12
+ setup(__props, { emit: __emit }) {
13
+ const cs = index.useCssName(data.name);
14
+ const { getLocale } = index$1.useLocale();
15
+ const props = __props;
16
+ const emit = __emit;
17
+ const value = vue.computed({
18
+ get() {
19
+ if (props.modelValue) {
20
+ return props.modelValue;
21
+ } else if (!props.isEmpty) {
22
+ if (props.default) {
23
+ return props.default;
24
+ } else {
25
+ const v = /* @__PURE__ */ new Date();
26
+ emit("update:modelValue", v);
27
+ return v;
28
+ }
29
+ }
30
+ },
31
+ set(value2) {
32
+ emit("update:modelValue", value2);
33
+ }
34
+ });
35
+ return (_ctx, _cache) => {
36
+ return vue.openBlock(), vue.createElementBlock("div", {
37
+ class: vue.normalizeClass(vue.unref(cs).z("date"))
38
+ }, [
39
+ vue.createVNode(vue.unref(index$2.Dates), {
40
+ modelValue: value.value,
41
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
42
+ type: "datetime"
43
+ }, null, 8, ["modelValue"])
44
+ ], 2);
45
+ };
46
+ }
47
+ });
48
+ exports.default = _sfc_main;
@@ -0,0 +1,48 @@
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createVNode } from "vue";
2
+ import { dataDataEmits, dataDataProps, name } from "../data.js";
3
+ import { Dates } from "../../../dates/index.js";
4
+ import { useCssName } from "../../../../hooks/cssname/index.js";
5
+ import { useLocale } from "../../../../hooks/locale/index.js";
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "date",
8
+ props: dataDataProps,
9
+ emits: dataDataEmits,
10
+ setup(__props, { emit: __emit }) {
11
+ const cs = useCssName(name);
12
+ const { getLocale } = useLocale();
13
+ const props = __props;
14
+ const emit = __emit;
15
+ const value = computed({
16
+ get() {
17
+ if (props.modelValue) {
18
+ return props.modelValue;
19
+ } else if (!props.isEmpty) {
20
+ if (props.default) {
21
+ return props.default;
22
+ } else {
23
+ const v = /* @__PURE__ */ new Date();
24
+ emit("update:modelValue", v);
25
+ return v;
26
+ }
27
+ }
28
+ },
29
+ set(value2) {
30
+ emit("update:modelValue", value2);
31
+ }
32
+ });
33
+ return (_ctx, _cache) => {
34
+ return openBlock(), createElementBlock("div", {
35
+ class: normalizeClass(unref(cs).z("date"))
36
+ }, [
37
+ createVNode(unref(Dates), {
38
+ modelValue: value.value,
39
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
40
+ type: "datetime"
41
+ }, null, 8, ["modelValue"])
42
+ ], 2);
43
+ };
44
+ }
45
+ });
46
+ export {
47
+ _sfc_main as default
48
+ };
@@ -17,7 +17,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  const props = __props;
18
18
  const emit = __emit;
19
19
  const getValue = (v) => {
20
- return toFunction.toFunction(v);
20
+ if (v) {
21
+ return toFunction.toFunction(v);
22
+ } else if (!props.isEmpty) {
23
+ return function() {
24
+ };
25
+ }
21
26
  };
22
27
  const check = (v) => {
23
28
  try {
@@ -32,10 +37,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
32
37
  get() {
33
38
  if (props.modelValue) {
34
39
  return props.modelValue.toString();
35
- } else {
36
- emit("update:modelValue", function() {
37
- });
38
- return "function () {}";
40
+ } else if (!props.isEmpty) {
41
+ if (props.default) {
42
+ return props.default;
43
+ } else {
44
+ emit("update:modelValue", function() {
45
+ });
46
+ return "function () {}";
47
+ }
39
48
  }
40
49
  },
41
50
  set(value2) {
@@ -47,13 +56,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
47
56
  return vue.openBlock(), vue.createElementBlock("div", {
48
57
  class: vue.normalizeClass(vue.unref(cs).z("function"))
49
58
  }, [
50
- vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, {
59
+ vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(props, {
51
60
  check,
52
61
  modelValue: value.value,
53
62
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
54
63
  title: "方法设置",
55
64
  type: "function"
56
- }, null, 8, ["modelValue"])
65
+ }), null, 16, ["modelValue"])
57
66
  ], 2);
58
67
  };
59
68
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createVNode } from "vue";
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, createVNode, mergeProps } from "vue";
2
2
  import { dataDataEmits, dataDataProps, name } from "../data.js";
3
3
  import { useCssName } from "../../../../hooks/cssname/index.js";
4
4
  import { useLocale } from "../../../../hooks/locale/index.js";
@@ -15,7 +15,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  const props = __props;
16
16
  const emit = __emit;
17
17
  const getValue = (v) => {
18
- return toFunction(v);
18
+ if (v) {
19
+ return toFunction(v);
20
+ } else if (!props.isEmpty) {
21
+ return function() {
22
+ };
23
+ }
19
24
  };
20
25
  const check = (v) => {
21
26
  try {
@@ -30,10 +35,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
30
35
  get() {
31
36
  if (props.modelValue) {
32
37
  return props.modelValue.toString();
33
- } else {
34
- emit("update:modelValue", function() {
35
- });
36
- return "function () {}";
38
+ } else if (!props.isEmpty) {
39
+ if (props.default) {
40
+ return props.default;
41
+ } else {
42
+ emit("update:modelValue", function() {
43
+ });
44
+ return "function () {}";
45
+ }
37
46
  }
38
47
  },
39
48
  set(value2) {
@@ -45,13 +54,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
54
  return openBlock(), createElementBlock("div", {
46
55
  class: normalizeClass(unref(cs).z("function"))
47
56
  }, [
48
- createVNode(_sfc_main$1, {
57
+ createVNode(_sfc_main$1, mergeProps(props, {
49
58
  check,
50
59
  modelValue: value.value,
51
60
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
52
61
  title: "方法设置",
53
62
  type: "function"
54
- }, null, 8, ["modelValue"])
63
+ }), null, 16, ["modelValue"])
55
64
  ], 2);
56
65
  };
57
66
  }
@@ -17,7 +17,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  return (_ctx, _cache) => {
18
18
  return vue.openBlock(), vue.createElementBlock("div", {
19
19
  class: vue.normalizeClass(vue.unref(cs).z("null"))
20
- }, "null", 2);
20
+ }, [..._cache[0] || (_cache[0] = [
21
+ vue.createElementVNode("span", null, "null", -1)
22
+ ])], 2);
21
23
  };
22
24
  }
23
25
  });
@@ -1,4 +1,4 @@
1
- import { defineComponent, onMounted, createElementBlock, openBlock, normalizeClass, unref } from "vue";
1
+ import { defineComponent, onMounted, createElementBlock, openBlock, normalizeClass, unref, createElementVNode } from "vue";
2
2
  import { dataDataEmits, dataDataProps, name } from "../data.js";
3
3
  import { useCssName } from "../../../../hooks/cssname/index.js";
4
4
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -15,7 +15,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
15
15
  return (_ctx, _cache) => {
16
16
  return openBlock(), createElementBlock("div", {
17
17
  class: normalizeClass(unref(cs).z("null"))
18
- }, "null", 2);
18
+ }, [..._cache[0] || (_cache[0] = [
19
+ createElementVNode("span", null, "null", -1)
20
+ ])], 2);
19
21
  };
20
22
  }
21
23
  });
@@ -18,9 +18,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
18
18
  get() {
19
19
  if (props.modelValue || props.modelValue === 0) {
20
20
  return props.modelValue;
21
- } else {
22
- emit("update:modelValue", 0);
23
- return 0;
21
+ } else if (!props.isEmpty) {
22
+ if (props.default) {
23
+ return props.default;
24
+ } else {
25
+ emit("update:modelValue", 0);
26
+ return 0;
27
+ }
24
28
  }
25
29
  },
26
30
  set(value2) {
@@ -16,9 +16,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  get() {
17
17
  if (props.modelValue || props.modelValue === 0) {
18
18
  return props.modelValue;
19
- } else {
20
- emit("update:modelValue", 0);
21
- return 0;
19
+ } else if (!props.isEmpty) {
20
+ if (props.default) {
21
+ return props.default;
22
+ } else {
23
+ emit("update:modelValue", 0);
24
+ return 0;
25
+ }
22
26
  }
23
27
  },
24
28
  set(value2) {
@@ -21,8 +21,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
21
  return v;
22
22
  } else {
23
23
  if (v) {
24
- return json5.parse(v) || {};
25
- } else {
24
+ return json5.parse(v);
25
+ } else if (!props.isEmpty) {
26
26
  return {};
27
27
  }
28
28
  }
@@ -40,9 +40,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
40
40
  get() {
41
41
  if (props.modelValue) {
42
42
  return props.modelValue;
43
- } else {
44
- emit("update:modelValue", {});
45
- return {};
43
+ } else if (!props.isEmpty) {
44
+ if (props.default) {
45
+ return props.default;
46
+ } else {
47
+ emit("update:modelValue", {});
48
+ return {};
49
+ }
46
50
  }
47
51
  },
48
52
  set(value2) {
@@ -19,8 +19,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  return v;
20
20
  } else {
21
21
  if (v) {
22
- return json5.parse(v) || {};
23
- } else {
22
+ return json5.parse(v);
23
+ } else if (!props.isEmpty) {
24
24
  return {};
25
25
  }
26
26
  }
@@ -38,9 +38,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
38
38
  get() {
39
39
  if (props.modelValue) {
40
40
  return props.modelValue;
41
- } else {
42
- emit("update:modelValue", {});
43
- return {};
41
+ } else if (!props.isEmpty) {
42
+ if (props.default) {
43
+ return props.default;
44
+ } else {
45
+ emit("update:modelValue", {});
46
+ return {};
47
+ }
44
48
  }
45
49
  },
46
50
  set(value2) {
@@ -17,7 +17,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
17
17
  const props = __props;
18
18
  const emit = __emit;
19
19
  const getValue = (v) => {
20
- return getContent.getContent(v);
20
+ if (v) {
21
+ return getContent.getContent(v);
22
+ } else if (!props.isEmpty) {
23
+ return "";
24
+ }
21
25
  };
22
26
  const check = (v) => {
23
27
  try {
@@ -32,8 +36,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
32
36
  get() {
33
37
  if (props.modelValue) {
34
38
  return props.modelValue.toString();
35
- } else {
36
- return "";
39
+ } else if (!props.isEmpty) {
40
+ if (props.default) {
41
+ return props.default;
42
+ } else {
43
+ return "";
44
+ }
37
45
  }
38
46
  },
39
47
  set(value2) {
@@ -45,13 +53,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
45
53
  return vue.openBlock(), vue.createElementBlock("div", {
46
54
  class: vue.normalizeClass(vue.unref(cs).z("other"))
47
55
  }, [
48
- vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, {
56
+ vue.createVNode(general_vue_vue_type_script_setup_true_lang.default, vue.mergeProps(props, {
49
57
  check,
50
58
  modelValue: value.value,
51
59
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
52
60
  title: "自定义设置",
53
61
  type: "other"
54
- }, null, 8, ["modelValue"])
62
+ }), null, 16, ["modelValue"])
55
63
  ], 2);
56
64
  };
57
65
  }