@genesislcap/foundation-ui 14.340.3 → 14.342.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/custom-elements.json +1130 -359
- package/dist/dts/dialog/dialog.d.ts +28 -3
- 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/dts/options-datasource/options-datasource.d.ts +1 -0
- package/dist/dts/options-datasource/options-datasource.d.ts.map +1 -1
- package/dist/esm/dialog/dialog.js +217 -0
- package/dist/esm/dialog/dialog.styles.js +142 -0
- package/dist/esm/dialog/dialog.template.js +10 -0
- package/dist/esm/options-datasource/options-datasource.js +8 -3
- package/package.json +18 -18
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { NotificationStructure } from '@genesislcap/foundation-notifications';
|
|
2
2
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
3
|
import type { DialogPosition, DialogType } from './dialog.types';
|
|
4
|
-
/**
|
|
5
|
-
* Focus trapping will be addressed as part of https://genesisglobal.atlassian.net/browse/FUI-2083
|
|
6
|
-
*/
|
|
7
4
|
export declare const foundationDialogShadowOptions: ShadowRootInit;
|
|
8
5
|
export declare const defaultDialogConfig: {};
|
|
9
6
|
export declare abstract class DialogElement extends FoundationElement {
|
|
@@ -22,6 +19,18 @@ export declare abstract class DialogElement extends FoundationElement {
|
|
|
22
19
|
* Whether or not to show the close icon
|
|
23
20
|
*/
|
|
24
21
|
showCloseIcon: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether or not the dialog is resizable
|
|
24
|
+
*/
|
|
25
|
+
resizable: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Minimum width for the dialog
|
|
28
|
+
*/
|
|
29
|
+
minWidth: number;
|
|
30
|
+
/**
|
|
31
|
+
* Minimum height for the dialog
|
|
32
|
+
*/
|
|
33
|
+
minHeight: number;
|
|
25
34
|
/**
|
|
26
35
|
* Callback to run *before* HTMLDialogElement is shown
|
|
27
36
|
*/
|
|
@@ -30,7 +39,23 @@ export declare abstract class DialogElement extends FoundationElement {
|
|
|
30
39
|
* Callback to run *after* HTMLDialogElement is closed
|
|
31
40
|
*/
|
|
32
41
|
onCloseCallback: () => void;
|
|
42
|
+
private isResizing;
|
|
43
|
+
private currentResizeHandle;
|
|
44
|
+
private startX;
|
|
45
|
+
private startY;
|
|
46
|
+
private startWidth;
|
|
47
|
+
private startHeight;
|
|
48
|
+
private startLeft;
|
|
49
|
+
private startTop;
|
|
50
|
+
private resizeOffsetX;
|
|
51
|
+
private resizeOffsetY;
|
|
33
52
|
connectedCallback(): void;
|
|
53
|
+
disconnectedCallback(): void;
|
|
54
|
+
private setupResizeHandlers;
|
|
55
|
+
private removeResizeHandlers;
|
|
56
|
+
private handleResizeStart;
|
|
57
|
+
private handleResizeMove;
|
|
58
|
+
private handleResizeEnd;
|
|
34
59
|
/**
|
|
35
60
|
* Determine if the dialog is showing or closed.
|
|
36
61
|
*/
|
|
@@ -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;
|
|
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;;OAEG;IACS,eAAe,EAAE,MAAM,IAAI,CAAC;IAGxC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,mBAAmB,CAAgB;IAC3C,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,QAAQ,CAAa;IAC7B,OAAO,CAAC,aAAa,CAAa;IAClC,OAAO,CAAC,aAAa,CAAa;IAElC,iBAAiB;IAoBjB,oBAAoB;IAKpB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,iBAAiB;IAqEzB,OAAO,CAAC,gBAAgB;IA4FxB,OAAO,CAAC,eAAe;IAuBvB;;OAEG;IACH,IACI,IAAI,IAAI,OAAO,CAElB;IAED;;OAEG;IACH,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACI,OAAO;IAOd;;OAEG;IACI,WAAW,IAAI,IAAI;CAQ3B;AAED;;GAEG;AACH,qBAAa,MAAO,SAAQ,aAAa;IACvC,IAAI,IAAI,IAAI;CAIb;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAM3B,CAAC"}
|
|
@@ -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,aAyNpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.template.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"dialog.template.d.ts","sourceRoot":"","sources":["../../../src/dialog/dialog.template.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,gEAqE/C,CAAC;AAEF,eAAO,MAAM,wBAAwB,6DAEpC,CAAC"}
|
|
@@ -8,6 +8,7 @@ export declare class OptionsDatasource extends BaseDatasource {
|
|
|
8
8
|
emptyDataLabel: string;
|
|
9
9
|
allowCustomOptions: boolean;
|
|
10
10
|
labelFormatter: any;
|
|
11
|
+
labelRowFormatter: (any: any) => string;
|
|
11
12
|
initialSelectedValue: string | number;
|
|
12
13
|
initialSelectedValueChanged(oldValue: any, newValue: any): void;
|
|
13
14
|
initalSelectedValueInitialized: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-datasource.d.ts","sourceRoot":"","sources":["../../../src/options-datasource/options-datasource.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqB,MAAM,UAAU,CAAC;AAG7D,qBAGa,iBAAkB,SAAQ,cAAc;IACf,UAAU,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAyB;IAC1B,kBAAkB,UAAS;IAC7E,cAAc,MAAC;
|
|
1
|
+
{"version":3,"file":"options-datasource.d.ts","sourceRoot":"","sources":["../../../src/options-datasource/options-datasource.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAqB,MAAM,UAAU,CAAC;AAG7D,qBAGa,iBAAkB,SAAQ,cAAc;IACf,UAAU,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAyB;IAC1B,kBAAkB,UAAS;IAC7E,cAAc,MAAC;IACf,iBAAiB,EAAE,CAAC,GAAG,KAAA,KAAK,MAAM,CAAC;IAEnC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClD,2BAA2B,CAAC,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAQ9C,8BAA8B,EAAE,OAAO,CAAS;IAEhD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAQ;IAElC,SAAS,CAAC,OAAO,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAEnD,OAAO,CAAC,cAAc,CAAiB;IAEjC,iBAAiB;IAkBvB,oBAAoB;IAQpB,OAAO,CAAC,sBAAsB,CAI5B;IAEF,mBAAmB,GAAI,MAAC,UAQtB;IAEF,SAAS;IAcH,sBAAsB;IAY5B,SAAS,IAAI,IAAI;IAWjB,OAAO,CAAC,aAAa;IAYrB,iBAAiB,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE;IA+DtC,eAAe;IAcf,aAAa;IAMb,mBAAmB,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI;IAI9C,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;IAI7C,mBAAmB,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI;CAG9C"}
|
|
@@ -8,6 +8,8 @@ import { foundationDialogTemplate as template } from './dialog.template';
|
|
|
8
8
|
/**
|
|
9
9
|
* Focus trapping will be addressed as part of https://genesisglobal.atlassian.net/browse/FUI-2083
|
|
10
10
|
*/
|
|
11
|
+
const MIN_WIDTH = 300;
|
|
12
|
+
const MIN_HEIGHT = 200;
|
|
11
13
|
// explicitly declaring for extensibility
|
|
12
14
|
export const foundationDialogShadowOptions = {
|
|
13
15
|
mode: 'open',
|
|
@@ -23,6 +25,29 @@ export class DialogElement extends FoundationElement {
|
|
|
23
25
|
* Whether or not to show the close icon
|
|
24
26
|
*/
|
|
25
27
|
this.showCloseIcon = true;
|
|
28
|
+
/**
|
|
29
|
+
* Whether or not the dialog is resizable
|
|
30
|
+
*/
|
|
31
|
+
this.resizable = false;
|
|
32
|
+
/**
|
|
33
|
+
* Minimum width for the dialog
|
|
34
|
+
*/
|
|
35
|
+
this.minWidth = MIN_WIDTH;
|
|
36
|
+
/**
|
|
37
|
+
* Minimum height for the dialog
|
|
38
|
+
*/
|
|
39
|
+
this.minHeight = MIN_HEIGHT;
|
|
40
|
+
// Resize state
|
|
41
|
+
this.isResizing = false;
|
|
42
|
+
this.currentResizeHandle = null;
|
|
43
|
+
this.startX = 0;
|
|
44
|
+
this.startY = 0;
|
|
45
|
+
this.startWidth = 0;
|
|
46
|
+
this.startHeight = 0;
|
|
47
|
+
this.startLeft = 0;
|
|
48
|
+
this.startTop = 0;
|
|
49
|
+
this.resizeOffsetX = 0;
|
|
50
|
+
this.resizeOffsetY = 0;
|
|
26
51
|
}
|
|
27
52
|
notificationChanged() {
|
|
28
53
|
if (this.notification)
|
|
@@ -41,6 +66,189 @@ export class DialogElement extends FoundationElement {
|
|
|
41
66
|
if (this.hasAttribute('open')) {
|
|
42
67
|
this.shadowRoot.querySelector('dialog').setAttribute('open', '');
|
|
43
68
|
}
|
|
69
|
+
// Set up resize handlers
|
|
70
|
+
this.setupResizeHandlers();
|
|
71
|
+
}
|
|
72
|
+
disconnectedCallback() {
|
|
73
|
+
super.disconnectedCallback();
|
|
74
|
+
this.removeResizeHandlers();
|
|
75
|
+
}
|
|
76
|
+
setupResizeHandlers() {
|
|
77
|
+
if (!this.resizable)
|
|
78
|
+
return;
|
|
79
|
+
this.mainElement.style.minHeight = `${this.minHeight}px`;
|
|
80
|
+
this.mainElement.style.minWidth = `${this.minWidth}px`;
|
|
81
|
+
// Add event listeners for resize handles
|
|
82
|
+
const handles = this.shadowRoot.querySelectorAll('.resize-handle');
|
|
83
|
+
handles.forEach((handle) => {
|
|
84
|
+
handle.addEventListener('mousedown', this.handleResizeStart.bind(this));
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
removeResizeHandlers() {
|
|
88
|
+
document.removeEventListener('mousemove', this.handleResizeMove.bind(this));
|
|
89
|
+
document.removeEventListener('mouseup', this.handleResizeEnd.bind(this));
|
|
90
|
+
}
|
|
91
|
+
handleResizeStart(e) {
|
|
92
|
+
if (!this.resizable)
|
|
93
|
+
return;
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
this.isResizing = true;
|
|
97
|
+
const target = e.target;
|
|
98
|
+
this.currentResizeHandle = target.dataset.direction;
|
|
99
|
+
this.startX = e.clientX;
|
|
100
|
+
this.startY = e.clientY;
|
|
101
|
+
const rect = this.mainElement.getBoundingClientRect();
|
|
102
|
+
this.startWidth = rect.width;
|
|
103
|
+
this.startHeight = rect.height;
|
|
104
|
+
this.startLeft = rect.left;
|
|
105
|
+
this.startTop = rect.top;
|
|
106
|
+
// Calculate offset from click position to actual edge
|
|
107
|
+
// This prevents the initial "jump" when starting to drag
|
|
108
|
+
this.resizeOffsetX = 0;
|
|
109
|
+
this.resizeOffsetY = 0;
|
|
110
|
+
switch (this.currentResizeHandle) {
|
|
111
|
+
case 'n':
|
|
112
|
+
this.resizeOffsetY = e.clientY - rect.top;
|
|
113
|
+
break;
|
|
114
|
+
case 's':
|
|
115
|
+
this.resizeOffsetY = e.clientY - rect.bottom;
|
|
116
|
+
break;
|
|
117
|
+
case 'e':
|
|
118
|
+
this.resizeOffsetX = e.clientX - rect.right;
|
|
119
|
+
break;
|
|
120
|
+
case 'w':
|
|
121
|
+
this.resizeOffsetX = e.clientX - rect.left;
|
|
122
|
+
break;
|
|
123
|
+
case 'ne':
|
|
124
|
+
this.resizeOffsetX = e.clientX - rect.right;
|
|
125
|
+
this.resizeOffsetY = e.clientY - rect.top;
|
|
126
|
+
break;
|
|
127
|
+
case 'nw':
|
|
128
|
+
this.resizeOffsetX = e.clientX - rect.left;
|
|
129
|
+
this.resizeOffsetY = e.clientY - rect.top;
|
|
130
|
+
break;
|
|
131
|
+
case 'se':
|
|
132
|
+
this.resizeOffsetX = e.clientX - rect.right;
|
|
133
|
+
this.resizeOffsetY = e.clientY - rect.bottom;
|
|
134
|
+
break;
|
|
135
|
+
case 'sw':
|
|
136
|
+
this.resizeOffsetX = e.clientX - rect.left;
|
|
137
|
+
this.resizeOffsetY = e.clientY - rect.bottom;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
// Convert to fixed positioning to allow precise position control
|
|
141
|
+
this.mainElement.style.position = 'fixed';
|
|
142
|
+
this.mainElement.style.left = `${rect.left}px`;
|
|
143
|
+
this.mainElement.style.top = `${rect.top}px`;
|
|
144
|
+
this.mainElement.style.margin = '0';
|
|
145
|
+
// Add document-level listeners for smooth resizing
|
|
146
|
+
document.addEventListener('mousemove', this.handleResizeMove.bind(this));
|
|
147
|
+
document.addEventListener('mouseup', this.handleResizeEnd.bind(this));
|
|
148
|
+
// Add resizing class for styling
|
|
149
|
+
this.mainElement.classList.add('resizing');
|
|
150
|
+
}
|
|
151
|
+
handleResizeMove(e) {
|
|
152
|
+
if (!this.isResizing || !this.currentResizeHandle)
|
|
153
|
+
return;
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
// Apply the offset to eliminate initial jump
|
|
156
|
+
const deltaX = e.clientX - this.startX - this.resizeOffsetX;
|
|
157
|
+
const deltaY = e.clientY - this.startY - this.resizeOffsetY;
|
|
158
|
+
let newWidth = this.startWidth;
|
|
159
|
+
let newHeight = this.startHeight;
|
|
160
|
+
let newLeft = this.startLeft;
|
|
161
|
+
let newTop = this.startTop;
|
|
162
|
+
let shouldUpdatePosition = false;
|
|
163
|
+
// Calculate new dimensions and positions based on resize handle direction
|
|
164
|
+
switch (this.currentResizeHandle) {
|
|
165
|
+
case 'se': // bottom-right
|
|
166
|
+
newWidth = this.startWidth + deltaX;
|
|
167
|
+
newHeight = this.startHeight + deltaY;
|
|
168
|
+
break;
|
|
169
|
+
case 'sw': // bottom-left
|
|
170
|
+
newWidth = this.startWidth - deltaX;
|
|
171
|
+
newHeight = this.startHeight + deltaY;
|
|
172
|
+
newLeft = this.startLeft + deltaX;
|
|
173
|
+
shouldUpdatePosition = true;
|
|
174
|
+
break;
|
|
175
|
+
case 'ne': // top-right
|
|
176
|
+
newWidth = this.startWidth + deltaX;
|
|
177
|
+
newHeight = this.startHeight - deltaY;
|
|
178
|
+
newTop = this.startTop + deltaY;
|
|
179
|
+
shouldUpdatePosition = true;
|
|
180
|
+
break;
|
|
181
|
+
case 'nw': // top-left
|
|
182
|
+
newWidth = this.startWidth - deltaX;
|
|
183
|
+
newHeight = this.startHeight - deltaY;
|
|
184
|
+
newLeft = this.startLeft + deltaX;
|
|
185
|
+
newTop = this.startTop + deltaY;
|
|
186
|
+
shouldUpdatePosition = true;
|
|
187
|
+
break;
|
|
188
|
+
case 'e': // right
|
|
189
|
+
newWidth = this.startWidth + deltaX;
|
|
190
|
+
break;
|
|
191
|
+
case 'w': // left
|
|
192
|
+
newWidth = this.startWidth - deltaX;
|
|
193
|
+
newLeft = this.startLeft + deltaX;
|
|
194
|
+
shouldUpdatePosition = true;
|
|
195
|
+
break;
|
|
196
|
+
case 's': // bottom
|
|
197
|
+
newHeight = this.startHeight + deltaY;
|
|
198
|
+
break;
|
|
199
|
+
case 'n': // top
|
|
200
|
+
newHeight = this.startHeight - deltaY;
|
|
201
|
+
newTop = this.startTop + deltaY;
|
|
202
|
+
shouldUpdatePosition = true;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
// Apply minimum constraints only when resizable
|
|
206
|
+
if (this.resizable) {
|
|
207
|
+
// Apply minimum width constraint and adjust position if needed
|
|
208
|
+
if (newWidth < this.minWidth) {
|
|
209
|
+
const widthDiff = this.minWidth - newWidth;
|
|
210
|
+
newWidth = this.minWidth;
|
|
211
|
+
// If resizing from left edge, maintain the right edge position
|
|
212
|
+
if (this.currentResizeHandle.includes('w')) {
|
|
213
|
+
newLeft = newLeft - widthDiff;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// Apply minimum height constraint and adjust position if needed
|
|
217
|
+
if (newHeight < this.minHeight) {
|
|
218
|
+
const heightDiff = this.minHeight - newHeight;
|
|
219
|
+
newHeight = this.minHeight;
|
|
220
|
+
// If resizing from top edge, maintain the bottom edge position
|
|
221
|
+
if (this.currentResizeHandle.includes('n')) {
|
|
222
|
+
newTop = newTop - heightDiff;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Apply new dimensions
|
|
227
|
+
this.mainElement.style.width = `${newWidth}px`;
|
|
228
|
+
this.mainElement.style.height = `${newHeight}px`;
|
|
229
|
+
// Always update position when using handles that move edges
|
|
230
|
+
if (shouldUpdatePosition) {
|
|
231
|
+
this.mainElement.style.left = `${newLeft}px`;
|
|
232
|
+
this.mainElement.style.top = `${newTop}px`;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
handleResizeEnd(e) {
|
|
236
|
+
if (!this.isResizing)
|
|
237
|
+
return;
|
|
238
|
+
e.preventDefault();
|
|
239
|
+
this.isResizing = false;
|
|
240
|
+
this.currentResizeHandle = null;
|
|
241
|
+
this.resizeOffsetX = 0;
|
|
242
|
+
this.resizeOffsetY = 0;
|
|
243
|
+
// Remove document-level listeners
|
|
244
|
+
document.removeEventListener('mousemove', this.handleResizeMove.bind(this));
|
|
245
|
+
document.removeEventListener('mouseup', this.handleResizeEnd.bind(this));
|
|
246
|
+
// Remove resizing class
|
|
247
|
+
this.mainElement.classList.remove('resizing');
|
|
248
|
+
this.$emit('resize', {
|
|
249
|
+
width: this.mainElement.offsetWidth,
|
|
250
|
+
height: this.mainElement.offsetHeight,
|
|
251
|
+
});
|
|
44
252
|
}
|
|
45
253
|
/**
|
|
46
254
|
* Determine if the dialog is showing or closed.
|
|
@@ -89,6 +297,15 @@ __decorate([
|
|
|
89
297
|
__decorate([
|
|
90
298
|
attr({ mode: 'boolean', attribute: 'show-close-icon' })
|
|
91
299
|
], DialogElement.prototype, "showCloseIcon", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
attr({ mode: 'boolean', attribute: 'resizable' })
|
|
302
|
+
], DialogElement.prototype, "resizable", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
attr({ attribute: 'min-width' })
|
|
305
|
+
], DialogElement.prototype, "minWidth", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
attr({ attribute: 'min-height' })
|
|
308
|
+
], DialogElement.prototype, "minHeight", void 0);
|
|
92
309
|
__decorate([
|
|
93
310
|
observable
|
|
94
311
|
], DialogElement.prototype, "onShowCallback", void 0);
|
|
@@ -74,4 +74,146 @@ export const foundationDialogStyles = css `
|
|
|
74
74
|
min-height: var(--notification-details-min-height);
|
|
75
75
|
white-space: pre-line;
|
|
76
76
|
}
|
|
77
|
+
|
|
78
|
+
:host([resizable]) dialog {
|
|
79
|
+
position: relative;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([resizable]) dialog .content-wrapper {
|
|
84
|
+
position: relative;
|
|
85
|
+
height: 100%;
|
|
86
|
+
width: 100%;
|
|
87
|
+
min-width: 100%;
|
|
88
|
+
max-width: 100%;
|
|
89
|
+
resize: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Resize handles */
|
|
93
|
+
.resize-handle {
|
|
94
|
+
position: absolute;
|
|
95
|
+
z-index: 10;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* Edge handles */
|
|
99
|
+
.resize-handle-n,
|
|
100
|
+
.resize-handle-s {
|
|
101
|
+
left: 0;
|
|
102
|
+
right: 0;
|
|
103
|
+
height: 8px;
|
|
104
|
+
cursor: ns-resize;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.resize-handle-n {
|
|
108
|
+
top: 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.resize-handle-s {
|
|
112
|
+
bottom: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.resize-handle-e,
|
|
116
|
+
.resize-handle-w {
|
|
117
|
+
top: 0;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
width: 8px;
|
|
120
|
+
cursor: ew-resize;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.resize-handle-e {
|
|
124
|
+
right: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.resize-handle-w {
|
|
128
|
+
left: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Corner handles */
|
|
132
|
+
.resize-handle-ne,
|
|
133
|
+
.resize-handle-nw,
|
|
134
|
+
.resize-handle-se,
|
|
135
|
+
.resize-handle-sw {
|
|
136
|
+
width: 16px;
|
|
137
|
+
height: 16px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.resize-handle-ne {
|
|
141
|
+
top: 0;
|
|
142
|
+
right: 0;
|
|
143
|
+
cursor: nesw-resize;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.resize-handle-nw {
|
|
147
|
+
top: 0;
|
|
148
|
+
left: 0;
|
|
149
|
+
cursor: nwse-resize;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.resize-handle-se {
|
|
153
|
+
bottom: 0;
|
|
154
|
+
right: 0;
|
|
155
|
+
cursor: nwse-resize;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.resize-handle-sw {
|
|
159
|
+
bottom: 0;
|
|
160
|
+
left: 0;
|
|
161
|
+
cursor: nesw-resize;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Visual indicator for corner handles */
|
|
165
|
+
.resize-handle-se::after,
|
|
166
|
+
.resize-handle-sw::after,
|
|
167
|
+
.resize-handle-ne::after,
|
|
168
|
+
.resize-handle-nw::after {
|
|
169
|
+
content: '';
|
|
170
|
+
position: absolute;
|
|
171
|
+
width: 8px;
|
|
172
|
+
height: 8px;
|
|
173
|
+
border-style: solid;
|
|
174
|
+
border-color: var(--neutral-stroke-divider-rest);
|
|
175
|
+
opacity: 50%;
|
|
176
|
+
transition: opacity 0.2s;
|
|
177
|
+
margin: 2px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.resize-handle-se::after {
|
|
181
|
+
bottom: 2px;
|
|
182
|
+
right: 2px;
|
|
183
|
+
border-width: 0 3px 3px 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.resize-handle-sw::after {
|
|
187
|
+
bottom: 2px;
|
|
188
|
+
left: 2px;
|
|
189
|
+
border-width: 0 0 3px 3px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.resize-handle-ne::after {
|
|
193
|
+
top: 2px;
|
|
194
|
+
right: 2px;
|
|
195
|
+
border-width: 3px 3px 0 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.resize-handle-nw::after {
|
|
199
|
+
top: 2px;
|
|
200
|
+
left: 2px;
|
|
201
|
+
border-width: 3px 0 0 3px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Hover effect */
|
|
205
|
+
.resize-handle:hover::after {
|
|
206
|
+
opacity: 100%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* Resizing state */
|
|
210
|
+
dialog.resizing {
|
|
211
|
+
user-select: none;
|
|
212
|
+
pointer-events: auto;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Fixed positioning support for resizable dialogs */
|
|
216
|
+
dialog[style*='position: fixed'] {
|
|
217
|
+
margin: 0;
|
|
218
|
+
}
|
|
77
219
|
`;
|
|
@@ -43,6 +43,16 @@ export const getDialogTemplate = (prefix) => html `
|
|
|
43
43
|
</slot>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
+
${when((x) => x.resizable, html `
|
|
47
|
+
<div class="resize-handle resize-handle-n" data-direction="n"></div>
|
|
48
|
+
<div class="resize-handle resize-handle-s" data-direction="s"></div>
|
|
49
|
+
<div class="resize-handle resize-handle-e" data-direction="e"></div>
|
|
50
|
+
<div class="resize-handle resize-handle-w" data-direction="w"></div>
|
|
51
|
+
<div class="resize-handle resize-handle-ne" data-direction="ne"></div>
|
|
52
|
+
<div class="resize-handle resize-handle-nw" data-direction="nw"></div>
|
|
53
|
+
<div class="resize-handle resize-handle-se" data-direction="se"></div>
|
|
54
|
+
<div class="resize-handle resize-handle-sw" data-direction="sw"></div>
|
|
55
|
+
`)}
|
|
46
56
|
</dialog>
|
|
47
57
|
`;
|
|
48
58
|
export const foundationDialogTemplate = html `
|
|
@@ -112,9 +112,11 @@ let OptionsDatasource = OptionsDatasource_1 = class OptionsDatasource extends Ba
|
|
|
112
112
|
var _a;
|
|
113
113
|
return ({
|
|
114
114
|
value: row[this.valueField],
|
|
115
|
-
label: this.
|
|
116
|
-
? this.
|
|
117
|
-
: this.
|
|
115
|
+
label: this.labelRowFormatter
|
|
116
|
+
? this.labelRowFormatter(row)
|
|
117
|
+
: this.labelFormatter
|
|
118
|
+
? this.labelFormatter(row[this.labelField])
|
|
119
|
+
: this.getDefaultLabelFormat(row[this.labelField], (_a = this.getFieldMetadata(this.labelField)) === null || _a === void 0 ? void 0 : _a.type),
|
|
118
120
|
});
|
|
119
121
|
});
|
|
120
122
|
const listboxOptions = this.options.map(({ value, label }) => {
|
|
@@ -206,6 +208,9 @@ __decorate([
|
|
|
206
208
|
__decorate([
|
|
207
209
|
observable
|
|
208
210
|
], OptionsDatasource.prototype, "labelFormatter", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
observable
|
|
213
|
+
], OptionsDatasource.prototype, "labelRowFormatter", void 0);
|
|
209
214
|
__decorate([
|
|
210
215
|
observable
|
|
211
216
|
], OptionsDatasource.prototype, "initialSelectedValue", void 0);
|
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.342.0",
|
|
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.342.0",
|
|
87
|
+
"@genesislcap/genx": "14.342.0",
|
|
88
|
+
"@genesislcap/rollup-builder": "14.342.0",
|
|
89
|
+
"@genesislcap/ts-builder": "14.342.0",
|
|
90
|
+
"@genesislcap/uvu-playwright-builder": "14.342.0",
|
|
91
|
+
"@genesislcap/vite-builder": "14.342.0",
|
|
92
|
+
"@genesislcap/webpack-builder": "14.342.0",
|
|
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.342.0",
|
|
102
|
+
"@genesislcap/foundation-comms": "14.342.0",
|
|
103
|
+
"@genesislcap/foundation-criteria": "14.342.0",
|
|
104
|
+
"@genesislcap/foundation-errors": "14.342.0",
|
|
105
|
+
"@genesislcap/foundation-events": "14.342.0",
|
|
106
|
+
"@genesislcap/foundation-logger": "14.342.0",
|
|
107
|
+
"@genesislcap/foundation-notifications": "14.342.0",
|
|
108
|
+
"@genesislcap/foundation-user": "14.342.0",
|
|
109
|
+
"@genesislcap/foundation-utils": "14.342.0",
|
|
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": "bdc6df2edd12875ab7886e6d8808cf9b320de918"
|
|
132
132
|
}
|