@king-design/vue 2.0.0-beta.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/__snapshots__/Vue Next Demos.md +1795 -0
- package/__tests__/components/dropdown.spec.ts +43 -0
- package/__tests__/index.ts +46 -0
- package/__tests__/karma.conf.js +54 -0
- package/__tests__/webpack.config.js +61 -0
- package/components/breadcrumb/item.d.ts +1 -1
- package/components/breadcrumb/item.js +3 -14
- package/components/breadcrumb/styles.js +1 -1
- package/components/button/index.vdt.js +26 -17
- package/components/button/styles.d.ts +82 -1
- package/components/button/styles.js +16 -2
- package/components/card/styles.js +1 -1
- package/components/carousel/styles.js +4 -1
- package/components/carousel/useSlide.js +10 -9
- package/components/cascader/index.spec.js +1 -1
- package/components/checkbox/index.vdt.js +15 -10
- package/components/checkbox/styles.js +2 -2
- package/components/collapse/item.vdt.js +2 -1
- package/components/collapse/styles.js +5 -1
- package/components/colorpicker/index.d.ts +2 -0
- package/components/colorpicker/index.js +2 -1
- package/components/colorpicker/index.spec.js +1 -1
- package/components/colorpicker/index.vdt.js +3 -1
- package/components/context.d.ts +5 -2
- package/components/context.js +7 -4
- package/components/datepicker/helpers.d.ts +2 -1
- package/components/datepicker/helpers.js +8 -2
- package/components/datepicker/index.spec.js +1 -1
- package/components/datepicker/styles.d.ts +46 -1
- package/components/diagram/shapes/generateShapes.js +3 -3
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +0 -1
- package/components/dialog/base.d.ts +2 -0
- package/components/dialog/base.js +2 -1
- package/components/dialog/index.spec.js +59 -94
- package/components/dialog/styles.js +5 -1
- package/components/dialog/useFixBody.d.ts +6 -0
- package/components/dialog/useFixBody.js +12 -0
- package/components/drawer/index.spec.js +5 -5
- package/components/drawer/styles.js +1 -1
- package/components/dropdown/index.js +1 -2
- package/components/dropdown/index.spec.js +3 -3
- package/components/dropdown/styles.js +1 -1
- package/components/editable/index.vdt.js +2 -1
- package/components/editable/styles.d.ts +8 -1
- package/components/form/index.spec.js +8 -8
- package/components/form/item.vdt.js +13 -9
- package/components/form/useError.d.ts +5 -1
- package/components/form/useError.js +3 -1
- package/components/form/useValidate.js +2 -2
- package/components/grid/col.vdt.js +4 -2
- package/components/grid/styles.js +1 -1
- package/components/grid/useGutter.d.ts +1 -1
- package/components/icon/index.vdt.js +3 -2
- package/components/icon/styles.js +8 -4
- package/components/input/index.d.ts +1 -0
- package/components/input/index.js +2 -1
- package/components/input/index.vdt.js +47 -32
- package/components/input/search.vdt.js +4 -2
- package/components/input/styles.js +8 -3
- package/components/layout/styles.d.ts +1 -1
- package/components/layout/styles.js +7 -3
- package/components/menu/index.spec.js +2 -2
- package/components/menu/item.d.ts +1 -1
- package/components/menu/item.js +4 -13
- package/components/menu/styles.d.ts +62 -1
- package/components/menu/styles.js +6 -2
- package/components/message/index.spec.js +1 -1
- package/components/message/styles.js +6 -2
- package/components/pagination/styles.js +1 -1
- package/components/radio/index.vdt.js +14 -9
- package/components/radio/styles.js +9 -1
- package/components/rate/styles.js +5 -1
- package/components/scrollSelect/styles.d.ts +14 -1
- package/components/scrollSelect/styles.js +9 -1
- package/components/select/base.vdt.js +135 -121
- package/components/select/index.spec.js +1 -1
- package/components/select/menu.vdt.js +1 -0
- package/components/select/styles.js +9 -4
- package/components/select/useSearchable.d.ts +1 -1
- package/components/slider/styles.js +5 -1
- package/components/spinner/index.d.ts +1 -1
- package/components/spinner/index.js +1 -1
- package/components/split/style.js +1 -1
- package/components/steps/context.d.ts +1 -1
- package/components/steps/styles.js +5 -1
- package/components/switch/styles.js +5 -1
- package/components/table/index.d.ts +1 -0
- package/components/table/index.spec.js +2 -1
- package/components/table/row.vdt.js +12 -4
- package/components/table/styles.js +6 -1
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +2 -1
- package/components/table/table.vdt.js +30 -27
- package/components/table/useColumns.d.ts +1 -1
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +5 -2
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useResizable.d.ts +1 -1
- package/components/table/useSortable.d.ts +1 -1
- package/components/table/useWidth.js +7 -1
- package/components/tabs/index.spec.js +1 -1
- package/components/tabs/styles.js +9 -2
- package/components/tabs/tab.vdt.js +2 -1
- package/components/tabs/useActiveBar.js +6 -3
- package/components/tag/base.js +1 -0
- package/components/tag/styles.js +8 -2
- package/components/timepicker/constants.d.ts +2 -1
- package/components/timepicker/constants.js +3 -2
- package/components/timepicker/index.spec.js +36 -35
- package/components/timepicker/useStep.js +3 -3
- package/components/timepicker/useValue.js +2 -2
- package/components/tooltip/index.spec.js +28 -24
- package/components/transfer/index.spec.js +20 -19
- package/components/tree/index.d.ts +1 -1
- package/components/tree/index.js +1 -1
- package/components/tree/index.spec.js +20 -19
- package/components/tree/index.vdt.js +1 -0
- package/components/tree/styles.js +5 -1
- package/components/treeSelect/index.spec.js +5 -5
- package/components/treeSelect/styles.js +5 -1
- package/components/upload/index.d.ts +1 -1
- package/components/upload/index.spec.js +1 -1
- package/components/upload/index.vdt.js +10 -11
- package/components/upload/styles.js +5 -1
- package/components/utils.d.ts +1 -1
- package/components/wave/index.d.ts +19 -0
- package/components/wave/index.js +120 -0
- package/components/wave/styles.d.ts +2 -0
- package/components/wave/styles.js +17 -0
- package/hooks/useRouter.d.ts +1 -0
- package/hooks/useRouter.js +10 -0
- package/index.d.ts +3 -2
- package/index.js +3 -2
- package/install.d.ts +2 -0
- package/package.json +2 -12
- package/styles/global.js +4 -3
- package/styles/theme.d.ts +16 -7
- package/styles/theme.js +15 -7
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import { __decorate } from "tslib";
|
|
4
|
+
import { Component, findDomFromVNode } from 'intact-vue-next';
|
|
5
|
+
import { isArray } from 'intact-shared';
|
|
6
|
+
import { bind } from '../utils';
|
|
7
|
+
import { makeStyles } from './styles';
|
|
8
|
+
import { theme } from '../../styles/theme';
|
|
9
|
+
var typeDefs = {
|
|
10
|
+
disabled: Boolean,
|
|
11
|
+
color: String,
|
|
12
|
+
inset: String
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var defaults = function defaults() {
|
|
16
|
+
return {
|
|
17
|
+
color: theme.color.primary,
|
|
18
|
+
inset: '-1px'
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var Wave = /*#__PURE__*/function (_Component) {
|
|
23
|
+
_inheritsLoose(Wave, _Component);
|
|
24
|
+
|
|
25
|
+
function Wave() {
|
|
26
|
+
var _context;
|
|
27
|
+
|
|
28
|
+
var _this;
|
|
29
|
+
|
|
30
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
31
|
+
args[_key] = arguments[_key];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
35
|
+
_this.instance = null;
|
|
36
|
+
_this.className = void 0;
|
|
37
|
+
_this.timer = 0;
|
|
38
|
+
return _this;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var _proto = Wave.prototype;
|
|
42
|
+
|
|
43
|
+
_proto.initClassName = function initClassName() {
|
|
44
|
+
var _this$get = this.get(),
|
|
45
|
+
color = _this$get.color,
|
|
46
|
+
inset = _this$get.inset;
|
|
47
|
+
|
|
48
|
+
this.className = makeStyles(color || theme.color.primary, inset);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
_proto.mounted = function mounted() {
|
|
52
|
+
var children = this.get('children');
|
|
53
|
+
var node = findDomFromVNode(children, true);
|
|
54
|
+
|
|
55
|
+
if (!node || node.nodeType !== 1) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.instance = node;
|
|
60
|
+
node.addEventListener('click', this.onClick);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_proto.beforeUnmount = function beforeUnmount() {
|
|
64
|
+
if (this.instance) {
|
|
65
|
+
this.instance.removeEventListener('click', this.onClick);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this.resetAnimation();
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
_proto.onClick = function onClick(e) {
|
|
72
|
+
var _this2 = this;
|
|
73
|
+
|
|
74
|
+
this.initClassName();
|
|
75
|
+
var instance = this.instance;
|
|
76
|
+
|
|
77
|
+
var _this$get2 = this.get(),
|
|
78
|
+
disabled = _this$get2.disabled;
|
|
79
|
+
|
|
80
|
+
var node = e.target; // 点击输入框中的icon时,此时输入框不需要动效
|
|
81
|
+
|
|
82
|
+
var isInput = instance.classList.contains('k-input-wrapper');
|
|
83
|
+
if (disabled || isInput && node.classList.contains('k-icon')) return;
|
|
84
|
+
this.resetAnimation();
|
|
85
|
+
instance.addEventListener('animationend', this.resetAnimation);
|
|
86
|
+
this.timer = window.setTimeout(function () {
|
|
87
|
+
instance.classList.add(_this2.className);
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
_proto.resetAnimation = function resetAnimation() {
|
|
92
|
+
var node = this.instance;
|
|
93
|
+
if (!node) return;
|
|
94
|
+
node.classList.remove(this.className);
|
|
95
|
+
node.removeEventListener('animationend', this.resetAnimation);
|
|
96
|
+
clearTimeout(this.timer);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return Wave;
|
|
100
|
+
}(Component);
|
|
101
|
+
Wave.typeDefs = typeDefs;
|
|
102
|
+
Wave.defaults = defaults;
|
|
103
|
+
|
|
104
|
+
Wave.template = function () {
|
|
105
|
+
var children = this.get('children');
|
|
106
|
+
|
|
107
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
108
|
+
if (!children || isArray(children) && children.length > 1) {
|
|
109
|
+
throw new Error('Wave must receive only one Element children');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return children;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
__decorate([bind], Wave.prototype, "mounted", null);
|
|
117
|
+
|
|
118
|
+
__decorate([bind], Wave.prototype, "onClick", null);
|
|
119
|
+
|
|
120
|
+
__decorate([bind], Wave.prototype, "resetAnimation", null);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { css, keyframes } from '@emotion/css';
|
|
2
|
+
import { theme, setDefault } from '../../styles/theme';
|
|
3
|
+
import { deepDefaults } from '../../styles/utils';
|
|
4
|
+
import '../../styles/global';
|
|
5
|
+
var defaults = {
|
|
6
|
+
inset: '-3px'
|
|
7
|
+
};
|
|
8
|
+
var wave;
|
|
9
|
+
setDefault(function () {
|
|
10
|
+
wave = deepDefaults(theme, {
|
|
11
|
+
wave: defaults
|
|
12
|
+
}).wave;
|
|
13
|
+
});
|
|
14
|
+
export function makeStyles(color, inset) {
|
|
15
|
+
var waveEffect = /*#__PURE__*/keyframes("100%{top:calc(", inset, " + ", wave.inset, ");bottom:calc(", inset, " + ", wave.inset, ");left:calc(", inset, " + ", wave.inset, ");right:calc(", inset, " + ", wave.inset, ");opacity:0.05;}");
|
|
16
|
+
return /*#__PURE__*/css("position:relative;&::after{display:block;content:'';position:absolute;top:", inset, ";bottom:", inset, ";left:", inset, ";right:", inset, ";opacity:0.4;border-radius:4px;z-index:2;animation:", waveEffect, " .2s ease-in;animation-fill-mode:forwards;border:2px solid ", color, ";}&.k-circle,&.k-radio-wrapper{&:after{border-radius:calc(", theme.large.height, " / 2 + 4px);}}");
|
|
17
|
+
}
|
package/hooks/useRouter.d.ts
CHANGED
package/hooks/useRouter.js
CHANGED
|
@@ -19,6 +19,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
19
19
|
* in Vue, find the $router
|
|
20
20
|
*/
|
|
21
21
|
import { useInstance, createRef, onMounted } from 'intact-vue-next';
|
|
22
|
+
import { isExternalLink } from '../components/utils';
|
|
22
23
|
export function useRouter() {
|
|
23
24
|
var instance = useInstance();
|
|
24
25
|
var ref = createRef();
|
|
@@ -27,6 +28,15 @@ export function useRouter() {
|
|
|
27
28
|
});
|
|
28
29
|
return ref;
|
|
29
30
|
}
|
|
31
|
+
export function navigate(router, to) {
|
|
32
|
+
if (to) {
|
|
33
|
+
if (router && !isExternalLink(to)) {
|
|
34
|
+
router.push(to);
|
|
35
|
+
} else {
|
|
36
|
+
location.href = to;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
30
40
|
|
|
31
41
|
function findRouter(instance) {
|
|
32
42
|
var Component = instance.constructor;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.0
|
|
2
|
+
* @king-design v2.0.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -55,7 +55,8 @@ export * from './components/transfer';
|
|
|
55
55
|
export * from './components/tree';
|
|
56
56
|
export * from './components/treeSelect';
|
|
57
57
|
export * from './components/upload';
|
|
58
|
-
export
|
|
58
|
+
export * from './components/wave';
|
|
59
|
+
export declare const version = "2.0.0";
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
export {normalize} from 'intact-vue-next';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.0.0
|
|
2
|
+
* @king-design v2.0.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -57,7 +57,8 @@ export * from './components/transfer';
|
|
|
57
57
|
export * from './components/tree';
|
|
58
58
|
export * from './components/treeSelect';
|
|
59
59
|
export * from './components/upload';
|
|
60
|
-
export
|
|
60
|
+
export * from './components/wave';
|
|
61
|
+
export var version = '2.0.0';
|
|
61
62
|
/* generate end */
|
|
62
63
|
|
|
63
64
|
export {normalize} from 'intact-vue-next';
|
package/install.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/vue",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "King-Design UI components for Vue3.0.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
"king-design",
|
|
13
13
|
"kpc"
|
|
14
14
|
],
|
|
15
|
-
"files": [
|
|
16
|
-
"components",
|
|
17
|
-
"hooks",
|
|
18
|
-
"i18n",
|
|
19
|
-
"styles",
|
|
20
|
-
"dist",
|
|
21
|
-
"index.js",
|
|
22
|
-
"install.js",
|
|
23
|
-
"index.d.ts"
|
|
24
|
-
],
|
|
25
15
|
"author": "Javey <jiawei23716@sina.com>",
|
|
26
16
|
"homepage": "https://design.ksyun.com",
|
|
27
17
|
"license": "MIT",
|
|
@@ -48,7 +38,7 @@
|
|
|
48
38
|
"dayjs": "^1.10.7",
|
|
49
39
|
"downloadjs": "^1.4.7",
|
|
50
40
|
"enquire.js": "^2.1.6",
|
|
51
|
-
"intact-vue-next": "^3.0.0
|
|
41
|
+
"intact-vue-next": "^3.0.0",
|
|
52
42
|
"monaco-editor": "^0.26.1",
|
|
53
43
|
"mxgraphx": "^4.0.7",
|
|
54
44
|
"resize-observer-polyfill": "^1.5.1",
|
package/styles/global.js
CHANGED
|
@@ -4,6 +4,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
|
4
4
|
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
5
5
|
import { injectGlobal } from '@emotion/css';
|
|
6
6
|
import { theme } from './theme';
|
|
7
|
+
import { palette } from '../styles/utils';
|
|
7
8
|
var slideDirections = {
|
|
8
9
|
down: 'center top 0',
|
|
9
10
|
up: 'center bottom 0',
|
|
@@ -11,6 +12,6 @@ var slideDirections = {
|
|
|
11
12
|
right: 'left center 0'
|
|
12
13
|
}; // TODO: update global when theme changed
|
|
13
14
|
|
|
14
|
-
injectGlobal("html{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,SF Pro SC,SF Pro Text,Helvetica Neue,Helvetica,PingFang SC,Segoe UI,Roboto,Hiragino Sans GB,arial,microsoft yahei ui,Microsoft YaHei,SimSun,sans-serif;}body{font-size:", theme.fontSize, ";line-height:", theme.lineHeight, ";margin:0;padding:0;color:", theme.color.text, ";}*,*:before,*:after{box-sizing:inherit;}", _mapInstanceProperty(_context = _Object$keys(slideDirections)).call(_context, function (direction) {
|
|
15
|
-
return "\n .k-slide" + direction + "-enter-from,\n .k-slide" + direction + "-leave-to {\n transform-origin: " + slideDirections[direction] + ";\n opacity: 0;\n transform: " + (direction === 'down' || direction === 'up' ? "scaleY(.8)" : 'scaleX(.8)') + ";\n }\n .k-slide" + direction + "-enter-active,\n .k-slide" + direction + "-leave-active {\n transform-origin: " + slideDirections[direction] + ";\n transition: opacity " + theme.transition + ", transform " + theme.transition + " !important;\n pointer-events: none;\n }\n ";
|
|
16
|
-
}).join(''), " .k-fade-enter-from,.k-fade-leave-to{opacity:0!important;}.k-fade-enter-active,.k-fade-leave-active{transition:opacity ", theme.transition, ";}.k-fade-leave-active:not(tr){position:absolute;}.k-fade-move{transition:transform ", theme.transition, ";}.k-scale-enter-from,.k-scale-leave-to{transform:scale(0);}.k-scale-enter-active,.k-scale-leave-active{transition:transform ", theme.transition, ";}.k-expand-enter-from,.k-expand-leave-to{opacity:0;overflow:hidden;}.k-expand-enter-active,.k-expand-leave-active{transition:all ", theme.transition, "!important;overflow:hidden;}.k-expand-move{transition:transform ", theme.transition, ";}.k-dropdown-enter-from,.k-dropdown-leave-to{opacity:0;transform:translateY(-20px);}.k-dropdown-enter-active,.k-dropdown-leave-active,.k-dropdown-move{transition:all ", theme.transition, ";}.k-dropdown-leave-active{position:absolute!important;}.k-dropdown-move{transition:transform ", theme.transition, ";}.c-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.c-hidden{display:none;}.c-middle{display:inline-block;vertical-align:middle;}");
|
|
15
|
+
injectGlobal("html{--var-wave-color:", theme.color.primary, ";box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,SF Pro SC,SF Pro Text,Helvetica Neue,Helvetica,PingFang SC,Segoe UI,Roboto,Hiragino Sans GB,arial,microsoft yahei ui,Microsoft YaHei,SimSun,sans-serif;}body{font-size:", theme.fontSize, ";line-height:", theme.lineHeight, ";margin:0;padding:0;color:", theme.color.text, ";}*,*:before,*:after{box-sizing:inherit;}", _mapInstanceProperty(_context = _Object$keys(slideDirections)).call(_context, function (direction) {
|
|
16
|
+
return "\n .k-slide" + direction + "-enter-from,\n .k-slide" + direction + "-leave-to {\n transform-origin: " + slideDirections[direction] + ";\n opacity: 0;\n transform: " + (direction === 'down' || direction === 'up' ? "scaleY(.8)" : 'scaleX(.8)') + ";\n }\n .k-slide" + direction + "-enter-active,\n .k-slide" + direction + "-leave-active {\n transform-origin: " + slideDirections[direction] + ";\n transition: opacity " + theme.transition.large + ", transform " + theme.transition.large + " !important;\n pointer-events: none;\n }\n ";
|
|
17
|
+
}).join(''), " .k-fade-enter-from,.k-fade-leave-to{opacity:0!important;}.k-fade-enter-active,.k-fade-leave-active{transition:opacity ", theme.transition.large, ";}.k-fade-leave-active:not(tr){position:absolute;}.k-fade-move{transition:transform ", theme.transition.large, ";}.k-scale-enter-from,.k-scale-leave-to{transform:scale(0);}.k-scale-enter-active,.k-scale-leave-active{transition:transform ", theme.transition.large, ";}.k-expand-enter-from,.k-expand-leave-to{opacity:0;overflow:hidden;}.k-expand-enter-active,.k-expand-leave-active{transition:all ", theme.transition.large, "!important;overflow:hidden;}.k-expand-move{transition:transform ", theme.transition.large, ";}.k-dropdown-enter-from,.k-dropdown-leave-to{opacity:0;transform:translateY(-20px);}.k-dropdown-enter-active,.k-dropdown-leave-active,.k-dropdown-move{transition:all ", theme.transition.large, ";}.k-dropdown-leave-active{position:absolute!important;}.k-dropdown-move{transition:transform ", theme.transition.large, ";}.k-fade-in-left-enter-from,.k-fade-in-left-leave-to{opacity:0;transform:translate3d(-15px, 0, 0);}.k-fade-in-left-enter-active,.k-fade-in-left-leave-active{transition:all ", theme.transition.large, ";td{background:", palette(theme.color.primary, -4), "!important;}}.k-fade-in-left-move{transition:transform ", theme.transition.large, ";}.k-fade-expand-enter-from,.k-fade-expand-leave-to{opacity:0;}.k-fade-expand-enter-active,.k-fade-expand-leave-active{transition:all ", theme.transition.large, ";background:", palette(theme.color.primary, -4), "!important;}.c-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.c-hidden{display:none;}.c-middle{display:inline-block;vertical-align:middle;}");
|
package/styles/theme.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare type ThemeValue<T> = T;
|
|
2
1
|
export declare type Theme = {
|
|
3
|
-
[name: string]:
|
|
2
|
+
[name: string]: string | number | Theme;
|
|
4
3
|
};
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function defaultTheme(): {
|
|
6
5
|
large: {
|
|
7
6
|
height: string;
|
|
8
7
|
fontSize: string;
|
|
@@ -24,7 +23,6 @@ export declare function defualtTheme(): {
|
|
|
24
23
|
padding: string;
|
|
25
24
|
};
|
|
26
25
|
color: {
|
|
27
|
-
lightBlack: string;
|
|
28
26
|
primary: string;
|
|
29
27
|
warning: string;
|
|
30
28
|
danger: string;
|
|
@@ -38,9 +36,11 @@ export declare function defualtTheme(): {
|
|
|
38
36
|
placeholder: string;
|
|
39
37
|
readonly link: string;
|
|
40
38
|
readonly linkHover: string;
|
|
39
|
+
readonly hoverBg: string;
|
|
41
40
|
disabled: string;
|
|
42
41
|
disabledBg: string;
|
|
43
42
|
disabledBorder: string;
|
|
43
|
+
lightBlack: string;
|
|
44
44
|
};
|
|
45
45
|
borderRadius: string;
|
|
46
46
|
boxShadow: string;
|
|
@@ -48,7 +48,11 @@ export declare function defualtTheme(): {
|
|
|
48
48
|
lineHeight: number;
|
|
49
49
|
maxZIndex: number;
|
|
50
50
|
midZIndex: number;
|
|
51
|
-
transition:
|
|
51
|
+
transition: {
|
|
52
|
+
small: string;
|
|
53
|
+
middle: string;
|
|
54
|
+
large: string;
|
|
55
|
+
};
|
|
52
56
|
};
|
|
53
57
|
declare let theme: {
|
|
54
58
|
large: {
|
|
@@ -72,7 +76,6 @@ declare let theme: {
|
|
|
72
76
|
padding: string;
|
|
73
77
|
};
|
|
74
78
|
color: {
|
|
75
|
-
lightBlack: string;
|
|
76
79
|
primary: string;
|
|
77
80
|
warning: string;
|
|
78
81
|
danger: string;
|
|
@@ -86,9 +89,11 @@ declare let theme: {
|
|
|
86
89
|
placeholder: string;
|
|
87
90
|
readonly link: string;
|
|
88
91
|
readonly linkHover: string;
|
|
92
|
+
readonly hoverBg: string;
|
|
89
93
|
disabled: string;
|
|
90
94
|
disabledBg: string;
|
|
91
95
|
disabledBorder: string;
|
|
96
|
+
lightBlack: string;
|
|
92
97
|
};
|
|
93
98
|
borderRadius: string;
|
|
94
99
|
boxShadow: string;
|
|
@@ -96,7 +101,11 @@ declare let theme: {
|
|
|
96
101
|
lineHeight: number;
|
|
97
102
|
maxZIndex: number;
|
|
98
103
|
midZIndex: number;
|
|
99
|
-
transition:
|
|
104
|
+
transition: {
|
|
105
|
+
small: string;
|
|
106
|
+
middle: string;
|
|
107
|
+
large: string;
|
|
108
|
+
};
|
|
100
109
|
};
|
|
101
110
|
export declare function resetTheme(): void;
|
|
102
111
|
export { theme };
|
package/styles/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { palette, deepExtends } from './utils';
|
|
2
|
-
export function
|
|
2
|
+
export function defaultTheme() {
|
|
3
3
|
return {
|
|
4
4
|
large: {
|
|
5
5
|
height: '40px',
|
|
@@ -22,7 +22,6 @@ export function defualtTheme() {
|
|
|
22
22
|
padding: '8px'
|
|
23
23
|
},
|
|
24
24
|
color: {
|
|
25
|
-
lightBlack: '#737373',
|
|
26
25
|
primary: '#0091ea',
|
|
27
26
|
warning: '#ff9800',
|
|
28
27
|
danger: '#ff4133',
|
|
@@ -43,22 +42,31 @@ export function defualtTheme() {
|
|
|
43
42
|
return palette(theme.color.primary, -1);
|
|
44
43
|
},
|
|
45
44
|
|
|
45
|
+
get hoverBg() {
|
|
46
|
+
return palette(theme.color.primary, -4);
|
|
47
|
+
},
|
|
48
|
+
|
|
46
49
|
disabled: '#ccc',
|
|
47
50
|
disabledBg: '#f2f2f2',
|
|
48
|
-
disabledBorder: '#ccc'
|
|
51
|
+
disabledBorder: '#ccc',
|
|
52
|
+
lightBlack: '#737373'
|
|
49
53
|
},
|
|
50
54
|
borderRadius: '2px',
|
|
51
|
-
boxShadow: '0 0
|
|
55
|
+
boxShadow: '0 0 16px 0 rgba(0, 0, 0, .1)',
|
|
52
56
|
fontSize: '12px',
|
|
53
57
|
lineHeight: 1.5,
|
|
54
58
|
maxZIndex: 9999,
|
|
55
59
|
midZIndex: 999,
|
|
56
|
-
transition:
|
|
60
|
+
transition: {
|
|
61
|
+
small: '.1s cubic-bezier(0.42, 0, 0.58, 1)',
|
|
62
|
+
middle: '.2s cubic-bezier(0.25, 0.1, 0.25, 1)',
|
|
63
|
+
large: '.3s cubic-bezier(0.25, 0.1, 0.25, 1)'
|
|
64
|
+
}
|
|
57
65
|
};
|
|
58
66
|
}
|
|
59
|
-
var theme =
|
|
67
|
+
var theme = defaultTheme();
|
|
60
68
|
export function resetTheme() {
|
|
61
|
-
theme =
|
|
69
|
+
theme = defaultTheme();
|
|
62
70
|
}
|
|
63
71
|
export { theme };
|
|
64
72
|
var queue = [];
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
// "extends": "../../tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// "outDir": "./build",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"paths": {
|
|
12
|
+
"vue": ["./node_modules/vue"],
|
|
13
|
+
"kpc-vue-next": ["./"],
|
|
14
|
+
"kpc-vue-next/*": ["./*"],
|
|
15
|
+
"@/*": ["../../*"]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"../../typings",
|
|
20
|
+
"../../test/utils.ts"
|
|
21
|
+
]
|
|
22
|
+
}
|