@pixelium/web-vue 0.0.1-beta → 0.0.2-fix

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 +5370 -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 +677 -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
@@ -0,0 +1,432 @@
1
+ import './css.js'
2
+ import { defineComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, getCurrentInstance, ref, inject, computed, shallowRef, useSlots, watch, onMounted, nextTick, normalizeClass, createCommentVNode, unref, renderSlot, withModifiers, createBlock, toDisplayString, createVNode } from "vue";
3
+ import { u as useResizeObserver } from "../share/hook/use-resize-observer.js";
4
+ import { d as drawBorder } from "./draw.js";
5
+ import { g as getGlobalThemeColor } from "../share/util/color.js";
6
+ import { a as canvasPreprocess, c as calcPixelSize, g as getBorderRadius, b as calcBorderCornerCenter, f as floodFill } from "../share/util/plot.js";
7
+ import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
8
+ import { u as useComposition } from "../share/hook/use-composition.js";
9
+ import { T as TimesCircleSolid, S as SpinnerThirdSolid } from "../auto-complete/index.js";
10
+ import { N } from "../aside/index.js";
11
+ import { u as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
12
+ import { _ as _sfc_main$1 } from "../input-group/index.js";
13
+ import { I as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
14
+ import { u as useIndexOfChildren } from "../share/hook/use-index-of-children.js";
15
+ import { I as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
16
+ import { B as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
17
+ import { u as useControlledMode } from "../share/hook/use-controlled-mode.js";
18
+ const Eye = /* @__PURE__ */ defineComponent({
19
+ props: {
20
+ size: {},
21
+ color: {}
22
+ },
23
+ setup(__props) {
24
+ const props = __props;
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock(
27
+ "svg",
28
+ {
29
+ class: "px-icon-hn",
30
+ style: normalizeStyle({ color: props.color, fontSize: props.size + "px" }),
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ viewBox: "0 0 24 24"
33
+ },
34
+ [..._cache[0] || (_cache[0] = [
35
+ createElementVNode(
36
+ "path",
37
+ { d: "M16 11h1v2h-1zM16 13v2h-1v1h-2v-1h1v-1h1v-1zM16 9v2h-1v-1h-1V9h-1V8h2v1zM11 16h2v1h-2zM11 15v1H9v-1H8v-2h1v1h1v1zM13 7v1h-1v3h-1v1H8v1H7v-2h1V9h1V8h2V7z" },
38
+ null,
39
+ -1
40
+ /* CACHED */
41
+ ),
42
+ createElementVNode(
43
+ "path",
44
+ { d: "M22 11V9h-1V8h-1V7h-1V6h-2V5H7v1H5v1H4v1H3v1H2v2H1v2h1v2h1v1h1v1h1v1h2v1h10v-1h2v-1h1v-1h1v-1h1v-2h1v-2zm-1 3h-1v1h-1v1h-1v1h-2v1H8v-1H7v-1H5v-1H4v-1H3v-4h1V9h1V8h1V7h2V6h8v1h2v1h1v1h1v1h1z" },
45
+ null,
46
+ -1
47
+ /* CACHED */
48
+ )
49
+ ])],
50
+ 4
51
+ /* STYLE */
52
+ );
53
+ };
54
+ }
55
+ });
56
+ const EyeCross = /* @__PURE__ */ defineComponent({
57
+ props: {
58
+ size: {},
59
+ color: {}
60
+ },
61
+ setup(__props) {
62
+ const props = __props;
63
+ return (_ctx, _cache) => {
64
+ return openBlock(), createElementBlock(
65
+ "svg",
66
+ {
67
+ class: "px-icon-hn",
68
+ style: normalizeStyle({ color: props.color, fontSize: props.size + "px" }),
69
+ xmlns: "http://www.w3.org/2000/svg",
70
+ viewBox: "0 0 24 24"
71
+ },
72
+ [..._cache[0] || (_cache[0] = [
73
+ createElementVNode(
74
+ "path",
75
+ { d: "M15 13h1v2h-1v1h-2v-1h1v-1h1zM16 11h1v2h-1z" },
76
+ null,
77
+ -1
78
+ /* CACHED */
79
+ ),
80
+ createElementVNode(
81
+ "path",
82
+ { d: "M23 11v2h-1v2h-1v1h-1v1h-1v1h-2v1H9v-1h7v-1h2v-1h1v-1h1v-1h1v-4h-1V9h-1V8h2v1h1v2zM2 13H1v-2h1V9h1V8h1V7h1V6h2V5h8v1H8v1H6v1H5v1H4v1H3v4h1v1h1v1H3v-1H2z" },
83
+ null,
84
+ -1
85
+ /* CACHED */
86
+ ),
87
+ createElementVNode(
88
+ "path",
89
+ { d: "M13 7v1h-1v1h-1v1h-1v1H9v1H8v1H7v-2h1V9h1V8h2V7zM9 17H8v1H7v1H6v1H5v1H4v1H3v-1H2v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1v-1h1V9h1V8h1V7h1V6h1V5h1V4h1V3h1V2h1v1h1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1h-1v1H9zM11 16h2v1h-2z" },
90
+ null,
91
+ -1
92
+ /* CACHED */
93
+ )
94
+ ])],
95
+ 4
96
+ /* STYLE */
97
+ );
98
+ };
99
+ }
100
+ });
101
+ const _hoisted_1 = {
102
+ key: 0,
103
+ class: "px-input-prefix-wrapper"
104
+ };
105
+ const _hoisted_2 = ["value", "placeholder", "disabled", "autofocus", "type"];
106
+ const _hoisted_3 = {
107
+ key: 1,
108
+ class: "px-input-close-wrapper"
109
+ };
110
+ const _hoisted_4 = {
111
+ key: 1,
112
+ class: "px-input-icon-placeholder"
113
+ };
114
+ const _hoisted_5 = {
115
+ key: 2,
116
+ class: "px-input-password-wrapper"
117
+ };
118
+ const _hoisted_6 = {
119
+ key: 3,
120
+ class: "px-input-count-wrapper"
121
+ };
122
+ const _hoisted_7 = {
123
+ key: 4,
124
+ class: "px-input-loading-wrapper"
125
+ };
126
+ const _hoisted_8 = {
127
+ key: 5,
128
+ class: "px-input-suffix-wrapper"
129
+ };
130
+ const _sfc_main = /* @__PURE__ */ defineComponent({
131
+ ...{
132
+ name: "Input"
133
+ },
134
+ __name: "index",
135
+ props: {
136
+ modelValue: null,
137
+ defaultValue: null,
138
+ placeholder: null,
139
+ password: { type: Boolean, default: false },
140
+ disabled: { type: Boolean, default: false },
141
+ readonly: { type: Boolean, default: false },
142
+ clearable: { type: Boolean, default: false },
143
+ loading: { type: Boolean, default: false },
144
+ size: { default: "medium" },
145
+ shape: { default: "default" },
146
+ borderRadius: null,
147
+ maxLength: null,
148
+ showCount: { type: Boolean, default: false },
149
+ countGraphemes: { type: Function },
150
+ sliceGraphemes: { type: Function },
151
+ status: { default: "normal" },
152
+ autofocus: { type: Boolean },
153
+ nativeType: null
154
+ },
155
+ emits: ["input", "update:modelValue", "change", "clear", "blur", "focus"],
156
+ setup(__props, { expose: __expose, emit: __emit }) {
157
+ var _a;
158
+ const props = __props;
159
+ const emits = __emit;
160
+ const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({
161
+ afterComposition: (e) => {
162
+ nextTick(() => {
163
+ inputHandler(e);
164
+ });
165
+ }
166
+ });
167
+ const instance = getCurrentInstance();
168
+ const innerInputGroup = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
169
+ const [_, first, last] = innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE) : [ref(0), ref(false), ref(false)];
170
+ const inputGroupProps = inject(INPUT_GROUP_PROVIDE);
171
+ const borderRadiusComputed = computed(() => {
172
+ return innerInputGroup.value && inputGroupProps ? inputGroupProps.borderRadius : props.borderRadius;
173
+ });
174
+ const sizeComputed = computed(() => {
175
+ return innerInputGroup.value && inputGroupProps ? inputGroupProps.size : props.size;
176
+ });
177
+ const shapeComputed = computed(() => {
178
+ return innerInputGroup.value && inputGroupProps ? inputGroupProps.shape : props.shape;
179
+ });
180
+ const disabledComputed = computed(() => {
181
+ return innerInputGroup.value && inputGroupProps ? inputGroupProps.disabled || props.disabled : props.disabled;
182
+ });
183
+ const [inputValue, updateInputValue] = useControlledMode("modelValue", props, emits, {
184
+ defaultField: "defaultValue",
185
+ transform: (nextValue) => {
186
+ return nextValue || "";
187
+ }
188
+ });
189
+ const wrapperRef = shallowRef(null);
190
+ const canvasRef = shallowRef(null);
191
+ const inputRef = shallowRef(null);
192
+ const currentLength = computed(() => {
193
+ return props.countGraphemes ? props.countGraphemes(inputValue.value) : inputValue.value.length;
194
+ });
195
+ const inputHandler = async (e) => {
196
+ const target = e.target;
197
+ let newValue = target.value;
198
+ inputValue.value = newValue;
199
+ if (isComposing.value) {
200
+ return;
201
+ }
202
+ emits("input", newValue, e);
203
+ if (props.maxLength) {
204
+ if (props.countGraphemes && props.sliceGraphemes) {
205
+ await nextTick();
206
+ newValue = props.sliceGraphemes(inputValue.value, props.maxLength);
207
+ } else {
208
+ newValue = inputValue.value.slice(0, props.maxLength);
209
+ }
210
+ }
211
+ updateInputValue(newValue);
212
+ };
213
+ const clearHandler = async () => {
214
+ await updateInputValue("");
215
+ emits("change", "");
216
+ emits("clear", "");
217
+ };
218
+ const changeHandler = (e) => {
219
+ const target = e.target;
220
+ emits("change", target.value, e);
221
+ };
222
+ const focusMode = ref(false);
223
+ const blurHandler = () => {
224
+ focusMode.value = false;
225
+ };
226
+ const focusHandler = () => {
227
+ focusMode.value = true;
228
+ };
229
+ const focusInputHandler = () => {
230
+ var _a2;
231
+ (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
232
+ };
233
+ const hoverFlag = ref(false);
234
+ const mouseenterHandler = () => {
235
+ hoverFlag.value = true;
236
+ };
237
+ const mouseleaveHandler = () => {
238
+ hoverFlag.value = false;
239
+ };
240
+ const showClose = computed(() => {
241
+ return props.clearable && !disabledComputed.value && !props.readonly;
242
+ });
243
+ const showPassword = ref(false);
244
+ const toggleShowPassword = () => {
245
+ showPassword.value = !showPassword.value;
246
+ };
247
+ const typeComputed = computed(() => {
248
+ if (props.nativeType) {
249
+ return props.nativeType;
250
+ }
251
+ if (props.password) {
252
+ return showPassword.value ? "text" : "password";
253
+ }
254
+ return "text";
255
+ });
256
+ const slots = useSlots();
257
+ __expose({
258
+ focus: () => {
259
+ var _a2;
260
+ (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
261
+ },
262
+ blur: () => {
263
+ var _a2;
264
+ (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
265
+ },
266
+ clear: () => clearHandler(),
267
+ select: () => {
268
+ var _a2;
269
+ (_a2 = inputRef.value) == null ? void 0 : _a2.select();
270
+ }
271
+ });
272
+ const darkMode = useDarkMode();
273
+ watch(
274
+ [
275
+ first,
276
+ last,
277
+ borderRadiusComputed,
278
+ shapeComputed,
279
+ sizeComputed,
280
+ disabledComputed,
281
+ () => slots,
282
+ darkMode,
283
+ focusMode,
284
+ hoverFlag
285
+ ],
286
+ () => {
287
+ setTimeout(() => {
288
+ drawPixel();
289
+ });
290
+ }
291
+ );
292
+ const drawPixel = () => {
293
+ const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
294
+ if (!preprocessData) {
295
+ return;
296
+ }
297
+ const { ctx, width, height, canvas } = preprocessData;
298
+ const pixelSize = calcPixelSize();
299
+ const borderRadius = getBorderRadius(
300
+ canvas,
301
+ pixelSize,
302
+ borderRadiusComputed.value,
303
+ shapeComputed.value,
304
+ sizeComputed.value || "medium",
305
+ innerInputGroup.value,
306
+ first.value,
307
+ last.value
308
+ );
309
+ const borderColor = props.status !== "normal" ? getGlobalThemeColor(props.status === "error" ? "danger" : props.status, 6) : (hoverFlag.value || focusMode.value) && !disabledComputed.value && !props.readonly ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
310
+ const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize);
311
+ const rad = BORDER_CORNER_RAD_RANGE;
312
+ drawBorder(
313
+ ctx,
314
+ width,
315
+ height,
316
+ center,
317
+ borderRadius,
318
+ rad,
319
+ borderColor,
320
+ pixelSize,
321
+ innerInputGroup.value,
322
+ first.value,
323
+ last.value
324
+ );
325
+ const backgroundColor = disabledComputed.value ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
326
+ floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
327
+ };
328
+ onMounted(() => {
329
+ nextTick(() => {
330
+ drawPixel();
331
+ });
332
+ });
333
+ useResizeObserver(wrapperRef, drawPixel);
334
+ useWatchGlobalCssVal(drawPixel);
335
+ return (_ctx, _cache) => {
336
+ return openBlock(), createElementBlock(
337
+ "div",
338
+ {
339
+ class: normalizeClass(["pixelium px-input", {
340
+ [`px-input__${sizeComputed.value}`]: !!sizeComputed.value,
341
+ [`px-input__${shapeComputed.value}`]: !!shapeComputed.value,
342
+ "px-input__inner": innerInputGroup.value,
343
+ "px-input__disabled": !!disabledComputed.value
344
+ }]),
345
+ ref_key: "wrapperRef",
346
+ ref: wrapperRef,
347
+ onClick: focusInputHandler,
348
+ onMouseenter: mouseenterHandler,
349
+ onMouseleave: mouseleaveHandler
350
+ },
351
+ [
352
+ unref(slots).prefix ? (openBlock(), createElementBlock("div", _hoisted_1, [
353
+ renderSlot(_ctx.$slots, "prefix")
354
+ ])) : createCommentVNode("v-if", true),
355
+ createElementVNode("input", {
356
+ class: "px-input-inner",
357
+ value: unref(inputValue),
358
+ ref_key: "inputRef",
359
+ ref: inputRef,
360
+ placeholder: props.placeholder,
361
+ disabled: disabledComputed.value || props.readonly,
362
+ autofocus: __props.autofocus,
363
+ type: typeComputed.value,
364
+ onInput: withModifiers(inputHandler, ["stop"]),
365
+ onChange: withModifiers(changeHandler, ["stop"]),
366
+ onBlur: blurHandler,
367
+ onFocus: focusHandler,
368
+ onCompositionstart: _cache[0] || (_cache[0] = //@ts-ignore
369
+ (...args) => unref(compositionStartHandler) && unref(compositionStartHandler)(...args)),
370
+ onCompositionend: _cache[1] || (_cache[1] = //@ts-ignore
371
+ (...args) => unref(compositionUpdateHandler) && unref(compositionUpdateHandler)(...args))
372
+ }, null, 40, _hoisted_2),
373
+ showClose.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
374
+ hoverFlag.value && !!unref(inputValue) ? (openBlock(), createBlock(unref(TimesCircleSolid), {
375
+ key: 0,
376
+ class: "px-input-icon",
377
+ onClick: clearHandler
378
+ })) : (openBlock(), createElementBlock("div", _hoisted_4))
379
+ ])) : createCommentVNode("v-if", true),
380
+ props.password ? (openBlock(), createElementBlock("div", _hoisted_5, [
381
+ !showPassword.value ? (openBlock(), createBlock(unref(Eye), {
382
+ key: 0,
383
+ class: "px-input-icon",
384
+ onClick: toggleShowPassword
385
+ })) : (openBlock(), createBlock(unref(EyeCross), {
386
+ key: 1,
387
+ class: "px-input-icon",
388
+ onClick: toggleShowPassword
389
+ }))
390
+ ])) : createCommentVNode("v-if", true),
391
+ props.showCount ? (openBlock(), createElementBlock("div", _hoisted_6, [
392
+ renderSlot(_ctx.$slots, "count", {
393
+ value: unref(inputValue),
394
+ count: currentLength.value,
395
+ maxLength: props.maxLength
396
+ }, () => [
397
+ createElementVNode(
398
+ "span",
399
+ null,
400
+ toDisplayString(currentLength.value) + toDisplayString(unref(N)(props.maxLength) ? "" : " / " + props.maxLength),
401
+ 1
402
+ /* TEXT */
403
+ )
404
+ ])
405
+ ])) : createCommentVNode("v-if", true),
406
+ props.loading ? (openBlock(), createElementBlock("div", _hoisted_7, [
407
+ createVNode(unref(SpinnerThirdSolid), { class: "px-input-icon px-animation__loading" })
408
+ ])) : createCommentVNode("v-if", true),
409
+ unref(slots).suffix ? (openBlock(), createElementBlock("div", _hoisted_8, [
410
+ renderSlot(_ctx.$slots, "suffix")
411
+ ])) : createCommentVNode("v-if", true),
412
+ createElementVNode(
413
+ "canvas",
414
+ {
415
+ class: "px-input-canvas",
416
+ ref_key: "canvasRef",
417
+ ref: canvasRef
418
+ },
419
+ null,
420
+ 512
421
+ /* NEED_PATCH */
422
+ )
423
+ ],
424
+ 34
425
+ /* CLASS, NEED_HYDRATION */
426
+ );
427
+ };
428
+ }
429
+ });
430
+ export {
431
+ _sfc_main as _
432
+ };
@@ -0,0 +1,175 @@
1
+ import type { NumberOrPercentage } from '../share/type';
2
+ export type InputProps = {
3
+ /**
4
+ * @property {string | null} [modelValue]
5
+ * @version 0.0.2
6
+ */
7
+ modelValue?: string | null;
8
+ /**
9
+ * @property {string | null} [defaultValue]
10
+ * @version 0.0.2
11
+ */
12
+ defaultValue?: string | null;
13
+ /**
14
+ * @property {string} [placeholder]
15
+ * @version 0.0.2
16
+ */
17
+ placeholder?: string;
18
+ /**
19
+ * @property {boolean} [password=false]
20
+ * @version 0.0.2
21
+ */
22
+ password?: boolean;
23
+ /**
24
+ * @property {boolean} [disabled=false]
25
+ * @version 0.0.2
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * @property {boolean} [readonly=false]
30
+ * @version 0.0.2
31
+ */
32
+ readonly?: boolean;
33
+ /**
34
+ * @property {boolean} [clearable=false]
35
+ * @version 0.0.2
36
+ */
37
+ clearable?: boolean;
38
+ /**
39
+ * @property {boolean} [loading=false]
40
+ * @version 0.0.2
41
+ */
42
+ loading?: boolean;
43
+ /**
44
+ * @property {'medium' | 'large' | 'small'} [size='medium']
45
+ * @version 0.0.2
46
+ */
47
+ size?: 'medium' | 'large' | 'small';
48
+ /**
49
+ * @property {'default' | 'round'} [shape='default']
50
+ * @version 0.0.2
51
+ */
52
+ shape?: 'default' | 'round';
53
+ /**
54
+ * @property {NumberOrPercentage | NumberOrPercentage[]} [borderRadius]
55
+ * @version 0.0.2
56
+ */
57
+ borderRadius?: NumberOrPercentage | NumberOrPercentage[];
58
+ /**
59
+ * @property {number} [maxLength]
60
+ * @version 0.0.2
61
+ */
62
+ maxLength?: number;
63
+ /**
64
+ * @property {boolean} [showCount=false]
65
+ * @version 0.0.2
66
+ */
67
+ showCount?: boolean;
68
+ /**
69
+ * @property {(value: string) => number} [countGraphemes]
70
+ * @version 0.0.2
71
+ */
72
+ countGraphemes?: (value: string) => number;
73
+ /**
74
+ * @property {(value: string, limit: number) => string} [sliceGraphemes]
75
+ * @version 0.0.2
76
+ */
77
+ sliceGraphemes?: (value: string, limit: number) => string;
78
+ /**
79
+ * @property {'success' | 'warning' | 'error' | 'normal'} [status='normal']
80
+ * @version 0.0.2
81
+ */
82
+ status?: 'success' | 'warning' | 'error' | 'normal';
83
+ /**
84
+ * @property {boolean} [autofocus=false]
85
+ * @version 0.0.2
86
+ */
87
+ autofocus?: boolean;
88
+ /**
89
+ * @property {'text' | 'password' | 'email' | 'tel' | 'url' | 'search'} [nativeType='text']
90
+ * @version 0.0.2
91
+ */
92
+ nativeType?: 'text' | 'password' | 'email' | 'tel' | 'url' | 'search';
93
+ };
94
+ export type InputEvents = {
95
+ /**
96
+ * @event input
97
+ * @param {string} value
98
+ * @param {Event} e
99
+ * @version 0.0.2
100
+ */
101
+ input: [value: string, e: Event];
102
+ /**
103
+ * @event update:modelValue
104
+ * @param {string} value
105
+ * @version 0.0.2
106
+ */
107
+ 'update:modelValue': [value: string];
108
+ /**
109
+ * @event change
110
+ * @param {string} value
111
+ * @param {Event | undefined} e
112
+ * @version 0.0.2
113
+ */
114
+ change: [value: string, e?: Event];
115
+ /**
116
+ * @event clear
117
+ * @param {string} value
118
+ * @version 0.0.2
119
+ */
120
+ clear: [value: string];
121
+ /**
122
+ * @event blur
123
+ * @param {FocusEvent} e
124
+ * @version 0.0.2
125
+ */
126
+ blur: [e: FocusEvent];
127
+ /**
128
+ * @event focus
129
+ * @param {FocusEvent} e
130
+ * @version 0.0.2
131
+ */
132
+ focus: [e: FocusEvent];
133
+ };
134
+ export type InputSlots = {
135
+ /**
136
+ * @slot prefix
137
+ * @version 0.0.2
138
+ */
139
+ prefix: {};
140
+ /**
141
+ * @slot suffix
142
+ * @version 0.0.2
143
+ */
144
+ suffix: {};
145
+ /**
146
+ * @slot count
147
+ * @param {number} inputValue
148
+ * @param {number} currentLength
149
+ * @param {number} maxLength
150
+ * @version 0.0.2
151
+ */
152
+ count: {};
153
+ };
154
+ export type InputExpose = {
155
+ /**
156
+ * @property {() => void} focus
157
+ * @version 0.0.2
158
+ */
159
+ focus: () => void;
160
+ /**
161
+ * @property {() => void} blur
162
+ * @version 0.0.2
163
+ */
164
+ blur: () => void;
165
+ /**
166
+ * @property {() => void} clear
167
+ * @version 0.0.2
168
+ */
169
+ clear: () => void;
170
+ /**
171
+ * @property {() => void} select
172
+ * @version 0.0.2
173
+ */
174
+ select: () => void;
175
+ };
@@ -0,0 +1,2 @@
1
+ import '../index.css'
2
+ import './index.css'
@@ -0,0 +1,24 @@
1
+ .px-input-group {
2
+ height: var(--button-size);
3
+ display: inline-flex;
4
+ align-items: start;
5
+ position: relative;
6
+ }
7
+ .px-input-group > .px-button,
8
+ .px-input-group > .px-input,
9
+ .px-input-group > .px-input-number,
10
+ .px-input-group > .px-auto-complete,
11
+ .px-input-group > .px-input-tag,
12
+ .px-input-group > .px-select,
13
+ .px-input-group > .px-input-group-label {
14
+ margin-left: calc(-2 * var(--px-bit) - 1px);
15
+ }
16
+ .px-input-group > .px-button:first-child,
17
+ .px-input-group > .px-input:first-child,
18
+ .px-input-group > .px-input-number:first-child,
19
+ .px-input-group > .px-auto-complete:first-child,
20
+ .px-input-group > .px-input-tag:first-child,
21
+ .px-input-group > .px-select:first-child,
22
+ .px-input-group > .px-input-group-label:first-child {
23
+ margin-left: 0;
24
+ }
@@ -0,0 +1,17 @@
1
+ import type { InputGroupProps } from './type';
2
+ declare var __VLS_1: {};
3
+ type __VLS_Slots = {} & {
4
+ default?: (props: typeof __VLS_1) => any;
5
+ };
6
+ declare const __VLS_component: import("vue").DefineComponent<InputGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<InputGroupProps> & Readonly<{}>, {
7
+ shape: "default" | "round";
8
+ size: "medium" | "large" | "small";
9
+ disabled: boolean;
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,40 @@
1
+ import './css.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 { I as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
5
+ import { I as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
6
+ const _hoisted_1 = {
7
+ class: "pixelium px-input-group",
8
+ ref: "slotWrapper"
9
+ };
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
11
+ ...{
12
+ name: "InputGroup"
13
+ },
14
+ __name: "index",
15
+ props: {
16
+ borderRadius: null,
17
+ shape: { default: "default" },
18
+ size: { default: "medium" },
19
+ disabled: { type: Boolean, default: false }
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ provide(INPUT_GROUP_PROVIDE, props);
24
+ emitParentUpdate(INPUT_GROUP_UPDATE);
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock(
27
+ "div",
28
+ _hoisted_1,
29
+ [
30
+ renderSlot(_ctx.$slots, "default")
31
+ ],
32
+ 512
33
+ /* NEED_PATCH */
34
+ );
35
+ };
36
+ }
37
+ });
38
+ export {
39
+ _sfc_main as _
40
+ };