emilsoftware-utilities 2.0.0-dev.63 → 2.0.0-dev.65
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/README.MD +9 -0
- package/dist/angular-components/aree-disponibili/aree-disponibili.js +1336 -0
- package/dist/angular-components/aree-disponibili/demo.html +232 -0
- package/dist/emilsoftware-utilities-2.0.0-dev.65.tgz +0 -0
- package/package.json +3 -3
- package/dist/emilsoftware-utilities-2.0.0-dev.63.tgz +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="it" data-theme="light">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>es-aree-disponibili · demo</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
color-scheme: light;
|
|
10
|
+
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
body {
|
|
14
|
+
margin: 0;
|
|
15
|
+
min-height: 100vh;
|
|
16
|
+
background: #eef2f7;
|
|
17
|
+
color: #0f172a;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.toolbar {
|
|
21
|
+
position: sticky;
|
|
22
|
+
top: 0;
|
|
23
|
+
z-index: 10;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-wrap: wrap;
|
|
26
|
+
gap: 10px;
|
|
27
|
+
align-items: center;
|
|
28
|
+
padding: 12px 20px;
|
|
29
|
+
border-bottom: 1px solid rgba(15, 23, 42, 0.08);
|
|
30
|
+
background: rgba(255, 255, 255, 0.92);
|
|
31
|
+
backdrop-filter: blur(8px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.toolbar strong {
|
|
35
|
+
margin-right: auto;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.toolbar button {
|
|
40
|
+
padding: 7px 12px;
|
|
41
|
+
border: 1px solid rgba(15, 23, 42, 0.16);
|
|
42
|
+
border-radius: 999px;
|
|
43
|
+
background: #fff;
|
|
44
|
+
color: inherit;
|
|
45
|
+
font: inherit;
|
|
46
|
+
font-size: 13px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.toolbar button[aria-pressed="true"] {
|
|
51
|
+
border-color: #2563eb;
|
|
52
|
+
background: #2563eb;
|
|
53
|
+
color: #fff;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.event-log {
|
|
57
|
+
max-width: 960px;
|
|
58
|
+
margin: 0 auto;
|
|
59
|
+
padding: 0 28px 32px;
|
|
60
|
+
color: #64748b;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.event-log p {
|
|
66
|
+
margin: 4px 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
html[data-theme="dark"] {
|
|
70
|
+
color-scheme: dark;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
html[data-theme="dark"] body {
|
|
74
|
+
background: #0b1220;
|
|
75
|
+
color: #e2e8f0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
html[data-theme="dark"] .toolbar {
|
|
79
|
+
border-color: rgba(148, 163, 184, 0.16);
|
|
80
|
+
background: rgba(17, 28, 46, 0.92);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
html[data-theme="dark"] .toolbar button {
|
|
84
|
+
border-color: rgba(148, 163, 184, 0.28);
|
|
85
|
+
background: #111c2e;
|
|
86
|
+
color: #e2e8f0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
html[data-theme="dark"] .toolbar button[aria-pressed="true"] {
|
|
90
|
+
border-color: #60a5fa;
|
|
91
|
+
background: #2563eb;
|
|
92
|
+
color: #fff;
|
|
93
|
+
}
|
|
94
|
+
</style>
|
|
95
|
+
</head>
|
|
96
|
+
<body>
|
|
97
|
+
<div class="toolbar">
|
|
98
|
+
<strong>es-aree-disponibili</strong>
|
|
99
|
+
<button type="button" data-theme-button="light" aria-pressed="true">Light</button>
|
|
100
|
+
<button type="button" data-theme-button="dark" aria-pressed="false">Dark</button>
|
|
101
|
+
<button type="button" data-theme-button="auto" aria-pressed="false">Auto</button>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<es-aree-disponibili id="aree"></es-aree-disponibili>
|
|
105
|
+
|
|
106
|
+
<div class="event-log" id="events" aria-live="polite"></div>
|
|
107
|
+
|
|
108
|
+
<script src="./aree-disponibili.js"></script>
|
|
109
|
+
<script>
|
|
110
|
+
const element = document.getElementById('aree');
|
|
111
|
+
const events = document.getElementById('events');
|
|
112
|
+
|
|
113
|
+
element.groups = [
|
|
114
|
+
{
|
|
115
|
+
name: 'Produzione',
|
|
116
|
+
order: 4,
|
|
117
|
+
areas: [
|
|
118
|
+
{
|
|
119
|
+
code: 'MNUMAIN',
|
|
120
|
+
label: 'Home',
|
|
121
|
+
icon: 'home-outline',
|
|
122
|
+
route: '/main',
|
|
123
|
+
url: 'https://example.local/#/main',
|
|
124
|
+
available: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
code: 'MNUAVANZA',
|
|
128
|
+
label: 'Avanzamento Produzione',
|
|
129
|
+
icon: 'play-outline',
|
|
130
|
+
page: '/avanzamento',
|
|
131
|
+
available: false,
|
|
132
|
+
reason: "La pagina /avanzamento non esiste nell'app al momento.",
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
code: 'MNUJOURNAL',
|
|
136
|
+
label: 'Giornale Attivita',
|
|
137
|
+
icon: 'book-outline',
|
|
138
|
+
page: '/journal',
|
|
139
|
+
available: false,
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'Amministrazione',
|
|
145
|
+
order: 7,
|
|
146
|
+
areas: [
|
|
147
|
+
{
|
|
148
|
+
code: 'MNUUTENTI',
|
|
149
|
+
label: 'Gestione Utenti',
|
|
150
|
+
icon: 'people-outline',
|
|
151
|
+
route: '/lista-profili',
|
|
152
|
+
url: 'https://example.local/#/lista-profili',
|
|
153
|
+
available: true,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'Qualita',
|
|
159
|
+
order: 16,
|
|
160
|
+
areas: [
|
|
161
|
+
{
|
|
162
|
+
code: 'STEX_ARRIVI_CQ',
|
|
163
|
+
label: 'SteX - Arrivi CQ',
|
|
164
|
+
icon: 'checkmark-done-outline',
|
|
165
|
+
route: '/cq-arrivi',
|
|
166
|
+
url: 'https://example.local/#/cq-arrivi',
|
|
167
|
+
available: true,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
code: 'STEX_PARTITE_CQ',
|
|
171
|
+
label: 'SteX - Partite CQ',
|
|
172
|
+
icon: 'albums-outline',
|
|
173
|
+
route: '/cq-partite',
|
|
174
|
+
url: 'https://example.local/#/cq-partite',
|
|
175
|
+
available: true,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
code: 'MNUVASCATE',
|
|
179
|
+
label: 'Controllo Vascate',
|
|
180
|
+
icon: 'analytics-outline',
|
|
181
|
+
page: '/controllo-vascate',
|
|
182
|
+
available: false,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
element.defaultPage = '/main';
|
|
189
|
+
|
|
190
|
+
function log(message) {
|
|
191
|
+
const line = document.createElement('p');
|
|
192
|
+
line.textContent = new Date().toLocaleTimeString() + ' · ' + message;
|
|
193
|
+
events.prepend(line);
|
|
194
|
+
while (events.children.length > 6) {
|
|
195
|
+
events.lastElementChild.remove();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
element.addEventListener('es-area-select', (event) => {
|
|
200
|
+
log('select: ' + event.detail.area.label + ' → ' + event.detail.area.route);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
element.addEventListener('es-area-blocked', (event) => {
|
|
204
|
+
log('blocked: ' + event.detail.area.label + ' · ' + event.detail.reason);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
function applyTheme(theme) {
|
|
208
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
209
|
+
element.theme = theme;
|
|
210
|
+
for (const button of document.querySelectorAll('[data-theme-button]')) {
|
|
211
|
+
button.setAttribute(
|
|
212
|
+
'aria-pressed',
|
|
213
|
+
String(button.getAttribute('data-theme-button') === theme),
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
for (const button of document.querySelectorAll('[data-theme-button]')) {
|
|
219
|
+
button.addEventListener('click', () => {
|
|
220
|
+
const theme = button.getAttribute('data-theme-button');
|
|
221
|
+
applyTheme(theme);
|
|
222
|
+
const url = new URL(window.location.href);
|
|
223
|
+
url.searchParams.set('theme', theme);
|
|
224
|
+
history.replaceState(null, '', url);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Permette di aprire la demo direttamente in un tema: ?theme=dark
|
|
229
|
+
applyTheme(new URLSearchParams(window.location.search).get('theme') || 'light');
|
|
230
|
+
</script>
|
|
231
|
+
</body>
|
|
232
|
+
</html>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emilsoftware-utilities",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.65",
|
|
4
4
|
"description": "Utilities for EmilSoftware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"typecheck": "tsc --noEmit",
|
|
22
22
|
"lint": "node scripts/lint.cjs",
|
|
23
23
|
"test": "npm run typecheck && npm run lint && npm run test:unit",
|
|
24
|
-
"test:unit": "node --test test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs",
|
|
25
|
-
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs",
|
|
24
|
+
"test:unit": "node --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs",
|
|
25
|
+
"test:coverage": "node --experimental-test-coverage --test-coverage-lines=50 --test-coverage-functions=60 --test-coverage-branches=60 --test test/angular-components.cjs test/menus-catalog.mjs test/menu-scopes.cjs test/accessi-regressions.cjs test/password-reset-regressions.cjs test/two-factor.cjs test/accessi-schema.cjs test/utilities-regressions.cjs test/service-token-regressions.cjs test/accessi-email-config.cjs test/accessi-catalog-scripts.cjs",
|
|
26
26
|
"test:accessi": "npm run test:unit",
|
|
27
27
|
"test:all": "npm test && npm run test:integration",
|
|
28
28
|
"test:integration": "node test/integration/run-firebird.cjs 5",
|
|
Binary file
|