django-spire 0.22.3__py3-none-any.whl → 0.23.0__py3-none-any.whl
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.
- django_spire/auth/group/forms.py +3 -4
- django_spire/auth/group/utils.py +1 -2
- django_spire/auth/group/views/form_views.py +22 -14
- django_spire/auth/group/views/page_views.py +1 -1
- django_spire/auth/mfa/utils.py +1 -1
- django_spire/auth/permissions/consts.py +2 -1
- django_spire/auth/permissions/decorators.py +1 -2
- django_spire/auth/permissions/permissions.py +1 -3
- django_spire/comment/factories.py +1 -1
- django_spire/comment/mixins.py +1 -1
- django_spire/comment/views.py +1 -1
- django_spire/consts.py +1 -1
- django_spire/contrib/breadcrumb/breadcrumbs.py +1 -1
- django_spire/contrib/form/confirmation_forms.py +1 -1
- django_spire/contrib/form/utils.py +26 -16
- django_spire/contrib/generic_views/modal_views.py +1 -1
- django_spire/contrib/generic_views/portal_views.py +18 -55
- django_spire/contrib/ordering/validators.py +4 -8
- django_spire/core/context_processors.py +1 -1
- django_spire/core/management/commands/spire_startapp_pkg/user_input.py +1 -1
- django_spire/core/middleware/maintenance.py +2 -1
- django_spire/core/middleware.py +2 -1
- django_spire/core/redirect/generic_redirect.py +1 -1
- django_spire/core/redirect/safe_redirect.py +2 -1
- django_spire/core/shortcuts.py +4 -2
- django_spire/core/table/__init__.py +0 -0
- django_spire/core/table/enums.py +18 -0
- django_spire/core/templates/django_spire/card/infinite_scroll_card.html +3 -137
- django_spire/core/templates/django_spire/container/infinite_scroll_container.html +64 -0
- django_spire/core/templates/django_spire/infinite_scroll/base.html +348 -0
- django_spire/core/templates/django_spire/infinite_scroll/element/footer.html +11 -0
- django_spire/core/templates/django_spire/infinite_scroll/scroll.html +152 -0
- django_spire/core/templates/django_spire/item/infinite_scroll_item.html +33 -0
- django_spire/core/templates/django_spire/lazy_tab/element/lazy_tab_section_element.html +19 -0
- django_spire/core/templates/django_spire/lazy_tab/element/lazy_tab_trigger_element.html +15 -0
- django_spire/core/templates/django_spire/lazy_tab/lazy_tab.html +157 -0
- django_spire/core/templates/django_spire/page/infinite_scroll_list_page.html +7 -0
- django_spire/core/templates/django_spire/table/base.html +185 -373
- django_spire/core/templates/django_spire/table/element/footer.html +7 -15
- django_spire/core/templates/django_spire/table/element/header.html +1 -1
- django_spire/core/templates/django_spire/table/element/row.html +15 -7
- django_spire/core/templatetags/spire_core_tags.py +1 -2
- django_spire/file/fields.py +1 -1
- django_spire/file/interfaces.py +1 -1
- django_spire/file/views.py +1 -1
- django_spire/history/activity/utils.py +1 -1
- django_spire/history/mixins.py +0 -4
- django_spire/knowledge/static/django_spire/knowledge/css/editor.css +93 -0
- django_spire/knowledge/templates/django_spire/knowledge/entry/version/page/editor_page.html +4 -0
- django_spire/notification/app/context_data.py +3 -1
- django_spire/notification/app/views/json_views.py +1 -1
- django_spire/notification/app/views/page_views.py +2 -1
- django_spire/notification/app/views/template_views.py +2 -2
- django_spire/profiling/middleware/profiling.py +2 -2
- django_spire/profiling/panel.py +2 -2
- django_spire/testing/__init__.py +0 -0
- django_spire/testing/playwright/__init__.py +64 -0
- django_spire/testing/playwright/components/__init__.py +45 -0
- django_spire/testing/playwright/components/accordion.py +55 -0
- django_spire/testing/playwright/components/attribute_element.py +73 -0
- django_spire/testing/playwright/components/base_session_filter_form.py +57 -0
- django_spire/testing/playwright/components/breadcrumb_element.py +56 -0
- django_spire/testing/playwright/components/card.py +102 -0
- django_spire/testing/playwright/components/dropdown.py +87 -0
- django_spire/testing/playwright/components/infinite_scroll.py +158 -0
- django_spire/testing/playwright/components/lazy_tab.py +92 -0
- django_spire/testing/playwright/components/modal.py +101 -0
- django_spire/testing/playwright/components/navigation.py +119 -0
- django_spire/testing/playwright/components/notification_bell.py +59 -0
- django_spire/testing/playwright/components/theme_selector.py +46 -0
- django_spire/testing/playwright/components/toast.py +72 -0
- django_spire/testing/playwright/fixtures.py +54 -0
- django_spire/testing/playwright/pages/__init__.py +6 -0
- django_spire/testing/playwright/pages/base.py +24 -0
- django_spire/theme/models.py +1 -1
- django_spire/theme/tests/test_context_processor.py +0 -1
- django_spire/theme/views/json_views.py +1 -1
- django_spire/theme/views/page_views.py +1 -1
- {django_spire-0.22.3.dist-info → django_spire-0.23.0.dist-info}/METADATA +4 -1
- {django_spire-0.22.3.dist-info → django_spire-0.23.0.dist-info}/RECORD +83 -52
- {django_spire-0.22.3.dist-info → django_spire-0.23.0.dist-info}/WHEEL +0 -0
- {django_spire-0.22.3.dist-info → django_spire-0.23.0.dist-info}/licenses/LICENSE.md +0 -0
- {django_spire-0.22.3.dist-info → django_spire-0.23.0.dist-info}/top_level.txt +0 -0
|
@@ -1,409 +1,221 @@
|
|
|
1
|
-
|
|
2
|
-
x-data="{
|
|
3
|
-
current_page: parseInt('{{ current_page|default:0 }}'),
|
|
4
|
-
endpoint: '{{ endpoint }}',
|
|
5
|
-
has_next: {{ has_next|default:'true'|yesno:'true,false' }},
|
|
6
|
-
batch_size: parseInt('{{ batch_size|default:25 }}'),
|
|
7
|
-
responsive_mode: '{{ responsive_mode|default:"collapse" }}',
|
|
8
|
-
shared_payload: {},
|
|
9
|
-
skeleton_row: parseInt('{{ batch_size|default:25 }}'),
|
|
10
|
-
sort_column: {% if sort_column %}'{{ sort_column }}'{% else %}null{% endif %},
|
|
11
|
-
sort_direction: '{{ sort_direction|default:'asc' }}',
|
|
12
|
-
table_id: $id('table'),
|
|
13
|
-
total_count: parseInt('{{ total_count|default:0 }}'),
|
|
14
|
-
|
|
15
|
-
any_row_has_children: false,
|
|
16
|
-
average_row_height: 0,
|
|
17
|
-
column_breakpoints: [],
|
|
18
|
-
column_count: 0,
|
|
19
|
-
is_loading: false,
|
|
20
|
-
is_refreshing: false,
|
|
21
|
-
is_row_open: {},
|
|
22
|
-
loaded_count: 0,
|
|
23
|
-
observer: null,
|
|
24
|
-
select_all: false,
|
|
25
|
-
selected_rows: new Set(),
|
|
26
|
-
skeleton_count: 0,
|
|
27
|
-
prevent_auto_load: false,
|
|
28
|
-
|
|
29
|
-
{% block table_xdata %}{% endblock %}
|
|
30
|
-
|
|
31
|
-
async init() {
|
|
32
|
-
await this.$nextTick();
|
|
33
|
-
this.reset_scroll_position();
|
|
34
|
-
|
|
35
|
-
if (this.should_load_initial_data()) {
|
|
36
|
-
this.skeleton_count = this.skeleton_row;
|
|
37
|
-
await this.load_more();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (this.has_next) {
|
|
41
|
-
setTimeout(() => this.setup_observer(), 500);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
apply_column_breakpoints(row_element) {
|
|
46
|
-
if (this.responsive_mode !== 'collapse') return;
|
|
47
|
-
|
|
48
|
-
let cells = Array.from(row_element.children);
|
|
49
|
-
|
|
50
|
-
cells.forEach((cell, index) => {
|
|
51
|
-
let breakpoint = this.column_breakpoints[index];
|
|
52
|
-
|
|
53
|
-
if (breakpoint && cell.tagName === 'TD') {
|
|
54
|
-
cell.classList.add('d-none', `d-${breakpoint}-table-cell`);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
build_request_params(next_page) {
|
|
60
|
-
let params = new URLSearchParams({
|
|
61
|
-
page: next_page,
|
|
62
|
-
batch_size: this.batch_size
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
if (this.sort_column) {
|
|
66
|
-
params.set('sort', this.sort_column);
|
|
67
|
-
params.set('direction', this.sort_direction);
|
|
68
|
-
}
|
|
1
|
+
{% extends 'django_spire/infinite_scroll/base.html' %}
|
|
69
2
|
|
|
70
|
-
|
|
71
|
-
|
|
3
|
+
{% block scroll_xdata %}
|
|
4
|
+
responsive_mode: '{{ responsive_mode|default:"collapse" }}',
|
|
5
|
+
table_id: $id('table'),
|
|
72
6
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
7
|
+
any_row_has_children: false,
|
|
8
|
+
average_row_height: 0,
|
|
9
|
+
column_breakpoints: [],
|
|
10
|
+
column_count: 0,
|
|
11
|
+
is_row_open: {},
|
|
12
|
+
select_all: false,
|
|
13
|
+
selected_rows: new Set(),
|
|
76
14
|
|
|
77
|
-
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
await new Promise(resolve => setTimeout(resolve, 50));
|
|
82
|
-
|
|
83
|
-
let container_rect = table_container.getBoundingClientRect();
|
|
84
|
-
let trigger_rect = trigger.getBoundingClientRect();
|
|
85
|
-
|
|
86
|
-
if (trigger_rect.top <= container_rect.bottom) {
|
|
87
|
-
await this.load_more();
|
|
88
|
-
}
|
|
89
|
-
},
|
|
15
|
+
{% block table_xdata %}{% endblock %}
|
|
90
16
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
17
|
+
apply_column_breakpoints(row_element) {
|
|
18
|
+
if (this.responsive_mode !== 'collapse') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
95
21
|
|
|
96
|
-
|
|
97
|
-
if (this.observer) {
|
|
98
|
-
this.observer.disconnect();
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
async fetch_rows(next_page) {
|
|
103
|
-
if (!this.endpoint) {
|
|
104
|
-
return { success: false, error: 'No endpoint provided' };
|
|
105
|
-
}
|
|
22
|
+
let cells = Array.from(row_element.children);
|
|
106
23
|
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
let view = new ViewGlue(url, this.$refs.shared_payload ? JSON.parse(this.$refs.shared_payload.textContent) : {});
|
|
24
|
+
cells.forEach((cell, index) => {
|
|
25
|
+
let breakpoint = this.column_breakpoints[index];
|
|
110
26
|
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
this.$refs.table_body.innerHTML = '';
|
|
27
|
+
if (breakpoint && cell.tagName === 'TD') {
|
|
28
|
+
cell.classList.add('d-none', `d-${breakpoint}-table-cell`);
|
|
114
29
|
}
|
|
30
|
+
});
|
|
31
|
+
},
|
|
115
32
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
let added = this.loaded_count - previous_count;
|
|
33
|
+
handle_header_mounted(event) {
|
|
34
|
+
this.column_count = event.detail.count;
|
|
35
|
+
},
|
|
121
36
|
|
|
122
|
-
|
|
123
|
-
|
|
37
|
+
handle_header_registered(event) {
|
|
38
|
+
this.column_breakpoints[event.detail.index] = event.detail.breakpoint;
|
|
39
|
+
},
|
|
124
40
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return 'bi-chevron-expand';
|
|
128
|
-
}
|
|
129
|
-
return this.sort_direction === 'asc' ? 'bi-chevron-up' : 'bi-chevron-down';
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
handle_header_mounted(event) {
|
|
133
|
-
this.column_count = event.detail.count;
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
handle_header_registered(event) {
|
|
137
|
-
this.column_breakpoints[event.detail.index] = event.detail.breakpoint;
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
handle_row_deselected(event) {
|
|
41
|
+
handle_row_deselected(event) {
|
|
42
|
+
if (event.detail.table_id === this.table_id) {
|
|
141
43
|
this.selected_rows.delete(event.detail.row_id);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
handle_row_mounted(event) {
|
|
145
|
-
this.loaded_count++;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
146
46
|
|
|
147
|
-
|
|
148
|
-
|
|
47
|
+
handle_row_mounted(event) {
|
|
48
|
+
if (event.detail.table_id !== this.table_id) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
149
51
|
|
|
150
|
-
|
|
151
|
-
this.average_row_height = event.detail.row_element.offsetHeight;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
handle_row_selected(event) {
|
|
157
|
-
this.selected_rows.add(event.detail.row_id);
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
handle_rows_cleared() {
|
|
161
|
-
this.loaded_count = 0;
|
|
162
|
-
this.selected_rows.clear();
|
|
163
|
-
this.select_all = false;
|
|
164
|
-
},
|
|
52
|
+
this.loaded_count++;
|
|
165
53
|
|
|
166
|
-
|
|
167
|
-
this.
|
|
54
|
+
if (event.detail.row_element) {
|
|
55
|
+
this.apply_column_breakpoints(event.detail.row_element);
|
|
168
56
|
|
|
169
|
-
if (this.
|
|
170
|
-
this
|
|
171
|
-
} else {
|
|
172
|
-
this.selected_rows.clear();
|
|
173
|
-
this.$dispatch('deselect-all-rows', { table_id: this.table_id });
|
|
57
|
+
if (this.average_row_height === 0) {
|
|
58
|
+
this.average_row_height = event.detail.row_element.offsetHeight;
|
|
174
59
|
}
|
|
175
|
-
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
176
62
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
handle_total_count_updated(event) {
|
|
185
|
-
this.total_count = event.detail.total_count;
|
|
186
|
-
|
|
187
|
-
if (event.detail.batch_size) {
|
|
188
|
-
this.batch_size = event.detail.batch_size;
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
async load_more() {
|
|
193
|
-
if (!this.endpoint) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
this.is_loading = true;
|
|
198
|
-
this.skeleton_count = this.batch_size;
|
|
199
|
-
|
|
200
|
-
if (!this.$refs.table_body) {
|
|
201
|
-
this.cleanup_loading_state();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
let result = await this.fetch_rows(this.current_page + 1);
|
|
206
|
-
|
|
207
|
-
if (!result.success) {
|
|
208
|
-
this.cleanup_loading_state();
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (result.added > 0) {
|
|
213
|
-
this.current_page++;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (result.added < this.batch_size) {
|
|
217
|
-
this.has_next = false;
|
|
218
|
-
this.disconnect_observer();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
this.cleanup_loading_state();
|
|
222
|
-
|
|
223
|
-
await this.$nextTick();
|
|
224
|
-
await this.check_container_height();
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
async refresh_table() {
|
|
228
|
-
if (this.is_refreshing || this.is_loading) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
this.disconnect_observer();
|
|
233
|
-
|
|
234
|
-
this.prevent_auto_load = true;
|
|
235
|
-
this.skeleton_count = this.batch_size;
|
|
236
|
-
this.is_refreshing = true;
|
|
237
|
-
this.select_all = false;
|
|
238
|
-
|
|
239
|
-
await this.$nextTick();
|
|
240
|
-
|
|
241
|
-
this.reset_table_state();
|
|
242
|
-
|
|
243
|
-
let result = await this.fetch_rows(1);
|
|
244
|
-
this.update_counts_after_refresh(result);
|
|
245
|
-
|
|
246
|
-
await this.$nextTick();
|
|
247
|
-
await new Promise(resolve => setTimeout(resolve, 150));
|
|
248
|
-
|
|
249
|
-
this.is_refreshing = false;
|
|
250
|
-
this.skeleton_count = 0;
|
|
63
|
+
handle_row_selected(event) {
|
|
64
|
+
if (event.detail.table_id === this.table_id) {
|
|
65
|
+
this.selected_rows.add(event.detail.row_id);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
251
68
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
69
|
+
handle_row_cleared() {
|
|
70
|
+
this.loaded_count = 0;
|
|
71
|
+
this.selected_rows.clear();
|
|
72
|
+
this.select_all = false;
|
|
73
|
+
},
|
|
255
74
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
},
|
|
262
|
-
|
|
263
|
-
reset_scroll_position() {
|
|
264
|
-
requestAnimationFrame(() => {
|
|
265
|
-
if (this.$refs.table_container) {
|
|
266
|
-
this.$refs.table_container.scrollTop = 0;
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
reset_table_state() {
|
|
272
|
-
this.current_page = 1;
|
|
273
|
-
this.has_next = true;
|
|
274
|
-
this.is_row_open = {};
|
|
275
|
-
},
|
|
276
|
-
|
|
277
|
-
async setup_observer() {
|
|
278
|
-
let trigger = this.$refs.infinite_scroll_trigger;
|
|
279
|
-
|
|
280
|
-
if (!trigger) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
75
|
+
handle_table_total_count_updated(event) {
|
|
76
|
+
if (event.detail.table_id !== this.table_id) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
283
79
|
|
|
284
|
-
|
|
285
|
-
root: null,
|
|
286
|
-
rootMargin: '200px',
|
|
287
|
-
threshold: 0.01
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
this.observer = new IntersectionObserver(
|
|
291
|
-
(entries) => {
|
|
292
|
-
entries.forEach(async entry => {
|
|
293
|
-
if (entry.isIntersecting && this.has_next && !this.is_loading && !this.prevent_auto_load) {
|
|
294
|
-
await this.load_more();
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
},
|
|
298
|
-
options
|
|
299
|
-
);
|
|
300
|
-
|
|
301
|
-
this.observer.observe(trigger);
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
should_load_initial_data() {
|
|
305
|
-
return this.loaded_count === 0 && this.current_page === 0;
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
async sort_by(column) {
|
|
309
|
-
if (this.is_refreshing || this.is_loading) {
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
80
|
+
this.total_count = event.detail.total_count;
|
|
312
81
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
this.sort_direction = 'asc';
|
|
318
|
-
}
|
|
82
|
+
if (event.detail.batch_size) {
|
|
83
|
+
this.batch_size = event.detail.batch_size;
|
|
84
|
+
}
|
|
85
|
+
},
|
|
319
86
|
|
|
320
|
-
|
|
321
|
-
|
|
87
|
+
handle_toggle_all() {
|
|
88
|
+
this.select_all = !this.select_all;
|
|
322
89
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
90
|
+
if (this.select_all) {
|
|
91
|
+
this.$dispatch('select-all-rows', { table_id: this.table_id });
|
|
92
|
+
} else {
|
|
93
|
+
this.selected_rows.clear();
|
|
94
|
+
this.$dispatch('deselect-all-rows', { table_id: this.table_id });
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
handle_toggle_row(event) {
|
|
99
|
+
if (event.detail.table_id !== this.table_id) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
let row_id = event.detail.row_id;
|
|
104
|
+
this.is_row_open[row_id] = !this.is_row_open[row_id];
|
|
105
|
+
|
|
106
|
+
this.$dispatch('toggle-row-state', {
|
|
107
|
+
is_open: this.is_row_open[row_id],
|
|
108
|
+
row_id: row_id,
|
|
109
|
+
table_id: this.table_id
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
async refresh_table() {
|
|
114
|
+
await this.refresh();
|
|
115
|
+
},
|
|
116
|
+
{% endblock %}
|
|
117
|
+
|
|
118
|
+
{% block handle_item_mounted %}{% endblock %}
|
|
119
|
+
{% block handle_item_cleared %}{% endblock %}
|
|
120
|
+
{% block handle_total_count_updated %}{% endblock %}
|
|
121
|
+
|
|
122
|
+
{% block scroll_reset_state %}
|
|
123
|
+
this.selected_rows.clear();
|
|
124
|
+
this.select_all = false;
|
|
125
|
+
this.is_row_open = {};
|
|
126
|
+
{% endblock %}
|
|
127
|
+
|
|
128
|
+
{% block scroll_event %}
|
|
331
129
|
@header-mounted="handle_header_mounted($event)"
|
|
332
130
|
@header-registered="handle_header_registered($event)"
|
|
333
|
-
@row-deselected.window="
|
|
334
|
-
@row-mounted.window="
|
|
335
|
-
@row-selected.window="
|
|
336
|
-
@
|
|
337
|
-
@total-count-updated.window="
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
131
|
+
@row-deselected.window="handle_row_deselected($event)"
|
|
132
|
+
@row-mounted.window="handle_row_mounted($event)"
|
|
133
|
+
@row-selected.window="handle_row_selected($event)"
|
|
134
|
+
@row-cleared.window="if ($event.detail.table_id === table_id) handle_row_cleared()"
|
|
135
|
+
@table-total-count-updated.window="handle_table_total_count_updated($event)"
|
|
136
|
+
@toggle-row.window="handle_toggle_row($event)"
|
|
137
|
+
{% endblock %}
|
|
138
|
+
|
|
139
|
+
{% block scroll_container %}
|
|
140
|
+
<div
|
|
141
|
+
class="position-relative table-container"
|
|
142
|
+
style="height: {{ table_height|default:'600px' }}; overflow-x: auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;"
|
|
143
|
+
x-ref="scroll_container"
|
|
144
|
+
:data-table-id="table_id"
|
|
145
|
+
>
|
|
146
|
+
<table
|
|
147
|
+
class="table table-hover table-striped fs-7 w-100 {% block table_class %}{% endblock %}"
|
|
148
|
+
:style="'min-width: ' + (responsive_mode === 'scroll' ? '100%' : '800px') + '; ' + (any_row_has_children ? 'table-layout: fixed;' : 'table-layout: auto;')"
|
|
349
149
|
>
|
|
350
|
-
<
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
>
|
|
368
|
-
</th>
|
|
369
|
-
|
|
370
|
-
<th style="min-width: 30px; width: 30px;"></th>
|
|
371
|
-
{% endblock %}
|
|
372
|
-
|
|
373
|
-
{% block table_header %}{% endblock %}
|
|
374
|
-
|
|
375
|
-
{% block table_header_end %}
|
|
376
|
-
<th style="min-width: 70px; width: 70px;">Actions</th>
|
|
377
|
-
{% endblock %}
|
|
150
|
+
<thead class="{% block table_head_class %}bg-app-layer-two sticky-top{% endblock %}">
|
|
151
|
+
<tr
|
|
152
|
+
x-init="column_count = $el.children.length; $dispatch('header-mounted', { count: column_count })"
|
|
153
|
+
x-ref="header_row"
|
|
154
|
+
>
|
|
155
|
+
{% block table_header_container %}
|
|
156
|
+
{% block table_header_start %}
|
|
157
|
+
<th style="min-width: 30px; width: 30px;">
|
|
158
|
+
<input
|
|
159
|
+
:checked="select_all"
|
|
160
|
+
:disabled="is_loading || is_refreshing"
|
|
161
|
+
@change="handle_toggle_all()"
|
|
162
|
+
type="checkbox"
|
|
163
|
+
>
|
|
164
|
+
</th>
|
|
165
|
+
|
|
166
|
+
<th style="min-width: 30px; width: 30px;"></th>
|
|
378
167
|
{% endblock %}
|
|
379
|
-
</tr>
|
|
380
|
-
</thead>
|
|
381
168
|
|
|
382
|
-
|
|
383
|
-
x-ref="table_body"
|
|
384
|
-
x-show="!is_refreshing"
|
|
385
|
-
:data-table-id="table_id"
|
|
386
|
-
>
|
|
387
|
-
{% block refreshing_skeleton %}
|
|
388
|
-
{% include 'django_spire/table/element/refreshing_skeleton.html' %}
|
|
389
|
-
{% endblock %}
|
|
169
|
+
{% block table_header %}{% endblock %}
|
|
390
170
|
|
|
391
|
-
|
|
171
|
+
{% block table_header_end %}
|
|
172
|
+
<th style="min-width: 70px; width: 70px;">Actions</th>
|
|
173
|
+
{% endblock %}
|
|
392
174
|
{% endblock %}
|
|
175
|
+
</tr>
|
|
176
|
+
</thead>
|
|
393
177
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
178
|
+
<tbody
|
|
179
|
+
x-ref="content_container"
|
|
180
|
+
x-show="!is_refreshing"
|
|
181
|
+
:data-table-id="table_id"
|
|
182
|
+
>
|
|
183
|
+
{% block table_body %}{% endblock %}
|
|
184
|
+
</tbody>
|
|
185
|
+
|
|
186
|
+
{% block refreshing_skeleton %}
|
|
187
|
+
{% include 'django_spire/table/element/refreshing_skeleton.html' %}
|
|
188
|
+
{% endblock %}
|
|
399
189
|
|
|
400
|
-
{% block
|
|
401
|
-
{% include 'django_spire/table/element/
|
|
190
|
+
{% block loading_skeleton %}
|
|
191
|
+
{% include 'django_spire/table/element/loading_skeleton.html' %}
|
|
402
192
|
{% endblock %}
|
|
193
|
+
|
|
194
|
+
{% block no_data %}
|
|
195
|
+
{% include 'django_spire/table/item/no_data_item.html' %}
|
|
196
|
+
{% endblock %}
|
|
197
|
+
</table>
|
|
198
|
+
|
|
199
|
+
{% block trigger %}
|
|
200
|
+
{% include 'django_spire/table/element/trigger.html' %}
|
|
201
|
+
{% endblock %}
|
|
202
|
+
</div>
|
|
203
|
+
{% endblock %}
|
|
204
|
+
|
|
205
|
+
{% block scroll_footer %}
|
|
206
|
+
<div class="row mt-3">
|
|
207
|
+
<div class="col text-start">
|
|
208
|
+
<span class="fs-7 text-app-secondary">
|
|
209
|
+
Showing <span x-text="loaded_count"></span> of <span x-text="total_count"></span> rows
|
|
210
|
+
</span>
|
|
403
211
|
</div>
|
|
404
|
-
{% endblock %}
|
|
405
212
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
</
|
|
213
|
+
<div class="col-auto text-end">
|
|
214
|
+
<span class="fs-7 text-app-secondary" x-cloak x-show="selected_rows.size > 0">
|
|
215
|
+
<span x-text="selected_rows.size"></span> selected
|
|
216
|
+
</span>
|
|
217
|
+
|
|
218
|
+
{% block footer_table_action %}{% endblock %}
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
{% endblock %}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
<div class="col-6 text-start">
|
|
3
|
-
<span class="fs-7 text-app-secondary">
|
|
4
|
-
Showing <span x-text="loaded_count"></span> of <span x-text="total_count"></span> rows
|
|
5
|
-
</span>
|
|
6
|
-
</div>
|
|
1
|
+
{% extends 'django_spire/infinite_scroll/element/footer.html' %}
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</span>
|
|
3
|
+
{% block footer_action %}
|
|
4
|
+
<span class="fs-7 text-app-secondary" x-cloak x-show="selected_rows.size > 0">
|
|
5
|
+
<span x-text="selected_rows.size"></span> selected
|
|
6
|
+
</span>
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
8
|
+
{% block footer_table_action %}{% endblock %}
|
|
9
|
+
{% endblock %}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<th
|
|
2
2
|
data-breakpoint="{{ breakpoint|default:'' }}"
|
|
3
3
|
{% if sort_key %}@click="sort_by('{{ sort_key }}')"{% endif %}
|
|
4
|
-
class="{% if sort_key %}cursor-pointer{% endif %} {% if breakpoint %}d-none d-{{ breakpoint }}-table-cell{% endif %} user-select-none {{ extra_class|default:'' }}"
|
|
4
|
+
class="{% if sort_key %}cursor-pointer{% endif %} {% if breakpoint and responsive_mode != 'scroll' %}d-none d-{{ breakpoint }}-table-cell{% endif %} user-select-none {{ extra_class|default:'' }}"
|
|
5
5
|
style="{{ style|default:'' }}"
|
|
6
6
|
x-init="let index = Array.from($el.parentElement.children).indexOf($el); $dispatch('header-registered', { index: index, breakpoint: '{{ breakpoint|default:'' }}' || null });"
|
|
7
7
|
>
|