@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.
Files changed (199) hide show
  1. package/README.md +21 -10
  2. package/README.zh.md +21 -10
  3. package/dist/icon-pa.d.ts +490 -0
  4. package/dist/index.d.ts +1586 -10
  5. package/dist/pixelium-vue-icon-pa.cjs +1 -0
  6. package/dist/pixelium-vue-icon-pa.css +1 -0
  7. package/dist/pixelium-vue-icon-pa.js +10143 -0
  8. package/dist/pixelium-vue-icon-pa.umd.cjs +1 -0
  9. package/dist/pixelium-vue.cjs +12 -1
  10. package/dist/pixelium-vue.css +1 -1
  11. package/dist/pixelium-vue.js +5368 -1093
  12. package/dist/pixelium-vue.umd.cjs +12 -1
  13. package/es/aside/css.js +1 -1
  14. package/es/aside/index.js +60 -13
  15. package/es/auto-complete/css.js +2 -0
  16. package/es/auto-complete/draw.d.ts +2 -0
  17. package/es/auto-complete/draw.js +52 -0
  18. package/es/auto-complete/index.css +123 -0
  19. package/es/auto-complete/index.d.ts +35 -0
  20. package/es/auto-complete/index.js +402 -0
  21. package/es/auto-complete/type.d.ts +192 -0
  22. package/es/button/css.js +1 -1
  23. package/es/button/draw.d.ts +1 -2
  24. package/es/button/draw.js +105 -123
  25. package/es/button/index.css +24 -14
  26. package/es/button/index.js +70 -121
  27. package/es/button-group/css.js +1 -1
  28. package/es/button-group/index.d.ts +0 -1
  29. package/es/button-group/index.js +11 -37
  30. package/es/button-group/type.d.ts +1 -1
  31. package/es/col/css.js +1 -1
  32. package/es/col/index.d.ts +2 -2
  33. package/es/container/css.js +1 -1
  34. package/es/divider/css.js +1 -1
  35. package/es/empty/css.js +2 -0
  36. package/es/empty/index.css +19 -0
  37. package/es/empty/index.d.ts +17 -0
  38. package/es/empty/index.js +73 -0
  39. package/es/empty/type.d.ts +19 -0
  40. package/es/footer/css.js +1 -1
  41. package/es/grid/css.js +1 -1
  42. package/es/grid/index.js +5 -1
  43. package/es/grid-item/css.js +1 -1
  44. package/es/grid-item/index.d.ts +1 -1
  45. package/es/grid-item/index.js +7 -3
  46. package/es/header/css.js +1 -1
  47. package/es/icon/css.js +1 -1
  48. package/es/icon/index.css +0 -3
  49. package/es/icon/index.js +1 -1
  50. package/es/icons/css-pa.js +2 -0
  51. package/es/icons/icon-hn.js +1 -1
  52. package/es/icons/icon-pa.css +9 -0
  53. package/es/icons/icon-pa.d.ts +490 -0
  54. package/es/icons/icon-pa.js +17449 -0
  55. package/es/index.css +22 -8
  56. package/es/index.d.ts +18 -1
  57. package/es/index.js +63 -2
  58. package/es/input/css.js +2 -0
  59. package/es/input/draw.d.ts +2 -0
  60. package/es/input/draw.js +52 -0
  61. package/es/input/index.css +138 -0
  62. package/es/input/index.d.ts +50 -0
  63. package/es/input/index.js +432 -0
  64. package/es/input/type.d.ts +175 -0
  65. package/es/input-group/css.js +2 -0
  66. package/es/input-group/index.css +24 -0
  67. package/es/input-group/index.d.ts +17 -0
  68. package/es/input-group/index.js +40 -0
  69. package/es/input-group/type.d.ts +30 -0
  70. package/es/input-group-label/css.js +2 -0
  71. package/es/input-group-label/draw.d.ts +2 -0
  72. package/es/input-group-label/draw.js +52 -0
  73. package/es/input-group-label/index.css +50 -0
  74. package/es/input-group-label/index.d.ts +16 -0
  75. package/es/input-group-label/index.js +129 -0
  76. package/es/input-group-label/type.d.ts +30 -0
  77. package/es/input-number/css.js +2 -0
  78. package/es/input-number/draw.d.ts +2 -0
  79. package/es/input-number/draw.js +52 -0
  80. package/es/input-number/index.css +161 -0
  81. package/es/input-number/index.d.ts +47 -0
  82. package/es/input-number/index.js +543 -0
  83. package/es/input-number/type.d.ts +183 -0
  84. package/es/input-tag/css.js +2 -0
  85. package/es/input-tag/draw.d.ts +2 -0
  86. package/es/input-tag/draw.js +49 -0
  87. package/es/input-tag/index.css +133 -0
  88. package/es/input-tag/index.d.ts +73 -0
  89. package/es/input-tag/index.js +474 -0
  90. package/es/input-tag/type.d.ts +212 -0
  91. package/es/link/css.js +1 -1
  92. package/es/link/index.css +2 -5
  93. package/es/link/index.js +10 -6
  94. package/es/main/css.js +1 -1
  95. package/es/mask/css.js +2 -0
  96. package/es/mask/index.css +17 -0
  97. package/es/mask/index.d.ts +8 -0
  98. package/es/mask/index.js +117 -0
  99. package/es/mask/type.d.ts +27 -0
  100. package/es/message/css.js +1 -1
  101. package/es/message/index.css +26 -26
  102. package/es/message/index.d.ts +1 -1
  103. package/es/message/index.js +22 -50
  104. package/es/message-box/css.js +1 -1
  105. package/es/message-box/index.js +40 -30
  106. package/es/message-box/message-box-wrapped.d.ts +0 -1
  107. package/es/message-box/message-box-wrapped.js +2 -2
  108. package/es/message-box/message-box.d.ts +2 -1
  109. package/es/message-box/message-box.js +10 -8
  110. package/es/message-box/type.d.ts +14 -4
  111. package/es/option-list/css.js +2 -0
  112. package/es/option-list/index.css +57 -0
  113. package/es/option-list/index.d.ts +38 -0
  114. package/es/option-list/index.js +169 -0
  115. package/es/option-list/type.d.ts +16 -0
  116. package/es/popover/css.js +1 -0
  117. package/es/popover/index.d.ts +203 -0
  118. package/es/popover/index.js +240 -0
  119. package/es/popover/type.d.ts +100 -0
  120. package/es/popup-content/css.js +2 -0
  121. package/es/popup-content/draw.d.ts +6 -0
  122. package/es/popup-content/draw.js +151 -0
  123. package/es/popup-content/index.css +99 -0
  124. package/es/popup-content/index.d.ts +30 -0
  125. package/es/popup-content/index.js +1578 -0
  126. package/es/popup-content/type.d.ts +20 -0
  127. package/es/popup-trigger/css.js +1 -0
  128. package/es/popup-trigger/index.d.ts +22 -0
  129. package/es/popup-trigger/index.js +97 -0
  130. package/es/popup-trigger/type.d.ts +9 -0
  131. package/es/row/css.js +1 -1
  132. package/es/select/css.js +2 -0
  133. package/es/select/draw.d.ts +2 -0
  134. package/es/select/draw.js +52 -0
  135. package/es/select/index.css +152 -0
  136. package/es/select/index.d.ts +44 -0
  137. package/es/select/index.js +674 -0
  138. package/es/select/type.d.ts +252 -0
  139. package/es/share/const/event-bus-key.d.ts +4 -0
  140. package/es/share/const/event-bus-key.js +10 -0
  141. package/es/share/const/index.d.ts +4 -0
  142. package/es/share/const/index.js +11 -2
  143. package/es/share/const/provide-key.d.ts +3 -0
  144. package/es/share/const/provide-key.js +8 -0
  145. package/es/share/hook/use-click-outside-listener.d.ts +4 -0
  146. package/es/share/hook/use-click-outside-listener.js +44 -0
  147. package/es/share/hook/use-composition.d.ts +5 -0
  148. package/es/share/hook/use-composition.js +17 -0
  149. package/es/share/hook/use-controlled-mode.d.ts +6 -0
  150. package/es/share/hook/use-controlled-mode.js +25 -0
  151. package/es/share/hook/use-dark-mode.js +11 -3
  152. package/es/share/hook/use-index-of-children.d.ts +2 -1
  153. package/es/share/hook/use-index-of-children.js +25 -35
  154. package/es/share/hook/use-resize-observer.js +1 -1
  155. package/es/share/hook/use-textarea-height.d.ts +5 -0
  156. package/es/share/hook/use-textarea-height.js +116 -0
  157. package/es/share/hook/use-watch-global-css-var.d.ts +1 -0
  158. package/es/share/hook/use-watch-global-css-var.js +19 -0
  159. package/es/share/hook/use-z-index.d.ts +6 -0
  160. package/es/share/hook/use-z-index.js +32 -0
  161. package/es/share/type/index.d.ts +9 -1
  162. package/es/share/util/color.js +4 -2
  163. package/es/share/util/common.d.ts +5 -0
  164. package/es/share/util/common.js +71 -0
  165. package/es/share/util/event-bus.d.ts +1 -0
  166. package/es/share/util/event-bus.js +20 -0
  167. package/es/share/util/plot.d.ts +15 -2
  168. package/es/share/util/plot.js +200 -30
  169. package/es/share/util/render.d.ts +1 -0
  170. package/es/share/util/render.js +10 -2
  171. package/es/share/util/theme.js +23 -4
  172. package/es/space/css.js +1 -1
  173. package/es/space/index.css +5 -0
  174. package/es/space/index.js +2 -2
  175. package/es/spin/css.js +2 -0
  176. package/es/spin/index.css +66 -0
  177. package/es/spin/index.d.ts +24 -0
  178. package/es/spin/index.js +104 -0
  179. package/es/spin/type.d.ts +54 -0
  180. package/es/tag/css.js +2 -0
  181. package/es/tag/draw.d.ts +6 -0
  182. package/es/tag/draw.js +135 -0
  183. package/es/tag/index.css +372 -0
  184. package/es/tag/index.d.ts +23 -0
  185. package/es/tag/index.js +193 -0
  186. package/es/tag/type.d.ts +58 -0
  187. package/es/textarea/css.js +2 -0
  188. package/es/textarea/draw.d.ts +2 -0
  189. package/es/textarea/draw.js +13 -0
  190. package/es/textarea/index.css +108 -0
  191. package/es/textarea/index.d.ts +49 -0
  192. package/es/textarea/index.js +267 -0
  193. package/es/textarea/type.d.ts +169 -0
  194. package/es/tooltip/css.js +1 -0
  195. package/es/tooltip/index.d.ts +20 -0
  196. package/es/tooltip/index.js +228 -0
  197. package/es/tooltip/type.d.ts +77 -0
  198. package/package.json +17 -3
  199. package/es/icons/{css.js → css-hn.js} +1 -1
@@ -1,42 +1,18 @@
1
1
  import './css.js'
2
- import { defineComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, getCurrentInstance, ref, inject, computed, useSlots, onMounted, onBeforeUnmount, watch, normalizeClass, createCommentVNode, renderSlot, unref, createBlock } from "vue";
3
- import { f as floodFill } from "../share/util/plot.js";
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 { g as getTextColorWithPalette, a as getBorderRadius, b as getBorderColor, d as drawGradient, c as drawBorder, e as getBackgroundColor } from "./draw.js";
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
- const SpinnerThirdSolid = /* @__PURE__ */ defineComponent({
10
- props: {
11
- size: {},
12
- color: {}
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 inner = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
64
- const last = ref(false);
65
- const first = ref(false);
66
- const buttonGroupProps = inject("px-button-group-props");
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 inner.value && buttonGroupProps ? buttonGroupProps.borderRadius : props.borderRadius;
45
+ return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.borderRadius : innerInputGroup.value && inputGroupProps ? inputGroupProps.borderRadius : props.borderRadius;
69
46
  });
70
47
  const typeComputed = computed(() => {
71
- return inner.value && buttonGroupProps ? buttonGroupProps.variant : props.variant;
48
+ return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.variant || props.variant : props.variant;
72
49
  });
73
50
  const sizeComputed = computed(() => {
74
- return inner.value && buttonGroupProps ? buttonGroupProps.size : props.size;
51
+ return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.size : innerInputGroup.value && inputGroupProps ? inputGroupProps.size : props.size;
75
52
  });
76
53
  const shapeComputed = computed(() => {
77
- return inner.value && buttonGroupProps ? buttonGroupProps.shape : props.shape;
54
+ return innerButtonGroup.value && buttonGroupProps ? buttonGroupProps.shape : innerInputGroup.value && inputGroupProps ? inputGroupProps.shape : props.shape;
78
55
  });
79
56
  const disabledComputed = computed(() => {
80
- return inner.value && buttonGroupProps ? buttonGroupProps.disabled || props.disabled : props.disabled;
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 = ref(null);
106
- const buttonRef = ref(null);
72
+ const canvasRef = shallowRef(null);
73
+ const buttonRef = shallowRef(null);
107
74
  onMounted(() => {
108
- setTimeout(() => {
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(palette.value, typeComputed.value, disabledComputed.value, props.loading, hoverFlag.value, activeFlag.value);
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
- () => props.loading,
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
- setTimeout(() => {
146
- checkIsLast();
147
- drawPixel();
148
- });
109
+ drawPixel();
149
110
  }
150
111
  );
112
+ watch([first, last], () => {
113
+ drawPixel();
114
+ });
151
115
  const drawPixel = () => {
152
- const globalComputedStyle = getComputedStyle(document.documentElement);
153
- const pixelSize = parseInt(globalComputedStyle.getPropertyValue("--px-bit"));
154
- if (!canvasRef.value || !buttonRef.value) return;
155
- const ctx = canvasRef.value.getContext("2d", { willReadFrequently: true });
156
- const buttonRect = buttonRef.value.getBoundingClientRect();
157
- canvasRef.value.width = buttonRect.width;
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
- canvasRef.value,
123
+ canvas,
162
124
  pixelSize,
163
125
  borderRadiusComputed.value,
164
126
  shapeComputed.value,
165
- inner.value,
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
- props.loading,
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
- [borderRadius[0], borderRadius[0]],
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
- canvasRef.value.width,
194
- canvasRef.value.height,
146
+ width,
147
+ height,
195
148
  center,
196
149
  borderRadius,
197
150
  rad,
198
151
  pixelSize,
199
152
  disabledComputed.value,
200
- props.loading,
201
- typeComputed.value,
153
+ loadingComputed.value,
202
154
  props.theme,
203
155
  palette.value,
204
- inner.value,
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
- canvasRef.value.width,
214
- canvasRef.value.height,
165
+ width,
166
+ height,
215
167
  center,
216
168
  borderRadius,
217
169
  rad,
218
170
  borderColor,
219
171
  pixelSize,
220
172
  typeComputed.value,
221
- inner.value,
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
- props.loading,
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((center[0][0] + center[1][0]) / 2), Math.round((center[0][1] + center[2][1]) / 2), backgroundColor);
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 || props.loading,
192
+ disabled: disabledComputed.value || loadingComputed.value,
240
193
  class: normalizeClass(["pixelium px-button", {
241
- "px-button__block": !inner.value && !!props.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": props.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": inner.value,
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 || props.loading ? (openBlock(), createElementBlock(
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
- props.loading ? (openBlock(), createBlock(unref(SpinnerThirdSolid), {
240
+ loadingComputed.value ? (openBlock(), createBlock(unref(SpinnerThirdSolid), {
289
241
  key: 0,
290
- class: normalizeClass(["px-button-icon", {
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, ["class", "style"])) : renderSlot(_ctx.$slots, "icon", { key: 1 })
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
  };
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
@@ -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;
@@ -1,6 +1,9 @@
1
1
  import './css.js'
2
- import { defineComponent, provide, ref, onMounted, nextTick, onBeforeUnmount, createElementBlock, openBlock, renderSlot } from "vue";
3
- import { i as inBrowser } from "../share/util/env.js";
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: { default: "primary" }
18
+ variant: null
16
19
  },
17
20
  setup(__props) {
18
21
  const props = __props;
19
- provide("px-button-group-props", props);
20
- const slotWrapper = ref(null);
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
- "div",
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='primary']
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
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
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("../share/type/index.ts").ValueWithDeviceWidth<number>;
8
- offset: number | import("../share/type/index.ts").ValueWithDeviceWidth<number>;
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;
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
package/es/divider/css.js CHANGED
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
@@ -0,0 +1,2 @@
1
+ import '../index.css'
2
+ import './index.css'
@@ -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
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
package/es/grid/css.js CHANGED
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
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("px-grid-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",
@@ -1,2 +1,2 @@
1
- import './index.css'
2
1
  import '../index.css'
2
+ import './index.css'
@@ -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("../share/type/index.ts").ValueWithDeviceWidth<number>;
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;