@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.
- package/README.md +42 -0
- package/README.zh.md +6 -3
- package/dist/font.css +1 -1
- package/dist/index.d.ts +1602 -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 +7407 -5854
- package/dist/pixelium-vue.umd.cjs +2 -2
- package/es/aside/index.css +1 -0
- 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.css +1 -0
- 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.css +1 -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.css +1 -0
- 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 +144 -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.css +4 -0
- package/es/main/index.d.ts +4 -1
- package/es/main/index.js +15 -15
- package/es/main/type.d.ts +7 -0
- 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/style/index.css +5 -0
- 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/option-list/index.js
CHANGED
|
@@ -1,169 +1,101 @@
|
|
|
1
1
|
import './css.js'
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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 };
|
package/es/option-list/type.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { GroupOption, Option } from '../share/type';
|
|
2
|
-
|
|
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 {};
|
package/es/popover/index.d.ts
CHANGED
|
@@ -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:
|
|
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"
|
|
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
|
-
|
|
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
|
-
|
|
115
|
+
destroyOnHide: boolean;
|
|
202
116
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
203
117
|
export default _default;
|