desy-html 13.0.1 → 14.0.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.
- package/docs/_include.template-header.njk +5 -0
- package/docs/_macro.example-render.njk +5 -0
- package/docs/componentes.html +3 -0
- package/docs/ds/_ds.example.checkboxes.njk +1 -1
- package/docs/ds/_ds.example.date-input.njk +3 -3
- package/docs/ds/_ds.example.file-upload.njk +1 -1
- package/docs/ds/_ds.example.input-group.njk +1 -1
- package/docs/ds/_ds.example.input.njk +5 -5
- package/docs/ds/_ds.example.radios.njk +1 -1
- package/docs/ds/_ds.example.searchbar.njk +1 -1
- package/docs/ds/_ds.example.select.njk +5 -5
- package/docs/ds/_ds.example.textarea.njk +7 -7
- package/docs/examples-treegrid.html +8 -0
- package/docs/index.html +8 -0
- package/gulpfile.js +15 -1
- package/package.json +2 -1
- package/src/css/styles.css +1 -0
- package/src/js/aria/MenuNavigation.js +12 -3
- package/src/js/aria/tree.js +320 -31
- package/src/js/aria/treegrid.js +508 -0
- package/src/js/aria/treeitem.js +25 -19
- package/src/js/desy-html.js +37 -31
- package/src/js/index.js +12 -10
- package/src/templates/components/character-count/_examples.character-count.njk +3 -15
- package/src/templates/components/checkboxes/_examples.checkboxes.njk +67 -86
- package/src/templates/components/date-input/_examples.date-input.njk +15 -15
- package/src/templates/components/datepicker/_examples.datepicker.njk +7 -6
- package/src/templates/components/datepicker/_template.datepicker.njk +0 -1
- package/src/templates/components/description-list/_examples.description-list.njk +2 -2
- package/src/templates/components/dialog/_examples.dialog.njk +2 -2
- package/src/templates/components/dropdown/_examples.dropdown.njk +3 -3
- package/src/templates/components/error-message/_examples.error-message.njk +4 -2
- package/src/templates/components/error-summary/params.error-summary.yaml +0 -3
- package/src/templates/components/fieldset/_examples.fieldset.njk +2 -29
- package/src/templates/components/file-upload/_examples.file-upload.njk +4 -15
- package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -0
- package/src/templates/components/hint/params.hint.yaml +0 -14
- package/src/templates/components/input/_examples.input.njk +9 -45
- package/src/templates/components/input-group/_examples.input-group.njk +19 -18
- package/src/templates/components/item/_examples.item.njk +1 -0
- package/src/templates/components/media-object/_examples.media-object.njk +6 -5
- package/src/templates/components/menubar/_template.menubar.njk +2 -2
- package/src/templates/components/menubar/params.menubar.yaml +0 -10
- package/src/templates/components/modal/_examples.modal.njk +1 -1
- package/src/templates/components/notification/_examples.notification.njk +8 -2
- package/src/templates/components/pill/_examples.pill.njk +2 -1
- package/src/templates/components/radios/_examples.radios.njk +56 -91
- package/src/templates/components/searchbar/_examples.searchbar.njk +2 -1
- package/src/templates/components/select/_examples.select.njk +3 -29
- package/src/templates/components/status-item/_examples.status-item.njk +1 -0
- package/src/templates/components/table-advanced/params.table-advanced.yaml +1 -1
- package/src/templates/components/textarea/_examples.textarea.njk +3 -14
- package/src/templates/components/tree/_examples.tree.njk +157 -3
- package/src/templates/components/tree/_template.tree.njk +112 -101
- package/src/templates/components/tree/params.tree.yaml +4 -0
- package/src/templates/components/treegrid/_examples.treegrid.njk +1240 -0
- package/src/templates/components/treegrid/_macro.treegrid.njk +3 -0
- package/src/templates/components/treegrid/_styles.treegrid.css +39 -0
- package/src/templates/components/treegrid/_template.treegrid.njk +91 -0
- package/src/templates/components/treegrid/params.treegrid.yaml +132 -0
|
@@ -358,6 +358,11 @@
|
|
|
358
358
|
href: "examples-tree.html",
|
|
359
359
|
text: "Tree",
|
|
360
360
|
id: "page-examples-tree"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
href: "examples-treegrid.html",
|
|
364
|
+
text: "Treegrid",
|
|
365
|
+
id: "page-examples-treegrid"
|
|
361
366
|
}],
|
|
362
367
|
attributes: {
|
|
363
368
|
"id": "navegacion-ejemplos-offcanvas",
|
|
@@ -108,6 +108,8 @@ import componentToggle %}
|
|
|
108
108
|
import componentTooltip %}
|
|
109
109
|
{% from "components/tree/_macro.tree.njk"
|
|
110
110
|
import componentTree %}
|
|
111
|
+
{% from "components/treegrid/_macro.treegrid.njk"
|
|
112
|
+
import componentTreegrid %}
|
|
111
113
|
|
|
112
114
|
|
|
113
115
|
{% macro exampleRender(data) %}
|
|
@@ -296,6 +298,9 @@ import componentTree %}
|
|
|
296
298
|
{{ componentTooltip(example.data) }}
|
|
297
299
|
{% elseif exampleComponent == "tree" %}
|
|
298
300
|
{{ componentTree(example.data) }}
|
|
301
|
+
{% elseif exampleComponent == "treegrid" %}
|
|
302
|
+
{{ componentTreegrid(example.data) }}
|
|
303
|
+
{% else %}
|
|
299
304
|
|
|
300
305
|
{% endif %}
|
|
301
306
|
</div>
|
package/docs/componentes.html
CHANGED
|
@@ -176,6 +176,9 @@
|
|
|
176
176
|
<div>
|
|
177
177
|
<p class="c-paragraph-base"><a href="examples-tree.html" class="c-link">Tree</a></p>
|
|
178
178
|
</div>
|
|
179
|
+
<div>
|
|
180
|
+
<p class="c-paragraph-base"><a href="examples-treegrid.html" class="c-link">Treegrid</a></p>
|
|
181
|
+
</div>
|
|
179
182
|
</div>
|
|
180
183
|
<div class="pb-2xl"></div>
|
|
181
184
|
{% endblock %}
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
"errorMessage": {
|
|
122
|
-
"text": "
|
|
122
|
+
"text": "Aqui va un mensaje de error"
|
|
123
123
|
},
|
|
124
124
|
"items": [
|
|
125
125
|
{
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"text": "Por ejemplo, 31 3 1980"
|
|
160
160
|
},
|
|
161
161
|
"errorMessage": {
|
|
162
|
-
"text": "
|
|
162
|
+
"text": "Aqui va un mensaje de error"
|
|
163
163
|
},
|
|
164
164
|
"items": [
|
|
165
165
|
{
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"text": "Por ejemplo, 31 3 1980"
|
|
200
200
|
},
|
|
201
201
|
"errorMessage": {
|
|
202
|
-
"text": "
|
|
202
|
+
"text": "Aqui va un mensaje de error"
|
|
203
203
|
},
|
|
204
204
|
"items": [
|
|
205
205
|
{
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"text": "Tu foto puede estar en tus Imágenes, Fotos, Descargas o el Escritorio. O en una aplicación como Fotos."
|
|
47
47
|
},
|
|
48
48
|
"errorMessage": {
|
|
49
|
-
"text": "Error
|
|
49
|
+
"text": "Error message goes here"
|
|
50
50
|
},
|
|
51
51
|
"classes": "text-sm lg:text-base"
|
|
52
52
|
}) }}
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"id": "input-14",
|
|
46
46
|
"name": "test-name",
|
|
47
47
|
"errorMessage": {
|
|
48
|
-
"text": "
|
|
48
|
+
"text": "Mensaje de error"
|
|
49
49
|
},
|
|
50
50
|
"classes": "w-full"
|
|
51
51
|
}) }}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"id": "input-15",
|
|
62
62
|
"name": "test-name",
|
|
63
63
|
"errorMessage": {
|
|
64
|
-
"text": "
|
|
64
|
+
"text": "Mensaje de error"
|
|
65
65
|
},
|
|
66
66
|
"classes": "w-full"
|
|
67
67
|
}) }}
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"id": "input-24",
|
|
118
118
|
"name": "test-name",
|
|
119
119
|
"errorMessage": {
|
|
120
|
-
"text": "
|
|
120
|
+
"text": "Mensaje de error",
|
|
121
121
|
"classes": "text-sm"
|
|
122
122
|
},
|
|
123
123
|
"classes": "c-input--sm w-full"
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"id": "input-25",
|
|
137
137
|
"name": "test-name",
|
|
138
138
|
"errorMessage": {
|
|
139
|
-
"text": "
|
|
139
|
+
"text": "Mensaje de error",
|
|
140
140
|
"classes": "text-sm"
|
|
141
141
|
},
|
|
142
142
|
"classes": "c-input--sm w-full"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"id": "classes-applied-b",
|
|
157
157
|
"name": "classes-applied-b",
|
|
158
158
|
"errorMessage": {
|
|
159
|
-
"text": "Error
|
|
159
|
+
"text": "Error message goes here",
|
|
160
160
|
"classes": "order-1 w-full pt-sm"
|
|
161
161
|
},
|
|
162
162
|
"classes": "lg:flex-1"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"text": "Label"
|
|
85
85
|
},
|
|
86
86
|
"errorMessage": {
|
|
87
|
-
"text": "
|
|
87
|
+
"text": "Mensaje de error"
|
|
88
88
|
},
|
|
89
89
|
"items": [
|
|
90
90
|
{
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"text": "Hint texto descriptivo"
|
|
115
115
|
},
|
|
116
116
|
"errorMessage": {
|
|
117
|
-
"text": "
|
|
117
|
+
"text": "Mensaje de error"
|
|
118
118
|
},
|
|
119
119
|
"items": [
|
|
120
120
|
{
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
"classes": "text-sm"
|
|
225
225
|
},
|
|
226
226
|
"errorMessage": {
|
|
227
|
-
"text": "
|
|
227
|
+
"text": "Mensaje de error",
|
|
228
228
|
"classes": "text-sm"
|
|
229
229
|
},
|
|
230
230
|
"items": [
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
"classes": "text-sm"
|
|
258
258
|
},
|
|
259
259
|
"errorMessage": {
|
|
260
|
-
"text": "
|
|
260
|
+
"text": "Mensaje de error",
|
|
261
261
|
"classes": "text-sm"
|
|
262
262
|
},
|
|
263
263
|
"items": [
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
"classes": "lg:flex lg:flex-wrap lg:items-center lg:gap-x-base"
|
|
367
367
|
},
|
|
368
368
|
"errorMessage": {
|
|
369
|
-
"text": "Error
|
|
369
|
+
"text": "Error message goes here",
|
|
370
370
|
"classes": "order-1 w-full pt-sm"
|
|
371
371
|
},
|
|
372
372
|
"items": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"id": "input-14",
|
|
47
47
|
"name": "test-name",
|
|
48
48
|
"errorMessage": {
|
|
49
|
-
"text": "
|
|
49
|
+
"text": "Mensaje de error"
|
|
50
50
|
},
|
|
51
51
|
"classes": "w-full"
|
|
52
52
|
}) }}
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"id": "input-15",
|
|
63
63
|
"name": "test-name",
|
|
64
64
|
"errorMessage": {
|
|
65
|
-
"text": "
|
|
65
|
+
"text": "Mensaje de error"
|
|
66
66
|
},
|
|
67
67
|
"classes": "w-full"
|
|
68
68
|
}) }}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"id": "input-14",
|
|
117
117
|
"name": "test-name",
|
|
118
118
|
"errorMessage": {
|
|
119
|
-
"text": "
|
|
119
|
+
"text": "Mensaje de error"
|
|
120
120
|
},
|
|
121
121
|
"maxlength": 10,
|
|
122
122
|
"classes": "w-full"
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"id": "input-15",
|
|
134
134
|
"name": "test-name",
|
|
135
135
|
"errorMessage": {
|
|
136
|
-
"text": "
|
|
136
|
+
"text": "Mensaje de error"
|
|
137
137
|
},
|
|
138
138
|
"maxlength": 10,
|
|
139
139
|
"classes": "w-full"
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"id": "input-24",
|
|
191
191
|
"name": "test-name",
|
|
192
192
|
"errorMessage": {
|
|
193
|
-
"text": "
|
|
193
|
+
"text": "Mensaje de error",
|
|
194
194
|
"classes": "text-sm"
|
|
195
195
|
},
|
|
196
196
|
"classes": "text-sm w-full"
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"id": "input-25",
|
|
210
210
|
"name": "test-name",
|
|
211
211
|
"errorMessage": {
|
|
212
|
-
"text": "
|
|
212
|
+
"text": "Mensaje de error",
|
|
213
213
|
"classes": "text-sm"
|
|
214
214
|
},
|
|
215
215
|
"classes": "text-sm w-full"
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"id": "classes-applied-b",
|
|
230
230
|
"name": "classes-applied-b",
|
|
231
231
|
"errorMessage": {
|
|
232
|
-
"text": "Error
|
|
232
|
+
"text": "Error message goes here",
|
|
233
233
|
"classes": "order-1 w-full pt-sm"
|
|
234
234
|
},
|
|
235
235
|
"classes": "lg:flex-1"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% set title = "Treegrid. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
|
|
2
|
+
|
|
3
|
+
{% set activePage = "page-componentes" %}
|
|
4
|
+
{% set activeComponent = "Treegrid" %}
|
|
5
|
+
{% extends "_template.examples.njk" %}
|
|
6
|
+
{% block contentBlock %}
|
|
7
|
+
{% import "components/treegrid/_examples.treegrid.njk" as exampleData %}
|
|
8
|
+
{% endblock %}
|
package/docs/index.html
CHANGED
|
@@ -39,6 +39,14 @@
|
|
|
39
39
|
|
|
40
40
|
<h2>Changelog (English)</h2>
|
|
41
41
|
<p>What's new in the latest version of desy-html</p>
|
|
42
|
+
<h3>v.14.0.0</h3>
|
|
43
|
+
<ul class="text-sm">
|
|
44
|
+
<li>Added Treegrid component. Better gulp compilation with errors.</li>
|
|
45
|
+
</ul>
|
|
46
|
+
<h3>v.13.0.2</h3>
|
|
47
|
+
<ul class="text-sm">
|
|
48
|
+
<li>Accesibility fixes in most of the component examples.</li>
|
|
49
|
+
</ul>
|
|
42
50
|
<h3>v.13.0.1</h3>
|
|
43
51
|
<ul class="text-sm">
|
|
44
52
|
<li>Removed backstop npm script entries as they are not used.</li>
|
package/gulpfile.js
CHANGED
|
@@ -5,6 +5,7 @@ import gulp from 'gulp';
|
|
|
5
5
|
import sourcemaps from 'gulp-sourcemaps';
|
|
6
6
|
import clean from 'gulp-clean';
|
|
7
7
|
import nunjucksRender from 'gulp-nunjucks-render';
|
|
8
|
+
import plumber from 'gulp-plumber';
|
|
8
9
|
import browserSyncPackage from 'browser-sync';
|
|
9
10
|
import postcss from 'gulp-postcss';
|
|
10
11
|
import atimport from 'postcss-import';
|
|
@@ -75,7 +76,12 @@ function css() {
|
|
|
75
76
|
tailwindcssNesting(),
|
|
76
77
|
tailwindcss(TAILWIND_CONFIG),
|
|
77
78
|
autoprefixer()
|
|
78
|
-
])
|
|
79
|
+
]).on('error', function(err) {
|
|
80
|
+
console.log('\x1b[31m%s\x1b[0m', '=== POSTCSS ERROR ===');
|
|
81
|
+
console.log('\x1b[31m%s\x1b[0m', err.message);
|
|
82
|
+
console.log('\x1b[31m%s\x1b[0m', '===================');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
})
|
|
79
85
|
)
|
|
80
86
|
.pipe(stripCssComments({preserve: false}))
|
|
81
87
|
.pipe(footer('\n'))
|
|
@@ -89,6 +95,14 @@ function html() {
|
|
|
89
95
|
|
|
90
96
|
function nunjucks() {
|
|
91
97
|
return gulp.src(SOURCE_NUNJUCKS_DIR)
|
|
98
|
+
.pipe(plumber({
|
|
99
|
+
errorHandler: function(err) {
|
|
100
|
+
console.log('\x1b[31m%s\x1b[0m', '=== NUNJUCKS ERROR ===');
|
|
101
|
+
console.log('\x1b[31m%s\x1b[0m', 'Error: ' + err.message);
|
|
102
|
+
console.log('\x1b[31m%s\x1b[0m', '=====================');
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
}))
|
|
92
106
|
.pipe(nunjucksRender({
|
|
93
107
|
envOptions: {
|
|
94
108
|
autoescape: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "desy-html",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"gulp-clean-css": "^4.3.0",
|
|
53
53
|
"gulp-footer": "^2.1.0",
|
|
54
54
|
"gulp-nunjucks-render": "^2.2.3",
|
|
55
|
+
"gulp-plumber": "^1.2.1",
|
|
55
56
|
"gulp-postcss": "^9.0.1",
|
|
56
57
|
"gulp-sourcemaps": "^2.6.5",
|
|
57
58
|
"gulp-strip-css-comments": "^2.0.0",
|
package/src/css/styles.css
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
@import "../templates/components/toggle/_styles.toggle.css";
|
|
44
44
|
@import "../templates/components/tooltip/_styles.tooltip.css";
|
|
45
45
|
@import "../templates/components/tree/_styles.tree.css";
|
|
46
|
+
@import "../templates/components/treegrid/_styles.treegrid.css";
|
|
46
47
|
@import "./component.form-group.css";
|
|
47
48
|
@import "./component.tippy-box.css";
|
|
48
49
|
@import "./component.headroom.css";
|
|
@@ -35,7 +35,10 @@ export function MenuNavigation(aria) {
|
|
|
35
35
|
const getElement = element.parentElement.parentElement.parentElement.parentElement.querySelector('button');
|
|
36
36
|
getElement.classList.add('c-menu-navigation__button--primary', 'c-menu-navigation__button--has-selection');
|
|
37
37
|
getElement.setAttribute('aria-current', 'true');
|
|
38
|
-
|
|
38
|
+
const mainSpan = getElement.querySelector('span:not(.sr-only)');
|
|
39
|
+
if (mainSpan) {
|
|
40
|
+
mainSpan.innerHTML = `<strong class="font-bold">${mainSpan.textContent}</strong>`;
|
|
41
|
+
}
|
|
39
42
|
element.innerHTML = `<strong class="font-bold">${element.textContent}</strong>`;
|
|
40
43
|
}
|
|
41
44
|
})
|
|
@@ -97,7 +100,10 @@ export function MenuNavigation(aria) {
|
|
|
97
100
|
const getElementParent = link.parentElement.parentElement.parentElement.parentElement.querySelector('button');
|
|
98
101
|
getElementParent.classList.remove('c-menu-navigation__button--primary', 'c-menu-navigation__button--has-selection');
|
|
99
102
|
getElementParent.removeAttribute('aria-current');
|
|
100
|
-
|
|
103
|
+
const mainSpanParent2 = getElementParent.querySelector('span:not(.sr-only)');
|
|
104
|
+
if (mainSpanParent2) {
|
|
105
|
+
mainSpanParent2.innerHTML = mainSpanParent2.textContent;
|
|
106
|
+
}
|
|
101
107
|
link.removeAttribute('aria-current');
|
|
102
108
|
link.innerHTML = `${link.textContent}`;
|
|
103
109
|
}
|
|
@@ -107,7 +113,10 @@ export function MenuNavigation(aria) {
|
|
|
107
113
|
const getElementParent = link.parentElement.parentElement.parentElement.parentElement.querySelector('button');
|
|
108
114
|
getElementParent.classList.add('c-menu-navigation__button--primary', 'c-menu-navigation__button--has-selection');
|
|
109
115
|
getElementParent.setAttribute('aria-current', 'true');
|
|
110
|
-
|
|
116
|
+
const mainSpanParent = getElementParent.querySelector('span:not(.sr-only)');
|
|
117
|
+
if (mainSpanParent) {
|
|
118
|
+
mainSpanParent.innerHTML = `<strong class="font-bold">${mainSpanParent.textContent}</strong>`;
|
|
119
|
+
}
|
|
111
120
|
}
|
|
112
121
|
});
|
|
113
122
|
};
|