lightning-base-components 1.18.2-alpha → 1.18.4-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 +4 -0
- package/package.json +15 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/src/lightning/accordion/__docs__/accordion.md +2 -2
- package/src/lightning/avatar/__docs__/avatar.md +7 -7
- package/src/lightning/badge/__docs__/badge.md +2 -2
- package/src/lightning/baseCombobox/baseCombobox.js +62 -22
- package/src/lightning/breadcrumbs/__docs__/breadcrumbs.md +3 -3
- package/src/lightning/button/__docs__/button.md +15 -15
- package/src/lightning/buttonIcon/__docs__/buttonIcon.md +9 -9
- package/src/lightning/buttonIconStateful/__docs__/buttonIconStateful.md +9 -9
- package/src/lightning/buttonMenu/__docs__/buttonMenu.md +8 -8
- package/src/lightning/buttonStateful/__docs__/buttonStateful.md +12 -12
- package/src/lightning/calendar/calendar.css +2 -2
- package/src/lightning/calendar/calendar.js +4 -2
- package/src/lightning/card/__docs__/card.md +3 -3
- package/src/lightning/checkboxGroup/__docs__/checkboxGroup.md +2 -2
- package/src/lightning/datatable/__docs__/datatable.md +45 -35
- package/src/lightning/datatable/autoWidthStrategy.js +3 -0
- package/src/lightning/datatable/columnWidthManager.js +1 -1
- package/src/lightning/datatable/datatable.js +8 -7
- package/src/lightning/datatable/rowSelection.js +7 -4
- package/src/lightning/datatable/templates/table/table.html +1 -0
- package/src/lightning/datepicker/datepicker.css +2 -2
- package/src/lightning/datepicker/datepicker.js +4 -2
- package/src/lightning/datetimepicker/datetimepicker.css +2 -2
- package/src/lightning/datetimepicker/datetimepicker.js +4 -2
- package/src/lightning/dualListbox/dualListbox.js +16 -7
- package/src/lightning/formattedRichText/formatted-rich-text.slds.css +230 -0
- package/src/lightning/formattedRichText/formattedRichText.css +2 -0
- package/src/lightning/formattedRichText/formattedRichText.js +4 -2
- package/src/lightning/formattedText/formattedText.css +1 -0
- package/src/lightning/formattedText/formattedText.js +3 -2
- package/src/lightning/helptext/__docs__/helptext.md +2 -2
- package/src/lightning/icon/__docs__/icon.md +5 -5
- package/src/lightning/icon/icon.js +6 -1
- package/src/lightning/iconUtils/iconUtils.js +0 -12
- package/src/lightning/iconUtils/polyfill.js +5 -90
- package/src/lightning/input/__docs__/input.md +7 -7
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.css +6 -0
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.html +2 -1
- package/src/lightning/input/__examples__/checkboxbutton/checkboxbutton.js +1 -1
- package/src/lightning/input/__examples__/number/number.html +0 -5
- package/src/lightning/input/input.css +2 -4
- package/src/lightning/input/input.html +149 -239
- package/src/lightning/input/input.js +209 -532
- package/src/lightning/inputAddress/__docs__/inputAddress.md +3 -3
- package/src/lightning/inputUtils/inputUtils.js +15 -20
- package/src/lightning/inputUtils/normalize.js +7 -0
- package/src/lightning/{input/numberUtil.js → inputUtils/number.js} +1 -1
- package/src/lightning/inputUtils/utils.js +18 -0
- package/src/lightning/modalBody/__docs__/modalBody.md +9 -9
- package/src/lightning/modalFooter/__docs__/modalFooter.md +9 -9
- package/src/lightning/modalHeader/__docs__/modalHeader.md +9 -9
- package/src/lightning/overlayContainer/overlayContainer.js +4 -2
- package/src/lightning/pill/__docs__/pill.md +3 -3
- package/src/lightning/pillContainer/__docs__/pillContainer.md +14 -14
- package/src/lightning/primitiveIcon/primitiveIcon.js +8 -5
- package/src/lightning/primitiveInputCheckbox/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.css +3 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.html +48 -0
- package/src/lightning/primitiveInputCheckbox/primitiveInputCheckbox.js +139 -0
- package/src/lightning/primitiveInputCheckboxButton/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputCheckboxButton/input-checkbox-button.slds.css +126 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.css +6 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.html +24 -0
- package/src/lightning/primitiveInputCheckboxButton/primitiveInputCheckboxButton.js +176 -0
- package/src/lightning/primitiveInputColor/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputColor/input-color.slds.css +35 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.css +4 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.html +50 -0
- package/src/lightning/primitiveInputColor/primitiveInputColor.js +184 -0
- package/src/lightning/primitiveInputFile/button.slds.css +527 -0
- package/src/lightning/primitiveInputFile/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputFile/input-file.slds.css +62 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.css +5 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.html +45 -0
- package/src/lightning/primitiveInputFile/primitiveInputFile.js +111 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.html +24 -0
- package/src/lightning/primitiveInputRadio/primitiveInputRadio.js +103 -0
- package/src/lightning/primitiveInputSimple/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputSimple/input-text.slds.css +398 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.css +9 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.html +65 -0
- package/src/lightning/primitiveInputSimple/primitiveInputSimple.js +585 -0
- package/src/lightning/primitiveInputToggle/form-element.slds.css +281 -0
- package/src/lightning/primitiveInputToggle/input-toggle.slds.css +170 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.css +3 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.html +34 -0
- package/src/lightning/primitiveInputToggle/primitiveInputToggle.js +164 -0
- package/src/lightning/radioGroup/__docs__/radioGroup.md +4 -4
- package/src/lightning/select/__docs__/select.md +2 -2
- package/src/lightning/shadowBaseClassPrivate/shadowBaseClassPrivate.js +1 -1
- package/src/lightning/sldsCommon/sldsCommon.css +144 -42
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.css +10 -0
- package/src/lightning/sldsUtilsAlignment/sldsUtilsAlignment.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.css +18 -0
- package/src/lightning/sldsUtilsBorders/sldsUtilsBorders.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.css +24 -0
- package/src/lightning/sldsUtilsBox/sldsUtilsBox.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.css +20 -0
- package/src/lightning/sldsUtilsFloats/sldsUtilsFloats.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.css +259 -0
- package/src/lightning/sldsUtilsGrid/sldsUtilsGrid.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.css +8 -0
- package/src/lightning/sldsUtilsHyphenation/sldsUtilsHyphenation.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.css +57 -0
- package/src/lightning/sldsUtilsLineClamp/sldsUtilsLineClamp.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.css +313 -0
- package/src/lightning/sldsUtilsMargin/sldsUtilsMargin.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.css +308 -0
- package/src/lightning/sldsUtilsPadding/sldsUtilsPadding.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.css +18 -0
- package/src/lightning/sldsUtilsPosition/sldsUtilsPosition.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.css +1408 -0
- package/src/lightning/sldsUtilsSizing/sldsUtilsSizing.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.css +295 -0
- package/src/lightning/sldsUtilsThemes/sldsUtilsThemes.js-meta.xml +4 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.css +14 -0
- package/src/lightning/sldsUtilsTruncation/sldsUtilsTruncation.js-meta.xml +4 -0
- package/src/lightning/slider/__docs__/slider.md +2 -2
- package/src/lightning/tabset/__docs__/tabset.md +2 -2
- package/src/lightning/textarea/__docs__/textarea.md +2 -2
- package/src/lightning/timepicker/timepicker.js +4 -2
- package/src/lightning/toast/toast.js-meta.xml +2 -0
- package/src/lightning/toastContainer/__docs__/toastContainer.md +14 -34
- package/src/lightning/toastContainer/toastContainer.js +10 -15
- package/src/lightning/tooltipLibrary/tooltipLibrary.js +12 -5
- package/src/lightning/iconUtils/isIframeInEdge.js +0 -7
- package/src/lightning/iconUtils/supportsSvg.js +0 -16
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.html +0 -0
- /package/src/lightning/formattedRichText/{__examples__disabled → __examples__}/basic/basic.js +0 -0
- /package/src/lightning/{input/emailUtil.js → inputUtils/email.js} +0 -0
- /package/src/lightning/{input → primitiveInputCheckbox}/input-checkbox.slds.css +0 -0
- /package/src/lightning/{input → primitiveInputColor}/input-text.slds.css +0 -0
- /package/src/lightning/{input → primitiveInputSimple}/normalize.js +0 -0
- /package/src/lightning/{input → primitiveInputSimple}/selection.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { api, track } from 'lwc';
|
|
2
|
+
import LightningShadowBaseClass from 'lightning/shadowBaseClassPrivate';
|
|
2
3
|
import {
|
|
3
4
|
normalizeBoolean,
|
|
4
5
|
parseToFormattedLinkifiedParts,
|
|
@@ -8,7 +9,7 @@ import {
|
|
|
8
9
|
/**
|
|
9
10
|
* Displays text, replaces newlines with line breaks, and linkifies if requested.
|
|
10
11
|
*/
|
|
11
|
-
export default class FormattedText extends
|
|
12
|
+
export default class FormattedText extends LightningShadowBaseClass {
|
|
12
13
|
/**
|
|
13
14
|
* Sets the text to display.
|
|
14
15
|
* @type {string}
|
|
@@ -73,9 +73,9 @@ some text that appears before the tooltip icon here
|
|
|
73
73
|
|
|
74
74
|
To apply custom styling, use the `:host` selector or define a custom class using the `class` attribute.
|
|
75
75
|
|
|
76
|
-
`lightning-helptext` contains the same customizable elements as `lightning-button-icon` for the button icon, which supports `--
|
|
76
|
+
`lightning-helptext` contains the same customizable elements as `lightning-button-icon` for the button icon, which supports `--slds-c-button-*` custom properties. See the [`lightning-button-icon` documentation](bundle/lightning-button-icon/documentation).
|
|
77
77
|
|
|
78
|
-
Customizing the tooltip content using the `--
|
|
78
|
+
Customizing the tooltip content using the `--slds-c-tooltip-*` custom properties isn't supported. `lightning-helptext` renders the tooltip as the child of the body element outside of the scoped container.
|
|
79
79
|
|
|
80
80
|
#### Accessibility
|
|
81
81
|
|
|
@@ -83,12 +83,12 @@ To change the fill and background color of a utility icon, define a custom class
|
|
|
83
83
|
</lightning-icon>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Specify the fill and background colors on the utility icon using the `--
|
|
86
|
+
Specify the fill and background colors on the utility icon using the `--slds-c-icon-color-*` custom properties.
|
|
87
87
|
|
|
88
88
|
```css
|
|
89
89
|
.my-icon {
|
|
90
|
-
--
|
|
91
|
-
--
|
|
90
|
+
--slds-c-icon-color-foreground-default: orange;
|
|
91
|
+
--slds-c-icon-color-background: gray;
|
|
92
92
|
}
|
|
93
93
|
```
|
|
94
94
|
|
|
@@ -96,8 +96,8 @@ To change the fill and background colors of a non-utility icon, such as an [acti
|
|
|
96
96
|
|
|
97
97
|
```css
|
|
98
98
|
.my-icon {
|
|
99
|
-
--
|
|
100
|
-
--
|
|
99
|
+
--slds-c-icon-color-foreground: orange;
|
|
100
|
+
--slds-c-icon-color-background: gray;
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
103
|
|
|
@@ -18,6 +18,8 @@ import { normalizeVariant } from './util';
|
|
|
18
18
|
* Represents a visual element that provides context and enhances usability.
|
|
19
19
|
*/
|
|
20
20
|
export default class LightningIcon extends LightningShadowBaseClass {
|
|
21
|
+
static validationOptOut = ['class'];
|
|
22
|
+
|
|
21
23
|
_src;
|
|
22
24
|
_privateIconName;
|
|
23
25
|
_iconName;
|
|
@@ -174,7 +176,10 @@ export default class LightningIcon extends LightningShadowBaseClass {
|
|
|
174
176
|
const name = getName(iconName);
|
|
175
177
|
const color = iconColors[category] && iconColors[category][name];
|
|
176
178
|
if (color) {
|
|
177
|
-
this.
|
|
179
|
+
this.setAttribute(
|
|
180
|
+
'style',
|
|
181
|
+
`--sds-c-icon-color-background: var(--slds-c-icon-color-background, ${color})`
|
|
182
|
+
);
|
|
178
183
|
}
|
|
179
184
|
}
|
|
180
185
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getPathPrefix, getToken } from 'lightning/configProvider';
|
|
2
|
-
import isIframeInEdge from './isIframeInEdge';
|
|
3
2
|
|
|
4
3
|
const validNameRe = /^([a-zA-Z]+):([a-zA-Z]\w*)$/;
|
|
5
4
|
const underscoreRe = /_/g;
|
|
@@ -65,17 +64,6 @@ export const getIconPath = (iconName, direction = 'ltr') => {
|
|
|
65
64
|
if (isValidName(iconName)) {
|
|
66
65
|
const baseIconPath = getBaseIconPath(getCategory(iconName), direction);
|
|
67
66
|
if (baseIconPath) {
|
|
68
|
-
// This check was introduced the following MS-Edge issue:
|
|
69
|
-
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/9655192/
|
|
70
|
-
// If and when this get fixed, we can safely remove this block of code.
|
|
71
|
-
if (isIframeInEdge) {
|
|
72
|
-
// protocol => 'https:' or 'http:'
|
|
73
|
-
// host => hostname + port
|
|
74
|
-
const origin = `${window.location.protocol}//${window.location.host}`;
|
|
75
|
-
return `${origin}${pathPrefix}${baseIconPath}#${getName(
|
|
76
|
-
iconName
|
|
77
|
-
)}`;
|
|
78
|
-
}
|
|
79
67
|
return `${pathPrefix}${baseIconPath}#${getName(iconName)}`;
|
|
80
68
|
}
|
|
81
69
|
}
|
|
@@ -1,93 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
This polyfill
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
rendered on the page, both end up as #image from the doctype sprite (last one
|
|
7
|
-
wins). SLDS cannot change their image IDs due to backwards-compatibility
|
|
8
|
-
reasons so we take care of this issue at runtime by adding namespacing as we
|
|
9
|
-
polyfill SVG elements.
|
|
10
|
-
|
|
11
|
-
For example, given "/assets/icons/action-sprite/svg/symbols.svg#approval", we
|
|
12
|
-
replace the "#approval" id with "#${namespace}-approval" and a similar
|
|
13
|
-
operation is done on the corresponding symbol element.
|
|
2
|
+
This polyfill is no longer needed, since we no longer
|
|
3
|
+
support IE or the non-Chromium versions of Edge
|
|
4
|
+
However, since it's exported to customers we can't
|
|
5
|
+
remove it from our repo entirely
|
|
14
6
|
**/
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
import supportsSvg from './supportsSvg';
|
|
18
|
-
|
|
19
|
-
const svgTagName = /svg/i;
|
|
20
|
-
const isSvgElement = (el) => el && svgTagName.test(el.nodeName);
|
|
21
|
-
|
|
22
|
-
const requestCache = {};
|
|
23
|
-
const symbolEls = {};
|
|
24
|
-
const svgFragments = {};
|
|
25
|
-
|
|
26
|
-
const spritesContainerId = 'slds-svg-sprites';
|
|
27
|
-
let spritesEl;
|
|
28
|
-
|
|
29
|
-
export function polyfill(el) {
|
|
30
|
-
if (!supportsSvg && isSvgElement(el)) {
|
|
31
|
-
if (!spritesEl) {
|
|
32
|
-
spritesEl = document.createElement('svg');
|
|
33
|
-
spritesEl.xmlns = 'http://www.w3.org/2000/svg';
|
|
34
|
-
spritesEl['xmlns:xlink'] = 'http://www.w3.org/1999/xlink';
|
|
35
|
-
spritesEl.style.display = 'none';
|
|
36
|
-
spritesEl.id = spritesContainerId;
|
|
37
|
-
|
|
38
|
-
document.body.insertBefore(spritesEl, document.body.childNodes[0]);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Array.from(el.getElementsByTagName('use')).forEach((use) => {
|
|
42
|
-
// We access the href differently in raptor and in aura, probably
|
|
43
|
-
// due to difference in the way the svg is constructed.
|
|
44
|
-
const src =
|
|
45
|
-
use.getAttribute('xlink:href') || use.getAttribute('href');
|
|
46
|
-
|
|
47
|
-
if (src) {
|
|
48
|
-
// "/assets/icons/action-sprite/svg/symbols.svg#approval" =>
|
|
49
|
-
// ["/assets/icons/action-sprite/svg/symbols.svg", "approval"]
|
|
50
|
-
const parts = src.split('#');
|
|
51
|
-
const url = parts[0];
|
|
52
|
-
const id = parts[1];
|
|
53
|
-
const namespace = url.replace(/[^\w]/g, '-');
|
|
54
|
-
const href = `#${namespace}-${id}`;
|
|
55
|
-
|
|
56
|
-
if (url.length) {
|
|
57
|
-
// set the HREF value to no longer be an external reference
|
|
58
|
-
if (use.getAttribute('xlink:href')) {
|
|
59
|
-
use.setAttribute('xlink:href', href);
|
|
60
|
-
} else {
|
|
61
|
-
use.setAttribute('href', href);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// only insert SVG content if it hasn't already been retrieved
|
|
65
|
-
if (!requestCache[url]) {
|
|
66
|
-
requestCache[url] = fetchSvg(url);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
requestCache[url].then((svgContent) => {
|
|
70
|
-
// create a document fragment from the svgContent returned (is parsed by HTML parser)
|
|
71
|
-
if (!svgFragments[url]) {
|
|
72
|
-
const svgFragment = document
|
|
73
|
-
.createRange()
|
|
74
|
-
.createContextualFragment(svgContent);
|
|
75
|
-
|
|
76
|
-
svgFragments[url] = svgFragment;
|
|
77
|
-
}
|
|
78
|
-
if (!symbolEls[href]) {
|
|
79
|
-
const svgFragment = svgFragments[url];
|
|
80
|
-
const symbolEl = svgFragment.querySelector(
|
|
81
|
-
`#${id}`
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
symbolEls[href] = true;
|
|
85
|
-
symbolEl.id = `${namespace}-${id}`;
|
|
86
|
-
spritesEl.appendChild(symbolEl);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}
|
|
8
|
+
export function polyfill() {}
|
|
@@ -120,8 +120,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
|
|
|
120
120
|
|
|
121
121
|
```css
|
|
122
122
|
:host {
|
|
123
|
-
--
|
|
124
|
-
--
|
|
123
|
+
--slds-c-checkbox-color-background-checked: green;
|
|
124
|
+
--slds-c-checkbox-mark-color-foreground: yellow;
|
|
125
125
|
}
|
|
126
126
|
```
|
|
127
127
|
|
|
@@ -555,7 +555,7 @@ to select a time.
|
|
|
555
555
|
|
|
556
556
|
On mobile devices, this component uses the native time picker, which ignores the `time-style` attribute. The native time picker uses the user's device settings for the input time format.
|
|
557
557
|
|
|
558
|
-
On desktop, this component uses a time picker styled with the Lightning Design System. This picker uses the user's Salesforce locale setting for the time format, either 12-hr time with AM/PM or 24-hr time format. The entered date and time are validated against the user's Salesforce locale format during the `blur` event.
|
|
558
|
+
On desktop, this component uses a time picker styled with the Lightning Design System. This picker uses the user's Salesforce locale setting for the time format, either 12-hr time with AM/PM or 24-hr time format. The entered date and time are validated against the user's Salesforce locale format during the `blur` event.
|
|
559
559
|
|
|
560
560
|
The component uses the attribute `time-style="short"` by default, so the time picker
|
|
561
561
|
displays time without seconds. To display time including seconds, set `time-style="medium"`.
|
|
@@ -596,8 +596,8 @@ To apply custom styling, use the `:host` selector. Use SLDS styling hooks to cus
|
|
|
596
596
|
|
|
597
597
|
```css
|
|
598
598
|
:host {
|
|
599
|
-
--
|
|
600
|
-
--
|
|
599
|
+
--slds-c-checkbox-toggle-switch-color-background: orange;
|
|
600
|
+
--slds-c-checkbox-toggle-color-background-checked: green;
|
|
601
601
|
}
|
|
602
602
|
```
|
|
603
603
|
|
|
@@ -1033,11 +1033,11 @@ This example creates two fields using `lightning-input` in a compound row simila
|
|
|
1033
1033
|
</fieldset>
|
|
1034
1034
|
```
|
|
1035
1035
|
|
|
1036
|
-
To apply custom styling, use the `:host` selector. Use SLDS styling hooks to customize the component's styles. For example, change the background color of the input fields using the `--
|
|
1036
|
+
To apply custom styling, use the `:host` selector. Use SLDS styling hooks to customize the component's styles. For example, change the background color of the input fields using the `--slds-c-input-color-background` custom property.
|
|
1037
1037
|
|
|
1038
1038
|
```css
|
|
1039
1039
|
:host {
|
|
1040
|
-
--
|
|
1040
|
+
--slds-c-input-color-background: orange;
|
|
1041
1041
|
}
|
|
1042
1042
|
```
|
|
1043
1043
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
<h2 class="header">Input Checkbox Button</h2>
|
|
4
4
|
<lightning-input type="checkbox-button" label="Input One" name="input1"></lightning-input>
|
|
5
5
|
<lightning-input type="checkbox-button" label="Input Two" name="input2" checked required></lightning-input>
|
|
6
|
-
<lightning-input type="checkbox-button" label="Input Three" name="input3"
|
|
6
|
+
<lightning-input type="checkbox-button" label="Input Three" name="input3" disabled></lightning-input>
|
|
7
|
+
<lightning-input type="checkbox-button" label="Input Four" name="input3" checked disabled></lightning-input>
|
|
7
8
|
</div>
|
|
8
9
|
</template>
|
|
@@ -19,11 +19,6 @@
|
|
|
19
19
|
<lightning-input type="number" name="input8" required value="5" label="Required number field with a maximum value of 99" max="99"></lightning-input>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
<div>
|
|
23
|
-
<h2>Input Counter</h2>
|
|
24
|
-
<lightning-input type="counter" value="123" label="Input with a Counter"></lightning-input>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
22
|
<div>
|
|
28
23
|
<h2>Live Input Number</h2>
|
|
29
24
|
<lightning-input type="number" name="seven" value={amount} onchange={handleAmountChange} placeholder="type the number of items..." label="Enter a number" ></lightning-input>
|