@aiaiai-pt/design-system 0.56.0 → 0.57.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/components/ActionFormRenderer.svelte +55 -10
- package/components/ActionFormRenderer.svelte.d.ts +24 -0
- package/components/Calendar.svelte +12 -4
- package/components/Calendar.svelte.d.ts +8 -0
- package/components/Combobox.svelte +6 -2
- package/components/Combobox.svelte.d.ts +4 -0
- package/components/DataTable.svelte +5 -1
- package/components/FileUpload.svelte +3 -1
- package/components/FileUpload.svelte.d.ts +2 -0
- package/components/FilterPanel.svelte +12 -4
- package/components/FilterPanel.svelte.d.ts +8 -0
- package/components/Modal.svelte +3 -1
- package/components/Modal.svelte.d.ts +2 -0
- package/components/MultiSelectCombobox.svelte +12 -2
- package/components/MultiSelectCombobox.svelte.d.ts +8 -0
- package/components/Pagination.svelte +9 -4
- package/components/Pagination.svelte.d.ts +4 -0
- package/components/Tag.svelte +3 -1
- package/components/Tag.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -176,6 +176,33 @@
|
|
|
176
176
|
* complete payload (incl. attachment_keys) to review and submit. Read-only
|
|
177
177
|
* consumers omit it. */
|
|
178
178
|
onchange?: (payload: Record<string, unknown>) => void;
|
|
179
|
+
|
|
180
|
+
// #2672 L4 — consumer-overridable labels for i18n. Each has today's
|
|
181
|
+
// English as the default so no consumer changes behaviour.
|
|
182
|
+
/** Hint appended to required file-param labels, e.g. " (required)". */
|
|
183
|
+
requiredLabel?: string;
|
|
184
|
+
/** Placeholder for choice-type selects. */
|
|
185
|
+
selectPlaceholder?: string;
|
|
186
|
+
/** Shown in a choice select while options load. */
|
|
187
|
+
loadingOptionsLabel?: string;
|
|
188
|
+
/** Shown in a choice select when no options exist. */
|
|
189
|
+
noOptionsLabel?: string;
|
|
190
|
+
/** Boolean toggle "yes" option label. */
|
|
191
|
+
booleanYesLabel?: string;
|
|
192
|
+
/** Boolean toggle "no" option label. */
|
|
193
|
+
booleanNoLabel?: string;
|
|
194
|
+
/** Hint shown when a file param has a stored file on edit. */
|
|
195
|
+
fileReplaceLabel?: string;
|
|
196
|
+
/** Hint shown below a required field (submit modes). */
|
|
197
|
+
requiredHintLabel?: string;
|
|
198
|
+
/** Combobox: shown when search returns nothing (passed through). */
|
|
199
|
+
noResultsLabel?: string;
|
|
200
|
+
/** Combobox: shown while searching / debouncing (passed through). */
|
|
201
|
+
searchingLabel?: string;
|
|
202
|
+
/** FileUpload: drop-zone instruction text (passed through). */
|
|
203
|
+
dropLabel?: string;
|
|
204
|
+
/** Default section heading when no section label is declared. */
|
|
205
|
+
defaultSectionLabel?: string;
|
|
179
206
|
}
|
|
180
207
|
|
|
181
208
|
let {
|
|
@@ -200,6 +227,18 @@
|
|
|
200
227
|
activeSectionKey = null,
|
|
201
228
|
hideSubmit = false,
|
|
202
229
|
onchange = undefined,
|
|
230
|
+
requiredLabel = " (required)",
|
|
231
|
+
selectPlaceholder = "Select value",
|
|
232
|
+
loadingOptionsLabel = "Loading options...",
|
|
233
|
+
noOptionsLabel = "No options available",
|
|
234
|
+
booleanYesLabel = "Yes",
|
|
235
|
+
booleanNoLabel = "No",
|
|
236
|
+
fileReplaceLabel = "Current file — uploading replaces it",
|
|
237
|
+
requiredHintLabel = "Required",
|
|
238
|
+
noResultsLabel = "No results found",
|
|
239
|
+
searchingLabel = "Searching…",
|
|
240
|
+
dropLabel = "Drop files here or click to browse",
|
|
241
|
+
defaultSectionLabel = "Details",
|
|
203
242
|
}: Props = $props();
|
|
204
243
|
|
|
205
244
|
let values = $state<Record<string, unknown>>({});
|
|
@@ -377,7 +416,7 @@
|
|
|
377
416
|
const section = row.section_label || row.section;
|
|
378
417
|
if (section) return String(section);
|
|
379
418
|
}
|
|
380
|
-
return
|
|
419
|
+
return defaultSectionLabel;
|
|
381
420
|
}
|
|
382
421
|
|
|
383
422
|
function groupIntoSections(items: Entity[]): Array<{ name: string; items: Entity[] }> {
|
|
@@ -403,7 +442,7 @@
|
|
|
403
442
|
// predicate, and `order` (the server emits sections pre-sorted; the
|
|
404
443
|
// sort below is a defensive mirror, stable via declaration index).
|
|
405
444
|
return {
|
|
406
|
-
name: String(section.label ?? section.key ??
|
|
445
|
+
name: String(section.label ?? section.key ?? defaultSectionLabel),
|
|
407
446
|
key: section.key ? String(section.key) : undefined,
|
|
408
447
|
columns: Number(section.columns ?? 1),
|
|
409
448
|
visibleWhen:
|
|
@@ -842,13 +881,13 @@
|
|
|
842
881
|
name={key}
|
|
843
882
|
value={String(values[key] ?? initialValue(parameter) ?? "")}
|
|
844
883
|
{options}
|
|
845
|
-
placeholder=
|
|
884
|
+
placeholder={selectPlaceholder}
|
|
846
885
|
disabled={fieldDisabled || !editable || options.length === 0}
|
|
847
886
|
error={fieldError}
|
|
848
887
|
help={parameter.loading === true
|
|
849
|
-
?
|
|
888
|
+
? loadingOptionsLabel
|
|
850
889
|
: options.length === 0
|
|
851
|
-
?
|
|
890
|
+
? noOptionsLabel
|
|
852
891
|
: undefined}
|
|
853
892
|
onchange={(value: string) => setValue(key, value)}
|
|
854
893
|
aria-required={ariaRequired}
|
|
@@ -874,8 +913,8 @@
|
|
|
874
913
|
name={key}
|
|
875
914
|
value={values[key] ? "true" : "false"}
|
|
876
915
|
options={[
|
|
877
|
-
{ value: "true", label:
|
|
878
|
-
{ value: "false", label:
|
|
916
|
+
{ value: "true", label: booleanYesLabel },
|
|
917
|
+
{ value: "false", label: booleanNoLabel },
|
|
879
918
|
]}
|
|
880
919
|
disabled={fieldDisabled || !editable}
|
|
881
920
|
error={fieldError}
|
|
@@ -919,6 +958,9 @@
|
|
|
919
958
|
disabled={!searchEntities || !editable || fieldDisabled}
|
|
920
959
|
loading={(referenceLoading[key] ?? false) || parameter.loading === true}
|
|
921
960
|
error={fieldError}
|
|
961
|
+
{noResultsLabel}
|
|
962
|
+
{searchingLabel}
|
|
963
|
+
requiredLabel={requiredLabel}
|
|
922
964
|
onsearch={(query: string) => handleReferenceSearch(parameter, query)}
|
|
923
965
|
onadd={(value: string) => addRelId(key, value)}
|
|
924
966
|
onremove={(value: string) => removeRelId(key, value)}
|
|
@@ -932,6 +974,8 @@
|
|
|
932
974
|
disabled={!searchEntities || !editable || fieldDisabled}
|
|
933
975
|
loading={(referenceLoading[key] ?? false) || parameter.loading === true}
|
|
934
976
|
error={fieldError}
|
|
977
|
+
{noResultsLabel}
|
|
978
|
+
{searchingLabel}
|
|
935
979
|
onsearch={(query: string) => handleReferenceSearch(parameter, query)}
|
|
936
980
|
onchange={(value: string) => pickSingleRel(key, value)}
|
|
937
981
|
/>
|
|
@@ -947,7 +991,7 @@
|
|
|
947
991
|
<div class="afr-file-param" role="group" aria-labelledby={`${key}-file-label`}>
|
|
948
992
|
<span id={`${key}-file-label`} class="afr-file-label"
|
|
949
993
|
>{String(parameter.label ?? key)}{parameter.required
|
|
950
|
-
?
|
|
994
|
+
? requiredLabel
|
|
951
995
|
: ""}</span
|
|
952
996
|
>
|
|
953
997
|
<!-- #40 — REPLACE semantics: the stored current shows until a pending
|
|
@@ -966,7 +1010,7 @@
|
|
|
966
1010
|
{:else}
|
|
967
1011
|
<span class="afr-file-current-name">{storedFile.name}</span>
|
|
968
1012
|
{/if}
|
|
969
|
-
<span class="afr-file-current-hint">
|
|
1013
|
+
<span class="afr-file-current-hint">{fileReplaceLabel}</span>
|
|
970
1014
|
</div>
|
|
971
1015
|
{/if}
|
|
972
1016
|
{#each fileUploads[key] ?? [] as f (f.key)}
|
|
@@ -981,6 +1025,7 @@
|
|
|
981
1025
|
maxSize={fileMaxBytes(parameter)}
|
|
982
1026
|
multiple={!replaceMode}
|
|
983
1027
|
disabled={!uploadFile || fileBusy[key]}
|
|
1028
|
+
{dropLabel}
|
|
984
1029
|
onfiles={(files: File[]) => handleFiles(key, files, replaceMode)}
|
|
985
1030
|
onreject={() => {
|
|
986
1031
|
fileError = {
|
|
@@ -1063,7 +1108,7 @@
|
|
|
1063
1108
|
<!-- EXECUTE surfaces (citizen public-submit AND staff admin-execute,
|
|
1064
1109
|
#629 follow-up): just a quiet required hint — the "Required / type"
|
|
1065
1110
|
line is operator DEBUG chrome, preview modes only. -->
|
|
1066
|
-
{#if parameter.required}<p class="field-meta">
|
|
1111
|
+
{#if parameter.required}<p class="field-meta">{requiredHintLabel}</p>{/if}
|
|
1067
1112
|
{:else}
|
|
1068
1113
|
<p class="field-meta">
|
|
1069
1114
|
{String(parameter.required ? "Required" : "Optional")} / {type}
|
|
@@ -118,6 +118,30 @@ interface Props {
|
|
|
118
118
|
* complete payload (incl. attachment_keys) to review and submit. Read-only
|
|
119
119
|
* consumers omit it. */
|
|
120
120
|
onchange?: (payload: Record<string, unknown>) => void;
|
|
121
|
+
/** Hint appended to required file-param labels, e.g. " (required)". */
|
|
122
|
+
requiredLabel?: string;
|
|
123
|
+
/** Placeholder for choice-type selects. */
|
|
124
|
+
selectPlaceholder?: string;
|
|
125
|
+
/** Shown in a choice select while options load. */
|
|
126
|
+
loadingOptionsLabel?: string;
|
|
127
|
+
/** Shown in a choice select when no options exist. */
|
|
128
|
+
noOptionsLabel?: string;
|
|
129
|
+
/** Boolean toggle "yes" option label. */
|
|
130
|
+
booleanYesLabel?: string;
|
|
131
|
+
/** Boolean toggle "no" option label. */
|
|
132
|
+
booleanNoLabel?: string;
|
|
133
|
+
/** Hint shown when a file param has a stored file on edit. */
|
|
134
|
+
fileReplaceLabel?: string;
|
|
135
|
+
/** Hint shown below a required field (submit modes). */
|
|
136
|
+
requiredHintLabel?: string;
|
|
137
|
+
/** Combobox: shown when search returns nothing (passed through). */
|
|
138
|
+
noResultsLabel?: string;
|
|
139
|
+
/** Combobox: shown while searching / debouncing (passed through). */
|
|
140
|
+
searchingLabel?: string;
|
|
141
|
+
/** FileUpload: drop-zone instruction text (passed through). */
|
|
142
|
+
dropLabel?: string;
|
|
143
|
+
/** Default section heading when no section label is declared. */
|
|
144
|
+
defaultSectionLabel?: string;
|
|
121
145
|
}
|
|
122
146
|
declare const ActionFormRenderer: import("svelte").Component<Props, {}, "">;
|
|
123
147
|
type ActionFormRenderer = ReturnType<typeof ActionFormRenderer>;
|
|
@@ -60,6 +60,14 @@
|
|
|
60
60
|
ondateclick = undefined,
|
|
61
61
|
/** @type {import('svelte').Snippet<[CalendarEvent]> | undefined} */
|
|
62
62
|
event: eventSnippet = undefined,
|
|
63
|
+
/** @type {string} — "Today" button label */
|
|
64
|
+
todayLabel = 'Today',
|
|
65
|
+
/** @type {string} — "Month" view toggle label */
|
|
66
|
+
monthLabel = 'Month',
|
|
67
|
+
/** @type {string} — "Week" view toggle label */
|
|
68
|
+
weekLabel = 'Week',
|
|
69
|
+
/** @type {string} — "Day" view toggle label */
|
|
70
|
+
dayLabel = 'Day',
|
|
63
71
|
/** @type {string} */
|
|
64
72
|
class: className = '',
|
|
65
73
|
...rest
|
|
@@ -278,7 +286,7 @@
|
|
|
278
286
|
<polyline points="96,48 176,128 96,208" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
|
|
279
287
|
</svg>
|
|
280
288
|
</button>
|
|
281
|
-
<button type="button" class="calendar-today-btn" onclick={(e) => { goToday(); /** @type {HTMLElement} */ (e.currentTarget).blur(); }}>
|
|
289
|
+
<button type="button" class="calendar-today-btn" onclick={(e) => { goToday(); /** @type {HTMLElement} */ (e.currentTarget).blur(); }}>{todayLabel}</button>
|
|
282
290
|
<h2 class="calendar-title">
|
|
283
291
|
{#if view === 'month'}
|
|
284
292
|
{format(date, 'LLLL yyyy', { locale })}
|
|
@@ -296,19 +304,19 @@
|
|
|
296
304
|
class="calendar-toggle-btn"
|
|
297
305
|
class:calendar-toggle-active={view === 'month'}
|
|
298
306
|
onclick={(e) => { view = 'month'; /** @type {HTMLElement} */ (e.currentTarget).blur(); }}
|
|
299
|
-
>
|
|
307
|
+
>{monthLabel}</button>
|
|
300
308
|
<button
|
|
301
309
|
type="button"
|
|
302
310
|
class="calendar-toggle-btn"
|
|
303
311
|
class:calendar-toggle-active={view === 'week'}
|
|
304
312
|
onclick={(e) => { view = 'week'; /** @type {HTMLElement} */ (e.currentTarget).blur(); }}
|
|
305
|
-
>
|
|
313
|
+
>{weekLabel}</button>
|
|
306
314
|
<button
|
|
307
315
|
type="button"
|
|
308
316
|
class="calendar-toggle-btn"
|
|
309
317
|
class:calendar-toggle-active={view === 'day'}
|
|
310
318
|
onclick={(e) => { view = 'day'; /** @type {HTMLElement} */ (e.currentTarget).blur(); }}
|
|
311
|
-
>
|
|
319
|
+
>{dayLabel}</button>
|
|
312
320
|
</div>
|
|
313
321
|
</div>
|
|
314
322
|
</div>
|
|
@@ -34,6 +34,10 @@ declare const Calendar: import("svelte").Component<{
|
|
|
34
34
|
oneventclick?: any;
|
|
35
35
|
ondateclick?: any;
|
|
36
36
|
event?: any;
|
|
37
|
+
todayLabel?: string;
|
|
38
|
+
monthLabel?: string;
|
|
39
|
+
weekLabel?: string;
|
|
40
|
+
dayLabel?: string;
|
|
37
41
|
class?: string;
|
|
38
42
|
} & Record<string, any>, {}, "view" | "date">;
|
|
39
43
|
type $$ComponentProps = {
|
|
@@ -45,6 +49,10 @@ type $$ComponentProps = {
|
|
|
45
49
|
oneventclick?: any;
|
|
46
50
|
ondateclick?: any;
|
|
47
51
|
event?: any;
|
|
52
|
+
todayLabel?: string;
|
|
53
|
+
monthLabel?: string;
|
|
54
|
+
weekLabel?: string;
|
|
55
|
+
dayLabel?: string;
|
|
48
56
|
class?: string;
|
|
49
57
|
} & Record<string, any>;
|
|
50
58
|
import { enUS } from 'date-fns/locale';
|
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
onsearch = undefined,
|
|
58
58
|
/** @type {boolean} */
|
|
59
59
|
loading = false,
|
|
60
|
+
/** @type {string} — shown when loading (async search debounce) */
|
|
61
|
+
searchingLabel = 'Searching…',
|
|
62
|
+
/** @type {string} — shown when the filtered list is empty */
|
|
63
|
+
noResultsLabel = 'No results found',
|
|
60
64
|
/** @type {string} */
|
|
61
65
|
class: className = '',
|
|
62
66
|
...rest
|
|
@@ -247,11 +251,11 @@
|
|
|
247
251
|
>
|
|
248
252
|
{#if loading}
|
|
249
253
|
<li class="combobox-empty" role="option" aria-selected="false" aria-disabled="true">
|
|
250
|
-
|
|
254
|
+
{searchingLabel}
|
|
251
255
|
</li>
|
|
252
256
|
{:else if filtered.length === 0}
|
|
253
257
|
<li class="combobox-empty" role="option" aria-selected="false" aria-disabled="true">
|
|
254
|
-
|
|
258
|
+
{noResultsLabel}
|
|
255
259
|
</li>
|
|
256
260
|
{:else}
|
|
257
261
|
{#each [...grouped.entries()] as [group, groupItems]}
|
|
@@ -46,6 +46,8 @@ declare const Combobox: import("svelte").Component<{
|
|
|
46
46
|
onchange?: any;
|
|
47
47
|
onsearch?: any;
|
|
48
48
|
loading?: boolean;
|
|
49
|
+
searchingLabel?: string;
|
|
50
|
+
noResultsLabel?: string;
|
|
49
51
|
class?: string;
|
|
50
52
|
} & Record<string, any>, {}, "value">;
|
|
51
53
|
type $$ComponentProps = {
|
|
@@ -60,5 +62,7 @@ type $$ComponentProps = {
|
|
|
60
62
|
onchange?: any;
|
|
61
63
|
onsearch?: any;
|
|
62
64
|
loading?: boolean;
|
|
65
|
+
searchingLabel?: string;
|
|
66
|
+
noResultsLabel?: string;
|
|
63
67
|
class?: string;
|
|
64
68
|
} & Record<string, any>;
|
|
@@ -447,7 +447,11 @@
|
|
|
447
447
|
background: var(--color-surface-secondary);
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
.
|
|
450
|
+
/* #2668 P3b — only clickable rows highlight on hover. A list whose rows
|
|
451
|
+
go nowhere (no on_row_click) looked clickable because .table-row:hover
|
|
452
|
+
highlighted all rows. Selectable rows keep their .table-row-selected
|
|
453
|
+
affordance (the checkbox cell has its own click handler). */
|
|
454
|
+
.table-row-clickable:hover {
|
|
451
455
|
background: var(--color-surface-tertiary);
|
|
452
456
|
}
|
|
453
457
|
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
icon = undefined,
|
|
37
37
|
/** @type {import('svelte').Snippet | undefined} */
|
|
38
38
|
children = undefined,
|
|
39
|
+
/** @type {string} — drop-zone instruction text */
|
|
40
|
+
dropLabel = 'Drop files here or click to browse',
|
|
39
41
|
/** @type {string} */
|
|
40
42
|
class: className = '',
|
|
41
43
|
...rest
|
|
@@ -192,7 +194,7 @@
|
|
|
192
194
|
{#if icon}
|
|
193
195
|
<span class="fileupload-icon">{@render icon()}</span>
|
|
194
196
|
{/if}
|
|
195
|
-
<span class="fileupload-text">
|
|
197
|
+
<span class="fileupload-text">{dropLabel}</span>
|
|
196
198
|
{#if accept || maxSize}
|
|
197
199
|
<span class="fileupload-hint">
|
|
198
200
|
{#if accept}{accept}{/if}
|
|
@@ -32,6 +32,7 @@ declare const FileUpload: import("svelte").Component<{
|
|
|
32
32
|
onreject?: any;
|
|
33
33
|
icon?: any;
|
|
34
34
|
children?: any;
|
|
35
|
+
dropLabel?: string;
|
|
35
36
|
class?: string;
|
|
36
37
|
} & Record<string, any>, {}, "">;
|
|
37
38
|
type $$ComponentProps = {
|
|
@@ -43,5 +44,6 @@ type $$ComponentProps = {
|
|
|
43
44
|
onreject?: any;
|
|
44
45
|
icon?: any;
|
|
45
46
|
children?: any;
|
|
47
|
+
dropLabel?: string;
|
|
46
48
|
class?: string;
|
|
47
49
|
} & Record<string, any>;
|
|
@@ -47,6 +47,14 @@
|
|
|
47
47
|
onchange = undefined,
|
|
48
48
|
/** @type {(() => void) | undefined} */
|
|
49
49
|
onclear = undefined,
|
|
50
|
+
/** @type {string} — default option label in select filters */
|
|
51
|
+
allLabel = 'All',
|
|
52
|
+
/** @type {string} — clear-all button label */
|
|
53
|
+
clearLabel = 'Clear all',
|
|
54
|
+
/** @type {string} — boolean filter "yes" label */
|
|
55
|
+
booleanYesLabel = 'Yes',
|
|
56
|
+
/** @type {string} — boolean filter "no" label */
|
|
57
|
+
booleanNoLabel = 'No',
|
|
50
58
|
/** @type {string} */
|
|
51
59
|
class: className = '',
|
|
52
60
|
...rest
|
|
@@ -102,7 +110,7 @@
|
|
|
102
110
|
value={value[filter.key] ?? ''}
|
|
103
111
|
onchange={(e) => setFilter(filter.key, /** @type {HTMLSelectElement} */ (e.currentTarget).value)}
|
|
104
112
|
>
|
|
105
|
-
<option value="">
|
|
113
|
+
<option value="">{allLabel}</option>
|
|
106
114
|
{#each filter.options as opt (opt.value)}
|
|
107
115
|
<option value={opt.value}>{opt.label}</option>
|
|
108
116
|
{/each}
|
|
@@ -112,7 +120,7 @@
|
|
|
112
120
|
</span>
|
|
113
121
|
</div>
|
|
114
122
|
{:else if filter.type === 'boolean'}
|
|
115
|
-
{@const opts = filter.options ?? [{ value: 'true', label:
|
|
123
|
+
{@const opts = filter.options ?? [{ value: 'true', label: booleanYesLabel }, { value: 'false', label: booleanNoLabel }]}
|
|
116
124
|
<span class="filter-field-label">{filter.label}</span>
|
|
117
125
|
<div class="filter-bool-chips">
|
|
118
126
|
{#each opts as opt (opt.value)}
|
|
@@ -130,7 +138,7 @@
|
|
|
130
138
|
<Combobox
|
|
131
139
|
size="sm"
|
|
132
140
|
label={filter.label}
|
|
133
|
-
placeholder=
|
|
141
|
+
placeholder={allLabel}
|
|
134
142
|
items={filter.searchItems ?? []}
|
|
135
143
|
value={value[filter.key] ?? ''}
|
|
136
144
|
onchange={(val) => setFilter(filter.key, val)}
|
|
@@ -147,7 +155,7 @@
|
|
|
147
155
|
onclick={clearAll}
|
|
148
156
|
type="button"
|
|
149
157
|
>
|
|
150
|
-
|
|
158
|
+
{clearLabel}
|
|
151
159
|
</button>
|
|
152
160
|
{/if}
|
|
153
161
|
</div>
|
|
@@ -43,6 +43,10 @@ declare const FilterPanel: import("svelte").Component<{
|
|
|
43
43
|
value?: Record<string, any>;
|
|
44
44
|
onchange?: any;
|
|
45
45
|
onclear?: any;
|
|
46
|
+
allLabel?: string;
|
|
47
|
+
clearLabel?: string;
|
|
48
|
+
booleanYesLabel?: string;
|
|
49
|
+
booleanNoLabel?: string;
|
|
46
50
|
class?: string;
|
|
47
51
|
} & Record<string, any>, {}, "value">;
|
|
48
52
|
type $$ComponentProps = {
|
|
@@ -50,5 +54,9 @@ type $$ComponentProps = {
|
|
|
50
54
|
value?: Record<string, any>;
|
|
51
55
|
onchange?: any;
|
|
52
56
|
onclear?: any;
|
|
57
|
+
allLabel?: string;
|
|
58
|
+
clearLabel?: string;
|
|
59
|
+
booleanYesLabel?: string;
|
|
60
|
+
booleanNoLabel?: string;
|
|
53
61
|
class?: string;
|
|
54
62
|
} & Record<string, any>;
|
package/components/Modal.svelte
CHANGED
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
width = 'default',
|
|
38
38
|
/** @type {(() => void) | undefined} */
|
|
39
39
|
onclose,
|
|
40
|
+
/** @type {string} — aria-label for the close button */
|
|
41
|
+
closeLabel = 'Close',
|
|
40
42
|
/** @type {string} */
|
|
41
43
|
class: className = '',
|
|
42
44
|
/** @type {import('svelte').Snippet | undefined} */
|
|
@@ -124,7 +126,7 @@
|
|
|
124
126
|
<button
|
|
125
127
|
class="modal-close"
|
|
126
128
|
onclick={onclose}
|
|
127
|
-
aria-label=
|
|
129
|
+
aria-label={closeLabel}
|
|
128
130
|
>
|
|
129
131
|
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
130
132
|
<path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
@@ -29,6 +29,7 @@ declare const Modal: import("svelte").Component<{
|
|
|
29
29
|
title: any;
|
|
30
30
|
width?: string;
|
|
31
31
|
onclose: any;
|
|
32
|
+
closeLabel?: string;
|
|
32
33
|
class?: string;
|
|
33
34
|
header?: any;
|
|
34
35
|
footer?: any;
|
|
@@ -39,6 +40,7 @@ type $$ComponentProps = {
|
|
|
39
40
|
title: any;
|
|
40
41
|
width?: string;
|
|
41
42
|
onclose: any;
|
|
43
|
+
closeLabel?: string;
|
|
42
44
|
class?: string;
|
|
43
45
|
header?: any;
|
|
44
46
|
footer?: any;
|
|
@@ -56,6 +56,14 @@
|
|
|
56
56
|
onremove = undefined,
|
|
57
57
|
/** @type {((query: string) => void) | undefined} — async search; parent owns items */
|
|
58
58
|
onsearch = undefined,
|
|
59
|
+
/** @type {string} — shown when search returns nothing (forwarded to Combobox) */
|
|
60
|
+
noResultsLabel = 'No results found',
|
|
61
|
+
/** @type {string} — shown while searching (forwarded to Combobox) */
|
|
62
|
+
searchingLabel = 'Searching…',
|
|
63
|
+
/** @type {string} — aria-label for chip remove buttons (forwarded to Tag) */
|
|
64
|
+
removeLabel = 'Remove tag',
|
|
65
|
+
/** @type {string} — hint appended to the label when required */
|
|
66
|
+
requiredLabel = ' (required)',
|
|
59
67
|
/** @type {string} */
|
|
60
68
|
class: className = '',
|
|
61
69
|
...rest
|
|
@@ -89,14 +97,14 @@
|
|
|
89
97
|
>
|
|
90
98
|
{#if label}
|
|
91
99
|
<span id={`${mscId}-label`} class="msc-label"
|
|
92
|
-
>{label}{required ?
|
|
100
|
+
>{label}{required ? requiredLabel : ''}</span
|
|
93
101
|
>
|
|
94
102
|
{/if}
|
|
95
103
|
|
|
96
104
|
{#if selected.length}
|
|
97
105
|
<div class="msc-chips">
|
|
98
106
|
{#each selected as entry (entry.value)}
|
|
99
|
-
<Tag removable={!disabled} onremove={() => onremove?.(entry.value)}>
|
|
107
|
+
<Tag removable={!disabled} {removeLabel} onremove={() => onremove?.(entry.value)}>
|
|
100
108
|
{entry.label}
|
|
101
109
|
</Tag>
|
|
102
110
|
{/each}
|
|
@@ -112,6 +120,8 @@
|
|
|
112
120
|
{error}
|
|
113
121
|
{help}
|
|
114
122
|
{size}
|
|
123
|
+
{noResultsLabel}
|
|
124
|
+
{searchingLabel}
|
|
115
125
|
onsearch={onsearch}
|
|
116
126
|
onchange={handlePick}
|
|
117
127
|
/>
|
|
@@ -42,6 +42,10 @@ declare const MultiSelectCombobox: import("svelte").Component<{
|
|
|
42
42
|
onadd?: any;
|
|
43
43
|
onremove?: any;
|
|
44
44
|
onsearch?: any;
|
|
45
|
+
noResultsLabel?: string;
|
|
46
|
+
searchingLabel?: string;
|
|
47
|
+
removeLabel?: string;
|
|
48
|
+
requiredLabel?: string;
|
|
45
49
|
class?: string;
|
|
46
50
|
} & Record<string, any>, {}, "">;
|
|
47
51
|
type $$ComponentProps = {
|
|
@@ -58,5 +62,9 @@ type $$ComponentProps = {
|
|
|
58
62
|
onadd?: any;
|
|
59
63
|
onremove?: any;
|
|
60
64
|
onsearch?: any;
|
|
65
|
+
noResultsLabel?: string;
|
|
66
|
+
searchingLabel?: string;
|
|
67
|
+
removeLabel?: string;
|
|
68
|
+
requiredLabel?: string;
|
|
61
69
|
class?: string;
|
|
62
70
|
} & Record<string, any>;
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
/** @type {((size: number) => void) | undefined} */
|
|
62
62
|
on_page_size_change = undefined,
|
|
63
63
|
|
|
64
|
+
/** @type {string} — label for the "previous" nav button */
|
|
65
|
+
prevLabel = 'PREV',
|
|
66
|
+
/** @type {string} — label for the "next" nav button */
|
|
67
|
+
nextLabel = 'NEXT',
|
|
68
|
+
|
|
64
69
|
/** @type {string} */
|
|
65
70
|
class: className = '',
|
|
66
71
|
...rest
|
|
@@ -146,15 +151,15 @@
|
|
|
146
151
|
|
|
147
152
|
{#if mode === 'cursor'}
|
|
148
153
|
<button class="pagination-nav" disabled={!has_prev} onclick={on_prev} aria-label="Previous page">
|
|
149
|
-
{@render chevronLeft()}<span>
|
|
154
|
+
{@render chevronLeft()}<span>{prevLabel}</span>
|
|
150
155
|
</button>
|
|
151
156
|
<button class="pagination-nav" disabled={!has_next} onclick={on_next} aria-label="Next page">
|
|
152
|
-
<span>
|
|
157
|
+
<span>{nextLabel}</span>{@render chevronRight()}
|
|
153
158
|
</button>
|
|
154
159
|
|
|
155
160
|
{:else}
|
|
156
161
|
<button class="pagination-nav" disabled={current_page <= 1} onclick={() => on_page_change?.(current_page - 1)} aria-label="Previous page">
|
|
157
|
-
{@render chevronLeft()}<span>
|
|
162
|
+
{@render chevronLeft()}<span>{prevLabel}</span>
|
|
158
163
|
</button>
|
|
159
164
|
|
|
160
165
|
<div class="pagination-pages">
|
|
@@ -177,7 +182,7 @@
|
|
|
177
182
|
</div>
|
|
178
183
|
|
|
179
184
|
<button class="pagination-nav" disabled={current_page >= (total_pages ?? current_page)} onclick={() => on_page_change?.(current_page + 1)} aria-label="Next page">
|
|
180
|
-
<span>
|
|
185
|
+
<span>{nextLabel}</span>{@render chevronRight()}
|
|
181
186
|
</button>
|
|
182
187
|
{/if}
|
|
183
188
|
</div>
|
|
@@ -44,6 +44,8 @@ declare const Pagination: import("svelte").Component<{
|
|
|
44
44
|
page_size?: number;
|
|
45
45
|
page_sizes?: any;
|
|
46
46
|
on_page_size_change?: any;
|
|
47
|
+
prevLabel?: string;
|
|
48
|
+
nextLabel?: string;
|
|
47
49
|
class?: string;
|
|
48
50
|
} & Record<string, any>, {}, "">;
|
|
49
51
|
type $$ComponentProps = {
|
|
@@ -59,5 +61,7 @@ type $$ComponentProps = {
|
|
|
59
61
|
page_size?: number;
|
|
60
62
|
page_sizes?: any;
|
|
61
63
|
on_page_size_change?: any;
|
|
64
|
+
prevLabel?: string;
|
|
65
|
+
nextLabel?: string;
|
|
62
66
|
class?: string;
|
|
63
67
|
} & Record<string, any>;
|
package/components/Tag.svelte
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
removable = false,
|
|
17
17
|
/** @type {(() => void) | undefined} */
|
|
18
18
|
onremove = undefined,
|
|
19
|
+
/** @type {string} — aria-label for the remove button */
|
|
20
|
+
removeLabel = 'Remove tag',
|
|
19
21
|
/** @type {string} */
|
|
20
22
|
class: className = '',
|
|
21
23
|
/** @type {import('svelte').Snippet | undefined} */
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
<button
|
|
40
42
|
type="button"
|
|
41
43
|
class="tag-remove"
|
|
42
|
-
aria-label=
|
|
44
|
+
aria-label={removeLabel}
|
|
43
45
|
onclick={(e) => {
|
|
44
46
|
e.stopPropagation();
|
|
45
47
|
onremove?.();
|
|
@@ -18,12 +18,14 @@ type Tag = {
|
|
|
18
18
|
declare const Tag: import("svelte").Component<{
|
|
19
19
|
removable?: boolean;
|
|
20
20
|
onremove?: any;
|
|
21
|
+
removeLabel?: string;
|
|
21
22
|
class?: string;
|
|
22
23
|
children?: any;
|
|
23
24
|
} & Record<string, any>, {}, "">;
|
|
24
25
|
type $$ComponentProps = {
|
|
25
26
|
removable?: boolean;
|
|
26
27
|
onremove?: any;
|
|
28
|
+
removeLabel?: string;
|
|
27
29
|
class?: string;
|
|
28
30
|
children?: any;
|
|
29
31
|
} & Record<string, any>;
|