lightning-base-components 1.28.14-alpha → 1.28.15-alpha
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/metadata/raptor.json +3 -10
- package/package.json +5 -1
- package/scopedImports/@salesforce-label-LightningRichTextAssist.composeText.js +1 -1
- package/src/lightning/datatable/keyboard.d.ts.map +1 -1
- package/src/lightning/datatable/keyboard.js +4 -4
- package/src/lightning/features/gates/imports.d.ts +1 -0
- package/src/lightning/features/gates/imports.d.ts.map +1 -1
- package/src/lightning/features/gates/imports.js +1 -0
- package/src/lightning/features/types.d.ts +1 -0
- package/src/lightning/features/types.d.ts.map +1 -1
- package/src/lightning/groupedCombobox/groupedCombobox.d.ts +4 -0
- package/src/lightning/groupedCombobox/groupedCombobox.d.ts.map +1 -1
- package/src/lightning/groupedCombobox/groupedCombobox.html +1 -0
- package/src/lightning/groupedCombobox/groupedCombobox.js +13 -1
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts +1 -1
- package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts.map +1 -1
- package/src/lightning/overlayBase/overlayBase.css +21 -0
- package/src/lightning/overlayBase/overlayBase.d.ts +28 -0
- package/src/lightning/overlayBase/overlayBase.d.ts.map +1 -0
- package/src/lightning/overlayBase/overlayBase.html +24 -0
- package/src/lightning/overlayBase/overlayBase.js +125 -0
- package/src/lightning/overlayBase/overlayBase.js-meta.xml +8 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts +24 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.js +49 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts +14 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/cssAnchorPositioning.js +94 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts +55 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.js +107 -0
- package/src/lightning/overlayPositionUtils/overlayPositionUtils.js-meta.xml +6 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts +30 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts.map +1 -0
- package/src/lightning/overlayPositionUtils/positionLibraryFallback.js +435 -0
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts +1 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts.map +1 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -4
- package/src/lightning/primitiveHeaderFactory/selectableHeader.html +1 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +1 -1
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.d.ts.map +1 -1
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +2 -1
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts +13 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.html +27 -0
- package/src/lightning/primitiveOverlay/__examples__/alert/alert.js +34 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.css +7 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts +12 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.html +18 -0
- package/src/lightning/primitiveOverlay/__examples__/basic/basic.js +58 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts +11 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.html +29 -0
- package/src/lightning/primitiveOverlay/__examples__/demo/demo.js +41 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts +9 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.html +17 -0
- package/src/lightning/primitiveOverlay/__examples__/panel/panel.js +24 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts +8 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts.map +1 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.html +4 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.js +37 -0
- package/src/lightning/primitiveOverlay/primitiveOverlay.js-meta.xml +7 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts +2 -0
- package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts.map +1 -1
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +45 -3
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { AutoPosition, Direction } from 'lightning/positionLibrary';
|
|
7
|
+
import { normalizeSizingValue } from './overlayPositionUtils';
|
|
8
|
+
import { isRTL } from 'lightning/utilsPrivate';
|
|
9
|
+
export class PositionLibraryFallback {
|
|
10
|
+
element;
|
|
11
|
+
config;
|
|
12
|
+
autoPosition;
|
|
13
|
+
positionUpdater;
|
|
14
|
+
constructor(element, config = {}) {
|
|
15
|
+
this.element = element;
|
|
16
|
+
this.config = config;
|
|
17
|
+
this.autoPosition = null;
|
|
18
|
+
this.positionUpdater = null;
|
|
19
|
+
}
|
|
20
|
+
getPhysicalDirection(direction) {
|
|
21
|
+
if (isRTL()) {
|
|
22
|
+
if (direction === Direction.Left) {
|
|
23
|
+
return Direction.Right;
|
|
24
|
+
}
|
|
25
|
+
if (direction === Direction.Right) {
|
|
26
|
+
return Direction.Left;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return direction;
|
|
30
|
+
}
|
|
31
|
+
shouldAlignWidth(position) {
|
|
32
|
+
const horizontal = position.toLowerCase().split(/\s+/)[1];
|
|
33
|
+
return horizontal === 'center';
|
|
34
|
+
}
|
|
35
|
+
apply() {
|
|
36
|
+
const { source, position, offsetInline = 0, offsetBlock = 0, } = this.config;
|
|
37
|
+
if (this.element?.style?.display === 'none') {
|
|
38
|
+
this.element.style.display = '';
|
|
39
|
+
}
|
|
40
|
+
this.applySizingStyles();
|
|
41
|
+
if (!this.autoPosition) {
|
|
42
|
+
this.autoPosition = new AutoPosition(this.element);
|
|
43
|
+
}
|
|
44
|
+
let alignment = this.convertPositionToAlignment(position);
|
|
45
|
+
alignment = {
|
|
46
|
+
align: {
|
|
47
|
+
horizontal: this.getPhysicalDirection(alignment.align.horizontal),
|
|
48
|
+
vertical: alignment.align.vertical,
|
|
49
|
+
},
|
|
50
|
+
targetAlign: {
|
|
51
|
+
horizontal: this.getPhysicalDirection(alignment.targetAlign.horizontal),
|
|
52
|
+
vertical: alignment.targetAlign.vertical,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
const padding = {
|
|
56
|
+
padLeft: offsetInline,
|
|
57
|
+
padTop: offsetBlock,
|
|
58
|
+
};
|
|
59
|
+
const positionConfig = {
|
|
60
|
+
target: () => source,
|
|
61
|
+
element: () => this.element,
|
|
62
|
+
align: alignment.align,
|
|
63
|
+
targetAlign: alignment.targetAlign,
|
|
64
|
+
alignWidth: this.shouldAlignWidth(position),
|
|
65
|
+
autoFlip: true,
|
|
66
|
+
considerPadForFlip: true,
|
|
67
|
+
autoShrink: true,
|
|
68
|
+
...padding,
|
|
69
|
+
};
|
|
70
|
+
try {
|
|
71
|
+
const autoPositionUpdater = this.autoPosition.start(positionConfig);
|
|
72
|
+
if (autoPositionUpdater) {
|
|
73
|
+
this.positionUpdater = autoPositionUpdater;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error('Error positioning element with positionLibrary:', error);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
applySizingStyles() {
|
|
81
|
+
const { minWidth, maxWidth, minHeight, maxHeight } = this.config;
|
|
82
|
+
const normalizedMinWidth = normalizeSizingValue(minWidth);
|
|
83
|
+
const normalizedMaxWidth = normalizeSizingValue(maxWidth);
|
|
84
|
+
const normalizedMinHeight = normalizeSizingValue(minHeight);
|
|
85
|
+
const normalizedMaxHeight = normalizeSizingValue(maxHeight);
|
|
86
|
+
if (normalizedMinWidth) {
|
|
87
|
+
this.element.style.minWidth = normalizedMinWidth;
|
|
88
|
+
}
|
|
89
|
+
if (normalizedMaxWidth) {
|
|
90
|
+
this.element.style.maxWidth = normalizedMaxWidth;
|
|
91
|
+
}
|
|
92
|
+
if (normalizedMinHeight) {
|
|
93
|
+
this.element.style.minHeight = normalizedMinHeight;
|
|
94
|
+
}
|
|
95
|
+
if (normalizedMaxHeight) {
|
|
96
|
+
this.element.style.maxHeight = normalizedMaxHeight;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
convertPositionToAlignment(position) {
|
|
100
|
+
const [vertical, horizontal] = position.toLowerCase().split(/\s+/);
|
|
101
|
+
const alignmentMap = {
|
|
102
|
+
'top left': {
|
|
103
|
+
align: {
|
|
104
|
+
horizontal: Direction.Right,
|
|
105
|
+
vertical: Direction.Bottom,
|
|
106
|
+
},
|
|
107
|
+
targetAlign: {
|
|
108
|
+
horizontal: Direction.Left,
|
|
109
|
+
vertical: Direction.Top,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
'top center': {
|
|
113
|
+
align: {
|
|
114
|
+
horizontal: Direction.Center,
|
|
115
|
+
vertical: Direction.Bottom,
|
|
116
|
+
},
|
|
117
|
+
targetAlign: {
|
|
118
|
+
horizontal: Direction.Center,
|
|
119
|
+
vertical: Direction.Top,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
'top right': {
|
|
123
|
+
align: {
|
|
124
|
+
horizontal: Direction.Left,
|
|
125
|
+
vertical: Direction.Bottom,
|
|
126
|
+
},
|
|
127
|
+
targetAlign: {
|
|
128
|
+
horizontal: Direction.Right,
|
|
129
|
+
vertical: Direction.Top,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
'top span-right': {
|
|
133
|
+
align: {
|
|
134
|
+
horizontal: Direction.Left,
|
|
135
|
+
vertical: Direction.Bottom,
|
|
136
|
+
},
|
|
137
|
+
targetAlign: {
|
|
138
|
+
horizontal: Direction.Left,
|
|
139
|
+
vertical: Direction.Top,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
'top span-all': {
|
|
143
|
+
align: {
|
|
144
|
+
horizontal: Direction.Center,
|
|
145
|
+
vertical: Direction.Bottom,
|
|
146
|
+
},
|
|
147
|
+
targetAlign: {
|
|
148
|
+
horizontal: Direction.Center,
|
|
149
|
+
vertical: Direction.Top,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
'top span-left': {
|
|
153
|
+
align: {
|
|
154
|
+
horizontal: Direction.Right,
|
|
155
|
+
vertical: Direction.Bottom,
|
|
156
|
+
},
|
|
157
|
+
targetAlign: {
|
|
158
|
+
horizontal: Direction.Right,
|
|
159
|
+
vertical: Direction.Top,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
'center left': {
|
|
163
|
+
align: {
|
|
164
|
+
horizontal: Direction.Right,
|
|
165
|
+
vertical: Direction.Center,
|
|
166
|
+
},
|
|
167
|
+
targetAlign: {
|
|
168
|
+
horizontal: Direction.Left,
|
|
169
|
+
vertical: Direction.Center,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
'center center': {
|
|
173
|
+
align: {
|
|
174
|
+
horizontal: Direction.Center,
|
|
175
|
+
vertical: Direction.Center,
|
|
176
|
+
},
|
|
177
|
+
targetAlign: {
|
|
178
|
+
horizontal: Direction.Center,
|
|
179
|
+
vertical: Direction.Center,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
'center right': {
|
|
183
|
+
align: {
|
|
184
|
+
horizontal: Direction.Left,
|
|
185
|
+
vertical: Direction.Center,
|
|
186
|
+
},
|
|
187
|
+
targetAlign: {
|
|
188
|
+
horizontal: Direction.Right,
|
|
189
|
+
vertical: Direction.Center,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
'center span-right': {
|
|
193
|
+
align: {
|
|
194
|
+
horizontal: Direction.Left,
|
|
195
|
+
vertical: Direction.Center,
|
|
196
|
+
},
|
|
197
|
+
targetAlign: {
|
|
198
|
+
horizontal: Direction.Left,
|
|
199
|
+
vertical: Direction.Center,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
'center span-left': {
|
|
203
|
+
align: {
|
|
204
|
+
horizontal: Direction.Right,
|
|
205
|
+
vertical: Direction.Center,
|
|
206
|
+
},
|
|
207
|
+
targetAlign: {
|
|
208
|
+
horizontal: Direction.Right,
|
|
209
|
+
vertical: Direction.Center,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
'center span-all': {
|
|
213
|
+
align: {
|
|
214
|
+
horizontal: Direction.Center,
|
|
215
|
+
vertical: Direction.Center,
|
|
216
|
+
},
|
|
217
|
+
targetAlign: {
|
|
218
|
+
horizontal: Direction.Center,
|
|
219
|
+
vertical: Direction.Center,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
'bottom left': {
|
|
223
|
+
align: { horizontal: Direction.Right, vertical: Direction.Top },
|
|
224
|
+
targetAlign: {
|
|
225
|
+
horizontal: Direction.Left,
|
|
226
|
+
vertical: Direction.Bottom,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
'bottom center': {
|
|
230
|
+
align: {
|
|
231
|
+
horizontal: Direction.Center,
|
|
232
|
+
vertical: Direction.Top,
|
|
233
|
+
},
|
|
234
|
+
targetAlign: {
|
|
235
|
+
horizontal: Direction.Center,
|
|
236
|
+
vertical: Direction.Bottom,
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
'bottom right': {
|
|
240
|
+
align: { horizontal: Direction.Left, vertical: Direction.Top },
|
|
241
|
+
targetAlign: {
|
|
242
|
+
horizontal: Direction.Right,
|
|
243
|
+
vertical: Direction.Bottom,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
'bottom span-right': {
|
|
247
|
+
align: { horizontal: Direction.Left, vertical: Direction.Top },
|
|
248
|
+
targetAlign: {
|
|
249
|
+
horizontal: Direction.Left,
|
|
250
|
+
vertical: Direction.Bottom,
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
'bottom span-all': {
|
|
254
|
+
align: {
|
|
255
|
+
horizontal: Direction.Center,
|
|
256
|
+
vertical: Direction.Top,
|
|
257
|
+
},
|
|
258
|
+
targetAlign: {
|
|
259
|
+
horizontal: Direction.Center,
|
|
260
|
+
vertical: Direction.Bottom,
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
'bottom span-left': {
|
|
264
|
+
align: { horizontal: Direction.Right, vertical: Direction.Top },
|
|
265
|
+
targetAlign: {
|
|
266
|
+
horizontal: Direction.Right,
|
|
267
|
+
vertical: Direction.Bottom,
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
'span-top left': {
|
|
271
|
+
align: {
|
|
272
|
+
horizontal: Direction.Right,
|
|
273
|
+
vertical: Direction.Bottom,
|
|
274
|
+
},
|
|
275
|
+
targetAlign: {
|
|
276
|
+
horizontal: Direction.Left,
|
|
277
|
+
vertical: Direction.Bottom,
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
'span-top center': {
|
|
281
|
+
align: {
|
|
282
|
+
horizontal: Direction.Center,
|
|
283
|
+
vertical: Direction.Bottom,
|
|
284
|
+
},
|
|
285
|
+
targetAlign: {
|
|
286
|
+
horizontal: Direction.Center,
|
|
287
|
+
vertical: Direction.Bottom,
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
'span-top right': {
|
|
291
|
+
align: {
|
|
292
|
+
horizontal: Direction.Left,
|
|
293
|
+
vertical: Direction.Bottom,
|
|
294
|
+
},
|
|
295
|
+
targetAlign: {
|
|
296
|
+
horizontal: Direction.Right,
|
|
297
|
+
vertical: Direction.Bottom,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
'span-top span-right': {
|
|
301
|
+
align: {
|
|
302
|
+
horizontal: Direction.Left,
|
|
303
|
+
vertical: Direction.Bottom,
|
|
304
|
+
},
|
|
305
|
+
targetAlign: {
|
|
306
|
+
horizontal: Direction.Left,
|
|
307
|
+
vertical: Direction.Bottom,
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
'span-top span-all': {
|
|
311
|
+
align: {
|
|
312
|
+
horizontal: Direction.Center,
|
|
313
|
+
vertical: Direction.Bottom,
|
|
314
|
+
},
|
|
315
|
+
targetAlign: {
|
|
316
|
+
horizontal: Direction.Center,
|
|
317
|
+
vertical: Direction.Bottom,
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
'span-top span-left': {
|
|
321
|
+
align: {
|
|
322
|
+
horizontal: Direction.Right,
|
|
323
|
+
vertical: Direction.Bottom,
|
|
324
|
+
},
|
|
325
|
+
targetAlign: {
|
|
326
|
+
horizontal: Direction.Right,
|
|
327
|
+
vertical: Direction.Bottom,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
'span-all span-all': {
|
|
331
|
+
align: {
|
|
332
|
+
horizontal: Direction.Center,
|
|
333
|
+
vertical: Direction.Center,
|
|
334
|
+
},
|
|
335
|
+
targetAlign: {
|
|
336
|
+
horizontal: Direction.Center,
|
|
337
|
+
vertical: Direction.Center,
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
'span-all left': {
|
|
341
|
+
align: {
|
|
342
|
+
horizontal: Direction.Right,
|
|
343
|
+
vertical: Direction.Center,
|
|
344
|
+
},
|
|
345
|
+
targetAlign: {
|
|
346
|
+
horizontal: Direction.Left,
|
|
347
|
+
vertical: Direction.Center,
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
'span-all center': {
|
|
351
|
+
align: {
|
|
352
|
+
horizontal: Direction.Center,
|
|
353
|
+
vertical: Direction.Center,
|
|
354
|
+
},
|
|
355
|
+
targetAlign: {
|
|
356
|
+
horizontal: Direction.Center,
|
|
357
|
+
vertical: Direction.Center,
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
'span-all right': {
|
|
361
|
+
align: {
|
|
362
|
+
horizontal: Direction.Left,
|
|
363
|
+
vertical: Direction.Center,
|
|
364
|
+
},
|
|
365
|
+
targetAlign: {
|
|
366
|
+
horizontal: Direction.Right,
|
|
367
|
+
vertical: Direction.Center,
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
'span-bottom left': {
|
|
371
|
+
align: { horizontal: Direction.Right, vertical: Direction.Top },
|
|
372
|
+
targetAlign: {
|
|
373
|
+
horizontal: Direction.Left,
|
|
374
|
+
vertical: Direction.Top,
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
'span-bottom center': {
|
|
378
|
+
align: {
|
|
379
|
+
horizontal: Direction.Center,
|
|
380
|
+
vertical: Direction.Top,
|
|
381
|
+
},
|
|
382
|
+
targetAlign: {
|
|
383
|
+
horizontal: Direction.Center,
|
|
384
|
+
vertical: Direction.Top,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
'span-bottom right': {
|
|
388
|
+
align: { horizontal: Direction.Left, vertical: Direction.Top },
|
|
389
|
+
targetAlign: {
|
|
390
|
+
horizontal: Direction.Right,
|
|
391
|
+
vertical: Direction.Top,
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
'span-bottom span-right': {
|
|
395
|
+
align: { horizontal: Direction.Left, vertical: Direction.Top },
|
|
396
|
+
targetAlign: {
|
|
397
|
+
horizontal: Direction.Left,
|
|
398
|
+
vertical: Direction.Top,
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
'span-bottom span-all': {
|
|
402
|
+
align: {
|
|
403
|
+
horizontal: Direction.Center,
|
|
404
|
+
vertical: Direction.Top,
|
|
405
|
+
},
|
|
406
|
+
targetAlign: {
|
|
407
|
+
horizontal: Direction.Center,
|
|
408
|
+
vertical: Direction.Top,
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
'span-bottom span-left': {
|
|
412
|
+
align: { horizontal: Direction.Right, vertical: Direction.Top },
|
|
413
|
+
targetAlign: {
|
|
414
|
+
horizontal: Direction.Right,
|
|
415
|
+
vertical: Direction.Top,
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
};
|
|
419
|
+
const key = horizontal ? `${vertical} ${horizontal}` : vertical;
|
|
420
|
+
return alignmentMap[key];
|
|
421
|
+
}
|
|
422
|
+
cleanup() {
|
|
423
|
+
if (this.autoPosition) {
|
|
424
|
+
this.autoPosition.stop();
|
|
425
|
+
this.autoPosition = null;
|
|
426
|
+
}
|
|
427
|
+
this.positionUpdater = null;
|
|
428
|
+
if (this.element) {
|
|
429
|
+
this.element?.style?.removeProperty('min-width');
|
|
430
|
+
this.element?.style?.removeProperty('max-width');
|
|
431
|
+
this.element?.style?.removeProperty('min-height');
|
|
432
|
+
this.element?.style?.removeProperty('max-height');
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
@@ -42,7 +42,7 @@ export default class PrivateCellFactory extends PrimitiveDatatableCell {
|
|
|
42
42
|
set columnType(value: any);
|
|
43
43
|
get columnType(): any;
|
|
44
44
|
_columnType: any;
|
|
45
|
-
getActionableElements():
|
|
45
|
+
getActionableElements(): any[];
|
|
46
46
|
isType(typeName: any): boolean;
|
|
47
47
|
get consolidateTypeAttributes(): boolean;
|
|
48
48
|
get isText(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveCellFactory.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/primitiveCellFactory/primitiveCellFactory.js"],"names":[],"mappings":"AAiCA;IACI,kCAAoC;IACpC,WAAW;IACX,eAAe;IACf,WAAW;IACX,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,kBAAkB;IAClB,yBAAyB;IACzB,wBAAwB;IACxB,cAAc;IACd,kBAAkB;IAClB,yBAAyB;IACzB,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;IAErB,qBAAqB;IACrB,qBAAqB;IACrB,uBAA6B;IAC7B,mBAAyB;IACzB,sBAAsB;IAEtB,uBAAsB;IACtB,mBAAkB;IAClB,sBAAqB;IAOrB,iCAEC;IAPD,4BAGC;IAWD,6BAQC;IAbD,wBAGC;IAiBD,2BAKC;IAVD,sBAGC;IAMG,iBAAwB;IAG5B
|
|
1
|
+
{"version":3,"file":"primitiveCellFactory.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/primitiveCellFactory/primitiveCellFactory.js"],"names":[],"mappings":"AAiCA;IACI,kCAAoC;IACpC,WAAW;IACX,eAAe;IACf,WAAW;IACX,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,kBAAkB;IAClB,yBAAyB;IACzB,wBAAwB;IACxB,cAAc;IACd,kBAAkB;IAClB,yBAAyB;IACzB,cAAc;IACd,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,qBAAqB;IAErB,qBAAqB;IACrB,qBAAqB;IACrB,uBAA6B;IAC7B,mBAAyB;IACzB,sBAAsB;IAEtB,uBAAsB;IACtB,mBAAkB;IAClB,sBAAqB;IAOrB,iCAEC;IAPD,4BAGC;IAWD,6BAQC;IAbD,wBAGC;IAiBD,2BAKC;IAVD,sBAGC;IAMG,iBAAwB;IAG5B,+BAmBC;IAOD,+BAEC;IAED,yCAEC;IAED,sBAEC;IAED,wBAEC;IAED,0BAEC;IAED,yBAEC;IAED,uBAEC;IAED,0BAEC;IAED,uBAEC;IAED,qBAEC;IAED,0BAEC;IAED,2BAEC;IAED,2BAcC;IAED,wBAEC;IAED,wBAEC;IAED,4BAEC;IAED,yBAEC;IAED,2BAEC;IAED,qBAOC;IAED,2BAEC;IAOD,sBAMC;IAaD,iCAEC;IAID,6BAmBC;IAED,2BAMC;IAED,4BAEC;IAED,yCAEC;IAED,0CAEC;IAED,mCAWC;IAED,mCAcC;IAED,yDAEC;IAED,oCAGC;IAED,0DAIC;IAOD,oBAKC;IAED,qBAKC;IAED,sBAWC;IAED,yBAEC;IAED,sBAMC;IAED,gCAKC;IAED,kCAKC;IAED,iCAKC;IAED,gCAQC;IAED,uCAEC;IAQD,8BAWC;IAGD,oBAKC;CA6BJ;mCA/dkC,kCAAkC"}
|
|
@@ -129,13 +129,13 @@ export default class PrivateCellFactory extends PrimitiveDatatableCell {
|
|
|
129
129
|
this._columnType = value;
|
|
130
130
|
}
|
|
131
131
|
getActionableElements() {
|
|
132
|
-
|
|
132
|
+
let result = [];
|
|
133
133
|
const customType = this.refs.customCell;
|
|
134
134
|
if (customType) {
|
|
135
|
-
|
|
136
|
-
wrapperActionableElements.forEach((elem) => result.push(elem));
|
|
135
|
+
result = Array.from(customType.getActionableElements());
|
|
137
136
|
}
|
|
138
|
-
|
|
137
|
+
const defaultActions = Array.from(this.template.querySelectorAll('[data-navigation="enable"]'));
|
|
138
|
+
return result.concat(defaultActions);
|
|
139
139
|
}
|
|
140
140
|
isType(typeName) {
|
|
141
141
|
return typeName === this.columnType || typeName === this.columnSubType;
|
|
@@ -101,7 +101,7 @@ export default class LightningPrimitiveInputColor extends LightningShadowBaseCla
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
get iconName() {
|
|
104
|
-
return this.
|
|
104
|
+
return this._checked ? 'utility:check' : 'utility:add';
|
|
105
105
|
}
|
|
106
106
|
connectedCallback() {
|
|
107
107
|
super.connectedCallback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitiveInputSimple.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/primitiveInputSimple/primitiveInputSimple.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"primitiveInputSimple.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/primitiveInputSimple/primitiveInputSimple.js"],"names":[],"mappings":"AA2DA;IACI,WAAM;IACN,sBAAsB;IACtB,wBAAwB;IACxB,cAAc;IACd,WAAW;IACX,oBAAoB;IACpB,6BAA6B;IAE7B,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,eAAe;IAEf,SAAS;IACT,SAAS;IACT,eAAe;IACf,eAAe;IACf,aAAa;IACb,iBAAiB;IACjB,UAAU;IACV,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IAEd,eAAe;IACf,iBAAiB;IACjB,cAAc;IAEd,sBAAsB;IACtB,kBAAkB;IAClB,yBAAyB;IACzB,kBAAkB;IAClB,sBAAsB;IAWtB,qBAEC;IAXD,gBAOC;IAHO,WAAyB;IASjC,iCAEC;IAED,uCAGC;IAED,uCAGC;IAED,8BAGC;IAOD,qBAcC;IAnBD,gBAGC;IA0LD,0BAAyB;IAnKzB,6BAMC;IAXD,wBAGC;IAmKD,mBAA+B;IApJ/B,qCAKC;IAVD,gCAGC;IAGG,2BAAkC;IAWtC,qBAcC;IAnBD,gBAGC;IAgJD,WAAM;IAzHN,8BAGC;IARD,uBAGC;IA0HD,kBAAa;IA9Gb,yBAuBC;IA5BD,oBAGC;IAmHD,eAAY;IAxFZ,qCAOC;IAHO,qCAAsC;IAwB9C,0BAEC;IAPD,qBAIC;IAEG,gBAAuB;IAG3B,yBAwCC;IAeD,wBAAqB;IAbrB,4BAGC;IAID,wBAAuB;IAEvB,eAAU;IACV,qCAAgB;IAKhB,qBAAgB;IAChB,mCAAkC;IAGlC,8BAYC;IAED,6BAMC;IAED,gCA+BC;IAED,8BAoCC;IAED,iCAYC;IAED,+BAyBC;IAOD,qBAIC;IAID,4BASC;IAED,4BA0BC;IAED,iDAQC;IAMD,wBAOC;IAED,4BAEC;IAED,2BAGC;IAED,4BAEC;IAED,0BAEC;IAID,0BAEC;IAED,8BAEC;IAED,0BAEC;IAED,gCAEC;IAED,gCAEC;IAED,oCAEC;IAID,uGAIC;IAED,+BAMC;IAED,0BAeC;IAED,yCASC;IAED;;;;MAEC;IAED,6BAKC;IAED;;;;;;MAQC;IAID,oCAIC;IAUD,sCAoBC;IAED;;MAyBC;IAED,4CAWC;IAID,0CAiBC;IAED,gCAIC;IAED,8BASC;IAUG,yBAA8C;IAGlD,yBAqCC;IAPO,0BAA0D;IASlE,6BAQC;CAYJ;qCA5zBoC,kCAAkC;oCAwCnC,aAAa"}
|
|
@@ -10,6 +10,7 @@ import { privateContext } from 'lightning/utilsInternal';
|
|
|
10
10
|
import labelRequired from '@salesforce/label/LightningControl.required';
|
|
11
11
|
import labelClearInput from '@salesforce/label/LightningControl.clear';
|
|
12
12
|
import labelLoadingIndicator from '@salesforce/label/LightningControl.loading';
|
|
13
|
+
import formFactor from '@salesforce/client/formFactor';
|
|
13
14
|
const { setContext, assertContext } = privateContext;
|
|
14
15
|
import { normalizeTime, normalizeDate, normalizeUTCDateTime, normalizeDateTimeToUTC, } from './mobileInputUtils';
|
|
15
16
|
import { calculateFractionDigitsFromStep, formatNumber, fromIsoDecimal, hasValidNumberShortcut, hasValidNumberSymbol, increaseNumberByStep, isValidNumber, isValidNumberCharacter, stringifyNumber, toIsoDecimal, } from 'lightning/numberUtils';
|
|
@@ -91,7 +92,7 @@ export default class LightningPrimitiveInputSimple extends LightningShadowBaseCl
|
|
|
91
92
|
ariaAutoComplete;
|
|
92
93
|
@api
|
|
93
94
|
get role() {
|
|
94
|
-
if (this.isTypeNumber) {
|
|
95
|
+
if (this.isTypeNumber && formFactor === 'Large') {
|
|
95
96
|
this._role = 'spinbutton';
|
|
96
97
|
}
|
|
97
98
|
return this._role;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class OverlayAlert extends LightningPrimitiveOverlay {
|
|
2
|
+
header: string;
|
|
3
|
+
body: string;
|
|
4
|
+
okayText: string;
|
|
5
|
+
cancelText: string;
|
|
6
|
+
handleOkay(): void;
|
|
7
|
+
handleCancel(): void;
|
|
8
|
+
handleDismiss(): void;
|
|
9
|
+
hasFocus: boolean;
|
|
10
|
+
renderedCallback(): void;
|
|
11
|
+
}
|
|
12
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
13
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../../../../modules/lightning/primitiveOverlay/__examples__/alert/alert.js"],"names":[],"mappings":"AAGA;IACI,eAAuB;IAEvB,aAAmB;IAEnB,iBAAuB;IAEvB,mBAA2B;IAE3B,mBAEC;IAED,qBAEC;IAED,sBAEC;IAED,kBAAiB;IACjB,yBAMC;CACJ;sCA/BqC,4BAA4B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lightning-focus-trap>
|
|
3
|
+
<section role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true"
|
|
4
|
+
aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open slds-modal_small">
|
|
5
|
+
<div class="slds-modal__container">
|
|
6
|
+
<header class="slds-modal__header">
|
|
7
|
+
<button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse"
|
|
8
|
+
title="Close" onclick={handleDismiss}>
|
|
9
|
+
<svg class="slds-button__icon slds-button__icon_large" aria-hidden="true">
|
|
10
|
+
<use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#close"></use>
|
|
11
|
+
</svg>
|
|
12
|
+
<span class="slds-assistive-text">Close</span>
|
|
13
|
+
</button>
|
|
14
|
+
<h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate">{header}</h2>
|
|
15
|
+
</header>
|
|
16
|
+
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
|
|
17
|
+
<p>{body}</p>
|
|
18
|
+
</div>
|
|
19
|
+
<footer class="slds-modal__footer">
|
|
20
|
+
<button class="slds-button slds-button_neutral" onclick={handleCancel}>{cancelText}</button>
|
|
21
|
+
<button class="slds-button slds-button_brand" onclick={handleOkay}>{okayText}</button>
|
|
22
|
+
</footer>
|
|
23
|
+
</div>
|
|
24
|
+
</section>
|
|
25
|
+
</lightning-focus-trap>
|
|
26
|
+
<div class="slds-backdrop slds-backdrop_open"></div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { api } from 'lwc';
|
|
7
|
+
import LightningPrimitiveOverlay from 'lightning/primitiveOverlay';
|
|
8
|
+
export default class OverlayAlert extends LightningPrimitiveOverlay {
|
|
9
|
+
@api
|
|
10
|
+
header = 'Header';
|
|
11
|
+
@api
|
|
12
|
+
body = 'Body';
|
|
13
|
+
@api
|
|
14
|
+
okayText = 'Okay';
|
|
15
|
+
@api
|
|
16
|
+
cancelText = 'Cancel';
|
|
17
|
+
handleOkay() {
|
|
18
|
+
this.close('okay');
|
|
19
|
+
}
|
|
20
|
+
handleCancel() {
|
|
21
|
+
this.close('cancel');
|
|
22
|
+
}
|
|
23
|
+
handleDismiss() {
|
|
24
|
+
this.close('dismiss');
|
|
25
|
+
}
|
|
26
|
+
hasFocus = false;
|
|
27
|
+
renderedCallback() {
|
|
28
|
+
if (!this.hasFocus) {
|
|
29
|
+
const close = this.template.querySelector('header > button');
|
|
30
|
+
close.focus();
|
|
31
|
+
this.hasFocus = true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class OverlayBasic extends LightningElement {
|
|
2
|
+
confirmResult: string;
|
|
3
|
+
handleConfirmModal(): void;
|
|
4
|
+
confirmAltResult: string;
|
|
5
|
+
handleConfirmAltModal(): void;
|
|
6
|
+
demoResult: string;
|
|
7
|
+
handleDemoModal(): void;
|
|
8
|
+
panelResult: string;
|
|
9
|
+
handlePanel(): void;
|
|
10
|
+
}
|
|
11
|
+
import { LightningElement } from 'lwc';
|
|
12
|
+
//# sourceMappingURL=basic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic.d.ts","sourceRoot":"","sources":["../../../../../../../modules/lightning/primitiveOverlay/__examples__/basic/basic.js"],"names":[],"mappings":"AAMA;IACI,sBAAwB;IAExB,2BAOC;IAED,yBAA2B;IAE3B,8BASC;IAED,mBAAqB;IAErB,wBAeC;IAED,oBAAsB;IAEtB,oBAOC;CACJ;iCA5DgC,KAAK"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="example">
|
|
3
|
+
<button onclick={handleConfirmModal}>Open a Confirm Modal</button>
|
|
4
|
+
<p>Result: <code>{confirmResult}</code></p>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="example">
|
|
7
|
+
<button onclick={handleConfirmAltModal}>Open a Confirm Modal Alt</button>
|
|
8
|
+
<p>Result: <code>{confirmAltResult}</code></p>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="example">
|
|
11
|
+
<button onclick={handleDemoModal}>Open a Demo Modal</button>
|
|
12
|
+
<p>Result: <code>{demoResult}</code></p>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="example">
|
|
15
|
+
<button onclick={handlePanel}>Open a Panel</button>
|
|
16
|
+
<p>Result: <code>{panelResult}</code></p>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|