@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.px-radio-canvas {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
left: 50%;
|
|
5
|
+
transform: translate(-50%, -50%);
|
|
6
|
+
z-index: -1;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
}
|
|
9
|
+
.px-radio {
|
|
10
|
+
--radio-size: var(--px-medium-compat-size);
|
|
11
|
+
--text-color: var(--px-neutral-10);
|
|
12
|
+
background-color: transparent;
|
|
13
|
+
color: var(--text-color);
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
position: relative;
|
|
17
|
+
transition: 0.25s;
|
|
18
|
+
z-index: 0;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
.px-radio.px-radio {
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
}
|
|
24
|
+
.px-radio__large {
|
|
25
|
+
--radio-size: var(--px-large-compat-size);
|
|
26
|
+
font-size: 15px;
|
|
27
|
+
}
|
|
28
|
+
.px-radio__large .px-radio-canvas-wrapper {
|
|
29
|
+
margin-right: 12px;
|
|
30
|
+
}
|
|
31
|
+
.px-radio__small {
|
|
32
|
+
--radio-size: var(--px-small-compat-size);
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
}
|
|
35
|
+
.px-radio__small .px-radio-canvas-wrapper {
|
|
36
|
+
margin-right: 4px;
|
|
37
|
+
}
|
|
38
|
+
.px-radio__input {
|
|
39
|
+
height: 0;
|
|
40
|
+
width: 0;
|
|
41
|
+
margin: 0;
|
|
42
|
+
position: absolute;
|
|
43
|
+
}
|
|
44
|
+
.px-radio__readonly {
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
47
|
+
.px-radio__disabled {
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
.px-radio-canvas-wrapper {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
border-color: transparent;
|
|
53
|
+
border-width: var(--px-bit);
|
|
54
|
+
border-style: solid;
|
|
55
|
+
background-color: transparent;
|
|
56
|
+
width: var(--radio-size);
|
|
57
|
+
height: var(--radio-size);
|
|
58
|
+
position: relative;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
margin-right: 8px;
|
|
62
|
+
transition: 0.25s;
|
|
63
|
+
}
|
|
64
|
+
.px-radio__checked {
|
|
65
|
+
--text-color: var(--px-primary-6);
|
|
66
|
+
}
|
|
67
|
+
.px-radio__disabled {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
--text-color: var(--px-neutral-8);
|
|
70
|
+
}
|
|
71
|
+
.px-radio__disabled.px-radio__checked {
|
|
72
|
+
--text-color: var(--px-primary-2);
|
|
73
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export type RadioProps = {
|
|
2
|
+
/**
|
|
3
|
+
* @property {boolean | null} [modelValue]
|
|
4
|
+
* @version 0.0.3
|
|
5
|
+
*/
|
|
6
|
+
modelValue?: boolean | null;
|
|
7
|
+
/**
|
|
8
|
+
* @property {boolean | null} [defaultValue]
|
|
9
|
+
* @version 0.0.3
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: boolean | null;
|
|
12
|
+
/**
|
|
13
|
+
* @property {'normal' | 'retro'} [variant='normal']
|
|
14
|
+
* @version 0.0.3
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'normal' | 'retro';
|
|
17
|
+
/**
|
|
18
|
+
* @property {boolean} [disabled=false]
|
|
19
|
+
* @version 0.0.3
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @property {boolean} [readonly=false]
|
|
24
|
+
* @version 0.0.3
|
|
25
|
+
*/
|
|
26
|
+
readonly?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @property {string} [label]
|
|
29
|
+
* @version 0.0.3
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* @property {any} [value]
|
|
34
|
+
* @version 0.0.3
|
|
35
|
+
*/
|
|
36
|
+
value?: any;
|
|
37
|
+
/**
|
|
38
|
+
* @property {'medium' | 'large' | 'small'} [size='medium']
|
|
39
|
+
* @version 0.0.3
|
|
40
|
+
*/
|
|
41
|
+
size?: 'medium' | 'large' | 'small';
|
|
42
|
+
};
|
|
43
|
+
export type RadioEvents = {
|
|
44
|
+
/**
|
|
45
|
+
* @event update:modelValue
|
|
46
|
+
* @version 0.0.3
|
|
47
|
+
* @param {boolean} value
|
|
48
|
+
*/
|
|
49
|
+
'update:modelValue': [value: boolean];
|
|
50
|
+
/**
|
|
51
|
+
* @event input
|
|
52
|
+
* @version 0.0.3
|
|
53
|
+
* @param {boolean} value
|
|
54
|
+
* @param {InputEvent} event
|
|
55
|
+
*/
|
|
56
|
+
input: [value: boolean, event: InputEvent];
|
|
57
|
+
/**
|
|
58
|
+
* @event change
|
|
59
|
+
* @version 0.0.3
|
|
60
|
+
* @param {boolean} value
|
|
61
|
+
* @param {Event} event
|
|
62
|
+
*/
|
|
63
|
+
change: [value: boolean, event: Event];
|
|
64
|
+
/**
|
|
65
|
+
* @event focus
|
|
66
|
+
* @param {FocusEvent} event
|
|
67
|
+
* @version 0.0.3
|
|
68
|
+
*/
|
|
69
|
+
focus: [event: FocusEvent];
|
|
70
|
+
/**
|
|
71
|
+
* @event blur
|
|
72
|
+
* @param {FocusEvent} event
|
|
73
|
+
* @version 0.0.3
|
|
74
|
+
*/
|
|
75
|
+
blur: [event: FocusEvent];
|
|
76
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
div.px-radio-group {
|
|
2
|
+
font-size: 0;
|
|
3
|
+
}
|
|
4
|
+
.px-radio-group {
|
|
5
|
+
display: inline-block;
|
|
6
|
+
}
|
|
7
|
+
.px-radio-group-inner {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
margin: -8px;
|
|
11
|
+
}
|
|
12
|
+
.px-radio-group-inner > * {
|
|
13
|
+
margin: 8px;
|
|
14
|
+
}
|
|
15
|
+
.px-radio-group__vertical {
|
|
16
|
+
display: inline-block;
|
|
17
|
+
}
|
|
18
|
+
.px-radio-group__vertical > .px-radio-group-inner {
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RadioGroupProps } 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<RadioGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
change: (value: any) => any;
|
|
8
|
+
"update:modelValue": (value: any) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<RadioGroupProps> & Readonly<{
|
|
10
|
+
onChange?: ((value: any) => any) | undefined;
|
|
11
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
readonly: boolean;
|
|
15
|
+
direction: "horizontal" | "vertical";
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import './css.js'
|
|
2
|
+
import { B as y } from "../vendor.js";
|
|
3
|
+
import { c as RADIO_GROUP_PROVIDE, i as FORM_ITEM_PROVIDE } from "../share/const/provide-key.js";
|
|
4
|
+
import { t as createProvideComputed } from "../share/util/reactivity.js";
|
|
5
|
+
import { t as useControlledMode } from "../share/hook/use-controlled-mode.js";
|
|
6
|
+
import { t as radio_default } from "../radio/index.js";
|
|
7
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, normalizeClass, openBlock, provide, renderList, renderSlot, toDisplayString, toRef, unref, withCtx } from "vue";
|
|
8
|
+
var _hoisted_1 = { class: "px-radio-group-inner" };
|
|
9
|
+
var radio_group_default = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "RadioGroup",
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: null,
|
|
14
|
+
defaultValue: null,
|
|
15
|
+
variant: null,
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
readonly: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
direction: { default: "horizontal" },
|
|
25
|
+
options: null,
|
|
26
|
+
size: null
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:modelValue", "change"],
|
|
29
|
+
setup(__props, { emit: __emit }) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const emits = __emit;
|
|
32
|
+
const formItemProvide = inject(FORM_ITEM_PROVIDE, void 0);
|
|
33
|
+
const disabledComputed = createProvideComputed("disabled", [formItemProvide, props], "or");
|
|
34
|
+
const readonlyComputed = createProvideComputed("readonly", [formItemProvide, props], "or");
|
|
35
|
+
const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
|
|
36
|
+
transform: (val) => {
|
|
37
|
+
return val;
|
|
38
|
+
},
|
|
39
|
+
defaultField: "defaultValue"
|
|
40
|
+
});
|
|
41
|
+
const sizeComputed = createProvideComputed("size", () => [
|
|
42
|
+
props.size && props,
|
|
43
|
+
formItemProvide,
|
|
44
|
+
props
|
|
45
|
+
], "nullish", (val) => val || "medium");
|
|
46
|
+
const getKey = (option) => {
|
|
47
|
+
if (y(option)) return option;
|
|
48
|
+
else return option.key ?? option.value;
|
|
49
|
+
};
|
|
50
|
+
const updateValue = (value) => {
|
|
51
|
+
updateModelValue(value);
|
|
52
|
+
emits("change", value);
|
|
53
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
|
|
54
|
+
};
|
|
55
|
+
provide(RADIO_GROUP_PROVIDE, {
|
|
56
|
+
variant: toRef(props, "variant"),
|
|
57
|
+
size: sizeComputed,
|
|
58
|
+
modelValue,
|
|
59
|
+
disabled: disabledComputed,
|
|
60
|
+
readonly: readonlyComputed,
|
|
61
|
+
updateValue
|
|
62
|
+
});
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["pixelium px-radio-group", { [`px-radio-group__${props.direction}`]: props.direction }]) }, [createElementVNode("div", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, () => [props.options ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.options, (option) => {
|
|
65
|
+
return openBlock(), createBlock(radio_default, {
|
|
66
|
+
key: getKey(option),
|
|
67
|
+
value: unref(y)(option) ? option : option.value,
|
|
68
|
+
disabled: unref(y)(option) ? false : option.disabled
|
|
69
|
+
}, {
|
|
70
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(y)(option) ? option : option.label), 1)]),
|
|
71
|
+
_: 2
|
|
72
|
+
}, 1032, ["value", "disabled"]);
|
|
73
|
+
}), 128)) : createCommentVNode("v-if", true)])])], 2);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export { radio_group_default as t };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import type { Option } from '../share/type';
|
|
3
|
+
export interface RadioGroupOption<T = any> extends Option<T> {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
key?: string | number | symbol;
|
|
6
|
+
}
|
|
7
|
+
export type RadioGroupProps = {
|
|
8
|
+
/**
|
|
9
|
+
* @property {any} [modelValue]
|
|
10
|
+
* @version 0.0.3
|
|
11
|
+
*/
|
|
12
|
+
modelValue?: any;
|
|
13
|
+
/**
|
|
14
|
+
* @property {any} [defaultValue]
|
|
15
|
+
* @version 0.0.3
|
|
16
|
+
*/
|
|
17
|
+
defaultValue?: any;
|
|
18
|
+
/**
|
|
19
|
+
* @property {'normal' | 'retro'} [variant]
|
|
20
|
+
* @version 0.0.3
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'normal' | 'retro';
|
|
23
|
+
/**
|
|
24
|
+
* @property {boolean} [disabled=false]
|
|
25
|
+
* @version 0.0.3
|
|
26
|
+
*/
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @property {boolean} [readonly=false]
|
|
30
|
+
* @version 0.0.3
|
|
31
|
+
*/
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* @property {'horizontal' | 'vertical'} [direction='horizontal']
|
|
35
|
+
* @version 0.0.3
|
|
36
|
+
*/
|
|
37
|
+
direction?: 'horizontal' | 'vertical';
|
|
38
|
+
/**
|
|
39
|
+
* @property {(RadioGroupOption | string)[]} [options]
|
|
40
|
+
* @version 0.0.3
|
|
41
|
+
*/
|
|
42
|
+
options?: (RadioGroupOption | string)[];
|
|
43
|
+
/**
|
|
44
|
+
* @property {'medium' | 'large' | 'small'} [size]
|
|
45
|
+
* @version 0.0.3
|
|
46
|
+
*/
|
|
47
|
+
size?: 'medium' | 'large' | 'small';
|
|
48
|
+
};
|
|
49
|
+
export interface RadioGroupProvide {
|
|
50
|
+
variant: Ref<'normal' | 'retro' | undefined>;
|
|
51
|
+
size: ComputedRef<'medium' | 'large' | 'small' | undefined>;
|
|
52
|
+
modelValue: Ref<any>;
|
|
53
|
+
disabled: ComputedRef<boolean | undefined>;
|
|
54
|
+
readonly: ComputedRef<boolean | undefined>;
|
|
55
|
+
updateValue: (value: any) => void;
|
|
56
|
+
}
|
|
57
|
+
export type RadioGroupSlots = {
|
|
58
|
+
/**
|
|
59
|
+
* @slot default
|
|
60
|
+
* @version 0.0.3
|
|
61
|
+
*/
|
|
62
|
+
default: {};
|
|
63
|
+
};
|
|
64
|
+
export type RadioGroupEvents = {
|
|
65
|
+
/**
|
|
66
|
+
* @event update:modelValue
|
|
67
|
+
* @version 0.0.3
|
|
68
|
+
* @param {any} value
|
|
69
|
+
*/
|
|
70
|
+
'update:modelValue': [value: any];
|
|
71
|
+
/**
|
|
72
|
+
* @event change
|
|
73
|
+
* @version 0.0.3
|
|
74
|
+
* @param {any} value
|
|
75
|
+
*/
|
|
76
|
+
change: [value: any];
|
|
77
|
+
};
|
package/es/row/index.js
CHANGED
|
@@ -1,72 +1,58 @@
|
|
|
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
|
-
marginBottom: gutterComputed.value ? -gutterComputed.value.y / 2 + "px" : void 0
|
|
58
|
-
})
|
|
59
|
-
},
|
|
60
|
-
[
|
|
61
|
-
renderSlot(_ctx.$slots, "default")
|
|
62
|
-
],
|
|
63
|
-
6
|
|
64
|
-
/* CLASS, STYLE */
|
|
65
|
-
)
|
|
66
|
-
]);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
2
|
+
import { g as A, w as Qn } from "../vendor.js";
|
|
3
|
+
import { t as useScreenWidth } from "../share/hook/use-screen-width.js";
|
|
4
|
+
import { computed, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, provide, renderSlot } from "vue";
|
|
5
|
+
var _hoisted_1 = { class: "pixelium px-row" };
|
|
6
|
+
var row_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "Row",
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
gutter: { default: 0 },
|
|
11
|
+
justify: { default: "start" },
|
|
12
|
+
align: { default: "start" },
|
|
13
|
+
wrap: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const [widthType] = useScreenWidth();
|
|
21
|
+
const gutterComputed = computed(() => {
|
|
22
|
+
if (A(props.gutter)) return {
|
|
23
|
+
x: props.gutter,
|
|
24
|
+
y: props.gutter
|
|
25
|
+
};
|
|
26
|
+
if ("x" in props.gutter || "y" in props.gutter) return {
|
|
27
|
+
x: props.gutter.x || 0,
|
|
28
|
+
y: props.gutter.y || 0
|
|
29
|
+
};
|
|
30
|
+
const currentGutter = props.gutter[widthType.value];
|
|
31
|
+
if (A(currentGutter)) return {
|
|
32
|
+
x: currentGutter,
|
|
33
|
+
y: currentGutter
|
|
34
|
+
};
|
|
35
|
+
return Qn({
|
|
36
|
+
x: 0,
|
|
37
|
+
y: 0
|
|
38
|
+
}, currentGutter);
|
|
39
|
+
});
|
|
40
|
+
provide("px-row-provide", gutterComputed);
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", {
|
|
43
|
+
class: normalizeClass(["px-row-inner", {
|
|
44
|
+
[`px-row__justify-${props.justify}`]: true,
|
|
45
|
+
[`px-row__align-${props.align}`]: true,
|
|
46
|
+
[`px-row__wrap`]: !!props.wrap
|
|
47
|
+
}]),
|
|
48
|
+
style: normalizeStyle({
|
|
49
|
+
marginLeft: gutterComputed.value ? -gutterComputed.value.x / 2 + "px" : void 0,
|
|
50
|
+
marginRight: gutterComputed.value ? -gutterComputed.value.x / 2 + "px" : void 0,
|
|
51
|
+
marginTop: gutterComputed.value ? -gutterComputed.value.y / 2 + "px" : void 0,
|
|
52
|
+
marginBottom: gutterComputed.value ? -gutterComputed.value.y / 2 + "px" : void 0
|
|
53
|
+
})
|
|
54
|
+
}, [renderSlot(_ctx.$slots, "default")], 6)]);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
69
57
|
});
|
|
70
|
-
export {
|
|
71
|
-
_sfc_main as _
|
|
72
|
-
};
|
|
58
|
+
export { row_default as t };
|
package/es/select/draw.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RgbaColor } from '../share/type';
|
|
2
|
-
export declare const drawBorder: (ctx: CanvasRenderingContext2D, width: number, height: number, center: [number, number][], borderRadius: number[], rad: [number, number][], borderColor: RgbaColor, pixelSize: number, inner: boolean, first: boolean, last: boolean) => void;
|
|
2
|
+
export declare const drawBorder: (ctx: CanvasRenderingContext2D, width: number, height: number, center: [number, number][], borderRadius: number[], rad: [number, number][], borderColor: RgbaColor, pixelSize: number, inner: boolean, first: boolean, last: boolean, nextIsTextButton: boolean) => void;
|
package/es/select/draw.js
CHANGED
|
@@ -1,52 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const drawBorder = (ctx, width, height, center, borderRadius, rad, borderColor, pixelSize, inner, first, last) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
width - pixelSize,
|
|
27
|
-
center[1][1],
|
|
28
|
-
pixelSize,
|
|
29
|
-
center[2][1] - center[1][1] + pixelSize
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
if (center[3][0] < center[2][0] + pixelSize) {
|
|
33
|
-
ctx.fillRect(
|
|
34
|
-
center[3][0],
|
|
35
|
-
height - pixelSize,
|
|
36
|
-
center[2][0] - center[3][0] + pixelSize,
|
|
37
|
-
pixelSize
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (center[3][1] + pixelSize > center[0][1] && !(inner && !first)) {
|
|
41
|
-
ctx.fillRect(0, center[0][1], pixelSize, center[3][1] - center[0][1] + pixelSize);
|
|
42
|
-
}
|
|
43
|
-
if (inner && !first) {
|
|
44
|
-
ctx.fillRect(pixelSize / 2, 0, pixelSize / 2, height);
|
|
45
|
-
}
|
|
46
|
-
if (inner && !last) {
|
|
47
|
-
ctx.fillRect(width - 2 * pixelSize - 1, 0, pixelSize, height);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
drawBorder as d
|
|
1
|
+
import { a as drawCircle } from "../share/util/plot.js";
|
|
2
|
+
import { a as rgbaColor2string } from "../share/util/color.js";
|
|
3
|
+
const drawBorder = (ctx, width, height, center, borderRadius, rad, borderColor, pixelSize, inner, first, last, nextIsTextButton) => {
|
|
4
|
+
ctx.fillStyle = rgbaColor2string(borderColor);
|
|
5
|
+
for (let i = 0; i < 4; i++) if (borderRadius[i] > pixelSize) {
|
|
6
|
+
if (i === 1 || i === 2 ? inner && last || !inner : true) drawCircle(ctx, center[i][0], center[i][1], borderRadius[i], rad[i][0], rad[i][1], pixelSize);
|
|
7
|
+
}
|
|
8
|
+
if (center[1][0] + pixelSize > center[0][0]) {
|
|
9
|
+
let length = center[1][0] - center[0][0] + pixelSize;
|
|
10
|
+
if (inner && !last) length -= pixelSize;
|
|
11
|
+
ctx.fillRect(center[0][0], 0, length, pixelSize);
|
|
12
|
+
}
|
|
13
|
+
if (center[2][1] + pixelSize > center[1][1] && (inner && last || !inner)) ctx.fillRect(width - pixelSize, center[1][1], pixelSize, center[2][1] - center[1][1] + pixelSize);
|
|
14
|
+
if (center[3][0] < center[2][0] + pixelSize) {
|
|
15
|
+
let length = center[2][0] - center[3][0] + pixelSize;
|
|
16
|
+
if (inner && !last) length -= pixelSize;
|
|
17
|
+
ctx.fillRect(center[3][0], height - pixelSize, length, pixelSize);
|
|
18
|
+
}
|
|
19
|
+
if ((!inner || first) && center[3][1] + pixelSize > center[0][1]) ctx.fillRect(0, center[0][1], pixelSize, center[3][1] - center[0][1] + pixelSize);
|
|
20
|
+
if (inner && !first) ctx.fillRect(pixelSize / 2, 0, pixelSize / 2, height);
|
|
21
|
+
if (inner && !last) {
|
|
22
|
+
let length = pixelSize;
|
|
23
|
+
if (nextIsTextButton) length /= 2;
|
|
24
|
+
ctx.fillRect(width - 2 * pixelSize - 1, 0, length, height);
|
|
25
|
+
}
|
|
52
26
|
};
|
|
27
|
+
export { drawBorder as t };
|