@king-design/vue 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.
@@ -28,7 +28,8 @@ var typeDefs = {
28
28
  var defaults = function defaults() {
29
29
  return {
30
30
  trigger: 'hover',
31
- of: 'self'
31
+ of: 'self',
32
+ value: false
32
33
  };
33
34
  };
34
35
 
@@ -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-vue-next';
13
13
  import { Form, FormItem } from './';
14
14
  import { Input } from '../input';
15
+ import { Select } from '../select';
15
16
 
16
17
  RemoteDemo.prototype.validateUserName = function (value) {
17
18
  // mock api
@@ -29,7 +30,9 @@ RemoteDemo.prototype.validateUserName = function (value) {
29
30
  };
30
31
 
31
32
  describe('Form', function () {
32
- // afterEach(() => unmount());
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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v2.1.1
2
+ * @king-design v2.1.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -57,7 +57,7 @@ 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.1";
60
+ export declare const version = "2.1.2";
61
61
 
62
62
 
63
63
  export {normalize} from 'intact-vue-next';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v2.1.1
2
+ * @king-design v2.1.2
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -59,7 +59,7 @@ 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.1';
62
+ export var version = '2.1.2';
63
63
  /* generate end */
64
64
 
65
65
  export {normalize} from 'intact-vue-next';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@king-design/vue",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "King-Design UI components for Vue3.0.",
5
5
  "keywords": [
6
6
  "component",