@bertimatteodev/astra-ui 0.8.6 → 0.9.1
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/astra-ui.cjs +1 -1
- package/dist/astra-ui.css +1 -1
- package/dist/astra-ui.js +109 -149
- package/dist/charts.cjs +32 -32
- package/dist/charts.js +4017 -4113
- package/dist/types/components/List/List.d.ts +12 -18
- package/dist/types/components/List/List.d.ts.map +1 -1
- package/dist/types/components/List/index.d.ts +2 -2
- package/dist/types/components/List/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/astra-ui.js
CHANGED
|
@@ -1091,7 +1091,7 @@ var Ee = r(function({ id: e, options: t, label: n, hint: r, error: i, placeholde
|
|
|
1091
1091
|
});
|
|
1092
1092
|
});
|
|
1093
1093
|
Ee.displayName = "Dropdown";
|
|
1094
|
-
var
|
|
1094
|
+
var K = {
|
|
1095
1095
|
group: "_group_1fqa2_1",
|
|
1096
1096
|
option: "_option_1fqa2_8",
|
|
1097
1097
|
selected: "_selected_1fqa2_41",
|
|
@@ -1099,10 +1099,10 @@ var De = {
|
|
|
1099
1099
|
};
|
|
1100
1100
|
//#endregion
|
|
1101
1101
|
//#region src/components/MultiSelect/MultiSelect.tsx
|
|
1102
|
-
function
|
|
1102
|
+
function De(...e) {
|
|
1103
1103
|
return e.filter(Boolean).join(" ");
|
|
1104
1104
|
}
|
|
1105
|
-
var
|
|
1105
|
+
var Oe = r(function({ options: e, value: t, defaultValue: n = [], multiple: r = !1, disabled: i = !1, className: a, onValueChange: o, "aria-label": s = r ? "Selezione multipla" : "Selezione singola", ...c }, l) {
|
|
1106
1106
|
let [d, m] = u(n), h = t ?? d, g = r ? h : h.slice(0, 1);
|
|
1107
1107
|
function _(e) {
|
|
1108
1108
|
let n = g.includes(e), i = r ? n ? g.filter((t) => t !== e) : [...g, e] : n ? [] : [e];
|
|
@@ -1112,7 +1112,7 @@ var ke = r(function({ options: e, value: t, defaultValue: n = [], multiple: r =
|
|
|
1112
1112
|
ref: l,
|
|
1113
1113
|
role: "group",
|
|
1114
1114
|
"aria-label": s,
|
|
1115
|
-
className:
|
|
1115
|
+
className: De(K.group, a),
|
|
1116
1116
|
...c,
|
|
1117
1117
|
children: e.map((e) => {
|
|
1118
1118
|
let t = g.includes(e.value), n = i || e.disabled, r = e.selectedColor ? {
|
|
@@ -1121,21 +1121,21 @@ var ke = r(function({ options: e, value: t, defaultValue: n = [], multiple: r =
|
|
|
1121
1121
|
} : void 0;
|
|
1122
1122
|
return /* @__PURE__ */ p("button", {
|
|
1123
1123
|
type: "button",
|
|
1124
|
-
className:
|
|
1124
|
+
className: De(K.option, t && K.selected),
|
|
1125
1125
|
disabled: n,
|
|
1126
1126
|
"aria-pressed": t,
|
|
1127
1127
|
style: r,
|
|
1128
1128
|
onClick: () => _(e.value),
|
|
1129
1129
|
children: [e.count === void 0 ? null : /* @__PURE__ */ f("span", {
|
|
1130
|
-
className:
|
|
1130
|
+
className: K.count,
|
|
1131
1131
|
children: e.count
|
|
1132
1132
|
}), /* @__PURE__ */ f("span", { children: e.label })]
|
|
1133
1133
|
}, e.value);
|
|
1134
1134
|
})
|
|
1135
1135
|
});
|
|
1136
1136
|
});
|
|
1137
|
-
|
|
1138
|
-
var
|
|
1137
|
+
Oe.displayName = "MultiSelect";
|
|
1138
|
+
var q = {
|
|
1139
1139
|
carousel: "_carousel_17hln_1",
|
|
1140
1140
|
navigationButton: "_navigationButton_17hln_13",
|
|
1141
1141
|
track: "_track_17hln_51",
|
|
@@ -1145,30 +1145,30 @@ var K = {
|
|
|
1145
1145
|
};
|
|
1146
1146
|
//#endregion
|
|
1147
1147
|
//#region src/components/MonthCarousel/MonthCarousel.tsx
|
|
1148
|
-
function
|
|
1148
|
+
function J(e) {
|
|
1149
1149
|
return e.year * 12 + e.month - 1;
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function ke(e, t) {
|
|
1152
1152
|
let n = e.year * 12 + e.month - 1 + t;
|
|
1153
1153
|
return {
|
|
1154
1154
|
year: Math.floor(n / 12),
|
|
1155
1155
|
month: (n % 12 + 12) % 12 + 1
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
|
-
function
|
|
1158
|
+
function Ae(e, t) {
|
|
1159
1159
|
let n = new Date(e.year, e.month - 1, 1), r = new Intl.DateTimeFormat(t, {
|
|
1160
1160
|
month: "long",
|
|
1161
1161
|
year: "numeric"
|
|
1162
1162
|
}).format(n);
|
|
1163
1163
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let i =
|
|
1167
|
-
return e === -1 && n ?
|
|
1165
|
+
function je(e, t, n, r) {
|
|
1166
|
+
let i = ke(t, e);
|
|
1167
|
+
return e === -1 && n ? J(i) < J(n) : e === 1 && r ? J(i) > J(r) : !1;
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1170
|
-
let [d, m] = u(0), h = l(null), g = c(() =>
|
|
1171
|
-
n === -1 && _ || n === 1 && v || (m(n), t(
|
|
1169
|
+
function Me({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth: a, disabled: o = !1, ariaLabel: s = "Seleziona il mese" }) {
|
|
1170
|
+
let [d, m] = u(0), h = l(null), g = c(() => Ae(e, n), [e, n]), _ = o || je(-1, e, r, a), v = o || je(1, e, r, a), y = i((n) => {
|
|
1171
|
+
n === -1 && _ || n === 1 && v || (m(n), t(ke(e, n)));
|
|
1172
1172
|
}, [
|
|
1173
1173
|
v,
|
|
1174
1174
|
_,
|
|
@@ -1179,14 +1179,14 @@ function Pe({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth:
|
|
|
1179
1179
|
e.key === "ArrowLeft" ? (e.preventDefault(), y(-1)) : e.key === "ArrowRight" && (e.preventDefault(), y(1));
|
|
1180
1180
|
}
|
|
1181
1181
|
return /* @__PURE__ */ p("div", {
|
|
1182
|
-
className:
|
|
1182
|
+
className: q.carousel,
|
|
1183
1183
|
role: "group",
|
|
1184
1184
|
"aria-label": s,
|
|
1185
1185
|
onKeyDown: b,
|
|
1186
1186
|
children: [
|
|
1187
1187
|
/* @__PURE__ */ f("button", {
|
|
1188
1188
|
type: "button",
|
|
1189
|
-
className:
|
|
1189
|
+
className: q.navigationButton,
|
|
1190
1190
|
"aria-label": "Mese precedente",
|
|
1191
1191
|
disabled: _,
|
|
1192
1192
|
onClick: () => y(-1),
|
|
@@ -1196,16 +1196,16 @@ function Pe({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth:
|
|
|
1196
1196
|
})
|
|
1197
1197
|
}),
|
|
1198
1198
|
/* @__PURE__ */ f("div", {
|
|
1199
|
-
className:
|
|
1199
|
+
className: q.track,
|
|
1200
1200
|
children: /* @__PURE__ */ f("span", {
|
|
1201
|
-
className:
|
|
1201
|
+
className: q.label,
|
|
1202
1202
|
"data-direction": d,
|
|
1203
1203
|
children: g
|
|
1204
1204
|
}, `${e.year}-${e.month}`)
|
|
1205
1205
|
}),
|
|
1206
1206
|
/* @__PURE__ */ f("button", {
|
|
1207
1207
|
type: "button",
|
|
1208
|
-
className:
|
|
1208
|
+
className: q.navigationButton,
|
|
1209
1209
|
"aria-label": "Mese successivo",
|
|
1210
1210
|
disabled: v,
|
|
1211
1211
|
onClick: () => y(1),
|
|
@@ -1216,20 +1216,20 @@ function Pe({ value: e, onChange: t, locale: n = "it-IT", minMonth: r, maxMonth:
|
|
|
1216
1216
|
}),
|
|
1217
1217
|
/* @__PURE__ */ f("span", {
|
|
1218
1218
|
ref: h,
|
|
1219
|
-
className:
|
|
1219
|
+
className: q.srOnly,
|
|
1220
1220
|
"aria-live": "polite",
|
|
1221
1221
|
children: g
|
|
1222
1222
|
})
|
|
1223
1223
|
]
|
|
1224
1224
|
});
|
|
1225
1225
|
}
|
|
1226
|
-
var
|
|
1226
|
+
var Ne = { badge: "_badge_3xnd3_1" };
|
|
1227
1227
|
//#endregion
|
|
1228
1228
|
//#region src/components/Badge/Badge.tsx
|
|
1229
|
-
function
|
|
1229
|
+
function Pe(...e) {
|
|
1230
1230
|
return e.filter(Boolean).join(" ");
|
|
1231
1231
|
}
|
|
1232
|
-
var
|
|
1232
|
+
var Fe = r(function({ text: e, color: t, className: n, style: r, ...i }, a) {
|
|
1233
1233
|
let o = t ? {
|
|
1234
1234
|
...r,
|
|
1235
1235
|
"--badge-color": t,
|
|
@@ -1237,14 +1237,14 @@ var Le = r(function({ text: e, color: t, className: n, style: r, ...i }, a) {
|
|
|
1237
1237
|
} : r;
|
|
1238
1238
|
return /* @__PURE__ */ f("span", {
|
|
1239
1239
|
ref: a,
|
|
1240
|
-
className:
|
|
1240
|
+
className: Pe(Ne.badge, n),
|
|
1241
1241
|
style: o,
|
|
1242
1242
|
...i,
|
|
1243
1243
|
children: e
|
|
1244
1244
|
});
|
|
1245
1245
|
});
|
|
1246
|
-
|
|
1247
|
-
var
|
|
1246
|
+
Fe.displayName = "Badge";
|
|
1247
|
+
var Y = {
|
|
1248
1248
|
switch: "_switch_1u3md_1",
|
|
1249
1249
|
input: "_input_1u3md_14",
|
|
1250
1250
|
track: "_track_1u3md_24",
|
|
@@ -1256,10 +1256,10 @@ var q = {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
//#endregion
|
|
1258
1258
|
//#region src/components/Switch/Switch.tsx
|
|
1259
|
-
function
|
|
1259
|
+
function Ie(...e) {
|
|
1260
1260
|
return e.filter(Boolean).join(" ");
|
|
1261
1261
|
}
|
|
1262
|
-
var
|
|
1262
|
+
var Le = r(function({ label: e, className: t, color: n, size: r = "md", disabled: i = !1, onChange: a, onCheckedChange: o, "aria-label": s = "Interruttore", style: c, ...l }, u) {
|
|
1263
1263
|
function d(e) {
|
|
1264
1264
|
a?.(e), o?.(e.target.checked);
|
|
1265
1265
|
}
|
|
@@ -1268,112 +1268,72 @@ var ze = r(function({ label: e, className: t, color: n, size: r = "md", disabled
|
|
|
1268
1268
|
"--switch-color": n
|
|
1269
1269
|
} : c;
|
|
1270
1270
|
return /* @__PURE__ */ p("label", {
|
|
1271
|
-
className:
|
|
1271
|
+
className: Ie(Y.switch, Y[`size${r[0].toUpperCase()}${r.slice(1)}`], i && Y.disabled, t),
|
|
1272
1272
|
style: m,
|
|
1273
1273
|
children: [
|
|
1274
1274
|
/* @__PURE__ */ f("input", {
|
|
1275
1275
|
ref: u,
|
|
1276
1276
|
type: "checkbox",
|
|
1277
|
-
className:
|
|
1277
|
+
className: Y.input,
|
|
1278
1278
|
disabled: i,
|
|
1279
1279
|
"aria-label": s,
|
|
1280
1280
|
onChange: d,
|
|
1281
1281
|
...l
|
|
1282
1282
|
}),
|
|
1283
1283
|
/* @__PURE__ */ f("span", {
|
|
1284
|
-
className:
|
|
1284
|
+
className: Y.track,
|
|
1285
1285
|
"aria-hidden": "true",
|
|
1286
|
-
children: /* @__PURE__ */ f("span", { className:
|
|
1286
|
+
children: /* @__PURE__ */ f("span", { className: Y.thumb })
|
|
1287
1287
|
}),
|
|
1288
1288
|
e ? /* @__PURE__ */ f("span", {
|
|
1289
|
-
className:
|
|
1289
|
+
className: Y.label,
|
|
1290
1290
|
children: e
|
|
1291
1291
|
}) : null
|
|
1292
1292
|
]
|
|
1293
1293
|
});
|
|
1294
1294
|
});
|
|
1295
|
-
|
|
1296
|
-
var
|
|
1297
|
-
list: "
|
|
1298
|
-
listItem: "
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
leading: "_leading_gx1se_50",
|
|
1302
|
-
content: "_content_gx1se_57",
|
|
1303
|
-
meta: "_meta_gx1se_65",
|
|
1304
|
-
trailing: "_trailing_gx1se_74",
|
|
1305
|
-
chevron: "_chevron_gx1se_86",
|
|
1306
|
-
action: "_action_gx1se_91",
|
|
1307
|
-
statusMessage: "_statusMessage_gx1se_98"
|
|
1295
|
+
Le.displayName = "Switch";
|
|
1296
|
+
var Re = {
|
|
1297
|
+
list: "_list_o9mae_1",
|
|
1298
|
+
listItem: "_listItem_o9mae_12",
|
|
1299
|
+
interactive: "_interactive_o9mae_22",
|
|
1300
|
+
cell: "_cell_o9mae_36"
|
|
1308
1301
|
};
|
|
1309
1302
|
//#endregion
|
|
1310
1303
|
//#region src/components/List/List.tsx
|
|
1311
|
-
function
|
|
1304
|
+
function ze(...e) {
|
|
1312
1305
|
return e.filter(Boolean).join(" ");
|
|
1313
1306
|
}
|
|
1314
|
-
function
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
className:
|
|
1318
|
-
"aria-label":
|
|
1319
|
-
|
|
1320
|
-
role: "status",
|
|
1321
|
-
children: /* @__PURE__ */ f("p", {
|
|
1322
|
-
className: J.statusMessage,
|
|
1323
|
-
children: "Caricamento in corso…"
|
|
1324
|
-
})
|
|
1325
|
-
}) : e.length === 0 ? /* @__PURE__ */ f("div", {
|
|
1326
|
-
className: Be(J.list, c),
|
|
1327
|
-
"aria-label": s,
|
|
1328
|
-
role: "status",
|
|
1329
|
-
children: /* @__PURE__ */ f("p", {
|
|
1330
|
-
className: J.statusMessage,
|
|
1331
|
-
children: a
|
|
1332
|
-
})
|
|
1333
|
-
}) : /* @__PURE__ */ f("ul", {
|
|
1334
|
-
className: Be(J.list, c),
|
|
1335
|
-
"aria-label": s,
|
|
1336
|
-
children: e.map((e, a) => {
|
|
1337
|
-
let o = t(e, a), s = n(e, a), c = l ? "button" : "div";
|
|
1338
|
-
return /* @__PURE__ */ p("li", {
|
|
1339
|
-
className: J.listItem,
|
|
1340
|
-
children: [/* @__PURE__ */ p(c, {
|
|
1341
|
-
type: l ? "button" : void 0,
|
|
1342
|
-
className: Be(J.itemInner, l && J.interactive),
|
|
1343
|
-
onClick: l ? () => r?.(e, a) : void 0,
|
|
1344
|
-
children: [
|
|
1345
|
-
s.leading ? /* @__PURE__ */ f("span", {
|
|
1346
|
-
className: J.leading,
|
|
1347
|
-
children: s.leading
|
|
1348
|
-
}) : null,
|
|
1349
|
-
/* @__PURE__ */ f("span", {
|
|
1350
|
-
className: J.content,
|
|
1351
|
-
children: s.content
|
|
1352
|
-
}),
|
|
1353
|
-
s.meta ? /* @__PURE__ */ f("span", {
|
|
1354
|
-
className: J.meta,
|
|
1355
|
-
children: s.meta
|
|
1356
|
-
}) : null,
|
|
1357
|
-
s.trailing ? /* @__PURE__ */ f("span", {
|
|
1358
|
-
className: J.trailing,
|
|
1359
|
-
children: s.trailing
|
|
1360
|
-
}) : null,
|
|
1361
|
-
l && i ? /* @__PURE__ */ f(L, {
|
|
1362
|
-
className: J.chevron,
|
|
1363
|
-
size: 18,
|
|
1364
|
-
"aria-hidden": "true"
|
|
1365
|
-
}) : null
|
|
1366
|
-
]
|
|
1367
|
-
}), s.action ? /* @__PURE__ */ f("span", {
|
|
1368
|
-
className: J.action,
|
|
1369
|
-
onClick: (e) => e.stopPropagation(),
|
|
1370
|
-
children: s.action
|
|
1371
|
-
}) : null]
|
|
1372
|
-
}, o);
|
|
1373
|
-
})
|
|
1307
|
+
function Be({ children: e, ariaLabel: t, className: n, ...r }) {
|
|
1308
|
+
return /* @__PURE__ */ f("ul", {
|
|
1309
|
+
...r,
|
|
1310
|
+
className: ze(Re.list, n),
|
|
1311
|
+
"aria-label": t,
|
|
1312
|
+
children: e
|
|
1374
1313
|
});
|
|
1375
1314
|
}
|
|
1376
|
-
|
|
1315
|
+
function Ve({ children: e, className: t, onClick: n, onKeyDown: r, ...i }) {
|
|
1316
|
+
let a = !!n;
|
|
1317
|
+
return /* @__PURE__ */ f("li", {
|
|
1318
|
+
...i,
|
|
1319
|
+
className: ze(Re.listItem, a ? Re.interactive : void 0, t),
|
|
1320
|
+
onClick: n,
|
|
1321
|
+
onKeyDown: (e) => {
|
|
1322
|
+
r?.(e), a && !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
1323
|
+
},
|
|
1324
|
+
role: a ? "button" : i.role,
|
|
1325
|
+
tabIndex: a ? 0 : i.tabIndex,
|
|
1326
|
+
children: e
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
function He({ children: e, className: t, ...n }) {
|
|
1330
|
+
return /* @__PURE__ */ f("div", {
|
|
1331
|
+
...n,
|
|
1332
|
+
className: ze(Re.cell, t),
|
|
1333
|
+
children: e
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
var X = {
|
|
1377
1337
|
wrapper: "_wrapper_1ly5u_1",
|
|
1378
1338
|
table: "_table_1ly5u_11",
|
|
1379
1339
|
caption: "_caption_1ly5u_19",
|
|
@@ -1394,20 +1354,20 @@ var Y = {
|
|
|
1394
1354
|
};
|
|
1395
1355
|
//#endregion
|
|
1396
1356
|
//#region src/components/DataTable/DataTable.tsx
|
|
1397
|
-
function
|
|
1357
|
+
function Z(...e) {
|
|
1398
1358
|
return e.filter(Boolean).join(" ");
|
|
1399
1359
|
}
|
|
1400
|
-
function
|
|
1360
|
+
function Ue(e, t) {
|
|
1401
1361
|
return e == null ? 1 : t == null ? -1 : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), "it-IT", {
|
|
1402
1362
|
numeric: !0,
|
|
1403
1363
|
sensitivity: "base"
|
|
1404
1364
|
});
|
|
1405
1365
|
}
|
|
1406
|
-
function
|
|
1366
|
+
function We({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "Non sono disponibili dati da visualizzare.", isLoading: a = !1, sortable: o = !0, onRowClick: s, rowAriaLabel: l, className: d, containerClassName: m, ...h }) {
|
|
1407
1367
|
let [g, _] = u(null), v = c(() => {
|
|
1408
1368
|
if (!g?.column.sortValue) return t;
|
|
1409
1369
|
let { column: e, direction: n } = g, r = n === "ascending" ? 1 : -1;
|
|
1410
|
-
return [...t].sort((t, n) =>
|
|
1370
|
+
return [...t].sort((t, n) => Ue(e.sortValue?.(t), e.sortValue?.(n)) * r);
|
|
1411
1371
|
}, [t, g]);
|
|
1412
1372
|
function y(e) {
|
|
1413
1373
|
!o || !e.sortable || !e.sortValue || _((t) => t?.column.id === e.id ? t.direction === "ascending" ? {
|
|
@@ -1434,30 +1394,30 @@ function Ue({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1434
1394
|
});
|
|
1435
1395
|
}
|
|
1436
1396
|
return /* @__PURE__ */ f("div", {
|
|
1437
|
-
className: X
|
|
1397
|
+
className: Z(X.wrapper, m),
|
|
1438
1398
|
children: /* @__PURE__ */ p("table", {
|
|
1439
|
-
className: X
|
|
1399
|
+
className: Z(X.table, d),
|
|
1440
1400
|
...h,
|
|
1441
1401
|
children: [
|
|
1442
1402
|
r ? /* @__PURE__ */ f("caption", {
|
|
1443
|
-
className:
|
|
1403
|
+
className: X.caption,
|
|
1444
1404
|
children: r
|
|
1445
1405
|
}) : null,
|
|
1446
1406
|
/* @__PURE__ */ f("colgroup", { children: e.map((e) => /* @__PURE__ */ f("col", { style: e.width ? { width: e.width } : void 0 }, e.id)) }),
|
|
1447
1407
|
/* @__PURE__ */ f("thead", {
|
|
1448
|
-
className:
|
|
1408
|
+
className: X.head,
|
|
1449
1409
|
children: /* @__PURE__ */ f("tr", { children: e.map((e) => {
|
|
1450
1410
|
let t = o && e.sortable && !!e.sortValue;
|
|
1451
1411
|
return /* @__PURE__ */ f("th", {
|
|
1452
1412
|
scope: "col",
|
|
1453
1413
|
"aria-sort": t ? b(e) : void 0,
|
|
1454
|
-
className: X
|
|
1414
|
+
className: Z(X.headerCell, X[`align${Ge(e.align ?? "left")}`], e.hideOnMobile && X.hideOnMobile),
|
|
1455
1415
|
children: t ? /* @__PURE__ */ p("button", {
|
|
1456
1416
|
type: "button",
|
|
1457
|
-
className:
|
|
1417
|
+
className: X.sortButton,
|
|
1458
1418
|
onClick: () => y(e),
|
|
1459
1419
|
children: [/* @__PURE__ */ f("span", { children: e.header }), /* @__PURE__ */ f("span", {
|
|
1460
|
-
className:
|
|
1420
|
+
className: X.sortIcon,
|
|
1461
1421
|
children: x(e)
|
|
1462
1422
|
})]
|
|
1463
1423
|
}) : e.header
|
|
@@ -1465,15 +1425,15 @@ function Ue({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1465
1425
|
}) })
|
|
1466
1426
|
}),
|
|
1467
1427
|
/* @__PURE__ */ p("tbody", {
|
|
1468
|
-
className:
|
|
1428
|
+
className: X.body,
|
|
1469
1429
|
children: [
|
|
1470
1430
|
a ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
|
|
1471
|
-
className:
|
|
1431
|
+
className: X.statusCell,
|
|
1472
1432
|
colSpan: e.length,
|
|
1473
1433
|
children: "Caricamento dati…"
|
|
1474
1434
|
}) }) : null,
|
|
1475
1435
|
!a && v.length === 0 ? /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
|
|
1476
|
-
className:
|
|
1436
|
+
className: X.statusCell,
|
|
1477
1437
|
colSpan: e.length,
|
|
1478
1438
|
children: i
|
|
1479
1439
|
}) }) : null,
|
|
@@ -1482,7 +1442,7 @@ function Ue({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1482
1442
|
a?.(t, r);
|
|
1483
1443
|
};
|
|
1484
1444
|
return /* @__PURE__ */ f("tr", {
|
|
1485
|
-
className: X
|
|
1445
|
+
className: Z(X.row, o && X.interactiveRow),
|
|
1486
1446
|
tabIndex: o ? 0 : void 0,
|
|
1487
1447
|
"aria-label": o ? l?.(t, r) : void 0,
|
|
1488
1448
|
onClick: o ? c : void 0,
|
|
@@ -1490,7 +1450,7 @@ function Ue({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1490
1450
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), c());
|
|
1491
1451
|
} : void 0,
|
|
1492
1452
|
children: e.map((e) => /* @__PURE__ */ f("td", {
|
|
1493
|
-
className: X
|
|
1453
|
+
className: Z(X.cell, X[`align${Ge(e.align ?? "left")}`], e.numeric && X.numeric, e.hideOnMobile && X.hideOnMobile),
|
|
1494
1454
|
children: e.cell(t, r)
|
|
1495
1455
|
}, e.id))
|
|
1496
1456
|
}, i);
|
|
@@ -1501,10 +1461,10 @@ function Ue({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
1501
1461
|
})
|
|
1502
1462
|
});
|
|
1503
1463
|
}
|
|
1504
|
-
function
|
|
1464
|
+
function Ge(e) {
|
|
1505
1465
|
return `${e.charAt(0).toUpperCase()}${e.slice(1)}`;
|
|
1506
1466
|
}
|
|
1507
|
-
var
|
|
1467
|
+
var Q = {
|
|
1508
1468
|
root: "_root_4rywg_1",
|
|
1509
1469
|
track: "_track_4rywg_8",
|
|
1510
1470
|
sm: "_sm_4rywg_16",
|
|
@@ -1514,40 +1474,40 @@ var Z = {
|
|
|
1514
1474
|
};
|
|
1515
1475
|
//#endregion
|
|
1516
1476
|
//#region src/components/ProgressBar/ProgressBar.tsx
|
|
1517
|
-
function
|
|
1477
|
+
function Ke(e, t) {
|
|
1518
1478
|
if (t <= 0) return 0;
|
|
1519
1479
|
let n = e / t * 100;
|
|
1520
1480
|
return Math.min(100, Math.max(0, n));
|
|
1521
1481
|
}
|
|
1522
|
-
var
|
|
1523
|
-
let n =
|
|
1482
|
+
var qe = (e, t) => {
|
|
1483
|
+
let n = Ke(e, t);
|
|
1524
1484
|
return `${Math.round(n)}%`;
|
|
1525
1485
|
};
|
|
1526
|
-
function
|
|
1527
|
-
let c =
|
|
1486
|
+
function Je({ value: e, max: t = 100, color: n = "var(--color-danger-500)", showValue: r = !0, formatValue: i = qe, label: a, size: o = "md", className: s }) {
|
|
1487
|
+
let c = Ke(e, t), l = Math.max(0, t), u = Math.min(l, Math.max(0, e));
|
|
1528
1488
|
return /* @__PURE__ */ p("div", {
|
|
1529
|
-
className: [
|
|
1489
|
+
className: [Q.root, s].filter(Boolean).join(" "),
|
|
1530
1490
|
children: [/* @__PURE__ */ f("div", {
|
|
1531
|
-
className: [
|
|
1491
|
+
className: [Q.track, Q[o]].join(" "),
|
|
1532
1492
|
role: "progressbar",
|
|
1533
1493
|
"aria-valuemin": 0,
|
|
1534
1494
|
"aria-valuemax": l,
|
|
1535
1495
|
"aria-valuenow": u,
|
|
1536
1496
|
"aria-label": a,
|
|
1537
1497
|
children: /* @__PURE__ */ f("div", {
|
|
1538
|
-
className:
|
|
1498
|
+
className: Q.fill,
|
|
1539
1499
|
style: {
|
|
1540
1500
|
width: `${c}%`,
|
|
1541
1501
|
backgroundColor: n
|
|
1542
1502
|
}
|
|
1543
1503
|
})
|
|
1544
1504
|
}), r ? /* @__PURE__ */ f("span", {
|
|
1545
|
-
className: `${
|
|
1505
|
+
className: `${Q.value} numeric`,
|
|
1546
1506
|
children: i(e, t)
|
|
1547
1507
|
}) : null]
|
|
1548
1508
|
});
|
|
1549
1509
|
}
|
|
1550
|
-
var
|
|
1510
|
+
var $ = {
|
|
1551
1511
|
root: "_root_xnpes_1",
|
|
1552
1512
|
track: "_track_xnpes_6",
|
|
1553
1513
|
slide: "_slide_xnpes_19",
|
|
@@ -1560,10 +1520,10 @@ var Q = {
|
|
|
1560
1520
|
};
|
|
1561
1521
|
//#endregion
|
|
1562
1522
|
//#region src/components/Carousel/Carousel.tsx
|
|
1563
|
-
function
|
|
1523
|
+
function Ye(...e) {
|
|
1564
1524
|
return e.filter(Boolean).join(" ");
|
|
1565
1525
|
}
|
|
1566
|
-
function
|
|
1526
|
+
function Xe({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showDots: a = !0, gap: c = "var(--space-4)", slideWidth: m = "100%", className: h }) {
|
|
1567
1527
|
let g = l(null), _ = l([]), v = s(), y = e.toArray(t), [b, x] = u(0), [S, C] = u(!1), [w, T] = u(y.length > 1), E = i(() => {
|
|
1568
1528
|
let e = g.current;
|
|
1569
1529
|
if (!e) return;
|
|
@@ -1599,14 +1559,14 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1599
1559
|
D(Math.min(y.length - 1, b + 1));
|
|
1600
1560
|
}
|
|
1601
1561
|
return /* @__PURE__ */ p("div", {
|
|
1602
|
-
className:
|
|
1562
|
+
className: Ye($.root, h),
|
|
1603
1563
|
role: "region",
|
|
1604
1564
|
"aria-roledescription": "carosello",
|
|
1605
1565
|
"aria-label": n,
|
|
1606
1566
|
children: [
|
|
1607
1567
|
/* @__PURE__ */ f("div", {
|
|
1608
1568
|
ref: g,
|
|
1609
|
-
className:
|
|
1569
|
+
className: $.track,
|
|
1610
1570
|
style: { gap: c },
|
|
1611
1571
|
onScroll: E,
|
|
1612
1572
|
children: y.map((e, t) => /* @__PURE__ */ f("div", {
|
|
@@ -1614,7 +1574,7 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1614
1574
|
_.current[t] = e;
|
|
1615
1575
|
},
|
|
1616
1576
|
id: `${v}-slide-${t}`,
|
|
1617
|
-
className:
|
|
1577
|
+
className: $.slide,
|
|
1618
1578
|
style: { minWidth: m },
|
|
1619
1579
|
role: "group",
|
|
1620
1580
|
"aria-roledescription": "slide",
|
|
@@ -1624,7 +1584,7 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1624
1584
|
}),
|
|
1625
1585
|
r && y.length > 1 ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
|
|
1626
1586
|
type: "button",
|
|
1627
|
-
className:
|
|
1587
|
+
className: Ye($.arrow, $.arrowPrev),
|
|
1628
1588
|
"aria-label": "Elemento precedente",
|
|
1629
1589
|
disabled: !S,
|
|
1630
1590
|
onClick: O,
|
|
@@ -1634,7 +1594,7 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1634
1594
|
})
|
|
1635
1595
|
}), /* @__PURE__ */ f("button", {
|
|
1636
1596
|
type: "button",
|
|
1637
|
-
className:
|
|
1597
|
+
className: Ye($.arrow, $.arrowNext),
|
|
1638
1598
|
"aria-label": "Elemento successivo",
|
|
1639
1599
|
disabled: !w,
|
|
1640
1600
|
onClick: k,
|
|
@@ -1644,13 +1604,13 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1644
1604
|
})
|
|
1645
1605
|
})] }) : null,
|
|
1646
1606
|
a && y.length > 1 ? /* @__PURE__ */ f("div", {
|
|
1647
|
-
className:
|
|
1607
|
+
className: $.dots,
|
|
1648
1608
|
role: "tablist",
|
|
1649
1609
|
"aria-label": "Vai a",
|
|
1650
1610
|
children: y.map((e, t) => /* @__PURE__ */ f("button", {
|
|
1651
1611
|
type: "button",
|
|
1652
1612
|
role: "tab",
|
|
1653
|
-
className:
|
|
1613
|
+
className: Ye($.dot, t === b && $.activeDot),
|
|
1654
1614
|
"aria-selected": t === b,
|
|
1655
1615
|
"aria-controls": `${v}-slide-${t}`,
|
|
1656
1616
|
"aria-label": `Vai all'elemento ${t + 1}`,
|
|
@@ -1661,4 +1621,4 @@ function Je({ children: t, ariaLabel: n = "Carosello", showArrows: r = !0, showD
|
|
|
1661
1621
|
});
|
|
1662
1622
|
}
|
|
1663
1623
|
//#endregion
|
|
1664
|
-
export {
|
|
1624
|
+
export { Fe as Badge, v as Button, le as CalculatorKeypad, C as Card, Xe as Carousel, We as DataTable, ye as DatePicker, Ee as Dropdown, Ce as IconButton, Be as List, He as ListCell, Ve as ListRow, Me as MonthCarousel, Oe as MultiSelect, Je as ProgressBar, Le as Switch, Te as TextField };
|