@king-design/intact 3.1.4 → 3.1.5
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/components/cascader/index.spec.ts +49 -0
- package/components/cascader/useValue.ts +1 -1
- package/components/dropdown/menu.ts +3 -1
- package/components/dropdown/usePosition.ts +14 -2
- package/components/select/useFocusout.ts +1 -1
- package/components/table/demos/pagination.md +3 -0
- package/es/components/cascader/index.spec.js +67 -4
- package/es/components/cascader/useValue.js +1 -1
- package/es/components/diagram/index.d.ts +1 -1
- package/es/components/dropdown/menu.js +2 -0
- package/es/components/dropdown/usePosition.d.ts +1 -0
- package/es/components/dropdown/usePosition.js +12 -1
- package/es/components/select/useFocusout.d.ts +1 -1
- package/es/components/select/useFocusout.js +1 -1
- package/es/components/steps/context.d.ts +3 -3
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/menu/demos/collapse/react.d.ts +1 -1
- package/es/site/data/components/menu/demos/size/react.d.ts +1 -1
- package/index.ts +2 -2
- package/package.json +3 -4
- package/es/components/cascader/index.d.ts +0 -45
- package/es/components/datepicker/index.d.ts +0 -63
- package/es/components/select/select.d.ts +0 -33
- package/es/components/timepicker/panelPicker.d.ts +0 -54
- package/es/components/treeSelect/index.d.ts +0 -28
|
@@ -135,6 +135,14 @@ describe('Cascader', () => {
|
|
|
135
135
|
dropdown1.querySelector<HTMLElement>('.k-dropdown-item')!.click();
|
|
136
136
|
await wait();
|
|
137
137
|
expect(instance.get('value')).to.eql(['hunan', 'yueyang', 'yueyanglou']);
|
|
138
|
+
|
|
139
|
+
// show again to test the position
|
|
140
|
+
input.click();
|
|
141
|
+
await wait();
|
|
142
|
+
const [_dropdown1, _dropdown2, _dropdown3] = getElements('.k-cascader-menu')!;
|
|
143
|
+
expect(_dropdown1.style.top).not.eql('0px');
|
|
144
|
+
expect(_dropdown2.style.top).not.eql('0px');
|
|
145
|
+
expect(_dropdown3.style.top).not.eql('0px');
|
|
138
146
|
});
|
|
139
147
|
|
|
140
148
|
it('no data for init data', async () => {
|
|
@@ -261,4 +269,45 @@ describe('Cascader', () => {
|
|
|
261
269
|
expect(element.innerHTML).to.matchSnapshot();
|
|
262
270
|
expect(instance.get('value')).to.eql(['beijing', 'haidian']);
|
|
263
271
|
});
|
|
272
|
+
|
|
273
|
+
it('should select correct value', async () => {
|
|
274
|
+
class Demo extends Component {
|
|
275
|
+
static template = `
|
|
276
|
+
const {Cascader} = this;
|
|
277
|
+
<Cascader data={this.get('data')} v-model="value" />
|
|
278
|
+
`;
|
|
279
|
+
static defaults() {
|
|
280
|
+
return {
|
|
281
|
+
value: ['beijing', 'haidian'],
|
|
282
|
+
data: [
|
|
283
|
+
{
|
|
284
|
+
value: 'beijing',
|
|
285
|
+
label: '北京',
|
|
286
|
+
children: [
|
|
287
|
+
{
|
|
288
|
+
value: 'haidian',
|
|
289
|
+
label: '海淀区'
|
|
290
|
+
},
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
value: 'hunan',
|
|
295
|
+
label: '湖南',
|
|
296
|
+
},
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
private Cascader = Cascader;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
const [instance, element] = mount(Demo);
|
|
304
|
+
dispatchEvent(element, 'click');
|
|
305
|
+
await wait();
|
|
306
|
+
|
|
307
|
+
const [dropdown1, dropdown2] = getElements('.k-cascader-menu');
|
|
308
|
+
const [item1, item2] = dropdown1.querySelectorAll(':scope > .k-dropdown-item');
|
|
309
|
+
dispatchEvent(item2, 'click');
|
|
310
|
+
await wait();
|
|
311
|
+
expect(instance.get('value')).to.eql(['hunan']);
|
|
312
|
+
});
|
|
264
313
|
});
|
|
@@ -80,7 +80,7 @@ export function useValue() {
|
|
|
80
80
|
// maybe the showedValue has the leaf value when we set it on show menu,
|
|
81
81
|
// if we select by clicking, the showedValue has not the leaf value,
|
|
82
82
|
// no matter which case, we set the last value by level
|
|
83
|
-
const newValue = showedValue.value.slice(0);
|
|
83
|
+
const newValue = showedValue.value.slice(0, level);
|
|
84
84
|
newValue[level] = value;
|
|
85
85
|
setValue(newValue);
|
|
86
86
|
}
|
|
@@ -7,6 +7,7 @@ import {useMenuKeyboard} from './useKeyboard';
|
|
|
7
7
|
import {useMouseOutsidable} from '../../hooks/useMouseOutsidable';
|
|
8
8
|
import {FeedbackCallback} from './usePosition';
|
|
9
9
|
import { useConfigContext } from '../config';
|
|
10
|
+
import { usePositionForDropdownMenu } from './usePosition';
|
|
10
11
|
|
|
11
12
|
export interface DropdownMenuProps { }
|
|
12
13
|
export interface DropdownMenuEvents { }
|
|
@@ -31,6 +32,7 @@ export class DropdownMenu<
|
|
|
31
32
|
init() {
|
|
32
33
|
provide(DROPDOWN_MENU, this);
|
|
33
34
|
useMouseOutsidable(this.elementRef);
|
|
35
|
+
usePositionForDropdownMenu();
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
// no matter what the trigger is, we should show menu when enter into it.
|
|
@@ -80,4 +82,4 @@ function useKeyboardForDropdownMenu(dropdown: Dropdown) {
|
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
return {lock};
|
|
83
|
-
}
|
|
85
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {useInstance, findDomFromVNode} from 'intact';
|
|
2
|
-
import type {Dropdown} from './';
|
|
1
|
+
import {useInstance, findDomFromVNode, onBeforeUnmount} from 'intact';
|
|
2
|
+
import type {Dropdown, DropdownMenu} from './';
|
|
3
3
|
import {Options, position, Feedback} from '../position';
|
|
4
4
|
import {noop, isObject, isFunction} from 'intact-shared';
|
|
5
5
|
import { isEqualObject } from '../utils';
|
|
@@ -114,3 +114,15 @@ export function usePosition() {
|
|
|
114
114
|
|
|
115
115
|
return {handle, positioned};
|
|
116
116
|
}
|
|
117
|
+
|
|
118
|
+
export function usePositionForDropdownMenu() {
|
|
119
|
+
const instance = useInstance() as DropdownMenu;
|
|
120
|
+
/**
|
|
121
|
+
* Meybe the DropdownMenu has changed by specified key
|
|
122
|
+
* so, we must reset the positioned.value beforeUnmount
|
|
123
|
+
* #956
|
|
124
|
+
*/
|
|
125
|
+
onBeforeUnmount(() => {
|
|
126
|
+
instance.dropdown.positionHook.positioned.value = false;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
@@ -3,7 +3,7 @@ import {BaseSelect} from './base';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* don't trigger focusout event when layer is showing,
|
|
6
|
-
* only trigger focusout when it hidden to make FormItem to validate it
|
|
6
|
+
* only trigger focusout when it is hidden to make FormItem to validate it
|
|
7
7
|
* #449
|
|
8
8
|
*/
|
|
9
9
|
export function useFocusout() {
|
|
@@ -9,6 +9,9 @@ order: 30
|
|
|
9
9
|
> 需要给Table设置rowKey属性,否则选择的行翻页后依然会保留选中状态,因为不设置key,则使用索引当key,
|
|
10
10
|
> 只要当前选中的索引在下一页存在,则会依然选中
|
|
11
11
|
|
|
12
|
+
> 该功能需要将所有数据一次性传给Table,Table自动做分页处理,对于每次分页单独请求新数据的情况,请不要使用该功能,
|
|
13
|
+
> 而是配合单独的Pagination组件处理
|
|
14
|
+
|
|
12
15
|
```vdt
|
|
13
16
|
import {Table, TableColumn, Switch} from 'kpc';
|
|
14
17
|
|
|
@@ -160,7 +160,7 @@ describe('Cascader', function () {
|
|
|
160
160
|
}, _callee5);
|
|
161
161
|
})));
|
|
162
162
|
it('filter', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
163
|
-
var _mount5, instance, element, input, dropdown, dropdown1;
|
|
163
|
+
var _mount5, instance, element, input, dropdown, dropdown1, _getElements2, _dropdown1, _dropdown2, _dropdown3;
|
|
164
164
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
165
165
|
while (1) switch (_context6.prev = _context6.next) {
|
|
166
166
|
case 0:
|
|
@@ -207,7 +207,16 @@ describe('Cascader', function () {
|
|
|
207
207
|
return wait();
|
|
208
208
|
case 34:
|
|
209
209
|
expect(instance.get('value')).to.eql(['hunan', 'yueyang', 'yueyanglou']);
|
|
210
|
-
|
|
210
|
+
// show again to test the position
|
|
211
|
+
input.click();
|
|
212
|
+
_context6.next = 38;
|
|
213
|
+
return wait();
|
|
214
|
+
case 38:
|
|
215
|
+
_getElements2 = getElements('.k-cascader-menu'), _dropdown1 = _getElements2[0], _dropdown2 = _getElements2[1], _dropdown3 = _getElements2[2];
|
|
216
|
+
expect(_dropdown1.style.top).not.eql('0px');
|
|
217
|
+
expect(_dropdown2.style.top).not.eql('0px');
|
|
218
|
+
expect(_dropdown3.style.top).not.eql('0px');
|
|
219
|
+
case 42:
|
|
211
220
|
case "end":
|
|
212
221
|
return _context6.stop();
|
|
213
222
|
}
|
|
@@ -234,7 +243,7 @@ describe('Cascader', function () {
|
|
|
234
243
|
}, _callee7);
|
|
235
244
|
})));
|
|
236
245
|
it('duplicated sub data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
237
|
-
var Demo, _mount7, instance, element,
|
|
246
|
+
var Demo, _mount7, instance, element, _getElements3, dropdown1, dropdown2, _dropdown1$querySelec4, item1, item2, _dropdown2$querySelec3, item21, dropdown3, _dropdown3$querySelec2, item31;
|
|
238
247
|
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
239
248
|
while (1) switch (_context9.prev = _context9.next) {
|
|
240
249
|
case 0:
|
|
@@ -278,7 +287,7 @@ describe('Cascader', function () {
|
|
|
278
287
|
_context9.next = 6;
|
|
279
288
|
return wait();
|
|
280
289
|
case 6:
|
|
281
|
-
|
|
290
|
+
_getElements3 = getElements('.k-cascader-menu'), dropdown1 = _getElements3[0], dropdown2 = _getElements3[1];
|
|
282
291
|
_dropdown1$querySelec4 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec4[0], item2 = _dropdown1$querySelec4[1];
|
|
283
292
|
expect(item1.classList.contains('k-selected')).to.be.true;
|
|
284
293
|
expect(item2.classList.contains('k-selected')).to.be.false;
|
|
@@ -370,4 +379,58 @@ describe('Cascader', function () {
|
|
|
370
379
|
}
|
|
371
380
|
}, _callee9);
|
|
372
381
|
})));
|
|
382
|
+
it('should select correct value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
383
|
+
var Demo, _mount9, instance, element, _getElements4, dropdown1, dropdown2, _dropdown1$querySelec6, item1, item2;
|
|
384
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context13) {
|
|
385
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
386
|
+
case 0:
|
|
387
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
388
|
+
_inheritsLoose(Demo, _Component3);
|
|
389
|
+
function Demo() {
|
|
390
|
+
var _context12;
|
|
391
|
+
var _this3;
|
|
392
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
393
|
+
args[_key3] = arguments[_key3];
|
|
394
|
+
}
|
|
395
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context12 = [this]).call(_context12, args)) || this;
|
|
396
|
+
_this3.Cascader = Cascader;
|
|
397
|
+
return _this3;
|
|
398
|
+
}
|
|
399
|
+
Demo.defaults = function defaults() {
|
|
400
|
+
return {
|
|
401
|
+
value: ['beijing', 'haidian'],
|
|
402
|
+
data: [{
|
|
403
|
+
value: 'beijing',
|
|
404
|
+
label: '北京',
|
|
405
|
+
children: [{
|
|
406
|
+
value: 'haidian',
|
|
407
|
+
label: '海淀区'
|
|
408
|
+
}]
|
|
409
|
+
}, {
|
|
410
|
+
value: 'hunan',
|
|
411
|
+
label: '湖南'
|
|
412
|
+
}]
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
return Demo;
|
|
416
|
+
}(Component);
|
|
417
|
+
Demo.template = "\n const {Cascader} = this;\n <Cascader data={this.get('data')} v-model=\"value\" />\n ";
|
|
418
|
+
_mount9 = mount(Demo), instance = _mount9[0], element = _mount9[1];
|
|
419
|
+
dispatchEvent(element, 'click');
|
|
420
|
+
_context13.next = 6;
|
|
421
|
+
return wait();
|
|
422
|
+
case 6:
|
|
423
|
+
_getElements4 = getElements('.k-cascader-menu'), dropdown1 = _getElements4[0], dropdown2 = _getElements4[1];
|
|
424
|
+
_dropdown1$querySelec6 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec6[0], item2 = _dropdown1$querySelec6[1];
|
|
425
|
+
dispatchEvent(item2, 'click');
|
|
426
|
+
_context13.next = 11;
|
|
427
|
+
return wait();
|
|
428
|
+
case 11:
|
|
429
|
+
expect(instance.get('value')).to.eql(['hunan']);
|
|
430
|
+
case 12:
|
|
431
|
+
case "end":
|
|
432
|
+
return _context13.stop();
|
|
433
|
+
}
|
|
434
|
+
}, _callee10);
|
|
435
|
+
})));
|
|
373
436
|
});
|
|
@@ -74,7 +74,7 @@ export function useValue() {
|
|
|
74
74
|
// maybe the showedValue has the leaf value when we set it on show menu,
|
|
75
75
|
// if we select by clicking, the showedValue has not the leaf value,
|
|
76
76
|
// no matter which case, we set the last value by level
|
|
77
|
-
var newValue = _sliceInstanceProperty(_context4 = showedValue.value).call(_context4, 0);
|
|
77
|
+
var newValue = _sliceInstanceProperty(_context4 = showedValue.value).call(_context4, 0, level);
|
|
78
78
|
newValue[level] = value;
|
|
79
79
|
setValue(newValue);
|
|
80
80
|
}
|
|
@@ -10,7 +10,7 @@ export * from './shapes/rectangle';
|
|
|
10
10
|
export * from './shapes/square';
|
|
11
11
|
export * from './shapes/text';
|
|
12
12
|
export * from './shapes/line';
|
|
13
|
-
declare const DDiamond: import("
|
|
13
|
+
declare const DDiamond: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DTriangle: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCylinder: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>, DCloud: import("vdt").ComponentConstructor<import("./shapes/shape").DShape<import("./shapes/shape").DShapeProps>>;
|
|
14
14
|
export { DDiamond, DTriangle, DCylinder, DCloud };
|
|
15
15
|
export * from './layouts/layout';
|
|
16
16
|
export * from './layouts/circle';
|
|
@@ -9,6 +9,7 @@ import { useTransition } from './useTransition';
|
|
|
9
9
|
import { useMenuKeyboard } from './useKeyboard';
|
|
10
10
|
import { useMouseOutsidable } from '../../hooks/useMouseOutsidable';
|
|
11
11
|
import { useConfigContext } from '../config';
|
|
12
|
+
import { usePositionForDropdownMenu } from './usePosition';
|
|
12
13
|
export var DROPDOWN_MENU = 'DropdownMenu';
|
|
13
14
|
export var DropdownMenu = /*#__PURE__*/function (_Component) {
|
|
14
15
|
_inheritsLoose(DropdownMenu, _Component);
|
|
@@ -32,6 +33,7 @@ export var DropdownMenu = /*#__PURE__*/function (_Component) {
|
|
|
32
33
|
_proto.init = function init() {
|
|
33
34
|
provide(DROPDOWN_MENU, this);
|
|
34
35
|
useMouseOutsidable(this.elementRef);
|
|
36
|
+
usePositionForDropdownMenu();
|
|
35
37
|
}
|
|
36
38
|
// no matter what the trigger is, we should show menu when enter into it.
|
|
37
39
|
;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
-
import { useInstance, findDomFromVNode } from 'intact';
|
|
2
|
+
import { useInstance, findDomFromVNode, onBeforeUnmount } from 'intact';
|
|
3
3
|
import { position } from '../position';
|
|
4
4
|
import { noop, isObject, isFunction } from 'intact-shared';
|
|
5
5
|
import { isEqualObject } from '../utils';
|
|
@@ -112,4 +112,15 @@ export function usePosition() {
|
|
|
112
112
|
handle: handle,
|
|
113
113
|
positioned: positioned
|
|
114
114
|
};
|
|
115
|
+
}
|
|
116
|
+
export function usePositionForDropdownMenu() {
|
|
117
|
+
var instance = useInstance();
|
|
118
|
+
/**
|
|
119
|
+
* Meybe the DropdownMenu has changed by specified key
|
|
120
|
+
* so, we must reset the positioned.value beforeUnmount
|
|
121
|
+
* #956
|
|
122
|
+
*/
|
|
123
|
+
onBeforeUnmount(function () {
|
|
124
|
+
instance.dropdown.positionHook.positioned.value = false;
|
|
125
|
+
});
|
|
115
126
|
}
|
|
@@ -2,7 +2,7 @@ import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
|
2
2
|
import { useInstance, createRef } from 'intact';
|
|
3
3
|
/**
|
|
4
4
|
* don't trigger focusout event when layer is showing,
|
|
5
|
-
* only trigger focusout when it hidden to make FormItem to validate it
|
|
5
|
+
* only trigger focusout when it is hidden to make FormItem to validate it
|
|
6
6
|
* #449
|
|
7
7
|
*/
|
|
8
8
|
export function useFocusout() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const context: {
|
|
2
|
-
Provider: import("
|
|
3
|
-
Consumer: import("
|
|
4
|
-
useContext: () => import("
|
|
2
|
+
Provider: import("vdt").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
3
|
+
Consumer: import("vdt").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
4
|
+
useContext: () => import("vdt").RefObject<any>;
|
|
5
5
|
};
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -60,4 +60,4 @@ export * from './components/tree';
|
|
|
60
60
|
export * from './components/treeSelect';
|
|
61
61
|
export * from './components/upload';
|
|
62
62
|
export * from './components/wave';
|
|
63
|
-
export declare const version = "3.1.
|
|
63
|
+
export declare const version = "3.1.5";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -61,5 +61,5 @@ export * from './components/tree';
|
|
|
61
61
|
export * from './components/treeSelect';
|
|
62
62
|
export * from './components/upload';
|
|
63
63
|
export * from './components/wave';
|
|
64
|
-
export var version = '3.1.
|
|
64
|
+
export var version = '3.1.5';
|
|
65
65
|
/* generate end */
|
|
@@ -3,7 +3,7 @@ import { MenuProps } from '@king-design/react';
|
|
|
3
3
|
interface Props extends MenuProps {
|
|
4
4
|
}
|
|
5
5
|
export default class Demo extends React.Component<{}, Props> {
|
|
6
|
-
state: MenuProps<import("
|
|
6
|
+
state: MenuProps<import("vdt").Key>;
|
|
7
7
|
private __test;
|
|
8
8
|
setTheme(theme?: string): void;
|
|
9
9
|
render(): React.JSX.Element;
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import './index.styl';
|
|
3
3
|
import type { MenuProps } from '@king-design/react';
|
|
4
4
|
export default class Demo extends React.Component {
|
|
5
|
-
state: MenuProps<import("
|
|
5
|
+
state: MenuProps<import("vdt").Key>;
|
|
6
6
|
render(): React.JSX.Element;
|
|
7
7
|
}
|
package/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v3.1.
|
|
2
|
+
* @king-design v3.1.5
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -65,6 +65,6 @@ export * from './components/treeSelect';
|
|
|
65
65
|
export * from './components/upload';
|
|
66
66
|
export * from './components/wave';
|
|
67
67
|
|
|
68
|
-
export const version = '3.1.
|
|
68
|
+
export const version = '3.1.5';
|
|
69
69
|
|
|
70
70
|
/* generate end */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/intact",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "A component library written in Intact for Intact, Vue, React and Angular",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
"highlight.js": "^10.4.1",
|
|
121
121
|
"history": "^5.0.0",
|
|
122
122
|
"html-webpack-plugin": "5.3.1",
|
|
123
|
-
"intact-react": "^3.0.26",
|
|
124
123
|
"istanbul-instrumenter-loader": "^3.0.0",
|
|
125
124
|
"js-yaml": "^4.1.0",
|
|
126
125
|
"karma": "^6.3.2",
|
|
@@ -179,10 +178,10 @@
|
|
|
179
178
|
"dependencies": {
|
|
180
179
|
"@babel/runtime-corejs3": "^7.16.0",
|
|
181
180
|
"@emotion/css": "^11.5.0",
|
|
182
|
-
"@king-design/react": "^3.1.
|
|
181
|
+
"@king-design/react": "^3.1.5",
|
|
183
182
|
"dayjs": "^1.10.7",
|
|
184
183
|
"enquire.js": "^2.1.6",
|
|
185
|
-
"intact": "^3.0.
|
|
184
|
+
"intact": "^3.0.28",
|
|
186
185
|
"monaco-editor": "^0.26.1",
|
|
187
186
|
"mxgraphx": "^4.0.7",
|
|
188
187
|
"resize-observer-polyfill": "^1.5.1",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { TypeDefs } from 'intact';
|
|
2
|
-
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
3
|
-
export interface CascaderProps<V = any, Multipe extends boolean = boolean, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelectProps<V[], Multipe> {
|
|
4
|
-
data?: Data[];
|
|
5
|
-
trigger?: 'click' | 'hover';
|
|
6
|
-
changeOnSelect?: boolean;
|
|
7
|
-
format?: (labels: string[]) => string;
|
|
8
|
-
loadData?: (data: Data) => any;
|
|
9
|
-
filter?: (keywords: string, data: Data) => boolean;
|
|
10
|
-
fields?: CascaderFields<Data>;
|
|
11
|
-
}
|
|
12
|
-
export type CascaderFields<Data> = {
|
|
13
|
-
value?: keyof Data;
|
|
14
|
-
label?: keyof Data;
|
|
15
|
-
children?: keyof Data;
|
|
16
|
-
disabled?: keyof Data;
|
|
17
|
-
};
|
|
18
|
-
export interface BaseCascaderData {
|
|
19
|
-
loaded?: boolean;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
22
|
-
export interface CascaderData<V> extends BaseCascaderData {
|
|
23
|
-
value: V;
|
|
24
|
-
label: string;
|
|
25
|
-
children?: CascaderData<V>[];
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface CascaderEvents extends BaseSelectEvents {
|
|
29
|
-
}
|
|
30
|
-
export interface CascaderBlocks<V> extends BaseSelectBlocks<V> {
|
|
31
|
-
}
|
|
32
|
-
export declare class Cascader<V = any, Multipe extends boolean = false, Data extends BaseCascaderData = CascaderData<V>> extends BaseSelect<CascaderProps<V, Multipe, Data>, CascaderEvents, CascaderBlocks<V>> {
|
|
33
|
-
static template: string | import("intact").Template<any>;
|
|
34
|
-
static typeDefs: Required<TypeDefs<CascaderProps<any, boolean, CascaderData<any>>>>;
|
|
35
|
-
static defaults: () => Partial<CascaderProps<any, boolean, CascaderData<any>>>;
|
|
36
|
-
private fields;
|
|
37
|
-
private value;
|
|
38
|
-
private label;
|
|
39
|
-
private load;
|
|
40
|
-
private filterable;
|
|
41
|
-
private positionObj;
|
|
42
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
43
|
-
protected getLabel(): import("intact").Children;
|
|
44
|
-
protected hasValue(): any;
|
|
45
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { TypeDefs } from 'intact';
|
|
2
|
-
import dayjs from './dayjs';
|
|
3
|
-
import { State } from '../../hooks/useState';
|
|
4
|
-
import { Shortcut } from './shortcuts';
|
|
5
|
-
import { BasePicker, BasePickerProps, BasePickerEvents, BasePickerBlocks, Value } from './basepicker';
|
|
6
|
-
export * as shortcuts from './shortcuts';
|
|
7
|
-
export interface DatepickerProps<V extends Value = Value, M extends boolean = boolean, R extends boolean = boolean> extends BasePickerProps<V extends string ? V : V | string, M, R> {
|
|
8
|
-
type?: 'date' | 'datetime' | 'year' | 'month';
|
|
9
|
-
shortcuts?: Shortcut[];
|
|
10
|
-
}
|
|
11
|
-
export interface DatepickerEvents extends BasePickerEvents {
|
|
12
|
-
}
|
|
13
|
-
export interface DatepickerBlocks<V extends Value = Value, R extends boolean = boolean> extends BasePickerBlocks<V, R> {
|
|
14
|
-
}
|
|
15
|
-
export declare class Datepicker<V extends Value = Value, M extends boolean = false, R extends boolean = false> extends BasePicker<DatepickerProps<V, M, R>, DatepickerEvents, DatepickerBlocks<V, R>> {
|
|
16
|
-
static template: string | import("intact").Template<any>;
|
|
17
|
-
static typeDefs: Required<TypeDefs<DatepickerProps<Value, boolean, boolean>>>;
|
|
18
|
-
static defaults: () => Partial<DatepickerProps<Value, boolean, boolean>>;
|
|
19
|
-
formats: {
|
|
20
|
-
getValueFormat: () => string;
|
|
21
|
-
getShowFormat: () => string;
|
|
22
|
-
createDateByValueFormat: (value: Value) => dayjs.Dayjs;
|
|
23
|
-
createDateByShowFormat: (value: string) => dayjs.Dayjs;
|
|
24
|
-
getShowString: (value: dayjs.Dayjs) => string;
|
|
25
|
-
getValueString: (value: dayjs.Dayjs) => string;
|
|
26
|
-
};
|
|
27
|
-
disabled: {
|
|
28
|
-
isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
|
|
29
|
-
isDisabledTime: (value: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => boolean;
|
|
30
|
-
isDisabledConfirm: () => boolean;
|
|
31
|
-
maxDate: State<dayjs.Dayjs | null>;
|
|
32
|
-
minDate: State<dayjs.Dayjs | null>;
|
|
33
|
-
};
|
|
34
|
-
panel: {
|
|
35
|
-
startPanel: State<import("./usePanel").PanelTypes>;
|
|
36
|
-
endPanel: State<import("./usePanel").PanelTypes>;
|
|
37
|
-
changePanel: (type: import("./usePanel").PanelTypes, flag?: import("./usePanel").PanelFlags) => void;
|
|
38
|
-
getPanel: (flag: import("./usePanel").PanelFlags) => State<import("./usePanel").PanelTypes>;
|
|
39
|
-
reset: () => void;
|
|
40
|
-
startRef: import("intact").RefObject<import("./calendar").DatepickerCalendar>;
|
|
41
|
-
endRef: import("intact").RefObject<import("./calendar").DatepickerCalendar>;
|
|
42
|
-
};
|
|
43
|
-
focusDate: {
|
|
44
|
-
focusDate: State<dayjs.Dayjs | null>;
|
|
45
|
-
reset: () => void;
|
|
46
|
-
};
|
|
47
|
-
value: {
|
|
48
|
-
format: () => string | string[];
|
|
49
|
-
onConfirm: () => void;
|
|
50
|
-
onChangeTime: (date: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
|
|
51
|
-
getTimeValue: (flag: import("./usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
52
|
-
convertToDayjs: (v: Value | [Value, Value] | Value[] | [Value, Value][] | null | undefined) => import("./basepicker").DayjsValue;
|
|
53
|
-
getDayjsValue: () => import("./basepicker").DayjsValue;
|
|
54
|
-
value: State<import("./basepicker").StateValue>;
|
|
55
|
-
setValue: (v: import("./basepicker").StateValueItem, fromInput: boolean) => void;
|
|
56
|
-
onChangeDate: (v: dayjs.Dayjs, flag: import("./usePanel").PanelFlags) => void;
|
|
57
|
-
};
|
|
58
|
-
init(): void;
|
|
59
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
60
|
-
protected getLabel(): string | string[];
|
|
61
|
-
protected clear(e: MouseEvent): void;
|
|
62
|
-
private setByShortcut;
|
|
63
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Children, TypeDefs } from 'intact';
|
|
2
|
-
import { Option } from './option';
|
|
3
|
-
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from './base';
|
|
4
|
-
export interface SelectProps<T = string, Multipe extends boolean = boolean> extends BaseSelectProps<T, Multipe> {
|
|
5
|
-
filter?: (keywords: string, props: any) => boolean;
|
|
6
|
-
searchable?: boolean;
|
|
7
|
-
creatable?: boolean;
|
|
8
|
-
labelMap?: Map<any, Children>;
|
|
9
|
-
card?: boolean;
|
|
10
|
-
autoDisableArrow?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface SelectEvents extends BaseSelectEvents {
|
|
13
|
-
}
|
|
14
|
-
export interface SelectBlocks<T> extends BaseSelectBlocks<T> {
|
|
15
|
-
menu: null;
|
|
16
|
-
}
|
|
17
|
-
export declare class Select<T = string, Multipe extends boolean = false> extends BaseSelect<SelectProps<T, Multipe>, SelectEvents, SelectBlocks<T>> {
|
|
18
|
-
static template: string | import("intact").Template<any>;
|
|
19
|
-
static typeDefs: Required<TypeDefs<SelectProps<string, boolean>>>;
|
|
20
|
-
static defaults: () => Partial<SelectProps<string, boolean>>;
|
|
21
|
-
filterable: {
|
|
22
|
-
getCreatedVNode: (children: (string | number | import("intact").VNode<import("intact").VNodeTag>)[]) => import("intact").VNode<typeof Option> | undefined;
|
|
23
|
-
filter: (children: Children) => Children;
|
|
24
|
-
};
|
|
25
|
-
label: {
|
|
26
|
-
getLabel: () => Children;
|
|
27
|
-
activeIndices: import("intact").NonNullableRefObject<number[]>;
|
|
28
|
-
};
|
|
29
|
-
init(): void;
|
|
30
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
|
|
31
|
-
protected getLabel(): Children;
|
|
32
|
-
private getAllShowedValues;
|
|
33
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { TypeDefs } from 'intact';
|
|
2
|
-
import { BasePicker } from '../datepicker/basepicker';
|
|
3
|
-
import dayjs from '../datepicker/dayjs';
|
|
4
|
-
import { State } from '../../hooks/useState';
|
|
5
|
-
import { PanelTypes } from '../datepicker/usePanel';
|
|
6
|
-
import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
|
|
7
|
-
export declare class PanelPicker<Multipe extends boolean = false, Range extends boolean = false> extends BasePicker<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks> {
|
|
8
|
-
static template: string | import("intact").Template<any>;
|
|
9
|
-
static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
|
|
10
|
-
formats: {
|
|
11
|
-
getValueFormat: () => string;
|
|
12
|
-
getShowFormat: () => string;
|
|
13
|
-
createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
14
|
-
createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
15
|
-
getShowString: (value: dayjs.Dayjs) => string;
|
|
16
|
-
getValueString: (value: dayjs.Dayjs) => string;
|
|
17
|
-
};
|
|
18
|
-
disabled: {
|
|
19
|
-
isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
|
|
20
|
-
isDisabledConfirm: () => boolean;
|
|
21
|
-
maxDate: State<dayjs.Dayjs | null>;
|
|
22
|
-
minDate: State<dayjs.Dayjs | null>;
|
|
23
|
-
isDisabledTime: (value: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
24
|
-
isDisabledTimeByStep: (value: string, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
25
|
-
};
|
|
26
|
-
panel: {
|
|
27
|
-
startPanel: State<PanelTypes>;
|
|
28
|
-
endPanel: State<PanelTypes>;
|
|
29
|
-
changePanel: (type: PanelTypes, flag?: import("../datepicker/usePanel").PanelFlags) => void;
|
|
30
|
-
getPanel: (flag: import("../datepicker/usePanel").PanelFlags) => State<PanelTypes>;
|
|
31
|
-
reset: () => void;
|
|
32
|
-
startRef: import("intact").RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
33
|
-
endRef: import("intact").RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
34
|
-
};
|
|
35
|
-
value: {
|
|
36
|
-
format: () => string | string[];
|
|
37
|
-
onConfirm: () => void;
|
|
38
|
-
getTimeValue: (flag: import("../datepicker/usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
39
|
-
convertToDayjs: (v: import("../datepicker/basepicker").Value | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value] | import("../datepicker/basepicker").Value[] | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value][] | null | undefined) => import("../datepicker/basepicker").DayjsValue;
|
|
40
|
-
value: State<import("../datepicker/basepicker").StateValue>;
|
|
41
|
-
setValue: (v: import("../datepicker/basepicker").StateValueItem, fromInput: boolean) => void;
|
|
42
|
-
getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
|
|
43
|
-
onChangeTime: (date: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
44
|
-
onChangeTimeByStep: (v: string, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
45
|
-
};
|
|
46
|
-
step: {
|
|
47
|
-
options: State<{
|
|
48
|
-
value: string;
|
|
49
|
-
label: string;
|
|
50
|
-
}[] | null>;
|
|
51
|
-
};
|
|
52
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
53
|
-
protected getLabel(): string | string[];
|
|
54
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TypeDefs, Children, Key } from 'intact';
|
|
2
|
-
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
3
|
-
import { TreeProps } from '../tree';
|
|
4
|
-
import type { DataItem } from '../tree/useNodes';
|
|
5
|
-
export interface TreeSelectProps<K extends Key = Key, Multipe extends boolean = boolean, Checkbox extends boolean = boolean> extends BaseSelectProps<K, Multipe, Checkbox extends true ? K[] : K | null> {
|
|
6
|
-
data?: TreeProps<K>['data'];
|
|
7
|
-
uncorrelated?: boolean;
|
|
8
|
-
load?: TreeProps<K>['load'];
|
|
9
|
-
showLine?: boolean;
|
|
10
|
-
defaultExpandAll?: boolean;
|
|
11
|
-
checkbox?: Checkbox;
|
|
12
|
-
filter?: (keywords: string, data: DataItem<K>) => boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface TreeSelectEvents extends BaseSelectEvents {
|
|
15
|
-
}
|
|
16
|
-
export interface TreeSelectBlocks<K> extends BaseSelectBlocks<K> {
|
|
17
|
-
}
|
|
18
|
-
export declare class TreeSelect<K extends Key = Key, Checkbox extends boolean = false, Multipe extends boolean = Checkbox extends true ? true : false> extends BaseSelect<TreeSelectProps<K, Multipe, Checkbox>, TreeSelectEvents, TreeSelectBlocks<K>> {
|
|
19
|
-
static template: string | import("intact").Template<any>;
|
|
20
|
-
static typeDefs: Required<TypeDefs<TreeSelectProps<Key, boolean, boolean>>>;
|
|
21
|
-
static defaults: () => Partial<TreeSelectProps<Key, boolean, boolean>>;
|
|
22
|
-
private value;
|
|
23
|
-
init(): void;
|
|
24
|
-
expandAll(): void;
|
|
25
|
-
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | Children[];
|
|
26
|
-
protected getLabel(): Children;
|
|
27
|
-
private filter;
|
|
28
|
-
}
|