@king-design/react 2.0.5 → 2.0.7
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__/React Demos.md +62 -62
- package/__tests__/index.ts +2 -2
- package/__tests__/karma.conf.js +6 -1
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +1 -1
- package/components/dialog/index.js +6 -5
- package/components/dialog/staticMethods.d.ts +1 -0
- package/components/dialog/staticMethods.js +3 -2
- package/components/drawer/styles.js +1 -1
- package/components/menu/index.spec.js +62 -0
- package/components/menu/item.js +2 -1
- package/components/menu/useHighlight.d.ts +2 -0
- package/components/menu/useHighlight.js +13 -2
- package/components/portal.d.ts +0 -3
- package/components/portal.js +13 -47
- package/components/select/styles.js +1 -1
- package/components/tooltip/content.vdt.js +2 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/yarn-error.log +546 -0
package/__tests__/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ testsContext.keys().forEach(testsContext);
|
|
|
15
15
|
|
|
16
16
|
// const reactReq = require.context('~/components/', true, /^((?!(affix|code|layout)).)*\/demos\/.*react\.tsx$/);
|
|
17
17
|
const reactReq = require.context('~/components/', true, /^((?!(affix|code)).)*\/demos\/.*react\.tsx$/);
|
|
18
|
-
// const reactReq = require.context('~/components/', true, /
|
|
18
|
+
// const reactReq = require.context('~/components/', true, /layout\/demos\/.*react\.tsx$/);
|
|
19
19
|
|
|
20
20
|
describe('React Demos', () => {
|
|
21
21
|
afterEach(() => unmount());
|
|
@@ -41,7 +41,7 @@ describe('React Demos', () => {
|
|
|
41
41
|
testDemos(reactReq, async (Demo) => {
|
|
42
42
|
const [instance, element] = mount(wrap(Demo as any));
|
|
43
43
|
await wait(100);
|
|
44
|
-
// FIXME: I don't why the width of `autoWidth` input is an unexpected value
|
|
44
|
+
// FIXME: I don't know why the width of `autoWidth` input is an unexpected value
|
|
45
45
|
// while we run test on Github Actions.
|
|
46
46
|
const innerHTML = element.innerHTML.replace(/(\<input.*?style="width: )(?:.*?)(px;")/g, '$1$2');
|
|
47
47
|
expect(innerHTML).to.matchSnapshot();
|
package/__tests__/karma.conf.js
CHANGED
|
@@ -16,7 +16,12 @@ module.exports = function (config) {
|
|
|
16
16
|
customLaunchers: {
|
|
17
17
|
'MyChromeHeadless': {
|
|
18
18
|
base: 'ChromeHeadless',
|
|
19
|
-
flags: [
|
|
19
|
+
flags: [
|
|
20
|
+
'--window-size=1920,1080',
|
|
21
|
+
'--force-device-scale-factor=1',
|
|
22
|
+
'--disable-gpu',
|
|
23
|
+
'--no-sandbox',
|
|
24
|
+
],
|
|
20
25
|
}
|
|
21
26
|
},
|
|
22
27
|
frameworks: ['webpack', 'mocha', 'sinon-chai', 'snapshot', 'mocha-snapshot'],
|
|
@@ -14,7 +14,7 @@ declare type Value = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare class DatepickerTime extends Component<DatepickerTimeProps> {
|
|
16
16
|
static template: string | import("intact").Template<any>;
|
|
17
|
-
value: import("../../hooks/useState").State<Value
|
|
17
|
+
value: import("../../hooks/useState").State<Value>;
|
|
18
18
|
disabled: {
|
|
19
19
|
disableSeconds: import("../../hooks/useState").State<boolean>;
|
|
20
20
|
disableMinutes: import("../../hooks/useState").State<boolean>;
|
|
@@ -25,7 +25,7 @@ export var DatepickerTime = /*#__PURE__*/function (_Component) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
28
|
-
_this.value = useState(
|
|
28
|
+
_this.value = useState(defaultValue);
|
|
29
29
|
_this.disabled = useDisable(_assertThisInitialized(_this));
|
|
30
30
|
return _this;
|
|
31
31
|
}
|
|
@@ -15,7 +15,7 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if ($vNode === void 0) {
|
|
18
|
-
$vNode =
|
|
18
|
+
$vNode = createVNode(BaseDialog);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if ($SVG === void 0) {
|
|
@@ -38,13 +38,14 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
38
38
|
var _proto = BaseDialog.prototype;
|
|
39
39
|
|
|
40
40
|
_proto.init = function init() {
|
|
41
|
-
_BaseDialog2.prototype.init.call(this);
|
|
41
|
+
_BaseDialog2.prototype.init.call(this); // @ts-ignore
|
|
42
42
|
|
|
43
|
-
usePosition(this.dialogRef);
|
|
44
43
|
|
|
45
|
-
if (this.$vNode) {
|
|
44
|
+
if (this.$vNode.tag !== BaseDialog) {
|
|
46
45
|
this.useAsComponent = true;
|
|
47
46
|
}
|
|
47
|
+
|
|
48
|
+
usePosition(this.dialogRef);
|
|
48
49
|
};
|
|
49
50
|
|
|
50
51
|
_proto.show = function show() {
|
|
@@ -68,7 +69,7 @@ export var BaseDialog = /*#__PURE__*/function (_BaseDialog2) {
|
|
|
68
69
|
|
|
69
70
|
_this2.$init(null);
|
|
70
71
|
|
|
71
|
-
var vNode = _this2.$vNode
|
|
72
|
+
var vNode = _this2.$vNode;
|
|
72
73
|
vNode.children = _this2;
|
|
73
74
|
|
|
74
75
|
_this2.$render(null, vNode, document.body, null, mountedQueue);
|
|
@@ -5,6 +5,7 @@ export interface AlertDialogProps extends DialogProps {
|
|
|
5
5
|
type?: 'success' | 'warning' | 'error' | 'confirm';
|
|
6
6
|
hideIcon?: boolean;
|
|
7
7
|
hideFooter?: boolean;
|
|
8
|
+
ref?: (i: Dialog) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare type StaticMethod = (options?: AlertDialogProps) => Promise<void>;
|
|
10
11
|
export declare function addStaticMethods(Component: typeof Dialog): void;
|
|
@@ -29,9 +29,10 @@ export function addStaticMethods(Component) {
|
|
|
29
29
|
options = {};
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
var dialog = new AlertDialog(options);
|
|
33
|
+
dialog.show();
|
|
34
|
+
if (options.ref) options.ref(dialog);
|
|
32
35
|
return new _Promise(function (resolve, reject) {
|
|
33
|
-
var dialog = new AlertDialog(options, null, false, [], null);
|
|
34
|
-
dialog.show();
|
|
35
36
|
dialog.on('ok', function () {
|
|
36
37
|
resolve();
|
|
37
38
|
});
|
|
@@ -21,7 +21,7 @@ setDefault(function () {
|
|
|
21
21
|
}).drawer;
|
|
22
22
|
});
|
|
23
23
|
export function makeStyles(overlay) {
|
|
24
|
-
return /*#__PURE__*/css("box-shadow:none;border-radius:0;position:fixed!important;background:transparent!important;box-shadow:none!important;&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:opacity ", drawer.transition, "!important;overflow:hidden;.k-drawer-content{transition:transform ", drawer.transition, ";}}.k-drawer-content{height:100%;display:flex;background:#fff;flex-direction:column;transform:translateX(0);box-shadow:", drawer.boxShadow, ";.k-dialog-body{flex-grow:1;}}", _mapInstanceProperty(placements).call(placements, function (placement) {
|
|
24
|
+
return /*#__PURE__*/css("box-shadow:none;border-radius:0;position:fixed!important;background:transparent!important;box-shadow:none!important;&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:opacity ", drawer.transition, "!important;overflow:hidden;.k-drawer-content{transition:transform ", drawer.transition, ";}}.k-drawer-content{height:100%;display:flex;background:#fff;flex-direction:column;transform:translateX(0);box-shadow:", drawer.boxShadow, ";.k-dialog-body{flex-grow:1;overflow:auto;}}", _mapInstanceProperty(placements).call(placements, function (placement) {
|
|
25
25
|
var positionValue = '';
|
|
26
26
|
var transformValue = '';
|
|
27
27
|
placements.forEach(function (p) {
|
|
@@ -1,8 +1,13 @@
|
|
|
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";
|
|
4
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/includes";
|
|
2
5
|
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
6
|
+
import { Component } from 'intact-react';
|
|
3
7
|
import CollapseDemo from '~/components/menu/demos/collapse';
|
|
4
8
|
import AccordionDemo from '~/components/menu/demos/accordion';
|
|
5
9
|
import { mount, unmount, dispatchEvent, getElement, wait } from '../../test/utils';
|
|
10
|
+
import { Menu, MenuItem } from './';
|
|
6
11
|
describe('Menu', function () {
|
|
7
12
|
afterEach(function () {
|
|
8
13
|
return unmount();
|
|
@@ -220,4 +225,61 @@ describe('Menu', function () {
|
|
|
220
225
|
}
|
|
221
226
|
}, _callee5);
|
|
222
227
|
})));
|
|
228
|
+
it('expand when set selectedKey', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
229
|
+
var Demo, _mount6, instance, expandedKeys;
|
|
230
|
+
|
|
231
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
232
|
+
while (1) {
|
|
233
|
+
switch (_context7.prev = _context7.next) {
|
|
234
|
+
case 0:
|
|
235
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
236
|
+
_inheritsLoose(Demo, _Component);
|
|
237
|
+
|
|
238
|
+
function Demo() {
|
|
239
|
+
var _context6;
|
|
240
|
+
|
|
241
|
+
var _this;
|
|
242
|
+
|
|
243
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
244
|
+
args[_key] = arguments[_key];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
248
|
+
_this.Menu = Menu;
|
|
249
|
+
_this.MenuItem = MenuItem;
|
|
250
|
+
return _this;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
Demo.defaults = function defaults() {
|
|
254
|
+
return {
|
|
255
|
+
expandedKeys: [],
|
|
256
|
+
selectedKey: '1-3',
|
|
257
|
+
list: ['1-1', '1-2']
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
return Demo;
|
|
262
|
+
}(Component);
|
|
263
|
+
|
|
264
|
+
Demo.template = "\n var Menu = this.Menu;\n var MenuItem = this.MenuItem;\n <Menu\n v-model:expandedKeys=\"expandedKeys\"\n v-model:selectedKey=\"selectedKey\"\n >\n <MenuItem key=\"1\">\n <Menu>\n <MenuItem v-for={this.get('list')} key={$value}>{$value}</MenuItem>\n </Menu>\n </MenuItem>\n </Menu>\n ";
|
|
265
|
+
_mount6 = mount(Demo), instance = _mount6[0];
|
|
266
|
+
_context7.next = 5;
|
|
267
|
+
return wait();
|
|
268
|
+
|
|
269
|
+
case 5:
|
|
270
|
+
instance.set('list', ['1-1', '1-2', '1-3']);
|
|
271
|
+
_context7.next = 8;
|
|
272
|
+
return wait();
|
|
273
|
+
|
|
274
|
+
case 8:
|
|
275
|
+
expandedKeys = instance.get('expandedKeys');
|
|
276
|
+
expect(_includesInstanceProperty(expandedKeys).call(expandedKeys, '1')).to.be.true;
|
|
277
|
+
|
|
278
|
+
case 10:
|
|
279
|
+
case "end":
|
|
280
|
+
return _context7.stop();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, _callee6);
|
|
284
|
+
})));
|
|
223
285
|
});
|
package/components/menu/item.js
CHANGED
|
@@ -9,7 +9,7 @@ import { useExpanded } from './useExpanded';
|
|
|
9
9
|
import { useDropdown } from './useDropdown';
|
|
10
10
|
import { useRouter, navigate } from '../../hooks/useRouter';
|
|
11
11
|
import { useRecordItem } from '../../hooks/useRecordComponent';
|
|
12
|
-
import { MENU_RECORD_KEY } from './useHighlight';
|
|
12
|
+
import { MENU_RECORD_KEY, useHighlightItem } from './useHighlight';
|
|
13
13
|
var typeDefs = {
|
|
14
14
|
key: {
|
|
15
15
|
type: [String, Number],
|
|
@@ -47,6 +47,7 @@ export var MenuItem = /*#__PURE__*/function (_Component) {
|
|
|
47
47
|
_proto.init = function init() {
|
|
48
48
|
provide(MENU_ITEM, this);
|
|
49
49
|
useRecordItem(MENU_RECORD_KEY);
|
|
50
|
+
useHighlightItem();
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
_proto.onClick = function onClick(hasSubMenu, e) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _Set from "@babel/runtime-corejs3/core-js/set";
|
|
2
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
3
3
|
import _Array$from from "@babel/runtime-corejs3/core-js/array/from";
|
|
4
|
-
import { useInstance } from 'intact-react';
|
|
4
|
+
import { useInstance, onMounted } from 'intact-react';
|
|
5
5
|
import { useRecordParent } from '../../hooks/useRecordComponent';
|
|
6
6
|
import { inArray } from '../table/useChecked';
|
|
7
7
|
import { useState } from '../../hooks/useState';
|
|
@@ -64,6 +64,17 @@ export function useHighlight() {
|
|
|
64
64
|
return {
|
|
65
65
|
isHighlighted: isHighlighted,
|
|
66
66
|
select: select,
|
|
67
|
-
isSelected: isSelected
|
|
67
|
+
isSelected: isSelected,
|
|
68
|
+
updateStatus: updateStatus
|
|
68
69
|
};
|
|
70
|
+
}
|
|
71
|
+
export function useHighlightItem() {
|
|
72
|
+
var instance = useInstance();
|
|
73
|
+
onMounted(function () {
|
|
74
|
+
if (instance.rootMenu.get('selectedKey') == instance.get('key')) {
|
|
75
|
+
var _instance$rootMenu$hi;
|
|
76
|
+
|
|
77
|
+
(_instance$rootMenu$hi = instance.rootMenu.highlight) == null ? void 0 : _instance$rootMenu$hi.updateStatus(instance.get('key'));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
69
80
|
}
|
package/components/portal.d.ts
CHANGED
|
@@ -8,11 +8,8 @@ export declare class Portal<T extends PortalProps = PortalProps> extends Compone
|
|
|
8
8
|
static typeDefs: Required<TypeDefs<PortalProps>>;
|
|
9
9
|
private container;
|
|
10
10
|
private dialog;
|
|
11
|
-
private portal;
|
|
12
|
-
private rootPortal;
|
|
13
11
|
mountedQueue?: Function[];
|
|
14
12
|
mountedDone?: boolean;
|
|
15
|
-
init(): void;
|
|
16
13
|
$render(lastVNode: VNodeComponentClass<this> | null, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[]): void;
|
|
17
14
|
$update(lastVNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[], force: boolean): void;
|
|
18
15
|
$unmount(vNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this> | null): void;
|
package/components/portal.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
-
import { Component, createCommentVNode, createTextVNode, mount, patch, remove,
|
|
3
|
+
import { Component, createCommentVNode, createTextVNode, mount, patch, remove, inject, callAll } from 'intact-react';
|
|
4
4
|
import { isString } from 'intact-shared';
|
|
5
5
|
import { DIALOG } from './dialog/constants';
|
|
6
6
|
var typeDefs = {
|
|
7
7
|
container: [String, Function]
|
|
8
8
|
};
|
|
9
|
-
var PORTAL = 'Portal';
|
|
10
9
|
export var Portal = /*#__PURE__*/function (_Component) {
|
|
11
10
|
_inheritsLoose(Portal, _Component);
|
|
12
11
|
|
|
@@ -22,8 +21,6 @@ export var Portal = /*#__PURE__*/function (_Component) {
|
|
|
22
21
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
23
22
|
_this.container = null;
|
|
24
23
|
_this.dialog = inject(DIALOG, null);
|
|
25
|
-
_this.portal = inject(PORTAL, null);
|
|
26
|
-
_this.rootPortal = inject(PORTAL, null);
|
|
27
24
|
_this.mountedQueue = void 0;
|
|
28
25
|
_this.mountedDone = void 0;
|
|
29
26
|
return _this;
|
|
@@ -39,55 +36,24 @@ export var Portal = /*#__PURE__*/function (_Component) {
|
|
|
39
36
|
|
|
40
37
|
var _proto = Portal.prototype;
|
|
41
38
|
|
|
42
|
-
_proto.init = function init() {
|
|
43
|
-
if (!this.rootPortal) {
|
|
44
|
-
provide(PORTAL, this);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
39
|
_proto.$render = function $render(lastVNode, nextVNode, parentDom, anchor, mountedQueue) {
|
|
49
40
|
var _this2 = this;
|
|
50
41
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var shouldTrigger = false;
|
|
59
|
-
|
|
60
|
-
if (!this.rootPortal) {
|
|
61
|
-
rootPortal = this;
|
|
62
|
-
rootPortal.mountedQueue = [];
|
|
63
|
-
shouldTrigger = true;
|
|
64
|
-
} else {
|
|
65
|
-
rootPortal = this.rootPortal;
|
|
42
|
+
mountedQueue.push(function () {
|
|
43
|
+
var nextProps = nextVNode.props;
|
|
44
|
+
var parentDom = _this2.$lastInput.dom.parentElement;
|
|
45
|
+
/**
|
|
46
|
+
* initialize a new mountedQueue to place the callbacks of sub-components to it,
|
|
47
|
+
* so that we can call them before the sibling components of the Portal
|
|
48
|
+
*/
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
shouldTrigger = true;
|
|
69
|
-
rootPortal.mountedQueue = [];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
50
|
+
var mountedQueue = [];
|
|
72
51
|
|
|
73
|
-
|
|
74
|
-
selfMountedQueue.push(function () {
|
|
75
|
-
mount(nextProps.children, _this2.container, _this2, _this2.$SVG, null, mountedQueue);
|
|
76
|
-
});
|
|
52
|
+
_this2.initContainer(nextProps.container, parentDom, anchor);
|
|
77
53
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
mountedQueue.push(function () {
|
|
84
|
-
var parentDom = _this2.$lastInput.dom.parentElement;
|
|
85
|
-
|
|
86
|
-
_this2.initContainer(nextProps.container, parentDom, anchor);
|
|
87
|
-
|
|
88
|
-
mount(nextProps.children, _this2.container, _this2, _this2.$SVG, null, mountedQueue);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
54
|
+
mount(nextProps.children, _this2.container, _this2, _this2.$SVG, null, mountedQueue);
|
|
55
|
+
callAll(mountedQueue);
|
|
56
|
+
});
|
|
91
57
|
|
|
92
58
|
_Component.prototype.$render.call(this, lastVNode, nextVNode, parentDom, anchor, mountedQueue);
|
|
93
59
|
};
|
|
@@ -188,7 +188,7 @@ setDefault(function () {
|
|
|
188
188
|
}).select;
|
|
189
189
|
});
|
|
190
190
|
export default function makeStyles() {
|
|
191
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;vertical-align:middle;position:relative;width:", select.width, ";cursor:pointer;outline:none;border:", select.border, ";background:", select.bgColor, ";transition:border ", select.transition, ",background ", select.transition, ",box-shadow ", select.transition, ";border-radius:", select.borderRadius, ";.k-select-main{flex:1;}.k-select-prefix,.k-select-suffix{color:", select.iconColor, ";position:relative;}.k-select-suffix{margin-left:", select.suffixGap, ";}.k-select-placeholder{color:", select.placeholderColor, ";user-select:none;}&.k-fluid{width:100%;}.k-select-clear{opacity:0;transition:opacity ", select.transition, ",color ", select.transition, "!important;pointer-events:none;position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%, -50%);}&:hover{border:", select.hoverBorder, ";.k-select-clear.k-show{opacity:1;pointer-events:all;+.k-select-suffix-icon{opacity:0;}}}.k-select-suffix-icon{display:inline-block;transition:opacity ", select.transition, ";}.k-select-arrow{display:inline-block;transition:transform ", select.transition, ";&.k-disabled{color:", select.disabledArrowColor, ";}}&.k-dropdown-open{border:", select.focusBorder, ";.k-select-arrow{transform:rotateX(180deg);}}&:focus{outline:none;border:", select.focusBorder, ";}&.k-disabled{color:", select.disabled.color, ";cursor:not-allowed;background:", select.disabled.bgColor, ";border-color:", select.disabled.borderColor, ";.k-select-tag{background:", select.tag.disabledBgColor, ";}}.k-select-values{display:inline-block;margin-right:-", getRight(select.tag.margin), ";&.k-with-values{margin:0;}}.k-select-tag{display:inline-flex;align-items:center;padding:", select.tag.padding, ";background:", select.tag.bgColor, ";border-radius:", select.tag.borderRadius, ";margin:", select.tag.margin, ";line-height:1;}.k-select-close{margin-left:", select.tag.delete.gap, ";font-size:", select.tag.delete.fontSize, ";color:", select.tag.delete.color, ";}.k-select-input{margin-right:", getRight(select.tag.margin), ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
191
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;vertical-align:middle;position:relative;width:", select.width, ";cursor:pointer;outline:none;border:", select.border, ";background:", select.bgColor, ";transition:border ", select.transition, ",background ", select.transition, ",box-shadow ", select.transition, ";border-radius:", select.borderRadius, ";.k-select-main{flex:1;min-width:0;}.k-select-prefix,.k-select-suffix{color:", select.iconColor, ";position:relative;}.k-select-suffix{margin-left:", select.suffixGap, ";}.k-select-placeholder{color:", select.placeholderColor, ";user-select:none;}&.k-fluid{width:100%;}.k-select-clear{opacity:0;transition:opacity ", select.transition, ",color ", select.transition, "!important;pointer-events:none;position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%, -50%);}&:hover{border:", select.hoverBorder, ";.k-select-clear.k-show{opacity:1;pointer-events:all;+.k-select-suffix-icon{opacity:0;}}}.k-select-suffix-icon{display:inline-block;transition:opacity ", select.transition, ";}.k-select-arrow{display:inline-block;transition:transform ", select.transition, ";&.k-disabled{color:", select.disabledArrowColor, ";}}&.k-dropdown-open{border:", select.focusBorder, ";.k-select-arrow{transform:rotateX(180deg);}}&:focus{outline:none;border:", select.focusBorder, ";}&.k-disabled{color:", select.disabled.color, ";cursor:not-allowed;background:", select.disabled.bgColor, ";border-color:", select.disabled.borderColor, ";.k-select-tag{background:", select.tag.disabledBgColor, ";}}.k-select-values{display:inline-block;margin-right:-", getRight(select.tag.margin), ";&.k-with-values{margin:0;}}.k-select-tag{display:inline-flex;align-items:center;padding:", select.tag.padding, ";background:", select.tag.bgColor, ";border-radius:", select.tag.borderRadius, ";margin:", select.tag.margin, ";line-height:1;}.k-select-close{margin-left:", select.tag.delete.gap, ";font-size:", select.tag.delete.fontSize, ";color:", select.tag.delete.color, ";}.k-select-input{margin-right:", getRight(select.tag.margin), ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
192
192
|
var styles = select[size];
|
|
193
193
|
var className = /*#__PURE__*/css("font-size:", styles.fontSize, ";min-height:", styles.height, ";padding:", styles.padding, ";");
|
|
194
194
|
if (size === 'default') return className;
|
|
@@ -50,7 +50,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
50
50
|
|
|
51
51
|
return [children, showArrow ? _$ce(2, 'i', null, 1, _$cn((_$cn2 = {
|
|
52
52
|
"k-tooltip-arrow": true
|
|
53
|
-
}, _$cn2["k-" + arrowType.value] = arrowType.value, _$cn2)), null,
|
|
53
|
+
}, _$cn2["k-" + arrowType.value] = arrowType.value, _$cn2)), null, 'tooltip-arrow', arrowRef) : undefined, confirm ? _$ce(2, 'div', (_$blocks['buttons'] = function ($super) {
|
|
54
54
|
return [_$cc(Button, {
|
|
55
55
|
'type': 'primary',
|
|
56
56
|
'ev-click': this.ok,
|
|
@@ -69,7 +69,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
72
|
-
}, __$blocks['buttons'](_$no)), 0, 'k-tooltip-buttons') : undefined];
|
|
72
|
+
}, __$blocks['buttons'](_$no)), 0, 'k-tooltip-buttons', null, 'tooltip-buttons') : undefined];
|
|
73
73
|
}, __$blocks['children'] = function ($super, data) {
|
|
74
74
|
var block = $blocks['children'];
|
|
75
75
|
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.7
|
|
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.0.
|
|
60
|
+
export declare const version = "2.0.7";
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
export {normalize} from 'intact-react';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.
|
|
2
|
+
* @king-design v2.0.7
|
|
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.0.
|
|
62
|
+
export var version = '2.0.7';
|
|
63
63
|
/* generate end */
|
|
64
64
|
|
|
65
65
|
export {normalize} from 'intact-react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "King-Design UI components for React.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dayjs": "^1.10.7",
|
|
38
38
|
"downloadjs": "^1.4.7",
|
|
39
39
|
"enquire.js": "^2.1.6",
|
|
40
|
-
"intact-react": "
|
|
40
|
+
"intact-react": "3.0.8",
|
|
41
41
|
"monaco-editor": "^0.26.1",
|
|
42
42
|
"mxgraphx": "^4.0.7",
|
|
43
43
|
"resize-observer-polyfill": "^1.5.1",
|