@leavittsoftware/web 1.0.0 → 1.2.1
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/leavitt/api-service/api-service.js +6 -6
- package/leavitt/api-service/api-service.js.map +1 -1
- package/leavitt/api-service/api2-service.js +1 -1
- package/leavitt/api-service/api2-service.js.map +1 -1
- package/leavitt/api-service/mapi-service.js +1 -1
- package/leavitt/api-service/mapi-service.js.map +1 -1
- package/leavitt/api-service/odata-response.js +2 -2
- package/leavitt/api-service/odata-response.js.map +1 -1
- package/leavitt/company-select/company-select.js +10 -10
- package/leavitt/person-company-select/person-company-select.js +14 -14
- package/leavitt/person-group-select/person-group-select.js +18 -18
- package/leavitt/person-select/person-select.js +4 -4
- package/leavitt/profile-picture/profile-picture-menu.js +96 -96
- package/leavitt/profile-picture/profile-picture.js +64 -64
- package/leavitt/user-feedback/user-feedback.js +79 -79
- package/package.json +37 -36
- package/titanium/access-denied-page/access-denied-page.js +330 -330
- package/titanium/address-input/address-input.js +17 -17
- package/titanium/address-input/address-input.js.map +1 -1
- package/titanium/address-input/google-address-input.js +4 -4
- package/titanium/address-input/manual-address-dialog.js +127 -127
- package/titanium/card/card.js +117 -117
- package/titanium/chip-multi-select/chip-multi-select.js +38 -38
- package/titanium/data-table/data-table-header.js +95 -95
- package/titanium/data-table/data-table-item.js +163 -163
- package/titanium/data-table/data-table.js +313 -313
- package/titanium/data-table/data-table.js.map +1 -1
- package/titanium/data-table/filter-controller.js +5 -5
- package/titanium/data-table/filter-controller.js.map +1 -1
- package/titanium/data-table/page-control.js +75 -75
- package/titanium/data-table/page-control.js.map +1 -1
- package/titanium/date-range-selector/date-range-change-event.js.map +1 -1
- package/titanium/date-range-selector/date-range-selector.d.ts +1 -11
- package/titanium/date-range-selector/date-range-selector.js +53 -271
- package/titanium/date-range-selector/date-range-selector.js.map +1 -1
- package/titanium/date-range-selector/types/date-range-key.d.ts +2 -0
- package/titanium/date-range-selector/types/date-range-key.js +2 -0
- package/titanium/date-range-selector/types/date-range-key.js.map +1 -0
- package/titanium/date-range-selector/types/date-range-option.d.ts +8 -0
- package/titanium/date-range-selector/types/date-range-option.js +2 -0
- package/titanium/date-range-selector/types/date-range-option.js.map +1 -0
- package/titanium/date-range-selector/types/date-range-time-key.d.ts +2 -0
- package/titanium/date-range-selector/types/date-range-time-key.js +2 -0
- package/titanium/date-range-selector/types/date-range-time-key.js.map +1 -0
- package/titanium/date-range-selector/types/date-ranges.d.ts +4 -0
- package/titanium/date-range-selector/types/date-ranges.js +139 -0
- package/titanium/date-range-selector/types/date-ranges.js.map +1 -0
- package/titanium/date-range-selector/types/date-time-ranges.d.ts +4 -0
- package/titanium/date-range-selector/types/date-time-ranges.js +86 -0
- package/titanium/date-range-selector/types/date-time-ranges.js.map +1 -0
- package/titanium/date-range-selector/types/range-label.d.ts +3 -0
- package/titanium/date-range-selector/types/range-label.js +14 -0
- package/titanium/date-range-selector/types/range-label.js.map +1 -0
- package/titanium/date-range-selector/types/range-time-label.d.ts +3 -0
- package/titanium/date-range-selector/types/range-time-label.js +14 -0
- package/titanium/date-range-selector/types/range-time-label.js.map +1 -0
- package/titanium/drawer/drawer.js +125 -125
- package/titanium/drawer/drawer.js.map +1 -1
- package/titanium/duration-input/human-interval.js +6 -6
- package/titanium/duration-input/human-interval.js.map +1 -1
- package/titanium/error-page/error-page.js +66 -66
- package/titanium/event-bus/event-bus.js +7 -7
- package/titanium/event-bus/event-bus.js.map +1 -1
- package/titanium/extendable-outlined-text-field/extendable-outlined-text-field.js +28 -28
- package/titanium/full-page-loading-indicator/full-page-loading-indicator.js +48 -48
- package/titanium/header/header.js +83 -83
- package/titanium/helpers/csv/convert-array-to-csv.d.ts +2 -0
- package/titanium/helpers/csv/convert-array-to-csv.js +38 -0
- package/titanium/helpers/csv/convert-array-to-csv.js.map +1 -0
- package/titanium/helpers/csv/flatten-object.d.ts +2 -0
- package/titanium/helpers/{csv-download.js → csv/flatten-object.js} +1 -12
- package/titanium/helpers/csv/flatten-object.js.map +1 -0
- package/titanium/helpers/csv/start-csv-download.d.ts +2 -0
- package/titanium/helpers/csv/start-csv-download.js +12 -0
- package/titanium/helpers/csv/start-csv-download.js.map +1 -0
- package/titanium/helpers/debouncer.js.map +1 -1
- package/titanium/helpers/{odata-helpers.d.ts → escape-term.d.ts} +1 -1
- package/titanium/helpers/{odata-helpers.js → escape-term.js} +1 -1
- package/titanium/helpers/escape-term.js.map +1 -0
- package/titanium/helpers/{leavitt-cdn.d.ts → get-cdn-Inline-url.d.ts} +1 -2
- package/titanium/helpers/{leavitt-cdn.js → get-cdn-Inline-url.js} +1 -12
- package/titanium/helpers/get-cdn-Inline-url.js.map +1 -0
- package/titanium/helpers/get-cdn-download-url.d.ts +3 -0
- package/titanium/helpers/get-cdn-download-url.js +12 -0
- package/titanium/helpers/get-cdn-download-url.js.map +1 -0
- package/titanium/helpers/{search-token.d.ts → get-search-token.d.ts} +1 -1
- package/titanium/helpers/{search-token.js → get-search-token.js} +4 -4
- package/titanium/helpers/get-search-token.js.map +1 -0
- package/titanium/helpers/helpers.d.ts +6 -5
- package/titanium/helpers/helpers.js +6 -5
- package/titanium/helpers/helpers.js.map +1 -1
- package/titanium/helpers/{media-query.d.ts → install-media-query-watcher.d.ts} +1 -1
- package/titanium/helpers/{media-query.js → install-media-query-watcher.js} +2 -2
- package/titanium/helpers/install-media-query-watcher.js.map +1 -0
- package/titanium/helpers/{dev-detection.d.ts → is-development.d.ts} +1 -1
- package/titanium/helpers/{dev-detection.js → is-development.js} +2 -2
- package/titanium/helpers/is-development.js.map +1 -0
- package/titanium/icon-picker/icon-picker.js +4 -4
- package/titanium/search-input/search-input.js +117 -117
- package/titanium/show-hide/show-hide.js +54 -54
- package/titanium/show-hide/show-hide.js.map +1 -1
- package/titanium/single-select-base/single-select-base.js +93 -92
- package/titanium/single-select-base/single-select-base.js.map +1 -1
- package/titanium/smart-attachment-input/crop-and-save-image-dialog.js +115 -115
- package/titanium/smart-attachment-input/cropper-styles.js +307 -307
- package/titanium/smart-attachment-input/image-preview-dialog.js +29 -29
- package/titanium/smart-attachment-input/smart-attachment-input.js +83 -82
- package/titanium/smart-attachment-input/smart-attachment-input.js.map +1 -1
- package/titanium/snackbar/snackbar.js +133 -133
- package/titanium/styles/a.js +15 -15
- package/titanium/styles/data-row.js +43 -43
- package/titanium/styles/ellipsis.js +6 -6
- package/titanium/styles/h1.js +14 -14
- package/titanium/styles/h2.js +14 -14
- package/titanium/styles/h3.js +14 -14
- package/titanium/styles/h4.js +14 -14
- package/titanium/styles/h5.js +16 -16
- package/titanium/styles/p.js +14 -14
- package/titanium/toolbar/toolbar.js +45 -45
- package/titanium/types/pending-state-event.js.map +1 -1
- package/titanium/youtube-input/youtube-input.js +9 -9
- package/titanium/address-input/Address.js.map +0 -1
- package/titanium/address-input/types/address.js.map +0 -1
- package/titanium/address-input/types/autocomplete-prediction-suggestion.js.map +0 -1
- package/titanium/date-range-selector/range-label.d.ts +0 -4
- package/titanium/date-range-selector/range-label.js +0 -25
- package/titanium/date-range-selector/range-label.js.map +0 -1
- package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.d.ts +0 -45
- package/titanium/extendable-outlined-text-field/extensible-outlined-text-field.js.map +0 -1
- package/titanium/helpers/csv-download.d.ts +0 -3
- package/titanium/helpers/csv-download.js.map +0 -1
- package/titanium/helpers/dev-detection.js.map +0 -1
- package/titanium/helpers/leavitt-cdn.js.map +0 -1
- package/titanium/helpers/media-query.js.map +0 -1
- package/titanium/helpers/odata-helpers.js.map +0 -1
- package/titanium/helpers/search-token.js.map +0 -1
|
@@ -101,7 +101,7 @@ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
|
|
|
101
101
|
}
|
|
102
102
|
async firstUpdated() {
|
|
103
103
|
if (typeof ResizeObserver === 'function') {
|
|
104
|
-
const ro = new ResizeObserver(entries => {
|
|
104
|
+
const ro = new ResizeObserver((entries) => {
|
|
105
105
|
for (const entry of entries) {
|
|
106
106
|
const cr = entry.contentRect;
|
|
107
107
|
this.narrow = cr.width < 560;
|
|
@@ -112,7 +112,7 @@ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
|
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
114
|
const mql = window.matchMedia('(max-width: 768px)');
|
|
115
|
-
mql.addEventListener('change', e => {
|
|
115
|
+
mql.addEventListener('change', (e) => {
|
|
116
116
|
this.narrow = e.matches;
|
|
117
117
|
this.updateChildrenIsNarrow();
|
|
118
118
|
});
|
|
@@ -143,8 +143,8 @@ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
|
|
|
143
143
|
* @ignore
|
|
144
144
|
*/
|
|
145
145
|
updateChildrenIsNarrow() {
|
|
146
|
-
this.itemsSlot.assignedElements().forEach(o => (o.narrow = this.narrow));
|
|
147
|
-
this.tableHeaders.assignedElements().forEach(o => (o.narrow = this.narrow));
|
|
146
|
+
this.itemsSlot.assignedElements().forEach((o) => (o.narrow = this.narrow));
|
|
147
|
+
this.tableHeaders.assignedElements().forEach((o) => (o.narrow = this.narrow));
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* de-select all table items and clear this.selected
|
|
@@ -184,290 +184,290 @@ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
#deselectAll() {
|
|
187
|
-
this.#getTableItems().forEach(o => o.deselect());
|
|
187
|
+
this.#getTableItems().forEach((o) => o.deselect());
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
190
|
* select all table items
|
|
191
191
|
*/
|
|
192
192
|
selectAll() {
|
|
193
193
|
if (!this.singleSelect) {
|
|
194
|
-
this.#getTableItems().forEach(o => o.select());
|
|
194
|
+
this.#getTableItems().forEach((o) => o.select());
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
#getTableItems() {
|
|
198
|
-
return this.itemsSlot.assignedElements().filter(o => typeof o.select === 'function' && typeof o.deselect === 'function');
|
|
198
|
+
return this.itemsSlot.assignedElements().filter((o) => typeof o.select === 'function' && typeof o.deselect === 'function');
|
|
199
199
|
}
|
|
200
200
|
static { this.styles = [
|
|
201
201
|
h1,
|
|
202
202
|
ellipsis,
|
|
203
|
-
css `
|
|
204
|
-
:host {
|
|
205
|
-
display: flex;
|
|
206
|
-
flex-direction: column;
|
|
207
|
-
|
|
208
|
-
border: 1px solid var(--md-sys-color-outline-variant);
|
|
209
|
-
border-radius: 8px;
|
|
210
|
-
font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
|
|
211
|
-
--titanium-page-control-font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
|
|
212
|
-
-webkit-font-smoothing: antialiased;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
header {
|
|
216
|
-
display: flex;
|
|
217
|
-
flex-direction: column;
|
|
218
|
-
padding-bottom: 12px;
|
|
219
|
-
gap: 12px;
|
|
220
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
221
|
-
position: relative;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/* HEADER ROW ONE */
|
|
225
|
-
|
|
226
|
-
section[row-one] {
|
|
227
|
-
display: grid;
|
|
228
|
-
grid: 'head menu' / 1fr auto;
|
|
229
|
-
gap: 8px;
|
|
230
|
-
padding: 12px 12px 0 12px;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
section[row-one] div[head] {
|
|
234
|
-
grid-area: head;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
section[row-one] div[menu] {
|
|
238
|
-
grid-area: menu;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
div[search] {
|
|
242
|
-
grid-area: search;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/* HEADER ROW TWO */
|
|
246
|
-
|
|
247
|
-
section[row-two] {
|
|
248
|
-
display: grid;
|
|
249
|
-
grid: 'search-filter add' / 1fr auto;
|
|
250
|
-
gap: 8px;
|
|
251
|
-
padding: 0 12px 0 20px;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
:host([narrow]) section[row-two] {
|
|
255
|
-
grid:
|
|
256
|
-
'search-filter '
|
|
257
|
-
'add' / auto;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
section[row-two] div[search-filter] {
|
|
261
|
-
grid-area: search-filter;
|
|
262
|
-
display: flex;
|
|
263
|
-
flex-wrap: wrap;
|
|
264
|
-
align-items: center;
|
|
265
|
-
gap: 8px;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
section[row-two] div[add-button] {
|
|
269
|
-
grid-area: add;
|
|
270
|
-
justify-self: end;
|
|
271
|
-
align-self: end;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
h1 {
|
|
275
|
-
padding: 12px 12px 0 12px;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
selected-actions {
|
|
279
|
-
display: grid;
|
|
280
|
-
gap: 6px 24px;
|
|
281
|
-
grid: 'selected-text buttons';
|
|
282
|
-
background-color: var(--md-sys-color-secondary-container);
|
|
283
|
-
position: absolute;
|
|
284
|
-
top: 0px;
|
|
285
|
-
left: 0px;
|
|
286
|
-
right: 0px;
|
|
287
|
-
bottom: 0px;
|
|
288
|
-
margin: 0 !important;
|
|
289
|
-
padding: 0 12px 12px 24px;
|
|
290
|
-
align-content: end;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
selected-actions h2 {
|
|
294
|
-
color: var(--md-sys-color-on-secondary-container);
|
|
295
|
-
font-size: 18px;
|
|
296
|
-
font-weight: 400;
|
|
297
|
-
align-self: end;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
selected-actions div[buttons] {
|
|
301
|
-
display: flex;
|
|
302
|
-
flex-wrap: wrap;
|
|
303
|
-
align-items: center;
|
|
304
|
-
gap: 0 8px;
|
|
305
|
-
justify-content: flex-end;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
table-header {
|
|
309
|
-
display: flex;
|
|
310
|
-
flex-direction: row;
|
|
311
|
-
min-height: 48px;
|
|
312
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
table-header ::slotted(titanium-data-table-header:last-of-type) {
|
|
316
|
-
padding-right: 24px;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
md-linear-progress {
|
|
320
|
-
width: 100%;
|
|
321
|
-
margin-top: -4px;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
main {
|
|
325
|
-
position: relative;
|
|
326
|
-
min-height: 48px;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
content-veil {
|
|
330
|
-
display: none;
|
|
331
|
-
position: absolute;
|
|
332
|
-
top: 0;
|
|
333
|
-
left: 0;
|
|
334
|
-
width: 100%;
|
|
335
|
-
height: 100%;
|
|
336
|
-
background-color: var(--md-sys-color-scrim);
|
|
337
|
-
opacity: 0;
|
|
338
|
-
-webkit-transition: opacity 75ms linear;
|
|
339
|
-
-o-transition: opacity 75ms linear;
|
|
340
|
-
transition: opacity 75ms linear;
|
|
341
|
-
z-index: 6;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
content-veil[opened] {
|
|
345
|
-
opacity: 0.12;
|
|
346
|
-
display: block;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
table-message {
|
|
350
|
-
display: flex;
|
|
351
|
-
place-items: center;
|
|
352
|
-
justify-content: center;
|
|
353
|
-
gap: 8px;
|
|
354
|
-
padding: 64px;
|
|
355
|
-
|
|
356
|
-
font-size: 14px;
|
|
357
|
-
z-index: 10;
|
|
358
|
-
line-height: 20px;
|
|
359
|
-
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
table-message md-icon {
|
|
363
|
-
align-self: center;
|
|
364
|
-
flex-shrink: 0;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
footer {
|
|
368
|
-
display: grid;
|
|
369
|
-
grid: 'controls footer-slot' / minmax(400px, 1fr) auto;
|
|
370
|
-
gap: 24px;
|
|
371
|
-
padding: 12px;
|
|
372
|
-
align-items: center;
|
|
373
|
-
margin-top: -1px;
|
|
374
|
-
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
titanium-page-control {
|
|
378
|
-
grid-area: controls;
|
|
379
|
-
margin-left: 12px;
|
|
380
|
-
justify-self: start;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
div[footer] {
|
|
384
|
-
justify-self: end;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
:host([narrow]) footer {
|
|
388
|
-
grid:
|
|
389
|
-
'controls'
|
|
390
|
-
'footer-slot' / auto;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
:host([disable-paging]) footer {
|
|
394
|
-
grid: 'footer-slot' / auto;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
footer-buttons {
|
|
398
|
-
display: flex;
|
|
399
|
-
gap: 12px;
|
|
400
|
-
flex-wrap: wrap;
|
|
401
|
-
align-items: flex-end;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
div[add-button] {
|
|
405
|
-
display: flex;
|
|
406
|
-
align-items: center;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
div[items-slot] {
|
|
410
|
-
position: relative;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
md-checkbox {
|
|
414
|
-
flex-shrink: 0;
|
|
415
|
-
align-self: center;
|
|
416
|
-
margin: 0 14px 0 20px;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
:host([disable-select]) table-header ::slotted(titanium-data-table-header:first-of-type) {
|
|
420
|
-
padding-left: 24px;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
:host(:not([disable-select])[single-select]) table-header {
|
|
424
|
-
padding-left: 57px;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
[hidden] {
|
|
428
|
-
display: none !important;
|
|
429
|
-
}
|
|
203
|
+
css `
|
|
204
|
+
:host {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
|
|
208
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
209
|
+
border-radius: 8px;
|
|
210
|
+
font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
|
|
211
|
+
--titanium-page-control-font-family: var(--titanium-data-table-font-family, Roboto, Noto, sans-serif);
|
|
212
|
+
-webkit-font-smoothing: antialiased;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
header {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
padding-bottom: 12px;
|
|
219
|
+
gap: 12px;
|
|
220
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
221
|
+
position: relative;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* HEADER ROW ONE */
|
|
225
|
+
|
|
226
|
+
section[row-one] {
|
|
227
|
+
display: grid;
|
|
228
|
+
grid: 'head menu' / 1fr auto;
|
|
229
|
+
gap: 8px;
|
|
230
|
+
padding: 12px 12px 0 12px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
section[row-one] div[head] {
|
|
234
|
+
grid-area: head;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
section[row-one] div[menu] {
|
|
238
|
+
grid-area: menu;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
div[search] {
|
|
242
|
+
grid-area: search;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* HEADER ROW TWO */
|
|
246
|
+
|
|
247
|
+
section[row-two] {
|
|
248
|
+
display: grid;
|
|
249
|
+
grid: 'search-filter add' / 1fr auto;
|
|
250
|
+
gap: 8px;
|
|
251
|
+
padding: 0 12px 0 20px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:host([narrow]) section[row-two] {
|
|
255
|
+
grid:
|
|
256
|
+
'search-filter '
|
|
257
|
+
'add' / auto;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
section[row-two] div[search-filter] {
|
|
261
|
+
grid-area: search-filter;
|
|
262
|
+
display: flex;
|
|
263
|
+
flex-wrap: wrap;
|
|
264
|
+
align-items: center;
|
|
265
|
+
gap: 8px;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
section[row-two] div[add-button] {
|
|
269
|
+
grid-area: add;
|
|
270
|
+
justify-self: end;
|
|
271
|
+
align-self: end;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
h1 {
|
|
275
|
+
padding: 12px 12px 0 12px;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
selected-actions {
|
|
279
|
+
display: grid;
|
|
280
|
+
gap: 6px 24px;
|
|
281
|
+
grid: 'selected-text buttons';
|
|
282
|
+
background-color: var(--md-sys-color-secondary-container);
|
|
283
|
+
position: absolute;
|
|
284
|
+
top: 0px;
|
|
285
|
+
left: 0px;
|
|
286
|
+
right: 0px;
|
|
287
|
+
bottom: 0px;
|
|
288
|
+
margin: 0 !important;
|
|
289
|
+
padding: 0 12px 12px 24px;
|
|
290
|
+
align-content: end;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
selected-actions h2 {
|
|
294
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
295
|
+
font-size: 18px;
|
|
296
|
+
font-weight: 400;
|
|
297
|
+
align-self: end;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
selected-actions div[buttons] {
|
|
301
|
+
display: flex;
|
|
302
|
+
flex-wrap: wrap;
|
|
303
|
+
align-items: center;
|
|
304
|
+
gap: 0 8px;
|
|
305
|
+
justify-content: flex-end;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
table-header {
|
|
309
|
+
display: flex;
|
|
310
|
+
flex-direction: row;
|
|
311
|
+
min-height: 48px;
|
|
312
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
table-header ::slotted(titanium-data-table-header:last-of-type) {
|
|
316
|
+
padding-right: 24px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
md-linear-progress {
|
|
320
|
+
width: 100%;
|
|
321
|
+
margin-top: -4px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
main {
|
|
325
|
+
position: relative;
|
|
326
|
+
min-height: 48px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
content-veil {
|
|
330
|
+
display: none;
|
|
331
|
+
position: absolute;
|
|
332
|
+
top: 0;
|
|
333
|
+
left: 0;
|
|
334
|
+
width: 100%;
|
|
335
|
+
height: 100%;
|
|
336
|
+
background-color: var(--md-sys-color-scrim);
|
|
337
|
+
opacity: 0;
|
|
338
|
+
-webkit-transition: opacity 75ms linear;
|
|
339
|
+
-o-transition: opacity 75ms linear;
|
|
340
|
+
transition: opacity 75ms linear;
|
|
341
|
+
z-index: 6;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
content-veil[opened] {
|
|
345
|
+
opacity: 0.12;
|
|
346
|
+
display: block;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
table-message {
|
|
350
|
+
display: flex;
|
|
351
|
+
place-items: center;
|
|
352
|
+
justify-content: center;
|
|
353
|
+
gap: 8px;
|
|
354
|
+
padding: 64px;
|
|
355
|
+
|
|
356
|
+
font-size: 14px;
|
|
357
|
+
z-index: 10;
|
|
358
|
+
line-height: 20px;
|
|
359
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
table-message md-icon {
|
|
363
|
+
align-self: center;
|
|
364
|
+
flex-shrink: 0;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
footer {
|
|
368
|
+
display: grid;
|
|
369
|
+
grid: 'controls footer-slot' / minmax(400px, 1fr) auto;
|
|
370
|
+
gap: 24px;
|
|
371
|
+
padding: 12px;
|
|
372
|
+
align-items: center;
|
|
373
|
+
margin-top: -1px;
|
|
374
|
+
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
titanium-page-control {
|
|
378
|
+
grid-area: controls;
|
|
379
|
+
margin-left: 12px;
|
|
380
|
+
justify-self: start;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
div[footer] {
|
|
384
|
+
justify-self: end;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
:host([narrow]) footer {
|
|
388
|
+
grid:
|
|
389
|
+
'controls'
|
|
390
|
+
'footer-slot' / auto;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
:host([disable-paging]) footer {
|
|
394
|
+
grid: 'footer-slot' / auto;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
footer-buttons {
|
|
398
|
+
display: flex;
|
|
399
|
+
gap: 12px;
|
|
400
|
+
flex-wrap: wrap;
|
|
401
|
+
align-items: flex-end;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
div[add-button] {
|
|
405
|
+
display: flex;
|
|
406
|
+
align-items: center;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
div[items-slot] {
|
|
410
|
+
position: relative;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
md-checkbox {
|
|
414
|
+
flex-shrink: 0;
|
|
415
|
+
align-self: center;
|
|
416
|
+
margin: 0 14px 0 20px;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
:host([disable-select]) table-header ::slotted(titanium-data-table-header:first-of-type) {
|
|
420
|
+
padding-left: 24px;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
:host(:not([disable-select])[single-select]) table-header {
|
|
424
|
+
padding-left: 57px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
[hidden] {
|
|
428
|
+
display: none !important;
|
|
429
|
+
}
|
|
430
430
|
`,
|
|
431
431
|
]; }
|
|
432
432
|
render() {
|
|
433
|
-
return html `
|
|
434
|
-
<header part="header">
|
|
435
|
-
<section row-one>
|
|
436
|
-
<div head ellipsis part="table-header-text-container">
|
|
437
|
-
<slot name="table-header-text"> <h1 ellipsis>${this.header}</h1></slot>
|
|
438
|
-
</div>
|
|
439
|
-
<div menu part="table-actions-container">
|
|
440
|
-
<slot name="table-actions"></slot>
|
|
441
|
-
</div>
|
|
442
|
-
</section>
|
|
443
|
-
<section row-two>
|
|
444
|
-
<div search-filter part="filters-container">
|
|
445
|
-
<slot name="search-button"></slot>
|
|
446
|
-
<slot name="filter-button"></slot>
|
|
447
|
-
<slot name="filters"></slot>
|
|
448
|
-
</div>
|
|
449
|
-
<div add-button part="add-button-container">
|
|
450
|
-
<slot name="add-button"></slot>
|
|
451
|
-
</div>
|
|
452
|
-
</section>
|
|
453
|
-
|
|
454
|
-
<selected-actions ?hidden="${this.selected.length === 0}">
|
|
455
|
-
<h2 ellipsis>${this.selected.length} item${this.selected.length > 1 ? 's' : ''} selected</h2>
|
|
456
|
-
<div buttons part="selected-actions-container">
|
|
457
|
-
<slot name="selected-actions"></slot>
|
|
458
|
-
</div>
|
|
459
|
-
</selected-actions>
|
|
460
|
-
</header>
|
|
461
|
-
|
|
462
|
-
<table-container
|
|
463
|
-
@titanium-data-table-item-selected-changed=${e => {
|
|
433
|
+
return html `
|
|
434
|
+
<header part="header">
|
|
435
|
+
<section row-one>
|
|
436
|
+
<div head ellipsis part="table-header-text-container">
|
|
437
|
+
<slot name="table-header-text"> <h1 ellipsis>${this.header}</h1></slot>
|
|
438
|
+
</div>
|
|
439
|
+
<div menu part="table-actions-container">
|
|
440
|
+
<slot name="table-actions"></slot>
|
|
441
|
+
</div>
|
|
442
|
+
</section>
|
|
443
|
+
<section row-two>
|
|
444
|
+
<div search-filter part="filters-container">
|
|
445
|
+
<slot name="search-button"></slot>
|
|
446
|
+
<slot name="filter-button"></slot>
|
|
447
|
+
<slot name="filters"></slot>
|
|
448
|
+
</div>
|
|
449
|
+
<div add-button part="add-button-container">
|
|
450
|
+
<slot name="add-button"></slot>
|
|
451
|
+
</div>
|
|
452
|
+
</section>
|
|
453
|
+
|
|
454
|
+
<selected-actions ?hidden="${this.selected.length === 0}">
|
|
455
|
+
<h2 ellipsis>${this.selected.length} item${this.selected.length > 1 ? 's' : ''} selected</h2>
|
|
456
|
+
<div buttons part="selected-actions-container">
|
|
457
|
+
<slot name="selected-actions"></slot>
|
|
458
|
+
</div>
|
|
459
|
+
</selected-actions>
|
|
460
|
+
</header>
|
|
461
|
+
|
|
462
|
+
<table-container
|
|
463
|
+
@titanium-data-table-item-selected-changed=${(e) => {
|
|
464
464
|
e.stopPropagation();
|
|
465
465
|
const dataTableItem = e.target;
|
|
466
466
|
if (dataTableItem.selected) {
|
|
467
467
|
if (this.singleSelect) {
|
|
468
468
|
this.#getTableItems()
|
|
469
|
-
.filter(o => o.item !== dataTableItem.item)
|
|
470
|
-
.forEach(o => o.deselect());
|
|
469
|
+
.filter((o) => o.item !== dataTableItem.item)
|
|
470
|
+
.forEach((o) => o.deselect());
|
|
471
471
|
}
|
|
472
472
|
this.selected.push(dataTableItem.item);
|
|
473
473
|
this.requestUpdate();
|
|
@@ -478,63 +478,63 @@ let TitaniumDataTable = class TitaniumDataTable extends LitElement {
|
|
|
478
478
|
this.requestUpdate();
|
|
479
479
|
this.#notifySelectedChanged();
|
|
480
480
|
}
|
|
481
|
-
}}
|
|
482
|
-
>
|
|
483
|
-
<table-header part="table-header-container">
|
|
481
|
+
}}
|
|
482
|
+
>
|
|
483
|
+
<table-header part="table-header-container">
|
|
484
484
|
${this.disableSelect || this.singleSelect
|
|
485
485
|
? ''
|
|
486
|
-
: html `
|
|
487
|
-
<md-checkbox
|
|
488
|
-
title="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
|
|
489
|
-
aria-label="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
|
|
490
|
-
?checked=${this.selected.length > 0}
|
|
491
|
-
?indeterminate=${this.selected.length !== 0 && this.selected.length !== this.items.length}
|
|
486
|
+
: html `
|
|
487
|
+
<md-checkbox
|
|
488
|
+
title="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
|
|
489
|
+
aria-label="${this.selected.length > 0 ? 'Deselect' : 'Select'} all checkboxes"
|
|
490
|
+
?checked=${this.selected.length > 0}
|
|
491
|
+
?indeterminate=${this.selected.length !== 0 && this.selected.length !== this.items.length}
|
|
492
492
|
@click=${() => {
|
|
493
493
|
this.selected.length > 0 ? this.#deselectAll() : this.selectAll();
|
|
494
494
|
this.checkbox.focus();
|
|
495
|
-
}}
|
|
496
|
-
></md-checkbox>
|
|
497
|
-
`}
|
|
498
|
-
<slot name="table-headers"></slot>
|
|
499
|
-
</table-header>
|
|
500
|
-
<md-linear-progress ?hidden=${!this.isLoading} ?closed=${!this.isLoading} indeterminate></md-linear-progress>
|
|
501
|
-
|
|
502
|
-
<main>
|
|
503
|
-
<div items-slot part="items-container">
|
|
504
|
-
<slot name="items"></slot>
|
|
505
|
-
</div>
|
|
506
|
-
<table-message ?hidden=${this.isLoading || this.items.length > 0}>
|
|
507
|
-
<md-icon>info</md-icon>
|
|
495
|
+
}}
|
|
496
|
+
></md-checkbox>
|
|
497
|
+
`}
|
|
498
|
+
<slot name="table-headers"></slot>
|
|
499
|
+
</table-header>
|
|
500
|
+
<md-linear-progress ?hidden=${!this.isLoading} ?closed=${!this.isLoading} indeterminate></md-linear-progress>
|
|
501
|
+
|
|
502
|
+
<main>
|
|
503
|
+
<div items-slot part="items-container">
|
|
504
|
+
<slot name="items"></slot>
|
|
505
|
+
</div>
|
|
506
|
+
<table-message ?hidden=${this.isLoading || this.items.length > 0}>
|
|
507
|
+
<md-icon>info</md-icon>
|
|
508
508
|
${this.searchTerm === '' || typeof this.searchTerm === 'undefined' || this.searchTerm === null
|
|
509
509
|
? 'No results'
|
|
510
|
-
: `Your search of '${this.searchTerm}' did not match any results`}</table-message
|
|
511
|
-
>
|
|
512
|
-
<table-message ?hidden=${!this.isLoading || this.items.length !== 0}> Loading data... </table-message>
|
|
513
|
-
<content-veil ?opened=${this.isLoading}></content-veil>
|
|
514
|
-
</main>
|
|
515
|
-
</table-container>
|
|
516
|
-
<footer part="footer-container">
|
|
517
|
-
<slot name="footer">
|
|
510
|
+
: `Your search of '${this.searchTerm}' did not match any results`}</table-message
|
|
511
|
+
>
|
|
512
|
+
<table-message ?hidden=${!this.isLoading || this.items.length !== 0}> Loading data... </table-message>
|
|
513
|
+
<content-veil ?opened=${this.isLoading}></content-veil>
|
|
514
|
+
</main>
|
|
515
|
+
</table-container>
|
|
516
|
+
<footer part="footer-container">
|
|
517
|
+
<slot name="footer">
|
|
518
518
|
${this.disablePaging
|
|
519
519
|
? ''
|
|
520
|
-
: html `
|
|
521
|
-
<titanium-page-control
|
|
522
|
-
label="Rows per page"
|
|
523
|
-
?disabled=${this.isLoading}
|
|
524
|
-
.count=${this.count}
|
|
525
|
-
.pageSizes=${this.pageSizes}
|
|
526
|
-
.defaultPageSize=${this.defaultPageSize}
|
|
527
|
-
.localStorageKey="${this.header}-take"
|
|
520
|
+
: html `
|
|
521
|
+
<titanium-page-control
|
|
522
|
+
label="Rows per page"
|
|
523
|
+
?disabled=${this.isLoading}
|
|
524
|
+
.count=${this.count}
|
|
525
|
+
.pageSizes=${this.pageSizes}
|
|
526
|
+
.defaultPageSize=${this.defaultPageSize}
|
|
527
|
+
.localStorageKey="${this.header}-take"
|
|
528
528
|
@action=${() => {
|
|
529
529
|
this.dispatchEvent(new CustomEvent('paging-changed', { composed: true }));
|
|
530
|
-
}}
|
|
531
|
-
></titanium-page-control>
|
|
532
|
-
`}
|
|
533
|
-
<div footer>
|
|
534
|
-
<footer-buttons><slot name="footer-buttons"></slot></footer-buttons>
|
|
535
|
-
</div>
|
|
536
|
-
</slot>
|
|
537
|
-
</footer>
|
|
530
|
+
}}
|
|
531
|
+
></titanium-page-control>
|
|
532
|
+
`}
|
|
533
|
+
<div footer>
|
|
534
|
+
<footer-buttons><slot name="footer-buttons"></slot></footer-buttons>
|
|
535
|
+
</div>
|
|
536
|
+
</slot>
|
|
537
|
+
</footer>
|
|
538
538
|
`;
|
|
539
539
|
}
|
|
540
540
|
};
|