el-plus 0.0.109 → 0.0.111
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 +33 -8
- 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 +33 -9
- package/es/components/index.mjs +1 -1
- package/es/components/input/index.d.ts +20 -0
- package/es/components/input/src/input.d.ts +5 -0
- package/es/components/input/src/input.mjs +6 -1
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input.vue.d.ts +11 -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/search-list-page/index.d.ts +18 -5
- package/es/components/search-list-page/index.mjs +1 -1
- package/es/components/search-list-page/src/search-list-page.d.ts +5 -0
- package/es/components/search-list-page/src/search-list-page.mjs +7 -1
- package/es/components/search-list-page/src/search-list-page.mjs.map +1 -1
- package/es/components/search-list-page/src/search-list-page.vue.d.ts +8 -2
- package/es/components/search-list-page/src/search-list-page.vue2.mjs +5 -3
- package/es/components/search-list-page/src/search-list-page.vue2.mjs.map +1 -1
- package/es/components/search-list-page/src/use-search-list-page.d.ts +3 -2
- package/es/components/search-list-page/src/use-search-list-page.mjs +6 -3
- package/es/components/search-list-page/src/use-search-list-page.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/package.json.mjs +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/index.d.ts +20 -0
- package/lib/components/input/src/input.d.ts +5 -0
- package/lib/components/input/src/input.js +6 -1
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input.vue.d.ts +11 -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/search-list-page/index.d.ts +18 -5
- package/lib/components/search-list-page/index.js +1 -0
- package/lib/components/search-list-page/index.js.map +1 -1
- package/lib/components/search-list-page/src/search-list-page.d.ts +5 -0
- package/lib/components/search-list-page/src/search-list-page.js +7 -0
- package/lib/components/search-list-page/src/search-list-page.js.map +1 -1
- package/lib/components/search-list-page/src/search-list-page.vue.d.ts +8 -2
- package/lib/components/search-list-page/src/search-list-page.vue2.js +4 -2
- package/lib/components/search-list-page/src/search-list-page.vue2.js.map +1 -1
- package/lib/components/search-list-page/src/use-search-list-page.d.ts +3 -2
- package/lib/components/search-list-page/src/use-search-list-page.js +6 -3
- package/lib/components/search-list-page/src/use-search-list-page.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/package.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ElPlus v0.0.
|
|
1
|
+
/*! ElPlus v0.0.111 */
|
|
2
2
|
|
|
3
3
|
import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, reactive, onBeforeUpdate, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, useSlots, watch, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw, onMounted } from 'vue';
|
|
4
4
|
import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, configProviderContextKey, ElConfigProvider, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1, ElSkeleton } from 'element-plus';
|
|
@@ -1143,10 +1143,15 @@ const inputProps = {
|
|
|
1143
1143
|
clearable: {
|
|
1144
1144
|
...inputProps$1.clearable,
|
|
1145
1145
|
default: true
|
|
1146
|
+
},
|
|
1147
|
+
clearableFocus: {
|
|
1148
|
+
type: Boolean,
|
|
1149
|
+
default: true
|
|
1146
1150
|
}
|
|
1147
1151
|
};
|
|
1148
1152
|
const inputEmits = {
|
|
1149
|
-
...inputEmits$1
|
|
1153
|
+
...inputEmits$1,
|
|
1154
|
+
click: (evt) => evt instanceof MouseEvent
|
|
1150
1155
|
};
|
|
1151
1156
|
const inputEmitsKeys = Object.keys(inputEmits);
|
|
1152
1157
|
|
|
@@ -1175,6 +1180,14 @@ var _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1175
1180
|
...prepareProps(props, ["modelValue"]),
|
|
1176
1181
|
...prepareEvents(emit, inputEmitsKeys),
|
|
1177
1182
|
placeholder: props.disabled ? "" : props.placeholder,
|
|
1183
|
+
onClear: () => {
|
|
1184
|
+
emit("clear");
|
|
1185
|
+
if (!props.clearableFocus) {
|
|
1186
|
+
nextTick(() => {
|
|
1187
|
+
inputRef.value?.blur?.();
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1178
1191
|
onFocus: (e) => {
|
|
1179
1192
|
isFocusing = true;
|
|
1180
1193
|
if (props.thousand) {
|
|
@@ -2618,6 +2631,8 @@ const searchListPageProps = {
|
|
|
2618
2631
|
},
|
|
2619
2632
|
add: Function,
|
|
2620
2633
|
// 新增
|
|
2634
|
+
clearBefore: Function,
|
|
2635
|
+
// 清空前钩子,返回 false 阻止清空
|
|
2621
2636
|
// templateDownloadApi: String, // 模板下载
|
|
2622
2637
|
// importApi: String, // 导入
|
|
2623
2638
|
// exportApi: String, // 导出
|
|
@@ -2641,6 +2656,10 @@ const searchListPageProps = {
|
|
|
2641
2656
|
default: true
|
|
2642
2657
|
}
|
|
2643
2658
|
};
|
|
2659
|
+
const searchListPageEmits = {
|
|
2660
|
+
// 点击「清空」按钮后触发
|
|
2661
|
+
clear: () => true
|
|
2662
|
+
};
|
|
2644
2663
|
|
|
2645
2664
|
const getAvailableHeight = (el) => {
|
|
2646
2665
|
const elRect = el.getBoundingClientRect();
|
|
@@ -2660,7 +2679,7 @@ const getAvailableHeight = (el) => {
|
|
|
2660
2679
|
}
|
|
2661
2680
|
return window.innerHeight - elRect.top;
|
|
2662
2681
|
};
|
|
2663
|
-
const useSearchListPage = (props, config = {}) => {
|
|
2682
|
+
const useSearchListPage = (props, config = {}, emit) => {
|
|
2664
2683
|
const rootRef = useTemplateRef("rootRef");
|
|
2665
2684
|
const topRef = useTemplateRef("topRef");
|
|
2666
2685
|
const middleRef = useTemplateRef("middleRef");
|
|
@@ -2671,7 +2690,8 @@ const useSearchListPage = (props, config = {}) => {
|
|
|
2671
2690
|
const { buttonsProps, searchButtons, search, reset } = useButtons$1(props, {
|
|
2672
2691
|
validate,
|
|
2673
2692
|
resetFields,
|
|
2674
|
-
tableRef
|
|
2693
|
+
tableRef,
|
|
2694
|
+
emit
|
|
2675
2695
|
});
|
|
2676
2696
|
return {
|
|
2677
2697
|
formProps,
|
|
@@ -2769,7 +2789,7 @@ const useForm = (props, { calcTableHeight }) => {
|
|
|
2769
2789
|
clearValidate
|
|
2770
2790
|
};
|
|
2771
2791
|
};
|
|
2772
|
-
const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
|
|
2792
|
+
const useButtons$1 = (props, { validate, resetFields, tableRef, emit }) => {
|
|
2773
2793
|
const { t } = useLocale();
|
|
2774
2794
|
const defaultButtons = [
|
|
2775
2795
|
{
|
|
@@ -2843,8 +2863,10 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
|
|
|
2843
2863
|
tableRef.value.search(isInitSearch);
|
|
2844
2864
|
};
|
|
2845
2865
|
const reset = async () => {
|
|
2866
|
+
if (props.clearBefore && props.clearBefore() === false) return;
|
|
2846
2867
|
resetFields();
|
|
2847
2868
|
search(true);
|
|
2869
|
+
emit?.("clear");
|
|
2848
2870
|
};
|
|
2849
2871
|
const searchButtons = [
|
|
2850
2872
|
{
|
|
@@ -2869,9 +2891,11 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2869
2891
|
...{ name: "EpSearchListPage" },
|
|
2870
2892
|
__name: "search-list-page",
|
|
2871
2893
|
props: searchListPageProps,
|
|
2872
|
-
|
|
2894
|
+
emits: searchListPageEmits,
|
|
2895
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2873
2896
|
const bem = createNameSpace("search-list-page");
|
|
2874
2897
|
const props = __props;
|
|
2898
|
+
const emit = __emit;
|
|
2875
2899
|
const {
|
|
2876
2900
|
formProps,
|
|
2877
2901
|
buttonsProps,
|
|
@@ -2882,7 +2906,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2882
2906
|
formRef,
|
|
2883
2907
|
tableProps,
|
|
2884
2908
|
beforeSearch
|
|
2885
|
-
} = useSearchListPage(props);
|
|
2909
|
+
} = useSearchListPage(props, {}, emit);
|
|
2886
2910
|
__expose({
|
|
2887
2911
|
search,
|
|
2888
2912
|
reset,
|
|
@@ -4516,7 +4540,7 @@ var components = [
|
|
|
4516
4540
|
EpFooterInfo
|
|
4517
4541
|
];
|
|
4518
4542
|
|
|
4519
|
-
var version = "0.0.
|
|
4543
|
+
var version = "0.0.111";
|
|
4520
4544
|
|
|
4521
4545
|
var globalProperties = {
|
|
4522
4546
|
install(app) {
|
|
@@ -4669,4 +4693,4 @@ const plugin = {
|
|
|
4669
4693
|
version
|
|
4670
4694
|
};
|
|
4671
4695
|
|
|
4672
|
-
export { EpAttachment, EpButtons, EpCustomColumn, EpDatePickerRange, EpFooterInfo, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, EpUniVue, attachmentProps, buttonsProps, componentType, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, defaultFields, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, footerInfoProps, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, uniVueProps, useChooseDialog, useConfirmDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, useUtils, vPermisson as vPermission, vRepeatClick };
|
|
4696
|
+
export { EpAttachment, EpButtons, EpCustomColumn, EpDatePickerRange, EpFooterInfo, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, EpUniVue, attachmentProps, buttonsProps, componentType, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, defaultFields, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, footerInfoProps, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageEmits, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, uniVueProps, useChooseDialog, useConfirmDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, useUtils, vPermisson as vPermission, vRepeatClick };
|
package/es/components/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ export { expandFormPropsKeys, formEmits, formEmitsKeys, formProps } from './form
|
|
|
17
17
|
export { expandFormItemPropsKeys, formItemProps } from './form/src/form-item.mjs';
|
|
18
18
|
export { default as EpFormItem } from './form/src/form-item-vue.mjs';
|
|
19
19
|
export { inputEmits, inputEmitsKeys, inputProps } from './input/src/input.mjs';
|
|
20
|
-
export { searchListPageProps } from './search-list-page/src/search-list-page.mjs';
|
|
20
|
+
export { searchListPageEmits, searchListPageProps } from './search-list-page/src/search-list-page.mjs';
|
|
21
21
|
export { expandSelectPropsKeys, inheritSelectProps, selectEmits, selectEmitsKeys, selectProps } from './select/src/select.mjs';
|
|
22
22
|
export { expandTablePropsKeys, tableEmits, tableEmitsKeys, tableProps } from './table/src/table.mjs';
|
|
23
23
|
export { titleEmits, titleProps } from './title/src/title.mjs';
|
|
@@ -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;
|
|
@@ -107,6 +111,7 @@ export declare const EpInput: {
|
|
|
107
111
|
onClear?: (() => any) | undefined;
|
|
108
112
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
109
113
|
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
114
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
110
115
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
111
116
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
112
117
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
@@ -120,6 +125,7 @@ export declare const EpInput: {
|
|
|
120
125
|
clear: () => void;
|
|
121
126
|
blur: (evt: FocusEvent) => void;
|
|
122
127
|
change: (value: string, evt?: Event | undefined) => void;
|
|
128
|
+
click: (evt: MouseEvent) => void;
|
|
123
129
|
compositionend: (evt: CompositionEvent) => void;
|
|
124
130
|
compositionstart: (evt: CompositionEvent) => void;
|
|
125
131
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
@@ -138,6 +144,7 @@ export declare const EpInput: {
|
|
|
138
144
|
nonzero: boolean;
|
|
139
145
|
placeholder: string;
|
|
140
146
|
thousand: boolean;
|
|
147
|
+
clearableFocus: boolean;
|
|
141
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>;
|
|
142
149
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
143
150
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -175,6 +182,10 @@ export declare const EpInput: {
|
|
|
175
182
|
readonly default: true;
|
|
176
183
|
readonly prototype: Boolean;
|
|
177
184
|
};
|
|
185
|
+
clearableFocus: {
|
|
186
|
+
readonly type: BooleanConstructor;
|
|
187
|
+
readonly default: true;
|
|
188
|
+
};
|
|
178
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>;
|
|
179
190
|
name: StringConstructor;
|
|
180
191
|
ariaLabel: StringConstructor;
|
|
@@ -266,6 +277,7 @@ export declare const EpInput: {
|
|
|
266
277
|
onClear?: (() => any) | undefined;
|
|
267
278
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
268
279
|
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
280
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
269
281
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
270
282
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
271
283
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
@@ -284,6 +296,7 @@ export declare const EpInput: {
|
|
|
284
296
|
nonzero: boolean;
|
|
285
297
|
placeholder: string;
|
|
286
298
|
thousand: boolean;
|
|
299
|
+
clearableFocus: boolean;
|
|
287
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>;
|
|
288
301
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
289
302
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -318,6 +331,10 @@ export declare const EpInput: {
|
|
|
318
331
|
readonly default: true;
|
|
319
332
|
readonly prototype: Boolean;
|
|
320
333
|
};
|
|
334
|
+
clearableFocus: {
|
|
335
|
+
readonly type: BooleanConstructor;
|
|
336
|
+
readonly default: true;
|
|
337
|
+
};
|
|
321
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>;
|
|
322
339
|
name: StringConstructor;
|
|
323
340
|
ariaLabel: StringConstructor;
|
|
@@ -409,6 +426,7 @@ export declare const EpInput: {
|
|
|
409
426
|
onClear?: (() => any) | undefined;
|
|
410
427
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
411
428
|
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
429
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
412
430
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
413
431
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
414
432
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
@@ -422,6 +440,7 @@ export declare const EpInput: {
|
|
|
422
440
|
clear: () => void;
|
|
423
441
|
blur: (evt: FocusEvent) => void;
|
|
424
442
|
change: (value: string, evt?: Event | undefined) => void;
|
|
443
|
+
click: (evt: MouseEvent) => void;
|
|
425
444
|
compositionend: (evt: CompositionEvent) => void;
|
|
426
445
|
compositionstart: (evt: CompositionEvent) => void;
|
|
427
446
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
@@ -440,6 +459,7 @@ export declare const EpInput: {
|
|
|
440
459
|
nonzero: boolean;
|
|
441
460
|
placeholder: string;
|
|
442
461
|
thousand: boolean;
|
|
462
|
+
clearableFocus: boolean;
|
|
443
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>;
|
|
444
464
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
445
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;
|
|
@@ -105,6 +109,7 @@ export declare const inputProps: {
|
|
|
105
109
|
};
|
|
106
110
|
export type InputProps = ExtractPropTypes<typeof inputProps>;
|
|
107
111
|
export declare const inputEmits: {
|
|
112
|
+
click: (evt: MouseEvent) => boolean;
|
|
108
113
|
"update:modelValue": (value: string) => boolean;
|
|
109
114
|
input: (value: string) => boolean;
|
|
110
115
|
change: (value: string, evt?: Event) => boolean;
|
|
@@ -21,10 +21,15 @@ const inputProps = {
|
|
|
21
21
|
clearable: {
|
|
22
22
|
...inputProps$1.clearable,
|
|
23
23
|
default: true
|
|
24
|
+
},
|
|
25
|
+
clearableFocus: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
24
28
|
}
|
|
25
29
|
};
|
|
26
30
|
const inputEmits = {
|
|
27
|
-
...inputEmits$1
|
|
31
|
+
...inputEmits$1,
|
|
32
|
+
click: (evt) => evt instanceof MouseEvent
|
|
28
33
|
};
|
|
29
34
|
const inputEmitsKeys = Object.keys(inputEmits);
|
|
30
35
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.mjs","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}\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":["elInputProps","elInputEmits"],"mappings":";;;AAMA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AAEjB,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGA,YAAA;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,YAAA,CAAa,SAAA;AAAA,IAChB,OAAA,EAAS;AAAA;AAEb;AAEO,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGC;
|
|
1
|
+
{"version":3,"file":"input.mjs","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":["elInputProps","elInputEmits"],"mappings":";;;AAMA,MAAM,EAAE,CAAA,EAAE,GAAI,SAAA,EAAU;AAEjB,MAAM,UAAA,GAAa;AAAA,EACxB,GAAGA,YAAA;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,YAAA,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,YAAA;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;
|
|
@@ -110,6 +114,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
110
114
|
clear: () => void;
|
|
111
115
|
blur: (evt: FocusEvent) => void;
|
|
112
116
|
change: (value: string, evt?: Event | undefined) => void;
|
|
117
|
+
click: (evt: MouseEvent) => void;
|
|
113
118
|
compositionend: (evt: CompositionEvent) => void;
|
|
114
119
|
compositionstart: (evt: CompositionEvent) => void;
|
|
115
120
|
compositionupdate: (evt: CompositionEvent) => void;
|
|
@@ -135,6 +140,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
135
140
|
readonly default: true;
|
|
136
141
|
readonly prototype: Boolean;
|
|
137
142
|
};
|
|
143
|
+
clearableFocus: {
|
|
144
|
+
readonly type: BooleanConstructor;
|
|
145
|
+
readonly default: true;
|
|
146
|
+
};
|
|
138
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>;
|
|
139
148
|
name: StringConstructor;
|
|
140
149
|
ariaLabel: StringConstructor;
|
|
@@ -226,6 +235,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
226
235
|
onClear?: (() => any) | undefined;
|
|
227
236
|
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
228
237
|
onChange?: ((value: string, evt?: Event | undefined) => any) | undefined;
|
|
238
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
229
239
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
230
240
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
231
241
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
@@ -244,6 +254,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
244
254
|
nonzero: boolean;
|
|
245
255
|
placeholder: string;
|
|
246
256
|
thousand: boolean;
|
|
257
|
+
clearableFocus: boolean;
|
|
247
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>;
|
|
248
259
|
modelModifiers: import("element-plus").InputModelModifiers;
|
|
249
260
|
autosize: import("element-plus").InputAutoSize;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, computed, useSlots, useModel, ref, watch,
|
|
1
|
+
import { defineComponent, mergeModels, computed, useSlots, useModel, nextTick, ref, watch, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { createNameSpace } from '../../../utils/bem.mjs';
|
|
3
3
|
import { inputEmitsKeys, inputEmits, inputProps } from './input.mjs';
|
|
4
4
|
import { prepareEvents, prepareProps, prepareStyles, prepareClassNames } from '../../../utils/props.mjs';
|
|
@@ -28,6 +28,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
...prepareProps(props, ["modelValue"]),
|
|
29
29
|
...prepareEvents(emit, inputEmitsKeys),
|
|
30
30
|
placeholder: props.disabled ? "" : props.placeholder,
|
|
31
|
+
onClear: () => {
|
|
32
|
+
emit("clear");
|
|
33
|
+
if (!props.clearableFocus) {
|
|
34
|
+
nextTick(() => {
|
|
35
|
+
inputRef.value?.blur?.();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
},
|
|
31
39
|
onFocus: (e) => {
|
|
32
40
|
isFocusing = true;
|
|
33
41
|
if (props.thousand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.vue2.mjs","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":["_useModel","reg","_openBlock","_createBlock","_mergeProps","_unref","type","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAM,GAAA,GAAM,gBAAgB,OAAO,CAAA;AACnC,IAAA,MAAM,KAAA,GAAQ,OAAA;AACd,IAAA,MAAM,IAAA,GAAO,MAAA;AACb,IAAA,MAAM,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAA,OAAO,MAAA,CAAO,IAAA,CAAK,QAAA,EAAU,CAAA;AAAA,IAC/B,CAAC,CAAA;AACD,IAAA,IAAI,SAAA,GAAY,KAAA;AAChB,IAAA,IAAI,UAAA,GAAa,KAAA;AACjB,IAAA,MAAM,WAAA,GAAc,SAAS,MAAM;AACjC,MAAA,OAAO;AAAA,QACL,GAAG,YAAA,CAAa,KAAA,EAAO,CAAC,YAAY,CAAC,CAAA;AAAA,QACrC,GAAG,aAAA,CAA0B,IAAA,EAAM,cAAc,CAAA;AAAA,QACjD,W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/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":["_useModel","reg","_openBlock","_createBlock","_mergeProps","_unref","type","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;;;AA+BA,IAAA,MAAM,GAAA,GAAM,gBAAgB,OAAO,CAAA;AACnC,IAAA,MAAM,KAAA,GAAQ,OAAA;AACd,IAAA,MAAM,IAAA,GAAO,MAAA;AACb,IAAA,MAAM,KAAA,GAAQ,SAAS,MAAM;AAC3B,MAAA,OAAO,MAAA,CAAO,IAAA,CAAK,QAAA,EAAU,CAAA;AAAA,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Page: {
|
|
|
99
99
|
readonly default: true;
|
|
100
100
|
};
|
|
101
101
|
readonly add: FunctionConstructor;
|
|
102
|
+
readonly clearBefore: FunctionConstructor;
|
|
102
103
|
readonly offsetTop: {
|
|
103
104
|
readonly type: NumberConstructor;
|
|
104
105
|
readonly default: 0;
|
|
@@ -133,7 +134,9 @@ export declare const EpSearchListPage: {
|
|
|
133
134
|
readonly reqAfter: {
|
|
134
135
|
type: import("vue").PropType<import("el-plus/es/utils/index").ReqAfter>;
|
|
135
136
|
};
|
|
136
|
-
}>> & Readonly<{
|
|
137
|
+
}>> & Readonly<{
|
|
138
|
+
onClear?: (() => any) | undefined;
|
|
139
|
+
}>, {
|
|
137
140
|
search: (isInitSearch?: boolean) => Promise<void>;
|
|
138
141
|
reset: () => Promise<void>;
|
|
139
142
|
tableRef: Readonly<import("vue").ShallowRef<({
|
|
@@ -2582,7 +2585,9 @@ export declare const EpSearchListPage: {
|
|
|
2582
2585
|
default?: (props: {}) => any;
|
|
2583
2586
|
};
|
|
2584
2587
|
}) | null>>;
|
|
2585
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2588
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2589
|
+
clear: () => void;
|
|
2590
|
+
}, import("vue").PublicProps, {
|
|
2586
2591
|
readonly columns: Partial<import("element-plus").TableColumnCtx & {
|
|
2587
2592
|
[key: string]: any;
|
|
2588
2593
|
required: boolean | (() => boolean);
|
|
@@ -2756,6 +2761,7 @@ export declare const EpSearchListPage: {
|
|
|
2756
2761
|
readonly default: true;
|
|
2757
2762
|
};
|
|
2758
2763
|
readonly add: FunctionConstructor;
|
|
2764
|
+
readonly clearBefore: FunctionConstructor;
|
|
2759
2765
|
readonly offsetTop: {
|
|
2760
2766
|
readonly type: NumberConstructor;
|
|
2761
2767
|
readonly default: 0;
|
|
@@ -2790,7 +2796,9 @@ export declare const EpSearchListPage: {
|
|
|
2790
2796
|
readonly reqAfter: {
|
|
2791
2797
|
type: import("vue").PropType<import("el-plus/es/utils/index").ReqAfter>;
|
|
2792
2798
|
};
|
|
2793
|
-
}>> & Readonly<{
|
|
2799
|
+
}>> & Readonly<{
|
|
2800
|
+
onClear?: (() => any) | undefined;
|
|
2801
|
+
}>, {
|
|
2794
2802
|
search: (isInitSearch?: boolean) => Promise<void>;
|
|
2795
2803
|
reset: () => Promise<void>;
|
|
2796
2804
|
tableRef: Readonly<import("vue").ShallowRef<({
|
|
@@ -5358,6 +5366,7 @@ export declare const EpSearchListPage: {
|
|
|
5358
5366
|
readonly default: true;
|
|
5359
5367
|
};
|
|
5360
5368
|
readonly add: FunctionConstructor;
|
|
5369
|
+
readonly clearBefore: FunctionConstructor;
|
|
5361
5370
|
readonly offsetTop: {
|
|
5362
5371
|
readonly type: NumberConstructor;
|
|
5363
5372
|
readonly default: 0;
|
|
@@ -5392,7 +5401,9 @@ export declare const EpSearchListPage: {
|
|
|
5392
5401
|
readonly reqAfter: {
|
|
5393
5402
|
type: import("vue").PropType<import("el-plus/es/utils/index").ReqAfter>;
|
|
5394
5403
|
};
|
|
5395
|
-
}>> & Readonly<{
|
|
5404
|
+
}>> & Readonly<{
|
|
5405
|
+
onClear?: (() => any) | undefined;
|
|
5406
|
+
}>, {
|
|
5396
5407
|
search: (isInitSearch?: boolean) => Promise<void>;
|
|
5397
5408
|
reset: () => Promise<void>;
|
|
5398
5409
|
tableRef: Readonly<import("vue").ShallowRef<({
|
|
@@ -7763,7 +7774,9 @@ export declare const EpSearchListPage: {
|
|
|
7763
7774
|
default?: (props: {}) => any;
|
|
7764
7775
|
};
|
|
7765
7776
|
}) | null>>;
|
|
7766
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7777
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7778
|
+
clear: () => void;
|
|
7779
|
+
}, string, {
|
|
7767
7780
|
readonly columns: Partial<import("element-plus").TableColumnCtx & {
|
|
7768
7781
|
[key: string]: any;
|
|
7769
7782
|
required: boolean | (() => boolean);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main from './src/search-list-page.vue2.mjs';
|
|
2
2
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
3
|
-
export { searchListPageProps } from './src/search-list-page.mjs';
|
|
3
|
+
export { searchListPageEmits, searchListPageProps } from './src/search-list-page.mjs';
|
|
4
4
|
|
|
5
5
|
const EpSearchListPage = withInstall(_sfc_main);
|
|
6
6
|
|
|
@@ -47,6 +47,7 @@ export declare const searchListPageProps: {
|
|
|
47
47
|
readonly default: true;
|
|
48
48
|
};
|
|
49
49
|
readonly add: FunctionConstructor;
|
|
50
|
+
readonly clearBefore: FunctionConstructor;
|
|
50
51
|
readonly offsetTop: {
|
|
51
52
|
readonly type: NumberConstructor;
|
|
52
53
|
readonly default: 0;
|
|
@@ -83,3 +84,7 @@ export declare const searchListPageProps: {
|
|
|
83
84
|
};
|
|
84
85
|
};
|
|
85
86
|
export type SearchListPageProps = ExtractPublicPropTypes<typeof searchListPageProps>;
|
|
87
|
+
export declare const searchListPageEmits: {
|
|
88
|
+
clear: () => boolean;
|
|
89
|
+
};
|
|
90
|
+
export type SearchListPageEmits = typeof searchListPageEmits;
|
|
@@ -54,6 +54,8 @@ const searchListPageProps = {
|
|
|
54
54
|
},
|
|
55
55
|
add: Function,
|
|
56
56
|
// 新增
|
|
57
|
+
clearBefore: Function,
|
|
58
|
+
// 清空前钩子,返回 false 阻止清空
|
|
57
59
|
// templateDownloadApi: String, // 模板下载
|
|
58
60
|
// importApi: String, // 导入
|
|
59
61
|
// exportApi: String, // 导出
|
|
@@ -77,6 +79,10 @@ const searchListPageProps = {
|
|
|
77
79
|
default: true
|
|
78
80
|
}
|
|
79
81
|
};
|
|
82
|
+
const searchListPageEmits = {
|
|
83
|
+
// 点击「清空」按钮后触发
|
|
84
|
+
clear: () => true
|
|
85
|
+
};
|
|
80
86
|
|
|
81
|
-
export { searchListPageProps };
|
|
87
|
+
export { searchListPageEmits, searchListPageProps };
|
|
82
88
|
//# sourceMappingURL=search-list-page.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-list-page.mjs","sources":["../../../../../../packages/components/search-list-page/src/search-list-page.ts"],"sourcesContent":["import type { PropType, ExtractPublicPropTypes } from 'vue'\nimport { apiProps } from '@el-plus/utils/props'\nimport { formProps } from '@el-plus/components/form'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { ButtonProps } from '@el-plus/components/buttons'\nimport { tableProps } from '@el-plus/components/table'\nimport { customColumnProps } from '@el-plus/components/custom-column'\n\nexport const searchListPageProps = {\n ...apiProps,\n // 自定义列模块\n customColumnModule: {\n ...customColumnProps.module,\n },\n customColumnApi: {\n ...customColumnProps.api,\n },\n customColumnSaveApi: {\n ...customColumnProps.saveApi,\n },\n showOperationColumn: Boolean, // 是否显示操作列\n // 表单列表\n formItemList: {\n ...formProps.formItemList,\n },\n // 左侧按钮\n leftButtons: {\n type: Array as PropType<ButtonProps<any[]>[]>,\n default: () => [],\n },\n // 表格列\n columns: {\n ...tableProps.columns,\n },\n // 列最小宽度\n minWidth: {\n ...tableProps.minWidth,\n },\n // 操作列宽度\n actionColWidth: {\n ...tableProps.actionColWidth,\n },\n // 操作列\n actionButtons: {\n ...tableProps.actionButtons,\n },\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n showSelectionCol: Boolean,\n showSingleSelectionCol: Boolean,\n showIndexCol: {\n type: Boolean,\n default: true,\n },\n add: Function, // 新增\n // templateDownloadApi: String, // 模板下载\n // importApi: String, // 导入\n // exportApi: String, // 导出\n // 表格额外距离\n offsetTop: {\n type: Number,\n default: 0,\n },\n formData: {\n type: Object,\n default: () => ({}),\n },\n tableProps: Object,\n formProps: Object,\n buttonsProps: Object,\n name: String, // 权限前缀\n // 是否初始化加载数据\n isInitSearch: {\n type: Boolean,\n default: true,\n },\n} as const\nexport type SearchListPageProps = ExtractPublicPropTypes<\n typeof searchListPageProps\n>\n"],"names":[],"mappings":";;;;;AAQO,MAAM,mBAAA,GAAsB;AAAA,EACjC,GAAG,QAAA;AAAA;AAAA,EAEH,kBAAA,EAAoB;AAAA,IAClB,GAAG,iBAAA,CAAkB;AAAA,GACvB;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,GAAG,iBAAA,CAAkB;AAAA,GACvB;AAAA,EACA,mBAAA,EAAqB;AAAA,IACnB,GAAG,iBAAA,CAAkB;AAAA,GACvB;AAAA,EACA,mBAAA,EAAqB,OAAA;AAAA;AAAA;AAAA,EAErB,YAAA,EAAc;AAAA,IACZ,GAAG,SAAA,CAAU;AAAA,GACf;AAAA;AAAA,EAEA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,OAAA,EAAS;AAAA,IACP,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,cAAA,EAAgB;AAAA,IACd,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,aAAA,EAAe;AAAA,IACb,GAAG,UAAA,CAAW;AAAA,GAChB;AAAA,EACA,gBAAA,EAAkB,OAAA;AAAA,EAClB,sBAAA,EAAwB,OAAA;AAAA,EACxB,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,GAAA,EAAK,QAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"search-list-page.mjs","sources":["../../../../../../packages/components/search-list-page/src/search-list-page.ts"],"sourcesContent":["import type { PropType, ExtractPublicPropTypes } from 'vue'\nimport { apiProps } from '@el-plus/utils/props'\nimport { formProps } from '@el-plus/components/form'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { ButtonProps } from '@el-plus/components/buttons'\nimport { tableProps } from '@el-plus/components/table'\nimport { customColumnProps } from '@el-plus/components/custom-column'\n\nexport const searchListPageProps = {\n ...apiProps,\n // 自定义列模块\n customColumnModule: {\n ...customColumnProps.module,\n },\n customColumnApi: {\n ...customColumnProps.api,\n },\n customColumnSaveApi: {\n ...customColumnProps.saveApi,\n },\n showOperationColumn: Boolean, // 是否显示操作列\n // 表单列表\n formItemList: {\n ...formProps.formItemList,\n },\n // 左侧按钮\n leftButtons: {\n type: Array as PropType<ButtonProps<any[]>[]>,\n default: () => [],\n },\n // 表格列\n columns: {\n ...tableProps.columns,\n },\n // 列最小宽度\n minWidth: {\n ...tableProps.minWidth,\n },\n // 操作列宽度\n actionColWidth: {\n ...tableProps.actionColWidth,\n },\n // 操作列\n actionButtons: {\n ...tableProps.actionButtons,\n },\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n showSelectionCol: Boolean,\n showSingleSelectionCol: Boolean,\n showIndexCol: {\n type: Boolean,\n default: true,\n },\n add: Function, // 新增\n clearBefore: Function, // 清空前钩子,返回 false 阻止清空\n // templateDownloadApi: String, // 模板下载\n // importApi: String, // 导入\n // exportApi: String, // 导出\n // 表格额外距离\n offsetTop: {\n type: Number,\n default: 0,\n },\n formData: {\n type: Object,\n default: () => ({}),\n },\n tableProps: Object,\n formProps: Object,\n buttonsProps: Object,\n name: String, // 权限前缀\n // 是否初始化加载数据\n isInitSearch: {\n type: Boolean,\n default: true,\n },\n} as const\nexport type SearchListPageProps = ExtractPublicPropTypes<\n typeof searchListPageProps\n>\nexport const searchListPageEmits = {\n // 点击「清空」按钮后触发\n clear: () => true,\n}\nexport type SearchListPageEmits = typeof searchListPageEmits\n"],"names":[],"mappings":";;;;;AAQO,MAAM,mBAAA,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A,GACnB;AAAA,EACA,UAAA,EAAY,MAAA;AAAA,EACZ,SAAA,EAAW,MAAA;AAAA,EACX,YAAA,EAAc,MAAA;AAAA,EACd,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb;AAIO,MAAM,mBAAA,GAAsB;AAAA;AAAA,EAEjC,OAAO,MAAM;AACf;;;;"}
|
|
@@ -50,6 +50,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
50
50
|
readonly default: true;
|
|
51
51
|
};
|
|
52
52
|
readonly add: FunctionConstructor;
|
|
53
|
+
readonly clearBefore: FunctionConstructor;
|
|
53
54
|
readonly offsetTop: {
|
|
54
55
|
readonly type: NumberConstructor;
|
|
55
56
|
readonly default: 0;
|
|
@@ -2455,7 +2456,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
2455
2456
|
default?: (props: {}) => any;
|
|
2456
2457
|
};
|
|
2457
2458
|
}) | null>>;
|
|
2458
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2459
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2460
|
+
clear: () => void;
|
|
2461
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
2459
2462
|
readonly customColumnModule: {
|
|
2460
2463
|
readonly type: import("vue").PropType<number | string>;
|
|
2461
2464
|
};
|
|
@@ -2502,6 +2505,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
2502
2505
|
readonly default: true;
|
|
2503
2506
|
};
|
|
2504
2507
|
readonly add: FunctionConstructor;
|
|
2508
|
+
readonly clearBefore: FunctionConstructor;
|
|
2505
2509
|
readonly offsetTop: {
|
|
2506
2510
|
readonly type: NumberConstructor;
|
|
2507
2511
|
readonly default: 0;
|
|
@@ -2536,7 +2540,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
2536
2540
|
readonly reqAfter: {
|
|
2537
2541
|
type: import("vue").PropType<import("el-plus/es/utils").ReqAfter>;
|
|
2538
2542
|
};
|
|
2539
|
-
}>> & Readonly<{
|
|
2543
|
+
}>> & Readonly<{
|
|
2544
|
+
onClear?: (() => any) | undefined;
|
|
2545
|
+
}>, {
|
|
2540
2546
|
readonly columns: Partial<import("element-plus").TableColumnCtx & {
|
|
2541
2547
|
[key: string]: any;
|
|
2542
2548
|
required: boolean | (() => boolean);
|
|
@@ -4,16 +4,18 @@ import { EpTable } from '../../table/index.mjs';
|
|
|
4
4
|
import { EpButtons } from '../../buttons/index.mjs';
|
|
5
5
|
import { createNameSpace } from '../../../utils/bem.mjs';
|
|
6
6
|
import { prepareStyles, prepareClassNames } from '../../../utils/props.mjs';
|
|
7
|
-
import { searchListPageProps } from './search-list-page.mjs';
|
|
7
|
+
import { searchListPageEmits, searchListPageProps } from './search-list-page.mjs';
|
|
8
8
|
import { useSearchListPage } from './use-search-list-page.mjs';
|
|
9
9
|
|
|
10
10
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
11
|
...{ name: "EpSearchListPage" },
|
|
12
12
|
__name: "search-list-page",
|
|
13
13
|
props: searchListPageProps,
|
|
14
|
-
|
|
14
|
+
emits: searchListPageEmits,
|
|
15
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
15
16
|
const bem = createNameSpace("search-list-page");
|
|
16
17
|
const props = __props;
|
|
18
|
+
const emit = __emit;
|
|
17
19
|
const {
|
|
18
20
|
formProps,
|
|
19
21
|
buttonsProps,
|
|
@@ -24,7 +26,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24
26
|
formRef,
|
|
25
27
|
tableProps,
|
|
26
28
|
beforeSearch
|
|
27
|
-
} = useSearchListPage(props);
|
|
29
|
+
} = useSearchListPage(props, {}, emit);
|
|
28
30
|
__expose({
|
|
29
31
|
search,
|
|
30
32
|
reset,
|