ll-plus 2.7.23 → 2.7.25
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/es/components/input/index.d.ts +15 -2
- package/es/components/input/src/input.d.ts +6 -0
- package/es/components/input/src/input.vue.d.ts +15 -2
- package/es/packages/components/input/src/input.mjs +6 -0
- package/es/packages/components/input/src/input.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue2.mjs +5 -8
- package/es/packages/components/input/src/input.vue2.mjs.map +1 -1
- package/es/utils/props/runtime.d.ts +2 -2
- package/index.full.js +11 -8
- package/index.full.min.js +17 -17
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +24 -24
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +11 -8
- package/lib/components/input/index.d.ts +15 -2
- package/lib/components/input/src/input.d.ts +6 -0
- package/lib/components/input/src/input.vue.d.ts +15 -2
- package/lib/packages/components/input/src/input.js +6 -0
- package/lib/packages/components/input/src/input.js.map +1 -1
- package/lib/packages/components/input/src/input.vue2.js +5 -8
- package/lib/packages/components/input/src/input.vue2.js.map +1 -1
- package/lib/utils/props/runtime.d.ts +2 -2
- package/package.json +1 -1
- package/types/packages/components/input/index.d.ts +15 -2
- package/types/packages/components/input/src/input.d.ts +6 -0
- package/types/packages/components/input/src/input.vue.d.ts +15 -2
- package/types/packages/utils/props/runtime.d.ts +2 -2
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import Input from './src/input.vue';
|
|
2
2
|
export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
3
|
+
readonly defaultValue: {
|
|
4
|
+
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
3
9
|
readonly value: {
|
|
4
10
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
5
11
|
readonly required: false;
|
|
@@ -41,6 +47,7 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
|
|
|
41
47
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
42
48
|
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
43
49
|
readonly value?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
50
|
+
readonly defaultValue?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
44
51
|
readonly suffixIcon?: string | undefined;
|
|
45
52
|
readonly prefixIcon?: string | undefined;
|
|
46
53
|
readonly showPassword?: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
@@ -52,7 +59,7 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
|
|
|
52
59
|
innerValue: import("vue").Ref<string | number | undefined>;
|
|
53
60
|
inputRef: import("vue").Ref<any>;
|
|
54
61
|
isMouseOver: import("vue").Ref<boolean>;
|
|
55
|
-
hasValue: import("vue").ComputedRef<string | number | undefined
|
|
62
|
+
hasValue: import("vue").ComputedRef<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
56
63
|
handleMouseOver: () => void;
|
|
57
64
|
handleMouseOut: () => void;
|
|
58
65
|
onChange: (e: any) => Promise<void>;
|
|
@@ -1322,6 +1329,7 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
|
|
|
1322
1329
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
1323
1330
|
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
1324
1331
|
readonly value?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
1332
|
+
readonly defaultValue?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
1325
1333
|
readonly suffixIcon?: string | undefined;
|
|
1326
1334
|
readonly prefixIcon?: string | undefined;
|
|
1327
1335
|
readonly showPassword?: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
@@ -1330,8 +1338,13 @@ export declare const LlInput: import("ll-plus/es/utils").SFCWithInstall<import("
|
|
|
1330
1338
|
readonly onClear?: ((...args: any[]) => any) | undefined;
|
|
1331
1339
|
} & {}>;
|
|
1332
1340
|
}>;
|
|
1333
|
-
focus: () => void;
|
|
1334
1341
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "change" | "update:value")[], "clear" | "change" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1342
|
+
readonly defaultValue: {
|
|
1343
|
+
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
1344
|
+
readonly required: false;
|
|
1345
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1346
|
+
__epPropKey: true;
|
|
1347
|
+
};
|
|
1335
1348
|
readonly value: {
|
|
1336
1349
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
1337
1350
|
readonly required: false;
|
|
@@ -2,6 +2,12 @@ import type { ExtractPropTypes } from 'vue';
|
|
|
2
2
|
import type { InputProps as AntInputProps } from 'ant-design-vue';
|
|
3
3
|
import type Input from './input.vue';
|
|
4
4
|
export declare const inputProps: {
|
|
5
|
+
readonly defaultValue: {
|
|
6
|
+
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
7
|
+
readonly required: false;
|
|
8
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
9
|
+
__epPropKey: true;
|
|
10
|
+
};
|
|
5
11
|
readonly value: {
|
|
6
12
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
7
13
|
readonly required: false;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
readonly defaultValue: {
|
|
3
|
+
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
4
|
+
readonly required: false;
|
|
5
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
6
|
+
__epPropKey: true;
|
|
7
|
+
};
|
|
2
8
|
readonly value: {
|
|
3
9
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
4
10
|
readonly required: false;
|
|
@@ -40,6 +46,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
46
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
41
47
|
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
42
48
|
readonly value?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
49
|
+
readonly defaultValue?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
43
50
|
readonly suffixIcon?: string | undefined;
|
|
44
51
|
readonly prefixIcon?: string | undefined;
|
|
45
52
|
readonly showPassword?: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
@@ -51,7 +58,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
58
|
innerValue: import("vue").Ref<string | number | undefined>;
|
|
52
59
|
inputRef: import("vue").Ref<any>;
|
|
53
60
|
isMouseOver: import("vue").Ref<boolean>;
|
|
54
|
-
hasValue: import("vue").ComputedRef<string | number | undefined
|
|
61
|
+
hasValue: import("vue").ComputedRef<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
55
62
|
handleMouseOver: () => void;
|
|
56
63
|
handleMouseOut: () => void;
|
|
57
64
|
onChange: (e: any) => Promise<void>;
|
|
@@ -1321,6 +1328,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1321
1328
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
1322
1329
|
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
1323
1330
|
readonly value?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
1331
|
+
readonly defaultValue?: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>;
|
|
1324
1332
|
readonly suffixIcon?: string | undefined;
|
|
1325
1333
|
readonly prefixIcon?: string | undefined;
|
|
1326
1334
|
readonly showPassword?: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown> | undefined;
|
|
@@ -1329,8 +1337,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1329
1337
|
readonly onClear?: ((...args: any[]) => any) | undefined;
|
|
1330
1338
|
} & {}>;
|
|
1331
1339
|
}>;
|
|
1332
|
-
focus: () => void;
|
|
1333
1340
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "change" | "update:value")[], "clear" | "change" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1341
|
+
readonly defaultValue: {
|
|
1342
|
+
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
1343
|
+
readonly required: false;
|
|
1344
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
1345
|
+
__epPropKey: true;
|
|
1346
|
+
};
|
|
1334
1347
|
readonly value: {
|
|
1335
1348
|
readonly type: import("vue").PropType<import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => string | number) | (() => string | number | undefined) | ((new (...args: any[]) => string | number) | (() => string | number | undefined))[], unknown, unknown>>;
|
|
1336
1349
|
readonly required: false;
|
|
@@ -3,6 +3,12 @@ import { buildProps, definePropType } from '../../../utils/props/runtime.mjs';
|
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
5
|
const inputProps = buildProps({
|
|
6
|
+
/**
|
|
7
|
+
* @description input的defaultValue
|
|
8
|
+
*/
|
|
9
|
+
defaultValue: {
|
|
10
|
+
type: definePropType(String)
|
|
11
|
+
},
|
|
6
12
|
/**
|
|
7
13
|
* @description input的value
|
|
8
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.mjs","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { InputProps as AntInputProps } from 'ant-design-vue'\nimport type Input from './input.vue'\n\nexport const inputProps = buildProps({\n /**\n * @description input的value\n */\n value: {\n type: definePropType<AntInputProps['value']>(String)\n },\n /**\n * @description 带有前缀图标的 input\n */\n prefixIcon: {\n type: String\n },\n /**\n * @description 带有后缀图标的 input\n */\n suffixIcon: {\n type: String\n },\n /**\n * @description 是否显示密码框\n */\n showPassword: {\n type: Boolean\n },\n /**\n * @description 是否点击清除图标删除内容\n */\n allowClear: {\n type: Boolean,\n default: true\n },\n /**\n * @description 是否禁用状态,默认为 false\n */\n disabled: {\n type: Boolean,\n default: false\n }\n} as const)\n\n// props\nexport type InputProps = ExtractPropTypes<typeof inputProps> // ExtractPropTypes和defineCpmponent类似\nexport type InputValue = AntInputProps['value']\n\n// instance\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":[],"mappings":";;;;AAMO,MAAM,aAAa,UAAW,CAAA;AAAA;AAAA;AAAA;AAAA,EAInC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAuC,MAAM,CAAA;AAAA,GACrD;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AACF,CAAU;;;;"}
|
|
1
|
+
{"version":3,"file":"input.mjs","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type { InputProps as AntInputProps } from 'ant-design-vue'\nimport type Input from './input.vue'\n\nexport const inputProps = buildProps({\n /**\n * @description input的defaultValue\n */\n defaultValue: {\n type: definePropType<AntInputProps['defaultValue']>(String)\n },\n /**\n * @description input的value\n */\n value: {\n type: definePropType<AntInputProps['value']>(String)\n },\n /**\n * @description 带有前缀图标的 input\n */\n prefixIcon: {\n type: String\n },\n /**\n * @description 带有后缀图标的 input\n */\n suffixIcon: {\n type: String\n },\n /**\n * @description 是否显示密码框\n */\n showPassword: {\n type: Boolean\n },\n /**\n * @description 是否点击清除图标删除内容\n */\n allowClear: {\n type: Boolean,\n default: true\n },\n /**\n * @description 是否禁用状态,默认为 false\n */\n disabled: {\n type: Boolean,\n default: false\n }\n} as const)\n\n// props\nexport type InputProps = ExtractPropTypes<typeof inputProps> // ExtractPropTypes和defineCpmponent类似\nexport type InputValue = AntInputProps['value']\n\n// instance\nexport type InputInstance = InstanceType<typeof Input>\n"],"names":[],"mappings":";;;;AAMO,MAAM,aAAa,UAAW,CAAA;AAAA;AAAA;AAAA;AAAA,EAInC,YAAc,EAAA;AAAA,IACZ,IAAA,EAAM,eAA8C,MAAM,CAAA;AAAA,GAC5D;AAAA;AAAA;AAAA;AAAA,EAIA,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAAuC,MAAM,CAAA;AAAA,GACrD;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA,EAIA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AACF,CAAU;;;;"}
|
|
@@ -18,7 +18,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
18
18
|
const innerValue = ref("");
|
|
19
19
|
const inputRef = ref();
|
|
20
20
|
const isMouseOver = ref(false);
|
|
21
|
-
const hasValue = computed(() => innerValue.value);
|
|
21
|
+
const hasValue = computed(() => innerValue.value || props.defaultValue);
|
|
22
22
|
const handleMouseOver = () => {
|
|
23
23
|
isMouseOver.value = true;
|
|
24
24
|
};
|
|
@@ -35,9 +35,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
emit("change", e);
|
|
36
36
|
};
|
|
37
37
|
watch(
|
|
38
|
-
() => props.value,
|
|
39
|
-
(newValue) => {
|
|
40
|
-
innerValue.value = newValue;
|
|
38
|
+
() => [props.value, props.defaultValue],
|
|
39
|
+
([newValue, newDefaultValue]) => {
|
|
40
|
+
innerValue.value = newValue || newDefaultValue;
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
immediate: true
|
|
@@ -57,10 +57,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
57
57
|
const attrs = { ...omit(useAttrs(), ["class", "style"]), props };
|
|
58
58
|
return attrs;
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
inputRef.value.focus();
|
|
62
|
-
};
|
|
63
|
-
__expose({ focus });
|
|
60
|
+
__expose({ ...inputRef.value });
|
|
64
61
|
return (_ctx, _cache) => {
|
|
65
62
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
66
63
|
return openBlock(), createElementBlock(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\" @mouseover=\"handleMouseOver\" @mouseout=\"handleMouseOut\">\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n v-bind=\"computedAttrs\"\n v-model:value=\"innerValue\"\n :allow-clear=\"props.allowClear\"\n :disabled=\"props.disabled\"\n :class=\"{\n 'show-clear-icon':\n props.allowClear && hasValue && isMouseOver && !props.disabled\n }\"\n @change=\"onChange\"\n >\n <template v-for=\"item in Object.keys($slots)\" :key=\"item\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\"></slot>\n </template>\n <template v-if=\"prefixIcon\" #prefix>\n <ll-icon :icon-name=\"prefixIcon\" class=\"prefix-icon\" />\n </template>\n <template v-if=\"suffixIcon\" #suffix>\n <ll-icon :icon-name=\"suffixIcon\" class=\"suffix-icon\" />\n </template>\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\nimport { omit } from 'lodash'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst emit = defineEmits(['update:value', 'change', 'clear'])\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst isMouseOver = ref(false)\n\n// 判断当前输入框是否有值\nconst hasValue = computed(() => innerValue.value)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n isMouseOver.value = true\n}\n\n// 鼠标移出事件\nconst handleMouseOut = () => {\n isMouseOver.value = false\n}\n\n// 输入框发送变化的回调\nconst onChange = async (e: any) => {\n const { value } = e.target\n innerValue.value = value\n await nextTick()\n if (!value && e.type === 'click') {\n emit('clear', value)\n }\n emit('change', e)\n}\n\n// 监听props.value的变化\nwatch(\n () => props.value,\n newValue => {\n innerValue.value = newValue\n },\n {\n immediate: true\n }\n)\n\n// 监听innerValue的变化,触发update:value事件\nwatch(\n innerValue,\n newValue => {\n emit('update:value', newValue)\n },\n {\n immediate: true\n }\n)\n\n// 根据showPassword属性决定组件类型\nconst componentType = props.showPassword ? Input.Password : Input\n\n// 计算属性,合并attrs和props\nconst computedAttrs = computed(() => {\n const attrs = { ...omit(useAttrs(), ['class', 'style']), props }\n return attrs\n})\n\n//
|
|
1
|
+
{"version":3,"file":"input.vue2.mjs","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\" @mouseover=\"handleMouseOver\" @mouseout=\"handleMouseOut\">\n <component\n :is=\"componentType\"\n ref=\"inputRef\"\n v-bind=\"computedAttrs\"\n v-model:value=\"innerValue\"\n :allow-clear=\"props.allowClear\"\n :disabled=\"props.disabled\"\n :class=\"{\n 'show-clear-icon':\n props.allowClear && hasValue && isMouseOver && !props.disabled\n }\"\n @change=\"onChange\"\n >\n <template v-for=\"item in Object.keys($slots)\" :key=\"item\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\"></slot>\n </template>\n <template v-if=\"prefixIcon\" #prefix>\n <ll-icon :icon-name=\"prefixIcon\" class=\"prefix-icon\" />\n </template>\n <template v-if=\"suffixIcon\" #suffix>\n <ll-icon :icon-name=\"suffixIcon\" class=\"suffix-icon\" />\n </template>\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch, nextTick } from 'vue'\nimport { Input } from 'ant-design-vue'\nimport { createNamespace } from '@ll-plus/utils'\nimport { InputValue, inputProps } from './input'\nimport { omit } from 'lodash'\n\ndefineOptions({ name: 'LlInput' })\n\nconst bem = createNamespace('input')\n\nconst props = defineProps(inputProps)\n\nconst emit = defineEmits(['update:value', 'change', 'clear'])\n\nconst innerValue = ref<InputValue>('')\n\nconst inputRef = ref()\n\nconst isMouseOver = ref(false)\n\n// 判断当前输入框是否有值\nconst hasValue = computed(() => innerValue.value || props.defaultValue)\n\n// 鼠标移入事件\nconst handleMouseOver = () => {\n isMouseOver.value = true\n}\n\n// 鼠标移出事件\nconst handleMouseOut = () => {\n isMouseOver.value = false\n}\n\n// 输入框发送变化的回调\nconst onChange = async (e: any) => {\n const { value } = e.target\n innerValue.value = value\n await nextTick()\n if (!value && e.type === 'click') {\n emit('clear', value)\n }\n emit('change', e)\n}\n\n// 监听props.value/props.defaultValue的变化\nwatch(\n () => [props.value, props.defaultValue],\n ([newValue, newDefaultValue]) => {\n innerValue.value = newValue || newDefaultValue\n },\n {\n immediate: true\n }\n)\n\n// 监听innerValue的变化,触发update:value事件\nwatch(\n innerValue,\n newValue => {\n emit('update:value', newValue)\n },\n {\n immediate: true\n }\n)\n\n// 根据showPassword属性决定组件类型\nconst componentType = props.showPassword ? Input.Password : Input\n\n// 计算属性,合并attrs和props\nconst computedAttrs = computed(() => {\n const attrs = { ...omit(useAttrs(), ['class', 'style']), props }\n return attrs\n})\n\n// 公开focus方法\ndefineExpose({ ...inputRef.value })\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAqCA,IAAM,MAAA,GAAA,GAAM,gBAAgB,OAAO,CAAA,CAAA;AAEnC,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,IAAO,GAAA,MAAA,CAAA;AAEb,IAAM,MAAA,UAAA,GAAa,IAAgB,EAAE,CAAA,CAAA;AAErC,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,WAAA,GAAc,IAAI,KAAK,CAAA,CAAA;AAG7B,IAAA,MAAM,WAAW,QAAS,CAAA,MAAM,UAAW,CAAA,KAAA,IAAS,MAAM,YAAY,CAAA,CAAA;AAGtE,IAAA,MAAM,kBAAkB,MAAM;AAC5B,MAAA,WAAA,CAAY,KAAQ,GAAA,IAAA,CAAA;AAAA,KACtB,CAAA;AAGA,IAAA,MAAM,iBAAiB,MAAM;AAC3B,MAAA,WAAA,CAAY,KAAQ,GAAA,KAAA,CAAA;AAAA,KACtB,CAAA;AAGA,IAAM,MAAA,QAAA,GAAW,OAAO,CAAW,KAAA;AACjC,MAAM,MAAA,EAAE,KAAM,EAAA,GAAI,CAAE,CAAA,MAAA,CAAA;AACpB,MAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AACnB,MAAA,MAAM,QAAS,EAAA,CAAA;AACf,MAAA,IAAI,CAAC,KAAA,IAAS,CAAE,CAAA,IAAA,KAAS,OAAS,EAAA;AAChC,QAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,OACrB;AACA,MAAA,IAAA,CAAK,UAAU,CAAC,CAAA,CAAA;AAAA,KAClB,CAAA;AAGA,IAAA,KAAA;AAAA,MACE,MAAM,CAAC,KAAM,CAAA,KAAA,EAAO,MAAM,YAAY,CAAA;AAAA,MACtC,CAAC,CAAC,QAAU,EAAA,eAAe,CAAM,KAAA;AAC/B,QAAA,UAAA,CAAW,QAAQ,QAAY,IAAA,eAAA,CAAA;AAAA,OACjC;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,OACb;AAAA,KACF,CAAA;AAGA,IAAA,KAAA;AAAA,MACE,UAAA;AAAA,MACA,CAAY,QAAA,KAAA;AACV,QAAA,IAAA,CAAK,gBAAgB,QAAQ,CAAA,CAAA;AAAA,OAC/B;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,OACb;AAAA,KACF,CAAA;AAGA,IAAA,MAAM,aAAgB,GAAA,KAAA,CAAM,YAAe,GAAA,KAAA,CAAM,QAAW,GAAA,KAAA,CAAA;AAG5D,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAM,MAAA,KAAA,GAAQ,EAAE,GAAG,IAAK,CAAA,QAAA,EAAY,EAAA,CAAC,OAAS,EAAA,OAAO,CAAC,CAAA,EAAG,KAAM,EAAA,CAAA;AAC/D,MAAO,OAAA,KAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAGD,IAAA,QAAA,CAAa,EAAE,GAAG,QAAS,CAAA,KAAA,EAAO,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -27,6 +27,6 @@ export declare const buildProp: <Type = never, Value = never, Validator = never,
|
|
|
27
27
|
export type TestProps = Record<string, {
|
|
28
28
|
[epPropKey]: true;
|
|
29
29
|
} | NativePropType | EpPropInput<any, any, any, any, any>>;
|
|
30
|
-
export declare const buildProps: <Props extends Record<string, {
|
|
30
|
+
export declare const buildProps: <Props extends Record<string, NativePropType | EpPropInput<any, any, any, any, any> | {
|
|
31
31
|
__epPropKey: true;
|
|
32
|
-
}
|
|
32
|
+
}>>(props: Props) => { [K in keyof Props]: IfEpProp<Props[K], Props[K], IfNativePropType<Props[K], Props[K], EpPropConvert<Props[K]>>>; };
|
package/index.full.js
CHANGED
|
@@ -64482,6 +64482,12 @@
|
|
|
64482
64482
|
const LlImagePreviewGroup = withInstall(ImagePreviewGroup);
|
|
64483
64483
|
|
|
64484
64484
|
const inputProps = buildProps({
|
|
64485
|
+
/**
|
|
64486
|
+
* @description input的defaultValue
|
|
64487
|
+
*/
|
|
64488
|
+
defaultValue: {
|
|
64489
|
+
type: definePropType(String)
|
|
64490
|
+
},
|
|
64485
64491
|
/**
|
|
64486
64492
|
* @description input的value
|
|
64487
64493
|
*/
|
|
@@ -70023,7 +70029,7 @@
|
|
|
70023
70029
|
const innerValue = require$$0.ref("");
|
|
70024
70030
|
const inputRef = require$$0.ref();
|
|
70025
70031
|
const isMouseOver = require$$0.ref(false);
|
|
70026
|
-
const hasValue = require$$0.computed(() => innerValue.value);
|
|
70032
|
+
const hasValue = require$$0.computed(() => innerValue.value || props.defaultValue);
|
|
70027
70033
|
const handleMouseOver = () => {
|
|
70028
70034
|
isMouseOver.value = true;
|
|
70029
70035
|
};
|
|
@@ -70040,9 +70046,9 @@
|
|
|
70040
70046
|
emit("change", e);
|
|
70041
70047
|
};
|
|
70042
70048
|
require$$0.watch(
|
|
70043
|
-
() => props.value,
|
|
70044
|
-
(newValue) => {
|
|
70045
|
-
innerValue.value = newValue;
|
|
70049
|
+
() => [props.value, props.defaultValue],
|
|
70050
|
+
([newValue, newDefaultValue]) => {
|
|
70051
|
+
innerValue.value = newValue || newDefaultValue;
|
|
70046
70052
|
},
|
|
70047
70053
|
{
|
|
70048
70054
|
immediate: true
|
|
@@ -70062,10 +70068,7 @@
|
|
|
70062
70068
|
const attrs = { ...lodashExports.omit(require$$0.useAttrs(), ["class", "style"]), props };
|
|
70063
70069
|
return attrs;
|
|
70064
70070
|
});
|
|
70065
|
-
|
|
70066
|
-
inputRef.value.focus();
|
|
70067
|
-
};
|
|
70068
|
-
__expose({ focus });
|
|
70071
|
+
__expose({ ...inputRef.value });
|
|
70069
70072
|
return (_ctx, _cache) => {
|
|
70070
70073
|
const _component_ll_icon = require$$0.resolveComponent("ll-icon");
|
|
70071
70074
|
return require$$0.openBlock(), require$$0.createElementBlock(
|