bkui-vue 0.0.2-beta.2 → 0.0.2-beta.20
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/dist/index.cjs.js +65 -65
- package/dist/index.esm.js +16959 -16663
- package/dist/index.umd.js +63 -63
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/index.js +1 -1
- package/lib/alert/alert.css +1 -0
- package/lib/alert/alert.less +119 -119
- package/lib/alert/alert.variable.css +1 -0
- package/lib/backtop/index.js +1 -1
- package/lib/badge/badge.d.ts +1 -0
- package/lib/badge/index.d.ts +3 -0
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +4 -4
- package/lib/button/button-group.d.ts +2 -2
- package/lib/button/index.d.ts +2 -2
- package/lib/button/index.js +1 -1
- package/lib/cascader/cascader-panel.d.ts +1 -0
- package/lib/cascader/cascader.d.ts +2 -12
- package/lib/cascader/cascader.less +4 -4
- package/lib/cascader/index.d.ts +7 -18
- package/lib/cascader/index.js +1 -1
- package/lib/checkbox/checkbox-group.d.ts +3 -1
- package/lib/checkbox/checkbox.d.ts +8 -8
- package/lib/checkbox/index.d.ts +15 -13
- package/lib/checkbox/index.js +1 -1
- package/lib/collapse-transition/collapse-transition.d.ts +1 -0
- package/lib/collapse-transition/index.js +1 -1
- package/lib/color-picker/color-picker.d.ts +1 -1
- package/lib/color-picker/index.d.ts +3 -3
- package/lib/color-picker/index.js +1 -1
- package/lib/components.d.ts +1 -1
- package/lib/container/index.js +1 -1
- package/lib/date-picker/base/confirm.d.ts +1 -0
- package/lib/date-picker/base/date-table.d.ts +1 -0
- package/lib/date-picker/base/month-table.d.ts +1 -0
- package/lib/date-picker/base/picker-dropdown.d.ts +1 -0
- package/lib/date-picker/base/time-spinner.d.ts +2 -1
- package/lib/date-picker/base/year-table.d.ts +1 -0
- package/lib/date-picker/date-picker.d.ts +3 -2
- package/lib/date-picker/index.d.ts +9 -6
- package/lib/date-picker/index.js +1 -1
- package/lib/date-picker/panel/date-range.d.ts +1 -0
- package/lib/date-picker/panel/date.d.ts +1 -0
- package/lib/date-picker/panel/time-range.d.ts +3 -2
- package/lib/date-picker/panel/time.d.ts +3 -2
- package/lib/date-picker/time-picker.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -3
- package/lib/dialog/index.d.ts +10 -7
- package/lib/dialog/index.js +1 -1
- package/lib/dialog/props.d.ts +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/directives/tooltips.d.ts +1 -0
- package/lib/divider/divider.less +3 -4
- package/lib/divider/index.js +1 -1
- package/lib/dropdown/dropdown.d.ts +1 -1
- package/lib/dropdown/index.d.ts +5 -5
- package/lib/fixed-navbar/index.js +1 -1
- package/lib/image/image-viewer.less +5 -3
- package/lib/image/image-viewer.variable.css +122 -0
- package/lib/image/image.css +142 -0
- package/lib/image/image.d.ts +0 -1
- package/lib/image/image.less +4 -1
- package/lib/image/image.variable.css +264 -0
- package/lib/image/index.js +1 -1
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +74 -56
- package/lib/input/index.js +1 -1
- package/lib/input/input.css +12 -0
- package/lib/input/input.d.ts +29 -13
- package/lib/input/input.less +26 -5
- package/lib/input/input.variable.css +12 -0
- package/lib/link/index.d.ts +3 -0
- package/lib/link/index.js +1 -1
- package/lib/link/link.d.ts +1 -0
- package/lib/loading/index.js +1 -1
- package/lib/message/index.js +1 -1
- package/lib/message/message.css +16 -8
- package/lib/message/message.less +66 -56
- package/lib/message/message.variable.css +16 -8
- package/lib/message/messageConstructor.d.ts +9 -6
- package/lib/modal/index.d.ts +8 -8
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal.d.ts +3 -3
- package/lib/modal/props.mixin.d.ts +1 -1
- package/lib/notify/notifyConstructor.d.ts +1 -1
- package/lib/pagination/index.d.ts +7 -7
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +4 -4
- package/lib/plugin-popover/index.js +1 -1
- package/lib/pop-confirm/index.js +1 -1
- package/lib/pop-confirm/pop-confirm.less +9 -8
- package/lib/popover/const.d.ts +22 -9
- package/lib/popover/content.d.ts +1 -0
- package/lib/popover/index.d.ts +84 -57
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.d.ts +26 -23
- package/lib/popover/props.d.ts +5 -5
- package/lib/popover/use-floating.d.ts +1 -1
- package/lib/progress/index.d.ts +7 -7
- package/lib/progress/progress.d.ts +4 -4
- package/lib/radio/index.d.ts +3 -3
- package/lib/radio/radio-button.d.ts +3 -3
- package/lib/radio/radio-group.d.ts +1 -1
- package/lib/radio/radio.less +1 -1
- package/lib/rate/index.d.ts +4 -4
- package/lib/rate/index.js +1 -1
- package/lib/rate/rate.d.ts +2 -2
- package/lib/rate/rate.less +5 -3
- package/lib/rate/rate.variable.css +122 -0
- package/lib/rate/star.less +6 -4
- package/lib/rate/star.variable.css +122 -0
- package/lib/resize-layout/index.js +1 -1
- package/lib/search-select/index.d.ts +3 -0
- package/lib/search-select/index.js +1 -1
- package/lib/search-select/search-select.d.ts +1 -0
- package/lib/search-select/utils.d.ts +1 -0
- package/lib/select/index.d.ts +26 -39
- package/lib/select/index.js +1 -1
- package/lib/select/option.d.ts +1 -0
- package/lib/select/optionGroup.d.ts +1 -0
- package/lib/select/select.d.ts +11 -20
- package/lib/select/selectTagInput.d.ts +1 -0
- package/lib/shared/index.js +1 -1
- package/lib/shared/mask-manager.d.ts +3 -4
- package/lib/shared/pop-manager.d.ts +6 -2
- package/lib/shared/vue-types.d.ts +2 -2
- package/lib/sideslider/index.d.ts +7 -7
- package/lib/sideslider/index.js +1 -1
- package/lib/sideslider/sideslider.d.ts +3 -3
- package/lib/slider/index.js +1 -1
- package/lib/slider/slider.less +6 -6
- package/lib/steps/index.d.ts +7 -7
- package/lib/steps/index.js +1 -1
- package/lib/steps/steps.d.ts +4 -4
- package/lib/styles/index.d.ts +2 -0
- package/lib/styles/mixins/popper.less +6 -5
- package/lib/styles/reset.less +4 -2
- package/lib/styles/reset.variable.css +122 -0
- package/lib/switcher/index.d.ts +4 -4
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +2 -2
- package/lib/tab/index.d.ts +3 -0
- package/lib/tab/index.js +1 -1
- package/lib/tab/tab-nav.d.ts +1 -0
- package/lib/tab/tab.d.ts +1 -0
- package/lib/table/components/table-cell.d.ts +15 -6
- package/lib/table/components/table-column.d.ts +136 -228
- package/lib/table/const.d.ts +17 -55
- package/lib/table/events.d.ts +180 -0
- package/lib/table/index.d.ts +697 -440
- package/lib/table/index.js +1 -1
- package/lib/table/plugins/head-filter.d.ts +6 -5
- package/lib/table/plugins/head-filter.less +5 -7
- package/lib/table/plugins/head-sort.d.ts +6 -5
- package/lib/table/plugins/settings.d.ts +8 -12
- package/lib/table/plugins/settings.less +3 -3
- package/lib/table/plugins/use-fixed-column.d.ts +3 -2
- package/lib/table/props.d.ts +185 -169
- package/lib/table/render.d.ts +6 -4
- package/lib/table/table.css +11 -1
- package/lib/table/table.d.ts +202 -91
- package/lib/table/table.less +26 -1
- package/lib/table/table.variable.css +11 -1
- package/lib/table/use-column.d.ts +51 -1
- package/lib/table/use-common.d.ts +13 -9
- package/lib/table/utils.d.ts +1 -0
- package/lib/table-column/index.d.ts +182 -562
- package/lib/table-column/index.js +1 -1
- package/lib/tag-input/index.d.ts +15 -27
- package/lib/tag-input/tag-input.css +1 -1
- package/lib/tag-input/tag-input.d.ts +8 -16
- package/lib/tag-input/tag-input.less +4 -4
- package/lib/tag-input/tag-input.variable.css +1 -1
- package/lib/tag-input/tag-props.d.ts +3 -7
- package/lib/time-picker/index.d.ts +9 -6
- package/lib/time-picker/time-picker.less +39 -39
- package/lib/tree/index.d.ts +3 -3
- package/lib/tree/index.js +1 -1
- package/lib/tree/tree.d.ts +1 -1
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/virtual-render.less +5 -6
- package/package.json +1 -1
package/lib/input/index.d.ts
CHANGED
@@ -3,8 +3,8 @@ declare const BkInput: {
|
|
3
3
|
$: import("vue").ComponentInternalInstance;
|
4
4
|
$data: {};
|
5
5
|
$props: {
|
6
|
-
prefix?: string;
|
7
6
|
type?: string;
|
7
|
+
prefix?: string;
|
8
8
|
disabled?: boolean;
|
9
9
|
placeholder?: string;
|
10
10
|
step?: number;
|
@@ -24,19 +24,20 @@ declare const BkInput: {
|
|
24
24
|
rows?: number;
|
25
25
|
selectReadonly?: boolean;
|
26
26
|
withValidate?: boolean;
|
27
|
+
overMaxLengthLimit?: boolean;
|
27
28
|
class?: unknown;
|
28
29
|
style?: unknown;
|
29
|
-
onPaste?: (_value: any, _evt
|
30
|
+
onPaste?: (_value: any, _evt: KeyboardEvent) => any;
|
30
31
|
onCompositionend?: (evt: CompositionEvent) => any;
|
31
32
|
onCompositionstart?: (evt: CompositionEvent) => any;
|
32
33
|
onCompositionupdate?: (evt: CompositionEvent) => any;
|
33
34
|
onFocus?: (evt: FocusEvent) => any;
|
34
35
|
onBlur?: (evt: FocusEvent) => any;
|
35
|
-
onChange?: (_value: any, _evt
|
36
|
-
onInput?: (_value: any, _evt
|
37
|
-
onKeydown?: (_value: any, _evt
|
38
|
-
onKeypress?: (_value: any, _evt
|
39
|
-
onKeyup?: (_value: any, _evt
|
36
|
+
onChange?: (_value: any, _evt: KeyboardEvent) => any;
|
37
|
+
onInput?: (_value: any, _evt: KeyboardEvent) => any;
|
38
|
+
onKeydown?: (_value: any, _evt: KeyboardEvent) => any;
|
39
|
+
onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
|
40
|
+
onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
|
40
41
|
key?: string | number | symbol;
|
41
42
|
ref?: import("vue").VNodeRef;
|
42
43
|
ref_for?: boolean;
|
@@ -79,11 +80,11 @@ declare const BkInput: {
|
|
79
80
|
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
80
81
|
[key: string]: any;
|
81
82
|
}>) => void)[];
|
82
|
-
readonly size?: "
|
83
|
+
readonly size?: "default" | "small" | "large";
|
83
84
|
readonly modelValue?: string | number;
|
84
85
|
onClear?: () => any;
|
85
|
-
"onUpdate:modelValue"?: (_value: any, _evt
|
86
|
-
onEnter?: (_value: any, _evt
|
86
|
+
"onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
|
87
|
+
onEnter?: (_value: any, _evt: KeyboardEvent) => any;
|
87
88
|
};
|
88
89
|
$attrs: {
|
89
90
|
[x: string]: unknown;
|
@@ -96,7 +97,7 @@ declare const BkInput: {
|
|
96
97
|
}>;
|
97
98
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
98
99
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>;
|
99
|
-
$emit: ((event: import("./input").EVENTS.UPDATE, _value: any, _evt
|
100
|
+
$emit: ((event: import("./input").EVENTS.UPDATE, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.FOCUS, evt: FocusEvent) => void) & ((event: import("./input").EVENTS.BLUR, evt: FocusEvent) => void) & ((event: import("./input").EVENTS.CHANGE, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.CLEAR) => void) & ((event: import("./input").EVENTS.INPUT, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.KEYPRESS, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.KEYDOWN, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.KEYUP, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.ENTER, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.PASTE, _value: any, _evt: KeyboardEvent) => void) & ((event: import("./input").EVENTS.COMPOSITIONSTART, evt: CompositionEvent) => void) & ((event: import("./input").EVENTS.COMPOSITIONUPDATE, evt: CompositionEvent) => void) & ((event: import("./input").EVENTS.COMPOSITIONEND, evt: CompositionEvent) => void);
|
100
101
|
$el: any;
|
101
102
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
102
103
|
type: import("vue-types").VueTypeValidableDef<string> & {
|
@@ -166,7 +167,7 @@ declare const BkInput: {
|
|
166
167
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
167
168
|
};
|
168
169
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
169
|
-
size: import("vue-types").VueTypeDef<"
|
170
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
170
171
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
171
172
|
default: number;
|
172
173
|
};
|
@@ -180,39 +181,44 @@ declare const BkInput: {
|
|
180
181
|
} & {
|
181
182
|
default: boolean;
|
182
183
|
};
|
184
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
185
|
+
default: boolean;
|
186
|
+
} & {
|
187
|
+
default: boolean;
|
188
|
+
};
|
183
189
|
}>> & {
|
184
|
-
onPaste?: (_value: any, _evt
|
190
|
+
onPaste?: (_value: any, _evt: KeyboardEvent) => any;
|
185
191
|
onCompositionend?: (evt: CompositionEvent) => any;
|
186
192
|
onCompositionstart?: (evt: CompositionEvent) => any;
|
187
193
|
onCompositionupdate?: (evt: CompositionEvent) => any;
|
188
194
|
onFocus?: (evt: FocusEvent) => any;
|
189
195
|
onBlur?: (evt: FocusEvent) => any;
|
190
|
-
onChange?: (_value: any, _evt
|
191
|
-
onInput?: (_value: any, _evt
|
192
|
-
onKeydown?: (_value: any, _evt
|
193
|
-
onKeypress?: (_value: any, _evt
|
194
|
-
onKeyup?: (_value: any, _evt
|
196
|
+
onChange?: (_value: any, _evt: KeyboardEvent) => any;
|
197
|
+
onInput?: (_value: any, _evt: KeyboardEvent) => any;
|
198
|
+
onKeydown?: (_value: any, _evt: KeyboardEvent) => any;
|
199
|
+
onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
|
200
|
+
onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
|
195
201
|
onClear?: () => any;
|
196
|
-
"onUpdate:modelValue"?: (_value: any, _evt
|
197
|
-
onEnter?: (_value: any, _evt
|
202
|
+
"onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
|
203
|
+
onEnter?: (_value: any, _evt: KeyboardEvent) => any;
|
198
204
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
199
|
-
"update:modelValue": (_value: any, _evt
|
205
|
+
"update:modelValue": (_value: any, _evt: KeyboardEvent) => any;
|
200
206
|
focus: (evt: FocusEvent) => FocusEvent;
|
201
207
|
blur: (evt: FocusEvent) => FocusEvent;
|
202
|
-
change: (_value: any, _evt
|
208
|
+
change: (_value: any, _evt: KeyboardEvent) => any;
|
203
209
|
clear: () => boolean;
|
204
|
-
input: (_value: any, _evt
|
205
|
-
keypress: (_value: any, _evt
|
206
|
-
keydown: (_value: any, _evt
|
207
|
-
keyup: (_value: any, _evt
|
208
|
-
enter: (_value: any, _evt
|
209
|
-
paste: (_value: any, _evt
|
210
|
+
input: (_value: any, _evt: KeyboardEvent) => any;
|
211
|
+
keypress: (_value: any, _evt: KeyboardEvent) => any;
|
212
|
+
keydown: (_value: any, _evt: KeyboardEvent) => any;
|
213
|
+
keyup: (_value: any, _evt: KeyboardEvent) => any;
|
214
|
+
enter: (_value: any, _evt: KeyboardEvent) => any;
|
215
|
+
paste: (_value: any, _evt: KeyboardEvent) => any;
|
210
216
|
compositionstart: (evt: CompositionEvent) => CompositionEvent;
|
211
217
|
compositionupdate: (evt: CompositionEvent) => CompositionEvent;
|
212
218
|
compositionend: (evt: CompositionEvent) => CompositionEvent;
|
213
219
|
}, string, {
|
214
|
-
prefix: string;
|
215
220
|
type: string;
|
221
|
+
prefix: string;
|
216
222
|
disabled: boolean;
|
217
223
|
placeholder: string;
|
218
224
|
step: number;
|
@@ -232,6 +238,7 @@ declare const BkInput: {
|
|
232
238
|
rows: number;
|
233
239
|
selectReadonly: boolean;
|
234
240
|
withValidate: boolean;
|
241
|
+
overMaxLengthLimit: boolean;
|
235
242
|
}, {}, string, {}> & {
|
236
243
|
beforeCreate?: (() => void) | (() => void)[];
|
237
244
|
created?: (() => void) | (() => void)[];
|
@@ -320,7 +327,7 @@ declare const BkInput: {
|
|
320
327
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
321
328
|
};
|
322
329
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
323
|
-
size: import("vue-types").VueTypeDef<"
|
330
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
324
331
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
325
332
|
default: number;
|
326
333
|
};
|
@@ -334,21 +341,26 @@ declare const BkInput: {
|
|
334
341
|
} & {
|
335
342
|
default: boolean;
|
336
343
|
};
|
344
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
345
|
+
default: boolean;
|
346
|
+
} & {
|
347
|
+
default: boolean;
|
348
|
+
};
|
337
349
|
}>> & {
|
338
|
-
onPaste?: (_value: any, _evt
|
350
|
+
onPaste?: (_value: any, _evt: KeyboardEvent) => any;
|
339
351
|
onCompositionend?: (evt: CompositionEvent) => any;
|
340
352
|
onCompositionstart?: (evt: CompositionEvent) => any;
|
341
353
|
onCompositionupdate?: (evt: CompositionEvent) => any;
|
342
354
|
onFocus?: (evt: FocusEvent) => any;
|
343
355
|
onBlur?: (evt: FocusEvent) => any;
|
344
|
-
onChange?: (_value: any, _evt
|
345
|
-
onInput?: (_value: any, _evt
|
346
|
-
onKeydown?: (_value: any, _evt
|
347
|
-
onKeypress?: (_value: any, _evt
|
348
|
-
onKeyup?: (_value: any, _evt
|
356
|
+
onChange?: (_value: any, _evt: KeyboardEvent) => any;
|
357
|
+
onInput?: (_value: any, _evt: KeyboardEvent) => any;
|
358
|
+
onKeydown?: (_value: any, _evt: KeyboardEvent) => any;
|
359
|
+
onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
|
360
|
+
onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
|
349
361
|
onClear?: () => any;
|
350
|
-
"onUpdate:modelValue"?: (_value: any, _evt
|
351
|
-
onEnter?: (_value: any, _evt
|
362
|
+
"onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
|
363
|
+
onEnter?: (_value: any, _evt: KeyboardEvent) => any;
|
352
364
|
} & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
|
353
365
|
__isFragment?: never;
|
354
366
|
__isTeleport?: never;
|
@@ -421,7 +433,7 @@ declare const BkInput: {
|
|
421
433
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
422
434
|
};
|
423
435
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
424
|
-
size: import("vue-types").VueTypeDef<"
|
436
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
425
437
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
426
438
|
default: number;
|
427
439
|
};
|
@@ -435,39 +447,44 @@ declare const BkInput: {
|
|
435
447
|
} & {
|
436
448
|
default: boolean;
|
437
449
|
};
|
450
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
451
|
+
default: boolean;
|
452
|
+
} & {
|
453
|
+
default: boolean;
|
454
|
+
};
|
438
455
|
}>> & {
|
439
|
-
onPaste?: (_value: any, _evt
|
456
|
+
onPaste?: (_value: any, _evt: KeyboardEvent) => any;
|
440
457
|
onCompositionend?: (evt: CompositionEvent) => any;
|
441
458
|
onCompositionstart?: (evt: CompositionEvent) => any;
|
442
459
|
onCompositionupdate?: (evt: CompositionEvent) => any;
|
443
460
|
onFocus?: (evt: FocusEvent) => any;
|
444
461
|
onBlur?: (evt: FocusEvent) => any;
|
445
|
-
onChange?: (_value: any, _evt
|
446
|
-
onInput?: (_value: any, _evt
|
447
|
-
onKeydown?: (_value: any, _evt
|
448
|
-
onKeypress?: (_value: any, _evt
|
449
|
-
onKeyup?: (_value: any, _evt
|
462
|
+
onChange?: (_value: any, _evt: KeyboardEvent) => any;
|
463
|
+
onInput?: (_value: any, _evt: KeyboardEvent) => any;
|
464
|
+
onKeydown?: (_value: any, _evt: KeyboardEvent) => any;
|
465
|
+
onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
|
466
|
+
onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
|
450
467
|
onClear?: () => any;
|
451
|
-
"onUpdate:modelValue"?: (_value: any, _evt
|
452
|
-
onEnter?: (_value: any, _evt
|
468
|
+
"onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
|
469
|
+
onEnter?: (_value: any, _evt: KeyboardEvent) => any;
|
453
470
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
454
|
-
"update:modelValue": (_value: any, _evt
|
471
|
+
"update:modelValue": (_value: any, _evt: KeyboardEvent) => any;
|
455
472
|
focus: (evt: FocusEvent) => FocusEvent;
|
456
473
|
blur: (evt: FocusEvent) => FocusEvent;
|
457
|
-
change: (_value: any, _evt
|
474
|
+
change: (_value: any, _evt: KeyboardEvent) => any;
|
458
475
|
clear: () => boolean;
|
459
|
-
input: (_value: any, _evt
|
460
|
-
keypress: (_value: any, _evt
|
461
|
-
keydown: (_value: any, _evt
|
462
|
-
keyup: (_value: any, _evt
|
463
|
-
enter: (_value: any, _evt
|
464
|
-
paste: (_value: any, _evt
|
476
|
+
input: (_value: any, _evt: KeyboardEvent) => any;
|
477
|
+
keypress: (_value: any, _evt: KeyboardEvent) => any;
|
478
|
+
keydown: (_value: any, _evt: KeyboardEvent) => any;
|
479
|
+
keyup: (_value: any, _evt: KeyboardEvent) => any;
|
480
|
+
enter: (_value: any, _evt: KeyboardEvent) => any;
|
481
|
+
paste: (_value: any, _evt: KeyboardEvent) => any;
|
465
482
|
compositionstart: (evt: CompositionEvent) => CompositionEvent;
|
466
483
|
compositionupdate: (evt: CompositionEvent) => CompositionEvent;
|
467
484
|
compositionend: (evt: CompositionEvent) => CompositionEvent;
|
468
485
|
}, string, {
|
469
|
-
prefix: string;
|
470
486
|
type: string;
|
487
|
+
prefix: string;
|
471
488
|
disabled: boolean;
|
472
489
|
placeholder: string;
|
473
490
|
step: number;
|
@@ -487,5 +504,6 @@ declare const BkInput: {
|
|
487
504
|
rows: number;
|
488
505
|
selectReadonly: boolean;
|
489
506
|
withValidate: boolean;
|
507
|
+
overMaxLengthLimit: boolean;
|
490
508
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin<any[]>;
|
491
509
|
export default BkInput;
|
package/lib/input/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("../shared"),require("vue"),require("../config-provider"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../icon"],r);else{var t="object"==typeof exports?r(require("../shared"),require("vue"),require("../config-provider"),require("../icon")):r(e["../shared"],e.vue,e["../config-provider"],e["../icon"]);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(self,((e,r,t,o)=>(()=>{"use strict";var n={2717:e=>{e.exports=t},6870:e=>{e.exports=o},4212:r=>{r.exports=e},748:e=>{e.exports=r}},l={};function a(e){var r=l[e];if(void 0!==r)return r.exports;var t=l[e]={exports:{}};return n[e](t,t.exports,a),t.exports}a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{a.r(i),a.d(i,{default:()=>y});var e=a(4212);function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=new Array(r);t<r;t++)o[t]=e[t];return o}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function o(e,r,o){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}var n=a(748);Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var l,u,s=a(2717),c=a(6870),p={type:e.PropTypes.string.def("text"),clearable:e.PropTypes.bool,disabled:e.PropTypes.bool,readonly:e.PropTypes.bool,placeholder:e.PropTypes.string.def(""),prefixIcon:e.PropTypes.string,suffixIcon:e.PropTypes.string,suffix:e.PropTypes.string,prefix:e.PropTypes.string,step:e.PropTypes.integer,max:e.PropTypes.integer,min:e.PropTypes.integer,maxlength:e.PropTypes.integer,behavior:(0,e.InputBehaviorType)(),showWordLimit:e.PropTypes.bool,showControl:e.PropTypes.bool.def(!0),showClearOnlyHover:e.PropTypes.bool.def(!0),precision:e.PropTypes.number.def(0).validate((function(e){return e>=0&&e<20})),modelValue:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]),size:e.PropTypes.size(),rows:e.PropTypes.number,selectReadonly:e.PropTypes.bool.def(!1),withValidate:e.PropTypes.bool.def(!0)};function d(e,r){return!0}function f(e){return e}!function(e){e.UPDATE="update:modelValue",e.FOCUS="focus",e.BLUR="blur",e.CHANGE="change",e.CLEAR="clear",e.INPUT="input",e.KEYPRESS="keypress",e.KEYDOWN="keydown",e.KEYUP="keyup",e.ENTER="enter",e.PASTE="paste",e.COMPOSITIONSTART="compositionstart",e.COMPOSITIONUPDATE="compositionupdate",e.COMPOSITIONEND="compositionend"}(u||(u={}));var v=(o(l={},u.UPDATE,d),o(l,u.FOCUS,(function(e){return e})),o(l,u.BLUR,(function(e){return e})),o(l,u.CHANGE,d),o(l,u.CLEAR,(function(){return!0})),o(l,u.INPUT,d),o(l,u.KEYPRESS,d),o(l,u.KEYDOWN,d),o(l,u.KEYUP,d),o(l,u.ENTER,d),o(l,u.PASTE,d),o(l,u.COMPOSITIONSTART,f),o(l,u.COMPOSITIONUPDATE,f),o(l,u.COMPOSITIONEND,f),l);const m=(0,n.defineComponent)({name:"Input",inheritAttrs:!1,props:p,emits:v,setup:function(t,l){var a=(0,e.useFormItem)(),i=(0,s.useLocale)("input"),p=(0,n.ref)(!1),d=(0,n.ref)(!1),f=(0,n.computed)((function(){return"textarea"===t.type})),v=(0,n.computed)((function(){return f.value?(0,e.resolveClassName)("textarea"):(0,e.resolveClassName)("input")})),m=l.attrs,y=m.class,b=m.style,P=function(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}(m,["class","style"]),T=(0,n.ref)(),g=(0,n.computed)((function(){var r;return(0,e.classes)((o(r={},"".concat(v.value,"--").concat(t.size),!!t.size),o(r,"is-focused",p.value),o(r,"is-readonly",t.readonly&&!t.selectReadonly),o(r,"is-disabled",t.disabled),o(r,"is-simplicity","simplicity"===t.behavior),o(r,"".concat(y),!!y),r),v.value)})),h={search:function(){return(0,n.createVNode)(c.Search,null,null)},password:function(){return(0,n.createVNode)(c.Eye,{onClick:F},null)}},x=G("suffix-icon"),N=(0,n.computed)((function(){var e=h[t.type];return S.value?(0,n.createVNode)(c.Unvisible,{onClick:F,class:x},null):e?(0,n.createVNode)(e,{class:x},null):null})),E=(0,n.computed)((function(){return"number"===t.type})),O=(0,n.computed)((function(){return Math.floor(t.maxlength)})),S=(0,n.ref)(!1),C=(0,n.computed)((function(){return(0,e.classes)(o({"show-clear-only-hover":t.showClearOnlyHover},"".concat(v.value,"--clear-icon"),!0),x)})),V=(0,n.computed)((function(){return(0,e.classes)({"is-disabled":t.disabled||t.modelValue>=t.max})})),w=(0,n.computed)((function(){return(0,e.classes)({"is-disabled":t.disabled||t.modelValue<=t.min})}));function A(){if(!t.disabled){var e=E.value?t.min:"";l.emit(u.UPDATE,e),l.emit(u.CHANGE,e),l.emit(u.CLEAR)}}(0,n.watch)((function(){return t.modelValue}),(function(){var e;t.withValidate&&(null===(e=null==a?void 0:a.validate)||void 0===e||e.call(a,"change"))})),l.expose({focus:function(){T.value.focus()},clear:A});var I,U,j=(I=[u.KEYUP,u.KEYDOWN,u.KEYPRESS,u.PASTE,u.CHANGE,u.INPUT].map((function(e){return function(r){if(r.stopPropagation(),e!==u.KEYDOWN||"Enter"!==r.code&&"Enter"!==r.key&&13!==r.keyCode||l.emit(u.ENTER,r.target.value,r),!d.value||![u.INPUT,u.CHANGE].some((function(r){return e===r}))){if(e===u.INPUT)l.emit(u.UPDATE,r.target.value);else if(e===u.CHANGE&&E.value&&""!==r.target.value){var t=Y(r.target.value,0);return l.emit(u.UPDATE,t,r),void l.emit(e,t,r)}l.emit(e,r.target.value,r)}}})),U=6,function(e){if(Array.isArray(e))return e}(I)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,n,l,a,i=[],u=!0,s=!1;try{if(l=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(o=l.call(t)).done)&&(i.push(o.value),i.length!==r);u=!0);}catch(e){s=!0,n=e}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(s)throw n}}return i}}(I,U)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(e,t):void 0}}(I,U)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),D=j[0],R=j[1],K=j[2],k=j[3],M=j[4],H=j[5];function Y(e,r){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Number(r),l=Number.isInteger(t.precision)?t.precision:0,a=Number(e),i=Number.isInteger(n)?n:1,u=a+(o?i:-1*i);return Number.isInteger(t.max)&&(u=Math.min(u,t.max)),Number.isInteger(t.min)&&(u=Math.max(u,t.min)),+u.toFixed(l)}function L(){if(!t.disabled){var e=Y(t.modelValue,t.step);l.emit(u.UPDATE,e),l.emit(u.CHANGE,e)}}function q(){if(!t.disabled){var e=Y(t.modelValue,t.step,!1);l.emit(u.UPDATE,e),l.emit(u.CHANGE,e)}}function G(e){return"".concat(v.value,"--").concat(e)}function F(){S.value=!S.value}var W=(0,n.computed)((function(){var e=void 0===t.modelValue||null===t.modelValue?{}:{value:t.modelValue};return Object.assign(Object.assign({},e),{maxlength:t.maxlength,placeholder:t.placeholder||i.value.placeholder,readonly:t.readonly,disabled:t.disabled})})),B={onInput:H,onFocus:function(e){p.value=!0,l.emit(u.FOCUS,e)},onBlur:function(e){var r;p.value=!1,l.emit(u.BLUR,e),t.withValidate&&(null===(r=null==a?void 0:a.validate)||void 0===r||r.call(a,"blur"))},onPaste:k,onChange:M,onKeypress:K,onKeydown:R,onKeyup:D,onCompositionstart:function(){d.value=!0},onCompositionend:function(e){d.value=!1,H(e)}};return function(){var e,r,o,a,i,u,s;return(0,n.createVNode)("div",{class:g.value,style:b},[null!==(o=null===(r=null===(e=l.slots)||void 0===e?void 0:e.prefix)||void 0===r?void 0:r.call(e))&&void 0!==o?o:t.prefix&&(0,n.createVNode)("div",{class:G("prefix-area")},[(0,n.createVNode)("span",{class:G("prefix-area--text")},[t.prefix])]),f.value?(0,n.createVNode)("textarea",(0,n.mergeProps)({ref:T,spellcheck:!1},P,B,W.value,{rows:t.rows}),null):(0,n.createVNode)("input",(0,n.mergeProps)({spellcheck:!1},P,{ref:T,class:"".concat(v.value,"--text"),type:S.value&&"password"===t.type?"text":t.type,step:t.step,max:t.max,min:t.min},B,W.value),null),!f.value&&t.clearable&&!!t.modelValue&&(0,n.createVNode)("span",{class:C.value,onClick:A},[(0,n.createVNode)(c.Close,null,null)]),N.value,"number"==typeof t.maxlength&&(t.showWordLimit||f.value)&&(0,n.createVNode)("p",{class:G("max-length")},[(null!==(a=t.modelValue)&&void 0!==a?a:"").toString().length,(0,n.createTextVNode)("/"),(0,n.createVNode)("span",null,[O.value])]),E.value&&t.showControl&&(0,n.createVNode)("div",{class:G("number-control")},[(0,n.createVNode)(c.DownSmall,{class:V.value,onClick:L},null),(0,n.createVNode)(c.DownSmall,{class:w.value,onClick:q},null)]),null!==(s=null===(u=null===(i=l.slots)||void 0===i?void 0:i.suffix)||void 0===u?void 0:u.call(i))&&void 0!==s?s:t.suffix&&(0,n.createVNode)("div",{class:G("suffix-area")},[(0,n.createVNode)("span",{class:G("suffix-area--text")},[t.suffix])])])}}}),y=(0,e.withInstall)(m)})(),i})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","../directives","../icon"],t);else{var r="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("../directives"),require("../icon")):t(e["../shared"],e.vue,e["../config-provider"],e["../directives"],e["../icon"]);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(self,((e,t,r,o,n)=>(()=>{"use strict";var l={2717:e=>{e.exports=r},4061:e=>{e.exports=o},6870:e=>{e.exports=n},4212:t=>{t.exports=e},748:e=>{e.exports=t}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return l[e](r,r.exports,a),r.exports}a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{a.r(u),a.d(u,{default:()=>b});var e=a(4212);function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,o){return(t=function(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,"string");if("object"!==r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===r(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var n=a(748);Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var l,i,s=a(2717),c=a(4061),p=a(6870),d={type:e.PropTypes.string.def("text"),clearable:e.PropTypes.bool,disabled:e.PropTypes.bool,readonly:e.PropTypes.bool,placeholder:e.PropTypes.string.def(""),prefixIcon:e.PropTypes.string,suffixIcon:e.PropTypes.string,suffix:e.PropTypes.string,prefix:e.PropTypes.string,step:e.PropTypes.integer,max:e.PropTypes.integer,min:e.PropTypes.integer,maxlength:e.PropTypes.integer,behavior:(0,e.InputBehaviorType)(),showWordLimit:e.PropTypes.bool,showControl:e.PropTypes.bool.def(!0),showClearOnlyHover:e.PropTypes.bool.def(!0),precision:e.PropTypes.number.def(0).validate((function(e){return e>=0&&e<20})),modelValue:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]),size:e.PropTypes.size(),rows:e.PropTypes.number,selectReadonly:e.PropTypes.bool.def(!1),withValidate:e.PropTypes.bool.def(!0),overMaxLengthLimit:e.PropTypes.bool.def(!1)};function f(e,t){return!0}function v(e){return e}!function(e){e.UPDATE="update:modelValue",e.FOCUS="focus",e.BLUR="blur",e.CHANGE="change",e.CLEAR="clear",e.INPUT="input",e.KEYPRESS="keypress",e.KEYDOWN="keydown",e.KEYUP="keyup",e.ENTER="enter",e.PASTE="paste",e.COMPOSITIONSTART="compositionstart",e.COMPOSITIONUPDATE="compositionupdate",e.COMPOSITIONEND="compositionend"}(i||(i={}));var m=(o(l={},i.UPDATE,f),o(l,i.FOCUS,(function(e){return e})),o(l,i.BLUR,(function(e){return e})),o(l,i.CHANGE,f),o(l,i.CLEAR,(function(){return!0})),o(l,i.INPUT,f),o(l,i.KEYPRESS,f),o(l,i.KEYDOWN,f),o(l,i.KEYUP,f),o(l,i.ENTER,f),o(l,i.PASTE,f),o(l,i.COMPOSITIONSTART,v),o(l,i.COMPOSITIONUPDATE,v),o(l,i.COMPOSITIONEND,v),l);const y=(0,n.defineComponent)({name:"Input",directives:{bkTooltips:c.bkTooltips},inheritAttrs:!1,props:d,emits:m,setup:function(r,l){var a=(0,s.usePrefix)().resolveClassName,u=(0,e.useFormItem)(),c=(0,s.useLocale)("input"),d=(0,n.ref)(!1),f=(0,n.ref)(!1),v=(0,n.computed)((function(){return"textarea"===r.type})),m=(0,n.computed)((function(){return v.value?a("textarea"):a("input")})),y=l.attrs,b=y.class,P=y.style,h=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(y,["class","style"]),g=(0,n.ref)(),T=(0,n.computed)((function(){var t;return(0,e.classes)((o(t={},"".concat(m.value,"--").concat(r.size),!!r.size),o(t,"is-focused",d.value),o(t,"is-readonly",r.readonly&&!r.selectReadonly),o(t,"is-disabled",r.disabled),o(t,"is-simplicity","simplicity"===r.behavior),o(t,"".concat(b),!!b),t),m.value)})),x=(0,n.ref)(!1),N={search:function(){return(0,n.createVNode)(p.Search,null,null)},password:function(){return(0,n.createVNode)(p.Eye,{style:{fontSize:"18px"},onClick:$},null)}},E=_("suffix-icon"),O=(0,n.computed)((function(){var e=N[r.type];return C.value?(0,n.createVNode)(p.Unvisible,{onClick:$,class:E},null):e?(0,n.createVNode)(e,{class:E},null):null})),S=(0,n.computed)((function(){return"number"===r.type})),V=(0,n.computed)((function(){return Math.floor(r.maxlength)})),C=(0,n.ref)(!1),w=(0,n.computed)((function(){return(0,e.classes)(o({"show-clear-only-hover":r.showClearOnlyHover},"".concat(m.value,"--clear-icon"),!0),E)})),A=(0,n.computed)((function(){var t,n;return(0,e.classes)((o(t={},_("max-length"),!0),o(t,"is-over-limit",V.value-(null!==(n=r.modelValue)&&void 0!==n?n:"").toString().length<0),t))})),I=(0,n.computed)((function(){var e;return(null!==(e=r.modelValue)&&void 0!==e?e:"").toString().length})),U=(0,n.computed)((function(){return(0,e.classes)({"is-disabled":r.disabled||r.modelValue>=r.max})})),j=(0,n.computed)((function(){return(0,e.classes)({"is-disabled":r.disabled||r.modelValue<=r.min})})),D=(0,n.computed)((function(){return x.value&&r.modelValue?{content:r.modelValue,sameWidth:!0}:{disabled:!0}}));function M(){if(!r.disabled){var e=S.value?r.min:"";l.emit(i.UPDATE,e,null),l.emit(i.CHANGE,e,null),l.emit(i.CLEAR)}}(0,n.watch)((function(){return r.modelValue}),(function(){var e;r.withValidate&&(null===(e=null==u?void 0:u.validate)||void 0===e||e.call(u,"change"))})),(0,n.onMounted)((function(){var e,t;x.value=(null===(e=g.value)||void 0===e?void 0:e.scrollWidth)>(null===(t=g.value)||void 0===t?void 0:t.clientWidth)})),l.expose({focus:function(){g.value.focus()},clear:M});var R,k,L=(R=[i.KEYUP,i.KEYDOWN,i.KEYPRESS,i.PASTE,i.CHANGE,i.INPUT].map((function(e){return function(t){if(t.stopPropagation(),e!==i.KEYDOWN||"Enter"!==t.code&&"Enter"!==t.key&&13!==t.keyCode||l.emit(i.ENTER,t.target.value,t),!f.value||![i.INPUT,i.CHANGE].some((function(t){return e===t}))){if(e===i.INPUT)l.emit(i.UPDATE,t.target.value,t);else if(e===i.CHANGE&&S.value&&""!==t.target.value){var r=F(t.target.value,0);return l.emit(i.UPDATE,r,t),void l.emit(e,r,t)}l.emit(e,t.target.value,t)}}})),k=6,function(e){if(Array.isArray(e))return e}(R)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,l,i,a=[],u=!0,s=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(o=l.call(r)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(e){s=!0,n=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw n}}return a}}(R,k)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,r):void 0}}(R,k)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),K=L[0],W=L[1],q=L[2],H=L[3],Y=L[4],G=L[5];function F(e,t){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=Number(t),l=Number.isInteger(r.precision)?r.precision:0,i=Number(e),a=Number.isInteger(n)?n:1,u=i+(o?a:-1*a);return Number.isInteger(r.max)&&(u=Math.min(u,r.max)),Number.isInteger(r.min)&&(u=Math.max(u,r.min)),+u.toFixed(l)}function z(e){if(!r.disabled){var t=F(r.modelValue,r.step);l.emit(i.UPDATE,t,e),l.emit(i.CHANGE,t,e)}}function B(e){if(!r.disabled){var t=F(r.modelValue,r.step,!1);l.emit(i.UPDATE,t,e),l.emit(i.CHANGE,t,e)}}function _(e){return"".concat(m.value,"--").concat(e)}function $(){C.value=!C.value}var J=(0,n.computed)((function(){var e=void 0===r.modelValue||null===r.modelValue?{}:{value:r.modelValue};return Object.assign(Object.assign({},e),{maxlength:!r.overMaxLengthLimit&&r.maxlength,placeholder:r.placeholder||c.value.placeholder,readonly:r.readonly,disabled:r.disabled})})),Q={onInput:G,onFocus:function(e){d.value=!0,l.emit(i.FOCUS,e)},onBlur:function(e){var t,o,n;d.value=!1,x.value=(null===(t=g.value)||void 0===t?void 0:t.scrollWidth)>(null===(o=g.value)||void 0===o?void 0:o.clientWidth),l.emit(i.BLUR,e),r.withValidate&&(null===(n=null==u?void 0:u.validate)||void 0===n||n.call(u,"blur"))},onPaste:H,onChange:Y,onKeypress:q,onKeydown:W,onKeyup:K,onCompositionstart:function(){f.value=!0},onCompositionend:function(e){f.value=!1,G(e)}};return function(){var e,t,o,i,a,u;return(0,n.withDirectives)((0,n.createVNode)("div",{class:T.value,style:P},[null!==(o=null===(t=null===(e=l.slots)||void 0===e?void 0:e.prefix)||void 0===t?void 0:t.call(e))&&void 0!==o?o:r.prefix&&(0,n.createVNode)("div",{class:_("prefix-area")},[(0,n.createVNode)("span",{class:_("prefix-area--text")},[r.prefix])]),v.value?(0,n.createVNode)("textarea",(0,n.mergeProps)({ref:g,spellcheck:!1},h,Q,J.value,{rows:r.rows}),null):(0,n.createVNode)("input",(0,n.mergeProps)({spellcheck:!1},h,{ref:g,class:"".concat(m.value,"--text"),type:C.value&&"password"===r.type?"text":r.type,step:r.step,max:r.max,min:r.min},Q,J.value),null),!v.value&&r.clearable&&!!r.modelValue&&(0,n.createVNode)("span",{class:w.value,onClick:M},[(0,n.createVNode)(p.Close,null,null)]),O.value,"number"==typeof r.maxlength&&(r.showWordLimit||v.value)&&(0,n.createVNode)("p",{class:A.value},[r.overMaxLengthLimit?V.value-I.value:(0,n.createVNode)(n.Fragment,null,[I.value,(0,n.createTextVNode)(" / "),(0,n.createVNode)("span",null,[V.value])])]),S.value&&r.showControl&&(0,n.createVNode)("div",{class:_("number-control")},[(0,n.createVNode)(p.DownSmall,{class:U.value,onClick:z},null),(0,n.createVNode)(p.DownSmall,{class:j.value,onClick:B},null)]),null!==(u=null===(a=null===(i=l.slots)||void 0===i?void 0:i.suffix)||void 0===a?void 0:a.call(i))&&void 0!==u?u:r.suffix&&(0,n.createVNode)("div",{class:_("suffix-area")},[(0,n.createVNode)("span",{class:_("suffix-area--text")},[r.suffix])])]),[[(0,n.resolveDirective)("bk-tooltips"),D.value]])}}}),b=(0,e.withInstall)(y)})(),u})()));
|
package/lib/input/input.css
CHANGED
@@ -84,6 +84,7 @@
|
|
84
84
|
box-sizing: border-box;
|
85
85
|
transition: all 0.3s;
|
86
86
|
flex-direction: column;
|
87
|
+
resize: both;
|
87
88
|
}
|
88
89
|
.bk-textarea ::placeholder {
|
89
90
|
color: #c4c6cc;
|
@@ -134,6 +135,9 @@
|
|
134
135
|
transform: scale(0.8);
|
135
136
|
justify-content: flex-end;
|
136
137
|
}
|
138
|
+
.bk-textarea--max-length.is-over-limit {
|
139
|
+
color: #ea3636;
|
140
|
+
}
|
137
141
|
.bk-textarea--max-length span {
|
138
142
|
color: #979ba5;
|
139
143
|
}
|
@@ -211,12 +215,14 @@
|
|
211
215
|
background-color: white;
|
212
216
|
align-items: center;
|
213
217
|
align-self: center;
|
218
|
+
flex-shrink: 0;
|
214
219
|
}
|
215
220
|
.bk-input--suffix-icon.show-clear-only-hover {
|
216
221
|
display: none;
|
217
222
|
}
|
218
223
|
.bk-input--clear-icon {
|
219
224
|
cursor: pointer;
|
225
|
+
flex-shrink: 0;
|
220
226
|
}
|
221
227
|
.bk-input--clear-icon:hover {
|
222
228
|
color: #979ba5;
|
@@ -277,6 +283,9 @@
|
|
277
283
|
font-size: 12px;
|
278
284
|
transform: scale(0.8);
|
279
285
|
}
|
286
|
+
.bk-input--max-length.is-over-limit {
|
287
|
+
color: #ea3636;
|
288
|
+
}
|
280
289
|
.bk-input--max-length span {
|
281
290
|
color: #979ba5;
|
282
291
|
}
|
@@ -293,6 +302,9 @@
|
|
293
302
|
box-sizing: border-box;
|
294
303
|
transition: all 0.3s;
|
295
304
|
flex: 1;
|
305
|
+
text-overflow: ellipsis;
|
306
|
+
white-space: nowrap;
|
307
|
+
overflow: hidden;
|
296
308
|
}
|
297
309
|
.bk-input--text[type='search']::-webkit-search-decoration,
|
298
310
|
.bk-input--text[type='search']::-webkit-search-cancel-button,
|
package/lib/input/input.d.ts
CHANGED
@@ -67,7 +67,7 @@ export declare const inputType: {
|
|
67
67
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
68
68
|
};
|
69
69
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
70
|
-
size: import("vue-types").VueTypeDef<"
|
70
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
71
71
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
72
72
|
default: number;
|
73
73
|
};
|
@@ -81,6 +81,11 @@ export declare const inputType: {
|
|
81
81
|
} & {
|
82
82
|
default: boolean;
|
83
83
|
};
|
84
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
85
|
+
default: boolean;
|
86
|
+
} & {
|
87
|
+
default: boolean;
|
88
|
+
};
|
84
89
|
};
|
85
90
|
export declare const enum EVENTS {
|
86
91
|
UPDATE = "update:modelValue",
|
@@ -98,7 +103,7 @@ export declare const enum EVENTS {
|
|
98
103
|
COMPOSITIONUPDATE = "compositionupdate",
|
99
104
|
COMPOSITIONEND = "compositionend"
|
100
105
|
}
|
101
|
-
declare function EventFunction(_value: any, _evt
|
106
|
+
declare function EventFunction(_value: any, _evt: KeyboardEvent): any;
|
102
107
|
declare function CompositionEventFunction(evt: CompositionEvent): CompositionEvent;
|
103
108
|
export declare const inputEmitEventsType: {
|
104
109
|
"update:modelValue": typeof EventFunction;
|
@@ -185,7 +190,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
185
190
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
186
191
|
};
|
187
192
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
188
|
-
size: import("vue-types").VueTypeDef<"
|
193
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
189
194
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
190
195
|
default: number;
|
191
196
|
};
|
@@ -199,6 +204,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
199
204
|
} & {
|
200
205
|
default: boolean;
|
201
206
|
};
|
207
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
208
|
+
default: boolean;
|
209
|
+
} & {
|
210
|
+
default: boolean;
|
211
|
+
};
|
202
212
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
203
213
|
"update:modelValue": typeof EventFunction;
|
204
214
|
focus: (evt: FocusEvent) => FocusEvent;
|
@@ -282,7 +292,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
282
292
|
validator: import("vue-types/dist/types").ValidatorFunction<unknown>;
|
283
293
|
};
|
284
294
|
modelValue: import("vue-types").VueTypeDef<string | number>;
|
285
|
-
size: import("vue-types").VueTypeDef<"
|
295
|
+
size: import("vue-types").VueTypeDef<"default" | "small" | "large">;
|
286
296
|
rows: import("vue-types").VueTypeValidableDef<number> & {
|
287
297
|
default: number;
|
288
298
|
};
|
@@ -296,24 +306,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
296
306
|
} & {
|
297
307
|
default: boolean;
|
298
308
|
};
|
309
|
+
overMaxLengthLimit: import("vue-types").VueTypeValidableDef<boolean> & {
|
310
|
+
default: boolean;
|
311
|
+
} & {
|
312
|
+
default: boolean;
|
313
|
+
};
|
299
314
|
}>> & {
|
300
|
-
onPaste?: (_value: any, _evt
|
315
|
+
onPaste?: (_value: any, _evt: KeyboardEvent) => any;
|
301
316
|
onCompositionend?: (evt: CompositionEvent) => any;
|
302
317
|
onCompositionstart?: (evt: CompositionEvent) => any;
|
303
318
|
onCompositionupdate?: (evt: CompositionEvent) => any;
|
304
319
|
onFocus?: (evt: FocusEvent) => any;
|
305
320
|
onBlur?: (evt: FocusEvent) => any;
|
306
|
-
onChange?: (_value: any, _evt
|
307
|
-
onInput?: (_value: any, _evt
|
308
|
-
onKeydown?: (_value: any, _evt
|
309
|
-
onKeypress?: (_value: any, _evt
|
310
|
-
onKeyup?: (_value: any, _evt
|
321
|
+
onChange?: (_value: any, _evt: KeyboardEvent) => any;
|
322
|
+
onInput?: (_value: any, _evt: KeyboardEvent) => any;
|
323
|
+
onKeydown?: (_value: any, _evt: KeyboardEvent) => any;
|
324
|
+
onKeypress?: (_value: any, _evt: KeyboardEvent) => any;
|
325
|
+
onKeyup?: (_value: any, _evt: KeyboardEvent) => any;
|
311
326
|
onClear?: () => any;
|
312
|
-
"onUpdate:modelValue"?: (_value: any, _evt
|
313
|
-
onEnter?: (_value: any, _evt
|
327
|
+
"onUpdate:modelValue"?: (_value: any, _evt: KeyboardEvent) => any;
|
328
|
+
onEnter?: (_value: any, _evt: KeyboardEvent) => any;
|
314
329
|
}, {
|
315
|
-
prefix: string;
|
316
330
|
type: string;
|
331
|
+
prefix: string;
|
317
332
|
disabled: boolean;
|
318
333
|
placeholder: string;
|
319
334
|
step: number;
|
@@ -333,5 +348,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
333
348
|
rows: number;
|
334
349
|
selectReadonly: boolean;
|
335
350
|
withValidate: boolean;
|
351
|
+
overMaxLengthLimit: boolean;
|
336
352
|
}, {}>;
|
337
353
|
export default _default;
|
package/lib/input/input.less
CHANGED
@@ -8,10 +8,12 @@
|
|
8
8
|
}
|
9
9
|
|
10
10
|
.disabled() {
|
11
|
+
|
11
12
|
&.is-disabled,
|
12
13
|
&.is-readonly {
|
13
14
|
background-color: @input-disabled-bg;
|
14
15
|
border-color: @disable-color;
|
16
|
+
|
15
17
|
.@{bk-prefix}-input--prefix-area,
|
16
18
|
.@{bk-prefix}-input--suffix-area,
|
17
19
|
.@{bk-prefix}-input--suffix-icon {
|
@@ -57,9 +59,10 @@
|
|
57
59
|
box-sizing: border-box;
|
58
60
|
transition: all .3s;
|
59
61
|
flex-direction: column;
|
62
|
+
resize: both;
|
60
63
|
.disabled();
|
61
64
|
|
62
|
-
>
|
65
|
+
>textarea {
|
63
66
|
width: 100%;
|
64
67
|
padding: 5px 10px;
|
65
68
|
line-height: 1.5;
|
@@ -80,9 +83,12 @@
|
|
80
83
|
transform: scale(.8);
|
81
84
|
justify-content: flex-end;
|
82
85
|
|
86
|
+
&.is-over-limit {
|
87
|
+
color: @danger-color;
|
88
|
+
}
|
89
|
+
|
83
90
|
span {
|
84
91
|
color: @input-maxlength-color;
|
85
|
-
|
86
92
|
}
|
87
93
|
}
|
88
94
|
|
@@ -121,7 +127,9 @@
|
|
121
127
|
border-color: transparent;
|
122
128
|
border-bottom-color: @light-gray;
|
123
129
|
box-shadow: none;
|
124
|
-
|
130
|
+
|
131
|
+
.@{bk-prefix}-input--text,
|
132
|
+
.@{bk-prefix}-input--suffix-icon {
|
125
133
|
background-color: @input-block-color;
|
126
134
|
}
|
127
135
|
}
|
@@ -136,6 +144,7 @@
|
|
136
144
|
background-color: @input-bg;
|
137
145
|
align-items: center;
|
138
146
|
align-self: center;
|
147
|
+
flex-shrink: 0;
|
139
148
|
|
140
149
|
&.show-clear-only-hover {
|
141
150
|
display: none;
|
@@ -144,6 +153,7 @@
|
|
144
153
|
|
145
154
|
&--clear-icon {
|
146
155
|
cursor: pointer;
|
156
|
+
flex-shrink: 0;
|
147
157
|
|
148
158
|
&:hover {
|
149
159
|
color: @gray-color;
|
@@ -157,6 +167,7 @@
|
|
157
167
|
.@{bk-prefix}-input--max-length {
|
158
168
|
font-size: @font-size-large;
|
159
169
|
}
|
170
|
+
|
160
171
|
.@{bk-prefix}-input--number-control {
|
161
172
|
span:first-child {
|
162
173
|
margin-bottom: 4px;
|
@@ -187,7 +198,9 @@
|
|
187
198
|
border-color: transparent;
|
188
199
|
border-bottom-color: @primary-color;
|
189
200
|
box-shadow: none;
|
190
|
-
|
201
|
+
|
202
|
+
.@{bk-prefix}-input--text,
|
203
|
+
.@{bk-prefix}-input--suffix-icon {
|
191
204
|
background-color: @input-block-color;
|
192
205
|
}
|
193
206
|
}
|
@@ -216,6 +229,10 @@
|
|
216
229
|
font-size: 12px;
|
217
230
|
transform: scale(.8);
|
218
231
|
|
232
|
+
&.is-over-limit {
|
233
|
+
color: @danger-color;
|
234
|
+
}
|
235
|
+
|
219
236
|
span {
|
220
237
|
color: @input-maxlength-color;
|
221
238
|
}
|
@@ -234,6 +251,9 @@
|
|
234
251
|
box-sizing: border-box;
|
235
252
|
transition: all .3s;
|
236
253
|
flex: 1;
|
254
|
+
text-overflow: ellipsis;
|
255
|
+
white-space: nowrap;
|
256
|
+
overflow: hidden;
|
237
257
|
|
238
258
|
//Chrome
|
239
259
|
&[type='search']::-webkit-search-decoration,
|
@@ -242,6 +262,7 @@
|
|
242
262
|
&[type='search']::-webkit-search-results-decoration {
|
243
263
|
appearance: none;
|
244
264
|
}
|
265
|
+
|
245
266
|
// IE
|
246
267
|
[type='search']::-ms-clear {
|
247
268
|
display: none;
|
@@ -305,4 +326,4 @@
|
|
305
326
|
background-color: @input-block-hover-color;
|
306
327
|
}
|
307
328
|
}
|
308
|
-
}
|
329
|
+
}
|
@@ -206,6 +206,7 @@
|
|
206
206
|
box-sizing: border-box;
|
207
207
|
transition: all 0.3s;
|
208
208
|
flex-direction: column;
|
209
|
+
resize: both;
|
209
210
|
}
|
210
211
|
.bk-textarea ::placeholder {
|
211
212
|
color: #c4c6cc;
|
@@ -256,6 +257,9 @@
|
|
256
257
|
transform: scale(0.8);
|
257
258
|
justify-content: flex-end;
|
258
259
|
}
|
260
|
+
.bk-textarea--max-length.is-over-limit {
|
261
|
+
color: #ea3636;
|
262
|
+
}
|
259
263
|
.bk-textarea--max-length span {
|
260
264
|
color: #979ba5;
|
261
265
|
}
|
@@ -333,12 +337,14 @@
|
|
333
337
|
background-color: white;
|
334
338
|
align-items: center;
|
335
339
|
align-self: center;
|
340
|
+
flex-shrink: 0;
|
336
341
|
}
|
337
342
|
.bk-input--suffix-icon.show-clear-only-hover {
|
338
343
|
display: none;
|
339
344
|
}
|
340
345
|
.bk-input--clear-icon {
|
341
346
|
cursor: pointer;
|
347
|
+
flex-shrink: 0;
|
342
348
|
}
|
343
349
|
.bk-input--clear-icon:hover {
|
344
350
|
color: #979ba5;
|
@@ -399,6 +405,9 @@
|
|
399
405
|
font-size: 12px;
|
400
406
|
transform: scale(0.8);
|
401
407
|
}
|
408
|
+
.bk-input--max-length.is-over-limit {
|
409
|
+
color: #ea3636;
|
410
|
+
}
|
402
411
|
.bk-input--max-length span {
|
403
412
|
color: #979ba5;
|
404
413
|
}
|
@@ -415,6 +424,9 @@
|
|
415
424
|
box-sizing: border-box;
|
416
425
|
transition: all 0.3s;
|
417
426
|
flex: 1;
|
427
|
+
text-overflow: ellipsis;
|
428
|
+
white-space: nowrap;
|
429
|
+
overflow: hidden;
|
418
430
|
}
|
419
431
|
.bk-input--text[type='search']::-webkit-search-decoration,
|
420
432
|
.bk-input--text[type='search']::-webkit-search-cancel-button,
|