@king-design/intact 3.0.0-beta.1 → 3.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/components/badge/styles.ts +1 -1
- package/components/breadcrumb/demos/separator.md +1 -1
- package/components/button/demos/basic.md +1 -1
- package/components/button/demos/disabled.md +2 -1
- package/components/button/demos/group.md +9 -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/group.ts +3 -1
- package/components/button/group.vdt +2 -1
- package/components/button/index.md +1 -0
- package/components/button/index.vdt +1 -1
- package/components/button/styles.ts +37 -16
- 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/checkbox/styles.ts +6 -10
- package/components/collapse/item.vdt +1 -1
- package/components/collapse/styles.ts +0 -2
- 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/dropdown/dropdown.ts +1 -0
- package/components/form/demos/basic.md +2 -2
- package/components/form/demos/custom.md +2 -4
- package/components/form/index.spec.ts +21 -0
- package/components/form/styles.ts +2 -2
- package/components/icon/demos/icons.md +130 -97
- package/components/icon/index.vdt +1 -1
- 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/message/demos/config.md +2 -2
- package/components/message/index.md +1 -1
- package/components/message/message.ts +1 -1
- package/components/pagination/index.vdt +2 -2
- package/components/pagination/styles.ts +1 -4
- package/components/popover/styles.ts +1 -1
- 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/radio/styles.ts +4 -1
- package/components/scrollSelect/styles.ts +1 -1
- package/components/select/base.vdt +25 -20
- 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 +6 -2
- 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/switch/styles.ts +17 -1
- package/components/table/cell.vdt +1 -1
- package/components/table/column.vdt +28 -16
- package/components/table/demos/group.md +4 -3
- package/components/table/demos/showIndeterminate.md +2 -2
- package/components/table/demos/title.md +3 -5
- package/components/table/index.md +1 -1
- package/components/table/index.spec.ts +18 -1
- package/components/table/styles.ts +22 -28
- package/components/table/table.ts +1 -0
- package/components/table/useGroup.ts +42 -23
- package/components/tabs/demos/closable.md +1 -1
- 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/tip/styles.ts +1 -1
- package/components/tooltip/index.spec.ts +30 -0
- package/components/tooltip/tooltip.ts +3 -0
- package/components/transfer/index.vdt +4 -3
- package/components/types.ts +1 -0
- package/components/upload/index.vdt +4 -4
- package/es/components/badge/styles.js +1 -1
- package/es/components/button/group.d.ts +1 -0
- package/es/components/button/group.js +2 -1
- package/es/components/button/group.vdt.js +4 -2
- package/es/components/button/index.vdt.js +1 -1
- package/es/components/button/styles.d.ts +1 -1
- package/es/components/button/styles.js +14 -9
- package/es/components/carousel/index.vdt.js +2 -2
- package/es/components/cascader/index.vdt.js +1 -1
- package/es/components/checkbox/styles.js +4 -8
- package/es/components/collapse/item.vdt.js +1 -1
- package/es/components/collapse/styles.js +2 -2
- 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/dropdown/dropdown.js +2 -1
- package/es/components/form/index.spec.js +45 -0
- package/es/components/form/styles.js +1 -1
- package/es/components/icon/index.vdt.js +3 -2
- 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/message/message.js +1 -1
- package/es/components/pagination/index.vdt.js +2 -2
- package/es/components/pagination/styles.js +2 -5
- package/es/components/popover/styles.js +1 -1
- package/es/components/progress/index.vdt.js +1 -1
- package/es/components/radio/styles.js +1 -1
- package/es/components/scrollSelect/styles.js +1 -1
- package/es/components/select/base.vdt.js +40 -20
- 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 +2 -2
- 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/switch/styles.js +10 -2
- package/es/components/table/cell.vdt.js +1 -1
- package/es/components/table/column.vdt.js +42 -24
- package/es/components/table/index.spec.js +37 -6
- package/es/components/table/styles.js +15 -8
- package/es/components/table/table.js +2 -1
- package/es/components/table/useGroup.d.ts +9 -3
- package/es/components/table/useGroup.js +46 -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/tip/styles.js +1 -1
- package/es/components/tooltip/index.spec.js +57 -0
- package/es/components/tooltip/tooltip.js +5 -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 +19 -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/message/demos/config/index.js +1 -1
- package/es/site/data/components/message/demos/config/react.js +1 -1
- package/es/site/data/components/select/demos/customMenu/react.js +5 -5
- package/es/site/data/components/table/demos/showIndeterminate/react.js +1 -1
- package/es/site/data/components/table/demos/title/react.js +4 -4
- package/es/site/data/components/tabs/demos/closable/react.js +2 -1
- package/es/site/src/pages/layout.js +1 -3
- 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 +36 -36
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/global.js +1 -1
- package/es/styles/theme.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 +36 -36
- 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/styles/theme.ts +1 -1
- package/components/select/useNowrap.ts +0 -24
- package/es/components/select/useNowrap.d.ts +0 -3
- package/es/components/select/useNowrap.js +0 -19
|
@@ -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,12 @@ 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;
|
|
141
|
+
line-height: 1.4;
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
// tbody
|
|
@@ -241,23 +243,7 @@ export function makeStyles() {
|
|
|
241
243
|
|
|
242
244
|
// group
|
|
243
245
|
.k-table-group {
|
|
244
|
-
width: ${table.group.width} !important;
|
|
245
|
-
height: ${table.group.width} !important;
|
|
246
246
|
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
247
|
}
|
|
262
248
|
|
|
263
249
|
// force checkbox / radio vertical align middle
|
|
@@ -278,12 +264,11 @@ export function makeStyles() {
|
|
|
278
264
|
display: block;
|
|
279
265
|
height: ${table.sort.iconHeight};
|
|
280
266
|
line-height: ${table.sort.iconHeight};
|
|
281
|
-
margin
|
|
282
|
-
color: ${table.sort.color};
|
|
267
|
+
margin: 0 0 1px ${table.sort.gap};
|
|
283
268
|
}
|
|
284
|
-
&.k-
|
|
285
|
-
&.k-
|
|
286
|
-
color: ${table.sort.
|
|
269
|
+
&.k-desc .k-icon.k-desc,
|
|
270
|
+
&.k-asc .k-icon.k-asc {
|
|
271
|
+
color: ${table.sort.enabledColor};
|
|
287
272
|
}
|
|
288
273
|
}
|
|
289
274
|
|
|
@@ -379,6 +364,7 @@ export function makeStyles() {
|
|
|
379
364
|
export function makeGroupMenuStyles() {
|
|
380
365
|
return css`
|
|
381
366
|
max-height: ${table.group.menuMaxHeight};
|
|
367
|
+
min-width: ${table.group.menuMinWidth} !important;
|
|
382
368
|
overflow: auto;
|
|
383
369
|
.k-dropdown-item.k-active {
|
|
384
370
|
color: ${table.group.activeColor};
|
|
@@ -387,5 +373,13 @@ export function makeGroupMenuStyles() {
|
|
|
387
373
|
padding: ${table.group.headerPadding};
|
|
388
374
|
border-bottom: ${table.group.headerBorder};
|
|
389
375
|
}
|
|
376
|
+
.k-table-group-footer {
|
|
377
|
+
text-align: right;
|
|
378
|
+
border-top: ${table.group.headerBorder};
|
|
379
|
+
padding: 8px;
|
|
380
|
+
.k-btn {
|
|
381
|
+
margin-left: 8px;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
390
384
|
`
|
|
391
385
|
}
|
|
@@ -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,51 @@ 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
|
-
|
|
51
|
-
if (ret) {
|
|
52
|
-
return `(${ret})`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
57
|
+
function reset(onChange: ContextValue['onChange']) {
|
|
58
|
+
localGroupValue.set([]);
|
|
59
|
+
confirm(onChange);
|
|
60
|
+
}
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
function isEmptyValue(groupValue: any) {
|
|
63
|
+
const {multiple} = instance.get();
|
|
64
|
+
return !groupValue || multiple && (!isArray(groupValue) || groupValue.every(value => !value));
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
watchState(keywords, (v) => {
|
|
@@ -69,5 +77,16 @@ export function useGroup() {
|
|
|
69
77
|
}
|
|
70
78
|
});
|
|
71
79
|
|
|
72
|
-
return {
|
|
80
|
+
return {
|
|
81
|
+
onSelect,
|
|
82
|
+
isChecked,
|
|
83
|
+
keywords,
|
|
84
|
+
filteredGroup,
|
|
85
|
+
onShow,
|
|
86
|
+
reset,
|
|
87
|
+
confirm,
|
|
88
|
+
dropdownRef,
|
|
89
|
+
localGroupValue,
|
|
90
|
+
isEmptyValue,
|
|
91
|
+
};
|
|
73
92
|
}
|
|
@@ -30,7 +30,7 @@ import {Tabs, Tab, Button, ButtonGroup, Icon} from 'kpc';
|
|
|
30
30
|
key={$value.value}
|
|
31
31
|
closable={$value.value !== 10}
|
|
32
32
|
>
|
|
33
|
-
<Icon class="k-icon-paper" size={this.get('size')} style="margin-right: 8px;" />
|
|
33
|
+
<Icon class="k-icon-paper" size={this.get('size')} style="margin-right: 8px;" color="inherit" />
|
|
34
34
|
{$value.label}
|
|
35
35
|
</Tab>
|
|
36
36
|
</Tabs>
|
|
@@ -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;
|
package/components/tip/styles.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {Tooltip} from './';
|
|
|
8
8
|
import {Dialog} from '../dialog';
|
|
9
9
|
import {mount, unmount, dispatchEvent, getElement, wait} from '../../test/utils';
|
|
10
10
|
import { tooltip as tooltipTheme } from './styles';
|
|
11
|
+
import { Select, Option } from '../select';
|
|
11
12
|
|
|
12
13
|
describe('Tooltip', () => {
|
|
13
14
|
afterEach((done) => {
|
|
@@ -378,4 +379,33 @@ describe('Tooltip', () => {
|
|
|
378
379
|
const newWidth = content.offsetWidth;
|
|
379
380
|
expect(newWidth).to.eql(width);
|
|
380
381
|
});
|
|
382
|
+
|
|
383
|
+
it('should not impact select when wrap select with tooltip', async () => {
|
|
384
|
+
class Demo extends Component {
|
|
385
|
+
static template = `
|
|
386
|
+
const {Tooltip, Select, Option} = this;
|
|
387
|
+
<Tooltip>
|
|
388
|
+
<Select>
|
|
389
|
+
<Option value="1">Option 1</Option>
|
|
390
|
+
<Option value="2">Option 2</Option>
|
|
391
|
+
</Select>
|
|
392
|
+
</Tooltip>
|
|
393
|
+
`
|
|
394
|
+
private Tooltip = Tooltip;
|
|
395
|
+
private Select = Select;
|
|
396
|
+
private Option = Option;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const [instance, element] = mount(Demo);
|
|
400
|
+
dispatchEvent(element, 'mouseenter');
|
|
401
|
+
await wait();
|
|
402
|
+
dispatchEvent(element, 'click');
|
|
403
|
+
await wait();
|
|
404
|
+
|
|
405
|
+
const menu = getElement(".k-select-menu")!;
|
|
406
|
+
dispatchEvent(element, 'mouseleave');
|
|
407
|
+
await wait(500);
|
|
408
|
+
|
|
409
|
+
expect(menu.style.display).to.eql('');
|
|
410
|
+
});
|
|
381
411
|
});
|
|
@@ -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>
|
|
@@ -22,5 +22,5 @@ setDefault(function () {
|
|
|
22
22
|
}).badge;
|
|
23
23
|
});
|
|
24
24
|
export default function makeStyles() {
|
|
25
|
-
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:
|
|
25
|
+
return /*#__PURE__*/css("display:inline-block;position:relative;vertical-align:middle;>.k-badge-text{display:inline-block;position:absolute;width:", badge.width, ";height:", badge.height, ";border-radius:50%;top:0;right:0;transform:translate(50%, -50%);background:", badge.bgColor, ";font-size:85%;vertical-align:baseline;}&.k-has-text>.k-badge-text{width:auto;height:", badge.textHeight, ";line-height:", badge.textHeight, ";border-radius:calc(", badge.textHeight, " / 2);padding:0 ", badge.textPadding, ";color:", badge.textColor, ";}&.k-alone>.k-badge-text{position:static;transform:none;}");
|
|
26
26
|
}
|
|
@@ -4,6 +4,7 @@ export interface ButtonGroupProps {
|
|
|
4
4
|
value?: any;
|
|
5
5
|
checkType?: 'none' | 'radio' | 'checkbox';
|
|
6
6
|
fluid?: boolean;
|
|
7
|
+
seperate?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare class ButtonGroup extends Component<ButtonGroupProps> {
|
|
9
10
|
static template: string | import("intact").Template<any>;
|
|
@@ -13,12 +13,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
13
13
|
className = _this$get.className,
|
|
14
14
|
vertical = _this$get.vertical,
|
|
15
15
|
children = _this$get.children,
|
|
16
|
-
fluid = _this$get.fluid
|
|
16
|
+
fluid = _this$get.fluid,
|
|
17
|
+
seperate = _this$get.seperate;
|
|
17
18
|
|
|
18
19
|
var classNameObj = (_classNameObj = {
|
|
19
20
|
'k-btns': true,
|
|
20
21
|
'k-vertical': vertical,
|
|
21
|
-
'k-fluid': fluid
|
|
22
|
+
'k-fluid': fluid,
|
|
23
|
+
'k-seperate': seperate
|
|
22
24
|
}, _classNameObj[className] = className, _classNameObj[makeButtonGroupStyles()] = true, _classNameObj);
|
|
23
25
|
return _$cv('div', _extends({
|
|
24
26
|
'className': _$cn(classNameObj)
|
|
@@ -78,7 +78,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
78
78
|
var waveColor = typeStyles && typeStyles.borderColor || theme.primary.borderColor;
|
|
79
79
|
return _$cc(Wave, {
|
|
80
80
|
'disabled': loading || disabled || type === 'none' || type === 'link',
|
|
81
|
-
'inset': '-2px',
|
|
81
|
+
'inset': type === 'flat' ? '-1px' : '-2px',
|
|
82
82
|
'color': waveColor,
|
|
83
83
|
'children': _$cc(DynamicButton, _extends({
|
|
84
84
|
'className': _$cn(classNameObj),
|
|
@@ -7,14 +7,14 @@ 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',
|
|
14
14
|
lineHeight: '1.15',
|
|
15
15
|
|
|
16
16
|
get padding() {
|
|
17
|
-
return "0 "
|
|
17
|
+
return "0 16px";
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
get borderColor() {
|
|
@@ -146,6 +146,13 @@ var btnSizeStyles = sizes.reduce(function (memo, size) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
};
|
|
149
|
+
|
|
150
|
+
if (size === 'large') {
|
|
151
|
+
Object.defineProperty(memo[size], 'padding', {
|
|
152
|
+
value: "0 24px"
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
149
156
|
return memo;
|
|
150
157
|
}, {});
|
|
151
158
|
var defaults = deepDefaults({
|
|
@@ -181,9 +188,7 @@ var defaults = deepDefaults({
|
|
|
181
188
|
return theme.color.linkHover;
|
|
182
189
|
},
|
|
183
190
|
|
|
184
|
-
get hoverBgColor() {
|
|
185
|
-
return theme.color.hoverBg;
|
|
186
|
-
}
|
|
191
|
+
hoverBgColor: 'transparent' // get hoverBgColor() { return theme.color.hoverBg },
|
|
187
192
|
|
|
188
193
|
},
|
|
189
194
|
none: {
|
|
@@ -238,7 +243,7 @@ export function makeButtonStyles(_ref) {
|
|
|
238
243
|
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
244
|
var typeStyles = button[type];
|
|
240
245
|
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-
|
|
246
|
+
}), "&.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
247
|
var styles = button[size];
|
|
243
248
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";height:", styles.height, ";padding:", styles.padding, ";&.k-btn-icon{width:", styles.height, ";}}");
|
|
244
249
|
}), "&.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) {
|
|
@@ -257,13 +262,13 @@ export function makeButtonStyles(_ref) {
|
|
|
257
262
|
}) + "\n }\n }\n ", ";"));
|
|
258
263
|
}
|
|
259
264
|
export function makeButtonGroupStyles() {
|
|
260
|
-
return /*#__PURE__*/css("display:inline-
|
|
265
|
+
return /*#__PURE__*/css("display:inline-flex;align-items:center;flex-wrap:wrap;vertical-align:middle;.k-btn{margin:0;vertical-align:middle;&:hover,&:focus,&.k-active{z-index:1;position:relative;}}&.k-fluid{width:100%;}&:not(.k-vertical){>.k-btn{", _mapInstanceProperty(types).call(types, function (type) {
|
|
261
266
|
if (type === 'active') return;
|
|
262
267
|
var borderColor = button.group[type].borderColor;
|
|
263
268
|
return /*#__PURE__*/css("&.k-", type, ":not(:first-child){border-left-color:", borderColor, ";}&.k-", type, ":not(:last-child){border-right-color:", borderColor, ";}");
|
|
264
|
-
}), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.k-fluid{display:flex;>.k-btn{flex:1;}}}&.k-vertical{
|
|
269
|
+
}), ";&:not(:first-child){margin-left:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-top-right-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-bottom-left-radius:0;}}&.k-fluid{display:flex;>.k-btn{flex:1;}}}&.k-vertical{flex-direction:column;>.k-btn{", _mapInstanceProperty(types).call(types, function (type) {
|
|
265
270
|
if (type === 'active') return;
|
|
266
271
|
var borderColor = button.group[type].borderColor;
|
|
267
272
|
return /*#__PURE__*/css("&.k-", type, ":not(:first-child){border-top-color:", borderColor, ";}&.k-", type, ":not(:last-child){border-bottom-color:", borderColor, ";}");
|
|
268
|
-
}), ";&:not(.k-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}");
|
|
273
|
+
}), ";&:not(.k-btn-icon){width:100%;}&:not(:first-child){margin-top:-1px;&:not(:last-child){border-radius:0;}}&:not(:only-child):first-child{border-bottom-left-radius:0;border-bottom-right-radius:0;}&:not(:only-child):last-child{border-top-left-radius:0;border-top-right-radius:0;}}}&.k-seperate{gap:8px;>.k-btn{border-radius:", button.borderRadius, "!important;}}");
|
|
269
274
|
}
|
|
@@ -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;
|