@brightspace-ui/core 3.176.4 → 3.176.6
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/dropdown/demo/dropdown-menu-demo-view.js +37 -0
- package/components/dropdown/demo/dropdown-menu.html +19 -0
- package/components/hierarchical-view/hierarchical-view-mixin.js +10 -1
- package/custom-elements.json +6 -2
- package/package.json +1 -1
- package/templates/primary-secondary/README.md +1 -0
- package/templates/primary-secondary/primary-secondary.js +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import '../../colors/colors.js';
|
|
2
|
+
import '../../button/button-subtle.js';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { HierarchicalViewMixin } from '../../hierarchical-view/hierarchical-view-mixin.js';
|
|
5
|
+
import { LocalizeCoreElement } from '../../../helpers/localize-core-element.js';
|
|
6
|
+
|
|
7
|
+
class DemoView extends LocalizeCoreElement(HierarchicalViewMixin(LitElement)) {
|
|
8
|
+
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [ super.styles,
|
|
11
|
+
css`
|
|
12
|
+
:host {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
color: var(--d2l-color-ferrite);
|
|
15
|
+
cursor: default;
|
|
16
|
+
}
|
|
17
|
+
.d2l-hierarchical-view-content {
|
|
18
|
+
padding: 12px;
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
return html`
|
|
26
|
+
<div class="d2l-hierarchical-view-content">
|
|
27
|
+
<div>Trysail Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow's nest rutters.</div>
|
|
28
|
+
<div>
|
|
29
|
+
<d2l-button-subtle text="${this.localize('components.pager-load-more.action')}"></d2l-button-subtle>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
customElements.define('d2l-dropdown-menu-demo-view', DemoView);
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import '../../menu/menu-item-radio.js';
|
|
14
14
|
import '../dropdown.js';
|
|
15
15
|
import '../dropdown-menu.js';
|
|
16
|
+
import './dropdown-menu-demo-view.js';
|
|
16
17
|
</script>
|
|
17
18
|
</head>
|
|
18
19
|
|
|
@@ -201,6 +202,24 @@
|
|
|
201
202
|
</template>
|
|
202
203
|
</d2l-demo-snippet>
|
|
203
204
|
|
|
205
|
+
<h2>Custom View</h2>
|
|
206
|
+
<d2l-demo-snippet>
|
|
207
|
+
<template>
|
|
208
|
+
<d2l-dropdown>
|
|
209
|
+
<button class="d2l-dropdown-opener">Open it!</button>
|
|
210
|
+
<d2l-dropdown-menu>
|
|
211
|
+
<d2l-menu label="Astronomy">
|
|
212
|
+
<d2l-menu-item text="Introduction"></d2l-menu-item>
|
|
213
|
+
<d2l-menu-item text="Searching for the Heavens">
|
|
214
|
+
<d2l-dropdown-menu-demo-view></d2l-dropdown-menu-demo-view>
|
|
215
|
+
</d2l-menu-item>
|
|
216
|
+
<d2l-menu-item text="The Solar System"></d2l-menu-item>
|
|
217
|
+
</d2l-menu>
|
|
218
|
+
</d2l-dropdown-menu>
|
|
219
|
+
</d2l-dropdown>
|
|
220
|
+
</template>
|
|
221
|
+
</d2l-demo-snippet>
|
|
222
|
+
|
|
204
223
|
</d2l-demo-page>
|
|
205
224
|
|
|
206
225
|
</body>
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { findComposedAncestor, getComposedParent, isComposedAncestor } from '../../helpers/dom.js';
|
|
2
2
|
import { getNextFocusable, getPreviousFocusable } from '../../helpers/focus.js';
|
|
3
3
|
import { css } from 'lit';
|
|
4
|
+
import { getFlag } from '../../helpers/flags.js';
|
|
4
5
|
import ResizeObserver from 'resize-observer-polyfill/dist/ResizeObserver.es.js';
|
|
5
6
|
|
|
6
7
|
const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
7
8
|
const __nativeFocus = document.createElement('div').focus;
|
|
8
9
|
const escapeKeyCode = 27;
|
|
9
10
|
|
|
11
|
+
const useResizeFix = getFlag('GAUD-8969-hierarchical-view-resize', true);
|
|
12
|
+
|
|
10
13
|
export const HierarchicalViewMixin = superclass => class extends superclass {
|
|
11
14
|
|
|
12
15
|
static get properties() {
|
|
@@ -523,7 +526,13 @@ export const HierarchicalViewMixin = superclass => class extends superclass {
|
|
|
523
526
|
}
|
|
524
527
|
|
|
525
528
|
if (e.detail.isSource && this.__getParentViewFromEvent(e) === this) {
|
|
526
|
-
|
|
529
|
+
if (useResizeFix) {
|
|
530
|
+
requestAnimationFrame(() => {
|
|
531
|
+
e.detail.sourceView.__dispatchViewResize();
|
|
532
|
+
});
|
|
533
|
+
} else {
|
|
534
|
+
e.detail.sourceView.__dispatchViewResize();
|
|
535
|
+
}
|
|
527
536
|
}
|
|
528
537
|
|
|
529
538
|
}
|
package/custom-elements.json
CHANGED
|
@@ -2679,6 +2679,10 @@
|
|
|
2679
2679
|
}
|
|
2680
2680
|
]
|
|
2681
2681
|
},
|
|
2682
|
+
{
|
|
2683
|
+
"name": "d2l-dropdown-menu-demo-view",
|
|
2684
|
+
"path": "./components/dropdown/demo/dropdown-menu-demo-view.js"
|
|
2685
|
+
},
|
|
2682
2686
|
{
|
|
2683
2687
|
"name": "d2l-dropdown-button-subtle",
|
|
2684
2688
|
"path": "./components/dropdown/dropdown-button-subtle.js",
|
|
@@ -14924,7 +14928,7 @@
|
|
|
14924
14928
|
{
|
|
14925
14929
|
"name": "has-form",
|
|
14926
14930
|
"description": "Whether to render an encompassing form over all panels",
|
|
14927
|
-
"type": "
|
|
14931
|
+
"type": "boolean",
|
|
14928
14932
|
"default": "false"
|
|
14929
14933
|
}
|
|
14930
14934
|
],
|
|
@@ -14976,7 +14980,7 @@
|
|
|
14976
14980
|
"name": "hasForm",
|
|
14977
14981
|
"attribute": "has-form",
|
|
14978
14982
|
"description": "Whether to render an encompassing form over all panels",
|
|
14979
|
-
"type": "
|
|
14983
|
+
"type": "boolean",
|
|
14980
14984
|
"default": "false"
|
|
14981
14985
|
}
|
|
14982
14986
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "3.176.
|
|
3
|
+
"version": "3.176.6",
|
|
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",
|
|
@@ -53,6 +53,7 @@ If either of the panels contain an `iframe`, resizing may not work properly. Thi
|
|
|
53
53
|
| Property | Type | Description |
|
|
54
54
|
|---|---|---|
|
|
55
55
|
| `background-shading` | String, default: `'none'` | Controls whether the primary and secondary panels have shaded backgrounds. Can be one of `'primary'`, `'secondary'`, `'none'`. |
|
|
56
|
+
| `has-form` | Boolean, default: `false` | Whether to render an encompassing form over all panels |
|
|
56
57
|
| `primary-overflow` | String, default: `'default'` | Controls how the primary panel's contents overflow. Can be one of `'default'`, `'hidden'`. |
|
|
57
58
|
| `resizable` | Boolean, default: `false` | Whether the panels are user resizable. This only applies to desktop users, mobile users will always be able to resize. |
|
|
58
59
|
| `secondary-first` | Boolean, default: `false` | When set to true, the secondary panel will be displayed on the left (or the right in RTL) in the desktop view. This attribute has no effect on the mobile view. |
|
|
@@ -594,7 +594,7 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
|
|
|
594
594
|
widthType: { type: String, attribute: 'width-type', reflect: true },
|
|
595
595
|
/**
|
|
596
596
|
* Whether to render an encompassing form over all panels
|
|
597
|
-
* @type {
|
|
597
|
+
* @type {boolean}
|
|
598
598
|
*/
|
|
599
599
|
hasForm: { type: Boolean, attribute: 'has-form' },
|
|
600
600
|
_formErrorSummary: { type: Array },
|