edvoyui-component-library-test-flight 0.0.58 → 0.0.60
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/dist/EUIButton.vue.d.ts.map +1 -0
- package/dist/input/EUIInput.vue.d.ts +1 -1
- package/dist/library-vue-ts.cjs.js +2 -3
- package/dist/library-vue-ts.css +1 -0
- package/dist/library-vue-ts.es.js +535 -506
- package/dist/library-vue-ts.umd.js +8 -9
- package/dist/radio/EUIRadio.vue.d.ts +1 -1
- package/dist/searchexpand/EUISearchExpand.vue.d.ts +1 -1
- package/dist/slideover/EUISlideover.vue.d.ts +1 -1
- package/dist/table/EUIDashboardTable.vue.d.ts +1 -1
- package/dist/table/EUITable.vue.d.ts +1 -1
- package/dist/telephone/EUITelephone.vue.d.ts.map +1 -0
- package/package.json +1 -2
- package/src/components/delete.vue +5 -3
- package/src/components/input/EUIInput.vue +1 -1
- package/src/components/radio/EUIRadio.vue +3 -8
- package/src/components/searchexpand/EUISearchExpand.vue +6 -6
- package/src/components/slideover/EUISlideover.vue +4 -4
- package/src/components/table/EUIDashboardTable.vue +24 -16
- package/src/components/table/EUITable.vue +257 -216
- package/dist/EUITelephone.vue.d.ts.map +0 -1
- package/dist/button/EUIButton.vue.d.ts.map +0 -1
- /package/dist/{button/EUIButton.vue.d.ts → EUIButton.vue.d.ts} +0 -0
- /package/dist/{EUITelephone.vue.d.ts → telephone/EUITelephone.vue.d.ts} +0 -0
|
@@ -1,190 +1,228 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Transition name="fade" mode="out-in">
|
|
4
|
-
<div v-if="loading" :class="['overflow-hidden relative z-0 isolate bg-white backdrop-blur transition-colors duration-150 ease-in-out rounded-xl border border-gray-50', tableHeight ? tableHeight : 'h-[calc(100svh-9rem)] max-h-[calc(100svh-9rem)]']">
|
|
5
|
-
<div class="absolute flex items-center z-[calc(infinity)] w-full h-auto pointer-events-none inset-0">
|
|
6
|
-
<EUICircleLoader />
|
|
7
|
-
</div>
|
|
8
|
-
</div>
|
|
9
|
-
<div v-else class="relative w-full mx-auto overflow-hidden">
|
|
10
4
|
<div
|
|
11
|
-
|
|
12
|
-
:class="[
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
v-if="loading"
|
|
6
|
+
:class="[
|
|
7
|
+
'overflow-hidden relative z-0 isolate bg-white backdrop-blur transition-colors duration-150 ease-in-out rounded-xl border border-gray-50',
|
|
8
|
+
tableHeight
|
|
9
|
+
? tableHeight
|
|
10
|
+
: 'h-[calc(100svh-9rem)] max-h-[calc(100svh-9rem)]',
|
|
11
|
+
]"
|
|
15
12
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
isScrolled && headerIndex === 0 ? stickyClass.head : '',
|
|
39
|
-
{ 'cursor-pointer hover:text-gray-900': header?.sortable },
|
|
40
|
-
]"
|
|
41
|
-
:style="
|
|
42
|
-
header?.width
|
|
43
|
-
? `min-width:${header?.width}px;max-width:${header?.width}px;`
|
|
44
|
-
: ``
|
|
45
|
-
"
|
|
46
|
-
@click="sortBy(header, $event)"
|
|
47
|
-
>
|
|
48
|
-
<div
|
|
49
|
-
class="flex items-center justify-between gap-2 text-sm font-medium text-current font-inter"
|
|
50
|
-
>
|
|
51
|
-
<slot name="header" :header="header">
|
|
52
|
-
{{ capitalizeText(header?.text ?? header?.name ?? '') }}
|
|
53
|
-
</slot>
|
|
54
|
-
<slot name="headerOptionalItem"></slot>
|
|
55
|
-
<div v-if="header?.sortable" class="flex-none">
|
|
56
|
-
<svg
|
|
57
|
-
width="24"
|
|
58
|
-
height="24"
|
|
59
|
-
viewBox="0 0 24 24"
|
|
60
|
-
fill="none"
|
|
61
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
62
|
-
class="size-6"
|
|
63
|
-
>
|
|
64
|
-
<path
|
|
65
|
-
d="M8 15C9.06206 16.4619 10.3071 17.7713 11.7021 18.8942C11.8774 19.0353 12.1226 19.0353 12.2979 18.8942C13.6929 17.7713 14.9379 16.4619 16 15"
|
|
66
|
-
:stroke="
|
|
67
|
-
currentSortDir === 'asc' &&
|
|
68
|
-
currentSort === header?.value
|
|
69
|
-
? '#111827'
|
|
70
|
-
: '#9ca3af'
|
|
71
|
-
"
|
|
72
|
-
stroke-opacity="0.8"
|
|
73
|
-
stroke-width="2"
|
|
74
|
-
stroke-linecap="round"
|
|
75
|
-
stroke-linejoin="round"
|
|
76
|
-
/>
|
|
77
|
-
<path
|
|
78
|
-
d="M8 9C9.06206 7.5381 10.3071 6.2287 11.7021 5.1058C11.8774 4.9647 12.1226 4.9647 12.2979 5.1058C13.6929 6.2287 14.9379 7.5381 16 9"
|
|
79
|
-
:stroke="
|
|
80
|
-
currentSortDir === 'desc' &&
|
|
81
|
-
currentSort === header?.value
|
|
82
|
-
? '#111827'
|
|
83
|
-
: '#9ca3af'
|
|
84
|
-
"
|
|
85
|
-
stroke-opacity="0.8"
|
|
86
|
-
stroke-width="2"
|
|
87
|
-
stroke-linecap="round"
|
|
88
|
-
stroke-linejoin="round"
|
|
89
|
-
/>
|
|
90
|
-
</svg>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
</th>
|
|
94
|
-
</tr>
|
|
95
|
-
</thead>
|
|
96
|
-
<tbody>
|
|
97
|
-
<template
|
|
98
|
-
v-if="computedItems.length > 0"
|
|
99
|
-
v-for="(row, rowIndex) in computedItems"
|
|
100
|
-
:key="`table-row-${rowIndex}`"
|
|
13
|
+
<div
|
|
14
|
+
class="absolute flex items-center z-[calc(infinity)] w-full h-auto pointer-events-none inset-0"
|
|
15
|
+
>
|
|
16
|
+
<EUICircleLoader />
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div v-else class="relative w-full mx-auto overflow-hidden">
|
|
20
|
+
<div
|
|
21
|
+
id="student-table"
|
|
22
|
+
:class="[
|
|
23
|
+
'scrollbar--thin overscroll-none',
|
|
24
|
+
computedItems.length === 0 ? 'overflow-hidden' : 'overflow-auto',
|
|
25
|
+
tableHeight
|
|
26
|
+
? tableHeight
|
|
27
|
+
: 'h-[calc(100svh-12rem)] max-h-[calc(100svh-12rem)]',
|
|
28
|
+
]"
|
|
29
|
+
ref="tableContainer"
|
|
30
|
+
@scroll="handleScroll"
|
|
31
|
+
>
|
|
32
|
+
<table class="eui-table">
|
|
33
|
+
<thead
|
|
34
|
+
class="sticky top-0 left-0 z-20 bg-gray-100 before:-bottom-px before:left-0 before:absolute before:h-px before:w-full before:bg-gray-300"
|
|
101
35
|
>
|
|
102
|
-
<tr
|
|
103
|
-
@mouseenter="$attrs.mouseenter ? $emit('mouseenter', row, rowIndex) : null"
|
|
104
|
-
@mouseleave="$attrs.mouseleave ? $emit('mouseleave', row, rowIndex) : null"
|
|
105
|
-
>
|
|
36
|
+
<tr>
|
|
106
37
|
<template v-if="checkable">
|
|
107
|
-
<
|
|
38
|
+
<th class="checkable">
|
|
108
39
|
<EUITableCheckbox
|
|
109
|
-
:
|
|
110
|
-
:
|
|
111
|
-
|
|
40
|
+
:checked="isAllChecked"
|
|
41
|
+
:indeterminate="isIndeterminate"
|
|
42
|
+
:disabled="isAllUncheckable"
|
|
43
|
+
class="flex justify-center mt-0"
|
|
44
|
+
@change="checkAll"
|
|
112
45
|
/>
|
|
113
|
-
</
|
|
46
|
+
</th>
|
|
114
47
|
</template>
|
|
115
|
-
<
|
|
48
|
+
<th
|
|
116
49
|
v-for="(header, headerIndex) in headers"
|
|
117
|
-
:key="headerIndex"
|
|
118
|
-
|
|
50
|
+
:key="`item-${headerIndex}`"
|
|
51
|
+
scope="col"
|
|
52
|
+
:class="[
|
|
53
|
+
'px-3 py-2 text-gray-600 snap-start snap-always',
|
|
54
|
+
isScrolled && headerIndex === 0 ? stickyClass.head : '',
|
|
55
|
+
{ 'cursor-pointer hover:text-gray-900': header?.sortable },
|
|
56
|
+
]"
|
|
57
|
+
:style="
|
|
58
|
+
header?.width
|
|
59
|
+
? `min-width:${header?.width}px;max-width:${header?.width}px;`
|
|
60
|
+
: ``
|
|
61
|
+
"
|
|
62
|
+
@click="sortBy(header, $event)"
|
|
119
63
|
>
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
:row="row"
|
|
123
|
-
:rowIndex="rowIndex"
|
|
124
|
-
:headerIndex="headerIndex"
|
|
64
|
+
<div
|
|
65
|
+
class="flex items-center justify-between gap-2 text-sm font-medium text-current font-inter"
|
|
125
66
|
>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
67
|
+
<slot name="header" :header="header">
|
|
68
|
+
{{ capitalizeText(header?.text ?? header?.name ?? "") }}
|
|
69
|
+
</slot>
|
|
70
|
+
<slot name="headerOptionalItem"></slot>
|
|
71
|
+
<div v-if="header?.sortable" class="flex-none">
|
|
72
|
+
<svg
|
|
73
|
+
width="24"
|
|
74
|
+
height="24"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
fill="none"
|
|
77
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
78
|
+
class="size-6"
|
|
79
|
+
>
|
|
80
|
+
<path
|
|
81
|
+
d="M8 15C9.06206 16.4619 10.3071 17.7713 11.7021 18.8942C11.8774 19.0353 12.1226 19.0353 12.2979 18.8942C13.6929 17.7713 14.9379 16.4619 16 15"
|
|
82
|
+
:stroke="
|
|
83
|
+
currentSortDir === 'asc' &&
|
|
84
|
+
currentSort === header?.value
|
|
85
|
+
? '#111827'
|
|
86
|
+
: '#9ca3af'
|
|
87
|
+
"
|
|
88
|
+
stroke-opacity="0.8"
|
|
89
|
+
stroke-width="2"
|
|
90
|
+
stroke-linecap="round"
|
|
91
|
+
stroke-linejoin="round"
|
|
92
|
+
/>
|
|
93
|
+
<path
|
|
94
|
+
d="M8 9C9.06206 7.5381 10.3071 6.2287 11.7021 5.1058C11.8774 4.9647 12.1226 4.9647 12.2979 5.1058C13.6929 6.2287 14.9379 7.5381 16 9"
|
|
95
|
+
:stroke="
|
|
96
|
+
currentSortDir === 'desc' &&
|
|
97
|
+
currentSort === header?.value
|
|
98
|
+
? '#111827'
|
|
99
|
+
: '#9ca3af'
|
|
100
|
+
"
|
|
101
|
+
stroke-opacity="0.8"
|
|
102
|
+
stroke-width="2"
|
|
103
|
+
stroke-linecap="round"
|
|
104
|
+
stroke-linejoin="round"
|
|
105
|
+
/>
|
|
106
|
+
</svg>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</th>
|
|
129
110
|
</tr>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
|
|
111
|
+
</thead>
|
|
112
|
+
<tbody>
|
|
113
|
+
<template
|
|
114
|
+
v-if="computedItems.length > 0"
|
|
115
|
+
v-for="(row, rowIndex) in computedItems"
|
|
116
|
+
:key="`table-row-${rowIndex}`"
|
|
117
|
+
>
|
|
118
|
+
<tr
|
|
119
|
+
@mouseenter="
|
|
120
|
+
$attrs.mouseenter
|
|
121
|
+
? $emit('mouseenter', row, rowIndex)
|
|
122
|
+
: null
|
|
123
|
+
"
|
|
124
|
+
@mouseleave="
|
|
125
|
+
$attrs.mouseleave
|
|
126
|
+
? $emit('mouseleave', row, rowIndex)
|
|
127
|
+
: null
|
|
128
|
+
"
|
|
139
129
|
>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
130
|
+
<template v-if="checkable">
|
|
131
|
+
<td class="checkable">
|
|
132
|
+
<EUITableCheckbox
|
|
133
|
+
:disabled="!isRowCheckable(row)"
|
|
134
|
+
:checked="isRowChecked(row)"
|
|
135
|
+
@change.prevent.stop="
|
|
136
|
+
($event) => checkRow(row, rowIndex, $event)
|
|
137
|
+
"
|
|
138
|
+
/>
|
|
139
|
+
</td>
|
|
140
|
+
</template>
|
|
141
|
+
<td
|
|
142
|
+
v-for="(header, headerIndex) in headers"
|
|
143
|
+
:key="headerIndex"
|
|
144
|
+
:class="[
|
|
145
|
+
isScrolled && headerIndex === 0 ? stickyClass.body : '',
|
|
146
|
+
]"
|
|
147
|
+
>
|
|
148
|
+
<slot
|
|
149
|
+
:name="`item.${header?.value}`"
|
|
150
|
+
:row="row"
|
|
151
|
+
:rowIndex="rowIndex"
|
|
152
|
+
:headerIndex="headerIndex"
|
|
153
|
+
>
|
|
154
|
+
{{ getValueByPath(row, header?.value) }}
|
|
155
|
+
</slot>
|
|
156
|
+
</td>
|
|
157
|
+
</tr>
|
|
158
|
+
<template v-if="tableExpanded">
|
|
159
|
+
<slot name="expanded" :row="row" :rowIndex="rowIndex"></slot>
|
|
160
|
+
</template>
|
|
161
|
+
</template>
|
|
162
|
+
<template v-else-if="computedItems.length === 0">
|
|
163
|
+
<tr class="norecords">
|
|
164
|
+
<td
|
|
165
|
+
:colspan="
|
|
166
|
+
checkable === true ? headers.length + 1 : headers.length
|
|
167
|
+
"
|
|
168
|
+
>
|
|
169
|
+
<div
|
|
170
|
+
class="flex items-center justify-center text-xl font-medium text-gray-500 h-[calc(100svh-18rem)] max-w-screen-xl"
|
|
171
|
+
>
|
|
172
|
+
No matching records found
|
|
173
|
+
</div>
|
|
174
|
+
</td>
|
|
175
|
+
</tr>
|
|
176
|
+
</template>
|
|
177
|
+
</tbody>
|
|
178
|
+
</table>
|
|
179
|
+
</div>
|
|
180
|
+
<div
|
|
181
|
+
class="sticky bottom-0 left-0 z-50 flex items-center justify-between px-2 py-1 bg-white border-t border-gray-300"
|
|
182
|
+
>
|
|
183
|
+
<slot name="tableCount">
|
|
184
|
+
<div class="inline-flex items-center gap-x-2">
|
|
185
|
+
<div class="text-sm font-medium text-gray-900">
|
|
186
|
+
Total {{ total }}
|
|
187
|
+
</div>
|
|
188
|
+
<span class="text-gray-300">|</span>
|
|
189
|
+
<div class="inline-flex items-center">
|
|
190
|
+
<span class="text-sm font-medium text-gray-900">Per page</span>
|
|
191
|
+
<EUIPageLimit
|
|
192
|
+
:page-limit="limit"
|
|
193
|
+
@update-limit="changeLimit($event)"
|
|
194
|
+
@refetch="searchData($event)"
|
|
195
|
+
:iconStyle="true"
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
166
198
|
</div>
|
|
167
|
-
</div>
|
|
168
|
-
</slot>
|
|
169
|
-
<template v-if="paginated && computedItems.length !== 0">
|
|
170
|
-
<slot name="tablepagination">
|
|
171
|
-
<EUIStudentPagination
|
|
172
|
-
:activePage="newCurrentPage"
|
|
173
|
-
:pageLimit="limit"
|
|
174
|
-
:totalCount="total"
|
|
175
|
-
@change-page="pageChanged($event)"
|
|
176
|
-
/>
|
|
177
199
|
</slot>
|
|
178
|
-
|
|
200
|
+
<template v-if="paginated && computedItems.length !== 0">
|
|
201
|
+
<slot name="tablepagination">
|
|
202
|
+
<EUIStudentPagination
|
|
203
|
+
:activePage="newCurrentPage"
|
|
204
|
+
:pageLimit="limit"
|
|
205
|
+
:totalCount="total"
|
|
206
|
+
@change-page="pageChanged($event)"
|
|
207
|
+
/>
|
|
208
|
+
</slot>
|
|
209
|
+
</template>
|
|
210
|
+
</div>
|
|
179
211
|
</div>
|
|
180
|
-
</div>
|
|
181
212
|
</Transition>
|
|
182
213
|
</div>
|
|
183
214
|
</template>
|
|
184
215
|
|
|
185
|
-
|
|
186
216
|
<script setup lang="ts">
|
|
187
|
-
import {
|
|
217
|
+
import {
|
|
218
|
+
computed,
|
|
219
|
+
onMounted,
|
|
220
|
+
onUnmounted,
|
|
221
|
+
PropType,
|
|
222
|
+
ref,
|
|
223
|
+
toRefs,
|
|
224
|
+
watch,
|
|
225
|
+
} from "vue";
|
|
188
226
|
import EUITableCheckbox from "./EUITableCheckbox.vue";
|
|
189
227
|
import EUIPageLimit from "./EUIPageLimit.vue";
|
|
190
228
|
import EUIStudentPagination from "./EUIStudentPagination.vue";
|
|
@@ -210,7 +248,11 @@ const props = defineProps({
|
|
|
210
248
|
tableExpanded: { type: Boolean, default: false },
|
|
211
249
|
backendPagination: { type: Boolean, default: false },
|
|
212
250
|
checkedRows: { type: Array, default: () => ({}), required: true },
|
|
213
|
-
headers: {
|
|
251
|
+
headers: {
|
|
252
|
+
type: Array as PropType<Header[]>,
|
|
253
|
+
default: () => ({}),
|
|
254
|
+
required: true,
|
|
255
|
+
},
|
|
214
256
|
items: { type: Array, required: true, default: () => ({}) },
|
|
215
257
|
defaultSort: { type: String, default: "" },
|
|
216
258
|
defaultSortDirection: { type: String, default: "asc" },
|
|
@@ -226,7 +268,7 @@ const props = defineProps({
|
|
|
226
268
|
tableHeight: {
|
|
227
269
|
type: String,
|
|
228
270
|
required: false,
|
|
229
|
-
default: ""
|
|
271
|
+
default: "",
|
|
230
272
|
},
|
|
231
273
|
tableLoading: { type: Boolean, default: false },
|
|
232
274
|
});
|
|
@@ -257,7 +299,7 @@ const filteredItems = computed(() => {
|
|
|
257
299
|
let filteredItems = items.value.slice();
|
|
258
300
|
if (!backendPagination.value && search.value !== "") {
|
|
259
301
|
if (search.value.trim() === "") return filteredItems;
|
|
260
|
-
const props = headers.value.map((h:any) => h.value);
|
|
302
|
+
const props = headers.value.map((h: any) => h.value);
|
|
261
303
|
filteredItems = items.value.filter((row) =>
|
|
262
304
|
props.some((prop) =>
|
|
263
305
|
defaultFilter(
|
|
@@ -273,13 +315,13 @@ const filteredItems = computed(() => {
|
|
|
273
315
|
const computedItems = computed(() => {
|
|
274
316
|
let items = filteredItems.value;
|
|
275
317
|
// Sort items before slicing for pagination
|
|
276
|
-
items.sort((a:any, b:any) => {
|
|
318
|
+
items.sort((a: any, b: any) => {
|
|
277
319
|
const modifier = currentSortDir.value === "desc" ? -1 : 1;
|
|
278
320
|
if (a[currentSort.value] < b[currentSort.value]) return -1 * modifier;
|
|
279
321
|
if (a[currentSort.value] > b[currentSort.value]) return 1 * modifier;
|
|
280
322
|
return 0;
|
|
281
323
|
});
|
|
282
|
-
return items
|
|
324
|
+
return items;
|
|
283
325
|
|
|
284
326
|
// Apply pagination
|
|
285
327
|
// const start = (newCurrentPage.value - 0) * limit.value;
|
|
@@ -287,8 +329,7 @@ const computedItems = computed(() => {
|
|
|
287
329
|
// return items.slice(start, end);
|
|
288
330
|
});
|
|
289
331
|
|
|
290
|
-
|
|
291
|
-
const searchData = (_data:any) => {
|
|
332
|
+
const searchData = (_data: any) => {
|
|
292
333
|
// console.log(_data);
|
|
293
334
|
};
|
|
294
335
|
|
|
@@ -303,10 +344,10 @@ const isIndeterminate = computed(() => {
|
|
|
303
344
|
});
|
|
304
345
|
|
|
305
346
|
const isAllChecked = computed(() => {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
347
|
+
return (
|
|
348
|
+
computedItems.value.length > 0 &&
|
|
349
|
+
computedItems.value.every((row) => newCheckedRows.value.includes(row))
|
|
350
|
+
);
|
|
310
351
|
});
|
|
311
352
|
|
|
312
353
|
const isAllUncheckable = computed(() => {
|
|
@@ -327,7 +368,7 @@ const emit = defineEmits([
|
|
|
327
368
|
"update:selectedRows",
|
|
328
369
|
"changeLimit",
|
|
329
370
|
"mouseenter",
|
|
330
|
-
"mouseleave"
|
|
371
|
+
"mouseleave",
|
|
331
372
|
]);
|
|
332
373
|
|
|
333
374
|
const changeLimit = (limitData: number) => {
|
|
@@ -352,44 +393,44 @@ const sortBy = (header: any, event: any) => {
|
|
|
352
393
|
emit("sort", currentSort.value, currentSortDir.value, event);
|
|
353
394
|
};
|
|
354
395
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
396
|
+
const isRowChecked = (row: any) => {
|
|
397
|
+
return indexOf(newCheckedRows.value, row) >= 0;
|
|
398
|
+
};
|
|
358
399
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
400
|
+
const removeCheckedRow = (row: any) => {
|
|
401
|
+
const index = indexOf(newCheckedRows.value, row);
|
|
402
|
+
if (index >= 0) {
|
|
403
|
+
newCheckedRows.value.splice(index, 1);
|
|
404
|
+
}
|
|
405
|
+
};
|
|
365
406
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
407
|
+
const checkAll = () => {
|
|
408
|
+
if (isAllChecked.value) {
|
|
409
|
+
// Uncheck all rows
|
|
410
|
+
newCheckedRows.value = [];
|
|
411
|
+
} else {
|
|
412
|
+
// Check all rows
|
|
413
|
+
const rowsToCheck = computedItems.value.filter(
|
|
414
|
+
(row) => !newCheckedRows.value.includes(row)
|
|
415
|
+
);
|
|
416
|
+
newCheckedRows.value.push(...rowsToCheck);
|
|
417
|
+
}
|
|
418
|
+
emit("check", newCheckedRows.value);
|
|
419
|
+
emit("check-all", newCheckedRows.value);
|
|
420
|
+
emit("update:checkedRows", newCheckedRows.value);
|
|
421
|
+
emit("update:selectedRows", newCheckedRows.value);
|
|
381
422
|
};
|
|
382
423
|
|
|
383
|
-
const checkRow = (row: any, _rowIndex: number, _event:any) => {
|
|
424
|
+
const checkRow = (row: any, _rowIndex: number, _event: any) => {
|
|
384
425
|
const isChecked = newCheckedRows.value.includes(row);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
426
|
+
if (_event && isChecked) {
|
|
427
|
+
removeCheckedRow(row);
|
|
428
|
+
} else {
|
|
429
|
+
newCheckedRows.value.push(row);
|
|
430
|
+
}
|
|
431
|
+
emit("check", newCheckedRows.value, row);
|
|
432
|
+
emit("update:checkedRows", newCheckedRows.value);
|
|
433
|
+
emit("update:selectedRows", newCheckedRows.value);
|
|
393
434
|
};
|
|
394
435
|
|
|
395
436
|
// watch
|
|
@@ -423,7 +464,7 @@ const stickyClass = computed(() => {
|
|
|
423
464
|
});
|
|
424
465
|
|
|
425
466
|
const isOverflowing = ref(false);
|
|
426
|
-
const isScrolled = ref(false)
|
|
467
|
+
const isScrolled = ref(false);
|
|
427
468
|
const tableContainer = ref<HTMLElement | null>(null);
|
|
428
469
|
|
|
429
470
|
const handleScroll = () => {
|
|
@@ -441,11 +482,11 @@ const checkOverflow = () => {
|
|
|
441
482
|
};
|
|
442
483
|
|
|
443
484
|
onMounted(() => {
|
|
444
|
-
window.addEventListener(
|
|
485
|
+
window.addEventListener("resize", checkOverflow);
|
|
445
486
|
});
|
|
446
487
|
|
|
447
488
|
onUnmounted(() => {
|
|
448
|
-
window.removeEventListener(
|
|
489
|
+
window.removeEventListener("resize", checkOverflow);
|
|
449
490
|
});
|
|
450
491
|
|
|
451
492
|
// Watch for changes in the container's width to check for overflow
|
|
@@ -462,14 +503,14 @@ watch(() => tableContainer.value?.clientWidth, checkOverflow);
|
|
|
462
503
|
th {
|
|
463
504
|
@apply snap-always snap-start;
|
|
464
505
|
&:first-of-type.checkable {
|
|
465
|
-
|
|
506
|
+
@apply min-h-11 flex items-center justify-center px-2 max-w-16 w-16 sticky left-0 top-0 z-20 bg-gray-100;
|
|
466
507
|
}
|
|
467
508
|
}
|
|
468
509
|
}
|
|
469
510
|
|
|
470
511
|
tbody {
|
|
471
512
|
@apply snap-y snap-mandatory snap-always;
|
|
472
|
-
|
|
513
|
+
tr:not(.norecords) {
|
|
473
514
|
@apply text-gray-600 transition-colors duration-100 bg-white snap-start ease-in-out snap-x snap-mandatory rounded-sm h-12;
|
|
474
515
|
&:hover {
|
|
475
516
|
@apply bg-purple-50 ring-1 ring-purple-100 ring-inset;
|
|
@@ -477,9 +518,9 @@ watch(() => tableContainer.value?.clientWidth, checkOverflow);
|
|
|
477
518
|
td {
|
|
478
519
|
@apply px-3 py-1 text-sm font-normal transition-transform duration-100 ease-in-out snap-start snap-always border-solid border border-l-0 border-r-0 border-white first:border-s last:border-e last-of-type:rounded-e-sm first-of-type:rounded-s-sm;
|
|
479
520
|
&:first-of-type.checkable {
|
|
480
|
-
|
|
481
|
-
}
|
|
521
|
+
@apply w-12 text-center sticky left-0 top-0 z-[11] bg-white;
|
|
482
522
|
}
|
|
523
|
+
}
|
|
483
524
|
&:hover td {
|
|
484
525
|
@apply font-medium text-gray-900 bg-purple-50 border-purple-100;
|
|
485
526
|
&:first-of-type.checkable {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EUITelephone.vue.d.ts","sourceRoot":"","sources":["../src/components/telephone/EUITelephone.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,8GAA8G,CAAC;AACrI,cAAc,8GAA8G,CAAC;AAC7H,OAAO,4GAA4G,CAAC;AACpH,eAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EUIButton.vue.d.ts","sourceRoot":"","sources":["../../src/components/button/EUIButton.vue"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wGAAwG,CAAC;AAC/H,cAAc,wGAAwG,CAAC;AACvH,OAAO,sGAAsG,CAAC;AAC9G,eAAe,SAAS,CAAC"}
|
|
File without changes
|
|
File without changes
|