@king-design/intact 2.0.16 → 3.0.0-beta.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/components/button/styles.ts +4 -1
- package/components/card/styles.ts +3 -2
- package/components/checkbox/styles.ts +31 -6
- package/components/collapse/styles.ts +4 -1
- package/components/datepicker/styles.ts +3 -1
- package/components/dialog/base.vdt +4 -5
- package/components/dialog/styles.ts +18 -13
- package/components/drawer/styles.ts +20 -10
- package/components/dropdown/styles.ts +1 -1
- package/components/form/styles.ts +1 -1
- package/components/icon/demos/disabled.md +21 -0
- package/components/icon/demos/icons.md +87 -116
- package/components/icon/index.md +1 -0
- package/components/icon/index.ts +2 -0
- package/components/icon/index.vdt +6 -2
- package/components/icon/styles.ts +8 -1
- package/components/input/styles.ts +14 -20
- package/components/message/demos/basic.md +1 -1
- package/components/message/demos/duration.md +3 -3
- package/components/message/index.md +1 -1
- package/components/message/message.ts +2 -2
- package/components/message/message.vdt +6 -6
- package/components/message/styles.ts +10 -19
- package/components/pagination/index.vdt +9 -9
- package/components/pagination/styles.ts +11 -7
- package/components/radio/styles.ts +28 -9
- package/components/select/base.vdt +4 -5
- package/components/select/index.md +1 -1
- package/components/select/styles.ts +4 -27
- package/components/spinner/index.vdt +6 -4
- package/components/spinner/styles.ts +36 -36
- package/components/steps/demos/basic.md +2 -1
- package/components/steps/demos/clickable.md +6 -0
- package/components/steps/demos/error.md +25 -5
- package/components/steps/demos/line.md +7 -6
- package/components/steps/demos/simple.md +0 -6
- package/components/steps/index.md +1 -1
- package/components/steps/index.ts +4 -4
- package/components/steps/index.vdt +1 -0
- package/components/steps/step.vdt +16 -13
- package/components/steps/styles.ts +297 -259
- package/components/switch/demos/basic.md +1 -2
- package/components/switch/demos/disabled.md +20 -0
- package/components/switch/demos/onOff.md +5 -0
- package/components/switch/styles.ts +29 -37
- package/components/table/styles.ts +11 -6
- package/components/tabs/demos/basic.md +0 -1
- package/components/tabs/index.ts +2 -2
- package/components/tabs/index.vdt +3 -3
- package/components/tabs/styles.ts +202 -152
- package/components/tag/base.ts +1 -1
- package/components/tag/demos/border.md +2 -2
- package/components/tag/index.md +1 -1
- package/components/tag/styles.ts +12 -11
- package/components/tip/index.vdt +1 -3
- package/components/tip/styles.ts +8 -2
- package/components/tooltip/content.vdt +1 -1
- package/components/tooltip/styles.ts +8 -6
- package/components/transfer/index.vdt +3 -2
- package/components/transfer/styles.ts +1 -0
- package/components/transfer/useCheck.ts +9 -2
- package/components/upload/demos/manually.md +12 -13
- package/components/upload/index.vdt +40 -34
- package/components/upload/styles.ts +60 -64
- package/es/components/button/styles.js +2 -2
- package/es/components/card/styles.js +10 -2
- package/es/components/checkbox/styles.js +21 -10
- package/es/components/collapse/styles.js +6 -1
- package/es/components/datepicker/styles.d.ts +1 -1
- package/es/components/datepicker/styles.js +4 -1
- package/es/components/dialog/base.vdt.js +5 -6
- package/es/components/dialog/styles.js +16 -14
- package/es/components/drawer/styles.js +20 -5
- package/es/components/dropdown/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/index.d.ts +1 -0
- package/es/components/icon/index.js +2 -1
- package/es/components/icon/index.vdt.js +4 -2
- package/es/components/icon/styles.js +10 -2
- package/es/components/input/styles.js +1 -11
- package/es/components/message/message.js +1 -1
- package/es/components/message/message.vdt.js +7 -6
- package/es/components/message/styles.js +8 -8
- package/es/components/pagination/index.vdt.js +8 -8
- package/es/components/pagination/styles.js +11 -2
- package/es/components/radio/styles.js +16 -6
- package/es/components/select/base.vdt.js +5 -6
- package/es/components/select/styles.js +4 -24
- package/es/components/spinner/index.vdt.js +6 -4
- package/es/components/spinner/styles.js +33 -5
- package/es/components/steps/index.d.ts +2 -2
- package/es/components/steps/index.js +2 -2
- package/es/components/steps/index.vdt.js +1 -0
- package/es/components/steps/step.vdt.js +17 -8
- package/es/components/steps/styles.d.ts +1 -1
- package/es/components/steps/styles.js +80 -75
- package/es/components/switch/styles.js +20 -34
- package/es/components/table/styles.js +9 -4
- package/es/components/tabs/index.d.ts +1 -1
- package/es/components/tabs/index.js +1 -1
- package/es/components/tabs/index.vdt.js +1 -1
- package/es/components/tabs/styles.js +68 -22
- package/es/components/tag/base.js +1 -1
- package/es/components/tag/styles.js +15 -10
- package/es/components/tip/index.vdt.js +1 -3
- package/es/components/tip/styles.js +4 -3
- package/es/components/tooltip/content.vdt.js +4 -4
- package/es/components/tooltip/styles.js +12 -7
- package/es/components/transfer/index.vdt.js +3 -1
- package/es/components/transfer/styles.js +1 -1
- package/es/components/transfer/useCheck.d.ts +1 -0
- package/es/components/transfer/useCheck.js +8 -1
- package/es/components/upload/index.vdt.js +21 -20
- package/es/components/upload/styles.js +22 -30
- package/es/i18n/en-US.d.ts +2 -1
- package/es/i18n/en-US.js +2 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/icon/demos/disabled/index.js +18 -0
- package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/icon/demos/disabled/react.js +33 -0
- package/es/site/data/components/icon/demos/icons/index.js +1 -1
- package/es/site/data/components/icon/demos/icons/react.js +1 -1
- package/es/site/data/components/message/demos/duration/index.js +2 -2
- package/es/site/data/components/message/demos/duration/react.js +2 -2
- package/es/site/data/components/steps/demos/basic/react.js +1 -1
- package/es/site/data/components/steps/demos/clickable/react.js +15 -0
- package/es/site/data/components/steps/demos/error/react.js +22 -2
- package/es/site/data/components/steps/demos/line/react.js +15 -11
- package/es/site/data/components/steps/demos/simple/react.js +1 -11
- package/es/site/data/components/switch/demos/basic/react.js +0 -2
- package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/switch/demos/disabled/index.js +18 -0
- package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/switch/demos/disabled/react.js +27 -0
- package/es/site/data/components/switch/demos/onOff/react.js +13 -0
- package/es/site/data/components/tag/demos/border/index.js +1 -1
- package/es/site/data/components/tag/demos/border/react.js +1 -1
- package/es/site/data/components/upload/demos/manually/react.js +5 -7
- package/es/site/src/pages/document/index.js +3 -2
- package/es/site/src/pages/document/styles.js +1 -1
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +1 -1
- package/es/styles/fonts/iconfont.svg +189 -369
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/theme.d.ts +10 -2
- package/es/styles/theme.js +23 -21
- package/i18n/en-US.ts +2 -1
- package/index.ts +2 -2
- package/package.json +2 -1
- package/styles/fonts/iconfont.css +172 -289
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ts +255 -369
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/theme.ts +23 -19
package/components/tag/base.ts
CHANGED
|
@@ -3,7 +3,7 @@ title: 边框
|
|
|
3
3
|
order: 3
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
通过`border`可以定义边框样式: `solid`
|
|
6
|
+
通过`border`可以定义边框样式: `solid` `dashed` `none`(默认)
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
9
|
import {Tag} from 'kpc';
|
|
@@ -40,7 +40,7 @@ export default class extends Component {
|
|
|
40
40
|
static defaults() {
|
|
41
41
|
return {
|
|
42
42
|
types: ['default', 'primary', 'success', 'warning', 'danger'],
|
|
43
|
-
borders: ['dashed', 'none'],
|
|
43
|
+
borders: ['solid', 'dashed', 'none'],
|
|
44
44
|
} as Props;
|
|
45
45
|
}
|
|
46
46
|
}
|
package/components/tag/index.md
CHANGED
|
@@ -14,7 +14,7 @@ sidebar: doc
|
|
|
14
14
|
| closed | 是否已关闭 | `boolean` | `false` |
|
|
15
15
|
| disabled | 是否展示禁用状态 | `boolean` | `false` |
|
|
16
16
|
| size | 组件尺寸 | `"large"` | `"default"` | `"small"` | `"mini"` | `"default"` |
|
|
17
|
-
| border | 定义边框样式 | `"solid"` | `"dashed"` | `"none"` | `"
|
|
17
|
+
| border | 定义边框样式 | `"solid"` | `"dashed"` | `"none"` | `"none"` |
|
|
18
18
|
|
|
19
19
|
# 事件
|
|
20
20
|
|
package/components/tag/styles.ts
CHANGED
|
@@ -14,11 +14,12 @@ const types = ['primary', 'warning', 'danger', 'success', 'disabled'] as const;
|
|
|
14
14
|
|
|
15
15
|
const defaults = deepDefaults(
|
|
16
16
|
{
|
|
17
|
-
get
|
|
17
|
+
get border() { return `1px solid ${theme.color.border}` },
|
|
18
18
|
get borderRadius() { return theme.borderRadius },
|
|
19
19
|
get fontSize() { return theme.default.fontSize },
|
|
20
20
|
padding: `0 8px`,
|
|
21
21
|
height: '20px',
|
|
22
|
+
get bgColor() { return theme.color.bg },
|
|
22
23
|
close: {
|
|
23
24
|
fontSize: '20px',
|
|
24
25
|
gap: '8px',
|
|
@@ -29,32 +30,33 @@ const defaults = deepDefaults(
|
|
|
29
30
|
get bgColor() { return theme.color.disabledBg },
|
|
30
31
|
},
|
|
31
32
|
large: {
|
|
32
|
-
padding: `0px
|
|
33
|
-
height: '
|
|
33
|
+
padding: `0px 8px`,
|
|
34
|
+
height: '24px',
|
|
34
35
|
close: {
|
|
35
|
-
fontSize: '
|
|
36
|
+
fontSize: '20px',
|
|
36
37
|
gap: '12px',
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
small: {
|
|
40
41
|
padding: `0 4px`,
|
|
41
|
-
height: '
|
|
42
|
+
height: '16px',
|
|
42
43
|
close: {
|
|
43
|
-
fontSize: '
|
|
44
|
+
fontSize: '12px',
|
|
44
45
|
gap: '4px'
|
|
45
46
|
}
|
|
46
47
|
},
|
|
47
48
|
mini: {
|
|
48
|
-
padding: `0
|
|
49
|
+
padding: `0 2px`,
|
|
49
50
|
height: '14px',
|
|
50
51
|
close: {
|
|
51
|
-
fontSize: '
|
|
52
|
+
fontSize: '12px',
|
|
52
53
|
gap: '2px'
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
none: {
|
|
56
57
|
get bgColor() { return theme.color.bg },
|
|
57
|
-
}
|
|
58
|
+
},
|
|
59
|
+
|
|
58
60
|
},
|
|
59
61
|
types.reduce((memo, type) => {
|
|
60
62
|
if (type === 'disabled') return memo;
|
|
@@ -76,11 +78,10 @@ export function makeStyles() {
|
|
|
76
78
|
display: inline-flex;
|
|
77
79
|
align-items: center;
|
|
78
80
|
padding: ${tag.padding};
|
|
79
|
-
border:
|
|
81
|
+
border: ${tag.border};
|
|
80
82
|
border-radius: ${tag.borderRadius};
|
|
81
83
|
font-size: ${tag.fontSize};
|
|
82
84
|
height: ${tag.height};
|
|
83
|
-
|
|
84
85
|
.k-tag-close {
|
|
85
86
|
font-size: ${tag.close.fontSize};
|
|
86
87
|
margin-left: ${tag.close.gap};
|
package/components/tip/index.vdt
CHANGED
package/components/tip/styles.ts
CHANGED
|
@@ -6,9 +6,10 @@ import {deepDefaults} from '../../styles/utils';
|
|
|
6
6
|
const defaults = {
|
|
7
7
|
title: {
|
|
8
8
|
fontSize: '14px',
|
|
9
|
-
gap: '8px'
|
|
9
|
+
gap: '8px',
|
|
10
|
+
fontWeight: '500'
|
|
10
11
|
},
|
|
11
|
-
get color() { return theme.color.
|
|
12
|
+
get color() { return theme.color.title },
|
|
12
13
|
get padding() { return `6px ${theme.default.padding}` },
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -35,10 +36,15 @@ export function makeStyles() {
|
|
|
35
36
|
.k-tip-title {
|
|
36
37
|
font-size: ${tip.title.fontSize};
|
|
37
38
|
margin-bottom: ${tip.title.gap};
|
|
39
|
+
font-weight: ${tip.title.fontWeight}
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
&.k-fade-leave-active {
|
|
41
43
|
position: relative;
|
|
42
44
|
}
|
|
45
|
+
|
|
46
|
+
.k-tip-close:hover {
|
|
47
|
+
background: none;
|
|
48
|
+
}
|
|
43
49
|
`;
|
|
44
50
|
}
|
|
@@ -37,8 +37,8 @@ const classNameObj = {
|
|
|
37
37
|
></i>
|
|
38
38
|
<div class="k-tooltip-buttons" v-if={confirm} key="tooltip-buttons">
|
|
39
39
|
<b:buttons>
|
|
40
|
-
<Button type="primary" ev-click={this.ok} size="small">{okText}</Button>
|
|
41
40
|
<Button ev-click={this.cancel} size="small">{cancelText}</Button>
|
|
41
|
+
<Button type="primary" ev-click={this.ok} size="small">{okText}</Button>
|
|
42
42
|
</b:buttons>
|
|
43
43
|
</div>
|
|
44
44
|
</b:children>
|
|
@@ -8,12 +8,13 @@ const defaults = {
|
|
|
8
8
|
get color() { return theme.color.text },
|
|
9
9
|
bgColor: '#fff',
|
|
10
10
|
lineHeight: 1.4,
|
|
11
|
-
maxWidth: '
|
|
11
|
+
maxWidth: '312px',
|
|
12
|
+
get boxShadow() { return theme.middleBoxShadow },
|
|
12
13
|
|
|
13
14
|
// arrow
|
|
14
15
|
arrow: {
|
|
15
|
-
borderColor: 'rgba(
|
|
16
|
-
width: '
|
|
16
|
+
borderColor: 'rgba(221, 221, 221, .5)',
|
|
17
|
+
width: '6px',
|
|
17
18
|
},
|
|
18
19
|
|
|
19
20
|
// confirm
|
|
@@ -23,9 +24,9 @@ const defaults = {
|
|
|
23
24
|
|
|
24
25
|
// dark
|
|
25
26
|
dark: {
|
|
26
|
-
get bgColor() { return theme.color.
|
|
27
|
+
get bgColor() { return theme.color.title },
|
|
27
28
|
color: '#fff',
|
|
28
|
-
get arrowBorderColor() { return theme.color.
|
|
29
|
+
get arrowBorderColor() { return theme.color.title },
|
|
29
30
|
},
|
|
30
31
|
|
|
31
32
|
smallPadding: '4px',
|
|
@@ -48,7 +49,7 @@ const directionMap = {
|
|
|
48
49
|
|
|
49
50
|
export default function makeStyles() {
|
|
50
51
|
const arrowLong = tooltip.arrow.width;
|
|
51
|
-
const arrowShort = `calc(${arrowLong} -
|
|
52
|
+
const arrowShort = `calc(${arrowLong} - 1px)`;
|
|
52
53
|
|
|
53
54
|
// use &.k-tooltip-content to override css in dropdown menu
|
|
54
55
|
return css`
|
|
@@ -59,6 +60,7 @@ export default function makeStyles() {
|
|
|
59
60
|
line-height: ${tooltip.lineHeight};
|
|
60
61
|
word-wrap: break-word;
|
|
61
62
|
pointer-events: none;
|
|
63
|
+
box-shadow: ${tooltip.boxShadow};
|
|
62
64
|
|
|
63
65
|
// hoverable
|
|
64
66
|
&.k-hoverable,
|
|
@@ -12,7 +12,7 @@ const {
|
|
|
12
12
|
} = this.get();
|
|
13
13
|
const {getShowedData} = this.filter;
|
|
14
14
|
const {enableAdd, enableRemove, add, remove} = this.transfer;
|
|
15
|
-
const {isCheckAll, toggleCheckAll, onCheckboxChange} = this.check;
|
|
15
|
+
const {isCheckAll, toggleCheckAll, onCheckboxChange, isIndeterminate} = this.check;
|
|
16
16
|
|
|
17
17
|
const classNameObj = {
|
|
18
18
|
'k-transfer': true,
|
|
@@ -33,6 +33,7 @@ const Panel = (model) => {
|
|
|
33
33
|
</div>
|
|
34
34
|
<Checkbox class="c-ellipsis"
|
|
35
35
|
value={isCheckAll(model)}
|
|
36
|
+
indeterminate={isIndeterminate(model)}
|
|
36
37
|
ev-click={toggleCheckAll.bind(null, model)}
|
|
37
38
|
>{title}</Checkbox>
|
|
38
39
|
</b:header>
|
|
@@ -94,4 +95,4 @@ const Panel = (model) => {
|
|
|
94
95
|
</Button>
|
|
95
96
|
</div>
|
|
96
97
|
{Panel('right')}
|
|
97
|
-
</div>
|
|
98
|
+
</div>
|
|
@@ -25,7 +25,6 @@ export function useCheck({getEnabledData, getShowedData}: ReturnType<typeof useF
|
|
|
25
25
|
|
|
26
26
|
return data.length && checked.length >= data.length;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
function toggleCheckAll(model: Model, e: MouseEvent) {
|
|
30
29
|
if ((e.target as HTMLInputElement).checked) {
|
|
31
30
|
selectAll(model);
|
|
@@ -34,6 +33,13 @@ export function useCheck({getEnabledData, getShowedData}: ReturnType<typeof useF
|
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
|
|
36
|
+
function isIndeterminate(model: Model) {
|
|
37
|
+
const checked = instance.get(`${model}CheckedKeys` as CheckedKeys)!;
|
|
38
|
+
const data = getEnabledData(model);
|
|
39
|
+
|
|
40
|
+
return checked.length > 0 && checked.length < data.length;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
function onCheckboxChange(model: Model, index: number, e: MouseEvent) {
|
|
38
44
|
if (startIndex === undefined || !e.shiftKey) {
|
|
39
45
|
startIndex = index;
|
|
@@ -91,6 +97,7 @@ export function useCheck({getEnabledData, getShowedData}: ReturnType<typeof useF
|
|
|
91
97
|
return {
|
|
92
98
|
isCheckAll,
|
|
93
99
|
toggleCheckAll,
|
|
94
|
-
onCheckboxChange
|
|
100
|
+
onCheckboxChange,
|
|
101
|
+
isIndeterminate
|
|
95
102
|
};
|
|
96
103
|
}
|
|
@@ -6,20 +6,19 @@ order: 4
|
|
|
6
6
|
手动上传需要通过指定`autoUpload`为`false`来关闭自动上传,然后调用组件的`submit`方法来手动上传
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Upload} from 'kpc';
|
|
10
|
-
import {Button} from 'kpc';
|
|
9
|
+
import {Upload, Button} from 'kpc';
|
|
11
10
|
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
11
|
+
<div>
|
|
12
|
+
<Upload
|
|
13
|
+
ref="instance"
|
|
14
|
+
multiple
|
|
15
|
+
action="//fakestoreapi.com/products"
|
|
16
|
+
autoUpload={false}
|
|
17
|
+
>
|
|
18
|
+
<Button type="primary">选择文件</Button>
|
|
19
|
+
</Upload>
|
|
20
|
+
<Button ev-click={this.upload}>开始上传</Button>
|
|
21
|
+
</div>
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
```styl
|
|
@@ -38,22 +38,26 @@ const handle = (
|
|
|
38
38
|
<b:content>
|
|
39
39
|
<b:children v-if={children}>{children}</b:children>
|
|
40
40
|
<template v-else-if={type !== 'gallery'}>
|
|
41
|
-
<Button
|
|
41
|
+
<Button v-if={type === 'select'}>
|
|
42
|
+
<Icon class="k-icon-upload" />
|
|
43
|
+
{_$('点击上传')}
|
|
44
|
+
</Button>
|
|
42
45
|
<div class="k-upload-area" v-else>
|
|
43
|
-
<Icon class="
|
|
44
|
-
<div
|
|
46
|
+
<Icon class="k-icon-add-big" />
|
|
47
|
+
<div innerHTML={_$('将文件拖到此处,或<a>点击上传</a>')}></div>
|
|
45
48
|
</div>
|
|
46
49
|
</template>
|
|
47
|
-
<
|
|
48
|
-
<Icon class="k-
|
|
49
|
-
|
|
50
|
+
<div v-else class="k-upload-picture-card k-upload-add">
|
|
51
|
+
<Icon class="k-icon-add-big" size="large" />
|
|
52
|
+
<div>{_$('上传图片')}</div>
|
|
53
|
+
</div>
|
|
50
54
|
</b:content>
|
|
51
55
|
</div>
|
|
52
56
|
);
|
|
53
57
|
|
|
54
58
|
const {removeFile} = this.files;
|
|
55
|
-
const closeBtn = (value, index
|
|
56
|
-
<Icon class=
|
|
59
|
+
const closeBtn = (value, index) => (
|
|
60
|
+
<Icon class="k-upload-close k-icon-delete"
|
|
57
61
|
ev-click={() => removeFile(value, index)}
|
|
58
62
|
hoverable
|
|
59
63
|
/>
|
|
@@ -94,13 +98,14 @@ const {show, close, image, isShow} = this.showImage;
|
|
|
94
98
|
class="k-upload-progress"
|
|
95
99
|
/>
|
|
96
100
|
</div>
|
|
97
|
-
<div class="k-upload-overlap k-upload-icons" v-else
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
<div class="k-upload-overlap k-upload-icons" v-else>
|
|
102
|
+
<Icon class="k-upload-zoom ion-ios-eye-outline" size="large"
|
|
103
|
+
hoverable
|
|
104
|
+
ev-click={linkEvent($value, show)}
|
|
105
|
+
/>
|
|
106
|
+
{closeBtn($value, $key)}
|
|
101
107
|
</div>
|
|
102
108
|
</Transition>
|
|
103
|
-
{closeBtn($value, $key, 'ion-ios-close')}
|
|
104
109
|
</div>
|
|
105
110
|
<div key="handle" class="c-middle" v-if={!limit || files.length < limit}>
|
|
106
111
|
{handle}
|
|
@@ -120,28 +125,29 @@ const {show, close, image, isShow} = this.showImage;
|
|
|
120
125
|
}}
|
|
121
126
|
key={$value.uid}
|
|
122
127
|
>
|
|
123
|
-
<div class="k-upload-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
<div class="k-upload-file-main">
|
|
129
|
+
<div class="k-upload-name c-ellipsis">
|
|
130
|
+
<Icon class="k-upload-file-icon ion-document" />
|
|
131
|
+
<span class="k-upload-file-name">{$value.name}</span>
|
|
132
|
+
<Icon class="k-upload-status-icon ion-ios-checkmark-outline"
|
|
133
|
+
v-if={$value.status === UploadFileStatus.Done}
|
|
134
|
+
/>
|
|
135
|
+
<Icon class="k-upload-status-icon ion-ios-close-outline"
|
|
136
|
+
v-else-if={$value.status === UploadFileStatus.Error}
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
<Transition {...expandAnimationCallbacks}>
|
|
140
|
+
<Progress percent={$value.percent}
|
|
141
|
+
size="mini"
|
|
142
|
+
class="k-upload-progress"
|
|
143
|
+
v-if={
|
|
144
|
+
$value.status === UploadFileStatus.Ready ||
|
|
145
|
+
$value.status === UploadFileStatus.Uploading
|
|
146
|
+
}
|
|
147
|
+
/>
|
|
148
|
+
</Transition>
|
|
133
149
|
</div>
|
|
134
|
-
|
|
135
|
-
<Progress percent={$value.percent}
|
|
136
|
-
size="mini"
|
|
137
|
-
class="k-upload-progress"
|
|
138
|
-
v-if={
|
|
139
|
-
$value.status === UploadFileStatus.Ready ||
|
|
140
|
-
$value.status === UploadFileStatus.Uploading
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/>
|
|
144
|
-
</Transition>
|
|
150
|
+
{closeBtn($value, $key)}
|
|
145
151
|
</div>
|
|
146
152
|
</TransitionGroup>
|
|
147
153
|
</div>
|
|
@@ -6,11 +6,10 @@ import '../../styles/global';
|
|
|
6
6
|
const defaults = {
|
|
7
7
|
get transition() { return theme.transition.middle },
|
|
8
8
|
fontSize: '12px',
|
|
9
|
+
get color() { return theme.color.lightBlack },
|
|
9
10
|
tip: {
|
|
10
|
-
gap: '
|
|
11
|
-
get color() { return theme.color.lightBlack }
|
|
11
|
+
gap: '8px',
|
|
12
12
|
},
|
|
13
|
-
closeFontSize: '24px',
|
|
14
13
|
|
|
15
14
|
// files list
|
|
16
15
|
filesGap: '16px',
|
|
@@ -24,22 +23,27 @@ const defaults = {
|
|
|
24
23
|
status: {
|
|
25
24
|
// width: '16px',
|
|
26
25
|
get color() { return theme.color.success },
|
|
27
|
-
gap: '8px',
|
|
28
26
|
get errorColor() { return theme.color.danger },
|
|
27
|
+
offsetRight: '2px',
|
|
28
|
+
},
|
|
29
|
+
delete: {
|
|
30
|
+
width: '20px',
|
|
31
|
+
top: '7px',
|
|
32
|
+
right: '2px',
|
|
29
33
|
},
|
|
30
34
|
get errorColor() { return theme.color.danger },
|
|
31
35
|
},
|
|
32
36
|
|
|
33
37
|
// drag
|
|
34
38
|
drag: {
|
|
35
|
-
get color() { return theme.color.lightBlack },
|
|
36
39
|
get border() { return `1px dashed ${theme.color.border}` },
|
|
37
40
|
get borderRadius() { return theme.borderRadius },
|
|
38
41
|
get hoverBorderColor() { return theme.color.primary },
|
|
39
|
-
|
|
42
|
+
get bgColor() { return theme.color.bg },
|
|
43
|
+
padding: `42px 0`,
|
|
40
44
|
icon: {
|
|
41
|
-
fontSize: '
|
|
42
|
-
|
|
45
|
+
fontSize: '40px',
|
|
46
|
+
gap: '16px',
|
|
43
47
|
},
|
|
44
48
|
get overBorderColor() { return theme.color.primary },
|
|
45
49
|
},
|
|
@@ -54,23 +58,17 @@ const defaults = {
|
|
|
54
58
|
padding: '8px',
|
|
55
59
|
bgColor: '#fff',
|
|
56
60
|
get errorBorderColor() { return theme.color.danger },
|
|
57
|
-
close: {
|
|
58
|
-
top: '-8px',
|
|
59
|
-
right: '-8px',
|
|
60
|
-
fontSize: '18px',
|
|
61
|
-
},
|
|
62
61
|
add: {
|
|
63
62
|
get border() { return `1px dashed ${theme.color.border}` },
|
|
64
|
-
fontSize: '44px',
|
|
65
63
|
get hoverBorderColor() { return theme.color.primary },
|
|
66
64
|
}
|
|
67
65
|
},
|
|
68
66
|
|
|
69
67
|
// overlap
|
|
70
68
|
overlap: {
|
|
71
|
-
bgColor: 'rgba(
|
|
69
|
+
bgColor: 'rgba(21, 27, 30, .5)',
|
|
72
70
|
color: '#fff',
|
|
73
|
-
|
|
71
|
+
iconGap: '16px',
|
|
74
72
|
}
|
|
75
73
|
};
|
|
76
74
|
|
|
@@ -83,14 +81,20 @@ export function makeStyles() {
|
|
|
83
81
|
return css`
|
|
84
82
|
font-size: ${upload.fontSize};
|
|
85
83
|
position: relative;
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
|
|
85
|
+
// keep vertical align middle
|
|
86
|
+
.k-icon-upload {
|
|
87
|
+
position: relative;
|
|
88
|
+
top: -1px;
|
|
89
|
+
}
|
|
90
|
+
.k-upload-handle {
|
|
88
91
|
display: inline-block;
|
|
89
92
|
vertical-align: middle;
|
|
93
|
+
color: ${upload.color};
|
|
90
94
|
}
|
|
91
95
|
.k-upload-tip {
|
|
92
|
-
margin-
|
|
93
|
-
color: ${upload.
|
|
96
|
+
margin-top: ${upload.tip.gap};
|
|
97
|
+
color: ${upload.color};
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
// filelist
|
|
@@ -99,15 +103,24 @@ export function makeStyles() {
|
|
|
99
103
|
}
|
|
100
104
|
.k-upload-file {
|
|
101
105
|
margin: ${upload.file.margin};
|
|
102
|
-
padding: ${upload.file.
|
|
103
|
-
|
|
106
|
+
padding-right: ${upload.file.delete.width};
|
|
107
|
+
position: relative;
|
|
104
108
|
&:hover {
|
|
105
|
-
background: ${upload.file.bgColor};
|
|
106
109
|
.k-upload-close {
|
|
107
110
|
display: inline-flex;
|
|
111
|
+
position: absolute;
|
|
112
|
+
right: ${upload.file.delete.right};
|
|
113
|
+
top: ${upload.file.delete.top};
|
|
108
114
|
}
|
|
115
|
+
.k-upload-file-main {
|
|
116
|
+
background: ${upload.file.bgColor};
|
|
117
|
+
}
|
|
109
118
|
}
|
|
110
119
|
}
|
|
120
|
+
.k-upload-file-main {
|
|
121
|
+
padding: ${upload.file.padding};
|
|
122
|
+
border-radius: ${upload.file.borderRadius};
|
|
123
|
+
}
|
|
111
124
|
.k-upload-name {
|
|
112
125
|
display: flex;
|
|
113
126
|
align-items: center;
|
|
@@ -121,13 +134,10 @@ export function makeStyles() {
|
|
|
121
134
|
}
|
|
122
135
|
.k-upload-status-icon {
|
|
123
136
|
color: ${upload.file.status.color};
|
|
124
|
-
margin-
|
|
137
|
+
margin-right: ${upload.file.status.offsetRight};
|
|
125
138
|
}
|
|
126
139
|
.k-upload-close {
|
|
127
140
|
display: none;
|
|
128
|
-
.k-icon {
|
|
129
|
-
font-size: ${upload.closeFontSize};
|
|
130
|
-
}
|
|
131
141
|
}
|
|
132
142
|
.k-upload-file.k-error {
|
|
133
143
|
color: ${upload.file.errorColor};
|
|
@@ -144,13 +154,13 @@ export function makeStyles() {
|
|
|
144
154
|
// drag
|
|
145
155
|
&.k-drag {
|
|
146
156
|
.k-upload-handle {
|
|
147
|
-
color: ${upload.drag.color};
|
|
148
157
|
display: block;
|
|
149
158
|
border: ${upload.drag.border};
|
|
150
159
|
border-radius: ${upload.drag.borderRadius};
|
|
151
160
|
cursor: pointer;
|
|
152
161
|
text-align: center;
|
|
153
162
|
transition: border-color ${upload.transition};
|
|
163
|
+
background: ${upload.drag.bgColor};
|
|
154
164
|
&:hover {
|
|
155
165
|
border-color: ${upload.drag.hoverBorderColor};
|
|
156
166
|
}
|
|
@@ -158,9 +168,9 @@ export function makeStyles() {
|
|
|
158
168
|
.k-upload-area {
|
|
159
169
|
padding: ${upload.drag.padding};
|
|
160
170
|
.k-icon {
|
|
171
|
+
display: inline-block;
|
|
161
172
|
font-size: ${upload.drag.icon.fontSize};
|
|
162
|
-
|
|
163
|
-
line-height: 1;
|
|
173
|
+
margin-bottom: ${upload.drag.icon.gap};
|
|
164
174
|
}
|
|
165
175
|
}
|
|
166
176
|
&.k-dragover {
|
|
@@ -182,10 +192,12 @@ export function makeStyles() {
|
|
|
182
192
|
&.k-error {
|
|
183
193
|
border-color: ${upload.gallery.errorBorderColor};
|
|
184
194
|
}
|
|
195
|
+
.k-upload-close {
|
|
196
|
+
display: inline-flex;
|
|
197
|
+
}
|
|
185
198
|
&:hover {
|
|
186
|
-
.k-upload-
|
|
187
|
-
opacity: 1;
|
|
188
|
-
pointer-events: all;
|
|
199
|
+
.k-upload-icons {
|
|
200
|
+
opacity: 1;
|
|
189
201
|
}
|
|
190
202
|
}
|
|
191
203
|
.k-upload-img {
|
|
@@ -193,57 +205,48 @@ export function makeStyles() {
|
|
|
193
205
|
width: 100%;
|
|
194
206
|
height: 100%;
|
|
195
207
|
}
|
|
196
|
-
.k-upload-close {
|
|
197
|
-
position: absolute;
|
|
198
|
-
top: ${upload.gallery.close.top};
|
|
199
|
-
right: ${upload.gallery.close.right};
|
|
200
|
-
display: inline-block;
|
|
201
|
-
opacity: 0;
|
|
202
|
-
transition: opacity ${upload.transition};
|
|
203
|
-
pointer-events: none;
|
|
204
|
-
.k-icon {
|
|
205
|
-
font-size: ${upload.gallery.close.fontSize};
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
208
|
.k-upload-icons {
|
|
209
209
|
opacity: 0;
|
|
210
210
|
transition: opacity ${upload.transition};
|
|
211
211
|
}
|
|
212
|
-
&:hover {
|
|
213
|
-
.k-upload-icons {
|
|
214
|
-
opacity: 1;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
212
|
}
|
|
218
213
|
|
|
219
214
|
.k-upload-picture-card {
|
|
220
|
-
display: inline-
|
|
215
|
+
display: inline-flex;
|
|
221
216
|
width: ${upload.gallery.width};
|
|
222
217
|
height: ${upload.gallery.height};
|
|
223
218
|
border-radius: ${upload.gallery.borderRadius};
|
|
224
219
|
border: ${upload.gallery.border};
|
|
225
|
-
text-align: center;
|
|
226
|
-
cursor: pointer;
|
|
227
220
|
margin: ${upload.gallery.margin};
|
|
228
221
|
background: ${upload.gallery.bgColor};
|
|
222
|
+
align-items: center;
|
|
223
|
+
justify-content: center;
|
|
224
|
+
flex-direction: column;
|
|
229
225
|
}
|
|
230
226
|
.k-upload-add {
|
|
231
227
|
border: ${upload.gallery.add.border};
|
|
232
|
-
font-size: ${upload.gallery.add.fontSize};
|
|
233
|
-
line-height: calc(${upload.gallery.height} - 2px);
|
|
228
|
+
// font-size: ${upload.gallery.add.fontSize};
|
|
229
|
+
// line-height: calc(${upload.gallery.height} - 2px);
|
|
230
|
+
cursor: pointer;
|
|
234
231
|
&:hover {
|
|
235
232
|
border-color: ${upload.gallery.add.hoverBorderColor};
|
|
236
233
|
}
|
|
237
234
|
}
|
|
238
|
-
|
|
239
235
|
.k-upload-overlap {
|
|
240
236
|
position: absolute;
|
|
241
237
|
width: 100%;
|
|
242
238
|
height: 100%;
|
|
243
239
|
left: 0;
|
|
244
240
|
top: 0;
|
|
245
|
-
color: ${upload.overlap.color};
|
|
246
241
|
background: ${upload.overlap.bgColor};
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
gap: ${upload.overlap.iconGap};
|
|
246
|
+
color: ${upload.overlap.color};
|
|
247
|
+
.k-icon:not(:hover) {
|
|
248
|
+
color: inherit;
|
|
249
|
+
}
|
|
247
250
|
.k-upload-progress {
|
|
248
251
|
position: absolute;
|
|
249
252
|
width: 100%;
|
|
@@ -252,13 +255,6 @@ export function makeStyles() {
|
|
|
252
255
|
transform: translateY(-50%);
|
|
253
256
|
}
|
|
254
257
|
}
|
|
255
|
-
.k-upload-zoom {
|
|
256
|
-
display: inline-block;
|
|
257
|
-
position: relative;
|
|
258
|
-
top: 50%;
|
|
259
|
-
transform: translateY(-50%);
|
|
260
|
-
font-size: ${upload.overlap.zoomFontSize};
|
|
261
|
-
}
|
|
262
258
|
`;
|
|
263
259
|
}
|
|
264
260
|
|