@king-design/intact 2.1.1 → 2.1.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/components/dropdown/dropdown.ts +1 -0
- package/components/form/index.spec.ts +22 -1
- package/components/tooltip/index.spec.ts +30 -0
- package/components/tooltip/tooltip.ts +3 -0
- package/es/components/dropdown/dropdown.js +2 -1
- package/es/components/form/index.spec.js +49 -2
- package/es/components/tooltip/index.spec.js +57 -0
- package/es/components/tooltip/tooltip.js +5 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/copy/demos/basic/index.d.ts +5 -0
- package/es/site/data/components/copy/demos/basic/index.js +17 -0
- package/es/site/data/components/copy/demos/basic/react.d.ts +4 -0
- package/es/site/data/components/copy/demos/basic/react.js +23 -0
- package/es/site/data/components/copy/demos/children/index.d.ts +6 -0
- package/es/site/data/components/copy/demos/children/index.js +18 -0
- package/es/site/data/components/copy/demos/children/react.d.ts +5 -0
- package/es/site/data/components/copy/demos/children/react.js +44 -0
- package/es/site/data/components/copy/index.d.ts +57 -0
- package/es/site/data/components/copy/index.js +42 -0
- package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/icon/demos/disabled/index.js +18 -0
- package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/icon/demos/disabled/react.js +33 -0
- package/es/site/data/components/input/demos/flat/index.d.ts +5 -0
- package/es/site/data/components/input/demos/flat/index.js +17 -0
- package/es/site/data/components/input/demos/flat/react.d.ts +4 -0
- package/es/site/data/components/input/demos/flat/react.js +29 -0
- package/es/site/data/components/input/demos/showCount/index.d.ts +5 -0
- package/es/site/data/components/input/demos/showCount/index.js +17 -0
- package/es/site/data/components/input/demos/showCount/react.d.ts +4 -0
- package/es/site/data/components/input/demos/showCount/react.js +33 -0
- package/es/site/data/components/pagination/demos/flat/index.d.ts +6 -0
- package/es/site/data/components/pagination/demos/flat/index.js +18 -0
- package/es/site/data/components/pagination/demos/flat/react.d.ts +5 -0
- package/es/site/data/components/pagination/demos/flat/react.js +41 -0
- package/es/site/data/components/popover/demos/basic/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/basic/index.js +28 -0
- package/es/site/data/components/popover/demos/basic/react.d.ts +8 -0
- package/es/site/data/components/popover/demos/basic/react.js +59 -0
- package/es/site/data/components/popover/demos/button/index.d.ts +8 -0
- package/es/site/data/components/popover/demos/button/index.js +42 -0
- package/es/site/data/components/popover/demos/button/react.d.ts +8 -0
- package/es/site/data/components/popover/demos/button/react.js +73 -0
- package/es/site/data/components/popover/demos/content/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/content/index.js +28 -0
- package/es/site/data/components/popover/demos/content/react.d.ts +6 -0
- package/es/site/data/components/popover/demos/content/react.js +43 -0
- package/es/site/data/components/popover/demos/text/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/text/index.js +28 -0
- package/es/site/data/components/popover/demos/text/react.d.ts +6 -0
- package/es/site/data/components/popover/demos/text/react.js +36 -0
- package/es/site/data/components/popover/demos/type/index.d.ts +11 -0
- package/es/site/data/components/popover/demos/type/index.js +34 -0
- package/es/site/data/components/popover/demos/type/react.d.ts +11 -0
- package/es/site/data/components/popover/demos/type/react.js +58 -0
- package/es/site/data/components/popover/index.d.ts +57 -0
- package/es/site/data/components/popover/index.js +42 -0
- package/es/site/data/components/progress/demos/circleSize/index.d.ts +14 -0
- package/es/site/data/components/progress/demos/circleSize/index.js +43 -0
- package/es/site/data/components/progress/demos/circleSize/react.d.ts +14 -0
- package/es/site/data/components/progress/demos/circleSize/react.js +98 -0
- package/es/site/data/components/select/demos/draggable/index.d.ts +10 -0
- package/es/site/data/components/select/demos/draggable/index.js +24 -0
- package/es/site/data/components/select/demos/draggable/react.d.ts +10 -0
- package/es/site/data/components/select/demos/draggable/react.js +85 -0
- package/es/site/data/components/select/demos/flat/index.d.ts +5 -0
- package/es/site/data/components/select/demos/flat/index.js +17 -0
- package/es/site/data/components/select/demos/flat/react.d.ts +4 -0
- package/es/site/data/components/select/demos/flat/react.js +73 -0
- package/es/site/data/components/select/demos/inline/index.d.ts +5 -0
- package/es/site/data/components/select/demos/inline/index.js +17 -0
- package/es/site/data/components/select/demos/inline/react.d.ts +4 -0
- package/es/site/data/components/select/demos/inline/react.js +27 -0
- package/es/site/data/components/select/demos/nowrap/index.d.ts +5 -0
- package/es/site/data/components/select/demos/nowrap/index.js +17 -0
- package/es/site/data/components/select/demos/nowrap/react.d.ts +4 -0
- package/es/site/data/components/select/demos/nowrap/react.js +41 -0
- package/es/site/data/components/steps/demos/vertical/index.d.ts +14 -0
- package/es/site/data/components/steps/demos/vertical/index.js +40 -0
- package/es/site/data/components/steps/demos/vertical/react.d.ts +14 -0
- package/es/site/data/components/steps/demos/vertical/react.js +124 -0
- package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/switch/demos/disabled/index.js +18 -0
- package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/switch/demos/disabled/react.js +27 -0
- package/es/site/data/components/tabs/demos/scroll/index.d.ts +18 -0
- package/es/site/data/components/tabs/demos/scroll/index.js +87 -0
- package/es/site/data/components/tabs/demos/scroll/react.d.ts +18 -0
- package/es/site/data/components/tabs/demos/scroll/react.js +166 -0
- package/es/site/data/components/tag/demos/draggable/index.d.ts +11 -0
- package/es/site/data/components/tag/demos/draggable/index.js +24 -0
- package/es/site/data/components/tag/demos/draggable/react.d.ts +11 -0
- package/es/site/data/components/tag/demos/draggable/react.js +62 -0
- package/es/site/data/components/tag/demos/tags/index.d.ts +12 -0
- package/es/site/data/components/tag/demos/tags/index.js +39 -0
- package/es/site/data/components/tag/demos/tags/react.d.ts +12 -0
- package/es/site/data/components/tag/demos/tags/react.js +83 -0
- package/index.ts +2 -2
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ import {mount, unmount, dispatchEvent, wait} from '../../test/utils';
|
|
|
6
6
|
import {Component, findDomFromVNode} from 'intact';
|
|
7
7
|
import {Form, FormItem} from './';
|
|
8
8
|
import {Input} from '../input';
|
|
9
|
+
import { Select } from '../select';
|
|
9
10
|
|
|
10
11
|
RemoteDemo.prototype.validateUserName = function(value) {
|
|
11
12
|
// mock api
|
|
@@ -21,7 +22,7 @@ RemoteDemo.prototype.validateUserName = function(value) {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
describe('Form', () => {
|
|
24
|
-
|
|
25
|
+
afterEach(() => unmount());
|
|
25
26
|
|
|
26
27
|
it('validate', async () => {
|
|
27
28
|
const [instance, element] = mount(BasicDemo, null, basicDemoData);
|
|
@@ -440,4 +441,24 @@ describe('Form', () => {
|
|
|
440
441
|
await wait();
|
|
441
442
|
expect(classList.contains('k-ellipsis')).to.be.true;
|
|
442
443
|
});
|
|
444
|
+
|
|
445
|
+
it('should not validate when select is disabled on init', async () => {
|
|
446
|
+
class Demo extends Component {
|
|
447
|
+
static template = `
|
|
448
|
+
const {Form, FormItem, Select} = this;
|
|
449
|
+
<Form ref="form">
|
|
450
|
+
<FormItem rules={{required: true}}>
|
|
451
|
+
<Select disabled />
|
|
452
|
+
</FormItem>
|
|
453
|
+
</Form>
|
|
454
|
+
`;
|
|
455
|
+
Form = Form;
|
|
456
|
+
FormItem = FormItem;
|
|
457
|
+
Select = Select;
|
|
458
|
+
}
|
|
459
|
+
const [instance, element] = mount(Demo);
|
|
460
|
+
|
|
461
|
+
await wait(500);
|
|
462
|
+
expect(element.querySelector('.k-form-error')).to.be.null;
|
|
463
|
+
});
|
|
443
464
|
});
|
|
@@ -9,6 +9,7 @@ import {Tooltip} from './';
|
|
|
9
9
|
import {Dialog} from '../dialog';
|
|
10
10
|
import {mount, unmount, dispatchEvent, getElement, wait} from '../../test/utils';
|
|
11
11
|
import { tooltip as tooltipTheme } from './styles';
|
|
12
|
+
import { Select, Option } from '../select';
|
|
12
13
|
|
|
13
14
|
describe('Tooltip', () => {
|
|
14
15
|
afterEach((done) => {
|
|
@@ -408,4 +409,33 @@ describe('Tooltip', () => {
|
|
|
408
409
|
const newWidth = content.offsetWidth;
|
|
409
410
|
expect(newWidth).to.eql(width);
|
|
410
411
|
});
|
|
412
|
+
|
|
413
|
+
it('should not impact select when wrap select with tooltip', async () => {
|
|
414
|
+
class Demo extends Component {
|
|
415
|
+
static template = `
|
|
416
|
+
const {Tooltip, Select, Option} = this;
|
|
417
|
+
<Tooltip>
|
|
418
|
+
<Select>
|
|
419
|
+
<Option value="1">Option 1</Option>
|
|
420
|
+
<Option value="2">Option 2</Option>
|
|
421
|
+
</Select>
|
|
422
|
+
</Tooltip>
|
|
423
|
+
`
|
|
424
|
+
private Tooltip = Tooltip;
|
|
425
|
+
private Select = Select;
|
|
426
|
+
private Option = Option;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const [instance, element] = mount(Demo);
|
|
430
|
+
dispatchEvent(element, 'mouseenter');
|
|
431
|
+
await wait();
|
|
432
|
+
dispatchEvent(element, 'click');
|
|
433
|
+
await wait();
|
|
434
|
+
|
|
435
|
+
const menu = getElement(".k-select-menu")!;
|
|
436
|
+
dispatchEvent(element, 'mouseleave');
|
|
437
|
+
await wait(500);
|
|
438
|
+
|
|
439
|
+
expect(menu.style.display).to.eql('');
|
|
440
|
+
});
|
|
411
441
|
});
|
|
@@ -8,10 +8,11 @@ import BasicDemo, { data as basicDemoData } from '~/components/form/demos/basic'
|
|
|
8
8
|
import CustomDemo from '~/components/form/demos/custom';
|
|
9
9
|
import VariableDemo from '~/components/form/demos/variable';
|
|
10
10
|
import RemoteDemo from '~/components/form/demos/remote';
|
|
11
|
-
import { mount, dispatchEvent, wait } from '../../test/utils';
|
|
11
|
+
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
12
12
|
import { Component } from 'intact';
|
|
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
|
|
@@ -29,7 +30,9 @@ RemoteDemo.prototype.validateUserName = function (value) {
|
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
describe('Form', function () {
|
|
32
|
-
|
|
33
|
+
afterEach(function () {
|
|
34
|
+
return unmount();
|
|
35
|
+
});
|
|
33
36
|
it('validate', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
37
|
var _mount, instance, element, form, item, input;
|
|
35
38
|
|
|
@@ -1315,4 +1318,48 @@ describe('Form', function () {
|
|
|
1315
1318
|
}
|
|
1316
1319
|
}, _callee7);
|
|
1317
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
|
+
})));
|
|
1318
1365
|
});
|
|
@@ -15,6 +15,7 @@ import { Tooltip } from './';
|
|
|
15
15
|
import { Dialog } from '../dialog';
|
|
16
16
|
import { mount, unmount, dispatchEvent, getElement, wait } from '../../test/utils';
|
|
17
17
|
import { tooltip as tooltipTheme } from './styles';
|
|
18
|
+
import { Select, Option } from '../select';
|
|
18
19
|
describe('Tooltip', function () {
|
|
19
20
|
afterEach(function (done) {
|
|
20
21
|
unmount();
|
|
@@ -685,4 +686,60 @@ describe('Tooltip', function () {
|
|
|
685
686
|
}
|
|
686
687
|
}, _callee11);
|
|
687
688
|
})));
|
|
689
|
+
it('should not impact select when wrap select with tooltip', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
690
|
+
var Demo, _mount12, instance, element, menu;
|
|
691
|
+
|
|
692
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context17) {
|
|
693
|
+
while (1) {
|
|
694
|
+
switch (_context17.prev = _context17.next) {
|
|
695
|
+
case 0:
|
|
696
|
+
Demo = /*#__PURE__*/function (_Component5) {
|
|
697
|
+
_inheritsLoose(Demo, _Component5);
|
|
698
|
+
|
|
699
|
+
function Demo() {
|
|
700
|
+
var _context16;
|
|
701
|
+
|
|
702
|
+
var _this5;
|
|
703
|
+
|
|
704
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
705
|
+
args[_key5] = arguments[_key5];
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
_this5 = _Component5.call.apply(_Component5, _concatInstanceProperty(_context16 = [this]).call(_context16, args)) || this;
|
|
709
|
+
_this5.Tooltip = Tooltip;
|
|
710
|
+
_this5.Select = Select;
|
|
711
|
+
_this5.Option = Option;
|
|
712
|
+
return _this5;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return Demo;
|
|
716
|
+
}(Component);
|
|
717
|
+
|
|
718
|
+
Demo.template = "\n const {Tooltip, Select, Option} = this;\n <Tooltip>\n <Select>\n <Option value=\"1\">Option 1</Option>\n <Option value=\"2\">Option 2</Option>\n </Select>\n </Tooltip>\n ";
|
|
719
|
+
_mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
|
|
720
|
+
dispatchEvent(element, 'mouseenter');
|
|
721
|
+
_context17.next = 6;
|
|
722
|
+
return wait();
|
|
723
|
+
|
|
724
|
+
case 6:
|
|
725
|
+
dispatchEvent(element, 'click');
|
|
726
|
+
_context17.next = 9;
|
|
727
|
+
return wait();
|
|
728
|
+
|
|
729
|
+
case 9:
|
|
730
|
+
menu = getElement(".k-select-menu");
|
|
731
|
+
dispatchEvent(element, 'mouseleave');
|
|
732
|
+
_context17.next = 13;
|
|
733
|
+
return wait(500);
|
|
734
|
+
|
|
735
|
+
case 13:
|
|
736
|
+
expect(menu.style.display).to.eql('');
|
|
737
|
+
|
|
738
|
+
case 14:
|
|
739
|
+
case "end":
|
|
740
|
+
return _context17.stop();
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}, _callee12);
|
|
744
|
+
})));
|
|
688
745
|
});
|
|
@@ -64,7 +64,11 @@ export var Tooltip = /*#__PURE__*/function (_Dropdown) {
|
|
|
64
64
|
|
|
65
65
|
if (this.get('hoverable')) {
|
|
66
66
|
return _Dropdown.prototype.hide.call(this, immediately);
|
|
67
|
-
}
|
|
67
|
+
} // tooltip can show any number sub-tooltips, we should not close the showed tooltip
|
|
68
|
+
// #885
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
this.showedDropdown = null;
|
|
68
72
|
|
|
69
73
|
_Dropdown.prototype.hide.call(this, true);
|
|
70
74
|
};
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -57,4 +57,4 @@ export * from './components/tree';
|
|
|
57
57
|
export * from './components/treeSelect';
|
|
58
58
|
export * from './components/upload';
|
|
59
59
|
export * from './components/wave';
|
|
60
|
-
export declare const version = "2.1.
|
|
60
|
+
export declare const version = "2.1.2";
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -59,5 +59,5 @@ export * from './components/tree';
|
|
|
59
59
|
export * from './components/treeSelect';
|
|
60
60
|
export * from './components/upload';
|
|
61
61
|
export * from './components/wave';
|
|
62
|
-
export var version = '2.1.
|
|
62
|
+
export var version = '2.1.2';
|
|
63
63
|
/* generate end */
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
|
|
9
|
+
function default_1() {
|
|
10
|
+
return _Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return default_1;
|
|
14
|
+
}(Component);
|
|
15
|
+
|
|
16
|
+
default_1.template = template;
|
|
17
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Copy } from '@king-design/react';
|
|
4
|
+
|
|
5
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
|
+
_inheritsLoose(Demo, _React$Component);
|
|
7
|
+
|
|
8
|
+
function Demo() {
|
|
9
|
+
return _React$Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var _proto = Demo.prototype;
|
|
13
|
+
|
|
14
|
+
_proto.render = function render() {
|
|
15
|
+
return /*#__PURE__*/React.createElement(Copy, {
|
|
16
|
+
text: "Hello King Desgin!"
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return Demo;
|
|
21
|
+
}(React.Component);
|
|
22
|
+
|
|
23
|
+
export { Demo as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
|
|
7
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
8
|
+
_inheritsLoose(default_1, _Component);
|
|
9
|
+
|
|
10
|
+
function default_1() {
|
|
11
|
+
return _Component.apply(this, arguments) || this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return default_1;
|
|
15
|
+
}(Component);
|
|
16
|
+
|
|
17
|
+
default_1.template = template;
|
|
18
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Copy, Button, Icon } from '@king-design/react';
|
|
4
|
+
import './index.styl';
|
|
5
|
+
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
|
|
9
|
+
function Demo() {
|
|
10
|
+
return _React$Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var _proto = Demo.prototype;
|
|
14
|
+
|
|
15
|
+
_proto.render = function render() {
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Copy, {
|
|
17
|
+
text: "Hello King Desgin!"
|
|
18
|
+
}, "Copy"), /*#__PURE__*/React.createElement(Copy, {
|
|
19
|
+
text: "Hello King Desgin!"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Copy")), /*#__PURE__*/React.createElement(Copy, {
|
|
21
|
+
text: "Hello King Desgin!"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
type: "link",
|
|
24
|
+
size: "mini"
|
|
25
|
+
}, "Copy")), /*#__PURE__*/React.createElement(Copy, {
|
|
26
|
+
text: "Hello King Desgin!"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
className: "ion-ios-copy",
|
|
29
|
+
size: "large",
|
|
30
|
+
hoverable: true
|
|
31
|
+
})), /*#__PURE__*/React.createElement(Copy, {
|
|
32
|
+
text: "Hello King Desgin!"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
icon: true,
|
|
35
|
+
circle: true
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
37
|
+
className: "ion-ios-copy-outline"
|
|
38
|
+
}))));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return Demo;
|
|
42
|
+
}(React.Component);
|
|
43
|
+
|
|
44
|
+
export { Demo as default };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component } from 'intact';
|
|
2
|
+
import Article from '~/../src/components/article';
|
|
3
|
+
export default class extends Article {
|
|
4
|
+
static sidebar: {
|
|
5
|
+
组件: {
|
|
6
|
+
title: string;
|
|
7
|
+
category: string;
|
|
8
|
+
order: number;
|
|
9
|
+
sidebar: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}[];
|
|
12
|
+
undefined: ({
|
|
13
|
+
title: string;
|
|
14
|
+
order: number;
|
|
15
|
+
sidebar: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
path: string;
|
|
18
|
+
} | {
|
|
19
|
+
title: string;
|
|
20
|
+
order: number;
|
|
21
|
+
sidebar: string;
|
|
22
|
+
path: string;
|
|
23
|
+
disabled?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
};
|
|
26
|
+
static data: {
|
|
27
|
+
setting: {
|
|
28
|
+
title: string;
|
|
29
|
+
category: string;
|
|
30
|
+
order: number;
|
|
31
|
+
sidebar: string;
|
|
32
|
+
};
|
|
33
|
+
contents: string;
|
|
34
|
+
index: string;
|
|
35
|
+
catalogs: {
|
|
36
|
+
text: string;
|
|
37
|
+
level: number;
|
|
38
|
+
id: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
static defaults: () => {
|
|
42
|
+
demos: Component<any, {}, {}, {}>[];
|
|
43
|
+
setting: {
|
|
44
|
+
title: string;
|
|
45
|
+
category: string;
|
|
46
|
+
order: number;
|
|
47
|
+
sidebar: string;
|
|
48
|
+
};
|
|
49
|
+
contents: string;
|
|
50
|
+
index: string;
|
|
51
|
+
catalogs: {
|
|
52
|
+
text: string;
|
|
53
|
+
level: number;
|
|
54
|
+
id: string;
|
|
55
|
+
}[];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import _keysInstanceProperty from "@babel/runtime-corejs3/core-js/instance/keys";
|
|
4
|
+
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js/instance/starts-with";
|
|
5
|
+
import Article from '~/../src/components/article';
|
|
6
|
+
import data from './index.json';
|
|
7
|
+
import sidebar from '~/doc.json';
|
|
8
|
+
|
|
9
|
+
var r = require.context('./', true, /demos.*(index|demo).ts/);
|
|
10
|
+
|
|
11
|
+
var keys = _keysInstanceProperty(r).call(r);
|
|
12
|
+
|
|
13
|
+
var demos = [];
|
|
14
|
+
|
|
15
|
+
for (var i = 0; i < keys.length; i++) {
|
|
16
|
+
var file = keys[i];
|
|
17
|
+
if (!_startsWithInstanceProperty(file).call(file, '.')) continue; // if we found demo.js then ignore index.js
|
|
18
|
+
|
|
19
|
+
if (/demo.ts$/.test(file)) i++;
|
|
20
|
+
demos.push(r(file));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var default_1 = /*#__PURE__*/function (_Article) {
|
|
24
|
+
_inheritsLoose(default_1, _Article);
|
|
25
|
+
|
|
26
|
+
function default_1() {
|
|
27
|
+
return _Article.apply(this, arguments) || this;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return default_1;
|
|
31
|
+
}(Article);
|
|
32
|
+
|
|
33
|
+
default_1.sidebar = sidebar;
|
|
34
|
+
default_1.data = data;
|
|
35
|
+
|
|
36
|
+
default_1.defaults = function () {
|
|
37
|
+
return _extends({}, Article.defaults, data, {
|
|
38
|
+
demos: demos
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
import './index.styl';
|
|
6
|
+
|
|
7
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
8
|
+
_inheritsLoose(default_1, _Component);
|
|
9
|
+
|
|
10
|
+
function default_1() {
|
|
11
|
+
return _Component.apply(this, arguments) || this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return default_1;
|
|
15
|
+
}(Component);
|
|
16
|
+
|
|
17
|
+
default_1.template = template;
|
|
18
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon } from '@king-design/react';
|
|
4
|
+
import './index.styl';
|
|
5
|
+
|
|
6
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
7
|
+
_inheritsLoose(Demo, _React$Component);
|
|
8
|
+
|
|
9
|
+
function Demo() {
|
|
10
|
+
return _React$Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var _proto = Demo.prototype;
|
|
14
|
+
|
|
15
|
+
_proto.render = function render() {
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
|
|
17
|
+
className: "ion-happy-outline",
|
|
18
|
+
disabled: true
|
|
19
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
className: "ion-happy-outline",
|
|
21
|
+
disabled: true,
|
|
22
|
+
hoverable: true
|
|
23
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
24
|
+
className: "ion-happy-outline",
|
|
25
|
+
disabled: true,
|
|
26
|
+
color: "primary"
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return Demo;
|
|
31
|
+
}(React.Component);
|
|
32
|
+
|
|
33
|
+
export { Demo as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
export { default as data } from './index.json';
|
|
3
|
+
import { Component } from 'intact';
|
|
4
|
+
import template from './index.vdt';
|
|
5
|
+
|
|
6
|
+
var default_1 = /*#__PURE__*/function (_Component) {
|
|
7
|
+
_inheritsLoose(default_1, _Component);
|
|
8
|
+
|
|
9
|
+
function default_1() {
|
|
10
|
+
return _Component.apply(this, arguments) || this;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return default_1;
|
|
14
|
+
}(Component);
|
|
15
|
+
|
|
16
|
+
default_1.template = template;
|
|
17
|
+
export { default_1 as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Input } from '@king-design/react';
|
|
4
|
+
|
|
5
|
+
var Demo = /*#__PURE__*/function (_React$Component) {
|
|
6
|
+
_inheritsLoose(Demo, _React$Component);
|
|
7
|
+
|
|
8
|
+
function Demo() {
|
|
9
|
+
return _React$Component.apply(this, arguments) || this;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var _proto = Demo.prototype;
|
|
13
|
+
|
|
14
|
+
_proto.render = function render() {
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
16
|
+
placeholder: "Please enter",
|
|
17
|
+
flat: true
|
|
18
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Input, {
|
|
19
|
+
placeholder: "Please enter",
|
|
20
|
+
flat: true,
|
|
21
|
+
value: "disabled",
|
|
22
|
+
disabled: true
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return Demo;
|
|
27
|
+
}(React.Component);
|
|
28
|
+
|
|
29
|
+
export { Demo as default };
|