@marianmeres/stuic 3.181.0 → 3.182.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.
Files changed (32) hide show
  1. package/README.md +1 -1
  2. package/dist/components/FieldsBuilder/FieldsBuilder.svelte +101 -150
  3. package/dist/components/FieldsBuilder/FieldsBuilder.svelte.d.ts +10 -1
  4. package/dist/components/FieldsBuilder/README.md +82 -3
  5. package/dist/components/FieldsBuilder/_internal/ColumnsEditor.svelte +624 -0
  6. package/dist/components/FieldsBuilder/_internal/ColumnsEditor.svelte.d.ts +41 -0
  7. package/dist/components/FieldsBuilder/_internal/ExtrasEditor.svelte +174 -0
  8. package/dist/components/FieldsBuilder/_internal/ExtrasEditor.svelte.d.ts +20 -0
  9. package/dist/components/FieldsBuilder/_internal/column-meta.d.ts +27 -0
  10. package/dist/components/FieldsBuilder/_internal/column-meta.js +15 -0
  11. package/dist/components/FieldsBuilder/i18n-sk.js +17 -0
  12. package/dist/components/FieldsBuilder/i18n.d.ts +17 -0
  13. package/dist/components/FieldsBuilder/i18n.js +17 -0
  14. package/dist/components/FieldsBuilder/index.css +20 -0
  15. package/dist/components/FieldsBuilder/index.d.ts +2 -2
  16. package/dist/components/FieldsBuilder/types.d.ts +39 -0
  17. package/dist/components/FieldsBuilder/utils.d.ts +36 -1
  18. package/dist/components/FieldsBuilder/utils.js +180 -55
  19. package/dist/components/Input/FieldTable.svelte +907 -0
  20. package/dist/components/Input/FieldTable.svelte.d.ts +98 -0
  21. package/dist/components/Input/README.md +251 -0
  22. package/dist/components/Input/field-table-i18n-sk.d.ts +21 -0
  23. package/dist/components/Input/field-table-i18n-sk.js +41 -0
  24. package/dist/components/Input/field-table-i18n.d.ts +60 -0
  25. package/dist/components/Input/field-table-i18n.js +66 -0
  26. package/dist/components/Input/field-table-number.d.ts +48 -0
  27. package/dist/components/Input/field-table-number.js +86 -0
  28. package/dist/components/Input/index.css +597 -0
  29. package/dist/components/Input/index.d.ts +4 -0
  30. package/dist/components/Input/index.js +4 -0
  31. package/docs/domains/components.md +24 -18
  32. package/package.json +1 -1
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Locale-aware number parsing and formatting for `FieldTable`'s `number` cells.
3
+ *
4
+ * Pure functions (no DOM), so they can be unit-tested in the fast node project.
5
+ * The rule they implement is "never guess": a typed value is either read as one
6
+ * unambiguous number, or rejected.
7
+ */
8
+ /**
9
+ * The decimal separator `Intl` uses for `locale` (`"."` for `en`, `","` for `sk`).
10
+ * `undefined` means the runtime's default locale. An unknown locale falls back to `"."`.
11
+ */
12
+ export function decimalSeparator(locale) {
13
+ try {
14
+ const parts = new Intl.NumberFormat(locale, { useGrouping: false }).formatToParts(1.1);
15
+ return parts.find((p) => p.type === "decimal")?.value ?? ".";
16
+ }
17
+ catch {
18
+ return ".";
19
+ }
20
+ }
21
+ // an optional sign, then digits with at most one dot ("12", "12.", ".5", "-3.2");
22
+ // no exponent, no hex, no trailing garbage
23
+ const DECIMAL_RE = /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)$/;
24
+ /**
25
+ * Parses what a user typed into a number cell.
26
+ *
27
+ * - Whitespace anywhere (including NBSP / narrow NBSP) is stripped: `"1 000"` → `1000`.
28
+ * - `"."` is always accepted as the decimal separator.
29
+ * - `","` is accepted as the decimal separator **only** when `locale` uses it. Under an
30
+ * English locale `"1,000"` is rejected — it is never silently read as a thousands group.
31
+ * - Two separators (`"1.2.3"`, `"1,2,3"`, `"1,000.5"`) are rejected.
32
+ * - A Unicode minus (`"−5"`, what `Intl` formats in some locales) reads as a minus sign.
33
+ * - Blank is `{ ok: true, value: null }`.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * parseCellNumber("4.2", "sk"); // { ok: true, value: 4.2 }
38
+ * parseCellNumber("4,2", "sk"); // { ok: true, value: 4.2 }
39
+ * parseCellNumber("4,2", "en"); // { ok: false }
40
+ * parseCellNumber("1 000", "en"); // { ok: true, value: 1000 }
41
+ * parseCellNumber("", "en"); // { ok: true, value: null }
42
+ * ```
43
+ */
44
+ export function parseCellNumber(raw, locale) {
45
+ let s = String(raw ?? "")
46
+ .replace(/\s+/g, "")
47
+ .replace(/−/g, "-");
48
+ if (s === "")
49
+ return { ok: true, value: null };
50
+ const dots = (s.match(/\./g) ?? []).length;
51
+ const commas = (s.match(/,/g) ?? []).length;
52
+ if (dots + commas > 1)
53
+ return { ok: false };
54
+ if (commas === 1) {
55
+ if (decimalSeparator(locale) !== ",")
56
+ return { ok: false };
57
+ s = s.replace(",", ".");
58
+ }
59
+ if (!DECIMAL_RE.test(s))
60
+ return { ok: false };
61
+ const n = Number(s);
62
+ if (!Number.isFinite(n))
63
+ return { ok: false };
64
+ return { ok: true, value: n };
65
+ }
66
+ /**
67
+ * Formats a number for display in a number cell: no grouping, up to 20 fraction
68
+ * digits (so `4.2` is never rounded away), Latin digits, the locale's decimal
69
+ * separator. A Slovak user sees `4,2` for `4.2`; an English one `4.2`.
70
+ *
71
+ * A non-finite input yields `""`.
72
+ */
73
+ export function formatCellNumber(n, locale) {
74
+ if (typeof n !== "number" || !Number.isFinite(n))
75
+ return "";
76
+ try {
77
+ return new Intl.NumberFormat(locale, {
78
+ useGrouping: false,
79
+ maximumFractionDigits: 20,
80
+ numberingSystem: "latn",
81
+ }).format(n);
82
+ }
83
+ catch {
84
+ return String(n);
85
+ }
86
+ }
@@ -98,6 +98,27 @@
98
98
  --stuic-field-date-placeholder-text: var(--stuic-input-placeholder);
99
99
  --stuic-field-date-embedded-padding: 0.5rem;
100
100
  --stuic-field-date-dialog-padding: 1rem;
101
+
102
+ /* FieldTable specific (see the FIELD TABLE section at the bottom of this file) */
103
+ --stuic-field-table-border-color: var(--stuic-color-border);
104
+ --stuic-field-table-header-bg: var(--stuic-color-muted);
105
+ --stuic-field-table-header-text: var(--stuic-color-muted-foreground);
106
+ --stuic-field-table-row-divider-color: var(--stuic-color-border);
107
+ --stuic-field-table-cell-padding-x: calc(var(--spacing) * 1.5);
108
+ --stuic-field-table-cell-padding-y: calc(var(--spacing) * 1);
109
+ --stuic-field-table-card-bg: transparent;
110
+ --stuic-field-table-card-gap: calc(var(--spacing) * 2);
111
+ --stuic-field-table-invalid-color: var(--stuic-input-accent-error);
112
+ --stuic-field-table-unit-text: var(--stuic-color-muted-foreground);
113
+ /* `--stuic-field-table-card-radius` is deliberately NOT declared: it is read as a
114
+ fallback argument at the usage site (`--stuic-radius`) — see docs/conventions.md. */
115
+ /* Minimum usable width per cell type in table mode (the table scrolls instead) */
116
+ --stuic-field-table-col-min-text: 10rem;
117
+ --stuic-field-table-col-min-number: 6rem;
118
+ --stuic-field-table-col-min-select: 8rem;
119
+ --stuic-field-table-col-min-checkbox: 3rem;
120
+ --stuic-field-table-col-min-date: 9.5rem;
121
+ --stuic-field-table-col-min-url: 12rem;
101
122
  }
102
123
 
103
124
  @layer components {
@@ -954,3 +975,579 @@
954
975
  overflow-x: auto;
955
976
  }
956
977
  }
978
+
979
+ /* ============================================================================
980
+ FIELD TABLE
981
+ One DOM for both layouts: a real <table> is the base ("table" mode), and the
982
+ "stacked" mode restyles it into one card per row (thead gone, each <td> a
983
+ label + control line, the actions cell moved to the card's top). `auto`
984
+ picks the mode by a container query on the component's OWN inline size — a
985
+ size query cannot read a custom property, hence a `data-table-from` attribute
986
+ on a fixed scale and one block per step (the DescriptionList pattern).
987
+
988
+ The stacked block is repeated verbatim per step on purpose: the alternative
989
+ (a JS ResizeObserver flipping an attribute) would remount nothing either, but
990
+ paints one frame in the wrong mode and costs an observer per instance.
991
+
992
+ Cell controls take their chrome from Tailwind utilities in the component
993
+ (the `.stuic-input input` base rule outranks any component-layer selector);
994
+ this file owns layout, headers, cards, min-widths and the messages.
995
+ ============================================================================ */
996
+
997
+ @layer components {
998
+ .stuic-field-table {
999
+ padding: calc(var(--spacing) * 2);
1000
+ }
1001
+
1002
+ .stuic-field-table[data-layout="auto"] {
1003
+ /* Named so the queries below can only ever resolve against this element,
1004
+ never against a consumer's own @container ancestor. */
1005
+ container-name: stuic-field-table;
1006
+ container-type: inline-size;
1007
+ }
1008
+
1009
+ /* ---- table mode (base) ---- */
1010
+
1011
+ .stuic-field-table-scroll {
1012
+ overflow-x: auto;
1013
+ scrollbar-width: thin;
1014
+ }
1015
+
1016
+ .stuic-field-table table {
1017
+ width: 100%;
1018
+ border-collapse: collapse;
1019
+ }
1020
+
1021
+ .stuic-field-table th {
1022
+ text-align: start;
1023
+ font-size: var(--text-xs);
1024
+ font-weight: 500;
1025
+ color: var(--stuic-field-table-header-text);
1026
+ background: var(--stuic-field-table-header-bg);
1027
+ padding: var(--stuic-field-table-cell-padding-y)
1028
+ var(--stuic-field-table-cell-padding-x);
1029
+ white-space: nowrap;
1030
+ }
1031
+
1032
+ .stuic-field-table th:first-child {
1033
+ border-start-start-radius: var(
1034
+ --stuic-field-table-header-radius,
1035
+ var(--stuic-radius)
1036
+ );
1037
+ }
1038
+
1039
+ .stuic-field-table th:last-child {
1040
+ border-start-end-radius: var(--stuic-field-table-header-radius, var(--stuic-radius));
1041
+ }
1042
+
1043
+ .stuic-field-table td {
1044
+ padding: var(--stuic-field-table-cell-padding-y)
1045
+ var(--stuic-field-table-cell-padding-x);
1046
+ vertical-align: top;
1047
+ border-top: 1px solid var(--stuic-field-table-row-divider-color);
1048
+ }
1049
+
1050
+ .stuic-field-table tbody tr:first-child td {
1051
+ border-top-color: transparent;
1052
+ }
1053
+
1054
+ /* never squash an input below usable width — the wrapper scrolls instead */
1055
+ .stuic-field-table td[data-type="text"] {
1056
+ min-width: var(--stuic-field-table-col-min-text);
1057
+ }
1058
+ .stuic-field-table td[data-type="number"] {
1059
+ min-width: var(--stuic-field-table-col-min-number);
1060
+ }
1061
+ .stuic-field-table td[data-type="select"] {
1062
+ min-width: var(--stuic-field-table-col-min-select);
1063
+ }
1064
+ .stuic-field-table td[data-type="checkbox"] {
1065
+ min-width: var(--stuic-field-table-col-min-checkbox);
1066
+ }
1067
+ .stuic-field-table td[data-type="date"] {
1068
+ min-width: var(--stuic-field-table-col-min-date);
1069
+ }
1070
+ .stuic-field-table td[data-type="url"] {
1071
+ min-width: var(--stuic-field-table-col-min-url);
1072
+ }
1073
+
1074
+ /* In table mode the <th scope="col"> is the visible heading; the per-cell
1075
+ label stays for the accessible name only ("Qty, row 3"). */
1076
+ .stuic-field-table-cell-label {
1077
+ position: absolute;
1078
+ width: 1px;
1079
+ height: 1px;
1080
+ margin: -1px;
1081
+ padding: 0;
1082
+ overflow: hidden;
1083
+ clip-path: inset(50%);
1084
+ white-space: nowrap;
1085
+ border: 0;
1086
+ }
1087
+
1088
+ .stuic-field-table-row-title {
1089
+ display: none;
1090
+ }
1091
+
1092
+ .stuic-field-table-actions {
1093
+ width: 1%;
1094
+ white-space: nowrap;
1095
+ text-align: end;
1096
+ }
1097
+
1098
+ .stuic-field-table-actions-buttons {
1099
+ display: inline-flex;
1100
+ align-items: center;
1101
+ gap: calc(var(--spacing) * 0.5);
1102
+ }
1103
+
1104
+ /* ---- cells ---- */
1105
+
1106
+ .stuic-field-table-number {
1107
+ display: flex;
1108
+ align-items: center;
1109
+ gap: calc(var(--spacing) * 1.5);
1110
+ }
1111
+
1112
+ .stuic-field-table-unit {
1113
+ color: var(--stuic-field-table-unit-text);
1114
+ font-size: var(--text-xs);
1115
+ white-space: nowrap;
1116
+ }
1117
+
1118
+ .stuic-field-table-checkbox {
1119
+ display: flex;
1120
+ align-items: center;
1121
+ min-height: var(--stuic-input-min-height-sm);
1122
+ }
1123
+
1124
+ .stuic-field-table-readonly {
1125
+ font-size: var(--text-sm);
1126
+ padding-block: var(--stuic-field-table-cell-padding-y);
1127
+ overflow-wrap: anywhere;
1128
+ }
1129
+
1130
+ .stuic-field-table-unknown-row {
1131
+ font-size: var(--text-xs);
1132
+ color: var(--stuic-color-surface-warning-foreground);
1133
+ }
1134
+
1135
+ .stuic-field-table-cell-error {
1136
+ margin-top: calc(var(--spacing) * 1);
1137
+ font-size: var(--text-xs);
1138
+ color: var(--stuic-field-table-invalid-color);
1139
+ }
1140
+
1141
+ /* ---- empty / footer ---- */
1142
+
1143
+ .stuic-field-table-empty {
1144
+ padding: calc(var(--spacing) * 3);
1145
+ text-align: center;
1146
+ font-size: var(--text-sm);
1147
+ opacity: 0.5;
1148
+ }
1149
+
1150
+ .stuic-field-table-footer {
1151
+ display: flex;
1152
+ align-items: center;
1153
+ justify-content: space-between;
1154
+ gap: calc(var(--spacing) * 2);
1155
+ padding-top: calc(var(--spacing) * 2);
1156
+ }
1157
+
1158
+ .stuic-field-table-add {
1159
+ display: inline-flex;
1160
+ align-items: center;
1161
+ gap: calc(var(--spacing) * 1);
1162
+ font-size: var(--text-sm);
1163
+ padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 2)
1164
+ calc(var(--spacing) * 1.5) calc(var(--spacing) * 1.5);
1165
+ border-radius: var(--stuic-field-table-add-radius, var(--stuic-radius-button));
1166
+ background: var(--stuic-color-muted);
1167
+ opacity: 0.75;
1168
+ transition:
1169
+ opacity var(--stuic-transition),
1170
+ background var(--stuic-transition);
1171
+ }
1172
+
1173
+ .stuic-field-table-add:hover:not(:disabled) {
1174
+ opacity: 1;
1175
+ background: var(--stuic-color-muted-hover);
1176
+ }
1177
+
1178
+ .stuic-field-table-add:disabled {
1179
+ opacity: 0.25;
1180
+ cursor: not-allowed;
1181
+ }
1182
+
1183
+ .stuic-field-table-count {
1184
+ font-size: var(--text-xs);
1185
+ color: var(--stuic-color-muted-foreground);
1186
+ font-variant-numeric: tabular-nums;
1187
+ }
1188
+
1189
+ /* ---- stacked mode (static) ---- */
1190
+
1191
+ .stuic-field-table[data-layout="stacked"] thead {
1192
+ display: none;
1193
+ }
1194
+ .stuic-field-table[data-layout="stacked"] table,
1195
+ .stuic-field-table[data-layout="stacked"] tbody,
1196
+ .stuic-field-table[data-layout="stacked"] tr,
1197
+ .stuic-field-table[data-layout="stacked"] td {
1198
+ display: block;
1199
+ min-width: 0;
1200
+ }
1201
+ .stuic-field-table[data-layout="stacked"] tbody {
1202
+ display: flex;
1203
+ flex-direction: column;
1204
+ gap: var(--stuic-field-table-card-gap);
1205
+ }
1206
+ .stuic-field-table[data-layout="stacked"] tr {
1207
+ display: flex;
1208
+ flex-direction: column;
1209
+ gap: calc(var(--spacing) * 2);
1210
+ padding: calc(var(--spacing) * 2.5);
1211
+ border: 1px solid var(--stuic-field-table-border-color);
1212
+ border-radius: var(--stuic-field-table-card-radius, var(--stuic-radius));
1213
+ background: var(--stuic-field-table-card-bg);
1214
+ }
1215
+ .stuic-field-table[data-layout="stacked"] td {
1216
+ display: grid;
1217
+ grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
1218
+ column-gap: calc(var(--spacing) * 3);
1219
+ align-items: center;
1220
+ padding: 0;
1221
+ border-top: 0;
1222
+ }
1223
+ .stuic-field-table[data-layout="stacked"] td[data-degraded] {
1224
+ display: block;
1225
+ }
1226
+ .stuic-field-table[data-layout="stacked"] .stuic-field-table-cell-label {
1227
+ position: static;
1228
+ width: auto;
1229
+ height: auto;
1230
+ margin: 0;
1231
+ overflow: visible;
1232
+ clip-path: none;
1233
+ white-space: normal;
1234
+ font-size: var(--text-xs);
1235
+ font-weight: 500;
1236
+ color: var(--stuic-field-table-header-text);
1237
+ }
1238
+ .stuic-field-table[data-layout="stacked"] .stuic-field-table-cell-error {
1239
+ grid-column: 2;
1240
+ margin-top: 0;
1241
+ }
1242
+ .stuic-field-table[data-layout="stacked"] .stuic-field-table-actions {
1243
+ order: -1;
1244
+ display: flex;
1245
+ align-items: center;
1246
+ justify-content: space-between;
1247
+ width: auto;
1248
+ white-space: normal;
1249
+ padding-bottom: calc(var(--spacing) * 1.5);
1250
+ border-bottom: 1px solid var(--stuic-field-table-row-divider-color);
1251
+ }
1252
+ .stuic-field-table[data-layout="stacked"] .stuic-field-table-row-title {
1253
+ display: inline;
1254
+ font-size: var(--text-sm);
1255
+ font-weight: 500;
1256
+ }
1257
+
1258
+ /* ---- stacked mode by container query (`layout="auto"`) ----
1259
+ The same block as above, once per `tableFrom` step: sm 32rem, md 40rem,
1260
+ lg 48rem, xl 56rem. */
1261
+
1262
+ @container stuic-field-table (width < 32rem) {
1263
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] thead {
1264
+ display: none;
1265
+ }
1266
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] table,
1267
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] tbody,
1268
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] tr,
1269
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] td {
1270
+ display: block;
1271
+ min-width: 0;
1272
+ }
1273
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] tbody {
1274
+ display: flex;
1275
+ flex-direction: column;
1276
+ gap: var(--stuic-field-table-card-gap);
1277
+ }
1278
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] tr {
1279
+ display: flex;
1280
+ flex-direction: column;
1281
+ gap: calc(var(--spacing) * 2);
1282
+ padding: calc(var(--spacing) * 2.5);
1283
+ border: 1px solid var(--stuic-field-table-border-color);
1284
+ border-radius: var(--stuic-field-table-card-radius, var(--stuic-radius));
1285
+ background: var(--stuic-field-table-card-bg);
1286
+ }
1287
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] td {
1288
+ display: grid;
1289
+ grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
1290
+ column-gap: calc(var(--spacing) * 3);
1291
+ align-items: center;
1292
+ padding: 0;
1293
+ border-top: 0;
1294
+ }
1295
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"] td[data-degraded] {
1296
+ display: block;
1297
+ }
1298
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"]
1299
+ .stuic-field-table-cell-label {
1300
+ position: static;
1301
+ width: auto;
1302
+ height: auto;
1303
+ margin: 0;
1304
+ overflow: visible;
1305
+ clip-path: none;
1306
+ white-space: normal;
1307
+ font-size: var(--text-xs);
1308
+ font-weight: 500;
1309
+ color: var(--stuic-field-table-header-text);
1310
+ }
1311
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"]
1312
+ .stuic-field-table-cell-error {
1313
+ grid-column: 2;
1314
+ margin-top: 0;
1315
+ }
1316
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"]
1317
+ .stuic-field-table-actions {
1318
+ order: -1;
1319
+ display: flex;
1320
+ align-items: center;
1321
+ justify-content: space-between;
1322
+ width: auto;
1323
+ white-space: normal;
1324
+ padding-bottom: calc(var(--spacing) * 1.5);
1325
+ border-bottom: 1px solid var(--stuic-field-table-row-divider-color);
1326
+ }
1327
+ .stuic-field-table[data-layout="auto"][data-table-from="sm"]
1328
+ .stuic-field-table-row-title {
1329
+ display: inline;
1330
+ font-size: var(--text-sm);
1331
+ font-weight: 500;
1332
+ }
1333
+ }
1334
+
1335
+ @container stuic-field-table (width < 40rem) {
1336
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] thead {
1337
+ display: none;
1338
+ }
1339
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] table,
1340
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] tbody,
1341
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] tr,
1342
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] td {
1343
+ display: block;
1344
+ min-width: 0;
1345
+ }
1346
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] tbody {
1347
+ display: flex;
1348
+ flex-direction: column;
1349
+ gap: var(--stuic-field-table-card-gap);
1350
+ }
1351
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] tr {
1352
+ display: flex;
1353
+ flex-direction: column;
1354
+ gap: calc(var(--spacing) * 2);
1355
+ padding: calc(var(--spacing) * 2.5);
1356
+ border: 1px solid var(--stuic-field-table-border-color);
1357
+ border-radius: var(--stuic-field-table-card-radius, var(--stuic-radius));
1358
+ background: var(--stuic-field-table-card-bg);
1359
+ }
1360
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] td {
1361
+ display: grid;
1362
+ grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
1363
+ column-gap: calc(var(--spacing) * 3);
1364
+ align-items: center;
1365
+ padding: 0;
1366
+ border-top: 0;
1367
+ }
1368
+ .stuic-field-table[data-layout="auto"][data-table-from="md"] td[data-degraded] {
1369
+ display: block;
1370
+ }
1371
+ .stuic-field-table[data-layout="auto"][data-table-from="md"]
1372
+ .stuic-field-table-cell-label {
1373
+ position: static;
1374
+ width: auto;
1375
+ height: auto;
1376
+ margin: 0;
1377
+ overflow: visible;
1378
+ clip-path: none;
1379
+ white-space: normal;
1380
+ font-size: var(--text-xs);
1381
+ font-weight: 500;
1382
+ color: var(--stuic-field-table-header-text);
1383
+ }
1384
+ .stuic-field-table[data-layout="auto"][data-table-from="md"]
1385
+ .stuic-field-table-cell-error {
1386
+ grid-column: 2;
1387
+ margin-top: 0;
1388
+ }
1389
+ .stuic-field-table[data-layout="auto"][data-table-from="md"]
1390
+ .stuic-field-table-actions {
1391
+ order: -1;
1392
+ display: flex;
1393
+ align-items: center;
1394
+ justify-content: space-between;
1395
+ width: auto;
1396
+ white-space: normal;
1397
+ padding-bottom: calc(var(--spacing) * 1.5);
1398
+ border-bottom: 1px solid var(--stuic-field-table-row-divider-color);
1399
+ }
1400
+ .stuic-field-table[data-layout="auto"][data-table-from="md"]
1401
+ .stuic-field-table-row-title {
1402
+ display: inline;
1403
+ font-size: var(--text-sm);
1404
+ font-weight: 500;
1405
+ }
1406
+ }
1407
+
1408
+ @container stuic-field-table (width < 48rem) {
1409
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] thead {
1410
+ display: none;
1411
+ }
1412
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] table,
1413
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] tbody,
1414
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] tr,
1415
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] td {
1416
+ display: block;
1417
+ min-width: 0;
1418
+ }
1419
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] tbody {
1420
+ display: flex;
1421
+ flex-direction: column;
1422
+ gap: var(--stuic-field-table-card-gap);
1423
+ }
1424
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] tr {
1425
+ display: flex;
1426
+ flex-direction: column;
1427
+ gap: calc(var(--spacing) * 2);
1428
+ padding: calc(var(--spacing) * 2.5);
1429
+ border: 1px solid var(--stuic-field-table-border-color);
1430
+ border-radius: var(--stuic-field-table-card-radius, var(--stuic-radius));
1431
+ background: var(--stuic-field-table-card-bg);
1432
+ }
1433
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] td {
1434
+ display: grid;
1435
+ grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
1436
+ column-gap: calc(var(--spacing) * 3);
1437
+ align-items: center;
1438
+ padding: 0;
1439
+ border-top: 0;
1440
+ }
1441
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"] td[data-degraded] {
1442
+ display: block;
1443
+ }
1444
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"]
1445
+ .stuic-field-table-cell-label {
1446
+ position: static;
1447
+ width: auto;
1448
+ height: auto;
1449
+ margin: 0;
1450
+ overflow: visible;
1451
+ clip-path: none;
1452
+ white-space: normal;
1453
+ font-size: var(--text-xs);
1454
+ font-weight: 500;
1455
+ color: var(--stuic-field-table-header-text);
1456
+ }
1457
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"]
1458
+ .stuic-field-table-cell-error {
1459
+ grid-column: 2;
1460
+ margin-top: 0;
1461
+ }
1462
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"]
1463
+ .stuic-field-table-actions {
1464
+ order: -1;
1465
+ display: flex;
1466
+ align-items: center;
1467
+ justify-content: space-between;
1468
+ width: auto;
1469
+ white-space: normal;
1470
+ padding-bottom: calc(var(--spacing) * 1.5);
1471
+ border-bottom: 1px solid var(--stuic-field-table-row-divider-color);
1472
+ }
1473
+ .stuic-field-table[data-layout="auto"][data-table-from="lg"]
1474
+ .stuic-field-table-row-title {
1475
+ display: inline;
1476
+ font-size: var(--text-sm);
1477
+ font-weight: 500;
1478
+ }
1479
+ }
1480
+
1481
+ @container stuic-field-table (width < 56rem) {
1482
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] thead {
1483
+ display: none;
1484
+ }
1485
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] table,
1486
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] tbody,
1487
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] tr,
1488
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] td {
1489
+ display: block;
1490
+ min-width: 0;
1491
+ }
1492
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] tbody {
1493
+ display: flex;
1494
+ flex-direction: column;
1495
+ gap: var(--stuic-field-table-card-gap);
1496
+ }
1497
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] tr {
1498
+ display: flex;
1499
+ flex-direction: column;
1500
+ gap: calc(var(--spacing) * 2);
1501
+ padding: calc(var(--spacing) * 2.5);
1502
+ border: 1px solid var(--stuic-field-table-border-color);
1503
+ border-radius: var(--stuic-field-table-card-radius, var(--stuic-radius));
1504
+ background: var(--stuic-field-table-card-bg);
1505
+ }
1506
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] td {
1507
+ display: grid;
1508
+ grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr);
1509
+ column-gap: calc(var(--spacing) * 3);
1510
+ align-items: center;
1511
+ padding: 0;
1512
+ border-top: 0;
1513
+ }
1514
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"] td[data-degraded] {
1515
+ display: block;
1516
+ }
1517
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"]
1518
+ .stuic-field-table-cell-label {
1519
+ position: static;
1520
+ width: auto;
1521
+ height: auto;
1522
+ margin: 0;
1523
+ overflow: visible;
1524
+ clip-path: none;
1525
+ white-space: normal;
1526
+ font-size: var(--text-xs);
1527
+ font-weight: 500;
1528
+ color: var(--stuic-field-table-header-text);
1529
+ }
1530
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"]
1531
+ .stuic-field-table-cell-error {
1532
+ grid-column: 2;
1533
+ margin-top: 0;
1534
+ }
1535
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"]
1536
+ .stuic-field-table-actions {
1537
+ order: -1;
1538
+ display: flex;
1539
+ align-items: center;
1540
+ justify-content: space-between;
1541
+ width: auto;
1542
+ white-space: normal;
1543
+ padding-bottom: calc(var(--spacing) * 1.5);
1544
+ border-bottom: 1px solid var(--stuic-field-table-row-divider-color);
1545
+ }
1546
+ .stuic-field-table[data-layout="auto"][data-table-from="xl"]
1547
+ .stuic-field-table-row-title {
1548
+ display: inline;
1549
+ font-size: var(--text-sm);
1550
+ font-weight: 500;
1551
+ }
1552
+ }
1553
+ }
@@ -18,6 +18,10 @@ export { default as FieldTextarea, type Props as FieldTextareaProps, } from "./F
18
18
  export { default as FieldInputLocalized, type Props as FieldInputLocalizedProps, } from "./FieldInputLocalized.svelte";
19
19
  export { default as FieldKeyValues, type Props as FieldKeyValuesProps, type KeyValueEntry, } from "./FieldKeyValues.svelte";
20
20
  export { default as FieldObject, type Props as FieldObjectProps, } from "./FieldObject.svelte";
21
+ export { default as FieldTable, type Props as FieldTableProps, type FieldTableColumn, type FieldTableCellType, type FieldTableCellContext, type FieldTableRow, } from "./FieldTable.svelte";
22
+ export { createFieldTableT, FIELD_TABLE_MESSAGES_EN, type FieldTableMessageKey, type FieldTableMessages, } from "./field-table-i18n.js";
23
+ export { FIELD_TABLE_MESSAGES_SK } from "./field-table-i18n-sk.js";
24
+ export { parseCellNumber, formatCellNumber, type ParsedCellNumber, } from "./field-table-number.js";
21
25
  export { default as FieldPhoneNumber, type Props as FieldPhoneNumberProps, } from "./FieldPhoneNumber.svelte";
22
26
  export { default as FieldCountry, type Props as FieldCountryProps, } from "./FieldCountry.svelte";
23
27
  export { validatePhoneNumber } from "./phone-validation.js";