@brightspace-ui/core 1.196.1 → 1.197.1
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/backdrop/README.md +5 -6
- package/components/backdrop/backdrop.js +3 -0
- package/components/breadcrumbs/breadcrumbs.js +2 -1
- package/components/button/button-icon.js +1 -0
- package/components/button/button-mixin.js +2 -0
- package/components/button/button-subtle.js +1 -0
- package/components/button/button.js +1 -0
- package/components/button/floating-buttons.js +1 -0
- package/components/calendar/calendar.js +1 -1
- package/components/card/card-footer-link.js +12 -2
- package/components/card/card-loading-shimmer.js +1 -0
- package/components/card/card.js +9 -0
- package/components/dialog/dialog-confirm.js +1 -2
- package/components/dialog/dialog-fullscreen.js +4 -5
- package/components/dialog/dialog-mixin.js +2 -0
- package/components/dialog/dialog.js +0 -2
- package/components/dropdown/dropdown-button-subtle.js +3 -3
- package/components/dropdown/dropdown-button.js +2 -0
- package/components/dropdown/dropdown-content-mixin.js +19 -0
- package/components/dropdown/dropdown-content.js +0 -3
- package/components/dropdown/dropdown-context-menu.js +2 -0
- package/components/dropdown/dropdown-menu.js +0 -3
- package/components/dropdown/dropdown-more.js +2 -0
- package/components/dropdown/dropdown-opener-mixin.js +2 -0
- package/components/dropdown/dropdown-tabs.js +0 -3
- package/components/filter/filter-dimension-set-value.js +3 -0
- package/components/filter/filter-dimension-set.js +5 -1
- package/components/form/form-mixin.js +1 -0
- package/components/form/form-native.js +0 -1
- package/components/form/form.js +0 -1
- package/components/icons/images/tier3/rubric-graded.svg +2 -2
- package/components/inputs/input-date-range.js +9 -1
- package/components/inputs/input-date-time-range-to.js +3 -0
- package/components/inputs/input-date-time-range.js +10 -1
- package/components/inputs/input-date-time.js +7 -1
- package/components/inputs/input-date.js +7 -1
- package/components/inputs/input-fieldset.js +3 -0
- package/components/inputs/input-radio-styles.js +2 -1
- package/components/inputs/input-time-range.js +10 -1
- package/components/inputs/input-time.js +6 -1
- package/components/link/README.md +1 -1
- package/components/list/README.md +11 -10
- package/components/list/demo/list-item-custom.js +7 -3
- package/components/list/demo/list-nested.html +6 -62
- package/components/list/list-item-generic-layout.js +85 -14
- package/components/list/list.js +27 -2
- package/components/selection/selection-input.js +4 -2
- package/components/selection/selection-mixin.js +1 -0
- package/components/switch/switch-mixin.js +1 -0
- package/custom-elements.json +47 -90
- package/generated/icons/tier3/rubric-graded.js +3 -2
- package/helpers/focus.js +4 -2
- package/mixins/labelled-mixin.js +1 -0
- package/package.json +1 -1
|
@@ -106,6 +106,7 @@ export const FormMixin = superclass => class extends LocalizeCoreElement(supercl
|
|
|
106
106
|
|
|
107
107
|
if ((isNativeFormElement(ele) || isCustomFormElement(ele)) && e.type !== 'focusout') {
|
|
108
108
|
this._dirty = true;
|
|
109
|
+
/** Dispatched whenever any form element fires an `input` or `change` event. Can be used to track whether the form is dirty or not. */
|
|
109
110
|
this.dispatchEvent(new CustomEvent('d2l-form-dirty'));
|
|
110
111
|
}
|
|
111
112
|
|
|
@@ -8,7 +8,6 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
|
8
8
|
* These interactive controls are submitted using a native HTML form submission.
|
|
9
9
|
* @slot - The native and custom form elements that participate in validation and submission
|
|
10
10
|
* @fires submit - Dispatched when the form is submitted. Cancelling this event will prevent form submission.
|
|
11
|
-
* @fires d2l-form-dirty - Dispatched whenever any form element fires an `input` or `change` event. Can be used to track whether the form is dirty or not.
|
|
12
11
|
*/
|
|
13
12
|
class FormNative extends FormMixin(LitElement) {
|
|
14
13
|
|
package/components/form/form.js
CHANGED
|
@@ -6,7 +6,6 @@ import { FormMixin } from './form-mixin.js';
|
|
|
6
6
|
* A component that can be used to build sections containing interactive controls that are validated and submitted as a group.
|
|
7
7
|
* Values of these interactive controls are aggregated but the user is responsible for handling submission via the @d2l-form-submit event.
|
|
8
8
|
* @slot - The native and custom form elements that participate in validation and submission
|
|
9
|
-
* @fires d2l-form-dirty - Dispatched whenever any form element fires an `input` or `change` event. Can be used to track whether the form is dirty or not.
|
|
10
9
|
*/
|
|
11
10
|
class Form extends FormMixin(LitElement) {
|
|
12
11
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<svg height="30" width="30" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
|
|
2
2
|
<path fill="#494c4e" d="M17.641,17.98l-9.89,11.5a1.488,1.488,0,0,1-1.13.52.277.277,0,0,1-.09-.01.22.22,0,0,1-.08.01,1.509,1.509,0,0,1-1.01-.39l-4.95-4.5a1.5,1.5,0,1,1,2.02-2.22l3.9,3.55,8.95-10.42a1.5,1.5,0,1,1,2.28,1.96Z"/>
|
|
3
|
-
<path fill="#494c4e" d="M26,0H4A4.012,4.012,0,0,0,0,4V20.85a3.5,3.5,0,0,1,1.505-.35A3.492,3.492,0,0,1,2,20.545V16H7v5H3.3a3.439,3.439,0,0,1,.556.411L5.6,23H6.729L9,20.356V16h3.741l1.1-1.282A3.48,3.48,0,0,1,16,13.551V9h5v5H18.3a3.417,3.417,0,0,1,1.547,2H21v5H17.681L14,25.28V28H11.661l-1.72,2H26a4.012,4.012,0,0,0,4-4V4A4.012,4.012,0,0,0,26,0ZM7,14H2V9H7ZM7,7H2V4A2.006,2.006,0,0,1,4,2H7Zm7,7H9V9h5Zm0-7H9V2h5Zm7,21H16V23h5ZM21,7H16V2h5Zm7,19a2.006,2.006,0,0,1-2,2H23V23h5Zm0-5H23V16h5Zm0-7H23V9h5Zm0-7H23V2h3a2.006,2.006,0,0,1,2,2Z"
|
|
4
|
-
</svg>
|
|
3
|
+
<path fill="#494c4e" d="M26,0H4A4.012,4.012,0,0,0,0,4V20.85a3.5,3.5,0,0,1,1.505-.35A3.492,3.492,0,0,1,2,20.545V16H7v5H3.3a3.439,3.439,0,0,1,.556.411L5.6,23H6.729L9,20.356V16h3.741l1.1-1.282A3.48,3.48,0,0,1,16,13.551V9h5v5H18.3a3.417,3.417,0,0,1,1.547,2H21v5H17.681L14,25.28V28H11.661l-1.72,2H26a4.012,4.012,0,0,0,4-4V4A4.012,4.012,0,0,0,26,0ZM7,14H2V9H7ZM7,7H2V4A2.006,2.006,0,0,1,4,2H7Zm7,7H9V9h5Zm0-7H9V2h5Zm7,21H16V23h5ZM21,7H16V2h5Zm7,19a2.006,2.006,0,0,1-2,2H23V23h5Zm0-5H23V16h5Zm0-7H23V9h5Zm0-7H23V2h3a2.006,2.006,0,0,1,2,2Z"/>
|
|
4
|
+
</svg>
|
|
@@ -28,7 +28,7 @@ export function getShiftedEndDate(startValue, endValue, prevStartValue, inclusiv
|
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* A component consisting of two input-date components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's timezone if applicable and must be in ISO 8601 calendar date format ("YYYY-MM-DD").
|
|
31
|
-
* @fires change - Dispatched when there is a change to selected start date or selected end date.
|
|
31
|
+
* @fires change - Dispatched when there is a change to selected start date or selected end date. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar date format (`YYYY-MM-DD`).
|
|
32
32
|
*/
|
|
33
33
|
class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement)))) {
|
|
34
34
|
|
|
@@ -36,14 +36,17 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
36
36
|
return {
|
|
37
37
|
/**
|
|
38
38
|
* Automatically shifts end date when start date changes to keep same range
|
|
39
|
+
* @type {boolean}
|
|
39
40
|
*/
|
|
40
41
|
autoShiftDates: { attribute: 'auto-shift-dates', reflect: true, type: Boolean },
|
|
41
42
|
/**
|
|
42
43
|
* Hides the start and end labels visually
|
|
44
|
+
* @type {boolean}
|
|
43
45
|
*/
|
|
44
46
|
childLabelsHidden: { attribute: 'child-labels-hidden', reflect: true, type: Boolean },
|
|
45
47
|
/**
|
|
46
48
|
* Disables the inputs
|
|
49
|
+
* @type {boolean}
|
|
47
50
|
*/
|
|
48
51
|
disabled: { type: Boolean, reflect: true },
|
|
49
52
|
/**
|
|
@@ -54,6 +57,7 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
54
57
|
endLabel: { attribute: 'end-label', reflect: true, type: String },
|
|
55
58
|
/**
|
|
56
59
|
* Indicates if the end calendar dropdown is open
|
|
60
|
+
* @type {boolean}
|
|
57
61
|
*/
|
|
58
62
|
endOpened: { attribute: 'end-opened', type: Boolean },
|
|
59
63
|
/**
|
|
@@ -63,6 +67,7 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
63
67
|
endValue: { attribute: 'end-value', reflect: true, type: String },
|
|
64
68
|
/**
|
|
65
69
|
* Validates on inclusive range (i.e., it is valid for start and end dates to be equal)
|
|
70
|
+
* @type {boolean}
|
|
66
71
|
*/
|
|
67
72
|
inclusiveDateRange: { attribute: 'inclusive-date-range', reflect: true, type: Boolean },
|
|
68
73
|
/**
|
|
@@ -72,6 +77,7 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
72
77
|
label: { type: String, reflect: true },
|
|
73
78
|
/**
|
|
74
79
|
* Hides the fieldset label visually
|
|
80
|
+
* @type {boolean}
|
|
75
81
|
*/
|
|
76
82
|
labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
|
|
77
83
|
/**
|
|
@@ -86,6 +92,7 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
86
92
|
minValue: { attribute: 'min-value', reflect: true, type: String },
|
|
87
93
|
/**
|
|
88
94
|
* Indicates that values are required
|
|
95
|
+
* @type {boolean}
|
|
89
96
|
*/
|
|
90
97
|
required: { type: Boolean, reflect: true },
|
|
91
98
|
/**
|
|
@@ -96,6 +103,7 @@ class InputDateRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
96
103
|
startLabel: { attribute: 'start-label', reflect: true, type: String },
|
|
97
104
|
/**
|
|
98
105
|
* Indicates if the start calendar dropdown is open
|
|
106
|
+
* @type {boolean}
|
|
99
107
|
*/
|
|
100
108
|
startOpened: { attribute: 'start-opened', type: Boolean },
|
|
101
109
|
/**
|
|
@@ -12,14 +12,17 @@ class InputDateTimeRangeTo extends SkeletonMixin(LocalizeCoreElement(LitElement)
|
|
|
12
12
|
return {
|
|
13
13
|
/**
|
|
14
14
|
* Force block (stacked) range display if true
|
|
15
|
+
* @type {boolean}
|
|
15
16
|
*/
|
|
16
17
|
blockDisplay: { attribute: 'block-display', type: Boolean },
|
|
17
18
|
/**
|
|
18
19
|
* Display localized "to" between the left and right slot contents
|
|
20
|
+
* @type {boolean}
|
|
19
21
|
*/
|
|
20
22
|
displayTo: { attribute: 'display-to', type: Boolean },
|
|
21
23
|
/**
|
|
22
24
|
* Add margin-top for case where there would be a label above the range
|
|
25
|
+
* @type {boolean}
|
|
23
26
|
*/
|
|
24
27
|
topMargin: { attribute: 'top-margin', type: Boolean },
|
|
25
28
|
_blockDisplay: { attribute: false, type: Boolean }
|
|
@@ -59,9 +59,9 @@ export function getShiftedEndDateTime(startValue, endValue, prevStartValue, incl
|
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* A component consisting of two input-date-time components - one for start of range and one for end of range. The time input only appears once a date is selected.
|
|
62
|
-
* @fires change - Dispatched when there is a change to selected start date-time or selected end date-time. "start-value" and "end-value" correspond to the selected values and are formatted in ISO 8601 combined date and time format ("YYYY-MM-DDTHH:mm:ss.sssZ").
|
|
63
62
|
* @slot start - Optional content that would appear below the start input-date-time
|
|
64
63
|
* @slot end - Optional content that would appear below the end input-date-time
|
|
64
|
+
* @fires change - Dispatched when there is a change to selected start date-time or selected end date-time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`).
|
|
65
65
|
*/
|
|
66
66
|
class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement)))) {
|
|
67
67
|
|
|
@@ -69,14 +69,17 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
69
69
|
return {
|
|
70
70
|
/**
|
|
71
71
|
* Automatically shifts end date when start date changes to keep same range. If start and end date are equal, automatically shifts end time when start time changes.
|
|
72
|
+
* @type {boolean}
|
|
72
73
|
*/
|
|
73
74
|
autoShiftDates: { attribute: 'auto-shift-dates', reflect: true, type: Boolean },
|
|
74
75
|
/**
|
|
75
76
|
* Hides the start and end labels visually
|
|
77
|
+
* @type {boolean}
|
|
76
78
|
*/
|
|
77
79
|
childLabelsHidden: { attribute: 'child-labels-hidden', reflect: true, type: Boolean },
|
|
78
80
|
/**
|
|
79
81
|
* Disables the inputs
|
|
82
|
+
* @type {boolean}
|
|
80
83
|
*/
|
|
81
84
|
disabled: { type: Boolean, reflect: true },
|
|
82
85
|
/**
|
|
@@ -87,6 +90,7 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
87
90
|
endLabel: { attribute: 'end-label', reflect: true, type: String },
|
|
88
91
|
/**
|
|
89
92
|
* Indicates if the end date or time dropdown is open
|
|
93
|
+
* @type {boolean}
|
|
90
94
|
*/
|
|
91
95
|
endOpened: { attribute: 'end-opened', type: Boolean },
|
|
92
96
|
/**
|
|
@@ -96,6 +100,7 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
96
100
|
endValue: { attribute: 'end-value', reflect: true, type: String },
|
|
97
101
|
/**
|
|
98
102
|
* Validates on inclusive range (i.e., it is valid for start and end date-times to be equal)
|
|
103
|
+
* @type {boolean}
|
|
99
104
|
*/
|
|
100
105
|
inclusiveDateRange: { attribute: 'inclusive-date-range', reflect: true, type: Boolean },
|
|
101
106
|
/**
|
|
@@ -105,10 +110,12 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
105
110
|
label: { type: String, reflect: true },
|
|
106
111
|
/**
|
|
107
112
|
* Hides the fieldset label visually
|
|
113
|
+
* @type {boolean}
|
|
108
114
|
*/
|
|
109
115
|
labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
|
|
110
116
|
/**
|
|
111
117
|
* Indicates that localization will be handled by the consumer. `*value` will not be converted from/to UTC.
|
|
118
|
+
* @type {boolean}
|
|
112
119
|
*/
|
|
113
120
|
localized: { reflect: true, type: Boolean },
|
|
114
121
|
/**
|
|
@@ -123,6 +130,7 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
123
130
|
minValue: { attribute: 'min-value', reflect: true, type: String },
|
|
124
131
|
/**
|
|
125
132
|
* Indicates that values are required
|
|
133
|
+
* @type {boolean}
|
|
126
134
|
*/
|
|
127
135
|
required: { type: Boolean, reflect: true },
|
|
128
136
|
/**
|
|
@@ -133,6 +141,7 @@ class InputDateTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(Localiz
|
|
|
133
141
|
startLabel: { attribute: 'start-label', reflect: true, type: String },
|
|
134
142
|
/**
|
|
135
143
|
* Indicates if the start date or time dropdown is open
|
|
144
|
+
* @type {boolean}
|
|
136
145
|
*/
|
|
137
146
|
startOpened: { attribute: 'start-opened', type: Boolean },
|
|
138
147
|
/**
|
|
@@ -37,7 +37,7 @@ function _getFormattedDefaultTime(defaultValue) {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* A component that consists of a "<d2l-input-date>" and a "<d2l-input-time>" component. The time input only appears once a date is selected. This component displays the "value" if one is specified, and reflects the selected value when one is selected or entered.
|
|
40
|
-
* @fires change - Dispatched when there is a change to selected date or selected time.
|
|
40
|
+
* @fires change - Dispatched when there is a change to selected date or selected time. `value` corresponds to the selected value and is formatted in ISO 8601 combined date and time format (`YYYY-MM-DDTHH:mm:ss.sssZ`).
|
|
41
41
|
*/
|
|
42
42
|
class InputDateTime extends LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(RtlMixin(LitElement))))) {
|
|
43
43
|
|
|
@@ -45,14 +45,17 @@ class InputDateTime extends LabelledMixin(SkeletonMixin(FormElementMixin(Localiz
|
|
|
45
45
|
return {
|
|
46
46
|
/**
|
|
47
47
|
* Disables the input
|
|
48
|
+
* @type {boolean}
|
|
48
49
|
*/
|
|
49
50
|
disabled: { type: Boolean },
|
|
50
51
|
/**
|
|
51
52
|
* Hides the fieldset label visually
|
|
53
|
+
* @type {boolean}
|
|
52
54
|
*/
|
|
53
55
|
labelHidden: { attribute: 'label-hidden', reflect: true, type: Boolean },
|
|
54
56
|
/**
|
|
55
57
|
* Indicates that localization will be handled by the consumer. `*value` will not be converted from/to UTC.
|
|
58
|
+
* @type {boolean}
|
|
56
59
|
*/
|
|
57
60
|
localized: { reflect: true, type: Boolean },
|
|
58
61
|
/**
|
|
@@ -67,10 +70,12 @@ class InputDateTime extends LabelledMixin(SkeletonMixin(FormElementMixin(Localiz
|
|
|
67
70
|
minValue: { attribute: 'min-value', reflect: true, type: String },
|
|
68
71
|
/**
|
|
69
72
|
* Indicates if the date or time dropdown is open
|
|
73
|
+
* @type {boolean}
|
|
70
74
|
*/
|
|
71
75
|
opened: { type: Boolean },
|
|
72
76
|
/**
|
|
73
77
|
* Indicates that a value is required
|
|
78
|
+
* @type {boolean}
|
|
74
79
|
*/
|
|
75
80
|
required: { type: Boolean, reflect: true },
|
|
76
81
|
/**
|
|
@@ -80,6 +85,7 @@ class InputDateTime extends LabelledMixin(SkeletonMixin(FormElementMixin(Localiz
|
|
|
80
85
|
timeDefaultValue: { attribute: 'time-default-value', reflect: true, type: String },
|
|
81
86
|
/**
|
|
82
87
|
* Value of the input
|
|
88
|
+
* @type {string}
|
|
83
89
|
*/
|
|
84
90
|
value: { type: String },
|
|
85
91
|
_maxValueLocalized: { type: String },
|
|
@@ -25,7 +25,7 @@ export function formatISODateInUserCalDescriptor(val) {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* A component that consists of a text input field for typing a date and an attached calendar (d2l-calendar) dropdown. It displays the "value" if one is specified, or a placeholder if not, and reflects the selected value when one is selected in the calendar or entered in the text input.
|
|
28
|
-
* @fires change - Dispatched when there is a change to selected date.
|
|
28
|
+
* @fires change - Dispatched when there is a change to selected date. `value` corresponds to the selected value and is formatted in ISO 8601 calendar date format (`YYYY-MM-DD`).
|
|
29
29
|
*/
|
|
30
30
|
class InputDate extends LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCoreElement(LitElement)))) {
|
|
31
31
|
|
|
@@ -33,14 +33,17 @@ class InputDate extends LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCor
|
|
|
33
33
|
return {
|
|
34
34
|
/**
|
|
35
35
|
* Disables the input
|
|
36
|
+
* @type {boolean}
|
|
36
37
|
*/
|
|
37
38
|
disabled: { type: Boolean },
|
|
38
39
|
/**
|
|
39
40
|
* Text that appears as a placeholder in the input to reassure users that they can choose not to provide a value (usually not necessary)
|
|
41
|
+
* @type {string}
|
|
40
42
|
*/
|
|
41
43
|
emptyText: { type: String, attribute: 'empty-text' },
|
|
42
44
|
/**
|
|
43
45
|
* Hides the label visually (moves it to the input's "aria-label" attribute)
|
|
46
|
+
* @type {boolean}
|
|
44
47
|
*/
|
|
45
48
|
labelHidden: { type: Boolean, attribute: 'label-hidden' },
|
|
46
49
|
/**
|
|
@@ -60,14 +63,17 @@ class InputDate extends LabelledMixin(SkeletonMixin(FormElementMixin(LocalizeCor
|
|
|
60
63
|
noValidateMinMax: { attribute: 'novalidateminmax', type: Boolean },
|
|
61
64
|
/**
|
|
62
65
|
* Indicates if the calendar dropdown is open
|
|
66
|
+
* @type {boolean}
|
|
63
67
|
*/
|
|
64
68
|
opened: { type: Boolean, reflect: true },
|
|
65
69
|
/**
|
|
66
70
|
* Indicates that a value is required
|
|
71
|
+
* @type {boolean}
|
|
67
72
|
*/
|
|
68
73
|
required: { type: Boolean, reflect: true },
|
|
69
74
|
/**
|
|
70
75
|
* Value of the input
|
|
76
|
+
* @type {string}
|
|
71
77
|
*/
|
|
72
78
|
value: { type: String },
|
|
73
79
|
_hiddenCalendarHeight: { type: Number },
|
|
@@ -15,14 +15,17 @@ class InputFieldset extends SkeletonMixin(RtlMixin(LitElement)) {
|
|
|
15
15
|
return {
|
|
16
16
|
/**
|
|
17
17
|
* REQUIRED: Label for the fieldset
|
|
18
|
+
* @type {string}
|
|
18
19
|
*/
|
|
19
20
|
label: { type: String },
|
|
20
21
|
/**
|
|
21
22
|
* Hides the label visually
|
|
23
|
+
* @type {boolean}
|
|
22
24
|
*/
|
|
23
25
|
labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
|
|
24
26
|
/**
|
|
25
27
|
* Indicates that a value is required for inputs in the fieldset
|
|
28
|
+
* @type {boolean}
|
|
26
29
|
*/
|
|
27
30
|
required: { type: Boolean, reflect: true }
|
|
28
31
|
};
|
|
@@ -33,7 +33,7 @@ export const radioStyles = css`
|
|
|
33
33
|
border-color: var(--d2l-color-galena);
|
|
34
34
|
border-width: 1px;
|
|
35
35
|
}
|
|
36
|
-
.d2l-
|
|
36
|
+
.d2l-input-radio.d2l-hovering,
|
|
37
37
|
.d2l-input-radio:hover,
|
|
38
38
|
.d2l-input-radio:focus,
|
|
39
39
|
.d2l-input-radio-label > input[type="radio"]:hover,
|
|
@@ -47,6 +47,7 @@ export const radioStyles = css`
|
|
|
47
47
|
border-color: var(--d2l-color-cinnabar);
|
|
48
48
|
}
|
|
49
49
|
.d2l-input-radio:disabled,
|
|
50
|
+
.d2l-input-radio.d2l-disabled,
|
|
50
51
|
.d2l-input-radio-label > input[type="radio"]:disabled {
|
|
51
52
|
opacity: 0.5;
|
|
52
53
|
}
|
|
@@ -35,7 +35,7 @@ function getValidISOTimeAtInterval(val, timeInterval) {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* A component consisting of two input-time components - one for start of range and one for end of range. Values specified for these components (through start-value and/or end-value attributes) should be localized to the user's timezone if applicable and must be in ISO 8601 time format ("hh:mm:ss").
|
|
38
|
-
* @fires change - Dispatched when there is a change to selected start time or selected end time.
|
|
38
|
+
* @fires change - Dispatched when there is a change to selected start time or selected end time. `start-value` and `end-value` correspond to the selected values and are formatted in ISO 8601 calendar time format (`hh:mm:ss`).
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCoreElement(LitElement)))) {
|
|
@@ -44,14 +44,17 @@ class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
44
44
|
return {
|
|
45
45
|
/**
|
|
46
46
|
* Automatically shifts end time when start time changes to keep same range
|
|
47
|
+
* @type {boolean}
|
|
47
48
|
*/
|
|
48
49
|
autoShiftTimes: { attribute: 'auto-shift-times', reflect: true, type: Boolean },
|
|
49
50
|
/**
|
|
50
51
|
* Hides the start and end labels visually
|
|
52
|
+
* @type {boolean}
|
|
51
53
|
*/
|
|
52
54
|
childLabelsHidden: { attribute: 'child-labels-hidden', reflect: true, type: Boolean },
|
|
53
55
|
/**
|
|
54
56
|
* Disables the inputs
|
|
57
|
+
* @type {boolean}
|
|
55
58
|
*/
|
|
56
59
|
disabled: { type: Boolean, reflect: true },
|
|
57
60
|
/**
|
|
@@ -62,6 +65,7 @@ class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
62
65
|
endLabel: { attribute: 'end-label', reflect: true, type: String },
|
|
63
66
|
/**
|
|
64
67
|
* Indicates if the end dropdown is open
|
|
68
|
+
* @type {boolean}
|
|
65
69
|
*/
|
|
66
70
|
endOpened: { attribute: 'end-opened', type: Boolean },
|
|
67
71
|
/**
|
|
@@ -71,10 +75,12 @@ class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
71
75
|
endValue: { attribute: 'end-value', reflect: true, type: String },
|
|
72
76
|
/**
|
|
73
77
|
* Rounds typed input up to nearest valid interval time (specified with "time-interval")
|
|
78
|
+
* @type {boolean}
|
|
74
79
|
*/
|
|
75
80
|
enforceTimeIntervals: { attribute: 'enforce-time-intervals', reflect: true, type: Boolean },
|
|
76
81
|
/**
|
|
77
82
|
* Validates on inclusive range (i.e., it is valid for start and end times to be equal)
|
|
83
|
+
* @type {boolean}
|
|
78
84
|
*/
|
|
79
85
|
inclusiveTimeRange: { attribute: 'inclusive-time-range', reflect: true, type: Boolean },
|
|
80
86
|
/**
|
|
@@ -84,10 +90,12 @@ class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
84
90
|
label: { type: String, reflect: true },
|
|
85
91
|
/**
|
|
86
92
|
* Hides the fieldset label visually
|
|
93
|
+
* @type {boolean}
|
|
87
94
|
*/
|
|
88
95
|
labelHidden: { attribute: 'label-hidden', reflect: true, type: Boolean },
|
|
89
96
|
/**
|
|
90
97
|
* Indicates that values are required
|
|
98
|
+
* @type {boolean}
|
|
91
99
|
*/
|
|
92
100
|
required: { type: Boolean, reflect: true },
|
|
93
101
|
/**
|
|
@@ -98,6 +106,7 @@ class InputTimeRange extends SkeletonMixin(FormElementMixin(RtlMixin(LocalizeCor
|
|
|
98
106
|
startLabel: { attribute: 'start-label', reflect: true, type: String },
|
|
99
107
|
/**
|
|
100
108
|
* Indicates if the start dropdown is open
|
|
109
|
+
* @type {boolean}
|
|
101
110
|
*/
|
|
102
111
|
startOpened: { attribute: 'start-opened', type: Boolean },
|
|
103
112
|
/**
|
|
@@ -109,7 +109,7 @@ function initIntervals(size, enforceTimeIntervals) {
|
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* A component that consists of a text input field for typing a time and an attached dropdown for time selection. It displays the "value" if one is specified, or a placeholder if not, and reflects the selected value when one is selected in the dropdown or entered in the text input.
|
|
112
|
-
* @fires change - Dispatched when there is a change to selected time.
|
|
112
|
+
* @fires change - Dispatched when there is a change to selected time. `value` corresponds to the selected value and is formatted in ISO 8601 time format (`hh:mm:ss`).
|
|
113
113
|
*/
|
|
114
114
|
class InputTime extends LabelledMixin(SkeletonMixin(FormElementMixin(LitElement))) {
|
|
115
115
|
|
|
@@ -122,14 +122,17 @@ class InputTime extends LabelledMixin(SkeletonMixin(FormElementMixin(LitElement)
|
|
|
122
122
|
defaultValue: { type: String, attribute: 'default-value' },
|
|
123
123
|
/**
|
|
124
124
|
* Disables the input
|
|
125
|
+
* @type {boolean}
|
|
125
126
|
*/
|
|
126
127
|
disabled: { type: Boolean },
|
|
127
128
|
/**
|
|
128
129
|
* Rounds typed input up to nearest valid interval time (specified with "time-interval")
|
|
130
|
+
* @type {boolean}
|
|
129
131
|
*/
|
|
130
132
|
enforceTimeIntervals: { type: Boolean, attribute: 'enforce-time-intervals' },
|
|
131
133
|
/**
|
|
132
134
|
* Hides the label visually (moves it to the input's "aria-label" attribute)
|
|
135
|
+
* @type {boolean}
|
|
133
136
|
*/
|
|
134
137
|
labelHidden: { type: Boolean, attribute: 'label-hidden' },
|
|
135
138
|
/**
|
|
@@ -139,10 +142,12 @@ class InputTime extends LabelledMixin(SkeletonMixin(FormElementMixin(LitElement)
|
|
|
139
142
|
maxHeight: { type: Number, attribute: 'max-height' },
|
|
140
143
|
/**
|
|
141
144
|
* Indicates if the dropdown is open
|
|
145
|
+
* @type {boolean}
|
|
142
146
|
*/
|
|
143
147
|
opened: { type: Boolean },
|
|
144
148
|
/**
|
|
145
149
|
* Indicates that a value is required
|
|
150
|
+
* @type {boolean}
|
|
146
151
|
*/
|
|
147
152
|
required: { type: Boolean, reflect: true },
|
|
148
153
|
/**
|
|
@@ -69,7 +69,7 @@ To make your usage of `d2l-link` accessible, use the following property when app
|
|
|
69
69
|
|--|--|
|
|
70
70
|
| `aria-label` | Use when text in link does not provide enough context. |
|
|
71
71
|
|
|
72
|
-
## Applying link styles to native
|
|
72
|
+
## Applying link styles to native anchor elements
|
|
73
73
|
|
|
74
74
|
Alternately, you can apply link styles to a native `<a>` element by importing the styles and placing the `d2l-link` CSS class on the element.
|
|
75
75
|
|
|
@@ -15,13 +15,13 @@ A list displays a collection of objects of the same type. A list is primarily us
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<d2l-list style="width: 100%">
|
|
18
|
-
<d2l-list-item>
|
|
18
|
+
<d2l-list-item label="List Item 1">
|
|
19
19
|
<d2l-list-item-content>
|
|
20
20
|
<div>Regular list item</div>
|
|
21
21
|
<div slot="secondary">Secondary information</div>
|
|
22
22
|
</d2l-list-item-content>
|
|
23
23
|
</d2l-list-item>
|
|
24
|
-
<d2l-list-item href="http://www.d2l.com" key="1">
|
|
24
|
+
<d2l-list-item href="http://www.d2l.com" key="1" label="List Item 2">
|
|
25
25
|
<img slot="illustration" src="https://s.brightspace.com/course-images/images/38e839b1-37fa-470c-8830-b189ce4ae134/tile-high-density-max-size.jpg" />
|
|
26
26
|
<d2l-list-item-content>
|
|
27
27
|
<div>More exciting list item</div>
|
|
@@ -38,7 +38,7 @@ A list displays a collection of objects of the same type. A list is primarily us
|
|
|
38
38
|
</d2l-dropdown-more>
|
|
39
39
|
</div>
|
|
40
40
|
</d2l-list-item>
|
|
41
|
-
<d2l-list-item href="http://www.d2l.com" selectable key="2" selected>
|
|
41
|
+
<d2l-list-item href="http://www.d2l.com" selectable key="2" selected label="List Item 3">
|
|
42
42
|
<img slot="illustration" src="https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg">
|
|
43
43
|
<d2l-list-item-content>
|
|
44
44
|
<div>Selectable list item (selected)</div>
|
|
@@ -115,14 +115,14 @@ The `d2l-list` is the container to create a styled list of items using `d2l-list
|
|
|
115
115
|
</script>
|
|
116
116
|
|
|
117
117
|
<d2l-list style="width: 100%">
|
|
118
|
-
<d2l-list-item selectable>
|
|
118
|
+
<d2l-list-item selectable label="List Item 1">
|
|
119
119
|
<d2l-list-item-content>
|
|
120
120
|
<div>Regular list item</div>
|
|
121
121
|
<div slot="secondary">Secondary information</div>
|
|
122
122
|
<div slot="supporting-info">Supporting information</div>
|
|
123
123
|
</d2l-list-item-content>
|
|
124
124
|
</d2l-list-item>
|
|
125
|
-
<d2l-list-item selectable>
|
|
125
|
+
<d2l-list-item selectable label="List Item 2">
|
|
126
126
|
<d2l-list-item-content>
|
|
127
127
|
<div>Regular list item 2</div>
|
|
128
128
|
<div slot="secondary">Secondary information</div>
|
|
@@ -152,6 +152,7 @@ The `d2l-list` is the container to create a styled list of items using `d2l-list
|
|
|
152
152
|
|
|
153
153
|
- `getListItemCount`: returns the length of the items within the list
|
|
154
154
|
- `getListItemIndex` (Object): returns the index of the given element within the list
|
|
155
|
+
- `getSelectedListItems` (Array): returns the selected items; pass `true` to include nested lists
|
|
155
156
|
- `getSelectionInfo` (Object): returns a `SelectionInfo` object containing the `state` (`none`, `some`, `all`), and the `keys` (Array) for the selected items
|
|
156
157
|
|
|
157
158
|
## Selection Lists
|
|
@@ -244,7 +245,7 @@ Here is a simple component example that adds drag 'n' drop to a list:
|
|
|
244
245
|
render() {
|
|
245
246
|
const listItems = this.list.map((item) => {
|
|
246
247
|
return html`
|
|
247
|
-
<d2l-list-item draggable key="${item.key}">
|
|
248
|
+
<d2l-list-item draggable key="${item.key}" label="Draggable List Item">
|
|
248
249
|
<d2l-list-item-content>
|
|
249
250
|
${item.content}
|
|
250
251
|
<div slot="secondary">Secondary information</div>
|
|
@@ -299,7 +300,7 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
|
|
|
299
300
|
<div slot="supporting-info">Supporting information</div>
|
|
300
301
|
</d2l-list-item-content>
|
|
301
302
|
</d2l-list-item>
|
|
302
|
-
<d2l-list-item selectable key="ast" label="
|
|
303
|
+
<d2l-list-item selectable key="ast" label="Astronomy">
|
|
303
304
|
<d2l-list-item-content>
|
|
304
305
|
<div>Astronomy</div>
|
|
305
306
|
<div slot="supporting-info">Supporting information</div>
|
|
@@ -334,7 +335,7 @@ The `d2l-list-item` provides the appropriate `listitem` semantics for children w
|
|
|
334
335
|
</script>
|
|
335
336
|
|
|
336
337
|
<d2l-list>
|
|
337
|
-
<d2l-list-item href="http://www.d2l.com" selectable key="3">
|
|
338
|
+
<d2l-list-item href="http://www.d2l.com" selectable key="3" label="Geomorphology and GIS">
|
|
338
339
|
<img slot="illustration" src="https://s.brightspace.com/course-images/images/63b162ab-b582-4bf9-8c1d-1dad04714121/tile-high-density-max-size.jpg" />
|
|
339
340
|
<d2l-list-item-content>
|
|
340
341
|
<div>Geomorphology and GIS </div>
|
|
@@ -432,7 +433,7 @@ The `d2l-list-item-button` provides the same functionality as `d2l-list-item` ex
|
|
|
432
433
|
</script>
|
|
433
434
|
|
|
434
435
|
<d2l-list style="width: 100%">
|
|
435
|
-
<d2l-list-item-button href="http://www.d2l.com" selectable key="1">
|
|
436
|
+
<d2l-list-item-button href="http://www.d2l.com" selectable key="1" label="Geomorphology and GIS">
|
|
436
437
|
<d2l-list-item-content>
|
|
437
438
|
<div>Geomorphology and GIS </div>
|
|
438
439
|
<div slot="supporting-info">This course explores the geological processes of the Earth's interior and surface. These include volcanism, earthquakes, mountain...</div>
|
|
@@ -464,7 +465,7 @@ The `d2l-list-item-content` provides additional consistent layout for primary an
|
|
|
464
465
|
</script>
|
|
465
466
|
|
|
466
467
|
<d2l-list style="width: 100%">
|
|
467
|
-
<d2l-list-item>
|
|
468
|
+
<d2l-list-item label="List Item 1">
|
|
468
469
|
<d2l-list-item-content>
|
|
469
470
|
<div>Item 1</div>
|
|
470
471
|
<div slot="secondary">Secondary Info for item 1</div>
|
|
@@ -32,7 +32,7 @@ const demoData = {
|
|
|
32
32
|
'L3-1': {
|
|
33
33
|
primaryText: 'Glaciation (L3)',
|
|
34
34
|
supportingText: 'Supporting Info',
|
|
35
|
-
nested: [ 'L4-1' ]
|
|
35
|
+
nested: [ 'L4-1', 'L4-2' ]
|
|
36
36
|
},
|
|
37
37
|
'L3-2': {
|
|
38
38
|
primaryText: 'Weathering (L3)',
|
|
@@ -45,7 +45,11 @@ const demoData = {
|
|
|
45
45
|
'L4-1': {
|
|
46
46
|
primaryText: 'Ice Sheets',
|
|
47
47
|
supportingText: 'Supporting Info',
|
|
48
|
-
nested: [ 'L5-1'
|
|
48
|
+
nested: [ /*'L5-1', 'L5-2', 'L5-3', 'L5-4', 'L5-5'*/ ]
|
|
49
|
+
},
|
|
50
|
+
'L4-2': {
|
|
51
|
+
primaryText: 'Alpine Glaciers',
|
|
52
|
+
supportingText: 'Supporting Info'
|
|
49
53
|
},
|
|
50
54
|
'L5-1': {
|
|
51
55
|
primaryText: 'Topic L5-1',
|
|
@@ -178,7 +182,7 @@ class DemoListItemCustom extends ListItemMixin(LitElement) {
|
|
|
178
182
|
|
|
179
183
|
if (demoData[this.key].nested && demoData[this.key].nested.length > 0) {
|
|
180
184
|
itemTemplates.nested = html`
|
|
181
|
-
<d2l-list separators="all">
|
|
185
|
+
<d2l-list grid separators="all">
|
|
182
186
|
${demoData[this.key].nested.map(itemKey => html`<d2l-demo-list-item-custom selectable key="${itemKey}"></d2l-demo-list-item-custom>`)}
|
|
183
187
|
</d2l-list>
|
|
184
188
|
`;
|