webcake-ui-kit 1.2.13 → 1.2.15
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/package.json +2 -2
- package/src/components/date-picker/date-picker.css +3 -1
- package/src/components/dropdown/Dropdown.vue +2 -2
- package/src/components/file-type-icon/FileTypeIcon.vue +261 -0
- package/src/components/file-type-icon/file-type-icon.css +48 -0
- package/src/components/select-option/SelectOption.vue +2 -1
- package/src/components/select-option/select_option.css +0 -62
- package/src/components/select-option/select_option_sub.css +61 -0
- package/src/components/{table-v2 → table}/ColumnDragHandle.vue +2 -2
- package/src/components/table/Table.vue +250 -772
- package/src/components/{table-v2 → table}/TableColGroup.vue +2 -2
- package/src/components/{table-v2 → table}/TableEmpty.vue +2 -2
- package/src/components/{table-v2 → table}/TableLoading.vue +3 -3
- package/src/components/{table-v2 → table}/TableWrapper.vue +14 -9
- package/src/components/{table-v2 → table}/body/DragPreview.vue +4 -18
- package/src/components/{table-v2 → table}/body/TableBody.vue +6 -6
- package/src/components/{table-v2 → table}/body/TableCell.vue +8 -8
- package/src/components/{table-v2 → table}/body/TableRow.vue +4 -4
- package/src/components/{table-v2 → table}/header/TableHeader.vue +2 -2
- package/src/components/{table-v2 → table}/header/TableHeaderCell.vue +9 -9
- package/src/components/{table-v2 → table}/header/TableHeaderRow.vue +3 -3
- package/src/components/{table-v2 → table}/style/table-loading.css +3 -3
- package/src/components/{table-v2 → table}/style/table-wrapper.css +67 -51
- package/src/components/{table-v2 → table}/style/table.css +1 -1
- package/src/components/textarea/Textarea.vue +1 -1
- package/src/index.js +1 -1
- package/src/components/table/table.css +0 -396
- package/src/components/table-v2/Table.vue +0 -305
- /package/src/components/{table-v2 → table}/TableResizeObserver.vue +0 -0
- /package/src/components/{table-v2 → table}/body/MeasureCell.vue +0 -0
- /package/src/components/{table-v2 → table}/composables/useColumns.js +0 -0
- /package/src/components/{table-v2 → table}/composables/useSorter.js +0 -0
- /package/src/components/{table-v2 → table}/composables/useSticky.js +0 -0
- /package/src/components/{table-v2 → table}/constants.js +0 -0
- /package/src/components/{table-v2 → table}/context/createTableContext.js +0 -0
- /package/src/components/{table-v2 → table}/style/table-body.css +0 -0
- /package/src/components/{table-v2 → table}/style/table-header.css +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<col
|
|
4
4
|
v-for="col in tableContext.columns.flat"
|
|
5
5
|
:key="col.key"
|
|
6
|
-
:class="isSelectionCol(col) ? 'ui-
|
|
6
|
+
:class="isSelectionCol(col) ? 'ui-table__selection-col' : ''"
|
|
7
7
|
:style="colStyle(col)"
|
|
8
8
|
/>
|
|
9
9
|
<col v-if="hasScrollBar" :style="{ width: tableContext.layout.scrollBarWidth }" />
|
|
@@ -15,7 +15,7 @@ import { toCssSize } from '../../utils/common'
|
|
|
15
15
|
import { SELECTION_COLUMN, DRAGGABLE_COLUMN } from './constants.js'
|
|
16
16
|
|
|
17
17
|
export default {
|
|
18
|
-
name: '
|
|
18
|
+
name: 'TableColGroup',
|
|
19
19
|
inject: ['tableContext'],
|
|
20
20
|
props: {
|
|
21
21
|
isHeader: { type: Boolean, default: false }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="ui-
|
|
2
|
+
<div class="ui-table__loading-wrap" :class="{ 'ui-table__loading-wrap--loading': isLoading }">
|
|
3
3
|
<slot />
|
|
4
|
-
<div v-if="isLoading" class="ui-
|
|
4
|
+
<div v-if="isLoading" class="ui-table__loading-overlay">
|
|
5
5
|
<Spinner size="md" />
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import Spinner from '../spinner/Spinner.vue'
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
name: '
|
|
14
|
+
name: 'TableLoading',
|
|
15
15
|
components: { Spinner },
|
|
16
16
|
inject: ['tableContext'],
|
|
17
17
|
computed: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="ui-
|
|
3
|
+
class="ui-table__wrapper"
|
|
4
4
|
:class="{
|
|
5
|
-
'ui-
|
|
6
|
-
'ui-
|
|
5
|
+
'ui-table__wrapper--ping-left': isPingedLeft,
|
|
6
|
+
'ui-table__wrapper--ping-right': isPingedRight
|
|
7
7
|
}"
|
|
8
8
|
>
|
|
9
9
|
<DragPreview v-if="hasDraggable" ref="dragPreview">
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
|
|
15
15
|
<!-- Case 3: scroll.y — header và body là 2 table riêng để sticky header -->
|
|
16
16
|
<template v-if="hasScrollY && !isEmpty">
|
|
17
|
-
<div ref="headerRef" class="ui-
|
|
17
|
+
<div ref="headerRef" class="ui-table__header-hold" style="overflow: hidden">
|
|
18
18
|
<table :class="tableClass" :style="fixedTableStyle">
|
|
19
19
|
<TableColGroup :is-header="true" />
|
|
20
20
|
<TableHeader />
|
|
21
21
|
</table>
|
|
22
22
|
</div>
|
|
23
|
-
<div ref="bodyRef" class="ui-
|
|
23
|
+
<div ref="bodyRef" class="ui-table__body-hold" :style="bodyHoldStyle" @scroll="handleBodyScroll">
|
|
24
24
|
<table :class="tableClass" :style="fixedTableStyle">
|
|
25
25
|
<TableColGroup />
|
|
26
26
|
<TableBody :measureColumnWidth="hasScrollY || hasScrollX || hasSticky">
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</template>
|
|
37
37
|
|
|
38
38
|
<!-- Case 1 & 2: một table duy nhất -->
|
|
39
|
-
<div v-else class="ui-
|
|
39
|
+
<div v-else class="ui-table__content" ref="bodyRef" :style="contentStyle" @scroll="handleBodyScroll">
|
|
40
40
|
<table :class="tableClass" :style="tableStyle">
|
|
41
41
|
<TableColGroup />
|
|
42
42
|
<TableHeader />
|
|
@@ -61,7 +61,7 @@ import DragPreview from './body/DragPreview.vue'
|
|
|
61
61
|
import { toCssSize, getTargetScrollBarSize } from '../../utils/common'
|
|
62
62
|
|
|
63
63
|
export default {
|
|
64
|
-
name: '
|
|
64
|
+
name: 'TableWrapper',
|
|
65
65
|
|
|
66
66
|
data: () => {
|
|
67
67
|
return {
|
|
@@ -112,8 +112,8 @@ export default {
|
|
|
112
112
|
|
|
113
113
|
tableClass: function () {
|
|
114
114
|
return {
|
|
115
|
-
'ui-
|
|
116
|
-
'ui-
|
|
115
|
+
'ui-table__table': true,
|
|
116
|
+
'ui-table__table--bordered': this.tableContext.layout.bordered
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
|
|
@@ -194,6 +194,11 @@ export default {
|
|
|
194
194
|
this.$nextTick(() => {
|
|
195
195
|
this.updateScrollState()
|
|
196
196
|
})
|
|
197
|
+
},
|
|
198
|
+
hasScrollY() {
|
|
199
|
+
this.$nextTick(() => {
|
|
200
|
+
this.updateScrollState()
|
|
201
|
+
})
|
|
197
202
|
}
|
|
198
203
|
},
|
|
199
204
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<table
|
|
3
|
-
class="ui-
|
|
3
|
+
class="ui-table__drag-preview"
|
|
4
4
|
aria-hidden="true"
|
|
5
5
|
:style="{ width: containerWidth ? containerWidth + 'px' : '100%', tableLayout: 'fixed' }"
|
|
6
6
|
>
|
|
7
|
-
<tbody class="ui-
|
|
8
|
-
<tr class="ui-
|
|
7
|
+
<tbody class="ui-table__body">
|
|
8
|
+
<tr class="ui-table__row" v-if="record">
|
|
9
9
|
<td v-for="col in columns" :key="col.key">
|
|
10
10
|
<div v-if="col.type === DRAGGABLE_COLUMN" class="wrapper-option">
|
|
11
11
|
<span class="drag-handle">
|
|
@@ -27,7 +27,7 @@ import { WkiGripVertical } from '../../../icons'
|
|
|
27
27
|
import { SELECTION_COLUMN, DRAGGABLE_COLUMN } from '../constants.js'
|
|
28
28
|
|
|
29
29
|
export default {
|
|
30
|
-
name: '
|
|
30
|
+
name: 'TableDragPreview',
|
|
31
31
|
components: { WkiGripVertical },
|
|
32
32
|
inject: ['tableContext'],
|
|
33
33
|
data: function () {
|
|
@@ -49,17 +49,3 @@ export default {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
</script>
|
|
52
|
-
|
|
53
|
-
<style scoped>
|
|
54
|
-
.ui-table-v2__drag-preview {
|
|
55
|
-
position: fixed;
|
|
56
|
-
top: -10000px;
|
|
57
|
-
left: -10000px;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
border-collapse: separate;
|
|
60
|
-
border-spacing: 0;
|
|
61
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
62
|
-
border-radius: 4px;
|
|
63
|
-
overflow: hidden;
|
|
64
|
-
}
|
|
65
|
-
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<tbody class="ui-
|
|
2
|
+
<tbody class="ui-table__body">
|
|
3
3
|
<template v-if="measureColumnWidth">
|
|
4
|
-
<tr aria-hidden="true" class="ui-
|
|
4
|
+
<tr aria-hidden="true" class="ui-table__measure-row" :style="{ height: '0', fontSize: '0' }">
|
|
5
5
|
<MeasureCell v-for="(column, colIndex) in tableContext.columns.flat" :key="colIndex" :colKey="column.key" />
|
|
6
6
|
</tr>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<template v-if="isEmpty">
|
|
10
|
-
<tr class="ui-
|
|
10
|
+
<tr class="ui-table__row">
|
|
11
11
|
<td colspan="100">
|
|
12
|
-
<div class="ui-
|
|
12
|
+
<div class="ui-table__row-empty ui-table__empty" :style="emptyStyle">
|
|
13
13
|
<slot name="empty">
|
|
14
14
|
<div class="wrapper-img">
|
|
15
15
|
<img
|
|
@@ -43,7 +43,7 @@ import TableRow from './TableRow.vue'
|
|
|
43
43
|
import MeasureCell from './MeasureCell.vue'
|
|
44
44
|
|
|
45
45
|
export default {
|
|
46
|
-
name: '
|
|
46
|
+
name: 'TableBody',
|
|
47
47
|
components: { TableRow, MeasureCell },
|
|
48
48
|
props: {
|
|
49
49
|
measureColumnWidth: {
|
|
@@ -93,7 +93,7 @@ export default {
|
|
|
93
93
|
const offset = this.measureColumnWidth ? 1 : 0
|
|
94
94
|
this._sortable = Sortable.create(this.$el, {
|
|
95
95
|
handle: '.drag-handle',
|
|
96
|
-
draggable: '.ui-
|
|
96
|
+
draggable: '.ui-table__row',
|
|
97
97
|
animation: this.tableContext.draggable.enableAnimationFlip ? 150 : 0,
|
|
98
98
|
onChoose: function (evt) {
|
|
99
99
|
const rowIndex = evt.oldIndex - offset
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<td
|
|
3
3
|
:class="[
|
|
4
|
-
'ui-
|
|
5
|
-
isSelectionCol && 'ui-
|
|
6
|
-
isSelectionCol && 'ui-
|
|
7
|
-
column.fixed && `ui-
|
|
8
|
-
isLastFixedLeft && 'ui-
|
|
9
|
-
isFirstFixedRight && 'ui-
|
|
4
|
+
'ui-table__cell',
|
|
5
|
+
isSelectionCol && 'ui-table__cell--selection',
|
|
6
|
+
isSelectionCol && 'ui-table__header-cell--selection',
|
|
7
|
+
column.fixed && `ui-table__cell--fixed-${column.fixed}`,
|
|
8
|
+
isLastFixedLeft && 'ui-table__cell--fixed-left__last',
|
|
9
|
+
isFirstFixedRight && 'ui-table__cell--fixed-right__first'
|
|
10
10
|
]"
|
|
11
11
|
:style="cellStyle"
|
|
12
12
|
>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
:text="record[column.dataIndex]"
|
|
28
28
|
:record="record"
|
|
29
29
|
>
|
|
30
|
-
<span :class="[column.ellipsis && 'ui-
|
|
30
|
+
<span :class="[column.ellipsis && 'ui-table__cell--ellipsis']">
|
|
31
31
|
{{ record[column.dataIndex] }}
|
|
32
32
|
</span>
|
|
33
33
|
</slot>
|
|
@@ -41,7 +41,7 @@ import { toCssSize } from '../../../utils/common.js'
|
|
|
41
41
|
import { WkiGripVertical } from '../../../icons'
|
|
42
42
|
|
|
43
43
|
export default {
|
|
44
|
-
name: '
|
|
44
|
+
name: 'TableCell',
|
|
45
45
|
components: { Checkbox, WkiGripVertical },
|
|
46
46
|
inject: ['tableContext'],
|
|
47
47
|
props: {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
v-bind="customAttrs"
|
|
4
4
|
v-on="customListeners"
|
|
5
5
|
:class="[
|
|
6
|
-
'ui-
|
|
7
|
-
isLastItem && 'ui-
|
|
8
|
-
isSelected && 'ui-
|
|
6
|
+
'ui-table__row',
|
|
7
|
+
isLastItem && 'ui-table__row--last',
|
|
8
|
+
isSelected && 'ui-table__row--selected',
|
|
9
9
|
customAttrs.class
|
|
10
10
|
]"
|
|
11
11
|
:style="rowStyle"
|
|
@@ -29,7 +29,7 @@ import TableCell from './TableCell.vue'
|
|
|
29
29
|
import { splitProps } from '../../../utils/common.js'
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
|
-
name: '
|
|
32
|
+
name: 'TableRow',
|
|
33
33
|
components: { TableCell },
|
|
34
34
|
inject: ['tableContext'],
|
|
35
35
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<thead class="ui-
|
|
2
|
+
<thead class="ui-table__header">
|
|
3
3
|
<TableHeaderRow />
|
|
4
4
|
</thead>
|
|
5
5
|
</template>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import TableHeaderRow from './TableHeaderRow.vue'
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
name: '
|
|
11
|
+
name: 'TableHeader',
|
|
12
12
|
components: { TableHeaderRow },
|
|
13
13
|
inject: ['tableContext']
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<th
|
|
3
3
|
:class="[
|
|
4
|
-
'ui-
|
|
5
|
-
isSelectionCol && 'ui-
|
|
6
|
-
isLastItem && 'ui-
|
|
7
|
-
isSelectionCol && !isHideSelectAll && 'ui-
|
|
8
|
-
column.fixed && `ui-
|
|
9
|
-
isLastFixedLeft && 'ui-
|
|
10
|
-
isFirstFixedRight && 'ui-
|
|
4
|
+
'ui-table__header-cell',
|
|
5
|
+
isSelectionCol && 'ui-table__header-cell--selection',
|
|
6
|
+
isLastItem && 'ui-table__header-cell--last',
|
|
7
|
+
isSelectionCol && !isHideSelectAll && 'ui-table__header-cell--selection',
|
|
8
|
+
column.fixed && `ui-table__cell--fixed-${column.fixed}`,
|
|
9
|
+
isLastFixedLeft && 'ui-table__cell--fixed-left__last',
|
|
10
|
+
isFirstFixedRight && 'ui-table__cell--fixed-right__first'
|
|
11
11
|
]"
|
|
12
12
|
:style="cellStyle"
|
|
13
13
|
>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<Checkbox :checked="tableContext.selection.checkAll" @change="onCheckAll" />
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
<span v-else :class="[column.ellipsis && 'ui-
|
|
18
|
+
<span v-else :class="[column.ellipsis && 'ui-table__header-cell--ellipsis']">{{ column.title }}</span>
|
|
19
19
|
|
|
20
20
|
<slot name="drag-handle"></slot>
|
|
21
21
|
</th>
|
|
@@ -27,7 +27,7 @@ import { SELECTION_COLUMN } from '../constants.js'
|
|
|
27
27
|
import { toCssSize } from '../../../utils/common.js'
|
|
28
28
|
|
|
29
29
|
export default {
|
|
30
|
-
name: '
|
|
30
|
+
name: 'TableHeaderCell',
|
|
31
31
|
components: { Checkbox },
|
|
32
32
|
inject: ['tableContext'],
|
|
33
33
|
props: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<tr
|
|
3
3
|
v-bind="customAttrs"
|
|
4
4
|
v-on="customListeners"
|
|
5
|
-
:class="['ui-
|
|
5
|
+
:class="['ui-table__header-row', customAttrs.class]"
|
|
6
6
|
:style="rowStyle"
|
|
7
7
|
>
|
|
8
8
|
<TableHeaderCell
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/>
|
|
23
23
|
</template>
|
|
24
24
|
</TableHeaderCell>
|
|
25
|
-
<th v-if="hasScrollBar" class="ui-
|
|
25
|
+
<th v-if="hasScrollBar" class="ui-table__scrollbar-cell" aria-hidden="true" :style="styleFakeScrollbar" />
|
|
26
26
|
</tr>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ import { splitProps } from '../../../utils/common.js'
|
|
|
32
32
|
import ColumnDragHandle from '../ColumnDragHandle.vue'
|
|
33
33
|
|
|
34
34
|
export default {
|
|
35
|
-
name: '
|
|
35
|
+
name: 'TableHeaderRow',
|
|
36
36
|
components: {
|
|
37
37
|
TableHeaderCell,
|
|
38
38
|
ColumnDragHandle
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.ui-
|
|
1
|
+
.ui-table__loading-wrap {
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.ui-
|
|
5
|
+
.ui-table__loading-overlay {
|
|
6
6
|
position: absolute;
|
|
7
7
|
inset: 0;
|
|
8
8
|
z-index: 10;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
border-radius: inherit;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.ui-
|
|
16
|
+
.ui-table__loading-wrap--loading > :not(.ui-table__loading-overlay) {
|
|
17
17
|
pointer-events: none;
|
|
18
18
|
user-select: none;
|
|
19
19
|
}
|