@sulzanoks/vue-datatable 0.4.5 → 0.5.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.
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div class="card" :class="cardClasses">
2
+ <div class="vue-datatable" :class="cardClasses">
3
3
  <header
4
4
  v-if="showHeader || $slots.header"
5
- class="card-header"
5
+ class="vdt-header"
6
6
  :class="[
7
7
  {
8
- 'card-header-danger': cardError && cardIcon,
9
- 'card-header-icon': cardIcon
8
+ 'vdt-header-error': cardError,
9
+ 'vdt-header-menu-open': showPageDropdown
10
10
  },
11
11
  !cardError && cardIcon ? cardIconStyle : null,
12
12
  ]"
@@ -15,23 +15,23 @@
15
15
  <template
16
16
  v-if="showHeader"
17
17
  >
18
- <div v-if="cardIcon" class="card-icon">
18
+ <div v-if="cardIcon" class="vdt-header-icon">
19
19
  <i v-if="!cardError" class="material-icons">{{ cardIcon }}</i>
20
20
  <i v-else class="material-icons">dangerous</i>
21
21
  </div>
22
- <h4 v-if="cardTitle && !cardError" class="card-title">{{ cardTitle }}</h4>
23
- <h4 v-if="cardError" class="card-title text-danger">{{ cardError }}</h4>
24
- <div v-if="!advancedSearch" class="card-search" :class="{ open: searchBarOpen }">
25
- <div class="form-group label-floating is-empty">
26
- <i class="material-icons search-icon-left">search</i>
27
- <input type="text" class="form-control filter-input" :placeholder="t('search')" autocomplete="off"
22
+ <h4 v-if="cardTitle && !cardError" class="vdt-title">{{ cardTitle }}</h4>
23
+ <h4 v-if="cardError" class="vdt-title vdt-title-error">{{ cardError }}</h4>
24
+ <div v-if="!advancedSearch" class="vdt-search" :class="{ open: searchBarOpen }">
25
+ <div class="vdt-search-field">
26
+ <i class="material-icons vdt-search-icon" aria-hidden="true">search</i>
27
+ <input type="text" class="vdt-input filter-input" :aria-label="t('search')" :placeholder="t('search')" autocomplete="off"
28
28
  @keyup="setSearchTerm">
29
- <a href="javascript:void(0)" class="close-search" @click="clearSearch" :data-tippy-content="t('close')">
29
+ <a href="javascript:void(0)" class="vdt-search-close" :aria-label="t('close')" @click="clearSearch" :data-tippy-content="t('close')">
30
30
  <i class="material-icons">close</i>
31
31
  </a>
32
32
  </div>
33
33
  </div>
34
- <ul class="card-actions icons right-top">
34
+ <ul class="vdt-actions">
35
35
  <slot name="actions"></slot>
36
36
  <li v-if="createLink">
37
37
  <Link :href="createLink" :data-tippy-content="t('createNew')">
@@ -43,168 +43,173 @@
43
43
  <i class="material-icons">search</i>
44
44
  </a>
45
45
  </li>
46
- <li class="dropdown" :data-tippy-content="t('showEntries')">
47
- <a href="javascript:void(0)" data-bs-toggle="dropdown">
48
- <i class="material-icons">more_vert</i>
46
+ <li
47
+ ref="pageDropdown"
48
+ class="vdt-page-dropdown"
49
+ :data-tippy-content="t('showEntries')"
50
+ @keydown.esc.stop="closePageDropdown"
51
+ >
52
+ <a
53
+ ref="pageDropdownToggle"
54
+ href="#"
55
+ role="button"
56
+ :aria-label="t('showEntries')"
57
+ :aria-expanded="showPageDropdown"
58
+ @click.prevent="showPageDropdown = !showPageDropdown"
59
+ @keydown.space.prevent="showPageDropdown = !showPageDropdown"
60
+ >
61
+ <i class="material-icons" aria-hidden="true">more_vert</i>
49
62
  </a>
50
- <ul class="dropdown-menu dropdown-menu-right">
51
- <li @click="setPageLength(10)">
52
- <a href="javascript:void(0)">10</a>
53
- </li>
54
- <li @click="setPageLength(25)">
55
- <a href="javascript:void(0)">25</a>
56
- </li>
57
- <li @click="setPageLength(50)">
58
- <a href="javascript:void(0)">50</a>
59
- </li>
60
- <li @click="setPageLength(100)">
61
- <a href="javascript:void(0)">100</a>
63
+ <ul v-if="showPageDropdown" class="vdt-page-menu">
64
+ <li v-for="length in [10, 25, 50, 100]" :key="length">
65
+ <a
66
+ href="#"
67
+ :aria-current="columnSettings.length === length ? 'true' : undefined"
68
+ @click.prevent="setPageLength(length)"
69
+ >{{ length }}</a>
62
70
  </li>
63
71
  </ul>
64
72
  </li>
65
73
  </ul>
66
74
  </template>
67
75
  </header>
68
- <div class="card-body">
76
+ <div class="vdt-body">
69
77
  <slot name="default"></slot>
70
- <div v-if="advancedSearch" class="toolbar" :class="{ open: searchBarOpen }">
78
+ <div v-if="advancedSearch" class="vdt-toolbar" :class="{ open: searchBarOpen }">
71
79
  <form @submit.prevent="setAdvancedSearchFilters">
72
80
  <template
73
81
  v-for="(column, index) in columns"
74
82
  :key="index"
75
83
  >
76
- <span v-if="column.searchable !== false" class="bmd-form-group">
84
+ <span v-if="column.searchable !== false" class="vdt-filter">
77
85
  <input
78
86
  :name="column.name"
79
- class="form-control advanced-filter-input"
87
+ class="vdt-input advanced-filter-input"
88
+ :aria-label="column.displayName"
80
89
  :placeholder="column.displayName" autocomplete="off"
81
90
  />
82
91
  </span>
83
92
  </template>
84
- <button type="submit" class="btn btn-primary">{{ t('search') }}</button>
93
+ <button type="submit" class="vdt-button vdt-button-accent">{{ t('search') }}</button>
85
94
  </form>
86
95
  </div>
87
- <div class="table-responsive">
88
- <div class="dataTables_wrapper no-footer">
89
- <table class="table data-table dataTable no-footer" :class="{'table-hover' : clickableRows}">
90
- <thead>
91
- <tr>
92
- <th v-if="selectableRows">
93
- <input type="checkbox" @click="selectAllRows" ref="selectAllRows">
96
+ <div class="vdt-table-scroll">
97
+ <table class="vdt-table" :class="{ 'vdt-table-clickable': clickableRows }">
98
+ <thead>
99
+ <tr>
100
+ <th v-if="selectableRows">
101
+ <input type="checkbox" @click="selectAllRows" ref="selectAllRows">
102
+ </th>
103
+ <template v-for="(column, index) in columns" :key="index">
104
+ <th v-if="column.visible !== false"
105
+ :class="[columnSortingClasses[index], column.sortable !== false ? 'vdt-sortable' : '']"
106
+ @click="setSorting(index)"
107
+ :style="column.width ? { width: column.width } : {}"
108
+ >
109
+ {{ column.displayName }}
94
110
  </th>
95
- <template v-for="(column, index) in columns" :key="index">
96
- <th v-if="column.visible !== false"
97
- :class="[columnSortingClasses[index], column.sortable !== false ? 'sorting' : '']"
98
- @click="setSorting(index)"
99
- :style="column.width ? { width: column.width } : {}"
100
- >
101
- {{ column.displayName }}
102
- </th>
103
- </template>
104
- <th v-if="actions?.length" class="w-25">{{ t('actions') }}</th>
105
- </tr>
106
- </thead>
107
- <tbody>
108
- <tr
109
- v-for="(row, index) in rows"
110
- :key="index"
111
- @click="clickableRows ? $emit('row-click', row) : null"
112
- >
113
- <td v-if="selectableRows">
114
- <input
115
- type="checkbox"
116
- :value="row.id"
117
- v-model="selectedRows"
111
+ </template>
112
+ <th v-if="actions?.length" class="vdt-actions-column">{{ t('actions') }}</th>
113
+ </tr>
114
+ </thead>
115
+ <tbody>
116
+ <tr
117
+ v-for="(row, index) in rows"
118
+ :key="index"
119
+ @click="clickableRows ? $emit('row-click', row) : null"
120
+ >
121
+ <td v-if="selectableRows">
122
+ <input
123
+ type="checkbox"
124
+ :value="row.id"
125
+ v-model="selectedRows"
126
+ @click.stop
127
+ >
128
+ </td>
129
+ <template v-for="(column, index) in columns" :key="index">
130
+ <td
131
+ v-if="column.visible !== false"
132
+ :class="getCellClasses(column, row)"
133
+ >
134
+ <template v-if="column.render">
135
+ <span v-html="column.render(row)"></span>
136
+ </template>
137
+ <Link
138
+ v-else-if="column.link && hyperlinkStyle === 'Link'"
139
+ :href="column.link(row)"
118
140
  @click.stop
119
141
  >
120
- </td>
121
- <template v-for="(column, index) in columns" :key="index">
122
- <td
123
- v-if="column.visible !== false"
124
- :class="getCellClasses(column, row)"
142
+ {{row[column.data]}}
143
+ </Link>
144
+ <a
145
+ v-else-if="column.link && hyperlinkStyle === 'a'"
146
+ :href="column.link(row)"
147
+ @click.stop
125
148
  >
126
- <template v-if="column.render">
127
- <span v-html="column.render(row)"></span>
128
- </template>
129
- <Link
130
- v-else-if="column.link && hyperlinkStyle === 'Link'"
131
- :href="column.link(row)"
132
- @click.stop
133
- >
149
+ {{row[column.data]}}
150
+ </a>
151
+ <template v-else>
152
+ <span>
134
153
  {{row[column.data]}}
135
- </Link>
136
- <a
137
- v-else-if="column.link && hyperlinkStyle === 'a'"
138
- :href="column.link(row)"
139
- @click.stop
140
- >
141
- {{row[column.data]}}
142
- </a>
143
- <template v-else>
144
- <span>
145
- {{row[column.data]}}
146
- </span>
147
- </template>
148
- </td>
149
- </template>
150
- <td v-if="actions?.length">
151
- <button
152
- v-for="(action, index) in actions"
153
- :key="index"
154
- class="btn btn-sm"
155
- :class="action.class"
156
- @click.stop="handleEmit(action.emit, row)"
157
- >
158
- <i v-if="action.icon" class="material-icons">{{ action.icon }}</i> {{
159
- action.label
160
- }}
161
- </button>
154
+ </span>
155
+ </template>
162
156
  </td>
163
- </tr>
164
- </tbody>
165
- </table>
166
- <div class="d-flex justify-content-between align-items-center mt-3">
167
- <div class="dataTables_info">
168
- {{
169
- t('showingRecords', {
170
- first: firstRecord,
171
- last: lastRecord,
172
- filtered: recordsFiltered,
173
- })
174
- }}
175
- <span v-if="recordsFiltered != recordsTotal">
176
- ({{
177
- t('totalRecords', {
178
- total: recordsTotal,
179
- })
180
- }})
181
- </span>
182
- </div>
183
- <div class="dataTables_paginate paging_simple_numbers user-select-none"
184
- id="document-index-table_paginate">
185
- <a
186
- class="paginate_button first user-select-none"
187
- :class="{ disabled: columnSettings.start == 0 }"
188
- @click="setPage(1)"
189
- >{{ t('first') }}</a>
190
- <a class="paginate_button previous" :class="{ disabled: columnSettings.start == 0 }"
191
- @click="setPage(currentPage - 1)">{{ t('previous') }}</a>
192
-
193
- <span>
194
- <a
195
- v-for="(page, index) in pages"
157
+ </template>
158
+ <td v-if="actions?.length">
159
+ <button
160
+ v-for="(action, index) in actions"
196
161
  :key="index"
197
- class="paginate_button"
198
- :class="{ current: page == currentPage }"
199
- @click="setPage(page)"
200
- >{{ page }}</a>
201
- </span>
202
- <a class="paginate_button next" :class="{ disabled: columnSettings.start >= lastPageStart }"
203
- @click="setPage(currentPage + 1)">{{ t('next') }}</a>
204
- <a class="paginate_button last" :class="{ disabled: columnSettings.start >= lastPageStart }"
205
- @click="setPage(pageCount)">{{ t('last') }}</a>
206
- </div>
207
- </div>
162
+ type="button"
163
+ class="vdt-button"
164
+ :class="action.class"
165
+ @click.stop="handleEmit(action.emit, row)"
166
+ >
167
+ <i v-if="action.icon" class="material-icons">{{ action.icon }}</i> {{
168
+ action.label
169
+ }}
170
+ </button>
171
+ </td>
172
+ </tr>
173
+ </tbody>
174
+ </table>
175
+ </div>
176
+ <div class="vdt-footer">
177
+ <div class="vdt-info">
178
+ {{
179
+ t('showingRecords', {
180
+ first: firstRecord,
181
+ last: lastRecord,
182
+ filtered: recordsFiltered,
183
+ })
184
+ }}
185
+ <span v-if="recordsFiltered != recordsTotal">
186
+ ({{
187
+ t('totalRecords', {
188
+ total: recordsTotal,
189
+ })
190
+ }})
191
+ </span>
192
+ </div>
193
+ <div class="vdt-pagination">
194
+ <button type="button" :disabled="currentPage <= 1" @click="setPage(1)">
195
+ {{ t('first') }}
196
+ </button>
197
+ <button type="button" :disabled="currentPage <= 1" @click="setPage(currentPage - 1)">
198
+ {{ t('previous') }}
199
+ </button>
200
+ <button
201
+ v-for="page in pages"
202
+ :key="page"
203
+ type="button"
204
+ :aria-current="page === currentPage ? 'page' : undefined"
205
+ @click="setPage(page)"
206
+ >{{ page }}</button>
207
+ <button type="button" :disabled="currentPage >= pageCount" @click="setPage(currentPage + 1)">
208
+ {{ t('next') }}
209
+ </button>
210
+ <button type="button" :disabled="currentPage >= pageCount" @click="setPage(pageCount)">
211
+ {{ t('last') }}
212
+ </button>
208
213
  </div>
209
214
  </div>
210
215
  </div>
@@ -329,6 +334,7 @@ export default {
329
334
  data() {
330
335
  return {
331
336
  searchBarOpen: false,
337
+ showPageDropdown: false,
332
338
  rows: [],
333
339
  columnSettings: {},
334
340
  searchTerm: '',
@@ -384,7 +390,7 @@ export default {
384
390
  let sortDirection = '';
385
391
  for (let j = 0; j < this.columnSettings.order.length; j++) {
386
392
  if (this.columnSettings.order[j].column == i) {
387
- sortDirection = this.columnSettings.order[j].dir == 'asc' ? 'sorting_asc' : 'sorting_desc';
393
+ sortDirection = this.columnSettings.order[j].dir == 'asc' ? 'vdt-sort-ascending' : 'vdt-sort-descending';
388
394
  }
389
395
  }
390
396
  classes.push(sortDirection);
@@ -587,7 +593,21 @@ export default {
587
593
  },
588
594
  }
589
595
  },
596
+ closePageDropdown() {
597
+ if (!this.showPageDropdown) {
598
+ return;
599
+ }
600
+
601
+ this.showPageDropdown = false;
602
+ this.$refs.pageDropdownToggle?.focus();
603
+ },
604
+ handlePageDropdownOutsideClick(event) {
605
+ if (this.showPageDropdown && !this.$refs.pageDropdown?.contains(event.target)) {
606
+ this.showPageDropdown = false;
607
+ }
608
+ },
590
609
  setPageLength(length) {
610
+ this.closePageDropdown();
591
611
  this.columnSettings.length = length;
592
612
  this.columnSettings.start = 0;
593
613
  this.loadData();
@@ -704,325 +724,321 @@ export default {
704
724
  this.initColumnSettings();
705
725
  },
706
726
  mounted() {
727
+ document.addEventListener('click', this.handlePageDropdownOutsideClick);
707
728
  if (this.loadDataOnInit) {
708
729
  this.loadData();
709
730
  }
710
- }
711
-
731
+ },
732
+ beforeUnmount() {
733
+ document.removeEventListener('click', this.handlePageDropdownOutsideClick);
734
+ },
712
735
  }
713
736
  </script>
714
737
 
715
738
  <style scoped>
716
- .toolbar:not(.open) {
717
- display: none;
718
- }
719
-
720
- .card .card-heading {
721
- padding: 15px 20px;
739
+ .vue-datatable {
722
740
  position: relative;
723
- height: 65px;
741
+ isolation: isolate;
742
+ inline-size: 100%;
743
+ min-inline-size: 0;
744
+ margin-block: var(--vdt-margin-block, 1.875rem);
745
+ border: 1px solid var(--vdt-border, color-mix(in srgb, CanvasText 18%, transparent));
746
+ border-radius: var(--vdt-radius, 0.375rem);
747
+ background: var(--vdt-surface, Canvas);
748
+ color: var(--vdt-text, CanvasText);
749
+ box-shadow: var(--vdt-shadow, 0 1px 4px rgb(0 0 0 / 15%));
750
+ font-size: var(--vdt-font-size, 0.875rem);
751
+ text-align: start;
724
752
  }
725
753
 
726
- .card .card-search {
727
- position: absolute;
728
- top: 0;
729
- right: 0;
730
- margin: 0;
731
- padding: 0;
732
- height: 100%;
733
- z-index: 15;
734
- -webkit-transition: all 0.2s;
735
- -o-transition: all 0.2s;
736
- transition: all 0.2s;
737
- border: 0;
738
- box-shadow: none;
739
- width: 100%;
740
- display: none;
741
- background: #fff;
754
+ .vdt-header {
755
+ position: relative;
756
+ display: flex;
757
+ flex-wrap: wrap;
758
+ align-items: center;
759
+ gap: 0.75rem;
760
+ min-block-size: 4rem;
761
+ padding: var(--vdt-padding, 1rem);
742
762
  }
743
763
 
744
- .card .card-search .form-group {
745
- margin: 0;
746
- padding: 0;
747
- height: 65px;
764
+ .vdt-header-menu-open {
765
+ z-index: 2;
748
766
  }
749
767
 
750
- .card .card-search .search-icon-left {
751
- left: 15px;
752
- right: auto;
768
+ .vdt-header-icon {
769
+ display: grid;
770
+ flex: none;
771
+ place-items: center;
772
+ inline-size: 3.75rem;
773
+ block-size: 3.75rem;
774
+ margin-block-start: -2.5rem;
775
+ border-radius: var(--vdt-radius, 0.375rem);
776
+ background: var(--vdt-icon-surface, var(--vdt-accent, #9c27b0));
777
+ color: var(--vdt-accent-text, #fff);
753
778
  }
754
779
 
755
- .card .card-search .close-search,
756
- .card .card-search .search-icon-left {
757
- top: 50%;
758
- margin-top: -15px;
759
- line-height: 30px;
760
- margin-right: 10px;
761
- font-size: 25px;
762
- position: absolute;
763
- right: 15px;
764
- z-index: 99;
780
+ .vdt-header-error .vdt-header-icon {
781
+ background: var(--vdt-error-surface, #b42318);
765
782
  }
766
783
 
767
- .card .card-search .form-control {
768
- width: 100%;
769
- height: 100%;
770
- position: absolute;
771
- border: none;
772
- box-shadow: none;
773
- left: 0;
774
- top: 0;
784
+ .vdt-title {
775
785
  margin: 0;
776
- font-size: 15px;
777
- text-indent: 45px;
778
- background-color: #EEF5F9;
779
- background-image: none;
786
+ color: inherit;
787
+ font-size: 1.125rem;
788
+ font-weight: 500;
789
+ overflow-wrap: anywhere;
780
790
  }
781
791
 
782
- .card .card-search .close-search {
783
- right: 15px;
784
- left: auto;
792
+ .vdt-title-error {
793
+ color: var(--vdt-error-text, light-dark(#b42318, #ffb4ab));
785
794
  }
786
795
 
787
- .card .card-search .search-icon-left {
788
- top: 50%;
789
- margin-top: -15px;
790
- line-height: 30px;
791
- margin-right: 10px;
792
- font-size: 25px;
793
- position: absolute;
794
- right: 15px;
795
- z-index: 99;
796
- width: 30px;
796
+ .vdt-actions {
797
+ display: flex;
798
+ align-items: center;
799
+ gap: 0.375rem;
800
+ padding: 0;
801
+ margin: 0;
802
+ margin-inline-start: auto;
803
+ list-style: none;
797
804
  }
798
805
 
799
- .card .card-search.open {
800
- display: block;
806
+ .vdt-actions > li > a,
807
+ .vdt-search-close {
808
+ display: inline-grid;
809
+ place-items: center;
810
+ min-inline-size: 2rem;
811
+ min-block-size: 2rem;
812
+ border-radius: var(--vdt-radius, 0.375rem);
813
+ color: var(--vdt-link, LinkText);
814
+ text-decoration: none;
801
815
  }
802
816
 
803
- ul.card-actions.icons.right-top {
804
- right: 10px;
805
- top: 15px;
817
+ .vdt-actions > li > a:hover,
818
+ .vdt-search-close:hover {
819
+ background: var(--vdt-hover-surface, color-mix(in srgb, currentColor 12%, transparent));
806
820
  }
807
821
 
808
- .card-heading ul.card-actions.icons {
822
+ .vdt-search {
809
823
  position: absolute;
810
- list-style: none;
811
- padding: 0;
812
- margin: 0;
824
+ z-index: 3;
825
+ inset: 0;
826
+ display: none;
827
+ padding: 0.5rem var(--vdt-padding, 1rem);
828
+ border-radius: var(--vdt-radius, 0.375rem);
829
+ background: var(--vdt-search-surface, var(--vdt-surface, Canvas));
830
+ color: var(--vdt-search-text, var(--vdt-text, CanvasText));
813
831
  }
814
832
 
815
- ul.card-actions.icons li {
816
- display: inline;
833
+ .vdt-search.open,
834
+ .vdt-search-field {
835
+ display: flex;
836
+ align-items: center;
837
+ gap: 0.5rem;
817
838
  }
818
839
 
819
- .dataTables_wrapper .dataTables_paginate .paginate_button.current,
820
- .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
821
- background: unset;
822
- background-color: #00bcd4;
823
- border-color: #00bcd4;
824
- box-shadow: 0 4px 5px 0 rgba(0, 188, 212, 0.14), 0 1px 10px 0 rgba(0, 188, 212, 0.12), 0 2px 4px -1px rgba(0, 188, 212, 0.2);
840
+ .vdt-search-field {
841
+ inline-size: 100%;
825
842
  }
826
843
 
827
- .dataTables_wrapper .dataTables_paginate .paginate_button,
828
- .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
829
- background: unset;
830
- border: 0;
831
- border-color: #00bcd4;
832
- border-radius: 30px !important;
833
- -webkit-transition: all .3s;
834
- transition: all .3s;
835
- padding: 0px 11px;
836
- margin: 0 3px;
837
- min-width: 30px;
838
- height: 30px;
839
- line-height: 30px;
840
- color: #999999 !important;
841
- font-weight: 400;
842
- font-size: 12px;
843
- text-transform: uppercase;
844
- background: transparent;
845
- text-align: center;
844
+ .vdt-search-icon,
845
+ .vdt-search-close {
846
+ flex: none;
846
847
  }
847
848
 
848
- .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
849
- border: 1;
849
+ .vdt-input {
850
+ min-inline-size: 0;
851
+ padding: 0.5rem 0.625rem;
852
+ border: 1px solid var(--vdt-border, color-mix(in srgb, CanvasText 18%, transparent));
853
+ border-radius: var(--vdt-radius, 0.375rem);
854
+ background: var(--vdt-surface, Canvas);
855
+ color: var(--vdt-text, CanvasText);
856
+ font: inherit;
850
857
  }
851
858
 
852
- .card-header:first-child {
853
- border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;
859
+ .vdt-input::placeholder {
860
+ color: var(--vdt-muted-text, GrayText);
854
861
  }
855
862
 
856
- .card .card-header {
857
- border-bottom: none;
863
+ .vdt-search .vdt-input {
864
+ flex: 1;
858
865
  background: transparent;
866
+ color: inherit;
859
867
  }
860
868
 
861
- .card [class*=card-header-],
862
- .card[class*=bg-] {
863
- color: #ffffff;
869
+ .vdt-body {
870
+ padding: 0 var(--vdt-padding, 1rem) var(--vdt-padding, 1rem);
864
871
  }
865
872
 
866
- .card .card-header {
867
- z-index: 0 !important;
873
+ .vdt-toolbar {
874
+ margin-block-end: 0.75rem;
868
875
  }
869
876
 
870
- .card [class*=card-header-] {
871
- margin: 0px 15px 0;
872
- padding: 0;
873
- position: relative;
877
+ .vdt-toolbar:not(.open) {
878
+ display: none;
874
879
  }
875
880
 
876
- .card [class*=card-header-] .card-icon,
877
- .card [class*=card-header-] .card-text {
878
- border-radius: 3px;
879
- background-color: #999999;
880
- padding: 15px;
881
- margin-top: -20px;
882
- margin-right: 15px;
883
- float: left;
881
+ .vdt-toolbar form {
882
+ display: flex;
883
+ flex-wrap: wrap;
884
+ align-items: center;
885
+ gap: 0.5rem;
886
+ margin: 0;
884
887
  }
885
888
 
886
- .card .card-header.card-header-icon i,
887
- .card .card-header.card-header-text i {
888
- width: 33px;
889
- height: 33px;
890
- text-align: center;
891
- line-height: 33px;
889
+ .vdt-filter,
890
+ .vdt-filter .vdt-input {
891
+ min-inline-size: 0;
892
+ max-inline-size: 100%;
892
893
  }
893
894
 
894
- .card {
895
- border: 0;
896
- margin-bottom: 30px;
897
- margin-top: 30px;
898
- border-radius: 6px;
899
- color: #333333;
900
- background: #ffffff;
901
- width: 100%;
902
- box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
903
- box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.14);
904
- font-size: 0.875rem;
895
+ .vdt-table-scroll {
896
+ overflow-x: auto;
905
897
  }
906
898
 
907
- .card .card-header.card-header-icon .card-title,
908
- .card .card-header.card-header-text .card-title {
909
- margin-top: 15px;
910
- color: #3C4858;
899
+ .vdt-table {
900
+ inline-size: 100%;
901
+ border-collapse: collapse;
902
+ color: inherit;
911
903
  }
912
904
 
913
- .card .card-header.card-header-icon h4,
914
- .card .card-header.card-header-text h4 {
915
- font-weight: 300;
905
+ .vdt-table :is(th, td) {
906
+ padding: var(--vdt-cell-padding, 0.625rem 0.5rem);
907
+ border-block-end: 1px solid var(--vdt-border, color-mix(in srgb, CanvasText 18%, transparent));
908
+ text-align: inherit;
909
+ vertical-align: middle;
916
910
  }
917
911
 
918
- .card .card-header .card-title {
919
- margin-bottom: 3px;
912
+ .vdt-table th {
913
+ font-weight: 600;
920
914
  }
921
915
 
922
- .card .card-actions {
923
- position: absolute;
924
- z-index: 1;
925
- top: -50px;
926
- width: calc(100% - 30px);
927
- left: 17px;
928
- right: 17px;
929
- text-align: center;
916
+ .vdt-table .vdt-sortable {
917
+ cursor: pointer;
930
918
  }
931
919
 
932
- .card .card-actions {
933
- text-align: end;
920
+ .vdt-sortable::after {
921
+ content: '↕';
922
+ margin-inline-start: 0.375rem;
923
+ color: var(--vdt-muted-text, GrayText);
934
924
  }
935
925
 
936
- .card ul.card-actions.icons {
937
- position: absolute;
938
- list-style: none;
939
- padding: 0;
940
- margin: 0;
941
- right: 10px;
942
- top: 15px;
926
+ .vdt-sortable.vdt-sort-ascending::after { content: '↑'; }
927
+ .vdt-sortable.vdt-sort-descending::after { content: '↓'; }
928
+
929
+ .vdt-table-clickable tbody tr {
930
+ cursor: pointer;
943
931
  }
944
932
 
945
- ul.card-actions.icons.right-top {
946
- right: 10px;
947
- top: 15px;
933
+ .vdt-table-clickable tbody tr:hover {
934
+ background: var(--vdt-hover-surface, color-mix(in srgb, currentColor 8%, transparent));
948
935
  }
949
936
 
950
- ul.card-actions.icons li {
951
- display: inline;
952
- width: 100%;
953
- text-align: unset;
937
+ .vdt-table a {
938
+ color: var(--vdt-link, LinkText);
954
939
  }
955
940
 
956
- ul.card-actions.icons li {
957
- display: inline;
958
- width: 100%;
959
- text-align: unset;
941
+ .vdt-actions-column {
942
+ inline-size: 25%;
960
943
  }
961
944
 
962
- .dropdown-menu .dropdown-item,
963
- .dropdown-menu li>a {
964
- position: relative;
965
- width: auto;
945
+ .vdt-footer {
966
946
  display: flex;
967
- flex-flow: nowrap;
947
+ flex-wrap: wrap;
968
948
  align-items: center;
969
- color: #333;
970
- font-weight: normal;
971
- text-decoration: none;
972
- font-size: 0.8125rem;
973
- border-radius: 0.125rem;
974
- margin: 0 0.3125rem;
975
- transition: all 150ms linear;
976
- min-width: 7rem;
977
- padding: 0.625rem 1.25rem;
978
- overflow: hidden;
979
- line-height: 1.42857143;
980
- text-overflow: ellipsis;
981
- word-wrap: break-word;
949
+ justify-content: space-between;
950
+ gap: 0.625rem;
951
+ margin-block-start: 0.75rem;
952
+ }
953
+
954
+ .vdt-info {
955
+ color: var(--vdt-muted-text, GrayText);
956
+ }
957
+
958
+ .vdt-pagination {
959
+ display: flex;
960
+ flex-wrap: wrap;
961
+ gap: 0.25rem;
982
962
  }
983
963
 
984
- .dropdown-menu .dropdown-item,
985
- .dropdown-menu li>a {
986
- padding-right: 1.5rem;
987
- padding-left: 1.5rem;
964
+ .vdt-button,
965
+ .vdt-pagination button {
966
+ min-block-size: 2rem;
967
+ padding: 0.25rem 0.625rem;
968
+ border: 0;
969
+ border-radius: var(--vdt-radius, 0.375rem);
970
+ background: transparent;
971
+ color: inherit;
972
+ font: inherit;
973
+ cursor: pointer;
988
974
  }
989
975
 
990
- .dropdown-menu {
976
+ .vdt-button {
977
+ border: 1px solid var(--vdt-border, color-mix(in srgb, CanvasText 18%, transparent));
978
+ }
979
+
980
+ .vdt-pagination button {
981
+ min-inline-size: 2rem;
982
+ border-radius: 999px;
983
+ font-size: 0.75rem;
984
+ text-transform: uppercase;
985
+ }
986
+
987
+ .vdt-pagination button:disabled {
988
+ color: var(--vdt-muted-text, GrayText);
989
+ cursor: default;
990
+ opacity: 0.65;
991
+ }
992
+
993
+ .vdt-pagination button:hover:not(:disabled),
994
+ .vdt-button:hover:not(:disabled) {
995
+ background: var(--vdt-hover-surface, color-mix(in srgb, currentColor 12%, transparent));
996
+ }
997
+
998
+ .vdt-button-accent,
999
+ .vdt-button-accent:hover:not(:disabled),
1000
+ .vdt-pagination button[aria-current="page"],
1001
+ .vdt-pagination button[aria-current="page"]:hover {
1002
+ background: var(--vdt-accent, #9c27b0);
1003
+ color: var(--vdt-accent-text, #fff);
1004
+ }
1005
+
1006
+ .vdt-page-dropdown {
1007
+ position: relative;
1008
+ }
1009
+
1010
+ .vdt-page-menu {
991
1011
  position: absolute;
992
- top: 100%;
993
- left: 0;
994
- z-index: 1000;
995
- display: none;
996
- float: left;
997
- min-width: 10rem;
998
- padding: 0.5rem 0;
999
- margin: 0.125rem 0 0;
1000
- font-size: 1rem;
1001
- color: #212529;
1002
- text-align: left;
1012
+ inset-block-start: 100%;
1013
+ inset-inline-end: 0;
1014
+ min-inline-size: 10rem;
1015
+ padding: 0.3125rem;
1016
+ margin: 0;
1017
+ border: 1px solid var(--vdt-border, color-mix(in srgb, CanvasText 18%, transparent));
1018
+ border-radius: var(--vdt-radius, 0.375rem);
1019
+ background: var(--vdt-menu-surface, var(--vdt-surface, Canvas));
1020
+ color: var(--vdt-menu-text, var(--vdt-text, CanvasText));
1021
+ box-shadow: var(--vdt-shadow, 0 1px 4px rgb(0 0 0 / 15%));
1003
1022
  list-style: none;
1004
- background-color: #ffffff;
1005
- background-clip: padding-box;
1006
- border: 1px solid rgba(0, 0, 0, 0.15);
1007
- border-radius: 0.25rem;
1008
- box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
1009
1023
  }
1010
1024
 
1011
- .dropdown-menu {
1012
- border: 0;
1013
- display: none;
1014
- padding: 0.3125rem 0;
1015
- transform: scale(0);
1016
- transform-origin: 0 0;
1017
- will-change: transform, opacity;
1018
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
1025
+ .vdt-page-menu a {
1026
+ display: block;
1027
+ padding: 0.625rem 1.25rem;
1028
+ border-radius: var(--vdt-radius, 0.375rem);
1029
+ color: inherit;
1030
+ text-decoration: none;
1019
1031
  }
1020
1032
 
1021
- .dropdown-menu {
1022
- margin: 0 !important;
1033
+ .vdt-page-menu a:hover,
1034
+ .vdt-page-menu a:focus-visible,
1035
+ .vdt-page-menu a[aria-current="true"] {
1036
+ background: var(--datatable-page-option-active-bg, var(--vdt-accent, #9c27b0));
1037
+ color: var(--datatable-page-option-active-color, var(--vdt-accent-text, #fff));
1023
1038
  }
1024
1039
 
1025
- .clickable-rows tbody tr {
1026
- cursor: pointer;
1040
+ .vue-datatable :is(a, button, input):focus-visible {
1041
+ outline: 2px solid var(--vdt-focus, Highlight);
1042
+ outline-offset: 2px;
1027
1043
  }
1028
1044
  </style>