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