@king-design/react 3.0.0-beta.1 → 3.0.0-beta.2
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/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +278 -271
- package/components/button/styles.d.ts +1 -1
- package/components/button/styles.js +3 -5
- package/components/carousel/index.vdt.js +2 -2
- package/components/cascader/index.vdt.js +1 -1
- package/components/collapse/item.vdt.js +1 -1
- package/components/copy/index.vdt.js +1 -1
- package/components/datepicker/calendar.vdt.js +6 -6
- package/components/datepicker/index.spec.js +170 -152
- package/components/datepicker/styles.js +1 -1
- package/components/datepicker/useValue.d.ts +3 -3
- package/components/datepicker/useValue.js +38 -9
- package/components/dialog/styles.js +1 -1
- package/components/form/styles.js +1 -1
- package/components/icon/styles.js +1 -1
- package/components/input/index.d.ts +3 -1
- package/components/input/index.js +4 -1
- package/components/input/index.vdt.js +21 -10
- package/components/input/search.vdt.js +2 -4
- package/components/input/styles.js +13 -6
- package/components/input/useFocus.d.ts +4 -0
- package/components/input/useFocus.js +21 -0
- package/components/menu/item.vdt.js +4 -1
- package/components/pagination/index.vdt.js +2 -2
- package/components/progress/index.vdt.js +1 -1
- package/components/select/base.vdt.js +36 -19
- package/components/select/index.spec.js +23 -11
- package/components/select/menu.vdt.js +5 -5
- package/components/select/option.vdt.js +2 -1
- package/components/select/styles.js +1 -1
- package/components/spinner/index.vdt.js +4 -4
- package/components/spinner/styles.js +2 -2
- package/components/steps/step.vdt.js +2 -2
- package/components/steps/styles.js +6 -2
- package/components/table/cell.vdt.js +1 -1
- package/components/table/column.vdt.js +40 -24
- package/components/table/index.spec.js +37 -6
- package/components/table/styles.js +15 -8
- package/components/table/useGroup.d.ts +9 -3
- package/components/table/useGroup.js +45 -37
- package/components/tabs/index.vdt.js +7 -2
- package/components/tag/styles.js +1 -1
- package/components/tag/tags.vdt.js +14 -2
- package/components/tag/useNowrap.js +1 -1
- package/components/transfer/index.vdt.js +14 -3
- package/components/types.d.ts +1 -0
- package/components/upload/index.vdt.js +4 -4
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.svg +35 -35
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/global.js +1 -1
- package/components/select/useNowrap.d.ts +0 -3
- package/components/select/useNowrap.js +0 -19
|
@@ -83,7 +83,7 @@ export function makePanelStyles() {
|
|
|
83
83
|
return /*#__PURE__*/css("display:flex;.k-datepicker-shortcuts{width:", datepicker.shortcuts.width, ";padding:", datepicker.shortcuts.padding, ";border-right:", datepicker.border, ";}.k-datepicker-shortcut{height:", datepicker.shortcuts.shortcut.height, ";line-height:", datepicker.shortcuts.shortcut.height, ";padding:", datepicker.shortcuts.shortcut.padding, ";cursor:pointer;&:hover{background:", datepicker.shortcuts.shortcut.hoverBgcolor, ";}}.k-datepicker-calendars{display:flex;}.k-datepicker-calendar-wrapper{&:nth-child(2){border-left:", datepicker.border, ";}.k-tabs{border:none;.k-tabs-wrapper{float:none;}.k-tab{width:50%;}}}.k-datepicker-footer{border-top:", datepicker.border, ";padding:", datepicker.footer.padding, ";text-align:right;}");
|
|
84
84
|
}
|
|
85
85
|
export function makeCalendarStyles() {
|
|
86
|
-
return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.k-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.k-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.k-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.k-weekday{flex:1;text-align:center;}.k-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;.k-value{border-radius:", datepicker.item.borderRadius, ";}&.k-hover
|
|
86
|
+
return /*#__PURE__*/css("padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-datepicker-month{display:flex;padding:", datepicker.month.padding, ";}.k-prev .k-icon,.k-next .k-icon{margin:0 -5px!important;}.k-month-values{flex:1;font-size:14px;text-align:center;cursor:pointer;overflow:hidden;position:relative;}.k-month-value{margin:0 ", datepicker.month.valueGap, ";line-height:", theme.small.height, ";&:hover{color:", theme.color.primary, ";}},.k-weekdays{display:flex;border-bottom:", datepicker.border, ";padding:", datepicker.weekday.padding, ";}.k-weekday{flex:1;text-align:center;}.k-calendar-item{text-align:center;margin:", datepicker.item.gutter, ";aspect-ratio:1;display:flex;align-items:center;cursor:pointer;position:relative;border-radius:", datepicker.item.borderRadius, ";.k-value{border-radius:", datepicker.item.borderRadius, ";}&.k-hover{background:", datepicker.item.hoverBgColor, ";}&.k-exceed{color:", datepicker.item.exceedColor, ";}&.k-today .k-value{border:", datepicker.item.todayBorder, ";}&.k-active{background:", datepicker.item.active.bgColor, ";color:", datepicker.item.active.color, ";&.k-today .k-value{border-color:", datepicker.item.active.todayBorderColor, ";}}&.k-disabled{color:", datepicker.item.disabled.color, ";cursor:not-allowed;background:", datepicker.item.disabled.hoverBgColor, ";}&.k-in-range:after{content:'';display:block;position:absolute;box-sizing:content-box;background:", datepicker.item.range.bgColor, ";width:100%;height:100%;left:-", datepicker.item.gutter, ";padding:0 ", datepicker.item.gutter, ";z-index:-1;}.k-value{flex:1;display:flex;align-items:center;justify-content:center;height:100%;}}.k-days{display:grid;grid-template-columns:repeat(7, 1fr);}.k-years{display:grid;grid-template-columns:repeat(4, 1fr);}");
|
|
87
87
|
}
|
|
88
88
|
export function makeTimeStyles() {
|
|
89
89
|
return /*#__PURE__*/css("display:flex;padding:", datepicker.padding, ";width:", datepicker.width, ";position:relative;.k-scroll-select{flex:1;height:305px;}");
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { StateValueItem, DayjsValue } from './basepicker';
|
|
2
|
-
import { Dayjs } from 'dayjs';
|
|
2
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
3
3
|
import type { useFormats } from './useFormats';
|
|
4
4
|
import type { useDisabled } from './useDisabled';
|
|
5
5
|
import { PanelFlags, usePanel } from './usePanel';
|
|
6
6
|
export declare function useValue(formats: ReturnType<typeof useFormats>, disabled: ReturnType<typeof useDisabled>, panel: ReturnType<typeof usePanel>): {
|
|
7
7
|
format: () => string | string[];
|
|
8
8
|
onConfirm: () => void;
|
|
9
|
-
onChangeTime: (date: Dayjs, flag: PanelFlags) => void;
|
|
10
|
-
getTimeValue: (flag: PanelFlags) => Dayjs | null | undefined;
|
|
9
|
+
onChangeTime: (date: dayjs.Dayjs, flag: PanelFlags) => void;
|
|
10
|
+
getTimeValue: (flag: PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
11
11
|
convertToDayjs: (v: import("./basepicker").Value | [import("./basepicker").Value, import("./basepicker").Value] | import("./basepicker").Value[] | [import("./basepicker").Value, import("./basepicker").Value][] | null | undefined) => DayjsValue;
|
|
12
12
|
getDayjsValue: () => DayjsValue;
|
|
13
13
|
value: import("../../hooks/useState").State<import("./basepicker").StateValue>;
|
|
@@ -6,7 +6,9 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slic
|
|
|
6
6
|
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js/instance/sort";
|
|
7
7
|
import { useInstance } from 'intact-react';
|
|
8
8
|
import { useValue as useValueBase } from './basepicker';
|
|
9
|
+
import dayjs from 'dayjs';
|
|
9
10
|
import { last } from '../utils';
|
|
11
|
+
import { endTime } from './helpers';
|
|
10
12
|
import { PanelTypes, PanelFlags } from './usePanel';
|
|
11
13
|
export function useValue(formats, disabled, panel) {
|
|
12
14
|
var instance = useInstance();
|
|
@@ -41,21 +43,21 @@ export function useValue(formats, disabled, panel) {
|
|
|
41
43
|
type = _instance$get3.type,
|
|
42
44
|
range = _instance$get3.range;
|
|
43
45
|
|
|
44
|
-
var _value
|
|
45
|
-
|
|
46
|
-
var minDate = disabled.minDate.value;
|
|
47
|
-
|
|
48
|
-
if (minDate && _value.isBefore(minDate)) {
|
|
49
|
-
_value = minDate;
|
|
50
|
-
}
|
|
46
|
+
var _value;
|
|
51
47
|
|
|
52
48
|
if (range) {
|
|
53
49
|
var oldValue = last(value.value);
|
|
54
50
|
|
|
55
51
|
if (!oldValue || oldValue.length === 2) {
|
|
56
|
-
|
|
52
|
+
/**
|
|
53
|
+
* if we select the first value or re-select the value
|
|
54
|
+
* no matter what the flag is, we should set flag to start panel
|
|
55
|
+
* #877
|
|
56
|
+
*/
|
|
57
|
+
flag = PanelFlags.Start;
|
|
58
|
+
_value = [fixDatetimeWithMinDate(v)];
|
|
57
59
|
} else {
|
|
58
|
-
_value = [oldValue[0], v];
|
|
60
|
+
_value = [oldValue[0], fixDatetimeWithMaxDate(v)];
|
|
59
61
|
|
|
60
62
|
_sortInstanceProperty(_value).call(_value, function (a, b) {
|
|
61
63
|
return a.isAfter(b) ? 1 : -1;
|
|
@@ -63,6 +65,8 @@ export function useValue(formats, disabled, panel) {
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
instance.trigger('selecting', _value);
|
|
68
|
+
} else {
|
|
69
|
+
_value = fixDatetimeWithMinDate(v);
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
setValue(_value, false);
|
|
@@ -74,6 +78,31 @@ export function useValue(formats, disabled, panel) {
|
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
81
|
+
function fixDatetimeWithMinDate(v) {
|
|
82
|
+
// the datetime must be greater than minDate, #406
|
|
83
|
+
var minDate = disabled.minDate.value;
|
|
84
|
+
|
|
85
|
+
if (minDate && v.isBefore(minDate)) {
|
|
86
|
+
return minDate;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return v;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function fixDatetimeWithMaxDate(v) {
|
|
93
|
+
// the tiem of end datetime should be set to 23:59:59, #878
|
|
94
|
+
var maxDate = disabled.maxDate.value;
|
|
95
|
+
var date = v.toDate();
|
|
96
|
+
endTime(date);
|
|
97
|
+
v = dayjs(date);
|
|
98
|
+
|
|
99
|
+
if (maxDate && v.isAfter(maxDate)) {
|
|
100
|
+
return maxDate;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return v;
|
|
104
|
+
}
|
|
105
|
+
|
|
77
106
|
return _extends({
|
|
78
107
|
value: value,
|
|
79
108
|
setValue: setValue,
|
|
@@ -50,7 +50,7 @@ setDefault(function () {
|
|
|
50
50
|
}).form;
|
|
51
51
|
});
|
|
52
52
|
export function makeItemStyles() {
|
|
53
|
-
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-
|
|
53
|
+
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-wrapper{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-wrapper{border:none;}}.k-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
54
54
|
}
|
|
55
55
|
export function makeFormStyles() {
|
|
56
56
|
var _context;
|
|
@@ -41,5 +41,5 @@ export default function makeStyles(color) {
|
|
|
41
41
|
}), " ", _mapInstanceProperty(colors).call(colors, function (color) {
|
|
42
42
|
var _color = theme.color[color];
|
|
43
43
|
return /*#__PURE__*/css("&.k-", color, "{color:", _color, ";&.k-hoverable:hover{color:", palette(_color, -2), ";}}");
|
|
44
|
-
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{
|
|
44
|
+
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{font-size:inherit;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}&.k-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
|
|
45
45
|
}
|
|
@@ -2,7 +2,7 @@ import { Component, TypeDefs } from 'intact-react';
|
|
|
2
2
|
import { Sizes } from '../../styles/utils';
|
|
3
3
|
import { CommonInputHTMLAttributes, Events } from '../types';
|
|
4
4
|
export * from './search';
|
|
5
|
-
export declare type HTMLInputTypes = 'textarea' | 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
|
|
5
|
+
export declare type HTMLInputTypes = 'textarea' | 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | 'maxlength' | (string & {});
|
|
6
6
|
interface InputHTMLAttributes extends CommonInputHTMLAttributes {
|
|
7
7
|
pattern?: string;
|
|
8
8
|
dirname?: string;
|
|
@@ -31,6 +31,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
|
|
|
31
31
|
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
32
32
|
showPassword?: boolean;
|
|
33
33
|
flat?: boolean;
|
|
34
|
+
showCount?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare type AutoRows = {
|
|
36
37
|
min?: number;
|
|
@@ -58,6 +59,7 @@ export declare class Input<V extends Value = Value> extends Component<InputProps
|
|
|
58
59
|
private frozen;
|
|
59
60
|
private autoRows;
|
|
60
61
|
private showPassword;
|
|
62
|
+
private focusHook;
|
|
61
63
|
focus(): void;
|
|
62
64
|
blur(): void;
|
|
63
65
|
select(): void;
|
|
@@ -9,6 +9,7 @@ import { useAutoWidth } from './useAutoWidth';
|
|
|
9
9
|
import { useFrozen } from './useFrozen';
|
|
10
10
|
import { useAutoRows } from './useAutoRows';
|
|
11
11
|
import { useShowPassword } from './useShowPassword';
|
|
12
|
+
import { useFocus } from './useFocus';
|
|
12
13
|
export * from './search';
|
|
13
14
|
var typeDefs = {
|
|
14
15
|
type: String,
|
|
@@ -29,7 +30,8 @@ var typeDefs = {
|
|
|
29
30
|
waveDisabled: Boolean,
|
|
30
31
|
resize: ['none', 'vertical', 'horizontal', 'both'],
|
|
31
32
|
showPassword: Boolean,
|
|
32
|
-
flat: Boolean
|
|
33
|
+
flat: Boolean,
|
|
34
|
+
showCount: Boolean
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
var defaults = function defaults() {
|
|
@@ -65,6 +67,7 @@ export var Input = /*#__PURE__*/function (_Component) {
|
|
|
65
67
|
_this.frozen = useFrozen();
|
|
66
68
|
_this.autoRows = useAutoRows(_this.inputRef);
|
|
67
69
|
_this.showPassword = useShowPassword();
|
|
70
|
+
_this.focusHook = useFocus();
|
|
68
71
|
return _this;
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "flat", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
3
|
+
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "flat", "showCount", "maxlength", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
4
4
|
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
5
|
-
import { createElementVNode as _$ce, className as _$cn, createUnknownComponentVNode as _$cc, noop as _$no, createVNode as _$cv } from 'intact-react';
|
|
5
|
+
import { createElementVNode as _$ce, className as _$cn, createUnknownComponentVNode as _$cc, noop as _$no, createVNode as _$cv, createTextVNode as _$ct } from 'intact-react';
|
|
6
6
|
import { Icon } from '../icon';
|
|
7
|
-
import { addStyle, isTextBlock, getRestProps } from '../utils';
|
|
7
|
+
import { addStyle, isTextBlock, getRestProps, stopPropagation } from '../utils';
|
|
8
8
|
import { makeStyles } from './styles';
|
|
9
9
|
import { noop, isNullOrUndefined, isStringOrNumber } from 'intact-shared';
|
|
10
10
|
import { Wave } from '../wave';
|
|
@@ -42,6 +42,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
42
42
|
waveDisabled = _this$get.waveDisabled,
|
|
43
43
|
resize = _this$get.resize,
|
|
44
44
|
flat = _flatInstanceProperty(_this$get),
|
|
45
|
+
showCount = _this$get.showCount,
|
|
46
|
+
maxlength = _this$get.maxlength,
|
|
45
47
|
click = _this$get['ev-click'],
|
|
46
48
|
mouseenter = _this$get['ev-mounseenter'],
|
|
47
49
|
mouseleave = _this$get['ev-mouseleave'],
|
|
@@ -53,10 +55,13 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
53
55
|
startInput = _this$frozen.startInput,
|
|
54
56
|
onInput = _this$frozen.onInput,
|
|
55
57
|
endInput = _this$frozen.endInput;
|
|
58
|
+
var _this$focusHook = this.focusHook,
|
|
59
|
+
isFocus = _this$focusHook.isFocus,
|
|
60
|
+
focusInputOnClick = _this$focusHook.focusInputOnClick;
|
|
56
61
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
57
62
|
var classNameObj = (_classNameObj = {
|
|
58
63
|
'k-input': true
|
|
59
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-
|
|
64
|
+
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj['k-flat'] = flat, _classNameObj['k-type-textarea'] = type === 'textarea', _classNameObj['k-focus'] = isFocus.value, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
60
65
|
var _this$showPassword = this.showPassword,
|
|
61
66
|
isShowPassword = _this$showPassword.isShow,
|
|
62
67
|
toggleShowPassword = _this$showPassword.toggleShow,
|
|
@@ -78,6 +83,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
78
83
|
readOnly: readonly,
|
|
79
84
|
placeholder: placeholder,
|
|
80
85
|
disabled: disabled,
|
|
86
|
+
maxLength: maxlength,
|
|
81
87
|
ref: this.inputRef,
|
|
82
88
|
style: autoWidth && fakeWidth ? {
|
|
83
89
|
width: fakeWidth + 'px'
|
|
@@ -98,6 +104,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
98
104
|
'children': function children(isInvalid) {
|
|
99
105
|
return _$cc(Wave, {
|
|
100
106
|
'disabled': waveDisabled || disabled || isInvalid,
|
|
107
|
+
'inset': '-2px',
|
|
101
108
|
'children': _$ce(2, 'div', [$blocks.prefix ? _$ce(2, 'div', (_$blocks['prefix'] = function ($super) {
|
|
102
109
|
return null;
|
|
103
110
|
}, __$blocks['prefix'] = function ($super, data) {
|
|
@@ -117,22 +124,22 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
117
124
|
'style': height.value ? addStyle(inputProps.style, {
|
|
118
125
|
height: height.value + 'px'
|
|
119
126
|
}) : inputProps.style
|
|
120
|
-
})), $blocks.suffix || clearable && !disabled || showPasswordIcon.value ? _$ce(2, 'div', [showPasswordIcon.value ? [_$cc(Icon, {
|
|
127
|
+
})), $blocks.suffix || clearable && !disabled || showPasswordIcon.value || showCount ? _$ce(2, 'div', [showPasswordIcon.value ? [_$cc(Icon, {
|
|
121
128
|
'hoverable': true,
|
|
122
129
|
'className': _$cn({
|
|
123
130
|
"k-input-show-password": true,
|
|
124
|
-
"
|
|
125
|
-
"
|
|
131
|
+
"k-icon-hidden": !isShowPassword.value,
|
|
132
|
+
"k-icon-visible": isShowPassword.value
|
|
126
133
|
}),
|
|
127
134
|
'ev-click': toggleShowPassword
|
|
128
135
|
}), ' '] : undefined, clearable && !disabled ? _$cc(Icon, {
|
|
129
136
|
'className': _$cn({
|
|
130
|
-
"k-input-clear
|
|
137
|
+
"k-input-clear k-icon-error-fill": true,
|
|
131
138
|
"k-input-show": hasValue
|
|
132
139
|
}),
|
|
133
140
|
'ev-click': _this.clear,
|
|
134
141
|
'hoverable': true
|
|
135
|
-
}) : undefined, ' ', (_$blocks['suffix'] = function ($super) {
|
|
142
|
+
}) : undefined, ' ', showCount ? _$ce(2, 'span', [hasValue ? value.length : 0, maxlength ? _$ce(2, 'span', [_$ct(' / '), maxlength], 0) : undefined], 0, 'k-input-count') : undefined, (_$blocks['suffix'] = function ($super) {
|
|
136
143
|
return null;
|
|
137
144
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
138
145
|
var block = $blocks['suffix'];
|
|
@@ -142,7 +149,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
142
149
|
};
|
|
143
150
|
|
|
144
151
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
145
|
-
}, __$blocks['suffix'](_$no))], 0, 'k-input-suffix'
|
|
152
|
+
}, __$blocks['suffix'](_$no))], 0, 'k-input-suffix', {
|
|
153
|
+
'ev-click': stopPropagation
|
|
154
|
+
}) : undefined, autoWidth ? _$ce(2, 'div', _$ce(2, 'span', !hasValue ? placeholder : inputValue, 0, null, null, null, fakeRef), 2, 'k-input-fake') : undefined], 0, 'k-input-wrapper', {
|
|
155
|
+
'ev-click': focusInputOnClick
|
|
156
|
+
})
|
|
146
157
|
});
|
|
147
158
|
}
|
|
148
159
|
}), $blocks.append ? (_children = $blocks.append(noop), _$ce(2, 'div', _children, 0, _$cn({
|
|
@@ -23,10 +23,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
23
23
|
size = _this$get.size,
|
|
24
24
|
open = _this$get.open;
|
|
25
25
|
|
|
26
|
-
var isTypeNotDefault = type !== 'default';
|
|
27
26
|
var classNameObj = (_classNameObj = {
|
|
28
27
|
'k-search': true
|
|
29
|
-
}, _classNameObj[className] = className, _classNameObj['k-open'] = open, _classNameObj['k-hide'] = !open, _classNameObj["k-" + type] =
|
|
28
|
+
}, _classNameObj[className] = className, _classNameObj['k-open'] = open, _classNameObj['k-hide'] = !open, _classNameObj["k-" + type] = type, _classNameObj[makeSearchStyles()] = true, _classNameObj);
|
|
30
29
|
return _$cv('form', _extends({}, getRestProps(this), {
|
|
31
30
|
'className': _$cn(classNameObj),
|
|
32
31
|
'ev-submit': this.onSubmit,
|
|
@@ -39,8 +38,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
38
|
'ev-$change:value': this.onChangeValue,
|
|
40
39
|
'readonly': !open,
|
|
41
40
|
'size': size,
|
|
42
|
-
'
|
|
43
|
-
'waveDisabled': isTypeNotDefault
|
|
41
|
+
'waveDisabled': type !== 'default'
|
|
44
42
|
}, null, this.inputRef), _$cc(Button, {
|
|
45
43
|
'icon': true,
|
|
46
44
|
'type': 'none',
|
|
@@ -97,6 +97,13 @@ var defaults = deepDefaults({
|
|
|
97
97
|
return theme.color.bg;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
},
|
|
101
|
+
// count
|
|
102
|
+
count: {
|
|
103
|
+
get color() {
|
|
104
|
+
return theme.color.placeholder;
|
|
105
|
+
}
|
|
106
|
+
|
|
100
107
|
}
|
|
101
108
|
}, sizes.reduce(function (memo, size) {
|
|
102
109
|
var styles = theme[size];
|
|
@@ -125,18 +132,18 @@ setDefault(function () {
|
|
|
125
132
|
export function makeStyles() {
|
|
126
133
|
var _context;
|
|
127
134
|
|
|
128
|
-
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";vertical-align:middle;.k-input-wrapper{display:inline-
|
|
135
|
+
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";color:", input.color, ";vertical-align:middle;.k-input-wrapper{display:inline-flex;align-items:center;width:100%;position:relative;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";&:hover{border:", input.hoverBorder, ";z-index:1;}}&.k-focus .k-input-wrapper{border:", input.focusBorder, ";z-index:1;}.k-input-inner{flex:1;outline:none;color:inherit;font-size:inherit;border:none;background:transparent;padding:0;width:0;&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{display:flex;align-items:center;gap:", input.clearIconGap, ";color:", theme.color.lightBlack, ";position:relative;}.k-input-prefix{margin-right:", input.clearIconGap, ";}.k-input-suffix{margin-left:", input.clearIconGap, ";}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";}&:hover .k-input-clear.k-input-show{opacity:1;pointer-events:all;}.k-input-show-password{color:", input.clearIconColor, ";}&.k-stack-clear{.k-input-clear{position:absolute;z-index:1;right:0;&.k-input-show+*{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+*{opacity:0;}}}&.k-group{display:inline-flex;.k-input-wrapper{border-radius:0;}.k-input-wrapper:first-child{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}.k-input-wrapper:last-child{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-prepend,.k-input-append{display:inline-flex;align-items:center;background-color:", input.groupBgColor, ";border:", input.border, ";white-space:nowrap;.k-btn{margin:-1px;border:none;&.k-none:hover{background:transparent;}}.k-select{margin:-1px;text-align:left;}}.k-input-prepend{&,.k-btn,.k-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-append{&,.k-btn,.k-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-padding{padding:0 ", input.groupPaddingGap, ";}.k-input-prepend{border-right:none;}.k-input-append{border-left:none;}&.k-flat{color:", _flatInstanceProperty(input).color, ";.k-input-wrapper{border:none;background:", _flatInstanceProperty(input).bgColor, ";}}&.k-disabled{color:", input.disabledColor, ";cursor:not-allowed;.k-input-wrapper{border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";}.k-input-inner{cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
129
136
|
var styles = input[size];
|
|
130
|
-
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-
|
|
137
|
+
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-wrapper{height:", styles.height, ";padding:0 ", styles.paddingGap, ";}");
|
|
131
138
|
if (size === 'default') return sizeClassName;
|
|
132
139
|
return /*#__PURE__*/css("&.k-", size, "{", sizeClassName, ";}");
|
|
133
|
-
}), "&.k-inline{.k-input-
|
|
140
|
+
}), "&.k-inline{.k-input-wrapper{height:auto;border:none;border-radius:0;padding:0;}}&.k-type-textarea{.k-input-wrapper{display:inline-block;padding:0;height:auto;}.k-textarea{width:100%;padding:", input.textareaPadding, ";line-height:1.5;vertical-align:top;}.k-input-suffix{margin:0;justify-content:flex-end;}}", _mapInstanceProperty(_context = Input.typeDefs.resize).call(_context, function (type) {
|
|
134
141
|
return /*#__PURE__*/css("&.k-resize-", type, "{.k-textarea{resize:", type, ";}}");
|
|
135
|
-
}), ".k-input-fake{position:absolute;
|
|
142
|
+
}), ".k-input-fake{left:0;top:0;right:0;position:absolute;overflow:hidden;width:100%;visibility:hidden;white-space:nowrap;}&.k-auto-width{width:auto;max-width:100%;}.k-input-count{color:", input.count.color, ";}");
|
|
136
143
|
}
|
|
137
144
|
export function makeSearchStyles() {
|
|
138
|
-
return /*#__PURE__*/css("position:relative;display:inline-block;.k-input{transition:width ", input.transition, ";}.k-btn{position:absolute;top:0;right:0;z-index:1;}.k-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.k-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
145
|
+
return /*#__PURE__*/css("position:relative;display:inline-block;.k-input{transition:width ", input.transition, ";}.k-btn{position:absolute;top:0;right:0;z-index:1;}&.k-default .k-btn:hover{background:transparent;}.k-input-suffix{margin-right:", input.search.suffixMarginRight, ";}&.k-hide{", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
139
146
|
if (size == 'default') return;
|
|
140
147
|
return /*#__PURE__*/css(".k-input.k-", size, "{width:", input[size].height, ";}");
|
|
141
|
-
}), ";.k-input{width:", input.default.height, ";}.k-input-inner{padding:0!important;}}&.k-line{.k-input-
|
|
148
|
+
}), ";.k-input{width:", input.default.height, ";}.k-input-inner{padding:0!important;}}&.k-line{.k-input-wrapper{border-width:0;}&.k-open{.k-input-wrapper{border-bottom-width:1px;}.k-btn:hover{background:transparent;}}}");
|
|
142
149
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useInstance } from 'intact-react';
|
|
2
|
+
import { useState } from '../../hooks/useState';
|
|
3
|
+
export function useFocus() {
|
|
4
|
+
var instance = useInstance();
|
|
5
|
+
var isFocus = useState(false);
|
|
6
|
+
instance.on('focus', function () {
|
|
7
|
+
return isFocus.set(true);
|
|
8
|
+
});
|
|
9
|
+
instance.on('blur', function () {
|
|
10
|
+
return isFocus.set(false);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
function focusInputOnClick(e) {
|
|
14
|
+
instance.focus();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
isFocus: isFocus,
|
|
19
|
+
focusInputOnClick: focusInputOnClick
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -11,6 +11,9 @@ import { makeItemStyles, makeTitleStyles } from './styles';
|
|
|
11
11
|
var _$tmp0 = {
|
|
12
12
|
'className': 'k-menu-dot ion-record'
|
|
13
13
|
};
|
|
14
|
+
var _$tmp1 = {
|
|
15
|
+
'className': 'k-menu-arrow k-icon-down'
|
|
16
|
+
};
|
|
14
17
|
export default function ($props, $blocks, $__proto__) {
|
|
15
18
|
var _classNameObj,
|
|
16
19
|
_this = this;
|
|
@@ -56,7 +59,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
56
59
|
var title = function title(children) {
|
|
57
60
|
var _$cn2;
|
|
58
61
|
|
|
59
|
-
return _$ce(2, 'div', [showDot ? _$cc(Icon, _$tmp0) : undefined, _$ce(2, 'div', children, 0, 'k-menu-name'), subMenuVNode ? _$
|
|
62
|
+
return _$ce(2, 'div', [showDot ? _$cc(Icon, _$tmp0) : undefined, _$ce(2, 'div', children, 0, 'k-menu-name'), subMenuVNode ? _$cc(Icon, _$tmp1) : undefined], 0, _$cn((_$cn2 = {
|
|
60
63
|
'k-menu-title': true
|
|
61
64
|
}, _$cn2[makeTitleStyles()] = true, _$cn2)), {
|
|
62
65
|
'ev-click': _this.onClick.bind(_this, subMenuVNode)
|
|
@@ -9,10 +9,10 @@ import { Icon } from '../icon';
|
|
|
9
9
|
import { _$ } from '../../i18n';
|
|
10
10
|
import { makeStyles } from './styles';
|
|
11
11
|
var _$tmp0 = {
|
|
12
|
-
'className': 'k-icon-
|
|
12
|
+
'className': 'k-icon-left'
|
|
13
13
|
};
|
|
14
14
|
var _$tmp1 = {
|
|
15
|
-
'className': 'k-icon-
|
|
15
|
+
'className': 'k-icon-right'
|
|
16
16
|
};
|
|
17
17
|
export default function ($props, $blocks, $__proto__) {
|
|
18
18
|
var _classNameObj;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
3
3
|
import _valuesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/values";
|
|
4
|
-
import { createUnknownComponentVNode as _$cc, createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, map as _$ma } from 'intact-react';
|
|
4
|
+
import { createUnknownComponentVNode as _$cc, createVNode as _$cv, className as _$cn, createElementVNode as _$ce, noop as _$no, map as _$ma, extend as _$ex, EMPTY_OBJ as _$em } from 'intact-react';
|
|
5
5
|
import { TransitionGroup, Transition } from 'intact';
|
|
6
6
|
import { Input } from '../input';
|
|
7
7
|
import { Icon } from '../icon';
|
|
@@ -62,6 +62,21 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
62
62
|
var _this$focusout = this.focusout,
|
|
63
63
|
onFocusout = _this$focusout.onFocusout,
|
|
64
64
|
triggerRef = _this$focusout.triggerRef;
|
|
65
|
+
var filterInput = filterable ? _$cc(Input, {
|
|
66
|
+
'className': 'k-select-input',
|
|
67
|
+
'value': keywords,
|
|
68
|
+
'ev-$change:value': onInput,
|
|
69
|
+
'disabled': disabled,
|
|
70
|
+
'placeholder': !hasValue ? placeholder : '',
|
|
71
|
+
'ref': inputRef,
|
|
72
|
+
'autoWidth': true,
|
|
73
|
+
'inline': true,
|
|
74
|
+
'size': size,
|
|
75
|
+
'key': 'filter',
|
|
76
|
+
'readonly': !show,
|
|
77
|
+
'waveDisabled': true,
|
|
78
|
+
'flat': flat
|
|
79
|
+
}, 'filter', inputRef) : undefined;
|
|
65
80
|
return _$cc(ErrorContext.Consumer, {
|
|
66
81
|
'defaultValue': false,
|
|
67
82
|
'children': function children(isInvalid) {
|
|
@@ -124,7 +139,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
124
139
|
|
|
125
140
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
126
141
|
}, __$blocks['value'](_$no, [value, label])), 0, 'k-select-value c-ellipsis', null, 'value') : _$ce(2, 'div', [(_$blocks['values'] = function ($super) {
|
|
127
|
-
return label && label.length ? _$cc(Tags, {
|
|
142
|
+
return label && label.length || filterable ? _$cc(Tags, {
|
|
128
143
|
'nowrap': nowrap,
|
|
129
144
|
'size': size,
|
|
130
145
|
'draggable': draggable,
|
|
@@ -148,7 +163,23 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
148
163
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
149
164
|
}, __$blocks['value'](_$no, [value[$key], $label]))
|
|
150
165
|
}, isStringOrNumber($label) ? $label : isStringOrNumber(value[$key]) ? value[$key] : $key);
|
|
151
|
-
}, $this)
|
|
166
|
+
}, $this),
|
|
167
|
+
'$blocks': function ($blocks) {
|
|
168
|
+
var _$blocks = {},
|
|
169
|
+
__$blocks = _$ex({}, $blocks);
|
|
170
|
+
|
|
171
|
+
return (_$blocks['append'] = function ($super) {
|
|
172
|
+
return filterInput;
|
|
173
|
+
}, __$blocks['append'] = function ($super, data) {
|
|
174
|
+
var block = $blocks['append'];
|
|
175
|
+
|
|
176
|
+
var callBlock = function callBlock() {
|
|
177
|
+
return _$blocks['append'].call($this, $super, data);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
181
|
+
}), __$blocks;
|
|
182
|
+
}.call($this, _$em)
|
|
152
183
|
}) : undefined;
|
|
153
184
|
}, __$blocks['values'] = function ($super, data) {
|
|
154
185
|
var block = _valuesInstanceProperty($blocks);
|
|
@@ -158,21 +189,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
158
189
|
};
|
|
159
190
|
|
|
160
191
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
161
|
-
}, _valuesInstanceProperty(__$blocks).call(__$blocks, _$no, [value, label])),
|
|
162
|
-
'className': 'k-select-input',
|
|
163
|
-
'value': keywords,
|
|
164
|
-
'ev-$change:value': onInput,
|
|
165
|
-
'disabled': disabled,
|
|
166
|
-
'placeholder': !hasValue ? placeholder : '',
|
|
167
|
-
'ref': inputRef,
|
|
168
|
-
'autoWidth': true,
|
|
169
|
-
'inline': true,
|
|
170
|
-
'size': size,
|
|
171
|
-
'key': 'filter',
|
|
172
|
-
'readonly': !show,
|
|
173
|
-
'waveDisabled': true,
|
|
174
|
-
'flat': flat
|
|
175
|
-
}, 'filter', inputRef) : undefined], 0, 'k-select-values', null, 'values')
|
|
192
|
+
}, _valuesInstanceProperty(__$blocks).call(__$blocks, _$no, [value, label])), $blocks && _valuesInstanceProperty($blocks) ? filterInput : undefined], 0, 'k-select-values', null, 'values')
|
|
176
193
|
})], 0, 'k-select-main'), !hideIcon || clearable || loading || $blocks.suffix ? _$ce(2, 'span', [clearable && !disabled ? _$cc(Icon, {
|
|
177
194
|
'className': _$cn({
|
|
178
195
|
"k-select-clear ion-ios-close": true,
|
|
@@ -182,7 +199,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
182
199
|
'hoverable': true
|
|
183
200
|
}) : undefined, _$ce(2, 'span', (_$blocks['suffix'] = function ($super) {
|
|
184
201
|
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? _$cc(Icon, {
|
|
185
|
-
'className': 'k-select-arrow
|
|
202
|
+
'className': 'k-select-arrow k-icon-down',
|
|
186
203
|
'disabled': $props.isDisableArrow
|
|
187
204
|
}) : undefined;
|
|
188
205
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
@@ -473,7 +473,7 @@ describe('Select', function () {
|
|
|
473
473
|
}, _callee9);
|
|
474
474
|
})));
|
|
475
475
|
it('Searchable with multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
476
|
-
var _mount11, instance, element, _element$querySelecto6, select, dropdown, _dropdown$querySelect2, selectAll, toggleSelect, unselectAll, _dropdown$querySelect3,
|
|
476
|
+
var _mount11, instance, element, _element$querySelecto6, select, dropdown, _dropdown$querySelect2, selectAll, toggleSelect, unselectAll, _dropdown$querySelect3, cancel, confirm, input;
|
|
477
477
|
|
|
478
478
|
return _regeneratorRuntime.wrap(function _callee10$(_context12) {
|
|
479
479
|
while (1) {
|
|
@@ -488,44 +488,56 @@ describe('Select', function () {
|
|
|
488
488
|
case 5:
|
|
489
489
|
dropdown = getElement('.k-select-menu');
|
|
490
490
|
_dropdown$querySelect2 = dropdown.querySelectorAll('.k-select-op .k-btn'), selectAll = _dropdown$querySelect2[0], toggleSelect = _dropdown$querySelect2[1], unselectAll = _dropdown$querySelect2[2];
|
|
491
|
-
_dropdown$querySelect3 = dropdown.querySelectorAll('.k-select-footer .k-btn'),
|
|
491
|
+
_dropdown$querySelect3 = dropdown.querySelectorAll('.k-select-footer .k-btn'), cancel = _dropdown$querySelect3[0], confirm = _dropdown$querySelect3[1]; // select all
|
|
492
492
|
|
|
493
493
|
selectAll.click();
|
|
494
494
|
confirm.click();
|
|
495
|
+
_context12.next = 12;
|
|
496
|
+
return wait();
|
|
497
|
+
|
|
498
|
+
case 12:
|
|
495
499
|
expect(instance.get('days')).have.length(7); // unselect all
|
|
496
500
|
|
|
497
501
|
select.click();
|
|
498
|
-
_context12.next =
|
|
502
|
+
_context12.next = 16;
|
|
499
503
|
return wait();
|
|
500
504
|
|
|
501
|
-
case
|
|
505
|
+
case 16:
|
|
502
506
|
unselectAll.click();
|
|
503
507
|
confirm.click();
|
|
508
|
+
_context12.next = 20;
|
|
509
|
+
return wait();
|
|
510
|
+
|
|
511
|
+
case 20:
|
|
504
512
|
expect(instance.get('days')).have.length(0); // toggle select
|
|
505
513
|
|
|
506
514
|
select.click();
|
|
507
|
-
_context12.next =
|
|
515
|
+
_context12.next = 24;
|
|
508
516
|
return wait();
|
|
509
517
|
|
|
510
|
-
case
|
|
518
|
+
case 24:
|
|
511
519
|
instance.set('days', ['Monday', 'Tuesday']);
|
|
512
|
-
_context12.next =
|
|
520
|
+
_context12.next = 27;
|
|
513
521
|
return wait();
|
|
514
522
|
|
|
515
|
-
case
|
|
523
|
+
case 27:
|
|
516
524
|
input = dropdown.querySelector('.k-input-inner');
|
|
517
525
|
input.value = 's';
|
|
518
526
|
dispatchEvent(input, 'input');
|
|
519
|
-
_context12.next =
|
|
527
|
+
_context12.next = 32;
|
|
520
528
|
return wait();
|
|
521
529
|
|
|
522
|
-
case
|
|
530
|
+
case 32:
|
|
523
531
|
toggleSelect.click();
|
|
524
532
|
confirm.click();
|
|
533
|
+
_context12.next = 36;
|
|
534
|
+
return wait();
|
|
535
|
+
|
|
536
|
+
case 36:
|
|
525
537
|
expect(instance.get('days')).have.length(5);
|
|
526
538
|
expect(instance.get('days')).include('Monday');
|
|
527
539
|
|
|
528
|
-
case
|
|
540
|
+
case 38:
|
|
529
541
|
case "end":
|
|
530
542
|
return _context12.stop();
|
|
531
543
|
}
|