@brightspace-ui/core 3.268.0 → 3.268.2
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/collapsible-panel/README.md +11 -15
- package/components/demo/code-view.js +6 -10
- package/components/demo/demo-page-settings.js +25 -29
- package/components/demo/demo-page.js +32 -36
- package/components/demo/demo-snippet.js +95 -99
- package/components/description-list/README.md +25 -33
- package/components/description-list/demo/description-list-test.js +36 -39
- package/components/dialog/README.md +3 -5
- package/components/form/docs/form-element-mixin.md +11 -14
- package/components/form/docs/form-element-nesting.md +4 -6
- package/components/form/docs/form-element-wrapping.md +1 -3
- package/components/hierarchical-view/README.md +8 -11
- package/components/inputs/docs/input-select-styles.md +4 -9
- package/components/inputs/docs/styling-native-inputs.md +11 -25
- package/components/link/README.md +1 -1
- package/components/list/README.md +8 -16
- package/components/menu/menu-item-checkbox.js +1 -3
- package/components/menu/menu-item-link.js +27 -33
- package/components/menu/menu-item-mixin.js +52 -54
- package/components/menu/menu-item-radio.js +1 -3
- package/components/menu/menu-item-return.js +18 -22
- package/components/menu/menu-item-selectable-mixin.js +12 -14
- package/components/menu/menu-item-separator.js +9 -11
- package/components/menu/menu-item.js +11 -15
- package/components/menu/menu.js +50 -54
- package/components/meter/meter-circle.js +3 -4
- package/components/meter/meter-linear.js +86 -88
- package/components/meter/meter-mixin.js +34 -36
- package/components/meter/meter-radial.js +3 -4
- package/components/more-less/more-less.js +57 -61
- package/components/object-property-list/object-property-list-item-link.js +18 -19
- package/components/object-property-list/object-property-list-item-tooltip-help.js +8 -9
- package/components/object-property-list/object-property-list-item.js +52 -55
- package/components/object-property-list/object-property-list.js +24 -27
- package/components/offscreen/README.md +1 -1
- package/components/offscreen/offscreen.js +13 -15
- package/components/offscreen/screen-reader-pause.js +1 -3
- package/components/overflow-group/README.md +1 -3
- package/components/overflow-group/overflow-group-mixin.js +55 -59
- package/components/overflow-group/overflow-group.js +38 -42
- package/components/page/page-header-button.js +41 -45
- package/components/page/page-header-custom.js +108 -112
- package/components/page/page-header-immersive.js +65 -69
- package/components/page/page-header-separator.js +12 -14
- package/components/paging/pageable-mixin.js +3 -5
- package/components/paging/pageable-subscriber-mixin.js +8 -10
- package/components/paging/pager-load-more.js +47 -51
- package/components/popover/popover-mixin.js +186 -190
- package/components/progress/progress.js +160 -164
- package/components/scroll-wrapper/scroll-wrapper.js +109 -113
- package/components/selection/README.md +5 -7
- package/components/selection/demo/demo-selection.js +5 -7
- package/components/selection/selection-action-dropdown.js +9 -13
- package/components/selection/selection-action-menu-item.js +11 -15
- package/components/selection/selection-action.js +20 -24
- package/components/selection/selection-controls.js +92 -96
- package/components/selection/selection-input.js +40 -44
- package/components/selection/selection-mixin.js +11 -13
- package/components/selection/selection-observer-mixin.js +14 -16
- package/components/selection/selection-select-all-pages.js +8 -10
- package/components/selection/selection-select-all.js +16 -20
- package/components/selection/selection-summary.js +18 -22
- package/components/skeleton/README.md +2 -6
- package/components/skeleton/skeleton-group-mixin.js +3 -5
- package/components/skeleton/skeleton-mixin.js +7 -9
- package/components/skip-nav/skip-nav-custom.js +33 -37
- package/components/sorting/sort.js +11 -13
- package/components/status-indicator/status-indicator.js +75 -79
- package/components/switch/switch-mixin.js +145 -149
- package/components/switch/switch-visibility.js +11 -15
- package/components/switch/switch.js +5 -7
- package/components/table/README.md +19 -37
- package/components/table/demo/table-test.js +27 -31
- package/components/table/table-col-sort-button-item.js +1 -3
- package/components/table/table-col-sort-button.js +105 -109
- package/components/table/table-controls.js +18 -21
- package/components/table/table-wrapper.js +124 -128
- package/components/tabs/tab-internal.js +72 -76
- package/components/tabs/tab-mixin.js +22 -24
- package/components/tabs/tab-panel-mixin.js +47 -51
- package/components/tabs/tab.js +7 -9
- package/components/tabs/tabs.js +171 -175
- package/components/tag-list/tag-list-item-mixin.js +103 -107
- package/components/tag-list/tag-list-item.js +13 -15
- package/components/tag-list/tag-list.js +54 -58
- package/components/tooltip/tooltip-help.js +67 -71
- package/components/tooltip/tooltip.js +103 -107
- package/components/typography/README.md +5 -7
- package/components/validation/validation-custom-mixin.js +4 -6
- package/components/view-switcher/view-switcher-button.js +42 -46
- package/components/view-switcher/view-switcher.js +26 -29
- package/controllers/subscriber/README.md +7 -11
- package/custom-elements.json +1026 -3850
- package/helpers/flags.js +7 -1
- package/mixins/arrow-keys/arrow-keys-mixin.js +10 -12
- package/mixins/async-container/async-container-mixin.js +10 -12
- package/mixins/collection/collection-mixin.js +7 -9
- package/mixins/interactive/interactive-mixin.js +10 -14
- package/mixins/labelled/README.md +3 -5
- package/mixins/labelled/labelled-mixin.js +26 -30
- package/mixins/provider/README.md +5 -7
- package/mixins/rtl/README.md +5 -7
- package/mixins/rtl/rtl-mixin.js +7 -9
- package/mixins/theme/theme-mixin.js +6 -8
- package/mixins/visible-on-ancestor/README.md +1 -3
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +11 -13
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +373 -377
|
@@ -7,44 +7,40 @@ import { PropertyRequiredMixin } from '../../mixins/property-required/property-r
|
|
|
7
7
|
*/
|
|
8
8
|
class SkipNavCustom extends FocusMixin(PropertyRequiredMixin(LitElement)) {
|
|
9
9
|
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
}
|
|
10
|
+
static properties = {
|
|
11
|
+
/**
|
|
12
|
+
* ACCESSIBILITY: REQUIRED: Text for the link
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
text: { required: true, type: String }
|
|
16
|
+
};
|
|
19
17
|
|
|
20
|
-
static
|
|
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
|
-
}
|
|
18
|
+
static styles = css`
|
|
19
|
+
a {
|
|
20
|
+
inset-inline-start: -10000px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 1px;
|
|
24
|
+
}
|
|
25
|
+
a:active,
|
|
26
|
+
a:focus {
|
|
27
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
28
|
+
border: 1px solid rgba(0, 0, 0, 0.8);
|
|
29
|
+
color: #ffffff;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
display: block;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
inset-block-start: 0;
|
|
34
|
+
inset-inline-start: 25%;
|
|
35
|
+
margin: 0 auto;
|
|
36
|
+
outline: none;
|
|
37
|
+
padding: 0.3em;
|
|
38
|
+
text-align: center;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
width: 50%;
|
|
41
|
+
z-index: 10000;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
48
44
|
|
|
49
45
|
static get focusElementSelector() {
|
|
50
46
|
return 'a';
|
|
@@ -24,19 +24,17 @@ class Sort extends FocusMixin(LocalizeCoreElement(LitElement)) {
|
|
|
24
24
|
_selectedItemValue: { state: true },
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
static
|
|
28
|
-
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`;
|
|
39
|
-
}
|
|
27
|
+
static styles = css`
|
|
28
|
+
:host {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
}
|
|
31
|
+
:host([hidden]) {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
::slotted(:not(d2l-sort-item)) {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
40
38
|
|
|
41
39
|
constructor() {
|
|
42
40
|
super();
|
|
@@ -6,88 +6,84 @@ import { css, html, LitElement } from 'lit';
|
|
|
6
6
|
*/
|
|
7
7
|
class StatusIndicator extends LitElement {
|
|
8
8
|
|
|
9
|
-
static
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
}
|
|
9
|
+
static properties = {
|
|
10
|
+
/**
|
|
11
|
+
* State of status indicator to display
|
|
12
|
+
* @type {'default'|'success'|'alert'|'none'}
|
|
13
|
+
*/
|
|
14
|
+
state: {
|
|
15
|
+
type: String,
|
|
16
|
+
reflect: true
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* REQUIRED: The text that is displayed within the status indicator
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
text: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Use when the status is very important and needs to have a lot of prominence
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
bold: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
reflect: true
|
|
32
|
+
}
|
|
33
|
+
};
|
|
36
34
|
|
|
37
|
-
static
|
|
38
|
-
|
|
39
|
-
:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
35
|
+
static styles = css`
|
|
36
|
+
:host {
|
|
37
|
+
border-color: var(--d2l-color-celestine);
|
|
38
|
+
border-radius: 0.6rem;
|
|
39
|
+
border-style: solid;
|
|
40
|
+
border-width: 1px;
|
|
41
|
+
color: var(--d2l-color-celestine);
|
|
42
|
+
cursor: default;
|
|
43
|
+
display: inline-block;
|
|
44
|
+
font-size: 0.6rem;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
line-height: 1;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
padding: 2px 10px 2px 10px;
|
|
49
|
+
text-overflow: ellipsis;
|
|
50
|
+
text-transform: capitalize;
|
|
51
|
+
vertical-align: middle;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
}
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
:host([hidden]) {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
:host([state="success"]) {
|
|
59
|
+
border-color: var(--d2l-color-olivine-minus-1);
|
|
60
|
+
color: var(--d2l-color-olivine-minus-1);
|
|
61
|
+
}
|
|
62
|
+
:host([state="alert"]) {
|
|
63
|
+
border-color: var(--d2l-color-cinnabar);
|
|
64
|
+
color: var(--d2l-color-cinnabar);
|
|
65
|
+
}
|
|
66
|
+
:host([state="none"]),
|
|
67
|
+
:host([state="null"]) {
|
|
68
|
+
border-color: var(--d2l-color-tungsten);
|
|
69
|
+
color: var(--d2l-color-tungsten);
|
|
70
|
+
}
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
72
|
+
:host([bold]) {
|
|
73
|
+
background-color: var(--d2l-color-celestine);
|
|
74
|
+
color: white;
|
|
75
|
+
}
|
|
76
|
+
:host([bold][state="success"]) {
|
|
77
|
+
background-color: var(--d2l-color-olivine-minus-1);
|
|
78
|
+
}
|
|
79
|
+
:host([bold][state="alert"]) {
|
|
80
|
+
background-color: var(--d2l-color-cinnabar);
|
|
81
|
+
}
|
|
82
|
+
:host([bold][state="none"]),
|
|
83
|
+
:host([bold][state="null"]) {
|
|
84
|
+
background-color: var(--d2l-color-tungsten);
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
91
87
|
|
|
92
88
|
constructor() {
|
|
93
89
|
super();
|
|
@@ -9,158 +9,154 @@ import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
|
9
9
|
|
|
10
10
|
export const SwitchMixin = superclass => class extends FocusMixin(RtlMixin(superclass)) {
|
|
11
11
|
|
|
12
|
-
static
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
}
|
|
12
|
+
static properties = {
|
|
13
|
+
/**
|
|
14
|
+
* Disables the switch from being toggled.
|
|
15
|
+
* @type {boolean}
|
|
16
|
+
*/
|
|
17
|
+
disabled: { type: Boolean, reflect: true },
|
|
18
|
+
/**
|
|
19
|
+
* Active state.
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
*/
|
|
22
|
+
on: { type: Boolean, reflect: true },
|
|
23
|
+
/**
|
|
24
|
+
* @ignore - Need to add documentation in each component that uses this mixin.
|
|
25
|
+
*/
|
|
26
|
+
text: { type: String, reflect: true },
|
|
27
|
+
/**
|
|
28
|
+
* Determines where text should be positioned relative to the switch.
|
|
29
|
+
* @type {'start'|'end'|'hidden'}
|
|
30
|
+
* @default end
|
|
31
|
+
*/
|
|
32
|
+
textPosition: { type: String, attribute: 'text-position', reflect: true },
|
|
33
|
+
_hovering: { state: true }
|
|
34
|
+
};
|
|
37
35
|
|
|
38
|
-
static
|
|
39
|
-
|
|
40
|
-
:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
:
|
|
46
|
-
|
|
47
|
-
}
|
|
36
|
+
static styles = css`
|
|
37
|
+
:host {
|
|
38
|
+
display: inline-block;
|
|
39
|
+
user-select: none;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
:host([hidden]) {
|
|
43
|
+
display: none;
|
|
44
|
+
}
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
}
|
|
46
|
+
.d2l-switch-container {
|
|
47
|
+
--d2l-focus-ring-offset: 0;
|
|
48
|
+
background-color: var(--d2l-switch-container-background-color, var(--d2l-theme-background-color-base));
|
|
49
|
+
border-radius: 1rem;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
cursor: default;
|
|
52
|
+
display: inline-block;
|
|
53
|
+
font-size: 0;
|
|
54
|
+
line-height: 0;
|
|
55
|
+
outline-style: none;
|
|
56
|
+
padding: 0.1rem;
|
|
57
|
+
vertical-align: middle;
|
|
58
|
+
}
|
|
59
|
+
${getFocusRingStyles('.d2l-switch-container', { extraStyles: css`position: relative;` })}
|
|
60
|
+
:host([disabled]) .d2l-switch-container {
|
|
61
|
+
cursor: default;
|
|
62
|
+
opacity: var(--d2l-theme-opacity-disabled-control);
|
|
63
|
+
}
|
|
64
|
+
:host([disabled]) .d2l-switch-container:hover > .d2l-switch-inner,
|
|
65
|
+
:host([disabled]) .d2l-switch-inner:hover,
|
|
66
|
+
:host([disabled]) .switch-hover {
|
|
67
|
+
outline: none;
|
|
68
|
+
}
|
|
69
|
+
.d2l-switch-inner {
|
|
70
|
+
border: 1px solid var(--d2l-theme-border-color-emphasized);
|
|
71
|
+
border-radius: 0.8rem;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
padding: 0.3rem;
|
|
74
|
+
position: relative;
|
|
75
|
+
width: 3rem;
|
|
76
|
+
}
|
|
77
|
+
:host([on]) .d2l-switch-inner {
|
|
78
|
+
background-color: var(--d2l-theme-background-color-interactive-highlighted);
|
|
79
|
+
}
|
|
80
|
+
.d2l-switch-toggle {
|
|
81
|
+
position: relative;
|
|
82
|
+
transition: transform 150ms ease-out;
|
|
83
|
+
}
|
|
84
|
+
.d2l-switch-toggle > div {
|
|
85
|
+
background-color: var(--d2l-theme-background-color-base);
|
|
86
|
+
border: 1px solid var(--d2l-theme-border-color-emphasized);
|
|
87
|
+
border-radius: 0.6rem;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
display: inline-block;
|
|
90
|
+
height: 1.1rem;
|
|
91
|
+
left: -0.1rem;
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: -0.95rem;
|
|
94
|
+
width: 1.1rem;
|
|
95
|
+
}
|
|
96
|
+
:host([on]) .d2l-switch-toggle > div {
|
|
97
|
+
left: 0.1rem;
|
|
98
|
+
}
|
|
99
|
+
:host([dir="rtl"][on]) .d2l-switch-toggle > div {
|
|
100
|
+
right: 0.3rem;
|
|
101
|
+
}
|
|
102
|
+
:host([dir="rtl"]) .d2l-switch-toggle > div {
|
|
103
|
+
left: auto;
|
|
104
|
+
right: -0.1rem;
|
|
105
|
+
}
|
|
106
|
+
:host([on]) .d2l-switch-toggle {
|
|
107
|
+
transform: translateX(1.2rem);
|
|
108
|
+
}
|
|
109
|
+
:host([dir="rtl"][on]) .d2l-switch-toggle {
|
|
110
|
+
right: -0.2rem;
|
|
111
|
+
transform: translateX(-1.2rem);
|
|
112
|
+
}
|
|
113
|
+
d2l-icon, d2l-icon-custom {
|
|
114
|
+
height: 0.8rem;
|
|
115
|
+
width: 0.8rem;
|
|
116
|
+
}
|
|
117
|
+
.d2l-switch-icon-on, .d2l-switch-icon-off {
|
|
118
|
+
display: inline-block;
|
|
119
|
+
transform: scale(1);
|
|
120
|
+
transition: transform 150ms ease-out;
|
|
121
|
+
}
|
|
122
|
+
.d2l-switch-icon-on {
|
|
123
|
+
margin-right: 0.65rem;
|
|
124
|
+
}
|
|
125
|
+
:host([dir="rtl"]) .d2l-switch-icon-on {
|
|
126
|
+
margin-left: 0.65rem;
|
|
127
|
+
margin-right: 0;
|
|
128
|
+
}
|
|
129
|
+
:host([on]) .d2l-switch-icon-on > d2l-icon,
|
|
130
|
+
:host([on]) .d2l-switch-icon-on > d2l-icon-custom {
|
|
131
|
+
color: var(--d2l-theme-icon-color-active);
|
|
132
|
+
}
|
|
133
|
+
:host([on]) .d2l-switch-icon-off {
|
|
134
|
+
transform: scale(0.35);
|
|
135
|
+
}
|
|
136
|
+
:host(:not([on])) .d2l-switch-icon-on {
|
|
137
|
+
color: var(--d2l-theme-icon-color-active);
|
|
138
|
+
transform: scale(0.35);
|
|
139
|
+
}
|
|
140
|
+
.d2l-switch-text {
|
|
141
|
+
cursor: default;
|
|
142
|
+
font-size: 0.8rem;
|
|
143
|
+
font-weight: 400;
|
|
144
|
+
}
|
|
145
|
+
:host([text-position="hidden"]) .d2l-switch-text {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
.d2l-switch-inner:hover, .switch-hover {
|
|
149
|
+
outline: 2px solid var(--d2l-theme-border-color-focus);
|
|
150
|
+
outline-offset: -2px;
|
|
151
|
+
}
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
.d2l-switch-toggle,
|
|
154
|
+
.d2l-switch-icon-on,
|
|
155
|
+
.d2l-switch-icon-off {
|
|
156
|
+
transition: none;
|
|
161
157
|
}
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
}
|
|
159
|
+
`;
|
|
164
160
|
|
|
165
161
|
constructor() {
|
|
166
162
|
super();
|
|
@@ -12,22 +12,18 @@ import { SwitchMixin } from './switch-mixin.js';
|
|
|
12
12
|
*/
|
|
13
13
|
class VisibilitySwitch extends LocalizeCoreElement(SwitchMixin(LitElement)) {
|
|
14
14
|
|
|
15
|
-
static
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
}
|
|
15
|
+
static properties = {
|
|
16
|
+
_hasConditions: { state: true }
|
|
17
|
+
};
|
|
20
18
|
|
|
21
|
-
static
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`];
|
|
30
|
-
}
|
|
19
|
+
static styles = [super.styles, css`
|
|
20
|
+
d2l-tooltip-help {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
d2l-tooltip-help.switch-visibility-conditions-show {
|
|
24
|
+
display: inline;
|
|
25
|
+
}
|
|
26
|
+
`];
|
|
31
27
|
|
|
32
28
|
constructor() {
|
|
33
29
|
super();
|
|
@@ -11,13 +11,11 @@ import { SwitchMixin } from './switch-mixin.js';
|
|
|
11
11
|
*/
|
|
12
12
|
class Switch extends SwitchMixin(LitElement) {
|
|
13
13
|
|
|
14
|
-
static
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`];
|
|
20
|
-
}
|
|
14
|
+
static styles = [super.styles, css`
|
|
15
|
+
.d2l-switch-icon-off > d2l-icon-custom {
|
|
16
|
+
color: var(--d2l-theme-icon-color-standard);
|
|
17
|
+
}
|
|
18
|
+
`];
|
|
21
19
|
|
|
22
20
|
get offIcon() {
|
|
23
21
|
return html`
|