@internetarchive/collection-browser 4.1.3-alpha-webdev8108.0 → 4.1.3-alpha-webdev8257.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/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +8 -0
- package/dist/src/app-root.js +31 -0
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +3 -0
- package/dist/src/collection-browser.js +33 -29
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/models.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.js +28 -28
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.d.ts +14 -0
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +12 -1
- package/dist/src/tiles/tile-dispatcher.js +333 -216
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +77 -77
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +126 -126
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +87 -87
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js.map +1 -1
- package/index.ts +1 -0
- package/package.json +1 -1
- package/src/app-root.ts +35 -0
- package/src/collection-browser.ts +41 -38
- package/src/data-source/collection-browser-data-source.ts +1445 -1445
- package/src/models.ts +874 -874
- package/src/tiles/hover/hover-pane-controller.ts +628 -628
- package/src/tiles/models.ts +16 -0
- package/src/tiles/tile-dispatcher.ts +652 -527
- package/src/tiles/tile-display-value-provider.ts +124 -124
- package/test/mocks/mock-search-responses.ts +1364 -1364
- package/test/tiles/grid/item-tile.test.ts +520 -520
- package/test/tiles/list/tile-list.test.ts +552 -552
- package/test/tiles/tile-dispatcher.test.ts +300 -300
- package/test/tiles/tile-display-value-provider.test.ts +172 -172
|
@@ -2,6 +2,7 @@ var TileDispatcher_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { css, html, nothing } from 'lit';
|
|
4
4
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
7
|
import { msg } from '@lit/localize';
|
|
7
8
|
import './grid/collection-tile';
|
|
@@ -41,6 +42,15 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
41
42
|
/** Whether this tile should include a hover pane at all (for applicable tile modes) */
|
|
42
43
|
this.enableHoverPane = false;
|
|
43
44
|
this.manageCheckTitle = msg('Remove this item from the list');
|
|
45
|
+
/** Action buttons to display at the bottom of the tile (grid mode only) */
|
|
46
|
+
this.tileActions = [];
|
|
47
|
+
/**
|
|
48
|
+
* When the mouse enters the tile actions area, dispatch a synthetic mouseleave
|
|
49
|
+
* on the host to cancel the hover pane's show timer and hide any visible pane.
|
|
50
|
+
*/
|
|
51
|
+
this.handleTileActionsMouseEnter = () => {
|
|
52
|
+
this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));
|
|
53
|
+
};
|
|
44
54
|
}
|
|
45
55
|
static { TileDispatcher_1 = this; }
|
|
46
56
|
acquireFocus() {
|
|
@@ -58,14 +68,20 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
58
68
|
}; }
|
|
59
69
|
render() {
|
|
60
70
|
const isGridMode = this.tileDisplayMode === 'grid';
|
|
71
|
+
const hasTileActions = isGridMode && this.showTileActions;
|
|
61
72
|
const hoverPaneTemplate = this.hoverPaneController?.getTemplate() ?? nothing;
|
|
62
|
-
|
|
63
|
-
|
|
73
|
+
const containerClasses = classMap({
|
|
74
|
+
hoverable: isGridMode,
|
|
75
|
+
'has-tile-actions': hasTileActions,
|
|
76
|
+
});
|
|
77
|
+
return html `
|
|
78
|
+
<div id="container" class=${containerClasses}>
|
|
64
79
|
${this.tileDisplayMode === 'list-header'
|
|
65
80
|
? this.headerTemplate
|
|
66
|
-
: this.tileTemplate}
|
|
67
|
-
${this.
|
|
68
|
-
|
|
81
|
+
: this.tileTemplate}
|
|
82
|
+
${this.tileActionsTemplate} ${this.manageCheckTemplate}
|
|
83
|
+
${hoverPaneTemplate}
|
|
84
|
+
</div>
|
|
69
85
|
`;
|
|
70
86
|
}
|
|
71
87
|
firstUpdated() {
|
|
@@ -78,42 +94,42 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
78
94
|
}
|
|
79
95
|
get headerTemplate() {
|
|
80
96
|
const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } = this;
|
|
81
|
-
return html `
|
|
82
|
-
<tile-list-compact-header
|
|
83
|
-
class="header"
|
|
84
|
-
.currentWidth=${currentWidth}
|
|
85
|
-
.sortParam=${sortParam ?? defaultSortParam}
|
|
86
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
87
|
-
>
|
|
88
|
-
</tile-list-compact-header>
|
|
97
|
+
return html `
|
|
98
|
+
<tile-list-compact-header
|
|
99
|
+
class="header"
|
|
100
|
+
.currentWidth=${currentWidth}
|
|
101
|
+
.sortParam=${sortParam ?? defaultSortParam}
|
|
102
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
103
|
+
>
|
|
104
|
+
</tile-list-compact-header>
|
|
89
105
|
`;
|
|
90
106
|
}
|
|
91
107
|
get tileTemplate() {
|
|
92
|
-
return html `
|
|
108
|
+
return html `
|
|
93
109
|
${this.tileDisplayMode === 'list-detail'
|
|
94
110
|
? this.tile
|
|
95
|
-
: this.linkTileTemplate}
|
|
111
|
+
: this.linkTileTemplate}
|
|
96
112
|
`;
|
|
97
113
|
}
|
|
98
114
|
get linkTileTemplate() {
|
|
99
|
-
return html `
|
|
100
|
-
<a
|
|
101
|
-
href=${this.linkTileHref}
|
|
102
|
-
aria-label=${this.model?.title ?? 'Untitled item'}
|
|
103
|
-
aria-describedby="link-aria-description"
|
|
104
|
-
aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}
|
|
115
|
+
return html `
|
|
116
|
+
<a
|
|
117
|
+
href=${this.linkTileHref}
|
|
118
|
+
aria-label=${this.model?.title ?? 'Untitled item'}
|
|
119
|
+
aria-describedby="link-aria-description"
|
|
120
|
+
aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}
|
|
105
121
|
title=${this.shouldPrepareHoverPane
|
|
106
122
|
? nothing // Don't show title tooltips when we have the tile info popups
|
|
107
|
-
: ifDefined(this.model?.title)}
|
|
108
|
-
@click=${this.handleLinkClicked}
|
|
109
|
-
@contextmenu=${this.handleLinkContextMenu}
|
|
110
|
-
class="tile-link"
|
|
111
|
-
>
|
|
112
|
-
${this.tile}
|
|
113
|
-
</a>
|
|
114
|
-
<div id="link-aria-description" class="sr-only">
|
|
115
|
-
${msg('Press Down Arrow to preview item details')}
|
|
116
|
-
</div>
|
|
123
|
+
: ifDefined(this.model?.title)}
|
|
124
|
+
@click=${this.handleLinkClicked}
|
|
125
|
+
@contextmenu=${this.handleLinkContextMenu}
|
|
126
|
+
class="tile-link"
|
|
127
|
+
>
|
|
128
|
+
${this.tile}
|
|
129
|
+
</a>
|
|
130
|
+
<div id="link-aria-description" class="sr-only">
|
|
131
|
+
${msg('Press Down Arrow to preview item details')}
|
|
132
|
+
</div>
|
|
117
133
|
`;
|
|
118
134
|
}
|
|
119
135
|
get linkTileHref() {
|
|
@@ -129,15 +145,15 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
129
145
|
get manageCheckTemplate() {
|
|
130
146
|
if (!this.isManageView || this.tileDisplayMode !== 'grid')
|
|
131
147
|
return nothing;
|
|
132
|
-
return html `
|
|
133
|
-
<div class="manage-check">
|
|
134
|
-
<input
|
|
135
|
-
type="checkbox"
|
|
136
|
-
title=${this.manageCheckTitle}
|
|
137
|
-
?checked=${this.model?.checked}
|
|
138
|
-
@change=${this.handleLinkClicked}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
148
|
+
return html `
|
|
149
|
+
<div class="manage-check">
|
|
150
|
+
<input
|
|
151
|
+
type="checkbox"
|
|
152
|
+
title=${this.manageCheckTitle}
|
|
153
|
+
?checked=${this.model?.checked}
|
|
154
|
+
@change=${this.handleLinkClicked}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
141
157
|
`;
|
|
142
158
|
}
|
|
143
159
|
/**
|
|
@@ -226,6 +242,43 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
226
242
|
enableTouchBackdrop: true,
|
|
227
243
|
});
|
|
228
244
|
}
|
|
245
|
+
/** Whether tile action buttons should be rendered */
|
|
246
|
+
get showTileActions() {
|
|
247
|
+
return (this.tileActions.length > 0 &&
|
|
248
|
+
!this.isManageView &&
|
|
249
|
+
this.tileDisplayMode === 'grid');
|
|
250
|
+
}
|
|
251
|
+
get tileActionsTemplate() {
|
|
252
|
+
if (!this.showTileActions)
|
|
253
|
+
return nothing;
|
|
254
|
+
return html `
|
|
255
|
+
<div
|
|
256
|
+
class="tile-actions"
|
|
257
|
+
@mouseenter=${this.handleTileActionsMouseEnter}
|
|
258
|
+
@mousemove=${(e) => e.stopPropagation()}
|
|
259
|
+
>
|
|
260
|
+
${this.tileActions.map(action => html `
|
|
261
|
+
<button
|
|
262
|
+
class="tile-action-btn"
|
|
263
|
+
@click=${(e) => this.handleTileActionClick(e, action)}
|
|
264
|
+
>
|
|
265
|
+
${action.label}
|
|
266
|
+
</button>
|
|
267
|
+
`)}
|
|
268
|
+
</div>
|
|
269
|
+
`;
|
|
270
|
+
}
|
|
271
|
+
handleTileActionClick(e, action) {
|
|
272
|
+
e.stopPropagation();
|
|
273
|
+
// Pre-set the hover pane controller's clicking flag so that focus
|
|
274
|
+
// restoration after a consumer-opened modal won't trigger the hover pane.
|
|
275
|
+
this.dispatchEvent(new PointerEvent('pointerdown'));
|
|
276
|
+
this.dispatchEvent(new CustomEvent('tileActionClicked', {
|
|
277
|
+
detail: { actionId: action.id, model: this.model },
|
|
278
|
+
bubbles: true,
|
|
279
|
+
composed: true,
|
|
280
|
+
}));
|
|
281
|
+
}
|
|
229
282
|
get tile() {
|
|
230
283
|
const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
|
|
231
284
|
if (!model)
|
|
@@ -234,103 +287,103 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
234
287
|
case 'grid':
|
|
235
288
|
switch (model.mediatype) {
|
|
236
289
|
case 'collection':
|
|
237
|
-
return html `<collection-tile
|
|
238
|
-
.model=${model}
|
|
239
|
-
.collectionPagePath=${collectionPagePath}
|
|
240
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
241
|
-
.currentWidth=${currentWidth}
|
|
242
|
-
.currentHeight=${currentHeight}
|
|
243
|
-
.creatorFilter=${creatorFilter}
|
|
244
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
245
|
-
.isManageView=${this.isManageView}
|
|
246
|
-
.layoutType=${this.layoutType}
|
|
247
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
248
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
249
|
-
>
|
|
290
|
+
return html `<collection-tile
|
|
291
|
+
.model=${model}
|
|
292
|
+
.collectionPagePath=${collectionPagePath}
|
|
293
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
294
|
+
.currentWidth=${currentWidth}
|
|
295
|
+
.currentHeight=${currentHeight}
|
|
296
|
+
.creatorFilter=${creatorFilter}
|
|
297
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
298
|
+
.isManageView=${this.isManageView}
|
|
299
|
+
.layoutType=${this.layoutType}
|
|
300
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
301
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
302
|
+
>
|
|
250
303
|
</collection-tile>`;
|
|
251
304
|
case 'account':
|
|
252
|
-
return html `<account-tile
|
|
253
|
-
.model=${model}
|
|
254
|
-
.collectionPagePath=${collectionPagePath}
|
|
255
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
256
|
-
.currentWidth=${currentWidth}
|
|
257
|
-
.currentHeight=${currentHeight}
|
|
258
|
-
.creatorFilter=${creatorFilter}
|
|
259
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
260
|
-
.isManageView=${this.isManageView}
|
|
261
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
262
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
263
|
-
>
|
|
305
|
+
return html `<account-tile
|
|
306
|
+
.model=${model}
|
|
307
|
+
.collectionPagePath=${collectionPagePath}
|
|
308
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
309
|
+
.currentWidth=${currentWidth}
|
|
310
|
+
.currentHeight=${currentHeight}
|
|
311
|
+
.creatorFilter=${creatorFilter}
|
|
312
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
313
|
+
.isManageView=${this.isManageView}
|
|
314
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
315
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
316
|
+
>
|
|
264
317
|
</account-tile>`;
|
|
265
318
|
case 'search':
|
|
266
|
-
return html `<search-tile
|
|
267
|
-
.model=${model}
|
|
268
|
-
.collectionPagePath=${collectionPagePath}
|
|
269
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
270
|
-
.currentWidth=${currentWidth}
|
|
271
|
-
.currentHeight=${currentHeight}
|
|
272
|
-
.creatorFilter=${creatorFilter}
|
|
273
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
274
|
-
.isManageView=${this.isManageView}
|
|
275
|
-
?showInfoButton=${false}
|
|
276
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
277
|
-
>
|
|
319
|
+
return html `<search-tile
|
|
320
|
+
.model=${model}
|
|
321
|
+
.collectionPagePath=${collectionPagePath}
|
|
322
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
323
|
+
.currentWidth=${currentWidth}
|
|
324
|
+
.currentHeight=${currentHeight}
|
|
325
|
+
.creatorFilter=${creatorFilter}
|
|
326
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
327
|
+
.isManageView=${this.isManageView}
|
|
328
|
+
?showInfoButton=${false}
|
|
329
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
330
|
+
>
|
|
278
331
|
</search-tile>`;
|
|
279
332
|
default:
|
|
280
|
-
return html `<item-tile
|
|
281
|
-
.model=${model}
|
|
282
|
-
.collectionPagePath=${collectionPagePath}
|
|
283
|
-
.currentWidth=${this.currentWidth}
|
|
284
|
-
.currentHeight=${this.currentHeight}
|
|
285
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
286
|
-
.sortParam=${sortParam}
|
|
287
|
-
.defaultSortParam=${defaultSortParam}
|
|
288
|
-
.creatorFilter=${creatorFilter}
|
|
289
|
-
.loggedIn=${this.loggedIn}
|
|
290
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
291
|
-
.isManageView=${this.isManageView}
|
|
292
|
-
.layoutType=${this.layoutType}
|
|
293
|
-
?showTvClips=${this.showTvClips}
|
|
294
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
295
|
-
?useLocalTime=${this.useLocalTime}
|
|
296
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
297
|
-
>
|
|
333
|
+
return html `<item-tile
|
|
334
|
+
.model=${model}
|
|
335
|
+
.collectionPagePath=${collectionPagePath}
|
|
336
|
+
.currentWidth=${this.currentWidth}
|
|
337
|
+
.currentHeight=${this.currentHeight}
|
|
338
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
339
|
+
.sortParam=${sortParam}
|
|
340
|
+
.defaultSortParam=${defaultSortParam}
|
|
341
|
+
.creatorFilter=${creatorFilter}
|
|
342
|
+
.loggedIn=${this.loggedIn}
|
|
343
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
344
|
+
.isManageView=${this.isManageView}
|
|
345
|
+
.layoutType=${this.layoutType}
|
|
346
|
+
?showTvClips=${this.showTvClips}
|
|
347
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
348
|
+
?useLocalTime=${this.useLocalTime}
|
|
349
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
350
|
+
>
|
|
298
351
|
</item-tile>`;
|
|
299
352
|
}
|
|
300
353
|
case 'list-compact':
|
|
301
|
-
return html `<tile-list-compact
|
|
302
|
-
.model=${model}
|
|
303
|
-
.collectionPagePath=${collectionPagePath}
|
|
304
|
-
.currentWidth=${currentWidth}
|
|
305
|
-
.currentHeight=${currentHeight}
|
|
306
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
307
|
-
.sortParam=${sortParam}
|
|
308
|
-
.defaultSortParam=${defaultSortParam}
|
|
309
|
-
.creatorFilter=${creatorFilter}
|
|
310
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
311
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
312
|
-
.loggedIn=${this.loggedIn}
|
|
313
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
314
|
-
?useLocalTime=${this.useLocalTime}
|
|
315
|
-
>
|
|
354
|
+
return html `<tile-list-compact
|
|
355
|
+
.model=${model}
|
|
356
|
+
.collectionPagePath=${collectionPagePath}
|
|
357
|
+
.currentWidth=${currentWidth}
|
|
358
|
+
.currentHeight=${currentHeight}
|
|
359
|
+
.baseNavigationUrl=${baseNavigationUrl}
|
|
360
|
+
.sortParam=${sortParam}
|
|
361
|
+
.defaultSortParam=${defaultSortParam}
|
|
362
|
+
.creatorFilter=${creatorFilter}
|
|
363
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
364
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
365
|
+
.loggedIn=${this.loggedIn}
|
|
366
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
367
|
+
?useLocalTime=${this.useLocalTime}
|
|
368
|
+
>
|
|
316
369
|
</tile-list-compact>`;
|
|
317
370
|
case 'list-detail':
|
|
318
|
-
return html `<tile-list
|
|
319
|
-
.model=${model}
|
|
320
|
-
.collectionPagePath=${collectionPagePath}
|
|
321
|
-
.collectionTitles=${this.collectionTitles}
|
|
322
|
-
.currentWidth=${currentWidth}
|
|
323
|
-
.currentHeight=${currentHeight}
|
|
324
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
325
|
-
.sortParam=${sortParam}
|
|
326
|
-
.defaultSortParam=${defaultSortParam}
|
|
327
|
-
.creatorFilter=${creatorFilter}
|
|
328
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
329
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
330
|
-
.loggedIn=${this.loggedIn}
|
|
331
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
332
|
-
?useLocalTime=${this.useLocalTime}
|
|
333
|
-
>
|
|
371
|
+
return html `<tile-list
|
|
372
|
+
.model=${model}
|
|
373
|
+
.collectionPagePath=${collectionPagePath}
|
|
374
|
+
.collectionTitles=${this.collectionTitles}
|
|
375
|
+
.currentWidth=${currentWidth}
|
|
376
|
+
.currentHeight=${currentHeight}
|
|
377
|
+
.baseNavigationUrl=${baseNavigationUrl}
|
|
378
|
+
.sortParam=${sortParam}
|
|
379
|
+
.defaultSortParam=${defaultSortParam}
|
|
380
|
+
.creatorFilter=${creatorFilter}
|
|
381
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
382
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
383
|
+
.loggedIn=${this.loggedIn}
|
|
384
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
385
|
+
?useLocalTime=${this.useLocalTime}
|
|
386
|
+
>
|
|
334
387
|
</tile-list>`;
|
|
335
388
|
default:
|
|
336
389
|
return nothing;
|
|
@@ -339,96 +392,157 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
339
392
|
static get styles() {
|
|
340
393
|
return [
|
|
341
394
|
srOnlyStyle,
|
|
342
|
-
css `
|
|
343
|
-
:host {
|
|
344
|
-
display: block;
|
|
345
|
-
height: 100%;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
collection-tile {
|
|
349
|
-
--tileBorderColor: #555555;
|
|
350
|
-
--tileBackgroundColor: #666666;
|
|
351
|
-
--imageBlockBackgroundColor: #666666;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
account-tile {
|
|
355
|
-
--tileBorderColor: #dddddd;
|
|
356
|
-
--imageBlockBackgroundColor: #fcf5e6;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
item-tile {
|
|
360
|
-
--tileBorderColor: #dddddd;
|
|
361
|
-
--imageBlockBackgroundColor: #f1f1f4;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
search-tile {
|
|
365
|
-
--tileBorderColor: #555555;
|
|
366
|
-
--tileBackgroundColor: #666666;
|
|
367
|
-
--imageBlockBackgroundColor: #666666;
|
|
368
|
-
--iconFillColor: #2c2c2c;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
#container {
|
|
372
|
-
position: relative;
|
|
373
|
-
height: 100%;
|
|
374
|
-
border-radius: 4px;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
height:
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
395
|
+
css `
|
|
396
|
+
:host {
|
|
397
|
+
display: block;
|
|
398
|
+
height: 100%;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
collection-tile {
|
|
402
|
+
--tileBorderColor: #555555;
|
|
403
|
+
--tileBackgroundColor: #666666;
|
|
404
|
+
--imageBlockBackgroundColor: #666666;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
account-tile {
|
|
408
|
+
--tileBorderColor: #dddddd;
|
|
409
|
+
--imageBlockBackgroundColor: #fcf5e6;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
item-tile {
|
|
413
|
+
--tileBorderColor: #dddddd;
|
|
414
|
+
--imageBlockBackgroundColor: #f1f1f4;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
search-tile {
|
|
418
|
+
--tileBorderColor: #555555;
|
|
419
|
+
--tileBackgroundColor: #666666;
|
|
420
|
+
--imageBlockBackgroundColor: #666666;
|
|
421
|
+
--iconFillColor: #2c2c2c;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
#container {
|
|
425
|
+
position: relative;
|
|
426
|
+
height: 100%;
|
|
427
|
+
border-radius: 4px;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/*
|
|
431
|
+
* When tile actions are present, the container becomes the visual "card"
|
|
432
|
+
* so that the tile content and action buttons appear as one unified element.
|
|
433
|
+
*/
|
|
434
|
+
/*
|
|
435
|
+
* When tile actions are present, the container takes over the tile's
|
|
436
|
+
* border-radius and box-shadow so that the action bar appears as part
|
|
437
|
+
* of the same card. The inner tile's own shadow/radius are disabled
|
|
438
|
+
* via CSS variable overrides so there is no visual duplication.
|
|
439
|
+
*/
|
|
440
|
+
#container.has-tile-actions {
|
|
441
|
+
display: flex;
|
|
442
|
+
flex-direction: column;
|
|
443
|
+
overflow: hidden;
|
|
444
|
+
box-shadow: var(--tileShadow, 1px 1px 2px 0);
|
|
445
|
+
--tileBoxShadow: none;
|
|
446
|
+
--tileCornerRadius: 0;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
#container.has-tile-actions .tile-link {
|
|
450
|
+
flex: 1;
|
|
451
|
+
min-height: 0;
|
|
452
|
+
overflow: hidden;
|
|
453
|
+
border-radius: 0;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/* Move hover shadow to container level when tile actions are present */
|
|
457
|
+
#container.hoverable:not(.has-tile-actions) a:focus,
|
|
458
|
+
#container.hoverable:not(.has-tile-actions) a:hover {
|
|
459
|
+
box-shadow: var(
|
|
460
|
+
--tileHoverBoxShadow,
|
|
461
|
+
0 0 6px 2px rgba(8, 8, 32, 0.8)
|
|
462
|
+
);
|
|
463
|
+
transition: box-shadow 0.1s ease;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
#container.hoverable.has-tile-actions:hover {
|
|
467
|
+
box-shadow: var(
|
|
468
|
+
--tileHoverBoxShadow,
|
|
469
|
+
0 0 6px 2px rgba(8, 8, 32, 0.8)
|
|
470
|
+
);
|
|
471
|
+
transition: box-shadow 0.1s ease;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
a {
|
|
475
|
+
display: block;
|
|
476
|
+
height: 100%;
|
|
477
|
+
color: unset;
|
|
478
|
+
text-decoration: none;
|
|
479
|
+
transition: transform 0.05s ease;
|
|
480
|
+
border-radius: 4px;
|
|
481
|
+
outline: none;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
a :first-child {
|
|
485
|
+
display: block;
|
|
486
|
+
height: 100%;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.manage-check {
|
|
490
|
+
position: absolute;
|
|
491
|
+
right: 0;
|
|
492
|
+
top: 0;
|
|
493
|
+
border: 5px solid #2c2c2c;
|
|
494
|
+
border-radius: 3px;
|
|
495
|
+
background-color: #2c2c2c;
|
|
496
|
+
z-index: 1;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.manage-check > input[type='checkbox'] {
|
|
500
|
+
display: block;
|
|
501
|
+
margin: 0;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
#touch-backdrop {
|
|
505
|
+
position: fixed;
|
|
506
|
+
width: 100vw;
|
|
507
|
+
height: 100vh;
|
|
508
|
+
top: 0;
|
|
509
|
+
left: 0;
|
|
510
|
+
z-index: 2;
|
|
511
|
+
background: transparent;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
tile-hover-pane {
|
|
515
|
+
position: absolute;
|
|
516
|
+
top: 0;
|
|
517
|
+
left: -9999px;
|
|
518
|
+
z-index: 2;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.tile-actions {
|
|
522
|
+
flex-shrink: 0;
|
|
523
|
+
display: flex;
|
|
524
|
+
border-top: 1px solid var(--tileActionSeparatorColor, #ddd);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.tile-action-btn {
|
|
528
|
+
flex: 1;
|
|
529
|
+
padding: 8px;
|
|
530
|
+
border: none;
|
|
531
|
+
border-radius: 0;
|
|
532
|
+
font-size: 1.2rem;
|
|
533
|
+
cursor: pointer;
|
|
534
|
+
color: var(--tileActionColor, #333);
|
|
535
|
+
background: var(--tileActionBg, #fff);
|
|
536
|
+
transition: background 0.15s;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.tile-action-btn + .tile-action-btn {
|
|
540
|
+
border-left: 1px solid var(--tileActionSeparatorColor, #ddd);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.tile-action-btn:hover {
|
|
544
|
+
background: var(--tileActionHoverBg, #f0f0f0);
|
|
545
|
+
}
|
|
432
546
|
`,
|
|
433
547
|
];
|
|
434
548
|
}
|
|
@@ -457,6 +571,9 @@ __decorate([
|
|
|
457
571
|
__decorate([
|
|
458
572
|
property({ type: String })
|
|
459
573
|
], TileDispatcher.prototype, "manageCheckTitle", void 0);
|
|
574
|
+
__decorate([
|
|
575
|
+
property({ type: Array })
|
|
576
|
+
], TileDispatcher.prototype, "tileActions", void 0);
|
|
460
577
|
__decorate([
|
|
461
578
|
query('#container')
|
|
462
579
|
], TileDispatcher.prototype, "container", void 0);
|