@fangzhongya/fang-ui 0.1.51 → 0.1.52

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 (195) hide show
  1. package/bin/fang-ui.js +2 -2
  2. package/dist/components/box-fun/index.cjs +1 -0
  3. package/dist/components/box-fun/index.js +1 -0
  4. package/dist/components/box-fun/index.scss +8 -0
  5. package/dist/components/box-fun/style/index2.scss +4 -0
  6. package/dist/components/buttons/src/data.d.ts +14 -11
  7. package/dist/components/cascaders/src/data.d.ts +14 -11
  8. package/dist/components/cascaders/src/index2.cjs +15 -8
  9. package/dist/components/cascaders/src/index2.js +15 -8
  10. package/dist/components/checks/src/data.d.ts +14 -11
  11. package/dist/components/checks/src/index2.cjs +6 -6
  12. package/dist/components/checks/src/index2.js +6 -6
  13. package/dist/components/common/list.cjs +34 -15
  14. package/dist/components/common/list.d.ts +25 -12
  15. package/dist/components/common/list.js +34 -15
  16. package/dist/components/common/use.cjs +9 -5
  17. package/dist/components/common/use.js +9 -5
  18. package/dist/components/dates/src/data.d.ts +14 -11
  19. package/dist/components/dates2/src/data.d.ts +14 -11
  20. package/dist/components/draggable/style/index2.scss +1 -0
  21. package/dist/components/edit-data/index.cjs +9 -0
  22. package/dist/components/edit-data/index.css +144 -0
  23. package/dist/components/edit-data/index.d.ts +5 -0
  24. package/dist/components/edit-data/index.js +9 -0
  25. package/dist/components/edit-data/index.scss +95 -0
  26. package/dist/components/edit-data/src/area/array-json.cjs +4 -0
  27. package/dist/components/edit-data/src/area/array-json.js +4 -0
  28. package/dist/components/edit-data/src/area/array-json2.cjs +109 -0
  29. package/dist/components/edit-data/src/area/array-json2.js +109 -0
  30. package/dist/components/edit-data/src/area/array.cjs +4 -0
  31. package/dist/components/edit-data/src/area/array.js +4 -0
  32. package/dist/components/edit-data/src/area/array2.cjs +135 -0
  33. package/dist/components/edit-data/src/area/array2.js +135 -0
  34. package/dist/components/edit-data/src/area/code.cjs +4 -0
  35. package/dist/components/edit-data/src/area/code.js +4 -0
  36. package/dist/components/edit-data/src/area/code2.cjs +52 -0
  37. package/dist/components/edit-data/src/area/code2.js +52 -0
  38. package/dist/components/edit-data/src/area/editor.cjs +4 -0
  39. package/dist/components/edit-data/src/area/editor.js +4 -0
  40. package/dist/components/edit-data/src/area/editor2.cjs +170 -0
  41. package/dist/components/edit-data/src/area/editor2.js +170 -0
  42. package/dist/components/edit-data/src/area/general.cjs +4 -0
  43. package/dist/components/edit-data/src/area/general.js +4 -0
  44. package/dist/components/edit-data/src/area/general2.cjs +88 -0
  45. package/dist/components/edit-data/src/area/general2.js +88 -0
  46. package/dist/components/edit-data/src/area/object-json.cjs +4 -0
  47. package/dist/components/edit-data/src/area/object-json.js +4 -0
  48. package/dist/components/edit-data/src/area/object-json2.cjs +109 -0
  49. package/dist/components/edit-data/src/area/object-json2.js +109 -0
  50. package/dist/components/edit-data/src/area/object.cjs +4 -0
  51. package/dist/components/edit-data/src/area/object.js +4 -0
  52. package/dist/components/edit-data/src/area/object2.cjs +116 -0
  53. package/dist/components/edit-data/src/area/object2.js +116 -0
  54. package/dist/components/edit-data/src/data/array.cjs +4 -0
  55. package/dist/components/edit-data/src/data/array.js +4 -0
  56. package/dist/components/edit-data/src/data/array2.cjs +68 -0
  57. package/dist/components/edit-data/src/data/array2.js +68 -0
  58. package/dist/components/edit-data/src/data/bigint.cjs +4 -0
  59. package/dist/components/edit-data/src/data/bigint.js +4 -0
  60. package/dist/components/edit-data/src/data/bigint2.cjs +42 -0
  61. package/dist/components/edit-data/src/data/bigint2.js +42 -0
  62. package/dist/components/edit-data/src/data/boolean.cjs +4 -0
  63. package/dist/components/edit-data/src/data/boolean.js +4 -0
  64. package/dist/components/edit-data/src/data/boolean2.cjs +53 -0
  65. package/dist/components/edit-data/src/data/boolean2.js +53 -0
  66. package/dist/components/edit-data/src/data/function.cjs +4 -0
  67. package/dist/components/edit-data/src/data/function.js +4 -0
  68. package/dist/components/edit-data/src/data/function2.cjs +61 -0
  69. package/dist/components/edit-data/src/data/function2.js +61 -0
  70. package/dist/components/edit-data/src/data/not.cjs +4 -0
  71. package/dist/components/edit-data/src/data/not.js +4 -0
  72. package/dist/components/edit-data/src/data/not2.cjs +56 -0
  73. package/dist/components/edit-data/src/data/not2.js +56 -0
  74. package/dist/components/edit-data/src/data/null.cjs +4 -0
  75. package/dist/components/edit-data/src/data/null.js +4 -0
  76. package/dist/components/edit-data/src/data/null2.cjs +24 -0
  77. package/dist/components/edit-data/src/data/null2.js +24 -0
  78. package/dist/components/edit-data/src/data/number.cjs +4 -0
  79. package/dist/components/edit-data/src/data/number.js +4 -0
  80. package/dist/components/edit-data/src/data/number2.cjs +42 -0
  81. package/dist/components/edit-data/src/data/number2.js +42 -0
  82. package/dist/components/edit-data/src/data/object.cjs +4 -0
  83. package/dist/components/edit-data/src/data/object.js +4 -0
  84. package/dist/components/edit-data/src/data/object2.cjs +68 -0
  85. package/dist/components/edit-data/src/data/object2.js +68 -0
  86. package/dist/components/edit-data/src/data/other.cjs +4 -0
  87. package/dist/components/edit-data/src/data/other.js +4 -0
  88. package/dist/components/edit-data/src/data/other2.cjs +59 -0
  89. package/dist/components/edit-data/src/data/other2.js +59 -0
  90. package/dist/components/edit-data/src/data/string.cjs +4 -0
  91. package/dist/components/edit-data/src/data/string.js +4 -0
  92. package/dist/components/edit-data/src/data/string2.cjs +43 -0
  93. package/dist/components/edit-data/src/data/string2.js +43 -0
  94. package/dist/components/edit-data/src/data/symbol.cjs +4 -0
  95. package/dist/components/edit-data/src/data/symbol.js +4 -0
  96. package/dist/components/edit-data/src/data/symbol2.cjs +55 -0
  97. package/dist/components/edit-data/src/data/symbol2.js +55 -0
  98. package/dist/components/edit-data/src/data/undefined.cjs +4 -0
  99. package/dist/components/edit-data/src/data/undefined.js +4 -0
  100. package/dist/components/edit-data/src/data/undefined2.cjs +24 -0
  101. package/dist/components/edit-data/src/data/undefined2.js +24 -0
  102. package/dist/components/edit-data/src/data.cjs +57 -0
  103. package/dist/components/edit-data/src/data.d.ts +131 -0
  104. package/dist/components/edit-data/src/data.js +57 -0
  105. package/dist/components/edit-data/src/index.cjs +4 -0
  106. package/dist/components/edit-data/src/index.js +4 -0
  107. package/dist/components/edit-data/src/index2.cjs +134 -0
  108. package/dist/components/edit-data/src/index2.js +134 -0
  109. package/dist/components/edit-data/src/util.cjs +99 -0
  110. package/dist/components/edit-data/src/util.d.ts +1 -0
  111. package/dist/components/edit-data/src/util.js +99 -0
  112. package/dist/components/edit-data/style/index2.scss +13 -0
  113. package/dist/components/edit-data-add/index.cjs +9 -0
  114. package/dist/components/edit-data-add/index.d.ts +5 -0
  115. package/dist/components/edit-data-add/index.js +9 -0
  116. package/dist/components/edit-data-add/index.scss +5 -0
  117. package/dist/components/edit-data-add/src/data.cjs +24 -0
  118. package/dist/components/edit-data-add/src/data.d.ts +36 -0
  119. package/dist/components/edit-data-add/src/data.js +24 -0
  120. package/dist/components/edit-data-add/src/index.cjs +4 -0
  121. package/dist/components/edit-data-add/src/index.js +4 -0
  122. package/dist/components/edit-data-add/src/index2.cjs +241 -0
  123. package/dist/components/edit-data-add/src/index2.js +241 -0
  124. package/dist/components/edit-data-add/style/comm.scss +38 -0
  125. package/dist/components/edit-data-add/style/index2.scss +2 -0
  126. package/dist/components/history/src/data.cjs +9 -1
  127. package/dist/components/history/src/data.d.ts +13 -1
  128. package/dist/components/history/src/data.js +9 -1
  129. package/dist/components/history/src/index2.cjs +27 -9
  130. package/dist/components/history/src/index2.js +27 -9
  131. package/dist/components/index.cjs +60 -56
  132. package/dist/components/index.d.ts +2 -0
  133. package/dist/components/index.js +4 -0
  134. package/dist/components/index.scss +3 -0
  135. package/dist/components/index2.scss +5 -2
  136. package/dist/components/labels/src/data.d.ts +14 -11
  137. package/dist/components/labels/src/index2.cjs +13 -2
  138. package/dist/components/labels/src/index2.js +13 -2
  139. package/dist/components/page/index.css +8 -0
  140. package/dist/components/retract/index.css +20 -0
  141. package/dist/components/retract/index.scss +24 -0
  142. package/dist/components/retract/src/data.cjs +10 -0
  143. package/dist/components/retract/src/data.d.ts +10 -0
  144. package/dist/components/retract/src/data.js +10 -0
  145. package/dist/components/retract/src/index2.cjs +24 -4
  146. package/dist/components/retract/src/index2.js +23 -3
  147. package/dist/components/retract/style/index2.scss +1 -0
  148. package/dist/components/selects/src/data.d.ts +14 -11
  149. package/dist/components/selects/src/index2.cjs +1 -1
  150. package/dist/components/selects/src/index2.js +1 -1
  151. package/dist/components/switchs/src/data.d.ts +14 -11
  152. package/dist/components/switchs/src/index2.cjs +9 -5
  153. package/dist/components/switchs/src/index2.js +9 -5
  154. package/dist/components/tables/common/com-limit.cjs +4 -0
  155. package/dist/components/tables/common/com-limit.js +4 -0
  156. package/dist/components/tables/common/com-limit2.cjs +91 -0
  157. package/dist/components/tables/common/com-limit2.js +91 -0
  158. package/dist/components/tables/common/com.scss +12 -0
  159. package/dist/components/tables/index.css +9 -0
  160. package/dist/components/tables/index.scss +2 -0
  161. package/dist/components/tables/src/columns2.cjs +3 -1
  162. package/dist/components/tables/src/columns2.js +7 -5
  163. package/dist/components/tablesp/index.css +9 -0
  164. package/dist/components/tablespd/index.css +9 -0
  165. package/dist/components/uploads/src/data.d.ts +14 -11
  166. package/dist/css/edit-data.css +144 -0
  167. package/dist/css/index.css +149 -0
  168. package/dist/css/page.css +8 -0
  169. package/dist/css/retract.css +20 -0
  170. package/dist/css/tables.css +9 -0
  171. package/dist/css/tablesp.css +9 -0
  172. package/dist/css/tablespd.css +9 -0
  173. package/dist/directives/adjust/index.cjs +14 -6
  174. package/dist/directives/adjust/index.js +14 -6
  175. package/dist/directives/adjustment/index.cjs +622 -0
  176. package/dist/directives/adjustment/index.d.ts +7 -0
  177. package/dist/directives/adjustment/index.js +622 -0
  178. package/dist/directives/index.cjs +18 -16
  179. package/dist/directives/index.d.ts +1 -0
  180. package/dist/directives/index.js +16 -14
  181. package/dist/expand/{chunk-A7IW6WRD.cjs → chunk-BJVT6JH7.cjs} +6 -0
  182. package/dist/expand/{chunk-L4FI5HCY.js → chunk-I5UJEJJB.js} +6 -0
  183. package/dist/expand/components.cjs +5 -5
  184. package/dist/expand/components.js +1 -1
  185. package/dist/expand/config.cjs +2 -2
  186. package/dist/expand/config.js +1 -1
  187. package/dist/icons/index.json +1 -1
  188. package/dist/index.cjs +84 -78
  189. package/dist/index.css +149 -0
  190. package/dist/index.js +20 -14
  191. package/dist/utils/util.cjs +1 -1
  192. package/dist/utils/util.js +2 -2
  193. package/dist/utils/vues/withInstall.cjs +2 -1
  194. package/dist/utils/vues/withInstall.js +2 -1
  195. package/package.json +9 -8
@@ -0,0 +1,241 @@
1
+ import { defineComponent, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createVNode, toDisplayString, mergeProps, createTextVNode } from "vue";
2
+ import { name, dataProps, dataExpose, dataEmits as dataEmits$1 } from "./data.js";
3
+ import { dataEmits, dataProps as dataProps$1 } from "../../edit-data/src/data.js";
4
+ import { getObjTypes } from "../../edit-data/src/util.js";
5
+ import { useCssName } from "../../../hooks/cssname/index.js";
6
+ import { useLocale } from "../../../hooks/locale/index.js";
7
+ import { usePropsDefault, getProps } from "../../../hooks/props-default/index.js";
8
+ import { Button } from "../../button/index.js";
9
+ import { Window } from "../../window/index.js";
10
+ import { Inputs } from "../../inputs/index.js";
11
+ import { Selects } from "../../selects/index.js";
12
+ import { EditData } from "../../edit-data/index.js";
13
+ import { Message } from "../../message/index.js";
14
+ const _hoisted_1 = { key: 0 };
15
+ const _sfc_main = /* @__PURE__ */ defineComponent({
16
+ ...{
17
+ inheritAttrs: false
18
+ },
19
+ __name: "index",
20
+ props: getProps({ ...dataProps$1, ...dataProps }),
21
+ emits: [...dataEmits, ...dataEmits$1],
22
+ setup(__props, { expose: __expose, emit: __emit }) {
23
+ const cs = useCssName(name);
24
+ const { getLocale } = useLocale();
25
+ const prs = __props;
26
+ const props = usePropsDefault(name, prs, dataProps);
27
+ const emit = __emit;
28
+ const label = ref(props.label);
29
+ const value = computed({
30
+ get() {
31
+ const v = props.modelValue;
32
+ if (v) {
33
+ onEmptied();
34
+ }
35
+ return v;
36
+ },
37
+ set(value2) {
38
+ emit("update:modelValue", value2);
39
+ }
40
+ });
41
+ const typevalue = ref("");
42
+ const valueData = ref();
43
+ const Map = {
44
+ string: "字符串",
45
+ number: "数字",
46
+ boolean: "是否",
47
+ object: "对象",
48
+ array: "数组",
49
+ function: "方法",
50
+ symbol: "唯一值",
51
+ bigint: "大数字",
52
+ not: "不存在",
53
+ null: "空值",
54
+ undefined: "未定义",
55
+ other: "其他"
56
+ };
57
+ const getAll = () => {
58
+ const arr = [
59
+ "string",
60
+ "number",
61
+ "boolean",
62
+ "object",
63
+ "array",
64
+ "function",
65
+ "symbol",
66
+ "bigint",
67
+ "other"
68
+ ];
69
+ if (props.isNot) {
70
+ arr.push("not");
71
+ } else {
72
+ arr.push("null", "undefined");
73
+ }
74
+ return arr;
75
+ };
76
+ const tps = ref([]);
77
+ const getType = (type) => {
78
+ const t = type.toLowerCase();
79
+ if (t.startsWith("array")) {
80
+ tps.value = getObjTypes(t);
81
+ console.log("tps.value ", tps.value);
82
+ return "array";
83
+ } else if (t.startsWith("object")) {
84
+ tps.value = getObjTypes(t);
85
+ return "object";
86
+ } else {
87
+ return t;
88
+ }
89
+ };
90
+ const options = computed(() => {
91
+ let arr = [];
92
+ if (props.typeObj) {
93
+ if (typeof props.typeObj === "string") {
94
+ arr.push(props.typeObj);
95
+ } else {
96
+ arr = props.typeObj;
97
+ }
98
+ arr = arr.filter((v2) => Boolean(v2)).map((v2) => getType(v2));
99
+ }
100
+ if (arr.length == 0) {
101
+ arr = getAll();
102
+ }
103
+ const v = arr.map((v2) => ({ label: Map[v2], value: v2 }));
104
+ if (v.length > 0) {
105
+ typevalue.value = v[0].value;
106
+ }
107
+ return v;
108
+ });
109
+ const typeobjs = computed(() => {
110
+ if (tps.value.length > 0) {
111
+ return tps.value;
112
+ } else {
113
+ if (props.typeObj) {
114
+ if (typeof props.typeObj === "string") {
115
+ return [props.typeObj];
116
+ } else {
117
+ return props.typeObj;
118
+ }
119
+ }
120
+ return [];
121
+ }
122
+ });
123
+ function onEmptied() {
124
+ label.value = props.label;
125
+ valueData.value = void 0;
126
+ }
127
+ function onClick(key) {
128
+ if (key == 1) {
129
+ if (props.type === "object" && !label.value) {
130
+ Message.error("请输入" + props.labelName + "名称");
131
+ return;
132
+ }
133
+ emit("submit", {
134
+ label: label.value,
135
+ type: typevalue.value,
136
+ value: valueData.value
137
+ });
138
+ value.value = false;
139
+ } else {
140
+ value.value = false;
141
+ }
142
+ }
143
+ __expose({
144
+ ...dataExpose
145
+ });
146
+ return (_ctx, _cache) => {
147
+ return openBlock(), createBlock(unref(Window), {
148
+ isMin: false,
149
+ title: unref(props).title,
150
+ modelValue: value.value,
151
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => value.value = $event)
152
+ }, {
153
+ default: withCtx(() => [
154
+ createElementVNode("div", {
155
+ class: normalizeClass(unref(cs).z())
156
+ }, [
157
+ createElementVNode("div", {
158
+ class: normalizeClass(unref(cs).z("main"))
159
+ }, [
160
+ createElementVNode("div", {
161
+ class: normalizeClass(unref(cs).z("main-top"))
162
+ }, [
163
+ _ctx.type === "object" ? (openBlock(), createElementBlock("div", {
164
+ key: 0,
165
+ class: normalizeClass(unref(cs).z("main-top-li"))
166
+ }, [
167
+ createElementVNode("span", null, toDisplayString(unref(props).labelName + "名称") + ":", 1),
168
+ createVNode(unref(Inputs), {
169
+ class: normalizeClass(unref(cs).z("main-top-li-value")),
170
+ placeholder: "请输入" + unref(props).labelName + "名称",
171
+ modelValue: label.value,
172
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label.value = $event)
173
+ }, null, 8, ["class", "placeholder", "modelValue"])
174
+ ], 2)) : createCommentVNode("", true),
175
+ createElementVNode("div", {
176
+ class: normalizeClass(unref(cs).z("main-top-li"))
177
+ }, [
178
+ _cache[7] || (_cache[7] = createElementVNode("span", null, "类型:", -1)),
179
+ createVNode(unref(Selects), {
180
+ class: normalizeClass(unref(cs).z("main-top-li-value")),
181
+ placeholder: "类型",
182
+ options: options.value,
183
+ modelValue: typevalue.value,
184
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => typevalue.value = $event),
185
+ onChange: _cache[2] || (_cache[2] = ($event) => valueData.value = void 0)
186
+ }, null, 8, ["class", "options", "modelValue"])
187
+ ], 2)
188
+ ], 2),
189
+ createElementVNode("div", {
190
+ class: normalizeClass(unref(cs).z("main-content"))
191
+ }, [
192
+ createElementVNode("div", {
193
+ class: normalizeClass(unref(cs).z("main-content-name"))
194
+ }, [
195
+ createElementVNode("span", null, toDisplayString(unref(props).labelName) + "值:", 1)
196
+ ], 2),
197
+ typevalue.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
198
+ (openBlock(), createBlock(unref(EditData), mergeProps({ key: typevalue.value }, unref(props), {
199
+ typeObj: typeobjs.value,
200
+ type: typevalue.value,
201
+ modelValue: valueData.value,
202
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => valueData.value = $event)
203
+ }), null, 16, ["typeObj", "type", "modelValue"]))
204
+ ])) : createCommentVNode("", true)
205
+ ], 2)
206
+ ], 2),
207
+ createElementVNode("div", {
208
+ class: normalizeClass(unref(cs).z("footer"))
209
+ }, [
210
+ createElementVNode("div", {
211
+ class: normalizeClass(unref(cs).z("top-but"))
212
+ }, [
213
+ createVNode(unref(Button), {
214
+ onClick: _cache[4] || (_cache[4] = ($event) => onClick(0))
215
+ }, {
216
+ default: withCtx(() => [..._cache[8] || (_cache[8] = [
217
+ createTextVNode("取消", -1)
218
+ ])]),
219
+ _: 1
220
+ }),
221
+ createVNode(unref(Button), {
222
+ onClick: _cache[5] || (_cache[5] = ($event) => onClick(1)),
223
+ type: "primary"
224
+ }, {
225
+ default: withCtx(() => [..._cache[9] || (_cache[9] = [
226
+ createTextVNode("确认", -1)
227
+ ])]),
228
+ _: 1
229
+ })
230
+ ], 2)
231
+ ], 2)
232
+ ], 2)
233
+ ]),
234
+ _: 1
235
+ }, 8, ["title", "modelValue"]);
236
+ };
237
+ }
238
+ });
239
+ export {
240
+ _sfc_main as default
241
+ };
@@ -0,0 +1,38 @@
1
+ @use '../../scss/common.scss' as *;
2
+ $edit-data-add: 'edit-data-add';
3
+ @include b($edit-data-add) {
4
+ // 占位符,为将来扩展预留
5
+ width: 100%;
6
+ height: 100%;
7
+ display: flex;
8
+ flex-direction: column;
9
+ &-main {
10
+ flex: 1;
11
+ width: 100%;
12
+ display: flex;
13
+ flex-direction: column;
14
+ &-top {
15
+ width: 100%;
16
+ &-li {
17
+ display: flex;
18
+ align-items: center;
19
+ padding: 10px;
20
+ &-value {
21
+ flex: 1;
22
+ }
23
+ }
24
+ }
25
+ &-content {
26
+ flex: 1;
27
+ width: 100%;
28
+ margin: 10px;
29
+ &-name {
30
+ margin-bottom: 10px;
31
+ }
32
+ }
33
+ }
34
+ &-footer {
35
+ padding-top: 20px;
36
+ text-align: right;
37
+ }
38
+ }
@@ -0,0 +1,2 @@
1
+ @use '../../edit-data/style/index2.scss' as *;
2
+ @use '../index.scss' as *;
@@ -12,9 +12,17 @@ const dataProps = {
12
12
  record: {
13
13
  type: [Number, String],
14
14
  default: 0
15
+ },
16
+ isCur: { type: Boolean, default: true },
17
+ isModel: { type: Boolean, default: false },
18
+ copyFilter: {
19
+ type: Function,
20
+ default() {
21
+ return true;
22
+ }
15
23
  }
16
24
  };
17
- const dataEmits = ["update:modelValue"];
25
+ const dataEmits = ["update:modelValue", "change"];
18
26
  const dataSlot = {
19
27
  iconRetreat: "icon-retreat",
20
28
  iconForward: "icon-forward"
@@ -1,4 +1,4 @@
1
- import { ExtractPropTypes } from 'vue';
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
2
  /**
3
3
  * @title {h3} history
4
4
  */
@@ -15,6 +15,18 @@ export declare const dataProps: {
15
15
  type: (StringConstructor | NumberConstructor)[];
16
16
  default: number;
17
17
  };
18
+ isCur: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ isModel: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ copyFilter: {
27
+ type: PropType<(key: string) => boolean>;
28
+ default(): boolean;
29
+ };
18
30
  };
19
31
  export type DataProps = ExtractPropTypes<typeof dataProps>;
20
32
  /**
@@ -10,9 +10,17 @@ const dataProps = {
10
10
  record: {
11
11
  type: [Number, String],
12
12
  default: 0
13
+ },
14
+ isCur: { type: Boolean, default: true },
15
+ isModel: { type: Boolean, default: false },
16
+ copyFilter: {
17
+ type: Function,
18
+ default() {
19
+ return true;
20
+ }
13
21
  }
14
22
  };
15
- const dataEmits = ["update:modelValue"];
23
+ const dataEmits = ["update:modelValue", "change"];
16
24
  const dataSlot = {
17
25
  iconRetreat: "icon-retreat",
18
26
  iconForward: "icon-forward"
@@ -21,14 +21,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
21
  const index$3 = vue.ref(0);
22
22
  const current = vue.ref();
23
23
  const isRetreat = vue.computed(() => {
24
- if (history.value.length > 0 && index$3.value <= history.value.length - 1) {
24
+ const i = props.isModel ? 1 : 0;
25
+ if (history.value.length > i && index$3.value <= history.value.length - 1 - i) {
25
26
  return false;
26
27
  } else {
27
28
  return true;
28
29
  }
29
30
  });
30
31
  const isForward = vue.computed(() => {
31
- if (history.value.length > 0 && index$3.value != 0) {
32
+ const i = props.isModel ? 1 : 0;
33
+ if (history.value.length > i && index$3.value != 0) {
32
34
  return false;
33
35
  } else {
34
36
  return true;
@@ -41,35 +43,51 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
41
43
  }
42
44
  );
43
45
  function getWz() {
44
- return history.value.length - index$3.value;
46
+ if (props.isModel) {
47
+ return history.value.length - index$3.value - 1;
48
+ } else {
49
+ return history.value.length - index$3.value;
50
+ }
45
51
  }
46
52
  function setRecord() {
47
53
  if (index$3.value != 0) {
48
- history.value.splice(getWz());
54
+ const i = history.value.length - index$3.value;
55
+ history.value.splice(i);
49
56
  index$3.value = 0;
50
57
  }
51
58
  let v = props.modelValue;
52
59
  if (v && typeof v == "object") {
53
- v = deepCopy.deepCopy(props.modelValue);
60
+ v = deepCopy.deepCopy(props.modelValue, props.copyFilter);
54
61
  }
55
62
  history.value.push(v);
56
63
  }
57
64
  function onRetreat() {
58
65
  if (!isRetreat.value) {
59
- if (index$3.value === 0) {
66
+ if (props.isCur && index$3.value === 0) {
60
67
  current.value = props.modelValue;
61
68
  }
62
69
  index$3.value++;
63
- emit("update:modelValue", history.value[getWz()]);
70
+ let v = history.value[getWz()];
71
+ if (props.isModel) {
72
+ v = deepCopy.deepCopy(v, props.copyFilter);
73
+ }
74
+ emit("update:modelValue", v);
75
+ emit("change", v);
64
76
  }
65
77
  }
66
78
  function onForward() {
67
79
  if (!isForward.value) {
68
80
  index$3.value--;
69
- if (index$3.value == 0) {
81
+ if (props.isCur && index$3.value == 0) {
70
82
  emit("update:modelValue", current.value);
83
+ emit("change", current.value);
71
84
  } else {
72
- emit("update:modelValue", history.value[getWz()]);
85
+ let v = history.value[getWz()];
86
+ if (props.isModel) {
87
+ v = deepCopy.deepCopy(v, props.copyFilter);
88
+ }
89
+ emit("update:modelValue", v);
90
+ emit("change", v);
73
91
  }
74
92
  }
75
93
  }
@@ -19,14 +19,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
19
  const index = ref(0);
20
20
  const current = ref();
21
21
  const isRetreat = computed(() => {
22
- if (history.value.length > 0 && index.value <= history.value.length - 1) {
22
+ const i = props.isModel ? 1 : 0;
23
+ if (history.value.length > i && index.value <= history.value.length - 1 - i) {
23
24
  return false;
24
25
  } else {
25
26
  return true;
26
27
  }
27
28
  });
28
29
  const isForward = computed(() => {
29
- if (history.value.length > 0 && index.value != 0) {
30
+ const i = props.isModel ? 1 : 0;
31
+ if (history.value.length > i && index.value != 0) {
30
32
  return false;
31
33
  } else {
32
34
  return true;
@@ -39,35 +41,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
39
41
  }
40
42
  );
41
43
  function getWz() {
42
- return history.value.length - index.value;
44
+ if (props.isModel) {
45
+ return history.value.length - index.value - 1;
46
+ } else {
47
+ return history.value.length - index.value;
48
+ }
43
49
  }
44
50
  function setRecord() {
45
51
  if (index.value != 0) {
46
- history.value.splice(getWz());
52
+ const i = history.value.length - index.value;
53
+ history.value.splice(i);
47
54
  index.value = 0;
48
55
  }
49
56
  let v = props.modelValue;
50
57
  if (v && typeof v == "object") {
51
- v = deepCopy(props.modelValue);
58
+ v = deepCopy(props.modelValue, props.copyFilter);
52
59
  }
53
60
  history.value.push(v);
54
61
  }
55
62
  function onRetreat() {
56
63
  if (!isRetreat.value) {
57
- if (index.value === 0) {
64
+ if (props.isCur && index.value === 0) {
58
65
  current.value = props.modelValue;
59
66
  }
60
67
  index.value++;
61
- emit("update:modelValue", history.value[getWz()]);
68
+ let v = history.value[getWz()];
69
+ if (props.isModel) {
70
+ v = deepCopy(v, props.copyFilter);
71
+ }
72
+ emit("update:modelValue", v);
73
+ emit("change", v);
62
74
  }
63
75
  }
64
76
  function onForward() {
65
77
  if (!isForward.value) {
66
78
  index.value--;
67
- if (index.value == 0) {
79
+ if (props.isCur && index.value == 0) {
68
80
  emit("update:modelValue", current.value);
81
+ emit("change", current.value);
69
82
  } else {
70
- emit("update:modelValue", history.value[getWz()]);
83
+ let v = history.value[getWz()];
84
+ if (props.isModel) {
85
+ v = deepCopy(v, props.copyFilter);
86
+ }
87
+ emit("update:modelValue", v);
88
+ emit("change", v);
71
89
  }
72
90
  }
73
91
  }
@@ -104,34 +104,36 @@ const index$2g = require("./dates-picker/index.cjs");
104
104
  const index$2h = require("./dates/index.cjs");
105
105
  const index$2i = require("./dates2/index.cjs");
106
106
  const index$2j = require("./double/index.cjs");
107
- const index$2k = require("./edit-float/index.cjs");
108
- const index$2l = require("./edit/index.cjs");
109
- const index$2m = require("./history/index.cjs");
110
- const index$2n = require("./input-array/index.cjs");
111
- const index$2o = require("./input-history/index.cjs");
112
- const index$2p = require("./input-num/index.cjs");
113
- const index$2q = require("./input-select/index.cjs");
114
- const index$2r = require("./inputs/index.cjs");
115
- const index$2s = require("./labels/index.cjs");
116
- const index$2t = require("./select-scroll/index.cjs");
117
- const index$2u = require("./selector/index.cjs");
118
- const index$2v = require("./selects/index.cjs");
119
- const index$2w = require("./sliders/index.cjs");
120
- const index$2x = require("./switchs/index.cjs");
121
- const index$2y = require("./texts/index.cjs");
122
- const index$2z = require("./uploads/index.cjs");
123
- const index$2A = require("./list/index.cjs");
124
- const index$2B = require("./lists/index.cjs");
125
- const index$2C = require("./listsp/index.cjs");
126
- const index$2D = require("./listspd/index.cjs");
127
- const index$2E = require("./paging/index.cjs");
128
- const index$2F = require("./tables/index.cjs");
129
- const index$2G = require("./tablesp/index.cjs");
130
- const index$2H = require("./tablespd/index.cjs");
131
- const index$2I = require("./tabless/index.cjs");
132
- const index$2J = require("./tablesv/index.cjs");
133
- const index$2K = require("./tablesvp/index.cjs");
134
- const index$2L = require("./tablesvpd/index.cjs");
107
+ const index$2k = require("./edit-data-add/index.cjs");
108
+ const index$2l = require("./edit-data/index.cjs");
109
+ const index$2m = require("./edit-float/index.cjs");
110
+ const index$2n = require("./edit/index.cjs");
111
+ const index$2o = require("./history/index.cjs");
112
+ const index$2p = require("./input-array/index.cjs");
113
+ const index$2q = require("./input-history/index.cjs");
114
+ const index$2r = require("./input-num/index.cjs");
115
+ const index$2s = require("./input-select/index.cjs");
116
+ const index$2t = require("./inputs/index.cjs");
117
+ const index$2u = require("./labels/index.cjs");
118
+ const index$2v = require("./select-scroll/index.cjs");
119
+ const index$2w = require("./selector/index.cjs");
120
+ const index$2x = require("./selects/index.cjs");
121
+ const index$2y = require("./sliders/index.cjs");
122
+ const index$2z = require("./switchs/index.cjs");
123
+ const index$2A = require("./texts/index.cjs");
124
+ const index$2B = require("./uploads/index.cjs");
125
+ const index$2C = require("./list/index.cjs");
126
+ const index$2D = require("./lists/index.cjs");
127
+ const index$2E = require("./listsp/index.cjs");
128
+ const index$2F = require("./listspd/index.cjs");
129
+ const index$2G = require("./paging/index.cjs");
130
+ const index$2H = require("./tables/index.cjs");
131
+ const index$2I = require("./tablesp/index.cjs");
132
+ const index$2J = require("./tablespd/index.cjs");
133
+ const index$2K = require("./tabless/index.cjs");
134
+ const index$2L = require("./tablesv/index.cjs");
135
+ const index$2M = require("./tablesvp/index.cjs");
136
+ const index$2N = require("./tablesvpd/index.cjs");
135
137
  const index$2 = require("element-plus/es/components/button/index");
136
138
  const index$4 = require("element-plus/es/components/card/index");
137
139
  const index$6 = require("element-plus/es/components/color-picker/index");
@@ -280,34 +282,36 @@ exports.DatesPicker = index$2g.DatesPicker;
280
282
  exports.Dates = index$2h.Dates;
281
283
  exports.Dates2 = index$2i.Dates2;
282
284
  exports.Double = index$2j.Double;
283
- exports.EditFloat = index$2k.EditFloat;
284
- exports.Edit = index$2l.Edit;
285
- exports.History = index$2m.History;
286
- exports.InputArray = index$2n.InputArray;
287
- exports.InputHistory = index$2o.InputHistory;
288
- exports.InputNum = index$2p.InputNum;
289
- exports.InputSelect = index$2q.InputSelect;
290
- exports.Inputs = index$2r.Inputs;
291
- exports.Labels = index$2s.Labels;
292
- exports.SelectScroll = index$2t.SelectScroll;
293
- exports.Selector = index$2u.Selector;
294
- exports.Selects = index$2v.Selects;
295
- exports.Sliders = index$2w.Sliders;
296
- exports.Switchs = index$2x.Switchs;
297
- exports.Texts = index$2y.Texts;
298
- exports.Uploads = index$2z.Uploads;
299
- exports.List = index$2A.List;
300
- exports.Lists = index$2B.Lists;
301
- exports.Listsp = index$2C.Listsp;
302
- exports.Listspd = index$2D.Listspd;
303
- exports.Paging = index$2E.Paging;
304
- exports.Tables = index$2F.Tables;
305
- exports.Tablesp = index$2G.Tablesp;
306
- exports.Tablespd = index$2H.Tablespd;
307
- exports.Tabless = index$2I.Tabless;
308
- exports.Tablesv = index$2J.Tablesv;
309
- exports.Tablesvp = index$2K.Tablesvp;
310
- exports.Tablesvpd = index$2L.Tablesvpd;
285
+ exports.EditDataAdd = index$2k.EditDataAdd;
286
+ exports.EditData = index$2l.EditData;
287
+ exports.EditFloat = index$2m.EditFloat;
288
+ exports.Edit = index$2n.Edit;
289
+ exports.History = index$2o.History;
290
+ exports.InputArray = index$2p.InputArray;
291
+ exports.InputHistory = index$2q.InputHistory;
292
+ exports.InputNum = index$2r.InputNum;
293
+ exports.InputSelect = index$2s.InputSelect;
294
+ exports.Inputs = index$2t.Inputs;
295
+ exports.Labels = index$2u.Labels;
296
+ exports.SelectScroll = index$2v.SelectScroll;
297
+ exports.Selector = index$2w.Selector;
298
+ exports.Selects = index$2x.Selects;
299
+ exports.Sliders = index$2y.Sliders;
300
+ exports.Switchs = index$2z.Switchs;
301
+ exports.Texts = index$2A.Texts;
302
+ exports.Uploads = index$2B.Uploads;
303
+ exports.List = index$2C.List;
304
+ exports.Lists = index$2D.Lists;
305
+ exports.Listsp = index$2E.Listsp;
306
+ exports.Listspd = index$2F.Listspd;
307
+ exports.Paging = index$2G.Paging;
308
+ exports.Tables = index$2H.Tables;
309
+ exports.Tablesp = index$2I.Tablesp;
310
+ exports.Tablespd = index$2J.Tablespd;
311
+ exports.Tabless = index$2K.Tabless;
312
+ exports.Tablesv = index$2L.Tablesv;
313
+ exports.Tablesvp = index$2M.Tablesvp;
314
+ exports.Tablesvpd = index$2N.Tablesvpd;
311
315
  Object.keys(index$2).forEach((k) => {
312
316
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
313
317
  enumerable: true,
@@ -101,6 +101,8 @@ export * from './dates-picker/index';
101
101
  export * from './dates/index';
102
102
  export * from './dates2/index';
103
103
  export * from './double/index';
104
+ export * from './edit-data-add/index';
105
+ export * from './edit-data/index';
104
106
  export * from './edit-float/index';
105
107
  export * from './edit/index';
106
108
  export * from './history/index';
@@ -102,6 +102,8 @@ import { DatesPicker } from "./dates-picker/index.js";
102
102
  import { Dates } from "./dates/index.js";
103
103
  import { Dates2 } from "./dates2/index.js";
104
104
  import { Double } from "./double/index.js";
105
+ import { EditDataAdd } from "./edit-data-add/index.js";
106
+ import { EditData } from "./edit-data/index.js";
105
107
  import { EditFloat } from "./edit-float/index.js";
106
108
  import { Edit } from "./edit/index.js";
107
109
  import { History } from "./history/index.js";
@@ -216,6 +218,8 @@ export {
216
218
  DropdownItem,
217
219
  DropdownMenu,
218
220
  Edit,
221
+ EditData,
222
+ EditDataAdd,
219
223
  EditFloat,
220
224
  Form,
221
225
  FormItem,