@krumio/trailhand-ui 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-table/data-table.d.ts +8 -12
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/data-table.js +19 -116
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/dock/dock.d.ts +70 -0
- package/dist/components/dock/dock.d.ts.map +1 -0
- package/dist/components/dock/dock.js +423 -0
- package/dist/components/dock/dock.js.map +1 -0
- package/dist/components/dock/index.d.ts +3 -0
- package/dist/components/dock/index.d.ts.map +1 -0
- package/dist/components/dock/index.js +2 -0
- package/dist/components/dock/index.js.map +1 -0
- package/dist/components/icon/icon.d.ts +4 -1
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +4 -1
- package/dist/components/icon/icon.js.map +1 -1
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/icon/index.d.ts.map +1 -1
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.d.ts.map +1 -0
- package/dist/components/pagination/index.js +2 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/pagination.d.ts +66 -0
- package/dist/components/pagination/pagination.d.ts.map +1 -0
- package/dist/components/pagination/pagination.js +221 -0
- package/dist/components/pagination/pagination.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/debounce.d.ts +6 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/debounce.js +25 -0
- package/dist/utils/debounce.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
10
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
11
|
+
import '../icon/icon';
|
|
12
|
+
/**
|
|
13
|
+
* A tabbed, resizable, pinnable dock panel (bottom/left/right), for things
|
|
14
|
+
* like live log streams or an interactive terminal that must keep running
|
|
15
|
+
* while hidden behind another tab.
|
|
16
|
+
*
|
|
17
|
+
* Project each tab's content into the slot named `tab:<tabId>`. The consumer
|
|
18
|
+
* is responsible for keying its own child content by tab id (e.g. Vue's
|
|
19
|
+
* `:key`) so it isn't recreated on re-render, trailhand-dock guarantees the
|
|
20
|
+
* slot itself stays stable across tab switches, but that guarantee only
|
|
21
|
+
* holds end to end if the consumer doesn't destroy its own node either.
|
|
22
|
+
*
|
|
23
|
+
* @slot tab:<tabId> - Content for the tab with the matching id.
|
|
24
|
+
*
|
|
25
|
+
* @fires dock-open - Dock opened (first tab added, or opened externally).
|
|
26
|
+
* @fires dock-close - Dock closed (last tab removed, or closed externally).
|
|
27
|
+
* @fires dock-tab-switch - detail: { id }, active tab changed.
|
|
28
|
+
* @fires dock-tab-close - detail: { id }, a tab was closed.
|
|
29
|
+
* @fires dock-resize - detail: { width, height }, fires live during a resize.
|
|
30
|
+
* @fires dock-pin-change - detail: { pin }, pin position changed.
|
|
31
|
+
*/
|
|
32
|
+
export class Dock extends LitElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.open = false;
|
|
36
|
+
this.pin = 'bottom';
|
|
37
|
+
this.tabs = [];
|
|
38
|
+
this.activeTab = null;
|
|
39
|
+
/** Height in px, used when pin === 'bottom'. */
|
|
40
|
+
this.height = 300;
|
|
41
|
+
/** Width in px, used when pin !== 'bottom'. */
|
|
42
|
+
this.width = 400;
|
|
43
|
+
this._dragStart = null;
|
|
44
|
+
this._onResizePointerDown = (e) => {
|
|
45
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
46
|
+
const coord = this.pin === 'bottom' ? e.clientY : e.clientX;
|
|
47
|
+
const startSize = this.pin === 'bottom' ? this.height : this.width;
|
|
48
|
+
this._dragStart = { pointerCoord: coord, startSize };
|
|
49
|
+
};
|
|
50
|
+
this._onResizePointerMove = (e) => {
|
|
51
|
+
if (!this._dragStart)
|
|
52
|
+
return;
|
|
53
|
+
const coord = this.pin === 'bottom' ? e.clientY : e.clientX;
|
|
54
|
+
const rawDelta = coord - this._dragStart.pointerCoord;
|
|
55
|
+
// Handle faces the page, not the viewport edge. Left is the only pin
|
|
56
|
+
// where growing doesn't need the delta negated.
|
|
57
|
+
const signedDelta = this.pin === 'left' ? rawDelta : -rawDelta;
|
|
58
|
+
this._commitResize(this._clamp(this._dragStart.startSize + signedDelta));
|
|
59
|
+
};
|
|
60
|
+
this._onResizePointerUp = () => {
|
|
61
|
+
this._dragStart = null;
|
|
62
|
+
};
|
|
63
|
+
this._onResizeKeydown = (e) => {
|
|
64
|
+
const step = 20;
|
|
65
|
+
const isBottom = this.pin === 'bottom';
|
|
66
|
+
const growKey = isBottom ? 'ArrowUp' : this.pin === 'left' ? 'ArrowRight' : 'ArrowLeft';
|
|
67
|
+
const shrinkKey = isBottom ? 'ArrowDown' : this.pin === 'left' ? 'ArrowLeft' : 'ArrowRight';
|
|
68
|
+
if (e.key !== growKey && e.key !== shrinkKey)
|
|
69
|
+
return;
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
const delta = e.key === growKey ? step : -step;
|
|
72
|
+
const current = isBottom ? this.height : this.width;
|
|
73
|
+
this._commitResize(this._clamp(current + delta));
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
willUpdate(changed) {
|
|
77
|
+
if (changed.has('tabs')) {
|
|
78
|
+
const prevTabs = changed.get('tabs');
|
|
79
|
+
const hadTabs = (prevTabs?.length ?? 0) > 0;
|
|
80
|
+
if (!hadTabs && this.tabs.length > 0 && !this.open) {
|
|
81
|
+
this.open = true;
|
|
82
|
+
this._emit('dock-open', {});
|
|
83
|
+
}
|
|
84
|
+
if (this.tabs.length > 0 &&
|
|
85
|
+
!this.tabs.some((t) => t.id === this.activeTab)) {
|
|
86
|
+
this._switchTab(this.tabs[0].id);
|
|
87
|
+
}
|
|
88
|
+
if (this.tabs.length === 0 && this.open) {
|
|
89
|
+
this.open = false;
|
|
90
|
+
this._emit('dock-close', {});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (changed.has('pin') && changed.get('pin') !== undefined) {
|
|
94
|
+
this._emit('dock-pin-change', { pin: this.pin });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** Opens a tab, focusing it if it's already open (no duplicates). */
|
|
98
|
+
openTab(tab) {
|
|
99
|
+
if (this.tabs.some((t) => t.id === tab.id)) {
|
|
100
|
+
this._switchTab(tab.id);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.tabs = [...this.tabs, tab];
|
|
104
|
+
}
|
|
105
|
+
closeTab(id) {
|
|
106
|
+
this._closeTab(id);
|
|
107
|
+
}
|
|
108
|
+
switchTab(id) {
|
|
109
|
+
this._switchTab(id);
|
|
110
|
+
}
|
|
111
|
+
_switchTab(id) {
|
|
112
|
+
if (this.activeTab === id)
|
|
113
|
+
return;
|
|
114
|
+
this.activeTab = id;
|
|
115
|
+
this._emit('dock-tab-switch', { id });
|
|
116
|
+
}
|
|
117
|
+
_closeTab(id) {
|
|
118
|
+
const idx = this.tabs.findIndex((t) => t.id === id);
|
|
119
|
+
if (idx === -1)
|
|
120
|
+
return;
|
|
121
|
+
const wasActive = this.activeTab === id;
|
|
122
|
+
const next = this.tabs.filter((t) => t.id !== id);
|
|
123
|
+
this.tabs = next;
|
|
124
|
+
if (wasActive && next.length > 0) {
|
|
125
|
+
const neighbor = next[Math.max(0, idx - 1)];
|
|
126
|
+
this._switchTab(neighbor.id);
|
|
127
|
+
}
|
|
128
|
+
this._emit('dock-tab-close', { id });
|
|
129
|
+
}
|
|
130
|
+
_emit(name, detail) {
|
|
131
|
+
this.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
|
|
132
|
+
}
|
|
133
|
+
get _currentSize() {
|
|
134
|
+
return this.pin === 'bottom' ? this.height : this.width;
|
|
135
|
+
}
|
|
136
|
+
_clamp(raw) {
|
|
137
|
+
return this.pin === 'bottom'
|
|
138
|
+
? Math.min(Math.max(raw, 50), window.innerHeight * 0.75)
|
|
139
|
+
: Math.min(Math.max(raw, 250), window.innerWidth * 0.4);
|
|
140
|
+
}
|
|
141
|
+
// Commits live (every pointermove/keydown), not debounced to the drag end,
|
|
142
|
+
// so a consumer syncing its own layout to this doesn't lag behind.
|
|
143
|
+
_commitResize(size) {
|
|
144
|
+
if (this.pin === 'bottom') {
|
|
145
|
+
this.height = size;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.width = size;
|
|
149
|
+
}
|
|
150
|
+
this._emit('dock-resize', { width: this.width, height: this.height });
|
|
151
|
+
}
|
|
152
|
+
_renderResizer() {
|
|
153
|
+
const isBottom = this.pin === 'bottom';
|
|
154
|
+
const max = isBottom ? window.innerHeight * 0.75 : window.innerWidth * 0.4;
|
|
155
|
+
return html `
|
|
156
|
+
<div
|
|
157
|
+
class="dock__resizer"
|
|
158
|
+
role="separator"
|
|
159
|
+
aria-orientation=${isBottom ? 'horizontal' : 'vertical'}
|
|
160
|
+
aria-valuenow=${this._currentSize}
|
|
161
|
+
aria-valuemin=${isBottom ? 50 : 250}
|
|
162
|
+
aria-valuemax=${Math.round(max)}
|
|
163
|
+
tabindex="0"
|
|
164
|
+
@pointerdown=${this._onResizePointerDown}
|
|
165
|
+
@pointermove=${this._onResizePointerMove}
|
|
166
|
+
@pointerup=${this._onResizePointerUp}
|
|
167
|
+
@pointercancel=${this._onResizePointerUp}
|
|
168
|
+
@keydown=${this._onResizeKeydown}
|
|
169
|
+
></div>
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
_renderTab(tab) {
|
|
173
|
+
const active = tab.id === this.activeTab;
|
|
174
|
+
const closable = tab.closable !== false;
|
|
175
|
+
return html `
|
|
176
|
+
<div
|
|
177
|
+
class="dock__tab ${active ? 'dock__tab--active' : ''}"
|
|
178
|
+
id="tab-${tab.id}"
|
|
179
|
+
role="tab"
|
|
180
|
+
tabindex="0"
|
|
181
|
+
aria-selected=${active}
|
|
182
|
+
aria-controls="panel-${tab.id}"
|
|
183
|
+
@click=${() => this._switchTab(tab.id)}
|
|
184
|
+
@keydown=${(e) => this._handleTabKeydown(e, tab)}
|
|
185
|
+
>
|
|
186
|
+
${active
|
|
187
|
+
? html `<trailhand-icon class="dock__tab-active-icon" name="circle"></trailhand-icon>`
|
|
188
|
+
: nothing}
|
|
189
|
+
${tab.icon
|
|
190
|
+
? html `<trailhand-icon name=${tab.icon}></trailhand-icon>`
|
|
191
|
+
: nothing}
|
|
192
|
+
<span class="dock__tab-label">${tab.label}</span>
|
|
193
|
+
${closable
|
|
194
|
+
? html `<button
|
|
195
|
+
class="dock__tab-close"
|
|
196
|
+
aria-label="Close ${tab.label}"
|
|
197
|
+
@click=${(e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
this._closeTab(tab.id);
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
<trailhand-icon name="x"></trailhand-icon>
|
|
203
|
+
</button>`
|
|
204
|
+
: nothing}
|
|
205
|
+
</div>
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
_handleTabKeydown(e, tab) {
|
|
209
|
+
if (e.key !== 'Enter' && e.key !== ' ')
|
|
210
|
+
return;
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
this._switchTab(tab.id);
|
|
213
|
+
}
|
|
214
|
+
_renderPanel(tab) {
|
|
215
|
+
return html `
|
|
216
|
+
<div
|
|
217
|
+
class="dock__panel"
|
|
218
|
+
id="panel-${tab.id}"
|
|
219
|
+
role="tabpanel"
|
|
220
|
+
aria-labelledby="tab-${tab.id}"
|
|
221
|
+
?hidden=${tab.id !== this.activeTab}
|
|
222
|
+
>
|
|
223
|
+
<slot name="tab:${tab.id}"></slot>
|
|
224
|
+
</div>
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
render() {
|
|
228
|
+
const sizeStyle = this.pin === 'bottom'
|
|
229
|
+
? { height: `${this._currentSize}px` }
|
|
230
|
+
: { width: `${this._currentSize}px` };
|
|
231
|
+
return html `
|
|
232
|
+
<div class="dock" style=${styleMap(sizeStyle)}>
|
|
233
|
+
${this._renderResizer()}
|
|
234
|
+
<div class="dock__body">
|
|
235
|
+
<div class="dock__tabs" role="tablist">
|
|
236
|
+
${repeat(this.tabs, (t) => t.id, (t) => this._renderTab(t))}
|
|
237
|
+
</div>
|
|
238
|
+
<div class="dock__panels">
|
|
239
|
+
${repeat(this.tabs, (t) => t.id, (t) => this._renderPanel(t))}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
Dock.styles = css `
|
|
247
|
+
:host {
|
|
248
|
+
display: block;
|
|
249
|
+
font-family: var(--font-family, 'Poppins', sans-serif);
|
|
250
|
+
--_tab-height: var(--th-dock-tab-height, 29px);
|
|
251
|
+
--_tabs-bg: var(--th-dock-tabs-bg, #dcdee7);
|
|
252
|
+
--_tab-active-bg: var(--th-dock-tab-active-bg, #f4f5fa);
|
|
253
|
+
--_body-bg: var(--th-dock-body-bg, #f4f5fa);
|
|
254
|
+
--_border-color: var(--th-dock-border, #dcdee7);
|
|
255
|
+
--_radius: var(--th-dock-radius, 4px);
|
|
256
|
+
--_text-color: var(--th-color-text-primary, #000000);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
:host(:not([open])) {
|
|
260
|
+
display: none;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
:host([pin='left']) .dock,
|
|
264
|
+
:host([pin='right']) .dock {
|
|
265
|
+
height: 100%;
|
|
266
|
+
flex-direction: row;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
:host([pin='right']) .dock {
|
|
270
|
+
border-left: 1px solid var(--_border-color);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:host([pin='left']) .dock {
|
|
274
|
+
border-right: 1px solid var(--_border-color);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.dock__resizer {
|
|
278
|
+
flex-shrink: 0;
|
|
279
|
+
height: 4px;
|
|
280
|
+
cursor: ns-resize;
|
|
281
|
+
background: transparent;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
:host([pin='left']) .dock__resizer,
|
|
285
|
+
:host([pin='right']) .dock__resizer {
|
|
286
|
+
height: auto;
|
|
287
|
+
width: 4px;
|
|
288
|
+
cursor: ew-resize;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Handle renders first in markup, correct for bottom/right pins. Left
|
|
292
|
+
needs it after the body so it lands on the page-facing edge. */
|
|
293
|
+
:host([pin='left']) .dock__resizer {
|
|
294
|
+
order: 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.dock__resizer:hover,
|
|
298
|
+
.dock__resizer:focus-visible {
|
|
299
|
+
background: var(--th-color-primary, #3d98d3);
|
|
300
|
+
outline: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.dock {
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
border-radius: var(--_radius);
|
|
307
|
+
background: var(--_body-bg);
|
|
308
|
+
color: var(--_text-color);
|
|
309
|
+
overflow: hidden;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.dock__body {
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
flex: 1;
|
|
316
|
+
min-width: 0;
|
|
317
|
+
min-height: 0;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.dock__tabs {
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: stretch;
|
|
324
|
+
flex-shrink: 0;
|
|
325
|
+
height: var(--_tab-height);
|
|
326
|
+
background: var(--_tabs-bg);
|
|
327
|
+
border-top: 1px solid var(--_border-color);
|
|
328
|
+
border-bottom: 1px solid var(--_border-color);
|
|
329
|
+
overflow-x: auto;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.dock__tab {
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
gap: 6px;
|
|
336
|
+
padding: 0 10px;
|
|
337
|
+
border-right: 1px solid var(--_border-color);
|
|
338
|
+
cursor: pointer;
|
|
339
|
+
user-select: none;
|
|
340
|
+
white-space: nowrap;
|
|
341
|
+
font-size: 13px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.dock__tab--active {
|
|
345
|
+
background: var(--_tab-active-bg);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.dock__tab-active-icon {
|
|
349
|
+
color: var(--th-color-primary, #3d98d3);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.dock__tab:focus-visible {
|
|
353
|
+
outline: 2px solid var(--th-color-primary, #3d98d3);
|
|
354
|
+
outline-offset: -2px;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.dock__tab-close {
|
|
358
|
+
display: inline-flex;
|
|
359
|
+
align-items: center;
|
|
360
|
+
justify-content: center;
|
|
361
|
+
width: 14px;
|
|
362
|
+
height: 14px;
|
|
363
|
+
margin-left: 4px;
|
|
364
|
+
padding: 0;
|
|
365
|
+
border: 1px solid var(--_text-color);
|
|
366
|
+
border-radius: var(--_radius);
|
|
367
|
+
background: none;
|
|
368
|
+
cursor: pointer;
|
|
369
|
+
color: inherit;
|
|
370
|
+
font-size: 9px;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.dock__tab-close:hover {
|
|
374
|
+
border-color: var(--th-color-primary, #3d98d3);
|
|
375
|
+
color: var(--th-color-primary, #3d98d3);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.dock__panels {
|
|
379
|
+
flex: 1;
|
|
380
|
+
min-height: 0;
|
|
381
|
+
overflow: hidden;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.dock__panel {
|
|
385
|
+
height: 100%;
|
|
386
|
+
overflow: auto;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.dock__panel[hidden] {
|
|
390
|
+
display: none;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Intentionally no transitions anywhere in this component, the docking
|
|
394
|
+
chrome it's replacing (Rancher Shell's WindowManager) has none, and
|
|
395
|
+
open/close/resize should stay instant for behavioral parity. */
|
|
396
|
+
|
|
397
|
+
:host-context([data-theme='dark']) {
|
|
398
|
+
--_tabs-bg: var(--th-dock-tabs-bg, linear-gradient(180deg, #4a4b52, #27292e));
|
|
399
|
+
--_tab-active-bg: var(--th-dock-tab-active-bg, #1b1c21);
|
|
400
|
+
--_body-bg: var(--th-dock-body-bg, #141419);
|
|
401
|
+
--_border-color: var(--th-dock-border, #000000);
|
|
402
|
+
}
|
|
403
|
+
`;
|
|
404
|
+
__decorate([
|
|
405
|
+
property({ type: Boolean, reflect: true })
|
|
406
|
+
], Dock.prototype, "open", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
property({ type: String, reflect: true })
|
|
409
|
+
], Dock.prototype, "pin", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
property({ type: Array, attribute: false })
|
|
412
|
+
], Dock.prototype, "tabs", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
property({ type: String, reflect: true, attribute: 'active-tab' })
|
|
415
|
+
], Dock.prototype, "activeTab", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
property({ type: Number })
|
|
418
|
+
], Dock.prototype, "height", void 0);
|
|
419
|
+
__decorate([
|
|
420
|
+
property({ type: Number })
|
|
421
|
+
], Dock.prototype, "width", void 0);
|
|
422
|
+
customElements.define('trailhand-dock', Dock);
|
|
423
|
+
//# sourceMappingURL=dock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dock.js","sourceRoot":"","sources":["../../../src/components/dock/dock.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,cAAc,CAAC;AAoBtB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,IAAK,SAAQ,UAAU;IAApC;;QAEE,SAAI,GAAG,KAAK,CAAC;QAGb,QAAG,GAAY,QAAQ,CAAC;QAGxB,SAAI,GAAc,EAAE,CAAC;QAGrB,cAAS,GAAkB,IAAI,CAAC;QAEhC,gDAAgD;QAEhD,WAAM,GAAG,GAAG,CAAC;QAEb,+CAA+C;QAE/C,UAAK,GAAG,GAAG,CAAC;QAEJ,eAAU,GAAuD,IAAI,CAAC;QA+PtE,yBAAoB,GAAG,CAAC,CAAe,EAAQ,EAAE;YACtD,CAAC,CAAC,aAA6B,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAChE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC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AAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kCAC9B;AAGb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iCAClB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;kCACvB;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;uCACnC;AAIhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACd;AAIb;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mCACf;AA0Yd,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/dock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/dock/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -32,9 +32,12 @@ declare const iconMap: {
|
|
|
32
32
|
hammer: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
33
33
|
codeBranch: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
34
34
|
trash: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
35
|
+
file: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
36
|
+
chevronRight: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
37
|
+
circle: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
35
38
|
};
|
|
36
39
|
export declare const availableIcons: (keyof typeof iconMap)[];
|
|
37
|
-
type AvailableIcons = keyof typeof iconMap;
|
|
40
|
+
export type AvailableIcons = keyof typeof iconMap;
|
|
38
41
|
export interface IconProps {
|
|
39
42
|
name: AvailableIcons;
|
|
40
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AA0C5C,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCZ,CAAC;AAEF,eAAO,MAAM,cAAc,EAA2B,CAAC,MAAM,OAAO,OAAO,CAAC,EAAE,CAAC;AAI/E,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,OAAO,CAAC;AAElD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,qBAAa,IAAK,SAAQ,UAAU;IACN,IAAI,EAAE,cAAc,CAAU;IAE1D,MAAM,CAAC,MAAM,0BAUX;IAEF,MAAM;CAMP"}
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { LitElement, html, css } from 'lit';
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
9
|
import { library, icon } from '@fortawesome/fontawesome-svg-core';
|
|
10
|
-
import { faGlobe, faHome, faUser, faBug, faCircleExclamation, faCirclePause, faCirclePlay, faCircleXmark, faTableCellsLarge, faRocket, faGauge, faTableList, faFolderPlus, faGears, faBagShopping, faCircleInfo, faChartLine, faSliders, faDatabase, faCircleCheck, faTriangleExclamation, faScrewdriverWrench, faBan, faSpinner, faGear, faXmark, faMinus, faCheck, faPlus, faHammer, faCodeBranch, faTrashCan, } from '@fortawesome/free-solid-svg-icons';
|
|
10
|
+
import { faGlobe, faHome, faUser, faBug, faCircleExclamation, faCirclePause, faCirclePlay, faCircleXmark, faTableCellsLarge, faRocket, faGauge, faTableList, faFolderPlus, faGears, faBagShopping, faCircleInfo, faChartLine, faSliders, faDatabase, faCircleCheck, faTriangleExclamation, faScrewdriverWrench, faBan, faSpinner, faGear, faXmark, faMinus, faCheck, faPlus, faHammer, faCodeBranch, faTrashCan, faFile, faChevronRight, faCircle, } from '@fortawesome/free-solid-svg-icons';
|
|
11
11
|
const iconMap = {
|
|
12
12
|
bug: faBug,
|
|
13
13
|
error: faCircleExclamation,
|
|
@@ -41,6 +41,9 @@ const iconMap = {
|
|
|
41
41
|
hammer: faHammer,
|
|
42
42
|
codeBranch: faCodeBranch,
|
|
43
43
|
trash: faTrashCan,
|
|
44
|
+
file: faFile,
|
|
45
|
+
chevronRight: faChevronRight,
|
|
46
|
+
circle: faCircle,
|
|
44
47
|
};
|
|
45
48
|
export const availableIcons = Object.keys(iconMap);
|
|
46
49
|
library.add(...Object.values(iconMap));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/icon/icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,SAAS,EACT,UAAU,EACV,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,EACL,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,MAAM,EACN,cAAc,EACd,QAAQ,GACT,MAAM,mCAAmC,CAAC;AAE3C,MAAM,OAAO,GAAG;IACd,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,iBAAiB;IACxB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,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AAZ0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kCAA+B;AAsB5D,cAAc,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import 'iconify-icon';
|
|
3
|
+
export interface PaginationProps {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
startItem: number;
|
|
7
|
+
endItem: number;
|
|
8
|
+
totalItems: number;
|
|
9
|
+
showInfo: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A reusable pagination control: previous/next buttons, a "current / total"
|
|
14
|
+
* page indicator, and an optional "start-end of total" info string.
|
|
15
|
+
*
|
|
16
|
+
* This component does not track page state itself.
|
|
17
|
+
* The consumer passes `current-page` / `total-pages` (and, if `show-info`
|
|
18
|
+
* is enabled, the item-range props) and listens for the `page-change`
|
|
19
|
+
* event to apply the new page.
|
|
20
|
+
*
|
|
21
|
+
* @fires page-change - Detail: `{ page: number }`. Fired when the user
|
|
22
|
+
* clicks the previous or next button with a valid target page. The
|
|
23
|
+
* consumer owns page state and is responsible for applying it (and, for
|
|
24
|
+
* server-side pagination, fetching the corresponding data).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```html
|
|
28
|
+
* <trailhand-pagination
|
|
29
|
+
* current-page="2"
|
|
30
|
+
* total-pages="8"
|
|
31
|
+
* start-item="11"
|
|
32
|
+
* end-item="20"
|
|
33
|
+
* total-items="76"
|
|
34
|
+
* @page-change=${(e) => this.goToPage(e.detail.page)}
|
|
35
|
+
* ></trailhand-pagination>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class Pagination extends LitElement {
|
|
39
|
+
/** The current page number (1-indexed). */
|
|
40
|
+
currentPage: number;
|
|
41
|
+
/** Total number of pages. */
|
|
42
|
+
totalPages: number;
|
|
43
|
+
/** First item index (1-indexed) shown on the current page. Used in the info text. */
|
|
44
|
+
startItem: number;
|
|
45
|
+
/** Last item index (1-indexed) shown on the current page. Used in the info text. */
|
|
46
|
+
endItem: number;
|
|
47
|
+
/** Total number of items across all pages. Used in the info text. */
|
|
48
|
+
totalItems: number;
|
|
49
|
+
/** Whether to show the "start-end of total" info text. */
|
|
50
|
+
showInfo: boolean;
|
|
51
|
+
/** Disables both buttons, e.g. while a page fetch is in flight. */
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
static styles: import("lit").CSSResult;
|
|
54
|
+
/**
|
|
55
|
+
* Emit a `page-change` event for the given target page.
|
|
56
|
+
* @param page - The page number to request.
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private _emitPageChange;
|
|
60
|
+
private _handlePrev;
|
|
61
|
+
private _handleNext;
|
|
62
|
+
private _renderChevronLeft;
|
|
63
|
+
private _renderChevronRight;
|
|
64
|
+
render(): TemplateResult;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/pagination/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAE5D,OAAO,cAAc,CAAC;AAKtB,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,2CAA2C;IAE3C,WAAW,SAAK;IAEhB,6BAA6B;IAE7B,UAAU,SAAK;IAEf,qFAAqF;IAErF,SAAS,SAAK;IAEd,oFAAoF;IAEpF,OAAO,SAAK;IAEZ,qEAAqE;IAErE,UAAU,SAAK;IAEf,0DAA0D;IAE1D,QAAQ,UAAQ;IAEhB,mEAAmE;IAEnE,QAAQ,UAAS;IAEjB,OAAgB,MAAM,0BA8DpB;IAEF;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,mBAAmB;IASlB,MAAM,IAAI,cAAc;CAoClC"}
|