@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,43 @@
|
|
|
1
|
+
import {createApp, render} from 'vue';
|
|
2
|
+
import {mount, unmount, dispatchEvent, getElement, wait} from '@/test/utils';
|
|
3
|
+
import {Dropdown, DropdownMenu, DropdownItem} from '../../';
|
|
4
|
+
|
|
5
|
+
describe('Dropdown', () => {
|
|
6
|
+
it('should save original events', async () => {
|
|
7
|
+
const click = sinon.spy();
|
|
8
|
+
const container = document.createElement('div');
|
|
9
|
+
document.body.appendChild(container);
|
|
10
|
+
const vue = createApp({
|
|
11
|
+
template: `
|
|
12
|
+
<div>
|
|
13
|
+
<Dropdown>
|
|
14
|
+
<button ref="button" @click="test">
|
|
15
|
+
hover
|
|
16
|
+
</button>
|
|
17
|
+
<DropdownMenu>
|
|
18
|
+
<DropdownItem>item 1</DropdownItem>
|
|
19
|
+
<DropdownItem>item 2</DropdownItem>
|
|
20
|
+
<DropdownItem>item 3</DropdownItem>
|
|
21
|
+
</DropdownMenu>
|
|
22
|
+
</Dropdown>
|
|
23
|
+
</div>
|
|
24
|
+
`,
|
|
25
|
+
components: {
|
|
26
|
+
Dropdown, DropdownMenu, DropdownItem
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
test() {
|
|
30
|
+
click();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}).mount(container);
|
|
34
|
+
|
|
35
|
+
(vue.$refs.button as HTMLElement).click();
|
|
36
|
+
await wait();
|
|
37
|
+
expect(click.callCount).to.eql(1);
|
|
38
|
+
expect(getElement('.k-dropdown-menu')).to.be.exist;
|
|
39
|
+
|
|
40
|
+
render(null, container);
|
|
41
|
+
document.body.removeChild(container);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {createApp, render, h} from 'vue';
|
|
2
|
+
import {Component, createRef} from 'intact';
|
|
3
|
+
import {mount, unmount, testDemos, wait, nextFrame} from '@/test/utils';
|
|
4
|
+
import {matchSnapshot} from 'chai-karma-snapshot';
|
|
5
|
+
import mx from '../components/diagram/mxgraph/mx';
|
|
6
|
+
import '../../../test/test.styl';
|
|
7
|
+
|
|
8
|
+
chai.use(matchSnapshot);
|
|
9
|
+
|
|
10
|
+
mx.mxClient.IS_POINTER = false;
|
|
11
|
+
|
|
12
|
+
const testsContext = require.context('./components/', true, /.*\.spec\.ts/);
|
|
13
|
+
testsContext.keys().forEach(testsContext);
|
|
14
|
+
|
|
15
|
+
const reactReq = require.context('~/components/', true, /^((?!(affix|code)).)*\/demos\/.*next\.vue$/);
|
|
16
|
+
// const reactReq = require.context('~/components/', true, /button\/demos\/.*next\.vue$/);
|
|
17
|
+
|
|
18
|
+
describe('Vue Next Demos', () => {
|
|
19
|
+
afterEach(() => unmount());
|
|
20
|
+
|
|
21
|
+
function wrap(Demo: any) {
|
|
22
|
+
return class extends Component {
|
|
23
|
+
static template = '<div ref={this.elementRef}></div>';
|
|
24
|
+
private elementRef = createRef<HTMLElement>();
|
|
25
|
+
|
|
26
|
+
mounted() {
|
|
27
|
+
createApp({
|
|
28
|
+
render: () => h(Demo)
|
|
29
|
+
}).mount(this.elementRef.value!);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
beforeUnmount() {
|
|
33
|
+
render(null, this.elementRef.value!);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
testDemos(reactReq, async (Demo) => {
|
|
39
|
+
const [instance, element] = mount(wrap(Demo as any));
|
|
40
|
+
await wait();
|
|
41
|
+
// FIXME: I don't why the width of `autoWidth` input is an unexpected value
|
|
42
|
+
// while we run test on Github Actions.
|
|
43
|
+
const innerHTML = element.innerHTML.replace(/(\<input.*?style="width: )(?:.*?)(px;")/g, '$1$2');
|
|
44
|
+
expect(innerHTML).to.matchSnapshot();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const createWebpackConfig = require('./webpack.config');
|
|
4
|
+
|
|
5
|
+
const isDebug = !process.env.UPDATE && !process.env.CI
|
|
6
|
+
|
|
7
|
+
// for get font files
|
|
8
|
+
// https://github.com/ryanclark/karma-webpack/issues/498#issuecomment-790040818
|
|
9
|
+
const output = {
|
|
10
|
+
path: path.join(os.tmpdir(), '_karma_webpack_') + Math.floor(Math.random() * 1000000),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = function (config) {
|
|
14
|
+
config.set({
|
|
15
|
+
browsers: process.env.UPDATE || process.env.CI ? ['MyChromeHeadless'] : undefined,
|
|
16
|
+
customLaunchers: {
|
|
17
|
+
'MyChromeHeadless': {
|
|
18
|
+
base: 'ChromeHeadless',
|
|
19
|
+
flags: ['--window-size=1920,1080', '--force-device-scale-factor=1'],
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
frameworks: ['webpack', 'mocha', 'sinon-chai', 'snapshot', 'mocha-snapshot'],
|
|
23
|
+
reporters: ['mocha'],
|
|
24
|
+
files: [
|
|
25
|
+
'./index.ts',
|
|
26
|
+
'./__snapshots__/**/*.md',
|
|
27
|
+
],
|
|
28
|
+
preprocessors: {
|
|
29
|
+
'./index.ts': ['webpack', 'sourcemap'],
|
|
30
|
+
'./__snapshots__/**/*.md': ['snapshot'],
|
|
31
|
+
},
|
|
32
|
+
webpack: {...createWebpackConfig().toConfig(), output},
|
|
33
|
+
// webpack: createWebpackConfig().toConfig(),
|
|
34
|
+
webpackMiddleware: {
|
|
35
|
+
// noInfo: true
|
|
36
|
+
},
|
|
37
|
+
autoWatch: true,
|
|
38
|
+
mochaReporter: {
|
|
39
|
+
showDiff: true,
|
|
40
|
+
},
|
|
41
|
+
client: {
|
|
42
|
+
mocha: {
|
|
43
|
+
reporter: 'html',
|
|
44
|
+
ui: 'bdd',
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
snapshot: {
|
|
48
|
+
update: process.env.UPDATE === '1',
|
|
49
|
+
prune: process.env.UPDATE === '3',
|
|
50
|
+
},
|
|
51
|
+
logLevel: config.LOG_INFO,
|
|
52
|
+
singleRun: !isDebug,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const genConfig = require('../../../scripts/webpack');
|
|
3
|
+
const {VueLoaderPlugin} = require('vue-loader');
|
|
4
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
|
|
5
|
+
const {addConfig} = require('../../../test/webpack');
|
|
6
|
+
|
|
7
|
+
const resolve = (p) => path.resolve(__dirname, p);
|
|
8
|
+
|
|
9
|
+
module.exports = function() {
|
|
10
|
+
const config = genConfig()
|
|
11
|
+
// .context(resolve(''))
|
|
12
|
+
.module
|
|
13
|
+
.rule('ts')
|
|
14
|
+
.test(/\.ts$/)
|
|
15
|
+
.use('ts')
|
|
16
|
+
.loader('ts-loader')
|
|
17
|
+
.options({
|
|
18
|
+
appendTsSuffixTo: [/\.vue$/],
|
|
19
|
+
configFile: resolve('../tsconfig.json'),
|
|
20
|
+
happyPackMode: true,
|
|
21
|
+
})
|
|
22
|
+
.end()
|
|
23
|
+
.end()
|
|
24
|
+
.rule('vue')
|
|
25
|
+
.test(/\.vue$/)
|
|
26
|
+
.use('vue')
|
|
27
|
+
.loader(resolve('../node_modules/vue-loader'))
|
|
28
|
+
.end()
|
|
29
|
+
.end()
|
|
30
|
+
.end()
|
|
31
|
+
.resolve
|
|
32
|
+
.alias
|
|
33
|
+
.set('vue$', resolve('../node_modules/vue/dist/vue.esm-bundler.js'))
|
|
34
|
+
.set('vue-router', resolve('../node_modules/vue-router/dist/vue-router.esm-bundler.js'))
|
|
35
|
+
.end()
|
|
36
|
+
.end()
|
|
37
|
+
.plugin('vue')
|
|
38
|
+
.use(VueLoaderPlugin)
|
|
39
|
+
.end()
|
|
40
|
+
.devtool('inline-source-map');
|
|
41
|
+
|
|
42
|
+
config.stats({
|
|
43
|
+
errorDetails: true
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
addConfig(config);
|
|
47
|
+
|
|
48
|
+
// config.plugin('ts-checker').use(ForkTsCheckerWebpackPlugin, [{
|
|
49
|
+
// typescript: {
|
|
50
|
+
// configFile: resolve('../tsconfig.json'),
|
|
51
|
+
// diagnosticOptions: {
|
|
52
|
+
// semantic: true,
|
|
53
|
+
// syntactic: true,
|
|
54
|
+
// },
|
|
55
|
+
// },
|
|
56
|
+
// }]);
|
|
57
|
+
|
|
58
|
+
return config;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
2
|
export interface BreadcrumbItemProps {
|
|
3
|
-
to?: string;
|
|
3
|
+
to?: string | object;
|
|
4
4
|
}
|
|
5
5
|
export declare class BreadcrumbItem extends Component<BreadcrumbItemProps> {
|
|
6
6
|
static template: string | import("intact").Template<any>;
|
|
@@ -4,10 +4,9 @@ import { __decorate } from "tslib";
|
|
|
4
4
|
import { Component } from 'intact-vue-next';
|
|
5
5
|
import { bind } from '../utils';
|
|
6
6
|
import template from './item.vdt';
|
|
7
|
-
import {
|
|
8
|
-
import { useRouter } from '../../hooks/useRouter';
|
|
7
|
+
import { useRouter, navigate } from '../../hooks/useRouter';
|
|
9
8
|
var typeDefs = {
|
|
10
|
-
to: String
|
|
9
|
+
to: [String, Object]
|
|
11
10
|
};
|
|
12
11
|
export var BreadcrumbItem = /*#__PURE__*/function (_Component) {
|
|
13
12
|
_inheritsLoose(BreadcrumbItem, _Component);
|
|
@@ -29,17 +28,7 @@ export var BreadcrumbItem = /*#__PURE__*/function (_Component) {
|
|
|
29
28
|
var _proto = BreadcrumbItem.prototype;
|
|
30
29
|
|
|
31
30
|
_proto.onClick = function onClick() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (to) {
|
|
35
|
-
var router = this.router.value;
|
|
36
|
-
|
|
37
|
-
if (router && !isExternalLink(to)) {
|
|
38
|
-
router.push(to);
|
|
39
|
-
} else {
|
|
40
|
-
window.location.href = to;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
31
|
+
navigate(this.router.value, this.get('to'));
|
|
43
32
|
};
|
|
44
33
|
|
|
45
34
|
return BreadcrumbItem;
|
|
@@ -24,5 +24,5 @@ setDefault(function () {
|
|
|
24
24
|
}).breadcrumb;
|
|
25
25
|
});
|
|
26
26
|
export default function makeStyles() {
|
|
27
|
-
return /*#__PURE__*/css("font-size:", breadcrumb.fontSize, ";.k-breadcrumb-item{
|
|
27
|
+
return /*#__PURE__*/css("font-size:", breadcrumb.fontSize, ";display:flex;align-items:center;.k-breadcrumb-item{&:last-of-type .k-breadcrumb-link{font-weight:", breadcrumb.activeFontWeight, ";color:", breadcrumb.activeColor, ";}}.k-breadcrumb-link,.k-breadcrumb-link a{color:", breadcrumb.color, ";}a.k-breadcrumb-link,.k-breadcrumb-link a{cursor:pointer;&:hover{color:", breadcrumb.hoverColor, ";}}.k-breadcrumb-separator{margin:0 ", breadcrumb.gap, ";}");
|
|
28
28
|
}
|
|
@@ -4,6 +4,8 @@ import { getRestProps } from '../utils';
|
|
|
4
4
|
import { Icon } from '../icon';
|
|
5
5
|
import { makeButtonStyles } from './styles';
|
|
6
6
|
import { DynamicButton } from './dynamicButton';
|
|
7
|
+
import { Wave } from '../wave';
|
|
8
|
+
import { button as theme } from './styles';
|
|
7
9
|
export default function ($props, $blocks, $__proto__) {
|
|
8
10
|
var _classNameObj;
|
|
9
11
|
|
|
@@ -72,22 +74,29 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
72
74
|
var buttonGroup = this.buttonGroup;
|
|
73
75
|
var checkType = buttonGroup ? buttonGroup.get('checkType') : 'none';
|
|
74
76
|
var isCheckType = checkType !== 'none';
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'
|
|
89
|
-
'
|
|
90
|
-
|
|
91
|
-
|
|
77
|
+
var typeStyles = theme[type];
|
|
78
|
+
var waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
79
|
+
return _$cc(Wave, {
|
|
80
|
+
'disabled': loading || disabled || type === 'none' || type === 'link',
|
|
81
|
+
'inset': '-2px',
|
|
82
|
+
'color': waveColor,
|
|
83
|
+
'children': _$cc(DynamicButton, _extends({
|
|
84
|
+
'className': _$cn(classNameObj),
|
|
85
|
+
'tagName': tagName
|
|
86
|
+
}, getRestProps(this), {
|
|
87
|
+
'ref': this.elementRef,
|
|
88
|
+
'tabindex': disabled || loading ? '-1' : tabindex,
|
|
89
|
+
'ev-click': this.onClick,
|
|
90
|
+
'ev-mouseup': this.onMouseUp,
|
|
91
|
+
'htmlType': htmlType,
|
|
92
|
+
'name': isCheckType ? null : name,
|
|
93
|
+
'children': [loading ? iconSide === 'right' ? [children, loadingIcon] : [loadingIcon, children] : children, isCheckType ? _$ce(64, 'input', null, 1, 'k-button-input', {
|
|
94
|
+
'type': checkType,
|
|
95
|
+
'name': name,
|
|
96
|
+
'checked': checked,
|
|
97
|
+
'tabindex': '-1'
|
|
98
|
+
}) : undefined]
|
|
99
|
+
}), null, this.elementRef)
|
|
100
|
+
});
|
|
92
101
|
}
|
|
93
102
|
;
|
|
@@ -1,6 +1,87 @@
|
|
|
1
1
|
import '../../styles/global';
|
|
2
|
+
declare type TypeStyles = {
|
|
3
|
+
color: string;
|
|
4
|
+
bgColor: string;
|
|
5
|
+
borderColor: string;
|
|
6
|
+
hoverBorderColor: string;
|
|
7
|
+
ghostColor: string;
|
|
8
|
+
};
|
|
9
|
+
declare type SizeStyles = {
|
|
10
|
+
fontSize: string;
|
|
11
|
+
height: string;
|
|
12
|
+
padding: string;
|
|
13
|
+
};
|
|
2
14
|
export declare const types: readonly ["primary", "warning", "danger", "active", "success"];
|
|
3
|
-
declare
|
|
15
|
+
declare const defaults: {
|
|
16
|
+
readonly transition: string;
|
|
17
|
+
active: TypeStyles;
|
|
18
|
+
secondary: {
|
|
19
|
+
readonly color: string;
|
|
20
|
+
readonly borderColor: string;
|
|
21
|
+
readonly hoverBgColor: string;
|
|
22
|
+
readonly activeBgColor: string;
|
|
23
|
+
};
|
|
24
|
+
link: {
|
|
25
|
+
readonly color: string;
|
|
26
|
+
readonly hoverColor: string;
|
|
27
|
+
readonly hoverBgColor: string;
|
|
28
|
+
};
|
|
29
|
+
none: {
|
|
30
|
+
readonly hoverBgColor: string;
|
|
31
|
+
};
|
|
32
|
+
group: {
|
|
33
|
+
primary: {
|
|
34
|
+
readonly borderColor: string;
|
|
35
|
+
};
|
|
36
|
+
warning: {
|
|
37
|
+
readonly borderColor: string;
|
|
38
|
+
};
|
|
39
|
+
danger: {
|
|
40
|
+
readonly borderColor: string;
|
|
41
|
+
};
|
|
42
|
+
success: {
|
|
43
|
+
readonly borderColor: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
} & {
|
|
47
|
+
readonly color: string;
|
|
48
|
+
bgColor: string;
|
|
49
|
+
lineHeight: string;
|
|
50
|
+
readonly padding: string;
|
|
51
|
+
readonly borderColor: string;
|
|
52
|
+
readonly borderRadius: string;
|
|
53
|
+
readonly fontSize: string;
|
|
54
|
+
readonly height: string;
|
|
55
|
+
readonly hoverBorderColor: string;
|
|
56
|
+
readonly hoverColor: string;
|
|
57
|
+
ghost: {
|
|
58
|
+
color: string;
|
|
59
|
+
readonly hoverColor: string;
|
|
60
|
+
borderColor: string;
|
|
61
|
+
readonly hoverBorderColor: string;
|
|
62
|
+
};
|
|
63
|
+
icon: {
|
|
64
|
+
gap: string;
|
|
65
|
+
fontSize: string;
|
|
66
|
+
};
|
|
67
|
+
disabled: {
|
|
68
|
+
readonly color: string;
|
|
69
|
+
readonly bgColor: string;
|
|
70
|
+
readonly borderColor: string;
|
|
71
|
+
readonly ghostBorderColor: string;
|
|
72
|
+
};
|
|
73
|
+
} & {
|
|
74
|
+
primary: TypeStyles;
|
|
75
|
+
warning: TypeStyles;
|
|
76
|
+
danger: TypeStyles;
|
|
77
|
+
success: TypeStyles;
|
|
78
|
+
active: TypeStyles;
|
|
79
|
+
} & {
|
|
80
|
+
small: SizeStyles;
|
|
81
|
+
large: SizeStyles;
|
|
82
|
+
mini: SizeStyles;
|
|
83
|
+
};
|
|
84
|
+
declare let button: typeof defaults;
|
|
4
85
|
export { button };
|
|
5
86
|
export declare function makeButtonStyles({ iconSide }: {
|
|
6
87
|
iconSide?: string;
|
|
@@ -149,6 +149,10 @@ var btnSizeStyles = sizes.reduce(function (memo, size) {
|
|
|
149
149
|
return memo;
|
|
150
150
|
}, {});
|
|
151
151
|
var defaults = deepDefaults({
|
|
152
|
+
get transition() {
|
|
153
|
+
return theme.transition.middle;
|
|
154
|
+
},
|
|
155
|
+
|
|
152
156
|
active: btnActiveStyles,
|
|
153
157
|
secondary: {
|
|
154
158
|
get color() {
|
|
@@ -175,6 +179,16 @@ var defaults = deepDefaults({
|
|
|
175
179
|
|
|
176
180
|
get hoverColor() {
|
|
177
181
|
return theme.color.linkHover;
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
get hoverBgColor() {
|
|
185
|
+
return theme.color.hoverBg;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
},
|
|
189
|
+
none: {
|
|
190
|
+
get hoverBgColor() {
|
|
191
|
+
return theme.color.bg;
|
|
178
192
|
}
|
|
179
193
|
|
|
180
194
|
},
|
|
@@ -221,10 +235,10 @@ export function makeButtonStyles(_ref) {
|
|
|
221
235
|
return cx(
|
|
222
236
|
/*#__PURE__*/
|
|
223
237
|
// extract static styles to individual css method for performance
|
|
224
|
-
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ",
|
|
238
|
+
css("display:inline-flex;align-items:center;justify-content:center;cursor:pointer;height:", button.height, ";padding:", button.padding, ";outline:none;vertical-align:middle;color:", button.color, ";background:", button.bgColor, ";border-radius:", button.borderRadius, ";border:1px solid ", button.borderColor, ";font-size:", button.fontSize, ";white-space:nowrap;transition:all ", button.transition, ";line-height:", button.lineHeight, ";&:hover,&:focus{border-color:", button.hoverBorderColor, ";color:", button.hoverColor, ";}&:active{background:", palette(theme.color.primary, -4), ";}.k-button-input{position:absolute;opacity:0;width:0;height:0;}", _mapInstanceProperty(types).call(types, function (type) {
|
|
225
239
|
var typeStyles = button[type];
|
|
226
240
|
return /*#__PURE__*/css("&.k-", type, "{background:", typeStyles.bgColor, ";color:", typeStyles.color, ";border-color:", typeStyles.borderColor, ";&:hover,&:focus{background:", palette(typeStyles.bgColor, -1), ";border-color:", typeStyles.hoverBorderColor, ";color:", typeStyles.color, ";}&:active{background:", palette(typeStyles.bgColor, 1), ";border-color:", palette(typeStyles.borderColor, 1), ";}}");
|
|
227
|
-
}), "&.k-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}&.k-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";}}&.k-disabled{&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.k-none,&.k-link{
|
|
241
|
+
}), "&.k-secondary{color:", secondary.color, ";border-color:", secondary.borderColor, ";&:hover,&:focus{background:", secondary.hoverBgColor, ";}&:active{background:", secondary.activeBgColor, ";}}&.k-link{color:", link.color, ";&:hover{color:", link.hoverColor, ";background:", link.hoverBgColor, ";}}&.k-disabled{&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.k-none,&.k-link{background:transparent;&,&:hover{border:none;}&.k-active{color:", theme.color.primary, ";}}&.k-none:hover{background:", button.none.hoverBgColor, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
228
242
|
var styles = button[size];
|
|
229
243
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.k-btn-icon{width:", styles.height, ";}}");
|
|
230
244
|
}), "&.k-btn-icon{width:", button.height, ";padding:0;.k-icon{margin:0;}}&.k-fluid{width:100%;padding:0;}&.k-circle{border-radius:calc(", button.large.height, " / 2);}&.k-loading{", _mapInstanceProperty(types).call(types, function (type) {
|
|
@@ -3,7 +3,10 @@ import { theme, setDefault } from '../../styles/theme';
|
|
|
3
3
|
import { deepDefaults } from '../../styles/utils';
|
|
4
4
|
import '../../styles/global';
|
|
5
5
|
var defaults = {
|
|
6
|
-
transition
|
|
6
|
+
get transition() {
|
|
7
|
+
return theme.transition.large;
|
|
8
|
+
},
|
|
9
|
+
|
|
7
10
|
height: "300px",
|
|
8
11
|
indicator: {
|
|
9
12
|
bottom: "8px",
|
|
@@ -48,7 +48,7 @@ export function useSlide(getItems, getItemsWithCloned) {
|
|
|
48
48
|
|
|
49
49
|
function _translateToItem() {
|
|
50
50
|
_translateToItem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(item, oldIndex, newIndex, keepDirection) {
|
|
51
|
-
var itemsWithCloned, length;
|
|
51
|
+
var itemsWithCloned, length, lengthWithCloned;
|
|
52
52
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
53
53
|
while (1) {
|
|
54
54
|
switch (_context.prev = _context.next) {
|
|
@@ -62,7 +62,7 @@ export function useSlide(getItems, getItemsWithCloned) {
|
|
|
62
62
|
|
|
63
63
|
case 2:
|
|
64
64
|
if (!keepDirection) {
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 14;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -75,25 +75,26 @@ export function useSlide(getItems, getItemsWithCloned) {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
_context.next = 8;
|
|
78
|
-
return setTranslate(itemsWithCloned[
|
|
78
|
+
return setTranslate(itemsWithCloned[(itemsWithCloned.length - length) / 2 - 1], false);
|
|
79
79
|
|
|
80
80
|
case 8:
|
|
81
|
-
_context.next =
|
|
81
|
+
_context.next = 14;
|
|
82
82
|
break;
|
|
83
83
|
|
|
84
84
|
case 10:
|
|
85
85
|
if (!(oldIndex === 0 && newIndex === length - 1)) {
|
|
86
|
-
_context.next =
|
|
86
|
+
_context.next = 14;
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
lengthWithCloned = itemsWithCloned.length;
|
|
91
|
+
_context.next = 14;
|
|
92
|
+
return setTranslate(itemsWithCloned[lengthWithCloned - (lengthWithCloned - length) / 2], false);
|
|
92
93
|
|
|
93
|
-
case
|
|
94
|
+
case 14:
|
|
94
95
|
setTranslate(item, true);
|
|
95
96
|
|
|
96
|
-
case
|
|
97
|
+
case 15:
|
|
97
98
|
case "end":
|
|
98
99
|
return _context.stop();
|
|
99
100
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
3
|
var _excluded = ["className", "disabled", "falseValue", "children", "value", "trueValue", "style", "indeterminate", "title"];
|
|
4
|
-
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce } from 'intact-vue-next';
|
|
4
|
+
import { createVNode as _$cv, className as _$cn, createUnknownComponentVNode as _$cc, createElementVNode as _$ce } from 'intact-vue-next';
|
|
5
5
|
import { getRestProps } from '../utils';
|
|
6
6
|
import makeStyles from './styles';
|
|
7
|
+
import { Wave } from '../wave';
|
|
7
8
|
export default function ($props, $blocks, $__proto__) {
|
|
8
9
|
var _classNameObj;
|
|
9
10
|
|
|
@@ -51,15 +52,19 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
51
52
|
'title': title,
|
|
52
53
|
'ev-click': this.onClick,
|
|
53
54
|
'ev-keypress': this.onKeypress
|
|
54
|
-
}, events), [_$
|
|
55
|
-
'type': 'checkbox',
|
|
56
|
-
'checked': isChecked,
|
|
57
|
-
'value': trueValue,
|
|
58
|
-
'trueValue': trueValue,
|
|
59
|
-
'falseValue': falseValue,
|
|
55
|
+
}, events), [_$cc(Wave, {
|
|
60
56
|
'disabled': disabled,
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
|
|
57
|
+
'inset': '-2px',
|
|
58
|
+
'children': _$ce(2, 'span', _$cv('input', _extends({
|
|
59
|
+
'type': 'checkbox',
|
|
60
|
+
'checked': isChecked,
|
|
61
|
+
'value': trueValue,
|
|
62
|
+
'trueValue': trueValue,
|
|
63
|
+
'falseValue': falseValue,
|
|
64
|
+
'disabled': disabled,
|
|
65
|
+
'tabindex': '-1',
|
|
66
|
+
'ref': this.inputRef
|
|
67
|
+
}, getRestProps(this, rest))), 2, 'k-checkbox-wrapper')
|
|
68
|
+
}), children ? _$ce(2, 'span', children, 0, 'k-checkbox-text') : undefined]);
|
|
64
69
|
}
|
|
65
70
|
;
|
|
@@ -14,7 +14,7 @@ var defaults = {
|
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
get transition() {
|
|
17
|
-
return theme.transition;
|
|
17
|
+
return theme.transition.small;
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
bgColor: '#fff',
|
|
@@ -71,5 +71,5 @@ setDefault(function () {
|
|
|
71
71
|
}).checkbox;
|
|
72
72
|
});
|
|
73
73
|
export default function makeStyles() {
|
|
74
|
-
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{
|
|
74
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;cursor:pointer;vertical-align:middle;.k-checkbox-wrapper{width:", checkbox.width, ";height:", checkbox.width, ";border:1px solid ", checkbox.borderColor, ";border-radius:", checkbox.borderRadius, ";position:relative;transition:all ", checkbox.transition, ";background:", checkbox.bgColor, ";flex:0 0 auto;&:before{content:\"\";display:block;position:absolute;width:", checkbox.inner.width, ";height:", checkbox.inner.height, ";top:", checkbox.inner.top, ";left:", checkbox.inner.left, ";border:", checkbox.inner.border, ";border-top:0;border-left:0;transform:rotate(45deg) scale(0);transition:all ", checkbox.transition, ";}}input{width:100%;height:100%;opacity:0;cursor:pointer;position:absolute;left:0;top:0;margin:0;}.k-checkbox-text{margin-left:", checkbox.text.gap, ";flex:0 1 auto;}&.k-checked,&.k-indeterminate{.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";background:", checkbox.checked.bgColor, ";}}&.k-indeterminate{.k-checkbox-wrapper{&:before{transform:rotate(90deg) scale(1);border-bottom:0;left:", checkbox.indeterminate.innerLeft, ";}}}&.k-checked{.k-checkbox-wrapper{&:before{transform:rotate(45deg) scale(1);}}}&:focus{outline:none;.k-checkbox-wrapper{border-color:", checkbox.checked.borderColor, ";}}&.k-disabled{color:", checkbox.disabled.color, ";cursor:not-allowed;.k-checkbox-wrapper{border-color:", checkbox.disabled.borderColor, ";background:", checkbox.disabled.bgColor, ";&:before{border-color:", checkbox.disabled.innerColor, ";}}input{cursor:not-allowed;}}");
|
|
75
75
|
}
|
|
@@ -39,7 +39,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
39
|
|
|
40
40
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
41
41
|
}, __$blocks['title'](_$no)), _$cc(Icon, {
|
|
42
|
-
'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['ion-ios-arrow-right'] = true, _$cn2))
|
|
42
|
+
'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['ion-ios-arrow-right'] = true, _$cn2)),
|
|
43
|
+
'hoverable': !disabled
|
|
43
44
|
})], 0, _$cn(kls('title')), {
|
|
44
45
|
'ev-click': this.toggle
|
|
45
46
|
}), _$cc(Transition, _extends({
|
|
@@ -6,6 +6,10 @@ export var kls = function kls(className) {
|
|
|
6
6
|
return "k-collapse-" + className;
|
|
7
7
|
};
|
|
8
8
|
var defaults = {
|
|
9
|
+
get transition() {
|
|
10
|
+
return theme.transition.large;
|
|
11
|
+
},
|
|
12
|
+
|
|
9
13
|
fontSize: '12px',
|
|
10
14
|
titleMarginRight: '8px',
|
|
11
15
|
borderPadding: '0 24px',
|
|
@@ -27,5 +31,5 @@ export function makeStyles() {
|
|
|
27
31
|
}
|
|
28
32
|
export function makeItemStyles() {
|
|
29
33
|
var collapseItem = collapse.item;
|
|
30
|
-
return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", kls('title'), "{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ",
|
|
34
|
+
return /*#__PURE__*/css("border-bottom:", collapseItem.borderBottom, ";&:last-of-type{border-bottom-color:transparent;}.", kls('title'), "{cursor:pointer;font-weight:bold;height:", collapseItem.titleHeight, ";line-height:", collapseItem.titleHeight, ";transition:color ", collapse.transition, ";}.", kls('arrow'), "{float:right;transition:transform ", collapse.transition, ";line-height:", collapseItem.titleHeight, ";height:", collapseItem.titleHeight, ";transform-origin:left center 0;}&:not(.k-disabled){.", kls('title'), "{&:hover{color:", theme.color.primary, ";}}}.", kls('content'), "{overflow:hidden;.", kls('wrapper'), "{overflow:hidden;padding:", collapseItem.contentPadding, ";}}&.k-active{.", kls('arrow'), "{transform:rotate(90deg);}}&.k-disabled{color:", theme.color.disabledBorder, ";.", kls('title'), "{cursor:not-allowed;}}");
|
|
31
35
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
2
|
import { Sizes } from '../../styles/utils';
|
|
3
|
+
import { Container } from '../portal';
|
|
3
4
|
export interface ColorpickerProps {
|
|
4
5
|
value: string;
|
|
5
6
|
presets?: string[];
|
|
6
7
|
size?: Sizes;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
container?: Container;
|
|
8
10
|
}
|
|
9
11
|
export interface ColorpickerEvents {
|
|
10
12
|
}
|