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.
Files changed (67) hide show
  1. package/metadata/raptor.json +3 -10
  2. package/package.json +5 -1
  3. package/scopedImports/@salesforce-label-LightningRichTextAssist.composeText.js +1 -1
  4. package/src/lightning/datatable/keyboard.d.ts.map +1 -1
  5. package/src/lightning/datatable/keyboard.js +4 -4
  6. package/src/lightning/features/gates/imports.d.ts +1 -0
  7. package/src/lightning/features/gates/imports.d.ts.map +1 -1
  8. package/src/lightning/features/gates/imports.js +1 -0
  9. package/src/lightning/features/types.d.ts +1 -0
  10. package/src/lightning/features/types.d.ts.map +1 -1
  11. package/src/lightning/groupedCombobox/groupedCombobox.d.ts +4 -0
  12. package/src/lightning/groupedCombobox/groupedCombobox.d.ts.map +1 -1
  13. package/src/lightning/groupedCombobox/groupedCombobox.html +1 -0
  14. package/src/lightning/groupedCombobox/groupedCombobox.js +13 -1
  15. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts +1 -1
  16. package/src/lightning/multiColumnSortingModal/multiColumnSortingModal.d.ts.map +1 -1
  17. package/src/lightning/overlayBase/overlayBase.css +21 -0
  18. package/src/lightning/overlayBase/overlayBase.d.ts +28 -0
  19. package/src/lightning/overlayBase/overlayBase.d.ts.map +1 -0
  20. package/src/lightning/overlayBase/overlayBase.html +24 -0
  21. package/src/lightning/overlayBase/overlayBase.js +125 -0
  22. package/src/lightning/overlayBase/overlayBase.js-meta.xml +8 -0
  23. package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts +24 -0
  24. package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.d.ts.map +1 -0
  25. package/src/lightning/overlayPositionUtils/anchorPositioningAdapter.js +49 -0
  26. package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts +14 -0
  27. package/src/lightning/overlayPositionUtils/cssAnchorPositioning.d.ts.map +1 -0
  28. package/src/lightning/overlayPositionUtils/cssAnchorPositioning.js +94 -0
  29. package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts +55 -0
  30. package/src/lightning/overlayPositionUtils/overlayPositionUtils.d.ts.map +1 -0
  31. package/src/lightning/overlayPositionUtils/overlayPositionUtils.js +107 -0
  32. package/src/lightning/overlayPositionUtils/overlayPositionUtils.js-meta.xml +6 -0
  33. package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts +30 -0
  34. package/src/lightning/overlayPositionUtils/positionLibraryFallback.d.ts.map +1 -0
  35. package/src/lightning/overlayPositionUtils/positionLibraryFallback.js +435 -0
  36. package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts +1 -1
  37. package/src/lightning/primitiveCellFactory/primitiveCellFactory.d.ts.map +1 -1
  38. package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -4
  39. package/src/lightning/primitiveHeaderFactory/selectableHeader.html +1 -0
  40. package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +1 -1
  41. package/src/lightning/primitiveInputSimple/primitiveInputSimple.d.ts.map +1 -1
  42. package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +2 -1
  43. package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts +13 -0
  44. package/src/lightning/primitiveOverlay/__examples__/alert/alert.d.ts.map +1 -0
  45. package/src/lightning/primitiveOverlay/__examples__/alert/alert.html +27 -0
  46. package/src/lightning/primitiveOverlay/__examples__/alert/alert.js +34 -0
  47. package/src/lightning/primitiveOverlay/__examples__/basic/basic.css +7 -0
  48. package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts +12 -0
  49. package/src/lightning/primitiveOverlay/__examples__/basic/basic.d.ts.map +1 -0
  50. package/src/lightning/primitiveOverlay/__examples__/basic/basic.html +18 -0
  51. package/src/lightning/primitiveOverlay/__examples__/basic/basic.js +58 -0
  52. package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts +11 -0
  53. package/src/lightning/primitiveOverlay/__examples__/demo/demo.d.ts.map +1 -0
  54. package/src/lightning/primitiveOverlay/__examples__/demo/demo.html +29 -0
  55. package/src/lightning/primitiveOverlay/__examples__/demo/demo.js +41 -0
  56. package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts +9 -0
  57. package/src/lightning/primitiveOverlay/__examples__/panel/panel.d.ts.map +1 -0
  58. package/src/lightning/primitiveOverlay/__examples__/panel/panel.html +17 -0
  59. package/src/lightning/primitiveOverlay/__examples__/panel/panel.js +24 -0
  60. package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts +8 -0
  61. package/src/lightning/primitiveOverlay/primitiveOverlay.d.ts.map +1 -0
  62. package/src/lightning/primitiveOverlay/primitiveOverlay.html +4 -0
  63. package/src/lightning/primitiveOverlay/primitiveOverlay.js +37 -0
  64. package/src/lightning/primitiveOverlay/primitiveOverlay.js-meta.xml +7 -0
  65. package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts +2 -0
  66. package/src/lightning/tooltipLibrary/tooltipLibrary.d.ts.map +1 -1
  67. package/src/lightning/tooltipLibrary/tooltipLibrary.js +45 -3
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { convertLogicalToDirectionalInsets, normalizeSizingValue, } from './overlayPositionUtils';
7
+ export function supportsCSSAnchorPositioning() {
8
+ if (import.meta.env.SSR) {
9
+ return false;
10
+ }
11
+ const supportsAnchorName = 'anchorName' in document.documentElement.style;
12
+ const supportsPositionAnchor = typeof CSS !== 'undefined' &&
13
+ CSS.supports &&
14
+ CSS.supports('position-anchor', '--test');
15
+ return supportsAnchorName && supportsPositionAnchor;
16
+ }
17
+ export class CSSAnchorPositioning {
18
+ element;
19
+ config;
20
+ constructor(element, config = {}) {
21
+ this.element = element;
22
+ this.config = config;
23
+ }
24
+ apply() {
25
+ this.applyPanelStyles();
26
+ this.setPositionArea();
27
+ }
28
+ setPositionArea() {
29
+ this.element?.style?.setProperty('position-area', this.config.position);
30
+ }
31
+ applyPanelStyles() {
32
+ const { minWidth, maxWidth, minHeight, maxHeight, position, offsetInline, offsetBlock, } = this.config;
33
+ const elem = this.element;
34
+ const normalizedMinWidth = normalizeSizingValue(minWidth);
35
+ const normalizedMaxWidth = normalizeSizingValue(maxWidth);
36
+ const normalizedMinHeight = normalizeSizingValue(minHeight);
37
+ const normalizedMaxHeight = normalizeSizingValue(maxHeight);
38
+ if (normalizedMinWidth) {
39
+ elem.style.minWidth = normalizedMinWidth;
40
+ }
41
+ if (normalizedMaxWidth) {
42
+ elem.style.maxWidth = normalizedMaxWidth;
43
+ }
44
+ if (normalizedMinHeight) {
45
+ elem.style.minHeight = normalizedMinHeight;
46
+ }
47
+ if (normalizedMaxHeight) {
48
+ elem.style.maxHeight = normalizedMaxHeight;
49
+ }
50
+ this.applyLogicalInsets(position, offsetInline, offsetBlock);
51
+ }
52
+ applyLogicalInsets(position, offsetInline, offsetBlock) {
53
+ const elem = this.element;
54
+ const { top, bottom, left, right } = convertLogicalToDirectionalInsets(position, offsetInline, offsetBlock);
55
+ if (left) {
56
+ elem.style.setProperty('left', `${left}px`);
57
+ }
58
+ if (right) {
59
+ elem.style.setProperty('right', `${right}px`);
60
+ }
61
+ if (top) {
62
+ elem.style.setProperty('top', `${top}px`);
63
+ }
64
+ if (bottom) {
65
+ elem.style.setProperty('bottom', `${bottom}px`);
66
+ }
67
+ }
68
+ cleanup() {
69
+ if (this.element) {
70
+ const propertiesToRemove = [
71
+ 'position-anchor',
72
+ 'position-area',
73
+ 'left',
74
+ 'right',
75
+ 'top',
76
+ 'bottom',
77
+ 'min-width',
78
+ 'max-width',
79
+ 'min-height',
80
+ 'max-height',
81
+ 'margin-inline-start',
82
+ 'margin-inline-end',
83
+ 'margin-block-start',
84
+ 'margin-block-end',
85
+ ];
86
+ propertiesToRemove.forEach((prop) => {
87
+ this.element?.style?.removeProperty(prop);
88
+ });
89
+ if (this.element?.style?.position === 'absolute') {
90
+ this.element?.style?.removeProperty('position');
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,55 @@
1
+ export { AnchorPositioningAdapter } from './anchorPositioningAdapter';
2
+ export type { AnchorPositioningConfig } from './anchorPositioningAdapter';
3
+ export declare const OverlayPosition: {
4
+ readonly TopLeft: "top left";
5
+ readonly TopCenter: "top center";
6
+ readonly TopRight: "top right";
7
+ readonly TopSpanLeft: "top span-left";
8
+ readonly TopSpanAll: "top span-all";
9
+ readonly TopSpanRight: "top span-right";
10
+ readonly CenterLeft: "center left";
11
+ readonly CenterCenter: "center center";
12
+ readonly CenterRight: "center right";
13
+ readonly CenterSpanLeft: "center span-left";
14
+ readonly CenterSpanRight: "center span-right";
15
+ readonly CenterSpanAll: "center span-all";
16
+ readonly BottomLeft: "bottom left";
17
+ readonly BottomCenter: "bottom center";
18
+ readonly BottomRight: "bottom right";
19
+ readonly BottomSpanLeft: "bottom span-left";
20
+ readonly BottomSpanAll: "bottom span-all";
21
+ readonly BottomSpanRight: "bottom span-right";
22
+ readonly SpanTopLeft: "span-top left";
23
+ readonly SpanTopCenter: "span-top center";
24
+ readonly SpanTopRight: "span-top right";
25
+ readonly SpanTopSpanLeft: "span-top span-left";
26
+ readonly SpanTopSpanAll: "span-top span-all";
27
+ readonly SpanTopSpanRight: "span-top span-right";
28
+ readonly SpanAllLeft: "span-all left";
29
+ readonly SpanAllCenter: "span-all center";
30
+ readonly SpanAllRight: "span-all right";
31
+ readonly SpanAllSpanLeft: "span-all span-left";
32
+ readonly SpanAllSpanAll: "span-all span-all";
33
+ readonly SpanAllSpanRight: "span-all span-right";
34
+ readonly SpanBottomLeft: "span-bottom left";
35
+ readonly SpanBottomCenter: "span-bottom center";
36
+ readonly SpanBottomRight: "span-bottom right";
37
+ readonly SpanBottomSpanLeft: "span-bottom span-left";
38
+ readonly SpanBottomSpanAll: "span-bottom span-all";
39
+ readonly SpanBottomSpanRight: "span-bottom span-right";
40
+ };
41
+ export type PositionValue = (typeof OverlayPosition)[keyof typeof OverlayPosition];
42
+ export declare const VALID_POSITION_VALUES: readonly PositionValue[];
43
+ export declare const DEFAULT_POSITION: "top right";
44
+ export declare const VALID_POPOVER_VALUES: readonly ["auto", "manual", "hint"];
45
+ export type PopoverValue = (typeof VALID_POPOVER_VALUES)[number];
46
+ export declare const DEFAULT_POPOVER = "auto";
47
+ export declare function normalizeSizingValue(value: string | number): string;
48
+ interface DirectionalInsets {
49
+ top: number;
50
+ bottom: number;
51
+ left: number;
52
+ right: number;
53
+ }
54
+ export declare function convertLogicalToDirectionalInsets(position: string, offsetInline: number, offsetBlock: number): DirectionalInsets;
55
+ //# sourceMappingURL=overlayPositionUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlayPositionUtils.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/overlayPositionUtils/overlayPositionUtils.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAM1E,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqClB,CAAC;AAKX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAKnF,eAAO,MAAM,qBAAqB,EAAE,SAAS,aAAa,EAAmC,CAAC;AAK9F,eAAO,MAAM,gBAAgB,aAA2B,CAAC;AAKzD,eAAO,MAAM,oBAAoB,qCAAsC,CAAC;AAKxE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAKjE,eAAO,MAAM,eAAe,SAAS,CAAC;AAatC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAC,MAAM,GAAG,MAAM,CAgDjE;AAED,UAAU,iBAAiB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAWD,wBAAgB,iCAAiC,CAC7C,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,iBAAiB,CA2BnB"}
@@ -0,0 +1,107 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export { AnchorPositioningAdapter } from './anchorPositioningAdapter';
7
+ export const OverlayPosition = {
8
+ TopLeft: 'top left',
9
+ TopCenter: 'top center',
10
+ TopRight: 'top right',
11
+ TopSpanLeft: 'top span-left',
12
+ TopSpanAll: 'top span-all',
13
+ TopSpanRight: 'top span-right',
14
+ CenterLeft: 'center left',
15
+ CenterCenter: 'center center',
16
+ CenterRight: 'center right',
17
+ CenterSpanLeft: 'center span-left',
18
+ CenterSpanRight: 'center span-right',
19
+ CenterSpanAll: 'center span-all',
20
+ BottomLeft: 'bottom left',
21
+ BottomCenter: 'bottom center',
22
+ BottomRight: 'bottom right',
23
+ BottomSpanLeft: 'bottom span-left',
24
+ BottomSpanAll: 'bottom span-all',
25
+ BottomSpanRight: 'bottom span-right',
26
+ SpanTopLeft: 'span-top left',
27
+ SpanTopCenter: 'span-top center',
28
+ SpanTopRight: 'span-top right',
29
+ SpanTopSpanLeft: 'span-top span-left',
30
+ SpanTopSpanAll: 'span-top span-all',
31
+ SpanTopSpanRight: 'span-top span-right',
32
+ SpanAllLeft: 'span-all left',
33
+ SpanAllCenter: 'span-all center',
34
+ SpanAllRight: 'span-all right',
35
+ SpanAllSpanLeft: 'span-all span-left',
36
+ SpanAllSpanAll: 'span-all span-all',
37
+ SpanAllSpanRight: 'span-all span-right',
38
+ SpanBottomLeft: 'span-bottom left',
39
+ SpanBottomCenter: 'span-bottom center',
40
+ SpanBottomRight: 'span-bottom right',
41
+ SpanBottomSpanLeft: 'span-bottom span-left',
42
+ SpanBottomSpanAll: 'span-bottom span-all',
43
+ SpanBottomSpanRight: 'span-bottom span-right',
44
+ };
45
+ export const VALID_POSITION_VALUES = Object.values(OverlayPosition);
46
+ export const DEFAULT_POSITION = OverlayPosition.TopRight;
47
+ export const VALID_POPOVER_VALUES = ['auto', 'manual', 'hint'];
48
+ export const DEFAULT_POPOVER = 'auto';
49
+ export function normalizeSizingValue(value) {
50
+ if (value === null || value === undefined || value === '') {
51
+ return 'auto';
52
+ }
53
+ const strValue = String(value).trim();
54
+ const cssUnitPattern = /^-?\d*\.?\d+(px|rem|em|%|vh|vw|vmin|vmax|ch|ex|cm|mm|in|pt|pc)$/i;
55
+ if (cssUnitPattern.test(strValue)) {
56
+ return strValue;
57
+ }
58
+ const plainNumberPattern = /^-?\d*\.?\d+$/;
59
+ if (plainNumberPattern.test(strValue)) {
60
+ return `${strValue}rem`;
61
+ }
62
+ const validKeywords = [
63
+ 'auto',
64
+ 'max-content',
65
+ 'min-content',
66
+ 'fit-content',
67
+ 'inherit',
68
+ 'initial',
69
+ 'unset',
70
+ 'revert',
71
+ ];
72
+ if (validKeywords.includes(strValue.toLowerCase())) {
73
+ return strValue.toLowerCase();
74
+ }
75
+ if (strValue.includes('calc(') ||
76
+ strValue.includes('var(') ||
77
+ strValue.includes('min(') ||
78
+ strValue.includes('max(') ||
79
+ strValue.includes('clamp(')) {
80
+ return strValue;
81
+ }
82
+ return 'auto';
83
+ }
84
+ export function convertLogicalToDirectionalInsets(position, offsetInline, offsetBlock) {
85
+ let top = 0;
86
+ let bottom = 0;
87
+ let left = 0;
88
+ let right = 0;
89
+ const [vertical, horizontal] = position.toLowerCase().split(/\s+/);
90
+ if (horizontal) {
91
+ if (horizontal.includes('right')) {
92
+ left = offsetInline;
93
+ }
94
+ else if (horizontal.includes('left')) {
95
+ right = offsetInline;
96
+ }
97
+ }
98
+ if (vertical) {
99
+ if (vertical.includes('top')) {
100
+ bottom = offsetBlock;
101
+ }
102
+ else if (vertical.includes('bottom')) {
103
+ top = offsetBlock;
104
+ }
105
+ }
106
+ return { top, bottom, left, right };
107
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
3
+ <capabilities>
4
+ <capability>lightning__ServerRenderable</capability>
5
+ </capabilities>
6
+ </LightningComponentBundle>
@@ -0,0 +1,30 @@
1
+ import { AutoPosition } from 'lightning/positionLibrary';
2
+ import type { AnchorPositioningConfig } from './anchorPositioningAdapter';
3
+ import type { PositionValue } from 'lightning/overlayPositionUtils';
4
+ type horizontalDirection = "left" | "right" | "center";
5
+ type verticalDirection = "top" | "bottom" | "center";
6
+ interface Alignment {
7
+ align: {
8
+ horizontal: horizontalDirection;
9
+ vertical: verticalDirection;
10
+ };
11
+ targetAlign: {
12
+ horizontal: horizontalDirection;
13
+ vertical: verticalDirection;
14
+ };
15
+ }
16
+ export declare class PositionLibraryFallback {
17
+ element: HTMLElement;
18
+ config: AnchorPositioningConfig;
19
+ autoPosition: AutoPosition | null;
20
+ positionUpdater: Promise<any> | null;
21
+ constructor(element: HTMLElement, config?: AnchorPositioningConfig);
22
+ getPhysicalDirection(direction: horizontalDirection): horizontalDirection;
23
+ shouldAlignWidth(position: PositionValue): boolean;
24
+ apply(): void;
25
+ applySizingStyles(): void;
26
+ convertPositionToAlignment(position: PositionValue): Alignment;
27
+ cleanup(): void;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=positionLibraryFallback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positionLibraryFallback.d.ts","sourceRoot":"","sources":["../../../../../modules/lightning/overlayPositionUtils/positionLibraryFallback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAa,MAAM,2BAA2B,CAAC;AAEpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,KAAK,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACvD,KAAK,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErD,UAAU,SAAS;IACf,KAAK,EAAE;QACH,UAAU,EAAE,mBAAmB,CAAC;QAChC,QAAQ,EAAE,iBAAiB,CAAC;KAC/B,CAAC;IACF,WAAW,EAAE;QACT,UAAU,EAAE,mBAAmB,CAAC;QAChC,QAAQ,EAAE,iBAAiB,CAAC;KAC/B,CAAC;CACL;AAED,qBAAa,uBAAuB;IAChC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,uBAAuB,CAAC;IAChC,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,GAAE,uBAA4B;IAmBtE,oBAAoB,CAChB,SAAS,EAAE,mBAAmB,GAC/B,mBAAmB;IAiBtB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO;IAQlD,KAAK,IAAI,IAAI;IA2Eb,iBAAiB,IAAI,IAAI;IAyBzB,0BAA0B,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS;IAwV9D,OAAO,IAAI,IAAI;CAelB"}