@touchvue/ui 0.0.1-alpha.2

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 (141) hide show
  1. package/README.md +70 -0
  2. package/es/components/article/index.js +66 -0
  3. package/es/components/article/index.js.map +1 -0
  4. package/es/components/box/index.js +98 -0
  5. package/es/components/box/index.js.map +1 -0
  6. package/es/components/button/index.js +96 -0
  7. package/es/components/button/index.js.map +1 -0
  8. package/es/components/calendar/index.js +44 -0
  9. package/es/components/calendar/index.js.map +1 -0
  10. package/es/components/card/index.js +290 -0
  11. package/es/components/card/index.js.map +1 -0
  12. package/es/components/checkbox/index.js +97 -0
  13. package/es/components/checkbox/index.js.map +1 -0
  14. package/es/components/datepicker/index.js +44 -0
  15. package/es/components/datepicker/index.js.map +1 -0
  16. package/es/components/form/index.js +303 -0
  17. package/es/components/form/index.js.map +1 -0
  18. package/es/components/grid/index.js +253 -0
  19. package/es/components/grid/index.js.map +1 -0
  20. package/es/components/header/index.js +233 -0
  21. package/es/components/header/index.js.map +1 -0
  22. package/es/components/icon/index.js +98 -0
  23. package/es/components/icon/index.js.map +1 -0
  24. package/es/components/input/index.js +436 -0
  25. package/es/components/input/index.js.map +1 -0
  26. package/es/components/line/index.js +100 -0
  27. package/es/components/line/index.js.map +1 -0
  28. package/es/components/msg/index.js +322 -0
  29. package/es/components/msg/index.js.map +1 -0
  30. package/es/components/padding/index.js +92 -0
  31. package/es/components/padding/index.js.map +1 -0
  32. package/es/components/page/index.js +334 -0
  33. package/es/components/page/index.js.map +1 -0
  34. package/es/components/select/index.js +218 -0
  35. package/es/components/select/index.js.map +1 -0
  36. package/es/components/space/index.js +88 -0
  37. package/es/components/space/index.js.map +1 -0
  38. package/es/components/step/index.js +127 -0
  39. package/es/components/step/index.js.map +1 -0
  40. package/es/components/switch/index.js +120 -0
  41. package/es/components/switch/index.js.map +1 -0
  42. package/es/components/tab/index.js +227 -0
  43. package/es/components/tab/index.js.map +1 -0
  44. package/es/components/table/index.js +893 -0
  45. package/es/components/table/index.js.map +1 -0
  46. package/es/directives/dis/index.js +32 -0
  47. package/es/directives/dis/index.js.map +1 -0
  48. package/es/directives/size/index.js +23 -0
  49. package/es/directives/size/index.js.map +1 -0
  50. package/es/hooks/index.js +2 -0
  51. package/es/hooks/index.js.map +1 -0
  52. package/es/index.js +4209 -0
  53. package/es/index.js.map +1 -0
  54. package/es/utils/index.js +90 -0
  55. package/es/utils/index.js.map +1 -0
  56. package/lib/components/article/index.js +70 -0
  57. package/lib/components/article/index.js.map +1 -0
  58. package/lib/components/box/index.js +102 -0
  59. package/lib/components/box/index.js.map +1 -0
  60. package/lib/components/button/index.js +98 -0
  61. package/lib/components/button/index.js.map +1 -0
  62. package/lib/components/calendar/index.js +46 -0
  63. package/lib/components/calendar/index.js.map +1 -0
  64. package/lib/components/card/index.js +292 -0
  65. package/lib/components/card/index.js.map +1 -0
  66. package/lib/components/checkbox/index.js +99 -0
  67. package/lib/components/checkbox/index.js.map +1 -0
  68. package/lib/components/datepicker/index.js +46 -0
  69. package/lib/components/datepicker/index.js.map +1 -0
  70. package/lib/components/form/index.js +306 -0
  71. package/lib/components/form/index.js.map +1 -0
  72. package/lib/components/grid/index.js +256 -0
  73. package/lib/components/grid/index.js.map +1 -0
  74. package/lib/components/header/index.js +235 -0
  75. package/lib/components/header/index.js.map +1 -0
  76. package/lib/components/icon/index.js +101 -0
  77. package/lib/components/icon/index.js.map +1 -0
  78. package/lib/components/input/index.js +438 -0
  79. package/lib/components/input/index.js.map +1 -0
  80. package/lib/components/line/index.js +102 -0
  81. package/lib/components/line/index.js.map +1 -0
  82. package/lib/components/msg/index.js +324 -0
  83. package/lib/components/msg/index.js.map +1 -0
  84. package/lib/components/padding/index.js +94 -0
  85. package/lib/components/padding/index.js.map +1 -0
  86. package/lib/components/page/index.js +336 -0
  87. package/lib/components/page/index.js.map +1 -0
  88. package/lib/components/select/index.js +220 -0
  89. package/lib/components/select/index.js.map +1 -0
  90. package/lib/components/space/index.js +90 -0
  91. package/lib/components/space/index.js.map +1 -0
  92. package/lib/components/step/index.js +129 -0
  93. package/lib/components/step/index.js.map +1 -0
  94. package/lib/components/switch/index.js +122 -0
  95. package/lib/components/switch/index.js.map +1 -0
  96. package/lib/components/tab/index.js +230 -0
  97. package/lib/components/tab/index.js.map +1 -0
  98. package/lib/components/table/index.js +898 -0
  99. package/lib/components/table/index.js.map +1 -0
  100. package/lib/directives/dis/index.js +34 -0
  101. package/lib/directives/dis/index.js.map +1 -0
  102. package/lib/directives/size/index.js +25 -0
  103. package/lib/directives/size/index.js.map +1 -0
  104. package/lib/hooks/index.js +3 -0
  105. package/lib/hooks/index.js.map +1 -0
  106. package/lib/index.js +4251 -0
  107. package/lib/index.js.map +1 -0
  108. package/lib/utils/index.js +99 -0
  109. package/lib/utils/index.js.map +1 -0
  110. package/package.json +35 -0
  111. package/theme/components/article/index.css +1 -0
  112. package/theme/components/box/index.css +1 -0
  113. package/theme/components/button/index.css +1 -0
  114. package/theme/components/calendar/index.css +0 -0
  115. package/theme/components/card/index.css +1 -0
  116. package/theme/components/checkbox/index.css +1 -0
  117. package/theme/components/datepicker/index.css +0 -0
  118. package/theme/components/form/index.css +1 -0
  119. package/theme/components/grid/index.css +1 -0
  120. package/theme/components/header/index.css +1 -0
  121. package/theme/components/icon/index.css +1 -0
  122. package/theme/components/input/index.css +1 -0
  123. package/theme/components/line/index.css +1 -0
  124. package/theme/components/msg/index.css +1 -0
  125. package/theme/components/padding/index.css +1 -0
  126. package/theme/components/space/index.css +1 -0
  127. package/theme/components/step/index.css +1 -0
  128. package/theme/components/switch/index.css +1 -0
  129. package/theme/components/tab/index.css +1 -0
  130. package/theme/components/table/index.css +1 -0
  131. package/theme/img/default.png +0 -0
  132. package/theme/img/icon-type-fill.ttf +0 -0
  133. package/theme/img/icon.ttf +0 -0
  134. package/theme/img/loading-in.png +0 -0
  135. package/theme/img/loading-out.png +0 -0
  136. package/theme/img/msg/error-bg.png +0 -0
  137. package/theme/img/msg/error-icon.png +0 -0
  138. package/theme/img/msg/success-bg.png +0 -0
  139. package/theme/img/msg/success-icon.png +0 -0
  140. package/theme/index.css +1 -0
  141. package/theme/skin/default.css +1 -0
package/lib/index.js ADDED
@@ -0,0 +1,4251 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var fs = require('fs');
7
+ var path = require('path');
8
+
9
+ const _hoisted_1$g = { class: "to-button-text" };
10
+ var _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
11
+ ...{
12
+ name: "ToButton"
13
+ },
14
+ __name: "button",
15
+ props: {
16
+ icon: { type: String, required: false, default: "" },
17
+ mode: { type: String, required: false, default: "default" },
18
+ color: { type: String, required: false, default: "" },
19
+ width: { type: [String, Number], required: false },
20
+ iconPosition: { type: String, required: false, default: "" }
21
+ },
22
+ setup(__props, { expose: __expose }) {
23
+ const el = vue.ref(null);
24
+ const props = __props;
25
+ const setStyle = vue.computed(() => {
26
+ const style = {};
27
+ if (props.width) {
28
+ style.width = `${props.width}em`;
29
+ }
30
+ return style;
31
+ });
32
+ const setClass = vue.computed(() => {
33
+ let arr = [];
34
+ if (props.mode) {
35
+ arr.push(`mode-${props.mode}`);
36
+ }
37
+ if (props.color) {
38
+ arr.push(`color-${props.color}`);
39
+ }
40
+ if (props.iconPosition) {
41
+ arr.push(`icon-position-${props.iconPosition}`);
42
+ }
43
+ return arr;
44
+ });
45
+ __expose({ el });
46
+ return (_ctx, _cache) => {
47
+ const _component_ToIcon = vue.resolveComponent("ToIcon");
48
+ return vue.openBlock(), vue.createElementBlock(
49
+ "button",
50
+ {
51
+ ref_key: "el",
52
+ ref: el,
53
+ class: vue.normalizeClass(["to-button", setClass.value]),
54
+ style: vue.normalizeStyle(setStyle.value)
55
+ },
56
+ [
57
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_ToIcon, {
58
+ key: 0,
59
+ class: "to-button-icon",
60
+ value: _ctx.icon
61
+ }, null, 8, ["value"])) : vue.createCommentVNode("v-if", true),
62
+ vue.createElementVNode("span", _hoisted_1$g, [
63
+ vue.renderSlot(_ctx.$slots, "default")
64
+ ])
65
+ ],
66
+ 6
67
+ /* CLASS, STYLE */
68
+ );
69
+ };
70
+ }
71
+ });
72
+
73
+ var _export_sfc = (sfc, props) => {
74
+ const target = sfc.__vccOpts || sfc;
75
+ for (const [key, val] of props) {
76
+ target[key] = val;
77
+ }
78
+ return target;
79
+ };
80
+
81
+ var Button = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/button/src/button.vue"]]);
82
+
83
+ const withInstall = (main, extra) => {
84
+ main.install = (app) => {
85
+ for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
86
+ app.component(comp.name, comp);
87
+ }
88
+ };
89
+ if (extra) {
90
+ for (const [key, comp] of Object.entries(extra)) {
91
+ main[key] = comp;
92
+ }
93
+ }
94
+ return main;
95
+ };
96
+
97
+ const ua = navigator.userAgent.toLowerCase();
98
+ function setRatio(options = {}) {
99
+ var _a, _b, _c, _d, _e;
100
+ const ua2 = navigator.userAgent.toLowerCase();
101
+ const base = (_b = (_a = options == null ? void 0 : options.ratio) == null ? void 0 : _a.base) != null ? _b : {};
102
+ const baseSize = /iphone|android.*mobile|windows phone|ipod/i.test(ua2) ? (_c = base.phone) != null ? _c : 375 : /ipad|android(?!.*mobile)|tablet/i.test(ua2) ? (_d = base.pad) != null ? _d : 1100 : (_e = base.pc) != null ? _e : 1366;
103
+ const updateFontSize = () => {
104
+ const width = window.innerWidth || document.documentElement.clientWidth;
105
+ document.documentElement.style.fontSize = width / baseSize * 100 + "px";
106
+ };
107
+ updateFontSize();
108
+ window.addEventListener("resize", updateFontSize);
109
+ }
110
+ function getMedia(options = {}) {
111
+ const isMobile = /iphone|android.*mobile|windows phone|ipod/i.test(ua);
112
+ const isTablet = /ipad|android(?!.*mobile)|tablet/i.test(ua);
113
+ return isMobile ? "phone" : isTablet ? "pad" : "pc";
114
+ }
115
+ function setMedia(options = {}) {
116
+ const html = document.documentElement;
117
+ const classList = [];
118
+ if (/windows/i.test(ua)) {
119
+ classList.push("os-windows");
120
+ } else if (/macintosh|mac os x/i.test(ua)) {
121
+ classList.push("os-macos");
122
+ } else if (/android/i.test(ua)) {
123
+ classList.push("os-android");
124
+ } else if (/iphone|ipad|ipod/i.test(ua)) {
125
+ classList.push("os-ios");
126
+ }
127
+ const media = getMedia();
128
+ if (media === "pad") {
129
+ classList.push("media-pad");
130
+ } else if (media === "phone") {
131
+ classList.push("media-phone");
132
+ } else {
133
+ classList.push("media-pc");
134
+ }
135
+ html.className += " " + classList.join(" ");
136
+ }
137
+ function getEm() {
138
+ const el = document.createElement("div");
139
+ el.style.width = "1em";
140
+ el.style.height = "1em";
141
+ el.style.position = "absolute";
142
+ document.body.appendChild(el);
143
+ const size = el.getBoundingClientRect().height;
144
+ document.body.removeChild(el);
145
+ return size;
146
+ }
147
+
148
+ const ToButton = withInstall(Button);
149
+
150
+ var _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
151
+ ...{
152
+ name: "ToIcon"
153
+ },
154
+ __name: "icon",
155
+ props: {
156
+ value: { type: String, required: false, default: "" },
157
+ type: { type: String, required: false, default: "" },
158
+ color: { type: String, required: false, default: "" },
159
+ mode: { type: String, required: false, default: "text" },
160
+ contentSize: { type: [Number, String], required: false, default: "" },
161
+ link: { type: Boolean, required: false, default: false }
162
+ },
163
+ emits: ["click"],
164
+ setup(__props, { emit: __emit }) {
165
+ const props = __props;
166
+ const emit = __emit;
167
+ const text = vue.ref(null);
168
+ const setClass = vue.computed(() => {
169
+ const arr = props.value ? [`value-${props.value}`] : [];
170
+ if (props.type === "fill") {
171
+ arr.push("type-fill");
172
+ }
173
+ if (props.mode && props.mode !== "text") {
174
+ arr.push(`mode-${props.mode}`);
175
+ }
176
+ if (props.color) {
177
+ arr.push(`color-${props.color}`);
178
+ }
179
+ if (props.link) {
180
+ arr.push("is-link");
181
+ }
182
+ return arr;
183
+ });
184
+ function clickHandle(evt) {
185
+ emit("click", evt);
186
+ }
187
+ return (_ctx, _cache) => {
188
+ return vue.openBlock(), vue.createElementBlock(
189
+ "span",
190
+ {
191
+ class: vue.normalizeClass(["to-icon", setClass.value]),
192
+ onClick: clickHandle
193
+ },
194
+ [
195
+ vue.createElementVNode(
196
+ "span",
197
+ {
198
+ ref_key: "text",
199
+ ref: text,
200
+ class: "to-icon-text"
201
+ },
202
+ [
203
+ vue.renderSlot(_ctx.$slots, "default")
204
+ ],
205
+ 512
206
+ /* NEED_PATCH */
207
+ )
208
+ ],
209
+ 2
210
+ /* CLASS */
211
+ );
212
+ };
213
+ }
214
+ });
215
+
216
+ var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/icon/src/icon.vue"]]);
217
+
218
+ const ToIcon = withInstall(Icon);
219
+
220
+ const _hoisted_1$f = { class: "to-article" };
221
+ const _hoisted_2$c = {
222
+ key: 0,
223
+ class: "to-article-header"
224
+ };
225
+ const _hoisted_3$a = { class: "to-article-content" };
226
+ const _hoisted_4$a = {
227
+ key: 1,
228
+ class: "to-article-footer"
229
+ };
230
+ var _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
231
+ ...{
232
+ name: "ToArticle"
233
+ },
234
+ __name: "article",
235
+ setup(__props) {
236
+ return (_ctx, _cache) => {
237
+ return vue.openBlock(), vue.createElementBlock("article", _hoisted_1$f, [
238
+ _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("header", _hoisted_2$c, [
239
+ vue.renderSlot(_ctx.$slots, "header")
240
+ ])) : vue.createCommentVNode("v-if", true),
241
+ vue.createElementVNode("section", _hoisted_3$a, [
242
+ vue.renderSlot(_ctx.$slots, "default")
243
+ ]),
244
+ _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", _hoisted_4$a, [
245
+ vue.renderSlot(_ctx.$slots, "footer")
246
+ ])) : vue.createCommentVNode("v-if", true)
247
+ ]);
248
+ };
249
+ }
250
+ });
251
+
252
+ var Article = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/article/src/article.vue"]]);
253
+
254
+ const articleProps = {};
255
+
256
+ const ToArticle = withInstall(Article);
257
+
258
+ var _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
259
+ ...{
260
+ name: "ToBox"
261
+ },
262
+ __name: "box",
263
+ props: {
264
+ mode: { type: String, required: false, default: "default" },
265
+ color: { type: String, required: false },
266
+ padding: { type: [String, Number], required: false },
267
+ height: { type: [String, Number], required: false },
268
+ cut: { type: Boolean, required: false, default: false },
269
+ link: { type: Boolean, required: false }
270
+ },
271
+ setup(__props) {
272
+ const props = __props;
273
+ const setClass = vue.computed(() => {
274
+ let arr = [];
275
+ if (props.mode) {
276
+ arr.push(`mode-${props.mode}`);
277
+ }
278
+ if (props.cut) {
279
+ arr.push(`is-cut`);
280
+ }
281
+ if (props.link) {
282
+ arr.push(`is-link`);
283
+ }
284
+ if (props.height && props.height === "full") {
285
+ arr.push("height-full");
286
+ }
287
+ return arr;
288
+ });
289
+ const setStyle = vue.computed(() => {
290
+ const obj = {};
291
+ if (props.height && props.height !== "full") {
292
+ if (!isNaN(Number(props.height))) {
293
+ obj.height = props.height + "em";
294
+ }
295
+ }
296
+ const hasUnit = (val) => /[a-z%]+$/i.test(val);
297
+ if (String(props.padding).trim()) {
298
+ const padded = String(props.padding).trim().split(/\s+/).map((val) => {
299
+ return hasUnit(val) ? val : `${val}em`;
300
+ }).join(" ");
301
+ obj.padding = padded;
302
+ }
303
+ return obj;
304
+ });
305
+ return (_ctx, _cache) => {
306
+ return vue.openBlock(), vue.createElementBlock(
307
+ "div",
308
+ {
309
+ class: vue.normalizeClass(["to-box", setClass.value]),
310
+ style: vue.normalizeStyle(setStyle.value)
311
+ },
312
+ [
313
+ vue.renderSlot(_ctx.$slots, "default")
314
+ ],
315
+ 6
316
+ /* CLASS, STYLE */
317
+ );
318
+ };
319
+ }
320
+ });
321
+
322
+ var Box = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/box/src/box.vue"]]);
323
+
324
+ const boxProps = {};
325
+
326
+ const ToBox = withInstall(Box);
327
+
328
+ const _hoisted_1$e = { class: "to-select-content" };
329
+ const _hoisted_2$b = { key: 0 };
330
+ const _hoisted_3$9 = { key: 1 };
331
+ const _hoisted_4$9 = ["onClick"];
332
+
333
+ const _sfc_main$o = /*@__PURE__*/Object.assign({
334
+ name: 'ToSelect',
335
+ }, {
336
+ __name: 'select',
337
+ props: {
338
+ modelValue: {
339
+ type: [String, Number],
340
+ default: '',
341
+ },
342
+ data: {
343
+ type: [Boolean, Array],
344
+ default: () => {
345
+ return [];
346
+ },
347
+ },
348
+ prefix: {
349
+ type: String,
350
+ default: '',
351
+ },
352
+ suffix: {
353
+ type: String,
354
+ default: '',
355
+ },
356
+ mode: {
357
+ type: String,
358
+ default: 'default',
359
+ },
360
+ placeholderText: {
361
+ type: String,
362
+ default: '请选择',
363
+ },
364
+ },
365
+ emits: ['update:modelValue', 'change'],
366
+ setup(__props, { emit: __emit }) {
367
+
368
+
369
+ const props = __props;
370
+ const elRef = vue.ref(null);
371
+ const optionRef = vue.ref(null);
372
+ let showOption = vue.ref(false);
373
+ const options = vue.computed(() => {
374
+ if (typeof props.data === 'string') {
375
+ // 按逗号拆分字符串,过滤空项
376
+ return props.data
377
+ .split(',')
378
+ .map(item => item.trim())
379
+ .filter(item => item.length > 0)
380
+ .map(item => ({ label: item, value: item }));
381
+ } else if (Array.isArray(props.data)) {
382
+ return props.data;
383
+ }
384
+ // 其它情况返回空数组
385
+ return [];
386
+ });
387
+
388
+ const emit = __emit;
389
+
390
+ const isPlaceholder = vue.computed(
391
+ () => props.modelValue === undefined || props.modelValue === null || props.modelValue === ''
392
+ );
393
+
394
+ const displayText = vue.computed(() => {
395
+ if (isPlaceholder.value) return props.placeholderText;
396
+ if (options.value.length) {
397
+ const found = options.value.find(item => item.value === props.modelValue);
398
+ return found && found.label !== undefined ? found.label : String(props.modelValue);
399
+ }
400
+ return String(props.modelValue);
401
+ });
402
+
403
+ const setClass = vue.computed(() => {
404
+ const arr = [];
405
+ if (props.mode) {
406
+ arr.push(`mode-${props.mode}`);
407
+ }
408
+ return arr;
409
+ });
410
+
411
+ const setOptionStyle = vue.computed(() => {
412
+ const obj = {};
413
+ return obj;
414
+ });
415
+
416
+ const open = () => {
417
+ if (showOption.value) {
418
+ showOption.value = false;
419
+ } else {
420
+ // 获取初始变量
421
+ const baseInfo = elRef.value.getBoundingClientRect();
422
+ // const floatInfo = optionRef.value.getBoundingClientRect()
423
+ const contentHeight = optionRef.value.scrollHeight;
424
+ const spaceHeight = document.body.offsetHeight - (baseInfo.top + baseInfo.height);
425
+
426
+ // 定位
427
+ optionRef.value.style.left = `${baseInfo.left}px`;
428
+ optionRef.value.style.top = `${baseInfo.top + baseInfo.height - 1}px`;
429
+
430
+ // 设置大小
431
+ optionRef.value.style.width = `${baseInfo.width}px`;
432
+
433
+ // 设置高度
434
+ if (spaceHeight < contentHeight) {
435
+ optionRef.value.style.height = `${spaceHeight}px`;
436
+ }
437
+
438
+ // 打开
439
+ showOption.value = true;
440
+
441
+ // 点击组件之外关闭
442
+ document.body.addEventListener('mousedown', blur);
443
+ }
444
+ };
445
+
446
+ const blur = e => {
447
+ let node = e.target;
448
+ while (node && node !== optionRef.value && node !== elRef.value && node.nodeName !== 'BODY') {
449
+ node = node.parentNode;
450
+ }
451
+ if (node && node.nodeName === 'BODY') {
452
+ close();
453
+ }
454
+ };
455
+
456
+ const select = item => {
457
+ emit('update:modelValue', item.value);
458
+ emit('change', item.value);
459
+ close();
460
+ };
461
+
462
+ const close = () => {
463
+ showOption.value = false;
464
+ };
465
+
466
+ const clear = () => {
467
+ emit('update:modelValue', '');
468
+ emit('change', '');
469
+ close();
470
+ };
471
+
472
+ return (_ctx, _cache) => {
473
+ return (vue.openBlock(), vue.createElementBlock("div", {
474
+ ref_key: "elRef",
475
+ ref: elRef,
476
+ class: vue.normalizeClass(["to-select", [{ 'is-placeholder': isPlaceholder.value }, ...setClass.value]]),
477
+ onClick: open
478
+ }, [
479
+ vue.createElementVNode("div", _hoisted_1$e, [
480
+ (!isPlaceholder.value)
481
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$b, vue.toDisplayString(__props.prefix), 1 /* TEXT */))
482
+ : vue.createCommentVNode("v-if", true),
483
+ vue.createTextVNode(" " + vue.toDisplayString(displayText.value) + " ", 1 /* TEXT */),
484
+ (!isPlaceholder.value)
485
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$9, vue.toDisplayString(__props.suffix), 1 /* TEXT */))
486
+ : vue.createCommentVNode("v-if", true)
487
+ ]),
488
+ _cache[0] || (_cache[0] = vue.createElementVNode("div", { class: "to-select-arrow" }, null, -1 /* CACHED */)),
489
+ (vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
490
+ vue.createElementVNode("div", {
491
+ ref_key: "optionRef",
492
+ ref: optionRef,
493
+ class: vue.normalizeClass(["to-select-option", { 'is-show': vue.unref(showOption) }]),
494
+ style: vue.normalizeStyle(setOptionStyle.value)
495
+ }, [
496
+ vue.createElementVNode("div", {
497
+ class: "to-select-item",
498
+ onClick: clear
499
+ }, vue.toDisplayString(__props.placeholderText), 1 /* TEXT */),
500
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(options.value, (item, index) => {
501
+ return (vue.openBlock(), vue.createElementBlock("div", {
502
+ key: index,
503
+ class: vue.normalizeClass(["to-select-item", { 'is-on': __props.modelValue === item.value }]),
504
+ onClick: $event => (select(item))
505
+ }, vue.toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_4$9))
506
+ }), 128 /* KEYED_FRAGMENT */))
507
+ ], 6 /* CLASS, STYLE */)
508
+ ]))
509
+ ], 2 /* CLASS */))
510
+ }
511
+ }
512
+
513
+ });
514
+ var Select = /*#__PURE__*/_export_sfc(_sfc_main$o, [['__file',"/Users/wangding/WorkSpace/AsiaInfo/projects/前端框架/touch-vue3-ui/packages/components/select/src/select.vue"]]);
515
+
516
+ const ToSelect = withInstall(Select);
517
+
518
+ var _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
519
+ ...{
520
+ name: "ToCalendar"
521
+ },
522
+ __name: "calendar",
523
+ setup(__props) {
524
+ return (_ctx, _cache) => {
525
+ return vue.openBlock(), vue.createElementBlock("div");
526
+ };
527
+ }
528
+ });
529
+
530
+ var Calendar = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/calendar/src/calendar.vue"]]);
531
+
532
+ const ToCalendar = withInstall(Calendar);
533
+
534
+ var _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
535
+ ...{
536
+ name: "ToSpace"
537
+ },
538
+ __name: "space",
539
+ props: {
540
+ mode: { type: String, required: false, default: "default" },
541
+ value: { type: [String, Number], required: false, default: "" },
542
+ inline: { type: Boolean, required: false, default: false }
543
+ },
544
+ setup(__props) {
545
+ const props = __props;
546
+ const setStyle = vue.computed(() => {
547
+ const obj = {};
548
+ if (props.value) {
549
+ if (props.inline) {
550
+ if (!isNaN(Number(props.value))) {
551
+ obj.width = props.value + "em";
552
+ } else {
553
+ obj.width = props.value;
554
+ }
555
+ } else {
556
+ if (!isNaN(Number(props.value))) {
557
+ obj.height = props.value + "em";
558
+ } else {
559
+ obj.height = props.value;
560
+ }
561
+ }
562
+ }
563
+ return obj;
564
+ });
565
+ const setClass = vue.computed(() => {
566
+ let arr = [];
567
+ if (props.mode) {
568
+ arr.push(`mode-${props.mode}`);
569
+ }
570
+ if (props.inline) {
571
+ arr.push(`is-inline`);
572
+ }
573
+ return arr;
574
+ });
575
+ return (_ctx, _cache) => {
576
+ return vue.openBlock(), vue.createElementBlock(
577
+ "div",
578
+ {
579
+ class: vue.normalizeClass(["to-space", setClass.value]),
580
+ style: vue.normalizeStyle(setStyle.value)
581
+ },
582
+ null,
583
+ 6
584
+ /* CLASS, STYLE */
585
+ );
586
+ };
587
+ }
588
+ });
589
+
590
+ var Space = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/space/src/space.vue"]]);
591
+
592
+ const ToSpace = withInstall(Space);
593
+
594
+ const _hoisted_1$d = { class: "to-step" };
595
+ const _hoisted_2$a = { class: "to-step-index" };
596
+ const _hoisted_3$8 = {
597
+ key: 0,
598
+ class: "to-step-icon"
599
+ };
600
+ const _hoisted_4$8 = {
601
+ key: 1,
602
+ class: "to-step-number"
603
+ };
604
+ const _hoisted_5$8 = { class: "to-step-text" };
605
+ const _hoisted_6$7 = { class: "to-step-title" };
606
+ const _hoisted_7$6 = { class: "to-step-label" };
607
+ const _hoisted_8$6 = { class: "to-step-content" };
608
+ var _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
609
+ ...{
610
+ name: "ToStep"
611
+ },
612
+ __name: "step",
613
+ props: {
614
+ data: {
615
+ type: Array,
616
+ default: () => []
617
+ },
618
+ modelValue: { type: [Number, String], default: 0 }
619
+ },
620
+ emits: ["update:modelValue"],
621
+ setup(__props, { emit: __emit }) {
622
+ const props = __props;
623
+ const emit = __emit;
624
+ const updateValue = (idx) => {
625
+ console.log(props);
626
+ emit("update:modelValue", idx);
627
+ };
628
+ console.log(updateValue);
629
+ return (_ctx, _cache) => {
630
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
631
+ (vue.openBlock(true), vue.createElementBlock(
632
+ vue.Fragment,
633
+ null,
634
+ vue.renderList(__props.data, (item, idx) => {
635
+ return vue.openBlock(), vue.createElementBlock(
636
+ "div",
637
+ {
638
+ key: idx,
639
+ class: vue.normalizeClass(["to-step-item", { "is-on": idx === Number(__props.modelValue), "is-completed": Number(__props.modelValue) > idx }])
640
+ },
641
+ [
642
+ vue.createElementVNode("div", _hoisted_2$a, [
643
+ Number(__props.modelValue) > idx ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$8)) : (vue.openBlock(), vue.createElementBlock(
644
+ "div",
645
+ _hoisted_4$8,
646
+ vue.toDisplayString(idx + 1),
647
+ 1
648
+ /* TEXT */
649
+ ))
650
+ ]),
651
+ vue.createElementVNode("div", _hoisted_5$8, [
652
+ vue.createElementVNode("div", _hoisted_6$7, [
653
+ vue.createElementVNode(
654
+ "div",
655
+ _hoisted_7$6,
656
+ vue.toDisplayString(item.label),
657
+ 1
658
+ /* TEXT */
659
+ ),
660
+ _cache[0] || (_cache[0] = vue.createElementVNode(
661
+ "div",
662
+ { class: "to-step-line" },
663
+ null,
664
+ -1
665
+ /* CACHED */
666
+ ))
667
+ ]),
668
+ vue.createElementVNode(
669
+ "div",
670
+ _hoisted_8$6,
671
+ vue.toDisplayString(item.content),
672
+ 1
673
+ /* TEXT */
674
+ )
675
+ ])
676
+ ],
677
+ 2
678
+ /* CLASS */
679
+ );
680
+ }),
681
+ 128
682
+ /* KEYED_FRAGMENT */
683
+ ))
684
+ ]);
685
+ };
686
+ }
687
+ });
688
+
689
+ var Step = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/step/src/step.vue"]]);
690
+
691
+ const ToStep = withInstall(Step);
692
+
693
+ var _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
694
+ ...{
695
+ name: "ToForm"
696
+ },
697
+ __name: "form",
698
+ props: {
699
+ labelWidth: {
700
+ type: [Number, String],
701
+ default: ""
702
+ },
703
+ labelPosition: {
704
+ type: String,
705
+ default: "left"
706
+ },
707
+ col: {
708
+ type: [Number, String],
709
+ default: 1
710
+ },
711
+ submitPosition: {
712
+ type: String,
713
+ default: ""
714
+ },
715
+ type: {
716
+ type: String,
717
+ default: ""
718
+ },
719
+ mode: {
720
+ type: String,
721
+ default: ""
722
+ },
723
+ space: {
724
+ type: [Number, String],
725
+ default: (props) => props.type === "list" ? 0 : 0.5
726
+ },
727
+ spaceX: {
728
+ type: [Number, String],
729
+ default: ""
730
+ },
731
+ spaceY: {
732
+ type: [Number, String],
733
+ default: ""
734
+ },
735
+ valueWidth: {
736
+ type: String,
737
+ default: ""
738
+ },
739
+ comparable: Boolean,
740
+ readonly: Boolean
741
+ },
742
+ setup(__props) {
743
+ const props = __props;
744
+ const toForm = vue.ref(null);
745
+ const slots = vue.useSlots();
746
+ const items = vue.ref([]);
747
+ const setClass = vue.computed(() => {
748
+ const arr = [];
749
+ if (props.col)
750
+ arr.push(`col-${props.col}`);
751
+ if (props.submitPosition)
752
+ arr.push(`submit-position-${props.submitPosition}`);
753
+ if (props.mode)
754
+ arr.push(`mode-${props.mode}`);
755
+ if (props.labelPosition)
756
+ arr.push(`label-position-${props.labelPosition}`);
757
+ if (props.valueWidth)
758
+ arr.push(`value-width-${props.valueWidth}`);
759
+ return arr;
760
+ });
761
+ const setSubmitStyle = vue.computed(() => {
762
+ const obj = {};
763
+ const sp = props.space;
764
+ const spy = props.spaceY;
765
+ const pos = props.submitPosition;
766
+ if ((sp || sp === 0) && pos !== "right" && pos !== "follow" && props.type !== "list") {
767
+ obj.marginTop = `${sp}em`;
768
+ }
769
+ if ((sp || sp === 0) && (pos === "rightBottom" || pos === "item")) {
770
+ obj.paddingTop = `${sp}em`;
771
+ }
772
+ if ((spy || spy === 0) && pos !== "right" && pos !== "follow" && props.type !== "list") {
773
+ obj.marginTop = `${spy}em`;
774
+ }
775
+ if ((spy || spy === 0) && (pos === "rightBottom" || pos === "item")) {
776
+ obj.paddingTop = `${spy}em`;
777
+ }
778
+ return obj;
779
+ });
780
+ const setLiStyle = vue.computed(() => {
781
+ const obj = {};
782
+ const pos = props.submitPosition;
783
+ if ((props.space || props.space === 0) && pos === "rightBottom") {
784
+ obj.marginTop = `${props.space}em`;
785
+ }
786
+ if ((props.spaceY || props.spaceY === 0) && pos === "rightBottom") {
787
+ obj.marginTop = `${props.spaceY}em`;
788
+ }
789
+ return obj;
790
+ });
791
+ const adjust = () => {
792
+ setTimeout(() => {
793
+ let maxWidth = 0;
794
+ items.value.forEach((item) => {
795
+ var _a;
796
+ if ((_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.label) {
797
+ item.$refs.label.style.width = "";
798
+ }
799
+ });
800
+ items.value.forEach((item) => {
801
+ var _a;
802
+ const labelText = (_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.labelText;
803
+ if (labelText && labelText.clientWidth > maxWidth) {
804
+ maxWidth = labelText.clientWidth;
805
+ }
806
+ });
807
+ items.value.forEach((item) => {
808
+ var _a;
809
+ if ((_a = item == null ? void 0 : item.$refs) == null ? void 0 : _a.label) {
810
+ item.$refs.label.style.width = `${maxWidth + 1}px`;
811
+ }
812
+ });
813
+ }, 200);
814
+ };
815
+ vue.onMounted(() => {
816
+ if (props.labelWidth === "max") {
817
+ window.addEventListener("resize", adjust);
818
+ adjust();
819
+ }
820
+ });
821
+ vue.onBeforeUnmount(() => {
822
+ if (props.labelWidth === "max") {
823
+ window.removeEventListener("resize", adjust);
824
+ }
825
+ });
826
+ const instance = vue.getCurrentInstance();
827
+ vue.provide("ToForm", instance == null ? void 0 : instance.proxy);
828
+ return (_ctx, _cache) => {
829
+ return vue.openBlock(), vue.createElementBlock(
830
+ "div",
831
+ {
832
+ class: vue.normalizeClass(["to-form", setClass.value])
833
+ },
834
+ [
835
+ vue.createElementVNode(
836
+ "ul",
837
+ {
838
+ ref_key: "toForm",
839
+ ref: toForm,
840
+ class: "to-form-list"
841
+ },
842
+ [
843
+ vue.renderSlot(_ctx.$slots, "default"),
844
+ props.submitPosition === "corner" ? (vue.openBlock(), vue.createElementBlock(
845
+ "li",
846
+ {
847
+ key: 0,
848
+ class: "to-form-item to-form-placeholder",
849
+ style: vue.normalizeStyle(setLiStyle.value)
850
+ },
851
+ null,
852
+ 4
853
+ /* STYLE */
854
+ )) : vue.createCommentVNode("v-if", true),
855
+ vue.unref(slots).submit ? (vue.openBlock(), vue.createElementBlock(
856
+ "li",
857
+ {
858
+ key: 1,
859
+ class: "to-form-submit",
860
+ style: vue.normalizeStyle(setSubmitStyle.value.value)
861
+ },
862
+ [
863
+ vue.renderSlot(_ctx.$slots, "submit")
864
+ ],
865
+ 4
866
+ /* STYLE */
867
+ )) : vue.createCommentVNode("v-if", true)
868
+ ],
869
+ 512
870
+ /* NEED_PATCH */
871
+ )
872
+ ],
873
+ 2
874
+ /* CLASS */
875
+ );
876
+ };
877
+ }
878
+ });
879
+
880
+ var Form = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/form/src/form.vue"]]);
881
+
882
+ const _hoisted_1$c = { class: "to-form-value" };
883
+ var _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
884
+ ...{
885
+ name: "ToFormItem",
886
+ inheritAttrs: false
887
+ },
888
+ __name: "form-item",
889
+ props: {
890
+ label: { type: String, required: false },
891
+ labelTip: { type: String, required: false },
892
+ tip: { type: String, required: false },
893
+ labelWidth: { type: [Number, String], required: false },
894
+ required: { type: Boolean, required: false },
895
+ merge: { type: [Number, String, null], required: false },
896
+ link: { type: Boolean, required: false }
897
+ },
898
+ emits: ["click"],
899
+ setup(__props, { emit: __emit }) {
900
+ const emit = __emit;
901
+ const props = __props;
902
+ const labelV = vue.ref(null);
903
+ const labelText = vue.ref(null);
904
+ const ToForm = vue.inject("ToForm", {
905
+ items: []
906
+ });
907
+ vue.provide("ToFormItem", {});
908
+ const setClass = vue.computed(() => {
909
+ const arr = [];
910
+ if (props.required)
911
+ arr.push("is-required");
912
+ if (props.link)
913
+ arr.push("link");
914
+ if (props.merge !== null && props.merge !== void 0)
915
+ arr.push(`merge-${props.merge}`);
916
+ return arr;
917
+ });
918
+ const setLabelStyle = vue.computed(() => {
919
+ const style = {};
920
+ if (ToForm.labelWidth) {
921
+ style.width = ToForm.labelWidth + "em";
922
+ }
923
+ return style;
924
+ });
925
+ vue.onMounted(() => {
926
+ var _a;
927
+ (_a = ToForm == null ? void 0 : ToForm.items) == null ? void 0 : _a.push({
928
+ $refs: {
929
+ label: labelV.value,
930
+ labelText: labelText.value
931
+ }
932
+ });
933
+ });
934
+ return (_ctx, _cache) => {
935
+ return vue.openBlock(), vue.createElementBlock(
936
+ "li",
937
+ {
938
+ class: vue.normalizeClass(["to-form-item", setClass.value]),
939
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
940
+ },
941
+ [
942
+ vue.createElementVNode(
943
+ "div",
944
+ {
945
+ class: "to-form-label",
946
+ style: vue.normalizeStyle(setLabelStyle.value)
947
+ },
948
+ vue.toDisplayString(props.label),
949
+ 5
950
+ /* TEXT, STYLE */
951
+ ),
952
+ vue.createElementVNode("div", _hoisted_1$c, [
953
+ vue.renderSlot(_ctx.$slots, "default")
954
+ ])
955
+ ],
956
+ 2
957
+ /* CLASS */
958
+ );
959
+ };
960
+ }
961
+ });
962
+
963
+ var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/form/src/form-item.vue"]]);
964
+
965
+ const ToForm = withInstall(Form);
966
+ const ToFormItem = withInstall(FormItem);
967
+
968
+ var _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
969
+ __name: "grid",
970
+ props: {
971
+ type: { type: String, required: false, default: "" },
972
+ mode: { type: String, required: false, default: "default" },
973
+ space: { type: [Number, String], required: false, default: 0 },
974
+ spaceX: { type: [Number, String], required: false, default: 0 },
975
+ spaceY: { type: [Number, String], required: false, default: 0 },
976
+ padding: { type: [Number, String], required: false, default: 0 },
977
+ paddingX: { type: [Number, String], required: false, default: 0 },
978
+ paddingY: { type: [Number, String], required: false, default: 0 },
979
+ paddingPosition: { type: String, required: false, default: "" },
980
+ col: { type: [Number, String], required: false, default: "" },
981
+ height: { type: [Number, String], required: false, default: "" },
982
+ verticalAlign: { type: String, required: false, default: "top" },
983
+ va: { type: String, required: false, default: "top" },
984
+ line: { type: Boolean, required: false, default: false },
985
+ wrap: { type: Boolean, required: false, default: true },
986
+ visible: { type: Boolean, required: false, default: false }
987
+ },
988
+ setup(__props) {
989
+ const props = __props;
990
+ vue.provide("grid", props);
991
+ const setStyle = vue.computed(() => {
992
+ const obj = {};
993
+ if (!props.paddingPosition) {
994
+ if (typeof props.padding === "string" && props.padding.includes(" ")) {
995
+ const arr = props.padding.split(" ").map((item) => isNaN(Number(item)) ? item : `${item}em`);
996
+ obj.padding = arr.join(" ");
997
+ } else {
998
+ if (!props.paddingX && !props.paddingY) {
999
+ obj.padding = isNaN(Number(props.padding)) ? String(props.padding) : `${props.padding}em`;
1000
+ } else {
1001
+ if (props.paddingX) {
1002
+ const px = isNaN(Number(props.paddingX)) ? String(props.paddingX) : `${props.paddingX}em`;
1003
+ obj.paddingLeft = px;
1004
+ obj.paddingRight = px;
1005
+ }
1006
+ if (props.paddingY) {
1007
+ const py = isNaN(Number(props.paddingY)) ? String(props.paddingY) : `${props.paddingY}em`;
1008
+ obj.paddingTop = py;
1009
+ obj.paddingBottom = py;
1010
+ }
1011
+ }
1012
+ }
1013
+ } else {
1014
+ const p = props.padding;
1015
+ const position = props.paddingPosition;
1016
+ if (["u", "n", "c", "left", "side"].includes(position)) {
1017
+ obj.paddingLeft = isNaN(Number(p)) ? String(p) : `${p}em`;
1018
+ }
1019
+ if (["u", "n", "\u0254", "right", "side"].includes(position)) {
1020
+ obj.paddingRight = isNaN(Number(p)) ? String(p) : `${p}em`;
1021
+ }
1022
+ if (["n", "c", "\u0254"].includes(position)) {
1023
+ obj.paddingTop = isNaN(Number(p)) ? String(p) : `${p}em`;
1024
+ }
1025
+ if (["u", "c", "\u0254"].includes(position)) {
1026
+ obj.paddingBottom = isNaN(Number(p)) ? String(p) : `${p}em`;
1027
+ }
1028
+ }
1029
+ return obj;
1030
+ });
1031
+ const setContentStyle = vue.computed(() => {
1032
+ const obj = {};
1033
+ if (props.space && props.type !== "v") {
1034
+ obj.marginTop = `-${props.space}em`;
1035
+ }
1036
+ if (props.space) {
1037
+ obj.marginLeft = `-${props.space}em`;
1038
+ }
1039
+ if (props.spaceY && props.type !== "v") {
1040
+ obj.marginTop = `-${props.spaceY}em`;
1041
+ }
1042
+ if (props.spaceX) {
1043
+ obj.marginLeft = `-${props.spaceX}em`;
1044
+ }
1045
+ if (String(props.space) === "-1") {
1046
+ obj.paddingTop = "1px";
1047
+ obj.paddingLeft = "1px";
1048
+ }
1049
+ if (String(props.spaceY) === "-1") {
1050
+ obj.paddingTop = "1px";
1051
+ }
1052
+ if (String(props.spaceX) === "-1") {
1053
+ obj.paddingLeft = "1px";
1054
+ }
1055
+ if (props.height && props.height !== "full") {
1056
+ obj.height = isNaN(Number(props.height)) ? String(props.height) : `${props.height}em`;
1057
+ }
1058
+ return obj;
1059
+ });
1060
+ const setClass = vue.computed(() => {
1061
+ const classes = [];
1062
+ if (props.col !== "")
1063
+ classes.push(`col-${props.col}`);
1064
+ if (props.line)
1065
+ classes.push("is-line");
1066
+ if (props.mode)
1067
+ classes.push(`mode-${props.mode}`);
1068
+ if (props.visible)
1069
+ classes.push(`is-visible`);
1070
+ if (!props.wrap)
1071
+ classes.push("wrap-false");
1072
+ if (props.type === "v")
1073
+ classes.push("type-v");
1074
+ if (props.height === "full")
1075
+ classes.push("height-full");
1076
+ if (props.verticalAlign === "center" || props.va === "center")
1077
+ classes.push("va-center");
1078
+ if (props.verticalAlign === "bottom" || props.va === "bottom")
1079
+ classes.push("va-bottom");
1080
+ return classes;
1081
+ });
1082
+ return (_ctx, _cache) => {
1083
+ return vue.openBlock(), vue.createElementBlock(
1084
+ "div",
1085
+ {
1086
+ class: vue.normalizeClass(["to-grid", setClass.value]),
1087
+ style: vue.normalizeStyle(setStyle.value)
1088
+ },
1089
+ [
1090
+ vue.createElementVNode(
1091
+ "div",
1092
+ {
1093
+ class: "to-grid-content",
1094
+ style: vue.normalizeStyle(setContentStyle.value)
1095
+ },
1096
+ [
1097
+ vue.renderSlot(_ctx.$slots, "default")
1098
+ ],
1099
+ 4
1100
+ /* STYLE */
1101
+ )
1102
+ ],
1103
+ 6
1104
+ /* CLASS, STYLE */
1105
+ );
1106
+ };
1107
+ }
1108
+ });
1109
+
1110
+ var Grid = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/grid/src/grid.vue"]]);
1111
+
1112
+ var _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
1113
+ __name: "grid-item",
1114
+ props: {
1115
+ merge: { type: [Number, String], required: false, default: 1 },
1116
+ width: { type: [Number, String], required: false, default: "" },
1117
+ side: { type: Boolean, required: false, default: false }
1118
+ },
1119
+ setup(__props) {
1120
+ const props = __props;
1121
+ const grid = vue.inject("grid", {});
1122
+ function parseVal(val) {
1123
+ return Number(val != null ? val : 0);
1124
+ }
1125
+ const setStyle = vue.computed(() => {
1126
+ const style = {};
1127
+ const space = parseVal(grid == null ? void 0 : grid.space);
1128
+ const spaceX = parseVal(grid == null ? void 0 : grid.spaceX);
1129
+ const spaceY = parseVal(grid == null ? void 0 : grid.spaceY);
1130
+ if (space > 0) {
1131
+ style.paddingTop = `${space}em`;
1132
+ style.paddingLeft = `${space}em`;
1133
+ }
1134
+ if (spaceY > 0) {
1135
+ style.paddingTop = `${spaceY}em`;
1136
+ }
1137
+ if (spaceX > 0) {
1138
+ style.paddingLeft = `${spaceX}em`;
1139
+ }
1140
+ if (space === -1) {
1141
+ style.marginTop = "-1px";
1142
+ style.marginLeft = "-1px";
1143
+ }
1144
+ if (spaceY === -1) {
1145
+ style.marginTop = "-1px";
1146
+ }
1147
+ if (spaceX === -1) {
1148
+ style.marginLeft = "-1px";
1149
+ }
1150
+ if (props.width) {
1151
+ if (!isNaN(Number(props.width))) {
1152
+ style.width = `${props.width}em`;
1153
+ } else if (props.width === "full") {
1154
+ style.width = "100%";
1155
+ } else {
1156
+ style.width = props.width.toString();
1157
+ }
1158
+ }
1159
+ return style;
1160
+ });
1161
+ const setClass = vue.computed(() => {
1162
+ const arr = [];
1163
+ if (Number(props.merge) > 1) {
1164
+ arr.push(`merge-${props.merge}`);
1165
+ }
1166
+ if (props.side) {
1167
+ arr.push("is-side");
1168
+ }
1169
+ return arr;
1170
+ });
1171
+ return (_ctx, _cache) => {
1172
+ return vue.openBlock(), vue.createElementBlock(
1173
+ "div",
1174
+ {
1175
+ class: vue.normalizeClass(["to-grid-item", setClass.value]),
1176
+ style: vue.normalizeStyle(setStyle.value)
1177
+ },
1178
+ [
1179
+ vue.renderSlot(_ctx.$slots, "default")
1180
+ ],
1181
+ 6
1182
+ /* CLASS, STYLE */
1183
+ );
1184
+ };
1185
+ }
1186
+ });
1187
+
1188
+ var GridItem = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/grid/src/grid-item.vue"]]);
1189
+
1190
+ const ToGrid = withInstall(Grid);
1191
+ const ToGridItem = withInstall(GridItem);
1192
+
1193
+ const _hoisted_1$b = {
1194
+ key: 0,
1195
+ class: "to-header-left"
1196
+ };
1197
+ const _hoisted_2$9 = {
1198
+ key: 1,
1199
+ class: "to-header-back"
1200
+ };
1201
+ const _hoisted_3$7 = {
1202
+ key: 0,
1203
+ class: "tip"
1204
+ };
1205
+ const _hoisted_4$7 = {
1206
+ key: 2,
1207
+ class: "to-header-center"
1208
+ };
1209
+ const _hoisted_5$7 = {
1210
+ key: 3,
1211
+ class: "to-header-title"
1212
+ };
1213
+ const _hoisted_6$6 = {
1214
+ key: 0,
1215
+ class: "to-header-title-text"
1216
+ };
1217
+ const _hoisted_7$5 = {
1218
+ key: 1,
1219
+ class: "to-header-title-text"
1220
+ };
1221
+ const _hoisted_8$5 = {
1222
+ key: 2,
1223
+ class: "to-header-title-tip"
1224
+ };
1225
+ const _hoisted_9$3 = {
1226
+ key: 4,
1227
+ class: "to-header-content"
1228
+ };
1229
+ const _hoisted_10$2 = { class: "to-header-fn" };
1230
+ const _hoisted_11$2 = {
1231
+ key: 5,
1232
+ class: "to-header-fn is-float"
1233
+ };
1234
+ const _hoisted_12$1 = {
1235
+ key: 6,
1236
+ class: "to-header-right"
1237
+ };
1238
+ var _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
1239
+ __name: "header",
1240
+ props: {
1241
+ title: { type: String, required: false, default: "" },
1242
+ color: { type: String, required: false, default: "" },
1243
+ mode: { type: String, required: false, default: "default" },
1244
+ titlePosition: { type: String, required: false, default: "left" }
1245
+ },
1246
+ emits: ["back"],
1247
+ setup(__props, { emit: __emit }) {
1248
+ const instance = vue.getCurrentInstance();
1249
+ const props = __props;
1250
+ const emit = __emit;
1251
+ const slots = vue.useSlots();
1252
+ const float = vue.ref();
1253
+ const floatFnIcon = vue.ref();
1254
+ const hasBack = vue.computed(() => {
1255
+ var _a;
1256
+ return !!((_a = instance == null ? void 0 : instance.vnode.props) == null ? void 0 : _a.onClick);
1257
+ });
1258
+ const setClass = vue.computed(() => {
1259
+ const arr = [];
1260
+ if (props.mode) {
1261
+ arr.push(`mode-${props.mode}`);
1262
+ }
1263
+ return arr;
1264
+ });
1265
+ const toggleFloat = () => {
1266
+ var _a, _b;
1267
+ (_b = (_a = float.value) == null ? void 0 : _a.toggle) == null ? void 0 : _b.call(_a, floatFnIcon.value);
1268
+ };
1269
+ return (_ctx, _cache) => {
1270
+ const _component_to_button = vue.resolveComponent("to-button");
1271
+ const _component_to_icon = vue.resolveComponent("to-icon");
1272
+ const _component_to_float = vue.resolveComponent("to-float");
1273
+ return vue.openBlock(), vue.createElementBlock(
1274
+ "div",
1275
+ {
1276
+ class: vue.normalizeClass(["to-header", setClass.value])
1277
+ },
1278
+ [
1279
+ vue.unref(slots).left || Boolean(hasBack.value) && props.titlePosition === "center" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
1280
+ Boolean(hasBack.value) && props.titlePosition === "center" ? (vue.openBlock(), vue.createBlock(_component_to_button, {
1281
+ key: 0,
1282
+ icon: "back",
1283
+ mode: "none",
1284
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
1285
+ })) : vue.createCommentVNode("v-if", true),
1286
+ vue.renderSlot(_ctx.$slots, "left")
1287
+ ])) : vue.createCommentVNode("v-if", true),
1288
+ (props.title || vue.unref(slots).title) && Boolean(hasBack.value) && props.titlePosition === "left" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
1289
+ vue.createVNode(_component_to_button, {
1290
+ mode: "none",
1291
+ icon: "back",
1292
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("back"))
1293
+ }, {
1294
+ default: vue.withCtx(() => [
1295
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
1296
+ vue.createTextVNode(
1297
+ vue.toDisplayString(props.title),
1298
+ 1
1299
+ /* TEXT */
1300
+ )
1301
+ ])
1302
+ ]),
1303
+ _: 3
1304
+ /* FORWARDED */
1305
+ }),
1306
+ vue.unref(slots).tip ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$7, [
1307
+ vue.renderSlot(_ctx.$slots, "tip")
1308
+ ])) : vue.createCommentVNode("v-if", true)
1309
+ ])) : vue.createCommentVNode("v-if", true),
1310
+ props.titlePosition === "center" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$7, [
1311
+ vue.renderSlot(_ctx.$slots, "icon"),
1312
+ vue.renderSlot(_ctx.$slots, "title", {}, () => [
1313
+ vue.createTextVNode(
1314
+ vue.toDisplayString(props.title),
1315
+ 1
1316
+ /* TEXT */
1317
+ )
1318
+ ])
1319
+ ])) : vue.createCommentVNode("v-if", true),
1320
+ (props.title || vue.unref(slots).title) && !Boolean(hasBack.value) && props.titlePosition === "left" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$7, [
1321
+ _cache[2] || (_cache[2] = vue.createElementVNode(
1322
+ "div",
1323
+ { class: "to-header-title-icon" },
1324
+ null,
1325
+ -1
1326
+ /* CACHED */
1327
+ )),
1328
+ props.title ? (vue.openBlock(), vue.createElementBlock(
1329
+ "div",
1330
+ _hoisted_6$6,
1331
+ vue.toDisplayString(props.title),
1332
+ 1
1333
+ /* TEXT */
1334
+ )) : vue.createCommentVNode("v-if", true),
1335
+ vue.unref(slots).title ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$5, [
1336
+ vue.unref(slots).title ? vue.renderSlot(_ctx.$slots, "title", { key: 0 }) : vue.createCommentVNode("v-if", true)
1337
+ ])) : vue.createCommentVNode("v-if", true),
1338
+ vue.unref(slots).tip ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$5, [
1339
+ vue.renderSlot(_ctx.$slots, "tip")
1340
+ ])) : vue.createCommentVNode("v-if", true)
1341
+ ])) : vue.createCommentVNode("v-if", true),
1342
+ vue.unref(slots).content || !((props.title || vue.unref(slots).title) && props.titlePosition === "left") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$3, [
1343
+ vue.renderSlot(_ctx.$slots, "content")
1344
+ ])) : vue.createCommentVNode("v-if", true),
1345
+ vue.createElementVNode("div", _hoisted_10$2, [
1346
+ vue.renderSlot(_ctx.$slots, "default")
1347
+ ]),
1348
+ vue.unref(slots).floatFn ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$2, [
1349
+ vue.createVNode(
1350
+ _component_to_icon,
1351
+ {
1352
+ ref_key: "floatFnIcon",
1353
+ ref: floatFnIcon,
1354
+ link: "",
1355
+ value: "menu",
1356
+ mode: "none",
1357
+ fillet: "normal",
1358
+ onClick: toggleFloat
1359
+ },
1360
+ null,
1361
+ 512
1362
+ /* NEED_PATCH */
1363
+ ),
1364
+ vue.createVNode(
1365
+ _component_to_float,
1366
+ {
1367
+ ref_key: "float",
1368
+ ref: float,
1369
+ class: "to-header-floatFn",
1370
+ width: 10
1371
+ },
1372
+ {
1373
+ default: vue.withCtx(() => [
1374
+ vue.renderSlot(_ctx.$slots, "floatFn")
1375
+ ]),
1376
+ _: 3
1377
+ /* FORWARDED */
1378
+ },
1379
+ 512
1380
+ /* NEED_PATCH */
1381
+ )
1382
+ ])) : vue.createCommentVNode("v-if", true),
1383
+ vue.unref(slots).right ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
1384
+ vue.renderSlot(_ctx.$slots, "right")
1385
+ ])) : vue.createCommentVNode("v-if", true)
1386
+ ],
1387
+ 2
1388
+ /* CLASS */
1389
+ );
1390
+ };
1391
+ }
1392
+ });
1393
+
1394
+ var Header = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/header/src/header.vue"]]);
1395
+
1396
+ const ToHeader = withInstall(Header);
1397
+
1398
+ const _hoisted_1$a = {
1399
+ key: 0,
1400
+ class: "to-input-prefix"
1401
+ };
1402
+ const _hoisted_2$8 = {
1403
+ key: 0,
1404
+ class: "to-input-text"
1405
+ };
1406
+ const _hoisted_3$6 = ["autocomplete", "maxlength", "placeholder", "readonly", "tabindex"];
1407
+ const _hoisted_4$6 = {
1408
+ key: 2,
1409
+ class: "to-input-html"
1410
+ };
1411
+ const _hoisted_5$6 = ["autocomplete", "tabindex", "maxlength", "placeholder", "type", "readonly"];
1412
+ const _hoisted_6$5 = {
1413
+ key: 4,
1414
+ class: "to-input-suffix"
1415
+ };
1416
+ const _hoisted_7$4 = {
1417
+ key: 2,
1418
+ class: "to-input-text"
1419
+ };
1420
+ const _hoisted_8$4 = {
1421
+ key: 3,
1422
+ class: "to-input-suggestion"
1423
+ };
1424
+ var _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
1425
+ ...{
1426
+ name: "ToInput"
1427
+ },
1428
+ __name: "input",
1429
+ props: {
1430
+ id: {
1431
+ type: String,
1432
+ default: ""
1433
+ },
1434
+ placeholder: {
1435
+ type: String,
1436
+ default: "\u8BF7\u8F93\u5165"
1437
+ },
1438
+ type: {
1439
+ type: String,
1440
+ default: "text"
1441
+ },
1442
+ tabindex: {
1443
+ type: String,
1444
+ default: "1"
1445
+ },
1446
+ autocomplete: {
1447
+ type: Boolean,
1448
+ default: false
1449
+ },
1450
+ readonly: {
1451
+ type: Boolean,
1452
+ default: false
1453
+ },
1454
+ max: {
1455
+ type: [String, Number],
1456
+ default: Infinity
1457
+ },
1458
+ min: {
1459
+ type: [String, Number],
1460
+ default: -Infinity
1461
+ },
1462
+ maxlength: {
1463
+ type: [String, Number],
1464
+ default: Infinity
1465
+ },
1466
+ dot: {
1467
+ type: [String, Number],
1468
+ default: 0
1469
+ },
1470
+ step: {
1471
+ type: [String, Number],
1472
+ default: null
1473
+ },
1474
+ stepIconMode: {
1475
+ type: String,
1476
+ default: ""
1477
+ },
1478
+ spChars: {
1479
+ type: [String, Boolean],
1480
+ default: '/,\\,[,],{,},"'
1481
+ },
1482
+ prefix: {
1483
+ type: String,
1484
+ default: ""
1485
+ },
1486
+ suffix: {
1487
+ type: String,
1488
+ default: ""
1489
+ },
1490
+ suggestion: {
1491
+ type: String,
1492
+ default: ""
1493
+ },
1494
+ suggestionType: {
1495
+ type: String,
1496
+ default: ""
1497
+ },
1498
+ suggestionSymbol: {
1499
+ type: String,
1500
+ default: "\u3001"
1501
+ },
1502
+ clearable: {
1503
+ type: Boolean,
1504
+ default: false
1505
+ },
1506
+ preventFocus: {
1507
+ type: Boolean,
1508
+ default: false
1509
+ },
1510
+ comparable: {
1511
+ type: Boolean,
1512
+ default: false
1513
+ },
1514
+ modelValue: {
1515
+ type: [String, Number],
1516
+ default: () => ""
1517
+ },
1518
+ html: {
1519
+ type: [String, Number],
1520
+ default: ""
1521
+ },
1522
+ trim: {
1523
+ type: Boolean,
1524
+ default: true
1525
+ },
1526
+ fillet: {
1527
+ type: String,
1528
+ default: "normal"
1529
+ },
1530
+ filletPosition: {
1531
+ type: String,
1532
+ default: ""
1533
+ },
1534
+ color: {
1535
+ type: String,
1536
+ default: "default"
1537
+ },
1538
+ placeholderColor: {
1539
+ type: String,
1540
+ default: ""
1541
+ },
1542
+ mode: {
1543
+ type: String,
1544
+ default: ""
1545
+ },
1546
+ width: {
1547
+ type: [Number, String],
1548
+ default: ""
1549
+ },
1550
+ height: {
1551
+ type: [Number, String],
1552
+ default: ""
1553
+ },
1554
+ link: {
1555
+ type: Boolean,
1556
+ default: false
1557
+ },
1558
+ conversionType: {
1559
+ type: [String, Number],
1560
+ default: 0
1561
+ }
1562
+ },
1563
+ emits: ["update:modelValue", "click", "clear"],
1564
+ setup(__props, { emit: __emit }) {
1565
+ const props = __props;
1566
+ const emit = __emit;
1567
+ const focused = vue.ref(false);
1568
+ const data = vue.ref(props.modelValue);
1569
+ const clearVisible = vue.ref(false);
1570
+ const itype = vue.ref("text");
1571
+ const disabled = vue.computed(() => props.readonly);
1572
+ vue.watch(
1573
+ () => props.modelValue,
1574
+ (val) => {
1575
+ data.value = val;
1576
+ }
1577
+ );
1578
+ const iPlaceholder = vue.computed(() => {
1579
+ if (!disabled.value && !props.placeholder && props.placeholder !== "") {
1580
+ return "\u8BF7\u586B\u5199";
1581
+ } else {
1582
+ return props.placeholder;
1583
+ }
1584
+ });
1585
+ const iconMode = vue.computed(() => {
1586
+ if (props.mode === "none" || props.mode === "line" || focused.value)
1587
+ return "none";
1588
+ if (props.mode === "fill")
1589
+ return "fill";
1590
+ return "plain";
1591
+ });
1592
+ const setClass = vue.computed(() => {
1593
+ const arr = [];
1594
+ if (props.mode) {
1595
+ arr.push(`mode-${props.mode}`);
1596
+ }
1597
+ if (props.type) {
1598
+ arr.push(`type-${props.type}`);
1599
+ }
1600
+ if (props.readonly) {
1601
+ arr.push(`is-readonly`);
1602
+ }
1603
+ return arr;
1604
+ });
1605
+ const setStyle = vue.computed(() => {
1606
+ const obj = {};
1607
+ if (props.width) {
1608
+ if (!isNaN(Number(props.width))) {
1609
+ obj.width = props.width + "em";
1610
+ }
1611
+ }
1612
+ if (props.height) {
1613
+ if (!isNaN(Number(props.height))) {
1614
+ obj.height = props.height + "em";
1615
+ }
1616
+ }
1617
+ return obj;
1618
+ });
1619
+ const inputRef = vue.ref(null);
1620
+ function inputKeyup() {
1621
+ }
1622
+ function inputChange() {
1623
+ }
1624
+ function inputKeydown() {
1625
+ }
1626
+ function inputCut() {
1627
+ }
1628
+ function inputFocus() {
1629
+ focused.value = true;
1630
+ }
1631
+ function inputBlur() {
1632
+ focused.value = false;
1633
+ }
1634
+ function inputPaste() {
1635
+ }
1636
+ function inputKeyPress() {
1637
+ }
1638
+ function inputInput() {
1639
+ emit("update:modelValue", data.value);
1640
+ }
1641
+ function clear() {
1642
+ data.value = "";
1643
+ emit("clear");
1644
+ }
1645
+ function reduce() {
1646
+ }
1647
+ function increase() {
1648
+ }
1649
+ function addSuggestion(item) {
1650
+ data.value += item;
1651
+ }
1652
+ function click() {
1653
+ emit("click");
1654
+ }
1655
+ return (_ctx, _cache) => {
1656
+ const _component_ToIcon = vue.resolveComponent("ToIcon");
1657
+ const _component_ToButton = vue.resolveComponent("ToButton");
1658
+ return vue.openBlock(), vue.createElementBlock(
1659
+ "span",
1660
+ {
1661
+ class: vue.normalizeClass(["to-input", setClass.value]),
1662
+ style: vue.normalizeStyle(setStyle.value),
1663
+ onClick: click
1664
+ },
1665
+ [
1666
+ vue.createCommentVNode(" \u524D\u7F00 "),
1667
+ props.prefix || _ctx.$slots.prefix || props.step ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$a, [
1668
+ vue.renderSlot(_ctx.$slots, "prefix"),
1669
+ props.prefix ? (vue.openBlock(), vue.createElementBlock(
1670
+ "span",
1671
+ _hoisted_2$8,
1672
+ vue.toDisplayString(props.prefix),
1673
+ 1
1674
+ /* TEXT */
1675
+ )) : vue.createCommentVNode("v-if", true),
1676
+ props.step ? (vue.openBlock(), vue.createBlock(_component_ToIcon, {
1677
+ key: 1,
1678
+ value: props.stepIconMode ? "unfold" : "reduce",
1679
+ link: "",
1680
+ color: "primary",
1681
+ mode: "none",
1682
+ disabled: Number(data.value) === Number(props.min) || props.readonly,
1683
+ onMousedown: reduce
1684
+ }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true)
1685
+ ])) : vue.createCommentVNode("v-if", true),
1686
+ vue.createCommentVNode(" \u8F93\u5165\u6846\u90E8\u5206 "),
1687
+ props.type === "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
1688
+ key: 1,
1689
+ ref_key: "inputRef",
1690
+ ref: inputRef,
1691
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => data.value = $event),
1692
+ class: "to-input-textarea",
1693
+ autocomplete: props.autocomplete ? "on" : "new-password",
1694
+ maxlength: props.maxlength,
1695
+ placeholder: iPlaceholder.value,
1696
+ readonly: disabled.value,
1697
+ tabindex: props.tabindex,
1698
+ onKeyup: inputKeyup,
1699
+ onKeydown: inputKeydown,
1700
+ onCut: inputCut,
1701
+ onFocus: inputFocus,
1702
+ onBlur: inputBlur,
1703
+ onPaste: inputPaste,
1704
+ onKeypress: inputKeyPress
1705
+ }, null, 40, _hoisted_3$6)), [
1706
+ [vue.vModelText, data.value]
1707
+ ]) : props.type === "html" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$6, [
1708
+ vue.createTextVNode(
1709
+ vue.toDisplayString(props.html) + " ",
1710
+ 1
1711
+ /* TEXT */
1712
+ ),
1713
+ vue.renderSlot(_ctx.$slots, "html")
1714
+ ])) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
1715
+ key: 3,
1716
+ ref_key: "inputRef",
1717
+ ref: inputRef,
1718
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => data.value = $event),
1719
+ class: "to-input-content",
1720
+ autocomplete: props.autocomplete ? "on" : "new-password",
1721
+ tabindex: props.tabindex,
1722
+ maxlength: props.maxlength,
1723
+ placeholder: iPlaceholder.value,
1724
+ type: itype.value,
1725
+ readonly: disabled.value,
1726
+ onKeyup: inputKeyup,
1727
+ onKeydown: inputKeydown,
1728
+ onCut: inputCut,
1729
+ onFocus: inputFocus,
1730
+ onBlur: inputBlur,
1731
+ onPaste: inputPaste,
1732
+ onKeypress: inputKeyPress,
1733
+ onChange: inputChange,
1734
+ onInput: inputInput
1735
+ }, null, 40, _hoisted_5$6)), [
1736
+ [vue.vModelDynamic, data.value]
1737
+ ]),
1738
+ vue.createCommentVNode(" \u540E\u7F00\u533A "),
1739
+ props.clearable || props.suggestion || _ctx.$slots.default || _ctx.$slots.suffix || props.suffix || props.step ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$5, [
1740
+ !props.readonly && props.clearable ? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_ToIcon, {
1741
+ key: 0,
1742
+ class: "to-input-clear",
1743
+ mode: iconMode.value,
1744
+ link: "",
1745
+ value: "close",
1746
+ onClick: vue.withModifiers(clear, ["stop"])
1747
+ }, null, 8, ["mode"])), [
1748
+ [vue.vShow, clearVisible.value]
1749
+ ]) : vue.createCommentVNode("v-if", true),
1750
+ props.step ? (vue.openBlock(), vue.createBlock(_component_ToIcon, {
1751
+ key: 1,
1752
+ value: props.stepIconMode ? "fold" : "add",
1753
+ link: "",
1754
+ disabled: Number(data.value) === Number(props.max) || props.readonly,
1755
+ onMousedown: increase
1756
+ }, null, 8, ["value", "disabled"])) : vue.createCommentVNode("v-if", true),
1757
+ props.suffix ? (vue.openBlock(), vue.createElementBlock(
1758
+ "span",
1759
+ _hoisted_7$4,
1760
+ vue.toDisplayString(props.suffix),
1761
+ 1
1762
+ /* TEXT */
1763
+ )) : vue.createCommentVNode("v-if", true),
1764
+ vue.renderSlot(_ctx.$slots, "suffix"),
1765
+ vue.renderSlot(_ctx.$slots, "default"),
1766
+ props.suggestion ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$4, [
1767
+ (vue.openBlock(true), vue.createElementBlock(
1768
+ vue.Fragment,
1769
+ null,
1770
+ vue.renderList(props.suggestion.split(","), (item, i) => {
1771
+ return vue.openBlock(), vue.createBlock(_component_ToButton, {
1772
+ key: i,
1773
+ fillet: true,
1774
+ color: "info",
1775
+ mode: "text",
1776
+ onClick: ($event) => addSuggestion(item)
1777
+ }, {
1778
+ default: vue.withCtx(() => [
1779
+ vue.createTextVNode(
1780
+ vue.toDisplayString(item),
1781
+ 1
1782
+ /* TEXT */
1783
+ )
1784
+ ]),
1785
+ _: 2
1786
+ /* DYNAMIC */
1787
+ }, 1032, ["onClick"]);
1788
+ }),
1789
+ 128
1790
+ /* KEYED_FRAGMENT */
1791
+ ))
1792
+ ])) : vue.createCommentVNode("v-if", true)
1793
+ ])) : vue.createCommentVNode("v-if", true)
1794
+ ],
1795
+ 6
1796
+ /* CLASS, STYLE */
1797
+ );
1798
+ };
1799
+ }
1800
+ });
1801
+
1802
+ var Input = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/input/src/input.vue"]]);
1803
+
1804
+ const ToInput = withInstall(Input);
1805
+
1806
+ var _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
1807
+ __name: "line",
1808
+ props: {
1809
+ height: { type: String, required: false, default: "" },
1810
+ mode: { type: String, required: false, default: "default" },
1811
+ type: { type: String, required: false, default: "default" },
1812
+ color: { type: String, required: false, default: "" },
1813
+ marginX: { type: [String, Number], required: false, default: 0 },
1814
+ marginY: { type: [String, Number], required: false, default: 0 }
1815
+ },
1816
+ setup(__props) {
1817
+ const props = __props;
1818
+ const setClass = vue.computed(() => {
1819
+ let arr = [];
1820
+ if (props.mode) {
1821
+ arr.push(`mode-${props.mode}`);
1822
+ }
1823
+ if (props.type) {
1824
+ arr.push(`type-${props.type}`);
1825
+ }
1826
+ if (props.color) {
1827
+ arr.push(`color-${props.color}`);
1828
+ }
1829
+ return arr;
1830
+ });
1831
+ const setStyle = vue.computed(() => {
1832
+ const obj = {};
1833
+ if (props.marginX) {
1834
+ if (!isNaN(Number(props.marginX))) {
1835
+ obj.marginLeft = props.marginX + "em";
1836
+ obj.marginRight = props.marginX + "em";
1837
+ } else {
1838
+ obj.marginLeft = props.marginX;
1839
+ obj.marginRight = props.marginX + "em";
1840
+ }
1841
+ }
1842
+ if (props.marginY) {
1843
+ if (!isNaN(Number(props.marginY))) {
1844
+ obj.marginTop = props.marginY + "em";
1845
+ obj.marginBottom = props.marginY + "em";
1846
+ } else {
1847
+ obj.marginTop = props.marginY;
1848
+ }
1849
+ }
1850
+ if (props.height) {
1851
+ if (!isNaN(Number(props.height))) {
1852
+ obj.height = props.height + "em";
1853
+ } else {
1854
+ obj.height = props.height;
1855
+ }
1856
+ }
1857
+ return obj;
1858
+ });
1859
+ return (_ctx, _cache) => {
1860
+ return vue.openBlock(), vue.createElementBlock(
1861
+ "div",
1862
+ {
1863
+ class: vue.normalizeClass(["to-line", setClass.value]),
1864
+ style: vue.normalizeStyle(setStyle.value)
1865
+ },
1866
+ null,
1867
+ 6
1868
+ /* CLASS, STYLE */
1869
+ );
1870
+ };
1871
+ }
1872
+ });
1873
+
1874
+ var Line = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/line/src/line.vue"]]);
1875
+
1876
+ const ToLine = withInstall(Line);
1877
+
1878
+ const _hoisted_1$9 = { class: "to-msg-side" };
1879
+ const _hoisted_2$7 = {
1880
+ key: 1,
1881
+ class: "to-msg-pic"
1882
+ };
1883
+ const _hoisted_3$5 = {
1884
+ key: 0,
1885
+ class: "to-msg-main"
1886
+ };
1887
+ const _hoisted_4$5 = {
1888
+ key: 0,
1889
+ class: "to-msg-title"
1890
+ };
1891
+ const _hoisted_5$5 = { class: "to-msg-title-text" };
1892
+ const _hoisted_6$4 = { class: "to-msg-content-text" };
1893
+ const _hoisted_7$3 = ["innerHTML"];
1894
+ const _hoisted_8$3 = {
1895
+ key: 2,
1896
+ class: "to-msg-content"
1897
+ };
1898
+ const _hoisted_9$2 = { class: "to-msg-content-text" };
1899
+ const _hoisted_10$1 = ["innerHTML"];
1900
+ const _hoisted_11$1 = { class: "to-msg-fn" };
1901
+ var _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
1902
+ __name: "msg",
1903
+ props: {
1904
+ type: { type: String, required: false, default: "" },
1905
+ title: { type: String, required: false, default: "" },
1906
+ content: { type: String, required: false, default: "" },
1907
+ htmlContent: { type: String, required: false, default: "" },
1908
+ htmlHeight: { type: [String, Number], required: false, default: "auto" },
1909
+ width: { type: [String, Number], required: false, default: "" },
1910
+ detail: { type: String, required: false, default: "" },
1911
+ detailWidth: { type: [String, Number], required: false, default: "auto" },
1912
+ showDetail: { type: Boolean, required: false, default: true },
1913
+ padding: { type: [String, Number], required: false, default: 0 },
1914
+ pic: { type: String, required: false, default: "" },
1915
+ picPosition: { type: String, required: false, default: "top" },
1916
+ position: { type: String, required: false, default: "" },
1917
+ height: { type: [String, Number], required: false, default: "auto" },
1918
+ confirmButtonText: { type: String, required: false, default: "" },
1919
+ cancelButtonText: { type: String, required: false, default: "" },
1920
+ closeOnClickModal: { type: Boolean, required: false, default: true },
1921
+ closeOnBlur: { type: Boolean, required: false, default: true },
1922
+ zIndex: { type: Number, required: false, default: 0 },
1923
+ global: { type: Boolean, required: false, default: false },
1924
+ show: { type: Boolean, required: false, default: false }
1925
+ },
1926
+ emits: ["close", "confirm"],
1927
+ setup(__props, { expose: __expose, emit: __emit }) {
1928
+ const props = __props;
1929
+ const emit = __emit;
1930
+ const iShowDetail = vue.ref(props.showDetail);
1931
+ const visible = vue.ref(false);
1932
+ const slots = vue.useSlots();
1933
+ const className = vue.useAttrs().class;
1934
+ const setClass = vue.computed(() => {
1935
+ const arr = [];
1936
+ if (props.type)
1937
+ arr.push(`type-${props.type}`);
1938
+ if (props.show || visible.value)
1939
+ arr.push("is-show");
1940
+ if (className)
1941
+ arr.push(className);
1942
+ return arr;
1943
+ });
1944
+ const setStyle = vue.computed(() => {
1945
+ const style = {};
1946
+ if (typeof props.height === "string" && props.height !== "auto") {
1947
+ style.height = props.height;
1948
+ } else if (typeof props.height === "number") {
1949
+ style.height = `${props.height}em`;
1950
+ }
1951
+ return style;
1952
+ });
1953
+ const setWrapperStyle = vue.computed(() => {
1954
+ const style = {};
1955
+ if (props.width) {
1956
+ style.width = `${props.width}em`;
1957
+ }
1958
+ return style;
1959
+ });
1960
+ const setHtmlStyle = vue.computed(() => {
1961
+ if (props.htmlHeight !== "auto") {
1962
+ return {
1963
+ height: typeof props.htmlHeight === "number" ? `${props.htmlHeight}em` : props.htmlHeight,
1964
+ overflow: "auto"
1965
+ };
1966
+ }
1967
+ return {};
1968
+ });
1969
+ const setDetailStyle = vue.computed(() => {
1970
+ if (props.detailWidth !== "auto") {
1971
+ return {
1972
+ width: typeof props.detailWidth === "number" ? `${props.detailWidth}em` : props.detailWidth
1973
+ };
1974
+ }
1975
+ return {};
1976
+ });
1977
+ const hasInfoContent = vue.computed(
1978
+ () => props.title || slots.default || props.content || slots.content || slots.title
1979
+ );
1980
+ const emoteComponent = vue.computed(() => {
1981
+ var _a, _b, _c;
1982
+ return (_c = (_b = (_a = window.$TouchUI) == null ? void 0 : _a.msg) == null ? void 0 : _b.emote) == null ? void 0 : _c[props.pic || "default"];
1983
+ });
1984
+ const open = () => {
1985
+ var _a, _b;
1986
+ const el = document.querySelector(".to-msg");
1987
+ if (props.zIndex) {
1988
+ el.style.zIndex = props.zIndex.toString();
1989
+ } else {
1990
+ el.style.zIndex = ((_b = (_a = window.$TouchUI) == null ? void 0 : _a.zIndex) != null ? _b : 1e3).toString();
1991
+ if (window.$TouchUI)
1992
+ window.$TouchUI.zIndex++;
1993
+ }
1994
+ visible.value = true;
1995
+ };
1996
+ const close = () => {
1997
+ visible.value = false;
1998
+ emit("close");
1999
+ };
2000
+ const confirm = () => {
2001
+ emit("confirm");
2002
+ visible.value = false;
2003
+ emit("close");
2004
+ };
2005
+ const cancel = () => {
2006
+ visible.value = false;
2007
+ emit("close");
2008
+ };
2009
+ const bgClose = () => {
2010
+ if (!props.closeOnClickModal || !props.closeOnBlur)
2011
+ return;
2012
+ close();
2013
+ };
2014
+ vue.onMounted(() => {
2015
+ if (props.global) {
2016
+ document.body.appendChild(document.querySelector(".to-msg"));
2017
+ }
2018
+ });
2019
+ vue.onBeforeUnmount(() => {
2020
+ if (props.global) {
2021
+ const el = document.querySelector(".to-msg");
2022
+ if (el && el.parentNode) {
2023
+ el.parentNode.removeChild(el);
2024
+ }
2025
+ }
2026
+ });
2027
+ __expose({ open, close });
2028
+ return (_ctx, _cache) => {
2029
+ const _component_to_button = vue.resolveComponent("to-button");
2030
+ return vue.openBlock(), vue.createElementBlock(
2031
+ "div",
2032
+ {
2033
+ class: vue.normalizeClass(["to-msg", setClass.value]),
2034
+ style: vue.normalizeStyle(setStyle.value)
2035
+ },
2036
+ [
2037
+ vue.createElementVNode("div", {
2038
+ class: "to-msg-bg",
2039
+ onClick: bgClose
2040
+ }),
2041
+ vue.createElementVNode(
2042
+ "div",
2043
+ {
2044
+ class: "to-msg-wrapper",
2045
+ style: vue.normalizeStyle(setWrapperStyle.value)
2046
+ },
2047
+ [
2048
+ vue.createElementVNode("div", _hoisted_1$9, [
2049
+ emoteComponent.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(emoteComponent.value), { key: 0 })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7))
2050
+ ]),
2051
+ hasInfoContent.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$5, [
2052
+ _ctx.title || vue.unref(slots).title || vue.unref(slots).default ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$5, [
2053
+ vue.createElementVNode("div", _hoisted_5$5, [
2054
+ vue.createTextVNode(
2055
+ vue.toDisplayString(_ctx.title) + " ",
2056
+ 1
2057
+ /* TEXT */
2058
+ ),
2059
+ vue.renderSlot(_ctx.$slots, "title")
2060
+ ])
2061
+ ])) : vue.createCommentVNode("v-if", true),
2062
+ _ctx.htmlContent ? (vue.openBlock(), vue.createElementBlock(
2063
+ "div",
2064
+ {
2065
+ key: 1,
2066
+ class: "to-msg-content",
2067
+ style: vue.normalizeStyle(setHtmlStyle.value)
2068
+ },
2069
+ [
2070
+ vue.createElementVNode("div", _hoisted_6$4, [
2071
+ vue.createElementVNode("span", { innerHTML: _ctx.htmlContent }, null, 8, _hoisted_7$3)
2072
+ ])
2073
+ ],
2074
+ 4
2075
+ /* STYLE */
2076
+ )) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$3, [
2077
+ vue.createElementVNode("div", _hoisted_9$2, [
2078
+ _ctx.content || vue.unref(slots).content ? (vue.openBlock(), vue.createElementBlock(
2079
+ vue.Fragment,
2080
+ { key: 0 },
2081
+ [
2082
+ vue.createTextVNode(
2083
+ vue.toDisplayString(_ctx.content),
2084
+ 1
2085
+ /* TEXT */
2086
+ )
2087
+ ],
2088
+ 64
2089
+ /* STABLE_FRAGMENT */
2090
+ )) : vue.createCommentVNode("v-if", true),
2091
+ vue.renderSlot(_ctx.$slots, "content")
2092
+ ])
2093
+ ])),
2094
+ vue.createCommentVNode(' <div v-if="slots.detail || detail">\n <to-space />\n <a v-if="!iShowDetail" href="javascript:void(0)" @click="iShowDetail = true">\u663E\u793A\u8BE6\u60C5</a>\n <a v-else href="javascript:void(0)" @click="iShowDetail = false">\u9690\u85CF\u8BE6\u60C5</a>\n </div> '),
2095
+ vue.unref(slots).detail ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
2096
+ "div",
2097
+ {
2098
+ key: 3,
2099
+ style: vue.normalizeStyle(setDetailStyle.value),
2100
+ class: "to-msg-detail"
2101
+ },
2102
+ [
2103
+ vue.renderSlot(_ctx.$slots, "detail")
2104
+ ],
2105
+ 4
2106
+ /* STYLE */
2107
+ )), [
2108
+ [vue.vShow, iShowDetail.value]
2109
+ ]) : vue.createCommentVNode("v-if", true),
2110
+ _ctx.detail ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
2111
+ key: 4,
2112
+ style: vue.normalizeStyle(setDetailStyle.value),
2113
+ class: "detail",
2114
+ innerHTML: _ctx.detail
2115
+ }, null, 12, _hoisted_10$1)), [
2116
+ [vue.vShow, iShowDetail.value]
2117
+ ]) : vue.createCommentVNode("v-if", true),
2118
+ vue.createElementVNode("div", _hoisted_11$1, [
2119
+ vue.renderSlot(_ctx.$slots, "default", {}, () => [
2120
+ _ctx.cancelButtonText ? (vue.openBlock(), vue.createBlock(_component_to_button, {
2121
+ key: 0,
2122
+ icon: "close",
2123
+ fillet: "normal",
2124
+ onClick: cancel
2125
+ }, {
2126
+ default: vue.withCtx(() => [
2127
+ vue.createTextVNode(
2128
+ vue.toDisplayString(_ctx.cancelButtonText),
2129
+ 1
2130
+ /* TEXT */
2131
+ )
2132
+ ]),
2133
+ _: 1
2134
+ /* STABLE */
2135
+ })) : vue.createCommentVNode("v-if", true),
2136
+ _ctx.confirmButtonText ? (vue.openBlock(), vue.createBlock(_component_to_button, {
2137
+ key: 1,
2138
+ icon: "ok",
2139
+ color: "primary",
2140
+ fillet: "normal",
2141
+ onClick: confirm
2142
+ }, {
2143
+ default: vue.withCtx(() => [
2144
+ vue.createTextVNode(
2145
+ vue.toDisplayString(_ctx.confirmButtonText),
2146
+ 1
2147
+ /* TEXT */
2148
+ )
2149
+ ]),
2150
+ _: 1
2151
+ /* STABLE */
2152
+ })) : vue.createCommentVNode("v-if", true)
2153
+ ])
2154
+ ])
2155
+ ])) : vue.createCommentVNode("v-if", true)
2156
+ ],
2157
+ 4
2158
+ /* STYLE */
2159
+ )
2160
+ ],
2161
+ 6
2162
+ /* CLASS, STYLE */
2163
+ );
2164
+ };
2165
+ }
2166
+ });
2167
+
2168
+ var Msg = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/msg/src/msg.vue"]]);
2169
+
2170
+ const ToMsg = withInstall(Msg);
2171
+
2172
+ var _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
2173
+ __name: "padding",
2174
+ props: {
2175
+ mode: { type: String, required: false, default: "default" },
2176
+ value: { type: [String, Number], required: false, default: "" },
2177
+ height: { type: String, required: false, default: "" },
2178
+ position: { type: String, required: false, default: "trbl" }
2179
+ },
2180
+ setup(__props) {
2181
+ const props = __props;
2182
+ const hasUnit = (val) => /[a-z%]+$/i.test(val);
2183
+ const setStyle = vue.computed(() => {
2184
+ const obj = {};
2185
+ if (String(props.value).trim()) {
2186
+ const padded = String(props.value).trim().split(/\s+/).map((val) => {
2187
+ return hasUnit(val) ? val : `${val}em`;
2188
+ }).join(" ");
2189
+ obj.padding = padded;
2190
+ }
2191
+ if (!props.position.includes("t")) {
2192
+ obj.paddingTop = 0;
2193
+ }
2194
+ if (!props.position.includes("r")) {
2195
+ obj.paddingRight = 0;
2196
+ }
2197
+ if (!props.position.includes("b")) {
2198
+ obj.paddingBottom = 0;
2199
+ }
2200
+ if (!props.position.includes("l")) {
2201
+ obj.paddingLeft = 0;
2202
+ }
2203
+ return obj;
2204
+ });
2205
+ const setClass = vue.computed(() => {
2206
+ const arr = [];
2207
+ if (props.mode) {
2208
+ arr.push(`mode-${props.mode}`);
2209
+ }
2210
+ if (props.height && props.height === "full") {
2211
+ arr.push("height-full");
2212
+ }
2213
+ return arr;
2214
+ });
2215
+ return (_ctx, _cache) => {
2216
+ return vue.openBlock(), vue.createElementBlock(
2217
+ "div",
2218
+ {
2219
+ class: vue.normalizeClass(["to-padding", setClass.value]),
2220
+ style: vue.normalizeStyle(setStyle.value)
2221
+ },
2222
+ [
2223
+ vue.renderSlot(_ctx.$slots, "default")
2224
+ ],
2225
+ 6
2226
+ /* CLASS, STYLE */
2227
+ );
2228
+ };
2229
+ }
2230
+ });
2231
+
2232
+ var Padding = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/padding/src/padding.vue"]]);
2233
+
2234
+ const ToPadding = withInstall(Padding);
2235
+
2236
+ const _hoisted_1$8 = {
2237
+ key: 0,
2238
+ class: "to-page-total"
2239
+ };
2240
+ const _hoisted_2$6 = {
2241
+ key: 1,
2242
+ class: "to-page-pager"
2243
+ };
2244
+ const _hoisted_3$4 = { class: "to-page-pager-list" };
2245
+ const _hoisted_4$4 = {
2246
+ key: 0,
2247
+ class: "to-page-pager-ellipsis"
2248
+ };
2249
+ const _hoisted_5$4 = ["onClick"];
2250
+ const _hoisted_6$3 = {
2251
+ key: 1,
2252
+ class: "to-page-pager-ellipsis"
2253
+ };
2254
+ const _hoisted_7$2 = {
2255
+ key: 2,
2256
+ class: "to-page-size"
2257
+ };
2258
+ const _hoisted_8$2 = {
2259
+ key: 3,
2260
+ class: "to-page-jumper"
2261
+ };
2262
+ var _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
2263
+ __name: "page",
2264
+ props: {
2265
+ align: { type: String, default: "" },
2266
+ pageSize: { type: [Number, String], default: 10 },
2267
+ total: { type: [Number, String], default: 0 },
2268
+ pageCount: { type: [Number, String], default: void 0 },
2269
+ pagerCount: { type: [Number, String], default: 7 },
2270
+ currentPage: { type: [Number, String], default: 1 },
2271
+ layout: { type: String, default: "all" },
2272
+ pageSizes: { type: [Array, String], default: () => [10, 20, 30, 40, 50, 100] },
2273
+ prevText: { type: String, default: "" },
2274
+ nextText: { type: String, default: "" },
2275
+ disabled: { type: Boolean, default: false },
2276
+ hideOnSinglePage: { type: Boolean, default: false },
2277
+ lite: Boolean
2278
+ },
2279
+ emits: [
2280
+ "update:pageSize",
2281
+ "size-change",
2282
+ "update:currentPage",
2283
+ "current-change",
2284
+ "prev-click",
2285
+ "next-click"
2286
+ ],
2287
+ setup(__props, { emit: __emit }) {
2288
+ const props = __props;
2289
+ const emit = __emit;
2290
+ const pageCount_ = vue.ref(0);
2291
+ const pageSize_ = vue.ref(Number(props.pageSize));
2292
+ const currentPage_ = vue.ref(Number(props.currentPage));
2293
+ const pager_ = vue.ref([]);
2294
+ const jumperPage = vue.ref("");
2295
+ const showPrevMore = vue.ref(false);
2296
+ const showNextMore = vue.ref(false);
2297
+ const cShowInSingle = vue.computed(() => {
2298
+ return !(props.hideOnSinglePage && Number(pageCount_.value) <= 1) || !props.hideOnSinglePage;
2299
+ });
2300
+ const cPageSizes = vue.computed(() => {
2301
+ const sizes = typeof props.pageSizes === "string" ? props.pageSizes.split(",") : props.pageSizes;
2302
+ return sizes.map((size) => ({
2303
+ label: size,
2304
+ value: Number(size)
2305
+ }));
2306
+ });
2307
+ const setClass = vue.computed(() => {
2308
+ let arr = [];
2309
+ if (props.lite) {
2310
+ arr.push(`is-lite`);
2311
+ }
2312
+ return arr;
2313
+ });
2314
+ vue.watch(
2315
+ () => props.pageSize,
2316
+ (val) => {
2317
+ const sizes = typeof props.pageSizes === "string" ? props.pageSizes.split(",") : props.pageSizes;
2318
+ pageSize_.value = sizes.includes(val) ? Number(val) : Number(sizes[0]);
2319
+ },
2320
+ { immediate: true }
2321
+ );
2322
+ vue.watch(
2323
+ () => props.currentPage,
2324
+ (val) => {
2325
+ currentPage_.value = Number(val);
2326
+ computePager();
2327
+ },
2328
+ { immediate: true }
2329
+ );
2330
+ vue.watch(
2331
+ () => props.pageCount,
2332
+ (val) => {
2333
+ pageCount_.value = Number(val);
2334
+ computePager();
2335
+ },
2336
+ { immediate: true }
2337
+ );
2338
+ vue.watch(() => props.total, computePager);
2339
+ vue.watch(() => props.pagerCount, computePager);
2340
+ vue.onMounted(() => computePager());
2341
+ function handleJump() {
2342
+ if (props.disabled || !jumperPage.value)
2343
+ return;
2344
+ let jump = Number(jumperPage.value);
2345
+ jump = Math.max(1, Math.min(jump, pageCount_.value));
2346
+ jumperPage.value = "";
2347
+ handleCurrentChange(jump);
2348
+ }
2349
+ function handleSizeChange(size) {
2350
+ if (props.disabled)
2351
+ return;
2352
+ emit("update:pageSize", size);
2353
+ emit("size-change", size);
2354
+ computePager();
2355
+ }
2356
+ function handleCurrentChange(page) {
2357
+ if (props.disabled)
2358
+ return;
2359
+ currentPage_.value = page;
2360
+ emit("update:currentPage", page);
2361
+ emit("current-change", page);
2362
+ computePager();
2363
+ }
2364
+ function handlePagePrev() {
2365
+ if (props.disabled || currentPage_.value <= 1)
2366
+ return;
2367
+ currentPage_.value--;
2368
+ handleCurrentChange(currentPage_.value);
2369
+ emit("prev-click", currentPage_.value);
2370
+ }
2371
+ function handlePageNext() {
2372
+ if (props.disabled || currentPage_.value >= pageCount_.value)
2373
+ return;
2374
+ currentPage_.value++;
2375
+ handleCurrentChange(currentPage_.value);
2376
+ emit("next-click", currentPage_.value);
2377
+ }
2378
+ function computePager() {
2379
+ const pagerCount = Number(props.pagerCount);
2380
+ const halfPagerCount = (pagerCount - 1) / 2;
2381
+ const count = props.pageCount ? Number(props.pageCount) : Math.ceil(Number(props.total) / pageSize_.value);
2382
+ pageCount_.value = Math.max(1, count);
2383
+ const current = currentPage_.value;
2384
+ showPrevMore.value = current > pagerCount - halfPagerCount;
2385
+ showNextMore.value = current < pageCount_.value - halfPagerCount;
2386
+ const pages = [];
2387
+ if (showPrevMore.value && !showNextMore.value) {
2388
+ const start = pageCount_.value - (pagerCount - 2);
2389
+ for (let i = start; i < pageCount_.value; i++)
2390
+ pages.push(i);
2391
+ } else if (!showPrevMore.value && showNextMore.value) {
2392
+ for (let i = 2; i < pagerCount; i++)
2393
+ pages.push(i);
2394
+ } else if (showPrevMore.value && showNextMore.value) {
2395
+ const offset = Math.floor(pagerCount / 2) - 1;
2396
+ for (let i = current - offset; i <= current + offset; i++)
2397
+ pages.push(i);
2398
+ } else {
2399
+ for (let i = 2; i < pageCount_.value; i++)
2400
+ pages.push(i);
2401
+ }
2402
+ pager_.value = pages;
2403
+ }
2404
+ return (_ctx, _cache) => {
2405
+ const _component_to_select = vue.resolveComponent("to-select");
2406
+ const _component_to_input = vue.resolveComponent("to-input");
2407
+ const _directive_dis = vue.resolveDirective("dis");
2408
+ const _directive_align = vue.resolveDirective("align");
2409
+ return cShowInSingle.value ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
2410
+ "div",
2411
+ {
2412
+ key: 0,
2413
+ class: vue.normalizeClass([setClass.value, "to-page"])
2414
+ },
2415
+ [
2416
+ __props.layout.includes("total") || __props.layout === "all" ? (vue.openBlock(), vue.createElementBlock(
2417
+ "div",
2418
+ _hoisted_1$8,
2419
+ " \u5171 " + vue.toDisplayString(__props.total) + " \u9879\u6570\u636E ",
2420
+ 1
2421
+ /* TEXT */
2422
+ )) : vue.createCommentVNode("v-if", true),
2423
+ vue.createCommentVNode(' <div class="to-page-slot" v-if="slots.default || !lite"> '),
2424
+ vue.renderSlot(_ctx.$slots, "default"),
2425
+ vue.createCommentVNode(" </div> "),
2426
+ __props.layout.includes("pager") || __props.layout === "all" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
2427
+ vue.withDirectives(vue.createElementVNode(
2428
+ "div",
2429
+ {
2430
+ class: "to-page-pager-prev",
2431
+ onClick: handlePagePrev
2432
+ },
2433
+ null,
2434
+ 512
2435
+ /* NEED_PATCH */
2436
+ ), [
2437
+ [_directive_dis, Number(currentPage_.value) <= 1]
2438
+ ]),
2439
+ vue.createElementVNode("ul", _hoisted_3$4, [
2440
+ vue.createElementVNode(
2441
+ "li",
2442
+ {
2443
+ class: vue.normalizeClass(["to-page-pager-item", { "is-on": Number(currentPage_.value) === 1 }]),
2444
+ onClick: _cache[0] || (_cache[0] = ($event) => handleCurrentChange(1))
2445
+ },
2446
+ " 1 ",
2447
+ 2
2448
+ /* CLASS */
2449
+ ),
2450
+ showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_4$4, "\u2026")) : vue.createCommentVNode("v-if", true),
2451
+ (vue.openBlock(true), vue.createElementBlock(
2452
+ vue.Fragment,
2453
+ null,
2454
+ vue.renderList(pager_.value, (page) => {
2455
+ return vue.openBlock(), vue.createElementBlock("li", {
2456
+ key: page,
2457
+ class: vue.normalizeClass(["to-page-pager-item", { "is-on": Number(currentPage_.value) === page }]),
2458
+ onClick: ($event) => handleCurrentChange(page)
2459
+ }, vue.toDisplayString(page), 11, _hoisted_5$4);
2460
+ }),
2461
+ 128
2462
+ /* KEYED_FRAGMENT */
2463
+ )),
2464
+ showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_6$3, "\u2026")) : vue.createCommentVNode("v-if", true),
2465
+ pageCount_.value > 1 ? (vue.openBlock(), vue.createElementBlock(
2466
+ "li",
2467
+ {
2468
+ key: 2,
2469
+ class: vue.normalizeClass(["to-page-pager-item", { "is-on": Number(currentPage_.value) === Number(pageCount_.value) }]),
2470
+ onClick: _cache[1] || (_cache[1] = ($event) => handleCurrentChange(pageCount_.value))
2471
+ },
2472
+ vue.toDisplayString(pageCount_.value),
2473
+ 3
2474
+ /* TEXT, CLASS */
2475
+ )) : vue.createCommentVNode("v-if", true)
2476
+ ]),
2477
+ vue.withDirectives(vue.createElementVNode(
2478
+ "div",
2479
+ {
2480
+ class: "to-page-pager-next",
2481
+ onClick: handlePageNext
2482
+ },
2483
+ null,
2484
+ 512
2485
+ /* NEED_PATCH */
2486
+ ), [
2487
+ [_directive_dis, Number(currentPage_.value) >= Number(pageCount_.value)]
2488
+ ])
2489
+ ])) : vue.createCommentVNode("v-if", true),
2490
+ __props.layout.includes("size") || __props.layout === "all" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
2491
+ vue.withDirectives(vue.createVNode(_component_to_select, {
2492
+ modelValue: pageSize_.value,
2493
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pageSize_.value = $event),
2494
+ suffix: "\u6761/\u9875",
2495
+ mode: "none",
2496
+ clearable: false,
2497
+ data: cPageSizes.value,
2498
+ "option-width": 10,
2499
+ onChange: handleSizeChange
2500
+ }, null, 8, ["modelValue", "data"]), [
2501
+ [_directive_dis, __props.disabled]
2502
+ ])
2503
+ ])) : vue.createCommentVNode("v-if", true),
2504
+ __props.layout.includes("jumper") || __props.layout === "all" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$2, [
2505
+ _cache[4] || (_cache[4] = vue.createElementVNode(
2506
+ "span",
2507
+ null,
2508
+ "\u8DF3\u81F3",
2509
+ -1
2510
+ /* CACHED */
2511
+ )),
2512
+ vue.withDirectives(vue.createVNode(_component_to_input, {
2513
+ modelValue: jumperPage.value,
2514
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => jumperPage.value = $event),
2515
+ placeholder: "1",
2516
+ onKeyup: vue.withKeys(handleJump, ["enter"])
2517
+ }, null, 8, ["modelValue"]), [
2518
+ [_directive_dis, __props.disabled]
2519
+ ]),
2520
+ vue.createElementVNode(
2521
+ "span",
2522
+ null,
2523
+ "/" + vue.toDisplayString(pageCount_.value) + "\u9875",
2524
+ 1
2525
+ /* TEXT */
2526
+ )
2527
+ ])) : vue.createCommentVNode("v-if", true)
2528
+ ],
2529
+ 2
2530
+ /* CLASS */
2531
+ )), [
2532
+ [_directive_align, __props.align]
2533
+ ]) : vue.createCommentVNode("v-if", true);
2534
+ };
2535
+ }
2536
+ });
2537
+
2538
+ var Page = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/page/src/page.vue"]]);
2539
+
2540
+ const ToPage = withInstall(Page);
2541
+
2542
+ const _sfc_main$a = /*@__PURE__*/Object.assign({
2543
+ name: 'ToCard',
2544
+ }, {
2545
+ __name: 'Card',
2546
+ props: {
2547
+ fillet: { type: String, default: 'none' },
2548
+ color: { type: String, default: '' },
2549
+ mode: { type: String, default: 'default' },
2550
+ padding: { type: [Number, String], default: '' },
2551
+ link: Boolean,
2552
+ shadow: Boolean,
2553
+ checked: Boolean,
2554
+ wrap: Boolean,
2555
+ type: { type: String, default: '' },
2556
+ width: { type: [Number, String], default: '' },
2557
+ },
2558
+ emits: ['click'],
2559
+ setup(__props, { emit: __emit }) {
2560
+
2561
+
2562
+
2563
+ const props = __props;
2564
+
2565
+ const emits = __emit;
2566
+
2567
+ vue.provide('toCard', {});
2568
+
2569
+ const setClass = vue.computed(() => {
2570
+ const arr = [];
2571
+ if (props.wrap) arr.push('is-wrap');
2572
+ if (props.mode) arr.push(`mode-${props.mode}`);
2573
+ if (props.color) arr.push(`color-${props.color}`);
2574
+ if (props.link) arr.push('is-link');
2575
+ if (props.type) arr.push(`type-${props.type}`);
2576
+ if (props.checked) arr.push('is-checked');
2577
+ if (props.width === 'auto') arr.push('width-auto');
2578
+ return arr;
2579
+ });
2580
+
2581
+ const setStyle = vue.computed(() => {
2582
+ const obj = {};
2583
+ if (props.width) {
2584
+ obj.width = isNaN(Number(props.width)) ? props.width : `${props.width}em`;
2585
+ }
2586
+
2587
+ const hasUnit = val => /[a-z%]+$/i.test(val);
2588
+ if (String(props.padding).trim()) {
2589
+ // 分割成各个值
2590
+ const padded = String(props.padding)
2591
+ .trim()
2592
+ .split(/\s+/)
2593
+ .map(val => {
2594
+ // 如果是数字(或纯数字字符串),或末尾无单位,就加 em
2595
+ return hasUnit(val) ? val : `${val}em`;
2596
+ })
2597
+ .join(' ');
2598
+
2599
+ obj.padding = padded;
2600
+ }
2601
+ return obj;
2602
+ });
2603
+
2604
+ const setFnStyle = vue.computed(() => {
2605
+ const obj = {};
2606
+ if (props.padding >= 0 && props.padding !== 1) {
2607
+ obj.top = `${props.padding}em`;
2608
+ obj.right = `${props.padding}em`;
2609
+ }
2610
+ return obj;
2611
+ });
2612
+
2613
+ function clickHandle(evt) {
2614
+ if (props.link) {
2615
+ emits('click', evt);
2616
+ }
2617
+ }
2618
+
2619
+ return (_ctx, _cache) => {
2620
+ return (vue.openBlock(), vue.createElementBlock("div", {
2621
+ class: vue.normalizeClass(["to-card", setClass.value]),
2622
+ style: vue.normalizeStyle(setStyle.value),
2623
+ onClick: clickHandle
2624
+ }, [
2625
+ vue.renderSlot(_ctx.$slots, "default"),
2626
+ (_ctx.$slots.fn)
2627
+ ? (vue.openBlock(), vue.createElementBlock("div", {
2628
+ key: 0,
2629
+ class: "to-card-fn",
2630
+ style: vue.normalizeStyle(setFnStyle.value)
2631
+ }, [
2632
+ vue.renderSlot(_ctx.$slots, "fn")
2633
+ ], 4 /* STYLE */))
2634
+ : vue.createCommentVNode("v-if", true)
2635
+ ], 6 /* CLASS, STYLE */))
2636
+ }
2637
+ }
2638
+
2639
+ });
2640
+ var Card = /*#__PURE__*/_export_sfc(_sfc_main$a, [['__file',"/Users/wangding/WorkSpace/AsiaInfo/projects/前端框架/touch-vue3-ui/packages/components/card/src/Card.vue"]]);
2641
+
2642
+ const _hoisted_1$7 = {
2643
+ key: 0,
2644
+ class: "to-card-title"
2645
+ };
2646
+ const _hoisted_2$5 = {
2647
+ key: 0,
2648
+ class: "to-card-title-main"
2649
+ };
2650
+ const _hoisted_3$3 = { class: "to-card-title-text" };
2651
+ const _hoisted_4$3 = {
2652
+ key: 1,
2653
+ class: "to-card-title-side"
2654
+ };
2655
+ const _hoisted_5$3 = { class: "to-card-title-side-text" };
2656
+ const _hoisted_6$2 = {
2657
+ key: 1,
2658
+ class: "to-card-content"
2659
+ };
2660
+ const _hoisted_7$1 = {
2661
+ key: 0,
2662
+ class: "to-card-content-main"
2663
+ };
2664
+ const _hoisted_8$1 = { class: "to-card-content-text" };
2665
+ const _hoisted_9$1 = {
2666
+ key: 1,
2667
+ class: "to-card-content-side"
2668
+ };
2669
+ const _hoisted_10 = { class: "to-card-content-side-text" };
2670
+ const _hoisted_11 = {
2671
+ key: 2,
2672
+ class: "to-card-value"
2673
+ };
2674
+ const _hoisted_12 = { class: "to-card-value-text" };
2675
+ const _hoisted_13 = {
2676
+ key: 3,
2677
+ class: "to-card-label"
2678
+ };
2679
+ const _hoisted_14 = { class: "to-card-value-text" };
2680
+
2681
+
2682
+ const _sfc_main$9 = /*@__PURE__*/Object.assign({
2683
+ name: 'ToCardItem',
2684
+ }, {
2685
+ __name: 'CardItem',
2686
+ props: {
2687
+ type: { type: String, default: 'side' },
2688
+ align: { type: String, default: '' },
2689
+ padding: { type: [Number, String], default: 0 },
2690
+ width: { type: [Number, String], default: 0 },
2691
+ line: Boolean,
2692
+ more: Boolean,
2693
+ link: Boolean,
2694
+ main: Boolean,
2695
+ },
2696
+ setup(__props) {
2697
+
2698
+ const props = __props;
2699
+
2700
+ // const toCard = inject('toCard')
2701
+
2702
+
2703
+
2704
+ const setClass = vue.computed(() => {
2705
+ const arr = [];
2706
+ if (props.type === 'main' || props.main) arr.push('is-main');
2707
+ if (props.type === 'more' || props.more) arr.push('is-more');
2708
+ if (props.type === 'link' || props.link) arr.push('is-link');
2709
+ if (props.line === 'solid') arr.push('line-solid');
2710
+ if (props.align) arr.push(`align-${props.align}`);
2711
+ return arr;
2712
+ });
2713
+
2714
+ const setStyle = vue.computed(() => {
2715
+ const obj = {};
2716
+
2717
+ const hasUnit = val => /[a-z%]+$/i.test(val);
2718
+ if (String(props.padding).trim()) {
2719
+ // 分割成各个值
2720
+ const padded = String(props.padding)
2721
+ .trim()
2722
+ .split(/\s+/)
2723
+ .map(val => {
2724
+ // 如果是数字(或纯数字字符串),或末尾无单位,就加 em
2725
+ return hasUnit(val) ? val : `${val}em`;
2726
+ })
2727
+ .join(' ');
2728
+
2729
+ obj.padding = padded;
2730
+ }
2731
+
2732
+ if (props.width) {
2733
+ obj.width = props.width + 'em';
2734
+ }
2735
+
2736
+ return obj;
2737
+ });
2738
+
2739
+ return (_ctx, _cache) => {
2740
+ return (vue.openBlock(), vue.createElementBlock("div", {
2741
+ class: vue.normalizeClass(["to-card-item", setClass.value]),
2742
+ style: vue.normalizeStyle(setStyle.value)
2743
+ }, [
2744
+ vue.renderSlot(_ctx.$slots, "default"),
2745
+ (_ctx.$slots.title || _ctx.$slots.titleSide)
2746
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
2747
+ (_ctx.$slots.title)
2748
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$5, [
2749
+ vue.createElementVNode("span", _hoisted_3$3, [
2750
+ vue.renderSlot(_ctx.$slots, "title")
2751
+ ])
2752
+ ]))
2753
+ : vue.createCommentVNode("v-if", true),
2754
+ (_ctx.$slots.titleSide)
2755
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$3, [
2756
+ vue.createElementVNode("span", _hoisted_5$3, [
2757
+ vue.renderSlot(_ctx.$slots, "titleSide")
2758
+ ])
2759
+ ]))
2760
+ : vue.createCommentVNode("v-if", true)
2761
+ ]))
2762
+ : vue.createCommentVNode("v-if", true),
2763
+ (_ctx.$slots.content || _ctx.$slots.contentSide)
2764
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$2, [
2765
+ (_ctx.$slots.content)
2766
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, [
2767
+ vue.createElementVNode("span", _hoisted_8$1, [
2768
+ vue.renderSlot(_ctx.$slots, "content")
2769
+ ])
2770
+ ]))
2771
+ : vue.createCommentVNode("v-if", true),
2772
+ (_ctx.$slots.contentSide)
2773
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
2774
+ vue.createElementVNode("span", _hoisted_10, [
2775
+ vue.renderSlot(_ctx.$slots, "contentSide")
2776
+ ])
2777
+ ]))
2778
+ : vue.createCommentVNode("v-if", true)
2779
+ ]))
2780
+ : vue.createCommentVNode("v-if", true),
2781
+ (_ctx.$slots.value)
2782
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
2783
+ vue.createElementVNode("span", _hoisted_12, [
2784
+ vue.renderSlot(_ctx.$slots, "value")
2785
+ ])
2786
+ ]))
2787
+ : vue.createCommentVNode("v-if", true),
2788
+ (_ctx.$slots.label)
2789
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
2790
+ vue.createElementVNode("span", _hoisted_14, [
2791
+ vue.renderSlot(_ctx.$slots, "label")
2792
+ ])
2793
+ ]))
2794
+ : vue.createCommentVNode("v-if", true)
2795
+ ], 6 /* CLASS, STYLE */))
2796
+ }
2797
+ }
2798
+
2799
+ });
2800
+ var CardItem = /*#__PURE__*/_export_sfc(_sfc_main$9, [['__file',"/Users/wangding/WorkSpace/AsiaInfo/projects/前端框架/touch-vue3-ui/packages/components/card/src/CardItem.vue"]]);
2801
+
2802
+ const ToCard = withInstall(Card, [CardItem]);
2803
+
2804
+ const _hoisted_1$6 = {
2805
+ key: 0,
2806
+ class: "to-checkbox-label"
2807
+ };
2808
+ var _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
2809
+ ...{
2810
+ name: "ToCheckbox"
2811
+ },
2812
+ __name: "Checkbox",
2813
+ props: {
2814
+ mode: { type: String, required: false, default: "default" },
2815
+ label: { type: String, required: false, default: "" },
2816
+ value: { type: Boolean, required: false }
2817
+ },
2818
+ setup(__props) {
2819
+ const props = __props;
2820
+ let checked = vue.ref(false);
2821
+ const setStyle = vue.computed(() => {
2822
+ const obj = {};
2823
+ return obj;
2824
+ });
2825
+ const setClass = vue.computed(() => {
2826
+ let arr = [];
2827
+ if (props.mode) {
2828
+ arr.push(`mode-${props.mode}`);
2829
+ }
2830
+ if (checked.value) {
2831
+ arr.push(`is-checked`);
2832
+ }
2833
+ return arr;
2834
+ });
2835
+ function toggle() {
2836
+ checked.value = !checked.value;
2837
+ }
2838
+ return (_ctx, _cache) => {
2839
+ return vue.openBlock(), vue.createElementBlock(
2840
+ "div",
2841
+ {
2842
+ class: vue.normalizeClass(["to-checkbox", setClass.value]),
2843
+ style: vue.normalizeStyle(setStyle.value),
2844
+ onClick: vue.withModifiers(toggle, ["stop"])
2845
+ },
2846
+ [
2847
+ _cache[0] || (_cache[0] = vue.createElementVNode(
2848
+ "div",
2849
+ { class: "to-checkbox-box" },
2850
+ null,
2851
+ -1
2852
+ /* CACHED */
2853
+ )),
2854
+ _ctx.label ? (vue.openBlock(), vue.createElementBlock(
2855
+ "div",
2856
+ _hoisted_1$6,
2857
+ vue.toDisplayString(_ctx.label),
2858
+ 1
2859
+ /* TEXT */
2860
+ )) : vue.createCommentVNode("v-if", true)
2861
+ ],
2862
+ 6
2863
+ /* CLASS, STYLE */
2864
+ );
2865
+ };
2866
+ }
2867
+ });
2868
+
2869
+ var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/checkbox/src/Checkbox.vue"]]);
2870
+
2871
+ const ToCheckbox = withInstall(Checkbox);
2872
+
2873
+ var _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
2874
+ ...{
2875
+ name: "ToDatepicker"
2876
+ },
2877
+ __name: "DatePicker",
2878
+ setup(__props) {
2879
+ return (_ctx, _cache) => {
2880
+ return vue.openBlock(), vue.createElementBlock("div");
2881
+ };
2882
+ }
2883
+ });
2884
+
2885
+ var DatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/datepicker/src/DatePicker.vue"]]);
2886
+
2887
+ const ToDatepikcer = withInstall(DatePicker);
2888
+
2889
+ const _hoisted_1$5 = { class: "to-switch-on" };
2890
+ const _hoisted_2$4 = { class: "to-switch-off" };
2891
+
2892
+
2893
+ const _sfc_main$6 = /*@__PURE__*/Object.assign({
2894
+ name: 'ToSwitch',
2895
+ }, {
2896
+ __name: 'switch',
2897
+ props: {
2898
+ readonly: Boolean,
2899
+ modelValue: {
2900
+ type: [Boolean, String, Number],
2901
+ default: false
2902
+ },
2903
+ onValue: {
2904
+ type: [Boolean, String, Number],
2905
+ default: true
2906
+ },
2907
+ offValue: {
2908
+ type: [Boolean, String, Number],
2909
+ default: false
2910
+ },
2911
+ onText: {
2912
+ type: String,
2913
+ default: ''
2914
+ },
2915
+ offText: {
2916
+ type: String,
2917
+ default: ''
2918
+ }
2919
+ },
2920
+ emits: ['update:modelValue', 'change', 'beforeChange'],
2921
+ setup(__props, { emit: __emit }) {
2922
+
2923
+
2924
+ const props = __props;
2925
+
2926
+ const emit = __emit;
2927
+
2928
+ const ivalue = vue.ref(props.modelValue);
2929
+ const disabled = vue.ref(props.readonly);
2930
+
2931
+ vue.watch(() => props.modelValue, val => {
2932
+ ivalue.value = val;
2933
+ }, { immediate: true });
2934
+
2935
+ vue.watch(() => props.readonly, val => {
2936
+ disabled.value = val;
2937
+ });
2938
+
2939
+ const setClass = vue.computed(() => {
2940
+ const arr = [];
2941
+ if (ivalue.value === props.onValue) {
2942
+ arr.push(`is-on`);
2943
+ }
2944
+ return arr;
2945
+ });
2946
+
2947
+ function toggle() {
2948
+ if (disabled.value) return;
2949
+
2950
+ emit('beforeChange', ivalue.value);
2951
+ ivalue.value = (ivalue.value === props.onValue) ? props.offValue : props.onValue;
2952
+ emit('update:modelValue', ivalue.value);
2953
+ emit('change', ivalue.value);
2954
+ }
2955
+
2956
+ return (_ctx, _cache) => {
2957
+ const _directive_dis = vue.resolveDirective("dis");
2958
+
2959
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
2960
+ class: vue.normalizeClass(["to-switch", setClass.value]),
2961
+ onClick: toggle
2962
+ }, [
2963
+ vue.createElementVNode("div", _hoisted_1$5, vue.toDisplayString(__props.onText), 1 /* TEXT */),
2964
+ vue.createElementVNode("div", _hoisted_2$4, vue.toDisplayString(__props.offText), 1 /* TEXT */)
2965
+ ], 2 /* CLASS */)), [
2966
+ [
2967
+ _directive_dis,
2968
+ disabled.value,
2969
+ void 0,
2970
+ { opacity: true }
2971
+ ]
2972
+ ])
2973
+ }
2974
+ }
2975
+
2976
+ });
2977
+ var Switch = /*#__PURE__*/_export_sfc(_sfc_main$6, [['__file',"/Users/wangding/WorkSpace/AsiaInfo/projects/前端框架/touch-vue3-ui/packages/components/switch/src/switch.vue"]]);
2978
+
2979
+ const ToSwitch = withInstall(Switch);
2980
+
2981
+ const _hoisted_1$4 = { class: "to-tab-tab" };
2982
+ const _hoisted_2$3 = { class: "to-tab-list" };
2983
+ const _hoisted_3$2 = ["onClick"];
2984
+ const _hoisted_4$2 = { class: "to-tab-item-main" };
2985
+ const _hoisted_5$2 = { class: "to-tab-item-content" };
2986
+ const _hoisted_6$1 = { class: "to-tab-item-label" };
2987
+ const _hoisted_7 = ["onClick"];
2988
+ const _hoisted_8 = { class: "to-tab-fn" };
2989
+ const _hoisted_9 = { class: "to-tab-page" };
2990
+ var _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
2991
+ ...{
2992
+ name: "ToTab"
2993
+ },
2994
+ __name: "tab",
2995
+ props: {
2996
+ modelValue: { type: [String, Number], required: false, default: "" },
2997
+ position: { type: String, required: false, default: "" },
2998
+ mode: { type: String, required: false, default: "default" },
2999
+ data: { type: Array, required: false, default: () => [] },
3000
+ deletable: { type: Boolean, required: false, default: false },
3001
+ tabOver: { type: String, required: false, default: "control" }
3002
+ },
3003
+ emits: ["update:modelValue", "change"],
3004
+ setup(__props, { emit: __emit }) {
3005
+ const emit = __emit;
3006
+ const props = __props;
3007
+ const left = vue.ref(0);
3008
+ const setClass = vue.computed(() => {
3009
+ let arr = [];
3010
+ if (props.mode) {
3011
+ arr.push(`mode-${props.mode}`);
3012
+ }
3013
+ if (props.position) {
3014
+ arr.push(`position-${props.position}`);
3015
+ }
3016
+ return arr;
3017
+ });
3018
+ const setStyle = vue.computed(() => {
3019
+ let obj = {};
3020
+ return obj;
3021
+ });
3022
+ const setUlStyle = vue.computed(() => {
3023
+ let obj = {};
3024
+ obj.transform = `translateX(${left}px)`;
3025
+ return obj;
3026
+ });
3027
+ function changeTab(item, index) {
3028
+ emit("update:modelValue", item.value, index);
3029
+ emit("change", item.value, index);
3030
+ }
3031
+ function removeTab(item, index) {
3032
+ }
3033
+ return (_ctx, _cache) => {
3034
+ return vue.openBlock(), vue.createElementBlock(
3035
+ "div",
3036
+ {
3037
+ class: vue.normalizeClass(["to-tab", setClass.value]),
3038
+ style: vue.normalizeStyle(setStyle.value)
3039
+ },
3040
+ [
3041
+ vue.createElementVNode("div", _hoisted_1$4, [
3042
+ vue.createElementVNode("div", _hoisted_2$3, [
3043
+ vue.createElementVNode(
3044
+ "ul",
3045
+ {
3046
+ ref: "ul",
3047
+ class: "to-tab-wrapper",
3048
+ style: vue.normalizeStyle(setUlStyle.value)
3049
+ },
3050
+ [
3051
+ (vue.openBlock(true), vue.createElementBlock(
3052
+ vue.Fragment,
3053
+ null,
3054
+ vue.renderList(_ctx.data, (item, index) => {
3055
+ return vue.openBlock(), vue.createElementBlock("li", {
3056
+ key: index,
3057
+ class: vue.normalizeClass(["to-tab-item", { "is-on": item.value === _ctx.modelValue }]),
3058
+ onClick: ($event) => changeTab(item, index)
3059
+ }, [
3060
+ vue.renderSlot(_ctx.$slots, "item", vue.mergeProps({ ref_for: true }, item), () => [
3061
+ vue.createElementVNode("div", _hoisted_4$2, [
3062
+ _cache[1] || (_cache[1] = vue.createElementVNode(
3063
+ "div",
3064
+ { class: "to-tab-item-left" },
3065
+ null,
3066
+ -1
3067
+ /* CACHED */
3068
+ )),
3069
+ vue.createElementVNode("div", _hoisted_5$2, [
3070
+ vue.createElementVNode("div", _hoisted_6$1, [
3071
+ vue.renderSlot(_ctx.$slots, "label", vue.mergeProps({ ref_for: true }, item), () => [
3072
+ vue.createTextVNode(
3073
+ vue.toDisplayString(item.label),
3074
+ 1
3075
+ /* TEXT */
3076
+ )
3077
+ ])
3078
+ ]),
3079
+ _ctx.deletable ? (vue.openBlock(), vue.createElementBlock("span", {
3080
+ key: 0,
3081
+ class: "to-tab-item-delete",
3082
+ onClick: vue.withModifiers(($event) => removeTab(), ["stop"])
3083
+ }, [..._cache[0] || (_cache[0] = [
3084
+ vue.createElementVNode(
3085
+ "span",
3086
+ null,
3087
+ null,
3088
+ -1
3089
+ /* CACHED */
3090
+ )
3091
+ ])], 8, _hoisted_7)) : vue.createCommentVNode("v-if", true)
3092
+ ]),
3093
+ _cache[2] || (_cache[2] = vue.createElementVNode(
3094
+ "div",
3095
+ { class: "to-tab-item-right" },
3096
+ null,
3097
+ -1
3098
+ /* CACHED */
3099
+ ))
3100
+ ]),
3101
+ _cache[3] || (_cache[3] = vue.createElementVNode(
3102
+ "div",
3103
+ { class: "to-tab-item-under" },
3104
+ null,
3105
+ -1
3106
+ /* CACHED */
3107
+ ))
3108
+ ])
3109
+ ], 10, _hoisted_3$2);
3110
+ }),
3111
+ 128
3112
+ /* KEYED_FRAGMENT */
3113
+ ))
3114
+ ],
3115
+ 4
3116
+ /* STYLE */
3117
+ )
3118
+ ]),
3119
+ _cache[4] || (_cache[4] = vue.createElementVNode(
3120
+ "div",
3121
+ { class: "to-tab-line" },
3122
+ null,
3123
+ -1
3124
+ /* CACHED */
3125
+ )),
3126
+ vue.createElementVNode("div", _hoisted_8, [
3127
+ vue.renderSlot(_ctx.$slots, "fn"),
3128
+ vue.createCommentVNode(' <div class="to-tab-fn-item fn-left"></div>\n <div class="to-tab-fn-item fn-right"></div>\n <div class="to-tab-fn-item fn-refresh"></div> ')
3129
+ ])
3130
+ ]),
3131
+ vue.createElementVNode("div", _hoisted_9, [
3132
+ vue.renderSlot(_ctx.$slots, "default")
3133
+ ])
3134
+ ],
3135
+ 6
3136
+ /* CLASS, STYLE */
3137
+ );
3138
+ };
3139
+ }
3140
+ });
3141
+
3142
+ var Tab = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/tab/src/tab.vue"]]);
3143
+
3144
+ var _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
3145
+ ...{
3146
+ name: "ToTabItem"
3147
+ },
3148
+ __name: "tab-item",
3149
+ props: {
3150
+ mode: { type: String, required: true, default: "default" }
3151
+ },
3152
+ setup(__props) {
3153
+ const props = __props;
3154
+ const setClass = vue.computed(() => {
3155
+ let arr = [];
3156
+ if (props.mode) {
3157
+ arr.push(`mode-${props.mode}`);
3158
+ }
3159
+ return arr;
3160
+ });
3161
+ return (_ctx, _cache) => {
3162
+ return vue.openBlock(), vue.createElementBlock(
3163
+ "div",
3164
+ {
3165
+ class: vue.normalizeClass(["to-tab-item", setClass.value])
3166
+ },
3167
+ null,
3168
+ 2
3169
+ /* CLASS */
3170
+ );
3171
+ };
3172
+ }
3173
+ });
3174
+
3175
+ var TabItem = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/tab/src/tab-item.vue"]]);
3176
+
3177
+ const ToTab = withInstall(Tab);
3178
+ const ToTabItem = withInstall(TabItem);
3179
+
3180
+ const _hoisted_1$3 = { class: "to-table-table" };
3181
+ const _hoisted_2$2 = { class: "to-table-head" };
3182
+ const _hoisted_3$1 = { class: "to-table-head-row" };
3183
+ const _hoisted_4$1 = { class: "to-table-body" };
3184
+ const _hoisted_5$1 = ["onClick"];
3185
+ var _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
3186
+ ...{
3187
+ name: "ToTable"
3188
+ },
3189
+ __name: "table",
3190
+ props: {
3191
+ columns: { type: Array, required: false, default: () => [] },
3192
+ data: { type: Array, required: false, default: () => [] },
3193
+ height: { type: [Number, String], required: false, default: "" }
3194
+ },
3195
+ setup(__props) {
3196
+ const props = __props;
3197
+ const flatData = vue.computed(() => flattenTree(props.data));
3198
+ const expandedSet = vue.ref(/* @__PURE__ */ new Set());
3199
+ let uid = 0;
3200
+ function flattenTree(data, level = 0, parentId) {
3201
+ const result = [];
3202
+ for (const item of data) {
3203
+ const id = uid++;
3204
+ const { children, ...rest } = item;
3205
+ result.push({ ...rest, id, parentId, level });
3206
+ if (children && Array.isArray(children)) {
3207
+ result.push(...flattenTree(children, level + 1, id));
3208
+ }
3209
+ }
3210
+ return result;
3211
+ }
3212
+ function isVisible(item, all) {
3213
+ let parentId = item.parentId;
3214
+ while (parentId !== void 0) {
3215
+ if (!expandedSet.value.has(parentId))
3216
+ return false;
3217
+ const parent = all.find((n) => n.id === parentId);
3218
+ parentId = parent == null ? void 0 : parent.parentId;
3219
+ }
3220
+ return true;
3221
+ }
3222
+ const visibleRows = vue.computed(
3223
+ () => flatData.value.filter((item) => item.level === 0 || isVisible(item, flatData.value))
3224
+ );
3225
+ function toggleExpand(row) {
3226
+ if (expandedSet.value.has(row.id)) {
3227
+ expandedSet.value.delete(row.id);
3228
+ } else {
3229
+ expandedSet.value.add(row.id);
3230
+ }
3231
+ }
3232
+ function hasChildren(row) {
3233
+ return flatData.value.some((item) => item.parentId === row.id);
3234
+ }
3235
+ const setClass = vue.computed(() => {
3236
+ const classes = [];
3237
+ if (props.height === "full")
3238
+ classes.push("height-full");
3239
+ return classes;
3240
+ });
3241
+ const setTdClass = (column) => {
3242
+ return vue.computed(() => {
3243
+ const classes = [];
3244
+ if (column.type === "action")
3245
+ classes.push("is-action");
3246
+ return classes;
3247
+ });
3248
+ };
3249
+ const setStyle = vue.computed(() => {
3250
+ const obj = {};
3251
+ if (props.height && props.height !== "full") {
3252
+ obj.height = isNaN(Number(props.height)) ? String(props.height) : `${props.height}em`;
3253
+ }
3254
+ return obj;
3255
+ });
3256
+ return (_ctx, _cache) => {
3257
+ const _component_ToCheckbox = vue.resolveComponent("ToCheckbox");
3258
+ return vue.openBlock(), vue.createElementBlock(
3259
+ "div",
3260
+ {
3261
+ class: vue.normalizeClass(["to-table", setClass.value]),
3262
+ style: vue.normalizeStyle(setStyle.value)
3263
+ },
3264
+ [
3265
+ vue.createElementVNode("table", _hoisted_1$3, [
3266
+ vue.createElementVNode("thead", _hoisted_2$2, [
3267
+ vue.createElementVNode("tr", _hoisted_3$1, [
3268
+ (vue.openBlock(true), vue.createElementBlock(
3269
+ vue.Fragment,
3270
+ null,
3271
+ vue.renderList(_ctx.columns, (column) => {
3272
+ return vue.openBlock(), vue.createElementBlock(
3273
+ vue.Fragment,
3274
+ null,
3275
+ [
3276
+ column.type === "check" ? (vue.openBlock(), vue.createElementBlock("th", {
3277
+ key: column.prop + "check",
3278
+ class: "to-table-th is-check"
3279
+ }, [
3280
+ vue.createVNode(_component_ToCheckbox)
3281
+ ])) : (vue.openBlock(), vue.createElementBlock(
3282
+ "th",
3283
+ {
3284
+ class: "to-table-th",
3285
+ key: column.prop
3286
+ },
3287
+ vue.toDisplayString(column.label),
3288
+ 1
3289
+ /* TEXT */
3290
+ ))
3291
+ ],
3292
+ 64
3293
+ /* STABLE_FRAGMENT */
3294
+ );
3295
+ }),
3296
+ 256
3297
+ /* UNKEYED_FRAGMENT */
3298
+ ))
3299
+ ])
3300
+ ]),
3301
+ vue.createElementVNode("tbody", _hoisted_4$1, [
3302
+ (vue.openBlock(true), vue.createElementBlock(
3303
+ vue.Fragment,
3304
+ null,
3305
+ vue.renderList(visibleRows.value, (row, rowIndex) => {
3306
+ return vue.openBlock(), vue.createElementBlock("tr", {
3307
+ class: "to-table-body-row",
3308
+ key: rowIndex
3309
+ }, [
3310
+ (vue.openBlock(true), vue.createElementBlock(
3311
+ vue.Fragment,
3312
+ null,
3313
+ vue.renderList(_ctx.columns, (column) => {
3314
+ return vue.openBlock(), vue.createElementBlock(
3315
+ vue.Fragment,
3316
+ null,
3317
+ [
3318
+ column.type === "check" ? (vue.openBlock(), vue.createElementBlock("td", {
3319
+ key: column.prop + "check",
3320
+ class: "to-table-td is-check"
3321
+ }, [
3322
+ vue.createVNode(_component_ToCheckbox)
3323
+ ])) : (vue.openBlock(), vue.createElementBlock(
3324
+ "td",
3325
+ {
3326
+ class: vue.normalizeClass(["to-table-td", setTdClass(column).value]),
3327
+ key: column.prop,
3328
+ style: vue.normalizeStyle({ paddingLeft: column.toggler && row.level ? `${row.level + 2}em` : "" })
3329
+ },
3330
+ [
3331
+ hasChildren(row) && column.toggler ? (vue.openBlock(), vue.createElementBlock("span", {
3332
+ key: 0,
3333
+ onClick: ($event) => toggleExpand(row),
3334
+ class: vue.normalizeClass(["to-table-toggle", {
3335
+ "is-expand": expandedSet.value.has(row.id)
3336
+ }])
3337
+ }, null, 10, _hoisted_5$1)) : vue.createCommentVNode("v-if", true),
3338
+ vue.renderSlot(_ctx.$slots, column.prop, {
3339
+ row,
3340
+ index: rowIndex
3341
+ }, () => [
3342
+ column.prop ? (vue.openBlock(), vue.createElementBlock(
3343
+ vue.Fragment,
3344
+ { key: 0 },
3345
+ [
3346
+ vue.createTextVNode(
3347
+ vue.toDisplayString(row[column.prop]),
3348
+ 1
3349
+ /* TEXT */
3350
+ )
3351
+ ],
3352
+ 64
3353
+ /* STABLE_FRAGMENT */
3354
+ )) : vue.createCommentVNode("v-if", true)
3355
+ ])
3356
+ ],
3357
+ 6
3358
+ /* CLASS, STYLE */
3359
+ ))
3360
+ ],
3361
+ 64
3362
+ /* STABLE_FRAGMENT */
3363
+ );
3364
+ }),
3365
+ 256
3366
+ /* UNKEYED_FRAGMENT */
3367
+ ))
3368
+ ]);
3369
+ }),
3370
+ 128
3371
+ /* KEYED_FRAGMENT */
3372
+ ))
3373
+ ])
3374
+ ])
3375
+ ],
3376
+ 6
3377
+ /* CLASS, STYLE */
3378
+ );
3379
+ };
3380
+ }
3381
+ });
3382
+
3383
+ var Table = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/table/src/table.vue"]]);
3384
+
3385
+ const _hoisted_1$2 = { class: "config" };
3386
+ var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
3387
+ ...{
3388
+ name: "ToTableConfig"
3389
+ },
3390
+ __name: "table-config",
3391
+ props: {
3392
+ data: { type: Array, default: () => [] }
3393
+ },
3394
+ emits: ["change"],
3395
+ setup(__props, { emit: __emit }) {
3396
+ const props = __props;
3397
+ const emit = __emit;
3398
+ const checked = vue.ref([]);
3399
+ const configData = vue.ref([]);
3400
+ const configIconRef = vue.ref();
3401
+ const floatRef = vue.ref();
3402
+ function setConfigData() {
3403
+ const data = JSON.parse(JSON.stringify(props.data));
3404
+ function setData(data2, path) {
3405
+ data2.forEach((dataItem, dataIndex) => {
3406
+ if (dataItem.type === "selection" || dataItem.type === "radio") {
3407
+ dataItem.label = "\u9009\u62E9\u5668";
3408
+ }
3409
+ if (dataItem.type === "action") {
3410
+ data2.splice(dataIndex, 1);
3411
+ }
3412
+ dataItem.path = path ? path.concat(dataItem.label) : [dataItem.label];
3413
+ if (dataItem.children) {
3414
+ setData(dataItem.children, dataItem.path);
3415
+ }
3416
+ });
3417
+ }
3418
+ setData(data);
3419
+ configData.value = data;
3420
+ }
3421
+ function setChecked() {
3422
+ const arr = [];
3423
+ function setData(data) {
3424
+ data.forEach((dataItem) => {
3425
+ if (dataItem.show !== false) {
3426
+ if (dataItem.type === "selection") {
3427
+ arr.push("\u9009\u62E9\u5668");
3428
+ } else {
3429
+ arr.push(dataItem.label);
3430
+ }
3431
+ }
3432
+ if (dataItem.children) {
3433
+ setData(dataItem.children);
3434
+ }
3435
+ });
3436
+ }
3437
+ setData(props.data);
3438
+ checked.value = arr;
3439
+ }
3440
+ function flex() {
3441
+ var _a, _b;
3442
+ (_b = floatRef.value) == null ? void 0 : _b.set((_a = configIconRef.value) == null ? void 0 : _a.$el);
3443
+ }
3444
+ function check(checkedKeys, checkedNodes, node, checkedFlag) {
3445
+ const data = JSON.parse(JSON.stringify(props.data));
3446
+ function checkData(data2) {
3447
+ data2.forEach((dataItem) => {
3448
+ if (dataItem.type === "selection") {
3449
+ dataItem.show = checkedKeys.includes("\u9009\u62E9\u5668");
3450
+ } else {
3451
+ dataItem.show = checkedKeys.includes(dataItem.label) || dataItem.type === "action";
3452
+ }
3453
+ if (dataItem.children) {
3454
+ checkData(dataItem.children);
3455
+ }
3456
+ });
3457
+ }
3458
+ function setChildrenHide(data2, setHide) {
3459
+ data2.forEach((dataItem) => {
3460
+ if (setHide) {
3461
+ dataItem.show = false;
3462
+ checked.value = checked.value.filter((item) => item !== dataItem.label);
3463
+ }
3464
+ if (dataItem.children) {
3465
+ setChildrenHide(dataItem.children, dataItem.label === node.label || setHide);
3466
+ }
3467
+ });
3468
+ }
3469
+ function setChildrenAndParentShow(data2, setShow) {
3470
+ data2.forEach((dataItem) => {
3471
+ if (setShow || node.path.includes(dataItem.label)) {
3472
+ dataItem.show = true;
3473
+ if (!checked.value.includes(dataItem.label)) {
3474
+ checked.value.push(dataItem.label);
3475
+ }
3476
+ }
3477
+ if (dataItem.children) {
3478
+ setChildrenAndParentShow(dataItem.children, dataItem.label === node.label || setShow);
3479
+ }
3480
+ });
3481
+ }
3482
+ checkData(data);
3483
+ if (!checkedFlag) {
3484
+ setChildrenHide(data, false);
3485
+ checked.value = checked.value.filter((item) => item !== node.label);
3486
+ } else {
3487
+ setChildrenAndParentShow(data, false);
3488
+ checked.value.push(node.label);
3489
+ }
3490
+ emit("change", data);
3491
+ }
3492
+ vue.onMounted(() => {
3493
+ setConfigData();
3494
+ setChecked();
3495
+ });
3496
+ vue.watch(() => props.data, () => {
3497
+ setConfigData();
3498
+ setChecked();
3499
+ });
3500
+ return (_ctx, _cache) => {
3501
+ const _component_to_icon = vue.resolveComponent("to-icon");
3502
+ const _component_to_tree = vue.resolveComponent("to-tree");
3503
+ const _component_to_scroll = vue.resolveComponent("to-scroll");
3504
+ const _component_to_float = vue.resolveComponent("to-float");
3505
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
3506
+ vue.createVNode(
3507
+ _component_to_icon,
3508
+ {
3509
+ ref: "configIcon",
3510
+ value: "config",
3511
+ color: "info",
3512
+ mode: "none",
3513
+ link: "",
3514
+ fillet: "round",
3515
+ onClick: _cache[0] || (_cache[0] = () => {
3516
+ var _a;
3517
+ return (_a = floatRef.value.value) == null ? void 0 : _a.toggle(configIconRef.value.value);
3518
+ })
3519
+ },
3520
+ null,
3521
+ 512
3522
+ /* NEED_PATCH */
3523
+ ),
3524
+ vue.createVNode(
3525
+ _component_to_float,
3526
+ {
3527
+ ref_key: "floatRef",
3528
+ ref: floatRef,
3529
+ width: "18",
3530
+ lazy: false
3531
+ },
3532
+ {
3533
+ default: vue.withCtx(() => [
3534
+ vue.createVNode(_component_to_scroll, { padding: "0.5" }, {
3535
+ default: vue.withCtx(() => [
3536
+ vue.createVNode(_component_to_tree, {
3537
+ "show-checkbox": "",
3538
+ "check-strictly": "",
3539
+ expand: "",
3540
+ "check-on-click-node": "",
3541
+ data: configData.value,
3542
+ "value-text": "label",
3543
+ "checked-keys": checked.value,
3544
+ onCheckChange: check,
3545
+ onNodeExpand: flex,
3546
+ onNodeCollapse: flex
3547
+ }, null, 8, ["data", "checked-keys"])
3548
+ ]),
3549
+ _: 1
3550
+ /* STABLE */
3551
+ })
3552
+ ]),
3553
+ _: 1
3554
+ /* STABLE */
3555
+ },
3556
+ 512
3557
+ /* NEED_PATCH */
3558
+ )
3559
+ ]);
3560
+ };
3561
+ }
3562
+ });
3563
+
3564
+ var TableConfig = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/table/src/table-config.vue"]]);
3565
+
3566
+ const _hoisted_1$1 = { ref: "row" };
3567
+ const _hoisted_2$1 = ["rowspan", "colspan"];
3568
+ const _hoisted_3 = ["rowspan", "colspan"];
3569
+ const _hoisted_4 = ["rowspan", "colspan", "onClick"];
3570
+ const _hoisted_5 = ["rowspan", "colspan"];
3571
+ const _hoisted_6 = ["rowspan", "colspan", "onClick"];
3572
+ var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3573
+ ...{
3574
+ name: "ToTableHead"
3575
+ },
3576
+ __name: "table-head",
3577
+ props: {
3578
+ name: { type: String, default: "" },
3579
+ start: { type: Number, default: null },
3580
+ end: { type: Number, default: null },
3581
+ data: { type: Array, default: () => [] },
3582
+ configurable: Boolean
3583
+ },
3584
+ emits: ["select-all", "column-change"],
3585
+ setup(__props, { emit: __emit }) {
3586
+ const t = (str) => str;
3587
+ const props = __props;
3588
+ const emit = __emit;
3589
+ const ToTable = vue.inject("ToTable");
3590
+ const showColumn = (column, columnIndex) => {
3591
+ console.log(columnIndex);
3592
+ if (column.show === false)
3593
+ return false;
3594
+ if (["selection", "radio", "action"].includes(column.type))
3595
+ return true;
3596
+ if (ToTable.showColumns || ToTable.showColumns === 0) {
3597
+ if (!isNaN(ToTable.showColumns)) {
3598
+ const index = ToTable.normalColumn.findIndex((item) => column.prop === item.prop);
3599
+ return index !== -1 && index < Number(ToTable.showColumns);
3600
+ } else {
3601
+ return ToTable.showColumns.split(",").includes(column.prop);
3602
+ }
3603
+ }
3604
+ return true;
3605
+ };
3606
+ function countLeafNodes(tree) {
3607
+ if (!tree || tree.length === 0)
3608
+ return 0;
3609
+ let leafCount = 0;
3610
+ for (let i = 0; i < tree.length; i++) {
3611
+ if (tree[i].show !== false) {
3612
+ if (!tree[i].children || tree[i].children.length === 0 || tree[i].children.every((child) => child.show === false)) {
3613
+ leafCount += 1;
3614
+ } else {
3615
+ leafCount += countLeafNodes(tree[i].children);
3616
+ }
3617
+ }
3618
+ }
3619
+ return leafCount;
3620
+ }
3621
+ const tableData = vue.computed(() => {
3622
+ const result = [];
3623
+ let maxDepth = 0;
3624
+ function calculateMaxDepth(heads, depth = 1) {
3625
+ heads.forEach((head) => {
3626
+ if (head.children) {
3627
+ calculateMaxDepth(head.children, depth + 1);
3628
+ }
3629
+ });
3630
+ maxDepth = Math.max(maxDepth, depth);
3631
+ }
3632
+ calculateMaxDepth(props.data);
3633
+ function generateTableData(heads, depth = 0, rowIndex = 0) {
3634
+ if (!result[rowIndex])
3635
+ result[rowIndex] = [];
3636
+ heads.forEach((head) => {
3637
+ const cell = Object.assign({}, head, { rowspan: 1, colspan: 1 });
3638
+ if (head.children && !head.children.every((child) => child.show === false)) {
3639
+ cell.colspan = countLeafNodes(head.children);
3640
+ result[rowIndex].push(cell);
3641
+ generateTableData(head.children, depth + 1, rowIndex + 1);
3642
+ } else {
3643
+ cell.rowspan = maxDepth - depth;
3644
+ result[rowIndex].push(cell);
3645
+ }
3646
+ });
3647
+ }
3648
+ generateTableData(JSON.parse(JSON.stringify(props.data)));
3649
+ return result;
3650
+ });
3651
+ function checkAllChange(checked) {
3652
+ emit("select-all", checked);
3653
+ }
3654
+ function configChange(data) {
3655
+ emit("column-change", data);
3656
+ }
3657
+ return (_ctx, _cache) => {
3658
+ const _component_to_checkbox = vue.resolveComponent("to-checkbox");
3659
+ const _component_to_icon = vue.resolveComponent("to-icon");
3660
+ return vue.openBlock(), vue.createElementBlock(
3661
+ "thead",
3662
+ _hoisted_1$1,
3663
+ [
3664
+ (vue.openBlock(true), vue.createElementBlock(
3665
+ vue.Fragment,
3666
+ null,
3667
+ vue.renderList(tableData.value, (titem, tindex) => {
3668
+ return vue.openBlock(), vue.createElementBlock("tr", { key: tindex }, [
3669
+ (vue.openBlock(true), vue.createElementBlock(
3670
+ vue.Fragment,
3671
+ null,
3672
+ vue.renderList(titem, (item, index) => {
3673
+ return vue.openBlock(), vue.createElementBlock(
3674
+ vue.Fragment,
3675
+ null,
3676
+ [
3677
+ showColumn(item, index) ? (vue.openBlock(), vue.createElementBlock(
3678
+ vue.Fragment,
3679
+ { key: 0 },
3680
+ [
3681
+ vue.unref(ToTable).isNeedSelectAll && item.type === "selection" ? (vue.openBlock(), vue.createElementBlock("th", {
3682
+ key: index + "_selection",
3683
+ class: vue.normalizeClass(["selection", [item.sortable === true ? "sort" : "", "checkbox"]]),
3684
+ rowspan: item.rowspan || 1,
3685
+ colspan: item.colspan || 1
3686
+ }, [
3687
+ vue.createVNode(_component_to_checkbox, {
3688
+ value: vue.unref(ToTable).isSelectAll && vue.unref(ToTable).iData.length > 0,
3689
+ onChange: checkAllChange
3690
+ }, null, 8, ["value"])
3691
+ ], 10, _hoisted_2$1)) : item.type === "radio" ? (vue.openBlock(), vue.createElementBlock("th", {
3692
+ key: index + "_radio",
3693
+ class: vue.normalizeClass(["radio", [item.sortable === true ? "sort" : "", "index"]]),
3694
+ rowspan: item.rowspan || 1,
3695
+ colspan: item.colspan || 1
3696
+ }, vue.toDisplayString(t("to.common.select")), 11, _hoisted_3)) : item.type === "index" ? (vue.openBlock(), vue.createElementBlock("th", {
3697
+ key: index + "_index",
3698
+ rowspan: item.rowspan || 1,
3699
+ colspan: item.colspan || 1,
3700
+ class: vue.normalizeClass([item.sortable === true ? "sort" : "", "index"]),
3701
+ onClick: ($event) => vue.unref(ToTable).handleTableHeadCellClick(item, index, $event)
3702
+ }, [
3703
+ item.sortable === true ? (vue.openBlock(), vue.createElementBlock(
3704
+ vue.Fragment,
3705
+ { key: 0 },
3706
+ [
3707
+ item.orderType == "asc" ? (vue.openBlock(), vue.createBlock(_component_to_icon, {
3708
+ key: 0,
3709
+ value: "fold"
3710
+ })) : vue.createCommentVNode("v-if", true),
3711
+ item.orderType == "desc" ? (vue.openBlock(), vue.createBlock(_component_to_icon, {
3712
+ key: 1,
3713
+ value: "unfold"
3714
+ })) : vue.createCommentVNode("v-if", true)
3715
+ ],
3716
+ 64
3717
+ /* STABLE_FRAGMENT */
3718
+ )) : vue.createCommentVNode("v-if", true),
3719
+ vue.createElementVNode(
3720
+ "span",
3721
+ null,
3722
+ vue.toDisplayString(vue.unref(ToTable).indexColumnName || item.label),
3723
+ 1
3724
+ /* TEXT */
3725
+ )
3726
+ ], 10, _hoisted_4)) : item.type === "action" && __props.configurable && vue.unref(ToTable).hasAction ? (vue.openBlock(), vue.createElementBlock("th", {
3727
+ key: index + "_action",
3728
+ rowspan: item.rowspan || 1,
3729
+ colspan: item.colspan || 1,
3730
+ class: "configTh action"
3731
+ }, [
3732
+ vue.createVNode(TableConfig, {
3733
+ data: vue.unref(ToTable).columns,
3734
+ onChange: configChange
3735
+ }, null, 8, ["data"])
3736
+ ], 8, _hoisted_5)) : !(item.type === "action" && vue.unref(ToTable).contextAction) ? (vue.openBlock(), vue.createElementBlock("th", {
3737
+ key: index + "_other",
3738
+ rowspan: item.rowspan || 1,
3739
+ colspan: item.colspan || 1,
3740
+ class: vue.normalizeClass([item.sortable === true ? "sort" : "", item.type === "action" ? "action" : ""]),
3741
+ onClick: ($event) => vue.unref(ToTable).handleTableHeadCellClick(item, index, $event)
3742
+ }, [
3743
+ item.sortable === true ? (vue.openBlock(), vue.createElementBlock(
3744
+ "span",
3745
+ {
3746
+ key: 0,
3747
+ class: vue.normalizeClass(["to-table-sorticon", `type-${item.orderType}`])
3748
+ },
3749
+ [
3750
+ vue.createVNode(_component_to_icon, {
3751
+ value: "fold",
3752
+ type: "fill"
3753
+ }),
3754
+ vue.createVNode(_component_to_icon, {
3755
+ value: "unfold",
3756
+ type: "fill"
3757
+ })
3758
+ ],
3759
+ 2
3760
+ /* CLASS */
3761
+ )) : vue.createCommentVNode("v-if", true),
3762
+ vue.renderSlot(_ctx.$slots, item.prop + "_th", {
3763
+ column: item,
3764
+ index
3765
+ }, () => [
3766
+ vue.createElementVNode(
3767
+ "span",
3768
+ null,
3769
+ vue.toDisplayString(item.label),
3770
+ 1
3771
+ /* TEXT */
3772
+ )
3773
+ ])
3774
+ ], 10, _hoisted_6)) : vue.createCommentVNode("v-if", true)
3775
+ ],
3776
+ 64
3777
+ /* STABLE_FRAGMENT */
3778
+ )) : vue.createCommentVNode("v-if", true)
3779
+ ],
3780
+ 64
3781
+ /* STABLE_FRAGMENT */
3782
+ );
3783
+ }),
3784
+ 256
3785
+ /* UNKEYED_FRAGMENT */
3786
+ ))
3787
+ ]);
3788
+ }),
3789
+ 128
3790
+ /* KEYED_FRAGMENT */
3791
+ ))
3792
+ ],
3793
+ 512
3794
+ /* NEED_PATCH */
3795
+ );
3796
+ };
3797
+ }
3798
+ });
3799
+
3800
+ var TableHead = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/table/src/table-head.vue"]]);
3801
+
3802
+ const _hoisted_1 = ["data-index", "onContextmenu"];
3803
+ const _hoisted_2 = { key: 0 };
3804
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
3805
+ ...{
3806
+ name: "ToTableBody"
3807
+ },
3808
+ __name: "table-body",
3809
+ props: {
3810
+ columnData: { type: Array, default: () => [] },
3811
+ data: { type: Array, default: () => [] }
3812
+ },
3813
+ setup(__props) {
3814
+ const props = __props;
3815
+ const ToTable = vue.inject("ToTable");
3816
+ const isClick = vue.ref(false);
3817
+ const isDblClick = vue.ref(false);
3818
+ const clickTimer = vue.ref(null);
3819
+ const showColumn = (column, columnIndex) => {
3820
+ console.log(columnIndex);
3821
+ if (column.show === false)
3822
+ return false;
3823
+ if (ToTable.type === "v") {
3824
+ if (["key", "desc", "icon", "state", "selection", "radio", "action"].includes(column.type))
3825
+ return false;
3826
+ } else {
3827
+ if (["selection", "radio", "action"].includes(column.type))
3828
+ return true;
3829
+ }
3830
+ if (ToTable.showColumns) {
3831
+ if (!isNaN(ToTable.showColumns)) {
3832
+ const index = ToTable.normalColumn.findIndex((item) => column.prop === item.prop);
3833
+ return index !== -1 && index < Number(ToTable.showColumns);
3834
+ } else {
3835
+ return ToTable.showColumns.split(",").includes(column.prop);
3836
+ }
3837
+ }
3838
+ return true;
3839
+ };
3840
+ const setClass = (column) => {
3841
+ const arr = [];
3842
+ if (column.type === "key")
3843
+ arr.push("key");
3844
+ if (column.type === "action")
3845
+ arr.push("action");
3846
+ if (column.type === "edit")
3847
+ arr.push("edit");
3848
+ if (column.type === "desc")
3849
+ arr.push("desc");
3850
+ if (column.wrap)
3851
+ arr.push("wrap");
3852
+ if (column.className)
3853
+ arr.push(...column.className.split(","));
3854
+ return arr;
3855
+ };
3856
+ console.log(setClass);
3857
+ const setTrClass = (dataItem) => {
3858
+ const arr = [];
3859
+ if (dataItem._on)
3860
+ arr.push("on");
3861
+ if (dataItem._hover)
3862
+ arr.push("hover");
3863
+ if (dataItem._active)
3864
+ arr.push("active");
3865
+ if (dataItem._className)
3866
+ arr.push(...dataItem._className.split(","));
3867
+ return arr;
3868
+ };
3869
+ const setTrStyle = vue.computed(() => {
3870
+ const obj = {};
3871
+ if (ToTable.space)
3872
+ obj.marginTop = `${ToTable.space}em`;
3873
+ return obj;
3874
+ });
3875
+ const tableData = vue.computed(() => {
3876
+ const result = [];
3877
+ function traverse(headers) {
3878
+ headers.forEach((header) => {
3879
+ if (header.children && !header.children.every((child) => child.show === false)) {
3880
+ traverse(header.children);
3881
+ } else {
3882
+ result.push(header);
3883
+ }
3884
+ });
3885
+ }
3886
+ traverse(props.columnData);
3887
+ return result;
3888
+ });
3889
+ function toggleFold(item, index) {
3890
+ if (!item._showChild) {
3891
+ item._showChild = true;
3892
+ } else {
3893
+ item._showChild = false;
3894
+ }
3895
+ for (let i = index + 1; i < props.data.length; i++) {
3896
+ const el = props.data[i];
3897
+ if (item._showChild) {
3898
+ if (el._level === item._level + 1) {
3899
+ el._show = true;
3900
+ } else if (el._level <= item._level) {
3901
+ break;
3902
+ }
3903
+ } else {
3904
+ if (el._level === item._level + 1) {
3905
+ hide(el, i);
3906
+ } else if (el._level <= item._level) {
3907
+ break;
3908
+ }
3909
+ }
3910
+ }
3911
+ function hide(tr, index2) {
3912
+ tr._show = false;
3913
+ tr._showChild = false;
3914
+ if (tr._hasChild) {
3915
+ for (let i = index2 + 1; i < props.data.length; i++) {
3916
+ const el = props.data[i];
3917
+ if (el._level === tr._level + 1) {
3918
+ hide(el, i);
3919
+ } else {
3920
+ break;
3921
+ }
3922
+ }
3923
+ }
3924
+ }
3925
+ ToTable.adjust();
3926
+ }
3927
+ console.log(toggleFold);
3928
+ function clickHandle(event) {
3929
+ const path = event.composedPath ? event.composedPath() : event.path;
3930
+ if (ToTable.$listeners && (ToTable.$listeners["row-dblclick"] || ToTable.$listeners["cell-dblclick"])) {
3931
+ clickTimer.value = window.setTimeout(() => {
3932
+ if (!isDblClick.value) {
3933
+ isClick.value = true;
3934
+ ToTable.handleTableClick(event, path);
3935
+ const timer = window.setTimeout(() => {
3936
+ isClick.value = false;
3937
+ clearTimeout(timer);
3938
+ }, 300);
3939
+ } else {
3940
+ isDblClick.value = false;
3941
+ }
3942
+ if (clickTimer.value)
3943
+ clearTimeout(clickTimer.value);
3944
+ }, 300);
3945
+ } else {
3946
+ ToTable.handleTableClick(event);
3947
+ }
3948
+ }
3949
+ function dbclickHandle(event) {
3950
+ if (!isClick.value) {
3951
+ isDblClick.value = true;
3952
+ ToTable.handleTableDblClick(event);
3953
+ } else {
3954
+ isClick.value = false;
3955
+ }
3956
+ }
3957
+ return (_ctx, _cache) => {
3958
+ return vue.openBlock(), vue.createElementBlock(
3959
+ "tbody",
3960
+ {
3961
+ ref: "tbody",
3962
+ onClick: clickHandle,
3963
+ onMouseover: _cache[0] || (_cache[0] = //@ts-ignore
3964
+ (...args) => vue.unref(ToTable).handleTableMouseover && vue.unref(ToTable).handleTableMouseover(...args)),
3965
+ onMouseout: _cache[1] || (_cache[1] = //@ts-ignore
3966
+ (...args) => vue.unref(ToTable).handleTableMouseout && vue.unref(ToTable).handleTableMouseout(...args)),
3967
+ onMousedown: _cache[2] || (_cache[2] = //@ts-ignore
3968
+ (...args) => vue.unref(ToTable).handleTableMousedown && vue.unref(ToTable).handleTableMousedown(...args)),
3969
+ onTouchstart: _cache[3] || (_cache[3] = //@ts-ignore
3970
+ (...args) => vue.unref(ToTable).handleTableMousedown && vue.unref(ToTable).handleTableMousedown(...args)),
3971
+ onTouchmove: _cache[4] || (_cache[4] = //@ts-ignore
3972
+ (...args) => vue.unref(ToTable).handleTableMousemove && vue.unref(ToTable).handleTableMousemove(...args)),
3973
+ onMouseup: _cache[5] || (_cache[5] = //@ts-ignore
3974
+ (...args) => vue.unref(ToTable).handleTableMouseup && vue.unref(ToTable).handleTableMouseup(...args)),
3975
+ onTouchend: _cache[6] || (_cache[6] = //@ts-ignore
3976
+ (...args) => vue.unref(ToTable).handleTableMouseup && vue.unref(ToTable).handleTableMouseup(...args)),
3977
+ onDblclick: dbclickHandle
3978
+ },
3979
+ [
3980
+ (vue.openBlock(true), vue.createElementBlock(
3981
+ vue.Fragment,
3982
+ null,
3983
+ vue.renderList(__props.data, (dataItem, dataIndex) => {
3984
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("tr", {
3985
+ key: dataIndex,
3986
+ class: vue.normalizeClass(setTrClass(dataItem)),
3987
+ style: vue.normalizeStyle(setTrStyle.value),
3988
+ "data-index": dataIndex,
3989
+ onContextmenu: vue.withModifiers(($event) => vue.unref(ToTable).handleTableRowRightClick(dataItem, dataIndex, $event), ["prevent"])
3990
+ }, [
3991
+ vue.unref(ToTable).type === "v" ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_2, [
3992
+ vue.renderSlot(_ctx.$slots, "v", {
3993
+ row: dataItem,
3994
+ index: dataIndex
3995
+ }, () => [
3996
+ vue.createCommentVNode(" ... \u4FDD\u6301\u539F\u6709\u7ED3\u6784 ... ")
3997
+ ])
3998
+ ])) : (vue.openBlock(true), vue.createElementBlock(
3999
+ vue.Fragment,
4000
+ { key: 1 },
4001
+ vue.renderList(tableData.value, (column, columnIndex) => {
4002
+ return vue.openBlock(), vue.createElementBlock(
4003
+ vue.Fragment,
4004
+ null,
4005
+ [
4006
+ showColumn(column, columnIndex) ? (vue.openBlock(), vue.createElementBlock(
4007
+ vue.Fragment,
4008
+ { key: 0 },
4009
+ [
4010
+ vue.createCommentVNode(" ... \u4FDD\u6301\u539F\u6709\u7ED3\u6784 ... ")
4011
+ ],
4012
+ 64
4013
+ /* STABLE_FRAGMENT */
4014
+ )) : vue.createCommentVNode("v-if", true)
4015
+ ],
4016
+ 64
4017
+ /* STABLE_FRAGMENT */
4018
+ );
4019
+ }),
4020
+ 256
4021
+ /* UNKEYED_FRAGMENT */
4022
+ ))
4023
+ ], 46, _hoisted_1)), [
4024
+ [vue.vShow, dataItem._show]
4025
+ ]);
4026
+ }),
4027
+ 128
4028
+ /* KEYED_FRAGMENT */
4029
+ ))
4030
+ ],
4031
+ 544
4032
+ /* NEED_HYDRATION, NEED_PATCH */
4033
+ );
4034
+ };
4035
+ }
4036
+ });
4037
+
4038
+ var TableBody = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/wangding/WorkSpace/AsiaInfo/projects/\u524D\u7AEF\u6846\u67B6/touch-vue3-ui/packages/components/table/src/table-body.vue"]]);
4039
+
4040
+ const ToTable = withInstall(Table);
4041
+ const ToTableHead = withInstall(TableHead);
4042
+ const ToTableBody = withInstall(TableBody);
4043
+ const ToTableConfig = withInstall(TableConfig);
4044
+
4045
+ const dis = {
4046
+ mounted(el, binding) {
4047
+ updateClass(el, binding);
4048
+ },
4049
+ updated(el, binding) {
4050
+ updateClass(el, binding);
4051
+ }
4052
+ };
4053
+ function updateClass(el, binding) {
4054
+ queueMicrotask(() => {
4055
+ const { value, modifiers } = binding;
4056
+ if (value) {
4057
+ el.classList.add("to-dis");
4058
+ if (modifiers.opacity) {
4059
+ el.classList.add("type-opacity");
4060
+ } else {
4061
+ el.classList.remove("type-opacity");
4062
+ }
4063
+ if (modifiers.select) {
4064
+ el.classList.add("type-select");
4065
+ } else {
4066
+ el.classList.remove("type-select");
4067
+ }
4068
+ } else {
4069
+ el.classList.remove("to-dis");
4070
+ el.classList.remove("type-opacity");
4071
+ }
4072
+ });
4073
+ }
4074
+
4075
+ function setFontSize(el, binding) {
4076
+ const val = binding.value;
4077
+ if (val) {
4078
+ if (["xxs", "xs", "s", "m", "l", "xl", "xxl", "xxxl"].includes(val)) {
4079
+ el.classList.add(`to-size-${val}`);
4080
+ } else if (!isNaN(Number(val))) {
4081
+ el.style.fontSize = `${val * 100}%`;
4082
+ } else {
4083
+ el.style.fontSize = val;
4084
+ }
4085
+ }
4086
+ }
4087
+ const sizeDirective = {
4088
+ mounted(el, binding) {
4089
+ setFontSize(el, binding);
4090
+ },
4091
+ updated(el, binding) {
4092
+ setFontSize(el, binding);
4093
+ }
4094
+ };
4095
+
4096
+ const directives = {
4097
+ dis,
4098
+ size: sizeDirective
4099
+ };
4100
+ const install$1 = (app) => {
4101
+ Object.entries(directives).forEach(([name, directive]) => {
4102
+ app.directive(name, directive);
4103
+ });
4104
+ };
4105
+ var InstallDirective = {
4106
+ install: install$1
4107
+ };
4108
+
4109
+ const LIBRARY_NAME = "@touchvue/ui";
4110
+ const PREFIX = "To";
4111
+ const isValidComponentName = (name) => {
4112
+ return name.startsWith(PREFIX);
4113
+ };
4114
+ const getComponentName = (name) => {
4115
+ return name.slice(PREFIX.length);
4116
+ };
4117
+ const getSideEffectsPath = (name, prefix = LIBRARY_NAME) => {
4118
+ const componentName = getComponentName(name).toLowerCase();
4119
+ const cssPath = `${prefix}/theme/components/${componentName}/index.css`;
4120
+ if (process.env.NODE_ENV === "development") {
4121
+ try {
4122
+ const localThemePath = path.resolve(__dirname, `../themes/components/${componentName}/index.less`);
4123
+ if (!fs.existsSync(localThemePath)) {
4124
+ console.warn(`[TouchVue Resolver] \u7EC4\u4EF6 ${name} \u7684\u6837\u5F0F\u6587\u4EF6\u4E0D\u5B58\u5728: ${localThemePath}`);
4125
+ return false;
4126
+ }
4127
+ } catch (error) {
4128
+ console.warn(`[TouchVue Resolver] \u68C0\u67E5\u6837\u5F0F\u6587\u4EF6\u65F6\u51FA\u9519:`, error);
4129
+ return false;
4130
+ }
4131
+ }
4132
+ return cssPath;
4133
+ };
4134
+ function TouchVueResolver() {
4135
+ return {
4136
+ type: "component",
4137
+ resolve: (name) => {
4138
+ if (!isValidComponentName(name))
4139
+ return;
4140
+ const sideEffects = getSideEffectsPath(name);
4141
+ const result = {
4142
+ name,
4143
+ from: LIBRARY_NAME
4144
+ };
4145
+ if (sideEffects !== false) {
4146
+ result.sideEffects = sideEffects;
4147
+ }
4148
+ return result;
4149
+ }
4150
+ };
4151
+ }
4152
+
4153
+ const defaultOptions = {};
4154
+ exports.globalOptions = { ...defaultOptions };
4155
+ const getGlobalOptions = () => {
4156
+ return exports.globalOptions;
4157
+ };
4158
+ const components = [
4159
+ ToButton,
4160
+ ToIcon,
4161
+ ToArticle,
4162
+ ToBox,
4163
+ ToSelect,
4164
+ ToCalendar,
4165
+ ToSpace,
4166
+ ToStep,
4167
+ ToForm,
4168
+ ToFormItem,
4169
+ ToGrid,
4170
+ ToGridItem,
4171
+ ToHeader,
4172
+ ToInput,
4173
+ ToLine,
4174
+ ToMsg,
4175
+ ToPadding,
4176
+ ToPage,
4177
+ ToCard,
4178
+ ToCheckbox,
4179
+ ToDatepikcer,
4180
+ ToSwitch,
4181
+ ToTab,
4182
+ ToTabItem,
4183
+ ToTable,
4184
+ ToTableHead,
4185
+ ToTableBody,
4186
+ ToTableConfig
4187
+ ];
4188
+ const install = (app, options = {}) => {
4189
+ exports.globalOptions = {
4190
+ ...defaultOptions,
4191
+ ...options
4192
+ };
4193
+ app.config.globalProperties.$hello = () => console.log("Hello from plugin!");
4194
+ app.config.globalProperties.$getEm = getEm;
4195
+ app.config.globalProperties.$setMedia = setMedia;
4196
+ app.config.globalProperties.$getMedia = getMedia;
4197
+ const media = getMedia();
4198
+ app.config.globalProperties.$phone = media === "phone";
4199
+ app.config.globalProperties.$pad = media === "pad";
4200
+ app.config.globalProperties.$pc = media === "pc";
4201
+ setMedia(options);
4202
+ setRatio(options);
4203
+ components.forEach((component) => {
4204
+ app.use(component);
4205
+ });
4206
+ InstallDirective.install(app);
4207
+ };
4208
+ var index = {
4209
+ install
4210
+ };
4211
+
4212
+ exports.Article = Article;
4213
+ exports.Box = Box;
4214
+ exports.Icon = Icon;
4215
+ exports.ToArticle = ToArticle;
4216
+ exports.ToBox = ToBox;
4217
+ exports.ToButton = ToButton;
4218
+ exports.ToCalendar = ToCalendar;
4219
+ exports.ToCard = ToCard;
4220
+ exports.ToCheckbox = ToCheckbox;
4221
+ exports.ToDatepikcer = ToDatepikcer;
4222
+ exports.ToForm = ToForm;
4223
+ exports.ToFormItem = ToFormItem;
4224
+ exports.ToGrid = ToGrid;
4225
+ exports.ToGridItem = ToGridItem;
4226
+ exports.ToHeader = ToHeader;
4227
+ exports.ToIcon = ToIcon;
4228
+ exports.ToInput = ToInput;
4229
+ exports.ToLine = ToLine;
4230
+ exports.ToMsg = ToMsg;
4231
+ exports.ToPadding = ToPadding;
4232
+ exports.ToPage = ToPage;
4233
+ exports.ToSelect = ToSelect;
4234
+ exports.ToSpace = ToSpace;
4235
+ exports.ToStep = ToStep;
4236
+ exports.ToSwitch = ToSwitch;
4237
+ exports.ToTab = ToTab;
4238
+ exports.ToTabItem = ToTabItem;
4239
+ exports.ToTable = ToTable;
4240
+ exports.ToTableBody = ToTableBody;
4241
+ exports.ToTableConfig = ToTableConfig;
4242
+ exports.ToTableHead = ToTableHead;
4243
+ exports.TouchVueResolver = TouchVueResolver;
4244
+ exports.articleProps = articleProps;
4245
+ exports.boxProps = boxProps;
4246
+ exports.default = index;
4247
+ exports.defaultOptions = defaultOptions;
4248
+ exports.dis = dis;
4249
+ exports.getGlobalOptions = getGlobalOptions;
4250
+ exports.sizeDirective = sizeDirective;
4251
+ //# sourceMappingURL=index.js.map