@pixelium/web-vue 0.0.2-fix → 0.0.3-beta

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 (285) hide show
  1. package/README.md +42 -0
  2. package/README.zh.md +6 -3
  3. package/coverage/base.css +224 -0
  4. package/coverage/block-navigation.js +87 -0
  5. package/coverage/coverage-final.json +106 -0
  6. package/coverage/favicon.png +0 -0
  7. package/coverage/index.html +926 -0
  8. package/coverage/prettify.css +1 -0
  9. package/coverage/prettify.js +2 -0
  10. package/coverage/sort-arrow-sprite.png +0 -0
  11. package/coverage/sorter.js +210 -0
  12. package/dist/font.css +1 -1
  13. package/dist/index.d.ts +1593 -248
  14. package/dist/normalize.css +2 -0
  15. package/dist/pixelium-vue-icon-hn.cjs +1 -1
  16. package/dist/pixelium-vue-icon-hn.css +2 -1
  17. package/dist/pixelium-vue-icon-hn.js +8533 -8154
  18. package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
  19. package/dist/pixelium-vue-icon-pa.cjs +1 -1
  20. package/dist/pixelium-vue-icon-pa.css +2 -1
  21. package/dist/pixelium-vue-icon-pa.js +10625 -10143
  22. package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
  23. package/dist/pixelium-vue.cjs +2 -2
  24. package/dist/pixelium-vue.css +2 -1
  25. package/dist/pixelium-vue.js +7402 -5854
  26. package/dist/pixelium-vue.umd.cjs +2 -2
  27. package/es/aside/index.js +46 -151
  28. package/es/auto-complete/draw.d.ts +1 -1
  29. package/es/auto-complete/draw.js +26 -51
  30. package/es/auto-complete/index.css +92 -32
  31. package/es/auto-complete/index.d.ts +12 -15
  32. package/es/auto-complete/index.js +338 -400
  33. package/es/auto-complete/type.d.ts +25 -13
  34. package/es/avatar/css.js +2 -0
  35. package/es/avatar/draw.d.ts +2 -0
  36. package/es/avatar/draw.js +11 -0
  37. package/es/avatar/index.css +49 -0
  38. package/es/avatar/index.d.ts +15 -0
  39. package/es/avatar/index.js +110 -0
  40. package/es/avatar/type.d.ts +34 -0
  41. package/es/button/draw.d.ts +4 -4
  42. package/es/button/draw.js +213 -297
  43. package/es/button/index.css +40 -30
  44. package/es/button/index.d.ts +0 -4
  45. package/es/button/index.js +230 -256
  46. package/es/button/type.d.ts +3 -3
  47. package/es/button-group/index.css +0 -3
  48. package/es/button-group/index.d.ts +1 -2
  49. package/es/button-group/index.js +59 -31
  50. package/es/button-group/type.d.ts +21 -4
  51. package/es/checkbox/css.js +2 -0
  52. package/es/checkbox/draw.d.ts +4 -0
  53. package/es/checkbox/draw.js +46 -0
  54. package/es/checkbox/index.css +85 -0
  55. package/es/checkbox/index.d.ts +31 -0
  56. package/es/checkbox/index.js +206 -0
  57. package/es/checkbox/type.d.ts +88 -0
  58. package/es/checkbox-group/css.js +2 -0
  59. package/es/checkbox-group/index.css +20 -0
  60. package/es/checkbox-group/index.d.ts +23 -0
  61. package/es/checkbox-group/index.js +84 -0
  62. package/es/checkbox-group/type.d.ts +78 -0
  63. package/es/col/index.d.ts +2 -2
  64. package/es/col/index.js +43 -58
  65. package/es/container/index.js +18 -31
  66. package/es/divider/index.js +39 -53
  67. package/es/empty/index.css +4 -4
  68. package/es/empty/index.js +16 -71
  69. package/es/entry.js +102 -0
  70. package/es/footer/index.js +31 -40
  71. package/es/form/css.js +1 -0
  72. package/es/form/index.d.ts +27 -0
  73. package/es/form/index.js +125 -0
  74. package/es/form/type.d.ts +238 -0
  75. package/es/form/use-form.d.ts +4 -0
  76. package/es/form/use-form.js +48 -0
  77. package/es/form-item/css.js +2 -0
  78. package/es/form-item/index.css +77 -0
  79. package/es/form-item/index.d.ts +37 -0
  80. package/es/form-item/index.js +318 -0
  81. package/es/form-item/type.d.ts +96 -0
  82. package/es/grid/index.js +56 -75
  83. package/es/grid-item/css.js +0 -1
  84. package/es/grid-item/index.d.ts +1 -1
  85. package/es/grid-item/index.js +85 -121
  86. package/es/header/index.js +31 -40
  87. package/es/icon/index.js +44 -55
  88. package/es/icons/css-hn.js +0 -1
  89. package/es/icons/css-pa.js +0 -1
  90. package/es/icons/icon-hn.js +10337 -15986
  91. package/es/icons/icon-pa.js +12573 -17447
  92. package/es/image/css.js +2 -0
  93. package/es/image/index.css +69 -0
  94. package/es/image/index.d.ts +35 -0
  95. package/es/image/index.js +199 -0
  96. package/es/image/type.d.ts +126 -0
  97. package/es/index.css +1 -515
  98. package/es/index.d.ts +22 -2
  99. package/es/index.js +143 -123
  100. package/es/input/draw.d.ts +1 -1
  101. package/es/input/draw.js +26 -51
  102. package/es/input/index.css +85 -33
  103. package/es/input/index.d.ts +9 -16
  104. package/es/input/index.js +319 -423
  105. package/es/input/type.d.ts +3 -3
  106. package/es/input-group/index.css +0 -1
  107. package/es/input-group/index.d.ts +2 -2
  108. package/es/input-group/index.js +66 -37
  109. package/es/input-group/type.d.ts +16 -4
  110. package/es/input-group-label/draw.d.ts +1 -1
  111. package/es/input-group-label/draw.js +26 -51
  112. package/es/input-group-label/index.css +33 -22
  113. package/es/input-group-label/index.d.ts +1 -4
  114. package/es/input-group-label/index.js +104 -127
  115. package/es/input-group-label/type.d.ts +3 -3
  116. package/es/input-number/draw.d.ts +1 -1
  117. package/es/input-number/draw.js +26 -51
  118. package/es/input-number/index.css +90 -35
  119. package/es/input-number/index.d.ts +9 -16
  120. package/es/input-number/index.js +428 -536
  121. package/es/input-number/type.d.ts +3 -3
  122. package/es/input-tag/draw.d.ts +1 -1
  123. package/es/input-tag/draw.js +26 -48
  124. package/es/input-tag/index.css +100 -33
  125. package/es/input-tag/index.d.ts +7 -13
  126. package/es/input-tag/index.js +442 -467
  127. package/es/input-tag/type.d.ts +24 -13
  128. package/es/link/index.js +75 -106
  129. package/es/main/index.js +11 -15
  130. package/es/mask/index.js +94 -115
  131. package/es/message/index.css +1 -1
  132. package/es/message/index.js +168 -346
  133. package/es/message-box/css.js +1 -1
  134. package/es/message-box/index.js +98 -114
  135. package/es/message-box/message-box-wrapped.js +33 -46
  136. package/es/message-box/message-box.js +79 -111
  137. package/es/option-list/index.css +13 -13
  138. package/es/option-list/index.d.ts +4 -31
  139. package/es/option-list/index.js +99 -167
  140. package/es/option-list/type.d.ts +5 -1
  141. package/es/pixelate/pixel.d.ts +5 -0
  142. package/es/pixelate/pixel.js +70 -0
  143. package/es/pixelate/pixelate.worker.d.ts +1 -0
  144. package/es/popover/index.d.ts +13 -99
  145. package/es/popover/index.js +75 -238
  146. package/es/popover/type.d.ts +7 -2
  147. package/es/popup/css.js +1 -0
  148. package/es/popup/index.d.ts +210 -0
  149. package/es/popup/index.js +203 -0
  150. package/es/popup/type.d.ts +105 -0
  151. package/es/popup-content/draw.d.ts +2 -2
  152. package/es/popup-content/draw.js +98 -143
  153. package/es/popup-content/index.css +11 -11
  154. package/es/popup-content/index.d.ts +1 -0
  155. package/es/popup-content/index.js +253 -1576
  156. package/es/popup-content/type.d.ts +1 -0
  157. package/es/popup-trigger/index.d.ts +8 -2
  158. package/es/popup-trigger/index.js +122 -95
  159. package/es/popup-trigger/type.d.ts +4 -1
  160. package/es/popup-wrapper/css.js +2 -0
  161. package/es/popup-wrapper/index.css +14 -0
  162. package/es/popup-wrapper/index.d.ts +18 -0
  163. package/es/popup-wrapper/index.js +67 -0
  164. package/es/popup-wrapper/type.d.ts +9 -0
  165. package/es/radio/css.js +1 -0
  166. package/es/radio/draw.d.ts +4 -0
  167. package/es/radio/draw.js +47 -0
  168. package/es/radio/index.d.ts +30 -0
  169. package/es/radio/index.js +190 -0
  170. package/es/radio/style.css +73 -0
  171. package/es/radio/type.d.ts +76 -0
  172. package/es/radio-group/css.js +2 -0
  173. package/es/radio-group/index.css +20 -0
  174. package/es/radio-group/index.d.ts +23 -0
  175. package/es/radio-group/index.js +77 -0
  176. package/es/radio-group/type.d.ts +77 -0
  177. package/es/row/index.js +56 -70
  178. package/es/select/draw.d.ts +1 -1
  179. package/es/select/draw.js +26 -51
  180. package/es/select/index.css +118 -36
  181. package/es/select/index.d.ts +14 -16
  182. package/es/select/index.js +625 -675
  183. package/es/select/type.d.ts +60 -25
  184. package/es/share/const/event-bus-key.js +1 -6
  185. package/es/share/const/index.d.ts +4 -0
  186. package/es/share/const/index.js +22 -24
  187. package/es/share/const/provide-key.d.ts +5 -0
  188. package/es/share/const/provide-key.js +6 -5
  189. package/es/share/const/style.d.ts +6 -0
  190. package/es/share/const/style.js +7 -0
  191. package/es/share/hook/use-cancelable-delay.d.ts +1 -0
  192. package/es/share/hook/use-cancelable-delay.js +42 -0
  193. package/es/share/hook/use-click-outside-listener.d.ts +1 -1
  194. package/es/share/hook/use-click-outside-listener.js +28 -41
  195. package/es/share/hook/use-composition.js +17 -15
  196. package/es/share/hook/use-controlled-mode.d.ts +3 -3
  197. package/es/share/hook/use-controlled-mode.js +20 -23
  198. package/es/share/hook/use-dark-mode.js +51 -65
  199. package/es/share/hook/use-index-of-children.d.ts +2 -1
  200. package/es/share/hook/use-index-of-children.js +47 -45
  201. package/es/share/hook/use-lazy-load.d.ts +10 -0
  202. package/es/share/hook/use-lazy-load.js +133 -0
  203. package/es/share/hook/use-props-detect.d.ts +2 -0
  204. package/es/share/hook/use-resize-observer.d.ts +1 -2
  205. package/es/share/hook/use-resize-observer.js +28 -20
  206. package/es/share/hook/use-screen-width.js +27 -36
  207. package/es/share/hook/use-smooth-transition.d.ts +2 -0
  208. package/es/share/hook/use-smooth-transition.js +65 -0
  209. package/es/share/hook/use-textarea-height.js +86 -92
  210. package/es/share/hook/use-theme-mode.js +41 -42
  211. package/es/share/hook/use-transition-end.d.ts +2 -0
  212. package/es/share/hook/use-transition-end.js +12 -0
  213. package/es/share/hook/use-watch-global-css-var.js +12 -16
  214. package/es/share/hook/use-window-resize-listener.d.ts +1 -0
  215. package/es/share/hook/use-window-resize-listener.js +15 -0
  216. package/es/share/hook/use-z-index.js +30 -27
  217. package/es/share/type/index.d.ts +18 -3
  218. package/es/share/util/color.d.ts +5 -3
  219. package/es/share/util/color.js +156 -149
  220. package/es/share/util/common.d.ts +7 -2
  221. package/es/share/util/common.js +127 -65
  222. package/es/share/util/console.d.ts +3 -3
  223. package/es/share/util/console.js +10 -7
  224. package/es/share/util/dom.d.ts +19 -0
  225. package/es/share/util/dom.js +88 -0
  226. package/es/share/util/env.d.ts +1 -0
  227. package/es/share/util/env.js +5 -4
  228. package/es/share/util/event-bus.js +3 -20
  229. package/es/share/util/lru-cache.js +29 -33
  230. package/es/share/util/pixel.d.ts +4 -0
  231. package/es/share/util/plot.d.ts +8 -3
  232. package/es/share/util/plot.js +457 -229
  233. package/es/share/util/reactivity.d.ts +8 -0
  234. package/es/share/util/reactivity.js +23 -0
  235. package/es/share/util/render.js +31 -41
  236. package/es/share/util/theme.d.ts +3 -0
  237. package/es/share/util/theme.js +77 -57
  238. package/es/slider/css.js +2 -0
  239. package/es/slider/draw.d.ts +25 -0
  240. package/es/slider/draw.js +113 -0
  241. package/es/slider/index.css +119 -0
  242. package/es/slider/index.d.ts +66 -0
  243. package/es/slider/index.js +503 -0
  244. package/es/slider/type.d.ts +162 -0
  245. package/es/slider/util.d.ts +37 -0
  246. package/es/slider/util.js +130 -0
  247. package/es/space/index.css +24 -29
  248. package/es/space/index.js +73 -97
  249. package/es/spin/index.css +18 -17
  250. package/es/spin/index.js +72 -102
  251. package/es/spin/type.d.ts +11 -5
  252. package/es/switch/css.js +2 -0
  253. package/es/switch/draw.d.ts +2 -0
  254. package/es/switch/draw.js +18 -0
  255. package/es/switch/index.css +121 -0
  256. package/es/switch/index.d.ts +42 -0
  257. package/es/switch/index.js +259 -0
  258. package/es/switch/type.d.ts +133 -0
  259. package/es/tag/draw.d.ts +2 -2
  260. package/es/tag/draw.js +80 -127
  261. package/es/tag/index.css +38 -22
  262. package/es/tag/index.d.ts +2 -2
  263. package/es/tag/index.js +121 -190
  264. package/es/tag/type.d.ts +3 -3
  265. package/es/text-outline/css.js +2 -0
  266. package/es/text-outline/index.css +4 -0
  267. package/es/text-outline/index.d.ts +17 -0
  268. package/es/text-outline/index.js +33 -0
  269. package/es/text-outline/type.d.ts +23 -0
  270. package/es/textarea/draw.js +9 -11
  271. package/es/textarea/index.css +37 -23
  272. package/es/textarea/index.d.ts +8 -14
  273. package/es/textarea/index.js +274 -262
  274. package/es/tooltip/index.d.ts +100 -4
  275. package/es/tooltip/index.js +70 -226
  276. package/es/tooltip/type.d.ts +7 -2
  277. package/es/vendor.js +504 -0
  278. package/es/virtual-list/css.js +2 -0
  279. package/es/virtual-list/index.css +25 -0
  280. package/es/virtual-list/index.d.ts +11 -0
  281. package/es/virtual-list/index.js +313 -0
  282. package/es/virtual-list/type.d.ts +26 -0
  283. package/package.json +10 -16
  284. package/es/grid-item/index.css +0 -0
  285. /package/es/message-box/{message-box.css → index.css} +0 -0
@@ -1,474 +1,449 @@
1
1
  import './css.js'
2
- import { defineComponent, getCurrentInstance, ref, inject, computed, shallowRef, useSlots, watch, onMounted, nextTick, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, unref, renderSlot, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString, createVNode, withKeys, withModifiers } from "vue";
3
- import { u as useResizeObserver } from "../share/hook/use-resize-observer.js";
4
- import { d as drawBorder } from "./draw.js";
5
- import { g as getGlobalThemeColor } from "../share/util/color.js";
6
- import { a as canvasPreprocess, c as calcPixelSize, g as getBorderRadius, b as calcBorderCornerCenter, f as floodFill } from "../share/util/plot.js";
7
- import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
8
- import { u as useComposition } from "../share/hook/use-composition.js";
9
- import { T as TimesCircleSolid, S as SpinnerThirdSolid } from "../auto-complete/index.js";
10
- import { u as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
11
- import { _ as _sfc_main$1 } from "../input-group/index.js";
12
- import { I as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
13
- import { u as useIndexOfChildren } from "../share/hook/use-index-of-children.js";
14
- import { I as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
15
- import { _ as _sfc_main$2 } from "../tag/index.js";
16
- import { k, $ } from "../aside/index.js";
17
- import { _ as _sfc_main$3 } from "../popover/index.js";
18
- import { B as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
19
- import { u as useControlledMode } from "../share/hook/use-controlled-mode.js";
20
- const _hoisted_1 = {
21
- key: 0,
22
- class: "px-input-tag-prefix-wrapper"
2
+ import { D as S, V as spinner_third_solid_default, g as A, l as times_circle_solid_default } from "../vendor.js";
3
+ import { o as POPUP_CONTENT_DEFAULT_MAX_WIDTH, t as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
4
+ import { i as canvasPreprocess, l as getBorderRadius, n as calcPixelSize, s as floodFill, t as calcBorderCornerCenter } from "../share/util/plot.js";
5
+ import { n as getGlobalThemeColor } from "../share/util/color.js";
6
+ import { t as useDarkMode } from "../share/hook/use-dark-mode.js";
7
+ import { t as useResizeObserver } from "../share/hook/use-resize-observer.js";
8
+ import { i as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
9
+ import { t as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
10
+ import { n as useIndexOfChildren } from "../share/hook/use-index-of-children.js";
11
+ import { i as FORM_ITEM_PROVIDE, s as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
12
+ import { t as createProvideComputed } from "../share/util/reactivity.js";
13
+ import { t as useTransitionEnd } from "../share/hook/use-transition-end.js";
14
+ import { t as useComposition } from "../share/hook/use-composition.js";
15
+ import { t as useControlledMode } from "../share/hook/use-controlled-mode.js";
16
+ import { t as tag_default } from "../tag/index.js";
17
+ import { t as drawBorder } from "./draw.js";
18
+ import { t as popover_default } from "../popover/index.js";
19
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, useSlots, watch, withCtx, withKeys, withModifiers } from "vue";
20
+ var _hoisted_1 = {
21
+ key: 0,
22
+ class: "px-input-tag-prefix-wrapper"
23
23
  };
24
- const _hoisted_2 = { class: "px-input-tag-content" };
25
- const _hoisted_3 = { class: "px-input-tag-content" };
26
- const _hoisted_4 = ["value", "placeholder", "disabled", "autofocus"];
27
- const _hoisted_5 = {
28
- key: 1,
29
- class: "px-input-tag-close-wrapper"
24
+ var _hoisted_2 = { class: "px-input-tag-content" };
25
+ var _hoisted_3 = { class: "px-input-tag-content" };
26
+ var _hoisted_4 = [
27
+ "value",
28
+ "placeholder",
29
+ "disabled",
30
+ "autofocus"
31
+ ];
32
+ var _hoisted_5 = {
33
+ key: 1,
34
+ class: "px-input-tag-close-wrapper"
30
35
  };
31
- const _hoisted_6 = {
32
- key: 1,
33
- class: "px-input-tag-icon-placeholder"
36
+ var _hoisted_6 = {
37
+ key: 1,
38
+ class: "px-input-tag-icon-placeholder"
34
39
  };
35
- const _hoisted_7 = {
36
- key: 2,
37
- class: "px-input-tag-loading-wrapper"
40
+ var _hoisted_7 = {
41
+ key: 2,
42
+ class: "px-input-tag-loading-wrapper"
38
43
  };
39
- const _hoisted_8 = {
40
- key: 3,
41
- class: "px-input-tag-suffix-wrapper"
44
+ var _hoisted_8 = {
45
+ key: 3,
46
+ class: "px-input-tag-suffix-wrapper"
42
47
  };
43
- const _sfc_main = /* @__PURE__ */ defineComponent({
44
- ...{
45
- name: "InputTag"
46
- },
47
- __name: "index",
48
- props: {
49
- modelValue: null,
50
- defaultValue: null,
51
- inputValue: null,
52
- defaultInputValue: null,
53
- placeholder: null,
54
- disabled: { type: Boolean, default: false },
55
- readonly: { type: Boolean, default: false },
56
- clearable: { type: Boolean, default: false },
57
- loading: { type: Boolean, default: false },
58
- size: { default: "medium" },
59
- shape: { default: "default" },
60
- borderRadius: null,
61
- maxLength: null,
62
- collapseTags: { type: Boolean, default: false },
63
- maxDisplayTags: null,
64
- collapseTagsPopover: { type: Boolean, default: true },
65
- tagTheme: { default: "info" },
66
- tagVariant: { default: "plain" },
67
- tagColor: null,
68
- status: { default: "normal" },
69
- autofocus: { type: Boolean }
70
- },
71
- emits: ["update:modelValue", "tagAdd", "tagClose", "change", "input", "update:inputValue", "inputChange", "clear", "blur", "focus"],
72
- setup(__props, { expose: __expose, emit: __emit }) {
73
- var _a;
74
- const props = __props;
75
- const emits = __emit;
76
- const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({
77
- afterComposition: (e) => {
78
- nextTick(() => {
79
- inputHandler(e);
80
- });
81
- }
82
- });
83
- const instance = getCurrentInstance();
84
- const innerInputGroup = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
85
- const [_, first, last] = innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE) : [ref(0), ref(false), ref(false)];
86
- const inputGroupProps = inject(INPUT_GROUP_PROVIDE);
87
- const borderRadiusComputed = computed(() => {
88
- return innerInputGroup.value && inputGroupProps ? inputGroupProps.borderRadius : props.borderRadius;
89
- });
90
- const sizeComputed = computed(() => {
91
- return innerInputGroup.value && inputGroupProps ? inputGroupProps.size : props.size;
92
- });
93
- const shapeComputed = computed(() => {
94
- return innerInputGroup.value && inputGroupProps ? inputGroupProps.shape : props.shape;
95
- });
96
- const disabledComputed = computed(() => {
97
- return innerInputGroup.value && inputGroupProps ? inputGroupProps.disabled || props.disabled : props.disabled;
98
- });
99
- const tagSize = computed(() => {
100
- return sizeComputed.value === "small" ? "small" : "medium";
101
- });
102
- const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
103
- defaultField: "defaultValue",
104
- transform: (value) => {
105
- if ($(value)) {
106
- return [...value];
107
- }
108
- return [];
109
- }
110
- });
111
- const [inputValue, updateInputValue] = useControlledMode("inputValue", props, emits, {
112
- defaultField: "defaultInputValue",
113
- transform: (value) => {
114
- return value || "";
115
- }
116
- });
117
- const wrapperRef = shallowRef(null);
118
- const canvasRef = shallowRef(null);
119
- const inputRef = shallowRef(null);
120
- const inputHandler = async (e) => {
121
- const target = e.target;
122
- const newValue = target.value;
123
- inputValue.value = newValue;
124
- if (isComposing.value) {
125
- return;
126
- }
127
- emits("input", newValue, e);
128
- updateInputValue(newValue);
129
- };
130
- const clearHandler = async () => {
131
- const newTags = [];
132
- await updateModelValue(newTags);
133
- await updateInputValue("");
134
- emits("clear", newTags);
135
- emits("change", newTags);
136
- emits("inputChange", "");
137
- };
138
- const tagCloseHandler = async (index, e) => {
139
- const currentTags = modelValue.value ? [...modelValue.value] : [];
140
- const closed = currentTags.splice(index, 1);
141
- await updateModelValue(currentTags);
142
- emits("tagClose", closed[0], index, e);
143
- emits("change", currentTags);
144
- };
145
- const inputChangeHandler = (e) => {
146
- const target = e.target;
147
- emits("inputChange", target.value, e);
148
- };
149
- const focusMode = ref(false);
150
- const blurHandler = async () => {
151
- focusMode.value = false;
152
- await updateInputValue("");
153
- emits("inputChange", "");
154
- };
155
- const focusHandler = () => {
156
- focusMode.value = true;
157
- };
158
- const enterDownHandler = async (e) => {
159
- const currentValue = (inputValue.value || "").trim();
160
- if (!currentValue || props.maxLength && modelValue.value && modelValue.value.length >= props.maxLength) {
161
- return;
162
- }
163
- const currentTags = modelValue.value ? [...modelValue.value] : [];
164
- currentTags.push(currentValue);
165
- await updateModelValue(currentTags);
166
- await updateInputValue("");
167
- emits("tagAdd", currentValue, e);
168
- emits("change", currentTags);
169
- emits("inputChange", "");
170
- };
171
- const focusInputHandler = () => {
172
- var _a2;
173
- (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
174
- };
175
- const hoverFlag = ref(false);
176
- const mouseenterHandler = () => {
177
- hoverFlag.value = true;
178
- };
179
- const mouseleaveHandler = () => {
180
- hoverFlag.value = false;
181
- };
182
- const showClose = computed(() => {
183
- return props.clearable && !disabledComputed.value && !props.readonly;
184
- });
185
- const tagCanClose = computed(() => {
186
- return !disabledComputed.value && !props.readonly;
187
- });
188
- const slots = useSlots();
189
- __expose({
190
- focus: () => {
191
- var _a2;
192
- (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
193
- },
194
- blur: () => {
195
- var _a2;
196
- (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
197
- },
198
- clear: () => clearHandler()
199
- });
200
- const shouldCollapseTags = computed(() => {
201
- return !!props.collapseTags && k(props.maxDisplayTags) && props.maxDisplayTags >= 0;
202
- });
203
- const tagsShowed = computed(() => {
204
- return modelValue.value ? shouldCollapseTags.value ? modelValue.value.slice(0, props.maxDisplayTags) : modelValue.value : [];
205
- });
206
- const tagsCollapsed = computed(() => {
207
- return modelValue.value ? shouldCollapseTags.value ? modelValue.value.slice(props.maxDisplayTags) : [] : [];
208
- });
209
- const darkMode = useDarkMode();
210
- watch(
211
- [
212
- first,
213
- last,
214
- borderRadiusComputed,
215
- shapeComputed,
216
- sizeComputed,
217
- disabledComputed,
218
- () => slots,
219
- darkMode,
220
- focusMode,
221
- hoverFlag
222
- ],
223
- () => {
224
- setTimeout(() => {
225
- drawPixel();
226
- });
227
- }
228
- );
229
- const drawPixel = () => {
230
- const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
231
- if (!preprocessData) {
232
- return;
233
- }
234
- const { ctx, width, height, canvas } = preprocessData;
235
- const pixelSize = calcPixelSize();
236
- const borderRadius = getBorderRadius(
237
- canvas,
238
- pixelSize,
239
- borderRadiusComputed.value,
240
- shapeComputed.value,
241
- sizeComputed.value || "medium",
242
- innerInputGroup.value,
243
- first.value,
244
- last.value
245
- );
246
- const borderColor = props.status !== "normal" ? getGlobalThemeColor(props.status === "error" ? "danger" : props.status, 6) : (hoverFlag.value || focusMode.value) && !disabledComputed.value && !props.readonly ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
247
- const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize);
248
- const rad = BORDER_CORNER_RAD_RANGE;
249
- drawBorder(
250
- ctx,
251
- width,
252
- height,
253
- center,
254
- borderRadius,
255
- rad,
256
- borderColor,
257
- pixelSize,
258
- innerInputGroup.value,
259
- first.value,
260
- last.value
261
- );
262
- const backgroundColor = disabledComputed.value ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
263
- floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
264
- };
265
- onMounted(() => {
266
- nextTick(() => {
267
- drawPixel();
268
- });
269
- });
270
- useResizeObserver(wrapperRef, drawPixel);
271
- useWatchGlobalCssVal(drawPixel);
272
- return (_ctx, _cache) => {
273
- var _a2;
274
- return openBlock(), createElementBlock(
275
- "div",
276
- {
277
- class: normalizeClass(["pixelium px-input-tag", {
278
- [`px-input-tag__${sizeComputed.value}`]: !!sizeComputed.value,
279
- [`px-input-tag__${shapeComputed.value}`]: !!shapeComputed.value,
280
- "px-input-tag__inner": innerInputGroup.value,
281
- "px-input-tag__disabled": !!disabledComputed.value
282
- }]),
283
- ref_key: "wrapperRef",
284
- ref: wrapperRef,
285
- onClick: focusInputHandler,
286
- onMouseenter: mouseenterHandler,
287
- onMouseleave: mouseleaveHandler
288
- },
289
- [
290
- unref(slots).prefix ? (openBlock(), createElementBlock("div", _hoisted_1, [
291
- renderSlot(_ctx.$slots, "prefix")
292
- ])) : createCommentVNode("v-if", true),
293
- createElementVNode("div", _hoisted_2, [
294
- (openBlock(true), createElementBlock(
295
- Fragment,
296
- null,
297
- renderList(tagsShowed.value, (tag, index) => {
298
- return openBlock(), createBlock(_sfc_main$2, {
299
- key: index,
300
- size: tagSize.value,
301
- variant: props.tagVariant,
302
- theme: props.tagTheme,
303
- closable: tagCanClose.value,
304
- disabled: disabledComputed.value,
305
- color: props.tagColor,
306
- onClose: (e) => tagCloseHandler(index, e)
307
- }, {
308
- default: withCtx(() => [
309
- renderSlot(_ctx.$slots, "tag", {
310
- tag,
311
- index
312
- }, () => [
313
- createTextVNode(
314
- toDisplayString(tag),
315
- 1
316
- /* TEXT */
317
- )
318
- ])
319
- ]),
320
- _: 2
321
- /* DYNAMIC */
322
- }, 1032, ["size", "variant", "theme", "closable", "disabled", "color", "onClose"]);
323
- }),
324
- 128
325
- /* KEYED_FRAGMENT */
326
- )),
327
- tagsCollapsed.value.length && shouldCollapseTags.value ? (openBlock(), createElementBlock(
328
- Fragment,
329
- { key: 0 },
330
- [
331
- !props.collapseTagsPopover ? (openBlock(), createBlock(_sfc_main$2, {
332
- key: 0,
333
- size: tagSize.value,
334
- variant: props.tagVariant,
335
- theme: props.tagTheme,
336
- disabled: disabledComputed.value,
337
- color: props.tagColor
338
- }, {
339
- default: withCtx(() => [
340
- renderSlot(_ctx.$slots, "tag", {
341
- tag: `+${tagsCollapsed.value.length}`,
342
- index: -1
343
- }, () => [
344
- createTextVNode(
345
- "+" + toDisplayString(tagsCollapsed.value.length),
346
- 1
347
- /* TEXT */
348
- )
349
- ])
350
- ]),
351
- _: 3
352
- /* FORWARDED */
353
- }, 8, ["size", "variant", "theme", "disabled", "color"])) : (openBlock(), createBlock(_sfc_main$3, { key: 1 }, {
354
- content: withCtx(() => [
355
- createElementVNode("div", _hoisted_3, [
356
- (openBlock(true), createElementBlock(
357
- Fragment,
358
- null,
359
- renderList(tagsCollapsed.value, (tag, index) => {
360
- return openBlock(), createBlock(_sfc_main$2, {
361
- key: index,
362
- size: tagSize.value,
363
- variant: props.tagVariant,
364
- theme: props.tagTheme,
365
- closable: tagCanClose.value,
366
- disabled: disabledComputed.value,
367
- color: props.tagColor,
368
- onClose: (e) => tagCloseHandler(index + Math.floor(props.maxDisplayTags), e)
369
- }, {
370
- default: withCtx(() => [
371
- renderSlot(_ctx.$slots, "tag", {
372
- tag,
373
- index: index + Math.floor(props.maxDisplayTags)
374
- }, () => [
375
- createTextVNode(
376
- toDisplayString(tag),
377
- 1
378
- /* TEXT */
379
- )
380
- ])
381
- ]),
382
- _: 2
383
- /* DYNAMIC */
384
- }, 1032, ["size", "variant", "theme", "closable", "disabled", "color", "onClose"]);
385
- }),
386
- 128
387
- /* KEYED_FRAGMENT */
388
- ))
389
- ])
390
- ]),
391
- default: withCtx(() => [
392
- createVNode(_sfc_main$2, {
393
- size: tagSize.value,
394
- variant: props.tagVariant,
395
- theme: props.tagTheme,
396
- disabled: disabledComputed.value,
397
- color: props.tagColor
398
- }, {
399
- default: withCtx(() => [
400
- renderSlot(_ctx.$slots, "tag", {
401
- tag: `+${tagsCollapsed.value.length}`,
402
- index: -1
403
- }, () => [
404
- createTextVNode(
405
- "+" + toDisplayString(tagsCollapsed.value.length),
406
- 1
407
- /* TEXT */
408
- )
409
- ])
410
- ]),
411
- _: 3
412
- /* FORWARDED */
413
- }, 8, ["size", "variant", "theme", "disabled", "color"])
414
- ]),
415
- _: 3
416
- /* FORWARDED */
417
- }))
418
- ],
419
- 64
420
- /* STABLE_FRAGMENT */
421
- )) : createCommentVNode("v-if", true),
422
- createElementVNode("input", {
423
- class: "px-input-tag-inner",
424
- value: unref(inputValue),
425
- ref_key: "inputRef",
426
- ref: inputRef,
427
- placeholder: unref(modelValue) && unref(modelValue).length ? "" : props.placeholder,
428
- disabled: disabledComputed.value || props.readonly,
429
- autofocus: __props.autofocus,
430
- onInput: withModifiers(inputHandler, ["stop"]),
431
- onChange: withModifiers(inputChangeHandler, ["stop"]),
432
- onBlur: blurHandler,
433
- onFocus: focusHandler,
434
- onCompositionstart: _cache[0] || (_cache[0] = //@ts-ignore
435
- (...args) => unref(compositionStartHandler) && unref(compositionStartHandler)(...args)),
436
- onCompositionend: _cache[1] || (_cache[1] = //@ts-ignore
437
- (...args) => unref(compositionUpdateHandler) && unref(compositionUpdateHandler)(...args)),
438
- onKeydown: withKeys(enterDownHandler, ["enter"])
439
- }, null, 40, _hoisted_4)
440
- ]),
441
- showClose.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
442
- hoverFlag.value && !!((_a2 = unref(modelValue)) == null ? void 0 : _a2.length) ? (openBlock(), createBlock(unref(TimesCircleSolid), {
443
- key: 0,
444
- class: "px-input-tag-icon",
445
- onClick: clearHandler
446
- })) : (openBlock(), createElementBlock("div", _hoisted_6))
447
- ])) : createCommentVNode("v-if", true),
448
- props.loading ? (openBlock(), createElementBlock("div", _hoisted_7, [
449
- createVNode(unref(SpinnerThirdSolid), { class: "px-input-tag-icon px-animation__loading" })
450
- ])) : createCommentVNode("v-if", true),
451
- unref(slots).suffix ? (openBlock(), createElementBlock("div", _hoisted_8, [
452
- renderSlot(_ctx.$slots, "suffix")
453
- ])) : createCommentVNode("v-if", true),
454
- createElementVNode(
455
- "canvas",
456
- {
457
- class: "px-input-tag-canvas",
458
- ref_key: "canvasRef",
459
- ref: canvasRef
460
- },
461
- null,
462
- 512
463
- /* NEED_PATCH */
464
- )
465
- ],
466
- 34
467
- /* CLASS, NEED_HYDRATION */
468
- );
469
- };
470
- }
48
+ var input_tag_default = /* @__PURE__ */ defineComponent({
49
+ name: "InputTag",
50
+ __name: "index",
51
+ props: {
52
+ modelValue: null,
53
+ defaultValue: null,
54
+ inputValue: null,
55
+ defaultInputValue: null,
56
+ placeholder: null,
57
+ disabled: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ readonly: {
62
+ type: Boolean,
63
+ default: false
64
+ },
65
+ clearable: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ loading: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ size: null,
74
+ shape: null,
75
+ borderRadius: null,
76
+ maxLength: null,
77
+ collapseTags: {
78
+ type: Boolean,
79
+ default: false
80
+ },
81
+ maxDisplayTags: null,
82
+ collapseTagsPopover: {
83
+ type: Boolean,
84
+ default: true
85
+ },
86
+ tagProps: null,
87
+ status: { default: "normal" },
88
+ autofocus: { type: Boolean },
89
+ tagTheme: { default: "info" },
90
+ tagVariant: { default: "plain" },
91
+ tagColor: null,
92
+ popoverProps: null
93
+ },
94
+ emits: [
95
+ "update:modelValue",
96
+ "tagAdd",
97
+ "tagClose",
98
+ "change",
99
+ "input",
100
+ "update:inputValue",
101
+ "inputChange",
102
+ "clear",
103
+ "blur",
104
+ "focus"
105
+ ],
106
+ setup(__props, { expose: __expose, emit: __emit }) {
107
+ var _instance$parent;
108
+ const props = __props;
109
+ const emits = __emit;
110
+ const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({ afterComposition: (e) => {
111
+ nextTick(() => {
112
+ inputHandler(e);
113
+ });
114
+ } });
115
+ const instance = getCurrentInstance();
116
+ const innerInputGroup = ref((instance === null || instance === void 0 || (_instance$parent = instance.parent) === null || _instance$parent === void 0 ? void 0 : _instance$parent.type.name) === "InputGroup");
117
+ const [index, first, last] = innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE) : [
118
+ ref(0),
119
+ ref(false),
120
+ ref(false)
121
+ ];
122
+ const inputGroupProvide = inject(INPUT_GROUP_PROVIDE);
123
+ const formItemProvide = inject(FORM_ITEM_PROVIDE);
124
+ const borderRadiusComputed = createProvideComputed("borderRadius", [innerInputGroup.value && inputGroupProvide, props]);
125
+ const sizeComputed = createProvideComputed("size", () => [
126
+ innerInputGroup.value && inputGroupProvide,
127
+ props.size && props,
128
+ formItemProvide,
129
+ props
130
+ ], "nullish", (val) => val || "medium");
131
+ const shapeComputed = createProvideComputed("shape", [innerInputGroup.value && inputGroupProvide, props], "nullish", (val) => val || "rect");
132
+ const disabledComputed = createProvideComputed("disabled", [
133
+ innerInputGroup.value && inputGroupProvide,
134
+ formItemProvide,
135
+ props
136
+ ], "or");
137
+ const readonlyComputed = createProvideComputed("readonly", [
138
+ innerInputGroup.value && inputGroupProvide,
139
+ formItemProvide,
140
+ props
141
+ ], "or");
142
+ const statusComputed = createProvideComputed("status", [formItemProvide, props]);
143
+ const nextIsTextButton = computed(() => {
144
+ if (index.value >= 0) {
145
+ var _inputGroupProvide$ch;
146
+ return innerInputGroup.value ? !!((inputGroupProvide === null || inputGroupProvide === void 0 || (_inputGroupProvide$ch = inputGroupProvide.childrenInfo.value.find((e) => e.index === index.value + 1)) === null || _inputGroupProvide$ch === void 0 ? void 0 : _inputGroupProvide$ch.variant) === "text") : false;
147
+ } else return false;
148
+ });
149
+ const tagSize = computed(() => {
150
+ return sizeComputed.value === "small" ? "small" : "medium";
151
+ });
152
+ const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
153
+ defaultField: "defaultValue",
154
+ transform: (value) => {
155
+ if (S(value)) return [...value];
156
+ return [];
157
+ }
158
+ });
159
+ const [inputValue, updateInputValue] = useControlledMode("inputValue", props, emits, {
160
+ defaultField: "defaultInputValue",
161
+ transform: (value) => {
162
+ return value || "";
163
+ }
164
+ });
165
+ const wrapperRef = shallowRef(null);
166
+ const canvasRef = shallowRef(null);
167
+ const inputRef = shallowRef(null);
168
+ const inputHandler = async (e) => {
169
+ const newValue = e.target.value;
170
+ inputValue.value = newValue;
171
+ if (isComposing.value) return;
172
+ emits("input", newValue, e);
173
+ updateInputValue(newValue);
174
+ };
175
+ const clearHandler = async () => {
176
+ const newTags = [];
177
+ await updateModelValue(newTags);
178
+ await updateInputValue("");
179
+ emits("clear", newTags);
180
+ emits("change", newTags);
181
+ emits("inputChange", "");
182
+ formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
183
+ };
184
+ const tagCloseHandler = async (index$1, e) => {
185
+ const currentTags = modelValue.value ? [...modelValue.value] : [];
186
+ const closed = currentTags.splice(index$1, 1);
187
+ await updateModelValue(currentTags);
188
+ emits("tagClose", closed[0], index$1, e);
189
+ emits("change", currentTags);
190
+ formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
191
+ };
192
+ const inputChangeHandler = (e) => {
193
+ const target = e.target;
194
+ emits("inputChange", target.value, e);
195
+ };
196
+ const focusMode = ref(false);
197
+ const blurHandler = async (e) => {
198
+ focusMode.value = false;
199
+ await updateInputValue("");
200
+ emits("inputChange", "");
201
+ emits("blur", e);
202
+ formItemProvide === null || formItemProvide === void 0 || formItemProvide.blurHandler();
203
+ };
204
+ const focusHandler = (e) => {
205
+ focusMode.value = true;
206
+ emits("focus", e);
207
+ };
208
+ const enterDownHandler = async (e) => {
209
+ const currentValue = (inputValue.value || "").trim();
210
+ if (!currentValue || props.maxLength && modelValue.value && modelValue.value.length >= props.maxLength) return;
211
+ const currentTags = modelValue.value ? [...modelValue.value] : [];
212
+ currentTags.push(currentValue);
213
+ await updateModelValue(currentTags);
214
+ await updateInputValue("");
215
+ emits("tagAdd", currentValue, e);
216
+ emits("change", currentTags);
217
+ emits("inputChange", "");
218
+ formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
219
+ };
220
+ const focusInputHandler = () => {
221
+ var _inputRef$value;
222
+ (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 || _inputRef$value.focus();
223
+ };
224
+ const hoverFlag = ref(false);
225
+ const mouseenterHandler = () => {
226
+ hoverFlag.value = true;
227
+ };
228
+ const mouseleaveHandler = () => {
229
+ hoverFlag.value = false;
230
+ };
231
+ const showClose = computed(() => {
232
+ return props.clearable && !disabledComputed.value && !readonlyComputed.value;
233
+ });
234
+ const tagCanClose = computed(() => {
235
+ return !disabledComputed.value && !readonlyComputed.value;
236
+ });
237
+ const slots = useSlots();
238
+ __expose({
239
+ focus: () => {
240
+ var _inputRef$value2;
241
+ (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
242
+ },
243
+ blur: () => {
244
+ var _inputRef$value3;
245
+ (_inputRef$value3 = inputRef.value) === null || _inputRef$value3 === void 0 || _inputRef$value3.blur();
246
+ },
247
+ clear: () => clearHandler()
248
+ });
249
+ const shouldCollapseTags = computed(() => {
250
+ return !!props.collapseTags && A(props.maxDisplayTags) && props.maxDisplayTags >= 0;
251
+ });
252
+ const tagsShowed = computed(() => {
253
+ return modelValue.value ? shouldCollapseTags.value ? modelValue.value.slice(0, props.maxDisplayTags) : modelValue.value : [];
254
+ });
255
+ const tagsCollapsed = computed(() => {
256
+ return modelValue.value ? shouldCollapseTags.value ? modelValue.value.slice(props.maxDisplayTags) : [] : [];
257
+ });
258
+ const popoverProps = computed(() => {
259
+ var _props$popoverProps;
260
+ return {
261
+ ...props.popoverProps,
262
+ contentStyle: {
263
+ maxWidth: `400px`,
264
+ ...(_props$popoverProps = props.popoverProps) === null || _props$popoverProps === void 0 ? void 0 : _props$popoverProps.contentStyle
265
+ }
266
+ };
267
+ });
268
+ watch([
269
+ first,
270
+ last,
271
+ borderRadiusComputed,
272
+ shapeComputed,
273
+ sizeComputed,
274
+ readonlyComputed,
275
+ disabledComputed,
276
+ () => slots,
277
+ useDarkMode(),
278
+ focusMode,
279
+ hoverFlag,
280
+ statusComputed,
281
+ nextIsTextButton
282
+ ], () => {
283
+ setTimeout(() => {
284
+ drawPixel();
285
+ });
286
+ });
287
+ const drawPixel = () => {
288
+ const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
289
+ if (!preprocessData) return;
290
+ const { ctx, width, height, canvas } = preprocessData;
291
+ const pixelSize = calcPixelSize();
292
+ const borderRadius = getBorderRadius(canvas, pixelSize, borderRadiusComputed.value, shapeComputed.value, sizeComputed.value || "medium", innerInputGroup.value, first.value, last.value);
293
+ const borderColor = statusComputed.value !== "normal" ? getGlobalThemeColor(statusComputed.value === "error" ? "danger" : statusComputed.value, 6) : (hoverFlag.value || focusMode.value) && !disabledComputed.value && !readonlyComputed.value ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
294
+ const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize);
295
+ const rad = BORDER_CORNER_RAD_RANGE;
296
+ if (borderColor) drawBorder(ctx, width, height, center, borderRadius, rad, borderColor, pixelSize, innerInputGroup.value, first.value, last.value, nextIsTextButton.value);
297
+ const backgroundColor = disabledComputed.value ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
298
+ if (backgroundColor) floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
299
+ };
300
+ onMounted(() => {
301
+ nextTick(() => {
302
+ drawPixel();
303
+ });
304
+ });
305
+ useResizeObserver(wrapperRef, drawPixel);
306
+ useWatchGlobalCssVal(drawPixel);
307
+ useTransitionEnd(wrapperRef, drawPixel);
308
+ return (_ctx, _cache) => {
309
+ var _unref2;
310
+ return openBlock(), createElementBlock("div", {
311
+ class: normalizeClass(["pixelium px-input-tag", {
312
+ [`px-input-tag__${unref(sizeComputed)}`]: !!unref(sizeComputed),
313
+ [`px-input-tag__${unref(shapeComputed)}`]: !!unref(shapeComputed),
314
+ "px-input-tag__inner": innerInputGroup.value,
315
+ "px-input-tag__disabled": !!unref(disabledComputed)
316
+ }]),
317
+ ref_key: "wrapperRef",
318
+ ref: wrapperRef,
319
+ onClick: focusInputHandler,
320
+ onMouseenter: mouseenterHandler,
321
+ onMouseleave: mouseleaveHandler,
322
+ onFocusout: blurHandler,
323
+ onFocusin: focusHandler
324
+ }, [
325
+ unref(slots).prefix ? (openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "prefix")])) : createCommentVNode("v-if", true),
326
+ createElementVNode("div", _hoisted_2, [
327
+ (openBlock(true), createElementBlock(Fragment, null, renderList(tagsShowed.value, (tag, index$1) => {
328
+ return openBlock(), createBlock(tag_default, mergeProps({
329
+ key: index$1,
330
+ size: tagSize.value,
331
+ variant: props.tagVariant,
332
+ theme: props.tagTheme,
333
+ closable: tagCanClose.value,
334
+ disabled: unref(disabledComputed),
335
+ color: props.tagColor
336
+ }, { ref_for: true }, props.tagProps, { onClose: (e) => tagCloseHandler(index$1, e) }), {
337
+ default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
338
+ tag,
339
+ index: index$1
340
+ }, () => [createTextVNode(toDisplayString(tag), 1)])]),
341
+ _: 2
342
+ }, 1040, [
343
+ "size",
344
+ "variant",
345
+ "theme",
346
+ "closable",
347
+ "disabled",
348
+ "color",
349
+ "onClose"
350
+ ]);
351
+ }), 128)),
352
+ tagsCollapsed.value.length && shouldCollapseTags.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [!props.collapseTagsPopover ? (openBlock(), createBlock(tag_default, mergeProps({
353
+ key: 0,
354
+ size: tagSize.value,
355
+ variant: props.tagVariant,
356
+ theme: props.tagTheme,
357
+ disabled: unref(disabledComputed),
358
+ color: props.tagColor
359
+ }, props.tagProps), {
360
+ default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
361
+ tag: `+${tagsCollapsed.value.length}`,
362
+ index: -1
363
+ }, () => [createTextVNode("+" + toDisplayString(tagsCollapsed.value.length), 1)])]),
364
+ _: 3
365
+ }, 16, [
366
+ "size",
367
+ "variant",
368
+ "theme",
369
+ "disabled",
370
+ "color"
371
+ ])) : (openBlock(), createBlock(popover_default, normalizeProps(mergeProps({ key: 1 }, popoverProps.value)), {
372
+ content: withCtx(() => [createElementVNode("div", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(tagsCollapsed.value, (tag, index$1) => {
373
+ return openBlock(), createBlock(tag_default, mergeProps({
374
+ key: index$1,
375
+ size: tagSize.value,
376
+ variant: props.tagVariant,
377
+ theme: props.tagTheme,
378
+ closable: tagCanClose.value,
379
+ disabled: unref(disabledComputed),
380
+ color: props.tagColor
381
+ }, { ref_for: true }, props.tagProps, { onClose: (e) => tagCloseHandler(index$1 + Math.floor(props.maxDisplayTags), e) }), {
382
+ default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
383
+ tag,
384
+ index: index$1 + Math.floor(props.maxDisplayTags)
385
+ }, () => [createTextVNode(toDisplayString(tag), 1)])]),
386
+ _: 2
387
+ }, 1040, [
388
+ "size",
389
+ "variant",
390
+ "theme",
391
+ "closable",
392
+ "disabled",
393
+ "color",
394
+ "onClose"
395
+ ]);
396
+ }), 128))])]),
397
+ default: withCtx(() => [createVNode(tag_default, mergeProps({
398
+ size: tagSize.value,
399
+ variant: props.tagVariant,
400
+ theme: props.tagTheme,
401
+ disabled: unref(disabledComputed),
402
+ color: props.tagColor
403
+ }, props.tagProps), {
404
+ default: withCtx(() => [renderSlot(_ctx.$slots, "tag", {
405
+ tag: `+${tagsCollapsed.value.length}`,
406
+ index: -1
407
+ }, () => [createTextVNode("+" + toDisplayString(tagsCollapsed.value.length), 1)])]),
408
+ _: 3
409
+ }, 16, [
410
+ "size",
411
+ "variant",
412
+ "theme",
413
+ "disabled",
414
+ "color"
415
+ ])]),
416
+ _: 3
417
+ }, 16))], 64)) : createCommentVNode("v-if", true),
418
+ createElementVNode("input", {
419
+ class: "px-input-tag-inner",
420
+ value: unref(inputValue),
421
+ ref_key: "inputRef",
422
+ ref: inputRef,
423
+ placeholder: unref(modelValue) && unref(modelValue).length ? "" : props.placeholder,
424
+ disabled: unref(disabledComputed) || unref(readonlyComputed),
425
+ autofocus: __props.autofocus,
426
+ onInput: withModifiers(inputHandler, ["stop"]),
427
+ onChange: withModifiers(inputChangeHandler, ["stop"]),
428
+ onCompositionstart: _cache[0] || (_cache[0] = (...args) => unref(compositionStartHandler) && unref(compositionStartHandler)(...args)),
429
+ onCompositionend: _cache[1] || (_cache[1] = (...args) => unref(compositionUpdateHandler) && unref(compositionUpdateHandler)(...args)),
430
+ onKeydown: withKeys(enterDownHandler, ["enter"])
431
+ }, null, 40, _hoisted_4)
432
+ ]),
433
+ showClose.value ? (openBlock(), createElementBlock("div", _hoisted_5, [hoverFlag.value && !!((_unref2 = unref(modelValue)) === null || _unref2 === void 0 ? void 0 : _unref2.length) ? (openBlock(), createBlock(unref(times_circle_solid_default), {
434
+ key: 0,
435
+ class: "px-input-tag-icon",
436
+ onClick: clearHandler
437
+ })) : (openBlock(), createElementBlock("div", _hoisted_6))])) : createCommentVNode("v-if", true),
438
+ props.loading ? (openBlock(), createElementBlock("div", _hoisted_7, [createVNode(unref(spinner_third_solid_default), { class: "px-input-tag-icon px-animation__loading" })])) : createCommentVNode("v-if", true),
439
+ unref(slots).suffix ? (openBlock(), createElementBlock("div", _hoisted_8, [renderSlot(_ctx.$slots, "suffix")])) : createCommentVNode("v-if", true),
440
+ createElementVNode("canvas", {
441
+ class: "px-input-tag-canvas",
442
+ ref_key: "canvasRef",
443
+ ref: canvasRef
444
+ }, null, 512)
445
+ ], 34);
446
+ };
447
+ }
471
448
  });
472
- export {
473
- _sfc_main as _
474
- };
449
+ export { input_tag_default as t };