@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,117 +1,101 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { ref, createVNode, render, nextTick } from "vue";
5
- import { _ as _sfc_main } from "./message-box.js";
6
- import { p, m } from "../aside/index.js";
7
- const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
8
- let nanoid = (size = 21) => {
9
- let id = "";
10
- let bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
11
- while (size--) {
12
- id += urlAlphabet[bytes[size] & 63];
13
- }
14
- return id;
1
+ import './css.js'
2
+ import { B as y, F as m, c as nanoid } from "../vendor.js";
3
+ import { t as message_box_default } from "./message-box.js";
4
+ import { n as _defineProperty } from "../index.js";
5
+ import { createVNode, nextTick, ref, render } from "vue";
6
+ var MessageManager = class {
7
+ constructor(options) {
8
+ _defineProperty(this, "messages", void 0);
9
+ _defineProperty(this, "messageBox", void 0);
10
+ _defineProperty(this, "container", null);
11
+ this.messages = ref([]);
12
+ this.messageBox = createVNode(message_box_default, {
13
+ messages: this.messages.value,
14
+ placement: options.placement,
15
+ onClose: (id$1) => {
16
+ const idx = this.messages.value.findIndex((e) => e.id === id$1);
17
+ if (idx >= 0) this.messages.value.splice(idx, 1);
18
+ }
19
+ });
20
+ const root = (y(options.root) ? document.querySelector(options.root) : options.root) || document.body;
21
+ const id = nanoid();
22
+ this.container = document.createElement("div");
23
+ this.container.id = id;
24
+ this.container.className = `px-message-box-wrapper`;
25
+ root.appendChild(this.container);
26
+ render(this.messageBox, this.container);
27
+ }
28
+ push(options) {
29
+ const id = options.id ?? nanoid();
30
+ this.messages.value.push({
31
+ ...options,
32
+ id
33
+ });
34
+ return id;
35
+ }
36
+ close(id) {
37
+ var _this$messageBox$comp;
38
+ (_this$messageBox$comp = this.messageBox.component) === null || _this$messageBox$comp === void 0 || (_this$messageBox$comp = _this$messageBox$comp.exposed) === null || _this$messageBox$comp === void 0 || _this$messageBox$comp.close(id);
39
+ }
40
+ clear() {
41
+ this.messages.value.length = 0;
42
+ }
43
+ unmount() {
44
+ if (this.container) {
45
+ const container = this.container;
46
+ render(this.messageBox, container);
47
+ nextTick(() => {
48
+ container.remove();
49
+ this.container = null;
50
+ });
51
+ }
52
+ }
15
53
  };
16
- class MessageManager {
17
- constructor(options) {
18
- __publicField(this, "messages");
19
- __publicField(this, "messageBox");
20
- __publicField(this, "container", null);
21
- this.messages = ref([]);
22
- this.messageBox = createVNode(_sfc_main, {
23
- messages: this.messages.value,
24
- placement: options.placement,
25
- onClose: (id2) => {
26
- const idx = this.messages.value.findIndex((e) => e.id === id2);
27
- if (idx >= 0) {
28
- this.messages.value.splice(idx, 1);
29
- }
30
- }
31
- });
32
- const root = (p(options.root) ? document.querySelector(options.root) : options.root) || document.body;
33
- const id = nanoid();
34
- this.container = document.createElement("div");
35
- this.container.id = id;
36
- this.container.className = `px-message-box-wrapper`;
37
- root.appendChild(this.container);
38
- render(this.messageBox, this.container);
39
- }
40
- push(options) {
41
- const id = options.id ?? nanoid();
42
- this.messages.value.push({
43
- ...options,
44
- id
45
- });
46
- return id;
47
- }
48
- close(id) {
49
- var _a, _b;
50
- (_b = (_a = this.messageBox.component) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close(id);
51
- }
52
- clear() {
53
- this.messages.value.length = 0;
54
- }
55
- unmount() {
56
- if (this.container) {
57
- const container = this.container;
58
- render(this.messageBox, container);
59
- nextTick(() => {
60
- container.remove();
61
- this.container = null;
62
- });
63
- }
64
- }
65
- }
66
- const messageManagers = {
67
- top: void 0,
68
- bottom: void 0,
69
- "top-left": void 0,
70
- "top-right": void 0,
71
- "bottom-left": void 0,
72
- "bottom-right": void 0
54
+ var messageManagers = {
55
+ top: void 0,
56
+ bottom: void 0,
57
+ "top-left": void 0,
58
+ "top-right": void 0,
59
+ "bottom-left": void 0,
60
+ "bottom-right": void 0
73
61
  };
74
- const messageCall = (options) => {
75
- if (p(options) || m(options)) {
76
- options = {
77
- content: options
78
- };
79
- }
80
- const placement = options.placement || options.position || "top";
81
- const currentManager = messageManagers[placement] ? messageManagers[placement] : messageManagers[placement] = new MessageManager({
82
- placement,
83
- root: options.root || "body"
84
- });
85
- const id = currentManager.push({
86
- content: options.content,
87
- icon: options.icon,
88
- duration: options.duration || 3e3,
89
- type: options.type || "normal",
90
- color: options.color,
91
- closable: options.closable
92
- });
93
- return {
94
- close: () => currentManager.close(id),
95
- clear: () => currentManager.clear()
96
- };
97
- };
98
- const message = messageCall;
99
- ["info", "success", "warning", "error", "loading", "sakura", "normal"].forEach(
100
- (key) => {
101
- message[key] = (options) => {
102
- if (p(options) || m(options)) {
103
- options = {
104
- content: options
105
- };
106
- }
107
- return message({
108
- ...options,
109
- type: key
110
- });
111
- };
112
- }
113
- );
114
- export {
115
- message as m,
116
- nanoid as n
62
+ var messageCall = (options) => {
63
+ if (y(options) || m(options)) options = { content: options };
64
+ const placement = options.placement || options.position || "top";
65
+ const currentManager = messageManagers[placement] ? messageManagers[placement] : messageManagers[placement] = new MessageManager({
66
+ placement,
67
+ root: options.root || "body"
68
+ });
69
+ const id = currentManager.push({
70
+ content: options.content,
71
+ icon: options.icon,
72
+ duration: options.duration || 3e3,
73
+ type: options.type || "normal",
74
+ color: options.color,
75
+ closable: options.closable
76
+ });
77
+ return {
78
+ close: () => currentManager.close(id),
79
+ clear: () => currentManager.clear()
80
+ };
117
81
  };
82
+ var message = messageCall;
83
+ [
84
+ "info",
85
+ "success",
86
+ "warning",
87
+ "error",
88
+ "loading",
89
+ "sakura",
90
+ "normal"
91
+ ].forEach((key) => {
92
+ message[key] = (options) => {
93
+ if (y(options) || m(options)) options = { content: options };
94
+ return message({
95
+ ...options,
96
+ type: key
97
+ });
98
+ };
99
+ });
100
+ var message_box_default$1 = message;
101
+ export { message_box_default$1 as t };
@@ -1,47 +1,34 @@
1
- import { defineComponent, useAttrs, ref, createBlock, openBlock, Teleport, createVNode, mergeProps, unref } from "vue";
2
- import { _ as _sfc_main$1 } from "./message-box.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- ...{
5
- name: "MessageBox"
6
- },
7
- __name: "message-box-wrapped",
8
- props: {
9
- messages: null,
10
- placement: null,
11
- position: null,
12
- zIndex: null,
13
- root: { default: "body" },
14
- "onUpdate:messages": { type: Function },
15
- onClose: { type: Function }
16
- },
17
- setup(__props, { expose: __expose }) {
18
- const props = __props;
19
- const attrs = useAttrs();
20
- const messageBoxRef = ref(null);
21
- __expose({
22
- close: (id) => {
23
- var _a;
24
- (_a = messageBoxRef.value) == null ? void 0 : _a.close(id);
25
- }
26
- });
27
- return (_ctx, _cache) => {
28
- return openBlock(), createBlock(Teleport, {
29
- to: props.root
30
- }, [
31
- createVNode(
32
- _sfc_main$1,
33
- mergeProps({ ...props, ...unref(attrs) }, {
34
- ref_key: "messageBoxRef",
35
- ref: messageBoxRef
36
- }),
37
- null,
38
- 16
39
- /* FULL_PROPS */
40
- )
41
- ], 8, ["to"]);
42
- };
43
- }
1
+ import { t as message_box_default } from "./message-box.js";
2
+ import { Teleport, createBlock, createVNode, defineComponent, mergeProps, openBlock, ref, unref, useAttrs } from "vue";
3
+ var message_box_wrapped_default = /* @__PURE__ */ defineComponent({
4
+ name: "MessageBox",
5
+ __name: "message-box-wrapped",
6
+ props: {
7
+ messages: null,
8
+ placement: null,
9
+ position: null,
10
+ zIndex: null,
11
+ root: { default: "body" },
12
+ "onUpdate:messages": { type: Function },
13
+ onClose: { type: Function }
14
+ },
15
+ setup(__props, { expose: __expose }) {
16
+ const props = __props;
17
+ const attrs = useAttrs();
18
+ const messageBoxRef = ref(null);
19
+ __expose({ close: (id) => {
20
+ var _messageBoxRef$value;
21
+ (_messageBoxRef$value = messageBoxRef.value) === null || _messageBoxRef$value === void 0 || _messageBoxRef$value.close(id);
22
+ } });
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createBlock(Teleport, { to: props.root }, [createVNode(message_box_default, mergeProps({
25
+ ...props,
26
+ ...unref(attrs)
27
+ }, {
28
+ ref_key: "messageBoxRef",
29
+ ref: messageBoxRef
30
+ }), null, 16)], 8, ["to"]);
31
+ };
32
+ }
44
33
  });
45
- export {
46
- _sfc_main as _
47
- };
34
+ export { message_box_wrapped_default as t };
@@ -1,112 +1,80 @@
1
- import './css.js'
2
- import { defineComponent, useModel, computed, shallowRef, createElementBlock, openBlock, normalizeStyle, unref, createElementVNode, normalizeClass, Fragment, renderList, createBlock } from "vue";
3
- import { N } from "../aside/index.js";
4
- import { _ as _sfc_main$1 } from "../message/index.js";
5
- import { n as nanoid } from "./index.js";
6
- import { u as useZIndex } from "../share/hook/use-z-index.js";
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- ...{
9
- name: "MessageBoxInner"
10
- },
11
- __name: "message-box",
12
- props: {
13
- messages: {},
14
- placement: { default: "top" },
15
- position: { default: "top" },
16
- zIndex: {},
17
- root: {},
18
- "onUpdate:messages": {}
19
- },
20
- emits: ["close"],
21
- setup(__props, { expose: __expose, emit: __emit }) {
22
- const props = __props;
23
- const [currentZIndex] = useZIndex("message");
24
- const messages = useModel(props, "messages");
25
- const emits = __emit;
26
- const clone = computed(() => {
27
- return messages.value.map((e) => {
28
- return {
29
- ...e,
30
- id: e.id ?? nanoid()
31
- };
32
- });
33
- });
34
- const closeHandler = (id) => {
35
- if (N(id)) {
36
- return;
37
- }
38
- if (props["onUpdate:messages"]) {
39
- const idx = clone.value.findIndex((item) => item.id === id);
40
- if (idx >= 0) {
41
- const cur = [...clone.value];
42
- cur.splice(idx, 1);
43
- messages.value = cur;
44
- }
45
- }
46
- emits("close", id);
47
- };
48
- const messageRef = shallowRef([]);
49
- __expose({
50
- close: (id) => {
51
- var _a;
52
- const idx = clone.value.findIndex((e) => e.id === id);
53
- if (idx === -1) {
54
- return;
55
- }
56
- (_a = messageRef.value[idx]) == null ? void 0 : _a.close();
57
- }
58
- });
59
- return (_ctx, _cache) => {
60
- return openBlock(), createElementBlock(
61
- "div",
62
- {
63
- class: "px-message-box",
64
- style: normalizeStyle({
65
- zIndex: props.zIndex ?? unref(currentZIndex)
66
- })
67
- },
68
- [
69
- createElementVNode(
70
- "div",
71
- {
72
- class: normalizeClass(["px-message-box-container", {
73
- [`px-message-box-container__${props.placement || props.position || "top"}`]: true
74
- }])
75
- },
76
- [
77
- (openBlock(true), createElementBlock(
78
- Fragment,
79
- null,
80
- renderList(clone.value, (message) => {
81
- return openBlock(), createBlock(_sfc_main$1, {
82
- key: message.id,
83
- duration: message.duration,
84
- content: message.content,
85
- id: message.id,
86
- onClose: closeHandler,
87
- type: message.type,
88
- color: message.color,
89
- icon: message.icon,
90
- closable: message.closable,
91
- ref_for: true,
92
- ref_key: "messageRef",
93
- ref: messageRef
94
- }, null, 8, ["duration", "content", "id", "type", "color", "icon", "closable"]);
95
- }),
96
- 128
97
- /* KEYED_FRAGMENT */
98
- ))
99
- ],
100
- 2
101
- /* CLASS */
102
- )
103
- ],
104
- 4
105
- /* STYLE */
106
- );
107
- };
108
- }
1
+ import { _ as E, c as nanoid } from "../vendor.js";
2
+ import { t as message_default } from "../message/index.js";
3
+ import { t as useZIndex } from "../share/hook/use-z-index.js";
4
+ import { Fragment, computed, createBlock, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, renderList, shallowRef, unref, useModel } from "vue";
5
+ var message_box_default = /* @__PURE__ */ defineComponent({
6
+ name: "MessageBoxInner",
7
+ __name: "message-box",
8
+ props: {
9
+ messages: {},
10
+ placement: { default: "top" },
11
+ position: { default: "top" },
12
+ zIndex: {},
13
+ root: {},
14
+ "onUpdate:messages": {}
15
+ },
16
+ emits: ["close"],
17
+ setup(__props, { expose: __expose, emit: __emit }) {
18
+ const props = __props;
19
+ const [currentZIndex] = useZIndex("message");
20
+ const messages = useModel(props, "messages");
21
+ const emits = __emit;
22
+ const clone = computed(() => {
23
+ return messages.value.map((e) => {
24
+ return {
25
+ ...e,
26
+ id: e.id ?? nanoid()
27
+ };
28
+ });
29
+ });
30
+ const closeHandler = (id) => {
31
+ if (E(id)) return;
32
+ if (props["onUpdate:messages"]) {
33
+ const idx = clone.value.findIndex((item) => item.id === id);
34
+ if (idx >= 0) {
35
+ const cur = [...clone.value];
36
+ cur.splice(idx, 1);
37
+ messages.value = cur;
38
+ }
39
+ }
40
+ emits("close", id);
41
+ };
42
+ const messageRef = shallowRef([]);
43
+ __expose({ close: (id) => {
44
+ var _messageRef$value$idx;
45
+ const idx = clone.value.findIndex((e) => e.id === id);
46
+ if (idx === -1) return;
47
+ (_messageRef$value$idx = messageRef.value[idx]) === null || _messageRef$value$idx === void 0 || _messageRef$value$idx.close();
48
+ } });
49
+ return (_ctx, _cache) => {
50
+ return openBlock(), createElementBlock("div", {
51
+ class: "px-message-box",
52
+ style: normalizeStyle({ zIndex: props.zIndex ?? unref(currentZIndex) })
53
+ }, [createElementVNode("div", { class: normalizeClass(["px-message-box-container", { [`px-message-box-container__${props.placement || props.position || "top"}`]: true }]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(clone.value, (message) => {
54
+ return openBlock(), createBlock(message_default, {
55
+ key: message.id,
56
+ duration: message.duration,
57
+ content: message.content,
58
+ id: message.id,
59
+ onClose: closeHandler,
60
+ type: message.type,
61
+ color: message.color,
62
+ icon: message.icon,
63
+ closable: message.closable,
64
+ ref_for: true,
65
+ ref_key: "messageRef",
66
+ ref: messageRef
67
+ }, null, 8, [
68
+ "duration",
69
+ "content",
70
+ "id",
71
+ "type",
72
+ "color",
73
+ "icon",
74
+ "closable"
75
+ ]);
76
+ }), 128))], 2)], 4);
77
+ };
78
+ }
109
79
  });
110
- export {
111
- _sfc_main as _
112
- };
80
+ export { message_box_default as t };
@@ -1,9 +1,6 @@
1
1
  .px-option-list {
2
- --item-size: var(--px-medium-base-size);
3
- --px-padding-x: var(--px-interval-1);
4
- --px-padding-group-x: var(--px-interval-2);
5
2
  overflow: auto;
6
- max-height: calc(var(--item-size) * 6);
3
+ max-height: 168px;
7
4
  background-color: var(--px-neutral-1);
8
5
  color: var(--px-neutral-10);
9
6
  list-style: none;
@@ -11,19 +8,25 @@
11
8
  margin-top: 0;
12
9
  margin-bottom: 0;
13
10
  }
11
+ .px-option-list-virtual-list.px-virtual-list {
12
+ height: 168px;
13
+ }
14
14
  .px-option-list-item {
15
15
  overflow: hidden;
16
16
  text-overflow: ellipsis;
17
17
  white-space: nowrap;
18
- height: var(--item-size);
18
+ height: 28px;
19
19
  display: flex;
20
20
  align-items: center;
21
21
  cursor: pointer;
22
22
  transition: background-color 0.25s;
23
- padding-left: var(--px-padding-x);
24
- padding-right: var(--px-padding-x);
23
+ padding-left: 4px;
24
+ padding-right: 4px;
25
25
  background-color: var(--px-neutral-1);
26
26
  }
27
+ .px-option-list-item__child {
28
+ padding-left: 16px;
29
+ }
27
30
  .px-option-list-item:hover {
28
31
  background-color: var(--px-primary-1);
29
32
  }
@@ -41,17 +44,14 @@
41
44
  .px-option-list-item__active {
42
45
  color: var(--px-primary-6);
43
46
  }
44
- .px-option-list-item-group .px-option-list-item {
45
- padding-left: var(--px-padding-group-x);
46
- }
47
47
  .px-option-list-item-group-label {
48
48
  overflow: hidden;
49
49
  text-overflow: ellipsis;
50
50
  white-space: nowrap;
51
51
  color: var(--px-neutral-9);
52
- height: var(--item-size);
52
+ height: 28px;
53
53
  display: flex;
54
54
  align-items: center;
55
- padding-left: var(--px-padding-x);
56
- padding-right: var(--px-padding-x);
55
+ padding-left: 4px;
56
+ padding-right: 4px;
57
57
  }
@@ -1,38 +1,11 @@
1
1
  import type { OptionListGroupOption, OptionListOption, OptionListProps } from './type';
2
- declare var __VLS_1: {
3
- option: string;
4
- }, __VLS_3: {
5
- option: OptionListOption | OptionListGroupOption;
6
- }, __VLS_5: {
7
- option: OptionListGroupOption;
8
- }, __VLS_7: {
9
- option: string;
10
- }, __VLS_9: {
11
- option: OptionListOption;
12
- };
13
- type __VLS_Slots = {} & {
14
- option?: (props: typeof __VLS_1) => any;
15
- } & {
16
- option?: (props: typeof __VLS_3) => any;
17
- } & {
18
- 'group-label'?: (props: typeof __VLS_5) => any;
19
- } & {
20
- option?: (props: typeof __VLS_7) => any;
21
- } & {
22
- option?: (props: typeof __VLS_9) => any;
23
- };
24
- declare const __VLS_component: import("vue").DefineComponent<OptionListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
- select: (value: any, option: string | OptionListOption, e: MouseEvent) => any;
2
+ declare const _default: import("vue").DefineComponent<OptionListProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ select: (value: any, option: string | OptionListOption<any>, e: MouseEvent) => any;
26
4
  }, string, import("vue").PublicProps, Readonly<OptionListProps> & Readonly<{
27
- onSelect?: ((value: any, option: string | OptionListOption, e: MouseEvent) => any) | undefined;
5
+ onSelect?: ((value: any, option: string | OptionListOption<any>, e: MouseEvent) => any) | undefined;
28
6
  }>, {
29
7
  options: (string | OptionListOption | OptionListGroupOption)[];
30
8
  activeValues: any[];
9
+ virtualScroll: boolean;
31
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
33
11
  export default _default;
34
- type __VLS_WithSlots<T, S> = T & {
35
- new (): {
36
- $slots: S;
37
- };
38
- };