@pixelium/web-vue 0.0.2-fix → 0.0.3-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/README.md +42 -0
  2. package/README.zh.md +6 -3
  3. package/dist/font.css +1 -1
  4. package/dist/index.d.ts +1602 -248
  5. package/dist/normalize.css +2 -0
  6. package/dist/pixelium-vue-icon-hn.cjs +1 -1
  7. package/dist/pixelium-vue-icon-hn.css +2 -1
  8. package/dist/pixelium-vue-icon-hn.js +8533 -8154
  9. package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
  10. package/dist/pixelium-vue-icon-pa.cjs +1 -1
  11. package/dist/pixelium-vue-icon-pa.css +2 -1
  12. package/dist/pixelium-vue-icon-pa.js +10625 -10143
  13. package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
  14. package/dist/pixelium-vue.cjs +2 -2
  15. package/dist/pixelium-vue.css +2 -1
  16. package/dist/pixelium-vue.js +7407 -5854
  17. package/dist/pixelium-vue.umd.cjs +2 -2
  18. package/es/aside/index.css +1 -0
  19. package/es/aside/index.js +46 -151
  20. package/es/auto-complete/draw.d.ts +1 -1
  21. package/es/auto-complete/draw.js +26 -51
  22. package/es/auto-complete/index.css +92 -32
  23. package/es/auto-complete/index.d.ts +12 -15
  24. package/es/auto-complete/index.js +338 -400
  25. package/es/auto-complete/type.d.ts +25 -13
  26. package/es/avatar/css.js +2 -0
  27. package/es/avatar/draw.d.ts +2 -0
  28. package/es/avatar/draw.js +11 -0
  29. package/es/avatar/index.css +49 -0
  30. package/es/avatar/index.d.ts +15 -0
  31. package/es/avatar/index.js +110 -0
  32. package/es/avatar/type.d.ts +34 -0
  33. package/es/button/draw.d.ts +4 -4
  34. package/es/button/draw.js +213 -297
  35. package/es/button/index.css +40 -30
  36. package/es/button/index.d.ts +0 -4
  37. package/es/button/index.js +230 -256
  38. package/es/button/type.d.ts +3 -3
  39. package/es/button-group/index.css +0 -3
  40. package/es/button-group/index.d.ts +1 -2
  41. package/es/button-group/index.js +59 -31
  42. package/es/button-group/type.d.ts +21 -4
  43. package/es/checkbox/css.js +2 -0
  44. package/es/checkbox/draw.d.ts +4 -0
  45. package/es/checkbox/draw.js +46 -0
  46. package/es/checkbox/index.css +85 -0
  47. package/es/checkbox/index.d.ts +31 -0
  48. package/es/checkbox/index.js +206 -0
  49. package/es/checkbox/type.d.ts +88 -0
  50. package/es/checkbox-group/css.js +2 -0
  51. package/es/checkbox-group/index.css +20 -0
  52. package/es/checkbox-group/index.d.ts +23 -0
  53. package/es/checkbox-group/index.js +84 -0
  54. package/es/checkbox-group/type.d.ts +78 -0
  55. package/es/col/index.d.ts +2 -2
  56. package/es/col/index.js +43 -58
  57. package/es/container/index.css +1 -0
  58. package/es/container/index.js +18 -31
  59. package/es/divider/index.js +39 -53
  60. package/es/empty/index.css +4 -4
  61. package/es/empty/index.js +16 -71
  62. package/es/entry.js +102 -0
  63. package/es/footer/index.css +1 -0
  64. package/es/footer/index.js +31 -40
  65. package/es/form/css.js +1 -0
  66. package/es/form/index.d.ts +27 -0
  67. package/es/form/index.js +125 -0
  68. package/es/form/type.d.ts +238 -0
  69. package/es/form/use-form.d.ts +4 -0
  70. package/es/form/use-form.js +48 -0
  71. package/es/form-item/css.js +2 -0
  72. package/es/form-item/index.css +77 -0
  73. package/es/form-item/index.d.ts +37 -0
  74. package/es/form-item/index.js +318 -0
  75. package/es/form-item/type.d.ts +96 -0
  76. package/es/grid/index.js +56 -75
  77. package/es/grid-item/css.js +0 -1
  78. package/es/grid-item/index.d.ts +1 -1
  79. package/es/grid-item/index.js +85 -121
  80. package/es/header/index.css +1 -0
  81. package/es/header/index.js +31 -40
  82. package/es/icon/index.js +44 -55
  83. package/es/icons/css-hn.js +0 -1
  84. package/es/icons/css-pa.js +0 -1
  85. package/es/icons/icon-hn.js +10337 -15986
  86. package/es/icons/icon-pa.js +12573 -17447
  87. package/es/image/css.js +2 -0
  88. package/es/image/index.css +69 -0
  89. package/es/image/index.d.ts +35 -0
  90. package/es/image/index.js +199 -0
  91. package/es/image/type.d.ts +126 -0
  92. package/es/index.css +1 -515
  93. package/es/index.d.ts +22 -2
  94. package/es/index.js +144 -123
  95. package/es/input/draw.d.ts +1 -1
  96. package/es/input/draw.js +26 -51
  97. package/es/input/index.css +85 -33
  98. package/es/input/index.d.ts +9 -16
  99. package/es/input/index.js +319 -423
  100. package/es/input/type.d.ts +3 -3
  101. package/es/input-group/index.css +0 -1
  102. package/es/input-group/index.d.ts +2 -2
  103. package/es/input-group/index.js +66 -37
  104. package/es/input-group/type.d.ts +16 -4
  105. package/es/input-group-label/draw.d.ts +1 -1
  106. package/es/input-group-label/draw.js +26 -51
  107. package/es/input-group-label/index.css +33 -22
  108. package/es/input-group-label/index.d.ts +1 -4
  109. package/es/input-group-label/index.js +104 -127
  110. package/es/input-group-label/type.d.ts +3 -3
  111. package/es/input-number/draw.d.ts +1 -1
  112. package/es/input-number/draw.js +26 -51
  113. package/es/input-number/index.css +90 -35
  114. package/es/input-number/index.d.ts +9 -16
  115. package/es/input-number/index.js +428 -536
  116. package/es/input-number/type.d.ts +3 -3
  117. package/es/input-tag/draw.d.ts +1 -1
  118. package/es/input-tag/draw.js +26 -48
  119. package/es/input-tag/index.css +100 -33
  120. package/es/input-tag/index.d.ts +7 -13
  121. package/es/input-tag/index.js +442 -467
  122. package/es/input-tag/type.d.ts +24 -13
  123. package/es/link/index.js +75 -106
  124. package/es/main/index.css +4 -0
  125. package/es/main/index.d.ts +4 -1
  126. package/es/main/index.js +15 -15
  127. package/es/main/type.d.ts +7 -0
  128. package/es/mask/index.js +94 -115
  129. package/es/message/index.css +1 -1
  130. package/es/message/index.js +168 -346
  131. package/es/message-box/css.js +1 -1
  132. package/es/message-box/index.js +98 -114
  133. package/es/message-box/message-box-wrapped.js +33 -46
  134. package/es/message-box/message-box.js +79 -111
  135. package/es/option-list/index.css +13 -13
  136. package/es/option-list/index.d.ts +4 -31
  137. package/es/option-list/index.js +99 -167
  138. package/es/option-list/type.d.ts +5 -1
  139. package/es/pixelate/pixel.d.ts +5 -0
  140. package/es/pixelate/pixel.js +70 -0
  141. package/es/pixelate/pixelate.worker.d.ts +1 -0
  142. package/es/popover/index.d.ts +13 -99
  143. package/es/popover/index.js +75 -238
  144. package/es/popover/type.d.ts +7 -2
  145. package/es/popup/css.js +1 -0
  146. package/es/popup/index.d.ts +210 -0
  147. package/es/popup/index.js +203 -0
  148. package/es/popup/type.d.ts +105 -0
  149. package/es/popup-content/draw.d.ts +2 -2
  150. package/es/popup-content/draw.js +98 -143
  151. package/es/popup-content/index.css +11 -11
  152. package/es/popup-content/index.d.ts +1 -0
  153. package/es/popup-content/index.js +253 -1576
  154. package/es/popup-content/type.d.ts +1 -0
  155. package/es/popup-trigger/index.d.ts +8 -2
  156. package/es/popup-trigger/index.js +122 -95
  157. package/es/popup-trigger/type.d.ts +4 -1
  158. package/es/popup-wrapper/css.js +2 -0
  159. package/es/popup-wrapper/index.css +14 -0
  160. package/es/popup-wrapper/index.d.ts +18 -0
  161. package/es/popup-wrapper/index.js +67 -0
  162. package/es/popup-wrapper/type.d.ts +9 -0
  163. package/es/radio/css.js +1 -0
  164. package/es/radio/draw.d.ts +4 -0
  165. package/es/radio/draw.js +47 -0
  166. package/es/radio/index.d.ts +30 -0
  167. package/es/radio/index.js +190 -0
  168. package/es/radio/style.css +73 -0
  169. package/es/radio/type.d.ts +76 -0
  170. package/es/radio-group/css.js +2 -0
  171. package/es/radio-group/index.css +20 -0
  172. package/es/radio-group/index.d.ts +23 -0
  173. package/es/radio-group/index.js +77 -0
  174. package/es/radio-group/type.d.ts +77 -0
  175. package/es/row/index.js +56 -70
  176. package/es/select/draw.d.ts +1 -1
  177. package/es/select/draw.js +26 -51
  178. package/es/select/index.css +118 -36
  179. package/es/select/index.d.ts +14 -16
  180. package/es/select/index.js +625 -675
  181. package/es/select/type.d.ts +60 -25
  182. package/es/share/const/event-bus-key.js +1 -6
  183. package/es/share/const/index.d.ts +4 -0
  184. package/es/share/const/index.js +22 -24
  185. package/es/share/const/provide-key.d.ts +5 -0
  186. package/es/share/const/provide-key.js +6 -5
  187. package/es/share/const/style.d.ts +6 -0
  188. package/es/share/const/style.js +7 -0
  189. package/es/share/hook/use-cancelable-delay.d.ts +1 -0
  190. package/es/share/hook/use-cancelable-delay.js +42 -0
  191. package/es/share/hook/use-click-outside-listener.d.ts +1 -1
  192. package/es/share/hook/use-click-outside-listener.js +28 -41
  193. package/es/share/hook/use-composition.js +17 -15
  194. package/es/share/hook/use-controlled-mode.d.ts +3 -3
  195. package/es/share/hook/use-controlled-mode.js +20 -23
  196. package/es/share/hook/use-dark-mode.js +51 -65
  197. package/es/share/hook/use-index-of-children.d.ts +2 -1
  198. package/es/share/hook/use-index-of-children.js +47 -45
  199. package/es/share/hook/use-lazy-load.d.ts +10 -0
  200. package/es/share/hook/use-lazy-load.js +133 -0
  201. package/es/share/hook/use-props-detect.d.ts +2 -0
  202. package/es/share/hook/use-resize-observer.d.ts +1 -2
  203. package/es/share/hook/use-resize-observer.js +28 -20
  204. package/es/share/hook/use-screen-width.js +27 -36
  205. package/es/share/hook/use-smooth-transition.d.ts +2 -0
  206. package/es/share/hook/use-smooth-transition.js +65 -0
  207. package/es/share/hook/use-textarea-height.js +86 -92
  208. package/es/share/hook/use-theme-mode.js +41 -42
  209. package/es/share/hook/use-transition-end.d.ts +2 -0
  210. package/es/share/hook/use-transition-end.js +12 -0
  211. package/es/share/hook/use-watch-global-css-var.js +12 -16
  212. package/es/share/hook/use-window-resize-listener.d.ts +1 -0
  213. package/es/share/hook/use-window-resize-listener.js +15 -0
  214. package/es/share/hook/use-z-index.js +30 -27
  215. package/es/share/style/index.css +5 -0
  216. package/es/share/type/index.d.ts +18 -3
  217. package/es/share/util/color.d.ts +5 -3
  218. package/es/share/util/color.js +156 -149
  219. package/es/share/util/common.d.ts +7 -2
  220. package/es/share/util/common.js +127 -65
  221. package/es/share/util/console.d.ts +3 -3
  222. package/es/share/util/console.js +10 -7
  223. package/es/share/util/dom.d.ts +19 -0
  224. package/es/share/util/dom.js +88 -0
  225. package/es/share/util/env.d.ts +1 -0
  226. package/es/share/util/env.js +5 -4
  227. package/es/share/util/event-bus.js +3 -20
  228. package/es/share/util/lru-cache.js +29 -33
  229. package/es/share/util/pixel.d.ts +4 -0
  230. package/es/share/util/plot.d.ts +8 -3
  231. package/es/share/util/plot.js +457 -229
  232. package/es/share/util/reactivity.d.ts +8 -0
  233. package/es/share/util/reactivity.js +23 -0
  234. package/es/share/util/render.js +31 -41
  235. package/es/share/util/theme.d.ts +3 -0
  236. package/es/share/util/theme.js +77 -57
  237. package/es/slider/css.js +2 -0
  238. package/es/slider/draw.d.ts +25 -0
  239. package/es/slider/draw.js +113 -0
  240. package/es/slider/index.css +119 -0
  241. package/es/slider/index.d.ts +66 -0
  242. package/es/slider/index.js +503 -0
  243. package/es/slider/type.d.ts +162 -0
  244. package/es/slider/util.d.ts +37 -0
  245. package/es/slider/util.js +130 -0
  246. package/es/space/index.css +24 -29
  247. package/es/space/index.js +73 -97
  248. package/es/spin/index.css +18 -17
  249. package/es/spin/index.js +72 -102
  250. package/es/spin/type.d.ts +11 -5
  251. package/es/switch/css.js +2 -0
  252. package/es/switch/draw.d.ts +2 -0
  253. package/es/switch/draw.js +18 -0
  254. package/es/switch/index.css +121 -0
  255. package/es/switch/index.d.ts +42 -0
  256. package/es/switch/index.js +259 -0
  257. package/es/switch/type.d.ts +133 -0
  258. package/es/tag/draw.d.ts +2 -2
  259. package/es/tag/draw.js +80 -127
  260. package/es/tag/index.css +38 -22
  261. package/es/tag/index.d.ts +2 -2
  262. package/es/tag/index.js +121 -190
  263. package/es/tag/type.d.ts +3 -3
  264. package/es/text-outline/css.js +2 -0
  265. package/es/text-outline/index.css +4 -0
  266. package/es/text-outline/index.d.ts +17 -0
  267. package/es/text-outline/index.js +33 -0
  268. package/es/text-outline/type.d.ts +23 -0
  269. package/es/textarea/draw.js +9 -11
  270. package/es/textarea/index.css +37 -23
  271. package/es/textarea/index.d.ts +8 -14
  272. package/es/textarea/index.js +274 -262
  273. package/es/tooltip/index.d.ts +100 -4
  274. package/es/tooltip/index.js +70 -226
  275. package/es/tooltip/type.d.ts +7 -2
  276. package/es/vendor.js +504 -0
  277. package/es/virtual-list/css.js +2 -0
  278. package/es/virtual-list/index.css +25 -0
  279. package/es/virtual-list/index.d.ts +11 -0
  280. package/es/virtual-list/index.js +313 -0
  281. package/es/virtual-list/type.d.ts +26 -0
  282. package/package.json +10 -16
  283. package/es/grid-item/index.css +0 -0
  284. /package/es/message-box/{message-box.css → index.css} +0 -0
@@ -1,5 +1,6 @@
1
- import type { NumberOrPercentage } from '../share/type';
2
- import type { TagProps } from '../tag/type';
1
+ import type { PopoverProps, PopoverEvents } from '../popover/type';
2
+ import type { EmitEvent, NumberOrPercentage } from '../share/type';
3
+ import type { TagEvents, TagProps } from '../tag/type';
3
4
  export type InputTagProps = {
4
5
  /**
5
6
  * @property {string[] | null} [modelValue]
@@ -52,10 +53,10 @@ export type InputTagProps = {
52
53
  */
53
54
  size?: 'medium' | 'large' | 'small';
54
55
  /**
55
- * @property {'default' | 'round'} [shape='default']
56
- * @version 0.0.2
56
+ * @property {'rect' | 'round'} [shape='rect']
57
+ * @version 0.0.3
57
58
  */
58
- shape?: 'default' | 'round';
59
+ shape?: 'rect' | 'round' | 'default';
59
60
  /**
60
61
  * @property {NumberOrPercentage | NumberOrPercentage[]} [borderRadius]
61
62
  * @version 0.0.2
@@ -81,6 +82,21 @@ export type InputTagProps = {
81
82
  * @version 0.0.2
82
83
  */
83
84
  collapseTagsPopover?: boolean;
85
+ /**
86
+ * @property {Omit<TagProps, 'size' | 'disabled' | 'closable'> & EmitEvent<TagEvents>} [tagProps]
87
+ * @version 0.0.3
88
+ */
89
+ tagProps?: Omit<TagProps, 'size' | 'disabled' | 'closable'> & EmitEvent<TagEvents>;
90
+ /**
91
+ * @property {'success' | 'warning' | 'error' | 'normal'} [status='normal']
92
+ * @version 0.0.2
93
+ */
94
+ status?: 'success' | 'warning' | 'error' | 'normal';
95
+ /**
96
+ * @property {boolean} [autofocus=false]
97
+ * @version 0.0.2
98
+ */
99
+ autofocus?: boolean;
84
100
  /**
85
101
  * @property {'primary' | 'sakura' | 'success' | 'warning' | 'danger' | 'info'} [tagTheme='info']
86
102
  * @version 0.0.2
@@ -97,15 +113,10 @@ export type InputTagProps = {
97
113
  */
98
114
  tagColor?: TagProps['color'];
99
115
  /**
100
- * @property {'success' | 'warning' | 'error' | 'normal'} [status='normal']
101
- * @version 0.0.2
102
- */
103
- status?: 'success' | 'warning' | 'error' | 'normal';
104
- /**
105
- * @property {boolean} [autofocus=false]
106
- * @version 0.0.2
116
+ * @property {Omit<PopoverProps, 'visible' | 'content'> & EmitEvent<PopoverEvents>} [popoverProps]
117
+ * @version 0.0.3
107
118
  */
108
- autofocus?: boolean;
119
+ popoverProps?: Omit<PopoverProps, 'visible' | 'content'> & EmitEvent<PopoverEvents>;
109
120
  };
110
121
  export type InputTagEvents = {
111
122
  /**
package/es/link/index.js CHANGED
@@ -1,108 +1,77 @@
1
1
  import './css.js'
2
- import { defineComponent, useSlots, computed, ref, createElementBlock, openBlock, normalizeStyle, normalizeClass, createCommentVNode, renderSlot, unref, createBlock } from "vue";
3
- import { p as parseColor, a as generatePalette, r as rgbaColor2string } from "../share/util/color.js";
4
- import { S as SpinnerThirdSolid } from "../auto-complete/index.js";
5
- import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
6
- const _hoisted_1 = ["href", "target"];
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- ...{
9
- name: "Link"
10
- },
11
- __name: "index",
12
- props: {
13
- disabled: { type: Boolean },
14
- loading: { type: Boolean },
15
- theme: null,
16
- color: null,
17
- href: null,
18
- target: null
19
- },
20
- setup(__props) {
21
- const props = __props;
22
- const slots = useSlots();
23
- const darkMode = useDarkMode();
24
- const palette = computed(() => {
25
- if (!props.color) return null;
26
- const color = parseColor(props.color);
27
- const palette2 = generatePalette(color.r, color.g, color.b, color.a, darkMode.value);
28
- return palette2;
29
- });
30
- const hoverFlag = ref(false);
31
- const activeFlag = ref(false);
32
- const toggleHover = (value) => {
33
- hoverFlag.value = value;
34
- };
35
- const toggleActive = (value) => {
36
- activeFlag.value = value;
37
- };
38
- const getTextColorWithPalette = (palette2, disabled, loading, hoverFlag2, activeFlag2) => {
39
- if (!palette2) return void 0;
40
- if (disabled) {
41
- return rgbaColor2string(palette2[1]);
42
- }
43
- if (loading) return rgbaColor2string(palette2[5]);
44
- if (activeFlag2) return rgbaColor2string(palette2[6]);
45
- if (hoverFlag2) return rgbaColor2string(palette2[4]);
46
- return rgbaColor2string(palette2[5]);
47
- };
48
- const textColor = computed(() => {
49
- return getTextColorWithPalette(
50
- palette.value,
51
- props.disabled,
52
- props.loading,
53
- hoverFlag.value,
54
- activeFlag.value
55
- );
56
- });
57
- const clickHandler = (e) => {
58
- if (props.disabled || props.loading) {
59
- e.preventDefault();
60
- }
61
- };
62
- return (_ctx, _cache) => {
63
- return openBlock(), createElementBlock("a", {
64
- class: normalizeClass(["pixelium px-link", {
65
- "px-link__loading": props.loading,
66
- "px-link__disabled": props.disabled,
67
- "px-link__custom": palette.value,
68
- [`px-link__${props.theme || "primary"}`]: true
69
- }]),
70
- style: normalizeStyle({
71
- color: textColor.value
72
- }),
73
- onMouseenter: _cache[0] || (_cache[0] = ($event) => toggleHover(true)),
74
- onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleHover(false)),
75
- onMousedown: _cache[2] || (_cache[2] = ($event) => toggleActive(true)),
76
- onMouseup: _cache[3] || (_cache[3] = ($event) => toggleActive(false)),
77
- href: props.href,
78
- target: props.target,
79
- onClick: clickHandler
80
- }, [
81
- unref(slots).icon || props.loading ? (openBlock(), createElementBlock(
82
- "div",
83
- {
84
- key: 0,
85
- class: normalizeClass(["px-link-icon-wrapper", {
86
- "px-link-icon-wrapper__last": !unref(slots).default
87
- }])
88
- },
89
- [
90
- props.loading ? (openBlock(), createBlock(unref(SpinnerThirdSolid), {
91
- key: 0,
92
- class: "px-link-icon px-animation__loading",
93
- style: normalizeStyle({
94
- fill: textColor.value
95
- })
96
- }, null, 8, ["style"])) : renderSlot(_ctx.$slots, "icon", { key: 1 })
97
- ],
98
- 2
99
- /* CLASS */
100
- )) : createCommentVNode("v-if", true),
101
- renderSlot(_ctx.$slots, "default")
102
- ], 46, _hoisted_1);
103
- };
104
- }
2
+ import { V as spinner_third_solid_default } from "../vendor.js";
3
+ import { a as rgbaColor2string, i as parseColor, t as generatePalette } from "../share/util/color.js";
4
+ import { t as useDarkMode } from "../share/hook/use-dark-mode.js";
5
+ import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, unref, useSlots } from "vue";
6
+ var _hoisted_1 = ["href", "target"];
7
+ var link_default = /* @__PURE__ */ defineComponent({
8
+ name: "Link",
9
+ __name: "index",
10
+ props: {
11
+ disabled: { type: Boolean },
12
+ loading: { type: Boolean },
13
+ theme: null,
14
+ color: null,
15
+ href: null,
16
+ target: null
17
+ },
18
+ setup(__props) {
19
+ const props = __props;
20
+ const slots = useSlots();
21
+ const darkMode = useDarkMode();
22
+ const palette = computed(() => {
23
+ if (!props.color) return null;
24
+ const color = parseColor(props.color);
25
+ if (!color) return null;
26
+ return generatePalette(color.r, color.g, color.b, color.a, darkMode.value);
27
+ });
28
+ const hoverFlag = ref(false);
29
+ const activeFlag = ref(false);
30
+ const toggleHover = (value) => {
31
+ hoverFlag.value = value;
32
+ };
33
+ const toggleActive = (value) => {
34
+ activeFlag.value = value;
35
+ };
36
+ const getTextColorWithPalette = (palette$1, disabled, loading, hoverFlag$1, activeFlag$1) => {
37
+ if (!palette$1) return void 0;
38
+ if (disabled) return rgbaColor2string(palette$1[1]);
39
+ if (loading) return rgbaColor2string(palette$1[5]);
40
+ if (activeFlag$1) return rgbaColor2string(palette$1[6]);
41
+ if (hoverFlag$1) return rgbaColor2string(palette$1[4]);
42
+ return rgbaColor2string(palette$1[5]);
43
+ };
44
+ const textColor = computed(() => {
45
+ return getTextColorWithPalette(palette.value, props.disabled, props.loading, hoverFlag.value, activeFlag.value);
46
+ });
47
+ const clickHandler = (e) => {
48
+ if (props.disabled || props.loading) e.preventDefault();
49
+ };
50
+ return (_ctx, _cache) => {
51
+ return openBlock(), createElementBlock("a", {
52
+ class: normalizeClass(["pixelium px-link", {
53
+ "px-link__loading": props.loading,
54
+ "px-link__disabled": props.disabled,
55
+ "px-link__custom": palette.value,
56
+ [`px-link__${props.theme || "primary"}`]: true
57
+ }]),
58
+ style: normalizeStyle({ color: textColor.value }),
59
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => toggleHover(true)),
60
+ onMouseleave: _cache[1] || (_cache[1] = ($event) => toggleHover(false)),
61
+ onMousedown: _cache[2] || (_cache[2] = ($event) => toggleActive(true)),
62
+ onMouseup: _cache[3] || (_cache[3] = ($event) => toggleActive(false)),
63
+ href: props.href,
64
+ target: props.target,
65
+ onClick: clickHandler
66
+ }, [unref(slots).icon || props.loading ? (openBlock(), createElementBlock("div", {
67
+ key: 0,
68
+ class: normalizeClass(["px-link-icon-wrapper", { "px-link-icon-wrapper__last": !unref(slots).default }])
69
+ }, [props.loading ? (openBlock(), createBlock(unref(spinner_third_solid_default), {
70
+ key: 0,
71
+ class: "px-link-icon px-animation__loading",
72
+ style: normalizeStyle({ fill: textColor.value })
73
+ }, null, 8, ["style"])) : renderSlot(_ctx.$slots, "icon", { key: 1 })], 2)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")], 46, _hoisted_1);
74
+ };
75
+ }
105
76
  });
106
- export {
107
- _sfc_main as _
108
- };
77
+ export { link_default as t };
package/es/main/index.css CHANGED
@@ -5,4 +5,8 @@
5
5
  background-color: var(--px-neutral-1);
6
6
  color: var(--px-neutral-10);
7
7
  width: 100%;
8
+ box-sizing: border-box;
9
+ }
10
+ .px-main__soft {
11
+ background-color: var(--px-neutral-2);
8
12
  }
@@ -1,8 +1,11 @@
1
+ import type { MainProps } from './type';
1
2
  declare var __VLS_1: {};
2
3
  type __VLS_Slots = {} & {
3
4
  default?: (props: typeof __VLS_1) => any;
4
5
  };
5
- declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_component: import("vue").DefineComponent<MainProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MainProps> & Readonly<{}>, {
7
+ soft: boolean;
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
9
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
10
  export default _default;
8
11
  type __VLS_WithSlots<T, S> = T & {
package/es/main/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import './css.js'
2
- import { defineComponent, createElementBlock, openBlock, renderSlot } from "vue";
3
- const _hoisted_1 = { class: "pixelium px-main" };
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- ...{ name: "Main" },
6
- __name: "index",
7
- setup(__props) {
8
- return (_ctx, _cache) => {
9
- return openBlock(), createElementBlock("main", _hoisted_1, [
10
- renderSlot(_ctx.$slots, "default")
11
- ]);
12
- };
13
- }
2
+ import { createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot } from "vue";
3
+ var main_default = /* @__PURE__ */ defineComponent({
4
+ name: "Main",
5
+ __name: "index",
6
+ props: { soft: {
7
+ type: Boolean,
8
+ default: false
9
+ } },
10
+ setup(__props) {
11
+ const props = __props;
12
+ return (_ctx, _cache) => {
13
+ return openBlock(), createElementBlock("main", { class: normalizeClass(["pixelium px-main", { "px-main__soft": props.soft }]) }, [renderSlot(_ctx.$slots, "default")], 2);
14
+ };
15
+ }
14
16
  });
15
- export {
16
- _sfc_main as _
17
- };
17
+ export { main_default as t };
package/es/main/type.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ export type MainProps = {
2
+ /**
3
+ * @property {boolean} [soft=false]
4
+ * @version 0.0.3
5
+ */
6
+ soft?: boolean;
7
+ };
1
8
  export type MainSlots = {
2
9
  /**
3
10
  * @slot default
package/es/mask/index.js CHANGED
@@ -1,117 +1,96 @@
1
1
  import './css.js'
2
- import { defineComponent, shallowRef, ref, onMounted, nextTick, watch, createElementBlock, openBlock, normalizeStyle, createCommentVNode } from "vue";
3
- import { u as useResizeObserver } from "../share/hook/use-resize-observer.js";
4
- import { a as canvasPreprocess } from "../share/util/plot.js";
5
- import { u as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
6
- import { g as getGlobalThemeColor, r as rgbaColor2string } from "../share/util/color.js";
7
- import { C as COVER_Z_INDEX } from "../share/const/index.js";
8
- import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
9
- const _sfc_main = /* @__PURE__ */ defineComponent({
10
- ...{
11
- name: "Mask"
12
- },
13
- __name: "index",
14
- props: {
15
- color: null,
16
- step: { default: 1 },
17
- lineWidth: { default: 2 },
18
- grid: { type: Boolean, default: true },
19
- zIndex: { default: COVER_Z_INDEX }
20
- },
21
- setup(__props) {
22
- const darkMode = useDarkMode();
23
- const props = __props;
24
- const canvasRef = shallowRef(null);
25
- const wrapperRef = shallowRef(null);
26
- const calcDefaultBackgroundColor = () => {
27
- const color = getGlobalThemeColor("neutral", 8);
28
- color.a = Math.floor(255 * 0.5);
29
- return rgbaColor2string(color);
30
- };
31
- const defaultBackgroundColor = ref(calcDefaultBackgroundColor());
32
- const drawGrid = () => {
33
- if (!props.grid) {
34
- return;
35
- }
36
- const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
37
- if (!preprocessData) {
38
- return;
39
- }
40
- const { ctx, width, height } = preprocessData;
41
- const lineWidth = props.lineWidth;
42
- ctx.clearRect(0, 0, width, height);
43
- ctx.strokeStyle = props.color || defaultBackgroundColor.value;
44
- ctx.lineWidth = lineWidth;
45
- const step = Math.max(1, props.step);
46
- for (let x = 0; x <= width; x += step + lineWidth) {
47
- ctx.beginPath();
48
- ctx.moveTo(x, 0);
49
- ctx.lineTo(x, height);
50
- ctx.stroke();
51
- }
52
- for (let y = 0; y <= height; y += step + lineWidth) {
53
- ctx.beginPath();
54
- ctx.moveTo(0, y);
55
- ctx.lineTo(width, y);
56
- ctx.stroke();
57
- }
58
- };
59
- onMounted(() => {
60
- nextTick(() => {
61
- drawGrid();
62
- });
63
- });
64
- useResizeObserver(wrapperRef, drawGrid);
65
- useWatchGlobalCssVal(() => {
66
- drawGrid();
67
- defaultBackgroundColor.value = calcDefaultBackgroundColor();
68
- });
69
- watch(
70
- [
71
- darkMode,
72
- defaultBackgroundColor,
73
- () => props.grid,
74
- () => props.color,
75
- () => props.step,
76
- () => props.lineWidth
77
- ],
78
- () => {
79
- defaultBackgroundColor.value = calcDefaultBackgroundColor();
80
- drawGrid();
81
- }
82
- );
83
- return (_ctx, _cache) => {
84
- return openBlock(), createElementBlock(
85
- "div",
86
- {
87
- class: "pixelium px-mask",
88
- style: normalizeStyle({
89
- zIndex: props.zIndex,
90
- backgroundColor: !props.grid ? props.color || defaultBackgroundColor.value : void 0
91
- }),
92
- ref_key: "wrapperRef",
93
- ref: wrapperRef
94
- },
95
- [
96
- props.grid ? (openBlock(), createElementBlock(
97
- "canvas",
98
- {
99
- key: 0,
100
- ref_key: "canvasRef",
101
- ref: canvasRef,
102
- class: "px-mask-canvas"
103
- },
104
- null,
105
- 512
106
- /* NEED_PATCH */
107
- )) : createCommentVNode("v-if", true)
108
- ],
109
- 4
110
- /* STYLE */
111
- );
112
- };
113
- }
2
+ import { n as COVER_Z_INDEX } from "../share/const/index.js";
3
+ import { i as canvasPreprocess } from "../share/util/plot.js";
4
+ import { a as rgbaColor2string, n as getGlobalThemeColor } from "../share/util/color.js";
5
+ import { t as useDarkMode } from "../share/hook/use-dark-mode.js";
6
+ import { t as useResizeObserver } from "../share/hook/use-resize-observer.js";
7
+ import { t as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
8
+ import { createCommentVNode, createElementBlock, defineComponent, nextTick, normalizeStyle, onMounted, openBlock, ref, shallowRef, watch } from "vue";
9
+ var mask_default = /* @__PURE__ */ defineComponent({
10
+ name: "Mask",
11
+ __name: "index",
12
+ props: {
13
+ color: null,
14
+ step: { default: 1 },
15
+ lineWidth: { default: 2 },
16
+ grid: {
17
+ type: Boolean,
18
+ default: true
19
+ },
20
+ zIndex: { default: 20 }
21
+ },
22
+ setup(__props) {
23
+ const darkMode = useDarkMode();
24
+ const props = __props;
25
+ const canvasRef = shallowRef(null);
26
+ const wrapperRef = shallowRef(null);
27
+ const calcDefaultBackgroundColor = () => {
28
+ const color = getGlobalThemeColor("neutral", 8);
29
+ if (!color) return "none";
30
+ color.a = Math.floor(255 * .5);
31
+ return rgbaColor2string(color);
32
+ };
33
+ const defaultBackgroundColor = ref(calcDefaultBackgroundColor());
34
+ const drawGrid = () => {
35
+ if (!props.grid) return;
36
+ const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
37
+ if (!preprocessData) return;
38
+ const { ctx, width, height } = preprocessData;
39
+ const lineWidth = props.lineWidth;
40
+ ctx.clearRect(0, 0, width, height);
41
+ ctx.strokeStyle = props.color || defaultBackgroundColor.value;
42
+ ctx.lineWidth = lineWidth;
43
+ const step = Math.max(1, props.step);
44
+ for (let x = 0; x <= width; x += step + lineWidth) {
45
+ ctx.beginPath();
46
+ ctx.moveTo(x, 0);
47
+ ctx.lineTo(x, height);
48
+ ctx.stroke();
49
+ }
50
+ for (let y = 0; y <= height; y += step + lineWidth) {
51
+ ctx.beginPath();
52
+ ctx.moveTo(0, y);
53
+ ctx.lineTo(width, y);
54
+ ctx.stroke();
55
+ }
56
+ };
57
+ onMounted(() => {
58
+ nextTick(() => {
59
+ drawGrid();
60
+ });
61
+ });
62
+ useResizeObserver(wrapperRef, drawGrid);
63
+ useWatchGlobalCssVal(() => {
64
+ drawGrid();
65
+ defaultBackgroundColor.value = calcDefaultBackgroundColor();
66
+ });
67
+ watch([
68
+ darkMode,
69
+ defaultBackgroundColor,
70
+ () => props.grid,
71
+ () => props.color,
72
+ () => props.step,
73
+ () => props.lineWidth
74
+ ], () => {
75
+ defaultBackgroundColor.value = calcDefaultBackgroundColor();
76
+ drawGrid();
77
+ });
78
+ return (_ctx, _cache) => {
79
+ return openBlock(), createElementBlock("div", {
80
+ class: "pixelium px-mask",
81
+ style: normalizeStyle({
82
+ zIndex: props.zIndex,
83
+ backgroundColor: !props.grid ? props.color || defaultBackgroundColor.value : void 0
84
+ }),
85
+ ref_key: "wrapperRef",
86
+ ref: wrapperRef
87
+ }, [props.grid ? (openBlock(), createElementBlock("canvas", {
88
+ key: 0,
89
+ ref_key: "canvasRef",
90
+ ref: canvasRef,
91
+ class: "px-mask-canvas"
92
+ }, null, 512)) : createCommentVNode("v-if", true)], 4);
93
+ };
94
+ }
114
95
  });
115
- export {
116
- _sfc_main as _
117
- };
96
+ export { mask_default as t };
@@ -43,7 +43,7 @@
43
43
  display: flex;
44
44
  align-items: center;
45
45
  flex-shrink: 0;
46
- margin-left: var(--px-interval-2);
46
+ margin-left: 8px;
47
47
  }
48
48
  .px-message-close-wrapper .px-message-icon {
49
49
  cursor: pointer;