@factoringplus/pl-components-pack-v3 0.1.23 → 0.1.26
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.
- package/README.md +17 -18
- package/dist/CNAME +1 -1
- package/dist/pl-components-pack-v3.es.js +452 -343
- package/dist/pl-components-pack-v3.umd.js +13 -0
- package/dist/style.css +1 -1
- package/package.json +54 -46
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, warn, getCurrentInstance, computed, ref, inject, unref, mergeProps, renderSlot, shallowRef, watch, nextTick, onMounted, onUpdated,
|
|
20
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, warn, getCurrentInstance, computed, ref, inject, unref, mergeProps, renderSlot, useAttrs as useAttrs$1, useSlots, shallowRef, watch, nextTick, onMounted, onUpdated, toRef, withDirectives, normalizeClass, normalizeStyle, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, vShow, Text, provide, reactive, onUnmounted, createTextVNode, resolveComponent } from "vue";
|
|
21
21
|
function fromPairs(pairs) {
|
|
22
22
|
var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
|
|
23
23
|
while (++index < length) {
|
|
@@ -26,6 +26,9 @@ function fromPairs(pairs) {
|
|
|
26
26
|
}
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
|
+
function isNil(value) {
|
|
30
|
+
return value == null;
|
|
31
|
+
}
|
|
29
32
|
const isClient = typeof window !== "undefined";
|
|
30
33
|
const isNumber = (val) => typeof val === "number";
|
|
31
34
|
const NOOP = () => {
|
|
@@ -42,100 +45,88 @@ var _export_sfc$1 = (sfc, props) => {
|
|
|
42
45
|
}
|
|
43
46
|
return target;
|
|
44
47
|
};
|
|
45
|
-
const _sfc_main$
|
|
48
|
+
const _sfc_main$a = defineComponent({
|
|
46
49
|
name: "CircleCheck"
|
|
47
50
|
});
|
|
48
51
|
const _hoisted_1$7 = {
|
|
49
|
-
class: "icon",
|
|
50
|
-
width: "200",
|
|
51
|
-
height: "200",
|
|
52
52
|
viewBox: "0 0 1024 1024",
|
|
53
53
|
xmlns: "http://www.w3.org/2000/svg"
|
|
54
54
|
};
|
|
55
55
|
const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("path", {
|
|
56
56
|
fill: "currentColor",
|
|
57
|
-
d: "M512 896a384 384 0
|
|
57
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
|
|
58
58
|
}, null, -1);
|
|
59
59
|
const _hoisted_3$3 = /* @__PURE__ */ createElementVNode("path", {
|
|
60
60
|
fill: "currentColor",
|
|
61
|
-
d: "M745.344 361.344a32 32 0
|
|
61
|
+
d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
|
|
62
62
|
}, null, -1);
|
|
63
63
|
const _hoisted_4$1 = [
|
|
64
64
|
_hoisted_2$5,
|
|
65
65
|
_hoisted_3$3
|
|
66
66
|
];
|
|
67
|
-
function _sfc_render$
|
|
67
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
68
68
|
return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_4$1);
|
|
69
69
|
}
|
|
70
|
-
var circleCheck = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
71
|
-
const _sfc_main$
|
|
70
|
+
var circleCheck = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$3]]);
|
|
71
|
+
const _sfc_main$9 = defineComponent({
|
|
72
72
|
name: "CircleClose"
|
|
73
73
|
});
|
|
74
74
|
const _hoisted_1$6 = {
|
|
75
|
-
class: "icon",
|
|
76
|
-
width: "200",
|
|
77
|
-
height: "200",
|
|
78
75
|
viewBox: "0 0 1024 1024",
|
|
79
76
|
xmlns: "http://www.w3.org/2000/svg"
|
|
80
77
|
};
|
|
81
78
|
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("path", {
|
|
82
79
|
fill: "currentColor",
|
|
83
|
-
d: "
|
|
80
|
+
d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"
|
|
84
81
|
}, null, -1);
|
|
85
82
|
const _hoisted_3$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
86
83
|
fill: "currentColor",
|
|
87
|
-
d: "M512 896a384 384 0
|
|
84
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
|
|
88
85
|
}, null, -1);
|
|
89
86
|
const _hoisted_4 = [
|
|
90
87
|
_hoisted_2$4,
|
|
91
88
|
_hoisted_3$2
|
|
92
89
|
];
|
|
93
|
-
function _sfc_render$
|
|
90
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
94
91
|
return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_4);
|
|
95
92
|
}
|
|
96
|
-
var circleClose = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
97
|
-
const _sfc_main$
|
|
93
|
+
var circleClose = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$2]]);
|
|
94
|
+
const _sfc_main$8 = defineComponent({
|
|
98
95
|
name: "Loading"
|
|
99
96
|
});
|
|
100
97
|
const _hoisted_1$5 = {
|
|
101
|
-
class: "icon",
|
|
102
|
-
width: "200",
|
|
103
|
-
height: "200",
|
|
104
98
|
viewBox: "0 0 1024 1024",
|
|
105
99
|
xmlns: "http://www.w3.org/2000/svg"
|
|
106
100
|
};
|
|
107
101
|
const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("path", {
|
|
108
102
|
fill: "currentColor",
|
|
109
|
-
d: "M512 64a32 32 0
|
|
103
|
+
d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
|
|
110
104
|
}, null, -1);
|
|
111
105
|
const _hoisted_3$1 = [
|
|
112
106
|
_hoisted_2$3
|
|
113
107
|
];
|
|
114
|
-
function _sfc_render$
|
|
108
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
115
109
|
return openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$1);
|
|
116
110
|
}
|
|
117
|
-
var loading = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
118
|
-
const _sfc_main$
|
|
111
|
+
var loading = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$1]]);
|
|
112
|
+
const _sfc_main$7 = defineComponent({
|
|
119
113
|
name: "View"
|
|
120
114
|
});
|
|
121
115
|
const _hoisted_1$4 = {
|
|
122
|
-
class: "icon",
|
|
123
|
-
width: "200",
|
|
124
|
-
height: "200",
|
|
125
116
|
viewBox: "0 0 1024 1024",
|
|
126
117
|
xmlns: "http://www.w3.org/2000/svg"
|
|
127
118
|
};
|
|
128
119
|
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("path", {
|
|
129
120
|
fill: "currentColor",
|
|
130
|
-
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0
|
|
121
|
+
d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
|
|
131
122
|
}, null, -1);
|
|
132
123
|
const _hoisted_3 = [
|
|
133
124
|
_hoisted_2$2
|
|
134
125
|
];
|
|
135
|
-
function _sfc_render
|
|
126
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
136
127
|
return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3);
|
|
137
128
|
}
|
|
138
|
-
var view = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
129
|
+
var view = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render]]);
|
|
139
130
|
const wrapperKey = Symbol();
|
|
140
131
|
const propKey = "__elPropsReservedKey";
|
|
141
132
|
function buildProp(option, key) {
|
|
@@ -202,6 +193,8 @@ const withNoopInstall = (component) => {
|
|
|
202
193
|
component.install = NOOP;
|
|
203
194
|
return component;
|
|
204
195
|
};
|
|
196
|
+
function debugWarn(scope, message) {
|
|
197
|
+
}
|
|
205
198
|
function addUnit(value, defaultUnit = "px") {
|
|
206
199
|
if (!value)
|
|
207
200
|
return "";
|
|
@@ -229,10 +222,10 @@ const useAttrs = (params = {}) => {
|
|
|
229
222
|
return fromPairs(Object.entries((_a = instance.proxy) == null ? void 0 : _a.$attrs).filter(([key]) => !allExcludeKeys.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
|
|
230
223
|
});
|
|
231
224
|
};
|
|
232
|
-
const elFormKey = Symbol("elForm");
|
|
233
|
-
const elFormItemKey = Symbol("elFormItem");
|
|
234
225
|
const buttonGroupContextKey = Symbol("buttonGroupContextKey");
|
|
235
226
|
const configProviderContextKey = Symbol();
|
|
227
|
+
const formContextKey = Symbol("formContextKey");
|
|
228
|
+
const formItemContextKey = Symbol("formItemContextKey");
|
|
236
229
|
const useProp = (name) => {
|
|
237
230
|
const vm = getCurrentInstance();
|
|
238
231
|
return computed(() => {
|
|
@@ -261,18 +254,18 @@ const useSize = (fallback, ignore = {}) => {
|
|
|
261
254
|
const emptyRef = ref(void 0);
|
|
262
255
|
const size = ignore.prop ? emptyRef : useProp("size");
|
|
263
256
|
const globalConfig2 = ignore.global ? emptyRef : useGlobalConfig("size");
|
|
264
|
-
const form = ignore.form ? { size: void 0 } : inject(
|
|
265
|
-
const formItem = ignore.formItem ? { size: void 0 } : inject(
|
|
257
|
+
const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
|
|
258
|
+
const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
|
|
266
259
|
return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "default");
|
|
267
260
|
};
|
|
268
261
|
const useDisabled = (fallback) => {
|
|
269
262
|
const disabled = useProp("disabled");
|
|
270
|
-
const form = inject(
|
|
263
|
+
const form = inject(formContextKey, void 0);
|
|
271
264
|
return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
|
|
272
265
|
};
|
|
273
266
|
const useFormItem = () => {
|
|
274
|
-
const form = inject(
|
|
275
|
-
const formItem = inject(
|
|
267
|
+
const form = inject(formContextKey, void 0);
|
|
268
|
+
const formItem = inject(formItemContextKey, void 0);
|
|
276
269
|
return {
|
|
277
270
|
form,
|
|
278
271
|
formItem
|
|
@@ -327,11 +320,11 @@ const iconProps = buildProps({
|
|
|
327
320
|
type: String
|
|
328
321
|
}
|
|
329
322
|
});
|
|
330
|
-
const __default__$
|
|
323
|
+
const __default__$5 = {
|
|
331
324
|
name: "ElIcon",
|
|
332
325
|
inheritAttrs: false
|
|
333
326
|
};
|
|
334
|
-
const _sfc_main$
|
|
327
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$5), {
|
|
335
328
|
props: iconProps,
|
|
336
329
|
setup(__props) {
|
|
337
330
|
const props = __props;
|
|
@@ -354,7 +347,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
354
347
|
};
|
|
355
348
|
}
|
|
356
349
|
}));
|
|
357
|
-
const ElIcon = withInstall(_sfc_main$
|
|
350
|
+
const ElIcon = withInstall(_sfc_main$6);
|
|
358
351
|
let hiddenTextarea = void 0;
|
|
359
352
|
const HIDDEN_STYLE = `
|
|
360
353
|
height:0 !important;
|
|
@@ -385,8 +378,8 @@ const CONTEXT_STYLE = [
|
|
|
385
378
|
function calculateNodeStyling(targetElement) {
|
|
386
379
|
const style = window.getComputedStyle(targetElement);
|
|
387
380
|
const boxSizing = style.getPropertyValue("box-sizing");
|
|
388
|
-
const paddingSize = parseFloat(style.getPropertyValue("padding-bottom")) + parseFloat(style.getPropertyValue("padding-top"));
|
|
389
|
-
const borderSize = parseFloat(style.getPropertyValue("border-bottom-width")) + parseFloat(style.getPropertyValue("border-top-width"));
|
|
381
|
+
const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
|
|
382
|
+
const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
|
|
390
383
|
const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";");
|
|
391
384
|
return { contextStyle, paddingSize, borderSize, boxSizing };
|
|
392
385
|
}
|
|
@@ -432,7 +425,11 @@ const inputProps = buildProps({
|
|
|
432
425
|
size: useSizeProp,
|
|
433
426
|
disabled: Boolean,
|
|
434
427
|
modelValue: {
|
|
435
|
-
type: definePropType(
|
|
428
|
+
type: definePropType([
|
|
429
|
+
String,
|
|
430
|
+
Number,
|
|
431
|
+
Object
|
|
432
|
+
]),
|
|
436
433
|
default: ""
|
|
437
434
|
},
|
|
438
435
|
type: {
|
|
@@ -511,57 +508,60 @@ const inputEmits = {
|
|
|
511
508
|
compositionupdate: (evt) => evt instanceof CompositionEvent,
|
|
512
509
|
compositionend: (evt) => evt instanceof CompositionEvent
|
|
513
510
|
};
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
target[key] = val;
|
|
518
|
-
}
|
|
519
|
-
return target;
|
|
520
|
-
};
|
|
521
|
-
const PENDANT_MAP = {
|
|
522
|
-
suffix: "append",
|
|
523
|
-
prefix: "prepend"
|
|
524
|
-
};
|
|
525
|
-
const _sfc_main$4 = defineComponent({
|
|
511
|
+
const _hoisted_1$3 = ["type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder"];
|
|
512
|
+
const _hoisted_2$1 = ["tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder"];
|
|
513
|
+
const __default__$4 = {
|
|
526
514
|
name: "ElInput",
|
|
527
|
-
|
|
528
|
-
|
|
515
|
+
inheritAttrs: false
|
|
516
|
+
};
|
|
517
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
529
518
|
props: inputProps,
|
|
530
519
|
emits: inputEmits,
|
|
531
|
-
setup(
|
|
520
|
+
setup(__props, { expose, emit }) {
|
|
521
|
+
const props = __props;
|
|
522
|
+
const PENDANT_MAP = {
|
|
523
|
+
suffix: "append",
|
|
524
|
+
prefix: "prepend"
|
|
525
|
+
};
|
|
532
526
|
const instance = getCurrentInstance();
|
|
527
|
+
const rawAttrs = useAttrs$1();
|
|
528
|
+
const slots = useSlots();
|
|
533
529
|
const attrs = useAttrs();
|
|
534
530
|
const { form, formItem } = useFormItem();
|
|
535
531
|
const inputSize = useSize();
|
|
536
532
|
const inputDisabled = useDisabled();
|
|
537
533
|
const nsInput = useNamespace("input");
|
|
538
534
|
const nsTextarea = useNamespace("textarea");
|
|
539
|
-
const input2 =
|
|
540
|
-
const textarea =
|
|
535
|
+
const input2 = shallowRef();
|
|
536
|
+
const textarea = shallowRef();
|
|
541
537
|
const focused = ref(false);
|
|
542
538
|
const hovering = ref(false);
|
|
543
539
|
const isComposing = ref(false);
|
|
544
540
|
const passwordVisible = ref(false);
|
|
545
|
-
const
|
|
546
|
-
const
|
|
541
|
+
const textareaCalcStyle = shallowRef(props.inputStyle);
|
|
542
|
+
const _ref = computed(() => input2.value || textarea.value);
|
|
547
543
|
const needStatusIcon = computed(() => {
|
|
548
544
|
var _a;
|
|
549
545
|
return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
|
|
550
546
|
});
|
|
551
547
|
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
|
|
552
548
|
const validateIcon = computed(() => ValidateComponentsMap[validateState.value]);
|
|
553
|
-
const containerStyle = computed(() =>
|
|
554
|
-
|
|
549
|
+
const containerStyle = computed(() => [
|
|
550
|
+
rawAttrs.style,
|
|
551
|
+
props.inputStyle
|
|
552
|
+
]);
|
|
553
|
+
const textareaStyle = computed(() => [
|
|
555
554
|
props.inputStyle,
|
|
556
|
-
|
|
555
|
+
textareaCalcStyle.value,
|
|
557
556
|
{ resize: props.resize }
|
|
558
557
|
]);
|
|
559
|
-
const nativeInputValue = computed(() => props.modelValue
|
|
558
|
+
const nativeInputValue = computed(() => isNil(props.modelValue) ? "" : String(props.modelValue));
|
|
560
559
|
const showClear = computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
|
|
561
560
|
const showPwdVisible = computed(() => props.showPassword && !inputDisabled.value && !props.readonly && (!!nativeInputValue.value || focused.value));
|
|
562
561
|
const isWordLimitVisible = computed(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
|
|
563
562
|
const textLength = computed(() => Array.from(nativeInputValue.value).length);
|
|
564
563
|
const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
|
|
564
|
+
const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
|
|
565
565
|
const resizeTextarea = () => {
|
|
566
566
|
const { type, autosize } = props;
|
|
567
567
|
if (!isClient || type !== "textarea")
|
|
@@ -569,15 +569,15 @@ const _sfc_main$4 = defineComponent({
|
|
|
569
569
|
if (autosize) {
|
|
570
570
|
const minRows = isObject(autosize) ? autosize.minRows : void 0;
|
|
571
571
|
const maxRows = isObject(autosize) ? autosize.maxRows : void 0;
|
|
572
|
-
|
|
572
|
+
textareaCalcStyle.value = __spreadValues({}, calcTextareaHeight(textarea.value, minRows, maxRows));
|
|
573
573
|
} else {
|
|
574
|
-
|
|
574
|
+
textareaCalcStyle.value = {
|
|
575
575
|
minHeight: calcTextareaHeight(textarea.value).minHeight
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
579
|
const setNativeInputValue = () => {
|
|
580
|
-
const input22 =
|
|
580
|
+
const input22 = _ref.value;
|
|
581
581
|
if (!input22 || input22.value === nativeInputValue.value)
|
|
582
582
|
return;
|
|
583
583
|
input22.value = nativeInputValue.value;
|
|
@@ -601,7 +601,7 @@ const _sfc_main$4 = defineComponent({
|
|
|
601
601
|
calcIconOffset("prefix");
|
|
602
602
|
calcIconOffset("suffix");
|
|
603
603
|
};
|
|
604
|
-
const handleInput = (event) => {
|
|
604
|
+
const handleInput = async (event) => {
|
|
605
605
|
const { value } = event.target;
|
|
606
606
|
if (isComposing.value)
|
|
607
607
|
return;
|
|
@@ -609,20 +609,42 @@ const _sfc_main$4 = defineComponent({
|
|
|
609
609
|
return;
|
|
610
610
|
emit(UPDATE_MODEL_EVENT, value);
|
|
611
611
|
emit("input", value);
|
|
612
|
-
nextTick(
|
|
612
|
+
await nextTick();
|
|
613
|
+
setNativeInputValue();
|
|
613
614
|
};
|
|
614
615
|
const handleChange = (event) => {
|
|
615
616
|
emit("change", event.target.value);
|
|
616
617
|
};
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
618
|
+
const handleCompositionStart = (event) => {
|
|
619
|
+
emit("compositionstart", event);
|
|
620
|
+
isComposing.value = true;
|
|
621
|
+
};
|
|
622
|
+
const handleCompositionUpdate = (event) => {
|
|
623
|
+
var _a;
|
|
624
|
+
emit("compositionupdate", event);
|
|
625
|
+
const text = (_a = event.target) == null ? void 0 : _a.value;
|
|
626
|
+
const lastCharacter = text[text.length - 1] || "";
|
|
627
|
+
isComposing.value = !isKorean(lastCharacter);
|
|
628
|
+
};
|
|
629
|
+
const handleCompositionEnd = (event) => {
|
|
630
|
+
emit("compositionend", event);
|
|
631
|
+
if (isComposing.value) {
|
|
632
|
+
isComposing.value = false;
|
|
633
|
+
handleInput(event);
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
const handlePasswordVisible = () => {
|
|
637
|
+
passwordVisible.value = !passwordVisible.value;
|
|
638
|
+
focus();
|
|
639
|
+
};
|
|
640
|
+
const focus = async () => {
|
|
641
|
+
var _a;
|
|
642
|
+
await nextTick();
|
|
643
|
+
(_a = _ref.value) == null ? void 0 : _a.focus();
|
|
622
644
|
};
|
|
623
645
|
const blur = () => {
|
|
624
646
|
var _a;
|
|
625
|
-
(_a =
|
|
647
|
+
return (_a = _ref.value) == null ? void 0 : _a.blur();
|
|
626
648
|
};
|
|
627
649
|
const handleFocus = (event) => {
|
|
628
650
|
focused.value = true;
|
|
@@ -633,30 +655,23 @@ const _sfc_main$4 = defineComponent({
|
|
|
633
655
|
focused.value = false;
|
|
634
656
|
emit("blur", event);
|
|
635
657
|
if (props.validateEvent) {
|
|
636
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur");
|
|
658
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn());
|
|
637
659
|
}
|
|
638
660
|
};
|
|
639
|
-
const
|
|
640
|
-
|
|
641
|
-
(
|
|
661
|
+
const handleMouseLeave = (evt) => {
|
|
662
|
+
hovering.value = false;
|
|
663
|
+
emit("mouseleave", evt);
|
|
642
664
|
};
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
|
|
665
|
+
const handleMouseEnter = (evt) => {
|
|
666
|
+
hovering.value = true;
|
|
667
|
+
emit("mouseenter", evt);
|
|
646
668
|
};
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
emit("compositionupdate", event);
|
|
650
|
-
const text = (_a = event.target) == null ? void 0 : _a.value;
|
|
651
|
-
const lastCharacter = text[text.length - 1] || "";
|
|
652
|
-
isComposing.value = !isKorean(lastCharacter);
|
|
669
|
+
const handleKeydown = (evt) => {
|
|
670
|
+
emit("keydown", evt);
|
|
653
671
|
};
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
isComposing.value = false;
|
|
658
|
-
handleInput(event);
|
|
659
|
-
}
|
|
672
|
+
const select = () => {
|
|
673
|
+
var _a;
|
|
674
|
+
(_a = _ref.value) == null ? void 0 : _a.select();
|
|
660
675
|
};
|
|
661
676
|
const clear = () => {
|
|
662
677
|
emit(UPDATE_MODEL_EVENT, "");
|
|
@@ -664,263 +679,221 @@ const _sfc_main$4 = defineComponent({
|
|
|
664
679
|
emit("clear");
|
|
665
680
|
emit("input", "");
|
|
666
681
|
};
|
|
667
|
-
const handlePasswordVisible = () => {
|
|
668
|
-
passwordVisible.value = !passwordVisible.value;
|
|
669
|
-
focus();
|
|
670
|
-
};
|
|
671
|
-
const suffixVisible = computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
|
|
672
682
|
watch(() => props.modelValue, () => {
|
|
673
683
|
var _a;
|
|
674
|
-
nextTick(resizeTextarea);
|
|
684
|
+
nextTick(() => resizeTextarea());
|
|
675
685
|
if (props.validateEvent) {
|
|
676
|
-
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change");
|
|
686
|
+
(_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn());
|
|
677
687
|
}
|
|
678
688
|
});
|
|
679
689
|
watch(nativeInputValue, () => setNativeInputValue());
|
|
680
|
-
watch(() => props.type, () => {
|
|
681
|
-
nextTick(
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
});
|
|
690
|
+
watch(() => props.type, async () => {
|
|
691
|
+
await nextTick();
|
|
692
|
+
setNativeInputValue();
|
|
693
|
+
resizeTextarea();
|
|
694
|
+
updateIconOffset();
|
|
686
695
|
});
|
|
687
|
-
onMounted(() => {
|
|
696
|
+
onMounted(async () => {
|
|
688
697
|
setNativeInputValue();
|
|
689
698
|
updateIconOffset();
|
|
690
|
-
nextTick(
|
|
699
|
+
await nextTick();
|
|
700
|
+
resizeTextarea();
|
|
691
701
|
});
|
|
692
|
-
onUpdated(() => {
|
|
693
|
-
nextTick(
|
|
702
|
+
onUpdated(async () => {
|
|
703
|
+
await nextTick();
|
|
704
|
+
updateIconOffset();
|
|
694
705
|
});
|
|
695
|
-
|
|
696
|
-
hovering.value = false;
|
|
697
|
-
emit("mouseleave", evt);
|
|
698
|
-
};
|
|
699
|
-
const onMouseEnter = (evt) => {
|
|
700
|
-
hovering.value = true;
|
|
701
|
-
emit("mouseenter", evt);
|
|
702
|
-
};
|
|
703
|
-
const handleKeydown = (evt) => {
|
|
704
|
-
emit("keydown", evt);
|
|
705
|
-
};
|
|
706
|
-
return {
|
|
706
|
+
expose({
|
|
707
707
|
input: input2,
|
|
708
708
|
textarea,
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
validateIcon,
|
|
713
|
-
containerStyle,
|
|
714
|
-
computedTextareaStyle,
|
|
715
|
-
inputDisabled,
|
|
716
|
-
showClear,
|
|
717
|
-
showPwdVisible,
|
|
718
|
-
isWordLimitVisible,
|
|
719
|
-
textLength,
|
|
720
|
-
hovering,
|
|
721
|
-
inputExceed,
|
|
722
|
-
passwordVisible,
|
|
723
|
-
inputOrTextarea,
|
|
724
|
-
suffixVisible,
|
|
725
|
-
needStatusIcon,
|
|
726
|
-
resizeTextarea,
|
|
727
|
-
handleInput,
|
|
728
|
-
handleChange,
|
|
729
|
-
handleFocus,
|
|
730
|
-
handleBlur,
|
|
731
|
-
handleCompositionStart,
|
|
732
|
-
handleCompositionUpdate,
|
|
733
|
-
handleCompositionEnd,
|
|
734
|
-
handlePasswordVisible,
|
|
735
|
-
clear,
|
|
736
|
-
select,
|
|
709
|
+
ref: _ref,
|
|
710
|
+
textareaStyle,
|
|
711
|
+
autosize: toRef(props, "autosize"),
|
|
737
712
|
focus,
|
|
738
713
|
blur,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
[_ctx.nsInput.m("prefix")]: _ctx.$slots.prefix || _ctx.prefixIcon,
|
|
764
|
-
[_ctx.nsInput.m("suffix")]: _ctx.$slots.suffix || _ctx.suffixIcon || _ctx.clearable || _ctx.showPassword,
|
|
765
|
-
[_ctx.nsInput.m("suffix--password-clear")]: _ctx.showClear && _ctx.showPwdVisible
|
|
766
|
-
},
|
|
767
|
-
_ctx.$attrs.class
|
|
768
|
-
]),
|
|
769
|
-
style: normalizeStyle(_ctx.containerStyle),
|
|
770
|
-
onMouseenter: _cache[17] || (_cache[17] = (...args) => _ctx.onMouseEnter && _ctx.onMouseEnter(...args)),
|
|
771
|
-
onMouseleave: _cache[18] || (_cache[18] = (...args) => _ctx.onMouseLeave && _ctx.onMouseLeave(...args))
|
|
772
|
-
}, [
|
|
773
|
-
createCommentVNode(" input "),
|
|
774
|
-
_ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
775
|
-
createCommentVNode(" prepend slot "),
|
|
776
|
-
_ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
|
|
777
|
-
key: 0,
|
|
778
|
-
class: normalizeClass(_ctx.nsInput.be("group", "prepend"))
|
|
779
|
-
}, [
|
|
780
|
-
renderSlot(_ctx.$slots, "prepend")
|
|
781
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
782
|
-
createElementVNode("input", mergeProps({
|
|
783
|
-
ref: "input",
|
|
784
|
-
class: _ctx.nsInput.e("inner")
|
|
785
|
-
}, _ctx.attrs, {
|
|
786
|
-
type: _ctx.showPassword ? _ctx.passwordVisible ? "text" : "password" : _ctx.type,
|
|
787
|
-
disabled: _ctx.inputDisabled,
|
|
788
|
-
readonly: _ctx.readonly,
|
|
789
|
-
autocomplete: _ctx.autocomplete,
|
|
790
|
-
tabindex: _ctx.tabindex,
|
|
791
|
-
"aria-label": _ctx.label,
|
|
792
|
-
placeholder: _ctx.placeholder,
|
|
793
|
-
style: _ctx.inputStyle,
|
|
794
|
-
onCompositionstart: _cache[0] || (_cache[0] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
|
|
795
|
-
onCompositionupdate: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
|
|
796
|
-
onCompositionend: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
|
|
797
|
-
onInput: _cache[3] || (_cache[3] = (...args) => _ctx.handleInput && _ctx.handleInput(...args)),
|
|
798
|
-
onFocus: _cache[4] || (_cache[4] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
|
|
799
|
-
onBlur: _cache[5] || (_cache[5] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
|
|
800
|
-
onChange: _cache[6] || (_cache[6] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
801
|
-
onKeydown: _cache[7] || (_cache[7] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
|
|
802
|
-
}), null, 16, _hoisted_1$3),
|
|
803
|
-
createCommentVNode(" prefix slot "),
|
|
804
|
-
_ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
|
|
805
|
-
key: 1,
|
|
806
|
-
class: normalizeClass(_ctx.nsInput.e("prefix"))
|
|
714
|
+
select,
|
|
715
|
+
clear,
|
|
716
|
+
resizeTextarea
|
|
717
|
+
});
|
|
718
|
+
return (_ctx, _cache) => {
|
|
719
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
720
|
+
class: normalizeClass([
|
|
721
|
+
_ctx.type === "textarea" ? unref(nsTextarea).b() : unref(nsInput).b(),
|
|
722
|
+
unref(nsInput).m(unref(inputSize)),
|
|
723
|
+
unref(nsInput).is("disabled", unref(inputDisabled)),
|
|
724
|
+
unref(nsInput).is("exceed", unref(inputExceed)),
|
|
725
|
+
{
|
|
726
|
+
[unref(nsInput).b("group")]: _ctx.$slots.prepend || _ctx.$slots.append,
|
|
727
|
+
[unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
|
|
728
|
+
[unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend,
|
|
729
|
+
[unref(nsInput).m("prefix")]: _ctx.$slots.prefix || _ctx.prefixIcon,
|
|
730
|
+
[unref(nsInput).m("suffix")]: _ctx.$slots.suffix || _ctx.suffixIcon || _ctx.clearable || _ctx.showPassword,
|
|
731
|
+
[unref(nsInput).m("suffix--password-clear")]: unref(showClear) && unref(showPwdVisible)
|
|
732
|
+
},
|
|
733
|
+
_ctx.$attrs.class
|
|
734
|
+
]),
|
|
735
|
+
style: normalizeStyle(unref(containerStyle)),
|
|
736
|
+
onMouseenter: handleMouseEnter,
|
|
737
|
+
onMouseleave: handleMouseLeave
|
|
807
738
|
}, [
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
_ctx.prefixIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
739
|
+
createCommentVNode(" input "),
|
|
740
|
+
_ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
741
|
+
createCommentVNode(" prepend slot "),
|
|
742
|
+
_ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
|
|
813
743
|
key: 0,
|
|
814
|
-
class: normalizeClass(
|
|
815
|
-
},
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
744
|
+
class: normalizeClass(unref(nsInput).be("group", "prepend"))
|
|
745
|
+
}, [
|
|
746
|
+
renderSlot(_ctx.$slots, "prepend")
|
|
747
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
748
|
+
createElementVNode("input", mergeProps({
|
|
749
|
+
ref_key: "input",
|
|
750
|
+
ref: input2,
|
|
751
|
+
class: unref(nsInput).e("inner")
|
|
752
|
+
}, unref(attrs), {
|
|
753
|
+
type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
|
|
754
|
+
disabled: unref(inputDisabled),
|
|
755
|
+
readonly: _ctx.readonly,
|
|
756
|
+
autocomplete: _ctx.autocomplete,
|
|
757
|
+
tabindex: _ctx.tabindex,
|
|
758
|
+
"aria-label": _ctx.label,
|
|
759
|
+
placeholder: _ctx.placeholder,
|
|
760
|
+
style: _ctx.inputStyle,
|
|
761
|
+
onCompositionstart: handleCompositionStart,
|
|
762
|
+
onCompositionupdate: handleCompositionUpdate,
|
|
763
|
+
onCompositionend: handleCompositionEnd,
|
|
764
|
+
onInput: handleInput,
|
|
765
|
+
onFocus: handleFocus,
|
|
766
|
+
onBlur: handleBlur,
|
|
767
|
+
onChange: handleChange,
|
|
768
|
+
onKeydown: handleKeydown
|
|
769
|
+
}), null, 16, _hoisted_1$3),
|
|
770
|
+
createCommentVNode(" prefix slot "),
|
|
771
|
+
_ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
|
|
772
|
+
key: 1,
|
|
773
|
+
class: normalizeClass(unref(nsInput).e("prefix"))
|
|
774
|
+
}, [
|
|
775
|
+
createElementVNode("span", {
|
|
776
|
+
class: normalizeClass(unref(nsInput).e("prefix-inner"))
|
|
777
|
+
}, [
|
|
778
|
+
renderSlot(_ctx.$slots, "prefix"),
|
|
779
|
+
_ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
780
|
+
key: 0,
|
|
781
|
+
class: normalizeClass(unref(nsInput).e("icon"))
|
|
782
|
+
}, {
|
|
783
|
+
default: withCtx(() => [
|
|
784
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
|
|
785
|
+
]),
|
|
786
|
+
_: 1
|
|
787
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
788
|
+
], 2)
|
|
789
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
790
|
+
createCommentVNode(" suffix slot "),
|
|
791
|
+
unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
|
|
792
|
+
key: 2,
|
|
793
|
+
class: normalizeClass(unref(nsInput).e("suffix"))
|
|
794
|
+
}, [
|
|
795
|
+
createElementVNode("span", {
|
|
796
|
+
class: normalizeClass(unref(nsInput).e("suffix-inner"))
|
|
797
|
+
}, [
|
|
798
|
+
!unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
799
|
+
renderSlot(_ctx.$slots, "suffix"),
|
|
800
|
+
_ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
|
|
801
|
+
key: 0,
|
|
802
|
+
class: normalizeClass(unref(nsInput).e("icon"))
|
|
803
|
+
}, {
|
|
804
|
+
default: withCtx(() => [
|
|
805
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
|
|
806
|
+
]),
|
|
807
|
+
_: 1
|
|
808
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
809
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
810
|
+
unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
811
|
+
key: 1,
|
|
812
|
+
class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
|
|
813
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
814
|
+
}, ["prevent"])),
|
|
815
|
+
onClick: clear
|
|
816
|
+
}, {
|
|
817
|
+
default: withCtx(() => [
|
|
818
|
+
createVNode(unref(circleClose))
|
|
819
|
+
]),
|
|
820
|
+
_: 1
|
|
821
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
822
|
+
unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
823
|
+
key: 2,
|
|
824
|
+
class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
|
|
825
|
+
onClick: handlePasswordVisible
|
|
826
|
+
}, {
|
|
827
|
+
default: withCtx(() => [
|
|
828
|
+
createVNode(unref(view))
|
|
829
|
+
]),
|
|
830
|
+
_: 1
|
|
831
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
832
|
+
unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
|
|
833
|
+
key: 3,
|
|
834
|
+
class: normalizeClass(unref(nsInput).e("count"))
|
|
835
|
+
}, [
|
|
836
|
+
createElementVNode("span", {
|
|
837
|
+
class: normalizeClass(unref(nsInput).e("count-inner"))
|
|
838
|
+
}, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)
|
|
839
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
840
|
+
], 2),
|
|
841
|
+
unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
834
842
|
key: 0,
|
|
835
|
-
class: normalizeClass(
|
|
843
|
+
class: normalizeClass([
|
|
844
|
+
unref(nsInput).e("icon"),
|
|
845
|
+
unref(nsInput).e("validateIcon"),
|
|
846
|
+
unref(nsInput).is("loading", unref(validateState) === "validating")
|
|
847
|
+
])
|
|
836
848
|
}, {
|
|
837
849
|
default: withCtx(() => [
|
|
838
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
850
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
|
|
839
851
|
]),
|
|
840
852
|
_: 1
|
|
841
853
|
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
842
|
-
],
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
class: normalizeClass([_ctx.nsInput.e("icon"), _ctx.nsInput.e("clear")]),
|
|
846
|
-
onMousedown: _cache[8] || (_cache[8] = withModifiers(() => {
|
|
847
|
-
}, ["prevent"])),
|
|
848
|
-
onClick: _ctx.clear
|
|
849
|
-
}, {
|
|
850
|
-
default: withCtx(() => [
|
|
851
|
-
createVNode(_component_circle_close)
|
|
852
|
-
]),
|
|
853
|
-
_: 1
|
|
854
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
855
|
-
_ctx.showPwdVisible ? (openBlock(), createBlock(_component_el_icon, {
|
|
856
|
-
key: 2,
|
|
857
|
-
class: normalizeClass([_ctx.nsInput.e("icon"), _ctx.nsInput.e("clear")]),
|
|
858
|
-
onClick: _ctx.handlePasswordVisible
|
|
859
|
-
}, {
|
|
860
|
-
default: withCtx(() => [
|
|
861
|
-
createVNode(_component_icon_view)
|
|
862
|
-
]),
|
|
863
|
-
_: 1
|
|
864
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
865
|
-
_ctx.isWordLimitVisible ? (openBlock(), createElementBlock("span", {
|
|
854
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
855
|
+
createCommentVNode(" append slot "),
|
|
856
|
+
_ctx.$slots.append ? (openBlock(), createElementBlock("div", {
|
|
866
857
|
key: 3,
|
|
867
|
-
class: normalizeClass(
|
|
858
|
+
class: normalizeClass(unref(nsInput).be("group", "append"))
|
|
868
859
|
}, [
|
|
869
|
-
|
|
870
|
-
class: normalizeClass(_ctx.nsInput.e("count-inner"))
|
|
871
|
-
}, toDisplayString(_ctx.textLength) + " / " + toDisplayString(_ctx.attrs.maxlength), 3)
|
|
860
|
+
renderSlot(_ctx.$slots, "append")
|
|
872
861
|
], 2)) : createCommentVNode("v-if", true)
|
|
873
|
-
],
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
onFocus: _cache[13] || (_cache[13] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
|
|
909
|
-
onBlur: _cache[14] || (_cache[14] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
|
|
910
|
-
onChange: _cache[15] || (_cache[15] = (...args) => _ctx.handleChange && _ctx.handleChange(...args)),
|
|
911
|
-
onKeydown: _cache[16] || (_cache[16] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
|
|
912
|
-
}), null, 16, _hoisted_2$1),
|
|
913
|
-
_ctx.isWordLimitVisible ? (openBlock(), createElementBlock("span", {
|
|
914
|
-
key: 0,
|
|
915
|
-
class: normalizeClass(_ctx.nsInput.e("count"))
|
|
916
|
-
}, toDisplayString(_ctx.textLength) + " / " + toDisplayString(_ctx.attrs.maxlength), 3)) : createCommentVNode("v-if", true)
|
|
917
|
-
], 64))
|
|
918
|
-
], 38)), [
|
|
919
|
-
[vShow, _ctx.type !== "hidden"]
|
|
920
|
-
]);
|
|
921
|
-
}
|
|
922
|
-
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render]]);
|
|
923
|
-
const ElInput = withInstall(Input);
|
|
862
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
863
|
+
createCommentVNode(" textarea "),
|
|
864
|
+
createElementVNode("textarea", mergeProps({
|
|
865
|
+
ref_key: "textarea",
|
|
866
|
+
ref: textarea,
|
|
867
|
+
class: unref(nsTextarea).e("inner")
|
|
868
|
+
}, unref(attrs), {
|
|
869
|
+
tabindex: _ctx.tabindex,
|
|
870
|
+
disabled: unref(inputDisabled),
|
|
871
|
+
readonly: _ctx.readonly,
|
|
872
|
+
autocomplete: _ctx.autocomplete,
|
|
873
|
+
style: unref(textareaStyle),
|
|
874
|
+
"aria-label": _ctx.label,
|
|
875
|
+
placeholder: _ctx.placeholder,
|
|
876
|
+
onCompositionstart: handleCompositionStart,
|
|
877
|
+
onCompositionupdate: handleCompositionUpdate,
|
|
878
|
+
onCompositionend: handleCompositionEnd,
|
|
879
|
+
onInput: handleInput,
|
|
880
|
+
onFocus: handleFocus,
|
|
881
|
+
onBlur: handleBlur,
|
|
882
|
+
onChange: handleChange,
|
|
883
|
+
onKeydown: handleKeydown
|
|
884
|
+
}), null, 16, _hoisted_2$1),
|
|
885
|
+
unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
|
|
886
|
+
key: 0,
|
|
887
|
+
class: normalizeClass(unref(nsInput).e("count"))
|
|
888
|
+
}, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)) : createCommentVNode("v-if", true)
|
|
889
|
+
], 64))
|
|
890
|
+
], 38)), [
|
|
891
|
+
[vShow, _ctx.type !== "hidden"]
|
|
892
|
+
]);
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
}));
|
|
896
|
+
const ElInput = withInstall(_sfc_main$5);
|
|
924
897
|
function bound01(n, max) {
|
|
925
898
|
if (isOnePointZero(n)) {
|
|
926
899
|
n = "100%";
|
|
@@ -1839,7 +1812,7 @@ const _hoisted_1$2 = ["disabled", "autofocus", "type"];
|
|
|
1839
1812
|
const __default__$3 = {
|
|
1840
1813
|
name: "ElButton"
|
|
1841
1814
|
};
|
|
1842
|
-
const _sfc_main$
|
|
1815
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
1843
1816
|
props: buttonProps,
|
|
1844
1817
|
emits: buttonEmits,
|
|
1845
1818
|
setup(__props, { expose, emit }) {
|
|
@@ -1864,7 +1837,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
1864
1837
|
const slot = defaultSlot[0];
|
|
1865
1838
|
if ((slot == null ? void 0 : slot.type) === Text) {
|
|
1866
1839
|
const text = slot.children;
|
|
1867
|
-
return /^\p{Unified_Ideograph}{2}$/u.test(text);
|
|
1840
|
+
return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
|
|
1868
1841
|
}
|
|
1869
1842
|
}
|
|
1870
1843
|
return false;
|
|
@@ -1948,11 +1921,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
1948
1921
|
]),
|
|
1949
1922
|
_: 1
|
|
1950
1923
|
}, 8, ["class"]))
|
|
1951
|
-
], 2112)) : _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
1924
|
+
], 2112)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
1952
1925
|
default: withCtx(() => [
|
|
1953
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
1926
|
+
_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
1954
1927
|
]),
|
|
1955
|
-
_:
|
|
1928
|
+
_: 3
|
|
1956
1929
|
})) : createCommentVNode("v-if", true),
|
|
1957
1930
|
_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
1958
1931
|
key: 2,
|
|
@@ -1971,7 +1944,7 @@ const buttonGroupProps = {
|
|
|
1971
1944
|
const __default__$2 = {
|
|
1972
1945
|
name: "ElButtonGroup"
|
|
1973
1946
|
};
|
|
1974
|
-
const _sfc_main$
|
|
1947
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
1975
1948
|
props: buttonGroupProps,
|
|
1976
1949
|
setup(__props) {
|
|
1977
1950
|
const props = __props;
|
|
@@ -1989,10 +1962,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
1989
1962
|
};
|
|
1990
1963
|
}
|
|
1991
1964
|
}));
|
|
1992
|
-
const ElButton = withInstall(_sfc_main$
|
|
1993
|
-
ButtonGroup: _sfc_main$
|
|
1965
|
+
const ElButton = withInstall(_sfc_main$4, {
|
|
1966
|
+
ButtonGroup: _sfc_main$3
|
|
1994
1967
|
});
|
|
1995
|
-
withNoopInstall(_sfc_main$
|
|
1968
|
+
withNoopInstall(_sfc_main$3);
|
|
1996
1969
|
var base = "";
|
|
1997
1970
|
var input = "";
|
|
1998
1971
|
/**
|
|
@@ -2520,7 +2493,7 @@ const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("span", { class: "pl-cur
|
|
|
2520
2493
|
const __default__$1 = {
|
|
2521
2494
|
name: "PlCurrency"
|
|
2522
2495
|
};
|
|
2523
|
-
const _sfc_main$
|
|
2496
|
+
const _sfc_main$2 = /* @__PURE__ */ Object.assign(__default__$1, {
|
|
2524
2497
|
props: {
|
|
2525
2498
|
modelValue: String,
|
|
2526
2499
|
width: String
|
|
@@ -2558,7 +2531,7 @@ const _sfc_main$1 = /* @__PURE__ */ Object.assign(__default__$1, {
|
|
|
2558
2531
|
});
|
|
2559
2532
|
const PlCurrencyPlugin = {
|
|
2560
2533
|
install(app) {
|
|
2561
|
-
app.component("PlCurrency", _sfc_main$
|
|
2534
|
+
app.component("PlCurrency", _sfc_main$2);
|
|
2562
2535
|
}
|
|
2563
2536
|
};
|
|
2564
2537
|
var button = "";
|
|
@@ -2567,7 +2540,7 @@ const _hoisted_2 = /* @__PURE__ */ createTextVNode("Increment count");
|
|
|
2567
2540
|
const __default__ = {
|
|
2568
2541
|
name: "TestViteNpmComponent"
|
|
2569
2542
|
};
|
|
2570
|
-
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
2543
|
+
const _sfc_main$1 = /* @__PURE__ */ Object.assign(__default__, {
|
|
2571
2544
|
setup(__props) {
|
|
2572
2545
|
const msg = ref("");
|
|
2573
2546
|
const count2 = ref(0);
|
|
@@ -2603,14 +2576,150 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
2603
2576
|
});
|
|
2604
2577
|
const TestViteNpmComponentPlugin = {
|
|
2605
2578
|
install(app) {
|
|
2606
|
-
app.component("TestViteNpmComponent", _sfc_main);
|
|
2579
|
+
app.component("TestViteNpmComponent", _sfc_main$1);
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
var plButton_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
2583
|
+
var _export_sfc = (sfc, props) => {
|
|
2584
|
+
const target = sfc.__vccOpts || sfc;
|
|
2585
|
+
for (const [key, val] of props) {
|
|
2586
|
+
target[key] = val;
|
|
2587
|
+
}
|
|
2588
|
+
return target;
|
|
2589
|
+
};
|
|
2590
|
+
const _sfc_main = {
|
|
2591
|
+
props: {
|
|
2592
|
+
value: { type: String, default: null },
|
|
2593
|
+
beforeIcon: {
|
|
2594
|
+
type: String,
|
|
2595
|
+
default: null
|
|
2596
|
+
},
|
|
2597
|
+
afterIcon: {
|
|
2598
|
+
type: String,
|
|
2599
|
+
default: null
|
|
2600
|
+
},
|
|
2601
|
+
onlyIcon: {
|
|
2602
|
+
type: String,
|
|
2603
|
+
default: null
|
|
2604
|
+
},
|
|
2605
|
+
disabled: {
|
|
2606
|
+
type: Boolean,
|
|
2607
|
+
default: false
|
|
2608
|
+
},
|
|
2609
|
+
size: {
|
|
2610
|
+
type: String,
|
|
2611
|
+
default: "small"
|
|
2612
|
+
},
|
|
2613
|
+
type: {
|
|
2614
|
+
type: String,
|
|
2615
|
+
default: "primary"
|
|
2616
|
+
}
|
|
2617
|
+
},
|
|
2618
|
+
emits: ["onClick"],
|
|
2619
|
+
setup(__props, { emit }) {
|
|
2620
|
+
const props = __props;
|
|
2621
|
+
return (_ctx, _cache) => {
|
|
2622
|
+
const _component_vue_feather = resolveComponent("vue-feather");
|
|
2623
|
+
const _component_el_button = ElButton;
|
|
2624
|
+
return openBlock(), createBlock(_component_el_button, {
|
|
2625
|
+
class: normalizeClass([
|
|
2626
|
+
props.size === "medium" ? "big" : "",
|
|
2627
|
+
props.onlyIcon ? "btn-icon" : ""
|
|
2628
|
+
]),
|
|
2629
|
+
disabled: __props.disabled,
|
|
2630
|
+
type: __props.type,
|
|
2631
|
+
onClick: emit.onClick
|
|
2632
|
+
}, {
|
|
2633
|
+
default: withCtx(() => [
|
|
2634
|
+
__props.beforeIcon && !__props.onlyIcon ? (openBlock(), createBlock(_component_vue_feather, {
|
|
2635
|
+
key: 0,
|
|
2636
|
+
class: normalizeClass(["icon icon__before", [
|
|
2637
|
+
props.type === "secondary" ? "btn-text-secondary" : "",
|
|
2638
|
+
props.type === "tertiary" ? "btn-text-tertiary" : ""
|
|
2639
|
+
]]),
|
|
2640
|
+
type: __props.beforeIcon
|
|
2641
|
+
}, null, 8, ["class", "type"])) : createCommentVNode("", true),
|
|
2642
|
+
__props.onlyIcon ? (openBlock(), createBlock(_component_vue_feather, {
|
|
2643
|
+
key: 1,
|
|
2644
|
+
class: normalizeClass(["icon icon__before only-icon", [
|
|
2645
|
+
props.type === "secondary" ? "btn-text-secondary" : "",
|
|
2646
|
+
props.type === "tertiary" ? "btn-text-tertiary" : ""
|
|
2647
|
+
]]),
|
|
2648
|
+
type: __props.onlyIcon
|
|
2649
|
+
}, null, 8, ["class", "type"])) : createCommentVNode("", true),
|
|
2650
|
+
!__props.onlyIcon ? (openBlock(), createElementBlock("span", {
|
|
2651
|
+
key: 2,
|
|
2652
|
+
class: normalizeClass(["btn-text", [
|
|
2653
|
+
props.type === "secondary" ? "btn-text-secondary" : "",
|
|
2654
|
+
props.type === "tertiary" ? "btn-text-tertiary" : ""
|
|
2655
|
+
]])
|
|
2656
|
+
}, toDisplayString(__props.value), 3)) : createCommentVNode("", true),
|
|
2657
|
+
__props.afterIcon && !__props.onlyIcon ? (openBlock(), createBlock(_component_vue_feather, {
|
|
2658
|
+
key: 3,
|
|
2659
|
+
class: normalizeClass([[
|
|
2660
|
+
props.type === "secondary" ? "btn-text-secondary" : "",
|
|
2661
|
+
props.type === "tertiary" ? "btn-text-tertiary" : ""
|
|
2662
|
+
], "icon icon__after"]),
|
|
2663
|
+
type: __props.afterIcon
|
|
2664
|
+
}, null, 8, ["class", "type"])) : createCommentVNode("", true)
|
|
2665
|
+
]),
|
|
2666
|
+
_: 1
|
|
2667
|
+
}, 8, ["class", "disabled", "type", "onClick"]);
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
var PlButton$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-30f87e98"]]);
|
|
2672
|
+
var PlButton = {
|
|
2673
|
+
title: "Storybook3/PlButton",
|
|
2674
|
+
component: PlButton$1,
|
|
2675
|
+
argTypes: {
|
|
2676
|
+
disabled: { control: { type: "select" }, options: [true, false] },
|
|
2677
|
+
type: {
|
|
2678
|
+
control: { type: "select" },
|
|
2679
|
+
options: ["primary", "secondary", "tertiary"]
|
|
2680
|
+
},
|
|
2681
|
+
size: {
|
|
2682
|
+
control: { type: "select" },
|
|
2683
|
+
options: ["medium", "small"]
|
|
2684
|
+
},
|
|
2685
|
+
beforeIcon: {
|
|
2686
|
+
control: { type: "select" },
|
|
2687
|
+
options: ["arrow-left", "arrow-right", "check"]
|
|
2688
|
+
},
|
|
2689
|
+
afterIcon: {
|
|
2690
|
+
control: { type: "select" },
|
|
2691
|
+
options: ["arrow-left", "arrow-right", "check"]
|
|
2692
|
+
},
|
|
2693
|
+
onlyIcon: {
|
|
2694
|
+
control: { type: "select" },
|
|
2695
|
+
options: ["arrow-left", "arrow-right", "check"]
|
|
2696
|
+
},
|
|
2697
|
+
onClick: {},
|
|
2698
|
+
icon: { values: "https://feathericons.com/" }
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2701
|
+
const Template = (args) => ({
|
|
2702
|
+
components: { PlButton: PlButton$1 },
|
|
2703
|
+
setup() {
|
|
2704
|
+
return { args };
|
|
2705
|
+
},
|
|
2706
|
+
template: '<PlButton v-bind="args"></PlButton>'
|
|
2707
|
+
});
|
|
2708
|
+
const FirstStory = Template.bind({});
|
|
2709
|
+
FirstStory.args = {
|
|
2710
|
+
value: "test"
|
|
2711
|
+
};
|
|
2712
|
+
const PlButtonPlugin = {
|
|
2713
|
+
install(app) {
|
|
2714
|
+
app.component("PlButton", PlButton);
|
|
2607
2715
|
}
|
|
2608
2716
|
};
|
|
2609
2717
|
const TestKitPlugin = {
|
|
2610
2718
|
install(app) {
|
|
2611
|
-
var _a, _b;
|
|
2719
|
+
var _a, _b, _c;
|
|
2612
2720
|
(_a = PlCurrencyPlugin.install) == null ? void 0 : _a.call(PlCurrencyPlugin, app);
|
|
2613
2721
|
(_b = TestViteNpmComponentPlugin.install) == null ? void 0 : _b.call(TestViteNpmComponentPlugin, app);
|
|
2722
|
+
(_c = PlButtonPlugin.install) == null ? void 0 : _c.call(PlButtonPlugin, app);
|
|
2614
2723
|
}
|
|
2615
2724
|
};
|
|
2616
|
-
export { _sfc_main$
|
|
2725
|
+
export { PlButton, PlButtonPlugin, _sfc_main$2 as PlCurrency, PlCurrencyPlugin, _sfc_main$1 as TestViteNpmComponent, TestViteNpmComponentPlugin, TestKitPlugin as default };
|