@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,108 @@
1
+ div.px-textarea {
2
+ font-size: var(--text-size);
3
+ }
4
+ .px-textarea {
5
+ --px-medium-padding-x: var(--px-interval-2);
6
+ --px-large-padding-x: var(--px-interval-3);
7
+ --px-small-padding-x: var(--px-interval-2);
8
+ --padding-x-size: var(--px-medium-padding-x);
9
+ --text-size: var(--px-medium-font-size);
10
+ --textarea-size: var(--px-medium-size);
11
+ z-index: 0;
12
+ position: relative;
13
+ background-color: transparent;
14
+ border-color: transparent;
15
+ border-width: var(--px-bit);
16
+ border-style: solid;
17
+ color: var(--px-neutral-10);
18
+ display: flex;
19
+ box-sizing: border-box;
20
+ }
21
+ .px-textarea-inner {
22
+ height: 100%;
23
+ border: 0;
24
+ background-color: transparent;
25
+ box-sizing: border-box;
26
+ width: 100%;
27
+ font-size: var(--text-size);
28
+ line-height: var(--px-line-height);
29
+ font-family: var(--px-font);
30
+ padding: 0 var(--padding-x-size);
31
+ min-height: calc(var(--textarea-size) - var(--px-bit) * 2);
32
+ resize: none;
33
+ }
34
+ .px-textarea-inner:focus-visible {
35
+ outline-color: var(--px-neutral-10);
36
+ outline-offset: var(--px-bit);
37
+ }
38
+ .px-textarea-inner:disabled {
39
+ color: var(--px-neutral-10);
40
+ }
41
+ .px-textarea-inner::placeholder {
42
+ color: var(--px-neutral-8);
43
+ opacity: 1;
44
+ }
45
+ .px-textarea__resize .px-textarea-inner {
46
+ resize: vertical;
47
+ }
48
+ .px-textarea__large {
49
+ --padding-x-size: var(--px-large-padding-x);
50
+ --text-size: var(--px-large-font-size);
51
+ --input-size: var(--px-large-size);
52
+ }
53
+ .px-textarea__small {
54
+ --padding-x-size: var(--px-small-padding-x);
55
+ --input-size: var(--px-small-size);
56
+ --text-size: var(--px-small-font-size);
57
+ }
58
+ .px-textarea__disabled {
59
+ cursor: not-allowed;
60
+ }
61
+ .px-textarea__disabled .px-textarea-inner:disabled {
62
+ cursor: not-allowed;
63
+ color: var(--px-neutral-8);
64
+ }
65
+ .px-textarea-addition-wrapper {
66
+ position: absolute;
67
+ bottom: 0;
68
+ right: var(--padding-x-size);
69
+ display: flex;
70
+ align-items: center;
71
+ }
72
+ .px-textarea-count-wrapper,
73
+ .px-textarea-loading-wrapper,
74
+ .px-textarea-close-wrapper {
75
+ flex-shrink: 0;
76
+ display: flex;
77
+ align-items: center;
78
+ margin-left: var(--px-interval-2);
79
+ }
80
+ .px-textarea-close-wrapper .px-textarea-icon {
81
+ width: var(--text-size);
82
+ height: var(--text-size);
83
+ cursor: pointer;
84
+ fill: var(--px-neutral-8);
85
+ transition: 0.25s;
86
+ }
87
+ .px-textarea-close-wrapper .px-textarea-icon:hover {
88
+ fill: var(--px-neutral-7);
89
+ }
90
+ .px-textarea-close-wrapper .px-textarea-icon:active {
91
+ fill: var(--px-neutral-9);
92
+ }
93
+ .px-textarea-loading-wrapper .px-textarea-icon {
94
+ width: var(--text-size);
95
+ height: var(--text-size);
96
+ fill: var(--px-primary-6);
97
+ }
98
+ .px-textarea-count-wrapper {
99
+ color: var(--px-neutral-8);
100
+ }
101
+ .px-textarea-canvas {
102
+ position: absolute;
103
+ top: 50%;
104
+ left: 50%;
105
+ transform: translate(-50%, -50%);
106
+ z-index: -1;
107
+ pointer-events: none;
108
+ }
@@ -0,0 +1,49 @@
1
+ import type { TextareaProps } from './type';
2
+ import { type Nullish } from 'parsnip-kit';
3
+ declare var __VLS_9: {
4
+ value: string | Nullish;
5
+ count: number;
6
+ maxLength: number | undefined;
7
+ };
8
+ type __VLS_Slots = {} & {
9
+ count?: (props: typeof __VLS_9) => any;
10
+ };
11
+ declare const __VLS_component: import("vue").DefineComponent<TextareaProps, {
12
+ focus: () => void;
13
+ blur: () => void;
14
+ clear: () => Promise<void>;
15
+ select: () => void;
16
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
+ input: (value: string, e: Event) => any;
18
+ change: (value: string, e?: Event | undefined) => any;
19
+ clear: (value: string) => any;
20
+ blur: (e: FocusEvent) => any;
21
+ focus: (e: FocusEvent) => any;
22
+ "update:modelValue": (value: string) => any;
23
+ }, string, import("vue").PublicProps, Readonly<TextareaProps> & Readonly<{
24
+ onInput?: ((value: string, e: Event) => any) | undefined;
25
+ onChange?: ((value: string, e?: Event | undefined) => any) | undefined;
26
+ onClear?: ((value: string) => any) | undefined;
27
+ onBlur?: ((e: FocusEvent) => any) | undefined;
28
+ onFocus?: ((e: FocusEvent) => any) | undefined;
29
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
30
+ }>, {
31
+ size: "medium" | "large" | "small";
32
+ disabled: boolean;
33
+ loading: boolean;
34
+ resize: boolean;
35
+ readonly: boolean;
36
+ clearable: boolean;
37
+ showCount: boolean;
38
+ status: "success" | "warning" | "error" | "normal";
39
+ minRows: number;
40
+ maxRows: number;
41
+ autoResize: boolean;
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
43
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -0,0 +1,267 @@
1
+ import './css.js'
2
+ import { defineComponent, shallowRef, computed, ref, watch, onMounted, nextTick, createElementBlock, openBlock, normalizeClass, createElementVNode, unref, withModifiers, normalizeStyle, createCommentVNode, createVNode, renderSlot, toDisplayString } from "vue";
3
+ import { u as useResizeObserver } from "../share/hook/use-resize-observer.js";
4
+ import { d as draw } from "./draw.js";
5
+ import { g as getGlobalThemeColor } from "../share/util/color.js";
6
+ import { u as useDarkMode } from "../share/hook/use-dark-mode.js";
7
+ import { u as useComposition } from "../share/hook/use-composition.js";
8
+ import { T as TimesCircleSolid, S as SpinnerThirdSolid } from "../auto-complete/index.js";
9
+ import { a as Ne, N } from "../aside/index.js";
10
+ import { u as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
11
+ import { u as useTextareaHeight } from "../share/hook/use-textarea-height.js";
12
+ import { a as canvasPreprocess, c as calcPixelSize } from "../share/util/plot.js";
13
+ import { u as useControlledMode } from "../share/hook/use-controlled-mode.js";
14
+ const _hoisted_1 = ["value", "placeholder", "disabled", "autofocus", "rows"];
15
+ const _hoisted_2 = { class: "px-textarea-addition-wrapper" };
16
+ const _hoisted_3 = {
17
+ key: 0,
18
+ class: "px-textarea-close-wrapper"
19
+ };
20
+ const _hoisted_4 = {
21
+ key: 1,
22
+ class: "px-textarea-count-wrapper"
23
+ };
24
+ const _hoisted_5 = {
25
+ key: 2,
26
+ class: "px-textarea-loading-wrapper"
27
+ };
28
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29
+ ...{
30
+ name: "Textarea"
31
+ },
32
+ __name: "index",
33
+ props: {
34
+ modelValue: null,
35
+ defaultValue: null,
36
+ rows: null,
37
+ minRows: { default: 1 },
38
+ maxRows: { default: Infinity },
39
+ autoResize: { type: Boolean, default: false },
40
+ resize: { type: Boolean, default: true },
41
+ placeholder: null,
42
+ disabled: { type: Boolean, default: false },
43
+ readonly: { type: Boolean, default: false },
44
+ clearable: { type: Boolean, default: false },
45
+ loading: { type: Boolean, default: false },
46
+ size: { default: "medium" },
47
+ maxLength: null,
48
+ showCount: { type: Boolean, default: false },
49
+ countGraphemes: { type: Function },
50
+ sliceGraphemes: { type: Function },
51
+ status: { default: "normal" },
52
+ autofocus: { type: Boolean }
53
+ },
54
+ emits: ["input", "update:modelValue", "change", "clear", "blur", "focus"],
55
+ setup(__props, { expose: __expose, emit: __emit }) {
56
+ const props = __props;
57
+ const emits = __emit;
58
+ const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({
59
+ afterComposition: (e) => {
60
+ nextTick(() => {
61
+ inputHandler(e);
62
+ });
63
+ }
64
+ });
65
+ const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
66
+ defaultField: "defaultValue",
67
+ transform: (e) => {
68
+ return e || "";
69
+ }
70
+ });
71
+ const wrapperRef = shallowRef(null);
72
+ const canvasRef = shallowRef(null);
73
+ const inputRef = shallowRef(null);
74
+ const [height, minHeight, maxHeight, refreshHeight] = useTextareaHeight(inputRef, props);
75
+ const currentLength = computed(() => {
76
+ return modelValue.value ? props.countGraphemes ? props.countGraphemes(modelValue.value) : modelValue.value.length : 0;
77
+ });
78
+ const inputHandler = async (e) => {
79
+ const target = e.target;
80
+ let newValue = target.value;
81
+ modelValue.value = newValue;
82
+ if (isComposing.value) {
83
+ return;
84
+ }
85
+ if (props.maxLength) {
86
+ if (props.countGraphemes && props.sliceGraphemes) {
87
+ await nextTick();
88
+ newValue = props.sliceGraphemes(newValue, props.maxLength);
89
+ } else {
90
+ newValue = newValue.slice(0, props.maxLength);
91
+ }
92
+ }
93
+ modelValue.value = newValue;
94
+ emits("input", newValue, e);
95
+ updateModelValue(newValue);
96
+ };
97
+ const clearHandler = async () => {
98
+ await updateModelValue("");
99
+ emits("change", "");
100
+ emits("clear", "");
101
+ };
102
+ const changeHandler = (e) => {
103
+ const target = e.target;
104
+ refreshHeight();
105
+ emits("change", target.value, e);
106
+ };
107
+ const focusMode = ref(false);
108
+ const setHeight = () => {
109
+ if (props.autoResize && inputRef.value && height.value) {
110
+ inputRef.value.style.height = height.value + "px";
111
+ }
112
+ };
113
+ watch(height, () => {
114
+ setHeight();
115
+ });
116
+ const blurHandler = () => {
117
+ setHeight();
118
+ focusMode.value = false;
119
+ };
120
+ const focusHandler = () => {
121
+ setHeight();
122
+ focusMode.value = true;
123
+ };
124
+ const showClose = computed(() => {
125
+ return props.clearable && focusMode.value && !props.disabled && !props.readonly && !!modelValue.value;
126
+ });
127
+ const focusInputHandler = () => {
128
+ var _a;
129
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
130
+ };
131
+ const hoverFlag = ref(false);
132
+ const mouseenterHandler = () => {
133
+ hoverFlag.value = true;
134
+ };
135
+ const mouseleaveHandler = () => {
136
+ hoverFlag.value = false;
137
+ };
138
+ __expose({
139
+ focus: () => {
140
+ var _a;
141
+ (_a = inputRef.value) == null ? void 0 : _a.focus();
142
+ },
143
+ blur: () => {
144
+ var _a;
145
+ (_a = inputRef.value) == null ? void 0 : _a.blur();
146
+ },
147
+ clear: () => clearHandler(),
148
+ select: () => {
149
+ var _a;
150
+ (_a = inputRef.value) == null ? void 0 : _a.select();
151
+ }
152
+ });
153
+ const darkMode = useDarkMode();
154
+ watch([() => props.size, () => props.disabled, darkMode, hoverFlag, focusMode], () => {
155
+ setTimeout(() => {
156
+ drawPixelDebounce();
157
+ });
158
+ });
159
+ const drawPixel = () => {
160
+ const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
161
+ if (!preprocessData) {
162
+ return;
163
+ }
164
+ const { ctx, width, height: height2 } = preprocessData;
165
+ const pixelSize = calcPixelSize();
166
+ const borderColor = props.status !== "normal" ? getGlobalThemeColor(props.status === "error" ? "danger" : props.status, 6) : (hoverFlag.value || focusMode.value) && !props.disabled && !props.readonly ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
167
+ const backgroundColor = props.disabled ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
168
+ draw(ctx, width, height2, borderColor, backgroundColor, pixelSize);
169
+ };
170
+ const drawPixelDebounce = Ne(drawPixel, 0, {
171
+ maxWait: 50
172
+ });
173
+ onMounted(() => {
174
+ nextTick(() => {
175
+ drawPixel();
176
+ });
177
+ setTimeout(() => {
178
+ setHeight();
179
+ });
180
+ });
181
+ useResizeObserver(wrapperRef, drawPixelDebounce);
182
+ useWatchGlobalCssVal(drawPixelDebounce);
183
+ return (_ctx, _cache) => {
184
+ return openBlock(), createElementBlock(
185
+ "div",
186
+ {
187
+ class: normalizeClass(["pixelium px-textarea", {
188
+ [`px-textarea__${props.size}`]: !!props.size,
189
+ "px-textarea__disabled": !!props.disabled,
190
+ "px-textarea__resize": !!props.resize
191
+ }]),
192
+ ref_key: "wrapperRef",
193
+ ref: wrapperRef,
194
+ onClick: focusInputHandler,
195
+ onMouseenter: mouseenterHandler,
196
+ onMouseleave: mouseleaveHandler
197
+ },
198
+ [
199
+ createElementVNode("textarea", {
200
+ class: "px-textarea-inner",
201
+ value: unref(modelValue),
202
+ ref_key: "inputRef",
203
+ ref: inputRef,
204
+ placeholder: props.placeholder,
205
+ disabled: props.disabled || props.readonly,
206
+ autofocus: __props.autofocus,
207
+ rows: props.rows,
208
+ style: normalizeStyle({
209
+ minHeight: unref(minHeight) ? unref(minHeight) + "px" : void 0,
210
+ maxHeight: unref(maxHeight) ? unref(maxHeight) + "px" : void 0
211
+ }),
212
+ onInput: withModifiers(inputHandler, ["stop"]),
213
+ onChange: withModifiers(changeHandler, ["stop"]),
214
+ onBlur: blurHandler,
215
+ onFocus: focusHandler,
216
+ onCompositionstart: _cache[0] || (_cache[0] = //@ts-ignore
217
+ (...args) => unref(compositionStartHandler) && unref(compositionStartHandler)(...args)),
218
+ onCompositionend: _cache[1] || (_cache[1] = //@ts-ignore
219
+ (...args) => unref(compositionUpdateHandler) && unref(compositionUpdateHandler)(...args))
220
+ }, null, 44, _hoisted_1),
221
+ createElementVNode("div", _hoisted_2, [
222
+ showClose.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
223
+ createVNode(unref(TimesCircleSolid), {
224
+ class: "px-textarea-icon",
225
+ onClick: clearHandler
226
+ })
227
+ ])) : createCommentVNode("v-if", true),
228
+ props.showCount ? (openBlock(), createElementBlock("div", _hoisted_4, [
229
+ renderSlot(_ctx.$slots, "count", {
230
+ value: unref(modelValue),
231
+ count: currentLength.value,
232
+ maxLength: props.maxLength
233
+ }, () => [
234
+ createElementVNode(
235
+ "span",
236
+ null,
237
+ toDisplayString(currentLength.value) + toDisplayString(unref(N)(props.maxLength) ? "" : " / " + props.maxLength),
238
+ 1
239
+ /* TEXT */
240
+ )
241
+ ])
242
+ ])) : createCommentVNode("v-if", true),
243
+ props.loading ? (openBlock(), createElementBlock("div", _hoisted_5, [
244
+ createVNode(unref(SpinnerThirdSolid), { class: "px-textarea-icon px-animation__loading" })
245
+ ])) : createCommentVNode("v-if", true)
246
+ ]),
247
+ createElementVNode(
248
+ "canvas",
249
+ {
250
+ class: "px-textarea-canvas",
251
+ ref_key: "canvasRef",
252
+ ref: canvasRef
253
+ },
254
+ null,
255
+ 512
256
+ /* NEED_PATCH */
257
+ )
258
+ ],
259
+ 34
260
+ /* CLASS, NEED_HYDRATION */
261
+ );
262
+ };
263
+ }
264
+ });
265
+ export {
266
+ _sfc_main as _
267
+ };
@@ -0,0 +1,169 @@
1
+ export type TextareaProps = {
2
+ /**
3
+ * @property {string | null} [modelValue]
4
+ * @version 0.0.2
5
+ */
6
+ modelValue?: string | null;
7
+ /**
8
+ * @property {string | null} [defaultValue]
9
+ * @version 0.0.2
10
+ */
11
+ defaultValue?: string | null;
12
+ /**
13
+ * @property {number} [rows]
14
+ * @version 0.0.2
15
+ */
16
+ rows?: number;
17
+ /**
18
+ * @property {number} [minRows=1]
19
+ * @version 0.0.2
20
+ */
21
+ minRows?: number;
22
+ /**
23
+ * @property {number} [maxRows=Infinity]
24
+ * @version 0.0.2
25
+ */
26
+ maxRows?: number;
27
+ /**
28
+ * @property {boolean} [autoResize=false]
29
+ * @version 0.0.2
30
+ */
31
+ autoResize?: boolean;
32
+ /**
33
+ * @property {boolean} [resize=true]
34
+ * @version 0.0.2
35
+ */
36
+ resize?: boolean;
37
+ /**
38
+ * @property {string} [placeholder]
39
+ * @version 0.0.2
40
+ */
41
+ placeholder?: string;
42
+ /**
43
+ * @property {boolean} [disabled=false]
44
+ * @version 0.0.2
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * @property {boolean} [readonly=false]
49
+ * @version 0.0.2
50
+ */
51
+ readonly?: boolean;
52
+ /**
53
+ * @property {boolean} [clearable=false]
54
+ * @version 0.0.2
55
+ */
56
+ clearable?: boolean;
57
+ /**
58
+ * @property {boolean} [loading=false]
59
+ * @version 0.0.2
60
+ */
61
+ loading?: boolean;
62
+ /**
63
+ * @property {'medium' | 'large' | 'small'} [size='medium']
64
+ * @version 0.0.2
65
+ */
66
+ size?: 'medium' | 'large' | 'small';
67
+ /**
68
+ * @property {number} [maxLength]
69
+ * @version 0.0.2
70
+ */
71
+ maxLength?: number;
72
+ /**
73
+ * @property {boolean} [showCount=false]
74
+ * @version 0.0.2
75
+ */
76
+ showCount?: boolean;
77
+ /**
78
+ * @property {(value: string) => number} [countGraphemes]
79
+ * @version 0.0.2
80
+ */
81
+ countGraphemes?: (value: string) => number;
82
+ /**
83
+ * @property {(value: string, limit: number) => string} [sliceGraphemes]
84
+ * @version 0.0.2
85
+ */
86
+ sliceGraphemes?: (value: string, limit: number) => string;
87
+ /**
88
+ * @property {'success' | 'warning' | 'error' | 'normal'} [status='normal']
89
+ * @version 0.0.2
90
+ */
91
+ status?: 'success' | 'warning' | 'error' | 'normal';
92
+ /**
93
+ * @property {boolean} [autofocus=false]
94
+ * @version 0.0.2
95
+ */
96
+ autofocus?: boolean;
97
+ };
98
+ export type TextareaEvents = {
99
+ /**
100
+ * @event input
101
+ * @param {string} value
102
+ * @param {Event} e
103
+ * @version 0.0.2
104
+ */
105
+ input: [value: string, e: Event];
106
+ /**
107
+ * @event update:modelValue
108
+ * @param {string} value
109
+ * @version 0.0.2
110
+ */
111
+ 'update:modelValue': [value: string];
112
+ /**
113
+ * @event change
114
+ * @param {string} value
115
+ * @param {Event | undefined} e
116
+ * @version 0.0.2
117
+ */
118
+ change: [value: string, e?: Event];
119
+ /**
120
+ * @event clear
121
+ * @param {string} value
122
+ * @version 0.0.2
123
+ */
124
+ clear: [value: string];
125
+ /**
126
+ * @event blur
127
+ * @param {FocusEvent} e
128
+ * @version 0.0.2
129
+ */
130
+ blur: [e: FocusEvent];
131
+ /**
132
+ * @event focus
133
+ * @param {FocusEvent} e
134
+ * @version 0.0.2
135
+ */
136
+ focus: [e: FocusEvent];
137
+ };
138
+ export type TextareaSlots = {
139
+ /**
140
+ * @slot count
141
+ * @param {number} inputValue
142
+ * @param {number} currentLength
143
+ * @param {number} maxLength
144
+ * @version 0.0.2
145
+ */
146
+ count: {};
147
+ };
148
+ export type TextareaExpose = {
149
+ /**
150
+ * @property {() => void} focus
151
+ * @version 0.0.2
152
+ */
153
+ focus: () => void;
154
+ /**
155
+ * @property {() => void} blur
156
+ * @version 0.0.2
157
+ */
158
+ blur: () => void;
159
+ /**
160
+ * @property {() => void} clear
161
+ * @version 0.0.2
162
+ */
163
+ clear: () => void;
164
+ /**
165
+ * @property {() => void} select
166
+ * @version 0.0.2
167
+ */
168
+ select: () => void;
169
+ };
@@ -0,0 +1 @@
1
+ import '../index.css'
@@ -0,0 +1,20 @@
1
+ import type { TooltipProps } from './type';
2
+ declare const _default: import("vue").DefineComponent<TooltipProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ close: (e: MouseEvent) => any;
4
+ open: (e: MouseEvent) => any;
5
+ "update:visible": (value: boolean) => any;
6
+ }, string, import("vue").PublicProps, Readonly<TooltipProps> & Readonly<{
7
+ onClose?: ((e: MouseEvent) => any) | undefined;
8
+ onOpen?: ((e: MouseEvent) => any) | undefined;
9
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
10
+ }>, {
11
+ variant: "dark" | "light";
12
+ placement: "top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end";
13
+ root: HTMLElement | string;
14
+ offset: number;
15
+ visible: boolean | null;
16
+ defaultVisible: boolean | null;
17
+ arrow: boolean;
18
+ trigger: "hover" | "click";
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;