lightning-base-components 1.16.3-alpha → 1.16.5-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/README.md +7 -0
- package/metadata/raptor.json +110 -0
- package/package.json +59 -2
- package/scopedImports/@salesforce-label-LightningForm.cancel.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.closeError.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.edit.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.editErrorHelp.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.error.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.errorPopoverHeading.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.preview.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.previewHeader.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.reload.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.save.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.saveFieldErrorSummary.js +1 -0
- package/scopedImports/@salesforce-label-LightningForm.undo.js +1 -0
- package/scopedImports/@salesforce-label-LightningLookup.messageWhenMissingInformation.js +1 -0
- package/src/lightning/button/__docs__/button.md +13 -0
- package/src/lightning/button/button.slds.css +155 -11
- package/src/lightning/buttonGroup/button-group.slds.css +35 -59
- package/src/lightning/buttonIcon/button-icon.slds.css +287 -122
- package/src/lightning/buttonIconStateful/button-icon-stateful.slds.css +224 -39
- package/src/lightning/buttonStateful/button-stateful.slds.css +3269 -0
- package/src/lightning/card/card.slds.css +50 -0
- package/src/lightning/colorPickerCustom/color-picker-custom.slds.css +180 -364
- package/src/lightning/colorPickerPanel/color-picker-panel.slds.css +46 -413
- package/src/lightning/datatable/datatable.js +2 -2
- package/src/lightning/datatable/rowSelection.js +21 -4
- package/src/lightning/datetimepicker/datetimepicker.html +1 -3
- package/src/lightning/datetimepicker/datetimepicker.js +5 -0
- package/src/lightning/fileDownload/__docs__/fileDownload.md +41 -0
- package/src/lightning/helptext/help-text.slds.css +184 -39
- package/src/lightning/icon/icon.slds.css +823 -3
- package/src/lightning/input/input-checkbox.slds.css +291 -32
- package/src/lightning/input/input-text.slds.css +70 -7
- package/src/lightning/inputAddress/__docs__/inputAddress.md +1 -1
- package/src/lightning/inputAddress/inputAddress.js +2 -1
- package/src/lightning/internationalizationLibrary/datetime/intlFormat.js +20 -2
- package/src/lightning/iso8601Utils/iso8601Utils.js +2 -3
- package/src/lightning/mediaUtils/__docs__/mediaUtils.md +87 -0
- package/src/lightning/mediaUtils/mediaUtils.js +321 -0
- package/src/lightning/mediaUtils/mediaUtils.js-meta.xml +6 -0
- package/src/lightning/modal/__docs__/migration.md +158 -0
- package/src/lightning/modal/__docs__/modal.md +414 -0
- package/src/lightning/modal/__examples__disabled/all/all.css +7 -0
- package/src/lightning/modal/__examples__disabled/all/all.html +9 -0
- package/src/lightning/modal/__examples__disabled/all/all.js +25 -0
- package/src/lightning/modal/__examples__disabled/allform/allform.css +7 -0
- package/src/lightning/modal/__examples__disabled/allform/allform.html +9 -0
- package/src/lightning/modal/__examples__disabled/allform/allform.js +49 -0
- package/src/lightning/modal/__examples__disabled/allmulti/allmulti.html +24 -0
- package/src/lightning/modal/__examples__disabled/allmulti/allmulti.js +12 -0
- package/src/lightning/modal/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/modal/__examples__disabled/basic/basic.html +9 -0
- package/src/lightning/modal/__examples__disabled/basic/basic.js +27 -0
- package/src/lightning/modal/__examples__disabled/demo/demo.html +15 -0
- package/src/lightning/modal/__examples__disabled/demo/demo.js +13 -0
- package/src/lightning/modal/__examples__disabled/demoall/demoall.html +26 -0
- package/src/lightning/modal/__examples__disabled/demoall/demoall.js +13 -0
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.css +3 -0
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.html +146 -0
- package/src/lightning/modal/__examples__disabled/demoallform/demoallform.js +240 -0
- package/src/lightning/modal/__examples__disabled/demofootless/demofootless.html +17 -0
- package/src/lightning/modal/__examples__disabled/demofootless/demofootless.js +11 -0
- package/src/lightning/modal/__examples__disabled/demoheadless/demoheadless.html +20 -0
- package/src/lightning/modal/__examples__disabled/demoheadless/demoheadless.js +12 -0
- package/src/lightning/modal/__examples__disabled/footless/footless.css +7 -0
- package/src/lightning/modal/__examples__disabled/footless/footless.html +9 -0
- package/src/lightning/modal/__examples__disabled/footless/footless.js +19 -0
- package/src/lightning/modal/__examples__disabled/headless/headless.css +7 -0
- package/src/lightning/modal/__examples__disabled/headless/headless.html +9 -0
- package/src/lightning/modal/__examples__disabled/headless/headless.js +27 -0
- package/src/lightning/modal/modal.html +3 -0
- package/src/lightning/modal/modal.js +93 -0
- package/src/lightning/modal/modal.js-meta.xml +6 -0
- package/src/lightning/modalBody/__docs__/modalBody.md +61 -0
- package/src/lightning/modalBody/modalBody.html +13 -0
- package/src/lightning/modalBody/modalBody.js +203 -0
- package/src/lightning/modalBody/modalBody.js-meta.xml +6 -0
- package/src/lightning/modalFooter/__docs__/modalFooter.md +72 -0
- package/src/lightning/modalFooter/modalFooter.html +8 -0
- package/src/lightning/modalFooter/modalFooter.js +161 -0
- package/src/lightning/modalFooter/modalFooter.js-meta.xml +6 -0
- package/src/lightning/modalHeader/__docs__/modalHeader.md +64 -0
- package/src/lightning/modalHeader/modalHeader.html +16 -0
- package/src/lightning/modalHeader/modalHeader.js +204 -0
- package/src/lightning/modalHeader/modalHeader.js-meta.xml +6 -0
- package/src/lightning/primitiveBubble/tooltip.slds.css +45 -1
- package/src/lightning/primitiveCellFactory/primitiveCellFactory.js +4 -12
- package/src/lightning/primitiveColorpickerButton/color-picker-button.slds.css +2994 -319
- package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.html +14 -11
- package/src/lightning/primitiveDatatableIeditPanel/primitiveDatatableIeditPanel.js +1 -0
- package/src/lightning/primitiveIcon/icon.slds.css +823 -3
- package/src/lightning/progressStep/base.html +1 -0
- package/src/lightning/progressStep/path.html +1 -1
- package/src/lightning/radioGroup/input-radio-group.slds.css +168 -379
- package/src/lightning/spinner/spinner.slds.css +8 -2
- package/src/lightning/timepicker/timepicker.html +1 -4
- package/src/lightning/timepicker/timepicker.js +9 -5
- package/src/lightning/treeGrid/treeGrid.js +66 -1
- package/src/lightning/utilsPrivate/linkUtils.js +1 -1
- package/src/lightning/formattedAddress/__component__/formattedAddress.spec.js +0 -61
- package/src/lightning/formattedAddress/__component__/formattedAddressDisabled.spec.js +0 -20
- package/src/lightning/formattedAddress/__component__/x/basic/basic.html +0 -10
- package/src/lightning/formattedAddress/__component__/x/basic/basic.js +0 -17
- package/src/lightning/input/__component__/inputCheckbox.spec.js +0 -60
- package/src/lightning/input/__component__/inputDateTimePicker.spec.js +0 -60
- package/src/lightning/input/__component__/inputNumber.spec.js +0 -75
- package/src/lightning/input/__component__/inputSelection.spec.js +0 -83
- package/src/lightning/input/__component__/x/tall/tall.css +0 -5
- package/src/lightning/input/__component__/x/tall/tall.html +0 -5
- package/src/lightning/input/__component__/x/tall/tall.js +0 -7
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { api, LightningElement } from 'lwc';
|
|
2
|
+
import { getRealDOMId } from 'lightning/utilsPrivate';
|
|
3
|
+
import { findAllTabbableElements, filterTooltips } from 'lightning/focusUtils';
|
|
4
|
+
|
|
5
|
+
// selectors
|
|
6
|
+
const modalHeaderSelector = '.slds-modal__header';
|
|
7
|
+
const labelSelector = '[data-label]';
|
|
8
|
+
const slotWrapperSelector = '[data-slot-wrapper]';
|
|
9
|
+
const defaultSlotSelector = '[data-default-slot]';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a header to display the heading and tagline at the top of a modal.
|
|
13
|
+
* */
|
|
14
|
+
export default class LightningModalHeader extends LightningElement {
|
|
15
|
+
// tracked private state
|
|
16
|
+
initialRender = true;
|
|
17
|
+
initialSlotRender = true;
|
|
18
|
+
unregisterCallback = null;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Text to display as the heading at the top of the modal
|
|
22
|
+
*/
|
|
23
|
+
@api label = '';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Handle the default slot change event
|
|
27
|
+
* Always register with parent every slot change
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
handleDefaultSlotChange() {
|
|
31
|
+
// Set this once so that parent can know slot has rendered
|
|
32
|
+
if (this.initialSlotRender) {
|
|
33
|
+
this.initialSlotRender = false;
|
|
34
|
+
}
|
|
35
|
+
this.registerWithParent();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get the height of outer wrapper of modal header
|
|
40
|
+
* @returns {number} represents a height value in pixels
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
get headerHeight() {
|
|
44
|
+
const divElem = this.template.querySelector(modalHeaderSelector);
|
|
45
|
+
const headerRect = divElem ? divElem.getBoundingClientRect() : {};
|
|
46
|
+
const { height } = headerRect;
|
|
47
|
+
return height || 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get an element reference to the modal's title element, currently H1
|
|
52
|
+
* This get passed to the parent as a fallback element for autofocus
|
|
53
|
+
* @returns {(HTMLElement|null)}
|
|
54
|
+
* @private
|
|
55
|
+
*/
|
|
56
|
+
get modalTitleElement() {
|
|
57
|
+
return this.template.querySelector(labelSelector);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Get the ID value of the modalTitleElement, currently H1
|
|
62
|
+
* This value is passed to parent in order to use for aria-labelledby
|
|
63
|
+
* @returns {(string|null)}
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
get modalLabelId() {
|
|
67
|
+
const labelElem = this.modalTitleElement;
|
|
68
|
+
return getRealDOMId(labelElem);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get first tabbable element within modalHeader's slot, if exists
|
|
73
|
+
* This is passed to parent in order to possibly be used for autoFocus
|
|
74
|
+
* @returns {(HTMLElement|null)}
|
|
75
|
+
* @private
|
|
76
|
+
*/
|
|
77
|
+
get firstTabbableElement() {
|
|
78
|
+
let firstElem = null;
|
|
79
|
+
if (this.isDefaultSlotPopulated) {
|
|
80
|
+
const tabbableElements = findAllTabbableElements(
|
|
81
|
+
this.defaultSlotElement
|
|
82
|
+
);
|
|
83
|
+
const filteredElements = filterTooltips(tabbableElements);
|
|
84
|
+
if (filteredElements.length > 0) {
|
|
85
|
+
firstElem = filteredElements[0];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return firstElem;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get an element reference to the modal body's default slot's wrapper element
|
|
93
|
+
* Currently this is a P tag, representing the tagline within the header
|
|
94
|
+
* @returns {(HTMLElement|null)}
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
get defaultSlotWrapperElement() {
|
|
98
|
+
return this.template.querySelector(slotWrapperSelector);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Get the ID value for the slot wrapper (p tag)
|
|
103
|
+
* Future TODO: potentially wire up to aria-describedby
|
|
104
|
+
* - when there is a better identified reproducible pattern
|
|
105
|
+
* @returns {(string|null)}
|
|
106
|
+
* @private
|
|
107
|
+
*/
|
|
108
|
+
get defaultSlotWrapperId() {
|
|
109
|
+
return getRealDOMId(this.defaultSlotWrapperElement);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Get an element reference to the modal body's slot element
|
|
114
|
+
* @returns {(HTMLElement|null)}
|
|
115
|
+
* @private
|
|
116
|
+
*/
|
|
117
|
+
get defaultSlotElement() {
|
|
118
|
+
return this.template.querySelector(defaultSlotSelector);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Determine whether the default slot is populated
|
|
123
|
+
* @returns {boolean}
|
|
124
|
+
* @private
|
|
125
|
+
*/
|
|
126
|
+
get isDefaultSlotPopulated() {
|
|
127
|
+
const slotElement = this.defaultSlotElement;
|
|
128
|
+
if (slotElement && slotElement.assignedNodes) {
|
|
129
|
+
const slotPopulated = slotElement.assignedNodes().length > 0;
|
|
130
|
+
this.defaultSlotPopulated = slotPopulated;
|
|
131
|
+
return slotPopulated;
|
|
132
|
+
}
|
|
133
|
+
this.defaultSlotPopulated = false;
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Determine whether the developer provided label value is valid or not
|
|
139
|
+
* Label value is required value, so console.error when not valid
|
|
140
|
+
* @returns {boolean}
|
|
141
|
+
* @private
|
|
142
|
+
*/
|
|
143
|
+
get isLabelPopulated() {
|
|
144
|
+
return (this.label && this.label.trim().length > 0) || false;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Register modalHeader with modal parent, including callbacks to
|
|
149
|
+
* unregister the modal header
|
|
150
|
+
* this will get called multiple times over component lifecycle
|
|
151
|
+
* @type {CustomEvent}
|
|
152
|
+
* @private
|
|
153
|
+
*/
|
|
154
|
+
registerWithParent() {
|
|
155
|
+
const evtRegister = new CustomEvent('privatemodalheaderregister', {
|
|
156
|
+
bubbles: true,
|
|
157
|
+
composed: true,
|
|
158
|
+
detail: {
|
|
159
|
+
labelId: this.modalLabelId,
|
|
160
|
+
labelIsPopulated: this.isLabelPopulated,
|
|
161
|
+
headerHeight: this.headerHeight,
|
|
162
|
+
defaultSlotWrapperId: this.defaultSlotWrapperId,
|
|
163
|
+
defaultSlotIsPopulated: this.isDefaultSlotPopulated,
|
|
164
|
+
defaultSlotHasRendered: !this.initialSlotRender,
|
|
165
|
+
unRegisterCallback: (unregisterCallback) => {
|
|
166
|
+
this.unregisterCallback = unregisterCallback;
|
|
167
|
+
},
|
|
168
|
+
headerRef: this.modalTitleElement,
|
|
169
|
+
firstTabbableElemRef: this.firstTabbableElement,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
this.dispatchEvent(evtRegister);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* When modal header is being created, initialize
|
|
177
|
+
* private tracked modal header state
|
|
178
|
+
* This is need because modal header can be added back to
|
|
179
|
+
* the DOM, after being removed, and need to re-initialize state values
|
|
180
|
+
* @private
|
|
181
|
+
*/
|
|
182
|
+
initState() {
|
|
183
|
+
this.initialRender = true;
|
|
184
|
+
this.initialSlotRender = true;
|
|
185
|
+
this.unregisterCallback = null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
connectedCallback() {
|
|
189
|
+
this.initState();
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
renderedCallback() {
|
|
193
|
+
if (this.initialRender) {
|
|
194
|
+
this.registerWithParent();
|
|
195
|
+
this.initialRender = false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
disconnectedCallback() {
|
|
200
|
+
if (this.unregisterCallback) {
|
|
201
|
+
this.unregisterCallback();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
2
|
+
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
3
|
+
|
|
4
|
+
:host([data-render-mode="shadow"]) [part~='overlay'] {
|
|
5
|
+
background-color: var(
|
|
6
|
+
--sds-c-overlay-color-background,
|
|
7
|
+
var(--sds-s-popup-color-background, var(--sds-g-color-neutral-base-1))
|
|
8
|
+
);
|
|
9
|
+
color: var(
|
|
10
|
+
--sds-c-overlay-text-color,
|
|
11
|
+
var(--sds-s-popup-text-color, var(--sds-g-color-neutral-base-contrast-4))
|
|
12
|
+
);
|
|
13
|
+
border-radius: var(
|
|
14
|
+
--sds-c-overlay-radius-border,
|
|
15
|
+
var(--sds-s-popup-radius-border, var(--sds-g-radius-border-2, 0.25rem))
|
|
16
|
+
);
|
|
17
|
+
border-width: var(
|
|
18
|
+
--sds-c-overlay-sizing-border,
|
|
19
|
+
var(--sds-s-popup-sizing-border, var(--sds-g-sizing-border-1, 1px))
|
|
20
|
+
);
|
|
21
|
+
border-color: var(
|
|
22
|
+
--sds-c-overlay-color-border,
|
|
23
|
+
var(--sds-s-popup-color-border, var(--sds-g-color-border-base-1, #c9c9c9))
|
|
24
|
+
);
|
|
25
|
+
box-shadow: var(--sds-c-overlay-shadow, var(--sds-s-popup-shadow, var(--sds-g-shadow-1, 0 0 2px 0 #18181814, 0 2px 4px 1px #18181828)));
|
|
26
|
+
|
|
27
|
+
/* TODO: consider semantics of the shared hook for overlays/popups. */
|
|
28
|
+
padding-left: var(
|
|
29
|
+
--sds-c-overlay-spacing-inline-start,
|
|
30
|
+
var(--sds-c-overlay-spacing-inline, var(--sds-s-popup-spacing-inline, var(--sds-g-spacing-3, 0.75rem)))
|
|
31
|
+
);
|
|
32
|
+
padding-right: var(
|
|
33
|
+
--sds-c-overlay-spacing-inline-end,
|
|
34
|
+
var(--sds-c-overlay-spacing-inline, var(--sds-s-popup-spacing-inline, var(--sds-g-spacing-3, 0.75rem)))
|
|
35
|
+
);
|
|
36
|
+
padding-top: var(
|
|
37
|
+
--sds-c-overlay-spacing-block-start,
|
|
38
|
+
var(--sds-c-overlay-spacing-block, var(--sds-s-popup-spacing-block, var(--sds-g-spacing-3, 0.75rem)))
|
|
39
|
+
);
|
|
40
|
+
padding-bottom: var(
|
|
41
|
+
--sds-c-overlay-spacing-block-end,
|
|
42
|
+
var(--sds-c-overlay-spacing-block, var(--sds-s-popup-spacing-block, var(--sds-g-spacing-3, 0.75rem)))
|
|
43
|
+
);
|
|
44
|
+
}
|
|
1
45
|
|
|
2
46
|
/**
|
|
3
47
|
* @Note: Static fallbacks are in place until SLDS adopts SDS. Without static
|
|
@@ -37,7 +81,7 @@
|
|
|
37
81
|
* Opinion of subsystem, not supported in base SDS component
|
|
38
82
|
*/
|
|
39
83
|
font-size: var(--slds-c-tooltip-font-size, 0.75rem);
|
|
40
|
-
max-width: var(--slds-c-tooltip-sizing-max
|
|
84
|
+
max-width: var(--slds-c-tooltip-sizing-width-max, 20rem);
|
|
41
85
|
position: relative;
|
|
42
86
|
}
|
|
43
87
|
}
|
|
@@ -326,19 +326,11 @@ export default class PrivateCellFactory extends PrimitiveDatatableCell {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
get dateValue() {
|
|
329
|
-
// Supported values can be passed directly to lightning-formatted-date-time
|
|
330
|
-
//
|
|
331
|
-
//
|
|
329
|
+
// Supported values can be passed directly to lightning-formatted-date-time but
|
|
330
|
+
// non-supported formats need to be passed through Date constructor to avoid
|
|
331
|
+
// customer breakages for the time being. Ideally the use of toDate here will be
|
|
332
332
|
// temporary and we can remove use of the Date constructor in the future
|
|
333
|
-
|
|
334
|
-
toDate(this.value); // will throw error if value isn't supported
|
|
335
|
-
return this.value;
|
|
336
|
-
} catch (err) {
|
|
337
|
-
console.warn(
|
|
338
|
-
`'${this.value}' does not follow a supported date format. Please use either a timestamp, ISO8601 string, or Date object to avoid risking inconsistencies and breakages.`
|
|
339
|
-
);
|
|
340
|
-
return new Date(this.value);
|
|
341
|
-
}
|
|
333
|
+
return toDate(this.value);
|
|
342
334
|
}
|
|
343
335
|
|
|
344
336
|
get computedDateLocalDay() {
|