mypgs 1.6.0 → 2.1.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/AGENTS.md +2 -2
- package/README.md +25 -25
- package/assets/javascript/components/_accordion.js +2 -2
- package/assets/javascript/components/_modals.js +159 -136
- package/assets/javascript/components/_notifications.js +19 -9
- package/assets/javascript/components/_search.js +2 -2
- package/assets/javascript/components/_slides.js +66 -32
- package/assets/javascript/components/_stepTabs.js +4 -4
- package/assets/javascript/components/_steps.js +2 -2
- package/assets/javascript/components/_summary.js +2 -2
- package/assets/javascript/functions/_formValidate.js +97 -53
- package/assets/javascript/functions/_scrollY.js +10 -10
- package/assets/javascript/layout/_header.js +3 -0
- package/assets/scss/base/_html.scss +2 -2
- package/assets/scss/base/_variables.scss +2 -2
- package/assets/scss/components/_accordion.scss +0 -2
- package/assets/scss/components/_button.scss +1 -1
- package/assets/scss/components/_form.scss +2 -18
- package/assets/scss/components/_formAddon.scss +18 -0
- package/assets/scss/components/_modals.scss +5 -3
- package/assets/scss/components/_notification.scss +23 -30
- package/assets/scss/components/_search.scss +29 -23
- package/assets/scss/components/_slides.scss +0 -1
- package/assets/scss/components/_tooltip.scss +0 -1
- package/assets/scss/index.scss +1 -0
- package/assets/scss/layout/_footer.scss +0 -2
- package/assets/scss/layout/_header.scss +9 -1
- package/assets/scss/layout/_pageShell.scss +24 -17
- package/assets/scss/mixin/_mx-button.scss +30 -76
- package/assets/scss/mixin/_mx-card.scss +11 -9
- package/assets/scss/mixin/_mx-form.scss +10 -12
- package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +23 -26
- package/assets/scss/mixin/_mx-hover.scss +75 -0
- package/assets/scss/mixin/_settings.scss +2 -1
- package/assets/scss/mixin/mixin.scss +2 -1
- package/{templates/html → demo}/demo.html +1 -1
- package/demo/demo.js +241 -0
- package/dist/css/index.css +1317 -1674
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/javascript/index.js +356 -255
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/index.min.js +1 -1
- package/docs/componenti-e-markup.md +32 -32
- package/docs/components/accordion.md +61 -0
- package/docs/components/badges.md +67 -0
- package/docs/components/breadcumbs.md +43 -0
- package/docs/components/button.md +59 -0
- package/docs/components/card.md +50 -0
- package/docs/components/dropdown.md +135 -0
- package/docs/components/form.md +136 -0
- package/docs/components/formAddon.md +79 -0
- package/docs/components/logo.md +36 -0
- package/docs/components/menu.md +90 -0
- package/docs/components/modal.md +131 -0
- package/docs/components/notification.md +81 -0
- package/docs/components/search.md +118 -0
- package/docs/components/slides.md +85 -0
- package/docs/components/stepTabs.md +93 -0
- package/docs/components/steps.md +56 -0
- package/docs/components/summary.md +49 -0
- package/docs/components/table.md +42 -0
- package/docs/components/tooltip.md +53 -0
- package/docs/convenzioni.md +11 -11
- package/docs/export-e-sviluppo.md +3 -3
- package/docs/helper-javascript.md +73 -8
- package/docs/layout/body.md +41 -0
- package/docs/layout/flex.md +116 -0
- package/docs/layout/footer.md +71 -0
- package/docs/layout/grid.md +116 -0
- package/docs/layout/header.md +116 -0
- package/docs/layout/pageShell.md +94 -0
- package/docs/layout/section.md +69 -0
- package/docs/patterns/cookieConsent.md +89 -0
- package/docs/utilizzo-css-scss.md +8 -8
- package/package.json +2 -1
- package/scripts/generate-component-docs.js +557 -0
- package/templates/html/components/accordion.html +36 -7
- package/templates/html/components/badges.html +28 -5
- package/templates/html/components/breadcumbs.html +15 -1
- package/templates/html/components/button.html +28 -6
- package/templates/html/components/card.html +28 -8
- package/templates/html/components/dropdown.html +42 -8
- package/templates/html/components/form.html +110 -9
- package/templates/html/components/formAddon.html +72 -0
- package/templates/html/components/logo.html +22 -1
- package/templates/html/components/menu.html +33 -6
- package/templates/html/components/modal.html +58 -14
- package/templates/html/components/notification.html +68 -32
- package/templates/html/components/search.html +85 -8
- package/templates/html/components/slides.html +46 -3
- package/templates/html/components/stepTabs.html +55 -8
- package/templates/html/components/steps.html +24 -0
- package/templates/html/components/summary.html +30 -3
- package/templates/html/components/table.html +14 -2
- package/templates/html/components/tooltip.html +35 -0
- package/templates/html/layout/body.html +20 -6
- package/templates/html/layout/flex.html +53 -33
- package/templates/html/layout/footer.html +32 -4
- package/templates/html/layout/grid.html +53 -33
- package/templates/html/layout/header.html +47 -6
- package/templates/html/layout/pageShell.html +19 -0
- package/templates/html/layout/section.html +41 -19
- package/templates/html/patterns/cookieConsent.html +44 -13
- package/templates/react/components/accordion.jsx +4 -4
- package/templates/react/components/breadcumbs.jsx +1 -1
- package/templates/react/components/button.jsx +5 -5
- package/templates/react/components/card.jsx +4 -4
- package/templates/react/components/dropdown.jsx +8 -8
- package/templates/react/components/form.jsx +5 -5
- package/templates/react/components/modal.jsx +14 -14
- package/templates/react/components/notification.jsx +7 -7
- package/templates/react/components/search.jsx +5 -5
- package/templates/react/components/slides.jsx +3 -3
- package/templates/react/components/stepTabs.jsx +8 -8
- package/templates/react/components/summary.jsx +3 -3
- package/templates/react/components/table.jsx +2 -2
- package/templates/react/layout/flex.jsx +8 -8
- package/templates/react/layout/grid.jsx +8 -8
- package/templates/react/layout/section.jsx +12 -12
- package/templates/react/patterns/cookieConsent.jsx +8 -8
- package/templates/react/patterns/footer.jsx +4 -4
- package/templates/react/patterns/header.jsx +3 -3
- package/templates/html/demo.js +0 -130
- /package/{templates/html → demo}/demo.css +0 -0
|
@@ -30,7 +30,7 @@ export default function Header() {
|
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<div pgs="header-element-onlyDesktop">
|
|
33
|
-
<nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="
|
|
33
|
+
<nav pgs="menu" pgs-option="horizontal menuHeader" aria-label="Main menu">
|
|
34
34
|
<ul>
|
|
35
35
|
<li><a href="/">Home</a></li>
|
|
36
36
|
<li><a href="#componenti">Componenti</a></li>
|
|
@@ -42,7 +42,7 @@ export default function Header() {
|
|
|
42
42
|
<div pgs="header-element-onlyMobile"></div>
|
|
43
43
|
|
|
44
44
|
<div pgs="header-element-alwaysOnLast">
|
|
45
|
-
<button pgs="buttonIcon toggleDarkmode" type="button" aria-label="
|
|
45
|
+
<button pgs="buttonIcon toggleDarkmode" type="button" aria-label="Change theme">
|
|
46
46
|
<i className="fa-solid fa-moon"></i>
|
|
47
47
|
</button>
|
|
48
48
|
</div>
|
|
@@ -52,7 +52,7 @@ export default function Header() {
|
|
|
52
52
|
|
|
53
53
|
<dialog pgs="modal-dialog" pgs-option="right">
|
|
54
54
|
<div pgs="modal-dialog-content">
|
|
55
|
-
<nav pgs="menu" pgs-option="vertical menuHeader" aria-label="
|
|
55
|
+
<nav pgs="menu" pgs-option="vertical menuHeader" aria-label="Mobile menu">
|
|
56
56
|
<ul>
|
|
57
57
|
<li><a href="/">Home</a></li>
|
|
58
58
|
<li><a href="#componenti">Componenti</a></li>
|
package/templates/html/demo.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const templateFiles = [
|
|
3
|
-
"components/summary.html",
|
|
4
|
-
"components/menu.html",
|
|
5
|
-
"components/tooltip.html",
|
|
6
|
-
"components/modal.html",
|
|
7
|
-
"components/stepTabs.html",
|
|
8
|
-
"components/accordion.html",
|
|
9
|
-
"components/badges.html",
|
|
10
|
-
"components/breadcumbs.html",
|
|
11
|
-
"components/button.html",
|
|
12
|
-
"components/card.html",
|
|
13
|
-
"components/dropdown.html",
|
|
14
|
-
"components/tooltip.html",
|
|
15
|
-
"components/form.html",
|
|
16
|
-
"components/logo.html",
|
|
17
|
-
"components/search.html",
|
|
18
|
-
"components/slides.html",
|
|
19
|
-
"components/steps.html",
|
|
20
|
-
"components/table.html",
|
|
21
|
-
"components/notification.html",
|
|
22
|
-
"layout/body.html",
|
|
23
|
-
"layout/section.html",
|
|
24
|
-
"layout/flex.html",
|
|
25
|
-
"layout/grid.html",
|
|
26
|
-
"layout/pageShell.html",
|
|
27
|
-
"layout/footer.html",
|
|
28
|
-
"layout/header.html",
|
|
29
|
-
"patterns/cookieConsent.html",
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
function getTemplateTitle(path) {
|
|
33
|
-
return path.replace(".html", "").replace("/", " / ")
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function renderSourceTemplate(section, html) {
|
|
37
|
-
const pre = document.createElement("pre");
|
|
38
|
-
const code = document.createElement("code");
|
|
39
|
-
code.textContent = html.trim();
|
|
40
|
-
pre.append(code);
|
|
41
|
-
section.append(pre);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function renderTemplate(section, path, html) {
|
|
45
|
-
const content = document.createElement("div");
|
|
46
|
-
content.setAttribute("pgs", "container flexColumnElements");
|
|
47
|
-
content.innerHTML = html;
|
|
48
|
-
section.append(content);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function renderLayout(root, path, html) {
|
|
52
|
-
const template = document.createElement("template");
|
|
53
|
-
template.innerHTML = html.trim();
|
|
54
|
-
root.append(template.content.cloneNode(true));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function renderTitle(section, path) {
|
|
58
|
-
const title = document.createElement("p");
|
|
59
|
-
title.classList.add("template-title");
|
|
60
|
-
title.innerHTML = "<strong>" + getTemplateTitle(path) + "</strong>";
|
|
61
|
-
section.append(title);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function loadTemplate(path) {
|
|
65
|
-
const response = await fetch(path);
|
|
66
|
-
if (!response.ok) throw new Error(`${path}: ${response.status}`);
|
|
67
|
-
return response.text();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function loadPgsJavascript() {
|
|
71
|
-
const script = document.createElement("script");
|
|
72
|
-
script.src = "../../dist/javascript/index.js";
|
|
73
|
-
document.body.append(script);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async function bootDemo() {
|
|
77
|
-
const BEEFORE = document.getElementById("templates-demo-before");
|
|
78
|
-
const MAIN = document.getElementById("templates-demo-main");
|
|
79
|
-
const AFTER = document.getElementById("templates-demo-after");
|
|
80
|
-
|
|
81
|
-
for (const path of templateFiles) {
|
|
82
|
-
const isHeader = path === "layout/header.html";
|
|
83
|
-
const isfooter = path === "layout/footer.html";
|
|
84
|
-
const isBody = path === "layout/body.html";
|
|
85
|
-
|
|
86
|
-
if (isHeader || isfooter) {
|
|
87
|
-
try {
|
|
88
|
-
const html = await loadTemplate(path);
|
|
89
|
-
renderLayout(isHeader ? BEEFORE : AFTER, path, html);
|
|
90
|
-
} catch (error) {
|
|
91
|
-
const message = document.createElement("p");
|
|
92
|
-
message.textContent = `Template non caricato: ${error.message}`;
|
|
93
|
-
layoutRoot.append(message);
|
|
94
|
-
}
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const section = document.createElement("section");
|
|
99
|
-
section.setAttribute("pgs", "section flexColumnElements");
|
|
100
|
-
section.dataset.template = path;
|
|
101
|
-
renderTitle(section, path);
|
|
102
|
-
|
|
103
|
-
if (isBody) {
|
|
104
|
-
const html = await loadTemplate(path);
|
|
105
|
-
renderSourceTemplate(section, html);
|
|
106
|
-
MAIN.append(section);
|
|
107
|
-
continue
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
const html = await loadTemplate(path);
|
|
112
|
-
renderTemplate(section, path, html);
|
|
113
|
-
} catch (error) {
|
|
114
|
-
const message = document.createElement("p");
|
|
115
|
-
message.textContent = `Template non caricato: ${error.message}`;
|
|
116
|
-
section.append(message);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
MAIN.append(section);
|
|
120
|
-
|
|
121
|
-
if (path == "layout/section.html" || path == "layout/pageShell.html") {
|
|
122
|
-
section.style.display = "contents";
|
|
123
|
-
Array.from(section.children).forEach(c => c.style.width = "100%");
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
loadPgsJavascript();
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
bootDemo();
|
|
File without changes
|