@jsswift/ui 1.0.53 → 2.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/dist/css/animation.css +36 -36
- package/dist/css/base.css +374 -374
- package/dist/css/docs.css +54 -54
- package/dist/css/fonts-nunito.css +2 -2
- package/dist/css/min-ui.css +1 -1
- package/dist/css/responsive-base.css +557 -0
- package/dist/css/responsive.css +3225 -3225
- package/dist/css/ui-components.css +2902 -2930
- package/dist/css/ui-light.css +9908 -0
- package/dist/css/ui-light.min.css +1 -0
- package/dist/css/ui.css +6530 -6558
- package/dist/css/ui.min.css +1 -1
- package/dist/min-ui.js +12 -12
- package/dist/ui.js +4354 -9379
- package/dist/ui.min.js +12 -12
- package/package.json +4 -2
- package/src/00-bootstrap.js +305 -305
- package/src/01-foundation-helpers.js +328 -325
- package/src/10-primitives-layout.js +242 -242
- package/src/20-display-content.js +76 -76
- package/src/21-list-content.js +21 -21
- package/src/22-banner-content.js +376 -376
- package/src/23-tooltip.js +9 -9
- package/src/31-form-advanced.js +141 -141
- package/src/40-navigation.js +81 -81
- package/src/41-tab-panel.js +37 -37
- package/src/50-feedback.js +52 -52
- package/src/51-feedback-service.js +166 -166
- package/src/60-shell-app.js +1082 -1082
- package/src/61-form-service.js +5 -5
- package/src/70-dialog.js +34 -34
- package/src/71-menu-overlays.js +73 -73
- package/src/80-data.js +38 -38
- package/src/css/README.md +2 -0
- package/src/css/animation.css +36 -36
- package/src/css/base.css +374 -374
- package/src/css/docs.css +54 -54
- package/src/css/fonts-nunito.css +2 -2
- package/src/css/responsive.css +3225 -3225
- package/src/css/ui-components.css +2902 -2930
package/src/80-data.js
CHANGED
|
@@ -63,20 +63,20 @@
|
|
|
63
63
|
"toolbar", "toolbarStart", "toolbarEnd", "caption", "footer", "status", "rowClass", "rowAttrs",
|
|
64
64
|
"minTableWidth", "hideHeader", "hideFooter", "hideStatus", "slots", "body"
|
|
65
65
|
]);
|
|
66
|
-
wrapProps.class = uiClass(["
|
|
66
|
+
wrapProps.class = uiClass(["jss-table-card", props.class, props.cardClass]);
|
|
67
67
|
if (props.dense != null) wrapProps.dense = props.dense;
|
|
68
68
|
|
|
69
|
-
const shell = _.div({ class: "
|
|
69
|
+
const shell = _.div({ class: "jss-table-shell" });
|
|
70
70
|
const leadNodes = renderSlotToArray(slots, "default", {}, children);
|
|
71
|
-
if (leadNodes.length) shell.appendChild(_.div({ class: "
|
|
71
|
+
if (leadNodes.length) shell.appendChild(_.div({ class: "jss-table-lead" }, ...leadNodes));
|
|
72
72
|
|
|
73
73
|
const toolbarStartNodes = renderSlotToArray(slots, "toolbarStart", {}, props.toolbarStart);
|
|
74
74
|
const toolbarNodes = renderSlotToArray(slots, "toolbar", {}, props.toolbar);
|
|
75
75
|
const toolbarEndNodes = renderSlotToArray(slots, "toolbarEnd", {}, props.toolbarEnd);
|
|
76
76
|
|
|
77
|
-
const toolbar = _.div({ class: "
|
|
78
|
-
const toolbarMain = _.div({ class: "
|
|
79
|
-
const toolbarSide = _.div({ class: "
|
|
77
|
+
const toolbar = _.div({ class: "jss-table-toolbar" });
|
|
78
|
+
const toolbarMain = _.div({ class: "jss-table-toolbar-main" });
|
|
79
|
+
const toolbarSide = _.div({ class: "jss-table-toolbar-side" });
|
|
80
80
|
toolbarStartNodes.forEach((node) => toolbarMain.appendChild(node));
|
|
81
81
|
toolbarNodes.forEach((node) => toolbarMain.appendChild(node));
|
|
82
82
|
|
|
@@ -86,13 +86,13 @@
|
|
|
86
86
|
} else if (searchable) {
|
|
87
87
|
searchInput = _.input({
|
|
88
88
|
type: "search",
|
|
89
|
-
class: "
|
|
89
|
+
class: "jss-input",
|
|
90
90
|
placeholder: typeof props.searchable === "string" ? props.searchable : (props.searchPlaceholder || "Cerca nella tabella"),
|
|
91
91
|
value: String(getQuery() || "")
|
|
92
92
|
});
|
|
93
93
|
searchInput.addEventListener("input", () => setQuery(searchInput.value));
|
|
94
94
|
const clearSearch = UI.Btn({
|
|
95
|
-
class: "
|
|
95
|
+
class: "jss-table-search-clear",
|
|
96
96
|
outline: true,
|
|
97
97
|
onClick: () => {
|
|
98
98
|
if (searchInput) searchInput.value = "";
|
|
@@ -100,8 +100,8 @@
|
|
|
100
100
|
}
|
|
101
101
|
}, "Reset");
|
|
102
102
|
toolbarSide.appendChild(
|
|
103
|
-
_.div({ class: "
|
|
104
|
-
_.span({ class: "
|
|
103
|
+
_.div({ class: "jss-singularity jss-table-search" },
|
|
104
|
+
_.span({ class: "jss-table-search-icon", "aria-hidden": "true" }, "⌕"),
|
|
105
105
|
searchInput,
|
|
106
106
|
clearSearch
|
|
107
107
|
)
|
|
@@ -114,11 +114,11 @@
|
|
|
114
114
|
shell.appendChild(toolbar);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
const statusSummary = _.div({ class: "
|
|
118
|
-
const statusFilter = _.div({ class: "
|
|
119
|
-
const statusSort = _.div({ class: "
|
|
117
|
+
const statusSummary = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
118
|
+
const statusFilter = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
119
|
+
const statusSort = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
120
120
|
const statusExtraNodes = renderSlotToArray(slots, "status", {}, props.status);
|
|
121
|
-
const status = _.div({ class: "
|
|
121
|
+
const status = _.div({ class: "jss-table-status" },
|
|
122
122
|
statusSummary,
|
|
123
123
|
statusFilter,
|
|
124
124
|
statusSort,
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
if (props.hideStatus !== true) shell.appendChild(status);
|
|
128
128
|
|
|
129
129
|
const captionNodes = renderSlotToArray(slots, "caption", {}, props.caption);
|
|
130
|
-
if (captionNodes.length) shell.appendChild(_.div({ class: "
|
|
130
|
+
if (captionNodes.length) shell.appendChild(_.div({ class: "jss-table-caption" }, ...captionNodes));
|
|
131
131
|
|
|
132
132
|
const thead = _.thead();
|
|
133
133
|
const tbody = _.tbody();
|
|
134
134
|
const hasActions = !!props.actions || !!slots.actions;
|
|
135
135
|
|
|
136
136
|
const tableClass = uiClass([
|
|
137
|
-
"
|
|
137
|
+
"jss-table",
|
|
138
138
|
uiWhen(props.dense, "dense"),
|
|
139
139
|
uiWhen(props.striped, "striped"),
|
|
140
140
|
uiWhen(props.hover !== false, "hover"),
|
|
@@ -144,35 +144,35 @@
|
|
|
144
144
|
const tableStyle = {
|
|
145
145
|
...(props.tableStyle || {})
|
|
146
146
|
};
|
|
147
|
-
if (props.minTableWidth != null) tableStyle["--
|
|
147
|
+
if (props.minTableWidth != null) tableStyle["--jss-table-min-width"] = toCssSize(props.minTableWidth);
|
|
148
148
|
const table = _.table({ class: tableClass, style: tableStyle }, thead, tbody);
|
|
149
|
-
const wrapTable = _.div({ class: "
|
|
149
|
+
const wrapTable = _.div({ class: "jss-singularity jss-table-wrap" }, table);
|
|
150
150
|
shell.appendChild(wrapTable);
|
|
151
151
|
|
|
152
|
-
const pagerInfo = _.div({ class: "
|
|
153
|
-
const pagerMeta = _.div({ class: "
|
|
152
|
+
const pagerInfo = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
153
|
+
const pagerMeta = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
154
154
|
const btnPrev = UI.Btn({ outline: true, onClick: () => setPage(Math.max(1, getPage() - 1)) }, "‹");
|
|
155
155
|
const btnNext = UI.Btn({ outline: true, onClick: () => setPage(getPage() + 1) }, "›");
|
|
156
|
-
const pageChip = _.div({ class: "
|
|
157
|
-
const sizeSelect = _.select({ class: "
|
|
156
|
+
const pageChip = _.div({ class: "jss-singularity jss-table-chip" }, "");
|
|
157
|
+
const sizeSelect = _.select({ class: "jss-input jss-table-size-select" },
|
|
158
158
|
...pageSizes.map((size) => uiOptionNode({ value: String(size) }, String(size)))
|
|
159
159
|
);
|
|
160
160
|
sizeSelect.value = String(getPageSize());
|
|
161
161
|
sizeSelect.addEventListener("change", () => setPageSize(sizeSelect.value));
|
|
162
162
|
const footerExtraNodes = renderSlotToArray(slots, "footer", {}, props.footer);
|
|
163
163
|
|
|
164
|
-
const footer = _.div({ class: "
|
|
165
|
-
_.div({ class: "
|
|
164
|
+
const footer = _.div({ class: "jss-table-foot" },
|
|
165
|
+
_.div({ class: "jss-table-foot-main" },
|
|
166
166
|
pagerInfo,
|
|
167
167
|
pagerMeta,
|
|
168
|
-
_.label({ class: "
|
|
168
|
+
_.label({ class: "jss-table-size" },
|
|
169
169
|
_.span("Righe"),
|
|
170
170
|
sizeSelect
|
|
171
171
|
)
|
|
172
172
|
),
|
|
173
|
-
_.div({ class: "
|
|
173
|
+
_.div({ class: "jss-table-foot-extra" },
|
|
174
174
|
...footerExtraNodes,
|
|
175
|
-
_.div({ class: "
|
|
175
|
+
_.div({ class: "jss-table-pager" },
|
|
176
176
|
btnPrev,
|
|
177
177
|
pageChip,
|
|
178
178
|
btnNext
|
|
@@ -208,9 +208,9 @@
|
|
|
208
208
|
const isActive = !!currentSort && (currentSort.key === sortKey || currentSort.key === col?.key);
|
|
209
209
|
const th = _.th({
|
|
210
210
|
class: uiClass([
|
|
211
|
-
"
|
|
211
|
+
"jss-table-head-cell",
|
|
212
212
|
uiWhen(col?.nowrap, "is-nowrap"),
|
|
213
|
-
uiWhen(isSortable, "
|
|
213
|
+
uiWhen(isSortable, "jss-table-sortable"),
|
|
214
214
|
uiWhen(isActive, "is-sorted"),
|
|
215
215
|
col?.headerClass
|
|
216
216
|
]),
|
|
@@ -221,11 +221,11 @@
|
|
|
221
221
|
th.appendChild(
|
|
222
222
|
_.button({
|
|
223
223
|
type: "button",
|
|
224
|
-
class: "
|
|
224
|
+
class: "jss-table-head-button",
|
|
225
225
|
onClick: () => toggleSort(col, colIndex)
|
|
226
226
|
},
|
|
227
|
-
_.span({ class: "
|
|
228
|
-
_.span({ class: "
|
|
227
|
+
_.span({ class: "jss-table-head-label" }, ...headerNodes),
|
|
228
|
+
_.span({ class: "jss-table-head-arrow", "aria-hidden": "true" },
|
|
229
229
|
isActive ? (currentSort.dir === "asc" ? "↑" : "↓") : "↕"
|
|
230
230
|
)
|
|
231
231
|
)
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
if (hasActions) {
|
|
240
240
|
const actionsHeaderNodes = renderSlotToArray(slots, "actionsHeader", {}, props.actionsLabel || "Azioni");
|
|
241
241
|
row.appendChild(
|
|
242
|
-
_.th({ class: "
|
|
242
|
+
_.th({ class: "jss-table-head-cell jss-table-head-actions", style: { textAlign: "right" } }, ...actionsHeaderNodes)
|
|
243
243
|
);
|
|
244
244
|
}
|
|
245
245
|
thead.appendChild(row);
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
const colSpan = String(columns.length + (hasActions ? 1 : 0));
|
|
252
252
|
tbody.appendChild(
|
|
253
253
|
_.tr(
|
|
254
|
-
_.td({ colSpan, class: "
|
|
254
|
+
_.td({ colSpan, class: "jss-table-state" }, ...nodes)
|
|
255
255
|
)
|
|
256
256
|
);
|
|
257
257
|
};
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
const tr = _.tr({
|
|
355
355
|
...rowAttrs,
|
|
356
356
|
class: uiClass([
|
|
357
|
-
"
|
|
357
|
+
"jss-table-row",
|
|
358
358
|
rowClass,
|
|
359
359
|
rowAttrs.class,
|
|
360
360
|
uiWhen(isInteractiveRow, "is-clickable")
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
if (col?.maxWidth != null) tdStyle.maxWidth = toCssSize(col.maxWidth);
|
|
397
397
|
const cellClass = typeof col?.cellClass === "function" ? col.cellClass(row, cellCtx) : (col?.cellClass || col?.class);
|
|
398
398
|
const td = _.td({
|
|
399
|
-
class: uiClass(["
|
|
399
|
+
class: uiClass(["jss-table-cell", cellClass, uiWhen(col?.nowrap, "is-nowrap")]),
|
|
400
400
|
style: tdStyle
|
|
401
401
|
});
|
|
402
402
|
|
|
@@ -419,8 +419,8 @@
|
|
|
419
419
|
let actionNodes = renderSlotToArray(slots, "actions", actionCtx, actionRaw);
|
|
420
420
|
if (!actionNodes.length) actionNodes = renderSlotToArray(null, "default", actionCtx, actionRaw);
|
|
421
421
|
tr.appendChild(
|
|
422
|
-
_.td({ class: "
|
|
423
|
-
_.div({ class: "
|
|
422
|
+
_.td({ class: "jss-table-cell jss-table-cell-actions", style: { textAlign: "right" } },
|
|
423
|
+
_.div({ class: "jss-table-actions" }, ...actionNodes)
|
|
424
424
|
)
|
|
425
425
|
);
|
|
426
426
|
}
|
package/src/css/README.md
CHANGED
|
@@ -15,3 +15,5 @@ Generated outputs:
|
|
|
15
15
|
- `pages/_jsswift-fe/css/min-ui.css`
|
|
16
16
|
- `pages/_jsswift-fe/css/ui.min.css`
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
`ui.css` remains the full compatible bundle. `ui-light.css` and `ui-light.min.css` omit breakpoint utilities but retain base tokens, component/mobile styles and unprefixed utilities generated by `cms-dev/make-responsive-css.mjs --base-only`. Add `responsive.css` after the light bundle for breakpoint props. All props remain available in JavaScript.
|
package/src/css/animation.css
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
2
|
+
--jss-anim-dur: 500ms;
|
|
3
|
+
--jss-anim-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
|
|
4
|
+
--jss-anim-distance: 12px;
|
|
5
|
+
--jss-anim-scale: 0.98;
|
|
6
|
+
--jss-anim-in: jss-fade-in;
|
|
7
|
+
--jss-anim-out: jss-fade-out;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.
|
|
11
|
-
animation-duration: var(--
|
|
12
|
-
animation-timing-function: var(--
|
|
10
|
+
.jss-animate {
|
|
11
|
+
animation-duration: var(--jss-anim-dur);
|
|
12
|
+
animation-timing-function: var(--jss-anim-ease);
|
|
13
13
|
animation-fill-mode: both;
|
|
14
14
|
will-change: opacity, transform;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.
|
|
18
|
-
animation-name: var(--
|
|
17
|
+
.jss-animate.in {
|
|
18
|
+
animation-name: var(--jss-anim-in);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
22
|
-
animation-name: var(--
|
|
21
|
+
.jss-animate.out {
|
|
22
|
+
animation-name: var(--jss-anim-out);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.
|
|
26
|
-
animation-name:
|
|
25
|
+
.jss-animate.fade.in {
|
|
26
|
+
animation-name: jss-fade-in;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.
|
|
30
|
-
animation-name:
|
|
29
|
+
.jss-animate.fade.out {
|
|
30
|
+
animation-name: jss-fade-out;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.
|
|
34
|
-
animation-name:
|
|
33
|
+
.jss-animate.slide.in {
|
|
34
|
+
animation-name: jss-slide-in;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.
|
|
38
|
-
animation-name:
|
|
37
|
+
.jss-animate.slide.out {
|
|
38
|
+
animation-name: jss-slide-out;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.
|
|
42
|
-
animation-name:
|
|
41
|
+
.jss-animate.scale.in {
|
|
42
|
+
animation-name: jss-scale-in;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.
|
|
46
|
-
animation-name:
|
|
45
|
+
.jss-animate.scale.out {
|
|
46
|
+
animation-name: jss-scale-out;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
@keyframes
|
|
49
|
+
@keyframes jss-fade-in {
|
|
50
50
|
from {
|
|
51
51
|
opacity: 0;
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
@keyframes
|
|
59
|
+
@keyframes jss-fade-out {
|
|
60
60
|
from {
|
|
61
61
|
opacity: 1;
|
|
62
62
|
}
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
@keyframes
|
|
69
|
+
@keyframes jss-slide-in {
|
|
70
70
|
from {
|
|
71
71
|
opacity: 0;
|
|
72
|
-
transform: translateY(var(--
|
|
72
|
+
transform: translateY(var(--jss-anim-distance));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
to {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
@keyframes
|
|
81
|
+
@keyframes jss-slide-out {
|
|
82
82
|
from {
|
|
83
83
|
opacity: 1;
|
|
84
84
|
transform: translateY(0);
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
|
|
87
87
|
to {
|
|
88
88
|
opacity: 0;
|
|
89
|
-
transform: translateY(var(--
|
|
89
|
+
transform: translateY(var(--jss-anim-distance));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
@keyframes
|
|
93
|
+
@keyframes jss-scale-in {
|
|
94
94
|
from {
|
|
95
95
|
opacity: 0;
|
|
96
|
-
transform: scale(var(--
|
|
96
|
+
transform: scale(var(--jss-anim-scale));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
to {
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
@keyframes
|
|
105
|
+
@keyframes jss-scale-out {
|
|
106
106
|
from {
|
|
107
107
|
opacity: 1;
|
|
108
108
|
transform: scale(1);
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
|
|
111
111
|
to {
|
|
112
112
|
opacity: 0;
|
|
113
|
-
transform: scale(var(--
|
|
113
|
+
transform: scale(var(--jss-anim-scale));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@media (prefers-reduced-motion: reduce) {
|
|
118
|
-
.
|
|
118
|
+
.jss-animate {
|
|
119
119
|
animation-duration: 1ms;
|
|
120
120
|
}
|
|
121
121
|
}
|