@king-design/intact 3.0.0-beta.1 → 3.0.0-beta.2
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/demos/basic.md +1 -1
- package/components/button/demos/disabled.md +2 -1
- package/components/button/demos/group.md +2 -2
- package/components/button/demos/icon.md +7 -7
- package/components/button/demos/loading.md +4 -4
- package/components/button/demos/size.md +4 -4
- package/components/button/styles.ts +19 -13
- package/components/carousel/index.vdt +2 -2
- package/components/cascader/index.vdt +1 -1
- package/components/checkbox/demos/basic.md +1 -1
- package/components/checkbox/demos/group.md +1 -1
- package/components/checkbox/demos/indeterminate.md +1 -1
- package/components/checkbox/demos/value.md +1 -1
- package/components/collapse/item.vdt +1 -1
- package/components/copy/index.vdt +1 -1
- package/components/datepicker/calendar.vdt +6 -6
- package/components/datepicker/demos/datetime.md +5 -4
- package/components/datepicker/index.spec.ts +11 -1
- package/components/datepicker/styles.ts +6 -1
- package/components/datepicker/useValue.ts +35 -10
- package/components/dialog/styles.ts +1 -1
- package/components/dropdown/demos/basic.md +1 -1
- package/components/dropdown/demos/checkbox.md +1 -1
- package/components/dropdown/demos/disabled.md +2 -2
- package/components/dropdown/demos/nested.md +6 -6
- package/components/dropdown/demos/position.md +3 -3
- package/components/dropdown/demos/trigger.md +2 -2
- package/components/form/demos/basic.md +2 -2
- package/components/form/demos/custom.md +2 -4
- package/components/form/styles.ts +2 -2
- package/components/icon/demos/icons.md +130 -97
- package/components/icon/styles.ts +6 -2
- package/components/input/demos/blocks.md +7 -2
- package/components/input/demos/clearable.md +2 -2
- package/components/input/demos/showCount.md +18 -0
- package/components/input/demos/size.md +6 -4
- package/components/input/index.md +1 -0
- package/components/input/index.ts +5 -0
- package/components/input/index.vdt +22 -14
- package/components/input/search.vdt +2 -5
- package/components/input/styles.ts +81 -77
- package/components/input/useFocus.ts +17 -0
- package/components/menu/item.vdt +1 -1
- package/components/pagination/index.vdt +2 -2
- package/components/progress/index.vdt +1 -1
- package/components/radio/demos/basic.md +1 -1
- package/components/radio/demos/group.md +1 -1
- package/components/radio/demos/value.md +1 -1
- package/components/select/base.vdt +19 -17
- package/components/select/demos/customMenu.md +2 -2
- package/components/select/index.spec.ts +4 -1
- package/components/select/menu.vdt +2 -2
- package/components/select/option.vdt +1 -0
- package/components/select/styles.ts +5 -1
- package/components/spinner/index.vdt +4 -4
- package/components/spinner/styles.ts +9 -6
- package/components/steps/step.vdt +2 -2
- package/components/steps/styles.ts +5 -1
- package/components/table/cell.vdt +1 -1
- package/components/table/column.vdt +27 -16
- package/components/table/demos/group.md +4 -3
- package/components/table/demos/title.md +3 -5
- package/components/table/index.spec.ts +18 -1
- package/components/table/styles.ts +21 -28
- package/components/table/useGroup.ts +41 -23
- package/components/tabs/index.vdt +3 -2
- package/components/tag/index.md +31 -0
- package/components/tag/styles.ts +6 -6
- package/components/tag/tags.vdt +1 -0
- package/components/tag/useNowrap.ts +1 -1
- package/components/transfer/index.vdt +4 -3
- package/components/types.ts +1 -0
- package/components/upload/index.vdt +4 -4
- package/es/components/button/styles.d.ts +1 -1
- package/es/components/button/styles.js +3 -5
- package/es/components/carousel/index.vdt.js +2 -2
- package/es/components/cascader/index.vdt.js +1 -1
- package/es/components/collapse/item.vdt.js +1 -1
- package/es/components/copy/index.vdt.js +1 -1
- package/es/components/datepicker/calendar.vdt.js +6 -6
- package/es/components/datepicker/index.spec.js +170 -152
- package/es/components/datepicker/styles.js +1 -1
- package/es/components/datepicker/useValue.d.ts +3 -3
- package/es/components/datepicker/useValue.js +38 -9
- package/es/components/dialog/styles.js +1 -1
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/styles.js +1 -1
- package/es/components/input/index.d.ts +3 -1
- package/es/components/input/index.js +4 -1
- package/es/components/input/index.vdt.js +21 -10
- package/es/components/input/search.vdt.js +2 -4
- package/es/components/input/styles.js +13 -6
- package/es/components/input/useFocus.d.ts +4 -0
- package/es/components/input/useFocus.js +21 -0
- package/es/components/menu/item.vdt.js +4 -1
- package/es/components/pagination/index.vdt.js +2 -2
- package/es/components/progress/index.vdt.js +1 -1
- package/es/components/select/base.vdt.js +36 -19
- package/es/components/select/index.spec.js +23 -11
- package/es/components/select/menu.vdt.js +5 -5
- package/es/components/select/option.vdt.js +2 -1
- package/es/components/select/styles.js +1 -1
- package/es/components/spinner/index.vdt.js +4 -4
- package/es/components/spinner/styles.js +2 -2
- package/es/components/steps/step.vdt.js +2 -2
- package/es/components/steps/styles.js +6 -2
- package/es/components/table/cell.vdt.js +1 -1
- package/es/components/table/column.vdt.js +40 -24
- package/es/components/table/index.spec.js +37 -6
- package/es/components/table/styles.js +15 -8
- package/es/components/table/useGroup.d.ts +9 -3
- package/es/components/table/useGroup.js +45 -37
- package/es/components/tabs/index.vdt.js +7 -2
- package/es/components/tag/styles.js +1 -1
- package/es/components/tag/tags.vdt.js +14 -2
- package/es/components/tag/useNowrap.js +1 -1
- package/es/components/transfer/index.vdt.js +14 -3
- package/es/components/types.d.ts +1 -0
- package/es/components/upload/index.vdt.js +4 -4
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/site/data/components/button/demos/disabled/react.js +5 -2
- package/es/site/data/components/button/demos/group/react.js +2 -2
- package/es/site/data/components/button/demos/icon/react.js +7 -7
- package/es/site/data/components/button/demos/loading/react.js +4 -4
- package/es/site/data/components/button/demos/size/react.js +4 -4
- package/es/site/data/components/datepicker/demos/datetime/index.d.ts +1 -0
- package/es/site/data/components/datepicker/demos/datetime/index.js +1 -0
- package/es/site/data/components/dropdown/demos/basic/react.js +1 -1
- package/es/site/data/components/dropdown/demos/checkbox/react.js +1 -1
- package/es/site/data/components/dropdown/demos/disabled/react.js +2 -2
- package/es/site/data/components/dropdown/demos/nested/react.js +9 -9
- package/es/site/data/components/dropdown/demos/position/react.js +3 -3
- package/es/site/data/components/dropdown/demos/trigger/react.js +2 -2
- package/es/site/data/components/form/demos/basic/react.js +1 -1
- package/es/site/data/components/icon/demos/icons/index.d.ts +8 -4
- package/es/site/data/components/icon/demos/icons/index.js +35 -1
- package/es/site/data/components/icon/demos/icons/react.d.ts +9 -4
- package/es/site/data/components/icon/demos/icons/react.js +51 -9
- package/es/site/data/components/input/demos/blocks/react.js +7 -7
- package/es/site/data/components/input/demos/clearable/react.js +2 -2
- package/es/site/data/components/input/demos/showCount/index.d.ts +5 -0
- package/es/site/data/components/input/demos/showCount/index.js +17 -0
- package/es/site/data/components/input/demos/showCount/react.d.ts +4 -0
- package/es/site/data/components/input/demos/showCount/react.js +33 -0
- package/es/site/data/components/input/demos/size/react.js +8 -8
- package/es/site/data/components/select/demos/customMenu/react.js +5 -5
- package/es/site/data/components/table/demos/title/react.js +4 -4
- package/es/site/src/pages/styles.js +1 -1
- package/es/site/src/router/index.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 +35 -35
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/global.js +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
- package/styles/fonts/demo.css +277 -108
- package/styles/fonts/demo_index.html +2169 -0
- package/styles/fonts/iconfont.css +52 -50
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -0
- package/styles/fonts/iconfont.json +611 -0
- package/styles/fonts/iconfont.svg +35 -35
- package/styles/fonts/iconfont.ts +123 -124
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/global.ts +4 -4
- package/components/select/useNowrap.ts +0 -24
- package/es/components/select/useNowrap.d.ts +0 -3
- package/es/components/select/useNowrap.js +0 -19
|
@@ -4,7 +4,7 @@ import {Button} from '../button';
|
|
|
4
4
|
import {Icon} from '../icon';
|
|
5
5
|
import {Checkbox} from '../checkbox';
|
|
6
6
|
import {makeGroupMenuStyles} from './styles';
|
|
7
|
-
import {isStringOrNumber, get} from 'intact-shared';
|
|
7
|
+
import {isStringOrNumber, get, isArray} from 'intact-shared';
|
|
8
8
|
import {context as GroupContext} from './useGroup';
|
|
9
9
|
import {context as SortableContext} from './useSortable';
|
|
10
10
|
import {linkEvent} from 'intact';
|
|
@@ -16,7 +16,11 @@ import {Input} from '../input';
|
|
|
16
16
|
import {_$} from '../../i18n';
|
|
17
17
|
|
|
18
18
|
const {title, fixed, group, multiple, key, sortable, cols, rows} = this.get();
|
|
19
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
onSelect, isChecked, keywords, filteredGroup,
|
|
21
|
+
onShow, reset, confirm, dropdownRef,
|
|
22
|
+
localGroupValue, isEmptyValue,
|
|
23
|
+
} = this.group;
|
|
20
24
|
|
|
21
25
|
<TableContext.Consumer>
|
|
22
26
|
{checkType => {
|
|
@@ -35,14 +39,12 @@ const {onSelect, isChecked, getGroupText, keywords, filteredGroup} = this.group;
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
const groupValue = currentGroup && currentGroup[key];
|
|
38
|
-
const groupText = getGroupText(groupValue);
|
|
39
|
-
|
|
40
42
|
const type = sort && sort.key === key && sort.type;
|
|
41
43
|
|
|
42
44
|
let checked;
|
|
43
45
|
return <th className={classNameObj}
|
|
44
46
|
style={style}
|
|
45
|
-
title={isStringOrNumber(title) ? title
|
|
47
|
+
title={isStringOrNumber(title) ? title : null}
|
|
46
48
|
ev-click={sortable ? linkEvent(key, onChangeSort) : null}
|
|
47
49
|
colspan={cols}
|
|
48
50
|
rowspan={rows}
|
|
@@ -58,19 +60,19 @@ const {onSelect, isChecked, getGroupText, keywords, filteredGroup} = this.group;
|
|
|
58
60
|
<div class="k-table-title">
|
|
59
61
|
<div class="k-table-title-text c-ellipsis">
|
|
60
62
|
<b:title>{title}</b:title>
|
|
61
|
-
{groupText}
|
|
62
63
|
</div>
|
|
63
64
|
<Dropdown v-if={group}
|
|
64
65
|
position={{my: 'center top', at: 'center bottom+5', collision: 'flipfit'}}
|
|
65
66
|
key="dropdown"
|
|
66
67
|
trigger="click"
|
|
67
|
-
ev-show={() =>
|
|
68
|
+
ev-show={() => onShow(groupValue)}
|
|
69
|
+
ref={dropdownRef}
|
|
68
70
|
>
|
|
69
|
-
<
|
|
71
|
+
<Icon class="k-icon-down-squared k-table-group"
|
|
70
72
|
ev-click={e => e._ignoreSortable = true}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
hoverable
|
|
74
|
+
color={isEmptyValue(groupValue) ? null : 'primary'}
|
|
75
|
+
/>
|
|
74
76
|
<DropdownMenu class={{"k-table-group-dropdown": true, [makeGroupMenuStyles()]: true}}>
|
|
75
77
|
<div class="k-table-group-header">
|
|
76
78
|
<Input size="small" fluid
|
|
@@ -79,26 +81,35 @@ const {onSelect, isChecked, getGroupText, keywords, filteredGroup} = this.group;
|
|
|
79
81
|
ev-$change:value={keywords.set}
|
|
80
82
|
clearable
|
|
81
83
|
>
|
|
82
|
-
<b:suffix><Icon class="
|
|
84
|
+
<b:suffix><Icon class="k-icon-search" /></b:suffix>
|
|
83
85
|
</Input>
|
|
84
86
|
</div>
|
|
85
87
|
<div class="k-table-group-body">
|
|
86
88
|
<DropdownItem v-for={filteredGroup.value}
|
|
87
|
-
ev-select={() => onSelect($value.value,
|
|
89
|
+
ev-select={() => onSelect($value.value, onChange)}
|
|
88
90
|
hideOnSelect={!multiple}
|
|
89
|
-
class={{'k-active': (checked = isChecked($value.value
|
|
91
|
+
class={{'k-active': (checked = isChecked($value.value))}}
|
|
90
92
|
>
|
|
91
93
|
<Checkbox v-if={multiple} value={checked}>{$value.label}</Checkbox>
|
|
92
94
|
<span v-else>{$value.label}</span>
|
|
93
95
|
</DropdownItem>
|
|
94
96
|
</div>
|
|
97
|
+
<div class="k-table-group-footer" v-if={multiple}>
|
|
98
|
+
<Button type="none" size="small"
|
|
99
|
+
disabled={isEmptyValue(localGroupValue.value)}
|
|
100
|
+
ev-click={reset}
|
|
101
|
+
>重置</Button>
|
|
102
|
+
<Button type="primary" size="small"
|
|
103
|
+
ev-click={() => confirm(onChange)}
|
|
104
|
+
>确定</Button>
|
|
105
|
+
</div>
|
|
95
106
|
</DropdownMenu>
|
|
96
107
|
</Dropdown>
|
|
97
108
|
<div v-if={sortable}
|
|
98
109
|
class={{'k-column-sort': true, [`k-${type}`]: type}}
|
|
99
110
|
>
|
|
100
|
-
<Icon class="
|
|
101
|
-
<Icon class="
|
|
111
|
+
<Icon class="k-icon-up k-asc" size="mini" />
|
|
112
|
+
<Icon class="k-icon-down k-desc" size="mini" />
|
|
102
113
|
</div>
|
|
103
114
|
</div>
|
|
104
115
|
</th>
|
|
@@ -5,9 +5,10 @@ order: 18
|
|
|
5
5
|
|
|
6
6
|
分组需要两个`group`来指定:
|
|
7
7
|
|
|
8
|
-
1. 第一个是`Table`上的`group`属性,该属性指定当前分组的方式,形式为:`{key: ["分组的列的key"], value: ["当前列选择的分组的值"]}
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
1. 第一个是`Table`上的`group`属性,该属性指定当前分组的方式,形式为:`{key: ["分组的列的key"], value: ["当前列选择的分组的值"]}`。
|
|
9
|
+
对于“全部”选项,`value`需要设为空字符串`""`,这样才能在选择“全部”的时候,不高亮筛选按钮
|
|
10
|
+
2. 第二个是`TableColumn`的`group`属性,该属性指定当前列有哪些可选的分组方式,形式为:`[{label: "分组展示文案", value: "选择后的值"}]`。
|
|
11
|
+
如果该列支持多选,还可以添加`multiple`属性,默认为单选
|
|
11
12
|
|
|
12
13
|
当分组方式改变时,可以监听默认事件`$change:group`来执行自定义分组逻辑
|
|
13
14
|
|
|
@@ -6,7 +6,7 @@ order: 2
|
|
|
6
6
|
给表格定义复杂的表头内容,只需要通过`TableColumn` `title`扩展点传入自定义内容即可
|
|
7
7
|
|
|
8
8
|
```vdt
|
|
9
|
-
import {Table, TableColumn, Tooltip} from 'kpc';
|
|
9
|
+
import {Table, TableColumn, Tooltip, Icon} from 'kpc';
|
|
10
10
|
|
|
11
11
|
<Table data={this.get('data')}>
|
|
12
12
|
<TableColumn key="a"
|
|
@@ -14,9 +14,9 @@ import {Table, TableColumn, Tooltip} from 'kpc';
|
|
|
14
14
|
sortable
|
|
15
15
|
>
|
|
16
16
|
<b:title>
|
|
17
|
-
<span title="自定义表头内容" class="
|
|
17
|
+
<span title="自定义表头内容" class="title">自定义表头内容</span>
|
|
18
18
|
<Tooltip content="tooltip content">
|
|
19
|
-
<
|
|
19
|
+
<Icon class="k-icon-question" />
|
|
20
20
|
</Tooltip>
|
|
21
21
|
</b:title>
|
|
22
22
|
</TableColumn>
|
|
@@ -26,8 +26,6 @@ import {Table, TableColumn, Tooltip} from 'kpc';
|
|
|
26
26
|
|
|
27
27
|
```styl
|
|
28
28
|
.k-table
|
|
29
|
-
.middle
|
|
30
|
-
vertical-align middle
|
|
31
29
|
.title
|
|
32
30
|
margin-right 8px
|
|
33
31
|
```
|
|
@@ -230,13 +230,30 @@ describe('Table', () => {
|
|
|
230
230
|
const [item1, item2] = dropdown2.querySelectorAll<HTMLElement>('.k-checkbox');
|
|
231
231
|
item1.click();
|
|
232
232
|
await wait();
|
|
233
|
-
expect(instance.get('multipleGroup')).to.eql({status: [
|
|
233
|
+
expect(instance.get('multipleGroup')).to.eql({status: []});
|
|
234
234
|
expect(table2.innerHTML).to.matchSnapshot();
|
|
235
235
|
item2.click();
|
|
236
236
|
await wait();
|
|
237
|
+
expect(instance.get('multipleGroup')).to.eql({status: []});
|
|
238
|
+
|
|
239
|
+
// click confirm
|
|
240
|
+
const [reset, confirm] = dropdown2.querySelectorAll<HTMLElement>('.k-table-group-footer .k-btn');
|
|
241
|
+
confirm.click();
|
|
242
|
+
await wait();
|
|
237
243
|
expect(instance.get('multipleGroup')).to.eql({status: ['active', 'stopped']});
|
|
238
244
|
expect(table2.innerHTML).to.matchSnapshot();
|
|
239
245
|
|
|
246
|
+
// click reset
|
|
247
|
+
dispatchEvent(icon2, 'click');
|
|
248
|
+
await wait();
|
|
249
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
250
|
+
reset.click();
|
|
251
|
+
await wait();
|
|
252
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
253
|
+
confirm.click();
|
|
254
|
+
await wait();
|
|
255
|
+
expect(instance.get('multipleGroup')).to.eql({status: []});
|
|
256
|
+
|
|
240
257
|
// update group
|
|
241
258
|
instance.set('statusGroup', [{label: 'label', value: 'value'}]);
|
|
242
259
|
dispatchEvent(icon, 'click');
|
|
@@ -17,6 +17,7 @@ const defaults = {
|
|
|
17
17
|
// head
|
|
18
18
|
thead: {
|
|
19
19
|
get bgColor() { return theme.color.bg },
|
|
20
|
+
get color() { return theme.color.lightBlack },
|
|
20
21
|
padding: `0 5px 0 12px`,
|
|
21
22
|
fontSize: `12px`,
|
|
22
23
|
fontWeight: `bold`,
|
|
@@ -37,10 +38,9 @@ const defaults = {
|
|
|
37
38
|
|
|
38
39
|
// group
|
|
39
40
|
group: {
|
|
40
|
-
|
|
41
|
-
gap: `10px`,
|
|
42
|
-
color: `#a6a6a6`,
|
|
41
|
+
gap: `8px`,
|
|
43
42
|
menuMaxHeight: '200px',
|
|
43
|
+
menuMinWidth: '200px',
|
|
44
44
|
get activeColor() { return theme.color.primary },
|
|
45
45
|
headerPadding: `8px`,
|
|
46
46
|
get headerBorder() { return `1px solid ${theme.color.bg}` },
|
|
@@ -49,9 +49,9 @@ const defaults = {
|
|
|
49
49
|
// sort
|
|
50
50
|
sort: {
|
|
51
51
|
iconHeight: `7px`,
|
|
52
|
-
gap: `
|
|
53
|
-
color: `#d0d5d9`,
|
|
54
|
-
|
|
52
|
+
gap: `8px`,
|
|
53
|
+
// color: `#d0d5d9`,
|
|
54
|
+
get enabledColor() { return theme.color.primary },
|
|
55
55
|
},
|
|
56
56
|
|
|
57
57
|
expandBgColor: '#fdfcff',
|
|
@@ -133,10 +133,11 @@ export function makeStyles() {
|
|
|
133
133
|
display: inline-flex;
|
|
134
134
|
align-items: center;
|
|
135
135
|
max-width: 100%;
|
|
136
|
-
color: ${
|
|
136
|
+
color: ${table.thead.color};
|
|
137
137
|
}
|
|
138
138
|
.k-table-title-text {
|
|
139
139
|
flex: 1;
|
|
140
|
+
display: inline-flex;
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
// tbody
|
|
@@ -241,23 +242,7 @@ export function makeStyles() {
|
|
|
241
242
|
|
|
242
243
|
// group
|
|
243
244
|
.k-table-group {
|
|
244
|
-
width: ${table.group.width} !important;
|
|
245
|
-
height: ${table.group.width} !important;
|
|
246
245
|
margin-left: ${table.group.gap};
|
|
247
|
-
position: relative;
|
|
248
|
-
color: ${table.group.color};
|
|
249
|
-
&:hover {
|
|
250
|
-
color: ${theme.color.primary};
|
|
251
|
-
}
|
|
252
|
-
.k-icon {
|
|
253
|
-
// position: absolute;
|
|
254
|
-
// top: -1px;
|
|
255
|
-
// left: 2px;
|
|
256
|
-
transition: transform ${table.transition};
|
|
257
|
-
}
|
|
258
|
-
&.k-dropdown-open .k-icon {
|
|
259
|
-
transform: rotate(180deg);
|
|
260
|
-
}
|
|
261
246
|
}
|
|
262
247
|
|
|
263
248
|
// force checkbox / radio vertical align middle
|
|
@@ -278,12 +263,11 @@ export function makeStyles() {
|
|
|
278
263
|
display: block;
|
|
279
264
|
height: ${table.sort.iconHeight};
|
|
280
265
|
line-height: ${table.sort.iconHeight};
|
|
281
|
-
margin
|
|
282
|
-
color: ${table.sort.color};
|
|
266
|
+
margin: 0 0 1px ${table.sort.gap};
|
|
283
267
|
}
|
|
284
|
-
&.k-
|
|
285
|
-
&.k-
|
|
286
|
-
color: ${table.sort.
|
|
268
|
+
&.k-desc .k-icon.k-desc,
|
|
269
|
+
&.k-asc .k-icon.k-asc {
|
|
270
|
+
color: ${table.sort.enabledColor};
|
|
287
271
|
}
|
|
288
272
|
}
|
|
289
273
|
|
|
@@ -379,6 +363,7 @@ export function makeStyles() {
|
|
|
379
363
|
export function makeGroupMenuStyles() {
|
|
380
364
|
return css`
|
|
381
365
|
max-height: ${table.group.menuMaxHeight};
|
|
366
|
+
min-width: ${table.group.menuMinWidth} !important;
|
|
382
367
|
overflow: auto;
|
|
383
368
|
.k-dropdown-item.k-active {
|
|
384
369
|
color: ${table.group.activeColor};
|
|
@@ -387,5 +372,13 @@ export function makeGroupMenuStyles() {
|
|
|
387
372
|
padding: ${table.group.headerPadding};
|
|
388
373
|
border-bottom: ${table.group.headerBorder};
|
|
389
374
|
}
|
|
375
|
+
.k-table-group-footer {
|
|
376
|
+
text-align: right;
|
|
377
|
+
border-top: ${table.group.headerBorder};
|
|
378
|
+
padding: 8px;
|
|
379
|
+
.k-btn {
|
|
380
|
+
margin-left: 8px;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
390
383
|
`
|
|
391
384
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {useInstance} from 'intact';
|
|
1
|
+
import {useInstance, createRef} from 'intact';
|
|
2
2
|
import type {TableColumn, TableColumnGroupItem} from './column';
|
|
3
|
-
import {
|
|
3
|
+
import {isArray} from 'intact-shared';
|
|
4
4
|
import {toggleArray} from '../utils';
|
|
5
5
|
import {createContext} from '../context';
|
|
6
6
|
import {useState, watchState} from '../../hooks/useState';
|
|
7
|
+
import type { Dropdown } from '../dropdown';
|
|
7
8
|
|
|
8
9
|
type ContextValue = {
|
|
9
10
|
groupValue: any
|
|
@@ -16,44 +17,50 @@ export function useGroup() {
|
|
|
16
17
|
const instance = useInstance() as TableColumn;
|
|
17
18
|
const keywords = useState<string>('');
|
|
18
19
|
const filteredGroup = useState<TableColumnGroupItem[] | undefined>(instance.get('group'));
|
|
20
|
+
const localGroupValue = useState<any>(null);
|
|
21
|
+
const dropdownRef = createRef<Dropdown>();
|
|
19
22
|
|
|
20
23
|
instance.on('$receive:group', (group) => filteredGroup.set(group));
|
|
21
24
|
|
|
22
|
-
function
|
|
25
|
+
function onShow(groupValue: any) {
|
|
26
|
+
keywords.set('');
|
|
27
|
+
localGroupValue.set(groupValue);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function onSelect(value: any, onChange: ContextValue['onChange']) {
|
|
23
31
|
const {multiple, key} = instance.get();
|
|
24
32
|
|
|
25
33
|
if (multiple) {
|
|
26
|
-
|
|
34
|
+
// should click confirm button when it is multiple selection
|
|
35
|
+
localGroupValue.set(toggleArray(localGroupValue.value, value));
|
|
36
|
+
} else {
|
|
37
|
+
// change immediately when it is single selection
|
|
38
|
+
onChange(key, value);
|
|
27
39
|
}
|
|
28
|
-
onChange(key, value);
|
|
29
40
|
}
|
|
30
41
|
|
|
31
|
-
function isChecked(value: any
|
|
42
|
+
function isChecked(value: any) {
|
|
32
43
|
const {multiple} = instance.get();
|
|
44
|
+
const groupValue = localGroupValue.value;
|
|
33
45
|
if (multiple) {
|
|
34
46
|
return groupValue && groupValue.includes(value);
|
|
35
47
|
}
|
|
36
48
|
return groupValue === value;
|
|
37
49
|
}
|
|
38
50
|
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
groupValue = [groupValue];
|
|
45
|
-
}
|
|
51
|
+
function confirm(onChange: ContextValue['onChange']) {
|
|
52
|
+
const {key} = instance.get();
|
|
53
|
+
onChange(key, localGroupValue.value);
|
|
54
|
+
dropdownRef.value!.hide(true);
|
|
55
|
+
}
|
|
46
56
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.join(', ');
|
|
51
|
-
if (ret) {
|
|
52
|
-
return `(${ret})`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
57
|
+
function reset() {
|
|
58
|
+
localGroupValue.set([]);
|
|
59
|
+
}
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
function isEmptyValue(groupValue: any) {
|
|
62
|
+
const {multiple} = instance.get();
|
|
63
|
+
return !groupValue || multiple && (!isArray(groupValue) || groupValue.every(value => !value));
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
watchState(keywords, (v) => {
|
|
@@ -69,5 +76,16 @@ export function useGroup() {
|
|
|
69
76
|
}
|
|
70
77
|
});
|
|
71
78
|
|
|
72
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
onSelect,
|
|
81
|
+
isChecked,
|
|
82
|
+
keywords,
|
|
83
|
+
filteredGroup,
|
|
84
|
+
onShow,
|
|
85
|
+
reset,
|
|
86
|
+
confirm,
|
|
87
|
+
dropdownRef,
|
|
88
|
+
localGroupValue,
|
|
89
|
+
isEmptyValue,
|
|
90
|
+
};
|
|
73
91
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {Button} from '../button';
|
|
2
2
|
import {getRestProps} from '../utils';
|
|
3
3
|
import {makeStyles} from './styles';
|
|
4
|
+
import {Icon} from '../icon';
|
|
4
5
|
|
|
5
6
|
const {className, children, vertical, size, type} = this.get();
|
|
6
7
|
const {
|
|
@@ -25,7 +26,7 @@ const classNameObj = {
|
|
|
25
26
|
disabled={!enablePrev.value}
|
|
26
27
|
ev-click={prev}
|
|
27
28
|
>
|
|
28
|
-
<
|
|
29
|
+
<Icon class={vertical ? "k-icon-up" : "k-icon-left"} />
|
|
29
30
|
</Button>
|
|
30
31
|
<div class="k-tabs-scroll c-clearfix" ref={scrollRef}>
|
|
31
32
|
<div class="k-tabs-wrapper"
|
|
@@ -43,6 +44,6 @@ const classNameObj = {
|
|
|
43
44
|
disabled={!enableNext.value}
|
|
44
45
|
ev-click={next}
|
|
45
46
|
>
|
|
46
|
-
<
|
|
47
|
+
<Icon class={vertical ? "k-icon-down" : "k-icon-right"} />
|
|
47
48
|
</Button>
|
|
48
49
|
</div>
|
package/components/tag/index.md
CHANGED
|
@@ -27,8 +27,39 @@ sidebar: doc
|
|
|
27
27
|
| nowrap | 是否单行展示标签组,超出的部分会隐藏,仅展示隐藏数量 | `boolean` | `flase` |
|
|
28
28
|
| draggable | 标签是否支持拖动排序 | `boolean` | `false` |
|
|
29
29
|
|
|
30
|
+
# 扩展点
|
|
31
|
+
|
|
32
|
+
## Tags
|
|
33
|
+
|
|
34
|
+
| 名称 | 说明 | 参数 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| append | 追加到后面的元素,不参与到`Tags`对`Tag`的管理中 | - |
|
|
37
|
+
|
|
38
|
+
|
|
30
39
|
# 事件
|
|
31
40
|
|
|
41
|
+
## Tag
|
|
42
|
+
|
|
32
43
|
| 事件名 | 说明 | 参数 |
|
|
33
44
|
| --- | --- | --- |
|
|
34
45
|
| close | 标签关闭事件 | `(e: MouseEvent) => void` |
|
|
46
|
+
|
|
47
|
+
## Tags
|
|
48
|
+
|
|
49
|
+
| 事件名 | 说明 | 参数 |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| dragstart | 拖动开始 | `(v: TagsDragStartParam) => void` |
|
|
52
|
+
| dragend | 拖动结束 | `(v: TagsDragEndParam) => void` |
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
type Key = string | number
|
|
56
|
+
|
|
57
|
+
export type TagsDragStartParam = {
|
|
58
|
+
key: Key
|
|
59
|
+
from: number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type TagsDragEndParam = TagsDragStartParam & {
|
|
63
|
+
to: number
|
|
64
|
+
}
|
|
65
|
+
```
|
package/components/tag/styles.ts
CHANGED
|
@@ -155,12 +155,12 @@ export function makeTagsStyles() {
|
|
|
155
155
|
overflow: hidden;
|
|
156
156
|
&.k-nowrap {
|
|
157
157
|
flex-wrap: nowrap;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
.k-tag {
|
|
159
|
+
white-space: nowrap;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
}
|
|
164
164
|
}
|
|
165
165
|
.k-tags-more {
|
|
166
166
|
cursor: default;
|
package/components/tag/tags.vdt
CHANGED
|
@@ -32,7 +32,7 @@ export function useNowrap(originVNodes: State<VNode[]>) {
|
|
|
32
32
|
useResizeObserver(containerRef, refresh);
|
|
33
33
|
|
|
34
34
|
function refresh() {
|
|
35
|
-
if (!instance.get('nowrap')) return;
|
|
35
|
+
if (!instance.get('nowrap') || instance.$unmounted) return;
|
|
36
36
|
|
|
37
37
|
const container = containerRef.value!;
|
|
38
38
|
const containerWidth = container.offsetWidth;
|
|
@@ -5,6 +5,7 @@ import {Input} from '../input';
|
|
|
5
5
|
import {Checkbox} from '../checkbox';
|
|
6
6
|
import {Button} from '../button';
|
|
7
7
|
import {Tree} from '../tree';
|
|
8
|
+
import {Icon} from '../icon';
|
|
8
9
|
|
|
9
10
|
const {
|
|
10
11
|
data, className, keyName, labelName,
|
|
@@ -45,7 +46,7 @@ const Panel = (model) => {
|
|
|
45
46
|
size="small"
|
|
46
47
|
>
|
|
47
48
|
<b:prefix>
|
|
48
|
-
<
|
|
49
|
+
<Icon class="k-icon-search" size="small" />
|
|
49
50
|
</b:prefix>
|
|
50
51
|
</Input>
|
|
51
52
|
</b:filter>
|
|
@@ -83,7 +84,7 @@ const Panel = (model) => {
|
|
|
83
84
|
type="primary"
|
|
84
85
|
size="large"
|
|
85
86
|
>
|
|
86
|
-
<
|
|
87
|
+
<Icon class="k-transfer-icon k-icon-left" />
|
|
87
88
|
</Button>
|
|
88
89
|
<Button circle icon
|
|
89
90
|
disabled={!enableAdd()}
|
|
@@ -91,7 +92,7 @@ const Panel = (model) => {
|
|
|
91
92
|
type="primary"
|
|
92
93
|
size="large"
|
|
93
94
|
>
|
|
94
|
-
<
|
|
95
|
+
<Icon class="k-transfer-icon k-icon-right" />
|
|
95
96
|
</Button>
|
|
96
97
|
</div>
|
|
97
98
|
{Panel('right')}
|
package/components/types.ts
CHANGED
|
@@ -43,12 +43,12 @@ const handle = (
|
|
|
43
43
|
{_$('点击上传')}
|
|
44
44
|
</Button>
|
|
45
45
|
<div class="k-upload-area" v-else>
|
|
46
|
-
<Icon class="k-icon-add-
|
|
46
|
+
<Icon class="k-icon-add-bold" />
|
|
47
47
|
<div innerHTML={_$('将文件拖到此处,或<a>点击上传</a>')}></div>
|
|
48
48
|
</div>
|
|
49
49
|
</template>
|
|
50
50
|
<div v-else class="k-upload-picture-card k-upload-add">
|
|
51
|
-
<Icon class="k-icon-add-
|
|
51
|
+
<Icon class="k-icon-add-bold" size="large" />
|
|
52
52
|
<div>{_$('上传图片')}</div>
|
|
53
53
|
</div>
|
|
54
54
|
</b:content>
|
|
@@ -129,10 +129,10 @@ const {show, close, image, isShow} = this.showImage;
|
|
|
129
129
|
<div class="k-upload-name c-ellipsis">
|
|
130
130
|
<Icon class="k-upload-file-icon ion-document" />
|
|
131
131
|
<span class="k-upload-file-name">{$value.name}</span>
|
|
132
|
-
<Icon class="k-upload-status-icon
|
|
132
|
+
<Icon class="k-upload-status-icon k-icon-success-fill"
|
|
133
133
|
v-if={$value.status === UploadFileStatus.Done}
|
|
134
134
|
/>
|
|
135
|
-
<Icon class="k-upload-status-icon
|
|
135
|
+
<Icon class="k-upload-status-icon k-icon-error-fill"
|
|
136
136
|
v-else-if={$value.status === UploadFileStatus.Error}
|
|
137
137
|
/>
|
|
138
138
|
</div>
|
|
@@ -7,7 +7,7 @@ export var types = ['primary', 'warning', 'danger', 'active', 'success'];
|
|
|
7
7
|
var sizes = ['large', 'small', 'mini'];
|
|
8
8
|
var btnStyles = {
|
|
9
9
|
get color() {
|
|
10
|
-
return theme.color.
|
|
10
|
+
return theme.color.text;
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
bgColor: '#fff',
|
|
@@ -181,9 +181,7 @@ var defaults = deepDefaults({
|
|
|
181
181
|
return theme.color.linkHover;
|
|
182
182
|
},
|
|
183
183
|
|
|
184
|
-
get hoverBgColor() {
|
|
185
|
-
return theme.color.hoverBg;
|
|
186
|
-
}
|
|
184
|
+
hoverBgColor: 'transparent' // get hoverBgColor() { return theme.color.hoverBg },
|
|
187
185
|
|
|
188
186
|
},
|
|
189
187
|
none: {
|
|
@@ -238,7 +236,7 @@ export function makeButtonStyles(_ref) {
|
|
|
238
236
|
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, ";.k-icon{color:inherit;}&: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) {
|
|
239
237
|
var typeStyles = button[type];
|
|
240
238
|
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), ";}}");
|
|
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-
|
|
239
|
+
}), "&.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-none,&.k-link,&.k-flat{background:transparent;&,&:hover{border:none;}&.k-active{color:", theme.color.primary, ";}}&.k-none:hover{background:", button.none.hoverBgColor, ";}&.k-flat{background:", button.none.hoverBgColor, ";}&.k-disabled{&,&:hover{color:", button.disabled.color, ";background:", button.disabled.bgColor, ";border-color:", button.disabled.borderColor, ";cursor:not-allowed;}}&.k-none.k-disabled,&.k-link.k-disabled{&,&:hover{background:transparent;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
242
240
|
var styles = button[size];
|
|
243
241
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.k-btn-icon{width:", styles.height, ";}}");
|
|
244
242
|
}), "&.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) {
|
|
@@ -7,10 +7,10 @@ import { Icon } from '../icon';
|
|
|
7
7
|
import { makeStyles } from './styles';
|
|
8
8
|
import { linkEvent } from 'intact';
|
|
9
9
|
var _$tmp0 = {
|
|
10
|
-
'className': '
|
|
10
|
+
'className': 'k-icon-left'
|
|
11
11
|
};
|
|
12
12
|
var _$tmp1 = {
|
|
13
|
-
'className': '
|
|
13
|
+
'className': 'k-icon-right'
|
|
14
14
|
};
|
|
15
15
|
export default function ($props, $blocks, $__proto__) {
|
|
16
16
|
var _classNameObj;
|
|
@@ -39,7 +39,7 @@ 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['
|
|
42
|
+
'className': _$cn((_$cn2 = {}, _$cn2[kls('arrow')] = true, _$cn2['k-icon-right'] = true, _$cn2)),
|
|
43
43
|
'hoverable': !disabled
|
|
44
44
|
})], 0, _$cn(kls('title')), {
|
|
45
45
|
'ev-click': this.toggle
|