el-plus 0.0.110 → 0.0.112
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/CHANGELOG.md +12 -0
- package/dist/index.full.js +45 -22
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +45 -22
- package/es/components/input/index.d.ts +15 -0
- package/es/components/input/src/input.d.ts +4 -0
- package/es/components/input/src/input.mjs +4 -0
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input.vue.d.ts +9 -0
- package/es/components/input/src/input.vue2.mjs +9 -1
- package/es/components/input/src/input.vue2.mjs.map +1 -1
- package/es/components/select/index.d.ts +15 -14
- package/es/components/select/src/select.d.ts +4 -0
- package/es/components/select/src/select.mjs +5 -0
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/select.vue.d.ts +9 -8
- package/es/components/select/src/select.vue2.mjs +4 -7
- package/es/components/select/src/select.vue2.mjs.map +1 -1
- package/es/components/select/src/use-select.d.ts +2 -2
- package/es/components/select/src/use-select.mjs +22 -13
- package/es/components/select/src/use-select.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/lib/components/input/index.d.ts +15 -0
- package/lib/components/input/src/input.d.ts +4 -0
- package/lib/components/input/src/input.js +4 -0
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input.vue.d.ts +9 -0
- package/lib/components/input/src/input.vue2.js +8 -0
- package/lib/components/input/src/input.vue2.js.map +1 -1
- package/lib/components/select/index.d.ts +15 -14
- package/lib/components/select/src/select.d.ts +4 -0
- package/lib/components/select/src/select.js +5 -0
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/select.vue.d.ts +9 -8
- package/lib/components/select/src/select.vue2.js +4 -7
- package/lib/components/select/src/select.vue2.js.map +1 -1
- package/lib/components/select/src/use-select.d.ts +2 -2
- package/lib/components/select/src/use-select.js +22 -13
- package/lib/components/select/src/use-select.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SetupContext } from 'vue';
|
|
2
2
|
import type { SelectProps, SelectEmits } from './select';
|
|
3
3
|
export declare function useSelect(props: SelectProps, emit: SetupContext<SelectEmits>['emit']): {
|
|
4
|
-
customOptions: import("vue").
|
|
5
|
-
loadOptions: (
|
|
4
|
+
customOptions: import("vue").ComputedRef<Record<string, any>[]>;
|
|
5
|
+
loadOptions: () => void;
|
|
6
6
|
expandAttrs: import("vue").ComputedRef<{
|
|
7
7
|
loading: boolean | undefined;
|
|
8
8
|
remoteMethod: (query: string) => void;
|
|
@@ -3,6 +3,7 @@ import { useRequest } from '../../../hooks/use-request.mjs';
|
|
|
3
3
|
|
|
4
4
|
function useSelect(props, emit) {
|
|
5
5
|
let hasLoaded = false;
|
|
6
|
+
const loadedOptions = ref([]);
|
|
6
7
|
const { loading, requestFn } = useRequest({
|
|
7
8
|
api: props.api,
|
|
8
9
|
method: props.method,
|
|
@@ -14,12 +15,12 @@ function useSelect(props, emit) {
|
|
|
14
15
|
hooks: {
|
|
15
16
|
success(data) {
|
|
16
17
|
if (Array.isArray(data)) {
|
|
17
|
-
|
|
18
|
+
loadedOptions.value = data;
|
|
18
19
|
} else if (data && typeof data === "object") {
|
|
19
20
|
const rawData = data;
|
|
20
|
-
|
|
21
|
+
loadedOptions.value = rawData?.list || rawData?.data || [];
|
|
21
22
|
} else {
|
|
22
|
-
|
|
23
|
+
loadedOptions.value = [];
|
|
23
24
|
}
|
|
24
25
|
hasLoaded = true;
|
|
25
26
|
},
|
|
@@ -28,22 +29,30 @@ function useSelect(props, emit) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
const echoOption = computed(() => {
|
|
33
|
+
const v = props.modelValue;
|
|
34
|
+
const d = props.desc;
|
|
35
|
+
if ((v || v === 0) && d) {
|
|
36
|
+
const exists = loadedOptions.value.some(
|
|
37
|
+
(item) => item[props.valueKey] === v
|
|
38
|
+
);
|
|
39
|
+
if (!exists) {
|
|
40
|
+
return [{ [props.labelKey]: d, [props.valueKey]: v }];
|
|
41
|
+
}
|
|
40
42
|
}
|
|
43
|
+
return [];
|
|
44
|
+
});
|
|
45
|
+
const customOptions = computed(() => [
|
|
46
|
+
...echoOption.value,
|
|
47
|
+
...loadedOptions.value
|
|
48
|
+
]);
|
|
49
|
+
const loadOptions = () => {
|
|
41
50
|
if (props.api) {
|
|
42
51
|
if (!props.lazy && !props.remote) {
|
|
43
52
|
requestFn();
|
|
44
53
|
}
|
|
45
54
|
} else if (props.options?.length) {
|
|
46
|
-
|
|
55
|
+
loadedOptions.value = props.options;
|
|
47
56
|
}
|
|
48
57
|
};
|
|
49
58
|
const getSelectItem = (value) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-select.mjs","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref ,computed} from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n
|
|
1
|
+
{"version":3,"file":"use-select.mjs","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref ,computed} from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n // 已加载的选项(api 请求结果 / props.options / 搜索结果)\n const loadedOptions = ref<SelectOption[]>([])\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n loadedOptions.value = data as OptionArr\n } else if (data && typeof data === 'object') {\n const rawData = data as OptionObj\n loadedOptions.value = rawData?.list || rawData?.data || []\n } else {\n loadedOptions.value = []\n }\n hasLoaded = true\n },\n fail(error) {\n console.error(error)\n },\n },\n })\n // 回显占位项:value/desc 存在且不在已加载列表中时,补充一项\n // 由 computed 自动响应 value/desc/loadedOptions 的变化,无需 watch\n const echoOption = computed<SelectOption[]>(() => {\n const v = props.modelValue\n const d = props.desc\n if ((v || v === 0) && d) {\n const exists = loadedOptions.value.some(\n (item: SelectOption) => item[props.valueKey] === v,\n )\n if (!exists) {\n return [{ [props.labelKey]: d, [props.valueKey]: v }]\n }\n }\n return []\n })\n // 最终下拉项 = 回显占位 + 已加载\n const customOptions = computed<SelectOption[]>(() => [\n ...echoOption.value,\n ...loadedOptions.value,\n ])\n // 加载下拉列表(只负责加载,不处理回显)\n const loadOptions = () => {\n if (props.api) {\n if (!props.lazy && !props.remote) {\n requestFn!()\n }\n } else if (props.options?.length) {\n loadedOptions.value = props.options\n }\n }\n // 获取选中项\n const getSelectItem = (value: SelectProps['modelValue']) => {\n if (Array.isArray(value)) {\n if (!customOptions.value) return []\n return customOptions.value.filter((item: SelectOption) => {\n return value.indexOf(item[props.valueKey]) > -1\n })\n }\n if (!customOptions.value) return {}\n return (\n customOptions.value.find((item: SelectOption) => {\n return item[props.valueKey] === value\n }) || {}\n )\n }\n const expandAttrs = computed(() => {\n return {\n loading: props.loading || loading?.value,\n remoteMethod: (query: string) => {\n if (!query) return\n requestFn!({\n $searchValue: query,\n })\n },\n onChange(value: SelectProps['modelValue']) {\n emit('change', value, getSelectItem(value))\n },\n onVisibleChange(visible: boolean) {\n if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {\n requestFn!()\n }\n emit('visible-change', visible)\n },\n }\n })\n return {\n customOptions,\n loadOptions,\n expandAttrs,\n }\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,SAAA,CACd,OACA,IAAA,EACA;AACA,EAAA,IAAI,SAAA,GAAY,KAAA;AAEhB,EAAA,MAAM,aAAA,GAAgB,GAAA,CAAoB,EAAE,CAAA;AAC5C,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,UAAA,CAAW;AAAA,IACxC,KAAK,KAAA,CAAM,GAAA;AAAA,IACX,QAAQ,KAAA,CAAM,MAAA;AAAA,IACd,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,aAAa,KAAA,CAAM,MAAA;AAAA,IACnB,KAAA,EAAO;AAAA,MACL,QAAQ,IAAA,EAAM;AAMZ,QAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,UAAA,aAAA,CAAc,KAAA,GAAQ,IAAA;AAAA,QACxB,CAAA,MAAA,IAAW,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AAC3C,UAAA,MAAM,OAAA,GAAU,IAAA;AAChB,UAAA,aAAA,CAAc,KAAA,GAAQ,OAAA,EAAS,IAAA,IAAQ,OAAA,EAAS,QAAQ,EAAC;AAAA,QAC3D,CAAA,MAA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OAAO,CAAA;AAAA,MAChC;AAAA,KACF;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
|
package/es/package.json.mjs
CHANGED
|
@@ -16,6 +16,10 @@ export declare const EpInput: {
|
|
|
16
16
|
readonly default: true;
|
|
17
17
|
readonly prototype: Boolean;
|
|
18
18
|
};
|
|
19
|
+
clearableFocus: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: true;
|
|
22
|
+
};
|
|
19
23
|
inputmode: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
20
24
|
name: StringConstructor;
|
|
21
25
|
ariaLabel: StringConstructor;
|
|
@@ -140,6 +144,7 @@ export declare const EpInput: {
|
|
|
140
144
|
nonzero: boolean;
|
|
141
145
|
placeholder: string;
|
|
142
146
|
thousand: boolean;
|
|
147
|
+
clearableFocus: boolean;
|
|
143
148
|
inputmode: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown>;
|
|
144
149
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
145
150
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -177,6 +182,10 @@ export declare const EpInput: {
|
|
|
177
182
|
readonly default: true;
|
|
178
183
|
readonly prototype: Boolean;
|
|
179
184
|
};
|
|
185
|
+
clearableFocus: {
|
|
186
|
+
readonly type: BooleanConstructor;
|
|
187
|
+
readonly default: true;
|
|
188
|
+
};
|
|
180
189
|
inputmode: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
181
190
|
name: StringConstructor;
|
|
182
191
|
ariaLabel: StringConstructor;
|
|
@@ -287,6 +296,7 @@ export declare const EpInput: {
|
|
|
287
296
|
nonzero: boolean;
|
|
288
297
|
placeholder: string;
|
|
289
298
|
thousand: boolean;
|
|
299
|
+
clearableFocus: boolean;
|
|
290
300
|
inputmode: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown>;
|
|
291
301
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
292
302
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -321,6 +331,10 @@ export declare const EpInput: {
|
|
|
321
331
|
readonly default: true;
|
|
322
332
|
readonly prototype: Boolean;
|
|
323
333
|
};
|
|
334
|
+
clearableFocus: {
|
|
335
|
+
readonly type: BooleanConstructor;
|
|
336
|
+
readonly default: true;
|
|
337
|
+
};
|
|
324
338
|
inputmode: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
325
339
|
name: StringConstructor;
|
|
326
340
|
ariaLabel: StringConstructor;
|
|
@@ -445,6 +459,7 @@ export declare const EpInput: {
|
|
|
445
459
|
nonzero: boolean;
|
|
446
460
|
placeholder: string;
|
|
447
461
|
thousand: boolean;
|
|
462
|
+
clearableFocus: boolean;
|
|
448
463
|
inputmode: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown>;
|
|
449
464
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
450
465
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -16,6 +16,10 @@ export declare const inputProps: {
|
|
|
16
16
|
readonly default: true;
|
|
17
17
|
readonly prototype: Boolean;
|
|
18
18
|
};
|
|
19
|
+
readonly clearableFocus: {
|
|
20
|
+
readonly type: BooleanConstructor;
|
|
21
|
+
readonly default: true;
|
|
22
|
+
};
|
|
19
23
|
readonly inputmode: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
20
24
|
readonly name: StringConstructor;
|
|
21
25
|
readonly ariaLabel: StringConstructor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport {\n inputProps as elInputProps,\n inputEmits as elInputEmits,\n} from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nconst { t } = useLocale()\n\nexport const inputProps = {\n ...elInputProps,\n max: Number,\n min: Number,\n radix: Number,\n nonzero: Boolean,\n placeholder: {\n type: String,\n default: () => {\n return t('ep.input.placeholder')\n },\n },\n thousand: {\n type: Boolean,\n default: true,\n },\n clearable: {\n ...elInputProps.clearable,\n default: true,\n },\n} as const\nexport type InputProps = ExtractPropTypes<typeof inputProps>\nexport const inputEmits = {\n ...elInputEmits,\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type InputEmits = typeof inputEmits\nexport const inputEmitsKeys = Object.keys(inputEmits)\n\n// max: Number,\n// min: Number,\n// nonzero: Boolean,\n// format: Function,\n// radix: {\n// type: [String, Number],\n// default: 5,\n// },\n// thousand: {\n// type: Boolean,\n// default: false,\n// },\n"],"names":["useLocale","elInputProps","elInputEmits"],"mappings":";;;;;AAMA,MAAM,EAAE,CAAA,EAAE,GAAIA,mBAAA,EAAU;AAEjB,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGC,sBAAA;AAAA,EACH,GAAA,EAAK,MAAA;AAAA,EACL,GAAA,EAAK,MAAA;AAAA,EACL,KAAA,EAAO,MAAA;AAAA,EACP,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,MAAA;AAAA,IACN,SAAS,MAAM;AACb,MAAA,OAAO,EAAE,sBAAsB,CAAA;AAAA,IACjC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,GAAGA,sBAAA,CAAa,SAAA;AAAA,IAChB,OAAA,EAAS;AAAA;AAEb;AAEO,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGC,sBAAA;AAAA,EACH,KAAA,EAAO,CAAC,GAAA,KAAoB,GAAA,YAAe;AAC7C;AAEO,MAAM,cAAA,GAAiB,MAAA,CAAO,IAAA,CAAK,UAAU;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport {\n inputProps as elInputProps,\n inputEmits as elInputEmits,\n} from 'element-plus'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nconst { t } = useLocale()\n\nexport const inputProps = {\n ...elInputProps,\n max: Number,\n min: Number,\n radix: Number,\n nonzero: Boolean,\n placeholder: {\n type: String,\n default: () => {\n return t('ep.input.placeholder')\n },\n },\n thousand: {\n type: Boolean,\n default: true,\n },\n clearable: {\n ...elInputProps.clearable,\n default: true,\n },\n clearableFocus: {\n type: Boolean,\n default: true,\n },\n} as const\nexport type InputProps = ExtractPropTypes<typeof inputProps>\nexport const inputEmits = {\n ...elInputEmits,\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type InputEmits = typeof inputEmits\nexport const inputEmitsKeys = Object.keys(inputEmits)\n\n// max: Number,\n// min: Number,\n// nonzero: Boolean,\n// format: Function,\n// radix: {\n// type: [String, Number],\n// default: 5,\n// },\n// thousand: {\n// type: Boolean,\n// default: false,\n// },\n"],"names":["useLocale","elInputProps","elInputEmits"],"mappings":";;;;;AAMA,MAAM,EAAE,CAAA,EAAE,GAAIA,mBAAA,EAAU;AAEjB,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGC,sBAAA;AAAA,EACH,GAAA,EAAK,MAAA;AAAA,EACL,GAAA,EAAK,MAAA;AAAA,EACL,KAAA,EAAO,MAAA;AAAA,EACP,OAAA,EAAS,OAAA;AAAA,EACT,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,MAAA;AAAA,IACN,SAAS,MAAM;AACb,MAAA,OAAO,EAAE,sBAAsB,CAAA;AAAA,IACjC;AAAA,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,GAAGA,sBAAA,CAAa,SAAA;AAAA,IAChB,OAAA,EAAS;AAAA,GACX;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb;AAEO,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGC,sBAAA;AAAA,EACH,KAAA,EAAO,CAAC,GAAA,KAAoB,GAAA,YAAe;AAC7C;AAEO,MAAM,cAAA,GAAiB,MAAA,CAAO,IAAA,CAAK,UAAU;;;;;;"}
|
|
@@ -19,6 +19,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
19
19
|
readonly default: true;
|
|
20
20
|
readonly prototype: Boolean;
|
|
21
21
|
};
|
|
22
|
+
clearableFocus: {
|
|
23
|
+
readonly type: BooleanConstructor;
|
|
24
|
+
readonly default: true;
|
|
25
|
+
};
|
|
22
26
|
inputmode: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
23
27
|
name: StringConstructor;
|
|
24
28
|
ariaLabel: StringConstructor;
|
|
@@ -136,6 +140,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
136
140
|
readonly default: true;
|
|
137
141
|
readonly prototype: Boolean;
|
|
138
142
|
};
|
|
143
|
+
clearableFocus: {
|
|
144
|
+
readonly type: BooleanConstructor;
|
|
145
|
+
readonly default: true;
|
|
146
|
+
};
|
|
139
147
|
inputmode: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown, undefined, boolean>;
|
|
140
148
|
name: StringConstructor;
|
|
141
149
|
ariaLabel: StringConstructor;
|
|
@@ -246,6 +254,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
246
254
|
nonzero: boolean;
|
|
247
255
|
placeholder: string;
|
|
248
256
|
thousand: boolean;
|
|
257
|
+
clearableFocus: boolean;
|
|
249
258
|
inputmode: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined) | ((new (...args: any[]) => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal") | (() => "search" | "text" | "none" | "url" | "email" | "tel" | "numeric" | "decimal" | undefined))[], unknown, unknown>;
|
|
250
259
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
251
260
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -32,6 +32,14 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
32
32
|
...props.prepareProps(props$1, ["modelValue"]),
|
|
33
33
|
...props.prepareEvents(emit, input.inputEmitsKeys),
|
|
34
34
|
placeholder: props$1.disabled ? "" : props$1.placeholder,
|
|
35
|
+
onClear: () => {
|
|
36
|
+
emit("clear");
|
|
37
|
+
if (!props$1.clearableFocus) {
|
|
38
|
+
vue.nextTick(() => {
|
|
39
|
+
inputRef.value?.blur?.();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
},
|
|
35
43
|
onFocus: (e) => {
|
|
36
44
|
isFocusing = true;
|
|
37
45
|
if (props$1.thousand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue2.js","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <el-input\n ref=\"inputRef\"\n v-model=\"value\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n v-bind=\"customAttrs\"\n :type=\"type === 'number' ? 'text' : type\"\n >\n <template v-for=\"name in slots\" #[name]=\"scope\">\n <slot :name=\"name\" v-bind=\"scope\" />\n </template>\n </el-input>\n</template>\n<script setup lang=\"ts\">\nimport { computed, useSlots, watch, ref, nextTick} from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { inputProps, inputEmits, inputEmitsKeys } from './input'\nimport type { InputProps, InputEmits } from './input'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\ndefineOptions({\n name: 'EpInput',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('input')\nconst props = defineProps(inputProps)\nconst emit = defineEmits(inputEmits)\nconst slots = computed(() => {\n return Object.keys(useSlots())\n})\nlet isBluring = false\nlet isFocusing = false\nconst customAttrs = computed(() => {\n return {\n ...prepareProps(props, ['modelValue']),\n ...prepareEvents<InputEmits>(emit, inputEmitsKeys),\n placeholder: props.disabled ? '' : props.placeholder,\n onFocus: (e: FocusEvent) => {\n isFocusing = true\n if (props.thousand) {\n ;(e.target as HTMLInputElement).value = value.value\n ? String(value.value)\n : ''\n }\n emit('focus', e)\n },\n onBlur: (e: FocusEvent) => {\n if (props.type === 'number') {\n let val = value.value as string\n if (props.nonzero && +val === 0) {\n val = ''\n }\n if (val && val[val.length - 1] === '.') {\n val = String(val).slice(0, -1)\n }\n\n if (val && val === '-') {\n val = ''\n }\n value.value = val ? +val : val\n ;(e.target as HTMLInputElement).value =value.value? toThousand(value.value):''\n }\n isBluring = true\n isFocusing = false\n emit('blur', e)\n },\n }\n})\nconst value = defineModel<InputProps['modelValue']>()\nconst inputRef = ref()\nconst toThousand = (val: string | number) => {\n if (props.thousand) {\n return val ? window.hx.thousand(val) : val\n }\n return val\n}\nwatch(\n () => value.value,\n (val) => {\n if (props.type === 'number' && !isFocusing) {\n nextTick(() => {\n inputRef.value.input.value = val?toThousand(val as number):''\n })\n }\n if (isBluring) {\n isBluring = false\n return\n }\n if (!isFocusing) {\n return\n }\n if (props.type === 'number') {\n if (typeof val === 'number') {\n val = '' + val\n }\n if (typeof val === 'string') {\n // 校验一次是否0+数字开头,这种情况直接把0去除\n const zeroReg = new RegExp('^[-+]?0[0-9]\\\\d*')\n if (zeroReg.test(val)) {\n val = val.replace('0', '')\n }\n const reg = new RegExp('^([-+])?\\\\d*(\\\\.?\\\\d*)', 'g')\n val = val.match(reg) ? val.match(reg)![0] : ''\n\n // 限制小数位数\n if (props.radix || props.radix === 0) {\n const reg =\n props.radix === 0\n ? new RegExp('^([-+])?\\\\d*', 'g')\n : new RegExp(`^([-+])?\\\\d*(\\\\.?\\\\d{0,${props.radix}})`, 'g')\n val = val.match(reg) ? val.match(reg)![0] : ''\n }\n if ((props.max || props.max === 0) && +val > props.max) {\n val = props.max\n }\n // 最大最小值\n if (\n (props.min || props.min === 0) &&\n (val || val === 0) &&\n +val < props.min\n ) {\n val = props.min\n }\n }\n } else if (props.type === 'text') {\n val = (val as string).trim()\n }\n value.value = val\n },\n {\n immediate: true,\n },\n)\n</script>\n"],"names":["bem","createNameSpace","props","computed","useSlots","prepareProps","prepareEvents","inputEmitsKeys","_useModel","ref","watch","
|
|
1
|
+
{"version":3,"file":"input.vue2.js","sources":["../../../../../../packages/components/input/src/input.vue"],"sourcesContent":["<template>\n <el-input\n ref=\"inputRef\"\n v-model=\"value\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n v-bind=\"customAttrs\"\n :type=\"type === 'number' ? 'text' : type\"\n >\n <template v-for=\"name in slots\" #[name]=\"scope\">\n <slot :name=\"name\" v-bind=\"scope\" />\n </template>\n </el-input>\n</template>\n<script setup lang=\"ts\">\nimport { computed, useSlots, watch, ref, nextTick} from 'vue'\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { inputProps, inputEmits, inputEmitsKeys } from './input'\nimport type { InputProps, InputEmits } from './input'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\ndefineOptions({\n name: 'EpInput',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('input')\nconst props = defineProps(inputProps)\nconst emit = defineEmits(inputEmits)\nconst slots = computed(() => {\n return Object.keys(useSlots())\n})\nlet isBluring = false\nlet isFocusing = false\nconst customAttrs = computed(() => {\n return {\n ...prepareProps(props, ['modelValue']),\n ...prepareEvents<InputEmits>(emit, inputEmitsKeys),\n placeholder: props.disabled ? '' : props.placeholder,\n onClear: () => {\n emit('clear')\n if (!props.clearableFocus) {\n nextTick(() => {\n inputRef.value?.blur?.()\n })\n }\n },\n onFocus: (e: FocusEvent) => {\n isFocusing = true\n if (props.thousand) {\n ;(e.target as HTMLInputElement).value = value.value\n ? String(value.value)\n : ''\n }\n emit('focus', e)\n },\n onBlur: (e: FocusEvent) => {\n if (props.type === 'number') {\n let val = value.value as string\n if (props.nonzero && +val === 0) {\n val = ''\n }\n if (val && val[val.length - 1] === '.') {\n val = String(val).slice(0, -1)\n }\n\n if (val && val === '-') {\n val = ''\n }\n value.value = val ? +val : val\n ;(e.target as HTMLInputElement).value =value.value? toThousand(value.value):''\n }\n isBluring = true\n isFocusing = false\n emit('blur', e)\n },\n }\n})\nconst value = defineModel<InputProps['modelValue']>()\nconst inputRef = ref()\nconst toThousand = (val: string | number) => {\n if (props.thousand) {\n return val ? window.hx.thousand(val) : val\n }\n return val\n}\nwatch(\n () => value.value,\n (val) => {\n if (props.type === 'number' && !isFocusing) {\n nextTick(() => {\n inputRef.value.input.value = val?toThousand(val as number):''\n })\n }\n if (isBluring) {\n isBluring = false\n return\n }\n if (!isFocusing) {\n return\n }\n if (props.type === 'number') {\n if (typeof val === 'number') {\n val = '' + val\n }\n if (typeof val === 'string') {\n // 校验一次是否0+数字开头,这种情况直接把0去除\n const zeroReg = new RegExp('^[-+]?0[0-9]\\\\d*')\n if (zeroReg.test(val)) {\n val = val.replace('0', '')\n }\n const reg = new RegExp('^([-+])?\\\\d*(\\\\.?\\\\d*)', 'g')\n val = val.match(reg) ? val.match(reg)![0] : ''\n\n // 限制小数位数\n if (props.radix || props.radix === 0) {\n const reg =\n props.radix === 0\n ? new RegExp('^([-+])?\\\\d*', 'g')\n : new RegExp(`^([-+])?\\\\d*(\\\\.?\\\\d{0,${props.radix}})`, 'g')\n val = val.match(reg) ? val.match(reg)![0] : ''\n }\n if ((props.max || props.max === 0) && +val > props.max) {\n val = props.max\n }\n // 最大最小值\n if (\n (props.min || props.min === 0) &&\n (val || val === 0) &&\n +val < props.min\n ) {\n val = props.min\n }\n }\n } else if (props.type === 'text') {\n val = (val as string).trim()\n }\n value.value = val\n },\n {\n immediate: true,\n },\n)\n</script>\n"],"names":["bem","createNameSpace","props","computed","useSlots","prepareProps","prepareEvents","inputEmitsKeys","nextTick","_useModel","ref","watch","reg","_openBlock","_createBlock","_mergeProps","_unref","prepareClassNames","prepareStyles","type","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAMA,KAAA,GAAMC,oBAAgB,OAAO,CAAA;AACnC,IAAA,MAAMC,OAAA,GAAQ,OAAA;AACd,IAAA,MAAM,IAAA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,KAAA,KAAK;AAAA,cAC5CC,cAAA,CAAoC,KAAA,MAAA,EAAvB,IAAA,EAAIC,mBAAAC,sBAAA,CAAU,KAAK,CAAA,CAAA;AAAA;;;;;;;;;;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export declare const EpSelect: {
|
|
2
2
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
3
|
+
desc: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
3
7
|
disabledOption: {
|
|
4
8
|
type: import("vue").PropType<(item: import("./src/select").SelectOption) => boolean>;
|
|
5
9
|
default: () => boolean;
|
|
@@ -147,9 +151,6 @@ export declare const EpSelect: {
|
|
|
147
151
|
__epPropKey: true;
|
|
148
152
|
};
|
|
149
153
|
props: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps.js").Props>, boolean>;
|
|
150
|
-
desc: {
|
|
151
|
-
type: import("vue").PropType<string>;
|
|
152
|
-
};
|
|
153
154
|
}>> & Readonly<{
|
|
154
155
|
onClear?: (() => any) | undefined;
|
|
155
156
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
@@ -162,7 +163,6 @@ export declare const EpSelect: {
|
|
|
162
163
|
}) => any) | undefined;
|
|
163
164
|
"onRemove-tag"?: ((val: unknown) => any) | undefined;
|
|
164
165
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
165
|
-
"onUpdate:desc"?: ((value: string | undefined) => any) | undefined;
|
|
166
166
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
167
167
|
clear: () => void;
|
|
168
168
|
blur: (evt: FocusEvent) => void;
|
|
@@ -175,8 +175,8 @@ export declare const EpSelect: {
|
|
|
175
175
|
}) => void;
|
|
176
176
|
"remove-tag": (val: unknown) => void;
|
|
177
177
|
"visible-change": (visible: boolean) => void;
|
|
178
|
-
"update:desc": (value: string | undefined) => void;
|
|
179
178
|
}, import("vue").PublicProps, {
|
|
179
|
+
desc: string;
|
|
180
180
|
loading: boolean;
|
|
181
181
|
offset: number;
|
|
182
182
|
placement: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | ((new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement))[], import("element-plus").Placement, unknown>;
|
|
@@ -223,6 +223,10 @@ export declare const EpSelect: {
|
|
|
223
223
|
M: {};
|
|
224
224
|
Defaults: {};
|
|
225
225
|
}, Readonly<import("vue").ExtractPropTypes<{
|
|
226
|
+
desc: {
|
|
227
|
+
type: StringConstructor;
|
|
228
|
+
default: string;
|
|
229
|
+
};
|
|
226
230
|
disabledOption: {
|
|
227
231
|
type: import("vue").PropType<(item: import("./src/select").SelectOption) => boolean>;
|
|
228
232
|
default: () => boolean;
|
|
@@ -370,9 +374,6 @@ export declare const EpSelect: {
|
|
|
370
374
|
__epPropKey: true;
|
|
371
375
|
};
|
|
372
376
|
props: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps.js").Props>, boolean>;
|
|
373
|
-
desc: {
|
|
374
|
-
type: import("vue").PropType<string>;
|
|
375
|
-
};
|
|
376
377
|
}>> & Readonly<{
|
|
377
378
|
onClear?: (() => any) | undefined;
|
|
378
379
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
@@ -385,8 +386,8 @@ export declare const EpSelect: {
|
|
|
385
386
|
}) => any) | undefined;
|
|
386
387
|
"onRemove-tag"?: ((val: unknown) => any) | undefined;
|
|
387
388
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
388
|
-
"onUpdate:desc"?: ((value: string | undefined) => any) | undefined;
|
|
389
389
|
}>, {}, {}, {}, {}, {
|
|
390
|
+
desc: string;
|
|
390
391
|
loading: boolean;
|
|
391
392
|
offset: number;
|
|
392
393
|
placement: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | ((new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement))[], import("element-plus").Placement, unknown>;
|
|
@@ -430,6 +431,10 @@ export declare const EpSelect: {
|
|
|
430
431
|
__isTeleport?: never;
|
|
431
432
|
__isSuspense?: never;
|
|
432
433
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
434
|
+
desc: {
|
|
435
|
+
type: StringConstructor;
|
|
436
|
+
default: string;
|
|
437
|
+
};
|
|
433
438
|
disabledOption: {
|
|
434
439
|
type: import("vue").PropType<(item: import("./src/select").SelectOption) => boolean>;
|
|
435
440
|
default: () => boolean;
|
|
@@ -577,9 +582,6 @@ export declare const EpSelect: {
|
|
|
577
582
|
__epPropKey: true;
|
|
578
583
|
};
|
|
579
584
|
props: import("element-plus/es/utils/index.js").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps.js").Props) | (() => import("element-plus/es/components/select-v2/src/useProps.js").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps.js").Props>, boolean>;
|
|
580
|
-
desc: {
|
|
581
|
-
type: import("vue").PropType<string>;
|
|
582
|
-
};
|
|
583
585
|
}>> & Readonly<{
|
|
584
586
|
onClear?: (() => any) | undefined;
|
|
585
587
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
@@ -592,7 +594,6 @@ export declare const EpSelect: {
|
|
|
592
594
|
}) => any) | undefined;
|
|
593
595
|
"onRemove-tag"?: ((val: unknown) => any) | undefined;
|
|
594
596
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
595
|
-
"onUpdate:desc"?: ((value: string | undefined) => any) | undefined;
|
|
596
597
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
597
598
|
clear: () => void;
|
|
598
599
|
blur: (evt: FocusEvent) => void;
|
|
@@ -605,8 +606,8 @@ export declare const EpSelect: {
|
|
|
605
606
|
}) => void;
|
|
606
607
|
"remove-tag": (val: unknown) => void;
|
|
607
608
|
"visible-change": (visible: boolean) => void;
|
|
608
|
-
"update:desc": (value: string | undefined) => void;
|
|
609
609
|
}, string, {
|
|
610
|
+
desc: string;
|
|
610
611
|
loading: boolean;
|
|
611
612
|
offset: number;
|
|
612
613
|
placement: import("element-plus/es/utils/index.js").EpPropMergeType<(new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | ((new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement))[], import("element-plus").Placement, unknown>;
|
|
@@ -115,6 +115,10 @@ export declare const inheritSelectProps: {
|
|
|
115
115
|
readonly props: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps").Props>, boolean>;
|
|
116
116
|
};
|
|
117
117
|
export declare const selectProps: {
|
|
118
|
+
readonly desc: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
118
122
|
readonly disabledOption: {
|
|
119
123
|
type: PropType<(item: SelectOption) => boolean>;
|
|
120
124
|
default: () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../../../../../packages/components/select/src/select.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType, ExtractPublicPropTypes } from 'vue'\nimport {\n selectProps as elSelectProps,\n selectEmits as elSelectEmits,\n type SelectProps as ElSelectProps,\n} from 'element-plus'\nimport { apiProps } from '@el-plus/utils/props'\n\nexport type SelectOption = NonNullable<ElSelectProps['options']>[number]\nexport const inheritSelectProps = {\n ...elSelectProps,\n clearable: {\n ...elSelectProps.clearable,\n default: true,\n },\n} as const\nconst expandSelectProps = {\n ...apiProps,\n disabledOption: {\n type: Function as PropType<(item: SelectOption) => boolean>,\n default: () => false,\n },\n labelKey: {\n type: String,\n default: 'label',\n },\n valueKey: {\n type: String,\n default: 'value',\n },\n formatLabel: {\n type: Function as PropType<(item: SelectOption) => string>,\n },\n // api模式生效\n lazy: Boolean,\n // option是否同时展示code label, 默认值展示label, 传string展示指定字段\n codeInLabel: {\n type: [String, Boolean] as PropType<boolean | string>,\n },\n}\nexport const selectProps = {\n ...inheritSelectProps,\n ...expandSelectProps,\n} as const\nexport const expandSelectPropsKeys = Object.keys(expandSelectProps)\n\nexport type SelectProps = ExtractPropTypes<typeof selectProps>\nexport type SelectPropsPublic = ExtractPublicPropTypes<typeof selectProps>\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectEmits = {\n ...elSelectEmits,\n change: (\n value: SelectProps['modelValue'],\n item?: SelectOption | SelectOption[],\n ) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\nexport type SelectEmits = typeof selectEmits\nexport const selectEmitsKeys = Object.keys(selectEmits)\n"],"names":["elSelectProps","apiProps","elSelectEmits"],"mappings":";;;;;AASO,MAAM,kBAAA,GAAqB;AAAA,EAChC,GAAGA,uBAAA;AAAA,EACH,SAAA,EAAW;AAAA,IACT,GAAGA,uBAAA,CAAc,SAAA;AAAA,IACjB,OAAA,EAAS;AAAA;AAEb;AACA,MAAM,iBAAA,GAAoB;AAAA,EACxB,GAAGC,cAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../../../../../packages/components/select/src/select.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType, ExtractPublicPropTypes } from 'vue'\nimport {\n selectProps as elSelectProps,\n selectEmits as elSelectEmits,\n type SelectProps as ElSelectProps,\n} from 'element-plus'\nimport { apiProps } from '@el-plus/utils/props'\n\nexport type SelectOption = NonNullable<ElSelectProps['options']>[number]\nexport const inheritSelectProps = {\n ...elSelectProps,\n clearable: {\n ...elSelectProps.clearable,\n default: true,\n },\n} as const\nconst expandSelectProps = {\n ...apiProps,\n // 回显文本:异步 value 到达时,用 desc 构造占位项(只读)\n desc: {\n type: String,\n default: '',\n },\n disabledOption: {\n type: Function as PropType<(item: SelectOption) => boolean>,\n default: () => false,\n },\n labelKey: {\n type: String,\n default: 'label',\n },\n valueKey: {\n type: String,\n default: 'value',\n },\n formatLabel: {\n type: Function as PropType<(item: SelectOption) => string>,\n },\n // api模式生效\n lazy: Boolean,\n // option是否同时展示code label, 默认值展示label, 传string展示指定字段\n codeInLabel: {\n type: [String, Boolean] as PropType<boolean | string>,\n },\n}\nexport const selectProps = {\n ...inheritSelectProps,\n ...expandSelectProps,\n} as const\nexport const expandSelectPropsKeys = Object.keys(expandSelectProps)\n\nexport type SelectProps = ExtractPropTypes<typeof selectProps>\nexport type SelectPropsPublic = ExtractPublicPropTypes<typeof selectProps>\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\nexport const selectEmits = {\n ...elSelectEmits,\n change: (\n value: SelectProps['modelValue'],\n item?: SelectOption | SelectOption[],\n ) => true,\n}\n/* eslint-enable @typescript-eslint/no-unused-vars */\nexport type SelectEmits = typeof selectEmits\nexport const selectEmitsKeys = Object.keys(selectEmits)\n"],"names":["elSelectProps","apiProps","elSelectEmits"],"mappings":";;;;;AASO,MAAM,kBAAA,GAAqB;AAAA,EAChC,GAAGA,uBAAA;AAAA,EACH,SAAA,EAAW;AAAA,IACT,GAAGA,uBAAA,CAAc,SAAA;AAAA,IACjB,OAAA,EAAS;AAAA;AAEb;AACA,MAAM,iBAAA,GAAoB;AAAA,EACxB,GAAGC,cAAA;AAAA;AAAA,EAEH,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,GACjB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM;AAAA,GACR;AAAA;AAAA,EAEA,IAAA,EAAM,OAAA;AAAA;AAAA,EAEN,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,CAAC,MAAA,EAAQ,OAAO;AAAA;AAE1B,CAAA;AACO,MAAM,WAAA,GAAc;AAAA,EACzB,GAAG,kBAAA;AAAA,EACH,GAAG;AACL;AACO,MAAM,qBAAA,GAAwB,MAAA,CAAO,IAAA,CAAK,iBAAiB;AAM3D,MAAM,WAAA,GAAc;AAAA,EACzB,GAAGC,uBAAA;AAAA,EACH,MAAA,EAAQ,CACN,KAAA,EACA,IAAA,KACG;AACP;AAGO,MAAM,eAAA,GAAkB,MAAA,CAAO,IAAA,CAAK,WAAW;;;;;;;;"}
|
|
@@ -7,6 +7,10 @@ type __VLS_Slots = {} & {
|
|
|
7
7
|
option?: (props: typeof __VLS_14) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
desc: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
10
14
|
disabledOption: {
|
|
11
15
|
type: import("vue").PropType<(item: import("./select").SelectOption) => boolean>;
|
|
12
16
|
default: () => boolean;
|
|
@@ -154,9 +158,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
154
158
|
__epPropKey: true;
|
|
155
159
|
};
|
|
156
160
|
props: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps").Props>, boolean>;
|
|
157
|
-
desc: {
|
|
158
|
-
type: import("vue").PropType<string>;
|
|
159
|
-
};
|
|
160
161
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
161
162
|
clear: () => void;
|
|
162
163
|
blur: (evt: FocusEvent) => void;
|
|
@@ -169,8 +170,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
169
170
|
}) => void;
|
|
170
171
|
"remove-tag": (val: unknown) => void;
|
|
171
172
|
"visible-change": (visible: boolean) => void;
|
|
172
|
-
"update:desc": (value: string | undefined) => void;
|
|
173
173
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
174
|
+
desc: {
|
|
175
|
+
type: StringConstructor;
|
|
176
|
+
default: string;
|
|
177
|
+
};
|
|
174
178
|
disabledOption: {
|
|
175
179
|
type: import("vue").PropType<(item: import("./select").SelectOption) => boolean>;
|
|
176
180
|
default: () => boolean;
|
|
@@ -318,9 +322,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
318
322
|
__epPropKey: true;
|
|
319
323
|
};
|
|
320
324
|
props: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props) | ((new (...args: any[]) => import("element-plus/es/components/select-v2/src/useProps").Props) | (() => import("element-plus/es/components/select-v2/src/useProps").Props))[], unknown, unknown, () => Required<import("element-plus/es/components/select-v2/src/useProps").Props>, boolean>;
|
|
321
|
-
desc: {
|
|
322
|
-
type: import("vue").PropType<string>;
|
|
323
|
-
};
|
|
324
325
|
}>> & Readonly<{
|
|
325
326
|
onClear?: (() => any) | undefined;
|
|
326
327
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
@@ -333,8 +334,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
333
334
|
}) => any) | undefined;
|
|
334
335
|
"onRemove-tag"?: ((val: unknown) => any) | undefined;
|
|
335
336
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
336
|
-
"onUpdate:desc"?: ((value: string | undefined) => any) | undefined;
|
|
337
337
|
}>, {
|
|
338
|
+
desc: string;
|
|
338
339
|
loading: boolean;
|
|
339
340
|
offset: number;
|
|
340
341
|
placement: import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | ((new (...args: any[]) => "left" | "right" | "top" | "bottom" | "auto" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement))[], import("element-plus").Placement, unknown>;
|
|
@@ -16,11 +16,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
16
|
__name: "select",
|
|
17
17
|
props: /* @__PURE__ */ vue.mergeModels(select.selectProps, {
|
|
18
18
|
"modelValue": {},
|
|
19
|
-
"modelModifiers": {}
|
|
20
|
-
"desc": {},
|
|
21
|
-
"descModifiers": {}
|
|
19
|
+
"modelModifiers": {}
|
|
22
20
|
}),
|
|
23
|
-
emits: /* @__PURE__ */ vue.mergeModels(select.selectEmits, ["update:modelValue"
|
|
21
|
+
emits: /* @__PURE__ */ vue.mergeModels(select.selectEmits, ["update:modelValue"]),
|
|
24
22
|
setup(__props, { emit: __emit }) {
|
|
25
23
|
const bem$1 = bem.createNameSpace("select");
|
|
26
24
|
const props$1 = __props;
|
|
@@ -30,7 +28,6 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
30
28
|
});
|
|
31
29
|
const { customOptions, loadOptions, expandAttrs } = useSelect.useSelect(props$1, emit);
|
|
32
30
|
const value = vue.useModel(__props, "modelValue");
|
|
33
|
-
const desc = vue.useModel(__props, "desc");
|
|
34
31
|
const customAttrs = vue.computed(() => {
|
|
35
32
|
return {
|
|
36
33
|
...props.prepareProps(props$1, ["modelValue", "desc", ...select.expandSelectPropsKeys]),
|
|
@@ -38,11 +35,11 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
38
35
|
...expandAttrs.value
|
|
39
36
|
};
|
|
40
37
|
});
|
|
41
|
-
loadOptions(
|
|
38
|
+
loadOptions();
|
|
42
39
|
vue.watch(
|
|
43
40
|
() => props$1.options,
|
|
44
41
|
() => {
|
|
45
|
-
loadOptions(
|
|
42
|
+
loadOptions();
|
|
46
43
|
},
|
|
47
44
|
{
|
|
48
45
|
deep: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.vue2.js","sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <el-select\n v-model=\"value\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n v-bind=\"customAttrs\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-option\n v-for=\"item in customOptions\"\n :key=\"item[valueKey]\"\n :class=\"bem.e('option')\"\n :label=\"\n item.formatLabel\n ? item.formatLabel(item)\n : formatLabel\n ? formatLabel(item)\n : item[labelKey]\n \"\n :value=\"item[valueKey]\"\n :disabled=\"disabledOption(item)\"\n >\n <slot name=\"option\" :item=\"item\">\n <template v-if=\"codeInLabel || codeInLabel === ''\">\n <span style=\"float: left\">{{ item[labelKey] }}</span>\n <span\n style=\"\n float: right;\n color: var(--el-text-color-secondary);\n font-size: 13px;\n \"\n >\n {{\n item[\n typeof codeInLabel === 'string' && codeInLabel\n ? codeInLabel\n : valueKey\n ]\n }}\n </span>\n </template>\n </slot>\n </el-option>\n <template v-for=\"name in slots\" #[name]=\"scope\">\n <slot :name=\"name\" v-bind=\"scope\" />\n </template>\n </el-select>\n</template>\n<script setup lang=\"ts\">\nimport { computed, useSlots, watch } from 'vue'\nimport {\n selectProps,\n selectEmits,\n expandSelectPropsKeys,\n selectEmitsKeys,\n} from './select'\nimport type { SelectProps, SelectEmits } from './select'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nimport { useSelect } from './use-select'\nimport { createNameSpace } from '@el-plus/utils/bem'\ndefineOptions({\n name: 'EpSelect',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('select')\nconst props = defineProps(selectProps)\nconst emit = defineEmits(selectEmits)\nconst slots = computed(() => {\n return Object.keys(useSlots())\n})\n\nconst { customOptions, loadOptions, expandAttrs } = useSelect(props, emit)\nconst value = defineModel<SelectProps['modelValue']>()\nconst
|
|
1
|
+
{"version":3,"file":"select.vue2.js","sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <el-select\n v-model=\"value\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n v-bind=\"customAttrs\"\n :style=\"{\n ...prepareStyles(),\n }\"\n >\n <el-option\n v-for=\"item in customOptions\"\n :key=\"item[valueKey]\"\n :class=\"bem.e('option')\"\n :label=\"\n item.formatLabel\n ? item.formatLabel(item)\n : formatLabel\n ? formatLabel(item)\n : item[labelKey]\n \"\n :value=\"item[valueKey]\"\n :disabled=\"disabledOption(item)\"\n >\n <slot name=\"option\" :item=\"item\">\n <template v-if=\"codeInLabel || codeInLabel === ''\">\n <span style=\"float: left\">{{ item[labelKey] }}</span>\n <span\n style=\"\n float: right;\n color: var(--el-text-color-secondary);\n font-size: 13px;\n \"\n >\n {{\n item[\n typeof codeInLabel === 'string' && codeInLabel\n ? codeInLabel\n : valueKey\n ]\n }}\n </span>\n </template>\n </slot>\n </el-option>\n <template v-for=\"name in slots\" #[name]=\"scope\">\n <slot :name=\"name\" v-bind=\"scope\" />\n </template>\n </el-select>\n</template>\n<script setup lang=\"ts\">\nimport { computed, useSlots, watch } from 'vue'\nimport {\n selectProps,\n selectEmits,\n expandSelectPropsKeys,\n selectEmitsKeys,\n} from './select'\nimport type { SelectProps, SelectEmits } from './select'\nimport {\n prepareProps,\n prepareEvents,\n prepareClassNames,\n prepareStyles,\n} from '@el-plus/utils/props'\nimport { useSelect } from './use-select'\nimport { createNameSpace } from '@el-plus/utils/bem'\ndefineOptions({\n name: 'EpSelect',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('select')\nconst props = defineProps(selectProps)\nconst emit = defineEmits(selectEmits)\nconst slots = computed(() => {\n return Object.keys(useSlots())\n})\n\nconst { customOptions, loadOptions, expandAttrs } = useSelect(props, emit)\nconst value = defineModel<SelectProps['modelValue']>()\nconst customAttrs = computed(() => {\n return {\n ...prepareProps(props, ['modelValue', 'desc', ...expandSelectPropsKeys]),\n ...prepareEvents<SelectEmits>(emit, selectEmitsKeys),\n ...expandAttrs.value,\n }\n})\n// 回显由 echoOption computed 自动处理,这里只负责加载选项\nloadOptions()\nwatch(\n () => props.options,\n () => {\n loadOptions()\n },\n {\n deep: true,\n },\n)\n</script>\n"],"names":["bem","createNameSpace","props","computed","useSlots","useSelect","_useModel","prepareProps","expandSelectPropsKeys","prepareEvents","selectEmitsKeys","watch","_openBlock","_createBlock","_mergeProps","_unref","prepareClassNames","prepareStyles","_createElementBlock","_Fragment","_renderList","valueKey","_normalizeClass","formatLabel","labelKey","disabledOption","_renderSlot","codeInLabel","_createElementVNode","_toDisplayString","_withCtx","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsEA,IAAA,MAAMA,KAAA,GAAMC,oBAAgB,QAAQ,CAAA;AACpC,IAAA,MAAMC,OAAA,GAAQ,OAAA;AACd,IAAA,MAAM,IAAA,GAAO,MAAA;AACb,IAAA,MAAM,KAAA,GAAQC,aAAS,MAAM;AAC3B,MAAA,OAAO,MAAA,CAAO,IAAA,CAAKC,YAAA,EAAU,CAAA;AAAA,IAC/B,CAAC,CAAA;AAED,IAAA,MAAM,EAAE,aAAA,EAAe,WAAA,EAAa,aAAY,GAAIC,mBAAA,CAAUH,SAAO,IAAI,CAAA;AACzE,IAAA,MAAM,KAAA,GAAQI,YAAA,CAAsC,OAAA,EAAA,YAAC,CAAA;AACrD,IAAA,MAAM,WAAA,GAAcH,aAAS,MAAM;AACjC,MAAA,OAAO;AAAA,QACL,GAAGI,mB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AAY,IAAI,CAAA,GAAgB,IAAA,CAAKC,KAAAA,QAAQ,CAAA;AAAA,cAOvJ,KAAA,EAAO,IAAA,CAAKH,IAAAA,CAAAA,QAAQ,CAAA;AAAA,cACpB,QAAA,EAAUI,IAAAA,CAAAA,cAAAA,CAAe,IAAI;AAAA;mCAE9B,MAmBO;AAAA,gBAnBPC,eAmBO,IAAA,CAAA,MAAA,EAAA,UAAA,EAnBc,IAAA,IAArB,MAmBO;AAAA,kBAlBWC,IAAAA,CAAAA,WAAAA,IAAeA,IAAAA,CAAAA,WAAAA,KAAW,EAAA,qBAA1CT,sBAAA,CAiBWC,YAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,EAAA;AAAA,oBAhBTS,sBAAA,CAAqD,MAAA,IAA/C,KAAA,EAAA,qBAAmB,EAAAC,oBAAI,IAAA,CAAKL,IAAAA,CAAAA,QAAQ,CAAA,GAAA,CAAA,CAAA;AAAA,oBAC1CI,sBAAA,CAcO,MAAA,EAAA,EAbL,KAAA,EAAA,EAAA,OAAA,EAAA,OAAA,EAAA,OAAA,EAAA,gCAAA,EAAA,WAAA,EAAA,MAAA,EAAA,wBAOE,IAAA,CAA6BD,OAAAA,IAAAA,CAAAA,WAAAA,iBAA4BA,IAAAA,CAAAA,WAAAA,GAAgCA,IAAAA,CAAAA,WAAAA,GAAgCN,IAAAA,CAAAA;;;;;;;;;;QAU1GD,cAAA,CAAA,KAAA,CAAA,KAAA,GAAR,IAAA,KAAI;;;YACnB,EAAA,EAAAU,WAAA,CAAA,CADuC,KAAA,KAAK;AAAA,cAC5CJ,cAAA,CAAoC,KAAA,MAAA,EAAvB,IAAA,EAAIK,mBAAAC,sBAAA,CAAU,KAAK,CAAA,CAAA;AAAA;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SetupContext } from 'vue';
|
|
2
2
|
import type { SelectProps, SelectEmits } from './select';
|
|
3
3
|
export declare function useSelect(props: SelectProps, emit: SetupContext<SelectEmits>['emit']): {
|
|
4
|
-
customOptions: import("vue").
|
|
5
|
-
loadOptions: (
|
|
4
|
+
customOptions: import("vue").ComputedRef<Record<string, any>[]>;
|
|
5
|
+
loadOptions: () => void;
|
|
6
6
|
expandAttrs: import("vue").ComputedRef<{
|
|
7
7
|
loading: boolean | undefined;
|
|
8
8
|
remoteMethod: (query: string) => void;
|