@king-design/vue 3.3.1 → 3.3.3
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__/Vue Next Demos.md +166 -154
- package/__tests__/components/upload.spec.ts +1 -1
- package/components/button/group.d.ts +1 -0
- package/components/button/group.js +2 -1
- package/components/button/index.d.ts +1 -0
- package/components/button/index.js +1 -0
- package/components/button/index.vdt.js +15 -9
- package/components/button/styles.d.ts +1 -1
- package/components/button/styles.js +3 -3
- package/components/checkbox/index.vdt.js +2 -4
- package/components/dialog/alert.vdt.js +2 -2
- package/components/input/index.vdt.js +2 -4
- package/components/radio/index.vdt.js +2 -4
- package/components/select/base.vdt.js +2 -4
- package/components/switch/index.d.ts +3 -1
- package/components/switch/index.js +65 -13
- package/components/switch/index.spec.js +21 -0
- package/components/switch/index.vdt.js +14 -4
- package/components/switch/styles.js +12 -7
- package/components/table/cell.vdt.js +3 -1
- package/components/table/column.d.ts +1 -0
- package/components/table/column.js +1 -0
- package/components/table/column.vdt.js +3 -2
- package/components/table/styles.js +1 -1
- package/components/table/table.vdt.js +1 -1
- package/components/table/useColumns.js +1 -1
- package/components/utils.js +17 -0
- package/components/wave/index.js +2 -0
- package/i18n/en-US.js +6 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/yarn-error.log +1012 -0
|
@@ -5,6 +5,7 @@ export interface ButtonGroupProps {
|
|
|
5
5
|
checkType?: 'none' | 'radio' | 'checkbox';
|
|
6
6
|
fluid?: boolean;
|
|
7
7
|
seperate?: boolean;
|
|
8
|
+
btnWidth?: number | string;
|
|
8
9
|
}
|
|
9
10
|
export declare class ButtonGroup extends Component<ButtonGroupProps> {
|
|
10
11
|
static template: string | import('intact-vue-next').Template<any>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { createUnknownComponentVNode as _$cc, className as _$cn, createElementVNode as _$ce } from 'intact-vue-next';
|
|
3
|
-
import { getRestProps } from '../utils';
|
|
3
|
+
import { addStyle, getRestProps } from '../utils';
|
|
4
4
|
import { Icon } from '../icon';
|
|
5
5
|
import { makeButtonStyles } from './styles';
|
|
6
6
|
import { DynamicButton } from './dynamicButton';
|
|
7
7
|
import { Wave } from '../wave';
|
|
8
8
|
import { button as theme } from './styles';
|
|
9
9
|
export default function ($props, $blocks, $__proto__) {
|
|
10
|
-
var _classNameObj;
|
|
10
|
+
var _classNameObj, _buttonGroup$get;
|
|
11
11
|
$blocks || ($blocks = {});
|
|
12
12
|
$props || ($props = {});
|
|
13
13
|
var $this = this;
|
|
@@ -27,11 +27,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
27
27
|
loading = _this$get.loading,
|
|
28
28
|
disabled = _this$get.disabled,
|
|
29
29
|
name = _this$get.name,
|
|
30
|
-
ghost = _this$get.ghost
|
|
30
|
+
ghost = _this$get.ghost,
|
|
31
|
+
color = _this$get.color,
|
|
32
|
+
style = _this$get.style;
|
|
31
33
|
var _this$config = this.config,
|
|
32
34
|
cls = _this$config.cls,
|
|
33
|
-
k = _this$config.k
|
|
34
|
-
disableWave = _this$config.disableWave;
|
|
35
|
+
k = _this$config.k;
|
|
35
36
|
var checked = this.isChecked();
|
|
36
37
|
var isIcon = function isIcon(child) {
|
|
37
38
|
return child.tag === Icon || child.className && child.className.indexOf('icon') > -1;
|
|
@@ -54,7 +55,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] =
|
|
58
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[cls('btn')] = true, _classNameObj[cls(size)] = size !== 'default', _classNameObj[cls(type)] = !color, _classNameObj[cls("btn-icon")] = icon, _classNameObj[className] = className, _classNameObj[cls('circle')] = circle, _classNameObj[cls('loading')] = loading, _classNameObj[cls('fluid')] = fluid, _classNameObj[cls('active')] = checked, _classNameObj[cls('disabled')] = disabled || loading, _classNameObj[cls('ghost')] = ghost, _classNameObj[cls('custom')] = color, _classNameObj[makeButtonStyles(k, iconSide, color)] = true, _classNameObj);
|
|
58
59
|
var loadingIcon = _$cc(Icon, {
|
|
59
60
|
'className': _$cn("ion-load-c " + k + "-icon-loading"),
|
|
60
61
|
'size': size /*loadingSizeMap[size]*/,
|
|
@@ -62,18 +63,23 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
62
63
|
'rotate': true
|
|
63
64
|
}, 'k-loading');
|
|
64
65
|
var buttonGroup = this.buttonGroup;
|
|
65
|
-
var checkType = buttonGroup ? buttonGroup.get('checkType') : 'none';
|
|
66
|
+
var checkType = (_buttonGroup$get = buttonGroup == null ? void 0 : buttonGroup.get('checkType')) != null ? _buttonGroup$get : 'none';
|
|
67
|
+
var btnWidth = buttonGroup == null ? void 0 : buttonGroup.get('btnWidth');
|
|
68
|
+
var _style = {
|
|
69
|
+
width: typeof btnWidth === 'number' ? btnWidth + "px" : btnWidth
|
|
70
|
+
};
|
|
66
71
|
var isCheckType = checkType !== 'none';
|
|
67
72
|
var typeStyles = theme[type];
|
|
68
|
-
var waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
73
|
+
var waveColor = typeStyles && typeStyles.borderColor || color || theme.primary.borderColor;
|
|
69
74
|
return _$cc(Wave, {
|
|
70
|
-
'disabled': loading || disabled || type === 'none' || type === 'link'
|
|
75
|
+
'disabled': loading || disabled || type === 'none' || type === 'link',
|
|
71
76
|
'inset': type === 'flat' ? '-1px' : '-2px',
|
|
72
77
|
'color': waveColor,
|
|
73
78
|
'children': _$cc(DynamicButton, _extends({
|
|
74
79
|
'className': _$cn(classNameObj),
|
|
75
80
|
'tagName': tagName
|
|
76
81
|
}, getRestProps(this), {
|
|
82
|
+
'style': btnWidth ? addStyle(style, _style) : style,
|
|
77
83
|
'ref': this.elementRef,
|
|
78
84
|
'tabindex': disabled || loading ? '-1' : tabindex,
|
|
79
85
|
'ev-click': this.onClick,
|
|
@@ -84,7 +84,7 @@ declare const defaults: {
|
|
|
84
84
|
declare let button: typeof defaults;
|
|
85
85
|
export { button };
|
|
86
86
|
export declare const makeButtonStyles: {
|
|
87
|
-
(k: string, iconSide?: string | undefined): string;
|
|
87
|
+
(k: string, iconSide?: string | undefined, color?: string | undefined): string;
|
|
88
88
|
clearCache(): {};
|
|
89
89
|
};
|
|
90
90
|
export declare const makeButtonGroupStyles: {
|
|
@@ -190,7 +190,7 @@ setDefault(function () {
|
|
|
190
190
|
makeButtonGroupStyles == null || makeButtonGroupStyles.clearCache();
|
|
191
191
|
});
|
|
192
192
|
export { button };
|
|
193
|
-
export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide) {
|
|
193
|
+
export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide, color) {
|
|
194
194
|
var _button = button,
|
|
195
195
|
secondary = _button.secondary,
|
|
196
196
|
link = _button.link;
|
|
@@ -200,7 +200,7 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide) {
|
|
|
200
200
|
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";.", k, "-icon{color:inherit;}&.", k, "-default,&.", k, "-none,&.", k, "-flat{.", k, "-icon{color:", theme.color.lightBlack, ";}&:hover{.", k, "-icon{color:inherit;}}}&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.", k, "-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
|
|
201
201
|
var typeStyles = button[type];
|
|
202
202
|
return /*#__PURE__*/css("&.", k, "-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}}");
|
|
203
|
-
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}&.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
203
|
+
}), "&.", k, "-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}", color && /*#__PURE__*/css("&.", k, "-custom{color:", color, ";border-color:", color, ";&:hover,&:focus{background:", palette(color, -4), ";}&:active{background:", palette(color, -3), ";}}"), " &.", k, "-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.", k, "-none,&.", k, "-link,&.", k, "-flat{background:transparent;&,&:hover{border:none;}&.", k, "-active{color:", theme.color.primary, ";}}&.", k, "-none:hover{background:", button.none.hoverBgColor, ";}&.", k, "-flat{background:", button.none.hoverBgColor, ";}&.", k, "-disabled{.", k, "-icon{color:inherit;}&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.", k, "-none.", k, "-disabled,&.", k, "-link.", k, "-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
204
204
|
var styles = button[size];
|
|
205
205
|
return /*#__PURE__*/css("&.", k, "-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.", k, "-btn-icon{width:", styles.height, ";}}");
|
|
206
206
|
}), "&.", k, "-btn-icon{width:", button.height, ";padding:0;.", k, "-icon{margin:0;}}&.", k, "-fluid{width:100%;padding:0;}&.", k, "-circle{border-radius:calc(", button.large.height, " / 2);}&.", k, "-loading{", _mapInstanceProperty(types).call(types, function (type) {
|
|
@@ -211,7 +211,7 @@ export var makeButtonStyles = cache(function makeButtonStyles(k, iconSide) {
|
|
|
211
211
|
ghostColor = _button$type.ghostColor,
|
|
212
212
|
borderColor = _button$type.borderColor;
|
|
213
213
|
return /*#__PURE__*/css("&.", k, "-", type, "{color:", ghostColor, ";border-color:", borderColor, ";&:hover{color:", palette(ghostColor, -1), ";border-color:", palette(ghostColor, -1), ";}&:active{color:", palette(ghostColor, 1), ";border-color:", palette(ghostColor, 1), ";}}");
|
|
214
|
-
}), "&.", k, "-disabled{&,&:hover{color:", button.disabled.color, ";border-color:", button.disabled.ghostBorderColor, ";background:transparent;}}}"),
|
|
214
|
+
}), " ", color && /*#__PURE__*/css("&.", k, "-custom{color:", color, ";border-color:", color, ";&:hover{color:", palette(color, -1), ";border-color:", palette(color, -1), ";}&:active{color:", palette(color, 1), ";border-color:", palette(color, 1), ";}}"), "&.", k, "-disabled{&,&:hover{color:", button.disabled.color, ";border-color:", button.disabled.ghostBorderColor, ";background:transparent;}}}"),
|
|
215
215
|
/*#__PURE__*/
|
|
216
216
|
// dynamic styles
|
|
217
217
|
css(".", k, "-icon{", iconSide === 'right' ? "margin-left: " + button.icon.gap + ";" : "margin-right: " + button.icon.gap + ";", ";}", !iconSide && /*#__PURE__*/css("&.", k, "-loading{&:not(.", k, "-btn-icon){padding-left:calc(", getLeft(button.padding), " + 1em);", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
@@ -22,9 +22,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
22
22
|
title = _this$get.title,
|
|
23
23
|
rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
24
24
|
var isChecked = this.isChecked();
|
|
25
|
-
var
|
|
26
|
-
k = _this$config.k,
|
|
27
|
-
disableWave = _this$config.disableWave;
|
|
25
|
+
var k = this.config.k;
|
|
28
26
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-checkbox"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = isChecked, _classNameObj[k + "-indeterminate"] = indeterminate, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
29
27
|
var events = ['ev-click', 'ev-change', 'ev-mouseenter', 'ev-mouseleave'].reduce(function (memo, name) {
|
|
30
28
|
if (rest[name]) {
|
|
@@ -47,7 +45,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
47
45
|
'ev-click': this.onClick,
|
|
48
46
|
'ev-keypress': this.onKeypress
|
|
49
47
|
}, events), [_$cc(Wave, {
|
|
50
|
-
'disabled': disabled
|
|
48
|
+
'disabled': disabled,
|
|
51
49
|
'inset': '-2px',
|
|
52
50
|
'children': _$ce(2, 'span', _$cv('input', _extends({
|
|
53
51
|
'type': 'checkbox',
|
|
@@ -34,8 +34,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
34
34
|
}), (_$blocks['body'] = function ($super) {
|
|
35
35
|
var _ref;
|
|
36
36
|
return [_$ce(2, 'div', [!hideIcon && !icon ? _$cc(Icon, {
|
|
37
|
-
'className': _$cn(iconClassName || (_ref = {}, _ref[k + "-icon-success-fill"] = type === 'success', _ref[k + "-icon-warning-fill"] = type === 'warning'
|
|
38
|
-
'color': type === 'error' ? 'danger' : type === 'confirm' ? '
|
|
37
|
+
'className': _$cn(iconClassName || (_ref = {}, _ref[k + "-icon-success-fill"] = type === 'success', _ref[k + "-icon-warning-fill"] = type === 'warning' || type === 'confirm', _ref[k + "-icon-error-fill"] = type === 'error', _ref)),
|
|
38
|
+
'color': type === 'error' ? 'danger' : type === 'confirm' ? 'warning' : type
|
|
39
39
|
}) : undefined, icon], 0, _$cn(k + "-dialog-tip-icon")), _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, _$cn(k + "-alert-dialog-title")) : undefined, content], 0, _$cn(k + "-alert-dialog-wrapper"))];
|
|
40
40
|
}, __$blocks['body'] = function ($super, data) {
|
|
41
41
|
var block = $blocks['body'];
|
|
@@ -58,9 +58,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
58
58
|
isFocus = _this$focusHook.isFocus,
|
|
59
59
|
focusInputOnClick = _this$focusHook.focusInputOnClick;
|
|
60
60
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
61
|
-
var
|
|
62
|
-
k = _this$config.k,
|
|
63
|
-
disableWave = _this$config.disableWave;
|
|
61
|
+
var k = this.config.k;
|
|
64
62
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-input"] = true, _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(k)] = true, _classNameObj);
|
|
65
63
|
var _this$showPassword = this.showPassword,
|
|
66
64
|
isShowPassword = _this$showPassword.isShow,
|
|
@@ -98,7 +96,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
98
96
|
'children': function children(isInvalid) {
|
|
99
97
|
var _$cn3, _$cn4;
|
|
100
98
|
return _$cc(Wave, {
|
|
101
|
-
'disabled': waveDisabled || disabled || isInvalid
|
|
99
|
+
'disabled': waveDisabled || disabled || isInvalid,
|
|
102
100
|
'inset': '-2px',
|
|
103
101
|
'children': _$ce(2, 'div', [$blocks.prefix ? _$ce(2, 'div', (_$blocks['prefix'] = function ($super) {
|
|
104
102
|
return null;
|
|
@@ -22,9 +22,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
22
22
|
title = _this$get.title,
|
|
23
23
|
rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
24
24
|
var isChecked = value === trueValue;
|
|
25
|
-
var
|
|
26
|
-
k = _this$config.k,
|
|
27
|
-
disableWave = _this$config.disableWave;
|
|
25
|
+
var k = this.config.k;
|
|
28
26
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-radio"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-checked"] = isChecked, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
29
27
|
|
|
30
28
|
// let evClick;
|
|
@@ -49,7 +47,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
49
47
|
'ev-keypress': this.onKeypress,
|
|
50
48
|
'ev-click': this.fixClick
|
|
51
49
|
}), [_$cc(Wave, {
|
|
52
|
-
'disabled': disabled
|
|
50
|
+
'disabled': disabled,
|
|
53
51
|
'inset': '-2px',
|
|
54
52
|
'children': _$ce(2, 'span', _$cv('input', _extends({}, getRestProps(this, rest), {
|
|
55
53
|
'type': 'radio',
|
|
@@ -45,9 +45,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
45
45
|
flat = _flatInstanceProperty(_this$get),
|
|
46
46
|
nowrap = _this$get.nowrap,
|
|
47
47
|
draggable = _this$get.draggable;
|
|
48
|
-
var
|
|
49
|
-
k = _this$config.k,
|
|
50
|
-
disableWave = _this$config.disableWave;
|
|
48
|
+
var k = this.config.k;
|
|
51
49
|
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-select"] = true, _classNameObj[k + "-disabled"] = disabled, _classNameObj[k + "-" + size] = size !== 'default', _classNameObj[k + "-fluid"] = fluid, _classNameObj[k + "-inline"] = inline, _classNameObj[k + "-flat"] = flat, _classNameObj[k + "-nowrap"] = nowrap, _classNameObj[className] = className, _classNameObj[$props.className] = $props.className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
52
50
|
var placeholder = this.getPlaceholder();
|
|
53
51
|
var label = this.getLabel();
|
|
@@ -79,7 +77,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
79
77
|
'children': function children(isInvalid) {
|
|
80
78
|
var _$cn2;
|
|
81
79
|
return _$cc(Wave, {
|
|
82
|
-
'disabled': disabled || isInvalid || inline
|
|
80
|
+
'disabled': disabled || isInvalid || inline,
|
|
83
81
|
'inset': '-2px',
|
|
84
82
|
'children': _$cc(Dropdown, {
|
|
85
83
|
'trigger': 'click',
|
|
@@ -12,6 +12,8 @@ export interface SwitchProps<True = any, False = any> {
|
|
|
12
12
|
height?: number | string;
|
|
13
13
|
size?: Sizes;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
beforeChange?: (value: True | False | undefined) => boolean | Promise<boolean>;
|
|
15
17
|
}
|
|
16
18
|
export interface SwitchEvents {
|
|
17
19
|
click: [MouseEvent];
|
|
@@ -32,7 +34,7 @@ export declare class Switch<True = true, False = false> extends Component<Switch
|
|
|
32
34
|
private onClick;
|
|
33
35
|
private onClickOnHandle;
|
|
34
36
|
private onKeypress;
|
|
35
|
-
toggle(isKeypress: boolean): void
|
|
37
|
+
toggle(isKeypress: boolean): Promise<void>;
|
|
36
38
|
isChecked(): boolean;
|
|
37
39
|
check(): void;
|
|
38
40
|
uncheck(): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
1
2
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
2
4
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
5
|
import { __decorate } from "tslib";
|
|
4
6
|
import { Component, createRef } from 'intact-vue-next';
|
|
@@ -17,14 +19,17 @@ var typeDefs = {
|
|
|
17
19
|
width: [Number, String],
|
|
18
20
|
height: [Number, String],
|
|
19
21
|
size: sizes,
|
|
20
|
-
disabled: Boolean
|
|
22
|
+
disabled: Boolean,
|
|
23
|
+
loading: Boolean,
|
|
24
|
+
beforeChange: Function
|
|
21
25
|
};
|
|
22
26
|
var defaults = function defaults() {
|
|
23
27
|
return {
|
|
24
28
|
value: false,
|
|
25
29
|
trueValue: true,
|
|
26
30
|
falseValue: false,
|
|
27
|
-
size: 'default'
|
|
31
|
+
size: 'default',
|
|
32
|
+
loading: false
|
|
28
33
|
};
|
|
29
34
|
};
|
|
30
35
|
var events = {
|
|
@@ -62,18 +67,65 @@ export var Switch = /*#__PURE__*/function (_Component) {
|
|
|
62
67
|
this.toggle(true);
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
|
-
_proto.toggle = function
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
_proto.toggle = /*#__PURE__*/function () {
|
|
71
|
+
var _toggle = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(isKeypress) {
|
|
72
|
+
var _this$get, disabled, beforeChange, value, ret;
|
|
73
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
74
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
75
|
+
case 0:
|
|
76
|
+
_this$get = this.get(), disabled = _this$get.disabled, beforeChange = _this$get.beforeChange, value = _this$get.value;
|
|
77
|
+
if (!disabled) {
|
|
78
|
+
_context2.next = 3;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
return _context2.abrupt("return");
|
|
82
|
+
case 3:
|
|
83
|
+
// if is not keypress, we blur it to remove focus style
|
|
84
|
+
if (!isKeypress) {
|
|
85
|
+
this.elementRef.value.blur();
|
|
86
|
+
}
|
|
87
|
+
if (!beforeChange) {
|
|
88
|
+
_context2.next = 15;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
this.set({
|
|
92
|
+
disabled: true,
|
|
93
|
+
loading: true
|
|
94
|
+
});
|
|
95
|
+
_context2.prev = 6;
|
|
96
|
+
_context2.next = 9;
|
|
97
|
+
return beforeChange(value);
|
|
98
|
+
case 9:
|
|
99
|
+
ret = _context2.sent;
|
|
100
|
+
if (ret) {
|
|
101
|
+
_context2.next = 12;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
return _context2.abrupt("return");
|
|
105
|
+
case 12:
|
|
106
|
+
_context2.prev = 12;
|
|
107
|
+
this.set({
|
|
108
|
+
disabled: false,
|
|
109
|
+
loading: false
|
|
110
|
+
});
|
|
111
|
+
return _context2.finish(12);
|
|
112
|
+
case 15:
|
|
113
|
+
if (this.isChecked()) {
|
|
114
|
+
this.uncheck();
|
|
115
|
+
} else {
|
|
116
|
+
this.check();
|
|
117
|
+
}
|
|
118
|
+
case 16:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context2.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee, this, [[6,, 12, 15]]);
|
|
123
|
+
}));
|
|
124
|
+
function toggle(_x) {
|
|
125
|
+
return _toggle.apply(this, arguments);
|
|
70
126
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} else {
|
|
74
|
-
this.check();
|
|
75
|
-
}
|
|
76
|
-
};
|
|
127
|
+
return toggle;
|
|
128
|
+
}();
|
|
77
129
|
_proto.isChecked = function isChecked() {
|
|
78
130
|
return this.get('value') === this.get('trueValue');
|
|
79
131
|
};
|
|
@@ -4,6 +4,7 @@ import BasicDemo from '~/components/switch/demos/basic';
|
|
|
4
4
|
import DisabledDemo from '~/components/switch/demos/disabled';
|
|
5
5
|
import ValueDemo from '~/components/switch/demos/value';
|
|
6
6
|
import WidthHeightDemo from '~/components/switch/demos/widthHeight';
|
|
7
|
+
import BeforeChangeDemo from '~/components/switch/demos/beforeChange';
|
|
7
8
|
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
8
9
|
describe('Switch', function () {
|
|
9
10
|
afterEach(function () {
|
|
@@ -239,4 +240,24 @@ describe('Switch', function () {
|
|
|
239
240
|
}
|
|
240
241
|
}, _callee6);
|
|
241
242
|
})));
|
|
243
|
+
it('beforeChange', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
244
|
+
var _mount7, instance, element, _element$querySelecto5, el1, el2;
|
|
245
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
246
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
247
|
+
case 0:
|
|
248
|
+
_mount7 = mount(BeforeChangeDemo), instance = _mount7[0], element = _mount7[1];
|
|
249
|
+
_element$querySelecto5 = element.querySelectorAll('.k-switch'), el1 = _element$querySelecto5[0], el2 = _element$querySelecto5[1];
|
|
250
|
+
el1.click();
|
|
251
|
+
el2.click();
|
|
252
|
+
_context7.next = 6;
|
|
253
|
+
return wait(1000);
|
|
254
|
+
case 6:
|
|
255
|
+
expect(instance.get('value1')).to.be.true;
|
|
256
|
+
expect(instance.get('value2')).to.be.false;
|
|
257
|
+
case 8:
|
|
258
|
+
case "end":
|
|
259
|
+
return _context7.stop();
|
|
260
|
+
}
|
|
261
|
+
}, _callee7);
|
|
262
|
+
})));
|
|
242
263
|
});
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
3
|
-
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, isChecked as _$isc, linkEvent as _$le, setCheckboxModel as _$scm, noop as _$no } from 'intact-vue-next';
|
|
3
|
+
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, isChecked as _$isc, linkEvent as _$le, setCheckboxModel as _$scm, noop as _$no, createUnknownComponentVNode as _$cc } from 'intact-vue-next';
|
|
4
4
|
import { makeStyles } from './styles';
|
|
5
5
|
import { addStyle, getRestProps } from '../utils';
|
|
6
|
+
import { Icon } from '../icon';
|
|
6
7
|
var _$tmp0 = {
|
|
7
8
|
'src': 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
|
8
9
|
};
|
|
@@ -25,7 +26,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
26
|
width = _this$get.width,
|
|
26
27
|
height = _this$get.height,
|
|
27
28
|
size = _this$get.size,
|
|
28
|
-
disabled = _this$get.disabled
|
|
29
|
+
disabled = _this$get.disabled,
|
|
30
|
+
loading = _this$get.loading;
|
|
29
31
|
var _this$draggable = this.draggable,
|
|
30
32
|
start = _this$draggable.start,
|
|
31
33
|
dragging = _this$draggable.dragging,
|
|
@@ -36,6 +38,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
36
38
|
var onStyle;
|
|
37
39
|
var offStyle;
|
|
38
40
|
var barStyle;
|
|
41
|
+
var iconStyle;
|
|
39
42
|
if (width || height) {
|
|
40
43
|
var _style = {};
|
|
41
44
|
onStyle = {};
|
|
@@ -60,6 +63,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
60
63
|
barStyle = {
|
|
61
64
|
width: value === trueValue ? '100%' : height + "px"
|
|
62
65
|
};
|
|
66
|
+
iconStyle = {
|
|
67
|
+
fontSize: height * 0.7 + "px"
|
|
68
|
+
};
|
|
63
69
|
}
|
|
64
70
|
style = addStyle(style, _style);
|
|
65
71
|
}
|
|
@@ -106,10 +112,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
106
112
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
107
113
|
}, __$blocks['on'](_$no)), 0, _$cn(k + "-switch-on"), {
|
|
108
114
|
'style': onStyle
|
|
109
|
-
}) : undefined, _$ce(2, 'div',
|
|
115
|
+
}) : undefined, _$ce(2, 'div', [loading ? _$cc(Icon, {
|
|
116
|
+
'className': _$cn(k + "-switch-icon ion-load-c"),
|
|
117
|
+
'rotate': true,
|
|
118
|
+
'style': iconStyle
|
|
119
|
+
}) : undefined, _$ce(2, 'div', _$ce(2, 'img', null, 1, null, _$tmp0), 2, _$cn(k + "-switch-handle"), {
|
|
110
120
|
'ev-click': this.onClickOnHandle,
|
|
111
121
|
'ev-mousedown': start
|
|
112
|
-
}),
|
|
122
|
+
})], 0, _$cn(k + "-switch-wrapper"))], 0, _$cn(k + "-switch-bar"), {
|
|
113
123
|
'style': barStyle
|
|
114
124
|
}, null, barRef)]);
|
|
115
125
|
}
|
|
@@ -34,25 +34,29 @@ var defaults = {
|
|
|
34
34
|
default: {
|
|
35
35
|
width: "45px",
|
|
36
36
|
height: "24px",
|
|
37
|
-
padding: "3px"
|
|
37
|
+
padding: "3px",
|
|
38
|
+
iconSize: "16px"
|
|
38
39
|
},
|
|
39
40
|
// large
|
|
40
41
|
large: {
|
|
41
42
|
width: "58px",
|
|
42
43
|
height: "30px",
|
|
43
|
-
padding: "3px"
|
|
44
|
+
padding: "3px",
|
|
45
|
+
iconSize: "20px"
|
|
44
46
|
},
|
|
45
47
|
// small
|
|
46
48
|
small: {
|
|
47
49
|
width: "30px",
|
|
48
50
|
height: "16px",
|
|
49
|
-
padding: "2px"
|
|
51
|
+
padding: "2px",
|
|
52
|
+
iconSize: "10px"
|
|
50
53
|
},
|
|
51
54
|
// mini
|
|
52
55
|
mini: {
|
|
53
56
|
width: "18px",
|
|
54
57
|
height: "10px",
|
|
55
|
-
padding: "1px"
|
|
58
|
+
padding: "1px",
|
|
59
|
+
iconSize: "6px"
|
|
56
60
|
},
|
|
57
61
|
// disabled
|
|
58
62
|
get disabledBgColor() {
|
|
@@ -67,11 +71,12 @@ setDefault(function () {
|
|
|
67
71
|
makeStyles == null || makeStyles.clearCache();
|
|
68
72
|
});
|
|
69
73
|
export var makeStyles = cache(function makeStyles(k) {
|
|
70
|
-
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;transition:background ", kswitch.transition, ";input{opacity:0;position:absolute;}.", k, "-switch-bar,.", k, "-switch-off{box-sizing:border-box;}.", k, "-switch-bar{position:absolute;text-align:right;overflow:hidden;}.", k, "-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.", k, "-switch-bar,.", k, "-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}&:hover{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.hoverBgColor, ";}}.", k, "-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.", k, "-switch-on,.", k, "-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.", k, "-dragging{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
74
|
+
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;box-sizing:content-box;transition:background ", kswitch.transition, ";input{opacity:0;position:absolute;}.", k, "-switch-bar,.", k, "-switch-off{box-sizing:border-box;}.", k, "-switch-bar{position:absolute;text-align:right;overflow:hidden;}.", k, "-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.", k, "-switch-bar,.", k, "-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", kswitch.transition, ";}&:hover{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.hoverBgColor, ";}}.", k, "-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", kswitch.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.", k, "-switch-icon{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);}.", k, "-switch-on,.", k, "-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.", k, "-dragging{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";transition:background ", kswitch.transition, ";}}&:focus{outline:none;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
71
75
|
var _kswitch$size = kswitch[size],
|
|
72
76
|
width = _kswitch$size.width,
|
|
73
77
|
height = _kswitch$size.height,
|
|
74
|
-
padding = _kswitch$size.padding
|
|
75
|
-
|
|
78
|
+
padding = _kswitch$size.padding,
|
|
79
|
+
iconSize = _kswitch$size.iconSize;
|
|
80
|
+
return /*#__PURE__*/css("&.", k, "-", size, ",&.", k, "-", size, " .", k, "-switch-on,&.", k, "-", size, " .", k, "-switch-off{width:", width, ";height:", height, ";}&.", k, "-", size, "{border-radius:", height, ";.", k, "-switch-bar{width:", height, ";border-radius:", height, ";}.", k, "-switch-wrapper{padding:", padding, ";}.", k, "-switch-on,.", k, "-switch-off{line-height:", height, ";left:0;}.", k, "-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.", k, "-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}.", k, "-switch-icon{font-size:", iconSize, ";}}");
|
|
76
81
|
}), "&.", k, "-checked{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.bgColor, ";}.", k, "-switch-bar{width:100%;}&:hover{.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.hoverBgColor, ";}}}&.", k, "-disabled{&,.", k, "-switch-handle{cursor:not-allowed;}&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.disabledBgColor, ";}&.", k, "-checked{&,.", k, "-switch-bar,.", k, "-switch-wrapper{background:", kswitch.checked.disabledBgColor, ";}}}");
|
|
77
82
|
});
|
|
@@ -5,6 +5,7 @@ import { Button } from '../button';
|
|
|
5
5
|
import { Icon } from '../icon';
|
|
6
6
|
import { getTextByChildren } from '../utils';
|
|
7
7
|
export default function ($props, $blocks, $__proto__) {
|
|
8
|
+
var _classNameObj;
|
|
8
9
|
$blocks || ($blocks = {});
|
|
9
10
|
$props || ($props = {});
|
|
10
11
|
var $this = this;
|
|
@@ -37,6 +38,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
37
38
|
style || (style = {});
|
|
38
39
|
style.paddingLeft = indent + "px";
|
|
39
40
|
}
|
|
41
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-hidden"] = props.hidden, _classNameObj[className] = className, _classNameObj);
|
|
40
42
|
return _$ce(2, 'td', [columnIndex === 0 && hasChildren ? _$cc(Button, {
|
|
41
43
|
'type': 'none',
|
|
42
44
|
'icon': true,
|
|
@@ -48,7 +50,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
48
50
|
'className': _$cn(k + "-icon-right"),
|
|
49
51
|
'size': 'small'
|
|
50
52
|
})
|
|
51
|
-
}) : undefined, children], 0, _$cn(
|
|
53
|
+
}) : undefined, children], 0, _$cn(classNameObj), {
|
|
52
54
|
'style': style,
|
|
53
55
|
'title': getTextByChildren(children),
|
|
54
56
|
'rowspan': rowspan,
|
|
@@ -32,7 +32,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
32
32
|
key = _this$get.key,
|
|
33
33
|
sortable = _this$get.sortable,
|
|
34
34
|
cols = _this$get.cols,
|
|
35
|
-
rows = _this$get.rows
|
|
35
|
+
rows = _this$get.rows,
|
|
36
|
+
hidden = _this$get.hidden;
|
|
36
37
|
var _this$group = this.group,
|
|
37
38
|
onSelect = _this$group.onSelect,
|
|
38
39
|
isChecked = _this$group.isChecked,
|
|
@@ -66,7 +67,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
66
67
|
var _getClassAndStyleForF = getClassAndStyleForFixed(_this.get(), offsetMap[key], k, checkType),
|
|
67
68
|
className = _getClassAndStyleForF.className,
|
|
68
69
|
style = _getClassAndStyleForF.style;
|
|
69
|
-
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-column-sortable"] = sortable, _classNameObj[className] = className, _classNameObj);
|
|
70
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-column-sortable"] = sortable, _classNameObj[k + "-hidden"] = hidden, _classNameObj[className] = className, _classNameObj);
|
|
70
71
|
var groupValue = currentGroup && currentGroup[key];
|
|
71
72
|
var type = sort && sort.key === key && sort.type;
|
|
72
73
|
var checked;
|
|
@@ -90,7 +90,7 @@ setDefault(function () {
|
|
|
90
90
|
makeGroupMenuStyles == null || makeGroupMenuStyles.clearCache();
|
|
91
91
|
});
|
|
92
92
|
export var makeStyles = cache(function makeStyles(k) {
|
|
93
|
-
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
93
|
+
return /*#__PURE__*/css("font-size:", table.fontSize, ";color:", table.color, ";position:relative;z-index:0;.", k, "-table-wrapper{border-bottom:", table.border, ";overflow:auto;border-radius:", table.borderRadius, ";}table{width:100%;border-spacing:0;table-layout:fixed;}thead{text-align:", table.thead.textAlign, ";font-size:", table.thead.fontSize, ";font-weight:", table.thead.fontWeight, ";position:sticky;top:0;z-index:2;tr{height:", table.thead.height, ";&:not(:last-of-type) th{border-bottom:", table.border, ";}}}th{padding:", table.thead.padding, ";position:relative;background:", table.thead.bgColor, ";line-height:normal;&:before{content:'';height:", table.thead.delimiterHeight, ";position:absolute;background-color:", table.thead.delimiterColor, ";width:1px;left:1px;top:50%;transform:translateY(-50%);}&.", k, "-fixed-right:before{left:-2px;}&:first-of-type:before{display:none;}}.", k, "-table-title{display:inline-flex;align-items:center;max-width:100%;color:", table.thead.color, ";}.", k, "-table-title-text{flex:1;display:inline-flex;line-height:1.4;}tbody{tr{&:hover td{background:", table.tbody.hoverBgcolor, ";}&:last-of-type td{border-bottom-color:transparent;}}}td{padding:", table.tbody.padding, ";border-bottom:", table.border, ";background:", table.bgColor, ";word-wrap:break-word;}.", k, "-fixed-left,.", k, "-fixed-right{position:sticky;z-index:1;&:after{content:'';display:block;transition:box-shadow ", table.transition, ";position:absolute;top:0;bottom:0px;width:10px;pointer-events:none;}}.", k, "-fixed-left:after{right:-11px;}.", k, "-fixed-right:after{left:-11px;}&.", k, "-scroll-left .", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}&.", k, "-scroll-right .", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}&.", k, "-scroll-middle{.", k, "-fixed-left:after{box-shadow:", table.fixLeftShadow, ";}.", k, "-fixed-right:after{box-shadow:", table.fixRightShadow, ";}}.", k, "-fixed-right+.", k, "-fixed-right:after{display:none;}.", k, "-table-affix-header{position:sticky;top:0;left:0;.", k, "-affix-wrapper{overflow:hidden;}&.", k, "-fixed{position:relative;}}&.", k, "-border,&.", k, "-grid{.", k, "-table-wrapper{border-top:", table.border, ";border-left:", table.border, ";border-right:", table.border, ";}}&.", k, "-grid{td:not(:last-of-type),th:not(:last-of-type){border-right:", table.border, ";}th:before{display:none;}}&.", k, "-stripe{tr:nth-child(even):not(:hover) td{background:", table.stripeBgColor, ";}}.", k, "-table-group{margin-left:", table.group.gap, ";}.", k, "-table-check{.", k, "-checkbox,.", k, "-radio{position:relative;top:-1px;}}.", k, "-column-sortable{cursor:pointer;}.", k, "-column-sort{.", k, "-icon{display:block;height:", _sortInstanceProperty(table).iconHeight, ";line-height:", _sortInstanceProperty(table).iconHeight, ";margin:0 0 1px ", _sortInstanceProperty(table).gap, ";}&.", k, "-desc .", k, "-icon.", k, "-desc,&.", k, "-asc .", k, "-icon.", k, "-asc{color:", _sortInstanceProperty(table).enabledColor, ";}}.", k, "-table-spin.", k, "-overlay{z-index:2;}.", k, "-table-empty{text-align:center;}tr.", k, "-expand{td{padding:0;background:#fdfcff;}}&.", k, "-with-expand{tr:not(.", k, "-expand){td{border-bottom:none;}}}.", k, "-table-expand{border-top:", table.border, ";box-sizing:content-box;}tbody tr.", k, "-selected td{background:", table.selectedBgColor, ";}.", k, "-hidden{display:none;}.", k, "-table-arrow{width:", table.arrow.width, "!important;margin-right:", table.arrow.gap, ";transition:transform ", table.transition, ";position:relative;top:-1px;}tr.", k, "-spreaded{.", k, "-table-arrow{transform:rotate(90deg);}}.", k, "-table-resize{height:100%;width:", table.resizeWidth, ";position:absolute;top:0;left:-1px;cursor:ew-resize;}tr.", k, "-dragging{opacity:", table.draggingOpacity, ";}.", k, "-table-scrollbar{overflow-x:auto;overflow-y:hidden;}.", k, "-table-scrollbar-inner{height:1px;}", _mapInstanceProperty(aligns).call(aligns, function (type) {
|
|
94
94
|
return /*#__PURE__*/css(".", k, "-align-", type, "{text-align:", type, ";}");
|
|
95
95
|
}), ">.", k, "-pagination{margin:16px 0;}&.", k, "-fix-header{min-height:0;.", k, "-table-wrapper{height:100%;}}");
|
|
96
96
|
});
|
|
@@ -84,7 +84,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
84
84
|
var onStart = this.resizable.start;
|
|
85
85
|
var colgroup = _$ce(2, 'colgroup', [checkType !== 'none' ? _$ce(2, 'col', null, 1, null, _$tmp0) : undefined, _$ma(cols, function ($value, $key) {
|
|
86
86
|
var _$cn2;
|
|
87
|
-
return _$ce(2, 'col', null, 1, _$cn((_$cn2 = {}, _$cn2[$value.className] = $value.className, _$cn2)), {
|
|
87
|
+
return _$ce(2, 'col', null, 1, _$cn((_$cn2 = {}, _$cn2[k + "-hidden"] = $value.hidden, _$cn2[$value.className] = $value.className, _$cn2)), {
|
|
88
88
|
'width': $value.width,
|
|
89
89
|
'style': {
|
|
90
90
|
width: getWidth($value.key)
|