@nuralyui/table 0.0.9 → 0.0.11
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/bundle.js +942 -7
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/react.js.map +1 -1
- package/table.component.d.ts +5 -1
- package/table.component.js +50 -7
- package/table.component.js.map +1 -1
- package/table.style.js +16 -4
- package/table.style.js.map +1 -1
- package/table.types.d.ts +18 -0
- package/table.types.js.map +1 -1
package/bundle.js
CHANGED
|
@@ -1,4 +1,689 @@
|
|
|
1
|
-
import{css as t,html as e,nothing as i,LitElement as n}from"lit";import{property as r,state as a,query as o,customElement as l}from"lit/decorators.js";import{NuralyUIBaseMixin as s}from"@nuralyui/common/mixins";import{repeat as c}from"lit/directives/repeat.js";import{choose as d}from"lit/directives/choose.js";var h=t`:host{display:block;width:100%;font-family:var(--nuraly-font-family,Arial,sans-serif);color:var(--nuraly-color-text);background-color:var(--nuraly-color-background)}.filter-container{display:flex;justify-content:flex-end;width:100%;padding:var(--nuraly-spacing-2,.5rem) 0;position:relative;margin-bottom:5px}.filter-container input{padding:5px;padding-left:30px;width:100%;box-sizing:border-box;background-color:var(--nuraly-table-filter-background,#fff);color:var(--nuraly-table-filter-text,#000)}.filter-container input:focus{outline-style:none;border:1px solid var(--nuraly-table-filter-border,#1890ff)}.filter-container .icon-container{height:25px;width:35px;cursor:pointer;display:flex;justify-content:center;align-items:center}.filter-container .search-icon{position:absolute;left:10px;top:25%}.actions-container{background-color:var(--nuraly-table-action-color,#0f62fe);padding:10px;box-sizing:border-box;display:flex;justify-content:space-between;color:var(--nuraly-table-background,#fff)}.table-content-wrapper.fixed-header{overflow-y:auto;overflow-x:auto}.table-content-wrapper.fixed-header table{border-collapse:separate;border-spacing:0}.table-content-wrapper.fixed-header thead{background-color:var(--nuraly-table-header-background,#fafafa)}.table-content-wrapper.fixed-header thead th{position:sticky;top:0;z-index:10;background-color:var(--nuraly-table-header-background,#fafafa);border-bottom:var(--nuraly-table-border-width,1px) solid var(--nuraly-table-row-border-color,#f0f0f0)}.table-content-wrapper.fixed-header thead tr{box-shadow:0 1px 0 0 var(--nuraly-table-row-border-color,#f0f0f0)}.actions-container button{cursor:pointer;border:none;color:var(--nuraly-table-background,#fff);background-color:var(--nuraly-table-action-color,#0f62fe)}.actions-container[data-size=small]{padding:5px}.actions-container[data-size=large]{padding:15px}.table-content-wrapper{display:block;overflow:auto}input[type=checkbox][data-indeterminate=true]::after{width:13px;height:13px;background-color:var(--nuraly-table-checkbox-checked,#161616);color:var(--nuraly-table-background,#fff);display:flex;justify-content:center;align-items:center;content:'-'}table{width:100%;border-spacing:0;color:var(--nuraly-table-text-color)}td{text-align:center;border-bottom:var(--nuraly-table-border-width,1px) solid var(--nuraly-table-row-border-color,#f0f0f0);padding:10px}th{cursor:pointer;padding:10px}th span{display:flex;justify-content:center;gap:10px}nr-icon{display:flex;justify-content:center;align-items:center;--nuraly-icon-color:var(--nuraly-table-text-color)}tbody tr{background-color:var(--nuraly-table-row-background,#fff)}tbody tr:hover{background-color:var(--nuraly-table-row-hover-background,#f5f5f5)}thead tr{background-color:var(--nuraly-table-header-background,#fafafa)}tbody tr:has(input:checked){background-color:var(--nuraly-table-row-selected-background,#e6f7ff)}.expand-icon,input{cursor:pointer;accent-color:var(--nuraly-table-checkbox-checked,#1890ff)}:host([size=small]) td,:host([size=small]) th{padding:5px}:host([size=large]) td,:host([size=large]) th{padding:15px}.pagination-container{display:flex;justify-content:space-between;align-items:center;background-color:var(--nuraly-pagination-background-color);color:var(--nuraly-pagination-text-color)}.pagination-container .left-content{display:flex;align-items:center}.pagination-container .left-content .items-details{border-left:var(--nuraly-pagination-borders);padding:10px}.pagination-container .left-content .select-details{display:flex;align-items:center;gap:8px;padding:10px}.pagination-container .left-content .select-details label{font-size:var(--nuraly-font-size-input,14px);color:var(--nuraly-table-pagination-text,#000);white-space:nowrap}.pagination-container .left-content .select-details nr-select{min-width:60px;max-width:80px;--select-border-color:var(--nuraly-table-border-color, #d9d9d9);--select-background:var(--nuraly-table-pagination-background, #fafafa);--select-text-color:var(--nuraly-table-pagination-text, #000000)}.pagination-container .right-content{display:flex;align-items:center;border-left:var(--nuraly-pagination-borders)}.pagination-container .right-content .icon-container{display:flex;align-items:center;border-left:var(--nuraly-pagination-borders)}.pagination-container .right-content .page-details{padding:10px}.pagination-container .icon-container .left-arrow,.pagination-container .icon-container .right-arrow{padding:10px;--nuraly-icon-color:var(--nuraly-pagination-text-color)}.pagination-container .icon-container .left-arrow{border-right:var(--nuraly-pagination-borders)}.pagination-container nr-icon[data-enabled=false]{cursor:not-allowed}.pagination-container nr-icon[data-enabled=true]{cursor:pointer}.pagination-container[data-size=small] .left-content .items-details{padding:5px}.pagination-container[data-size=large] .left-content .items-details{padding:15px}.pagination-container[data-size=small] .left-content .select-details{padding:5px;gap:6px}.pagination-container[data-size=large] .left-content .select-details{padding:15px;gap:10px}.pagination-container[data-size=small] .right-content .page-details{padding:5px}.pagination-container[data-size=large] .right-content .page-details{padding:15px}.pagination-container[data-size=small] .icon-container .left-arrow,.pagination-container[data-size=small] .icon-container .right-arrow{padding:5px}.pagination-container[data-size=large] .icon-container .left-arrow,.pagination-container[data-size=large] .icon-container .right-arrow{padding:15px}th .th-content{display:flex;align-items:center;justify-content:space-between;gap:8px;position:relative}th .th-text{display:flex;align-items:center;gap:10px;flex:1}th .filter-wrapper{position:relative;display:flex;align-items:center}.filter-trigger{background:0 0;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s}.filter-trigger:hover{background-color:var(--nuraly-table-filter-hover,rgba(0,0,0,.04))}.filter-icon{position:relative;display:flex;align-items:center;justify-content:center}.filter-icon.has-filter{color:var(--nuraly-table-filter-active,#1890ff)}.filter-indicator{position:absolute;top:-2px;right:-2px;width:6px;height:6px;border-radius:50%;background-color:var(--nuraly-table-filter-active,#1890ff)}.column-filter-dropdown{position:absolute;top:calc(100% + 4px);right:0;background:var(--nuraly-table-background,#fff);border:1px solid var(--nuraly-table-row-border-color,#f0f0f0);border-radius:4px;box-shadow:0 2px 8px rgba(0,0,0,.15);z-index:100;min-width:200px;padding:8px}.column-filter-content{display:flex;flex-direction:column;gap:8px}.column-filter-input{padding:8px;border:1px solid var(--nuraly-table-row-border-color,#d9d9d9);border-radius:4px;font-size:14px;width:100%;box-sizing:border-box}.column-filter-input:focus{outline:0;border-color:var(--nuraly-table-filter-active,#1890ff);box-shadow:0 0 0 2px rgba(24,144,255,.2)}.column-filter-clear{background:0 0;border:none;cursor:pointer;padding:4px;display:flex;align-items:center;justify-content:center;color:var(--nuraly-table-text-color,#000);align-self:flex-end}.column-filter-clear:hover{color:var(--nuraly-table-filter-active,#1890ff)}td.fixed-column,th.fixed-column{position:sticky;background-color:var(--nuraly-table-row-background,#fff)}thead th.fixed-column{z-index:20;background-color:var(--nuraly-table-header-background,#fafafa)}.table-content-wrapper.fixed-header thead th.fixed-column{z-index:25;background-color:var(--nuraly-table-header-background,#fafafa)}tbody td.fixed-column{z-index:8;background-color:var(--nuraly-table-row-background,#fff)}tbody tr td.fixed-column{background-color:var(--nuraly-table-row-background,#fff)}tbody tr:hover td.fixed-column{background-color:var(--nuraly-table-row-hover-background,#f5f5f5)}td.fixed-column-left,th.fixed-column-left{left:0;border-right:1px solid var(--nuraly-table-row-border-color,#f0f0f0)}td.fixed-column-right,th.fixed-column-right{right:0;border-left:1px solid var(--nuraly-table-row-border-color,#f0f0f0)}td.fixed-column-left::after,th.fixed-column-left::after{content:'';position:absolute;top:0;right:-10px;bottom:0;width:10px;pointer-events:none;transition:box-shadow .3s;box-shadow:none}.table-content-wrapper.has-scroll td.fixed-column-left::after,.table-content-wrapper.has-scroll th.fixed-column-left::after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.15)}td.fixed-column-right::before,th.fixed-column-right::before{content:'';position:absolute;top:0;left:-10px;bottom:0;width:10px;pointer-events:none;transition:box-shadow .3s;box-shadow:none}.table-content-wrapper.has-scroll td.fixed-column-right::before,.table-content-wrapper.has-scroll th.fixed-column-right::before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.15)}.skeleton-row{animation:skeleton-pulse 1.5s ease-in-out infinite}.skeleton-cell{padding:var(--nuraly-spacing-3,.75rem) var(--nuraly-spacing-4,1rem);border-bottom:1px solid var(--nuraly-table-border-color,#f0f0f0)}.skeleton-cell.selection-skeleton{width:48px;text-align:center}.skeleton-checkbox{width:16px;height:16px;background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);background-size:200% 100%;animation:skeleton-shimmer 1.5s ease-in-out infinite;border-radius:2px;margin:0 auto}.skeleton-content{height:16px;background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);background-size:200% 100%;animation:skeleton-shimmer 1.5s ease-in-out infinite;border-radius:4px;width:80%}@keyframes skeleton-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}@keyframes skeleton-pulse{0%,100%{opacity:1}50%{opacity:.6}}.loading-row{background-color:var(--nuraly-table-row-background,#fff)}.loading-cell{padding:var(--nuraly-spacing-8,2rem) var(--nuraly-spacing-4,1rem);text-align:center;border-bottom:1px solid var(--nuraly-table-border-color,#f0f0f0)}.loading-spinner-container{display:flex;flex-direction:column;align-items:center;gap:var(--nuraly-spacing-4,1rem)}.loading-spinner{width:40px;height:40px;border:4px solid var(--nuraly-table-border-color,#f0f0f0);border-top-color:var(--nuraly-color-primary,#1890ff);border-radius:50%;animation:spinner-rotate .8s linear infinite}@keyframes spinner-rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.loading-text{margin:0;color:var(--nuraly-color-text-secondary,#666);font-size:14px}.empty-row{background:var(--nuraly-table-row-bg-color,#fff)}.empty-row:hover{background:var(--nuraly-table-row-bg-color,#fff)}.empty-cell{padding:64px 24px;text-align:center;border-bottom:1px solid var(--nuraly-table-border-color,#f0f0f0)}.empty-state{display:flex;flex-direction:column;align-items:center;gap:16px}.empty-icon{width:64px;height:64px;color:var(--nuraly-color-text-quaternary,#bfbfbf);display:flex;align-items:center;justify-content:center}.empty-icon svg{width:100%;height:100%}.empty-icon nr-icon{font-size:64px}.empty-text{margin:0;color:var(--nuraly-color-text-secondary,#666);font-size:14px;line-height:1.5}.expand-icon{text-align:center;vertical-align:middle;transition:transform .3s ease;outline:0}.expand-icon:hover{background-color:var(--nuraly-color-fill-tertiary,#f5f5f5)}.expand-icon:focus{background-color:var(--nuraly-color-fill-tertiary,#f5f5f5);box-shadow:inset 0 0 0 2px var(--nuraly-color-primary,#1890ff)}.expand-icon nr-icon{transition:transform .3s ease}.expand-icon.expanded nr-icon{transform:rotate(180deg)}.expansion-row{transition:all .3s ease}.expansion-row.collapsed{opacity:0;height:0;overflow:hidden}.expansion-row.expanded{opacity:1;animation:slideDown .3s ease}.expansion-content{padding:16px;background-color:var(--nuraly-color-fill-quaternary,#fafafa);border-top:1px solid var(--nuraly-color-border,#d9d9d9)}@keyframes slideDown{from{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}`;
|
|
1
|
+
import{css as t,html as e,nothing as n,LitElement as i}from"lit";import{property as r,state as a,query as o,customElement as l}from"lit/decorators.js";import{NuralyUIBaseMixin as s}from"@nuralyui/common/mixins";import{repeat as c}from"lit/directives/repeat.js";import{choose as d}from"lit/directives/choose.js";var h=t`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
width: 100%;
|
|
5
|
+
font-family: var(--nuraly-font-family, Arial, sans-serif);
|
|
6
|
+
color: var(--nuraly-color-text);
|
|
7
|
+
background-color: var(--nuraly-color-background);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Filter Container Styles */
|
|
11
|
+
.filter-container {
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
width: 100%;
|
|
15
|
+
padding: var(--nuraly-spacing-2, 0.5rem) 0;
|
|
16
|
+
position: relative;
|
|
17
|
+
margin-bottom: 5px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.filter-container input {
|
|
21
|
+
padding: 5px;
|
|
22
|
+
padding-left: 30px;
|
|
23
|
+
width: 100%;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
background-color: var(--nuraly-table-filter-background, #ffffff);
|
|
26
|
+
color: var(--nuraly-table-filter-text, #000000);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.filter-container input:focus {
|
|
30
|
+
outline-style: none;
|
|
31
|
+
border: 1px solid var(--nuraly-table-filter-border, #1890ff);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.filter-container .icon-container {
|
|
35
|
+
height: 25px;
|
|
36
|
+
width: 35px;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.filter-container .search-icon {
|
|
44
|
+
position: absolute;
|
|
45
|
+
left: 10px;
|
|
46
|
+
top: 25%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Actions Bar Styles */
|
|
50
|
+
.actions-container {
|
|
51
|
+
background-color: var(--nuraly-table-action-color, #0f62fe);
|
|
52
|
+
padding: 10px;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-between;
|
|
56
|
+
color: var(--nuraly-table-background, #ffffff);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Fixed Header Styles */
|
|
60
|
+
.table-content-wrapper.fixed-header {
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
overflow-x: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.table-content-wrapper.fixed-header table {
|
|
66
|
+
border-collapse: separate;
|
|
67
|
+
border-spacing: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.table-content-wrapper.fixed-header thead {
|
|
71
|
+
background-color: var(--nuraly-table-header-background, #fafafa);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.table-content-wrapper.fixed-header thead th {
|
|
75
|
+
position: sticky;
|
|
76
|
+
top: 0;
|
|
77
|
+
z-index: 10;
|
|
78
|
+
background-color: var(--nuraly-table-header-background, #fafafa);
|
|
79
|
+
border-bottom: var(--nuraly-table-border-width, 1px) solid var(--nuraly-table-row-border-color, #f0f0f0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.table-content-wrapper.fixed-header thead tr {
|
|
83
|
+
box-shadow: 0 1px 0 0 var(--nuraly-table-row-border-color, #f0f0f0);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.actions-container button {
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
border: none;
|
|
89
|
+
color: var(--nuraly-table-background, #ffffff);
|
|
90
|
+
background-color: var(--nuraly-table-action-color, #0f62fe);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.actions-container[data-size='small'] {
|
|
94
|
+
padding: 5px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.actions-container[data-size='large'] {
|
|
98
|
+
padding: 15px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Table Content Wrapper Styles */
|
|
102
|
+
.table-content-wrapper {
|
|
103
|
+
display: block;
|
|
104
|
+
overflow: auto;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
input[type='checkbox'][data-indeterminate='true']::after {
|
|
108
|
+
width: 13px;
|
|
109
|
+
height: 13px;
|
|
110
|
+
background-color: var(--nuraly-table-checkbox-checked, #161616);
|
|
111
|
+
color: var(--nuraly-table-background, #ffffff);
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
align-items: center;
|
|
115
|
+
content: '-';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Table Styles */
|
|
119
|
+
table {
|
|
120
|
+
width: 100%;
|
|
121
|
+
border-spacing: 0px;
|
|
122
|
+
color: var(--nuraly-table-text-color);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
td {
|
|
126
|
+
text-align: center;
|
|
127
|
+
border-bottom: var(--nuraly-table-border-width, 1px) solid var(--nuraly-table-row-border-color, #f0f0f0);
|
|
128
|
+
padding: 10px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
th {
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
padding: 10px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
th span {
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: center;
|
|
139
|
+
gap: 10px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
nr-icon {
|
|
143
|
+
display: flex;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
align-items: center;
|
|
146
|
+
--nuraly-icon-color: var(--nuraly-table-text-color);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
tbody tr {
|
|
150
|
+
background-color: var(--nuraly-table-row-background, #ffffff);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
tbody tr:hover {
|
|
154
|
+
background-color: var(--nuraly-table-row-hover-background, #f5f5f5);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
thead tr {
|
|
158
|
+
background-color: var(--nuraly-table-header-background, #fafafa);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
tbody tr:has(input:checked) {
|
|
162
|
+
background-color: var(--nuraly-table-row-selected-background, #e6f7ff);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
input,
|
|
166
|
+
.expand-icon {
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
accent-color: var(--nuraly-table-checkbox-checked, #1890ff);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Size Variants for Table Content */
|
|
172
|
+
:host([size='small']) td,
|
|
173
|
+
:host([size='small']) th {
|
|
174
|
+
padding: 5px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
:host([size='large']) td,
|
|
178
|
+
:host([size='large']) th {
|
|
179
|
+
padding: 15px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Pagination Styles */
|
|
183
|
+
.pagination-container {
|
|
184
|
+
display: flex;
|
|
185
|
+
justify-content: space-between;
|
|
186
|
+
align-items: center;
|
|
187
|
+
background-color: var(--nuraly-pagination-background-color);
|
|
188
|
+
color: var(--nuraly-pagination-text-color);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.pagination-container .left-content {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.pagination-container .left-content .items-details {
|
|
197
|
+
border-left: var(--nuraly-pagination-borders);
|
|
198
|
+
padding: 10px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.pagination-container .left-content .select-details {
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
gap: 8px;
|
|
205
|
+
padding: 10px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.pagination-container .left-content .select-details label {
|
|
209
|
+
font-size: var(--nuraly-font-size-input, 14px);
|
|
210
|
+
color: var(--nuraly-table-pagination-text, #000000);
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.pagination-container .left-content .select-details nr-select {
|
|
215
|
+
min-width: 60px;
|
|
216
|
+
max-width: 80px;
|
|
217
|
+
--select-border-color: var(--nuraly-table-border-color, #d9d9d9);
|
|
218
|
+
--select-background: var(--nuraly-table-pagination-background, #fafafa);
|
|
219
|
+
--select-text-color: var(--nuraly-table-pagination-text, #000000);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.pagination-container .right-content {
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
border-left: var(--nuraly-pagination-borders);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.pagination-container .right-content .icon-container {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
border-left: var(--nuraly-pagination-borders);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.pagination-container .right-content .page-details {
|
|
235
|
+
padding: 10px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.pagination-container .icon-container .left-arrow,
|
|
239
|
+
.pagination-container .icon-container .right-arrow {
|
|
240
|
+
padding: 10px;
|
|
241
|
+
--nuraly-icon-color: var(--nuraly-pagination-text-color);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.pagination-container .icon-container .left-arrow {
|
|
245
|
+
border-right: var(--nuraly-pagination-borders);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.pagination-container nr-icon[data-enabled='false'] {
|
|
249
|
+
cursor: not-allowed;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.pagination-container nr-icon[data-enabled='true'] {
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* Size Variants for Pagination */
|
|
257
|
+
.pagination-container[data-size='small'] .left-content .items-details {
|
|
258
|
+
padding: 5px;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.pagination-container[data-size='large'] .left-content .items-details {
|
|
262
|
+
padding: 15px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.pagination-container[data-size='small'] .left-content .select-details {
|
|
266
|
+
padding: 5px;
|
|
267
|
+
gap: 6px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.pagination-container[data-size='large'] .left-content .select-details {
|
|
271
|
+
padding: 15px;
|
|
272
|
+
gap: 10px;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.pagination-container[data-size='small'] .right-content .page-details {
|
|
276
|
+
padding: 5px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.pagination-container[data-size='large'] .right-content .page-details {
|
|
280
|
+
padding: 15px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.pagination-container[data-size='small'] .icon-container .left-arrow,
|
|
284
|
+
.pagination-container[data-size='small'] .icon-container .right-arrow {
|
|
285
|
+
padding: 5px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.pagination-container[data-size='large'] .icon-container .left-arrow,
|
|
289
|
+
.pagination-container[data-size='large'] .icon-container .right-arrow {
|
|
290
|
+
padding: 15px;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/* Column Filter Styles */
|
|
294
|
+
th .th-content {
|
|
295
|
+
display: flex;
|
|
296
|
+
align-items: center;
|
|
297
|
+
justify-content: space-between;
|
|
298
|
+
gap: 8px;
|
|
299
|
+
position: relative;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
th .th-text {
|
|
303
|
+
display: flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
gap: 10px;
|
|
306
|
+
flex: 1;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
th .filter-wrapper {
|
|
310
|
+
position: relative;
|
|
311
|
+
display: flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.filter-trigger {
|
|
316
|
+
background: transparent;
|
|
317
|
+
border: none;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
padding: 4px;
|
|
320
|
+
display: flex;
|
|
321
|
+
align-items: center;
|
|
322
|
+
justify-content: center;
|
|
323
|
+
border-radius: 4px;
|
|
324
|
+
transition: background-color 0.2s;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.filter-trigger:hover {
|
|
328
|
+
background-color: var(--nuraly-table-filter-hover, rgba(0, 0, 0, 0.04));
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.filter-icon {
|
|
332
|
+
position: relative;
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
justify-content: center;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.filter-icon.has-filter {
|
|
339
|
+
color: var(--nuraly-table-filter-active, #1890ff);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.filter-indicator {
|
|
343
|
+
position: absolute;
|
|
344
|
+
top: -2px;
|
|
345
|
+
right: -2px;
|
|
346
|
+
width: 6px;
|
|
347
|
+
height: 6px;
|
|
348
|
+
border-radius: 50%;
|
|
349
|
+
background-color: var(--nuraly-table-filter-active, #1890ff);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.column-filter-dropdown {
|
|
353
|
+
position: absolute;
|
|
354
|
+
top: calc(100% + 4px);
|
|
355
|
+
right: 0;
|
|
356
|
+
background: var(--nuraly-table-background, #ffffff);
|
|
357
|
+
border: 1px solid var(--nuraly-table-row-border-color, #f0f0f0);
|
|
358
|
+
border-radius: 4px;
|
|
359
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
360
|
+
z-index: 100;
|
|
361
|
+
min-width: 200px;
|
|
362
|
+
padding: 8px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.column-filter-content {
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
gap: 8px;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.column-filter-input {
|
|
372
|
+
padding: 8px;
|
|
373
|
+
border: 1px solid var(--nuraly-table-row-border-color, #d9d9d9);
|
|
374
|
+
border-radius: 4px;
|
|
375
|
+
font-size: 14px;
|
|
376
|
+
width: 100%;
|
|
377
|
+
box-sizing: border-box;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.column-filter-input:focus {
|
|
381
|
+
outline: none;
|
|
382
|
+
border-color: var(--nuraly-table-filter-active, #1890ff);
|
|
383
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.column-filter-clear {
|
|
387
|
+
background: transparent;
|
|
388
|
+
border: none;
|
|
389
|
+
cursor: pointer;
|
|
390
|
+
padding: 4px;
|
|
391
|
+
display: flex;
|
|
392
|
+
align-items: center;
|
|
393
|
+
justify-content: center;
|
|
394
|
+
color: var(--nuraly-table-text-color, #000);
|
|
395
|
+
align-self: flex-end;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.column-filter-clear:hover {
|
|
399
|
+
color: var(--nuraly-table-filter-active, #1890ff);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* Fixed Columns Styles */
|
|
403
|
+
th.fixed-column,
|
|
404
|
+
td.fixed-column {
|
|
405
|
+
position: sticky;
|
|
406
|
+
background-color: var(--nuraly-table-row-background, #ffffff);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/* Fixed columns in header - highest priority */
|
|
410
|
+
thead th.fixed-column {
|
|
411
|
+
z-index: 20;
|
|
412
|
+
background-color: var(--nuraly-table-header-background, #fafafa);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/* When table has fixed header, fixed columns in header need even higher z-index */
|
|
416
|
+
.table-content-wrapper.fixed-header thead th.fixed-column {
|
|
417
|
+
z-index: 25;
|
|
418
|
+
background-color: var(--nuraly-table-header-background, #fafafa);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/* Fixed columns in body */
|
|
422
|
+
tbody td.fixed-column {
|
|
423
|
+
z-index: 8;
|
|
424
|
+
background-color: var(--nuraly-table-row-background, #ffffff);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/* Ensure fixed columns in tbody have proper background */
|
|
428
|
+
tbody tr td.fixed-column {
|
|
429
|
+
background-color: var(--nuraly-table-row-background, #ffffff);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
tbody tr:hover td.fixed-column {
|
|
433
|
+
background-color: var(--nuraly-table-row-hover-background, #f5f5f5);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
th.fixed-column-left,
|
|
437
|
+
td.fixed-column-left {
|
|
438
|
+
left: 0;
|
|
439
|
+
border-right: 1px solid var(--nuraly-table-row-border-color, #f0f0f0);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
th.fixed-column-right,
|
|
443
|
+
td.fixed-column-right {
|
|
444
|
+
right: 0;
|
|
445
|
+
border-left: 1px solid var(--nuraly-table-row-border-color, #f0f0f0);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* Shadow effect for fixed columns */
|
|
449
|
+
th.fixed-column-left::after,
|
|
450
|
+
td.fixed-column-left::after {
|
|
451
|
+
content: '';
|
|
452
|
+
position: absolute;
|
|
453
|
+
top: 0;
|
|
454
|
+
right: -10px;
|
|
455
|
+
bottom: 0;
|
|
456
|
+
width: 10px;
|
|
457
|
+
pointer-events: none;
|
|
458
|
+
transition: box-shadow 0.3s;
|
|
459
|
+
box-shadow: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.table-content-wrapper.has-scroll th.fixed-column-left::after,
|
|
463
|
+
.table-content-wrapper.has-scroll td.fixed-column-left::after {
|
|
464
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
th.fixed-column-right::before,
|
|
468
|
+
td.fixed-column-right::before {
|
|
469
|
+
content: '';
|
|
470
|
+
position: absolute;
|
|
471
|
+
top: 0;
|
|
472
|
+
left: -10px;
|
|
473
|
+
bottom: 0;
|
|
474
|
+
width: 10px;
|
|
475
|
+
pointer-events: none;
|
|
476
|
+
transition: box-shadow 0.3s;
|
|
477
|
+
box-shadow: none;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
.table-content-wrapper.has-scroll th.fixed-column-right::before,
|
|
481
|
+
.table-content-wrapper.has-scroll td.fixed-column-right::before {
|
|
482
|
+
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/* ============================================ */
|
|
486
|
+
/* Loading State Styles */
|
|
487
|
+
/* ============================================ */
|
|
488
|
+
|
|
489
|
+
/* Skeleton Loading Rows */
|
|
490
|
+
.skeleton-row {
|
|
491
|
+
animation: skeleton-pulse 1.5s ease-in-out infinite;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.skeleton-cell {
|
|
495
|
+
padding: var(--nuraly-spacing-3, 0.75rem) var(--nuraly-spacing-4, 1rem);
|
|
496
|
+
border-bottom: 1px solid var(--nuraly-table-border-color, #f0f0f0);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.skeleton-cell.selection-skeleton {
|
|
500
|
+
width: 48px;
|
|
501
|
+
text-align: center;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.skeleton-checkbox {
|
|
505
|
+
width: 16px;
|
|
506
|
+
height: 16px;
|
|
507
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
508
|
+
background-size: 200% 100%;
|
|
509
|
+
animation: skeleton-shimmer 1.5s ease-in-out infinite;
|
|
510
|
+
border-radius: 2px;
|
|
511
|
+
margin: 0 auto;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.skeleton-content {
|
|
515
|
+
height: 16px;
|
|
516
|
+
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
517
|
+
background-size: 200% 100%;
|
|
518
|
+
animation: skeleton-shimmer 1.5s ease-in-out infinite;
|
|
519
|
+
border-radius: 4px;
|
|
520
|
+
width: 80%;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@keyframes skeleton-shimmer {
|
|
524
|
+
0% {
|
|
525
|
+
background-position: 200% 0;
|
|
526
|
+
}
|
|
527
|
+
100% {
|
|
528
|
+
background-position: -200% 0;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
@keyframes skeleton-pulse {
|
|
533
|
+
0%, 100% {
|
|
534
|
+
opacity: 1;
|
|
535
|
+
}
|
|
536
|
+
50% {
|
|
537
|
+
opacity: 0.6;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* Spinner Loading */
|
|
542
|
+
.loading-row {
|
|
543
|
+
background-color: var(--nuraly-table-row-background, #ffffff);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.loading-cell {
|
|
547
|
+
padding: var(--nuraly-spacing-8, 2rem) var(--nuraly-spacing-4, 1rem);
|
|
548
|
+
text-align: center;
|
|
549
|
+
border-bottom: 1px solid var(--nuraly-table-border-color, #f0f0f0);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.loading-spinner-container {
|
|
553
|
+
display: flex;
|
|
554
|
+
flex-direction: column;
|
|
555
|
+
align-items: center;
|
|
556
|
+
gap: var(--nuraly-spacing-4, 1rem);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.loading-spinner {
|
|
560
|
+
width: 40px;
|
|
561
|
+
height: 40px;
|
|
562
|
+
border: 4px solid var(--nuraly-table-border-color, #f0f0f0);
|
|
563
|
+
border-top-color: var(--nuraly-color-primary, #1890ff);
|
|
564
|
+
border-radius: 50%;
|
|
565
|
+
animation: spinner-rotate 0.8s linear infinite;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
@keyframes spinner-rotate {
|
|
569
|
+
0% {
|
|
570
|
+
transform: rotate(0deg);
|
|
571
|
+
}
|
|
572
|
+
100% {
|
|
573
|
+
transform: rotate(360deg);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.loading-text {
|
|
578
|
+
margin: 0;
|
|
579
|
+
color: var(--nuraly-color-text-secondary, #666666);
|
|
580
|
+
font-size: 14px;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/* Empty State Styles */
|
|
584
|
+
.empty-row {
|
|
585
|
+
background: var(--nuraly-table-row-bg-color, #ffffff);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.empty-row:hover {
|
|
589
|
+
background: var(--nuraly-table-row-bg-color, #ffffff);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.empty-cell {
|
|
593
|
+
padding: 64px 24px;
|
|
594
|
+
text-align: center;
|
|
595
|
+
border-bottom: 1px solid var(--nuraly-table-border-color, #f0f0f0);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.empty-state {
|
|
599
|
+
display: flex;
|
|
600
|
+
flex-direction: column;
|
|
601
|
+
align-items: center;
|
|
602
|
+
gap: 16px;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.empty-icon {
|
|
606
|
+
width: 64px;
|
|
607
|
+
height: 64px;
|
|
608
|
+
color: var(--nuraly-color-text-quaternary, #bfbfbf);
|
|
609
|
+
display: flex;
|
|
610
|
+
align-items: center;
|
|
611
|
+
justify-content: center;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
.empty-icon svg {
|
|
615
|
+
width: 100%;
|
|
616
|
+
height: 100%;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.empty-icon nr-icon {
|
|
620
|
+
font-size: 64px;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.empty-text {
|
|
624
|
+
margin: 0;
|
|
625
|
+
color: var(--nuraly-color-text-secondary, #666666);
|
|
626
|
+
font-size: 14px;
|
|
627
|
+
line-height: 1.5;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/* Expansion Row Styles */
|
|
631
|
+
.expand-icon {
|
|
632
|
+
text-align: center;
|
|
633
|
+
vertical-align: middle;
|
|
634
|
+
transition: transform 0.3s ease;
|
|
635
|
+
outline: none;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
.expand-icon:hover {
|
|
639
|
+
background-color: var(--nuraly-color-fill-tertiary, #f5f5f5);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.expand-icon:focus {
|
|
643
|
+
background-color: var(--nuraly-color-fill-tertiary, #f5f5f5);
|
|
644
|
+
box-shadow: inset 0 0 0 2px var(--nuraly-color-primary, #1890ff);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
.expand-icon nr-icon {
|
|
648
|
+
transition: transform 0.3s ease;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.expand-icon.expanded nr-icon {
|
|
652
|
+
transform: rotate(180deg);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.expansion-row {
|
|
656
|
+
transition: all 0.3s ease;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.expansion-row.collapsed {
|
|
660
|
+
opacity: 0;
|
|
661
|
+
height: 0;
|
|
662
|
+
overflow: hidden;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
.expansion-row.expanded {
|
|
666
|
+
opacity: 1;
|
|
667
|
+
animation: slideDown 0.3s ease;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.expansion-content {
|
|
671
|
+
padding: 16px;
|
|
672
|
+
background-color: var(--nuraly-color-fill-quaternary, #fafafa);
|
|
673
|
+
border-top: 1px solid var(--nuraly-color-border, #d9d9d9);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
@keyframes slideDown {
|
|
677
|
+
from {
|
|
678
|
+
opacity: 0;
|
|
679
|
+
transform: translateY(-10px);
|
|
680
|
+
}
|
|
681
|
+
to {
|
|
682
|
+
opacity: 1;
|
|
683
|
+
transform: translateY(0);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
`;
|
|
2
687
|
/**
|
|
3
688
|
* @license
|
|
4
689
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
@@ -9,30 +694,280 @@ class p{constructor(t){this._host=t,this._host.addController(this)}get host(){re
|
|
|
9
694
|
* @license
|
|
10
695
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
11
696
|
* SPDX-License-Identifier: MIT
|
|
12
|
-
*/class
|
|
697
|
+
*/class f extends p{initSelection(){this.host.selectionMode&&(this.host.selectedItems=Array(this.host.rows.length).fill(!1))}handleCheckAll(t){try{const e=(this.host.currentPage-1)*this.host.selectedItemPerPage,n=Math.min(e+this.host.selectedItemPerPage,this.host.selectedItems.length),i=[...this.host.selectedItems];for(let r=e;r<n;r++)i[r]=!t;this.host.selectedItems=i;const r=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("onSelect",{bubbles:!0,composed:!0,detail:{value:r}})),this.requestUpdate()}catch(t){this.handleError(t,"handleCheckAll")}}handleCheckOne(t,e){try{const n=t+(this.host.currentPage-1)*this.host.selectedItemPerPage;this.host.selectedItems[n]=e,this.host.selectedItems=[...this.host.selectedItems];const i=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:i}})),this.requestUpdate()}catch(t){this.handleError(t,"handleCheckOne")}}handleSelectOne(t){try{const e=this.host.selectedItems.findIndex(t=>t);e>-1&&(this.host.selectedItems[e]=!1);const n=t+(this.host.currentPage-1)*this.host.selectedItemPerPage;this.host.selectedItems[n]=!0,this.host.selectedItems=[...this.host.selectedItems];const i=this.host.rowsCopy.filter((t,e)=>this.host.selectedItems[e]);this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:i}})),this.requestUpdate()}catch(t){this.handleError(t,"handleSelectOne")}}cancelSelection(){try{this.host.selectedItems=this.host.selectedItems.map(()=>!1),this.dispatchEvent(new CustomEvent("nr-select",{bubbles:!0,composed:!0,detail:{value:[]}})),this.requestUpdate()}catch(t){this.handleError(t,"cancelSelection")}}hasSelection(){return this.host.selectedItems.some(t=>t)}getSelectedCount(){return this.host.selectedItems.filter(t=>t).length}}
|
|
13
698
|
/**
|
|
14
699
|
* @license
|
|
15
700
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
16
701
|
* SPDX-License-Identifier: MIT
|
|
17
|
-
*/class
|
|
702
|
+
*/class u extends p{initPagination(){try{this.host.displayedRows=this.host.rowsCopy.slice(0,this.host.selectedItemPerPage),this.host.currentPage=this.host.rowsCopy.length>0?1:0,this.requestUpdate()}catch(t){this.handleError(t,"initPagination")}}handleItemPerPageChange(t){try{this.host.selectedItemPerPage=t,this.initPagination()}catch(t){this.handleError(t,"handleItemPerPageChange")}}handlePageChange(t){try{this.host.currentPage=t;const e=(t-1)*this.host.selectedItemPerPage,n=e+this.host.selectedItemPerPage;this.host.displayedRows=this.host.rowsCopy.slice(e,n),this.dispatchEvent(new CustomEvent("onPaginate",{bubbles:!0,composed:!0,detail:{value:this.host.currentPage}})),this.requestUpdate()}catch(t){this.handleError(t,"handlePageChange")}}getTotalPages(){return Math.ceil(this.host.rowsCopy.length/this.host.selectedItemPerPage)}hasNextPage(){return this.host.currentPage<this.getTotalPages()}hasPreviousPage(){return this.host.currentPage>1}}
|
|
18
703
|
/**
|
|
19
704
|
* @license
|
|
20
705
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
21
706
|
* SPDX-License-Identifier: MIT
|
|
22
|
-
*/class g extends p{handleSortOrderChange(t){try{t!==this.host.sortAttribute.index?(this.host.sortAttribute.index=t,this.host.sortAttribute.order="ascending"):"default"===this.host.sortAttribute.order?this.host.sortAttribute.order="ascending":"ascending"===this.host.sortAttribute.order?this.host.sortAttribute.order="descending":this.host.sortAttribute.order="default",this.host.sortAttribute=Object.assign({},this.host.sortAttribute),this.requestUpdate()}catch(t){this.handleError(t,"handleSortOrderChange")}}sort(){try{if(!this.host.rowsCopy.length)return;const t="default"===this.host.sortAttribute.order?0:"ascending"===this.host.sortAttribute.order?1:-1;this.host.rowsCopy.sort((
|
|
707
|
+
*/class g extends p{handleSortOrderChange(t){try{t!==this.host.sortAttribute.index?(this.host.sortAttribute.index=t,this.host.sortAttribute.order="ascending"):"default"===this.host.sortAttribute.order?this.host.sortAttribute.order="ascending":"ascending"===this.host.sortAttribute.order?this.host.sortAttribute.order="descending":this.host.sortAttribute.order="default",this.host.sortAttribute=Object.assign({},this.host.sortAttribute),this.requestUpdate()}catch(t){this.handleError(t,"handleSortOrderChange")}}sort(){try{if(!this.host.rowsCopy.length)return;const t="default"===this.host.sortAttribute.order?0:"ascending"===this.host.sortAttribute.order?1:-1;this.host.rowsCopy.sort((e,n)=>{const i=this.host.headers[this.host.sortAttribute.index].key,r=JSON.stringify(e[i]),a=JSON.stringify(n[i]);return(r<a?-1:r>a?1:0)*t}),this.dispatchEvent(new CustomEvent("onSort",{bubbles:!0,composed:!0,detail:{value:this.host.rowsCopy}})),this.requestUpdate()}catch(t){this.handleError(t,"sort")}}resetSort(){try{this.host.rowsCopy.sort((t,e)=>{const n=this.host.rows.findIndex(e=>JSON.stringify(e)===JSON.stringify(t)),i=this.host.rows.findIndex(t=>JSON.stringify(t)===JSON.stringify(e));return n>i?1:n<i?-1:0}),this.requestUpdate()}catch(t){this.handleError(t,"resetSort")}}isSortActive(){return this.host.sortAttribute.index>-1}isSortDefault(){return"default"===this.host.sortAttribute.order}}
|
|
23
708
|
/**
|
|
24
709
|
* @license
|
|
25
710
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
26
711
|
* SPDX-License-Identifier: MIT
|
|
27
|
-
*/class b extends p{handleSearch(t){try{t.trim().length>0?(this.host.activeSearch=!0,this.host.rowsCopy=this.host.rows.filter(
|
|
712
|
+
*/class b extends p{handleSearch(t){try{t.trim().length>0?(this.host.activeSearch=!0,this.host.rowsCopy=this.host.rows.filter(e=>Object.values(e).some(e=>JSON.stringify(e).includes(t))),this.dispatchEvent(new CustomEvent("onSearch",{bubbles:!0,composed:!0,detail:{value:this.host.rowsCopy}}))):this.clearSearch(),this.requestUpdate()}catch(t){this.handleError(t,"handleSearch")}}clearSearch(){try{this.host.activeSearch=!1,this.requestUpdate()}catch(t){this.handleError(t,"clearSearch")}}isSearchActive(){return this.host.activeSearch}getFilteredCount(){return this.host.rowsCopy.length}applyColumnFilter(t,e){try{""===e||null==e?this.host.columnFilters.delete(t):this.host.columnFilters.set(t,e),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"applyColumnFilter")}}clearColumnFilter(t){try{this.host.columnFilters.delete(t),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"clearColumnFilter")}}clearAllColumnFilters(){try{this.host.columnFilters.clear(),this.filterRows(),this.requestUpdate()}catch(t){this.handleError(t,"clearAllColumnFilters")}}toggleColumnFilterDropdown(t){try{this.host.activeFilterColumn=this.host.activeFilterColumn===t?null:t,this.requestUpdate()}catch(t){this.handleError(t,"toggleColumnFilterDropdown")}}filterRows(){var t;let e=[...this.host.rows];this.host.columnFilters.size>0&&(e=e.filter(t=>Array.from(this.host.columnFilters.entries()).every(([e,n])=>{const i=t[e];if(null==i)return!1;const r=String(i).toLowerCase(),a=String(n).toLowerCase();return r.includes(a)}))),this.host.activeSearch&&this.host.filterValue&&(e=e.filter(t=>Object.values(t).some(t=>JSON.stringify(t).toLowerCase().includes(this.host.filterValue.toLowerCase())))),this.host.rowsCopy=e,this.host.activeSearch=this.host.columnFilters.size>0||(null===(t=this.host.filterValue)||void 0===t?void 0:t.length)>0}}function x(t,e,n){let i=0;n&&(i+=50);for(let n=0;n<e;n++)if("left"===t[n].fixed){const e=t[n].width;i+="number"==typeof e?e:parseInt(String(e))||150}return i}function m(t){const e=[];return t.fixed&&(e.push("fixed-column"),e.push(`fixed-column-${t.fixed}`)),e.join(" ")}function y(t){const i=t.headers.some(t=>"left"===t.fixed),r=i?"fixed-column fixed-column-left":"";return e`
|
|
713
|
+
<table>
|
|
714
|
+
<thead>
|
|
715
|
+
<tr>
|
|
716
|
+
${t.expandable||t.expansionRenderer||t.selectionMode?e`<th class="${r}" style="${i?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
717
|
+
${"multiple"===t.selectionMode?e`<nr-checkbox
|
|
718
|
+
id="global-check"
|
|
719
|
+
@nr-change=${t.onCheckAll}
|
|
720
|
+
></nr-checkbox>`:n}
|
|
721
|
+
</th>`:n}
|
|
722
|
+
${c(t.headers,(i,r)=>{const a=m(i),o=t.expandable||t.expansionRenderer||t.selectionMode,l="left"===i.fixed?x(t.headers,r,!!o):void 0,s=i.width?"number"==typeof i.width?`${i.width}px`:i.width:void 0;return e`
|
|
723
|
+
${t.expandable!==i.key?e`<th
|
|
724
|
+
class="${[i.filterable?"filterable":"",a].filter(Boolean).join(" ")}"
|
|
725
|
+
style="${void 0!==l?`left: ${l}px;`:""} ${s?`width: ${s}; min-width: ${s};`:""}">
|
|
726
|
+
<div class="th-content">
|
|
727
|
+
<span class="th-text" @click=${()=>t.onUpdateSort(r)}>
|
|
728
|
+
${i.name}
|
|
729
|
+
${r===t.sortAttribute.index?d(t.sortAttribute.order,[["default",()=>e`<nr-icon name="arrows-v"></nr-icon>`],["ascending",()=>e`<nr-icon name="long-arrow-up"></nr-icon>`],["descending",()=>e`<nr-icon name="long-arrow-down"></nr-icon>`]]):e`<nr-icon name="arrows-v"></nr-icon>`}
|
|
730
|
+
</span>
|
|
731
|
+
${i.filterable&&i.filterConfig?e`
|
|
732
|
+
<div class="filter-wrapper">
|
|
733
|
+
<button
|
|
734
|
+
class="filter-trigger"
|
|
735
|
+
@click=${e=>{e.stopPropagation(),t.onToggleColumnFilter(i.key)}}
|
|
736
|
+
>
|
|
737
|
+
${t.activeFilterColumn,i.key,c=t.columnFilters.has(i.key),e`
|
|
738
|
+
<span class="filter-icon ${c?"has-filter":""}">
|
|
739
|
+
<nr-icon name="filter"></nr-icon>
|
|
740
|
+
${c?e`<span class="filter-indicator"></span>`:n}
|
|
741
|
+
</span>
|
|
742
|
+
`}
|
|
743
|
+
</button>
|
|
744
|
+
${t.activeFilterColumn===i.key?function(t){const{filterConfig:i,currentValue:r,onFilterChange:a,onClearFilter:o}=t;return e`
|
|
745
|
+
<div class="column-filter-dropdown">
|
|
746
|
+
<div class="column-filter-content">
|
|
747
|
+
${"select"===i.type?e`
|
|
748
|
+
<nr-select
|
|
749
|
+
.options=${i.options||[]}
|
|
750
|
+
.value=${r||""}
|
|
751
|
+
placeholder=${i.placeholder||"Filter..."}
|
|
752
|
+
@nr-change=${t=>a(t.detail.value)}
|
|
753
|
+
></nr-select>
|
|
754
|
+
`:"number"===i.type?e`
|
|
755
|
+
<input
|
|
756
|
+
type="number"
|
|
757
|
+
class="column-filter-input"
|
|
758
|
+
placeholder=${i.placeholder||"Filter by number..."}
|
|
759
|
+
.value=${r||""}
|
|
760
|
+
@input=${t=>a(t.target.value)}
|
|
761
|
+
/>
|
|
762
|
+
`:"date"===i.type?e`
|
|
763
|
+
<input
|
|
764
|
+
type="date"
|
|
765
|
+
class="column-filter-input"
|
|
766
|
+
placeholder=${i.placeholder||"Filter by date..."}
|
|
767
|
+
.value=${r||""}
|
|
768
|
+
@input=${t=>a(t.target.value)}
|
|
769
|
+
/>
|
|
770
|
+
`:e`
|
|
771
|
+
<input
|
|
772
|
+
type="text"
|
|
773
|
+
class="column-filter-input"
|
|
774
|
+
placeholder=${i.placeholder||"Filter..."}
|
|
775
|
+
.value=${r||""}
|
|
776
|
+
@input=${t=>a(t.target.value)}
|
|
777
|
+
/>
|
|
778
|
+
`}
|
|
779
|
+
|
|
780
|
+
${r?e`
|
|
781
|
+
<button class="column-filter-clear" @click=${o}>
|
|
782
|
+
<nr-icon name="times"></nr-icon>
|
|
783
|
+
</button>
|
|
784
|
+
`:n}
|
|
785
|
+
</div>
|
|
786
|
+
</div>
|
|
787
|
+
`}({columnKey:i.key,filterConfig:i.filterConfig,currentValue:t.columnFilters.get(i.key),isActive:!0,onFilterChange:e=>t.onApplyColumnFilter(i.key,e),onClearFilter:()=>t.onClearColumnFilter(i.key)}):n}
|
|
788
|
+
</div>
|
|
789
|
+
`:n}
|
|
790
|
+
</div>
|
|
791
|
+
</th>`:n}
|
|
792
|
+
`;var c;
|
|
28
793
|
/**
|
|
29
794
|
* @license
|
|
30
795
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
31
796
|
* SPDX-License-Identifier: MIT
|
|
32
|
-
*/})
|
|
797
|
+
*/})}
|
|
798
|
+
</tr>
|
|
799
|
+
</thead>
|
|
800
|
+
<tbody>
|
|
801
|
+
${t.loading?function(t,n=5){const i=!!t.selectionMode;return e`
|
|
802
|
+
${Array.from({length:n},()=>e`
|
|
803
|
+
<tr class="skeleton-row">
|
|
804
|
+
${i?e`
|
|
805
|
+
<td class="skeleton-cell selection-skeleton">
|
|
806
|
+
<div class="skeleton-checkbox"></div>
|
|
807
|
+
</td>
|
|
808
|
+
`:""}
|
|
809
|
+
${t.headers.map(()=>e`
|
|
810
|
+
<td class="skeleton-cell">
|
|
811
|
+
<div class="skeleton-content"></div>
|
|
812
|
+
</td>
|
|
813
|
+
`)}
|
|
814
|
+
</tr>
|
|
815
|
+
`)}
|
|
816
|
+
`}(t.host,5):0===t.rows.length?function(t){const n=t.headers.length+(t.selectionMode?1:0);return e`
|
|
817
|
+
<tr class="empty-row">
|
|
818
|
+
<td colspan="${n}" class="empty-cell">
|
|
819
|
+
<div class="empty-state">
|
|
820
|
+
${t.emptyIcon?e`
|
|
821
|
+
<div class="empty-icon">
|
|
822
|
+
<nr-icon name="${t.emptyIcon}"></nr-icon>
|
|
823
|
+
</div>
|
|
824
|
+
`:e`
|
|
825
|
+
<div class="empty-icon">
|
|
826
|
+
<svg
|
|
827
|
+
width="64"
|
|
828
|
+
height="64"
|
|
829
|
+
viewBox="0 0 64 64"
|
|
830
|
+
fill="none"
|
|
831
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
832
|
+
>
|
|
833
|
+
<path
|
|
834
|
+
d="M32 8C18.745 8 8 18.745 8 32s10.745 24 24 24 24-10.745 24-24S45.255 8 32 8zm0 44c-11.028 0-20-8.972-20-20s8.972-20 20-20 20 8.972 20 20-8.972 20-20 20z"
|
|
835
|
+
fill="currentColor"
|
|
836
|
+
opacity="0.3"
|
|
837
|
+
/>
|
|
838
|
+
<path
|
|
839
|
+
d="M32 20c-1.105 0-2 .895-2 2v12c0 1.105.895 2 2 2s2-.895 2-2V22c0-1.105-.895-2-2-2zm0 20c-1.105 0-2 .895-2 2s.895 2 2 2 2-.895 2-2-.895-2-2-2z"
|
|
840
|
+
fill="currentColor"
|
|
841
|
+
/>
|
|
842
|
+
</svg>
|
|
843
|
+
</div>
|
|
844
|
+
`}
|
|
845
|
+
<div class="empty-text">${t.emptyText}</div>
|
|
846
|
+
</div>
|
|
847
|
+
</td>
|
|
848
|
+
</tr>
|
|
849
|
+
`}(t.host):c(t.rows,(a,o)=>e`
|
|
850
|
+
<tr>
|
|
851
|
+
${!t.expandable&&!t.expansionRenderer||t.selectionMode?t.selectionMode?d(t.selectionMode,[["multiple",()=>e`<td class="${r}" style="${i?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
852
|
+
<nr-checkbox
|
|
853
|
+
@nr-change=${e=>t.onCheckOne(e,o)}
|
|
854
|
+
.checked=${t.selectedItems[o+(t.currentPage-1)*t.itemPerPage]}
|
|
855
|
+
></nr-checkbox>
|
|
856
|
+
</td>`],["single",()=>e`<td class="${r}" style="${i?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
857
|
+
<nr-radio
|
|
858
|
+
name="table-row-selection"
|
|
859
|
+
value="${o}"
|
|
860
|
+
@nr-change=${()=>t.onSelectOne(o)}
|
|
861
|
+
.checked=${t.selectedItems[o+(t.currentPage-1)*t.itemPerPage]}
|
|
862
|
+
></nr-radio>
|
|
863
|
+
</td>`]]):n:e`
|
|
864
|
+
<td
|
|
865
|
+
@click=${()=>t.onShowExpandedContent(o)}
|
|
866
|
+
@keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.onShowExpandedContent(o))}}
|
|
867
|
+
tabindex="0"
|
|
868
|
+
role="button"
|
|
869
|
+
aria-expanded="${t.expand[o]}"
|
|
870
|
+
aria-label="${t.expand[o]?"Collapse row":"Expand row"}"
|
|
871
|
+
class="expand-icon ${t.expand[o]?"expanded":""} ${r}"
|
|
872
|
+
style="${i?"left: 0; width: 50px; min-width: 50px;":""}">
|
|
873
|
+
<nr-icon name="angle-down"></nr-icon>
|
|
874
|
+
</td>
|
|
875
|
+
`}
|
|
876
|
+
${c(t.headers,(i,r)=>{const o=m(i),l=t.expandable||t.expansionRenderer||t.selectionMode,s="left"===i.fixed?x(t.headers,r,!!l):void 0,c=i.width?"number"==typeof i.width?`${i.width}px`:i.width:void 0;return e`${t.expandable!==i.key?e`<td
|
|
877
|
+
class="${o}"
|
|
878
|
+
style="${void 0!==s?`left: ${s}px;`:""} ${c?`width: ${c}; min-width: ${c};`:""}">
|
|
879
|
+
${a[i.key]}
|
|
880
|
+
</td>`:n}`})}
|
|
881
|
+
</tr>
|
|
882
|
+
${t.expand[o]?e`
|
|
883
|
+
<tr class="expansion-row expanded">
|
|
884
|
+
<td colspan=${t.headers.length+(t.expandable||t.expansionRenderer||t.selectionMode?1:0)}>
|
|
885
|
+
<div class="expansion-content">
|
|
886
|
+
${t.expansionRenderer?t.expansionRenderer(a,o):t.expandable?a[t.expandable]:n}
|
|
887
|
+
</div>
|
|
888
|
+
</td>
|
|
889
|
+
</tr>
|
|
890
|
+
`:n}
|
|
891
|
+
`)}
|
|
892
|
+
</tbody>
|
|
893
|
+
</table>
|
|
894
|
+
`}
|
|
33
895
|
/**
|
|
34
896
|
* @license
|
|
35
897
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
36
898
|
* SPDX-License-Identifier: MIT
|
|
37
899
|
*/
|
|
38
|
-
var
|
|
900
|
+
var v=function(t,e,n,i){for(var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};let w=class extends(s(i)){constructor(){super(...arguments),this.rows=[],this.size="normal",this.withFilter=!1,this.fixedHeader=!1,this.loading=!1,this.emptyText="No data available",this.itemPerPage=[5,10,15,20],this.selectedItemPerPage=this.itemPerPage[0],this.displayedRows=[],this.selectedItems=[],this.rowsCopy=[],this.activeSearch=!1,this.sortAttribute={index:-1,order:"default"},this.expand=[],this.showFilterInput=!1,this.filterValue="",this.columnFilters=new Map,this.activeFilterColumn=null,this.requiredComponents=["nr-select","nr-icon","nr-checkbox","nr-radio"],this.selectionController=new f(this),this.paginationController=new u(this),this.sortController=new g(this),this.filterController=new b(this)}connectedCallback(){super.connectedCallback(),this.selectionController.initSelection()}updated(t){var e,n;if(this.globalCheck&&(t.has("selectedItems")||t.has("currentPage")||t.has("displayedRows"))){const t=this.globalCheck,e=(this.currentPage-1)*this.selectedItemPerPage,n=Math.min(e+this.displayedRows.length,this.selectedItems.length),i=this.selectedItems.slice(e,n);i.length>0&&i.every(t=>t)?(t.checked=!0,t.indeterminate=!1):i.some(t=>t)?(t.checked=!1,t.indeterminate=!0):(t.checked=!1,t.indeterminate=!1)}this.showFilterInput&&t.has("showFilterInput")&&(null===(n=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("input"))||void 0===n||n.focus())}willUpdate(t){t.has("rows")&&(this.expand=Array(this.rows.length).fill(!1)),t.has("sortAttribute")&&this.sortController.isSortActive()&&(this._initPagination(),this.selectionController.initSelection()),t.has("rowsCopy")&&this.filterController.isSearchActive()&&this._initPagination(),(t.has("activeSearch")||t.has("rows"))&&(this.filterController.isSearchActive()||(this.rowsCopy=[...this.rows],this._initPagination()))}_initPagination(){this.sortController.isSortActive()&&(this.sortController.isSortDefault()?this.sortController.resetSort():this.sortController.sort()),this.paginationController.initPagination()}_handleItemPerPage(t){const e=t.detail.value||t.detail.selectedItemPerPage;this.paginationController.handleItemPerPageChange(Number(e))}_handleUpdatePage(t){this.paginationController.handlePageChange(t.detail.page)}_handleCheckAll(t){this.selectionController.handleCheckAll(t.detail.isEveryItemChecked)}_handleCheckOne(t){this.selectionController.handleCheckOne(t.detail.index,t.detail.value)}_handleSelectOne(t){this.selectionController.handleSelectOne(t.detail.index)}_handleCancelSelection(){this.selectionController.cancelSelection()}_handleSearch(t){this.filterController.handleSearch(t.detail.value)}_handleSortOrder(t){this.sortController.handleSortOrderChange(t.detail.index)}_showExpandedContent(t){this.expand[t]=!this.expand[t],this.requestUpdate()}_toggleFilterInput(){this.showFilterInput=!this.showFilterInput}_handleFilterInputChange(t){this.filterValue=t.target.value,this.filterController.handleSearch(this.filterValue)}render(){var t,i;const r=Math.ceil(this.rowsCopy.length/this.selectedItemPerPage),a=this.currentPage>0?this.currentPage*this.selectedItemPerPage-this.selectedItemPerPage+1:0,o=this.currentPage*this.selectedItemPerPage<=this.rowsCopy.length?this.currentPage*this.selectedItemPerPage:this.rowsCopy.length,l=o<this.rowsCopy.length,s=a>1;return e`
|
|
901
|
+
${this.selectionMode&&!this.withFilter&&this.selectionController.hasSelection()?(c={selectedItems:this.selectionController.getSelectedCount(),size:this.size,onCancelSelection:()=>this._handleCancelSelection()},e`
|
|
902
|
+
<div class="actions-container" data-size="${c.size}">
|
|
903
|
+
<span>${c.selectedItems} selected</span>
|
|
904
|
+
<button @click=${c.onCancelSelection}>Cancel</button>
|
|
905
|
+
</div>
|
|
906
|
+
`):this.withFilter?e`
|
|
907
|
+
<div class="filter-container">
|
|
908
|
+
${function(t){return e`
|
|
909
|
+
<div class="filter-container">
|
|
910
|
+
${t.showInput?e`
|
|
911
|
+
<nr-icon name="search" class="search-icon"></nr-icon>
|
|
912
|
+
<input
|
|
913
|
+
type="text"
|
|
914
|
+
placeholder="search"
|
|
915
|
+
@blur=${t.value.trim()?n:t.onToggleInput}
|
|
916
|
+
@input=${t.onChange}
|
|
917
|
+
/>
|
|
918
|
+
`:e`
|
|
919
|
+
<div class="icon-container" @click=${t.onToggleInput}>
|
|
920
|
+
<nr-icon name="search"></nr-icon>
|
|
921
|
+
</div>
|
|
922
|
+
`}
|
|
923
|
+
</div>
|
|
924
|
+
`}({showInput:this.showFilterInput,value:this.filterValue,onToggleInput:()=>this._toggleFilterInput(),onChange:t=>this._handleFilterInputChange(t)})}
|
|
925
|
+
</div>
|
|
926
|
+
`:n}
|
|
927
|
+
|
|
928
|
+
<div class="table-content-wrapper ${this.fixedHeader?"fixed-header":""}"
|
|
929
|
+
style="${(null===(t=this.scrollConfig)||void 0===t?void 0:t.y)?`${this.fixedHeader?"height":"max-height"}: ${"number"==typeof this.scrollConfig.y?this.scrollConfig.y+"px":this.scrollConfig.y};`:""}
|
|
930
|
+
${(null===(i=this.scrollConfig)||void 0===i?void 0:i.x)?`${this.fixedHeader?"width":"max-width"}: ${"number"==typeof this.scrollConfig.x?this.scrollConfig.x+"px":this.scrollConfig.x};`:""}">
|
|
931
|
+
${y({headers:this.headers,rows:this.displayedRows,expandable:this.expandable&&!this.selectionMode?this.expandable:void 0,expansionRenderer:this.selectionMode?void 0:this.expansionRenderer,selectionMode:this.selectionMode&&!this.withFilter?this.selectionMode:void 0,selectedItems:this.selectedItems,currentPage:this.currentPage,itemPerPage:this.selectedItemPerPage,sortAttribute:this.sortAttribute,expand:this.expand,columnFilters:this.columnFilters,activeFilterColumn:this.activeFilterColumn,loading:this.loading,host:this,onCheckAll:()=>{const t=(this.currentPage-1)*this.selectedItemPerPage,e=Math.min(t+this.selectedItemPerPage,this.selectedItems.length),n=this.selectedItems.slice(t,e),i=n.every(t=>t)&&n.length>0;this._handleCheckAll({detail:{isEveryItemChecked:i}})},onCheckOne:(t,e)=>this._handleCheckOne({detail:{index:e,value:t.detail.checked}}),onSelectOne:t=>this._handleSelectOne({detail:{index:t}}),onUpdateSort:t=>this._handleSortOrder({detail:{index:t}}),onShowExpandedContent:t=>this._showExpandedContent(t),onToggleColumnFilter:t=>this.filterController.toggleColumnFilterDropdown(t),onApplyColumnFilter:(t,e)=>this.filterController.applyColumnFilter(t,e),onClearColumnFilter:t=>this.filterController.clearColumnFilter(t)})}
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
${function(t){const i=t.itemPerPage.map(t=>({label:String(t),value:String(t)}));return e`
|
|
935
|
+
<div class="pagination-container" data-size="${t.size}">
|
|
936
|
+
<div class="left-content">
|
|
937
|
+
<span class="select-details">
|
|
938
|
+
<label>Items per page:</label>
|
|
939
|
+
<nr-select
|
|
940
|
+
.options=${i}
|
|
941
|
+
.value=${String(t.selectedItemPerPage)}
|
|
942
|
+
size="small"
|
|
943
|
+
@nr-change=${t.onItemPerPageChange}
|
|
944
|
+
></nr-select>
|
|
945
|
+
</span>
|
|
946
|
+
<span class="items-details">
|
|
947
|
+
${t.fromItem} - ${t.toItem} of ${t.numberOfItems} items
|
|
948
|
+
</span>
|
|
949
|
+
</div>
|
|
950
|
+
|
|
951
|
+
<div class="right-content">
|
|
952
|
+
<span class="page-details">
|
|
953
|
+
${t.currentPage} of ${t.numberOfPages} pages
|
|
954
|
+
</span>
|
|
955
|
+
<span class="icon-container">
|
|
956
|
+
<nr-icon
|
|
957
|
+
class="left-arrow"
|
|
958
|
+
data-enabled=${t.enablePrevious}
|
|
959
|
+
name="caret-left"
|
|
960
|
+
@click=${t.enablePrevious?t.onPreviousPage:n}
|
|
961
|
+
></nr-icon>
|
|
962
|
+
|
|
963
|
+
<nr-icon
|
|
964
|
+
class="right-arrow"
|
|
965
|
+
data-enabled=${t.enableNext}
|
|
966
|
+
name="caret-right"
|
|
967
|
+
@click=${t.enableNext?t.onNextPage:n}
|
|
968
|
+
></nr-icon>
|
|
969
|
+
</span>
|
|
970
|
+
</div>
|
|
971
|
+
</div>
|
|
972
|
+
`}({numberOfItems:this.rowsCopy.length,itemPerPage:this.itemPerPage,selectedItemPerPage:this.selectedItemPerPage,currentPage:this.currentPage,size:this.size,numberOfPages:r,fromItem:a,toItem:o,enableNext:l,enablePrevious:s,onItemPerPageChange:t=>this._handleItemPerPage(t),onNextPage:()=>{this.currentPage++,this._handleUpdatePage({detail:{page:this.currentPage}})},onPreviousPage:()=>{this.currentPage--,this._handleUpdatePage({detail:{page:this.currentPage}})}})}
|
|
973
|
+
`;var c}};w.styles=h,v([r({type:Array})],w.prototype,"headers",void 0),v([r({type:Array})],w.prototype,"rows",void 0),v([r({type:String})],w.prototype,"size",void 0),v([r({type:Boolean})],w.prototype,"withFilter",void 0),v([r({type:String})],w.prototype,"expandable",void 0),v([r({attribute:!1})],w.prototype,"expansionRenderer",void 0),v([r({type:String})],w.prototype,"selectionMode",void 0),v([r({type:Boolean})],w.prototype,"fixedHeader",void 0),v([r({type:Object})],w.prototype,"scrollConfig",void 0),v([r({type:Boolean})],w.prototype,"loading",void 0),v([r({type:String})],w.prototype,"emptyText",void 0),v([r({type:String})],w.prototype,"emptyIcon",void 0),v([a()],w.prototype,"itemPerPage",void 0),v([a()],w.prototype,"selectedItemPerPage",void 0),v([a()],w.prototype,"displayedRows",void 0),v([a()],w.prototype,"selectedItems",void 0),v([a()],w.prototype,"currentPage",void 0),v([a()],w.prototype,"rowsCopy",void 0),v([a()],w.prototype,"activeSearch",void 0),v([a()],w.prototype,"sortAttribute",void 0),v([a()],w.prototype,"expand",void 0),v([a()],w.prototype,"showFilterInput",void 0),v([a()],w.prototype,"filterValue",void 0),v([a()],w.prototype,"columnFilters",void 0),v([a()],w.prototype,"activeFilterColumn",void 0),v([o("#global-check")],w.prototype,"globalCheck",void 0),w=v([l("nr-table")],w);export{w as HyTable};
|