@pixelium/web-vue 0.0.1-beta → 0.0.2
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 +21 -10
- package/README.zh.md +21 -10
- package/dist/icon-pa.d.ts +490 -0
- package/dist/index.d.ts +1586 -10
- package/dist/pixelium-vue-icon-pa.cjs +1 -0
- package/dist/pixelium-vue-icon-pa.css +1 -0
- package/dist/pixelium-vue-icon-pa.js +10143 -0
- package/dist/pixelium-vue-icon-pa.umd.cjs +1 -0
- package/dist/pixelium-vue.cjs +12 -1
- package/dist/pixelium-vue.css +1 -1
- package/dist/pixelium-vue.js +5368 -1093
- package/dist/pixelium-vue.umd.cjs +12 -1
- package/es/aside/css.js +1 -1
- package/es/aside/index.js +60 -13
- package/es/auto-complete/css.js +2 -0
- package/es/auto-complete/draw.d.ts +2 -0
- package/es/auto-complete/draw.js +52 -0
- package/es/auto-complete/index.css +123 -0
- package/es/auto-complete/index.d.ts +35 -0
- package/es/auto-complete/index.js +402 -0
- package/es/auto-complete/type.d.ts +192 -0
- package/es/button/css.js +1 -1
- package/es/button/draw.d.ts +1 -2
- package/es/button/draw.js +105 -123
- package/es/button/index.css +24 -14
- package/es/button/index.js +70 -121
- package/es/button-group/css.js +1 -1
- package/es/button-group/index.d.ts +0 -1
- package/es/button-group/index.js +11 -37
- package/es/button-group/type.d.ts +1 -1
- package/es/col/css.js +1 -1
- package/es/col/index.d.ts +2 -2
- package/es/container/css.js +1 -1
- package/es/divider/css.js +1 -1
- package/es/empty/css.js +2 -0
- package/es/empty/index.css +19 -0
- package/es/empty/index.d.ts +17 -0
- package/es/empty/index.js +73 -0
- package/es/empty/type.d.ts +19 -0
- package/es/footer/css.js +1 -1
- package/es/grid/css.js +1 -1
- package/es/grid/index.js +5 -1
- package/es/grid-item/css.js +1 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/grid-item/index.js +7 -3
- package/es/header/css.js +1 -1
- package/es/icon/css.js +1 -1
- package/es/icon/index.css +0 -3
- package/es/icon/index.js +1 -1
- package/es/icons/css-pa.js +2 -0
- package/es/icons/icon-hn.js +1 -1
- package/es/icons/icon-pa.css +9 -0
- package/es/icons/icon-pa.d.ts +490 -0
- package/es/icons/icon-pa.js +17449 -0
- package/es/index.css +22 -8
- package/es/index.d.ts +18 -1
- package/es/index.js +63 -2
- package/es/input/css.js +2 -0
- package/es/input/draw.d.ts +2 -0
- package/es/input/draw.js +52 -0
- package/es/input/index.css +138 -0
- package/es/input/index.d.ts +50 -0
- package/es/input/index.js +432 -0
- package/es/input/type.d.ts +175 -0
- package/es/input-group/css.js +2 -0
- package/es/input-group/index.css +24 -0
- package/es/input-group/index.d.ts +17 -0
- package/es/input-group/index.js +40 -0
- package/es/input-group/type.d.ts +30 -0
- package/es/input-group-label/css.js +2 -0
- package/es/input-group-label/draw.d.ts +2 -0
- package/es/input-group-label/draw.js +52 -0
- package/es/input-group-label/index.css +50 -0
- package/es/input-group-label/index.d.ts +16 -0
- package/es/input-group-label/index.js +129 -0
- package/es/input-group-label/type.d.ts +30 -0
- package/es/input-number/css.js +2 -0
- package/es/input-number/draw.d.ts +2 -0
- package/es/input-number/draw.js +52 -0
- package/es/input-number/index.css +161 -0
- package/es/input-number/index.d.ts +47 -0
- package/es/input-number/index.js +543 -0
- package/es/input-number/type.d.ts +183 -0
- package/es/input-tag/css.js +2 -0
- package/es/input-tag/draw.d.ts +2 -0
- package/es/input-tag/draw.js +49 -0
- package/es/input-tag/index.css +133 -0
- package/es/input-tag/index.d.ts +73 -0
- package/es/input-tag/index.js +474 -0
- package/es/input-tag/type.d.ts +212 -0
- package/es/link/css.js +1 -1
- package/es/link/index.css +2 -5
- package/es/link/index.js +10 -6
- package/es/main/css.js +1 -1
- package/es/mask/css.js +2 -0
- package/es/mask/index.css +17 -0
- package/es/mask/index.d.ts +8 -0
- package/es/mask/index.js +117 -0
- package/es/mask/type.d.ts +27 -0
- package/es/message/css.js +1 -1
- package/es/message/index.css +26 -26
- package/es/message/index.d.ts +1 -1
- package/es/message/index.js +22 -50
- package/es/message-box/css.js +1 -1
- package/es/message-box/index.js +40 -30
- package/es/message-box/message-box-wrapped.d.ts +0 -1
- package/es/message-box/message-box-wrapped.js +2 -2
- package/es/message-box/message-box.d.ts +2 -1
- package/es/message-box/message-box.js +10 -8
- package/es/message-box/type.d.ts +14 -4
- package/es/option-list/css.js +2 -0
- package/es/option-list/index.css +57 -0
- package/es/option-list/index.d.ts +38 -0
- package/es/option-list/index.js +169 -0
- package/es/option-list/type.d.ts +16 -0
- package/es/popover/css.js +1 -0
- package/es/popover/index.d.ts +203 -0
- package/es/popover/index.js +240 -0
- package/es/popover/type.d.ts +100 -0
- package/es/popup-content/css.js +2 -0
- package/es/popup-content/draw.d.ts +6 -0
- package/es/popup-content/draw.js +151 -0
- package/es/popup-content/index.css +99 -0
- package/es/popup-content/index.d.ts +30 -0
- package/es/popup-content/index.js +1578 -0
- package/es/popup-content/type.d.ts +20 -0
- package/es/popup-trigger/css.js +1 -0
- package/es/popup-trigger/index.d.ts +22 -0
- package/es/popup-trigger/index.js +97 -0
- package/es/popup-trigger/type.d.ts +9 -0
- package/es/row/css.js +1 -1
- package/es/select/css.js +2 -0
- package/es/select/draw.d.ts +2 -0
- package/es/select/draw.js +52 -0
- package/es/select/index.css +152 -0
- package/es/select/index.d.ts +44 -0
- package/es/select/index.js +674 -0
- package/es/select/type.d.ts +252 -0
- package/es/share/const/event-bus-key.d.ts +4 -0
- package/es/share/const/event-bus-key.js +10 -0
- package/es/share/const/index.d.ts +4 -0
- package/es/share/const/index.js +11 -2
- package/es/share/const/provide-key.d.ts +3 -0
- package/es/share/const/provide-key.js +8 -0
- package/es/share/hook/use-click-outside-listener.d.ts +4 -0
- package/es/share/hook/use-click-outside-listener.js +44 -0
- package/es/share/hook/use-composition.d.ts +5 -0
- package/es/share/hook/use-composition.js +17 -0
- package/es/share/hook/use-controlled-mode.d.ts +6 -0
- package/es/share/hook/use-controlled-mode.js +25 -0
- package/es/share/hook/use-dark-mode.js +11 -3
- package/es/share/hook/use-index-of-children.d.ts +2 -1
- package/es/share/hook/use-index-of-children.js +25 -35
- package/es/share/hook/use-resize-observer.js +1 -1
- package/es/share/hook/use-textarea-height.d.ts +5 -0
- package/es/share/hook/use-textarea-height.js +116 -0
- package/es/share/hook/use-watch-global-css-var.d.ts +1 -0
- package/es/share/hook/use-watch-global-css-var.js +19 -0
- package/es/share/hook/use-z-index.d.ts +6 -0
- package/es/share/hook/use-z-index.js +32 -0
- package/es/share/type/index.d.ts +9 -1
- package/es/share/util/color.js +4 -2
- package/es/share/util/common.d.ts +5 -0
- package/es/share/util/common.js +71 -0
- package/es/share/util/event-bus.d.ts +1 -0
- package/es/share/util/event-bus.js +20 -0
- package/es/share/util/plot.d.ts +15 -2
- package/es/share/util/plot.js +200 -30
- package/es/share/util/render.d.ts +1 -0
- package/es/share/util/render.js +10 -2
- package/es/share/util/theme.js +23 -4
- package/es/space/css.js +1 -1
- package/es/space/index.css +5 -0
- package/es/space/index.js +2 -2
- package/es/spin/css.js +2 -0
- package/es/spin/index.css +66 -0
- package/es/spin/index.d.ts +24 -0
- package/es/spin/index.js +104 -0
- package/es/spin/type.d.ts +54 -0
- package/es/tag/css.js +2 -0
- package/es/tag/draw.d.ts +6 -0
- package/es/tag/draw.js +135 -0
- package/es/tag/index.css +372 -0
- package/es/tag/index.d.ts +23 -0
- package/es/tag/index.js +193 -0
- package/es/tag/type.d.ts +58 -0
- package/es/textarea/css.js +2 -0
- package/es/textarea/draw.d.ts +2 -0
- package/es/textarea/draw.js +13 -0
- package/es/textarea/index.css +108 -0
- package/es/textarea/index.d.ts +49 -0
- package/es/textarea/index.js +267 -0
- package/es/textarea/type.d.ts +169 -0
- package/es/tooltip/css.js +1 -0
- package/es/tooltip/index.d.ts +20 -0
- package/es/tooltip/index.js +228 -0
- package/es/tooltip/type.d.ts +77 -0
- package/package.json +17 -3
- package/es/icons/{css.js → css-hn.js} +1 -1
package/es/button/index.js
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
import './css.js'
|
|
2
|
-
import { defineComponent,
|
|
3
|
-
import {
|
|
2
|
+
import { defineComponent, getCurrentInstance, ref, inject, computed, useSlots, shallowRef, onMounted, nextTick, watch, createElementBlock, openBlock, normalizeStyle, normalizeClass, createElementVNode, createCommentVNode, renderSlot, unref, createBlock } from "vue";
|
|
3
|
+
import { S as SpinnerThirdSolid } from "../auto-complete/index.js";
|
|
4
|
+
import { a as canvasPreprocess, c as calcPixelSize, g as getBorderRadius, b as calcBorderCornerCenter, f as floodFill } from "../share/util/plot.js";
|
|
4
5
|
import { p as parseColor, a as generatePalette } from "../share/util/color.js";
|
|
5
6
|
import { _ as _sfc_main$1 } from "../button-group/index.js";
|
|
6
|
-
import {
|
|
7
|
+
import { _ as _sfc_main$2 } from "../input-group/index.js";
|
|
8
|
+
import { g as getTextColorWithPalette, a as getBorderColor, d as drawGradient, b as drawBorder, c as getBackgroundColor } from "./draw.js";
|
|
7
9
|
import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
|
|
8
10
|
import { u as useResizeObserver } from "../share/hook/use-resize-observer.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
setup(__props) {
|
|
15
|
-
const props = __props;
|
|
16
|
-
return (_ctx, _cache) => {
|
|
17
|
-
return openBlock(), createElementBlock(
|
|
18
|
-
"svg",
|
|
19
|
-
{
|
|
20
|
-
class: "px-icon-hn",
|
|
21
|
-
style: normalizeStyle({ color: props.color, fontSize: props.size + "px" }),
|
|
22
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
viewBox: "0 0 24 24"
|
|
24
|
-
},
|
|
25
|
-
[..._cache[0] || (_cache[0] = [
|
|
26
|
-
createElementVNode(
|
|
27
|
-
"path",
|
|
28
|
-
{ d: "M23 9v6h-1v2h-3v-2h1V9h-1V7h-1V6h-1V5h-2V4h-2V3h-1V1h3v1h2v1h2v1h1v1h1v2h1v2z" },
|
|
29
|
-
null,
|
|
30
|
-
-1
|
|
31
|
-
/* CACHED */
|
|
32
|
-
)
|
|
33
|
-
])],
|
|
34
|
-
4
|
|
35
|
-
/* STYLE */
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
11
|
+
import { u as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
|
|
12
|
+
import { u as useIndexOfChildren } from "../share/hook/use-index-of-children.js";
|
|
13
|
+
import { B as BUTTON_GROUP_UPDATE, I as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
|
|
14
|
+
import { B as BUTTON_GROUP_PROVIDE, I as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
|
|
15
|
+
import { B as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
|
|
40
16
|
const _hoisted_1 = ["disabled", "type", "autofocus"];
|
|
41
17
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
18
|
...{
|
|
@@ -57,41 +33,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
33
|
autofocus: { type: Boolean, default: false }
|
|
58
34
|
},
|
|
59
35
|
setup(__props) {
|
|
60
|
-
var _a;
|
|
36
|
+
var _a, _b;
|
|
61
37
|
const props = __props;
|
|
62
38
|
const instance = getCurrentInstance();
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const first = ref(false);
|
|
66
|
-
const buttonGroupProps = inject(
|
|
39
|
+
const innerButtonGroup = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
|
|
40
|
+
const innerInputGroup = ref(((_b = instance == null ? void 0 : instance.parent) == null ? void 0 : _b.type) === _sfc_main$2);
|
|
41
|
+
const [_, first, last] = innerButtonGroup.value ? useIndexOfChildren(BUTTON_GROUP_UPDATE) : innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE) : [ref(0), ref(false), ref(false)];
|
|
42
|
+
const buttonGroupProps = inject(BUTTON_GROUP_PROVIDE);
|
|
43
|
+
const inputGroupProps = inject(INPUT_GROUP_PROVIDE);
|
|
67
44
|
const borderRadiusComputed = computed(() => {
|
|
68
|
-
return
|
|
45
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.borderRadius : innerInputGroup.value && inputGroupProps ? inputGroupProps.borderRadius : props.borderRadius;
|
|
69
46
|
});
|
|
70
47
|
const typeComputed = computed(() => {
|
|
71
|
-
return
|
|
48
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.variant || props.variant : props.variant;
|
|
72
49
|
});
|
|
73
50
|
const sizeComputed = computed(() => {
|
|
74
|
-
return
|
|
51
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.size : innerInputGroup.value && inputGroupProps ? inputGroupProps.size : props.size;
|
|
75
52
|
});
|
|
76
53
|
const shapeComputed = computed(() => {
|
|
77
|
-
return
|
|
54
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.shape : innerInputGroup.value && inputGroupProps ? inputGroupProps.shape : props.shape;
|
|
78
55
|
});
|
|
79
56
|
const disabledComputed = computed(() => {
|
|
80
|
-
return
|
|
57
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.disabled || props.disabled : innerInputGroup.value && inputGroupProps ? inputGroupProps.disabled || props.disabled : props.disabled;
|
|
58
|
+
});
|
|
59
|
+
const loadingComputed = computed(() => {
|
|
60
|
+
return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.loading || props.loading : props.loading;
|
|
81
61
|
});
|
|
82
|
-
const checkIsLast = () => {
|
|
83
|
-
if (instance && instance.vnode.el instanceof HTMLElement) {
|
|
84
|
-
const parent = instance.vnode.el.parentElement;
|
|
85
|
-
if (parent && parent.children.length) {
|
|
86
|
-
const arr = [...parent.children];
|
|
87
|
-
last.value = arr.indexOf(instance.vnode.el) === parent.children.length - 1;
|
|
88
|
-
first.value = arr.indexOf(instance.vnode.el) === 0;
|
|
89
|
-
} else {
|
|
90
|
-
last.value = false;
|
|
91
|
-
first.value = false;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
62
|
const slots = useSlots();
|
|
96
63
|
const hoverFlag = ref(false);
|
|
97
64
|
const activeFlag = ref(false);
|
|
@@ -102,22 +69,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
102
69
|
activeFlag.value = value;
|
|
103
70
|
};
|
|
104
71
|
const darkMode = useDarkMode();
|
|
105
|
-
const canvasRef =
|
|
106
|
-
const buttonRef =
|
|
72
|
+
const canvasRef = shallowRef(null);
|
|
73
|
+
const buttonRef = shallowRef(null);
|
|
107
74
|
onMounted(() => {
|
|
108
|
-
|
|
109
|
-
buttonRef.value && buttonRef.value.addEventListener("slot-changed", refresh);
|
|
110
|
-
checkIsLast();
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
const refresh = () => {
|
|
114
|
-
setTimeout(() => {
|
|
115
|
-
checkIsLast();
|
|
75
|
+
nextTick(() => {
|
|
116
76
|
drawPixel();
|
|
117
77
|
});
|
|
118
|
-
};
|
|
119
|
-
onBeforeUnmount(() => {
|
|
120
|
-
buttonRef.value && buttonRef.value.removeEventListener("slot-changed", refresh);
|
|
121
78
|
});
|
|
122
79
|
const palette = computed(() => {
|
|
123
80
|
if (!props.color) return null;
|
|
@@ -126,14 +83,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
83
|
return palette2;
|
|
127
84
|
});
|
|
128
85
|
const textColor = computed(() => {
|
|
129
|
-
return getTextColorWithPalette(
|
|
86
|
+
return getTextColorWithPalette(
|
|
87
|
+
palette.value,
|
|
88
|
+
typeComputed.value,
|
|
89
|
+
disabledComputed.value,
|
|
90
|
+
loadingComputed.value,
|
|
91
|
+
hoverFlag.value,
|
|
92
|
+
activeFlag.value
|
|
93
|
+
);
|
|
130
94
|
});
|
|
131
95
|
watch(
|
|
132
96
|
[
|
|
133
97
|
borderRadiusComputed,
|
|
134
98
|
shapeComputed,
|
|
135
99
|
disabledComputed,
|
|
136
|
-
|
|
100
|
+
loadingComputed,
|
|
137
101
|
typeComputed,
|
|
138
102
|
() => props.theme,
|
|
139
103
|
palette,
|
|
@@ -142,66 +106,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
142
106
|
darkMode
|
|
143
107
|
],
|
|
144
108
|
() => {
|
|
145
|
-
|
|
146
|
-
checkIsLast();
|
|
147
|
-
drawPixel();
|
|
148
|
-
});
|
|
109
|
+
drawPixel();
|
|
149
110
|
}
|
|
150
111
|
);
|
|
112
|
+
watch([first, last], () => {
|
|
113
|
+
drawPixel();
|
|
114
|
+
});
|
|
151
115
|
const drawPixel = () => {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
canvasRef.value.height = buttonRect.height;
|
|
159
|
-
if (!ctx) return;
|
|
116
|
+
const preprocessData = canvasPreprocess(buttonRef, canvasRef);
|
|
117
|
+
if (!preprocessData) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const pixelSize = calcPixelSize();
|
|
121
|
+
const { ctx, width, height, canvas } = preprocessData;
|
|
160
122
|
const borderRadius = getBorderRadius(
|
|
161
|
-
|
|
123
|
+
canvas,
|
|
162
124
|
pixelSize,
|
|
163
125
|
borderRadiusComputed.value,
|
|
164
126
|
shapeComputed.value,
|
|
165
|
-
|
|
127
|
+
sizeComputed.value || "medium",
|
|
128
|
+
innerButtonGroup.value || innerInputGroup.value,
|
|
166
129
|
first.value,
|
|
167
130
|
last.value
|
|
168
131
|
);
|
|
169
132
|
const borderColor = getBorderColor(
|
|
170
133
|
disabledComputed.value,
|
|
171
|
-
|
|
134
|
+
loadingComputed.value,
|
|
172
135
|
typeComputed.value,
|
|
173
136
|
props.theme,
|
|
174
137
|
palette.value,
|
|
175
138
|
hoverFlag.value,
|
|
176
139
|
activeFlag.value
|
|
177
140
|
);
|
|
178
|
-
const center =
|
|
179
|
-
|
|
180
|
-
[canvasRef.value.width - borderRadius[1] - pixelSize, borderRadius[1]],
|
|
181
|
-
[canvasRef.value.width - borderRadius[2] - pixelSize, canvasRef.value.height - borderRadius[2] - pixelSize],
|
|
182
|
-
[borderRadius[3], canvasRef.value.height - borderRadius[3] - pixelSize]
|
|
183
|
-
];
|
|
184
|
-
const rad = [
|
|
185
|
-
[Math.PI, Math.PI * 3 / 2],
|
|
186
|
-
[Math.PI * 3 / 2, Math.PI * 2],
|
|
187
|
-
[0, Math.PI / 2],
|
|
188
|
-
[Math.PI / 2, Math.PI]
|
|
189
|
-
];
|
|
141
|
+
const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize);
|
|
142
|
+
const rad = BORDER_CORNER_RAD_RANGE;
|
|
190
143
|
if (typeComputed.value === "primary") {
|
|
191
144
|
drawGradient(
|
|
192
145
|
ctx,
|
|
193
|
-
|
|
194
|
-
|
|
146
|
+
width,
|
|
147
|
+
height,
|
|
195
148
|
center,
|
|
196
149
|
borderRadius,
|
|
197
150
|
rad,
|
|
198
151
|
pixelSize,
|
|
199
152
|
disabledComputed.value,
|
|
200
|
-
|
|
201
|
-
typeComputed.value,
|
|
153
|
+
loadingComputed.value,
|
|
202
154
|
props.theme,
|
|
203
155
|
palette.value,
|
|
204
|
-
|
|
156
|
+
innerButtonGroup.value || innerInputGroup.value,
|
|
205
157
|
first.value,
|
|
206
158
|
last.value,
|
|
207
159
|
hoverFlag.value,
|
|
@@ -210,38 +162,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
210
162
|
}
|
|
211
163
|
drawBorder(
|
|
212
164
|
ctx,
|
|
213
|
-
|
|
214
|
-
|
|
165
|
+
width,
|
|
166
|
+
height,
|
|
215
167
|
center,
|
|
216
168
|
borderRadius,
|
|
217
169
|
rad,
|
|
218
170
|
borderColor,
|
|
219
171
|
pixelSize,
|
|
220
172
|
typeComputed.value,
|
|
221
|
-
|
|
173
|
+
innerButtonGroup.value || innerInputGroup.value,
|
|
222
174
|
first.value,
|
|
223
175
|
last.value
|
|
224
176
|
);
|
|
225
177
|
const backgroundColor = getBackgroundColor(
|
|
226
178
|
disabledComputed.value,
|
|
227
|
-
|
|
179
|
+
loadingComputed.value,
|
|
228
180
|
typeComputed.value,
|
|
229
181
|
props.theme,
|
|
230
182
|
palette.value,
|
|
231
183
|
hoverFlag.value,
|
|
232
184
|
activeFlag.value
|
|
233
185
|
);
|
|
234
|
-
floodFill(ctx, Math.round(
|
|
186
|
+
floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
|
|
235
187
|
};
|
|
236
188
|
useResizeObserver(buttonRef, drawPixel);
|
|
189
|
+
useWatchGlobalCssVal(drawPixel);
|
|
237
190
|
return (_ctx, _cache) => {
|
|
238
191
|
return openBlock(), createElementBlock("button", {
|
|
239
|
-
disabled: disabledComputed.value ||
|
|
192
|
+
disabled: disabledComputed.value || loadingComputed.value,
|
|
240
193
|
class: normalizeClass(["pixelium px-button", {
|
|
241
|
-
"px-button__block": !
|
|
194
|
+
"px-button__block": !(innerButtonGroup.value || innerInputGroup.value) && !!props.block,
|
|
242
195
|
"px-button__circle": shapeComputed.value === "circle",
|
|
243
196
|
"px-button__square": shapeComputed.value === "square",
|
|
244
|
-
"px-button__loading":
|
|
197
|
+
"px-button__loading": loadingComputed.value,
|
|
245
198
|
"px-button__large": sizeComputed.value === "large",
|
|
246
199
|
"px-button__small": sizeComputed.value === "small",
|
|
247
200
|
"px-button__outline": typeComputed.value === "outline",
|
|
@@ -249,7 +202,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
249
202
|
"px-button__text": typeComputed.value === "text",
|
|
250
203
|
"px-button__disabled": disabledComputed.value,
|
|
251
204
|
"px-button__custom": palette.value,
|
|
252
|
-
"px-button__inner":
|
|
205
|
+
"px-button__inner": innerButtonGroup.value || innerInputGroup.value,
|
|
253
206
|
[`px-button__${props.theme || "primary"}`]: true
|
|
254
207
|
}]),
|
|
255
208
|
style: normalizeStyle({
|
|
@@ -257,7 +210,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
257
210
|
}),
|
|
258
211
|
ref_key: "buttonRef",
|
|
259
212
|
ref: buttonRef,
|
|
260
|
-
"data-px-button": "",
|
|
261
213
|
onMouseenter: _cache[0] || (_cache[0] = ($event) => toggleHover(true)),
|
|
262
214
|
onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleHover(false)),
|
|
263
215
|
onMousedown: _cache[2] || (_cache[2] = ($event) => toggleActive(true)),
|
|
@@ -276,7 +228,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
276
228
|
512
|
|
277
229
|
/* NEED_PATCH */
|
|
278
230
|
),
|
|
279
|
-
unref(slots).icon ||
|
|
231
|
+
unref(slots).icon || loadingComputed.value ? (openBlock(), createElementBlock(
|
|
280
232
|
"div",
|
|
281
233
|
{
|
|
282
234
|
key: 0,
|
|
@@ -285,15 +237,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
285
237
|
}])
|
|
286
238
|
},
|
|
287
239
|
[
|
|
288
|
-
|
|
240
|
+
loadingComputed.value ? (openBlock(), createBlock(unref(SpinnerThirdSolid), {
|
|
289
241
|
key: 0,
|
|
290
|
-
class:
|
|
291
|
-
"px-button-icon__loading": props.loading
|
|
292
|
-
}]),
|
|
242
|
+
class: "px-button-icon px-animation__loading",
|
|
293
243
|
style: normalizeStyle({
|
|
294
244
|
fill: textColor.value
|
|
295
245
|
})
|
|
296
|
-
}, null, 8, ["
|
|
246
|
+
}, null, 8, ["style"])) : renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
297
247
|
],
|
|
298
248
|
2
|
|
299
249
|
/* CLASS */
|
|
@@ -304,6 +254,5 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
304
254
|
}
|
|
305
255
|
});
|
|
306
256
|
export {
|
|
307
|
-
SpinnerThirdSolid as S,
|
|
308
257
|
_sfc_main as _
|
|
309
258
|
};
|
package/es/button-group/css.js
CHANGED
|
@@ -7,7 +7,6 @@ declare const __VLS_component: import("vue").DefineComponent<ButtonGroupProps, {
|
|
|
7
7
|
shape: "default" | "round";
|
|
8
8
|
size: "medium" | "large" | "small";
|
|
9
9
|
disabled: boolean;
|
|
10
|
-
variant: "primary" | "plain" | "text" | "outline";
|
|
11
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
11
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
12
|
export default _default;
|
package/es/button-group/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import './css.js'
|
|
2
|
-
import { defineComponent, provide,
|
|
3
|
-
import {
|
|
2
|
+
import { defineComponent, provide, createElementBlock, openBlock, renderSlot } from "vue";
|
|
3
|
+
import { e as emitParentUpdate } from "../share/hook/use-index-of-children.js";
|
|
4
|
+
import { B as BUTTON_GROUP_UPDATE } from "../share/const/event-bus-key.js";
|
|
5
|
+
import { B as BUTTON_GROUP_PROVIDE } from "../share/const/provide-key.js";
|
|
6
|
+
const _hoisted_1 = { class: "pixelium px-button-group" };
|
|
4
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
8
|
...{
|
|
6
9
|
name: "ButtonGroup"
|
|
@@ -12,45 +15,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12
15
|
size: { default: "medium" },
|
|
13
16
|
disabled: { type: Boolean, default: false },
|
|
14
17
|
loading: { type: Boolean },
|
|
15
|
-
variant:
|
|
18
|
+
variant: null
|
|
16
19
|
},
|
|
17
20
|
setup(__props) {
|
|
18
21
|
const props = __props;
|
|
19
|
-
provide(
|
|
20
|
-
|
|
21
|
-
const callback = () => {
|
|
22
|
-
nextTick(() => {
|
|
23
|
-
if (slotWrapper.value) {
|
|
24
|
-
slotWrapper.value.querySelectorAll("[data-px-button]").forEach((el) => el.dispatchEvent(new CustomEvent("slot-changed")));
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
if (inBrowser()) {
|
|
29
|
-
const mutationObserver = new MutationObserver(callback);
|
|
30
|
-
onMounted(() => {
|
|
31
|
-
nextTick(() => {
|
|
32
|
-
slotWrapper.value && mutationObserver.observe(slotWrapper.value, { childList: true });
|
|
33
|
-
});
|
|
34
|
-
callback();
|
|
35
|
-
});
|
|
36
|
-
onBeforeUnmount(() => {
|
|
37
|
-
mutationObserver.disconnect();
|
|
38
|
-
});
|
|
39
|
-
}
|
|
22
|
+
provide(BUTTON_GROUP_PROVIDE, props);
|
|
23
|
+
emitParentUpdate(BUTTON_GROUP_UPDATE);
|
|
40
24
|
return (_ctx, _cache) => {
|
|
41
|
-
return openBlock(), createElementBlock(
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
class: "pixelium px-button-group",
|
|
45
|
-
ref_key: "slotWrapper",
|
|
46
|
-
ref: slotWrapper
|
|
47
|
-
},
|
|
48
|
-
[
|
|
49
|
-
renderSlot(_ctx.$slots, "default")
|
|
50
|
-
],
|
|
51
|
-
512
|
|
52
|
-
/* NEED_PATCH */
|
|
53
|
-
);
|
|
25
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
26
|
+
renderSlot(_ctx.$slots, "default")
|
|
27
|
+
]);
|
|
54
28
|
};
|
|
55
29
|
}
|
|
56
30
|
});
|
|
@@ -26,7 +26,7 @@ export type ButtonGroupProps = {
|
|
|
26
26
|
*/
|
|
27
27
|
loading?: boolean;
|
|
28
28
|
/**
|
|
29
|
-
* @property {'primary' | 'plain' | 'text' | 'outline'} [variant
|
|
29
|
+
* @property {'primary' | 'plain' | 'text' | 'outline'} [variant]
|
|
30
30
|
* @version 0.0.0-beta
|
|
31
31
|
*/
|
|
32
32
|
variant?: 'primary' | 'plain' | 'text' | 'outline';
|
package/es/col/css.js
CHANGED
package/es/col/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<ColProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColProps> & Readonly<{}>, {
|
|
7
|
-
span: number | import("../
|
|
8
|
-
offset: number | import("../
|
|
7
|
+
span: number | import("../index.ts").ValueWithDeviceWidth<number>;
|
|
8
|
+
offset: number | import("../index.ts").ValueWithDeviceWidth<number>;
|
|
9
9
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
10
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
11
|
export default _default;
|
package/es/container/css.js
CHANGED
package/es/divider/css.js
CHANGED
package/es/empty/css.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.px-empty {
|
|
2
|
+
color: var(--px-neutral-8);
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
.px-empty .px-empty-icon {
|
|
8
|
+
width: var(--px-large-base-size);
|
|
9
|
+
height: var(--px-large-base-size);
|
|
10
|
+
}
|
|
11
|
+
.px-empty-icon-wrapper {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
font-size: var(--px-large-base-size);
|
|
16
|
+
}
|
|
17
|
+
.px-empty-description {
|
|
18
|
+
margin-top: var(--px-interval-1);
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { EmptyProps } from './type';
|
|
2
|
+
declare var __VLS_1: {}, __VLS_8: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
image?: (props: typeof __VLS_1) => any;
|
|
5
|
+
} & {
|
|
6
|
+
description?: (props: typeof __VLS_8) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<EmptyProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<EmptyProps> & Readonly<{}>, {
|
|
9
|
+
description: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import './css.js'
|
|
2
|
+
import { defineComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, renderSlot, createVNode, unref, createTextVNode, toDisplayString } from "vue";
|
|
3
|
+
const FileDelete = /* @__PURE__ */ defineComponent({
|
|
4
|
+
props: {
|
|
5
|
+
size: {},
|
|
6
|
+
color: {}
|
|
7
|
+
},
|
|
8
|
+
setup(__props) {
|
|
9
|
+
const props = __props;
|
|
10
|
+
return (_ctx, _cache) => {
|
|
11
|
+
return openBlock(), createElementBlock(
|
|
12
|
+
"svg",
|
|
13
|
+
{
|
|
14
|
+
class: "px-icon-pa",
|
|
15
|
+
style: normalizeStyle({ color: props.color, fontSize: props.size + "px" }),
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
fill: "none",
|
|
18
|
+
viewBox: "0 0 24 24"
|
|
19
|
+
},
|
|
20
|
+
[..._cache[0] || (_cache[0] = [
|
|
21
|
+
createElementVNode(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
fill: "currentColor",
|
|
25
|
+
d: "M11 22h10V8h-2V6h-2v2h-2V6h2V4h-2V2H3v12h2V4h8v6h6v10h-8zm-4-2H5v2H3v-2h2v-2H3v-2h2v2h2v-2h2v2H7zm0 0h2v2H7z"
|
|
26
|
+
},
|
|
27
|
+
null,
|
|
28
|
+
-1
|
|
29
|
+
/* CACHED */
|
|
30
|
+
)
|
|
31
|
+
])],
|
|
32
|
+
4
|
|
33
|
+
/* STYLE */
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const _hoisted_1 = { class: "pixelium px-empty" };
|
|
39
|
+
const _hoisted_2 = { class: "px-empty-icon-wrapper" };
|
|
40
|
+
const _hoisted_3 = { class: "px-empty-description" };
|
|
41
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
|
+
...{
|
|
43
|
+
name: "Empty"
|
|
44
|
+
},
|
|
45
|
+
__name: "index",
|
|
46
|
+
props: {
|
|
47
|
+
description: { default: "No Data" }
|
|
48
|
+
},
|
|
49
|
+
setup(__props) {
|
|
50
|
+
const props = __props;
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
53
|
+
createElementVNode("div", _hoisted_2, [
|
|
54
|
+
renderSlot(_ctx.$slots, "image", {}, () => [
|
|
55
|
+
createVNode(unref(FileDelete), { class: "px-empty-icon" })
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
58
|
+
createElementVNode("div", _hoisted_3, [
|
|
59
|
+
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
60
|
+
createTextVNode(
|
|
61
|
+
toDisplayString(props.description),
|
|
62
|
+
1
|
|
63
|
+
/* TEXT */
|
|
64
|
+
)
|
|
65
|
+
])
|
|
66
|
+
])
|
|
67
|
+
]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
_sfc_main as _
|
|
73
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type EmptyProps = {
|
|
2
|
+
/**
|
|
3
|
+
* @property {string} [description='No Data']
|
|
4
|
+
* @version 0.0.2
|
|
5
|
+
*/
|
|
6
|
+
description?: string;
|
|
7
|
+
};
|
|
8
|
+
export type EmptySlots = {
|
|
9
|
+
/**
|
|
10
|
+
* @slot image
|
|
11
|
+
* @version 0.0.2
|
|
12
|
+
*/
|
|
13
|
+
image: {};
|
|
14
|
+
/**
|
|
15
|
+
* @slot description
|
|
16
|
+
* @version 0.0.2
|
|
17
|
+
*/
|
|
18
|
+
description: {};
|
|
19
|
+
};
|
package/es/footer/css.js
CHANGED
package/es/grid/css.js
CHANGED
package/es/grid/index.js
CHANGED
|
@@ -2,6 +2,9 @@ import './css.js'
|
|
|
2
2
|
import { defineComponent, computed, ref, provide, createElementBlock, openBlock, normalizeStyle, renderSlot } from "vue";
|
|
3
3
|
import { u as useScreenWidth } from "../share/hook/use-screen-width.js";
|
|
4
4
|
import { k, G as Gn } from "../aside/index.js";
|
|
5
|
+
import { e as emitParentUpdate } from "../share/hook/use-index-of-children.js";
|
|
6
|
+
import { G as GRID_UPDATE } from "../share/const/event-bus-key.js";
|
|
7
|
+
import { G as GRID_PROVIDE } from "../share/const/provide-key.js";
|
|
5
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
9
|
...{
|
|
7
10
|
name: "Grid"
|
|
@@ -44,11 +47,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
44
47
|
return currentColumn || 24;
|
|
45
48
|
});
|
|
46
49
|
const itemsStat = ref([]);
|
|
47
|
-
provide(
|
|
50
|
+
provide(GRID_PROVIDE, {
|
|
48
51
|
column: columnComputed,
|
|
49
52
|
gutter: gutterComputed,
|
|
50
53
|
itemsStat
|
|
51
54
|
});
|
|
55
|
+
emitParentUpdate(GRID_UPDATE);
|
|
52
56
|
return (_ctx, _cache) => {
|
|
53
57
|
return openBlock(), createElementBlock(
|
|
54
58
|
"div",
|
package/es/grid-item/css.js
CHANGED
package/es/grid-item/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ type __VLS_Slots = {} & {
|
|
|
4
4
|
default?: (props: typeof __VLS_1) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_component: import("vue").DefineComponent<GridItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<GridItemProps> & Readonly<{}>, {
|
|
7
|
-
offset: number | import("../
|
|
7
|
+
offset: number | import("../index.ts").ValueWithDeviceWidth<number>;
|
|
8
8
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
10
|
export default _default;
|