@dt-frames/ui 1.0.0 → 1.0.3
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/README.md +1 -15
- package/es/assets/style/reset.less +0 -3
- package/es/index.css +1 -1
- package/es/index.js +1 -0
- package/es/style/assets/style/reset.less +0 -3
- package/es/style/theme/sider/index.less +25 -25
- package/es/theme/content/index.d.ts +27 -29
- package/es/theme/header/components/menu-search.d.ts +528 -528
- package/es/theme/header/components/setting-theme.d.ts +2580 -2550
- package/es/theme/header/index.d.ts +4369 -4369
- package/es/theme/tabs/components/TabRedo.d.ts +7 -49
- package/es/theme/tabs/index.d.ts +2478 -1399
- package/es/theme/theme/initTheme.d.ts +3 -3
- package/es/theme/theme.d.ts +22 -4911
- package/package.json +50 -49
- package/src/assets/style/reset.less +0 -3
- package/src/directives/index.ts +1 -0
- package/src/theme/sider/index.less +25 -25
- package/es/themes/generate.ts +0 -74
- package/es/themes/index.ts +0 -10
- package/es/themes/modifyVars.ts +0 -33
- package/es/themes/themePlugiin.ts +0 -74
package/package.json
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dt-frames/ui",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"keywords": [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
],
|
|
8
|
-
"publishConfig": {
|
|
9
|
-
"access": "public"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dt-frames/ui",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"ui",
|
|
6
|
+
"dt-ui"
|
|
7
|
+
],
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"registry": "https://registry.npmjs.org/"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "yarn build -w",
|
|
14
|
+
"build": "vite build"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"assets",
|
|
19
|
+
"*.d.ts",
|
|
20
|
+
"es",
|
|
21
|
+
"index.*",
|
|
22
|
+
"README.md",
|
|
23
|
+
"tsconfig.json"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./es/index.js"
|
|
27
|
+
},
|
|
28
|
+
"types": "./es/index.d.ts",
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@iconify/iconify": "^2.1.2",
|
|
32
|
+
"@vueuse/core": "^7.5.2",
|
|
33
|
+
"lodash-es": "^4.17.21",
|
|
34
|
+
"sortablejs": "^1.15.0",
|
|
35
|
+
"vue": "^3.2.25",
|
|
36
|
+
"vue-router": "^4.0.12",
|
|
37
|
+
"xlsx": "^0.18.5"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@dt-frames/core": "1.0.0",
|
|
41
|
+
"@dt-frames/plugins": "1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@iconify/json": "^1.1.460",
|
|
45
|
+
"@vitejs/plugin-vue": "^2.0.0",
|
|
46
|
+
"vite": "^2.7.2",
|
|
47
|
+
"vite-plugin-purge-icons": "^0.7.0",
|
|
48
|
+
"vite-plugin-theme": "^0.8.6"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/directives/index.ts
CHANGED
|
@@ -91,37 +91,37 @@
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
.dt-sideBar.dt-sideBar--fixed {
|
|
97
|
+
position: fixed;
|
|
98
|
+
top: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
height: 100%;
|
|
101
|
+
}
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
.dt-sideBar.dt-sideBar--mix {
|
|
104
|
+
height: calc(100% - 48px);
|
|
105
|
+
top: @header-height;
|
|
106
|
+
background: @menu-mix-bg-color;
|
|
107
|
+
border-right: 1px solid #f0f0f0;
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
.ant-menu-item-selected{
|
|
115
|
-
background: @menu-mix-select-bg-color;
|
|
116
|
-
}
|
|
109
|
+
.ant-menu{
|
|
110
|
+
background: @menu-mix-bg-color;
|
|
111
|
+
border-right: none;
|
|
112
|
+
.ant-menu-sub{
|
|
113
|
+
background: @menu-mix-sub-bg-color;
|
|
117
114
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
background: @menu-mix-bg-color;
|
|
121
|
-
border-right: 1px solid #f0f0f0;
|
|
122
|
-
border-top: 1px solid #f0f0f0;
|
|
115
|
+
.ant-menu-item-selected{
|
|
116
|
+
background: @menu-mix-select-bg-color;
|
|
123
117
|
}
|
|
124
118
|
}
|
|
119
|
+
|
|
120
|
+
.ant-layout-sider-trigger{
|
|
121
|
+
background: @menu-mix-bg-color;
|
|
122
|
+
border-right: 1px solid #f0f0f0;
|
|
123
|
+
border-top: 1px solid #f0f0f0;
|
|
124
|
+
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.ant-layout-sider-dark, .ant-menu-dark {
|
package/es/themes/generate.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { generate } from '@ant-design/colors'
|
|
2
|
-
|
|
3
|
-
export const primaryColor = '#269ac1'
|
|
4
|
-
|
|
5
|
-
type Fn = (...arg: any) => any
|
|
6
|
-
type GenerateTheme = 'default' | 'dark'
|
|
7
|
-
|
|
8
|
-
interface GenerateColorsParams {
|
|
9
|
-
mixLighten: Fn
|
|
10
|
-
mixDarken: Fn
|
|
11
|
-
tinycolor: any
|
|
12
|
-
color?: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function generateAntColors(
|
|
16
|
-
color: string,
|
|
17
|
-
theme: GenerateTheme = 'default'
|
|
18
|
-
) {
|
|
19
|
-
return generate(color, { theme })
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function getThemeColors(color?: string) {
|
|
23
|
-
const tc = color || primaryColor
|
|
24
|
-
const lightColors = generateAntColors(tc)
|
|
25
|
-
const primary = lightColors[5]
|
|
26
|
-
const modeColors = generateAntColors(primary, 'dark')
|
|
27
|
-
|
|
28
|
-
return [...lightColors, ...modeColors]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function generateColors({
|
|
32
|
-
color = primaryColor,
|
|
33
|
-
mixLighten,
|
|
34
|
-
mixDarken,
|
|
35
|
-
tinycolor,
|
|
36
|
-
}: GenerateColorsParams) {
|
|
37
|
-
const arr = new Array(19).fill(0);
|
|
38
|
-
const lightens = arr.map((_t, i) => mixLighten(color, i / 5) )
|
|
39
|
-
|
|
40
|
-
const darkens = arr.map((_t, i) => mixDarken(color, i / 5))
|
|
41
|
-
|
|
42
|
-
const alphaColors = arr.map((_t, i) => {
|
|
43
|
-
return tinycolor(color)
|
|
44
|
-
.setAlpha(i / 20)
|
|
45
|
-
.toRgbString()
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const shortAlphaColors = alphaColors.map((item) => item.replace(/\s/g, '').replace(/0\./g, '.'))
|
|
49
|
-
|
|
50
|
-
const tinycolorLightens = arr
|
|
51
|
-
.map((_t, i) => {
|
|
52
|
-
return tinycolor(color)
|
|
53
|
-
.lighten(i * 5)
|
|
54
|
-
.toHexString()
|
|
55
|
-
})
|
|
56
|
-
.filter((item) => item !== '#ffffff')
|
|
57
|
-
|
|
58
|
-
const tinycolorDarkens = arr
|
|
59
|
-
.map((_t, i) => {
|
|
60
|
-
return tinycolor(color)
|
|
61
|
-
.darken(i * 5)
|
|
62
|
-
.toHexString()
|
|
63
|
-
})
|
|
64
|
-
.filter((item) => item !== '#000000')
|
|
65
|
-
|
|
66
|
-
return [
|
|
67
|
-
...lightens,
|
|
68
|
-
...darkens,
|
|
69
|
-
...alphaColors,
|
|
70
|
-
...shortAlphaColors,
|
|
71
|
-
...tinycolorDarkens,
|
|
72
|
-
...tinycolorLightens
|
|
73
|
-
].filter((item) => !item.includes('-'))
|
|
74
|
-
}
|
package/es/themes/index.ts
DELETED
package/es/themes/modifyVars.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getThemeVariables } from 'ant-design-vue/dist/theme'
|
|
2
|
-
import { resolve } from 'path'
|
|
3
|
-
import { generateAntColors, primaryColor } from './generate';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function generateModifyVars(dark = false) {
|
|
7
|
-
const palettes = generateAntColors(primaryColor)
|
|
8
|
-
const primary = palettes[5]
|
|
9
|
-
|
|
10
|
-
const primaryColorObj: Record<string, string> = {};
|
|
11
|
-
|
|
12
|
-
for (let index = 0; index < 10; index++) {
|
|
13
|
-
primaryColorObj[`primary-${index + 1}`] = palettes[index];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const modifyVars = getThemeVariables({ dark });
|
|
17
|
-
return {
|
|
18
|
-
...modifyVars,
|
|
19
|
-
hack: `${modifyVars.hack} @import (reference) "${resolve('src/assets/style/index.less')}";`,
|
|
20
|
-
'primary-color': primary,
|
|
21
|
-
...primaryColorObj,
|
|
22
|
-
'info-color': primary,
|
|
23
|
-
'processing-color': primary,
|
|
24
|
-
'success-color': '#55D187',
|
|
25
|
-
'error-color': '#ED6F6F',
|
|
26
|
-
'warning-color': '#EFBD47',
|
|
27
|
-
//'border-color-base': '#EEEEEE',
|
|
28
|
-
'font-size-base': '14px',
|
|
29
|
-
'border-radius-base': '2px',
|
|
30
|
-
'link-color': primary,
|
|
31
|
-
'app-content-background': '#fafafa',
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { PluginOption } from 'vite'
|
|
2
|
-
import { viteThemePlugin, antdDarkThemePlugin, mixLighten, mixDarken, tinycolor } from 'vite-plugin-theme'
|
|
3
|
-
import { getThemeColors, generateColors } from './generate'
|
|
4
|
-
import { generateModifyVars } from './modifyVars';
|
|
5
|
-
|
|
6
|
-
export function configThemePlugin(isBuild: boolean, modifyVars: string, preloadFiles: string[]): PluginOption[] {
|
|
7
|
-
const colors = generateColors({
|
|
8
|
-
mixDarken,
|
|
9
|
-
mixLighten,
|
|
10
|
-
tinycolor,
|
|
11
|
-
});
|
|
12
|
-
const plugin = [
|
|
13
|
-
viteThemePlugin({
|
|
14
|
-
resolveSelector: (s) => {
|
|
15
|
-
s = s.trim();
|
|
16
|
-
switch (s) {
|
|
17
|
-
case '.ant-steps-item-process .ant-steps-item-icon > .ant-steps-icon':
|
|
18
|
-
return '.ant-steps-item-icon > .ant-steps-icon';
|
|
19
|
-
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled)':
|
|
20
|
-
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover':
|
|
21
|
-
case '.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active':
|
|
22
|
-
return s;
|
|
23
|
-
case '.ant-steps-item-icon > .ant-steps-icon':
|
|
24
|
-
return s;
|
|
25
|
-
case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
|
|
26
|
-
return s;
|
|
27
|
-
default:
|
|
28
|
-
if (s.indexOf('.ant-btn') >= -1) {
|
|
29
|
-
// 按钮被重新定制过,需要过滤掉class防止覆盖
|
|
30
|
-
return s;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`;
|
|
34
|
-
},
|
|
35
|
-
colorVariables: [...getThemeColors(), ...colors],
|
|
36
|
-
}),
|
|
37
|
-
antdDarkThemePlugin({
|
|
38
|
-
preloadFiles,
|
|
39
|
-
filter: (id) => (isBuild ? !id.endsWith('antd.less') : true),
|
|
40
|
-
darkModifyVars: {
|
|
41
|
-
...generateModifyVars(true),
|
|
42
|
-
'text-color': '#c9d1d9',
|
|
43
|
-
'primary-1': 'rgb(255 255 255 / 8%)',
|
|
44
|
-
'text-color-base': '#c9d1d9',
|
|
45
|
-
'component-background': '#151515',
|
|
46
|
-
'heading-color': 'rgb(255 255 255 / 65%)',
|
|
47
|
-
// black: '#0e1117',
|
|
48
|
-
// #8b949e
|
|
49
|
-
'text-color-secondary': '#8b949e',
|
|
50
|
-
'border-color-base': '#303030',
|
|
51
|
-
// 'border-color-split': '#30363d',
|
|
52
|
-
'item-active-bg': '#111b26',
|
|
53
|
-
'app-content-background': '#1e1e1e',
|
|
54
|
-
'tree-node-selected-bg': '#11263c',
|
|
55
|
-
|
|
56
|
-
'alert-success-border-color': '#274916',
|
|
57
|
-
'alert-success-bg-color': '#162312',
|
|
58
|
-
'alert-success-icon-color': '#49aa19',
|
|
59
|
-
'alert-info-border-color': '#153450',
|
|
60
|
-
'alert-info-bg-color': '#111b26',
|
|
61
|
-
'alert-info-icon-color': '#177ddc',
|
|
62
|
-
'alert-warning-border-color': '#594214',
|
|
63
|
-
'alert-warning-bg-color': '#2b2111',
|
|
64
|
-
'alert-warning-icon-color': '#d89614',
|
|
65
|
-
'alert-error-border-color': '#58181c',
|
|
66
|
-
'alert-error-bg-color': '#2a1215',
|
|
67
|
-
'alert-error-icon-color': '#a61d24',
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
return plugin as unknown as PluginOption[];
|
|
73
|
-
}
|
|
74
|
-
|