@pixelium/web-vue 0.0.2 → 0.0.3-beta

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 (285) hide show
  1. package/README.md +42 -0
  2. package/README.zh.md +6 -3
  3. package/coverage/base.css +224 -0
  4. package/coverage/block-navigation.js +87 -0
  5. package/coverage/coverage-final.json +106 -0
  6. package/coverage/favicon.png +0 -0
  7. package/coverage/index.html +926 -0
  8. package/coverage/prettify.css +1 -0
  9. package/coverage/prettify.js +2 -0
  10. package/coverage/sort-arrow-sprite.png +0 -0
  11. package/coverage/sorter.js +210 -0
  12. package/dist/font.css +1 -1
  13. package/dist/index.d.ts +1593 -248
  14. package/dist/normalize.css +2 -0
  15. package/dist/pixelium-vue-icon-hn.cjs +1 -1
  16. package/dist/pixelium-vue-icon-hn.css +2 -1
  17. package/dist/pixelium-vue-icon-hn.js +8533 -8154
  18. package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
  19. package/dist/pixelium-vue-icon-pa.cjs +1 -1
  20. package/dist/pixelium-vue-icon-pa.css +2 -1
  21. package/dist/pixelium-vue-icon-pa.js +10625 -10143
  22. package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
  23. package/dist/pixelium-vue.cjs +2 -2
  24. package/dist/pixelium-vue.css +2 -1
  25. package/dist/pixelium-vue.js +7402 -5852
  26. package/dist/pixelium-vue.umd.cjs +2 -2
  27. package/es/aside/index.js +46 -151
  28. package/es/auto-complete/draw.d.ts +1 -1
  29. package/es/auto-complete/draw.js +26 -51
  30. package/es/auto-complete/index.css +92 -32
  31. package/es/auto-complete/index.d.ts +12 -15
  32. package/es/auto-complete/index.js +338 -400
  33. package/es/auto-complete/type.d.ts +25 -13
  34. package/es/avatar/css.js +2 -0
  35. package/es/avatar/draw.d.ts +2 -0
  36. package/es/avatar/draw.js +11 -0
  37. package/es/avatar/index.css +49 -0
  38. package/es/avatar/index.d.ts +15 -0
  39. package/es/avatar/index.js +110 -0
  40. package/es/avatar/type.d.ts +34 -0
  41. package/es/button/draw.d.ts +4 -4
  42. package/es/button/draw.js +213 -297
  43. package/es/button/index.css +40 -30
  44. package/es/button/index.d.ts +0 -4
  45. package/es/button/index.js +230 -256
  46. package/es/button/type.d.ts +3 -3
  47. package/es/button-group/index.css +0 -3
  48. package/es/button-group/index.d.ts +1 -2
  49. package/es/button-group/index.js +59 -31
  50. package/es/button-group/type.d.ts +21 -4
  51. package/es/checkbox/css.js +2 -0
  52. package/es/checkbox/draw.d.ts +4 -0
  53. package/es/checkbox/draw.js +46 -0
  54. package/es/checkbox/index.css +85 -0
  55. package/es/checkbox/index.d.ts +31 -0
  56. package/es/checkbox/index.js +206 -0
  57. package/es/checkbox/type.d.ts +88 -0
  58. package/es/checkbox-group/css.js +2 -0
  59. package/es/checkbox-group/index.css +20 -0
  60. package/es/checkbox-group/index.d.ts +23 -0
  61. package/es/checkbox-group/index.js +84 -0
  62. package/es/checkbox-group/type.d.ts +78 -0
  63. package/es/col/index.d.ts +2 -2
  64. package/es/col/index.js +43 -58
  65. package/es/container/index.js +18 -31
  66. package/es/divider/index.js +39 -53
  67. package/es/empty/index.css +4 -4
  68. package/es/empty/index.js +16 -71
  69. package/es/entry.js +102 -0
  70. package/es/footer/index.js +31 -40
  71. package/es/form/css.js +1 -0
  72. package/es/form/index.d.ts +27 -0
  73. package/es/form/index.js +125 -0
  74. package/es/form/type.d.ts +238 -0
  75. package/es/form/use-form.d.ts +4 -0
  76. package/es/form/use-form.js +48 -0
  77. package/es/form-item/css.js +2 -0
  78. package/es/form-item/index.css +77 -0
  79. package/es/form-item/index.d.ts +37 -0
  80. package/es/form-item/index.js +318 -0
  81. package/es/form-item/type.d.ts +96 -0
  82. package/es/grid/index.js +56 -75
  83. package/es/grid-item/css.js +0 -1
  84. package/es/grid-item/index.d.ts +1 -1
  85. package/es/grid-item/index.js +85 -121
  86. package/es/header/index.js +31 -40
  87. package/es/icon/index.js +44 -55
  88. package/es/icons/css-hn.js +0 -1
  89. package/es/icons/css-pa.js +0 -1
  90. package/es/icons/icon-hn.js +10337 -15986
  91. package/es/icons/icon-pa.js +12573 -17447
  92. package/es/image/css.js +2 -0
  93. package/es/image/index.css +69 -0
  94. package/es/image/index.d.ts +35 -0
  95. package/es/image/index.js +199 -0
  96. package/es/image/type.d.ts +126 -0
  97. package/es/index.css +1 -515
  98. package/es/index.d.ts +22 -2
  99. package/es/index.js +143 -123
  100. package/es/input/draw.d.ts +1 -1
  101. package/es/input/draw.js +26 -51
  102. package/es/input/index.css +85 -33
  103. package/es/input/index.d.ts +9 -16
  104. package/es/input/index.js +319 -423
  105. package/es/input/type.d.ts +3 -3
  106. package/es/input-group/index.css +0 -1
  107. package/es/input-group/index.d.ts +2 -2
  108. package/es/input-group/index.js +66 -37
  109. package/es/input-group/type.d.ts +16 -4
  110. package/es/input-group-label/draw.d.ts +1 -1
  111. package/es/input-group-label/draw.js +26 -51
  112. package/es/input-group-label/index.css +33 -22
  113. package/es/input-group-label/index.d.ts +1 -4
  114. package/es/input-group-label/index.js +104 -127
  115. package/es/input-group-label/type.d.ts +3 -3
  116. package/es/input-number/draw.d.ts +1 -1
  117. package/es/input-number/draw.js +26 -51
  118. package/es/input-number/index.css +90 -35
  119. package/es/input-number/index.d.ts +9 -16
  120. package/es/input-number/index.js +428 -536
  121. package/es/input-number/type.d.ts +3 -3
  122. package/es/input-tag/draw.d.ts +1 -1
  123. package/es/input-tag/draw.js +26 -48
  124. package/es/input-tag/index.css +100 -33
  125. package/es/input-tag/index.d.ts +7 -13
  126. package/es/input-tag/index.js +442 -467
  127. package/es/input-tag/type.d.ts +24 -13
  128. package/es/link/index.js +75 -106
  129. package/es/main/index.js +11 -15
  130. package/es/mask/index.js +94 -115
  131. package/es/message/index.css +1 -1
  132. package/es/message/index.js +168 -346
  133. package/es/message-box/css.js +1 -1
  134. package/es/message-box/index.js +98 -114
  135. package/es/message-box/message-box-wrapped.js +33 -46
  136. package/es/message-box/message-box.js +79 -111
  137. package/es/option-list/index.css +13 -13
  138. package/es/option-list/index.d.ts +4 -31
  139. package/es/option-list/index.js +99 -167
  140. package/es/option-list/type.d.ts +5 -1
  141. package/es/pixelate/pixel.d.ts +5 -0
  142. package/es/pixelate/pixel.js +70 -0
  143. package/es/pixelate/pixelate.worker.d.ts +1 -0
  144. package/es/popover/index.d.ts +13 -99
  145. package/es/popover/index.js +75 -238
  146. package/es/popover/type.d.ts +7 -2
  147. package/es/popup/css.js +1 -0
  148. package/es/popup/index.d.ts +210 -0
  149. package/es/popup/index.js +203 -0
  150. package/es/popup/type.d.ts +105 -0
  151. package/es/popup-content/draw.d.ts +2 -2
  152. package/es/popup-content/draw.js +98 -143
  153. package/es/popup-content/index.css +11 -11
  154. package/es/popup-content/index.d.ts +1 -0
  155. package/es/popup-content/index.js +253 -1576
  156. package/es/popup-content/type.d.ts +1 -0
  157. package/es/popup-trigger/index.d.ts +8 -2
  158. package/es/popup-trigger/index.js +122 -95
  159. package/es/popup-trigger/type.d.ts +4 -1
  160. package/es/popup-wrapper/css.js +2 -0
  161. package/es/popup-wrapper/index.css +14 -0
  162. package/es/popup-wrapper/index.d.ts +18 -0
  163. package/es/popup-wrapper/index.js +67 -0
  164. package/es/popup-wrapper/type.d.ts +9 -0
  165. package/es/radio/css.js +1 -0
  166. package/es/radio/draw.d.ts +4 -0
  167. package/es/radio/draw.js +47 -0
  168. package/es/radio/index.d.ts +30 -0
  169. package/es/radio/index.js +190 -0
  170. package/es/radio/style.css +73 -0
  171. package/es/radio/type.d.ts +76 -0
  172. package/es/radio-group/css.js +2 -0
  173. package/es/radio-group/index.css +20 -0
  174. package/es/radio-group/index.d.ts +23 -0
  175. package/es/radio-group/index.js +77 -0
  176. package/es/radio-group/type.d.ts +77 -0
  177. package/es/row/index.js +56 -70
  178. package/es/select/draw.d.ts +1 -1
  179. package/es/select/draw.js +26 -51
  180. package/es/select/index.css +118 -36
  181. package/es/select/index.d.ts +14 -16
  182. package/es/select/index.js +625 -672
  183. package/es/select/type.d.ts +60 -25
  184. package/es/share/const/event-bus-key.js +1 -6
  185. package/es/share/const/index.d.ts +4 -0
  186. package/es/share/const/index.js +22 -24
  187. package/es/share/const/provide-key.d.ts +5 -0
  188. package/es/share/const/provide-key.js +6 -5
  189. package/es/share/const/style.d.ts +6 -0
  190. package/es/share/const/style.js +7 -0
  191. package/es/share/hook/use-cancelable-delay.d.ts +1 -0
  192. package/es/share/hook/use-cancelable-delay.js +42 -0
  193. package/es/share/hook/use-click-outside-listener.d.ts +1 -1
  194. package/es/share/hook/use-click-outside-listener.js +28 -41
  195. package/es/share/hook/use-composition.js +17 -15
  196. package/es/share/hook/use-controlled-mode.d.ts +3 -3
  197. package/es/share/hook/use-controlled-mode.js +20 -23
  198. package/es/share/hook/use-dark-mode.js +51 -65
  199. package/es/share/hook/use-index-of-children.d.ts +2 -1
  200. package/es/share/hook/use-index-of-children.js +47 -45
  201. package/es/share/hook/use-lazy-load.d.ts +10 -0
  202. package/es/share/hook/use-lazy-load.js +133 -0
  203. package/es/share/hook/use-props-detect.d.ts +2 -0
  204. package/es/share/hook/use-resize-observer.d.ts +1 -2
  205. package/es/share/hook/use-resize-observer.js +28 -20
  206. package/es/share/hook/use-screen-width.js +27 -36
  207. package/es/share/hook/use-smooth-transition.d.ts +2 -0
  208. package/es/share/hook/use-smooth-transition.js +65 -0
  209. package/es/share/hook/use-textarea-height.js +86 -92
  210. package/es/share/hook/use-theme-mode.js +41 -42
  211. package/es/share/hook/use-transition-end.d.ts +2 -0
  212. package/es/share/hook/use-transition-end.js +12 -0
  213. package/es/share/hook/use-watch-global-css-var.js +12 -16
  214. package/es/share/hook/use-window-resize-listener.d.ts +1 -0
  215. package/es/share/hook/use-window-resize-listener.js +15 -0
  216. package/es/share/hook/use-z-index.js +30 -27
  217. package/es/share/type/index.d.ts +18 -3
  218. package/es/share/util/color.d.ts +5 -3
  219. package/es/share/util/color.js +156 -149
  220. package/es/share/util/common.d.ts +7 -2
  221. package/es/share/util/common.js +127 -65
  222. package/es/share/util/console.d.ts +3 -3
  223. package/es/share/util/console.js +10 -7
  224. package/es/share/util/dom.d.ts +19 -0
  225. package/es/share/util/dom.js +88 -0
  226. package/es/share/util/env.d.ts +1 -0
  227. package/es/share/util/env.js +5 -4
  228. package/es/share/util/event-bus.js +3 -20
  229. package/es/share/util/lru-cache.js +29 -33
  230. package/es/share/util/pixel.d.ts +4 -0
  231. package/es/share/util/plot.d.ts +8 -3
  232. package/es/share/util/plot.js +457 -229
  233. package/es/share/util/reactivity.d.ts +8 -0
  234. package/es/share/util/reactivity.js +23 -0
  235. package/es/share/util/render.js +31 -41
  236. package/es/share/util/theme.d.ts +3 -0
  237. package/es/share/util/theme.js +77 -57
  238. package/es/slider/css.js +2 -0
  239. package/es/slider/draw.d.ts +25 -0
  240. package/es/slider/draw.js +113 -0
  241. package/es/slider/index.css +119 -0
  242. package/es/slider/index.d.ts +66 -0
  243. package/es/slider/index.js +503 -0
  244. package/es/slider/type.d.ts +162 -0
  245. package/es/slider/util.d.ts +37 -0
  246. package/es/slider/util.js +130 -0
  247. package/es/space/index.css +24 -29
  248. package/es/space/index.js +73 -97
  249. package/es/spin/index.css +18 -17
  250. package/es/spin/index.js +72 -102
  251. package/es/spin/type.d.ts +11 -5
  252. package/es/switch/css.js +2 -0
  253. package/es/switch/draw.d.ts +2 -0
  254. package/es/switch/draw.js +18 -0
  255. package/es/switch/index.css +121 -0
  256. package/es/switch/index.d.ts +42 -0
  257. package/es/switch/index.js +259 -0
  258. package/es/switch/type.d.ts +133 -0
  259. package/es/tag/draw.d.ts +2 -2
  260. package/es/tag/draw.js +80 -127
  261. package/es/tag/index.css +38 -22
  262. package/es/tag/index.d.ts +2 -2
  263. package/es/tag/index.js +121 -190
  264. package/es/tag/type.d.ts +3 -3
  265. package/es/text-outline/css.js +2 -0
  266. package/es/text-outline/index.css +4 -0
  267. package/es/text-outline/index.d.ts +17 -0
  268. package/es/text-outline/index.js +33 -0
  269. package/es/text-outline/type.d.ts +23 -0
  270. package/es/textarea/draw.js +9 -11
  271. package/es/textarea/index.css +37 -23
  272. package/es/textarea/index.d.ts +8 -14
  273. package/es/textarea/index.js +274 -262
  274. package/es/tooltip/index.d.ts +100 -4
  275. package/es/tooltip/index.js +70 -226
  276. package/es/tooltip/type.d.ts +7 -2
  277. package/es/vendor.js +504 -0
  278. package/es/virtual-list/css.js +2 -0
  279. package/es/virtual-list/index.css +25 -0
  280. package/es/virtual-list/index.d.ts +11 -0
  281. package/es/virtual-list/index.js +313 -0
  282. package/es/virtual-list/type.d.ts +26 -0
  283. package/package.json +10 -16
  284. package/es/grid-item/index.css +0 -0
  285. /package/es/message-box/{message-box.css → index.css} +0 -0
@@ -0,0 +1,84 @@
1
+ import './css.js'
2
+ import { B as y } from "../vendor.js";
3
+ import { i as FORM_ITEM_PROVIDE, n as CHECKBOX_GROUP_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 checkbox_default } from "../checkbox/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-checkbox-group-inner" };
9
+ var checkbox_group_default = /* @__PURE__ */ defineComponent({
10
+ name: "CheckboxGroup",
11
+ __name: "index",
12
+ props: {
13
+ modelValue: null,
14
+ defaultValue: null,
15
+ disabled: {
16
+ type: Boolean,
17
+ default: false
18
+ },
19
+ readonly: {
20
+ type: Boolean,
21
+ default: false
22
+ },
23
+ variant: null,
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 [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
33
+ transform: (val) => {
34
+ return val || [];
35
+ },
36
+ defaultField: "defaultValue"
37
+ });
38
+ const formItemProvide = inject(FORM_ITEM_PROVIDE);
39
+ const disabledComputed = createProvideComputed("disabled", [formItemProvide, props], "or");
40
+ const readonlyComputed = createProvideComputed("readonly", [formItemProvide, props], "or");
41
+ const getKey = (option) => {
42
+ if (y(option)) return option;
43
+ else return option.key ?? option.value;
44
+ };
45
+ const sizeComputed = createProvideComputed("size", () => [
46
+ props.size && props,
47
+ formItemProvide,
48
+ props
49
+ ], "nullish", (val) => val || "medium");
50
+ provide(CHECKBOX_GROUP_PROVIDE, {
51
+ modelValue,
52
+ disabled: disabledComputed,
53
+ readonly: readonlyComputed,
54
+ variant: toRef(props, "variant"),
55
+ size: sizeComputed,
56
+ updateValue: (value, checked) => {
57
+ const newValue = (modelValue.value || []).slice();
58
+ if (checked) {
59
+ if (!newValue.includes(value)) newValue.push(value);
60
+ } else {
61
+ const idx = newValue.indexOf(value);
62
+ if (idx >= 0) newValue.splice(idx, 1);
63
+ }
64
+ modelValue.value = newValue;
65
+ updateModelValue(newValue);
66
+ emits("change", newValue);
67
+ formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
68
+ }
69
+ });
70
+ return (_ctx, _cache) => {
71
+ return openBlock(), createElementBlock("div", { class: normalizeClass(["pixelium px-checkbox-group", { [`px-checkbox-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) => {
72
+ return openBlock(), createBlock(checkbox_default, {
73
+ key: getKey(option),
74
+ value: unref(y)(option) ? option : option.value,
75
+ disabled: unref(y)(option) ? false : option.disabled
76
+ }, {
77
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(y)(option) ? option : option.label), 1)]),
78
+ _: 2
79
+ }, 1032, ["value", "disabled"]);
80
+ }), 128)) : createCommentVNode("v-if", true)])])], 2);
81
+ };
82
+ }
83
+ });
84
+ export { checkbox_group_default as t };
@@ -0,0 +1,78 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { Option } from '../share/type';
3
+ import type { Nullish } from 'parsnip-kit';
4
+ export interface CheckboxGroupOption<T = any> extends Option<T> {
5
+ disabled?: boolean;
6
+ key?: string | number | symbol;
7
+ }
8
+ export type CheckboxGroupProps = {
9
+ /**
10
+ * @property {any[] | null} [modelValue]
11
+ * @version 0.0.3
12
+ */
13
+ modelValue?: any[] | null;
14
+ /**
15
+ * @property {any[] | null} [defaultValue]
16
+ * @version 0.0.3
17
+ */
18
+ defaultValue?: any[] | null;
19
+ /**
20
+ * @property {boolean} [disabled=false]
21
+ * @version 0.0.3
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * @property {boolean} [readonly=false]
26
+ * @version 0.0.3
27
+ */
28
+ readonly?: boolean;
29
+ /**
30
+ * @property {'normal' | 'retro'} [variant]
31
+ * @version 0.0.3
32
+ */
33
+ variant?: 'normal' | 'retro';
34
+ /**
35
+ * @property {'horizontal' | 'vertical'} [direction='horizontal']
36
+ * @version 0.0.3
37
+ */
38
+ direction?: 'horizontal' | 'vertical';
39
+ /**
40
+ * @property {(CheckboxGroupOption | string)[]} [options]
41
+ * @version 0.0.3
42
+ */
43
+ options?: (CheckboxGroupOption | string)[];
44
+ /**
45
+ * @property {'medium' | 'large' | 'small'} [size='medium']
46
+ * @version 0.0.3
47
+ */
48
+ size?: 'medium' | 'large' | 'small';
49
+ };
50
+ export type CheckboxGroupEvents = {
51
+ /**
52
+ * @event update:modelValue
53
+ * @param {any[]} value
54
+ * @version 0.0.3
55
+ */
56
+ 'update:modelValue': [value: any[]];
57
+ /**
58
+ * @event change
59
+ * @param {any[]} value
60
+ * @version 0.0.3
61
+ */
62
+ change: [value: any[]];
63
+ };
64
+ export type CheckboxGroupSlots = {
65
+ /**
66
+ * @slot default
67
+ * @version 0.0.3
68
+ */
69
+ default: {};
70
+ };
71
+ export type CheckboxGroupProvide = {
72
+ size: ComputedRef<'medium' | 'large' | 'small' | undefined>;
73
+ variant: Ref<CheckboxGroupProps['variant']>;
74
+ disabled: ComputedRef<boolean | undefined>;
75
+ readonly: ComputedRef<boolean | undefined>;
76
+ modelValue: Ref<any[] | Nullish>;
77
+ updateValue: (value: any, checked: boolean) => void;
78
+ };
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("../index.ts").ValueWithDeviceWidth<number>;
8
- offset: number | import("../index.ts").ValueWithDeviceWidth<number>;
7
+ span: number | import("..").ValueWithDeviceWidth<number>;
8
+ offset: number | import("..").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/col/index.js CHANGED
@@ -1,60 +1,45 @@
1
1
  import './css.js'
2
- import { defineComponent, computed, getCurrentInstance, ref, inject, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, renderSlot } from "vue";
3
- import { k } from "../aside/index.js";
4
- import { u as useScreenWidth } from "../share/hook/use-screen-width.js";
5
- import { _ as _sfc_main$1 } from "../row/index.js";
6
- const _sfc_main = /* @__PURE__ */ defineComponent({
7
- ...{
8
- name: "Col"
9
- },
10
- __name: "index",
11
- props: {
12
- offset: { default: 0 },
13
- span: { default: 24 }
14
- },
15
- setup(__props) {
16
- var _a;
17
- const props = __props;
18
- const [widthType] = useScreenWidth();
19
- const offsetComputed = computed(() => {
20
- if (k(props.offset)) {
21
- return props.offset;
22
- }
23
- return props.offset[widthType.value] || 0;
24
- });
25
- const spanComputed = computed(() => {
26
- if (k(props.span)) {
27
- return props.span;
28
- }
29
- return props.span[widthType.value] || 24;
30
- });
31
- const instance = getCurrentInstance();
32
- const inner = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
33
- const gutter = inner.value && inject("px-row-provide") || ref({ x: 0, y: 0 });
34
- return (_ctx, _cache) => {
35
- return openBlock(), createElementBlock(
36
- "div",
37
- {
38
- class: normalizeClass(["pixelium px-col", {
39
- [`px-col__span-${spanComputed.value}`]: true,
40
- [`px-col__offset-${offsetComputed.value}`]: true
41
- }]),
42
- style: normalizeStyle({
43
- paddingLeft: unref(gutter) ? unref(gutter).x / 2 + "px" : void 0,
44
- paddingRight: unref(gutter) ? unref(gutter).x / 2 + "px" : void 0,
45
- paddingTop: unref(gutter) ? unref(gutter).y / 2 + "px" : void 0,
46
- paddingBottom: unref(gutter) ? unref(gutter).y / 2 + "px" : void 0
47
- })
48
- },
49
- [
50
- renderSlot(_ctx.$slots, "default")
51
- ],
52
- 6
53
- /* CLASS, STYLE */
54
- );
55
- };
56
- }
2
+ import { g as A } from "../vendor.js";
3
+ import { t as useScreenWidth } from "../share/hook/use-screen-width.js";
4
+ import { computed, createElementBlock, defineComponent, getCurrentInstance, inject, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, unref } from "vue";
5
+ var col_default = /* @__PURE__ */ defineComponent({
6
+ name: "Col",
7
+ __name: "index",
8
+ props: {
9
+ offset: { default: 0 },
10
+ span: { default: 24 }
11
+ },
12
+ setup(__props) {
13
+ var _instance$parent;
14
+ const props = __props;
15
+ const [widthType] = useScreenWidth();
16
+ const offsetComputed = computed(() => {
17
+ if (A(props.offset)) return props.offset;
18
+ return props.offset[widthType.value] || 0;
19
+ });
20
+ const spanComputed = computed(() => {
21
+ if (A(props.span)) return props.span;
22
+ return props.span[widthType.value] || 24;
23
+ });
24
+ const instance = getCurrentInstance();
25
+ const gutter = ref((instance === null || instance === void 0 || (_instance$parent = instance.parent) === null || _instance$parent === void 0 ? void 0 : _instance$parent.type.name) === "Row").value && inject("px-row-provide") || ref({
26
+ x: 0,
27
+ y: 0
28
+ });
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("div", {
31
+ class: normalizeClass(["pixelium px-col", {
32
+ [`px-col__span-${spanComputed.value}`]: true,
33
+ [`px-col__offset-${offsetComputed.value}`]: true
34
+ }]),
35
+ style: normalizeStyle({
36
+ paddingLeft: unref(gutter) ? unref(gutter).x / 2 + "px" : void 0,
37
+ paddingRight: unref(gutter) ? unref(gutter).x / 2 + "px" : void 0,
38
+ paddingTop: unref(gutter) ? unref(gutter).y / 2 + "px" : void 0,
39
+ paddingBottom: unref(gutter) ? unref(gutter).y / 2 + "px" : void 0
40
+ })
41
+ }, [renderSlot(_ctx.$slots, "default")], 6);
42
+ };
43
+ }
57
44
  });
58
- export {
59
- _sfc_main as _
60
- };
45
+ export { col_default as t };
@@ -1,33 +1,20 @@
1
1
  import './css.js'
2
- import { defineComponent, ref, provide, createElementBlock, openBlock, normalizeClass, renderSlot } from "vue";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- ...{ name: "Container" },
5
- __name: "index",
6
- props: {
7
- direction: null
8
- },
9
- setup(__props) {
10
- const aside = ref(0);
11
- provide("px-container-provide", aside);
12
- const props = __props;
13
- return (_ctx, _cache) => {
14
- return openBlock(), createElementBlock(
15
- "section",
16
- {
17
- class: normalizeClass(["pixelium px-container", {
18
- "px-container__has-aside": !!aside.value,
19
- [`px-container__${props.direction}`]: !!props.direction
20
- }])
21
- },
22
- [
23
- renderSlot(_ctx.$slots, "default")
24
- ],
25
- 2
26
- /* CLASS */
27
- );
28
- };
29
- }
2
+ import { r as CONTAINER_PROVIDE } from "../share/const/provide-key.js";
3
+ import { createElementBlock, defineComponent, normalizeClass, openBlock, provide, ref, renderSlot } from "vue";
4
+ var container_default = /* @__PURE__ */ defineComponent({
5
+ name: "Container",
6
+ __name: "index",
7
+ props: { direction: null },
8
+ setup(__props) {
9
+ const aside = ref(0);
10
+ provide(CONTAINER_PROVIDE, aside);
11
+ const props = __props;
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createElementBlock("section", { class: normalizeClass(["pixelium px-container", {
14
+ "px-container__has-aside": !!aside.value,
15
+ [`px-container__${props.direction}`]: !!props.direction
16
+ }]) }, [renderSlot(_ctx.$slots, "default")], 2);
17
+ };
18
+ }
30
19
  });
31
- export {
32
- _sfc_main as _
33
- };
20
+ export { container_default as t };
@@ -1,55 +1,41 @@
1
1
  import './css.js'
2
- import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass } from "vue";
3
- import { N, k } from "../aside/index.js";
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- ...{
6
- name: "Divider"
7
- },
8
- __name: "index",
9
- props: {
10
- direction: { default: "horizontal" },
11
- variant: { default: "solid" },
12
- margin: null,
13
- size: null
14
- },
15
- setup(__props) {
16
- const props = __props;
17
- const marginComputed = computed(() => {
18
- if (N(props.margin)) {
19
- return;
20
- }
21
- return k(props.margin) ? `${props.margin}px` : props.margin;
22
- });
23
- const sizeComputed = computed(() => {
24
- if (N(props.size)) {
25
- return;
26
- }
27
- return k(props.size) ? `${props.size}px` : props.size;
28
- });
29
- return (_ctx, _cache) => {
30
- return openBlock(), createElementBlock(
31
- "div",
32
- {
33
- class: normalizeClass(["pixelium px-divider", {
34
- [`px-divider__${props.direction}`]: true,
35
- [`px-divider__${props.variant}`]: true
36
- }]),
37
- style: normalizeStyle({
38
- marginLeft: props.direction === "vertical" ? marginComputed.value : void 0,
39
- marginRight: props.direction === "vertical" ? marginComputed.value : void 0,
40
- marginTop: props.direction === "horizontal" ? marginComputed.value : void 0,
41
- marginBottom: props.direction === "horizontal" ? marginComputed.value : void 0,
42
- borderBottomWidth: props.direction === "horizontal" ? sizeComputed.value : void 0,
43
- borderRightWidth: props.direction === "vertical" ? sizeComputed.value : void 0
44
- })
45
- },
46
- null,
47
- 6
48
- /* CLASS, STYLE */
49
- );
50
- };
51
- }
2
+ import { _ as E, g as A } from "../vendor.js";
3
+ import { computed, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock } from "vue";
4
+ var divider_default = /* @__PURE__ */ defineComponent({
5
+ name: "Divider",
6
+ __name: "index",
7
+ props: {
8
+ direction: { default: "horizontal" },
9
+ variant: { default: "solid" },
10
+ margin: null,
11
+ size: null
12
+ },
13
+ setup(__props) {
14
+ const props = __props;
15
+ const marginComputed = computed(() => {
16
+ if (E(props.margin)) return;
17
+ return A(props.margin) ? `${props.margin}px` : props.margin;
18
+ });
19
+ const sizeComputed = computed(() => {
20
+ if (E(props.size)) return;
21
+ return A(props.size) ? `${props.size}px` : props.size;
22
+ });
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("div", {
25
+ class: normalizeClass(["pixelium px-divider", {
26
+ [`px-divider__${props.direction}`]: true,
27
+ [`px-divider__${props.variant}`]: true
28
+ }]),
29
+ style: normalizeStyle({
30
+ marginLeft: props.direction === "vertical" ? marginComputed.value : void 0,
31
+ marginRight: props.direction === "vertical" ? marginComputed.value : void 0,
32
+ marginTop: props.direction === "horizontal" ? marginComputed.value : void 0,
33
+ marginBottom: props.direction === "horizontal" ? marginComputed.value : void 0,
34
+ borderBottomWidth: props.direction === "horizontal" ? sizeComputed.value : void 0,
35
+ borderRightWidth: props.direction === "vertical" ? sizeComputed.value : void 0
36
+ })
37
+ }, null, 6);
38
+ };
39
+ }
52
40
  });
53
- export {
54
- _sfc_main as _
55
- };
41
+ export { divider_default as t };
@@ -5,15 +5,15 @@
5
5
  align-items: center;
6
6
  }
7
7
  .px-empty .px-empty-icon {
8
- width: var(--px-large-base-size);
9
- height: var(--px-large-base-size);
8
+ width: 36px;
9
+ height: 36px;
10
10
  }
11
11
  .px-empty-icon-wrapper {
12
12
  display: flex;
13
13
  align-items: center;
14
14
  justify-content: center;
15
- font-size: var(--px-large-base-size);
15
+ font-size: 36px;
16
16
  }
17
17
  .px-empty-description {
18
- margin-top: var(--px-interval-1);
18
+ margin-top: 4px;
19
19
  }
package/es/empty/index.js CHANGED
@@ -1,73 +1,18 @@
1
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
- }
2
+ import { n as file_delete_default } from "../vendor.js";
3
+ import { createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref } from "vue";
4
+ var _hoisted_1 = { class: "pixelium px-empty" };
5
+ var _hoisted_2 = { class: "px-empty-icon-wrapper" };
6
+ var _hoisted_3 = { class: "px-empty-description" };
7
+ var empty_default = /* @__PURE__ */ defineComponent({
8
+ name: "Empty",
9
+ __name: "index",
10
+ props: { description: { default: "No Data" } },
11
+ setup(__props) {
12
+ const props = __props;
13
+ return (_ctx, _cache) => {
14
+ return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "image", {}, () => [createVNode(unref(file_delete_default), { class: "px-empty-icon" })])]), createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(props.description), 1)])])]);
15
+ };
16
+ }
37
17
  });
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
- };
18
+ export { empty_default as t };
package/es/entry.js ADDED
@@ -0,0 +1,102 @@
1
+ import { t as inBrowser } from "./share/util/env.js";
2
+ import { t as button_default } from "./button/index.js";
3
+ import { t as button_group_default } from "./button-group/index.js";
4
+ import { t as link_default } from "./link/index.js";
5
+ import { t as message_box_default } from "./message-box/index.js";
6
+ import { t as message_box_wrapped_default } from "./message-box/message-box-wrapped.js";
7
+ import { t as row_default } from "./row/index.js";
8
+ import { t as col_default } from "./col/index.js";
9
+ import { t as divider_default } from "./divider/index.js";
10
+ import { t as space_default } from "./space/index.js";
11
+ import { t as grid_default } from "./grid/index.js";
12
+ import { t as grid_item_default } from "./grid-item/index.js";
13
+ import { t as container_default } from "./container/index.js";
14
+ import { t as main_default } from "./main/index.js";
15
+ import { t as aside_default } from "./aside/index.js";
16
+ import { t as header_default } from "./header/index.js";
17
+ import { t as footer_default } from "./footer/index.js";
18
+ import { t as useThemeMode } from "./share/hook/use-theme-mode.js";
19
+ import { t as icon_default } from "./icon/index.js";
20
+ import { t as input_default } from "./input/index.js";
21
+ import { t as input_number_default } from "./input-number/index.js";
22
+ import { t as textarea_default } from "./textarea/index.js";
23
+ import { t as tag_default } from "./tag/index.js";
24
+ import { t as input_group_default } from "./input-group/index.js";
25
+ import { t as input_group_label_default } from "./input-group-label/index.js";
26
+ import { t as popover_default } from "./popover/index.js";
27
+ import { t as input_tag_default } from "./input-tag/index.js";
28
+ import { t as tooltip_default } from "./tooltip/index.js";
29
+ import { t as empty_default } from "./empty/index.js";
30
+ import { t as virtual_list_default } from "./virtual-list/index.js";
31
+ import { t as auto_complete_default } from "./auto-complete/index.js";
32
+ import { t as mask_default } from "./mask/index.js";
33
+ import { t as spin_default } from "./spin/index.js";
34
+ import { t as select_default } from "./select/index.js";
35
+ import { t as image_default } from "./image/index.js";
36
+ import { t as avatar_default } from "./avatar/index.js";
37
+ import { t as form_default } from "./form/index.js";
38
+ import { t as form_item_default } from "./form-item/index.js";
39
+ import { t as switch_default } from "./switch/index.js";
40
+ import { t as slider_default } from "./slider/index.js";
41
+ import { t as radio_default } from "./radio/index.js";
42
+ import { t as radio_group_default } from "./radio-group/index.js";
43
+ import { t as checkbox_default } from "./checkbox/index.js";
44
+ import { t as checkbox_group_default } from "./checkbox-group/index.js";
45
+ import { t as text_outline_default } from "./text-outline/index.js";
46
+ var components = [
47
+ button_default,
48
+ button_group_default,
49
+ link_default,
50
+ message_box_wrapped_default,
51
+ row_default,
52
+ col_default,
53
+ divider_default,
54
+ space_default,
55
+ grid_default,
56
+ grid_item_default,
57
+ container_default,
58
+ main_default,
59
+ aside_default,
60
+ header_default,
61
+ footer_default,
62
+ icon_default,
63
+ input_default,
64
+ input_number_default,
65
+ textarea_default,
66
+ input_group_default,
67
+ input_group_label_default,
68
+ tag_default,
69
+ input_tag_default,
70
+ tooltip_default,
71
+ popover_default,
72
+ empty_default,
73
+ auto_complete_default,
74
+ mask_default,
75
+ spin_default,
76
+ select_default,
77
+ virtual_list_default,
78
+ image_default,
79
+ avatar_default,
80
+ form_default,
81
+ form_item_default,
82
+ switch_default,
83
+ slider_default,
84
+ radio_default,
85
+ radio_group_default,
86
+ checkbox_default,
87
+ checkbox_group_default,
88
+ text_outline_default
89
+ ];
90
+ var defaultPrefix = "Px";
91
+ var install = (app, options = { prefix: defaultPrefix }) => {
92
+ components.forEach((component) => {
93
+ if (component.name) app.component(options.prefix + component.name, component);
94
+ });
95
+ if (options.attachToApp !== false) app.config.globalProperties.PixeliumVue = {
96
+ message: message_box_default,
97
+ useThemeMode
98
+ };
99
+ if (options.attachToWindow !== false && inBrowser()) window.$message = message_box_default;
100
+ };
101
+ var lib_default = { install };
102
+ export { lib_default as n, install as t };