@genesislcap/foundation-ui 14.346.0 → 14.347.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/custom-elements.json +1190 -746
- package/dist/dts/dialog/dialog.d.ts +23 -0
- package/dist/dts/dialog/dialog.d.ts.map +1 -1
- package/dist/dts/dialog/dialog.styles.d.ts.map +1 -1
- package/dist/dts/dialog/dialog.template.d.ts.map +1 -1
- package/dist/esm/dialog/dialog.js +181 -0
- package/dist/esm/dialog/dialog.styles.js +53 -7
- package/dist/esm/dialog/dialog.template.js +25 -12
- package/dist/esm/modal/modal.js +1 -1
- package/package.json +18 -18
|
@@ -49,10 +49,19 @@ export declare abstract class DialogElement extends FoundationElement {
|
|
|
49
49
|
private startTop;
|
|
50
50
|
private resizeOffsetX;
|
|
51
51
|
private resizeOffsetY;
|
|
52
|
+
private originalWidth;
|
|
53
|
+
private originalHeight;
|
|
54
|
+
private originalPosition;
|
|
55
|
+
private originalLeft;
|
|
56
|
+
private originalTop;
|
|
57
|
+
private originalMargin;
|
|
58
|
+
private isMaximized;
|
|
59
|
+
private hasBeenResized;
|
|
52
60
|
connectedCallback(): void;
|
|
53
61
|
disconnectedCallback(): void;
|
|
54
62
|
private setupResizeHandlers;
|
|
55
63
|
private removeResizeHandlers;
|
|
64
|
+
private handleEdgeDoubleClick;
|
|
56
65
|
private handleResizeStart;
|
|
57
66
|
private handleResizeMove;
|
|
58
67
|
private handleResizeEnd;
|
|
@@ -60,6 +69,10 @@ export declare abstract class DialogElement extends FoundationElement {
|
|
|
60
69
|
* Determine if the dialog is showing or closed.
|
|
61
70
|
*/
|
|
62
71
|
get open(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Get the appropriate icon name for the resize button
|
|
74
|
+
*/
|
|
75
|
+
get resizeIconName(): string;
|
|
63
76
|
/**
|
|
64
77
|
* Show the HTMLDialogElement and its contents
|
|
65
78
|
*/
|
|
@@ -76,6 +89,16 @@ export declare abstract class DialogElement extends FoundationElement {
|
|
|
76
89
|
* Dismiss the Dialog from display.
|
|
77
90
|
*/
|
|
78
91
|
closeDialog(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Maximize the dialog to fill the viewport.
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
private maximize;
|
|
97
|
+
/**
|
|
98
|
+
* Reset the dialog to its original size and position, or maximize if not resized.
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
resetSize(): void;
|
|
79
102
|
}
|
|
80
103
|
/**
|
|
81
104
|
* @tagname %%prefix%%-dialog
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAK/D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAWjE,eAAO,MAAM,6BAA6B,EAAE,cAG3C,CAAC;AAEF,eAAO,MAAM,mBAAmB,IAAK,CAAC;AAEtC,8BAAsB,aAAc,SAAQ,iBAAiB;IAC3D;;;OAGG;IACH,WAAW,EAAG,iBAAiB,CAAC;IAChC,UAAU,EAAG,WAAW,CAAC;IACzB,cAAc,EAAG,eAAe,CAAC;IACrB,YAAY,EAAG,qBAAqB,CAAC;IACjD,mBAAmB;IAIU,IAAI,EAAE,UAAU,CAAa;IAEpD,QAAQ,EAAE,cAAc,CAAY;IAE1C;;OAEG;IACsD,aAAa,EAAE,OAAO,CAAQ;IAEvF;;OAEG;IACgD,SAAS,EAAE,OAAO,CAAS;IAE9E;;OAEG;IAC+B,QAAQ,EAAE,MAAM,CAAa;IAE/D;;OAEG;IACgC,SAAS,EAAE,MAAM,CAAc;IAElE;;OAEG;IACS,cAAc,EAAE,MAAM,IAAI,CAAC;IAEvC;;OAE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C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,eAAO,MAAM,sBAAsB,EAAE,aAuQpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.template.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.template.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialog.template.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAevC,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,gEA4E/C,CAAC;AAEF,eAAO,MAAM,wBAAwB,6DAEpC,CAAC"}
|
|
@@ -48,6 +48,16 @@ export class DialogElement extends FoundationElement {
|
|
|
48
48
|
this.startTop = 0;
|
|
49
49
|
this.resizeOffsetX = 0;
|
|
50
50
|
this.resizeOffsetY = 0;
|
|
51
|
+
// Original size tracking for reset
|
|
52
|
+
this.originalWidth = '';
|
|
53
|
+
this.originalHeight = '';
|
|
54
|
+
this.originalPosition = '';
|
|
55
|
+
this.originalLeft = '';
|
|
56
|
+
this.originalTop = '';
|
|
57
|
+
this.originalMargin = '';
|
|
58
|
+
// Maximize state tracking
|
|
59
|
+
this.isMaximized = false;
|
|
60
|
+
this.hasBeenResized = false;
|
|
51
61
|
}
|
|
52
62
|
notificationChanged() {
|
|
53
63
|
if (this.notification)
|
|
@@ -76,17 +86,75 @@ export class DialogElement extends FoundationElement {
|
|
|
76
86
|
setupResizeHandlers() {
|
|
77
87
|
if (!this.resizable)
|
|
78
88
|
return;
|
|
89
|
+
// Store original dimensions and position for reset
|
|
90
|
+
this.originalWidth = this.mainElement.style.width || `${this.minWidth}px`;
|
|
91
|
+
this.originalHeight = this.mainElement.style.height || `${this.minHeight}px`;
|
|
92
|
+
this.originalPosition = this.mainElement.style.position || '';
|
|
93
|
+
this.originalLeft = this.mainElement.style.left || '';
|
|
94
|
+
this.originalTop = this.mainElement.style.top || '';
|
|
95
|
+
this.originalMargin = this.mainElement.style.margin || '';
|
|
96
|
+
this.mainElement.style.height = `${this.minHeight}px`;
|
|
79
97
|
this.mainElement.style.minHeight = `${this.minHeight}px`;
|
|
98
|
+
this.mainElement.style.width = `${this.minWidth}px`;
|
|
80
99
|
this.mainElement.style.minWidth = `${this.minWidth}px`;
|
|
100
|
+
// Update original values after setting initial size
|
|
101
|
+
this.originalWidth = this.mainElement.style.width;
|
|
102
|
+
this.originalHeight = this.mainElement.style.height;
|
|
81
103
|
// Add event listeners for resize handles
|
|
82
104
|
const handles = this.shadowRoot.querySelectorAll('.resize-handle');
|
|
83
105
|
handles.forEach((handle) => {
|
|
84
106
|
handle.addEventListener('mousedown', this.handleResizeStart.bind(this));
|
|
107
|
+
handle.addEventListener('dblclick', this.handleEdgeDoubleClick.bind(this));
|
|
85
108
|
});
|
|
86
109
|
}
|
|
87
110
|
removeResizeHandlers() {
|
|
111
|
+
var _a;
|
|
88
112
|
document.removeEventListener('mousemove', this.handleResizeMove.bind(this));
|
|
89
113
|
document.removeEventListener('mouseup', this.handleResizeEnd.bind(this));
|
|
114
|
+
// Remove double-click listeners from handles
|
|
115
|
+
const handles = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.resize-handle');
|
|
116
|
+
handles === null || handles === void 0 ? void 0 : handles.forEach((handle) => {
|
|
117
|
+
handle.removeEventListener('dblclick', this.handleEdgeDoubleClick.bind(this));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
handleEdgeDoubleClick(e) {
|
|
121
|
+
if (!this.resizable)
|
|
122
|
+
return;
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
const target = e.target;
|
|
126
|
+
const direction = target.dataset.direction;
|
|
127
|
+
// Only handle edge directions (not corners)
|
|
128
|
+
if (!['n', 's', 'e', 'w'].includes(direction))
|
|
129
|
+
return;
|
|
130
|
+
const rect = this.mainElement.getBoundingClientRect();
|
|
131
|
+
const viewportWidth = window.innerWidth;
|
|
132
|
+
const viewportHeight = window.innerHeight;
|
|
133
|
+
// Convert to fixed positioning if not already
|
|
134
|
+
this.mainElement.style.position = 'fixed';
|
|
135
|
+
this.mainElement.style.margin = '0';
|
|
136
|
+
switch (direction) {
|
|
137
|
+
case 'n': // North - expand to top
|
|
138
|
+
this.mainElement.style.height = `${rect.bottom}px`;
|
|
139
|
+
this.mainElement.style.top = '0px';
|
|
140
|
+
break;
|
|
141
|
+
case 's': // South - expand to bottom
|
|
142
|
+
this.mainElement.style.height = `${viewportHeight - rect.top}px`;
|
|
143
|
+
break;
|
|
144
|
+
case 'e': // East - expand to right
|
|
145
|
+
this.mainElement.style.width = `${viewportWidth - rect.left}px`;
|
|
146
|
+
break;
|
|
147
|
+
case 'w': // West - expand to left
|
|
148
|
+
this.mainElement.style.width = `${rect.right}px`;
|
|
149
|
+
this.mainElement.style.left = '0px';
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
// Mark as resized since dimensions changed
|
|
153
|
+
this.hasBeenResized = true;
|
|
154
|
+
this.$emit('resize', {
|
|
155
|
+
width: this.mainElement.offsetWidth,
|
|
156
|
+
height: this.mainElement.offsetHeight,
|
|
157
|
+
});
|
|
90
158
|
}
|
|
91
159
|
handleResizeStart(e) {
|
|
92
160
|
if (!this.resizable)
|
|
@@ -148,6 +216,7 @@ export class DialogElement extends FoundationElement {
|
|
|
148
216
|
// Add resizing class for styling
|
|
149
217
|
this.mainElement.classList.add('resizing');
|
|
150
218
|
}
|
|
219
|
+
// eslint-disable-next-line complexity
|
|
151
220
|
handleResizeMove(e) {
|
|
152
221
|
if (!this.isResizing || !this.currentResizeHandle)
|
|
153
222
|
return;
|
|
@@ -202,6 +271,9 @@ export class DialogElement extends FoundationElement {
|
|
|
202
271
|
shouldUpdatePosition = true;
|
|
203
272
|
break;
|
|
204
273
|
}
|
|
274
|
+
// Get viewport dimensions
|
|
275
|
+
const viewportWidth = window.innerWidth;
|
|
276
|
+
const viewportHeight = window.innerHeight;
|
|
205
277
|
// Apply minimum constraints only when resizable
|
|
206
278
|
if (this.resizable) {
|
|
207
279
|
// Apply minimum width constraint and adjust position if needed
|
|
@@ -222,6 +294,47 @@ export class DialogElement extends FoundationElement {
|
|
|
222
294
|
newTop = newTop - heightDiff;
|
|
223
295
|
}
|
|
224
296
|
}
|
|
297
|
+
// Apply viewport boundary constraints
|
|
298
|
+
// Prevent resizing beyond the right edge of viewport
|
|
299
|
+
if (this.currentResizeHandle.includes('e')) {
|
|
300
|
+
const maxWidth = viewportWidth - this.startLeft;
|
|
301
|
+
if (newWidth > maxWidth) {
|
|
302
|
+
newWidth = maxWidth;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// Prevent resizing beyond the bottom edge of viewport
|
|
306
|
+
if (this.currentResizeHandle.includes('s')) {
|
|
307
|
+
const maxHeight = viewportHeight - this.startTop;
|
|
308
|
+
if (newHeight > maxHeight) {
|
|
309
|
+
newHeight = maxHeight;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// Prevent resizing beyond the left edge of viewport
|
|
313
|
+
if (this.currentResizeHandle.includes('w')) {
|
|
314
|
+
// Ensure left position doesn't go negative
|
|
315
|
+
if (newLeft < 0) {
|
|
316
|
+
newWidth = newWidth + newLeft; // Reduce width by the negative offset
|
|
317
|
+
newLeft = 0;
|
|
318
|
+
}
|
|
319
|
+
// Also ensure we don't exceed the available width from new position
|
|
320
|
+
const maxWidthFromLeft = viewportWidth - newLeft;
|
|
321
|
+
if (newWidth > maxWidthFromLeft) {
|
|
322
|
+
newWidth = maxWidthFromLeft;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// Prevent resizing beyond the top edge of viewport
|
|
326
|
+
if (this.currentResizeHandle.includes('n')) {
|
|
327
|
+
// Ensure top position doesn't go negative
|
|
328
|
+
if (newTop < 0) {
|
|
329
|
+
newHeight = newHeight + newTop; // Reduce height by the negative offset
|
|
330
|
+
newTop = 0;
|
|
331
|
+
}
|
|
332
|
+
// Also ensure we don't exceed the available height from new position
|
|
333
|
+
const maxHeightFromTop = viewportHeight - newTop;
|
|
334
|
+
if (newHeight > maxHeightFromTop) {
|
|
335
|
+
newHeight = maxHeightFromTop;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
225
338
|
}
|
|
226
339
|
// Apply new dimensions
|
|
227
340
|
this.mainElement.style.width = `${newWidth}px`;
|
|
@@ -245,6 +358,12 @@ export class DialogElement extends FoundationElement {
|
|
|
245
358
|
document.removeEventListener('mouseup', this.handleResizeEnd.bind(this));
|
|
246
359
|
// Remove resizing class
|
|
247
360
|
this.mainElement.classList.remove('resizing');
|
|
361
|
+
// Mark as resized if dimensions changed from original
|
|
362
|
+
const currentWidth = this.mainElement.style.width;
|
|
363
|
+
const currentHeight = this.mainElement.style.height;
|
|
364
|
+
if (currentWidth !== this.originalWidth || currentHeight !== this.originalHeight) {
|
|
365
|
+
this.hasBeenResized = true;
|
|
366
|
+
}
|
|
248
367
|
this.$emit('resize', {
|
|
249
368
|
width: this.mainElement.offsetWidth,
|
|
250
369
|
height: this.mainElement.offsetHeight,
|
|
@@ -256,6 +375,12 @@ export class DialogElement extends FoundationElement {
|
|
|
256
375
|
get open() {
|
|
257
376
|
return this.mainElement.hasAttribute('open');
|
|
258
377
|
}
|
|
378
|
+
/**
|
|
379
|
+
* Get the appropriate icon name for the resize button
|
|
380
|
+
*/
|
|
381
|
+
get resizeIconName() {
|
|
382
|
+
return this.hasBeenResized || this.isMaximized ? 'compress' : 'expand';
|
|
383
|
+
}
|
|
259
384
|
/**
|
|
260
385
|
* Remove the HTMLDialogElement from display
|
|
261
386
|
*/
|
|
@@ -284,6 +409,53 @@ export class DialogElement extends FoundationElement {
|
|
|
284
409
|
logger.error(e);
|
|
285
410
|
}
|
|
286
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Maximize the dialog to fill the viewport.
|
|
414
|
+
* @private
|
|
415
|
+
*/
|
|
416
|
+
maximize() {
|
|
417
|
+
if (!this.resizable || !this.mainElement)
|
|
418
|
+
return;
|
|
419
|
+
// Convert to fixed positioning for full viewport control
|
|
420
|
+
this.mainElement.style.position = 'fixed';
|
|
421
|
+
this.mainElement.style.left = '0px';
|
|
422
|
+
this.mainElement.style.top = '0px';
|
|
423
|
+
this.mainElement.style.margin = '0';
|
|
424
|
+
this.mainElement.style.width = '100vw';
|
|
425
|
+
this.mainElement.style.height = '100vh';
|
|
426
|
+
this.isMaximized = true;
|
|
427
|
+
this.hasBeenResized = true;
|
|
428
|
+
this.$emit('resize', {
|
|
429
|
+
width: this.mainElement.offsetWidth,
|
|
430
|
+
height: this.mainElement.offsetHeight,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Reset the dialog to its original size and position, or maximize if not resized.
|
|
435
|
+
* @public
|
|
436
|
+
*/
|
|
437
|
+
resetSize() {
|
|
438
|
+
if (!this.resizable || !this.mainElement)
|
|
439
|
+
return;
|
|
440
|
+
// If dialog hasn't been resized, maximize it
|
|
441
|
+
if (!this.hasBeenResized && !this.isMaximized) {
|
|
442
|
+
this.maximize();
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
// Otherwise, reset to original size
|
|
446
|
+
this.mainElement.style.width = this.originalWidth;
|
|
447
|
+
this.mainElement.style.height = this.originalHeight;
|
|
448
|
+
this.mainElement.style.position = this.originalPosition;
|
|
449
|
+
this.mainElement.style.left = this.originalLeft;
|
|
450
|
+
this.mainElement.style.top = this.originalTop;
|
|
451
|
+
this.mainElement.style.margin = this.originalMargin;
|
|
452
|
+
this.isMaximized = false;
|
|
453
|
+
this.hasBeenResized = false;
|
|
454
|
+
this.$emit('resize', {
|
|
455
|
+
width: this.mainElement.offsetWidth,
|
|
456
|
+
height: this.mainElement.offsetHeight,
|
|
457
|
+
});
|
|
458
|
+
}
|
|
287
459
|
}
|
|
288
460
|
__decorate([
|
|
289
461
|
observable
|
|
@@ -312,9 +484,18 @@ __decorate([
|
|
|
312
484
|
__decorate([
|
|
313
485
|
observable
|
|
314
486
|
], DialogElement.prototype, "onCloseCallback", void 0);
|
|
487
|
+
__decorate([
|
|
488
|
+
observable
|
|
489
|
+
], DialogElement.prototype, "isMaximized", void 0);
|
|
490
|
+
__decorate([
|
|
491
|
+
observable
|
|
492
|
+
], DialogElement.prototype, "hasBeenResized", void 0);
|
|
315
493
|
__decorate([
|
|
316
494
|
volatile
|
|
317
495
|
], DialogElement.prototype, "open", null);
|
|
496
|
+
__decorate([
|
|
497
|
+
volatile
|
|
498
|
+
], DialogElement.prototype, "resizeIconName", null);
|
|
318
499
|
/**
|
|
319
500
|
* @tagname %%prefix%%-dialog
|
|
320
501
|
*/
|
|
@@ -32,10 +32,20 @@ export const foundationDialogStyles = css `
|
|
|
32
32
|
background-color: var(--success-color);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
.header-controls {
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: calc(var(--design-unit) * 1px);
|
|
38
|
+
align-items: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
.close-icon {
|
|
36
42
|
display: var(--dialog-close-icon-display);
|
|
37
43
|
}
|
|
38
44
|
|
|
45
|
+
.reset-size-icon {
|
|
46
|
+
display: flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
dialog {
|
|
40
50
|
background-color: var(--dialog-background, var(--fill-color));
|
|
41
51
|
padding: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 4px)
|
|
@@ -44,13 +54,6 @@ export const foundationDialogStyles = css `
|
|
|
44
54
|
overflow: inherit;
|
|
45
55
|
}
|
|
46
56
|
|
|
47
|
-
:host([position='right']) dialog .content-wrapper,
|
|
48
|
-
:host([position='left']) dialog .content-wrapper,
|
|
49
|
-
:host([position='left']) dialog,
|
|
50
|
-
:host([position='right']) dialog {
|
|
51
|
-
height: 100%;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
57
|
:host([position='left']) dialog {
|
|
55
58
|
margin-left: 0;
|
|
56
59
|
}
|
|
@@ -63,6 +66,13 @@ export const foundationDialogStyles = css `
|
|
|
63
66
|
width: 100%;
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
.top {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
align-items: center;
|
|
73
|
+
gap: calc(var(--design-unit) * 2px);
|
|
74
|
+
}
|
|
75
|
+
|
|
66
76
|
.title {
|
|
67
77
|
margin-top: calc(var(--design-unit) * 2px);
|
|
68
78
|
font-size: 14px;
|
|
@@ -75,18 +85,54 @@ export const foundationDialogStyles = css `
|
|
|
75
85
|
white-space: pre-line;
|
|
76
86
|
}
|
|
77
87
|
|
|
88
|
+
.content-container {
|
|
89
|
+
box-sizing: border-box;
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
:host([resizable]) dialog {
|
|
79
93
|
position: relative;
|
|
80
94
|
box-sizing: border-box;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
max-height: 100%;
|
|
81
97
|
}
|
|
82
98
|
|
|
99
|
+
:host([resizable]) dialog[open] {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Override design system max-width constraints for resizable dialogs */
|
|
83
105
|
:host([resizable]) dialog .content-wrapper {
|
|
84
106
|
position: relative;
|
|
85
107
|
height: 100%;
|
|
86
108
|
width: 100%;
|
|
109
|
+
max-height: 100%;
|
|
87
110
|
min-width: 100%;
|
|
88
111
|
max-width: 100%;
|
|
89
112
|
resize: none;
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:host([resizable]) .content-container {
|
|
120
|
+
flex: 1 1 auto;
|
|
121
|
+
overflow: auto;
|
|
122
|
+
min-height: 0;
|
|
123
|
+
box-sizing: border-box;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:host([resizable]) .top,
|
|
127
|
+
:host([resizable]) .bottom {
|
|
128
|
+
flex: 0 0 auto;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
:host([position='right']) dialog .content-wrapper,
|
|
132
|
+
:host([position='left']) dialog .content-wrapper,
|
|
133
|
+
:host([position='left']) dialog,
|
|
134
|
+
:host([position='right']) dialog {
|
|
135
|
+
height: 100%;
|
|
90
136
|
}
|
|
91
137
|
|
|
92
138
|
/* Resize handles */
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { whenElse } from '@genesislcap/foundation-utils';
|
|
1
2
|
import { html, ref, repeat, when } from '@microsoft/fast-element';
|
|
2
3
|
import { getPrefix } from '../utils';
|
|
4
|
+
const contentAndPlaceholer = html `
|
|
5
|
+
<slot>
|
|
6
|
+
${when((x) => x.notification, html `
|
|
7
|
+
<div class="details">
|
|
8
|
+
${(x) => { var _a; return ((_a = x.notification) === null || _a === void 0 ? void 0 : _a.body) || 'Place holder for notification message'; }}
|
|
9
|
+
</div>
|
|
10
|
+
`)}
|
|
11
|
+
</slot>
|
|
12
|
+
`;
|
|
3
13
|
export const getDialogTemplate = (prefix) => html `
|
|
4
14
|
<dialog ${ref('mainElement')} part="dialog" type=${(x) => x.type}>
|
|
5
15
|
<div class="content-wrapper" part="content">
|
|
@@ -7,19 +17,22 @@ export const getDialogTemplate = (prefix) => html `
|
|
|
7
17
|
<slot name="top" ${ref('topElementSlot')}>
|
|
8
18
|
<h2 slot="top" class="title">${(x) => { var _a; return (_a = x.notification) === null || _a === void 0 ? void 0 : _a.title; }}</h2>
|
|
9
19
|
</slot>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<${prefix}-icon
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
<div class="header-controls">
|
|
21
|
+
${when((x) => x.resizable, html `
|
|
22
|
+
<${prefix}-button class="reset-size-icon" part="reset-size-icon" aria-label="reset size" appearance="stealth" @click=${(x) => x.resetSize()}>
|
|
23
|
+
<${prefix}-icon name="${(x) => x.resizeIconName}"></${prefix}-icon>
|
|
24
|
+
</${prefix}-button>
|
|
25
|
+
`)}
|
|
26
|
+
${when((x) => x.showCloseIcon, html `
|
|
27
|
+
<${prefix}-button class="close-icon" part="close-icon" aria-label="close" appearance="stealth" @click=${(x) => x.close()}>
|
|
28
|
+
<${prefix}-icon name="times"></${prefix}-icon>
|
|
29
|
+
</${prefix}-button>
|
|
30
|
+
`)}
|
|
31
|
+
</div>
|
|
15
32
|
</div>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
${(x) => { var _a; return ((_a = x.notification) === null || _a === void 0 ? void 0 : _a.body) || 'Place holder for notification message'; }}
|
|
20
|
-
</div>
|
|
21
|
-
`)}
|
|
22
|
-
</slot>
|
|
33
|
+
${whenElse((x) => x.resizable, html `
|
|
34
|
+
<div class="content-container" part="content-container">${contentAndPlaceholer}</div>
|
|
35
|
+
`, contentAndPlaceholer)}
|
|
23
36
|
<div part="bottom" class="bottom">
|
|
24
37
|
<slot name="bottom">
|
|
25
38
|
${when((x) => x.notification, html `
|
package/dist/esm/modal/modal.js
CHANGED
|
@@ -82,7 +82,7 @@ export class Modal extends DialogElement {
|
|
|
82
82
|
return assignedNodes.some((node) => node === target || node.contains(target));
|
|
83
83
|
}
|
|
84
84
|
onMouseDown(event) {
|
|
85
|
-
if (!this.topElement || !this.isEventTargetInDraggableTarget(event))
|
|
85
|
+
if (!this.topElement || !this.isEventTargetInDraggableTarget(event) || this.isDragging)
|
|
86
86
|
return;
|
|
87
87
|
this.isDragging = true;
|
|
88
88
|
const rect = this.mainElement.getBoundingClientRect();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-ui",
|
|
3
3
|
"description": "Genesis Foundation UI",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.347.1",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@genesislcap/foundation-testing": "14.
|
|
87
|
-
"@genesislcap/genx": "14.
|
|
88
|
-
"@genesislcap/rollup-builder": "14.
|
|
89
|
-
"@genesislcap/ts-builder": "14.
|
|
90
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
91
|
-
"@genesislcap/vite-builder": "14.
|
|
92
|
-
"@genesislcap/webpack-builder": "14.
|
|
86
|
+
"@genesislcap/foundation-testing": "14.347.1",
|
|
87
|
+
"@genesislcap/genx": "14.347.1",
|
|
88
|
+
"@genesislcap/rollup-builder": "14.347.1",
|
|
89
|
+
"@genesislcap/ts-builder": "14.347.1",
|
|
90
|
+
"@genesislcap/uvu-playwright-builder": "14.347.1",
|
|
91
|
+
"@genesislcap/vite-builder": "14.347.1",
|
|
92
|
+
"@genesislcap/webpack-builder": "14.347.1",
|
|
93
93
|
"copyfiles": "^2.4.1"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
@@ -98,15 +98,15 @@
|
|
|
98
98
|
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
|
99
99
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
100
100
|
"@genesiscommunitysuccess/analyzer-import-alias-plugin": "^5.0.3",
|
|
101
|
-
"@genesislcap/expression-builder": "14.
|
|
102
|
-
"@genesislcap/foundation-comms": "14.
|
|
103
|
-
"@genesislcap/foundation-criteria": "14.
|
|
104
|
-
"@genesislcap/foundation-errors": "14.
|
|
105
|
-
"@genesislcap/foundation-events": "14.
|
|
106
|
-
"@genesislcap/foundation-logger": "14.
|
|
107
|
-
"@genesislcap/foundation-notifications": "14.
|
|
108
|
-
"@genesislcap/foundation-user": "14.
|
|
109
|
-
"@genesislcap/foundation-utils": "14.
|
|
101
|
+
"@genesislcap/expression-builder": "14.347.1",
|
|
102
|
+
"@genesislcap/foundation-comms": "14.347.1",
|
|
103
|
+
"@genesislcap/foundation-criteria": "14.347.1",
|
|
104
|
+
"@genesislcap/foundation-errors": "14.347.1",
|
|
105
|
+
"@genesislcap/foundation-events": "14.347.1",
|
|
106
|
+
"@genesislcap/foundation-logger": "14.347.1",
|
|
107
|
+
"@genesislcap/foundation-notifications": "14.347.1",
|
|
108
|
+
"@genesislcap/foundation-user": "14.347.1",
|
|
109
|
+
"@genesislcap/foundation-utils": "14.347.1",
|
|
110
110
|
"@microsoft/fast-colors": "5.3.1",
|
|
111
111
|
"@microsoft/fast-components": "2.30.6",
|
|
112
112
|
"@microsoft/fast-element": "1.14.0",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"access": "public"
|
|
129
129
|
},
|
|
130
130
|
"customElements": "dist/custom-elements.json",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "fb3dde1303cacf1079541238912b2d3b005dfe16"
|
|
132
132
|
}
|