@ulu/frontend 0.1.0-beta.73 → 0.1.0-beta.74
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/CHANGELOG.md +7 -0
- package/dist/ulu-frontend.min.js +8 -3
- package/docs-dev/changelog/index.html +22 -3
- package/docs-dev/demos/card/index.html +16 -16
- package/docs-dev/demos/data-table/index.html +100 -100
- package/docs-dev/demos/modals/index.html +21 -1
- package/docs-dev/demos/popovers/index.html +0 -5483
- package/docs-dev/javascript/ui-modal-builder/index.html +5 -0
- package/js/ui/modal-builder.js +13 -3
- package/package.json +1 -1
- package/types/ui/modal-builder.d.ts +6 -0
- package/types/ui/modal-builder.d.ts.map +1 -1
|
@@ -5378,6 +5378,11 @@ in twig for example)</li>
|
|
|
5378
5378
|
<td>Extra class/classes to add to title</td>
|
|
5379
5379
|
</tr>
|
|
5380
5380
|
<tr>
|
|
5381
|
+
<td>titleId</td>
|
|
5382
|
+
<td><code>string</code></td>
|
|
5383
|
+
<td>Set the title id (to tie to a custom title implementation, if using built in title this will be set automatically)</td>
|
|
5384
|
+
</tr>
|
|
5385
|
+
<tr>
|
|
5381
5386
|
<td>nonModal</td>
|
|
5382
5387
|
<td><code>boolean</code></td>
|
|
5383
5388
|
<td>If <code>true</code>, the modal will not prevent interaction with elements behind it. Defaults to <code>false</code>.</td>
|
package/js/ui/modal-builder.js
CHANGED
|
@@ -10,6 +10,7 @@ import { createElementFromHtml } from "@ulu/utils/browser/dom.js";
|
|
|
10
10
|
import { Resizer } from "./resizer.js";
|
|
11
11
|
import { baseAttribute, closeAttribute, defaults as dialogDefaults } from "./dialog.js";
|
|
12
12
|
|
|
13
|
+
|
|
13
14
|
/**
|
|
14
15
|
* Modal Builder Component Initializer
|
|
15
16
|
*/
|
|
@@ -27,6 +28,7 @@ export const initializer = new ComponentInitializer({
|
|
|
27
28
|
* @property {string|null} title - The title of the modal. Defaults to `null`.
|
|
28
29
|
* @property {string|null} titleIcon - The class name for an icon to display in the title. Defaults to `null`.
|
|
29
30
|
* @property {string} titleClass - Extra class/classes to add to title
|
|
31
|
+
* @property {string} titleId - Set the title id (to tie to a custom title implementation, if using built in title this will be set automatically)
|
|
30
32
|
* @property {boolean} nonModal - If `true`, the modal will not prevent interaction with elements behind it. Defaults to `false`.
|
|
31
33
|
* @property {boolean} documentEnd - If `true`, the modal will be appended to the end of the `document.body`. Defaults to `true`.
|
|
32
34
|
* @property {boolean} allowResize - If `true`, the modal will be resizable. Defaults to `false`.
|
|
@@ -56,6 +58,8 @@ export const defaults = {
|
|
|
56
58
|
title: null,
|
|
57
59
|
titleIcon: null,
|
|
58
60
|
titleClass: "",
|
|
61
|
+
labelledby: null,
|
|
62
|
+
describedby: null,
|
|
59
63
|
nonModal: false,
|
|
60
64
|
documentEnd: true,
|
|
61
65
|
allowResize: false,
|
|
@@ -85,7 +89,7 @@ export const defaults = {
|
|
|
85
89
|
* @returns {String} Markup for modal
|
|
86
90
|
*/
|
|
87
91
|
template(id, config) {
|
|
88
|
-
const { baseClass } = config;
|
|
92
|
+
const { baseClass, describedby } = config;
|
|
89
93
|
const classes = [
|
|
90
94
|
baseClass,
|
|
91
95
|
`${ baseClass }--${ config.position }`,
|
|
@@ -97,11 +101,17 @@ export const defaults = {
|
|
|
97
101
|
...(config.noMinHeight ? [`${ baseClass }--no-min-height`] : [] ),
|
|
98
102
|
...(config.class ? [config.class] : []),
|
|
99
103
|
];
|
|
104
|
+
const labelledby = config.title ? `${ id }--title` : config.labelledby;
|
|
100
105
|
return `
|
|
101
|
-
<dialog
|
|
106
|
+
<dialog
|
|
107
|
+
id="${ id }"
|
|
108
|
+
class="${ classes.join(" ") }"
|
|
109
|
+
${ labelledby ? `aria-labelledby="${ labelledby }"` : "" }
|
|
110
|
+
${ describedby ? `aria-describedby="${ describedby }"` : "" }
|
|
111
|
+
>
|
|
102
112
|
${ config.title ? `
|
|
103
113
|
<header class="${ baseClass }__header">
|
|
104
|
-
<h2 class="${ baseClass }__title ${ config.titleClass }">
|
|
114
|
+
<h2 id="${ labelledby }" class="${ baseClass }__title ${ config.titleClass }">
|
|
105
115
|
${ config.titleIcon ?
|
|
106
116
|
`<span class="${ baseClass }__title-icon ${ config.titleIcon }" aria-hidden="true"></span>` : ""
|
|
107
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.74",
|
|
4
4
|
"description": "A versatile SCSS and JavaScript component library offering configurable, accessible components and flexible integration into any project, with SCSS modules suitable for modern JS frameworks.",
|
|
5
5
|
"browser": "js/index.js",
|
|
6
6
|
"main": "index.js",
|
|
@@ -23,6 +23,8 @@ export namespace defaults {
|
|
|
23
23
|
export let title: any;
|
|
24
24
|
export let titleIcon: any;
|
|
25
25
|
export let titleClass: string;
|
|
26
|
+
export let labelledby: any;
|
|
27
|
+
export let describedby: any;
|
|
26
28
|
export let nonModal: boolean;
|
|
27
29
|
export let documentEnd: boolean;
|
|
28
30
|
export let allowResize: boolean;
|
|
@@ -67,6 +69,10 @@ export type DefaultModalOptions = {
|
|
|
67
69
|
* - Extra class/classes to add to title
|
|
68
70
|
*/
|
|
69
71
|
titleClass: string;
|
|
72
|
+
/**
|
|
73
|
+
* - Set the title id (to tie to a custom title implementation, if using built in title this will be set automatically)
|
|
74
|
+
*/
|
|
75
|
+
titleId: string;
|
|
70
76
|
/**
|
|
71
77
|
* - If `true`, the modal will not prevent interaction with elements behind it. Defaults to `false`.
|
|
72
78
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-builder.d.ts","sourceRoot":"","sources":["../../js/ui/modal-builder.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modal-builder.d.ts","sourceRoot":"","sources":["../../js/ui/modal-builder.js"],"names":[],"mappings":"AA0IA;;GAEG;AACH,gDAEC;AAED;;;GAGG;AACH,6BAQC;AAED;;;;GAIG;AACH,oCAHW,IAAI;;EAmDd;AAvMD;;GAEG;AACH,+CAGG;;;;;;;;;;;;;;;;;;;;;;IAyDD,uDAGC;IACD,yDAGC;IACD;;;;;OAKG;IACH,0DA0CC;;;;;;;;;;;;WAzGW,MAAM,GAAC,IAAI;;;;eACX,MAAM,GAAC,IAAI;;;;gBACX,MAAM;;;;aACN,MAAM;;;;cACN,OAAO;;;;iBACP,OAAO;;;;iBACP,OAAO;;;;cACP,QAAQ,GAAC,UAAU,GAAC,YAAY,GAAC,WAAW,GAAC,aAAa,GAAC,eAAe,GAAC,cAAc;;;;eACzF,OAAO;;;;gBACP,OAAO;;;;UACP,SAAS,GAAC,OAAO,GAAC,OAAO,GAAC,YAAY;;;;WACtC,OAAO;;;;iBACP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;oBACN,MAAM;;;;sBACN,MAAM;;;;WACN,OAAO;;;;8BACE,MAAM,KAAG,MAAM;;;;mBACf,MAAM,KAAG,MAAM;;qCAzCD,oBAAoB"}
|