edvoyui-component-library-test-flight 0.0.169 → 0.0.170
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 -5
- package/src/App.vue +0 -16
- package/src/App.vue.js.map +0 -1
- package/src/assets/fonts/gilroy/GilroyBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyBold/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyBoldItalic/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBold/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyExtraBoldItalic/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyMedium/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyMedium/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroyRegular/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroyRegular/font.woff2 +0 -0
- package/src/assets/fonts/gilroy/GilroySemiBold/font.woff +0 -0
- package/src/assets/fonts/gilroy/GilroySemiBold/font.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Bold.woff +0 -0
- package/src/assets/fonts/inter/Inter-Bold.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Italic.woff +0 -0
- package/src/assets/fonts/inter/Inter-Italic.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Medium.woff +0 -0
- package/src/assets/fonts/inter/Inter-Medium.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-MediumItalic.woff +0 -0
- package/src/assets/fonts/inter/Inter-MediumItalic.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-Regular.woff +0 -0
- package/src/assets/fonts/inter/Inter-Regular.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-SemiBold.woff +0 -0
- package/src/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
- package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff +0 -0
- package/src/assets/fonts/inter/Inter-SemiBoldItalic.woff2 +0 -0
- package/src/assets/images/search-nodata.png +0 -0
- package/src/assets/scss/body.scss +0 -25
- package/src/assets/svg/CheckTick.vue +0 -21
- package/src/assets/svg/CheckTick.vue.js.map +0 -1
- package/src/assets/svg/ChevronBigDown.vue +0 -22
- package/src/assets/svg/ChevronBigDown.vue.js.map +0 -1
- package/src/assets/svg/ChevronDownSolid.vue +0 -19
- package/src/assets/svg/ChevronDownSolid.vue.js.map +0 -1
- package/src/assets/svg/ChevronDownStroke.vue +0 -22
- package/src/assets/svg/ChevronDownStroke.vue.js.map +0 -1
- package/src/assets/svg/ChevronDownStrokeSolid.vue +0 -19
- package/src/assets/svg/ChevronDownStrokeSolid.vue.js.map +0 -1
- package/src/assets/svg/SearchBigZoomIn.vue +0 -21
- package/src/assets/svg/SearchBigZoomIn.vue.js.map +0 -1
- package/src/assets/svg/SortArrow.vue +0 -24
- package/src/assets/svg/SortArrow.vue.js.map +0 -1
- package/src/assets/svg/Student.vue +0 -30
- package/src/assets/svg/Student.vue.js.map +0 -1
- package/src/assets/svg/partner.vue +0 -33
- package/src/assets/svg/partner.vue.js.map +0 -1
- package/src/assets/svg/people.vue +0 -25
- package/src/assets/svg/people.vue.js.map +0 -1
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -1974
- package/src/components/HelloWorld.vue.js.map +0 -1
- package/src/components/accordion/EUIAccordion.stories.ts +0 -204
- package/src/components/accordion/EUIAccordion.vue +0 -152
- package/src/components/accordion/EUIAccordion.vue.js.map +0 -1
- package/src/components/alerts/EUIAlerts.stories.ts +0 -217
- package/src/components/alerts/EUIAlerts.vue +0 -194
- package/src/components/alerts/EUIAlerts.vue.js.map +0 -1
- package/src/components/avatar/EUIAvatar.stories.ts +0 -157
- package/src/components/avatar/EUIAvatar.vue +0 -96
- package/src/components/avatar/EUIAvatar.vue.js.map +0 -1
- package/src/components/breadcrumb/EUIBreadcrumb.stories.ts +0 -75
- package/src/components/breadcrumb/EUIBreadcrumb.vue +0 -59
- package/src/components/breadcrumb/EUIBreadcrumb.vue.js.map +0 -1
- package/src/components/button/EUIButton.stories.ts +0 -270
- package/src/components/button/EUIButton.vue +0 -154
- package/src/components/button/EUIButton.vue.js.map +0 -1
- package/src/components/button/EUIButtonGroup.vue +0 -287
- package/src/components/button/EUIButtonGroup.vue.js.map +0 -1
- package/src/components/button/buttonAnimateTab.vue +0 -74
- package/src/components/button/buttonAnimateTab.vue.js.map +0 -1
- package/src/components/checkbox/EUICheckbox.stories.ts +0 -58
- package/src/components/checkbox/EUICheckbox.vue +0 -110
- package/src/components/checkbox/EUICheckbox.vue.js.map +0 -1
- package/src/components/datepicker/EUIDatepicker.stories.ts +0 -492
- package/src/components/datepicker/EUIDatepicker.vue +0 -295
- package/src/components/datepicker/EUIDatepicker.vue.js.map +0 -1
- package/src/components/delete.vue +0 -262
- package/src/components/delete.vue.js.map +0 -1
- package/src/components/dragModal/EUIDrag.vue +0 -179
- package/src/components/dragModal/EUIDrag.vue.js.map +0 -1
- package/src/components/dropdown/EUIMultiDropdown.stories.ts +0 -294
- package/src/components/dropdown/EUIMultiDropdown.vue +0 -174
- package/src/components/dropdown/EUIMultiDropdown.vue.js.map +0 -1
- package/src/components/errorMessage/EUIErrorMessage.scss +0 -0
- package/src/components/errorMessage/EUIErrorMessage.stories.ts +0 -41
- package/src/components/errorMessage/EUIErrorMessage.vue +0 -25
- package/src/components/errorMessage/EUIErrorMessage.vue.js.map +0 -1
- package/src/components/index.js.map +0 -1
- package/src/components/index.ts +0 -62
- package/src/components/input/EUIInput.stories.ts +0 -387
- package/src/components/input/EUIInput.vue +0 -223
- package/src/components/input/EUIInput.vue.js.map +0 -1
- package/src/components/input/EUINumberInput.vue +0 -250
- package/src/components/loader/EUICircleLoader.vue +0 -31
- package/src/components/loader/EUICircleLoader.vue.js.map +0 -1
- package/src/components/loader/EUICubeLoader.vue +0 -237
- package/src/components/loader/EUICubeLoader.vue.js.map +0 -1
- package/src/components/loader/EUILoader.stories.ts +0 -99
- package/src/components/loader/EUILoader.vue +0 -17
- package/src/components/loader/EUILoader.vue.js.map +0 -1
- package/src/components/loader/EUISquareLoader.vue +0 -47
- package/src/components/loader/EUISquareLoader.vue.js.map +0 -1
- package/src/components/modal/EUIModal.stories.ts +0 -412
- package/src/components/modal/EUIModal.vue +0 -224
- package/src/components/modal/EUIModal.vue.js.map +0 -1
- package/src/components/pillSelect/EUIPillSelect.stories.ts +0 -74
- package/src/components/pillSelect/EUIPillSelect.vue +0 -149
- package/src/components/pillSelect/EUIPillSelect.vue.js.map +0 -1
- package/src/components/popover/EUIPopover.stories.ts +0 -306
- package/src/components/popover/EUIPopover.vue +0 -297
- package/src/components/popover/EUIPopover.vue.js.map +0 -1
- package/src/components/radio/EUIRadio.stories.ts +0 -54
- package/src/components/radio/EUIRadio.vue +0 -75
- package/src/components/radio/EUIRadio.vue.js.map +0 -1
- package/src/components/searchInput/EUISearch.stories.ts +0 -24
- package/src/components/searchInput/EUISearch.vue +0 -223
- package/src/components/searchInput/EUISearch.vue.js.map +0 -1
- package/src/components/searchTagSelect/EUISearchTagSelect.vue +0 -642
- package/src/components/searchTagSelect/EUISearchTagSelect.vue.js.map +0 -1
- package/src/components/searchTagSelect/SearchInput.vue +0 -167
- package/src/components/searchTagSelect/SearchInput.vue.js.map +0 -1
- package/src/components/searchexpand/EUISearchExpand.vue +0 -148
- package/src/components/searchexpand/EUISearchExpand.vue.js.map +0 -1
- package/src/components/searchexpand/EUISearchToggle.vue +0 -86
- package/src/components/searchexpand/EUISearchToggle.vue.js.map +0 -1
- package/src/components/select/EUISelect.stories.ts +0 -101
- package/src/components/select/EUISelect.vue +0 -1092
- package/src/components/select/EUISelect.vue.js.map +0 -1
- package/src/components/selectSearch/EUISelectSearch.vue +0 -23
- package/src/components/selectSearch/EUISelectSearch.vue.js.map +0 -1
- package/src/components/slideover/EUISlideover.stories.ts +0 -318
- package/src/components/slideover/EUISlideover.vue +0 -207
- package/src/components/slideover/EUISlideover.vue.js.map +0 -1
- package/src/components/stepperTimeline/EUIStepperHorizontal.vue +0 -242
- package/src/components/stepperTimeline/EUIStepperHorizontal.vue.js.map +0 -1
- package/src/components/stepperTimeline/EUIStepperTimeline.stories.ts +0 -54
- package/src/components/stepperTimeline/EUIStepperTimeline.vue +0 -16
- package/src/components/stepperTimeline/EUIStepperTimeline.vue.js.map +0 -1
- package/src/components/stepperTimeline/EUIStepperVertical.vue +0 -112
- package/src/components/stepperTimeline/EUIStepperVertical.vue.js.map +0 -1
- package/src/components/table/ColumnResizeTable.vue +0 -740
- package/src/components/table/ColumnResizeTable.vue.js.map +0 -1
- package/src/components/table/EUIDashboardTable.vue +0 -514
- package/src/components/table/EUIDashboardTable.vue.js.map +0 -1
- package/src/components/table/EUIPageLimit.vue +0 -66
- package/src/components/table/EUIPageLimit.vue.js.map +0 -1
- package/src/components/table/EUIPagination.vue +0 -175
- package/src/components/table/EUIPagination.vue.js.map +0 -1
- package/src/components/table/EUIStudentPagination.vue +0 -172
- package/src/components/table/EUIStudentPagination.vue.js.map +0 -1
- package/src/components/table/EUITable.stories.ts +0 -300
- package/src/components/table/EUITable.vue +0 -559
- package/src/components/table/EUITable.vue.js.map +0 -1
- package/src/components/table/EUITableCheckbox.vue +0 -98
- package/src/components/table/EUITableCheckbox.vue.js.map +0 -1
- package/src/components/table/GrowthTable.vue +0 -575
- package/src/components/table/GrowthTable.vue.js.map +0 -1
- package/src/components/table/GrowthTableView.vue +0 -108
- package/src/components/table/GrowthTableView.vue.js.map +0 -1
- package/src/components/table/ResizeTableview.vue +0 -198
- package/src/components/table/ResizeTableview.vue.js.map +0 -1
- package/src/components/table/UCheckbox.vue +0 -169
- package/src/components/table/UCheckbox.vue.js.map +0 -1
- package/src/components/table/UTable.scss +0 -69
- package/src/components/table/UTable.vue +0 -611
- package/src/components/table/UTable.vue.js.map +0 -1
- package/src/components/table/UTableview.vue +0 -189
- package/src/components/table/UTableview.vue.js.map +0 -1
- package/src/components/tabs/EUITabOutline.vue +0 -263
- package/src/components/tabs/EUITabOutline.vue.js.map +0 -1
- package/src/components/tabs/EUITabs.vue +0 -226
- package/src/components/tabs/EUITabs.vue.js.map +0 -1
- package/src/components/tabs/EUItabs.stories.ts +0 -137
- package/src/components/tag/EUITag.stories.ts +0 -53
- package/src/components/tag/EUITag.vue +0 -88
- package/src/components/tag/EUITag.vue.js.map +0 -1
- package/src/components/telephone/EUITelephone.stories.ts +0 -358
- package/src/components/telephone/EUITelephone.vue +0 -299
- package/src/components/telephone/EUITelephone.vue.js.map +0 -1
- package/src/components/textArea/EUITextArea.stories.ts +0 -134
- package/src/components/textArea/EUITextArea.vue +0 -155
- package/src/components/textArea/EUITextArea.vue.js.map +0 -1
- package/src/components/timeLine/EUITimeLine.stories.ts +0 -247
- package/src/components/timeLine/EUITimeLine.vue +0 -148
- package/src/components/timeLine/EUITimeLine.vue.js.map +0 -1
- package/src/components/toggle/EUIToggle.stories.ts +0 -63
- package/src/components/toggle/EUIToggle.vue +0 -101
- package/src/components/toggle/EUIToggle.vue.js.map +0 -1
- package/src/components/tooltip/EUITooltip.stories.ts +0 -53
- package/src/components/tooltip/EUITooltip.vue +0 -111
- package/src/components/tooltip/EUITooltip.vue.js.map +0 -1
- package/src/components/uidemo/select-com.vue +0 -120
- package/src/components/uidemo/select-com.vue.js.map +0 -1
- package/src/data/books.js.map +0 -1
- package/src/data/books.ts +0 -163
- package/src/data/country.ts +0 -56
- package/src/data/tab.js.map +0 -1
- package/src/data/tab.ts +0 -40
- package/src/data/table.js.map +0 -1
- package/src/data/table.ts +0 -5654
- package/src/main.js.map +0 -1
- package/src/main.ts +0 -5
- package/src/style.scss +0 -186
- package/src/utils/helpers.js.map +0 -1
- package/src/utils/helpers.ts +0 -30
- package/src/utils/lodash.js.map +0 -1
- package/src/utils/lodash.ts +0 -9
- package/src/utils/types.js.map +0 -1
- package/src/utils/types.ts +0 -9
- package/src/vite-env.d.ts +0 -5
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
.ui-table {
|
|
2
|
-
@apply bg-white bg-no-repeat;
|
|
3
|
-
background-image: linear-gradient(to right, white, white),
|
|
4
|
-
linear-gradient(to right, white, white),
|
|
5
|
-
linear-gradient(to right, rgba(229, 231, 235, 0.5), rgba(255, 255, 255, 0)),
|
|
6
|
-
linear-gradient(to left, rgba(229, 231, 235, 0.5), rgba(255, 255, 255, 0)),
|
|
7
|
-
linear-gradient(to top, white, rgba(255, 255, 255, 0)),
|
|
8
|
-
linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(229, 231, 235, 0.5));
|
|
9
|
-
background-position: left center, right center, left center, right center,
|
|
10
|
-
left bottom, left bottom;
|
|
11
|
-
background-size: 45px 100%, 32px 100%, 20px 100%, 20px 100%, 100% 100px,
|
|
12
|
-
100% 20px;
|
|
13
|
-
background-attachment: local, local, scroll, scroll, local, scroll;
|
|
14
|
-
|
|
15
|
-
& > table {
|
|
16
|
-
@apply table table-auto border-separate border-spacing-0 box-border w-full;
|
|
17
|
-
& > thead {
|
|
18
|
-
@apply sticky top-0 left-0 z-20 before:-bottom-px before:left-0 before:absolute before:h-px before:w-full before:bg-gray-300 rounded-xl;
|
|
19
|
-
& > tr {
|
|
20
|
-
& > th {
|
|
21
|
-
@apply bg-gray-50 text-sm text-gray-700 text-left first-letter:uppercase border border-b-0 border-l-0 border-solid border-gray-200/50 whitespace-nowrap last-of-type:rounded-tr-lg first-of-type:rounded-tl-lg first:border-l last:border-r font-bold snap-start snap-always h-10;
|
|
22
|
-
transition: all 0.15s ease-out;
|
|
23
|
-
&:first-of-type.checkable {
|
|
24
|
-
@apply min-h-10 px-2 max-w-[45px] w-[45px] sticky left-0 top-0 z-20 bg-gray-100 flex justify-center;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
& > tbody {
|
|
30
|
-
& > tr:not(.norecords, .row-expanded) {
|
|
31
|
-
@apply transition-all duration-100 ease-in-out last:mb-px;
|
|
32
|
-
&:hover {
|
|
33
|
-
transition: all 0.15s ease-out;
|
|
34
|
-
@apply bg-purple-50;
|
|
35
|
-
td {
|
|
36
|
-
@apply first:rounded-l-sm last:rounded-r-sm transition-colors duration-100 ease-in text-gray-900 bg-purple-50;
|
|
37
|
-
&:first-of-type.checkable {
|
|
38
|
-
@apply bg-purple-50;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
td {
|
|
43
|
-
@apply border-0 first:border-l border-r relative text-sm font-medium text-gray-600 border-b border-solid break-words border-gray-100 py-1.5 px-3 h-14 align-middle;
|
|
44
|
-
&:first-of-type.checkable {
|
|
45
|
-
@apply flex justify-center w-[45px] text-center sticky left-0 top-0 z-[11] bg-white overflow-visible;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
& > tr.row-expanded {
|
|
51
|
-
@apply bg-gray-50;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.search-icon {
|
|
58
|
-
span {
|
|
59
|
-
&::after {
|
|
60
|
-
@apply absolute m-auto;
|
|
61
|
-
content: "";
|
|
62
|
-
width: 18px;
|
|
63
|
-
height: 18px;
|
|
64
|
-
top: 10px;
|
|
65
|
-
right: 14px;
|
|
66
|
-
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='iso-8859-1'%3F%3E%3C!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='18px' height='18px' fill='%2393a3b8' viewBox='0 0 28.931 28.932' style='enable-background:new 0 0 28.931 28.932;' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M28.344,25.518l-6.114-6.115c1.486-2.067,2.303-4.537,2.303-7.137c0-3.275-1.275-6.355-3.594-8.672 C18.625,1.278,15.543,0,12.266,0C8.99,0,5.909,1.275,3.593,3.594C1.277,5.909,0.001,8.99,0.001,12.266 c0,3.276,1.275,6.356,3.592,8.674c2.316,2.316,5.396,3.594,8.673,3.594c2.599,0,5.067-0.813,7.136-2.303l6.114,6.115 c0.392,0.391,0.902,0.586,1.414,0.586c0.513,0,1.024-0.195,1.414-0.586C29.125,27.564,29.125,26.299,28.344,25.518z M6.422,18.111 c-1.562-1.562-2.421-3.639-2.421-5.846S4.86,7.983,6.422,6.421c1.561-1.562,3.636-2.422,5.844-2.422s4.284,0.86,5.845,2.422 c1.562,1.562,2.422,3.638,2.422,5.845s-0.859,4.283-2.422,5.846c-1.562,1.562-3.636,2.42-5.845,2.42S7.981,19.672,6.422,18.111z'/%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,611 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<Transition name="fade" mode="out-in">
|
|
4
|
-
<template v-if="loading">
|
|
5
|
-
<slot name="loader" :loading="loading" :height="tableHeight">
|
|
6
|
-
<div
|
|
7
|
-
:class="[
|
|
8
|
-
'overflow-hidden relative z-0 isolate bg-white backdrop-blur transition-colors duration-150 ease-in-out rounded-xl border border-gray-50',
|
|
9
|
-
tableHeight
|
|
10
|
-
? tableHeight
|
|
11
|
-
: 'h-[calc(100svh-9rem)] max-h-[calc(100svh-9rem)]',
|
|
12
|
-
]"
|
|
13
|
-
>
|
|
14
|
-
<div
|
|
15
|
-
class="absolute flex items-center z-[calc(infinity)] w-full h-auto pointer-events-none inset-0"
|
|
16
|
-
>
|
|
17
|
-
<EUICircleLoader />
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</slot>
|
|
21
|
-
</template>
|
|
22
|
-
<div v-else class="relative max-w-full mx-auto overflow-hidden">
|
|
23
|
-
<div
|
|
24
|
-
:class="[
|
|
25
|
-
'ui-table scrollbar--auto',
|
|
26
|
-
computedItems.length === 0
|
|
27
|
-
? 'overflow-hidden pointer-events-none'
|
|
28
|
-
: 'overflow-scroll',
|
|
29
|
-
tableHeight
|
|
30
|
-
? tableHeight
|
|
31
|
-
: 'h-[calc(100svh-12rem)] max-h-[calc(100svh-12rem)]',
|
|
32
|
-
]"
|
|
33
|
-
ref="tableContainer"
|
|
34
|
-
@scroll="handleScroll"
|
|
35
|
-
>
|
|
36
|
-
<table>
|
|
37
|
-
<thead>
|
|
38
|
-
<tr>
|
|
39
|
-
<th
|
|
40
|
-
v-if="checkable"
|
|
41
|
-
class="checkable"
|
|
42
|
-
style="
|
|
43
|
-
width: 45px;
|
|
44
|
-
max-width: 45px;
|
|
45
|
-
background-color: rgb(243 244 246);
|
|
46
|
-
"
|
|
47
|
-
scope="col"
|
|
48
|
-
>
|
|
49
|
-
<UCheckbox
|
|
50
|
-
:checked="isAllChecked"
|
|
51
|
-
:indeterminate="isIndeterminate"
|
|
52
|
-
:disabled="isAllUncheckable"
|
|
53
|
-
@change="checkAll"
|
|
54
|
-
/>
|
|
55
|
-
</th>
|
|
56
|
-
<th
|
|
57
|
-
v-for="(header, headerIndex) in headers"
|
|
58
|
-
:key="headerIndex"
|
|
59
|
-
scope="col"
|
|
60
|
-
:class="[
|
|
61
|
-
'snap-start snap-always py-2',
|
|
62
|
-
header?.sortable
|
|
63
|
-
? 'cursor-pointer hover:!text-gray-900 pr-8 pl-3'
|
|
64
|
-
: 'px-3 cursor-auto',
|
|
65
|
-
isScrolled && headerIndex === 0 ? stickyClass.head : null,
|
|
66
|
-
{ '!bg-gray-200': currentSort === header.value },
|
|
67
|
-
]"
|
|
68
|
-
:style="
|
|
69
|
-
headers.length > 6
|
|
70
|
-
? headerStyle(header)
|
|
71
|
-
: 'width: 100%;min-width: 250px;background-color: rgb(243 244 246);'
|
|
72
|
-
"
|
|
73
|
-
@click="sortBy(header, $event)"
|
|
74
|
-
>
|
|
75
|
-
<div class="relative z-0 w-full">
|
|
76
|
-
<div
|
|
77
|
-
class="w-full text-sm font-bold text-current font-inter"
|
|
78
|
-
:class="{ truncate: !header?.showHeaderInfoText }"
|
|
79
|
-
>
|
|
80
|
-
<slot name="header" :header="header" :index="headerIndex">
|
|
81
|
-
{{ capitalizeText(header?.text ?? header?.name ?? "") }}
|
|
82
|
-
</slot>
|
|
83
|
-
<slot
|
|
84
|
-
v-if="headerOptional"
|
|
85
|
-
name="headerOptionalItem"
|
|
86
|
-
></slot>
|
|
87
|
-
<EUITooltip
|
|
88
|
-
v-if="header?.showInfoText"
|
|
89
|
-
placement="top"
|
|
90
|
-
class="inline-block ms-0.5"
|
|
91
|
-
>
|
|
92
|
-
<template v-slot:default>
|
|
93
|
-
<InformationCircleIcon
|
|
94
|
-
class="inline-block text-gray-500 size-4"
|
|
95
|
-
/>
|
|
96
|
-
</template>
|
|
97
|
-
<template v-slot:tooltip>
|
|
98
|
-
<div
|
|
99
|
-
class="z-50 max-w-xs break-words whitespace-normal min-w-max"
|
|
100
|
-
>
|
|
101
|
-
{{ header?.showHeaderInfoText }}
|
|
102
|
-
</div>
|
|
103
|
-
</template>
|
|
104
|
-
</EUITooltip>
|
|
105
|
-
</div>
|
|
106
|
-
<div
|
|
107
|
-
v-if="header?.sortable"
|
|
108
|
-
class="absolute -top-0.5 -right-6 size-6 z-10"
|
|
109
|
-
>
|
|
110
|
-
<svg
|
|
111
|
-
width="24"
|
|
112
|
-
height="24"
|
|
113
|
-
viewBox="0 0 24 24"
|
|
114
|
-
fill="none"
|
|
115
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
-
class="size-6"
|
|
117
|
-
>
|
|
118
|
-
<rect width="24" height="24" fill="none" />
|
|
119
|
-
<path
|
|
120
|
-
d="M8 10C9.06206 8.5381 10.3071 7.2287 11.7021 6.1058C11.8774 5.9647 12.1226 5.9647 12.2979 6.1058C13.6929 7.2287 14.9379 8.5381 16 10"
|
|
121
|
-
:stroke="
|
|
122
|
-
currentSortDir === 'asc' &&
|
|
123
|
-
currentSort === header?.value
|
|
124
|
-
? '#111827'
|
|
125
|
-
: '#9ca3af'
|
|
126
|
-
"
|
|
127
|
-
stroke-opacity="0.8"
|
|
128
|
-
stroke-width="2"
|
|
129
|
-
stroke-linecap="round"
|
|
130
|
-
stroke-linejoin="round"
|
|
131
|
-
/>
|
|
132
|
-
<path
|
|
133
|
-
d="M8 14C9.06206 15.4619 10.3071 16.7713 11.7021 17.8942C11.8774 18.0353 12.1226 18.0353 12.2979 17.8942C13.6929 16.7713 14.9379 15.4619 16 14"
|
|
134
|
-
:stroke="
|
|
135
|
-
currentSortDir === 'desc' &&
|
|
136
|
-
currentSort === header?.value
|
|
137
|
-
? '#111827'
|
|
138
|
-
: '#9ca3af'
|
|
139
|
-
"
|
|
140
|
-
stroke-opacity="0.8"
|
|
141
|
-
stroke-width="2"
|
|
142
|
-
stroke-linecap="round"
|
|
143
|
-
stroke-linejoin="round"
|
|
144
|
-
/>
|
|
145
|
-
</svg>
|
|
146
|
-
</div>
|
|
147
|
-
</div>
|
|
148
|
-
</th>
|
|
149
|
-
</tr>
|
|
150
|
-
</thead>
|
|
151
|
-
<tbody>
|
|
152
|
-
<template
|
|
153
|
-
v-if="computedItems.length > 0"
|
|
154
|
-
v-for="(row, rowIndex) in computedItems"
|
|
155
|
-
:key="`table-row-${rowIndex}`"
|
|
156
|
-
>
|
|
157
|
-
<tr
|
|
158
|
-
:id="`row-${rowIndex}`"
|
|
159
|
-
@mouseenter="
|
|
160
|
-
$attrs.mouseenter
|
|
161
|
-
? $emit('mouseenter', row, rowIndex)
|
|
162
|
-
: null
|
|
163
|
-
"
|
|
164
|
-
@mouseleave="
|
|
165
|
-
$attrs.mouseleave
|
|
166
|
-
? $emit('mouseleave', row, rowIndex)
|
|
167
|
-
: null
|
|
168
|
-
"
|
|
169
|
-
class="group"
|
|
170
|
-
:class="{ 'bg-purple-100': activeRowIndex == rowIndex }"
|
|
171
|
-
>
|
|
172
|
-
<td
|
|
173
|
-
v-if="checkable"
|
|
174
|
-
class="checkable"
|
|
175
|
-
style="width: 45px; max-width: 45px"
|
|
176
|
-
>
|
|
177
|
-
<UCheckbox
|
|
178
|
-
:disabled="!isRowCheckable(row)"
|
|
179
|
-
:checked="isRowChecked(row)"
|
|
180
|
-
@change.prevent.stop="
|
|
181
|
-
($event) => checkRow(row, rowIndex, $event)
|
|
182
|
-
"
|
|
183
|
-
/>
|
|
184
|
-
</td>
|
|
185
|
-
<td
|
|
186
|
-
v-for="(header, headerIndex) in headers"
|
|
187
|
-
:key="headerIndex"
|
|
188
|
-
:style="bodyStyle(header)"
|
|
189
|
-
:class="[
|
|
190
|
-
isScrolled && headerIndex === 0 ? stickyClass.body : null,
|
|
191
|
-
{ '!bg-purple-100': activeRowIndex == rowIndex },
|
|
192
|
-
]"
|
|
193
|
-
>
|
|
194
|
-
<slot
|
|
195
|
-
:name="`item.${header?.value}`"
|
|
196
|
-
:row="row"
|
|
197
|
-
:rowIndex="rowIndex"
|
|
198
|
-
:headerIndex="headerIndex"
|
|
199
|
-
>
|
|
200
|
-
<span
|
|
201
|
-
class="block"
|
|
202
|
-
:class="{ truncate: !header.showInfoText }"
|
|
203
|
-
>
|
|
204
|
-
{{ getValueByPath(row, header?.value) }}
|
|
205
|
-
<EUITooltip
|
|
206
|
-
v-if="header?.showInfoText"
|
|
207
|
-
placement="top"
|
|
208
|
-
class="inline-block ms-0.5"
|
|
209
|
-
>
|
|
210
|
-
<template v-slot:default>
|
|
211
|
-
<InformationCircleIcon
|
|
212
|
-
class="inline-block text-gray-500 size-4"
|
|
213
|
-
/>
|
|
214
|
-
</template>
|
|
215
|
-
<template v-slot:tooltip>
|
|
216
|
-
<div
|
|
217
|
-
class="z-50 max-w-xs break-words whitespace-normal min-w-max"
|
|
218
|
-
>
|
|
219
|
-
{{ header?.showInfoText }}
|
|
220
|
-
</div>
|
|
221
|
-
</template>
|
|
222
|
-
</EUITooltip>
|
|
223
|
-
</span>
|
|
224
|
-
</slot>
|
|
225
|
-
</td>
|
|
226
|
-
</tr>
|
|
227
|
-
<template v-if="tableExpanded">
|
|
228
|
-
<slot
|
|
229
|
-
name="expanded"
|
|
230
|
-
:row="row"
|
|
231
|
-
:rowIndex="rowIndex"
|
|
232
|
-
:headerLength="headers.length"
|
|
233
|
-
></slot>
|
|
234
|
-
</template>
|
|
235
|
-
</template>
|
|
236
|
-
<template v-else-if="computedItems.length === 0">
|
|
237
|
-
<tr class="norecords">
|
|
238
|
-
<td
|
|
239
|
-
:colspan="
|
|
240
|
-
checkable === true ? headers.length + 1 : headers.length
|
|
241
|
-
"
|
|
242
|
-
>
|
|
243
|
-
<slot name="no-records">
|
|
244
|
-
<div
|
|
245
|
-
class="flex items-center justify-center w-[calc(100vw-14rem)]"
|
|
246
|
-
:class="[
|
|
247
|
-
tableHeight
|
|
248
|
-
? tableHeight
|
|
249
|
-
: 'h-[calc(100svh-12rem)] max-h-[calc(100svh-12rem)]',
|
|
250
|
-
]"
|
|
251
|
-
>
|
|
252
|
-
<div class="text-center">
|
|
253
|
-
<div
|
|
254
|
-
class="mx-auto overflow-hidden rounded-md size-56"
|
|
255
|
-
>
|
|
256
|
-
<img
|
|
257
|
-
src="@/assets/images/search-nodata.png"
|
|
258
|
-
alt=""
|
|
259
|
-
class="block object-contain object-center h-auto max-w-full opacity-90"
|
|
260
|
-
/>
|
|
261
|
-
</div>
|
|
262
|
-
<div class="my-2 text-xl font-medium text-gray-500">
|
|
263
|
-
No matching records found
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
</slot>
|
|
268
|
-
</td>
|
|
269
|
-
</tr>
|
|
270
|
-
</template>
|
|
271
|
-
</tbody>
|
|
272
|
-
</table>
|
|
273
|
-
</div>
|
|
274
|
-
<div
|
|
275
|
-
v-if="stickyFooter"
|
|
276
|
-
class="sticky bottom-0 left-0 z-50 flex items-center justify-between px-2 py-1 bg-white border-t border-gray-300"
|
|
277
|
-
>
|
|
278
|
-
<slot name="tableCount">
|
|
279
|
-
<div class="inline-flex items-center gap-x-2">
|
|
280
|
-
<div class="text-sm font-medium text-gray-900">
|
|
281
|
-
Total {{ total }}
|
|
282
|
-
</div>
|
|
283
|
-
<span class="text-gray-300">|</span>
|
|
284
|
-
<div class="inline-flex items-center">
|
|
285
|
-
<span class="text-sm font-medium text-gray-900">Per page</span>
|
|
286
|
-
<EUIPageLimit
|
|
287
|
-
:page-limit="limit"
|
|
288
|
-
@update-limit="changeLimit($event)"
|
|
289
|
-
@refetch="searchData($event)"
|
|
290
|
-
:iconStyle="true"
|
|
291
|
-
/>
|
|
292
|
-
</div>
|
|
293
|
-
</div>
|
|
294
|
-
</slot>
|
|
295
|
-
<template v-if="paginated && computedItems.length !== 0">
|
|
296
|
-
<slot name="tablepagination">
|
|
297
|
-
<EUIStudentPagination
|
|
298
|
-
:activePage="newCurrentPage"
|
|
299
|
-
:pageLimit="limit"
|
|
300
|
-
:totalCount="total"
|
|
301
|
-
@change-page="pageChanged($event)"
|
|
302
|
-
/>
|
|
303
|
-
</slot>
|
|
304
|
-
</template>
|
|
305
|
-
</div>
|
|
306
|
-
</div>
|
|
307
|
-
</Transition>
|
|
308
|
-
</div>
|
|
309
|
-
</template>
|
|
310
|
-
|
|
311
|
-
<script lang="ts" setup>
|
|
312
|
-
import {
|
|
313
|
-
ref,
|
|
314
|
-
computed,
|
|
315
|
-
watch,
|
|
316
|
-
toRefs,
|
|
317
|
-
PropType,
|
|
318
|
-
onMounted,
|
|
319
|
-
onUnmounted,
|
|
320
|
-
} from "vue";
|
|
321
|
-
import { getValueByPath, indexOf, defaultFilter } from "../../utils/helpers";
|
|
322
|
-
import UCheckbox from "./UCheckbox.vue";
|
|
323
|
-
import { capitalizeText } from "../../utils/lodash";
|
|
324
|
-
import EUIStudentPagination from "./EUIStudentPagination.vue";
|
|
325
|
-
import EUICircleLoader from "../loader/EUICircleLoader.vue";
|
|
326
|
-
import EUIPageLimit from "./EUIPageLimit.vue";
|
|
327
|
-
import "./UTable.scss";
|
|
328
|
-
import EUITooltip from "../tooltip/EUITooltip.vue";
|
|
329
|
-
import { InformationCircleIcon } from "@heroicons/vue/24/outline";
|
|
330
|
-
|
|
331
|
-
interface Header {
|
|
332
|
-
value: string;
|
|
333
|
-
text?: string;
|
|
334
|
-
name?: string;
|
|
335
|
-
sortable?: boolean;
|
|
336
|
-
width?: number;
|
|
337
|
-
color?: string;
|
|
338
|
-
showInfoText?: string;
|
|
339
|
-
showHeaderInfoText?: string;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
interface Item {
|
|
343
|
-
[key: string]: any;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const props = defineProps({
|
|
347
|
-
items: { type: Array as PropType<Item[]>, default: () => [], required: true },
|
|
348
|
-
headers: {
|
|
349
|
-
type: Array as PropType<Header[]>,
|
|
350
|
-
default: () => [],
|
|
351
|
-
required: true,
|
|
352
|
-
},
|
|
353
|
-
stickyFooter: { type: Boolean, default: true },
|
|
354
|
-
paginated: { type: Boolean, default: false },
|
|
355
|
-
tableExpanded: { type: Boolean, default: false },
|
|
356
|
-
search: { type: String, default: "" },
|
|
357
|
-
perPage: { type: Number, default: 5 },
|
|
358
|
-
total: { type: Number, default: 0 },
|
|
359
|
-
currentPage: { type: Number, default: 1 },
|
|
360
|
-
defaultSort: { type: String, default: "" },
|
|
361
|
-
defaultSortDirection: { type: String, default: "asc" },
|
|
362
|
-
headerOptional: { type: Boolean, default: false },
|
|
363
|
-
checkedRows: { type: Array as PropType<Item[]>, default: () => [] },
|
|
364
|
-
checkable: { type: Boolean, default: false },
|
|
365
|
-
isRowCheckable: {
|
|
366
|
-
type: Function as PropType<(row: Item) => boolean>,
|
|
367
|
-
default: () => true,
|
|
368
|
-
},
|
|
369
|
-
stickyColumn: { type: Boolean, default: true },
|
|
370
|
-
tableHeight: {
|
|
371
|
-
type: String,
|
|
372
|
-
required: false,
|
|
373
|
-
default: "",
|
|
374
|
-
},
|
|
375
|
-
tableLoading: { type: Boolean, default: false },
|
|
376
|
-
backendPagination: Boolean,
|
|
377
|
-
activeRowIndex: { type: Number, default: null },
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
const {
|
|
381
|
-
defaultSort,
|
|
382
|
-
defaultSortDirection,
|
|
383
|
-
checkedRows,
|
|
384
|
-
currentPage,
|
|
385
|
-
items,
|
|
386
|
-
backendPagination,
|
|
387
|
-
total,
|
|
388
|
-
search,
|
|
389
|
-
headers,
|
|
390
|
-
paginated,
|
|
391
|
-
isRowCheckable,
|
|
392
|
-
activeRowIndex,
|
|
393
|
-
} = toRefs(props);
|
|
394
|
-
|
|
395
|
-
// Emits used
|
|
396
|
-
const emit = defineEmits([
|
|
397
|
-
"update:currentPage",
|
|
398
|
-
"changePage",
|
|
399
|
-
"sort",
|
|
400
|
-
"check",
|
|
401
|
-
"check-all",
|
|
402
|
-
"update:checkedRows",
|
|
403
|
-
"update:selectedRows",
|
|
404
|
-
"changeLimit",
|
|
405
|
-
"mouseenter",
|
|
406
|
-
"mouseleave",
|
|
407
|
-
]);
|
|
408
|
-
|
|
409
|
-
const currentSort = ref(defaultSort.value);
|
|
410
|
-
const currentSortDir = ref(defaultSortDirection.value);
|
|
411
|
-
const newCheckedRows = ref([...checkedRows.value]);
|
|
412
|
-
const newCurrentPage = ref(currentPage.value);
|
|
413
|
-
const limit = ref(props.perPage);
|
|
414
|
-
const loading = computed(() => props.tableLoading);
|
|
415
|
-
|
|
416
|
-
// Computed Property
|
|
417
|
-
|
|
418
|
-
const filteredItems = computed(() => {
|
|
419
|
-
let filteredItems = items.value.slice();
|
|
420
|
-
if (!backendPagination.value && search.value !== "") {
|
|
421
|
-
if (search.value.trim() === "") return filteredItems;
|
|
422
|
-
const props = headers.value.map((h: any) => h.value);
|
|
423
|
-
filteredItems = items.value.filter((row) =>
|
|
424
|
-
props.some((prop) =>
|
|
425
|
-
defaultFilter(
|
|
426
|
-
getValueByPath(row, prop),
|
|
427
|
-
search.value.toString().toLowerCase()
|
|
428
|
-
)
|
|
429
|
-
)
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
return filteredItems;
|
|
433
|
-
});
|
|
434
|
-
|
|
435
|
-
const computedItems = computed(() => {
|
|
436
|
-
let items = filteredItems.value;
|
|
437
|
-
// Sort items before slicing for pagination
|
|
438
|
-
items.sort((a: any, b: any) => {
|
|
439
|
-
const modifier = currentSortDir.value === "desc" ? -1 : 1;
|
|
440
|
-
if (a[currentSort.value] < b[currentSort.value]) return -1 * modifier;
|
|
441
|
-
if (a[currentSort.value] > b[currentSort.value]) return 1 * modifier;
|
|
442
|
-
return 0;
|
|
443
|
-
});
|
|
444
|
-
return items;
|
|
445
|
-
|
|
446
|
-
// Apply pagination
|
|
447
|
-
// const start = (newCurrentPage.value - 0) * limit.value;
|
|
448
|
-
// const end = start + limit.value;
|
|
449
|
-
// return items.slice(start, end);
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
const headerStyle = (header: Header) => ({
|
|
453
|
-
minWidth: `${header.width || 300}px`,
|
|
454
|
-
maxWidth: `${header.width || 300}px`,
|
|
455
|
-
backgroundColor: header.color || "rgb(243 244 246)",
|
|
456
|
-
// flex: `${header.width || 300} 0 auto`,
|
|
457
|
-
});
|
|
458
|
-
|
|
459
|
-
const bodyStyle = (header: Header) => ({
|
|
460
|
-
width: `${header.width || 300}px`,
|
|
461
|
-
maxWidth: `${header.width || 300}px`,
|
|
462
|
-
// flex: `${header.width || 300} 0 auto`,
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
const searchData = (_data: any) => {
|
|
466
|
-
// console.log(_data);
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
const changeLimit = (limitData: number) => {
|
|
470
|
-
limit.value = limitData;
|
|
471
|
-
newCurrentPage.value = 0;
|
|
472
|
-
emit("update:currentPage", newCurrentPage.value);
|
|
473
|
-
emit("changeLimit", limitData);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
const pageChanged = (page: number) => {
|
|
477
|
-
newCurrentPage.value = page > 0 ? page : 0;
|
|
478
|
-
emit("update:currentPage", newCurrentPage.value);
|
|
479
|
-
emit("changePage", page);
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
const sortBy = (header: any, event: any) => {
|
|
483
|
-
if (!header || !header.sortable) return;
|
|
484
|
-
if (header.value === currentSort.value) {
|
|
485
|
-
currentSortDir.value = currentSortDir.value === "asc" ? "desc" : "asc";
|
|
486
|
-
}
|
|
487
|
-
currentSort.value = header.value;
|
|
488
|
-
emit("sort", currentSort.value, currentSortDir.value, event);
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
const isAllChecked = computed(() => {
|
|
492
|
-
return (
|
|
493
|
-
computedItems.value.length > 0 &&
|
|
494
|
-
computedItems.value.every((row) => newCheckedRows.value.includes(row))
|
|
495
|
-
);
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
const isAllUncheckable = computed(() => {
|
|
499
|
-
const validVisibleData = computedItems.value?.filter((row) =>
|
|
500
|
-
isRowCheckable.value!(row)
|
|
501
|
-
);
|
|
502
|
-
return validVisibleData.length === 0;
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
const isIndeterminate = computed(() => {
|
|
506
|
-
const validVisibleData = computedItems.value.filter((row) =>
|
|
507
|
-
isRowCheckable.value(row)
|
|
508
|
-
);
|
|
509
|
-
return (
|
|
510
|
-
newCheckedRows.value.length > 0 &&
|
|
511
|
-
newCheckedRows.value.length < validVisibleData.length
|
|
512
|
-
);
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
const isRowChecked = (row: any) => {
|
|
516
|
-
return indexOf(newCheckedRows.value, row) >= 0;
|
|
517
|
-
};
|
|
518
|
-
|
|
519
|
-
const removeCheckedRow = (row: any) => {
|
|
520
|
-
const index = indexOf(newCheckedRows.value, row);
|
|
521
|
-
if (index >= 0) {
|
|
522
|
-
newCheckedRows.value.splice(index, 1);
|
|
523
|
-
}
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
const checkAll = () => {
|
|
527
|
-
if (isAllChecked.value) {
|
|
528
|
-
// Uncheck all rows
|
|
529
|
-
newCheckedRows.value = [];
|
|
530
|
-
} else {
|
|
531
|
-
// Check all rows
|
|
532
|
-
const rowsToCheck = computedItems.value.filter(
|
|
533
|
-
(row) => !newCheckedRows.value.includes(row)
|
|
534
|
-
);
|
|
535
|
-
newCheckedRows.value.push(...rowsToCheck);
|
|
536
|
-
}
|
|
537
|
-
emit("check", newCheckedRows.value);
|
|
538
|
-
emit("check-all", newCheckedRows.value);
|
|
539
|
-
emit("update:checkedRows", newCheckedRows.value);
|
|
540
|
-
emit("update:selectedRows", newCheckedRows.value);
|
|
541
|
-
};
|
|
542
|
-
|
|
543
|
-
const checkRow = (row: any, _rowIndex: number, _event: any) => {
|
|
544
|
-
const isChecked = newCheckedRows.value.includes(row);
|
|
545
|
-
if (_event && isChecked) {
|
|
546
|
-
removeCheckedRow(row);
|
|
547
|
-
} else {
|
|
548
|
-
newCheckedRows.value.push(row);
|
|
549
|
-
}
|
|
550
|
-
emit("check", newCheckedRows.value, row);
|
|
551
|
-
emit("update:checkedRows", newCheckedRows.value);
|
|
552
|
-
emit("update:selectedRows", newCheckedRows.value);
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
// watch
|
|
556
|
-
watch(
|
|
557
|
-
() => currentPage.value,
|
|
558
|
-
(newVal) => {
|
|
559
|
-
newCurrentPage.value = newVal;
|
|
560
|
-
},
|
|
561
|
-
{ immediate: true }
|
|
562
|
-
);
|
|
563
|
-
watch(
|
|
564
|
-
() => checkedRows.value,
|
|
565
|
-
(rows) => {
|
|
566
|
-
newCheckedRows.value = [...rows];
|
|
567
|
-
},
|
|
568
|
-
{ immediate: true }
|
|
569
|
-
);
|
|
570
|
-
|
|
571
|
-
const stickyClass = computed(() => {
|
|
572
|
-
return props.checkable && props.stickyColumn
|
|
573
|
-
? {
|
|
574
|
-
head: "bg-gray-100 sticky left-[45px] top-0 z-20",
|
|
575
|
-
body: "bg-white !sticky left-[45px] top-0 z-10 !overflow-visible after:absolute after:content-[''] after:bg-inherit after:w-2 after:h-[103%] after:inset-y-0 after:-right-2 after:bg-gradient-to-r after:from-gray-200 after:from-0% after:via-gray-50 after:via-60% after:z-10",
|
|
576
|
-
}
|
|
577
|
-
: {
|
|
578
|
-
head: "bg-gray-100 sticky left-0 top-0 z-20",
|
|
579
|
-
body: "bg-white !sticky left-0 top-0 z-10 !overflow-visible after:absolute after:content-[''] after:bg-inherit after:w-2 after:h-[103%] after:inset-y-0 after:-right-2 after:bg-gradient-to-r after:from-gray-200 after:from-0% after:via-gray-50 after:via-60% after:z-0",
|
|
580
|
-
};
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
const isOverflowing = ref(false);
|
|
584
|
-
const isScrolled = ref(false);
|
|
585
|
-
const tableContainer = ref<HTMLElement | null>(null);
|
|
586
|
-
|
|
587
|
-
const handleScroll = () => {
|
|
588
|
-
const container = tableContainer.value;
|
|
589
|
-
if (container) {
|
|
590
|
-
isScrolled.value = container.scrollLeft > 0;
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
const checkOverflow = () => {
|
|
595
|
-
const container = tableContainer.value;
|
|
596
|
-
if (container) {
|
|
597
|
-
isOverflowing.value = container.scrollWidth > container.clientWidth;
|
|
598
|
-
}
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
onMounted(() => {
|
|
602
|
-
window.addEventListener("resize", checkOverflow);
|
|
603
|
-
});
|
|
604
|
-
|
|
605
|
-
onUnmounted(() => {
|
|
606
|
-
window.removeEventListener("resize", checkOverflow);
|
|
607
|
-
});
|
|
608
|
-
|
|
609
|
-
// Watch for changes in the container's width to check for overflow
|
|
610
|
-
watch(() => tableContainer.value?.clientWidth, checkOverflow);
|
|
611
|
-
</script>
|