@king-design/vue 2.0.0-beta.1 → 2.0.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__/Vue Next Demos.md +1795 -0
- package/__tests__/components/dropdown.spec.ts +72 -0
- package/__tests__/components/select.spec.ts +29 -0
- package/__tests__/index.ts +46 -0
- package/__tests__/karma.conf.js +54 -0
- package/__tests__/webpack.config.js +61 -0
- package/components/breadcrumb/item.d.ts +1 -1
- package/components/breadcrumb/item.js +3 -14
- package/components/breadcrumb/styles.js +1 -1
- package/components/button/index.vdt.js +26 -17
- package/components/button/styles.d.ts +82 -1
- package/components/button/styles.js +16 -2
- package/components/card/styles.js +1 -1
- package/components/carousel/styles.js +4 -1
- package/components/carousel/useSlide.js +10 -9
- package/components/cascader/index.spec.js +89 -1
- package/components/cascader/index.vdt.js +4 -4
- package/components/cascader/useLabel.js +8 -12
- package/components/checkbox/index.vdt.js +15 -10
- package/components/checkbox/styles.js +2 -2
- package/components/collapse/item.vdt.js +2 -1
- package/components/collapse/styles.js +5 -1
- package/components/colorpicker/index.d.ts +2 -0
- package/components/colorpicker/index.js +2 -1
- package/components/colorpicker/index.spec.js +1 -1
- package/components/colorpicker/index.vdt.js +3 -1
- package/components/context.d.ts +5 -2
- package/components/context.js +7 -4
- package/components/datepicker/helpers.d.ts +2 -1
- package/components/datepicker/helpers.js +8 -2
- package/components/datepicker/index.spec.js +1 -1
- package/components/datepicker/index.vdt.js +10 -5
- package/components/datepicker/styles.d.ts +46 -1
- package/components/diagram/shapes/generateShapes.js +3 -3
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +0 -1
- package/components/dialog/base.d.ts +2 -0
- package/components/dialog/base.js +2 -1
- package/components/dialog/index.spec.js +59 -94
- package/components/dialog/styles.js +5 -1
- package/components/dialog/useFixBody.d.ts +6 -0
- package/components/dialog/useFixBody.js +12 -0
- package/components/drawer/index.spec.js +5 -5
- package/components/drawer/styles.js +1 -1
- package/components/dropdown/dropdown.js +1 -0
- package/components/dropdown/index.js +1 -2
- package/components/dropdown/index.spec.js +3 -3
- package/components/dropdown/styles.js +1 -1
- package/components/editable/index.vdt.js +2 -1
- package/components/editable/styles.d.ts +8 -1
- package/components/form/index.spec.js +10 -12
- package/components/form/item.vdt.js +13 -9
- package/components/form/useError.d.ts +5 -1
- package/components/form/useError.js +3 -1
- package/components/form/useValidate.js +2 -2
- package/components/grid/col.vdt.js +4 -2
- package/components/grid/styles.js +1 -1
- package/components/grid/useGutter.d.ts +1 -1
- package/components/icon/index.vdt.js +3 -2
- package/components/icon/styles.js +8 -4
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +2 -1
- package/components/input/index.vdt.js +47 -32
- package/components/input/search.vdt.js +4 -2
- package/components/input/styles.js +8 -3
- package/components/layout/styles.d.ts +1 -1
- package/components/layout/styles.js +7 -3
- package/components/menu/index.spec.js +15 -8
- package/components/menu/item.d.ts +1 -2
- package/components/menu/item.js +10 -17
- package/components/menu/item.vdt.js +4 -4
- package/components/menu/menu.d.ts +3 -0
- package/components/menu/menu.js +4 -0
- package/components/menu/styles.d.ts +62 -1
- package/components/menu/styles.js +6 -2
- package/components/menu/useExpanded.d.ts +1 -4
- package/components/menu/useHighlight.d.ts +5 -8
- package/components/menu/useHighlight.js +44 -33
- package/components/message/index.spec.js +1 -1
- package/components/message/styles.js +6 -2
- package/components/pagination/styles.js +1 -1
- package/components/radio/index.vdt.js +14 -9
- package/components/radio/styles.js +9 -1
- package/components/rate/styles.js +5 -1
- package/components/scrollSelect/styles.d.ts +14 -1
- package/components/scrollSelect/styles.js +9 -1
- package/components/select/base.vdt.js +135 -121
- package/components/select/index.spec.js +1 -1
- package/components/select/menu.vdt.js +1 -0
- package/components/select/styles.js +9 -4
- package/components/select/useSearchable.d.ts +1 -1
- package/components/slider/styles.js +5 -1
- package/components/spinner/index.d.ts +1 -1
- package/components/spinner/index.js +1 -1
- package/components/split/style.js +1 -1
- package/components/steps/context.d.ts +1 -1
- package/components/steps/styles.js +5 -1
- package/components/switch/styles.js +5 -1
- package/components/table/index.d.ts +1 -0
- package/components/table/index.spec.js +2 -1
- package/components/table/row.vdt.js +12 -4
- package/components/table/styles.js +6 -1
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +2 -1
- package/components/table/table.vdt.js +30 -27
- package/components/table/useColumns.d.ts +1 -1
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +5 -2
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useResizable.d.ts +1 -1
- package/components/table/useSortable.d.ts +1 -1
- package/components/table/useWidth.js +7 -1
- package/components/tabs/index.spec.js +1 -1
- package/components/tabs/styles.js +9 -2
- package/components/tabs/tab.vdt.js +2 -1
- package/components/tabs/useActiveBar.js +6 -3
- package/components/tag/base.js +1 -0
- package/components/tag/styles.js +8 -2
- package/components/timepicker/constants.d.ts +2 -1
- package/components/timepicker/constants.js +3 -2
- package/components/timepicker/index.spec.js +36 -35
- package/components/timepicker/useStep.js +3 -3
- package/components/timepicker/useValue.js +2 -2
- package/components/tooltip/index.spec.js +32 -25
- package/components/transfer/index.spec.js +20 -19
- package/components/transfer/styles.js +2 -6
- package/components/tree/index.d.ts +1 -1
- package/components/tree/index.js +1 -1
- package/components/tree/index.spec.js +20 -19
- package/components/tree/index.vdt.js +1 -0
- package/components/tree/styles.js +5 -1
- package/components/treeSelect/index.spec.js +5 -5
- package/components/treeSelect/styles.js +5 -1
- package/components/upload/index.d.ts +1 -1
- package/components/upload/index.spec.js +1 -1
- package/components/upload/index.vdt.js +10 -11
- package/components/upload/styles.js +5 -1
- package/components/utils.d.ts +1 -1
- package/components/wave/index.d.ts +19 -0
- package/components/wave/index.js +120 -0
- package/components/wave/styles.d.ts +2 -0
- package/components/wave/styles.js +17 -0
- package/hooks/useRouter.d.ts +1 -0
- package/hooks/useRouter.js +10 -0
- package/i18n/en-US.d.ts +1 -0
- package/i18n/en-US.js +1 -0
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/install.d.ts +2 -0
- package/package.json +2 -12
- package/styles/global.js +4 -3
- package/styles/theme.d.ts +16 -7
- package/styles/theme.js +15 -7
- package/tsconfig.json +22 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
2
4
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
5
|
import BasicDemo from '~/components/cascader/demos/basic';
|
|
4
6
|
import CustomDemo from '~/components/cascader/demos/custom';
|
|
@@ -6,6 +8,8 @@ import ChangeOnSelectDemo from '~/components/cascader/demos/changeOnSelect';
|
|
|
6
8
|
import LoadDataDemo from '~/components/cascader/demos/loadData';
|
|
7
9
|
import FilterDemo from '~/components/cascader/demos/filterable';
|
|
8
10
|
import { mount, unmount, dispatchEvent, getElement, getElements, wait } from '../../test/utils';
|
|
11
|
+
import { Cascader } from './';
|
|
12
|
+
import { Component } from 'intact-vue-next';
|
|
9
13
|
describe('Cascader', function () {
|
|
10
14
|
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
11
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -14,7 +18,7 @@ describe('Cascader', function () {
|
|
|
14
18
|
case 0:
|
|
15
19
|
unmount();
|
|
16
20
|
_context.next = 3;
|
|
17
|
-
return wait(
|
|
21
|
+
return wait(500);
|
|
18
22
|
|
|
19
23
|
case 3:
|
|
20
24
|
case "end":
|
|
@@ -278,4 +282,88 @@ describe('Cascader', function () {
|
|
|
278
282
|
}
|
|
279
283
|
}, _callee7);
|
|
280
284
|
})));
|
|
285
|
+
it('duplicated sub data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
286
|
+
var Demo, _mount7, instance, element, _getElements2, dropdown1, dropdown2, _dropdown1$querySelec4, item1, item2, _dropdown2$querySelec3, item21, dropdown3, _dropdown3$querySelec2, item31;
|
|
287
|
+
|
|
288
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
289
|
+
while (1) {
|
|
290
|
+
switch (_context9.prev = _context9.next) {
|
|
291
|
+
case 0:
|
|
292
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
293
|
+
_inheritsLoose(Demo, _Component);
|
|
294
|
+
|
|
295
|
+
function Demo() {
|
|
296
|
+
var _context8;
|
|
297
|
+
|
|
298
|
+
var _this;
|
|
299
|
+
|
|
300
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
301
|
+
args[_key] = arguments[_key];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context8 = [this]).call(_context8, args)) || this;
|
|
305
|
+
_this.Cascader = Cascader;
|
|
306
|
+
return _this;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
Demo.defaults = function defaults() {
|
|
310
|
+
return {
|
|
311
|
+
value: ['beijing', 'haidian'],
|
|
312
|
+
data: [{
|
|
313
|
+
value: 'beijing',
|
|
314
|
+
label: '北京',
|
|
315
|
+
children: [{
|
|
316
|
+
value: 'haidian',
|
|
317
|
+
label: '海淀区'
|
|
318
|
+
}]
|
|
319
|
+
}, {
|
|
320
|
+
value: 'hunan',
|
|
321
|
+
label: '湖南',
|
|
322
|
+
children: [{
|
|
323
|
+
value: 'haidian',
|
|
324
|
+
label: '海淀区'
|
|
325
|
+
}]
|
|
326
|
+
}]
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
return Demo;
|
|
331
|
+
}(Component);
|
|
332
|
+
|
|
333
|
+
Demo.template = "const {Cascader} = this; <Cascader data={this.get('data')} v-model=\"value\" />";
|
|
334
|
+
_mount7 = mount(Demo), instance = _mount7[0], element = _mount7[1];
|
|
335
|
+
dispatchEvent(element, 'click');
|
|
336
|
+
_context9.next = 6;
|
|
337
|
+
return wait();
|
|
338
|
+
|
|
339
|
+
case 6:
|
|
340
|
+
_getElements2 = getElements('.k-cascader-menu'), dropdown1 = _getElements2[0], dropdown2 = _getElements2[1];
|
|
341
|
+
_dropdown1$querySelec4 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec4[0], item2 = _dropdown1$querySelec4[1];
|
|
342
|
+
expect(item1.classList.contains('k-selected')).to.be.true;
|
|
343
|
+
expect(item2.classList.contains('k-selected')).to.be.false;
|
|
344
|
+
_dropdown2$querySelec3 = dropdown2.querySelectorAll(':scope > .k-dropdown-item'), item21 = _dropdown2$querySelec3[0];
|
|
345
|
+
expect(item21.classList.contains('k-selected')).to.be.true;
|
|
346
|
+
dispatchEvent(item2, 'click');
|
|
347
|
+
_context9.next = 15;
|
|
348
|
+
return wait();
|
|
349
|
+
|
|
350
|
+
case 15:
|
|
351
|
+
dropdown3 = getElement('.k-cascader-menu');
|
|
352
|
+
_dropdown3$querySelec2 = dropdown3.querySelectorAll(':scope > .k-dropdown-item'), item31 = _dropdown3$querySelec2[0];
|
|
353
|
+
expect(item31.classList.contains('k-selected')).to.be.false;
|
|
354
|
+
dispatchEvent(item31, 'click');
|
|
355
|
+
_context9.next = 21;
|
|
356
|
+
return wait();
|
|
357
|
+
|
|
358
|
+
case 21:
|
|
359
|
+
expect(instance.get('value')).to.eql(['hunan', 'haidian']);
|
|
360
|
+
expect(element.textContent).to.eql('湖南 / 海淀区');
|
|
361
|
+
|
|
362
|
+
case 23:
|
|
363
|
+
case "end":
|
|
364
|
+
return _context9.stop();
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}, _callee8);
|
|
368
|
+
})));
|
|
281
369
|
});
|
|
@@ -41,7 +41,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
41
41
|
onSelect = _this$value.onSelect,
|
|
42
42
|
toggleShowedValue = _this$value.toggleShowedValue;
|
|
43
43
|
|
|
44
|
-
var Options = function Options(data, level, loaded) {
|
|
44
|
+
var Options = function Options(data, level, loaded, parentSelected) {
|
|
45
45
|
if (!data.length) {
|
|
46
46
|
if (!loaded) {
|
|
47
47
|
return _$cc(Icon, _$tmp0);
|
|
@@ -53,7 +53,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
53
53
|
return _mapInstanceProperty(data).call(data, function (item, index) {
|
|
54
54
|
var value = item.value;
|
|
55
55
|
var showed = isShowed(value, level);
|
|
56
|
-
var selected = isSelected(value, level);
|
|
56
|
+
var selected = parentSelected && isSelected(value, level);
|
|
57
57
|
var children = item.children;
|
|
58
58
|
|
|
59
59
|
var Item = function Item() {
|
|
@@ -79,7 +79,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
79
79
|
'ev-show': _this.load.bind(null, item),
|
|
80
80
|
'children': [Item(), _$cc(DropdownMenu, {
|
|
81
81
|
'className': _$cn(classNameObj),
|
|
82
|
-
'children': showed ? Options(children, level + 1, item.loaded) : null
|
|
82
|
+
'children': showed ? Options(children, level + 1, item.loaded, selected) : null
|
|
83
83
|
})]
|
|
84
84
|
}) : Item();
|
|
85
85
|
});
|
|
@@ -100,7 +100,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
100
100
|
return !filterable || !keywords ? _$cc(DropdownMenu, {
|
|
101
101
|
'className': _$cn(classNameObj),
|
|
102
102
|
'key': 'common',
|
|
103
|
-
'children': Options(data, 0, true)
|
|
103
|
+
'children': Options(data, 0, true, true)
|
|
104
104
|
}, 'common') : _$cc(DropdownMenu, {
|
|
105
105
|
'key': 'filter',
|
|
106
106
|
'className': _$cn((_$cn2 = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
2
1
|
import { useInstance } from 'intact-vue-next';
|
|
3
2
|
import { useBaseLabel } from '../select/useBaseLabel';
|
|
4
3
|
export function useLabel() {
|
|
@@ -11,27 +10,24 @@ export function useLabel() {
|
|
|
11
10
|
var labels = [];
|
|
12
11
|
var length = value.length;
|
|
13
12
|
|
|
14
|
-
var loop = function loop(data) {
|
|
13
|
+
var loop = function loop(data, level) {
|
|
14
|
+
if (level === length) return;
|
|
15
|
+
|
|
15
16
|
for (var i = 0; i < data.length; i++) {
|
|
16
17
|
var item = data[i];
|
|
17
18
|
|
|
18
|
-
if (
|
|
19
|
+
if (item.value === value[level]) {
|
|
19
20
|
labels.push(item.label);
|
|
21
|
+
var children = item.children;
|
|
20
22
|
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
+
if (children) {
|
|
24
|
+
loop(children, level + 1);
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
var children = item.children;
|
|
27
|
-
|
|
28
|
-
if (children) {
|
|
29
|
-
loop(children);
|
|
30
|
-
}
|
|
31
27
|
}
|
|
32
28
|
};
|
|
33
29
|
|
|
34
|
-
loop(data);
|
|
30
|
+
loop(data, 0);
|
|
35
31
|
return labels.length ? format(labels) : null;
|
|
36
32
|
}
|
|
37
33
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["className", "disabled", "falseValue", "children", "value", "trueValue", "style", "indeterminate", "title"];
|
|
4
|
-
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact-vue-next';
|
|
4
|
+
import { createVNode as _$cv, className as _$cn, createUnknownComponentVNode as _$cc, createElementVNode as _$ce } from 'intact-vue-next';
|
|
5
5
|
import { getRestProps } from '../utils';
|
|
6
6
|
import makeStyles from './styles';
|
|
7
|
+
import { Wave } from '../wave';
|
|
7
8
|
export default function ($props, $blocks, $__proto__) {
|
|
8
9
|
var _classNameObj;
|
|
9
10
|
|
|
@@ -51,15 +52,19 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
51
52
|
'title': title,
|
|
52
53
|
'ev-click': this.onClick,
|
|
53
54
|
'ev-keypress': this.onKeypress
|
|
54
|
-
}, events), [_$
|
|
55
|
-
'type': 'checkbox',
|
|
56
|
-
'checked': isChecked,
|
|
57
|
-
'value': trueValue,
|
|
58
|
-
'trueValue': trueValue,
|
|
59
|
-
'falseValue': falseValue,
|
|
55
|
+
}, events), [_$cc(Wave, {
|
|
60
56
|
'disabled': disabled,
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
|
|
57
|
+
'inset': '-2px',
|
|
58
|
+
'children': _$ce(2, 'span', _$cv('input', _extends({
|
|
59
|
+
'type': 'checkbox',
|
|
60
|
+
'checked': isChecked,
|
|
61
|
+
'value': trueValue,
|
|
62
|
+
'trueValue': trueValue,
|
|
63
|
+
'falseValue': falseValue,
|
|
64
|
+
'disabled': disabled,
|
|
65
|
+
'tabindex': '-1',
|
|
66
|
+
'ref': this.inputRef
|
|
67
|
+
}, getRestProps(this, rest))), 2, 'k-checkbox-wrapper')
|
|
68
|
+
}), children ? _$ce(2, 'span', children, 0, 'k-checkbox-text') : undefined]);
|
|
64
69
|
}
|
|
65
70
|
;
|
|
@@ -14,7 +14,7 @@ var defaults = {
|
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
get transition() {
|
|
17
|
-
return theme.transition;
|
|
17
|
+
return theme.transition.small;
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
bgColor: '#fff',
|
|
@@ -71,5 +71,5 @@ setDefault(function () {
|
|
|
71
71
|
}).checkbox;
|
|
72
72
|
});
|
|
73
73
|
export default function makeStyles() {
|
|
74
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{
|
|
74
|
+
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, ";}}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;left:", checkbox.indeterminate.innerLeft, ";}}}&.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;}}");
|
|
75
75
|
}
|
|
@@ -39,7 +39,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
39
|
|
|
40
40
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
41
41
|
}, __$blocks['title'](_$no)), _$cc(Icon, {
|
|
42
|
-
'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['ion-ios-arrow-right'] = true, _$cn2))
|
|
42
|
+
'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['ion-ios-arrow-right'] = true, _$cn2)),
|
|
43
|
+
'hoverable': !disabled
|
|
43
44
|
})], 0, _$cn(kls('title')), {
|
|
44
45
|
'ev-click': this.toggle
|
|
45
46
|
}), _$cc(Transition, _extends({
|
|
@@ -6,6 +6,10 @@ export var kls = function kls(className) {
|
|
|
6
6
|
return "k-collapse-" + className;
|
|
7
7
|
};
|
|
8
8
|
var defaults = {
|
|
9
|
+
get transition() {
|
|
10
|
+
return theme.transition.large;
|
|
11
|
+
},
|
|
12
|
+
|
|
9
13
|
fontSize: '12px',
|
|
10
14
|
titleMarginRight: '8px',
|
|
11
15
|
borderPadding: '0 24px',
|
|
@@ -27,5 +31,5 @@ export function makeStyles() {
|
|
|
27
31
|
}
|
|
28
32
|
export function makeItemStyles() {
|
|
29
33
|
var collapseItem = collapse.item;
|
|
30
|
-
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 ",
|
|
34
|
+
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, ";transform-origin:left center 0;}&: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;}}");
|
|
31
35
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
2
|
import { Sizes } from '../../styles/utils';
|
|
3
|
+
import { Container } from '../portal';
|
|
3
4
|
export interface ColorpickerProps {
|
|
4
5
|
value: string;
|
|
5
6
|
presets?: string[];
|
|
6
7
|
size?: Sizes;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
container?: Container;
|
|
8
10
|
}
|
|
9
11
|
export interface ColorpickerEvents {
|
|
10
12
|
}
|
|
@@ -18,7 +18,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
18
18
|
presets = _this$get.presets,
|
|
19
19
|
value = _this$get.value,
|
|
20
20
|
size = _this$get.size,
|
|
21
|
-
disabled = _this$get.disabled
|
|
21
|
+
disabled = _this$get.disabled,
|
|
22
|
+
container = _this$get.container;
|
|
22
23
|
|
|
23
24
|
var classNameObj = (_classNameObj = {
|
|
24
25
|
'k-colorpicker': true
|
|
@@ -33,6 +34,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
33
34
|
},
|
|
34
35
|
'trigger': 'click',
|
|
35
36
|
'disabled': disabled,
|
|
37
|
+
'container': container,
|
|
36
38
|
'children': [_$ce(2, 'div', _$ce(2, 'div', null, 1, 'k-colorpicker-inner', {
|
|
37
39
|
'style': {
|
|
38
40
|
backgroundColor: value
|
package/components/context.d.ts
CHANGED
|
@@ -2,10 +2,13 @@ import { Component, ComponentConstructor } from 'intact-vue-next';
|
|
|
2
2
|
export interface ProviderProps<T> {
|
|
3
3
|
value?: T;
|
|
4
4
|
}
|
|
5
|
+
export interface ConsumerProps<T> {
|
|
6
|
+
defaultValue?: T;
|
|
7
|
+
}
|
|
5
8
|
declare type ProviderConstructor<T> = ComponentConstructor<Component<ProviderProps<T>>>;
|
|
6
|
-
declare type ConsumerConstructor = ComponentConstructor<Component<
|
|
9
|
+
declare type ConsumerConstructor<T> = ComponentConstructor<Component<ConsumerProps<T>>>;
|
|
7
10
|
export declare function createContext<T = any>(defaultValue?: T): {
|
|
8
11
|
Provider: ProviderConstructor<T>;
|
|
9
|
-
Consumer: ConsumerConstructor
|
|
12
|
+
Consumer: ConsumerConstructor<T>;
|
|
10
13
|
};
|
|
11
14
|
export {};
|
package/components/context.js
CHANGED
|
@@ -53,14 +53,14 @@ export function createContext(defaultValue) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context2 = [this]).call(_context2, args)) || this;
|
|
56
|
-
_this2.ref = inject(injectionKey);
|
|
56
|
+
_this2.ref = inject(injectionKey, null);
|
|
57
57
|
return _this2;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return Consumer;
|
|
61
61
|
}(Component);
|
|
62
62
|
|
|
63
|
-
Consumer.template =
|
|
63
|
+
Consumer.template = consumerTemplate;
|
|
64
64
|
return {
|
|
65
65
|
Provider: Provider,
|
|
66
66
|
Consumer: Consumer
|
|
@@ -71,8 +71,11 @@ function providerTemplate() {
|
|
|
71
71
|
return this.$props.children;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function
|
|
75
|
-
|
|
74
|
+
function consumerTemplate() {
|
|
75
|
+
var ref = this.ref;
|
|
76
|
+
var props = this.$props;
|
|
77
|
+
var value = ref && ref.value || props && props.value;
|
|
78
|
+
return this.$props.children(value);
|
|
76
79
|
} // Maybe like legency context api of React
|
|
77
80
|
// Error: Can not use it in multiple instances.
|
|
78
81
|
// export function Context<T = any>(defaultValue?: T) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import dayjs, { Dayjs, OpUnitType } from 'dayjs';
|
|
2
2
|
import { StateValueItem } from './basepicker';
|
|
3
|
-
export declare function getNowDate(): dayjs.Dayjs;
|
|
3
|
+
export declare function getNowDate(isEnd?: boolean): dayjs.Dayjs;
|
|
4
4
|
export declare function clearTime(date: Date): void;
|
|
5
|
+
export declare function endTime(date: Date): void;
|
|
5
6
|
export declare function isEqual(a: Dayjs | undefined | null, b: Dayjs | undefined | null, type?: OpUnitType): boolean;
|
|
6
7
|
export declare function isLT(a: Dayjs | undefined | null, b: Dayjs | undefined | null, type?: OpUnitType): boolean;
|
|
7
8
|
export declare function isGT(a: Dayjs | undefined | null, b: Dayjs | undefined | null, type?: OpUnitType): boolean;
|
|
@@ -2,10 +2,10 @@ import _construct from "@babel/runtime-corejs3/helpers/construct";
|
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
3
3
|
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js/instance/find-index";
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
|
-
export function getNowDate() {
|
|
5
|
+
export function getNowDate(isEnd) {
|
|
6
6
|
// only date without time
|
|
7
7
|
var now = new Date();
|
|
8
|
-
clearTime(now);
|
|
8
|
+
isEnd ? endTime(now) : clearTime(now);
|
|
9
9
|
return dayjs(now);
|
|
10
10
|
}
|
|
11
11
|
export function clearTime(date) {
|
|
@@ -14,6 +14,12 @@ export function clearTime(date) {
|
|
|
14
14
|
date.setSeconds(0);
|
|
15
15
|
date.setMilliseconds(0);
|
|
16
16
|
}
|
|
17
|
+
export function endTime(date) {
|
|
18
|
+
date.setHours(23);
|
|
19
|
+
date.setMinutes(59);
|
|
20
|
+
date.setSeconds(59);
|
|
21
|
+
date.setMilliseconds(999);
|
|
22
|
+
}
|
|
17
23
|
export function isEqual(a, b, type) {
|
|
18
24
|
if (type === void 0) {
|
|
19
25
|
type = 'date';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, className as _$cn, createTextVNode as _$ct } from 'intact-vue-next';
|
|
2
3
|
import { linkEvent } from 'intact';
|
|
3
4
|
import { DropdownMenu } from '../dropdown';
|
|
4
5
|
import { DatepickerCalendar } from './calendar';
|
|
@@ -102,13 +103,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
102
103
|
__$blocks = _$ex({}, $blocks);
|
|
103
104
|
|
|
104
105
|
return (_$blocks['base-menu'] = function ($super) {
|
|
106
|
+
var _this2 = this;
|
|
107
|
+
|
|
105
108
|
return _$cc(DropdownMenu, {
|
|
106
109
|
'className': _$cn(classNameObj),
|
|
107
|
-
'children': [shortcuts && shortcuts.length ? _$ce(2, 'div',
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
'children': [shortcuts && shortcuts.length ? _$ce(2, 'div', _mapInstanceProperty(shortcuts).call(shortcuts, function ($value) {
|
|
111
|
+
var label = isFunction($value.label) ? $value.label() : $value.label;
|
|
112
|
+
return _$ce(2, 'div', label, 0, 'k-datepicker-shortcut c-ellipsis', {
|
|
113
|
+
'title': label,
|
|
114
|
+
'ev-click': linkEvent($value, _this2.setByShortcut)
|
|
110
115
|
});
|
|
111
|
-
}
|
|
116
|
+
}), 0, 'k-datepicker-shortcuts') : undefined, _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, 'k-datepicker-calendars'), type === 'datetime' ? _$ce(2, 'div', _$cc(Button, {
|
|
112
117
|
'type': 'primary',
|
|
113
118
|
'size': 'small',
|
|
114
119
|
'disabled': isDisabledConfirm(),
|
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
-
declare
|
|
2
|
+
declare const defaults: {
|
|
3
|
+
width: string;
|
|
4
|
+
padding: string;
|
|
5
|
+
border: string;
|
|
6
|
+
item: {
|
|
7
|
+
gutter: string;
|
|
8
|
+
height: string;
|
|
9
|
+
readonly hoverBgColor: string;
|
|
10
|
+
readonly exceedColor: string;
|
|
11
|
+
readonly todayBorder: string;
|
|
12
|
+
readonly borderRadius: string;
|
|
13
|
+
active: {
|
|
14
|
+
readonly bgColor: string;
|
|
15
|
+
color: string;
|
|
16
|
+
todayBorderColor: string;
|
|
17
|
+
};
|
|
18
|
+
disabled: {
|
|
19
|
+
color: string;
|
|
20
|
+
hoverBgColor: string;
|
|
21
|
+
};
|
|
22
|
+
range: {
|
|
23
|
+
readonly bgColor: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
weekday: {
|
|
27
|
+
padding: string;
|
|
28
|
+
};
|
|
29
|
+
month: {
|
|
30
|
+
padding: string;
|
|
31
|
+
fontSize: string;
|
|
32
|
+
valueGap: string;
|
|
33
|
+
};
|
|
34
|
+
footer: {
|
|
35
|
+
padding: string;
|
|
36
|
+
};
|
|
37
|
+
shortcuts: {
|
|
38
|
+
width: string;
|
|
39
|
+
padding: string;
|
|
40
|
+
shortcut: {
|
|
41
|
+
readonly hoverBgcolor: string;
|
|
42
|
+
height: string;
|
|
43
|
+
padding: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
declare let datepicker: typeof defaults;
|
|
3
48
|
export { datepicker };
|
|
4
49
|
export declare function makePanelStyles(): string;
|
|
5
50
|
export declare function makeCalendarStyles(): string;
|
|
@@ -26,10 +26,10 @@ var shapes = {
|
|
|
26
26
|
var components = {};
|
|
27
27
|
|
|
28
28
|
var _loop = function _loop(key) {
|
|
29
|
-
var _class
|
|
29
|
+
var _class;
|
|
30
30
|
|
|
31
31
|
var value = shapes[key];
|
|
32
|
-
components[key] = (
|
|
32
|
+
components[key] = (_class = /*#__PURE__*/function (_DShape) {
|
|
33
33
|
_inheritsLoose(_class, _DShape);
|
|
34
34
|
|
|
35
35
|
function _class() {
|
|
@@ -50,7 +50,7 @@ var _loop = function _loop(key) {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
return _class;
|
|
53
|
-
}(DShape), _class.displayName = "D" + key,
|
|
53
|
+
}(DShape), _class.displayName = "D" + key, _class);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
for (var key in shapes) {
|
|
@@ -6,10 +6,10 @@ export interface DLineProps extends DBaseProps {
|
|
|
6
6
|
endArrow?: Arrow;
|
|
7
7
|
startPoint?: Point;
|
|
8
8
|
endPoint?: Point;
|
|
9
|
-
exit?: Point;
|
|
10
|
-
entry?: Point;
|
|
11
9
|
from?: Key;
|
|
12
10
|
to?: Key;
|
|
11
|
+
exit?: Point;
|
|
12
|
+
entry?: Point;
|
|
13
13
|
}
|
|
14
14
|
declare type Arrow = 'none' | 'classic' | 'classicThin' | 'block' | 'blockThin' | 'open' | 'openThin' | 'oval' | 'diamond' | 'diamondThin';
|
|
15
15
|
declare type Point = [number, number];
|
|
@@ -12,7 +12,6 @@ var mxCell = mx.mxCell,
|
|
|
12
12
|
var arrows = ['none', 'classic', 'classicThin', 'block', 'blockThin', 'open', 'openThin', 'oval', 'diamond', 'diamondThin'];
|
|
13
13
|
|
|
14
14
|
var typeDefs = _extends({}, DBase.typeDefs, {
|
|
15
|
-
strokeStyle: ['solid', 'dashed', 'dotted'],
|
|
16
15
|
type: ['rounded', 'sharp', 'curved', 'straight'],
|
|
17
16
|
startArrow: arrows,
|
|
18
17
|
endArrow: arrows,
|
|
@@ -2,6 +2,7 @@ import { Component, TypeDefs } from 'intact-vue-next';
|
|
|
2
2
|
import { Sizes } from '../../styles/utils';
|
|
3
3
|
import { Container } from '../portal';
|
|
4
4
|
import { SHOW, HIDE } from './constants';
|
|
5
|
+
import { setHooks } from './useFixBody';
|
|
5
6
|
import type { Events } from '../types';
|
|
6
7
|
export interface BaseDialogProps {
|
|
7
8
|
title?: string;
|
|
@@ -42,6 +43,7 @@ export declare class BaseDialog<T extends BaseDialogProps = BaseDialogProps, E e
|
|
|
42
43
|
static typeDefs: Required<TypeDefs<BaseDialogProps>>;
|
|
43
44
|
static defaults: () => Partial<BaseDialogProps>;
|
|
44
45
|
static events: Events<BaseDialogEvents>;
|
|
46
|
+
static setHooks: typeof setHooks;
|
|
45
47
|
dialogRef: import("intact").RefObject<HTMLDivElement>;
|
|
46
48
|
private overlayRef;
|
|
47
49
|
private drag;
|
|
@@ -12,7 +12,7 @@ import { useMouseOutsidable } from '../../hooks/useMouseOutsidable';
|
|
|
12
12
|
import { useDraggable } from './useDraggable';
|
|
13
13
|
import { useEscClosable } from './useEscClosable';
|
|
14
14
|
import { SHOW, HIDE, DIALOG } from './constants';
|
|
15
|
-
import { useFixBody } from './useFixBody';
|
|
15
|
+
import { useFixBody, setHooks } from './useFixBody';
|
|
16
16
|
var typeDefs = {
|
|
17
17
|
title: String,
|
|
18
18
|
value: Boolean,
|
|
@@ -153,6 +153,7 @@ BaseDialog.template = template;
|
|
|
153
153
|
BaseDialog.typeDefs = typeDefs;
|
|
154
154
|
BaseDialog.defaults = defaults;
|
|
155
155
|
BaseDialog.events = events;
|
|
156
|
+
BaseDialog.setHooks = setHooks;
|
|
156
157
|
|
|
157
158
|
__decorate([bind], BaseDialog.prototype, "terminate", null);
|
|
158
159
|
|