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
|
@@ -1,32 +1,216 @@
|
|
|
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"]) {
|
|
5
|
+
/**
|
|
6
|
+
* Host mapping to composed sds-icon
|
|
7
|
+
*
|
|
8
|
+
* Static fallbacks in place for accessibility
|
|
9
|
+
*/
|
|
10
|
+
--sds-c-icon-color-background: var(
|
|
11
|
+
--sds-c-inputcheckbox-color-background,
|
|
12
|
+
var(--sds-s-input-color-background, var(--sds-g-color-neutral-base-1))
|
|
13
|
+
);
|
|
14
|
+
--sds-c-icon-color-foreground: var(--sds-c-inputcheckbox-mark-color-foreground, transparent);
|
|
15
|
+
--sds-c-icon-color-border: var(
|
|
16
|
+
--sds-c-inputcheckbox-color-border,
|
|
17
|
+
var(--sds-s-input-color-border, var(--sds-g-color-neutral-base-contrast-4))
|
|
18
|
+
);
|
|
19
|
+
--sds-c-icon-sizing: var(--sds-c-inputcheckbox-sizing, 1rem);
|
|
20
|
+
--sds-c-icon-spacing: var(--sds-c-inputcheckbox-spacing);
|
|
21
|
+
--sds-c-icon-radius-border: var(--sds-c-inputcheckbox-radius-border, var(--sds-s-input-radius-border));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([data-render-mode="shadow"]:hover) {
|
|
25
|
+
--sds-c-inputcheckbox-mark-color-foreground: var(--sds-c-inputcheckbox-mark-color-foreground-hover);
|
|
26
|
+
--sds-c-inputcheckbox-color-background: var(
|
|
27
|
+
--sds-c-inputcheckbox-color-background-hover,
|
|
28
|
+
var(--sds-s-input-color-background-hover)
|
|
29
|
+
);
|
|
30
|
+
--sds-c-inputcheckbox-color-border: var(
|
|
31
|
+
--sds-c-inputcheckbox-color-border-hover,
|
|
32
|
+
var(--sds-s-input-color-border-hover)
|
|
33
|
+
);
|
|
34
|
+
--sds-c-inputcheckbox-label-color: var(--sds-c-inputcheckbox-label-color-hover);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([data-render-mode="shadow"][checked]) {
|
|
38
|
+
--sds-c-inputcheckbox-mark-color-foreground: var(
|
|
39
|
+
--sds-c-inputcheckbox-mark-color-foreground-checked,
|
|
40
|
+
var(--sds-g-color-neutral-base-1)
|
|
41
|
+
);
|
|
42
|
+
--sds-c-inputcheckbox-color-background: var(
|
|
43
|
+
--sds-c-inputcheckbox-color-background-checked,
|
|
44
|
+
var(--sds-g-color-neutral-base-contrast-4)
|
|
45
|
+
);
|
|
46
|
+
--sds-c-inputcheckbox-color-border: var(
|
|
47
|
+
--sds-c-inputcheckbox-color-border-checked,
|
|
48
|
+
var(--sds-g-color-neutral-base-contrast-4)
|
|
49
|
+
);
|
|
50
|
+
--sds-c-inputcheckbox-label-color: var(--sds-c-inputcheckbox-label-color-checked);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([data-render-mode="shadow"][checked]:hover) {
|
|
54
|
+
--sds-c-inputcheckbox-mark-color-foreground-checked: var(
|
|
55
|
+
--sds-c-inputcheckbox-mark-color-foreground-checked-hover
|
|
56
|
+
);
|
|
57
|
+
--sds-c-inputcheckbox-color-background-checked: var(--sds-c-inputcheckbox-color-background-checked-hover);
|
|
58
|
+
--sds-c-inputcheckbox-color-border-checked: var(--sds-c-inputcheckbox-color-border-checked-hover);
|
|
59
|
+
--sds-c-inputcheckbox-label-color-checked: var(
|
|
60
|
+
--sds-c-inputcheckbox-label-color-checked-hover,
|
|
61
|
+
var(--sds-c-inputcheckbox-label-color-hover)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([data-render-mode="shadow"][indeterminate]) {
|
|
66
|
+
--sds-c-inputcheckbox-mark-color-foreground: var(
|
|
67
|
+
--sds-c-inputcheckbox-mark-color-foreground-indeterminate,
|
|
68
|
+
#fff
|
|
69
|
+
);
|
|
70
|
+
--sds-c-inputcheckbox-color-background: var(
|
|
71
|
+
--sds-c-inputcheckbox-color-background-indeterminate,
|
|
72
|
+
var(--sds-s-input-color-background, #111)
|
|
73
|
+
);
|
|
74
|
+
--sds-c-inputcheckbox-color-border: var(
|
|
75
|
+
--sds-c-inputcheckbox-color-border-indeterminate,
|
|
76
|
+
var(--sds-s-input-color-border, #111)
|
|
77
|
+
);
|
|
78
|
+
--sds-c-inputcheckbox-label-color: var(--sds-c-inputcheckbox-label-color-indeterminate);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([data-render-mode="shadow"][indeterminate]:hover) {
|
|
82
|
+
--sds-c-inputcheckbox-mark-color-foreground-indeterminate: var(
|
|
83
|
+
--sds-c-inputcheckbox-mark-color-foreground-indeterminate-hover
|
|
84
|
+
);
|
|
85
|
+
--sds-c-inputcheckbox-color-background-indeterminate: var(
|
|
86
|
+
--sds-c-inputcheckbox-color-background-indeterminate-hover
|
|
87
|
+
);
|
|
88
|
+
--sds-c-inputcheckbox-color-border-indeterminate: var(
|
|
89
|
+
--sds-c-inputcheckbox-color-border-indeterminate-hover
|
|
90
|
+
);
|
|
91
|
+
--sds-c-inputcheckbox-label-color-indeterminate: var(
|
|
92
|
+
--sds-c-inputcheckbox-label-color-indeterminate-hover,
|
|
93
|
+
var(--sds-c-inputcheckbox-label-color-hover)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([data-render-mode="shadow"][focus-visible]) {
|
|
98
|
+
--sds-c-inputcheckbox-shadow: var(
|
|
99
|
+
--sds-c-inputcheckbox-shadow-focus,
|
|
100
|
+
var(--sds-s-input-shadow-focus, 0 0 4px 1px var(--sds-g-color-palette-blue-50, #0176d3))
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
:host([data-render-mode="shadow"][disabled]) {
|
|
105
|
+
--sds-c-inputcheckbox-color-background: var(
|
|
106
|
+
--sds-c-inputcheckbox-color-background-disabled,
|
|
107
|
+
var(--sds-s-input-color-background-disabled, #efefef)
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
/* TODO: Add shared border hook when available: https://github.com/salesforce-ux/salesforce-design-system/issues/272 */
|
|
111
|
+
--sds-c-inputcheckbox-color-border: var(--sds-c-inputcheckbox-color-border-disabled, #666);
|
|
112
|
+
--sds-c-inputcheckbox-label-color: var(--sds-c-inputcheckbox-label-color-disabled);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([data-render-mode="shadow"][error]) {
|
|
116
|
+
--sds-c-inputcheckbox-mark-color-foreground: var(--sds-c-inputcheckbox-mark-color-foreground-error);
|
|
117
|
+
--sds-c-inputcheckbox-color-background: var(--sds-c-inputcheckbox-color-background-error);
|
|
118
|
+
--sds-c-inputcheckbox-color-border: var(--sds-c-inputcheckbox-color-border-error);
|
|
119
|
+
--sds-c-inputcheckbox-label-color: var(--sds-c-inputcheckbox-label-color-error);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([data-render-mode="shadow"][disabled][checked]) {
|
|
123
|
+
--sds-c-inputcheckbox-mark-color-foreground: var(
|
|
124
|
+
--sds-c-inputcheckbox-mark-color-foreground-disabled,
|
|
125
|
+
#666
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([data-render-mode="shadow"][error][focus-visible]) {
|
|
130
|
+
--sds-c-inputcheckbox-shadow: var(
|
|
131
|
+
--sds-c-inputcheckbox-shadow-error-focus,
|
|
132
|
+
0 0 4px 1px var(--sds-g-color-palette-blue-50, #0176d3)
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([data-render-mode="shadow"]) [part~='input-checkbox'] {
|
|
137
|
+
display: inline-flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:host([data-render-mode="shadow"]) [part~='indicator'] {
|
|
142
|
+
display: inline-flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
box-shadow: var(--sds-c-inputcheckbox-shadow, var(--sds-s-input-shadow));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Size and position the input on top of our icon for accessibility
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
:host([data-render-mode="shadow"]) [part~='checkbox'] {
|
|
152
|
+
position: absolute;
|
|
153
|
+
height: calc(
|
|
154
|
+
var(--sds-c-inputcheckbox-sizing, 1rem) + (var(--sds-c-inputcheckbox-sizing-border, 1px) * 2) +
|
|
155
|
+
var(--sds-c-inputcheckbox-spacing, 0px)
|
|
156
|
+
);
|
|
157
|
+
width: calc(
|
|
158
|
+
var(--sds-c-inputcheckbox-sizing, 1rem) + (var(--sds-c-inputcheckbox-sizing-border, 1px) * 2) +
|
|
159
|
+
var(--sds-c-inputcheckbox-spacing, 0px)
|
|
160
|
+
);
|
|
161
|
+
opacity: 0.00001;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
:host([data-render-mode="shadow"]) [part~='label'] {
|
|
165
|
+
padding-inline-start: var(--sds-c-inputcheckbox-label-spacing-inline-start);
|
|
166
|
+
color: var(--sds-c-inputcheckbox-label-color);
|
|
167
|
+
}
|
|
1
168
|
|
|
2
169
|
/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
|
|
3
170
|
Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
|
|
4
171
|
|
|
5
172
|
@supports (--styling-hooks: '') {
|
|
6
173
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
174
|
+
* Base
|
|
175
|
+
*/
|
|
9
176
|
:host([data-render-mode="shadow"]) [part~='input-checkbox'] {
|
|
10
177
|
/* Label */
|
|
11
178
|
--sds-c-inputcheckbox-label-spacing-inline-start: var(
|
|
12
179
|
--slds-c-inputcheckbox-label-spacing-inline-start,
|
|
13
180
|
var(--sds-g-spacing-2, 0.5rem)
|
|
14
181
|
);
|
|
182
|
+
|
|
183
|
+
/* We need 'flex' instead of SDS's 'inline-flex' for the responsive label-inline variant */
|
|
184
|
+
display: flex;
|
|
15
185
|
}
|
|
16
186
|
|
|
17
187
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
188
|
+
* Label Container
|
|
189
|
+
*/
|
|
20
190
|
:host([data-render-mode="shadow"]) [part~='label-container'] {
|
|
21
191
|
display: inline-flex;
|
|
22
192
|
align-items: center;
|
|
193
|
+
font-size: var(--sds-g-font-scale-neg-3, 0.75rem);
|
|
194
|
+
|
|
195
|
+
/* Accounts for help-text in same row as label */
|
|
196
|
+
padding-inline-end: var(--sds-g-spacing-1, 0.25rem);
|
|
23
197
|
}
|
|
24
198
|
|
|
25
199
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
200
|
+
* Label
|
|
201
|
+
*
|
|
202
|
+
* Add [part~='input-checkbox'] to increase specificity and
|
|
203
|
+
* avoid collisions with other components using [part~='label'] (e.g. slds-input-text)
|
|
204
|
+
*/
|
|
205
|
+
:host([data-render-mode="shadow"]) [part~='input-checkbox'] [part~='label'] {
|
|
206
|
+
color: var(--slds-c-inputcheckbox-label-color, var(--sds-g-color-neutral-base-30, #444444));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Checkbox
|
|
211
|
+
*
|
|
212
|
+
* Hidden from view, see Indicator for visual faux checkbox.
|
|
213
|
+
*/
|
|
30
214
|
:host([data-render-mode="shadow"]) [part~='checkbox'] {
|
|
31
215
|
width: 1px;
|
|
32
216
|
height: 1px;
|
|
@@ -40,27 +224,30 @@
|
|
|
40
224
|
}
|
|
41
225
|
|
|
42
226
|
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
227
|
+
* Required Marker
|
|
228
|
+
*
|
|
229
|
+
* Extra specificity required due to SDS having too much specificity (@TODO: fix SDS specificity)
|
|
230
|
+
*/
|
|
231
|
+
:host([data-render-mode="shadow"]) abbr[title='required'] {
|
|
46
232
|
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
47
233
|
padding-right: var(--sds-g-spacing-1, 0.25rem);
|
|
234
|
+
text-decoration: none;
|
|
48
235
|
}
|
|
49
236
|
|
|
50
237
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
238
|
+
* Checkbox Indicator
|
|
239
|
+
*
|
|
240
|
+
* ┌────────────────────┐ ┌─────────────────────┐
|
|
241
|
+
* │ sds-icon │ │ Faux via <span> │
|
|
242
|
+
* └────────────────────┘ └─────────────────────┘
|
|
243
|
+
* ▲ ▲
|
|
244
|
+
* ┌────────────────────┐ ┌─────────────────────┐
|
|
245
|
+
* │ sds-input-checkbox │ │ slds-input-checkbox │
|
|
246
|
+
* └────────────────────┘ └─────────────────────┘
|
|
247
|
+
*
|
|
248
|
+
* sds-input-checkbox uses sds-icon for its visual checkbox indicator. SLDS
|
|
249
|
+
* + LBC uses a styled <span>. Due to this divergence, we require custom CSS.
|
|
250
|
+
*/
|
|
64
251
|
:host([data-render-mode="shadow"]) [part~='indicator'] {
|
|
65
252
|
position: relative;
|
|
66
253
|
width: var(--slds-c-inputcheckbox-sizing, 1rem);
|
|
@@ -74,8 +261,8 @@
|
|
|
74
261
|
}
|
|
75
262
|
|
|
76
263
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
264
|
+
* Checked
|
|
265
|
+
*/
|
|
79
266
|
:host([data-render-mode="shadow"][checked]) [part~='indicator']::after {
|
|
80
267
|
content: '';
|
|
81
268
|
height: calc(var(--slds-c-inputcheckbox-sizing, 1rem) / 4);
|
|
@@ -95,8 +282,8 @@
|
|
|
95
282
|
}
|
|
96
283
|
|
|
97
284
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
285
|
+
* Disabled
|
|
286
|
+
*/
|
|
100
287
|
:host([data-render-mode="shadow"][disabled]) [part~='indicator'] {
|
|
101
288
|
--slds-c-inputcheckbox-color-background: var(
|
|
102
289
|
--slds-c-inputcheckbox-color-background-disabled,
|
|
@@ -110,8 +297,8 @@
|
|
|
110
297
|
}
|
|
111
298
|
|
|
112
299
|
/**
|
|
113
|
-
|
|
114
|
-
|
|
300
|
+
* Focused
|
|
301
|
+
*/
|
|
115
302
|
:host([data-render-mode="shadow"]:focus-within) [part~='indicator'] {
|
|
116
303
|
--slds-c-inputcheckbox-color-background: var(--slds-c-inputcheckbox-color-background-focus);
|
|
117
304
|
--slds-c-inputcheckbox-color-border: var(
|
|
@@ -125,8 +312,8 @@
|
|
|
125
312
|
}
|
|
126
313
|
|
|
127
314
|
/**
|
|
128
|
-
|
|
129
|
-
|
|
315
|
+
* Invalid
|
|
316
|
+
*/
|
|
130
317
|
:host([data-render-mode="shadow"][invalid]) [part~='indicator'] {
|
|
131
318
|
--slds-c-inputcheckbox-color-background: var(--slds-c-inputcheckbox-color-background-invalid);
|
|
132
319
|
--slds-c-inputcheckbox-sizing-border: var(
|
|
@@ -137,9 +324,81 @@
|
|
|
137
324
|
--slds-c-inputcheckbox-color-border-invalid,
|
|
138
325
|
var(--sds-g-color-error-base-50, #ea001e)
|
|
139
326
|
);
|
|
327
|
+
--slds-c-inputcheckbox-mark-color-foreground: var(
|
|
328
|
+
--slds-c-inputcheckbox-mark-color-foreground-invalid,
|
|
329
|
+
var(--sds-g-color-error-base-50, #ea001e)
|
|
330
|
+
);
|
|
140
331
|
}
|
|
141
332
|
|
|
142
333
|
:host([data-render-mode="shadow"][invalid]) [part~='help-text'] {
|
|
143
334
|
color: var(--slds-c-inputcheckbox-helptext-color-invalid, var(--sds-g-color-error-base-50, #ea001e));
|
|
144
335
|
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Label Inline Variant
|
|
339
|
+
*
|
|
340
|
+
* @TODO: Remove magic number for MQ
|
|
341
|
+
*/
|
|
342
|
+
@media (min-width: 48em) {
|
|
343
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='label-container'] {
|
|
344
|
+
float: left;
|
|
345
|
+
|
|
346
|
+
/* TODO: Get rid of these magic numbers */
|
|
347
|
+
max-width: calc(33% - 1.125rem);
|
|
348
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
349
|
+
padding-inline-start: var(--sds-g-spacing-1, 0.25rem);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='input-checkbox'] {
|
|
353
|
+
display: block;
|
|
354
|
+
margin-inline-start: 33%;
|
|
355
|
+
padding-block: var(--sds-g-spacing-1, 0.25rem);
|
|
356
|
+
margin-block-end: var(--sds-g-spacing-2, 0.5rem);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='inline-help'] {
|
|
360
|
+
float: left;
|
|
361
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='indicator'] {
|
|
365
|
+
/* @TODO: add change to SDS, removes line-height from display inline */
|
|
366
|
+
display: block;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Standalone Checkbox
|
|
372
|
+
*
|
|
373
|
+
* label-inline & label-stacked uses the "standalone" checkbox that lives outside the label
|
|
374
|
+
*/
|
|
375
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='checkbox'],:host([data-render-mode="shadow"][variant~='label-stacked']) [part~='checkbox'] {
|
|
376
|
+
width: 1rem;
|
|
377
|
+
height: 1rem;
|
|
378
|
+
margin: 0;
|
|
379
|
+
clip: auto;
|
|
380
|
+
opacity: 0;
|
|
381
|
+
z-index: 1;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* A temporarily baked-in utility class until SLDS gets a proper utility package.
|
|
387
|
+
*
|
|
388
|
+
* This is a hybrid patch between synthetic and native shadow. The ideal final
|
|
389
|
+
* outcome is the removal of this class and replacing the class with the SLDS
|
|
390
|
+
* utility package solution.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
394
|
+
position: absolute !important;
|
|
395
|
+
margin: -1px !important;
|
|
396
|
+
border: 0 !important;
|
|
397
|
+
padding: 0 !important;
|
|
398
|
+
width: 1px !important;
|
|
399
|
+
height: 1px !important;
|
|
400
|
+
overflow: hidden !important;
|
|
401
|
+
clip: rect(0 0 0 0) !important;
|
|
402
|
+
text-transform: none !important;
|
|
403
|
+
white-space: nowrap !important;
|
|
145
404
|
}
|
|
@@ -146,9 +146,13 @@
|
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Invalid State
|
|
149
|
+
*
|
|
150
|
+
* Does not use --sds-c-inputtext-color-border-invalid due to this hook being
|
|
151
|
+
* tied to :host([aria-invalid]) which this subsystem does not use. Instead, it
|
|
152
|
+
* uses :host([invalid]).
|
|
149
153
|
*/
|
|
150
|
-
:host([data-render-mode="shadow"][
|
|
151
|
-
--
|
|
154
|
+
:host([data-render-mode="shadow"][invalid]) [part~='input-text'] {
|
|
155
|
+
--slds-c-inputtext-color-border: var(--sds-g-color-error-base-50, #ea001e);
|
|
152
156
|
--slds-c-inputtext-sizing-border: var(--sds-g-sizing-border-2, 2px);
|
|
153
157
|
--slds-c-icon-color-foreground: var(--sds-g-color-error-base-50, #ea001e);
|
|
154
158
|
}
|
|
@@ -164,8 +168,11 @@
|
|
|
164
168
|
|
|
165
169
|
/**
|
|
166
170
|
* Label
|
|
171
|
+
*
|
|
172
|
+
* Add [part~='input-text'] to increase specificity and
|
|
173
|
+
* avoid collisions with other components using [part~='label'] (e.g. slds-input-checkbox)
|
|
167
174
|
*/
|
|
168
|
-
:host([data-render-mode="shadow"]) [part
|
|
175
|
+
:host([data-render-mode="shadow"]) [part~='input-text'] [part~='label'] {
|
|
169
176
|
padding-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
170
177
|
color: var(--slds-c-inputtext-label-color, var(--sds-g-color-neutral-base-30, #444444));
|
|
171
178
|
font-size: var(--slds-c-inputtext-label-font-size, var(--sds-g-font-scale-neg-3, 0.75rem));
|
|
@@ -180,14 +187,14 @@
|
|
|
180
187
|
/**
|
|
181
188
|
* Label's Required Symbol
|
|
182
189
|
*/
|
|
183
|
-
:host([data-render-mode="shadow"]) [part
|
|
190
|
+
:host([data-render-mode="shadow"]) [part~='label'] [title='required'] {
|
|
184
191
|
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
185
192
|
}
|
|
186
193
|
|
|
187
194
|
/**
|
|
188
195
|
* Input Container
|
|
189
196
|
*/
|
|
190
|
-
:host([data-render-mode="shadow"]) [part
|
|
197
|
+
:host([data-render-mode="shadow"]) [part~='input-container'] {
|
|
191
198
|
flex: 1 0 100%;
|
|
192
199
|
}
|
|
193
200
|
|
|
@@ -197,7 +204,7 @@
|
|
|
197
204
|
* Note: not to be confused with lightning-helptext. This is for the text
|
|
198
205
|
* that goes below the input.
|
|
199
206
|
*/
|
|
200
|
-
:host([data-render-mode="shadow"]) [part
|
|
207
|
+
:host([data-render-mode="shadow"]) [part~='help-text'] {
|
|
201
208
|
font-size: var(--slds-c-inputtext-helptext-font-size, var(--sds-g-font-scale-neg-3, 0.75rem));
|
|
202
209
|
|
|
203
210
|
/* TODO: Add global hook once SLDS creates a new spacing hook that equals the value needed here */
|
|
@@ -207,7 +214,7 @@
|
|
|
207
214
|
/**
|
|
208
215
|
* Help Text's Invalid State – Part container is unique to SLDS
|
|
209
216
|
*/
|
|
210
|
-
:host([data-render-mode="shadow"][
|
|
217
|
+
:host([data-render-mode="shadow"][invalid]) [part~='help-text'] {
|
|
211
218
|
color: var(--sds-g-color-error-base-50, #ea001e);
|
|
212
219
|
}
|
|
213
220
|
|
|
@@ -221,4 +228,60 @@
|
|
|
221
228
|
:host([data-render-mode="shadow"]) [part~='start'] {
|
|
222
229
|
--slds-c-icon-spacing-inline-end: var(--sds-g-spacing-2, 0.5rem);
|
|
223
230
|
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Label Inline Variant
|
|
234
|
+
*
|
|
235
|
+
* Note: all the 33% values you see are remnants of legacy SLDS. We need to
|
|
236
|
+
* keep this implementation intact so visual output is the same when used
|
|
237
|
+
* in a form that has non-shadow components. Attempting to refactor to a
|
|
238
|
+
* modern solution like flex is proving tricky due to the presence of the
|
|
239
|
+
* optional inline-help and the input needing to have exactly 33% of spacing
|
|
240
|
+
* from the inline-start.
|
|
241
|
+
*
|
|
242
|
+
* Ref: https://github.com/salesforce-ux/design-system-internal/blob/240-winter-23/ui/components/form-element/horizontal/_index.scss#L63
|
|
243
|
+
*/
|
|
244
|
+
@media (min-width: 48em) {
|
|
245
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='input-text'] {
|
|
246
|
+
display: block;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='label'] {
|
|
250
|
+
float: left;
|
|
251
|
+
|
|
252
|
+
/* TODO: Get rid of these magic numbers */
|
|
253
|
+
max-width: calc(33% - 1.125rem);
|
|
254
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='input-container'] {
|
|
258
|
+
margin-inline-start: 33%;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:host([data-render-mode="shadow"][variant~='label-inline']) [part~='inline-help'] {
|
|
262
|
+
float: left;
|
|
263
|
+
padding-block-start: var(--sds-g-spacing-1, 0.25rem);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* A temporarily baked-in utility class until SLDS gets a proper utility package.
|
|
270
|
+
*
|
|
271
|
+
* This is a hybrid patch between synthetic and native shadow. The ideal final
|
|
272
|
+
* outcome is the removal of this class and replacing the class with the SLDS
|
|
273
|
+
* utility package solution.
|
|
274
|
+
*/
|
|
275
|
+
|
|
276
|
+
:host([data-render-mode="shadow"]) .slds-assistive-text {
|
|
277
|
+
position: absolute !important;
|
|
278
|
+
margin: -1px !important;
|
|
279
|
+
border: 0 !important;
|
|
280
|
+
padding: 0 !important;
|
|
281
|
+
width: 1px !important;
|
|
282
|
+
height: 1px !important;
|
|
283
|
+
overflow: hidden !important;
|
|
284
|
+
clip: rect(0 0 0 0) !important;
|
|
285
|
+
text-transform: none !important;
|
|
286
|
+
white-space: nowrap !important;
|
|
224
287
|
}
|
|
@@ -207,7 +207,7 @@ You can hide the `address-label` visually and still make them accessible to scre
|
|
|
207
207
|
|
|
208
208
|
Additionally, the `show-address-lookup` boolean attribute creates a search field that doesn't have an associated label. See **Using Lookup to Find and Autofill an Address** for more information.
|
|
209
209
|
|
|
210
|
-
Your Salesforce locale setting determines the order and layout of the address fields.
|
|
210
|
+
Your Salesforce locale setting determines the order and layout of the input address fields by default. Use the `locale` attribute to override the default. Specify any locale code from the list of [Supported Number, Name, and Address Formats (ICU)](https://help.salesforce.com/s/articleView?id=sf.admin_supported_locales.htm&type=5").
|
|
211
211
|
|
|
212
212
|
You can also use custom labels that display translated values. For more information, see
|
|
213
213
|
[Access Labels](docs/component-library/documentation/lwc/lwc.create_labels).
|
|
@@ -140,8 +140,9 @@ export default class LightningInputAddress extends LightningElement {
|
|
|
140
140
|
@api countryDisabled;
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* Specifies the locale used to determine the layout of the address fields
|
|
144
144
|
* @type {string}
|
|
145
|
+
* @default en_US
|
|
145
146
|
*/
|
|
146
147
|
@api locale = locale;
|
|
147
148
|
|
|
@@ -28,6 +28,24 @@ function convertAndFormatDate(date, format, timeZone) {
|
|
|
28
28
|
return formatDateUTC(converted, format);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Tries toDateStrict; if error thrown (unparseable string),
|
|
33
|
+
* logs warning and returns value from Date.parse
|
|
34
|
+
*
|
|
35
|
+
* @param {String|Number|Date} value
|
|
36
|
+
* @returns Date
|
|
37
|
+
*/
|
|
38
|
+
export function toDate(value) {
|
|
39
|
+
try {
|
|
40
|
+
return toDateStrict(value);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.warn(
|
|
43
|
+
`'${value}' does not follow a supported date format. Please use either a timestamp, ISO8601 string, or Date object to avoid risking inconsistencies and breakages.`
|
|
44
|
+
);
|
|
45
|
+
return new Date(value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
/**
|
|
32
50
|
* Converts a timestamp or ISO-8601 string to a Date object
|
|
33
51
|
* If a Date object is provided it is returned as-is
|
|
@@ -35,8 +53,8 @@ function convertAndFormatDate(date, format, timeZone) {
|
|
|
35
53
|
* @param {String|Number|Date} value
|
|
36
54
|
* @returns Date
|
|
37
55
|
*/
|
|
38
|
-
|
|
39
|
-
if (!isDate(value) && isFinite(value)) {
|
|
56
|
+
function toDateStrict(value) {
|
|
57
|
+
if (value && !isDate(value) && isFinite(value)) {
|
|
40
58
|
// handles timestamp as number or string
|
|
41
59
|
return new Date(parseInt(value, 10));
|
|
42
60
|
} else if (value && !isDate(value)) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// TODO: remove file when migrating off aura
|
|
2
2
|
/*
|
|
3
3
|
* Regex to test a string for an ISO8601 Date. The following formats are matched.
|
|
4
|
-
* Note that if a time element is present (e.g. 'T'), the string should have a time zone designator (Z or +hh:mm or -hh:mm).
|
|
5
4
|
*
|
|
6
5
|
* YYYY
|
|
7
6
|
* YYYY-MM
|
|
@@ -14,7 +13,7 @@
|
|
|
14
13
|
* @see: https://www.w3.org/TR/NOTE-datetime
|
|
15
14
|
*/
|
|
16
15
|
const ISO8601_STRICT_PATTERN =
|
|
17
|
-
/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d[:]?\d\d)|Z)
|
|
16
|
+
/^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d[:]?\d\d)|Z)?)?)?)?$/i;
|
|
18
17
|
|
|
19
18
|
/* Regex to test a string for an ISO8601 partial time or full time:
|
|
20
19
|
* hh:mm
|
|
@@ -28,7 +27,7 @@ const ISO8601_TIME_PATTERN =
|
|
|
28
27
|
export const STANDARD_TIME_FORMAT = 'HH:mm:ss.SSS';
|
|
29
28
|
export const STANDARD_DATE_FORMAT = 'YYYY-MM-DD';
|
|
30
29
|
export const TIME_SEPARATOR = 'T';
|
|
31
|
-
const TIMEZONE_INDICATOR = /(Z|([+-])(\d{2})[:]?(\d{2}))
|
|
30
|
+
const TIMEZONE_INDICATOR = /(Z|([+-])(\d{2})[:]?(\d{2}))$/i;
|
|
32
31
|
|
|
33
32
|
export function isValidISODateTimeString(dateTimeString) {
|
|
34
33
|
return isValidISO8601String(dateTimeString) && isValidDate(dateTimeString);
|