@brightspace-ui/core 3.104.0 → 3.105.0

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.
@@ -15,6 +15,7 @@
15
15
  import '../../filter/filter.js';
16
16
  import '../../filter/filter-dimension-set.js';
17
17
  import '../../filter/filter-dimension-set-value.js';
18
+ import '../../inputs/input-checkbox.js';
18
19
  import '../../list/demo/demo-list.js';
19
20
  import '../dialog.js';
20
21
  import './dialog-async-content.js';
@@ -296,6 +297,38 @@
296
297
  </template>
297
298
  </d2l-demo-snippet>
298
299
 
300
+ <h2>Dialog (no content scrolling)</h2>
301
+
302
+ <d2l-demo-snippet>
303
+ <template>
304
+ <d2l-button id="openNoScrollDialog">Show Dialog</d2l-button>
305
+ <d2l-dialog id="noScrollDialog" title-text="Dialog Title">
306
+ <d2l-input-checkbox id="noScroll">Show extra paragraphs</d2l-input-checkbox>
307
+ <div>
308
+ <p>Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker</p>
309
+ <p id="p2" style="display: none;">Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.</p>
310
+ <p id="p3" style="display: none;">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. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.</p>
311
+ </div>
312
+ <d2l-button slot="footer" primary data-dialog-action="ok">Click Me!</d2l-button>
313
+ <d2l-button slot="footer" data-dialog-action>Cancel</d2l-button>
314
+ </d2l-dialog>
315
+ <script>
316
+ document.querySelector('#noScroll').addEventListener('change', async(e) => {
317
+ const dialog = document.querySelector('#noScrollDialog');
318
+ dialog.noContentScroll = true;
319
+ const display = e.target.checked ? 'block' : 'none';
320
+ dialog.querySelector('#p2').style.display = display;
321
+ dialog.querySelector('#p3').style.display = display;
322
+ await dialog.resize();
323
+ dialog.noContentScroll = false;
324
+ });
325
+ document.querySelector('#openNoScrollDialog').addEventListener('click', () => {
326
+ document.querySelector('#noScrollDialog').opened = true;
327
+ });
328
+ </script>
329
+ </template>
330
+ </d2l-demo-snippet>
331
+
299
332
  </d2l-demo-page>
300
333
  </body>
301
334
  </html>
@@ -41,7 +41,10 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
41
41
  * Whether or not the dialog is open
42
42
  */
43
43
  opened: { type: Boolean, reflect: true },
44
-
44
+ /**
45
+ * ADVANCED: Opt out of dialog content scrolling
46
+ */
47
+ noContentScroll: { type: Boolean, attribute: 'no-content-scroll', reflect: true },
45
48
  /**
46
49
  * The optional title for the dialog
47
50
  */
@@ -68,6 +71,7 @@ export const DialogMixin = superclass => class extends RtlMixin(superclass) {
68
71
  constructor() {
69
72
  super();
70
73
  this.focusableContentElemPresent = false;
74
+ this.noContentScroll = false;
71
75
  this.opened = false;
72
76
  this._autoSize = true;
73
77
  this._dialogId = getUniqueId();
@@ -147,7 +147,7 @@ export const dialogStyles = css`
147
147
  height: 100%;
148
148
  }
149
149
 
150
- .d2l-dialog-outer-scroll .d2l-dialog-content {
150
+ :host(:not([no-content-scroll])) .d2l-dialog-outer-scroll .d2l-dialog-content {
151
151
  overflow: auto;
152
152
  }
153
153
 
@@ -2072,6 +2072,12 @@
2072
2072
  "description": "The optional title for the dialog",
2073
2073
  "type": "string"
2074
2074
  },
2075
+ {
2076
+ "name": "no-content-scroll",
2077
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2078
+ "type": "boolean",
2079
+ "default": "false"
2080
+ },
2075
2081
  {
2076
2082
  "name": "opened",
2077
2083
  "description": "Whether or not the dialog is open",
@@ -2104,6 +2110,13 @@
2104
2110
  "type": "boolean",
2105
2111
  "default": "false"
2106
2112
  },
2113
+ {
2114
+ "name": "noContentScroll",
2115
+ "attribute": "no-content-scroll",
2116
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2117
+ "type": "boolean",
2118
+ "default": "false"
2119
+ },
2107
2120
  {
2108
2121
  "name": "opened",
2109
2122
  "attribute": "opened",
@@ -2161,6 +2174,12 @@
2161
2174
  "description": "REQUIRED: the title for the dialog",
2162
2175
  "type": "string"
2163
2176
  },
2177
+ {
2178
+ "name": "no-content-scroll",
2179
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2180
+ "type": "boolean",
2181
+ "default": "false"
2182
+ },
2164
2183
  {
2165
2184
  "name": "opened",
2166
2185
  "description": "Whether or not the dialog is open",
@@ -2210,6 +2229,13 @@
2210
2229
  "type": "boolean",
2211
2230
  "default": "false"
2212
2231
  },
2232
+ {
2233
+ "name": "noContentScroll",
2234
+ "attribute": "no-content-scroll",
2235
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2236
+ "type": "boolean",
2237
+ "default": "false"
2238
+ },
2213
2239
  {
2214
2240
  "name": "opened",
2215
2241
  "attribute": "opened",
@@ -2283,6 +2309,12 @@
2283
2309
  "description": "REQUIRED: the title for the dialog",
2284
2310
  "type": "string"
2285
2311
  },
2312
+ {
2313
+ "name": "no-content-scroll",
2314
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2315
+ "type": "boolean",
2316
+ "default": "false"
2317
+ },
2286
2318
  {
2287
2319
  "name": "opened",
2288
2320
  "description": "Whether or not the dialog is open",
@@ -2346,6 +2378,13 @@
2346
2378
  "type": "boolean",
2347
2379
  "default": "false"
2348
2380
  },
2381
+ {
2382
+ "name": "noContentScroll",
2383
+ "attribute": "no-content-scroll",
2384
+ "description": "ADVANCED: Opt out of dialog content scrolling",
2385
+ "type": "boolean",
2386
+ "default": "false"
2387
+ },
2349
2388
  {
2350
2389
  "name": "opened",
2351
2390
  "attribute": "opened",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.104.0",
3
+ "version": "3.105.0",
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",