@brightspace-ui/core 2.103.0 → 2.104.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/README.md +7 -7
- package/components/alert/alert.js +1 -1
- package/components/breadcrumbs/breadcrumb.js +2 -2
- package/components/breadcrumbs/breadcrumbs.js +1 -1
- package/components/button/button-icon.js +3 -3
- package/components/button/button-mixin.js +1 -1
- package/components/button/button-move.js +2 -2
- package/components/button/button-subtle.js +1 -1
- package/components/button/floating-buttons.js +1 -1
- package/components/calendar/calendar.js +1 -1
- package/components/card/card-footer-link.js +2 -2
- package/components/card/card.js +2 -2
- package/components/collapsible-panel/collapsible-panel.js +2 -2
- package/components/count-badge/count-badge-icon.js +1 -1
- package/components/count-badge/count-badge-mixin.js +1 -1
- package/components/count-badge/count-badge.js +1 -1
- package/components/dialog/dialog-mixin.js +1 -1
- package/components/dropdown/dropdown-button.js +1 -1
- package/components/dropdown/dropdown-content-mixin.js +1 -1
- package/components/dropdown/dropdown-context-menu.js +1 -1
- package/components/dropdown/dropdown-menu.js +1 -1
- package/components/dropdown/dropdown-more.js +1 -1
- package/components/empty-state/empty-state-simple.js +1 -1
- package/components/filter/filter-overflow-group.js +1 -1
- package/components/filter/filter.js +2 -2
- package/components/focus-trap/focus-trap.js +1 -1
- package/components/form/form-errory-summary.js +1 -1
- package/components/html-block/demo/html-block.html +1 -1
- package/components/html-block/html-block.js +1 -1
- package/components/icons/icon-custom.js +1 -1
- package/components/icons/icon.js +1 -1
- package/components/inputs/README.md +1 -1
- package/components/inputs/demo/input-radio-label-simple-test.js +1 -1
- package/components/inputs/demo/input-radio-label-test.js +1 -1
- package/components/inputs/demo/input-select-test.js +1 -1
- package/components/inputs/docs/input-radio.md +1 -1
- package/components/inputs/docs/input-select-styles.md +1 -1
- package/components/inputs/input-checkbox-spacer.js +1 -1
- package/components/inputs/input-checkbox.js +2 -2
- package/components/inputs/input-color.js +1 -1
- package/components/inputs/input-date-range.js +2 -2
- package/components/inputs/input-date-time-range.js +2 -2
- package/components/inputs/input-date-time.js +3 -3
- package/components/inputs/input-date.js +2 -2
- package/components/inputs/input-fieldset.js +1 -1
- package/components/inputs/input-number.js +2 -2
- package/components/inputs/input-percent.js +3 -3
- package/components/inputs/input-radio-spacer.js +1 -1
- package/components/inputs/input-search.js +2 -2
- package/components/inputs/input-text.js +3 -3
- package/components/inputs/input-textarea.js +3 -3
- package/components/inputs/input-time-range.js +2 -2
- package/components/inputs/input-time.js +2 -2
- package/components/link/link.js +1 -1
- package/components/list/list-item-drag-handle.js +2 -2
- package/components/list/list-item-drag-image.js +1 -1
- package/components/list/list-item-generic-layout.js +2 -3
- package/components/list/list-item-mixin.js +2 -2
- package/components/list/list-item-placement-marker.js +1 -1
- package/components/menu/menu-item-checkbox.js +1 -1
- package/components/menu/menu-item-radio.js +1 -1
- package/components/menu/menu-item-return.js +1 -1
- package/components/menu/menu.js +1 -1
- package/components/meter/meter-circle.js +1 -1
- package/components/meter/meter-linear.js +1 -1
- package/components/meter/meter-radial.js +1 -1
- package/components/object-property-list/object-property-list-item-link.js +1 -1
- package/components/offscreen/offscreen.js +1 -1
- package/components/overflow-group/overflow-group.js +1 -1
- package/components/paging/pager-load-more.js +1 -1
- package/components/scroll-wrapper/demo/scroll-wrapper-test.js +1 -1
- package/components/scroll-wrapper/scroll-wrapper.js +1 -1
- package/components/selection/selection-action-dropdown.js +1 -1
- package/components/selection/selection-action.js +1 -1
- package/components/selection/selection-controls.js +1 -1
- package/components/selection/selection-input.js +1 -1
- package/components/selection/selection-mixin.js +1 -1
- package/components/selection/selection-select-all-pages.js +1 -1
- package/components/selection/selection-select-all.js +1 -1
- package/components/skeleton/skeleton-mixin.js +1 -1
- package/components/switch/switch-mixin.js +2 -2
- package/components/table/demo/table-test.js +1 -1
- package/components/table/table-col-sort-button.js +1 -1
- package/components/table/table-wrapper.js +1 -1
- package/components/tabs/tab-internal.js +1 -1
- package/components/tabs/tabs.js +2 -2
- package/components/tag-list/tag-list-item-mixin.js +1 -1
- package/components/tag-list/tag-list.js +2 -2
- package/components/tooltip/tooltip-help.js +1 -1
- package/components/tooltip/tooltip.js +1 -1
- package/helpers/demo/prism.html +3 -3
- package/mixins/{arrow-keys-mixin.md → arrow-keys/README.md} +2 -2
- package/mixins/arrow-keys/arrow-keys-mixin.js +125 -0
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-mixin.html +2 -2
- package/mixins/{demo → arrow-keys/demo}/arrow-keys-test.js +1 -1
- package/mixins/arrow-keys-mixin.js +1 -125
- package/mixins/{focus-mixin.md → focus/README.md} +1 -1
- package/mixins/focus/focus-mixin.js +43 -0
- package/mixins/focus-mixin.js +1 -43
- package/mixins/{interactive-mixin.md → interactive/README.md} +1 -1
- package/mixins/{interactive-mixin.js → interactive/interactive-mixin.js} +4 -4
- package/mixins/{labelled-mixin.md → labelled/README.md} +2 -2
- package/mixins/{demo → labelled/demo}/labelled-mixin.html +3 -3
- package/mixins/labelled/labelled-mixin.js +215 -0
- package/mixins/labelled-mixin.js +1 -215
- package/mixins/localize/localize-mixin.js +1 -1
- package/mixins/{provider-mixin.md → provider/README.md} +3 -3
- package/mixins/provider/provider-mixin.js +35 -0
- package/mixins/provider-mixin.js +1 -35
- package/mixins/{rtl-mixin.md → rtl/README.md} +1 -1
- package/mixins/rtl/rtl-mixin.js +40 -0
- package/mixins/rtl-mixin.js +1 -40
- package/mixins/theme/theme-mixin.js +19 -0
- package/mixins/theme-mixin.js +1 -19
- package/mixins/{visible-on-ancestor-mixin.md → visible-on-ancestor/README.md} +1 -1
- package/mixins/visible-on-ancestor/visible-on-ancestor-mixin.js +160 -0
- package/mixins/visible-on-ancestor-mixin.js +1 -160
- package/package.json +1 -1
- package/templates/primary-secondary/primary-secondary.js +1 -1
|
@@ -1,160 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { css } from 'lit';
|
|
3
|
-
|
|
4
|
-
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
5
|
-
|
|
6
|
-
export const visibleOnAncestorStyles = css`
|
|
7
|
-
|
|
8
|
-
:host([__voa-state="hidden"]),
|
|
9
|
-
:host([__voa-state="hiding"]) {
|
|
10
|
-
opacity: 0 !important;
|
|
11
|
-
transform: translateY(-10px) !important;
|
|
12
|
-
}
|
|
13
|
-
:host([__voa-state="showing"]),
|
|
14
|
-
:host([__voa-state="hiding"]) {
|
|
15
|
-
transition: transform 200ms ease-out, opacity 200ms ease-out !important;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@media only screen and (hover: none), only screen and (-moz-touch-enabled: 1) {
|
|
19
|
-
:host([__voa-state="hidden"]),
|
|
20
|
-
:host([__voa-state="hiding"]) {
|
|
21
|
-
opacity: 1 !important;
|
|
22
|
-
transform: translateY(0) !important;
|
|
23
|
-
}
|
|
24
|
-
:host([__voa-state="hidden"][d2l-visible-on-ancestor-no-hover-hide]),
|
|
25
|
-
:host([__voa-state="hiding"][d2l-visible-on-ancestor-no-hover-hide]) {
|
|
26
|
-
opacity: 0 !important;
|
|
27
|
-
transform: translateY(-10px) !important;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
`;
|
|
32
|
-
|
|
33
|
-
export const VisibleOnAncestorMixin = superclass => class extends superclass {
|
|
34
|
-
|
|
35
|
-
static get properties() {
|
|
36
|
-
return {
|
|
37
|
-
/**
|
|
38
|
-
* @ignore
|
|
39
|
-
*/
|
|
40
|
-
visibleOnAncestor: { type: Boolean, reflect: true, attribute: 'visible-on-ancestor' },
|
|
41
|
-
__voaState: { type: String, reflect: true, attribute: '__voa-state' }
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
constructor() {
|
|
46
|
-
super();
|
|
47
|
-
|
|
48
|
-
this.visibleOnAncestor = false;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
attributeChangedCallback(name, oldval, newval) {
|
|
52
|
-
if (name === 'visible-on-ancestor' && this.__voaAttached) {
|
|
53
|
-
if (newval) this.__voaInit();
|
|
54
|
-
else this.__voaUninit();
|
|
55
|
-
}
|
|
56
|
-
super.attributeChangedCallback(name, oldval, newval);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
connectedCallback() {
|
|
60
|
-
super.connectedCallback();
|
|
61
|
-
this.__voaAttached = true;
|
|
62
|
-
if (this.visibleOnAncestor) {
|
|
63
|
-
requestAnimationFrame(() => this.__voaInit());
|
|
64
|
-
} else this.__voaState = null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
disconnectedCallback() {
|
|
68
|
-
this.__voaAttached = false;
|
|
69
|
-
this.__voaUninit();
|
|
70
|
-
super.disconnectedCallback();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
__voaHandleBlur(e) {
|
|
74
|
-
if (isComposedAncestor(this.__voaTarget, e.relatedTarget)) return;
|
|
75
|
-
this.__voaFocusIn = false;
|
|
76
|
-
this.__voaHide();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
__voaHandleFocus() {
|
|
80
|
-
this.__voaFocusIn = true;
|
|
81
|
-
this.__voaShow();
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
__voaHandleMouseEnter() {
|
|
85
|
-
this.__voaMouseOver = true;
|
|
86
|
-
this.__voaShow();
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
__voaHandleMouseLeave() {
|
|
90
|
-
this.__voaMouseOver = false;
|
|
91
|
-
this.__voaHide();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
__voaHide() {
|
|
95
|
-
if (this.__voaFocusIn || this.__voaMouseOver) return;
|
|
96
|
-
if (reduceMotion) {
|
|
97
|
-
this.__voaState = 'hidden';
|
|
98
|
-
} else {
|
|
99
|
-
const handleTransitionEnd = (e) => {
|
|
100
|
-
if (e.propertyName !== 'transform') return;
|
|
101
|
-
this.removeEventListener('transitionend', handleTransitionEnd);
|
|
102
|
-
this.__voaState = 'hidden';
|
|
103
|
-
};
|
|
104
|
-
this.addEventListener('transitionend', handleTransitionEnd);
|
|
105
|
-
this.__voaState = 'hiding';
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
__voaInit() {
|
|
110
|
-
|
|
111
|
-
if (!this.visibleOnAncestor) return;
|
|
112
|
-
|
|
113
|
-
this.__voaTarget = findComposedAncestor(this, (node) => {
|
|
114
|
-
if (!node || node.nodeType !== 1) return false;
|
|
115
|
-
return (node.classList.contains('d2l-visible-on-ancestor-target'));
|
|
116
|
-
});
|
|
117
|
-
if (!this.__voaTarget) {
|
|
118
|
-
this.__voaState = null;
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
this.__voaHandleBlur = this.__voaHandleBlur.bind(this);
|
|
123
|
-
this.__voaHandleFocus = this.__voaHandleFocus.bind(this);
|
|
124
|
-
this.__voaHandleMouseEnter = this.__voaHandleMouseEnter.bind(this);
|
|
125
|
-
this.__voaHandleMouseLeave = this.__voaHandleMouseLeave.bind(this);
|
|
126
|
-
|
|
127
|
-
this.__voaTarget.addEventListener('focus', this.__voaHandleFocus, true);
|
|
128
|
-
this.__voaTarget.addEventListener('blur', this.__voaHandleBlur, true);
|
|
129
|
-
this.__voaTarget.addEventListener('mouseenter', this.__voaHandleMouseEnter);
|
|
130
|
-
this.__voaTarget.addEventListener('mouseleave', this.__voaHandleMouseLeave);
|
|
131
|
-
|
|
132
|
-
this.__voaState = 'hidden';
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
__voaShow() {
|
|
137
|
-
if (reduceMotion) {
|
|
138
|
-
this.__voaState = 'shown';
|
|
139
|
-
} else {
|
|
140
|
-
const handleTransitionEnd = (e) => {
|
|
141
|
-
if (e.propertyName !== 'transform') return;
|
|
142
|
-
this.removeEventListener('transitionend', handleTransitionEnd);
|
|
143
|
-
this.__voaState = 'shown';
|
|
144
|
-
};
|
|
145
|
-
this.addEventListener('transitionend', handleTransitionEnd);
|
|
146
|
-
this.__voaState = 'showing';
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
__voaUninit() {
|
|
151
|
-
this.__voaState = null;
|
|
152
|
-
if (!this.__voaTarget) return;
|
|
153
|
-
this.__voaTarget.removeEventListener('focus', this.__voaHandleFocus, true);
|
|
154
|
-
this.__voaTarget.removeEventListener('blur', this.__voaHandleBlur, true);
|
|
155
|
-
this.__voaTarget.removeEventListener('mouseenter', this.__voaHandleMouseEnter);
|
|
156
|
-
this.__voaTarget.removeEventListener('mouseleave', this.__voaHandleMouseLeave);
|
|
157
|
-
this.__voaTarget = null;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
};
|
|
1
|
+
export { VisibleOnAncestorMixin, visibleOnAncestorStyles } from './visible-on-ancestor/visible-on-ancestor-mixin.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.104.1",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|
|
@@ -9,7 +9,7 @@ import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
|
9
9
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
10
|
import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
|
|
11
11
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
12
|
-
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
12
|
+
import { RtlMixin } from '../../mixins/rtl/rtl-mixin.js';
|
|
13
13
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
14
14
|
|
|
15
15
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|