@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.
- package/README.md +42 -0
- package/README.zh.md +6 -3
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/coverage-final.json +106 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +926 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/dist/font.css +1 -1
- package/dist/index.d.ts +1593 -248
- package/dist/normalize.css +2 -0
- package/dist/pixelium-vue-icon-hn.cjs +1 -1
- package/dist/pixelium-vue-icon-hn.css +2 -1
- package/dist/pixelium-vue-icon-hn.js +8533 -8154
- package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.css +2 -1
- package/dist/pixelium-vue-icon-pa.js +10625 -10143
- package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
- package/dist/pixelium-vue.cjs +2 -2
- package/dist/pixelium-vue.css +2 -1
- package/dist/pixelium-vue.js +7402 -5854
- package/dist/pixelium-vue.umd.cjs +2 -2
- package/es/aside/index.js +46 -151
- package/es/auto-complete/draw.d.ts +1 -1
- package/es/auto-complete/draw.js +26 -51
- package/es/auto-complete/index.css +92 -32
- package/es/auto-complete/index.d.ts +12 -15
- package/es/auto-complete/index.js +338 -400
- package/es/auto-complete/type.d.ts +25 -13
- package/es/avatar/css.js +2 -0
- package/es/avatar/draw.d.ts +2 -0
- package/es/avatar/draw.js +11 -0
- package/es/avatar/index.css +49 -0
- package/es/avatar/index.d.ts +15 -0
- package/es/avatar/index.js +110 -0
- package/es/avatar/type.d.ts +34 -0
- package/es/button/draw.d.ts +4 -4
- package/es/button/draw.js +213 -297
- package/es/button/index.css +40 -30
- package/es/button/index.d.ts +0 -4
- package/es/button/index.js +230 -256
- package/es/button/type.d.ts +3 -3
- package/es/button-group/index.css +0 -3
- package/es/button-group/index.d.ts +1 -2
- package/es/button-group/index.js +59 -31
- package/es/button-group/type.d.ts +21 -4
- package/es/checkbox/css.js +2 -0
- package/es/checkbox/draw.d.ts +4 -0
- package/es/checkbox/draw.js +46 -0
- package/es/checkbox/index.css +85 -0
- package/es/checkbox/index.d.ts +31 -0
- package/es/checkbox/index.js +206 -0
- package/es/checkbox/type.d.ts +88 -0
- package/es/checkbox-group/css.js +2 -0
- package/es/checkbox-group/index.css +20 -0
- package/es/checkbox-group/index.d.ts +23 -0
- package/es/checkbox-group/index.js +84 -0
- package/es/checkbox-group/type.d.ts +78 -0
- package/es/col/index.d.ts +2 -2
- package/es/col/index.js +43 -58
- package/es/container/index.js +18 -31
- package/es/divider/index.js +39 -53
- package/es/empty/index.css +4 -4
- package/es/empty/index.js +16 -71
- package/es/entry.js +102 -0
- package/es/footer/index.js +31 -40
- package/es/form/css.js +1 -0
- package/es/form/index.d.ts +27 -0
- package/es/form/index.js +125 -0
- package/es/form/type.d.ts +238 -0
- package/es/form/use-form.d.ts +4 -0
- package/es/form/use-form.js +48 -0
- package/es/form-item/css.js +2 -0
- package/es/form-item/index.css +77 -0
- package/es/form-item/index.d.ts +37 -0
- package/es/form-item/index.js +318 -0
- package/es/form-item/type.d.ts +96 -0
- package/es/grid/index.js +56 -75
- package/es/grid-item/css.js +0 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/grid-item/index.js +85 -121
- package/es/header/index.js +31 -40
- package/es/icon/index.js +44 -55
- package/es/icons/css-hn.js +0 -1
- package/es/icons/css-pa.js +0 -1
- package/es/icons/icon-hn.js +10337 -15986
- package/es/icons/icon-pa.js +12573 -17447
- package/es/image/css.js +2 -0
- package/es/image/index.css +69 -0
- package/es/image/index.d.ts +35 -0
- package/es/image/index.js +199 -0
- package/es/image/type.d.ts +126 -0
- package/es/index.css +1 -515
- package/es/index.d.ts +22 -2
- package/es/index.js +143 -123
- package/es/input/draw.d.ts +1 -1
- package/es/input/draw.js +26 -51
- package/es/input/index.css +85 -33
- package/es/input/index.d.ts +9 -16
- package/es/input/index.js +319 -423
- package/es/input/type.d.ts +3 -3
- package/es/input-group/index.css +0 -1
- package/es/input-group/index.d.ts +2 -2
- package/es/input-group/index.js +66 -37
- package/es/input-group/type.d.ts +16 -4
- package/es/input-group-label/draw.d.ts +1 -1
- package/es/input-group-label/draw.js +26 -51
- package/es/input-group-label/index.css +33 -22
- package/es/input-group-label/index.d.ts +1 -4
- package/es/input-group-label/index.js +104 -127
- package/es/input-group-label/type.d.ts +3 -3
- package/es/input-number/draw.d.ts +1 -1
- package/es/input-number/draw.js +26 -51
- package/es/input-number/index.css +90 -35
- package/es/input-number/index.d.ts +9 -16
- package/es/input-number/index.js +428 -536
- package/es/input-number/type.d.ts +3 -3
- package/es/input-tag/draw.d.ts +1 -1
- package/es/input-tag/draw.js +26 -48
- package/es/input-tag/index.css +100 -33
- package/es/input-tag/index.d.ts +7 -13
- package/es/input-tag/index.js +442 -467
- package/es/input-tag/type.d.ts +24 -13
- package/es/link/index.js +75 -106
- package/es/main/index.js +11 -15
- package/es/mask/index.js +94 -115
- package/es/message/index.css +1 -1
- package/es/message/index.js +168 -346
- package/es/message-box/css.js +1 -1
- package/es/message-box/index.js +98 -114
- package/es/message-box/message-box-wrapped.js +33 -46
- package/es/message-box/message-box.js +79 -111
- package/es/option-list/index.css +13 -13
- package/es/option-list/index.d.ts +4 -31
- package/es/option-list/index.js +99 -167
- package/es/option-list/type.d.ts +5 -1
- package/es/pixelate/pixel.d.ts +5 -0
- package/es/pixelate/pixel.js +70 -0
- package/es/pixelate/pixelate.worker.d.ts +1 -0
- package/es/popover/index.d.ts +13 -99
- package/es/popover/index.js +75 -238
- package/es/popover/type.d.ts +7 -2
- package/es/popup/css.js +1 -0
- package/es/popup/index.d.ts +210 -0
- package/es/popup/index.js +203 -0
- package/es/popup/type.d.ts +105 -0
- package/es/popup-content/draw.d.ts +2 -2
- package/es/popup-content/draw.js +98 -143
- package/es/popup-content/index.css +11 -11
- package/es/popup-content/index.d.ts +1 -0
- package/es/popup-content/index.js +253 -1576
- package/es/popup-content/type.d.ts +1 -0
- package/es/popup-trigger/index.d.ts +8 -2
- package/es/popup-trigger/index.js +122 -95
- package/es/popup-trigger/type.d.ts +4 -1
- package/es/popup-wrapper/css.js +2 -0
- package/es/popup-wrapper/index.css +14 -0
- package/es/popup-wrapper/index.d.ts +18 -0
- package/es/popup-wrapper/index.js +67 -0
- package/es/popup-wrapper/type.d.ts +9 -0
- package/es/radio/css.js +1 -0
- package/es/radio/draw.d.ts +4 -0
- package/es/radio/draw.js +47 -0
- package/es/radio/index.d.ts +30 -0
- package/es/radio/index.js +190 -0
- package/es/radio/style.css +73 -0
- package/es/radio/type.d.ts +76 -0
- package/es/radio-group/css.js +2 -0
- package/es/radio-group/index.css +20 -0
- package/es/radio-group/index.d.ts +23 -0
- package/es/radio-group/index.js +77 -0
- package/es/radio-group/type.d.ts +77 -0
- package/es/row/index.js +56 -70
- package/es/select/draw.d.ts +1 -1
- package/es/select/draw.js +26 -51
- package/es/select/index.css +118 -36
- package/es/select/index.d.ts +14 -16
- package/es/select/index.js +625 -675
- package/es/select/type.d.ts +60 -25
- package/es/share/const/event-bus-key.js +1 -6
- package/es/share/const/index.d.ts +4 -0
- package/es/share/const/index.js +22 -24
- package/es/share/const/provide-key.d.ts +5 -0
- package/es/share/const/provide-key.js +6 -5
- package/es/share/const/style.d.ts +6 -0
- package/es/share/const/style.js +7 -0
- package/es/share/hook/use-cancelable-delay.d.ts +1 -0
- package/es/share/hook/use-cancelable-delay.js +42 -0
- package/es/share/hook/use-click-outside-listener.d.ts +1 -1
- package/es/share/hook/use-click-outside-listener.js +28 -41
- package/es/share/hook/use-composition.js +17 -15
- package/es/share/hook/use-controlled-mode.d.ts +3 -3
- package/es/share/hook/use-controlled-mode.js +20 -23
- package/es/share/hook/use-dark-mode.js +51 -65
- package/es/share/hook/use-index-of-children.d.ts +2 -1
- package/es/share/hook/use-index-of-children.js +47 -45
- package/es/share/hook/use-lazy-load.d.ts +10 -0
- package/es/share/hook/use-lazy-load.js +133 -0
- package/es/share/hook/use-props-detect.d.ts +2 -0
- package/es/share/hook/use-resize-observer.d.ts +1 -2
- package/es/share/hook/use-resize-observer.js +28 -20
- package/es/share/hook/use-screen-width.js +27 -36
- package/es/share/hook/use-smooth-transition.d.ts +2 -0
- package/es/share/hook/use-smooth-transition.js +65 -0
- package/es/share/hook/use-textarea-height.js +86 -92
- package/es/share/hook/use-theme-mode.js +41 -42
- package/es/share/hook/use-transition-end.d.ts +2 -0
- package/es/share/hook/use-transition-end.js +12 -0
- package/es/share/hook/use-watch-global-css-var.js +12 -16
- package/es/share/hook/use-window-resize-listener.d.ts +1 -0
- package/es/share/hook/use-window-resize-listener.js +15 -0
- package/es/share/hook/use-z-index.js +30 -27
- package/es/share/type/index.d.ts +18 -3
- package/es/share/util/color.d.ts +5 -3
- package/es/share/util/color.js +156 -149
- package/es/share/util/common.d.ts +7 -2
- package/es/share/util/common.js +127 -65
- package/es/share/util/console.d.ts +3 -3
- package/es/share/util/console.js +10 -7
- package/es/share/util/dom.d.ts +19 -0
- package/es/share/util/dom.js +88 -0
- package/es/share/util/env.d.ts +1 -0
- package/es/share/util/env.js +5 -4
- package/es/share/util/event-bus.js +3 -20
- package/es/share/util/lru-cache.js +29 -33
- package/es/share/util/pixel.d.ts +4 -0
- package/es/share/util/plot.d.ts +8 -3
- package/es/share/util/plot.js +457 -229
- package/es/share/util/reactivity.d.ts +8 -0
- package/es/share/util/reactivity.js +23 -0
- package/es/share/util/render.js +31 -41
- package/es/share/util/theme.d.ts +3 -0
- package/es/share/util/theme.js +77 -57
- package/es/slider/css.js +2 -0
- package/es/slider/draw.d.ts +25 -0
- package/es/slider/draw.js +113 -0
- package/es/slider/index.css +119 -0
- package/es/slider/index.d.ts +66 -0
- package/es/slider/index.js +503 -0
- package/es/slider/type.d.ts +162 -0
- package/es/slider/util.d.ts +37 -0
- package/es/slider/util.js +130 -0
- package/es/space/index.css +24 -29
- package/es/space/index.js +73 -97
- package/es/spin/index.css +18 -17
- package/es/spin/index.js +72 -102
- package/es/spin/type.d.ts +11 -5
- package/es/switch/css.js +2 -0
- package/es/switch/draw.d.ts +2 -0
- package/es/switch/draw.js +18 -0
- package/es/switch/index.css +121 -0
- package/es/switch/index.d.ts +42 -0
- package/es/switch/index.js +259 -0
- package/es/switch/type.d.ts +133 -0
- package/es/tag/draw.d.ts +2 -2
- package/es/tag/draw.js +80 -127
- package/es/tag/index.css +38 -22
- package/es/tag/index.d.ts +2 -2
- package/es/tag/index.js +121 -190
- package/es/tag/type.d.ts +3 -3
- package/es/text-outline/css.js +2 -0
- package/es/text-outline/index.css +4 -0
- package/es/text-outline/index.d.ts +17 -0
- package/es/text-outline/index.js +33 -0
- package/es/text-outline/type.d.ts +23 -0
- package/es/textarea/draw.js +9 -11
- package/es/textarea/index.css +37 -23
- package/es/textarea/index.d.ts +8 -14
- package/es/textarea/index.js +274 -262
- package/es/tooltip/index.d.ts +100 -4
- package/es/tooltip/index.js +70 -226
- package/es/tooltip/type.d.ts +7 -2
- package/es/vendor.js +504 -0
- package/es/virtual-list/css.js +2 -0
- package/es/virtual-list/index.css +25 -0
- package/es/virtual-list/index.d.ts +11 -0
- package/es/virtual-list/index.js +313 -0
- package/es/virtual-list/type.d.ts +26 -0
- package/package.json +10 -16
- package/es/grid-item/index.css +0 -0
- /package/es/message-box/{message-box.css → index.css} +0 -0
package/es/message-box/index.js
CHANGED
|
@@ -1,117 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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 };
|
package/es/option-list/index.css
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
24
|
-
padding-right:
|
|
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:
|
|
52
|
+
height: 28px;
|
|
53
53
|
display: flex;
|
|
54
54
|
align-items: center;
|
|
55
|
-
padding-left:
|
|
56
|
-
padding-right:
|
|
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
|
|
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
|
|
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
|
-
};
|