@brightspace-ui/core 3.267.1 → 3.267.3
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/components/alert/alert-toast.js +98 -102
- package/components/alert/alert.js +109 -113
- package/components/backdrop/backdrop-dirty-overlay.js +13 -17
- package/components/backdrop/backdrop-loading.js +105 -109
- package/components/backdrop/backdrop.js +50 -54
- package/components/breadcrumbs/breadcrumb-current-page.js +19 -23
- package/components/breadcrumbs/breadcrumb.js +50 -54
- package/components/breadcrumbs/breadcrumbs.js +34 -38
- package/components/button/button-add.js +156 -164
- package/components/button/button-copy-mixin.js +9 -11
- package/components/button/button-copy.js +15 -19
- package/components/button/button-icon.js +110 -114
- package/components/button/button-move.js +153 -157
- package/components/button/button-split-item.js +16 -20
- package/components/button/button-split.js +70 -74
- package/components/button/button-subtle-copy.js +17 -19
- package/components/button/button-subtle.js +145 -149
- package/components/button/button-toggle.js +25 -29
- package/components/button/button.js +70 -74
- package/components/button/floating-buttons.js +63 -67
- package/components/calendar/calendar.js +244 -248
- package/components/card/card-content-meta.js +13 -15
- package/components/card/card-content-title.js +9 -11
- package/components/card/card-footer-link.js +76 -80
- package/components/card/card-loading-shimmer.js +35 -39
- package/components/card/card.js +188 -192
- package/components/collapsible-panel/collapsible-panel-group.js +17 -21
- package/components/collapsible-panel/collapsible-panel-summary-item.js +27 -31
- package/components/collapsible-panel/collapsible-panel.js +258 -262
- package/components/count-badge/count-badge-icon.js +12 -16
- package/components/count-badge/count-badge-mixin.js +124 -128
- package/components/count-badge/count-badge.js +2 -4
- package/components/description-list/description-list-wrapper.js +27 -31
- package/components/dialog/dialog-confirm.js +55 -59
- package/components/dialog/dialog-fullscreen.js +128 -132
- package/components/dialog/dialog-mixin.js +39 -41
- package/components/dialog/dialog.js +61 -65
- package/components/dropdown/dropdown-button-subtle.js +21 -25
- package/components/dropdown/dropdown-button.js +31 -35
- package/components/dropdown/dropdown-context-menu.js +28 -31
- package/components/dropdown/dropdown-menu.js +27 -31
- package/components/dropdown/dropdown-more.js +23 -26
- package/components/dropdown/dropdown-opener-mixin.js +44 -46
- package/components/dropdown/dropdown-popover-mixin.js +155 -159
- package/components/dropdown/dropdown-tabs.js +5 -7
- package/components/dropdown/dropdown.js +1 -3
- package/components/empty-state/empty-state-action-button.js +18 -22
- package/components/empty-state/empty-state-action-link.js +14 -18
- package/components/empty-state/empty-state-illustrated.js +21 -25
- package/components/empty-state/empty-state-simple.js +8 -12
- package/components/expand-collapse/expand-collapse-content.js +48 -52
- package/components/filter/filter-dimension-set-date-text-value.js +34 -36
- package/components/filter/filter-dimension-set-date-time-range-value.js +45 -47
- package/components/filter/filter-dimension-set-empty-state.js +17 -19
- package/components/filter/filter-dimension-set-value.js +27 -29
- package/components/filter/filter-dimension-set.js +65 -67
- package/components/filter/filter-overflow-group.js +15 -19
- package/components/filter/filter-tags.js +16 -19
- package/components/filter/filter.js +115 -119
- package/components/focus-trap/focus-trap.js +17 -21
- package/components/form/form-element-mixin.js +33 -35
- package/components/form/form-error-summary.js +37 -42
- package/components/form/form.js +33 -37
- package/components/hierarchical-view/hierarchical-view-mixin.js +76 -80
- package/components/hierarchical-view/hierarchical-view.js +5 -7
- package/components/html-block/html-block.js +45 -49
- package/components/icons/icon-custom.js +20 -24
- package/components/icons/icon.js +20 -24
- package/components/icons/slotted-icon-mixin.js +16 -18
- package/components/inputs/input-checkbox-group.js +34 -38
- package/components/inputs/input-checkbox.js +106 -110
- package/components/inputs/input-color.js +142 -148
- package/components/inputs/input-date-range.js +90 -94
- package/components/inputs/input-date-time-range-to.js +70 -74
- package/components/inputs/input-date-time-range.js +110 -115
- package/components/inputs/input-date-time.js +75 -79
- package/components/inputs/input-date.js +101 -105
- package/components/inputs/input-fieldset.js +37 -43
- package/components/inputs/input-group.js +10 -12
- package/components/inputs/input-inline-help.js +4 -6
- package/components/inputs/input-number.js +112 -118
- package/components/inputs/input-percent.js +52 -58
- package/components/inputs/input-radio-group.js +45 -49
- package/components/inputs/input-radio-spacer.js +11 -13
- package/components/inputs/input-radio.js +62 -66
- package/components/inputs/input-search.js +63 -68
- package/components/inputs/input-text.js +245 -251
- package/components/inputs/input-textarea.js +128 -132
- package/components/inputs/input-time-range.js +100 -104
- package/components/inputs/input-time.js +107 -113
- package/components/link/link-mixin.js +37 -41
- package/components/link/link.js +113 -119
- package/components/list/list-controls.js +25 -29
- package/components/list/list-item-button-mixin.js +10 -12
- package/components/list/list-item-checkbox-mixin.js +35 -37
- package/components/list/list-item-content.js +33 -35
- package/components/list/list-item-drag-drop-mixin.js +45 -47
- package/components/list/list-item-drag-handle.js +80 -84
- package/components/list/list-item-drag-image.js +77 -81
- package/components/list/list-item-expand-collapse-mixin.js +17 -19
- package/components/list/list-item-generic-layout.js +222 -226
- package/components/list/list-item-link-mixin.js +10 -12
- package/components/list/list-item-mixin.js +68 -70
- package/components/list/list-item-nav-mixin.js +17 -19
- package/components/list/list-item-placement-marker.js +65 -67
- package/components/list/list-item-role-mixin.js +9 -11
- package/components/list/list-item.js +7 -9
- package/components/list/list.js +121 -125
- package/components/loading-spinner/loading-spinner.js +93 -97
- package/custom-elements.json +1920 -6694
- package/package.json +3 -2
|
@@ -80,124 +80,118 @@ function roundPrecisely(val, maxFractionDigits) {
|
|
|
80
80
|
*/
|
|
81
81
|
class InputNumber extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
|
|
82
82
|
|
|
83
|
-
static
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
d2l-input-text:not([skeleton]) {
|
|
196
|
-
width: auto;
|
|
197
|
-
}
|
|
198
|
-
`
|
|
199
|
-
];
|
|
200
|
-
}
|
|
83
|
+
static properties = {
|
|
84
|
+
/**
|
|
85
|
+
* Specifies which types of values [can be autofilled](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) by the browser.
|
|
86
|
+
* @type {string}
|
|
87
|
+
*/
|
|
88
|
+
autocomplete: { type: String },
|
|
89
|
+
/**
|
|
90
|
+
* @ignore
|
|
91
|
+
*/
|
|
92
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
93
|
+
autofocus: { type: Boolean },
|
|
94
|
+
/**
|
|
95
|
+
* Disables the input
|
|
96
|
+
* @type {boolean}
|
|
97
|
+
*/
|
|
98
|
+
disabled: { type: Boolean },
|
|
99
|
+
/**
|
|
100
|
+
* ADVANCED: Hide the alert icon when input is invalid
|
|
101
|
+
* @type {boolean}
|
|
102
|
+
*/
|
|
103
|
+
hideInvalidIcon: { attribute: 'hide-invalid-icon', type: Boolean, reflect: true },
|
|
104
|
+
/**
|
|
105
|
+
* Restricts the maximum width of the input box without restricting the width of the label
|
|
106
|
+
* @type {string}
|
|
107
|
+
*/
|
|
108
|
+
inputWidth: { attribute: 'input-width', type: String },
|
|
109
|
+
/**
|
|
110
|
+
* Hides the label visually. Hidden labels are still read by screen readers so make sure to set an appropriate label.
|
|
111
|
+
* @type {boolean}
|
|
112
|
+
*/
|
|
113
|
+
labelHidden: { type: Boolean, attribute: 'label-hidden' },
|
|
114
|
+
/**
|
|
115
|
+
* Maximum value allowed
|
|
116
|
+
* @type {number}
|
|
117
|
+
*/
|
|
118
|
+
max: { type: Number },
|
|
119
|
+
/**
|
|
120
|
+
* Indicates whether the max value is exclusive
|
|
121
|
+
* @type {boolean}
|
|
122
|
+
*/
|
|
123
|
+
maxExclusive: { type: Boolean, attribute: 'max-exclusive' },
|
|
124
|
+
/**
|
|
125
|
+
* Maximum number of digits allowed after the decimal place. Must be between 0 and 20 and greater than or equal to `minFractionDigits`. Default is Greater of `minFractionDigits` or `3`.
|
|
126
|
+
* @type {number}
|
|
127
|
+
*/
|
|
128
|
+
maxFractionDigits: { type: Number, attribute: 'max-fraction-digits' },
|
|
129
|
+
/**
|
|
130
|
+
* Minimum value allowed
|
|
131
|
+
* @type {number}
|
|
132
|
+
*/
|
|
133
|
+
min: { type: Number },
|
|
134
|
+
/**
|
|
135
|
+
* Indicates whether the min value is exclusive
|
|
136
|
+
* @type {boolean}
|
|
137
|
+
*/
|
|
138
|
+
minExclusive: { type: Boolean, attribute: 'min-exclusive' },
|
|
139
|
+
/**
|
|
140
|
+
* Minimum number of digits allowed after the decimal place. Must be between 0 and 20 and less than or equal to `maxFractionDigits`. Default is `0`.
|
|
141
|
+
* @type {number}
|
|
142
|
+
*/
|
|
143
|
+
minFractionDigits: { type: Number, attribute: 'min-fraction-digits' },
|
|
144
|
+
/**
|
|
145
|
+
* Indicates that a value is required
|
|
146
|
+
* @type {boolean}
|
|
147
|
+
*/
|
|
148
|
+
required: { type: Boolean },
|
|
149
|
+
/**
|
|
150
|
+
* @ignore
|
|
151
|
+
*/
|
|
152
|
+
trailingZeroes: { type: Boolean, attribute: 'trailing-zeroes' },
|
|
153
|
+
/**
|
|
154
|
+
* Unit associated with the input value, displayed next to input and announced as part of the label
|
|
155
|
+
* @type {string}
|
|
156
|
+
*/
|
|
157
|
+
unit: { type: String },
|
|
158
|
+
/**
|
|
159
|
+
* ACCESSIBILITY: Label for the unit, which is only picked up by screenreaders. Required if `unit` is used.
|
|
160
|
+
* @type {string}
|
|
161
|
+
*/
|
|
162
|
+
unitLabel: { attribute: 'unit-label', type: String },
|
|
163
|
+
/**
|
|
164
|
+
* Value of the input
|
|
165
|
+
* @type {number}
|
|
166
|
+
*/
|
|
167
|
+
value: { type: Number, converter: numberConverter },
|
|
168
|
+
/**
|
|
169
|
+
* Alignment of the value text within the input
|
|
170
|
+
* @type {'start'|'end'}
|
|
171
|
+
*/
|
|
172
|
+
valueAlign: { attribute: 'value-align', type: String },
|
|
173
|
+
/**
|
|
174
|
+
* @ignore
|
|
175
|
+
*/
|
|
176
|
+
valueTrailingZeroes: { type: String, attribute: 'value-trailing-zeroes' },
|
|
177
|
+
_afterSlotWidth: { state: true },
|
|
178
|
+
_hintType: { state: true },
|
|
179
|
+
_formattedValue: { state: true }
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
static styles = [super.styles, css`
|
|
183
|
+
:host {
|
|
184
|
+
display: inline-block;
|
|
185
|
+
position: var(--d2l-input-position, relative); /* overridden by sticky headers in grades */
|
|
186
|
+
width: 100%;
|
|
187
|
+
}
|
|
188
|
+
:host([hidden]) {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
d2l-input-text:not([skeleton]) {
|
|
192
|
+
width: auto;
|
|
193
|
+
}
|
|
194
|
+
`];
|
|
201
195
|
|
|
202
196
|
constructor() {
|
|
203
197
|
super();
|
|
@@ -15,65 +15,59 @@ import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
|
15
15
|
*/
|
|
16
16
|
class InputPercent extends FocusMixin(LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement))))) {
|
|
17
17
|
|
|
18
|
-
static
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
}
|
|
18
|
+
static properties = {
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
// eslint-disable-next-line lit/no-native-attributes
|
|
23
|
+
autofocus: { type: Boolean },
|
|
24
|
+
/**
|
|
25
|
+
* Disables the input
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
disabled: { type: Boolean },
|
|
29
|
+
/**
|
|
30
|
+
* Restricts the maximum width of the input box without restricting the width of the label.
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
inputWidth: { attribute: 'input-width', type: String },
|
|
34
|
+
/**
|
|
35
|
+
* Hides the label visually. Hidden labels are still read by screen readers so make sure to set an appropriate label.
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
*/
|
|
38
|
+
labelHidden: { type: Boolean, attribute: 'label-hidden' },
|
|
39
|
+
/**
|
|
40
|
+
* Maximum number of decimal values to show (rounds value up or down).
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
maxFractionDigits: { type: Number, attribute: 'max-fraction-digits' },
|
|
44
|
+
/**
|
|
45
|
+
* Minimum number of decimal values to show.
|
|
46
|
+
* @type {number}
|
|
47
|
+
*/
|
|
48
|
+
minFractionDigits: { type: Number, attribute: 'min-fraction-digits' },
|
|
49
|
+
/**
|
|
50
|
+
* Indicates that a value is required
|
|
51
|
+
* @type {boolean}
|
|
52
|
+
*/
|
|
53
|
+
required: { type: Boolean },
|
|
54
|
+
/**
|
|
55
|
+
* Value of the input
|
|
56
|
+
* @type {number}
|
|
57
|
+
*/
|
|
58
|
+
value: { type: Number }
|
|
59
|
+
};
|
|
62
60
|
|
|
63
|
-
static
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
`
|
|
75
|
-
];
|
|
76
|
-
}
|
|
61
|
+
static styles = [super.styles, css`
|
|
62
|
+
:host {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 100%;
|
|
66
|
+
}
|
|
67
|
+
:host([hidden]) {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
`];
|
|
77
71
|
|
|
78
72
|
constructor() {
|
|
79
73
|
super();
|
|
@@ -13,57 +13,53 @@ import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
|
|
|
13
13
|
*/
|
|
14
14
|
class InputRadioGroup extends PropertyRequiredMixin(SkeletonMixin(FormElementMixin(LitElement))) {
|
|
15
15
|
|
|
16
|
-
static
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
}
|
|
16
|
+
static properties = {
|
|
17
|
+
/**
|
|
18
|
+
* Display the radio buttons horizontally
|
|
19
|
+
* @type {boolean}
|
|
20
|
+
*/
|
|
21
|
+
horizontal: { type: Boolean, reflect: true },
|
|
22
|
+
/**
|
|
23
|
+
* REQUIRED: Label for the group of radio inputs
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
label: { required: true, type: String },
|
|
27
|
+
/**
|
|
28
|
+
* Hides the label visually
|
|
29
|
+
* @type {boolean}
|
|
30
|
+
*/
|
|
31
|
+
labelHidden: { attribute: 'label-hidden', reflect: true, type: Boolean },
|
|
32
|
+
/**
|
|
33
|
+
* Indicates that a value is required
|
|
34
|
+
* @type {boolean}
|
|
35
|
+
*/
|
|
36
|
+
required: { type: Boolean, reflect: true }
|
|
37
|
+
};
|
|
40
38
|
|
|
41
|
-
static
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
39
|
+
static styles = [super.styles, inputLabelStyles, css`
|
|
40
|
+
:host {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
:host([hidden]) {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
div[role="radiogroup"] {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 0.6rem;
|
|
50
|
+
}
|
|
51
|
+
:host([horizontal]) div[role="radiogroup"] {
|
|
52
|
+
flex-direction: row;
|
|
53
|
+
flex-wrap: wrap;
|
|
54
|
+
}
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
56
|
+
.d2l-input-label[hidden] {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
::slotted(:not(d2l-input-radio)) {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
`];
|
|
67
63
|
|
|
68
64
|
constructor() {
|
|
69
65
|
super();
|
|
@@ -6,19 +6,17 @@ import { css, html, LitElement } from 'lit';
|
|
|
6
6
|
*/
|
|
7
7
|
class InputRadioSpacer extends LitElement {
|
|
8
8
|
|
|
9
|
-
static
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`;
|
|
21
|
-
}
|
|
9
|
+
static styles = css`
|
|
10
|
+
:host {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: block;
|
|
13
|
+
margin-bottom: 0.9rem;
|
|
14
|
+
padding-inline-start: 1.7rem;
|
|
15
|
+
}
|
|
16
|
+
:host(.d2l-input-inline-help) {
|
|
17
|
+
margin-bottom: 0.9rem !important;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
22
20
|
|
|
23
21
|
render() {
|
|
24
22
|
return html`<slot></slot>`;
|
|
@@ -18,73 +18,69 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
18
18
|
*/
|
|
19
19
|
class InputRadio extends InputInlineHelpMixin(SkeletonMixin(FocusMixin(PropertyRequiredMixin(LitElement)))) {
|
|
20
20
|
|
|
21
|
-
static
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
}
|
|
21
|
+
static properties = {
|
|
22
|
+
/**
|
|
23
|
+
* Checked state
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
*/
|
|
26
|
+
checked: { type: Boolean, reflect: true },
|
|
27
|
+
/**
|
|
28
|
+
* ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
description: { type: String },
|
|
32
|
+
/**
|
|
33
|
+
* Disables the input
|
|
34
|
+
* @type {boolean}
|
|
35
|
+
*/
|
|
36
|
+
disabled: { type: Boolean, reflect: true },
|
|
37
|
+
/**
|
|
38
|
+
* Tooltip text displayed when the input is disabled
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
disabledTooltip: { type: String, attribute: 'disabled-tooltip' },
|
|
42
|
+
/**
|
|
43
|
+
* REQUIRED: Label for the input
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
label: { required: true, type: String },
|
|
47
|
+
/**
|
|
48
|
+
* Hides the supporting slot when unchecked
|
|
49
|
+
* @type {boolean}
|
|
50
|
+
*/
|
|
51
|
+
supportingHiddenWhenUnchecked: { type: Boolean, attribute: 'supporting-hidden-when-unchecked', reflect: true },
|
|
52
|
+
/**
|
|
53
|
+
* Value of the input
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
value: { type: String },
|
|
57
|
+
_checked: { state: true },
|
|
58
|
+
_focusable: { state: true },
|
|
59
|
+
_hasSupporting: { state: true },
|
|
60
|
+
_horizontal: { state: true },
|
|
61
|
+
_isHovered: { state: true },
|
|
62
|
+
_invalid: { state: true }
|
|
63
|
+
};
|
|
66
64
|
|
|
67
|
-
static
|
|
68
|
-
|
|
69
|
-
:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`];
|
|
87
|
-
}
|
|
65
|
+
static styles = [super.styles, radioStyles, css`
|
|
66
|
+
:host {
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
:host([hidden]) {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
.d2l-input-radio-label {
|
|
73
|
+
cursor: default;
|
|
74
|
+
margin-block-end: 0;
|
|
75
|
+
}
|
|
76
|
+
.d2l-input-inline-help,
|
|
77
|
+
.d2l-input-radio-supporting {
|
|
78
|
+
margin-inline-start: 1.7rem;
|
|
79
|
+
}
|
|
80
|
+
.d2l-input-radio-supporting {
|
|
81
|
+
margin-block-start: 0.6rem;
|
|
82
|
+
}
|
|
83
|
+
`];
|
|
88
84
|
|
|
89
85
|
constructor() {
|
|
90
86
|
super();
|