@king-design/vue 3.0.0-beta.2 → 3.0.1
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 +256 -256
- package/components/badge/styles.js +1 -1
- package/components/button/group.d.ts +1 -0
- package/components/button/group.js +2 -1
- package/components/button/group.vdt.js +4 -2
- package/components/button/index.vdt.js +1 -1
- package/components/button/styles.js +11 -4
- package/components/checkbox/styles.js +4 -8
- package/components/collapse/styles.js +2 -2
- package/components/dropdown/dropdown.js +2 -1
- package/components/dropdown/usePosition.js +2 -2
- package/components/form/index.spec.js +45 -0
- package/components/form/styles.js +1 -1
- package/components/icon/index.vdt.js +3 -2
- package/components/layout/body.d.ts +1 -0
- package/components/layout/body.js +7 -2
- package/components/layout/header.d.ts +2 -0
- package/components/layout/header.js +9 -3
- package/components/layout/helpers.d.ts +1 -0
- package/components/layout/helpers.js +1 -0
- package/components/layout/index.spec.d.ts +1 -0
- package/components/layout/index.spec.js +53 -0
- package/components/layout/layout.d.ts +1 -0
- package/components/layout/layout.js +3 -2
- package/components/layout/styles.js +5 -5
- package/components/menu/styles.js +2 -2
- package/components/menu/useDropdown.js +6 -1
- package/components/message/message.js +1 -1
- package/components/pagination/styles.js +2 -5
- package/components/popover/styles.js +1 -1
- package/components/radio/styles.js +1 -1
- package/components/scrollSelect/styles.js +1 -1
- package/components/select/base.vdt.js +4 -1
- package/components/select/styles.js +1 -1
- package/components/switch/styles.js +10 -2
- package/components/table/column.vdt.js +4 -2
- package/components/table/index.spec.js +1 -1
- package/components/table/row.js +8 -1
- package/components/table/styles.js +2 -2
- package/components/table/table.d.ts +1 -1
- package/components/table/table.js +3 -2
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +2 -1
- package/components/table/usePagination.js +1 -1
- package/components/tip/styles.js +1 -1
- package/components/tooltip/index.spec.js +57 -0
- package/components/tooltip/tooltip.js +5 -1
- package/components/utils.d.ts +1 -0
- package/components/utils.js +16 -0
- package/components/virtual.js +5 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.svg +1 -1
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/theme.js +1 -1
- package/styles/utils.d.ts +1 -0
- package/styles/utils.js +3 -0
- package/yarn-error.log +809 -0
|
@@ -22,5 +22,5 @@ setDefault(function () {
|
|
|
22
22
|
}).badge;
|
|
23
23
|
});
|
|
24
24
|
export default function makeStyles() {
|
|
25
|
-
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:
|
|
25
|
+
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:85%;vertical-align:baseline;}&.k-has-text>.k-badge-text{width:auto;height:", badge.textHeight, ";line-height:", badge.textHeight, ";border-radius:calc(", badge.textHeight, " / 2);padding:0 ", badge.textPadding, ";color:", badge.textColor, ";}&.k-alone>.k-badge-text{position:static;transform:none;}");
|
|
26
26
|
}
|
|
@@ -4,6 +4,7 @@ export interface ButtonGroupProps {
|
|
|
4
4
|
value?: any;
|
|
5
5
|
checkType?: 'none' | 'radio' | 'checkbox';
|
|
6
6
|
fluid?: boolean;
|
|
7
|
+
seperate?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class ButtonGroup extends Component<ButtonGroupProps> {
|
|
9
10
|
static template: string | import("intact").Template<any>;
|
|
@@ -13,12 +13,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
13
13
|
className = _this$get.className,
|
|
14
14
|
vertical = _this$get.vertical,
|
|
15
15
|
children = _this$get.children,
|
|
16
|
-
fluid = _this$get.fluid
|
|
16
|
+
fluid = _this$get.fluid,
|
|
17
|
+
seperate = _this$get.seperate;
|
|
17
18
|
|
|
18
19
|
var classNameObj = (_classNameObj = {
|
|
19
20
|
'k-btns': true,
|
|
20
21
|
'k-vertical': vertical,
|
|
21
|
-
'k-fluid': fluid
|
|
22
|
+
'k-fluid': fluid,
|
|
23
|
+
'k-seperate': seperate
|
|
22
24
|
}, _classNameObj[className] = className, _classNameObj[makeButtonGroupStyles()] = true, _classNameObj);
|
|
23
25
|
return _$cv('div', _extends({
|
|
24
26
|
'className': _$cn(classNameObj)
|
|
@@ -78,7 +78,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
78
78
|
var waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
79
79
|
return _$cc(Wave, {
|
|
80
80
|
'disabled': loading || disabled || type === 'none' || type === 'link',
|
|
81
|
-
'inset': '-2px',
|
|
81
|
+
'inset': type === 'flat' ? '-1px' : '-2px',
|
|
82
82
|
'color': waveColor,
|
|
83
83
|
'children': _$cc(DynamicButton, _extends({
|
|
84
84
|
'className': _$cn(classNameObj),
|
|
@@ -14,7 +14,7 @@ var btnStyles = {
|
|
|
14
14
|
lineHeight: '1.15',
|
|
15
15
|
|
|
16
16
|
get padding() {
|
|
17
|
-
return "0 "
|
|
17
|
+
return "0 16px";
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
get borderColor() {
|
|
@@ -146,6 +146,13 @@ var btnSizeStyles = sizes.reduce(function (memo, size) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
};
|
|
149
|
+
|
|
150
|
+
if (size === 'large') {
|
|
151
|
+
Object.defineProperty(memo[size], 'padding', {
|
|
152
|
+
value: "0 24px"
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
149
156
|
return memo;
|
|
150
157
|
}, {});
|
|
151
158
|
var defaults = deepDefaults({
|
|
@@ -255,13 +262,13 @@ export function makeButtonStyles(_ref) {
|
|
|
255
262
|
}) + "\n }\n }\n ", ";"));
|
|
256
263
|
}
|
|
257
264
|
export function makeButtonGroupStyles() {
|
|
258
|
-
return /*#__PURE__*/css("display:inline-
|
|
265
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;flex-wrap:wrap;vertical-align:middle;.k-btn{margin:0;vertical-align:middle;&:hover,&:focus,&.k-active{z-index:1;position:relative;}}&.k-fluid{width:100%;}&:not(.k-vertical){>.k-btn{", _mapInstanceProperty(types).call(types, function (type) {
|
|
259
266
|
if (type === 'active') return;
|
|
260
267
|
var borderColor = button.group[type].borderColor;
|
|
261
268
|
return /*#__PURE__*/css("&.k-", type, ":not(:first-child){border-left-color:", borderColor, ";}&.k-", type, ":not(:last-child){border-right-color:", borderColor, ";}");
|
|
262
|
-
}), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.k-fluid{display:flex;>.k-btn{flex:1;}}}&.k-vertical{
|
|
269
|
+
}), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.k-fluid{display:flex;>.k-btn{flex:1;}}}&.k-vertical{flex-direction:column;>.k-btn{", _mapInstanceProperty(types).call(types, function (type) {
|
|
263
270
|
if (type === 'active') return;
|
|
264
271
|
var borderColor = button.group[type].borderColor;
|
|
265
272
|
return /*#__PURE__*/css("&.k-", type, ":not(:first-child){border-top-color:", borderColor, ";}&.k-", type, ":not(:last-child){border-bottom-color:", borderColor, ";}");
|
|
266
|
-
}), ";&:not(.k-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}");
|
|
273
|
+
}), ";&:not(.k-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}&.k-seperate{gap:8px;>.k-btn{border-radius:", button.borderRadius, "!important;}}");
|
|
267
274
|
}
|
|
@@ -38,11 +38,11 @@ var defaults = {
|
|
|
38
38
|
|
|
39
39
|
},
|
|
40
40
|
inner: {
|
|
41
|
-
width: '
|
|
41
|
+
width: '6px',
|
|
42
42
|
height: '10px',
|
|
43
43
|
top: '0px',
|
|
44
|
-
left: '
|
|
45
|
-
border: '
|
|
44
|
+
left: '4px',
|
|
45
|
+
border: '2px solid #fff'
|
|
46
46
|
},
|
|
47
47
|
// disabled
|
|
48
48
|
disabled: {
|
|
@@ -69,10 +69,6 @@ var defaults = {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
}
|
|
72
|
-
},
|
|
73
|
-
// indeterminate
|
|
74
|
-
indeterminate: {
|
|
75
|
-
innerLeft: '4px'
|
|
76
72
|
}
|
|
77
73
|
};
|
|
78
74
|
var checkbox;
|
|
@@ -82,5 +78,5 @@ setDefault(function () {
|
|
|
82
78
|
}).checkbox;
|
|
83
79
|
});
|
|
84
80
|
export default function makeStyles() {
|
|
85
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{width:", checkbox.width, ";height:", checkbox.width, ";border:1px solid ", checkbox.borderColor, ";border-radius:", checkbox.borderRadius, ";position:relative;transition:all ", checkbox.transition, ";background:", checkbox.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", checkbox.inner.width, ";height:", checkbox.inner.height, ";top:", checkbox.inner.top, ";left:", checkbox.inner.left, ";border:", checkbox.inner.border, ";border-top:0;border-left:0;transform:rotate(45deg) scale(0);transition:all ", checkbox.transition, ";}&:hover{border:", checkbox.hoverBorder, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;left:0;top:0;margin:0;}.k-checkbox-text{margin-left:", checkbox.text.gap, ";flex:0 1 auto;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";background:", checkbox.checked.bgColor, ";}}&.k-indeterminate{.k-checkbox-wrapper{&:before{transform:rotate(90deg) scale(1);border-bottom:0;
|
|
81
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{width:", checkbox.width, ";height:", checkbox.width, ";border:1px solid ", checkbox.borderColor, ";border-radius:", checkbox.borderRadius, ";position:relative;transition:all ", checkbox.transition, ";background:", checkbox.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", checkbox.inner.width, ";height:", checkbox.inner.height, ";top:", checkbox.inner.top, ";left:", checkbox.inner.left, ";border:", checkbox.inner.border, ";border-top:0;border-left:0;transform:rotate(45deg) scale(0);transition:all ", checkbox.transition, ";}}&:hover{.k-checkbox-wrapper{border:", checkbox.hoverBorder, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;left:0;top:0;margin:0;}.k-checkbox-text{margin-left:", checkbox.text.gap, ";flex:0 1 auto;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";background:", checkbox.checked.bgColor, ";}}&.k-indeterminate{.k-checkbox-wrapper{&:before{transform:rotate(90deg) scale(1);border-bottom:0;}}}&.k-checked{.k-checkbox-wrapper{&:before{transform:rotate(45deg) scale(1);}}}&:focus{outline:none;.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";}}&.k-disabled{color:", checkbox.disabled.color, ";cursor:not-allowed;.k-checkbox-wrapper{border-color:", checkbox.disabled.borderColor, ";background:", checkbox.disabled.bgColor, ";&:before{border-color:", checkbox.disabled.innerColor, ";}}input{cursor:not-allowed;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.disabled.checked.borderColor, ";background:", checkbox.disabled.checked.bgColor, ";}}}");
|
|
86
82
|
}
|
|
@@ -32,9 +32,9 @@ setDefault(function () {
|
|
|
32
32
|
}).collapse;
|
|
33
33
|
});
|
|
34
34
|
export function makeStyles() {
|
|
35
|
-
return /*#__PURE__*/css("font-size:", collapse.fontSize, ";&.k-left{.", kls('arrow'), "{float:left;margin-right:", collapse.titleMarginRight, ";
|
|
35
|
+
return /*#__PURE__*/css("font-size:", collapse.fontSize, ";&.k-left{.", kls('arrow'), "{float:left;margin-right:", collapse.titleMarginRight, ";}}&.k-border{border-radius:", collapse.borderRadius, ";padding:", collapse.borderPadding, ";border:", collapse.collBorder, ";}");
|
|
36
36
|
}
|
|
37
37
|
export function makeItemStyles() {
|
|
38
38
|
var collapseItem = collapse.item;
|
|
39
|
-
return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", kls('title'), "{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ", collapse.transition, ";}.", kls('arrow'), "{float:right;transition:transform ", collapse.transition, ";line-height:", collapseItem.titleHeight, ";height:", collapseItem.titleHeight, ";
|
|
39
|
+
return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", kls('title'), "{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ", collapse.transition, ";}.", kls('arrow'), "{float:right;transition:transform ", collapse.transition, ";line-height:", collapseItem.titleHeight, ";height:", collapseItem.titleHeight, ";}&:not(.k-disabled){.", kls('title'), "{&:hover{color:", theme.color.primary, ";}}}.", kls('content'), "{overflow:hidden;.", kls('wrapper'), "{overflow:hidden;padding:", collapseItem.contentPadding, ";}}&.k-active{.", kls('arrow'), "{transform:rotate(90deg);}}&.k-disabled{color:", theme.color.disabledBorder, ";.", kls('title'), "{cursor:not-allowed;}}");
|
|
40
40
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
3
2
|
import { useInstance, findDomFromVNode } from 'intact-vue-next';
|
|
4
3
|
import { position } from '../position';
|
|
5
4
|
import { noop } from 'intact-shared';
|
|
6
5
|
import { isObject } from 'intact-shared';
|
|
6
|
+
import { isEqualObject } from '../utils';
|
|
7
7
|
export function usePosition() {
|
|
8
8
|
var instance = useInstance();
|
|
9
9
|
var positioned = {
|
|
@@ -18,7 +18,7 @@ export function usePosition() {
|
|
|
18
18
|
instance.watch(item, function (newValue, oldValue) {
|
|
19
19
|
// return if object is the same
|
|
20
20
|
if (isObject(newValue) && isObject(oldValue) && // is not event object
|
|
21
|
-
!(newValue instanceof Event) &&
|
|
21
|
+
!(newValue instanceof Event) && isEqualObject(newValue, oldValue)) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -12,6 +12,7 @@ import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
|
12
12
|
import { Component } from 'intact-vue-next';
|
|
13
13
|
import { Form, FormItem } from './';
|
|
14
14
|
import { Input } from '../input';
|
|
15
|
+
import { Select } from '../select';
|
|
15
16
|
|
|
16
17
|
RemoteDemo.prototype.validateUserName = function (value) {
|
|
17
18
|
// mock api
|
|
@@ -1317,4 +1318,48 @@ describe('Form', function () {
|
|
|
1317
1318
|
}
|
|
1318
1319
|
}, _callee7);
|
|
1319
1320
|
})));
|
|
1321
|
+
it('should not validate when select is disabled on init', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
1322
|
+
var Demo, _mount8, instance, element;
|
|
1323
|
+
|
|
1324
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context11) {
|
|
1325
|
+
while (1) {
|
|
1326
|
+
switch (_context11.prev = _context11.next) {
|
|
1327
|
+
case 0:
|
|
1328
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
1329
|
+
_inheritsLoose(Demo, _Component3);
|
|
1330
|
+
|
|
1331
|
+
function Demo() {
|
|
1332
|
+
var _context10;
|
|
1333
|
+
|
|
1334
|
+
var _this3;
|
|
1335
|
+
|
|
1336
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1337
|
+
args[_key3] = arguments[_key3];
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
1341
|
+
_this3.Form = Form;
|
|
1342
|
+
_this3.FormItem = FormItem;
|
|
1343
|
+
_this3.Select = Select;
|
|
1344
|
+
return _this3;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
return Demo;
|
|
1348
|
+
}(Component);
|
|
1349
|
+
|
|
1350
|
+
Demo.template = "\n const {Form, FormItem, Select} = this;\n <Form ref=\"form\">\n <FormItem rules={{required: true}}>\n <Select disabled />\n </FormItem>\n </Form>\n ";
|
|
1351
|
+
_mount8 = mount(Demo), instance = _mount8[0], element = _mount8[1];
|
|
1352
|
+
_context11.next = 5;
|
|
1353
|
+
return wait(500);
|
|
1354
|
+
|
|
1355
|
+
case 5:
|
|
1356
|
+
expect(element.querySelector('.k-form-error')).to.be.null;
|
|
1357
|
+
|
|
1358
|
+
case 6:
|
|
1359
|
+
case "end":
|
|
1360
|
+
return _context11.stop();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
}, _callee8);
|
|
1364
|
+
})));
|
|
1320
1365
|
});
|
|
@@ -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-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;}");
|
|
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, ";flex-shrink:0;}.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;
|
|
@@ -44,8 +44,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
return _$cv('i', _extends({
|
|
47
|
-
'className': _$cn(classNameObj)
|
|
47
|
+
'className': _$cn(classNameObj)
|
|
48
|
+
}, getRestProps(this), {
|
|
48
49
|
'style': addStyle(style, _style)
|
|
49
|
-
}
|
|
50
|
+
}), children);
|
|
50
51
|
}
|
|
51
52
|
;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import { Component, inject } from 'intact-vue-next';
|
|
3
|
+
import { Component, inject, provide } from 'intact-vue-next';
|
|
4
4
|
import template from './template.vdt';
|
|
5
|
-
import { LAYOUT, getStyle } from './helpers';
|
|
5
|
+
import { LAYOUT, getStyle, BODY } from './helpers';
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
7
|
export var Body = /*#__PURE__*/function (_Component) {
|
|
8
8
|
_inheritsLoose(Body, _Component);
|
|
@@ -23,6 +23,10 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
23
23
|
|
|
24
24
|
var _proto = Body.prototype;
|
|
25
25
|
|
|
26
|
+
_proto.init = function init() {
|
|
27
|
+
provide(BODY, this);
|
|
28
|
+
};
|
|
29
|
+
|
|
26
30
|
_proto.getClassNames = function getClassNames() {
|
|
27
31
|
var _ref;
|
|
28
32
|
|
|
@@ -45,6 +49,7 @@ export var Body = /*#__PURE__*/function (_Component) {
|
|
|
45
49
|
|
|
46
50
|
if (!hasFixedAside && !hasFixedHeader) return style;
|
|
47
51
|
return addStyle(style, {
|
|
52
|
+
// FIXME: we must use padding instead of margin, otherwise the table's width is wired
|
|
48
53
|
paddingLeft: hasFixedAside ? getStyle(asideWidth) : null,
|
|
49
54
|
marginTop: hasFixedHeader ? getStyle(headerHeight) : null
|
|
50
55
|
});
|
|
@@ -5,6 +5,8 @@ export interface HeaderProps {
|
|
|
5
5
|
height?: number | string;
|
|
6
6
|
style?: string | Record<string, string>;
|
|
7
7
|
theme?: MenuProps['theme'];
|
|
8
|
+
blur?: boolean;
|
|
9
|
+
boxShadow?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export declare class Header extends Component<HeaderProps> {
|
|
10
12
|
static template: string | import("intact").Template<any>;
|
|
@@ -9,7 +9,9 @@ var typeDefs = {
|
|
|
9
9
|
fixed: Boolean,
|
|
10
10
|
height: [Number, String],
|
|
11
11
|
style: [String, Object],
|
|
12
|
-
theme: themes
|
|
12
|
+
theme: themes,
|
|
13
|
+
blur: Boolean,
|
|
14
|
+
boxShadow: Boolean
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
var defaults = function defaults() {
|
|
@@ -44,11 +46,15 @@ export var Header = /*#__PURE__*/function (_Component) {
|
|
|
44
46
|
var _this$get = this.get(),
|
|
45
47
|
className = _this$get.className,
|
|
46
48
|
fixed = _this$get.fixed,
|
|
47
|
-
theme = _this$get.theme
|
|
49
|
+
theme = _this$get.theme,
|
|
50
|
+
blur = _this$get.blur,
|
|
51
|
+
boxShadow = _this$get.boxShadow;
|
|
48
52
|
|
|
49
53
|
return _ref = {
|
|
50
54
|
'k-layout-header': true,
|
|
51
|
-
'k-fixed': fixed
|
|
55
|
+
'k-fixed': fixed,
|
|
56
|
+
'k-blur': blur,
|
|
57
|
+
'k-box-shadow': boxShadow
|
|
52
58
|
}, _ref["k-" + theme] = true, _ref[className] = className, _ref[makeHeaderStyles()] = true, _ref;
|
|
53
59
|
};
|
|
54
60
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const ROOT_LAYOUT = "RootLayout";
|
|
2
2
|
export declare const LAYOUT = "Layout";
|
|
3
|
+
export declare const BODY = "LayoutBody";
|
|
3
4
|
export declare const defaultHeight = "64px";
|
|
4
5
|
export declare const defaultWidth = "200px";
|
|
5
6
|
export declare function getStyle(height: number | string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
4
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
5
|
+
import { mount, unmount } from '../../test/utils';
|
|
6
|
+
import { Component } from 'intact-vue-next';
|
|
7
|
+
import { Layout, Header, Aside, Body } from './';
|
|
8
|
+
describe('Layout', function () {
|
|
9
|
+
afterEach(function () {
|
|
10
|
+
unmount();
|
|
11
|
+
});
|
|
12
|
+
it('nest Layout in Body with fixed header', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
13
|
+
var Demo, _mount, instance, element;
|
|
14
|
+
|
|
15
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
16
|
+
while (1) {
|
|
17
|
+
switch (_context2.prev = _context2.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
20
|
+
_inheritsLoose(Demo, _Component);
|
|
21
|
+
|
|
22
|
+
function Demo() {
|
|
23
|
+
var _context;
|
|
24
|
+
|
|
25
|
+
var _this;
|
|
26
|
+
|
|
27
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
+
args[_key] = arguments[_key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
32
|
+
_this.Layout = Layout;
|
|
33
|
+
_this.Header = Header;
|
|
34
|
+
_this.Aside = Aside;
|
|
35
|
+
_this.Body = Body;
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return Demo;
|
|
40
|
+
}(Component);
|
|
41
|
+
|
|
42
|
+
Demo.template = "\n const { Layout, Header, Aside, Body } = this;\n <Layout>\n <Header fixed />\n <Body>\n <Layout>\n <Aside fixed />\n <Body>body</Body>\n </Layout>\n </Body>\n </Layout>\n ";
|
|
43
|
+
_mount = mount(Demo), instance = _mount[0], element = _mount[1];
|
|
44
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
45
|
+
|
|
46
|
+
case 4:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context2.stop();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, _callee);
|
|
52
|
+
})));
|
|
53
|
+
});
|
|
@@ -4,7 +4,7 @@ import { Component, inject, provide } from 'intact-vue-next';
|
|
|
4
4
|
import template from './template.vdt';
|
|
5
5
|
import { makeLayoutStyles } from './styles';
|
|
6
6
|
import { addStyle } from '../utils';
|
|
7
|
-
import { ROOT_LAYOUT, LAYOUT, getStyle } from './helpers';
|
|
7
|
+
import { ROOT_LAYOUT, LAYOUT, getStyle, BODY } from './helpers';
|
|
8
8
|
import { useParse } from './useParse';
|
|
9
9
|
export var Layout = /*#__PURE__*/function (_Component) {
|
|
10
10
|
_inheritsLoose(Layout, _Component);
|
|
@@ -21,6 +21,7 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
21
21
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
22
22
|
_this.parse = useParse();
|
|
23
23
|
_this.layout = inject(LAYOUT, null);
|
|
24
|
+
_this.body = inject(BODY, null);
|
|
24
25
|
return _this;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -52,7 +53,7 @@ export var Layout = /*#__PURE__*/function (_Component) {
|
|
|
52
53
|
_proto.getStyles = function getStyles() {
|
|
53
54
|
var style = this.get('style');
|
|
54
55
|
var layout = this.layout;
|
|
55
|
-
if (!layout) return style;
|
|
56
|
+
if (!layout || this.body) return style;
|
|
56
57
|
|
|
57
58
|
var _layout$parse = layout.parse(),
|
|
58
59
|
hasFixedHeader = _layout$parse.hasFixedHeader,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
2
|
import { css } from '@emotion/css';
|
|
3
3
|
import { theme, setDefault } from '../../styles/theme';
|
|
4
|
-
import { deepDefaults, getLeft } from '../../styles/utils';
|
|
4
|
+
import { deepDefaults, getLeft, setAlpha } from '../../styles/utils';
|
|
5
5
|
import '../../styles/global';
|
|
6
6
|
import { menu } from '../menu/styles';
|
|
7
7
|
var sizes = ['small', 'large'];
|
|
@@ -21,7 +21,7 @@ var defaults = {
|
|
|
21
21
|
|
|
22
22
|
light: {
|
|
23
23
|
get color() {
|
|
24
|
-
return menu.light.
|
|
24
|
+
return menu.light.item.color;
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
get bgColor() {
|
|
@@ -35,7 +35,7 @@ var defaults = {
|
|
|
35
35
|
},
|
|
36
36
|
white: {
|
|
37
37
|
get color() {
|
|
38
|
-
return menu.white.
|
|
38
|
+
return menu.white.item.color;
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
get bgColor() {
|
|
@@ -68,10 +68,10 @@ export function makeLayoutStyles() {
|
|
|
68
68
|
return /*#__PURE__*/css("display:flex;flex-direction:column;flex:1;transition:padding-left ", layout.transition, ";&.k-has-aside{flex-direction:row;}.k-layout-footer{padding:", layout.footerPadding, ";}.k-layout-body{flex:1;}");
|
|
69
69
|
}
|
|
70
70
|
export function makeHeaderStyles() {
|
|
71
|
-
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.k-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
71
|
+
return /*#__PURE__*/css("display:flex;align-items:center;color:", layout.color, ";background:", layout.bgColor, ";left:0;transition:left ", layout.transition, ";&.k-fixed{position:fixed;left:0;right:0;top:0;z-index:", theme.midZIndex + 1, ";}>.k-menu{background:transparent!important;}&.k-blur{backdrop-filter:blur(20px);background:", setAlpha(layout.bgColor, 0.1), ";}&.k-box-shadow{border-bottom:none!important;box-shadow:", theme.boxShadow, ";}", _mapInstanceProperty(themes).call(themes, function (theme) {
|
|
72
72
|
if (theme === 'dark') return;
|
|
73
73
|
var styles = layout[theme];
|
|
74
|
-
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";}");
|
|
74
|
+
return /*#__PURE__*/css("&.k-", theme, "{background:", styles.bgColor, ";color:", styles.color, ";border-bottom:", styles.border, ";&.k-blur{background:", setAlpha(styles.bgColor, 0.1), ";}}");
|
|
75
75
|
}), ";");
|
|
76
76
|
}
|
|
77
77
|
export function makeAsideStyles() {
|
|
@@ -132,9 +132,9 @@ export function makeMenuStyles() {
|
|
|
132
132
|
}
|
|
133
133
|
export function makeTitleStyles() {
|
|
134
134
|
var item = menu.item;
|
|
135
|
-
return /*#__PURE__*/css("display:flex;align-items:center;padding:",
|
|
135
|
+
return /*#__PURE__*/css("display:flex;align-items:center;padding:", item.padding, ";color:", item.color, ";white-space:nowrap;overflow:hidden;flex-wrap:nowrap;");
|
|
136
136
|
}
|
|
137
137
|
export function makeItemStyles() {
|
|
138
138
|
var item = menu.item;
|
|
139
|
-
return /*#__PURE__*/css(".k-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.k-menu-name{flex:1;display:flex;align-items:center;}.k-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.k-expanded{>.k-menu-title{color:", menu.item.hoverColor, ";.k-menu-arrow{transform:rotateX(180deg);}}}&.k-highlighted{>.k-menu-title{color:", menu.item.hoverColor, ";}}&.k-active{>.k-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.k-disabled{>.k-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.k-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
139
|
+
return /*#__PURE__*/css(".k-menu-title{cursor:pointer;height:", menu.item.height, ";transition:all ", menu.transition, ";&:hover{color:", menu.item.hoverColor, ";}}.k-menu-name{flex:1;display:flex;align-items:center;min-width:0;span{overflow:hidden;text-overflow:ellipsis;min-width:0;}}.k-menu-arrow{transition:transform ", menu.transition, ";margin-left:", menu.icon.gap, ";}&.k-expanded{>.k-menu-title{color:", menu.item.hoverColor, ";.k-menu-arrow{transform:rotateX(180deg);}}}&.k-highlighted{>.k-menu-title{color:", menu.item.hoverColor, ";}}&.k-active{>.k-menu-title{color:", menu.item.hoverColor, "!important;background:", menu.item.activeBgColor, ";}}&.k-disabled{>.k-menu-title{color:", menu.item.disabledColor, "!important;cursor:not-allowed;}}.k-menu-dot{font-size:", menu.item.dotFontSize, ";transform:scale(.4);}");
|
|
140
140
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useInstance, onBeforeMount, onBeforeUpdate, inject } from 'intact-vue-next';
|
|
1
|
+
import { useInstance, onBeforeMount, onBeforeUpdate, inject, createVNode } from 'intact-vue-next';
|
|
2
2
|
import { Menu } from './';
|
|
3
3
|
import { Icon } from '../icon';
|
|
4
4
|
import { isComponentVNode, eachChildren, isTextVNode, isStringOrNumberNotEmpty } from '../utils';
|
|
@@ -38,6 +38,11 @@ export function useDropdown(rootMenu, parentMenu) {
|
|
|
38
38
|
iconVNode = vNode;
|
|
39
39
|
}
|
|
40
40
|
} else {
|
|
41
|
+
if (isStringOrNumberNotEmpty(vNode) || isTextVNode(vNode)) {
|
|
42
|
+
// wrap with span for showing text ellipsis
|
|
43
|
+
vNode = createVNode('span', null, vNode);
|
|
44
|
+
}
|
|
45
|
+
|
|
41
46
|
titleVNodes.push(vNode);
|
|
42
47
|
}
|
|
43
48
|
});
|
|
@@ -27,11 +27,8 @@ var defaults = deepDefaults({
|
|
|
27
27
|
|
|
28
28
|
get borderRadius() {
|
|
29
29
|
return theme.borderRadius;
|
|
30
|
-
}
|
|
30
|
+
} // get hoverBgColor() { return theme.color.hoverBg }
|
|
31
31
|
|
|
32
|
-
get hoverBgColor() {
|
|
33
|
-
return theme.color.hoverBg;
|
|
34
|
-
}
|
|
35
32
|
|
|
36
33
|
},
|
|
37
34
|
// goto
|
|
@@ -64,7 +61,7 @@ setDefault(function () {
|
|
|
64
61
|
}).pagination;
|
|
65
62
|
});
|
|
66
63
|
export function makeStyles() {
|
|
67
|
-
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.k-pagination-ellipsis{background-color:transparent;border-color:transparent;}.k-btns{.k-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}
|
|
64
|
+
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.k-pagination-ellipsis{background-color:transparent;border-color:transparent;}.k-btns{.k-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}}.k-icon{font-size:18px;}}.k-pagination-goto{.k-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.k-input-inner{text-align:center;}}.k-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
68
65
|
var styles = pagination[size];
|
|
69
66
|
var btnStyles = button[size];
|
|
70
67
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";.k-btn{margin-right:", styles.btnGap, ";min-width:", btnStyles.height, ";.k-icon{font-size:", styles.iconFontSize, ";}}}");
|
|
@@ -61,5 +61,5 @@ setDefault(function () {
|
|
|
61
61
|
}).radio;
|
|
62
62
|
});
|
|
63
63
|
export function makeStyles() {
|
|
64
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}&:hover{border:1px solid ", radio.hoverBorderColor, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.k-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.k-checked{.k-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.k-radio-wrapper{border-color:", radio.checkedColor, ";}}&.k-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.k-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";}input{cursor:not-allowed;}&.k-checked{.k-radio-wrapper{border-color:", radio.disabled.checked.borderColor, ";background:", radio.disabled.checked.bgColor, ";&:before{background:", radio.disabled.checked.innerColor, ";}}}}");
|
|
64
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-radio-wrapper{width:", radio.width, ";height:", radio.width, ";border:1px solid ", radio.borderColor, ";border-radius:50%;transition:all ", radio.transition, ";position:relative;background:", radio.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", radio.innerWidth, ";height:", radio.innerWidth, ";top:50%;left:50%;margin-left:calc(-", radio.innerWidth, " / 2);margin-top:calc(-", radio.innerWidth, " / 2);border-radius:50%;background-color:", radio.checkedColor, ";transform:scale(0);transition:all ", radio.transition, ";}}&:hover{.k-radio-wrapper{border:1px solid ", radio.hoverBorderColor, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;}.k-radio-text{margin-left:", radio.textGap, ";flex:0 1 auto;}&.k-checked{.k-radio-wrapper{border-color:", radio.checkedColor, ";&:before{transform:scale(1);}}}&:focus{outline:none;.k-radio-wrapper{border-color:", radio.checkedColor, ";}}&.k-disabled{color:", radio.disabled.color, ";cursor:not-allowed;.k-radio-wrapper{border-color:", radio.disabled.borderColor, ";background:", radio.disabled.bgColor, ";}input{cursor:not-allowed;}&.k-checked{.k-radio-wrapper{border-color:", radio.disabled.checked.borderColor, ";background:", radio.disabled.checked.bgColor, ";&:before{background:", radio.disabled.checked.innerColor, ";}}}}");
|
|
65
65
|
}
|
|
@@ -16,6 +16,9 @@ var _$tmp0 = {
|
|
|
16
16
|
'className': 'ion-load-c',
|
|
17
17
|
'rotate': true
|
|
18
18
|
};
|
|
19
|
+
var _$tmp1 = {
|
|
20
|
+
'className': 'k-icon-search'
|
|
21
|
+
};
|
|
19
22
|
export default function ($props, $blocks, $__proto__) {
|
|
20
23
|
var _classNameObj,
|
|
21
24
|
_this = this;
|
|
@@ -198,7 +201,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
198
201
|
'ev-click': _this.clear,
|
|
199
202
|
'hoverable': true
|
|
200
203
|
}) : undefined, _$ce(2, 'span', (_$blocks['suffix'] = function ($super) {
|
|
201
|
-
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? _$cc(Icon, {
|
|
204
|
+
return loading ? _$cc(Icon, _$tmp0) : !hideIcon ? filterable && show ? _$cc(Icon, _$tmp1) : _$cc(Icon, {
|
|
202
205
|
'className': 'k-select-arrow k-icon-down',
|
|
203
206
|
'disabled': $props.isDisableArrow
|
|
204
207
|
}) : undefined;
|