mypgs 2.1.0 → 3.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/.vscode/tasks.json +39 -0
- package/AGENTS.md +22 -21
- package/README.md +2 -2
- package/assets/javascript/components/_menu.js +2 -1
- package/assets/javascript/components/_modals.js +1 -1
- package/assets/javascript/components/_notifications.js +2 -1
- package/assets/javascript/components/_slides.js +2 -2
- package/assets/scss/base/_body.scss +5 -5
- package/assets/scss/base/_general.scss +27 -18
- package/assets/scss/base/_variables.scss +1 -1
- package/assets/scss/components/_accordion.scss +9 -7
- package/assets/scss/components/_alerts.scss +71 -0
- package/assets/scss/components/_badges.scss +40 -48
- package/assets/scss/components/_button.scss +27 -19
- package/assets/scss/components/_card.scss +9 -4
- package/assets/scss/components/_formAddon.scss +5 -1
- package/assets/scss/components/_logo.scss +3 -4
- package/assets/scss/components/_menu.scss +26 -3
- package/assets/scss/components/_modals.scss +2 -2
- package/assets/scss/components/_stepTabs.scss +2 -1
- package/assets/scss/index.scss +2 -3
- package/assets/scss/layout/_header.scss +3 -3
- package/assets/scss/layout/_responsive.scss +63 -0
- package/assets/scss/mixin/_mx-base.scss +4 -8
- package/assets/scss/mixin/_mx-button.scss +74 -70
- package/assets/scss/mixin/_mx-card.scss +33 -36
- package/assets/scss/mixin/_mx-form.scss +10 -5
- package/assets/scss/mixin/_mx-formAddon.scss +100 -58
- package/assets/scss/mixin/_mx-hover.scss +21 -15
- package/assets/scss/mixin/_mx-responsive.scss +81 -201
- package/demo/demo.css +9 -6
- package/demo/demo.html +7 -5
- package/demo/demo.js +34 -32
- package/dist/css/index.css +2502 -3507
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/javascript/index.js +7 -5
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/index.min.js +1 -1
- package/docs/componenti-e-markup.md +5 -5
- package/docs/components/accordion.md +3 -3
- package/docs/components/alerts.md +67 -0
- package/docs/components/badges.md +11 -8
- package/docs/components/breadcumbs.md +1 -1
- package/docs/components/button.md +9 -9
- package/docs/components/card.md +9 -6
- package/docs/components/dropdown.md +1 -1
- package/docs/components/form.md +6 -5
- package/docs/components/formAddon.md +56 -19
- package/docs/components/logo.md +1 -1
- package/docs/components/menu.md +2 -2
- package/docs/components/modal.md +7 -6
- package/docs/components/notification.md +2 -2
- package/docs/components/search.md +8 -7
- package/docs/components/slides.md +5 -6
- package/docs/components/stepTabs.md +7 -7
- package/docs/components/steps.md +1 -1
- package/docs/components/summary.md +1 -1
- package/docs/components/table.md +1 -1
- package/docs/components/tooltip.md +4 -3
- package/docs/convenzioni.md +1 -1
- package/docs/export-e-sviluppo.md +1 -1
- package/docs/helper-javascript.md +1 -1
- package/docs/layout/body.md +1 -1
- package/docs/layout/footer.md +7 -3
- package/docs/layout/header.md +5 -4
- package/docs/layout/pageShell.md +11 -11
- package/docs/layout/responsive.md +90 -0
- package/docs/layout/section.md +16 -16
- package/docs/patterns/cookieConsent.md +6 -3
- package/docs/utilizzo-css-scss.md +26 -2
- package/package.json +1 -1
- package/{templates → reference}/html/components/accordion.html +2 -2
- package/reference/html/components/alerts.html +59 -0
- package/{templates → reference}/html/components/badges.html +9 -7
- package/{templates → reference}/html/components/button.html +7 -7
- package/{templates → reference}/html/components/card.html +7 -5
- package/{templates → reference}/html/components/form.html +5 -4
- package/reference/html/components/formAddon.html +109 -0
- package/{templates → reference}/html/components/menu.html +2 -2
- package/{templates → reference}/html/components/modal.html +6 -5
- package/{templates → reference}/html/components/notification.html +2 -2
- package/{templates → reference}/html/components/search.html +7 -6
- package/{templates → reference}/html/components/slides.html +4 -5
- package/{templates → reference}/html/components/stepTabs.html +6 -6
- package/{templates → reference}/html/components/tooltip.html +3 -2
- package/{templates → reference}/html/layout/footer.html +5 -2
- package/{templates → reference}/html/layout/header.html +4 -3
- package/{templates → reference}/html/layout/pageShell.html +10 -10
- package/reference/html/layout/responsive.html +83 -0
- package/{templates → reference}/html/layout/section.html +15 -15
- package/{templates → reference}/html/patterns/cookieConsent.html +4 -2
- package/{templates → reference}/react/components/accordion.jsx +1 -1
- package/reference/react/components/alerts.jsx +46 -0
- package/{templates → reference}/react/components/button.jsx +4 -4
- package/{templates → reference}/react/components/card.jsx +2 -2
- package/{templates → reference}/react/components/form.jsx +1 -1
- package/{templates → reference}/react/components/modal.jsx +2 -2
- package/{templates → reference}/react/components/search.jsx +4 -4
- package/{templates → reference}/react/components/slides.jsx +1 -1
- package/{templates → reference}/react/components/stepTabs.jsx +4 -4
- package/{templates → reference}/react/components/tooltip.jsx +1 -1
- package/{templates → reference}/react/layout/pageShell.jsx +2 -2
- package/reference/react/layout/responsive.jsx +61 -0
- package/{templates → reference}/react/layout/section.jsx +12 -12
- package/{templates → reference}/react/patterns/cookieConsent.jsx +1 -1
- package/{templates → reference}/react/patterns/footer.jsx +1 -1
- package/{templates → reference}/react/patterns/header.jsx +2 -2
- package/scripts/generate-component-docs.js +8 -8
- package/assets/scss/layout/_flex.scss +0 -49
- package/assets/scss/layout/_gap.scss +0 -21
- package/assets/scss/layout/_grid.scss +0 -13
- package/docs/layout/flex.md +0 -116
- package/docs/layout/grid.md +0 -116
- package/templates/html/components/formAddon.html +0 -72
- package/templates/html/layout/flex.html +0 -109
- package/templates/html/layout/grid.html +0 -109
- package/templates/react/layout/flex.jsx +0 -36
- package/templates/react/layout/grid.jsx +0 -36
- /package/{templates → reference}/html/components/breadcumbs.html +0 -0
- /package/{templates → reference}/html/components/dropdown.html +0 -0
- /package/{templates → reference}/html/components/logo.html +0 -0
- /package/{templates → reference}/html/components/steps.html +0 -0
- /package/{templates → reference}/html/components/summary.html +0 -0
- /package/{templates → reference}/html/components/table.html +0 -0
- /package/{templates → reference}/html/layout/body.html +0 -0
- /package/{templates → reference}/react/components/breadcumbs.jsx +0 -0
- /package/{templates → reference}/react/components/dropdown.jsx +0 -0
- /package/{templates → reference}/react/components/logo.jsx +0 -0
- /package/{templates → reference}/react/components/menu.jsx +0 -0
- /package/{templates → reference}/react/components/notification.jsx +0 -0
- /package/{templates → reference}/react/components/steps.jsx +0 -0
- /package/{templates → reference}/react/components/summary.jsx +0 -0
- /package/{templates → reference}/react/components/table.jsx +0 -0
- /package/{templates → reference}/react/layout/body.jsx +0 -0
package/demo/demo.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//# DEMO PAGE
|
|
2
2
|
|
|
3
|
-
//=
|
|
3
|
+
//= Reference Renderer HTML
|
|
4
4
|
const demoRenderer = {
|
|
5
|
-
|
|
6
|
-
"components/form.html",
|
|
5
|
+
referenceFiles: [
|
|
7
6
|
"components/formAddon.html",
|
|
7
|
+
"components/form.html",
|
|
8
8
|
"components/search.html",
|
|
9
9
|
"components/summary.html",
|
|
10
10
|
"components/menu.html",
|
|
@@ -12,6 +12,7 @@ const demoRenderer = {
|
|
|
12
12
|
"components/modal.html",
|
|
13
13
|
"components/stepTabs.html",
|
|
14
14
|
"components/accordion.html",
|
|
15
|
+
"components/alerts.html",
|
|
15
16
|
"components/badges.html",
|
|
16
17
|
"components/breadcumbs.html",
|
|
17
18
|
"components/button.html",
|
|
@@ -25,23 +26,22 @@ const demoRenderer = {
|
|
|
25
26
|
"components/notification.html",
|
|
26
27
|
"patterns/cookieConsent.html",
|
|
27
28
|
"layout/body.html",
|
|
28
|
-
"layout/
|
|
29
|
-
"layout/grid.html",
|
|
29
|
+
"layout/responsive.html",
|
|
30
30
|
"layout/footer.html",
|
|
31
31
|
"layout/header.html",
|
|
32
32
|
"layout/section.html",
|
|
33
33
|
"layout/pageShell.html",
|
|
34
34
|
],
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
getReferenceTitle(path) {
|
|
37
37
|
return path.replace(".html", "").replace("/", " / ");
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
stripReferenceDocumentation(html) {
|
|
41
41
|
return html.replace(/^\uFEFF?<!--[\t\r\n ]*\/\*\*[\s\S]*?\*\/[\t\r\n ]*-->[\t\r\n ]*/, "");
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
renderSourceReference(section, html) {
|
|
45
45
|
const pre = document.createElement("pre");
|
|
46
46
|
const code = document.createElement("code");
|
|
47
47
|
code.textContent = html.trim();
|
|
@@ -49,9 +49,9 @@ const demoRenderer = {
|
|
|
49
49
|
section.append(pre);
|
|
50
50
|
},
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
renderReference(section, path, html) {
|
|
53
53
|
const content = document.createElement("div");
|
|
54
|
-
content.setAttribute("pgs", "container
|
|
54
|
+
content.setAttribute("pgs", "container flexColumn gapElements");
|
|
55
55
|
content.innerHTML = html;
|
|
56
56
|
section.append(content);
|
|
57
57
|
},
|
|
@@ -64,15 +64,15 @@ const demoRenderer = {
|
|
|
64
64
|
|
|
65
65
|
renderTitle(section, path) {
|
|
66
66
|
const title = document.createElement("p");
|
|
67
|
-
title.classList.add("
|
|
68
|
-
title.innerHTML = "<strong>" + this.
|
|
67
|
+
title.classList.add("reference-title");
|
|
68
|
+
title.innerHTML = "<strong>" + this.getReferenceTitle(path) + "</strong>";
|
|
69
69
|
section.append(title);
|
|
70
70
|
},
|
|
71
71
|
|
|
72
|
-
async
|
|
73
|
-
const response = await fetch(`../
|
|
72
|
+
async loadReference(path) {
|
|
73
|
+
const response = await fetch(`../reference/html/${path}`);
|
|
74
74
|
if (!response.ok) throw new Error(`${path}: ${response.status}`);
|
|
75
|
-
return this.
|
|
75
|
+
return this.stripReferenceDocumentation(await response.text());
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
loadPgsJavascript() {
|
|
@@ -86,22 +86,22 @@ const demoRenderer = {
|
|
|
86
86
|
},
|
|
87
87
|
|
|
88
88
|
async boot() {
|
|
89
|
-
const BEEFORE = document.getElementById("
|
|
90
|
-
const MAIN = document.getElementById("
|
|
91
|
-
const AFTER = document.getElementById("
|
|
89
|
+
const BEEFORE = document.getElementById("reference-demo-before");
|
|
90
|
+
const MAIN = document.getElementById("reference-demo-main");
|
|
91
|
+
const AFTER = document.getElementById("reference-demo-after");
|
|
92
92
|
|
|
93
|
-
for (const path of this.
|
|
93
|
+
for (const path of this.referenceFiles) {
|
|
94
94
|
const isHeader = path === "layout/header.html";
|
|
95
95
|
const isfooter = path === "layout/footer.html";
|
|
96
96
|
const isBody = path === "layout/body.html";
|
|
97
97
|
|
|
98
98
|
if (isHeader || isfooter) {
|
|
99
99
|
try {
|
|
100
|
-
const html = await this.
|
|
100
|
+
const html = await this.loadReference(path);
|
|
101
101
|
this.renderLayout(isHeader ? BEEFORE : AFTER, path, html);
|
|
102
102
|
} catch (error) {
|
|
103
103
|
const message = document.createElement("p");
|
|
104
|
-
message.textContent = `
|
|
104
|
+
message.textContent = `Riferimento non caricato: ${error.message}`;
|
|
105
105
|
(isHeader ? BEEFORE : AFTER).append(message);
|
|
106
106
|
}
|
|
107
107
|
continue;
|
|
@@ -111,24 +111,24 @@ const demoRenderer = {
|
|
|
111
111
|
const isSection = path !== "layout/section.html" && path !== "layout/pageShell.html"
|
|
112
112
|
isSection ? section = document.createElement("section") : section = document.createElement("div");
|
|
113
113
|
|
|
114
|
-
if (isSection) section.setAttribute("pgs", "section
|
|
114
|
+
if (isSection) section.setAttribute("pgs", "section flexColumn gapElements");
|
|
115
115
|
|
|
116
|
-
section.dataset.
|
|
116
|
+
section.dataset.reference = path;
|
|
117
117
|
this.renderTitle(section, path);
|
|
118
118
|
|
|
119
119
|
if (isBody) {
|
|
120
|
-
const html = await this.
|
|
121
|
-
this.
|
|
120
|
+
const html = await this.loadReference(path);
|
|
121
|
+
this.renderSourceReference(section, html);
|
|
122
122
|
MAIN.append(section);
|
|
123
123
|
continue;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
try {
|
|
127
|
-
const html = await this.
|
|
128
|
-
this.
|
|
127
|
+
const html = await this.loadReference(path);
|
|
128
|
+
this.renderReference(section, path, html);
|
|
129
129
|
} catch (error) {
|
|
130
130
|
const message = document.createElement("p");
|
|
131
|
-
message.textContent = `
|
|
131
|
+
message.textContent = `Riferimento non caricato: ${error.message}`;
|
|
132
132
|
section.append(message);
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -140,10 +140,12 @@ const demoRenderer = {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
try {
|
|
143
|
-
|
|
143
|
+
//# CORE
|
|
144
144
|
await this.loadPgsJavascript();
|
|
145
145
|
configureSearchDemo();
|
|
146
146
|
configureFormDemo();
|
|
147
|
+
document.body.classList.remove('is-loading');
|
|
148
|
+
//# end CORE
|
|
147
149
|
} catch (error) {
|
|
148
150
|
console.error("Demo PGS non inizializzata.", error);
|
|
149
151
|
}
|
|
@@ -153,10 +155,10 @@ const demoRenderer = {
|
|
|
153
155
|
//= Search Demo
|
|
154
156
|
function configureSearchDemo() {
|
|
155
157
|
const pgsApi = globalThis.pgs;
|
|
156
|
-
const section = document.querySelector('[data-
|
|
158
|
+
const section = document.querySelector('[data-reference="components/search.html"]');
|
|
157
159
|
if (!pgsApi?.search || !section) return;
|
|
158
160
|
|
|
159
|
-
pgsApi(
|
|
161
|
+
pgsApi(document).querySelectorAll("search").forEach(search => {
|
|
160
162
|
pgsApi.search.api(search)?.configure({
|
|
161
163
|
minLength: 2,
|
|
162
164
|
debounce: 250,
|
|
@@ -205,7 +207,7 @@ function configureSearchDemo() {
|
|
|
205
207
|
//= Form Demo
|
|
206
208
|
function configureFormDemo() {
|
|
207
209
|
const pgsApi = globalThis.pgs;
|
|
208
|
-
const section = document.querySelector('[data-
|
|
210
|
+
const section = document.querySelector('[data-reference="components/form.html"]');
|
|
209
211
|
const form = section?.querySelector('[pgs~="form"]');
|
|
210
212
|
if (!form) return;
|
|
211
213
|
|