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