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

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 (284) hide show
  1. package/README.md +42 -0
  2. package/README.zh.md +6 -3
  3. package/dist/font.css +1 -1
  4. package/dist/index.d.ts +1602 -248
  5. package/dist/normalize.css +2 -0
  6. package/dist/pixelium-vue-icon-hn.cjs +1 -1
  7. package/dist/pixelium-vue-icon-hn.css +2 -1
  8. package/dist/pixelium-vue-icon-hn.js +8533 -8154
  9. package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
  10. package/dist/pixelium-vue-icon-pa.cjs +1 -1
  11. package/dist/pixelium-vue-icon-pa.css +2 -1
  12. package/dist/pixelium-vue-icon-pa.js +10625 -10143
  13. package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
  14. package/dist/pixelium-vue.cjs +2 -2
  15. package/dist/pixelium-vue.css +2 -1
  16. package/dist/pixelium-vue.js +7407 -5854
  17. package/dist/pixelium-vue.umd.cjs +2 -2
  18. package/es/aside/index.css +1 -0
  19. package/es/aside/index.js +46 -151
  20. package/es/auto-complete/draw.d.ts +1 -1
  21. package/es/auto-complete/draw.js +26 -51
  22. package/es/auto-complete/index.css +92 -32
  23. package/es/auto-complete/index.d.ts +12 -15
  24. package/es/auto-complete/index.js +338 -400
  25. package/es/auto-complete/type.d.ts +25 -13
  26. package/es/avatar/css.js +2 -0
  27. package/es/avatar/draw.d.ts +2 -0
  28. package/es/avatar/draw.js +11 -0
  29. package/es/avatar/index.css +49 -0
  30. package/es/avatar/index.d.ts +15 -0
  31. package/es/avatar/index.js +110 -0
  32. package/es/avatar/type.d.ts +34 -0
  33. package/es/button/draw.d.ts +4 -4
  34. package/es/button/draw.js +213 -297
  35. package/es/button/index.css +40 -30
  36. package/es/button/index.d.ts +0 -4
  37. package/es/button/index.js +230 -256
  38. package/es/button/type.d.ts +3 -3
  39. package/es/button-group/index.css +0 -3
  40. package/es/button-group/index.d.ts +1 -2
  41. package/es/button-group/index.js +59 -31
  42. package/es/button-group/type.d.ts +21 -4
  43. package/es/checkbox/css.js +2 -0
  44. package/es/checkbox/draw.d.ts +4 -0
  45. package/es/checkbox/draw.js +46 -0
  46. package/es/checkbox/index.css +85 -0
  47. package/es/checkbox/index.d.ts +31 -0
  48. package/es/checkbox/index.js +206 -0
  49. package/es/checkbox/type.d.ts +88 -0
  50. package/es/checkbox-group/css.js +2 -0
  51. package/es/checkbox-group/index.css +20 -0
  52. package/es/checkbox-group/index.d.ts +23 -0
  53. package/es/checkbox-group/index.js +84 -0
  54. package/es/checkbox-group/type.d.ts +78 -0
  55. package/es/col/index.d.ts +2 -2
  56. package/es/col/index.js +43 -58
  57. package/es/container/index.css +1 -0
  58. package/es/container/index.js +18 -31
  59. package/es/divider/index.js +39 -53
  60. package/es/empty/index.css +4 -4
  61. package/es/empty/index.js +16 -71
  62. package/es/entry.js +102 -0
  63. package/es/footer/index.css +1 -0
  64. package/es/footer/index.js +31 -40
  65. package/es/form/css.js +1 -0
  66. package/es/form/index.d.ts +27 -0
  67. package/es/form/index.js +125 -0
  68. package/es/form/type.d.ts +238 -0
  69. package/es/form/use-form.d.ts +4 -0
  70. package/es/form/use-form.js +48 -0
  71. package/es/form-item/css.js +2 -0
  72. package/es/form-item/index.css +77 -0
  73. package/es/form-item/index.d.ts +37 -0
  74. package/es/form-item/index.js +318 -0
  75. package/es/form-item/type.d.ts +96 -0
  76. package/es/grid/index.js +56 -75
  77. package/es/grid-item/css.js +0 -1
  78. package/es/grid-item/index.d.ts +1 -1
  79. package/es/grid-item/index.js +85 -121
  80. package/es/header/index.css +1 -0
  81. package/es/header/index.js +31 -40
  82. package/es/icon/index.js +44 -55
  83. package/es/icons/css-hn.js +0 -1
  84. package/es/icons/css-pa.js +0 -1
  85. package/es/icons/icon-hn.js +10337 -15986
  86. package/es/icons/icon-pa.js +12573 -17447
  87. package/es/image/css.js +2 -0
  88. package/es/image/index.css +69 -0
  89. package/es/image/index.d.ts +35 -0
  90. package/es/image/index.js +199 -0
  91. package/es/image/type.d.ts +126 -0
  92. package/es/index.css +1 -515
  93. package/es/index.d.ts +22 -2
  94. package/es/index.js +144 -123
  95. package/es/input/draw.d.ts +1 -1
  96. package/es/input/draw.js +26 -51
  97. package/es/input/index.css +85 -33
  98. package/es/input/index.d.ts +9 -16
  99. package/es/input/index.js +319 -423
  100. package/es/input/type.d.ts +3 -3
  101. package/es/input-group/index.css +0 -1
  102. package/es/input-group/index.d.ts +2 -2
  103. package/es/input-group/index.js +66 -37
  104. package/es/input-group/type.d.ts +16 -4
  105. package/es/input-group-label/draw.d.ts +1 -1
  106. package/es/input-group-label/draw.js +26 -51
  107. package/es/input-group-label/index.css +33 -22
  108. package/es/input-group-label/index.d.ts +1 -4
  109. package/es/input-group-label/index.js +104 -127
  110. package/es/input-group-label/type.d.ts +3 -3
  111. package/es/input-number/draw.d.ts +1 -1
  112. package/es/input-number/draw.js +26 -51
  113. package/es/input-number/index.css +90 -35
  114. package/es/input-number/index.d.ts +9 -16
  115. package/es/input-number/index.js +428 -536
  116. package/es/input-number/type.d.ts +3 -3
  117. package/es/input-tag/draw.d.ts +1 -1
  118. package/es/input-tag/draw.js +26 -48
  119. package/es/input-tag/index.css +100 -33
  120. package/es/input-tag/index.d.ts +7 -13
  121. package/es/input-tag/index.js +442 -467
  122. package/es/input-tag/type.d.ts +24 -13
  123. package/es/link/index.js +75 -106
  124. package/es/main/index.css +4 -0
  125. package/es/main/index.d.ts +4 -1
  126. package/es/main/index.js +15 -15
  127. package/es/main/type.d.ts +7 -0
  128. package/es/mask/index.js +94 -115
  129. package/es/message/index.css +1 -1
  130. package/es/message/index.js +168 -346
  131. package/es/message-box/css.js +1 -1
  132. package/es/message-box/index.js +98 -114
  133. package/es/message-box/message-box-wrapped.js +33 -46
  134. package/es/message-box/message-box.js +79 -111
  135. package/es/option-list/index.css +13 -13
  136. package/es/option-list/index.d.ts +4 -31
  137. package/es/option-list/index.js +99 -167
  138. package/es/option-list/type.d.ts +5 -1
  139. package/es/pixelate/pixel.d.ts +5 -0
  140. package/es/pixelate/pixel.js +70 -0
  141. package/es/pixelate/pixelate.worker.d.ts +1 -0
  142. package/es/popover/index.d.ts +13 -99
  143. package/es/popover/index.js +75 -238
  144. package/es/popover/type.d.ts +7 -2
  145. package/es/popup/css.js +1 -0
  146. package/es/popup/index.d.ts +210 -0
  147. package/es/popup/index.js +203 -0
  148. package/es/popup/type.d.ts +105 -0
  149. package/es/popup-content/draw.d.ts +2 -2
  150. package/es/popup-content/draw.js +98 -143
  151. package/es/popup-content/index.css +11 -11
  152. package/es/popup-content/index.d.ts +1 -0
  153. package/es/popup-content/index.js +253 -1576
  154. package/es/popup-content/type.d.ts +1 -0
  155. package/es/popup-trigger/index.d.ts +8 -2
  156. package/es/popup-trigger/index.js +122 -95
  157. package/es/popup-trigger/type.d.ts +4 -1
  158. package/es/popup-wrapper/css.js +2 -0
  159. package/es/popup-wrapper/index.css +14 -0
  160. package/es/popup-wrapper/index.d.ts +18 -0
  161. package/es/popup-wrapper/index.js +67 -0
  162. package/es/popup-wrapper/type.d.ts +9 -0
  163. package/es/radio/css.js +1 -0
  164. package/es/radio/draw.d.ts +4 -0
  165. package/es/radio/draw.js +47 -0
  166. package/es/radio/index.d.ts +30 -0
  167. package/es/radio/index.js +190 -0
  168. package/es/radio/style.css +73 -0
  169. package/es/radio/type.d.ts +76 -0
  170. package/es/radio-group/css.js +2 -0
  171. package/es/radio-group/index.css +20 -0
  172. package/es/radio-group/index.d.ts +23 -0
  173. package/es/radio-group/index.js +77 -0
  174. package/es/radio-group/type.d.ts +77 -0
  175. package/es/row/index.js +56 -70
  176. package/es/select/draw.d.ts +1 -1
  177. package/es/select/draw.js +26 -51
  178. package/es/select/index.css +118 -36
  179. package/es/select/index.d.ts +14 -16
  180. package/es/select/index.js +625 -675
  181. package/es/select/type.d.ts +60 -25
  182. package/es/share/const/event-bus-key.js +1 -6
  183. package/es/share/const/index.d.ts +4 -0
  184. package/es/share/const/index.js +22 -24
  185. package/es/share/const/provide-key.d.ts +5 -0
  186. package/es/share/const/provide-key.js +6 -5
  187. package/es/share/const/style.d.ts +6 -0
  188. package/es/share/const/style.js +7 -0
  189. package/es/share/hook/use-cancelable-delay.d.ts +1 -0
  190. package/es/share/hook/use-cancelable-delay.js +42 -0
  191. package/es/share/hook/use-click-outside-listener.d.ts +1 -1
  192. package/es/share/hook/use-click-outside-listener.js +28 -41
  193. package/es/share/hook/use-composition.js +17 -15
  194. package/es/share/hook/use-controlled-mode.d.ts +3 -3
  195. package/es/share/hook/use-controlled-mode.js +20 -23
  196. package/es/share/hook/use-dark-mode.js +51 -65
  197. package/es/share/hook/use-index-of-children.d.ts +2 -1
  198. package/es/share/hook/use-index-of-children.js +47 -45
  199. package/es/share/hook/use-lazy-load.d.ts +10 -0
  200. package/es/share/hook/use-lazy-load.js +133 -0
  201. package/es/share/hook/use-props-detect.d.ts +2 -0
  202. package/es/share/hook/use-resize-observer.d.ts +1 -2
  203. package/es/share/hook/use-resize-observer.js +28 -20
  204. package/es/share/hook/use-screen-width.js +27 -36
  205. package/es/share/hook/use-smooth-transition.d.ts +2 -0
  206. package/es/share/hook/use-smooth-transition.js +65 -0
  207. package/es/share/hook/use-textarea-height.js +86 -92
  208. package/es/share/hook/use-theme-mode.js +41 -42
  209. package/es/share/hook/use-transition-end.d.ts +2 -0
  210. package/es/share/hook/use-transition-end.js +12 -0
  211. package/es/share/hook/use-watch-global-css-var.js +12 -16
  212. package/es/share/hook/use-window-resize-listener.d.ts +1 -0
  213. package/es/share/hook/use-window-resize-listener.js +15 -0
  214. package/es/share/hook/use-z-index.js +30 -27
  215. package/es/share/style/index.css +5 -0
  216. package/es/share/type/index.d.ts +18 -3
  217. package/es/share/util/color.d.ts +5 -3
  218. package/es/share/util/color.js +156 -149
  219. package/es/share/util/common.d.ts +7 -2
  220. package/es/share/util/common.js +127 -65
  221. package/es/share/util/console.d.ts +3 -3
  222. package/es/share/util/console.js +10 -7
  223. package/es/share/util/dom.d.ts +19 -0
  224. package/es/share/util/dom.js +88 -0
  225. package/es/share/util/env.d.ts +1 -0
  226. package/es/share/util/env.js +5 -4
  227. package/es/share/util/event-bus.js +3 -20
  228. package/es/share/util/lru-cache.js +29 -33
  229. package/es/share/util/pixel.d.ts +4 -0
  230. package/es/share/util/plot.d.ts +8 -3
  231. package/es/share/util/plot.js +457 -229
  232. package/es/share/util/reactivity.d.ts +8 -0
  233. package/es/share/util/reactivity.js +23 -0
  234. package/es/share/util/render.js +31 -41
  235. package/es/share/util/theme.d.ts +3 -0
  236. package/es/share/util/theme.js +77 -57
  237. package/es/slider/css.js +2 -0
  238. package/es/slider/draw.d.ts +25 -0
  239. package/es/slider/draw.js +113 -0
  240. package/es/slider/index.css +119 -0
  241. package/es/slider/index.d.ts +66 -0
  242. package/es/slider/index.js +503 -0
  243. package/es/slider/type.d.ts +162 -0
  244. package/es/slider/util.d.ts +37 -0
  245. package/es/slider/util.js +130 -0
  246. package/es/space/index.css +24 -29
  247. package/es/space/index.js +73 -97
  248. package/es/spin/index.css +18 -17
  249. package/es/spin/index.js +72 -102
  250. package/es/spin/type.d.ts +11 -5
  251. package/es/switch/css.js +2 -0
  252. package/es/switch/draw.d.ts +2 -0
  253. package/es/switch/draw.js +18 -0
  254. package/es/switch/index.css +121 -0
  255. package/es/switch/index.d.ts +42 -0
  256. package/es/switch/index.js +259 -0
  257. package/es/switch/type.d.ts +133 -0
  258. package/es/tag/draw.d.ts +2 -2
  259. package/es/tag/draw.js +80 -127
  260. package/es/tag/index.css +38 -22
  261. package/es/tag/index.d.ts +2 -2
  262. package/es/tag/index.js +121 -190
  263. package/es/tag/type.d.ts +3 -3
  264. package/es/text-outline/css.js +2 -0
  265. package/es/text-outline/index.css +4 -0
  266. package/es/text-outline/index.d.ts +17 -0
  267. package/es/text-outline/index.js +33 -0
  268. package/es/text-outline/type.d.ts +23 -0
  269. package/es/textarea/draw.js +9 -11
  270. package/es/textarea/index.css +37 -23
  271. package/es/textarea/index.d.ts +8 -14
  272. package/es/textarea/index.js +274 -262
  273. package/es/tooltip/index.d.ts +100 -4
  274. package/es/tooltip/index.js +70 -226
  275. package/es/tooltip/type.d.ts +7 -2
  276. package/es/vendor.js +504 -0
  277. package/es/virtual-list/css.js +2 -0
  278. package/es/virtual-list/index.css +25 -0
  279. package/es/virtual-list/index.d.ts +11 -0
  280. package/es/virtual-list/index.js +313 -0
  281. package/es/virtual-list/type.d.ts +26 -0
  282. package/package.json +10 -16
  283. package/es/grid-item/index.css +0 -0
  284. /package/es/message-box/{message-box.css → index.css} +0 -0
@@ -1,169 +1,101 @@
1
1
  import './css.js'
2
- import { defineComponent, createElementBlock, openBlock, Fragment, renderList, unref, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementVNode } from "vue";
3
- import { p, d } from "../aside/index.js";
4
- import { G as GROUP_OPTION_TYPE } from "../share/const/index.js";
5
- const _hoisted_1 = { class: "px-option-list" };
6
- const _hoisted_2 = ["onClick"];
7
- const _hoisted_3 = ["onClick"];
8
- const _hoisted_4 = {
9
- key: 2,
10
- class: "px-option-list-item-group"
11
- };
12
- const _hoisted_5 = { class: "px-option-list-item-group-label" };
13
- const _hoisted_6 = ["onClick"];
14
- const _hoisted_7 = ["onClick"];
15
- const _sfc_main = /* @__PURE__ */ defineComponent({
16
- ...{
17
- name: "OptionList"
18
- },
19
- __name: "index",
20
- props: {
21
- options: { default: () => [] },
22
- activeValues: { default: () => [] }
23
- },
24
- emits: ["select"],
25
- setup(__props, { emit: __emit }) {
26
- const props = __props;
27
- const emits = __emit;
28
- const selectHandler = (value, e) => {
29
- emits("select", value, value, e);
30
- };
31
- const selectObjectHandler = (option, e) => {
32
- if (option.disabled) {
33
- return;
34
- }
35
- emits("select", option.value, option, e);
36
- };
37
- const getKey = (option) => {
38
- if (p(option)) {
39
- return option;
40
- } else if ("type" in option && option.type === GROUP_OPTION_TYPE) {
41
- return option.key;
42
- } else {
43
- return option.label;
44
- }
45
- };
46
- const checkActive = (option) => {
47
- if (!props.activeValues.length) {
48
- return false;
49
- }
50
- if (p(option)) {
51
- return props.activeValues.includes(option);
52
- }
53
- return props.activeValues.includes(option.value);
54
- };
55
- return (_ctx, _cache) => {
56
- return openBlock(), createElementBlock("ul", _hoisted_1, [
57
- (openBlock(true), createElementBlock(
58
- Fragment,
59
- null,
60
- renderList(props.options, (item) => {
61
- return openBlock(), createElementBlock(
62
- Fragment,
63
- {
64
- key: getKey(item)
65
- },
66
- [
67
- unref(p)(item) ? (openBlock(), createElementBlock("li", {
68
- key: 0,
69
- class: normalizeClass(["px-option-list-item", {
70
- "px-option-list-item__active": checkActive(item)
71
- }]),
72
- onClick: (e) => selectHandler(item, e)
73
- }, [
74
- renderSlot(_ctx.$slots, "option", { option: item }, () => [
75
- createTextVNode(
76
- toDisplayString(item),
77
- 1
78
- /* TEXT */
79
- )
80
- ])
81
- ], 10, _hoisted_2)) : unref(d)(item) && !("type" in item && item.type === unref(GROUP_OPTION_TYPE)) ? (openBlock(), createElementBlock("li", {
82
- key: 1,
83
- class: normalizeClass(["px-option-list-item", {
84
- "px-option-list-item__disabled": item.disabled,
85
- "px-option-list-item__active": checkActive(item)
86
- }]),
87
- onClick: (e) => selectObjectHandler(item, e)
88
- }, [
89
- renderSlot(_ctx.$slots, "option", { option: item }, () => [
90
- createTextVNode(
91
- toDisplayString(item.label),
92
- 1
93
- /* TEXT */
94
- )
95
- ])
96
- ], 10, _hoisted_3)) : (openBlock(), createElementBlock("li", _hoisted_4, [
97
- createElementVNode("div", _hoisted_5, [
98
- renderSlot(_ctx.$slots, "group-label", { option: item }, () => [
99
- createTextVNode(
100
- toDisplayString(item.label),
101
- 1
102
- /* TEXT */
103
- )
104
- ])
105
- ]),
106
- (openBlock(true), createElementBlock(
107
- Fragment,
108
- null,
109
- renderList(item.children, (child) => {
110
- return openBlock(), createElementBlock(
111
- Fragment,
112
- {
113
- key: getKey(child)
114
- },
115
- [
116
- unref(p)(child) ? (openBlock(), createElementBlock("li", {
117
- key: 0,
118
- class: normalizeClass(["px-option-list-item", {
119
- "px-option-list-item__active": checkActive(child)
120
- }]),
121
- onClick: (e) => selectHandler(child, e)
122
- }, [
123
- renderSlot(_ctx.$slots, "option", { option: child }, () => [
124
- createTextVNode(
125
- toDisplayString(child),
126
- 1
127
- /* TEXT */
128
- )
129
- ])
130
- ], 10, _hoisted_6)) : (openBlock(), createElementBlock("li", {
131
- key: 1,
132
- class: normalizeClass(["px-option-list-item", {
133
- "px-option-list-item__disabled": child.disabled,
134
- "px-option-list-item__active": checkActive(child)
135
- }]),
136
- onClick: (e) => selectObjectHandler(child, e)
137
- }, [
138
- renderSlot(_ctx.$slots, "option", { option: child }, () => [
139
- createTextVNode(
140
- toDisplayString(child.label),
141
- 1
142
- /* TEXT */
143
- )
144
- ])
145
- ], 10, _hoisted_7))
146
- ],
147
- 64
148
- /* STABLE_FRAGMENT */
149
- );
150
- }),
151
- 128
152
- /* KEYED_FRAGMENT */
153
- ))
154
- ]))
155
- ],
156
- 64
157
- /* STABLE_FRAGMENT */
158
- );
159
- }),
160
- 128
161
- /* KEYED_FRAGMENT */
162
- ))
163
- ]);
164
- };
165
- }
2
+ import { A as d, B as y } from "../vendor.js";
3
+ import { i as GROUP_OPTION_TYPE } from "../share/const/index.js";
4
+ import { t as virtual_list_default } from "../virtual-list/index.js";
5
+ import { createVNode, defineComponent, getCurrentInstance, mergeProps, useSlots, withScopeId } from "vue";
6
+ var option_list_default = /* @__PURE__ */ defineComponent({
7
+ name: "OptionList",
8
+ __name: "index",
9
+ props: {
10
+ options: { default: () => [] },
11
+ activeValues: { default: () => [] },
12
+ virtualScroll: {
13
+ type: Boolean,
14
+ default: false
15
+ },
16
+ virtualListProps: null
17
+ },
18
+ emits: ["select"],
19
+ setup(__props, { emit: __emit }) {
20
+ const props = __props;
21
+ const emits = __emit;
22
+ const selectHandler = (value, e) => {
23
+ emits("select", value, value, e);
24
+ };
25
+ const selectObjectHandler = (option, e) => {
26
+ if (option.disabled) return;
27
+ emits("select", option.value, option, e);
28
+ };
29
+ const isOptionListOption = (item) => {
30
+ return d(item) && !("type" in item && item.type === "group");
31
+ };
32
+ const getKey = (option) => {
33
+ if (y(option)) return option;
34
+ else if (isOptionListOption(option)) return option.key ?? option.value;
35
+ else return option.key;
36
+ };
37
+ const checkActive = (option) => {
38
+ if (!props.activeValues.length) return false;
39
+ if (y(option)) return props.activeValues.includes(option);
40
+ return props.activeValues.includes(option.value);
41
+ };
42
+ const slots = useSlots();
43
+ const renderItem = (item, child = false) => {
44
+ const key = getKey(item);
45
+ if (y(item)) return {
46
+ el: createVNode("li", {
47
+ "tabindex": 0,
48
+ "key": key,
49
+ "class": {
50
+ "px-option-list-item": true,
51
+ "px-option-list-item__active": checkActive(item),
52
+ "px-option-list-item__child": child
53
+ },
54
+ "onClick": (e) => selectHandler(item, e)
55
+ }, [slots.option ? slots.option({ option: item }) : item]),
56
+ key
57
+ };
58
+ else if (isOptionListOption(item)) return {
59
+ el: createVNode("li", {
60
+ "tabindex": item.disabled ? -1 : 0,
61
+ "key": key,
62
+ "class": {
63
+ "px-option-list-item": true,
64
+ "px-option-list-item__disabled": item.disabled,
65
+ "px-option-list-item__active": checkActive(item),
66
+ "px-option-list-item__child": child
67
+ },
68
+ "onClick": (e) => selectObjectHandler(item, e)
69
+ }, [slots.option ? slots.option({ option: item }) : item.label]),
70
+ key
71
+ };
72
+ else return [{
73
+ el: createVNode("li", {
74
+ "class": "px-option-list-item-group",
75
+ "key": key
76
+ }, [createVNode("div", { "class": "px-option-list-item-group-label" }, [slots["group-label"] ? slots["group-label"]({ option: item }) : item.label])]),
77
+ key
78
+ }, ...item.children.map((child$1) => renderItem(child$1, true))];
79
+ };
80
+ const renderList$1 = () => {
81
+ const list = [];
82
+ props.options.map((item) => renderItem(item)).forEach((rendered) => {
83
+ if (Array.isArray(rendered)) rendered.forEach((r) => list.push(r));
84
+ else list.push(rendered);
85
+ });
86
+ return createVNode("ul", { "class": "px-option-list" }, [!props.virtualScroll ? list.map((item) => item.el) : createVNode(virtual_list_default, mergeProps({
87
+ "class": "px-option-list-virtual-list",
88
+ "list": list.map((item) => ({
89
+ render: () => item.el,
90
+ key: item.key
91
+ }))
92
+ }, props.virtualListProps), null)]);
93
+ };
94
+ const instance = getCurrentInstance();
95
+ return () => {
96
+ const scopeId = instance === null || instance === void 0 ? void 0 : instance.vnode.scopeId;
97
+ return scopeId ? withScopeId(scopeId)(renderList$1)() : renderList$1();
98
+ };
99
+ }
166
100
  });
167
- export {
168
- _sfc_main as _
169
- };
101
+ export { option_list_default as t };
@@ -1,6 +1,8 @@
1
1
  import type { GroupOption, Option } from '../share/type';
2
- export interface OptionListOption extends Option<any> {
2
+ import type { VirtualListProps } from '../virtual-list/type';
3
+ export interface OptionListOption<T = any> extends Option<T> {
3
4
  disabled?: boolean;
5
+ key?: string | number | symbol;
4
6
  }
5
7
  export interface OptionListGroupOption extends GroupOption {
6
8
  label: string;
@@ -10,6 +12,8 @@ export interface OptionListGroupOption extends GroupOption {
10
12
  export type OptionListProps = {
11
13
  options?: (string | OptionListOption | OptionListGroupOption)[];
12
14
  activeValues?: any[];
15
+ virtualScroll?: boolean;
16
+ virtualListProps?: Omit<VirtualListProps, 'list' | 'fixedHeight'>;
13
17
  };
14
18
  export type OptionListEvent = {
15
19
  select: [value: any, option: OptionListOption | string, e: MouseEvent];
@@ -0,0 +1,5 @@
1
+ export interface PixelateOptions {
2
+ palette?: string[];
3
+ background?: string;
4
+ }
5
+ export declare function pixelateImage(imageSource: HTMLImageElement | string, pixelSize: number, options?: PixelateOptions, onProgress?: (progress: number) => void): Promise<ImageData | null>;
@@ -0,0 +1,70 @@
1
+ import { t as inBrowser } from "../share/util/env.js";
2
+ import { i as parseColor } from "../share/util/color.js";
3
+ import { t as createError } from "../share/util/console.js";
4
+ import { t as WorkerWrapper } from "../index.js";
5
+ async function pixelateImage(imageSource, pixelSize, options, onProgress) {
6
+ if (!inBrowser()) return Promise.resolve(null);
7
+ const paletteResolved = (options === null || options === void 0 ? void 0 : options.palette) ? options.palette.map((color) => parseColor(color)) : [];
8
+ const background = (options === null || options === void 0 ? void 0 : options.background) ? parseColor(options.background) : {
9
+ r: 255,
10
+ g: 255,
11
+ b: 255,
12
+ a: 255
13
+ };
14
+ const imageData = await loadImageAndGetData(imageSource);
15
+ const worker = new WorkerWrapper();
16
+ return new Promise((resolve, reject) => {
17
+ worker.onmessage = (e) => {
18
+ const { type, imageData: imageData$1, progress, error } = e.data;
19
+ switch (type) {
20
+ case "progress":
21
+ onProgress === null || onProgress === void 0 || onProgress(progress);
22
+ break;
23
+ case "complete":
24
+ worker.terminate();
25
+ resolve(imageData$1);
26
+ break;
27
+ case "error":
28
+ worker.terminate();
29
+ reject(createError(error));
30
+ break;
31
+ }
32
+ };
33
+ worker.onerror = (error) => {
34
+ worker.terminate();
35
+ reject(createError(`Worker error: ${error.message}`));
36
+ };
37
+ worker.postMessage({
38
+ imageData,
39
+ pixelSize,
40
+ palette: paletteResolved,
41
+ background
42
+ });
43
+ });
44
+ }
45
+ async function loadImageAndGetData(imageSource) {
46
+ return new Promise((resolve, reject) => {
47
+ const img = imageSource instanceof HTMLImageElement ? imageSource : new Image();
48
+ const extractData = () => {
49
+ try {
50
+ const canvas = new OffscreenCanvas(img.width, img.height);
51
+ const ctx = canvas.getContext("2d");
52
+ if (!ctx) {
53
+ reject(createError("Cannot get Canvas context"));
54
+ return;
55
+ }
56
+ ctx.drawImage(img, 0, 0);
57
+ resolve(ctx.getImageData(0, 0, canvas.width, canvas.height));
58
+ } catch (error) {
59
+ reject(error);
60
+ }
61
+ };
62
+ if (!(imageSource instanceof HTMLImageElement)) {
63
+ img.crossOrigin = "anonymous";
64
+ img.onload = extractData;
65
+ img.onerror = () => reject(createError("Image loading failed"));
66
+ img.src = imageSource;
67
+ } else extractData();
68
+ });
69
+ }
70
+ export { pixelateImage as t };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,6 @@
1
- import { nextTick, type VNode } from 'vue';
2
1
  import type { PopoverProps } from './type';
3
2
  declare const _default: import("vue").DefineComponent<PopoverProps, {
4
- triggerContent: import("vue").ShallowRef<({
3
+ readonly triggerContent: ({
5
4
  $: import("vue").ComponentInternalInstance;
6
5
  $data: {};
7
6
  $props: {
@@ -13,11 +12,12 @@ declare const _default: import("vue").DefineComponent<PopoverProps, {
13
12
  readonly variant?: "dark" | "light" | undefined;
14
13
  readonly arrow?: boolean | undefined;
15
14
  readonly zIndex?: number | undefined;
16
- readonly target?: (HTMLElement | VNode | null) | undefined;
15
+ readonly target?: (HTMLElement | import("vue").VNode | null) | undefined;
17
16
  readonly root?: (HTMLElement | string) | undefined;
18
17
  readonly borderRadius?: number | undefined;
19
18
  readonly widthEqual?: boolean | undefined;
20
19
  readonly contentStyle?: import("vue").CSSProperties | undefined;
20
+ readonly destroyOnHide?: boolean | undefined;
21
21
  readonly onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
22
22
  readonly onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
23
23
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
@@ -52,6 +52,7 @@ declare const _default: import("vue").DefineComponent<PopoverProps, {
52
52
  visible: boolean | null;
53
53
  arrow: boolean;
54
54
  widthEqual: boolean;
55
+ destroyOnHide: boolean;
55
56
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
56
57
  beforeCreate?: (() => void) | (() => void)[];
57
58
  created?: (() => void) | (() => void)[];
@@ -70,7 +71,7 @@ declare const _default: import("vue").DefineComponent<PopoverProps, {
70
71
  errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
71
72
  };
72
73
  $forceUpdate: () => void;
73
- $nextTick: typeof nextTick;
74
+ $nextTick: typeof import("vue").nextTick;
74
75
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, ((cleanupFn: () => void) => void)]) => any : (...args: [any, any, ((cleanupFn: () => void) => void)]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
75
76
  } & Readonly<{
76
77
  variant: "dark" | "light";
@@ -80,113 +81,25 @@ declare const _default: import("vue").DefineComponent<PopoverProps, {
80
81
  visible: boolean | null;
81
82
  arrow: boolean;
82
83
  widthEqual: boolean;
84
+ destroyOnHide: boolean;
83
85
  }> & Omit<Readonly<import("../popup-content/type.ts").PopupContentProps> & Readonly<{
84
86
  onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
85
87
  onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
86
- }>, "content" | ("variant" | "placement" | "root" | "offset" | "visible" | "arrow" | "widthEqual") | "updateRenderState"> & import("vue").ShallowUnwrapRef<{
88
+ }>, "content" | "updateRenderState" | ("variant" | "placement" | "root" | "offset" | "visible" | "arrow" | "widthEqual" | "destroyOnHide")> & import("vue").ShallowUnwrapRef<{
87
89
  updateRenderState: () => void;
88
90
  content: import("vue").ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
89
91
  }> & {} & import("vue").ComponentCustomProperties & {} & {
90
92
  $slots: {
91
93
  content?: (props: {}) => any;
92
94
  };
93
- }) | undefined, ({
94
- $: import("vue").ComponentInternalInstance;
95
- $data: {};
96
- $props: {
97
- readonly content?: string | undefined;
98
- readonly visible?: boolean | null | undefined;
99
- readonly defaultVisible?: boolean | null | undefined;
100
- readonly placement?: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | undefined;
101
- readonly offset?: number | undefined;
102
- readonly variant?: "dark" | "light" | undefined;
103
- readonly arrow?: boolean | undefined;
104
- readonly zIndex?: number | undefined;
105
- readonly target?: (HTMLElement | VNode | null) | undefined;
106
- readonly root?: (HTMLElement | string) | undefined;
107
- readonly borderRadius?: number | undefined;
108
- readonly widthEqual?: boolean | undefined;
109
- readonly contentStyle?: import("vue").CSSProperties | undefined;
110
- readonly onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
111
- readonly onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
112
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
113
- $attrs: {
114
- [x: string]: unknown;
115
- };
116
- $refs: {
117
- [x: string]: unknown;
118
- };
119
- $slots: Readonly<{
120
- [name: string]: import("vue").Slot<any> | undefined;
121
- }>;
122
- $root: import("vue").ComponentPublicInstance | null;
123
- $parent: import("vue").ComponentPublicInstance | null;
124
- $host: Element | null;
125
- $emit: ((event: "contentMouseenter", e: MouseEvent) => void) & ((event: "contentMouseleave", e: MouseEvent) => void);
126
- $el: any;
127
- $options: import("vue").ComponentOptionsBase<Readonly<import("../popup-content/type.ts").PopupContentProps> & Readonly<{
128
- onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
129
- onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
130
- }>, {
131
- updateRenderState: () => void;
132
- content: import("vue").ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
133
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
134
- contentMouseenter: (e: MouseEvent) => any;
135
- contentMouseleave: (e: MouseEvent) => any;
136
- }, string, {
137
- variant: "dark" | "light";
138
- placement: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
139
- root: HTMLElement | string;
140
- offset: number;
141
- visible: boolean | null;
142
- arrow: boolean;
143
- widthEqual: boolean;
144
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
145
- beforeCreate?: (() => void) | (() => void)[];
146
- created?: (() => void) | (() => void)[];
147
- beforeMount?: (() => void) | (() => void)[];
148
- mounted?: (() => void) | (() => void)[];
149
- beforeUpdate?: (() => void) | (() => void)[];
150
- updated?: (() => void) | (() => void)[];
151
- activated?: (() => void) | (() => void)[];
152
- deactivated?: (() => void) | (() => void)[];
153
- beforeDestroy?: (() => void) | (() => void)[];
154
- beforeUnmount?: (() => void) | (() => void)[];
155
- destroyed?: (() => void) | (() => void)[];
156
- unmounted?: (() => void) | (() => void)[];
157
- renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
158
- renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
159
- errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
160
- };
161
- $forceUpdate: () => void;
162
- $nextTick: typeof nextTick;
163
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, ((cleanupFn: () => void) => void)]) => any : (...args: [any, any, ((cleanupFn: () => void) => void)]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
164
- } & Readonly<{
165
- variant: "dark" | "light";
166
- placement: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
167
- root: HTMLElement | string;
168
- offset: number;
169
- visible: boolean | null;
170
- arrow: boolean;
171
- widthEqual: boolean;
172
- }> & Omit<Readonly<import("../popup-content/type.ts").PopupContentProps> & Readonly<{
173
- onContentMouseenter?: ((e: MouseEvent) => any) | undefined;
174
- onContentMouseleave?: ((e: MouseEvent) => any) | undefined;
175
- }>, "content" | ("variant" | "placement" | "root" | "offset" | "visible" | "arrow" | "widthEqual") | "updateRenderState"> & import("vue").ShallowUnwrapRef<{
176
- updateRenderState: () => void;
177
- content: import("vue").ShallowRef<HTMLDivElement | null, HTMLDivElement | null>;
178
- }> & {} & import("vue").ComponentCustomProperties & {} & {
179
- $slots: {
180
- content?: (props: {}) => any;
181
- };
182
- }) | undefined>;
183
- updateRenderState: () => void;
95
+ }) | undefined;
96
+ updateRenderState(): void;
184
97
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
185
- close: (e: MouseEvent) => any;
98
+ close: (e: MouseEvent | TouchEvent) => any;
186
99
  open: (e: MouseEvent) => any;
187
100
  "update:visible": (value: boolean) => any;
188
101
  }, string, import("vue").PublicProps, Readonly<PopoverProps> & Readonly<{
189
- onClose?: ((e: MouseEvent) => any) | undefined;
102
+ onClose?: ((e: MouseEvent | TouchEvent) => any) | undefined;
190
103
  onOpen?: ((e: MouseEvent) => any) | undefined;
191
104
  "onUpdate:visible"?: ((value: boolean) => any) | undefined;
192
105
  }>, {
@@ -196,8 +109,9 @@ declare const _default: import("vue").DefineComponent<PopoverProps, {
196
109
  offset: number;
197
110
  visible: boolean | null;
198
111
  defaultVisible: boolean | null;
112
+ trigger: "hover" | "click";
199
113
  arrow: boolean;
200
114
  widthEqual: boolean;
201
- trigger: "hover" | "click";
115
+ destroyOnHide: boolean;
202
116
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
203
117
  export default _default;