@pixelium/web-vue 0.0.2 → 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 -5852
- 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 -672
- 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
|
@@ -7,15 +7,21 @@ declare const _default: import("vue").DefineComponent<PopupTriggerProps, {
|
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
}> | null>;
|
|
9
9
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
-
close: (e: MouseEvent) => any;
|
|
10
|
+
close: (e: MouseEvent | TouchEvent) => any;
|
|
11
|
+
drag: (event: MouseEvent | TouchEvent) => any;
|
|
11
12
|
open: (node: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
12
13
|
[key: string]: any;
|
|
13
14
|
}>, e: MouseEvent) => any;
|
|
15
|
+
dragStart: (event: MouseEvent | TouchEvent) => any;
|
|
16
|
+
dragEnd: (event: MouseEvent | TouchEvent) => any;
|
|
14
17
|
}, string, import("vue").PublicProps, Readonly<PopupTriggerProps> & Readonly<{
|
|
15
|
-
onClose?: ((e: MouseEvent) => any) | undefined;
|
|
18
|
+
onClose?: ((e: MouseEvent | TouchEvent) => any) | undefined;
|
|
19
|
+
onDrag?: ((event: MouseEvent | TouchEvent) => any) | undefined;
|
|
16
20
|
onOpen?: ((node: VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
21
|
[key: string]: any;
|
|
18
22
|
}>, e: MouseEvent) => any) | undefined;
|
|
23
|
+
onDragStart?: ((event: MouseEvent | TouchEvent) => any) | undefined;
|
|
24
|
+
onDragEnd?: ((event: MouseEvent | TouchEvent) => any) | undefined;
|
|
19
25
|
}>, {
|
|
20
26
|
trigger: "hover" | "click";
|
|
21
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,97 +1,124 @@
|
|
|
1
1
|
import './css.js'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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
|
-
|
|
2
|
+
import { F as m } from "../vendor.js";
|
|
3
|
+
import { r as GET_ELEMENT_RENDERED } from "../share/const/index.js";
|
|
4
|
+
import { t as inBrowser } from "../share/util/env.js";
|
|
5
|
+
import { n as isTextVNode, t as flattenVNodes } from "../share/util/render.js";
|
|
6
|
+
import { t as useClickOutsideListener } from "../share/hook/use-click-outside-listener.js";
|
|
7
|
+
import { r as checkMouseInsideElementFromEvent } from "../share/util/dom.js";
|
|
8
|
+
import { Fragment, cloneVNode, createVNode, defineComponent, ref, shallowRef, useSlots } from "vue";
|
|
9
|
+
var popup_trigger_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "PopupTrigger",
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
trigger: { default: "hover" },
|
|
14
|
+
disabled: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
emits: [
|
|
17
|
+
"close",
|
|
18
|
+
"open",
|
|
19
|
+
"drag",
|
|
20
|
+
"dragStart",
|
|
21
|
+
"dragEnd"
|
|
22
|
+
],
|
|
23
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const emits = __emit;
|
|
26
|
+
const currentTrigger = shallowRef(null);
|
|
27
|
+
async function openHandler(node, e) {
|
|
28
|
+
if (inBrowser()) {
|
|
29
|
+
let triggerEl = null;
|
|
30
|
+
if (node.el instanceof HTMLElement || node.el instanceof SVGElement) triggerEl = node.el;
|
|
31
|
+
else {
|
|
32
|
+
var _node$component;
|
|
33
|
+
const getElFunc = (_node$component = node.component) === null || _node$component === void 0 || (_node$component = _node$component.exposed) === null || _node$component === void 0 ? void 0 : _node$component[GET_ELEMENT_RENDERED];
|
|
34
|
+
if (m(getElFunc)) {
|
|
35
|
+
const el = getElFunc();
|
|
36
|
+
if (el instanceof HTMLElement || el instanceof SVGElement) triggerEl = el;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
currentTrigger.value = triggerEl;
|
|
40
|
+
}
|
|
41
|
+
if (props.disabled) return;
|
|
42
|
+
emits("open", node, e);
|
|
43
|
+
}
|
|
44
|
+
const dragging = ref(false);
|
|
45
|
+
async function closeHandler(e) {
|
|
46
|
+
if (props.disabled) return;
|
|
47
|
+
if (dragging.value) return;
|
|
48
|
+
emits("close", e);
|
|
49
|
+
}
|
|
50
|
+
const slots = useSlots();
|
|
51
|
+
const clickOutsideHandler = (event) => {
|
|
52
|
+
if (props.trigger === "click") closeHandler(event);
|
|
53
|
+
};
|
|
54
|
+
useClickOutsideListener(currentTrigger, clickOutsideHandler);
|
|
55
|
+
const firstVNodeRef = shallowRef(null);
|
|
56
|
+
__expose({ firstVNode: firstVNodeRef });
|
|
57
|
+
function handleDrag(e) {
|
|
58
|
+
emits("drag", e);
|
|
59
|
+
}
|
|
60
|
+
function stopDrag(e) {
|
|
61
|
+
dragging.value = false;
|
|
62
|
+
if (!currentTrigger.value) closeHandler(e);
|
|
63
|
+
else {
|
|
64
|
+
const el = currentTrigger.value;
|
|
65
|
+
if (!(el instanceof HTMLElement) && !(el instanceof SVGElement)) closeHandler(e);
|
|
66
|
+
else if (!checkMouseInsideElementFromEvent(el, e)) closeHandler(e);
|
|
67
|
+
}
|
|
68
|
+
document.removeEventListener("mousemove", handleDrag);
|
|
69
|
+
document.removeEventListener("mouseup", stopDrag);
|
|
70
|
+
document.removeEventListener("touchmove", handleDrag);
|
|
71
|
+
document.removeEventListener("touchend", stopDrag);
|
|
72
|
+
emits("dragEnd", e);
|
|
73
|
+
}
|
|
74
|
+
const startDrag = (e) => {
|
|
75
|
+
dragging.value = true;
|
|
76
|
+
document.addEventListener("mousemove", handleDrag);
|
|
77
|
+
document.addEventListener("mouseup", stopDrag);
|
|
78
|
+
document.addEventListener("touchmove", handleDrag);
|
|
79
|
+
document.addEventListener("touchend", stopDrag);
|
|
80
|
+
emits("dragStart", e);
|
|
81
|
+
};
|
|
82
|
+
const initCurrentTrigger = (e) => {
|
|
83
|
+
if (currentTrigger.value) return;
|
|
84
|
+
if (e instanceof HTMLElement || e instanceof SVGElement) currentTrigger.value = e;
|
|
85
|
+
};
|
|
86
|
+
return () => {
|
|
87
|
+
var _slots$default;
|
|
88
|
+
return createVNode(Fragment, null, [flattenVNodes(((_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)) || []).map((child, index) => {
|
|
89
|
+
if (isTextVNode(child)) {
|
|
90
|
+
const node = props.trigger === "click" ? createVNode("span", {
|
|
91
|
+
"onClick": (e) => openHandler(node, e),
|
|
92
|
+
"onMousedown": startDrag,
|
|
93
|
+
"onTouchstartPassive": startDrag,
|
|
94
|
+
"ref": initCurrentTrigger
|
|
95
|
+
}, [child]) : createVNode("span", {
|
|
96
|
+
"onMouseenter": (e) => openHandler(node, e),
|
|
97
|
+
"onMouseleave": (e) => closeHandler(e),
|
|
98
|
+
"onMousedown": startDrag,
|
|
99
|
+
"onTouchstartPassive": startDrag,
|
|
100
|
+
"ref": initCurrentTrigger
|
|
101
|
+
}, [child]);
|
|
102
|
+
if (index === 0) firstVNodeRef.value = node;
|
|
103
|
+
return node;
|
|
104
|
+
} else {
|
|
105
|
+
const clone = cloneVNode(child, props.trigger === "click" ? {
|
|
106
|
+
onClick: (e) => openHandler(clone, e),
|
|
107
|
+
onMousedown: startDrag,
|
|
108
|
+
onTouchstart: startDrag,
|
|
109
|
+
ref: initCurrentTrigger
|
|
110
|
+
} : {
|
|
111
|
+
onMouseenter: (e) => openHandler(clone, e),
|
|
112
|
+
onMouseleave: (e) => closeHandler(e),
|
|
113
|
+
onMousedown: startDrag,
|
|
114
|
+
onTouchstart: startDrag,
|
|
115
|
+
ref: initCurrentTrigger
|
|
116
|
+
}, true);
|
|
117
|
+
if (index === 0) firstVNodeRef.value = clone;
|
|
118
|
+
return clone;
|
|
119
|
+
}
|
|
120
|
+
})]);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
94
123
|
});
|
|
95
|
-
export {
|
|
96
|
-
_sfc_main as _
|
|
97
|
-
};
|
|
124
|
+
export { popup_trigger_default as t };
|
|
@@ -4,6 +4,9 @@ export type PopupTriggerProps = {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export type PopupTriggerEmits = {
|
|
7
|
-
close: [e: MouseEvent];
|
|
7
|
+
close: [e: TouchEvent | MouseEvent];
|
|
8
8
|
open: [node: VNode, e: MouseEvent];
|
|
9
|
+
drag: [event: TouchEvent | MouseEvent];
|
|
10
|
+
dragStart: [event: TouchEvent | MouseEvent];
|
|
11
|
+
dragEnd: [event: TouchEvent | MouseEvent];
|
|
9
12
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PopupWrapperProps } from './type';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<PopupWrapperProps, {
|
|
7
|
+
updateRenderState: () => void;
|
|
8
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PopupWrapperProps> & Readonly<{}>, {
|
|
9
|
+
root: HTMLElement | string;
|
|
10
|
+
destroyOnHide: boolean;
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import './css.js'
|
|
2
|
+
import { g as A } from "../vendor.js";
|
|
3
|
+
import { t as useZIndex } from "../share/hook/use-z-index.js";
|
|
4
|
+
import { Teleport, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, nextTick, onMounted, openBlock, ref, renderSlot, unref, vShow, watch, withDirectives } from "vue";
|
|
5
|
+
var popup_wrapper_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "PopupWrapper",
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
visible: { type: Boolean },
|
|
10
|
+
defaultVisible: { type: Boolean },
|
|
11
|
+
zIndex: null,
|
|
12
|
+
root: { default: "body" },
|
|
13
|
+
closeDelay: null,
|
|
14
|
+
position: null,
|
|
15
|
+
destroyOnHide: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(__props, { expose: __expose }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const [currentZIndex, next, release] = useZIndex("popup");
|
|
23
|
+
const innerVisible = ref(!!props.visible);
|
|
24
|
+
let timer;
|
|
25
|
+
const processVisible = (value) => {
|
|
26
|
+
if (timer) {
|
|
27
|
+
clearTimeout(timer);
|
|
28
|
+
timer = void 0;
|
|
29
|
+
}
|
|
30
|
+
if (value) {
|
|
31
|
+
innerVisible.value = true;
|
|
32
|
+
next();
|
|
33
|
+
} else {
|
|
34
|
+
release();
|
|
35
|
+
if (A(props.closeDelay)) timer = setTimeout(() => {
|
|
36
|
+
innerVisible.value = false;
|
|
37
|
+
}, props.closeDelay);
|
|
38
|
+
else innerVisible.value = false;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
watch(() => props.visible, (val) => {
|
|
42
|
+
processVisible(!!val);
|
|
43
|
+
});
|
|
44
|
+
__expose({ updateRenderState: () => {
|
|
45
|
+
nextTick(() => {
|
|
46
|
+
processVisible(!!props.visible);
|
|
47
|
+
});
|
|
48
|
+
} });
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
nextTick(() => {
|
|
51
|
+
processVisible(!!props.visible);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
return (_ctx, _cache) => {
|
|
55
|
+
return openBlock(), createBlock(Teleport, { to: props.root || "body" }, [(__props.destroyOnHide !== false ? innerVisible.value : true) ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
56
|
+
key: 0,
|
|
57
|
+
class: {
|
|
58
|
+
pixelium: true,
|
|
59
|
+
"px-popup-wrapper": true,
|
|
60
|
+
"px-popup-wrapper__fixed": props.position === "fixed"
|
|
61
|
+
},
|
|
62
|
+
style: { zIndex: props.zIndex ?? unref(currentZIndex) }
|
|
63
|
+
}, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16)), [[vShow, __props.destroyOnHide === false ? innerVisible.value : true]]) : createCommentVNode("v-if", true)], 8, ["to"]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export { popup_wrapper_default as t };
|
package/es/radio/css.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../index.css'
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const drawPixelTriangle: (ctx: CanvasRenderingContext2D, width: number, height: number, color: string, pixelSize: number) => void;
|
|
2
|
+
export declare const drawMaskedPixelTriangle: (ctx: CanvasRenderingContext2D, width: number, height: number, color: string, pixelSize: number) => void;
|
|
3
|
+
export declare const drawBorder: (ctx: CanvasRenderingContext2D, width: number, height: number, center: [number, number][], borderRadius: number[], rad: [number, number][], borderColor: string, pixelSize: number) => void;
|
|
4
|
+
export declare const drawRadioCircleMark: (ctx: CanvasRenderingContext2D, size: number, color: string, pixelSize: number) => void;
|
package/es/radio/draw.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { c as SQRT3 } from "../share/const/index.js";
|
|
2
|
+
import { n as INTERVAL } from "../share/const/style.js";
|
|
3
|
+
import { a as drawCircle, d as roundToPixel, o as drawSmoothCircle, s as floodFill } from "../share/util/plot.js";
|
|
4
|
+
import { i as parseColor } from "../share/util/color.js";
|
|
5
|
+
const drawPixelTriangle = (ctx, width, height, color, pixelSize) => {
|
|
6
|
+
ctx.fillStyle = color;
|
|
7
|
+
const size = roundToPixel(Math.min(width, height), pixelSize);
|
|
8
|
+
const x = Math.round((width - size * SQRT3 / 2) / 2 + pixelSize / 2);
|
|
9
|
+
const y = Math.round((height - size) / 2);
|
|
10
|
+
let cur = size;
|
|
11
|
+
let times = 0;
|
|
12
|
+
let preHeight = -1;
|
|
13
|
+
const step = pixelSize * Math.SQRT2;
|
|
14
|
+
while (cur >= 0) {
|
|
15
|
+
let h = roundToPixel(cur, pixelSize);
|
|
16
|
+
if (preHeight > pixelSize && h === 0) {
|
|
17
|
+
h = pixelSize;
|
|
18
|
+
cur = -1;
|
|
19
|
+
}
|
|
20
|
+
ctx.fillRect(x + times * pixelSize, y + Math.round((size - h) / 2), pixelSize, h);
|
|
21
|
+
cur -= step;
|
|
22
|
+
times++;
|
|
23
|
+
preHeight = h;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const drawMaskedPixelTriangle = (ctx, width, height, color, pixelSize) => {
|
|
27
|
+
drawPixelTriangle(ctx, width, height, color, pixelSize);
|
|
28
|
+
for (let x = 0; x <= width; x += 2) ctx.clearRect(x, 0, 1, height);
|
|
29
|
+
for (let y = 0; y < height; y += 2) ctx.clearRect(0, y, width, 1);
|
|
30
|
+
};
|
|
31
|
+
const drawBorder = (ctx, width, height, center, borderRadius, rad, borderColor, pixelSize) => {
|
|
32
|
+
ctx.fillStyle = borderColor;
|
|
33
|
+
for (let i = 0; i < 4; i++) if (borderRadius[i] > pixelSize) drawCircle(ctx, center[i][0], center[i][1], borderRadius[i], rad[i][0], rad[i][1], pixelSize);
|
|
34
|
+
if (center[1][0] + pixelSize > center[0][0]) ctx.fillRect(center[0][0], 0, center[1][0] - center[0][0] + pixelSize, pixelSize);
|
|
35
|
+
if (center[2][1] + pixelSize > center[1][1]) ctx.fillRect(width - pixelSize, center[1][1], pixelSize, center[2][1] - center[1][1] + pixelSize);
|
|
36
|
+
if (center[3][0] < center[2][0] + pixelSize) ctx.fillRect(center[3][0], height - pixelSize, center[2][0] - center[3][0] + pixelSize, pixelSize);
|
|
37
|
+
if (center[3][1] + pixelSize > center[0][1]) ctx.fillRect(0, center[0][1], pixelSize, center[3][1] - center[0][1] + pixelSize);
|
|
38
|
+
};
|
|
39
|
+
const drawRadioCircleMark = (ctx, size, color, pixelSize) => {
|
|
40
|
+
ctx.fillStyle = color;
|
|
41
|
+
drawSmoothCircle(ctx, size / 2 - pixelSize / 2, size / 2 - pixelSize / 2, Math.round((size - pixelSize / 2) / 2 - 8), 0, Math.PI * 2, pixelSize);
|
|
42
|
+
const fillStart = Math.ceil(size / 2 - pixelSize / 2) + 1;
|
|
43
|
+
const rgbaColor = color ? parseColor(color) : null;
|
|
44
|
+
if (rgbaColor) floodFill(ctx, fillStart, fillStart, rgbaColor);
|
|
45
|
+
ctx.fillRect(fillStart, fillStart, pixelSize, pixelSize);
|
|
46
|
+
};
|
|
47
|
+
export { drawRadioCircleMark as i, drawMaskedPixelTriangle as n, drawPixelTriangle as r, drawBorder as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RadioProps } from './type';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<RadioProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
change: (value: boolean, event: Event) => any;
|
|
8
|
+
blur: (event: FocusEvent) => any;
|
|
9
|
+
input: (value: boolean, event: InputEvent) => any;
|
|
10
|
+
focus: (event: FocusEvent) => any;
|
|
11
|
+
"update:modelValue": (value: boolean) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<RadioProps> & Readonly<{
|
|
13
|
+
onChange?: ((value: boolean, event: Event) => any) | undefined;
|
|
14
|
+
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
15
|
+
onInput?: ((value: boolean, event: InputEvent) => any) | undefined;
|
|
16
|
+
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
readonly: boolean;
|
|
21
|
+
modelValue: boolean | null;
|
|
22
|
+
defaultValue: boolean | null;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import './css.js'
|
|
2
|
+
import { t as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
|
|
3
|
+
import { i as canvasPreprocess, l as getBorderRadius, n as calcPixelSize, s as floodFill, t as calcBorderCornerCenter } from "../share/util/plot.js";
|
|
4
|
+
import { i as parseColor, r as getGlobalThemeColorString } from "../share/util/color.js";
|
|
5
|
+
import { t as useDarkMode } from "../share/hook/use-dark-mode.js";
|
|
6
|
+
import { t as useResizeObserver } from "../share/hook/use-resize-observer.js";
|
|
7
|
+
import { t as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
|
|
8
|
+
import { c as RADIO_GROUP_PROVIDE, i as FORM_ITEM_PROVIDE } from "../share/const/provide-key.js";
|
|
9
|
+
import { t as createProvideComputed } from "../share/util/reactivity.js";
|
|
10
|
+
import { t as useTransitionEnd } from "../share/hook/use-transition-end.js";
|
|
11
|
+
import { t as useControlledMode } from "../share/hook/use-controlled-mode.js";
|
|
12
|
+
import { i as drawRadioCircleMark, n as drawMaskedPixelTriangle, r as drawPixelTriangle, t as drawBorder } from "./draw.js";
|
|
13
|
+
import { createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, nextTick, normalizeClass, onMounted, openBlock, ref, renderSlot, toDisplayString, unref, watch, withModifiers } from "vue";
|
|
14
|
+
var _hoisted_1 = [
|
|
15
|
+
"value",
|
|
16
|
+
"checked",
|
|
17
|
+
"disabled"
|
|
18
|
+
];
|
|
19
|
+
var radio_default = /* @__PURE__ */ defineComponent({
|
|
20
|
+
name: "Radio",
|
|
21
|
+
__name: "index",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
defaultValue: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
variant: null,
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
readonly: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
label: null,
|
|
41
|
+
value: null,
|
|
42
|
+
size: null
|
|
43
|
+
},
|
|
44
|
+
emits: [
|
|
45
|
+
"update:modelValue",
|
|
46
|
+
"input",
|
|
47
|
+
"change",
|
|
48
|
+
"focus",
|
|
49
|
+
"blur"
|
|
50
|
+
],
|
|
51
|
+
setup(__props, { emit: __emit }) {
|
|
52
|
+
const canvasWrapperRef = ref(null);
|
|
53
|
+
const canvasRef = ref(null);
|
|
54
|
+
const props = __props;
|
|
55
|
+
const emits = __emit;
|
|
56
|
+
const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
|
|
57
|
+
defaultField: "defaultValue",
|
|
58
|
+
transform: (val) => !!val
|
|
59
|
+
});
|
|
60
|
+
const formItemProvide = inject(FORM_ITEM_PROVIDE, void 0);
|
|
61
|
+
const radioGroupProvide = inject(RADIO_GROUP_PROVIDE, void 0);
|
|
62
|
+
const sizeComputed = createProvideComputed("size", () => [
|
|
63
|
+
radioGroupProvide,
|
|
64
|
+
props.size && props,
|
|
65
|
+
formItemProvide,
|
|
66
|
+
props
|
|
67
|
+
], "nullish", (val) => val || "medium");
|
|
68
|
+
const disabledComputed = createProvideComputed("disabled", [
|
|
69
|
+
radioGroupProvide,
|
|
70
|
+
formItemProvide,
|
|
71
|
+
props
|
|
72
|
+
], "or");
|
|
73
|
+
const readonlyComputed = createProvideComputed("readonly", [
|
|
74
|
+
radioGroupProvide,
|
|
75
|
+
formItemProvide,
|
|
76
|
+
props
|
|
77
|
+
], "or");
|
|
78
|
+
const variantComputed = createProvideComputed("variant", [radioGroupProvide, props], "nullish", (val) => val || "normal");
|
|
79
|
+
if (radioGroupProvide) {
|
|
80
|
+
watch(() => radioGroupProvide.modelValue.value, (newValue) => {
|
|
81
|
+
modelValue.value = newValue === props.value;
|
|
82
|
+
}, { immediate: true });
|
|
83
|
+
watch(modelValue, (newValue) => {
|
|
84
|
+
if (!radioGroupProvide || !newValue) return;
|
|
85
|
+
radioGroupProvide.updateValue(props.value);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const hoverFlag = ref(false);
|
|
89
|
+
const mouseenterHandler = () => {
|
|
90
|
+
hoverFlag.value = true;
|
|
91
|
+
};
|
|
92
|
+
const mouseleaveHandler = () => {
|
|
93
|
+
hoverFlag.value = false;
|
|
94
|
+
};
|
|
95
|
+
const focusFlag = ref(false);
|
|
96
|
+
const focusHandler = (e) => {
|
|
97
|
+
focusFlag.value = true;
|
|
98
|
+
emits("focus", e);
|
|
99
|
+
};
|
|
100
|
+
const blurHandler = (e) => {
|
|
101
|
+
focusFlag.value = false;
|
|
102
|
+
emits("blur", e);
|
|
103
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.blurHandler();
|
|
104
|
+
};
|
|
105
|
+
const handleChange = (event) => {
|
|
106
|
+
const target = event.target;
|
|
107
|
+
emits("change", target.checked, event);
|
|
108
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
|
|
109
|
+
};
|
|
110
|
+
const inputHandler = async (e) => {
|
|
111
|
+
const newValue = e.target.checked;
|
|
112
|
+
modelValue.value = newValue;
|
|
113
|
+
emits("input", newValue, e);
|
|
114
|
+
await updateModelValue(newValue);
|
|
115
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.inputHandler();
|
|
116
|
+
};
|
|
117
|
+
const darkMode = useDarkMode();
|
|
118
|
+
const pixelSize = calcPixelSize();
|
|
119
|
+
const drawPixel = () => {
|
|
120
|
+
const preprocessData = canvasPreprocess(canvasWrapperRef, canvasRef);
|
|
121
|
+
if (!preprocessData) return;
|
|
122
|
+
const { ctx, width, height, canvas } = preprocessData;
|
|
123
|
+
ctx.clearRect(0, 0, width, height);
|
|
124
|
+
const backgroundColor = getGlobalThemeColorString("neutral", 1);
|
|
125
|
+
const mainColor = modelValue.value ? disabledComputed.value ? getGlobalThemeColorString("primary", 2) : hoverFlag.value && !readonlyComputed.value ? getGlobalThemeColorString("primary", 5) : getGlobalThemeColorString("primary", 6) : disabledComputed.value ? getGlobalThemeColorString("neutral", 8) : hoverFlag.value && !readonlyComputed.value ? getGlobalThemeColorString("primary", 5) : getGlobalThemeColorString("neutral", 10);
|
|
126
|
+
if (variantComputed.value === "retro") if (modelValue.value) drawPixelTriangle(ctx, width, height, mainColor, pixelSize);
|
|
127
|
+
else drawMaskedPixelTriangle(ctx, width, height, mainColor, pixelSize);
|
|
128
|
+
else {
|
|
129
|
+
const borderRadius = getBorderRadius(canvas, pixelSize, void 0, "round", void 0, false, false, false);
|
|
130
|
+
drawBorder(ctx, width, height, calcBorderCornerCenter(borderRadius, width, height, pixelSize), borderRadius, BORDER_CORNER_RAD_RANGE, mainColor, pixelSize);
|
|
131
|
+
const size = Math.min(width, height);
|
|
132
|
+
const fillStart = Math.ceil(size / 2 - pixelSize / 2) + 1;
|
|
133
|
+
if (backgroundColor) floodFill(ctx, fillStart, fillStart, parseColor(backgroundColor));
|
|
134
|
+
if (modelValue.value) drawRadioCircleMark(ctx, size, mainColor, pixelSize);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
onMounted(() => {
|
|
138
|
+
nextTick(() => {
|
|
139
|
+
drawPixel();
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
watch([
|
|
143
|
+
disabledComputed,
|
|
144
|
+
readonlyComputed,
|
|
145
|
+
modelValue,
|
|
146
|
+
darkMode,
|
|
147
|
+
hoverFlag,
|
|
148
|
+
variantComputed,
|
|
149
|
+
sizeComputed
|
|
150
|
+
], () => {
|
|
151
|
+
drawPixel();
|
|
152
|
+
});
|
|
153
|
+
useResizeObserver(canvasWrapperRef, drawPixel);
|
|
154
|
+
useWatchGlobalCssVal(drawPixel);
|
|
155
|
+
useTransitionEnd(canvasWrapperRef, drawPixel);
|
|
156
|
+
return (_ctx, _cache) => {
|
|
157
|
+
return openBlock(), createElementBlock("label", {
|
|
158
|
+
class: normalizeClass(["pixelium px-radio", {
|
|
159
|
+
"px-radio__disabled": unref(disabledComputed),
|
|
160
|
+
"px-radio__readonly": unref(readonlyComputed),
|
|
161
|
+
"px-radio__checked": unref(modelValue),
|
|
162
|
+
[`px-radio__${unref(variantComputed)}`]: unref(variantComputed),
|
|
163
|
+
[`px-radio__${unref(sizeComputed)}`]: unref(sizeComputed)
|
|
164
|
+
}]),
|
|
165
|
+
ref: "radioRef",
|
|
166
|
+
onMouseenter: mouseenterHandler,
|
|
167
|
+
onMouseleave: mouseleaveHandler
|
|
168
|
+
}, [createElementVNode("div", {
|
|
169
|
+
class: normalizeClass(["px-radio-canvas-wrapper", { "px-animation__blink": focusFlag.value && !unref(disabledComputed) && !unref(readonlyComputed) && unref(variantComputed) === "retro" }]),
|
|
170
|
+
ref_key: "canvasWrapperRef",
|
|
171
|
+
ref: canvasWrapperRef
|
|
172
|
+
}, [createElementVNode("input", {
|
|
173
|
+
type: "radio",
|
|
174
|
+
value: props.value,
|
|
175
|
+
class: "px-radio__input",
|
|
176
|
+
checked: !!unref(modelValue),
|
|
177
|
+
onInput: withModifiers(inputHandler, ["stop"]),
|
|
178
|
+
onChange: withModifiers(handleChange, ["stop"]),
|
|
179
|
+
onFocus: focusHandler,
|
|
180
|
+
onBlur: blurHandler,
|
|
181
|
+
disabled: unref(disabledComputed) || unref(readonlyComputed)
|
|
182
|
+
}, null, 40, _hoisted_1), createElementVNode("canvas", {
|
|
183
|
+
ref_key: "canvasRef",
|
|
184
|
+
ref: canvasRef,
|
|
185
|
+
class: "px-radio-canvas"
|
|
186
|
+
}, null, 512)], 2), renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(props.label), 1)])], 34);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
export { radio_default as t };
|