@eifi1/ui-kit 0.24.1 → 0.25.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/README.md +6 -6
- package/dist/chart.d.ts +2 -2
- package/dist/components/account-chips.d.ts +1 -1
- package/dist/components/amount-input.d.ts +2 -2
- package/dist/components/button-group.d.ts +2 -2
- package/dist/components/calculator.d.ts +2 -2
- package/dist/components/column-mapper.d.ts +28 -9
- package/dist/components/column-mapper.js +63 -77
- package/dist/components/column-mapper.js.map +1 -1
- package/dist/components/confirm-dialog.d.ts +2 -2
- package/dist/components/copy-button.d.ts +2 -2
- package/dist/components/danger-confirm.d.ts +2 -2
- package/dist/components/data-table-cells.d.ts +1 -1
- package/dist/components/data-table-filter-popover.d.ts +1 -1
- package/dist/components/data-table-filters.d.ts +1 -1
- package/dist/components/data-table-labels.d.ts +1 -1
- package/dist/components/data-table-pagination.d.ts +1 -1
- package/dist/components/data-table-pagination.js +6 -1
- package/dist/components/data-table-pagination.js.map +1 -1
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.js +7 -1
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/facing-pair.d.ts +2 -2
- package/dist/components/file-button.d.ts +2 -2
- package/dist/components/file-dropzone.d.ts +2 -2
- package/dist/components/form-actions.d.ts +2 -2
- package/dist/components/iban-input.d.ts +2 -2
- package/dist/components/language-select.d.ts +2 -2
- package/dist/components/money-field.d.ts +2 -2
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-input.d.ts +2 -2
- package/dist/components/numpad-sheet.d.ts +2 -2
- package/dist/components/phone-input.d.ts +2 -2
- package/dist/components/series-chart.d.ts +2 -2
- package/dist/components/settings-fields.d.ts +2 -2
- package/dist/components/share-card.d.ts +2 -2
- package/dist/components/swipeable-row.js +1 -1
- package/dist/components/swipeable-row.js.map +1 -1
- package/dist/components/table.d.ts +35 -1
- package/dist/components/table.js +4 -0
- package/dist/components/table.js.map +1 -1
- package/dist/components/text-link.d.ts +2 -2
- package/dist/components/time-input.d.ts +2 -2
- package/dist/components/tooltip.d.ts +103 -14
- package/dist/components/tooltip.js +194 -57
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/translation-review-editor.d.ts +9 -1
- package/dist/components/translation-review-editor.js +11 -1
- package/dist/components/translation-review-editor.js.map +1 -1
- package/dist/components/translation-review-labels.d.ts +10 -0
- package/dist/components/translation-review-labels.js +5 -1
- package/dist/components/translation-review-labels.js.map +1 -1
- package/dist/components/translation-review.d.ts +145 -8
- package/dist/components/translation-review.js +372 -91
- package/dist/components/translation-review.js.map +1 -1
- package/dist/components/ui.d.ts +2 -2
- package/dist/components/ui.js +55 -18
- package/dist/components/ui.js.map +1 -1
- package/dist/components/use-table-state.d.ts +1 -1
- package/dist/{data-table-labels-B7OdnM0S.d.ts → data-table-labels-Cdn1QS2k.d.ts} +21 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/feedback/feedback-attachment.d.ts +2 -2
- package/dist/feedback/feedback-dialog.d.ts +2 -2
- package/dist/feedback/feedback-dialog.js +6 -1
- package/dist/feedback/feedback-dialog.js.map +1 -1
- package/dist/feedback/feedback-inbox.d.ts +2 -2
- package/dist/feedback/feedback-inbox.js +2 -0
- package/dist/feedback/feedback-inbox.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +2 -2
- package/dist/{feedback-DOwPu-Il.d.ts → feedback-BXKH-ToU.d.ts} +32 -3
- package/dist/feedback.d.ts +2 -2
- package/dist/hooks/use-body-scroll-lock.js +16 -0
- package/dist/hooks/use-body-scroll-lock.js.map +1 -1
- package/dist/hooks/use-file-drop.d.ts +2 -2
- package/dist/hooks/use-search-param-state.d.ts +58 -3
- package/dist/hooks/use-search-param-state.js +107 -35
- package/dist/hooks/use-search-param-state.js.map +1 -1
- package/dist/i18n/defaults.d.ts +2 -2
- package/dist/i18n/german.d.ts +2 -2
- package/dist/i18n/german.js +8 -1
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +2 -2
- package/dist/i18n/languages.d.ts +2 -2
- package/dist/i18n/locales/de-CH.d.ts +2 -2
- package/dist/i18n/locales/en.d.ts +2 -2
- package/dist/i18n/locales/en.js +5 -1
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +2 -2
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +2 -2
- package/dist/i18n/locales/fr.js +6 -1
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +2 -2
- package/dist/i18n/locales/hu.js +9 -1
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +2 -2
- package/dist/i18n/locales/it.js +6 -1
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +2 -2
- package/dist/i18n/locales/zh.js +6 -1
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.d.ts +2 -2
- package/dist/i18n/review.js +11 -0
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/strip-fade.d.ts +84 -5
- package/dist/lib/strip-fade.js +109 -11
- package/dist/lib/strip-fade.js.map +1 -1
- package/dist/lib/translation-review.d.ts +45 -1
- package/dist/lib/translation-review.js +38 -1
- package/dist/lib/translation-review.js.map +1 -1
- package/dist/rhf/fields.d.ts +2 -2
- package/dist/rhf/form.d.ts +2 -2
- package/dist/rhf.d.ts +2 -2
- package/dist/shell/app-shell.d.ts +2 -2
- package/dist/shell/top-bar-brand.d.ts +2 -2
- package/dist/shell.d.ts +2 -2
- package/dist/wizard/stepper-nav.d.ts +2 -2
- package/dist/wizard.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/column-mapper.tsx +120 -113
- package/src/components/data-table-pagination.tsx +10 -1
- package/src/components/data-table.tsx +34 -1
- package/src/components/swipeable-row.tsx +1 -1
- package/src/components/table.tsx +39 -0
- package/src/components/tooltip.tsx +487 -104
- package/src/components/translation-review-editor.tsx +21 -1
- package/src/components/translation-review-labels.ts +17 -0
- package/src/components/translation-review.tsx +657 -109
- package/src/components/ui.tsx +104 -4
- package/src/feedback/feedback-dialog.tsx +21 -0
- package/src/feedback/feedback-inbox.tsx +19 -2
- package/src/hooks/use-body-scroll-lock.ts +25 -0
- package/src/hooks/use-search-param-state.ts +283 -41
- package/src/i18n/german.ts +10 -0
- package/src/i18n/locales/en.ts +7 -0
- package/src/i18n/locales/es.ts +9 -0
- package/src/i18n/locales/fr.ts +9 -0
- package/src/i18n/locales/hu.ts +11 -0
- package/src/i18n/locales/it.ts +9 -0
- package/src/i18n/locales/zh.ts +8 -0
- package/src/i18n/review.ts +11 -0
- package/src/index.ts +12 -0
- package/src/lib/strip-fade.ts +220 -15
- package/src/lib/translation-review.ts +85 -0
package/README.md
CHANGED
|
@@ -382,14 +382,14 @@ columns, strings and permissions (see the note at the top of `src/feedback/feedb
|
|
|
382
382
|
|
|
383
383
|
<!-- BEGIN GENERATED: exports — node scripts/gen-export-inventory.mjs -->
|
|
384
384
|
|
|
385
|
-
**
|
|
385
|
+
**1286 names from 193 modules** — 600 values and 686 types. _Italic_ is a type-only export.
|
|
386
386
|
|
|
387
387
|
Generated from `dist/index.d.ts` by `node scripts/gen-export-inventory.mjs`; the count
|
|
388
388
|
is pinned by `src/__tests__/public-surface.test.ts`. Do not edit between the markers.
|
|
389
389
|
|
|
390
390
|
| Entry point | Names |
|
|
391
391
|
|---|---|
|
|
392
|
-
| `@eifi1/ui-kit` |
|
|
392
|
+
| `@eifi1/ui-kit` | 1286 |
|
|
393
393
|
| `@eifi1/ui-kit/chart` | 104 |
|
|
394
394
|
| `@eifi1/ui-kit/shell` | 24 |
|
|
395
395
|
| `@eifi1/ui-kit/data-table` | 51 |
|
|
@@ -415,7 +415,7 @@ re-slicing of it, never a second API.
|
|
|
415
415
|
| `lib/safe-storage` | `readStored`, `writeStored` |
|
|
416
416
|
| `lib/qr-encode` | `encodeQr`, _`QrEncodeOptions`_, _`QrErrorCorrection`_, _`QrMatrix`_ |
|
|
417
417
|
| `lib/server-wake` | `attachServerWake`, `createServerWake`, `serverWake`, `watchReadsAnd`, `wrapFetch`, _`AxiosLikeInstance`_, _`ServerWakeAxiosConfig`_, _`ServerWakeFilter`_, _`ServerWakeOptions`_, _`ServerWakeRequest`_, _`ServerWakeStage`_, _`ServerWakeWatcher`_ |
|
|
418
|
-
| `lib/translation-review` | `DEFAULT_TRANSLATION_REVIEW_FILTER`, `dropReviews`, `filterTranslationRows`, `flattenStrings`, `fromApiReview`, `keyInArea`, `keyInAreas`, `keyNamespace`, `mergeReviews`, `placeholderMismatch`, `placeholderTokens`, `REVIEW_STATUSES`, `reviewStatus`, `reviewWrite`, `summariseRows`, `toApiWrite`, `translationCorrections`, `translationRows`, _`ApiTranslationReview`_, _`ApiTranslationReviewWrite`_, _`ReviewStatus`_, _`TranslationCorrection`_, _`TranslationReview`_, _`TranslationReviewFilter`_, _`TranslationReviewKey`_, _`TranslationReviewWrite`_, _`TranslationRow`_, _`TranslationRowsInput`_, _`TranslationSummary`_, _`TranslationVerdict`_ |
|
|
418
|
+
| `lib/translation-review` | `DEFAULT_TRANSLATION_REVIEW_FILTER`, `dropReviews`, `filterTranslationRows`, `flattenStrings`, `fromApiReview`, `groupTranslationRows`, `keyInArea`, `keyInAreas`, `keyNamespace`, `mergeReviews`, `placeholderMismatch`, `placeholderTokens`, `REVIEW_STATUSES`, `reviewStatus`, `reviewUndo`, `reviewWrite`, `summariseRows`, `toApiWrite`, `translationCorrections`, `translationRows`, `unreviewedRows`, _`ApiTranslationReview`_, _`ApiTranslationReviewWrite`_, _`ReviewStatus`_, _`TranslationCorrection`_, _`TranslationReview`_, _`TranslationReviewFilter`_, _`TranslationReviewKey`_, _`TranslationReviewUndo`_, _`TranslationReviewWrite`_, _`TranslationRow`_, _`TranslationRowGroup`_, _`TranslationRowsInput`_, _`TranslationSummary`_, _`TranslationVerdict`_ |
|
|
419
419
|
| `lib/countries` | `COUNTRY_CODES`, `countryName` |
|
|
420
420
|
| `lib/iban` | `compactIban`, `formatIban`, `IBAN_LENGTHS`, `ibanCheckDigits`, `ibanProblem`, `isQrIban`, `isValidIban`, _`IbanKind`_, _`IbanProblem`_ |
|
|
421
421
|
| `lib/isin` | `formatIsin`, `isinCheckDigit`, `isValidIsin` |
|
|
@@ -439,7 +439,7 @@ re-slicing of it, never a second API.
|
|
|
439
439
|
| `hooks/use-row-swipe` | `useRowSwipe`, _`RowSwipeOptions`_, _`RowSwipeReturn`_, _`SwipeStage`_ |
|
|
440
440
|
| `hooks/use-file-drop` | `dragHasFiles`, `useFileDrop`, _`FileDropProps`_, _`UseFileDropOptions`_, _`UseFileDropReturn`_ |
|
|
441
441
|
| `hooks/use-debounce` | `useDebounce`, `useDebouncedCallback`, _`DebouncedCallbackOptions`_, _`DebouncedFunction`_ |
|
|
442
|
-
| `hooks/use-search-param-state` | `useDialogParam`, `useSearchParamState`, `useTabParam`, _`DialogParam`_, _`SearchParamStateOptions`_ |
|
|
442
|
+
| `hooks/use-search-param-state` | `useDialogParam`, `useSearchParamsState`, `useSearchParamState`, `useTabParam`, _`DialogParam`_, _`SearchParamField`_, _`SearchParamFields`_, _`SearchParamStateOptions`_, _`SearchParamsUpdate`_ |
|
|
443
443
|
| `hooks/use-copy-to-clipboard` | `copyToClipboard`, `useCopyToClipboard`, _`CopyState`_, _`UseCopyToClipboardOptions`_, _`UseCopyToClipboardReturn`_ |
|
|
444
444
|
| `hooks/use-hotkey` | `matchesHotkey`, `parseHotkey`, `useHotkey`, _`Hotkey`_, _`ParsedHotkey`_, _`UseHotkeyOptions`_ |
|
|
445
445
|
| `hooks/use-authed-src` | `useAuthedSrc`, _`AuthedFetcher`_, _`AuthedSrcStatus`_, _`UseAuthedSrcOptions`_, _`UseAuthedSrcResult`_ |
|
|
@@ -495,7 +495,7 @@ re-slicing of it, never a second API.
|
|
|
495
495
|
| `components/entity-combobox` | `EntityCombobox`, _`EntityComboboxProps`_ |
|
|
496
496
|
| `components/multi-entity-combobox` | `MultiEntityCombobox`, _`MultiEntityComboboxProps`_ |
|
|
497
497
|
| `components/multi-select` | `MultiSelect`, _`MultiSelectOption`_, _`MultiSelectProps`_ |
|
|
498
|
-
| `components/tooltip` | `placeTooltip`, `Tooltip`, _`TooltipPlacement`_, _`TooltipProps`_, _`TooltipSide`_, _`TooltipSize`_, _`TooltipViewport`_ |
|
|
498
|
+
| `components/tooltip` | `placeTooltip`, `Tooltip`, _`TooltipPlacement`_, _`TooltipProps`_, _`TooltipSide`_, _`TooltipSize`_, _`TooltipTap`_, _`TooltipViewport`_ |
|
|
499
499
|
| `components/user-avatar` | `avatarInitials`, `UserAvatar`, _`UserAvatarBadge`_, _`UserAvatarProps`_ |
|
|
500
500
|
| `components/settings-fields` | `LanguageSetting`, `ThemeSetting`, _`LanguageSettingProps`_, _`ThemeSettingProps`_ |
|
|
501
501
|
| `components/field-sync` | `DEFAULT_FIELD_SYNC_LABELS`, `FIELD_SYNC_FRAME`, `FIELD_SYNC_SAVED_MS`, `FieldSyncIndicator`, `FieldSyncRow`, `resolveFieldSyncLabels`, `useFieldSync`, _`FieldSyncIndicatorProps`_, _`FieldSyncLabels`_, _`FieldSyncRowProps`_, _`FieldSyncState`_, _`UseFieldSyncOptions`_, _`UseFieldSyncReturn`_ |
|
|
@@ -579,7 +579,7 @@ re-slicing of it, never a second API.
|
|
|
579
579
|
| `components/data-table-pagination` | `PAGE_SIZE_OPTIONS`, `Pagination` |
|
|
580
580
|
| `components/data-table-filter-popover` | `FilterPopover` |
|
|
581
581
|
| `components/data-table-cells` | `booleanColumn`, `BooleanMark`, _`BooleanColumnOptions`_, _`BooleanMarkProps`_ |
|
|
582
|
-
| `components/translation-review` | `TranslationReviewPanel`, _`TranslationReviewPanelProps`_ |
|
|
582
|
+
| `components/translation-review` | `TranslationReviewPanel`, _`TranslationReviewGroupBy`_, _`TranslationReviewOrigin`_, _`TranslationReviewPanelProps`_, _`TranslationReviewSaveInfo`_ |
|
|
583
583
|
| `components/legal` | `DEFAULT_LEGAL_LABELS`, `LegalLayout`, `LegalLinks`, `LegalSection`, _`LegalLabels`_, _`LegalLayoutProps`_, _`LegalLink`_, _`LegalLinksProps`_, _`LegalSectionProps`_ |
|
|
584
584
|
| `components/checkbox-group` | `CheckboxGroup`, _`CheckboxGroupLegendVisibility`_, _`CheckboxGroupOption`_, _`CheckboxGroupProps`_ |
|
|
585
585
|
| `components/one-time-code-input` | `OneTimeCodeInput`, _`OneTimeCodeInputProps`_ |
|
package/dist/chart.d.ts
CHANGED
|
@@ -13,11 +13,11 @@ export { TimeTickUnit } from './components/series-chart-ticks.js';
|
|
|
13
13
|
import 'recharts';
|
|
14
14
|
import 'react';
|
|
15
15
|
import './lib/direction.js';
|
|
16
|
-
import './feedback-
|
|
16
|
+
import './feedback-BXKH-ToU.js';
|
|
17
17
|
import './components/tooltip.js';
|
|
18
18
|
import './hooks/use-anchored-rect.js';
|
|
19
19
|
import './lib/clipping.js';
|
|
20
|
-
import './data-table-labels-
|
|
20
|
+
import './data-table-labels-Cdn1QS2k.js';
|
|
21
21
|
import './components/data-table-sort.js';
|
|
22
22
|
import './components/swipeable-row.js';
|
|
23
23
|
import './components/mini-calendar.js';
|
|
@@ -3,7 +3,7 @@ import { ReactNode, ReactElement } from 'react';
|
|
|
3
3
|
import { LucideIcon } from 'lucide-react';
|
|
4
4
|
import { DateInput, FormatDateStyle, FormatRelativeTimeOptions } from '../lib/format.js';
|
|
5
5
|
import { ChipTone, ChipSize, ChipVariant, ChipShape } from './chip.js';
|
|
6
|
-
import { d as DataTableColumn } from '../data-table-labels-
|
|
6
|
+
import { d as DataTableColumn } from '../data-table-labels-Cdn1QS2k.js';
|
|
7
7
|
import './data-table-sort.js';
|
|
8
8
|
import './swipeable-row.js';
|
|
9
9
|
|
|
@@ -2,11 +2,11 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { CalculatorButtonLabels } from './calculator.js';
|
|
4
4
|
import { NumberPadSheetLabels } from './numpad-sheet.js';
|
|
5
|
-
import '../feedback-
|
|
5
|
+
import '../feedback-BXKH-ToU.js';
|
|
6
6
|
import './tooltip.js';
|
|
7
7
|
import '../hooks/use-anchored-rect.js';
|
|
8
8
|
import '../lib/clipping.js';
|
|
9
|
-
import '../data-table-labels-
|
|
9
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
10
10
|
import './data-table-sort.js';
|
|
11
11
|
import './swipeable-row.js';
|
|
12
12
|
import './mini-calendar.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef, ReactNode, Ref, MouseEvent, ReactElement } from 'react';
|
|
3
|
-
import { f as ButtonVariant, d as ButtonSize } from '../feedback-
|
|
3
|
+
import { f as ButtonVariant, d as ButtonSize } from '../feedback-BXKH-ToU.js';
|
|
4
4
|
import './tooltip.js';
|
|
5
5
|
import '../hooks/use-anchored-rect.js';
|
|
6
6
|
import '../lib/clipping.js';
|
|
7
|
-
import '../data-table-labels-
|
|
7
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
8
8
|
import './data-table-sort.js';
|
|
9
9
|
import './swipeable-row.js';
|
|
10
10
|
import './mini-calendar.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { C as CalculatorLabels } from '../feedback-
|
|
2
|
+
import { C as CalculatorLabels } from '../feedback-BXKH-ToU.js';
|
|
3
3
|
import './tooltip.js';
|
|
4
4
|
import '../hooks/use-anchored-rect.js';
|
|
5
5
|
import '../lib/clipping.js';
|
|
6
|
-
import '../data-table-labels-
|
|
6
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
7
7
|
import './data-table-sort.js';
|
|
8
8
|
import './swipeable-row.js';
|
|
9
9
|
import './mini-calendar.js';
|
|
@@ -68,8 +68,16 @@ interface ColumnMapperLabels {
|
|
|
68
68
|
/** The role select's "no role" option. */
|
|
69
69
|
ignore: string;
|
|
70
70
|
/** A required role in the select — only while some role is NOT required: when
|
|
71
|
-
* every one is, the mark tells no role from another (0.24, Kurvenschmiede).
|
|
71
|
+
* every one is, the mark tells no role from another (0.24, Kurvenschmiede). Since
|
|
72
|
+
* 0.25 this is what a screen reader says for the option (its `aria-label`); the
|
|
73
|
+
* option SHOWS {@link requiredRoleShort}. */
|
|
72
74
|
requiredRole: (role: string) => string;
|
|
75
|
+
/** The same required role as the select shows it (0.25): the role's name and a short
|
|
76
|
+
* mark, so the mark does not cut the name short in a phone-width column — "Booking
|
|
77
|
+
* date (re…" was all keksdose's closed select had room for. Spoken as
|
|
78
|
+
* {@link requiredRole}. Optional, so a complete `UiKitLabels` typed before 0.25
|
|
79
|
+
* still compiles; the asterisk needs no translation in most languages. */
|
|
80
|
+
requiredRoleShort?: (role: string) => string;
|
|
73
81
|
/** Under the preview, when it shows fewer rows than were read. */
|
|
74
82
|
previewOf: (shown: number, total: number) => string;
|
|
75
83
|
/** A required group's roles, already joined as a list with "or". */
|
|
@@ -151,23 +159,34 @@ interface ColumnRoleTableProps<R extends string, M extends ColumnMapping<R> = Co
|
|
|
151
159
|
*
|
|
152
160
|
* Picking a role another column holds MOVES it ({@link assignColumnRole}). What the
|
|
153
161
|
* table still needs is named under it — a required group as "either Amount, Debit or
|
|
154
|
-
* Credit". Required roles
|
|
162
|
+
* Credit". Required roles are marked in the list only where some role is not
|
|
155
163
|
* (0.24): Kurvenschmiede's roles are all required, so the mark told no option from
|
|
156
164
|
* another, and on a phone it cut the role's own name short ("Zeit (s) (erforderl…")
|
|
157
165
|
* — the part of the option the reader has to read. The "Still needed" line already
|
|
158
166
|
* says what is missing; a mark that distinguishes nothing is only noise.
|
|
159
167
|
*
|
|
168
|
+
* Where the mark does tell roles apart, it is short (0.25): keksdose's bank roles, on
|
|
169
|
+
* a phone, still showed "Booking date (re…" in the closed select. The option shows
|
|
170
|
+
* "Booking date *" ({@link ColumnMapperLabels.requiredRoleShort}) and is NAMED "Booking
|
|
171
|
+
* date (required)" ({@link ColumnMapperLabels.requiredRole}, its `aria-label`), so a
|
|
172
|
+
* screen reader hears the word rather than "star". And no role is cut at all: each
|
|
173
|
+
* column is at least as wide as its select's longest option — the select's own width,
|
|
174
|
+
* which a table cell otherwise ignores for a `w-full` control — up to 14rem, the width
|
|
175
|
+
* the column's name and values already stop at. A long role name ("Date de
|
|
176
|
+
* comptabilisation", "Betrag (mit Vorzeichen)") widens the columns, and the edge fade
|
|
177
|
+
* says there are more of them to scroll to.
|
|
178
|
+
*
|
|
160
179
|
* The table scrolls sideways inside its own box (the kit {@link Table}'s wrapper, a
|
|
161
180
|
* named, keyboard-reachable region while it overflows), so a wide export never widens
|
|
162
181
|
* the page at 390px. An edge with columns behind it fades out (0.24, Kurvenschmiede:
|
|
163
182
|
* on a phone the fourth column's select sat off-screen and nothing said there was more
|
|
164
|
-
* to the right; phone scrollbars are overlays that show only while you drag).
|
|
165
|
-
* the kit
|
|
166
|
-
*
|
|
167
|
-
* middle; the reading direction's own in RTL; never animated
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
183
|
+
* to the right; phone scrollbars are overlays that show only while you drag). Since
|
|
184
|
+
* 0.25 that is the kit Table's own `edgeFade`, not a box of this table's round it:
|
|
185
|
+
* measured, so a table that fits is painted as before; both ends once scrolled into
|
|
186
|
+
* the middle; the reading direction's own in RTL; never animated; a `mask-image`,
|
|
187
|
+
* which changes no layout and needs no background colour to fade to. A role select
|
|
188
|
+
* focused behind the fade is scrolled clear of it, cell and all, and the Table's
|
|
189
|
+
* wrapper says which ends are cut in `data-overflow`.
|
|
171
190
|
*/
|
|
172
191
|
declare function ColumnRoleTable<R extends string, M extends ColumnMapping<R> = ColumnMapping<R>>({ header, rows, width: widthProp, roles, mapping, onMappingChange, previewRows, totalRows, disabled, bodyProps, rowProps, labels: labelsProp, className, }: ColumnRoleTableProps<R, M>): react.JSX.Element;
|
|
173
192
|
interface ColumnMapperProps<R extends string> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect, useEffectEvent, useState } from "react";
|
|
5
5
|
import { Upload } from "lucide-react";
|
|
6
6
|
import { useKitLabels, useKitLocale } from "../i18n/kit-labels.js";
|
|
7
7
|
import { cn } from "../lib/cn.js";
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
readTextFile,
|
|
14
14
|
roleOfColumn
|
|
15
15
|
} from "../lib/column-mapping.js";
|
|
16
|
-
import { scrollIntoStrip, useStripFade } from "../lib/strip-fade.js";
|
|
17
16
|
import { parseTextTable } from "../lib/table-text.js";
|
|
18
17
|
import { AlertBanner } from "./alert-banner.js";
|
|
19
18
|
import { Checkbox } from "./checkbox.js";
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
TableRow
|
|
29
28
|
} from "./table.js";
|
|
30
29
|
import { Select, Textarea } from "./ui.js";
|
|
30
|
+
const markedShort = (role) => `${role} *`;
|
|
31
31
|
const DEFAULT_COLUMN_MAPPER_LABELS = {
|
|
32
32
|
paste: "Paste a table",
|
|
33
33
|
pasteHint: "Copy the rows out of a spreadsheet and paste them here, or drop a CSV or text file.",
|
|
@@ -50,6 +50,7 @@ const DEFAULT_COLUMN_MAPPER_LABELS = {
|
|
|
50
50
|
roleOf: (column) => `What does column \u201C${column}\u201D hold?`,
|
|
51
51
|
ignore: "Ignore",
|
|
52
52
|
requiredRole: (role) => `${role} (required)`,
|
|
53
|
+
requiredRoleShort: markedShort,
|
|
53
54
|
previewOf: (shown, total) => shown === 1 ? `The first of ${total} rows` : `The first ${shown} of ${total} rows`,
|
|
54
55
|
oneOf: (roles) => `either ${roles}`,
|
|
55
56
|
missing: (roles) => `Still needed: ${roles}.`
|
|
@@ -103,92 +104,77 @@ function ColumnRoleTable({
|
|
|
103
104
|
(gap) => gap.length === 1 ? labelOf(gap[0]) : labels.oneOf(formatList(gap.map(labelOf), "disjunction", locale))
|
|
104
105
|
);
|
|
105
106
|
const markRequired = roles.some((role) => role.required !== true);
|
|
106
|
-
const scroller = useRef(null);
|
|
107
|
-
const tableRef = useCallback((table) => {
|
|
108
|
-
scroller.current = table?.parentElement ?? null;
|
|
109
|
-
}, []);
|
|
110
|
-
const fade = useStripFade(scroller);
|
|
111
107
|
return /* @__PURE__ */ jsxs(
|
|
112
108
|
"div",
|
|
113
109
|
{
|
|
114
110
|
className: cn("min-w-0 space-y-1.5", className),
|
|
115
111
|
"data-slot": "column-role-table",
|
|
116
112
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
children: /* @__PURE__ */ jsxs(
|
|
124
|
-
Table,
|
|
113
|
+
/* @__PURE__ */ jsxs(Table, { density: "compact", framed: true, edgeFade: true, "aria-label": labels.table, children: [
|
|
114
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(TableRow, { children: columns.map((column) => {
|
|
115
|
+
const role = roleOfColumn(roles, mapping, column);
|
|
116
|
+
const name = nameOf(column);
|
|
117
|
+
return /* @__PURE__ */ jsxs(
|
|
118
|
+
TableHeaderCell,
|
|
125
119
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
framed: true,
|
|
129
|
-
"aria-label": labels.table,
|
|
120
|
+
scope: "col",
|
|
121
|
+
className: "min-w-36 py-2 align-top",
|
|
130
122
|
children: [
|
|
131
|
-
/* @__PURE__ */ jsx(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return /* @__PURE__ */ jsxs(
|
|
135
|
-
TableHeaderCell,
|
|
136
|
-
{
|
|
137
|
-
scope: "col",
|
|
138
|
-
className: "min-w-36 py-2 align-top",
|
|
139
|
-
children: [
|
|
140
|
-
/* @__PURE__ */ jsx("span", { className: "block max-w-56 truncate pb-1 text-[11px] font-normal text-[var(--text-muted)]", children: name }),
|
|
141
|
-
/* @__PURE__ */ jsxs(
|
|
142
|
-
Select,
|
|
143
|
-
{
|
|
144
|
-
size: "sm",
|
|
145
|
-
className: "w-full",
|
|
146
|
-
"aria-label": labels.roleOf(name),
|
|
147
|
-
value: role ?? "",
|
|
148
|
-
disabled,
|
|
149
|
-
onFocus: (event) => {
|
|
150
|
-
const cell = event.currentTarget.closest("th");
|
|
151
|
-
if (scroller.current && cell)
|
|
152
|
-
scrollIntoStrip(scroller.current, cell);
|
|
153
|
-
},
|
|
154
|
-
onChange: (event) => onMappingChange(
|
|
155
|
-
assignColumnRole(
|
|
156
|
-
roles,
|
|
157
|
-
mapping,
|
|
158
|
-
column,
|
|
159
|
-
event.target.value === "" ? null : event.target.value
|
|
160
|
-
)
|
|
161
|
-
),
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsx("option", { value: "", children: labels.ignore }),
|
|
164
|
-
roles.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.required === true && markRequired ? labels.requiredRole(option.label) : option.label }, option.value))
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
column
|
|
171
|
-
);
|
|
172
|
-
}) }) }),
|
|
173
|
-
/* @__PURE__ */ jsx(TableBody, { ...bodyProps, children: shown.map((row, index) => /* @__PURE__ */ createElement(TableRow, { ...rowProps?.(row, index), key: index }, columns.map((column) => /* @__PURE__ */ jsx(
|
|
174
|
-
TableCell,
|
|
123
|
+
/* @__PURE__ */ jsx("span", { className: "block max-w-56 truncate pb-1 text-[11px] font-normal text-[var(--text-muted)]", children: name }),
|
|
124
|
+
/* @__PURE__ */ jsxs(
|
|
125
|
+
Select,
|
|
175
126
|
{
|
|
176
|
-
"
|
|
177
|
-
className:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
127
|
+
size: "sm",
|
|
128
|
+
className: "w-full",
|
|
129
|
+
selectClassName: "w-auto min-w-full max-w-56",
|
|
130
|
+
"aria-label": labels.roleOf(name),
|
|
131
|
+
value: role ?? "",
|
|
132
|
+
disabled,
|
|
133
|
+
onChange: (event) => onMappingChange(
|
|
134
|
+
assignColumnRole(
|
|
135
|
+
roles,
|
|
136
|
+
mapping,
|
|
137
|
+
column,
|
|
138
|
+
event.target.value === "" ? null : event.target.value
|
|
139
|
+
)
|
|
182
140
|
),
|
|
183
|
-
children:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx("option", { value: "", children: labels.ignore }),
|
|
143
|
+
roles.map((option) => {
|
|
144
|
+
const marked = option.required === true && markRequired;
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
"option",
|
|
147
|
+
{
|
|
148
|
+
value: option.value,
|
|
149
|
+
"aria-label": marked ? labels.requiredRole(option.label) : void 0,
|
|
150
|
+
children: marked ? (labels.requiredRoleShort ?? markedShort)(option.label) : option.label
|
|
151
|
+
},
|
|
152
|
+
option.value
|
|
153
|
+
);
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
187
158
|
]
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
159
|
+
},
|
|
160
|
+
column
|
|
161
|
+
);
|
|
162
|
+
}) }) }),
|
|
163
|
+
/* @__PURE__ */ jsx(TableBody, { ...bodyProps, children: shown.map((row, index) => /* @__PURE__ */ createElement(TableRow, { ...rowProps?.(row, index), key: index }, columns.map((column) => /* @__PURE__ */ jsx(
|
|
164
|
+
TableCell,
|
|
165
|
+
{
|
|
166
|
+
"data-ignored": roleOfColumn(roles, mapping, column) === null || void 0,
|
|
167
|
+
className: cn(
|
|
168
|
+
"font-mono whitespace-nowrap",
|
|
169
|
+
// Dimmed, not hidden: its values are what tell you whether ignoring
|
|
170
|
+
// it was right.
|
|
171
|
+
roleOfColumn(roles, mapping, column) === null && "text-[var(--text-muted)]"
|
|
172
|
+
),
|
|
173
|
+
children: /* @__PURE__ */ jsx("span", { className: "block max-w-56 truncate", children: row[column] ?? "" })
|
|
174
|
+
},
|
|
175
|
+
column
|
|
176
|
+
)))) })
|
|
177
|
+
] }),
|
|
192
178
|
total > shown.length && /* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--text-muted)]", children: labels.previewOf(shown.length, total) }),
|
|
193
179
|
gaps.length > 0 && /* @__PURE__ */ jsx(AlertBanner, { tone: "warning", variant: "inline", size: "sm", block: true, children: labels.missing(formatList(gaps, "conjunction", locale)) })
|
|
194
180
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/column-mapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useEffectEvent, useRef, useState } from \"react\";\nimport type { ChangeEvent, DragEvent, HTMLAttributes, ReactNode } from \"react\";\nimport { Upload } from \"lucide-react\";\n\nimport { useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport {\n assignColumnRole,\n guessMapping,\n missingRoles,\n readMappedTable,\n readTextFile,\n roleOfColumn,\n} from \"../lib/column-mapping\";\nimport type {\n ColumnMapperResult,\n ColumnMapping,\n ColumnRole,\n} from \"../lib/column-mapping\";\nimport { scrollIntoStrip, useStripFade } from \"../lib/strip-fade\";\nimport { parseTextTable } from \"../lib/table-text\";\nimport type { TableSeparator, TextTable } from \"../lib/table-text\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { Checkbox } from \"./checkbox\";\nimport { Disclosure } from \"./disclosure\";\nimport { FileButton, useFilePicker } from \"./file-button\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from \"./table\";\nimport { Select, Textarea } from \"./ui\";\n\n/**\n * A table pasted, dropped or chosen as a file, and which of its columns plays which\n * part — Kurvenschmiede's columns input and keksdose's bank-file mapping step, once.\n *\n * Kurvenschmiede (`features/control/columns-input.tsx` + `csv.ts`) reads a recorder's\n * export into a playground signal (time, value) and a comparison (time, setpoint,\n * actual): a textarea, a file button, a parse, a select per role, and a line that says\n * which decimal convention was assumed and how many lines were skipped. keksdose\n * (`import-map-step.tsx`) shows a bank's CSV as a table with a role select on every\n * column's header, the file's real values under it, ignored columns dimmed, and what\n * the import still needs named under it. Same problem, two hand-built answers.\n *\n * Two layers, so both shapes fit:\n *\n * * {@link ColumnMapper} — the whole single panel: paste, drop or choose → parse\n * ({@link parseTextTable}: separator, decimal convention, header line, all stated\n * back) → preview with a role per column → `onChange(result)`. Kurvenschmiede's.\n * * {@link ColumnRoleTable} — the preview with the role selects alone, controlled, over\n * rows the caller already has. keksdose's map step, whose rows come from its server's\n * sniff (encodings, quoted multi-line cells, skipped title rows) and whose mapping\n * lives in the wizard's state between steps.\n *\n * The rules under both are headless in `lib/column-mapping.ts`: a role moves rather\n * than doubling up, what is missing is named, and the rows a numeric role cannot read\n * are reported by line number rather than dropped.\n */\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\nexport interface ColumnMapperLabels {\n /** The paste box's label. */\n paste: string;\n /** The caption under the paste box. */\n pasteHint: string;\n /** The file button. */\n chooseFile: string;\n /** A chosen or dropped file whose bytes could not be read at all. */\n readError: (name: string) => string;\n /** The checkbox that says whether the first line names the columns. */\n headerRow: string;\n /** What was read: so many columns and rows. */\n summary: (columns: number, rows: number) => string;\n /** The separator that was assumed. */\n separatorSemicolon: string;\n separatorComma: string;\n separatorTab: string;\n separatorSpace: string;\n /** The decimal convention that was assumed — with an example, because \"decimal\n * comma\" alone is a term, and `1,5` is something a reader recognises. */\n decimalComma: string;\n decimalPoint: string;\n /** The title over the lines that could not be read. */\n unreadCount: (count: number) => string;\n /** One of them. */\n unreadLine: (line: number) => string;\n /** Past the first hundred listed. */\n unreadMore: (count: number) => string;\n /** The text has content, and none of it is a row. */\n noRows: string;\n /** The preview table's name. */\n table: string;\n /** A column the table names no header for. */\n columnN: (n: number) => string;\n /** The role select on a column's header — its accessible name. */\n roleOf: (column: string) => string;\n /** The role select's \"no role\" option. */\n ignore: string;\n /** A required role in the select — only while some role is NOT required: when\n * every one is, the mark tells no role from another (0.24, Kurvenschmiede). */\n requiredRole: (role: string) => string;\n /** Under the preview, when it shows fewer rows than were read. */\n previewOf: (shown: number, total: number) => string;\n /** A required group's roles, already joined as a list with \"or\". */\n oneOf: (roles: string) => string;\n /** What the table still needs, already joined as a list with \"and\". */\n missing: (roles: string) => string;\n}\n\nexport const DEFAULT_COLUMN_MAPPER_LABELS: ColumnMapperLabels = {\n paste: \"Paste a table\",\n pasteHint:\n \"Copy the rows out of a spreadsheet and paste them here, or drop a CSV or text file.\",\n chooseFile: \"Choose a file\",\n readError: (name) => `“${name}” could not be read`,\n headerRow: \"The first line names the columns\",\n summary: (columns, rows) =>\n `${columns} ${columns === 1 ? \"column\" : \"columns\"}, ${rows} ${rows === 1 ? \"row\" : \"rows\"}`,\n separatorSemicolon: \"separated by semicolons\",\n separatorComma: \"separated by commas\",\n separatorTab: \"separated by tabs\",\n separatorSpace: \"separated by spaces\",\n decimalComma: \"decimal comma (1,5)\",\n decimalPoint: \"decimal point (1.5)\",\n unreadCount: (count) =>\n count === 1\n ? \"1 line could not be read\"\n : `${count} lines could not be read`,\n unreadLine: (line) => `Line ${line} could not be read`,\n unreadMore: (count) => `…and ${count} more`,\n noRows: \"No line of this text reads as a row of the table.\",\n table: \"Columns and their roles\",\n columnN: (n) => `Column ${n}`,\n roleOf: (column) => `What does column “${column}” hold?`,\n ignore: \"Ignore\",\n requiredRole: (role) => `${role} (required)`,\n previewOf: (shown, total) =>\n shown === 1\n ? `The first of ${total} rows`\n : `The first ${shown} of ${total} rows`,\n oneOf: (roles) => `either ${roles}`,\n missing: (roles) => `Still needed: ${roles}.`,\n};\n\nconst SEPARATOR_LABEL: Record<\n TableSeparator,\n \"separatorSemicolon\" | \"separatorComma\" | \"separatorTab\" | \"separatorSpace\"\n> = {\n \";\": \"separatorSemicolon\",\n \",\": \"separatorComma\",\n \"\\t\": \"separatorTab\",\n \" \": \"separatorSpace\",\n};\n\n/** How many unread lines are listed before \"…and N more\". */\nconst UNREAD_LISTED = 100;\n\n/** A file a table is likely to be in. Extensions only, so a refusal reads \"Only .csv,\n * .tsv, … files\" rather than a list of MIME types; the parse is the real check. */\nconst DEFAULT_ACCEPT = \".csv,.tsv,.txt,.dat,.asc\";\n\nfunction formatList(\n items: string[],\n type: \"conjunction\" | \"disjunction\",\n locale: string | undefined,\n): string {\n try {\n return new Intl.ListFormat(locale, { type, style: \"long\" }).format(items);\n } catch {\n return items.join(\", \");\n }\n}\n\n// ── ColumnRoleTable ───────────────────────────────────────────────────────────\n\n/** A `data-*` attribute, typed so `{ \"data-private\": \"\" }` needs no cast. */\ntype DataAttributes = { [key: `data-${string}`]: string | number | boolean | undefined };\n\n/**\n * What {@link ColumnRoleTableProps.bodyProps} puts on the preview's `<tbody>`: `data-*`\n * hooks, an `id`, a class, a style.\n */\nexport type ColumnRoleTableBodyProps = Omit<\n HTMLAttributes<HTMLTableSectionElement>,\n \"children\" | \"dangerouslySetInnerHTML\"\n> &\n DataAttributes;\n\n/**\n * What {@link ColumnRoleTableProps.rowProps} returns for one preview row's `<tr>` —\n * the same shape as LineItems' `LineItemsRowProps`, on a table row.\n */\nexport type ColumnRoleTableRowProps = Omit<\n HTMLAttributes<HTMLTableRowElement>,\n \"children\" | \"dangerouslySetInnerHTML\"\n> &\n DataAttributes;\n\nexport interface ColumnRoleTableProps<\n R extends string,\n M extends ColumnMapping<R> = ColumnMapping<R>,\n> {\n /** The columns' names — the file's header line — or `null` for a table without one\n * (each column is then \"Column 1\", \"Column 2\", …). */\n header: readonly string[] | null;\n /** The rows to preview, as text. Only the first {@link previewRows} are drawn. */\n rows: readonly (readonly string[])[];\n /** How many columns. Default: the header's length or the widest previewed row. */\n width?: number;\n /** The parts a column can play. */\n roles: readonly ColumnRole<R>[];\n /** Role → column. Any object with the roles as nullable number fields — keksdose's\n * `CsvMapping` as it stands; the other fields are handed back untouched. */\n mapping: M;\n /** The next mapping, with the picked role moved onto its column. */\n onMappingChange: (next: M) => void;\n /** Default 5. */\n previewRows?: number;\n /** How many rows the table has in all, for \"The first 5 of 120 rows\". Default:\n * `rows.length`. */\n totalRows?: number;\n /** Every role select disabled — keksdose locks them while a re-sniff replaces the\n * table they point into. */\n disabled?: boolean;\n /**\n * Extra attributes for the preview's `<tbody>` (0.24) — keksdose: the sample rows are\n * the user's own bank data (payees, memos, amounts), and its demo mode blurs exactly\n * that through `.demo-mode [data-private]` (#336). With nowhere to put the attribute,\n * its map step reached into the table with a `useLayoutEffect` that set it on the\n * `<tbody>` after every commit; `bodyProps={{ \"data-private\": \"\" }}` declares it.\n * There is deliberately no head counterpart: the column names and the role selects\n * are what such a mode is there to show.\n *\n * Spread on the kit `TableBody`; a `className` is added to its own.\n */\n bodyProps?: ColumnRoleTableBodyProps;\n /**\n * Extra attributes for one preview row's `<tr>`, from its cells and its index in the\n * preview (0.24) — the contract of LineItems' `rowProps` (keksdose K20), on a table:\n * `data-*` hooks (a per-row `data-private`, a test id), an `id`, a class. Called for\n * the rows drawn, the first {@link previewRows}. The row has no attributes of its own\n * to protect; a `className` is added after its classes.\n */\n rowProps?: (row: readonly string[], index: number) => ColumnRoleTableRowProps | undefined;\n labels?: Partial<ColumnMapperLabels>;\n className?: string;\n}\n\n/**\n * A table's first rows, with a role select on every column's header.\n *\n * keksdose's mapping step (dev#462: \"make it more table like, where the table columns\n * can be chosen from the input and the column data changes with the chosen column\n * header\"): the file IS the form. The file's own column name sits on top, verbatim —\n * it is how the reader recognises the column; under it the role, picked in place;\n * under that the column's real values, so a column that is one off shows up here and\n * not after the import. A column with no role says \"Ignore\" and its values are dimmed:\n * the state that most needs to be visible in a twelve-column bank export.\n *\n * Picking a role another column holds MOVES it ({@link assignColumnRole}). What the\n * table still needs is named under it — a required group as \"either Amount, Debit or\n * Credit\". Required roles say \"(required)\" in the list only where some role is not\n * (0.24): Kurvenschmiede's roles are all required, so the mark told no option from\n * another, and on a phone it cut the role's own name short (\"Zeit (s) (erforderl…\")\n * — the part of the option the reader has to read. The \"Still needed\" line already\n * says what is missing; a mark that distinguishes nothing is only noise.\n *\n * The table scrolls sideways inside its own box (the kit {@link Table}'s wrapper, a\n * named, keyboard-reachable region while it overflows), so a wide export never widens\n * the page at 390px. An edge with columns behind it fades out (0.24, Kurvenschmiede:\n * on a phone the fourth column's select sat off-screen and nothing said there was more\n * to the right; phone scrollbars are overlays that show only while you drag). It is\n * the kit Tabs strip's measured fade: drawn only while something is hidden on that\n * side, so a table that fits is painted as before; both ends once scrolled into the\n * middle; the reading direction's own in RTL; never animated, so there is nothing for\n * reduced motion to turn off; and a `mask-image`, which changes no layout and needs no\n * background colour to fade to. A role select focused behind the fade is scrolled\n * clear of it.\n */\nexport function ColumnRoleTable<\n R extends string,\n M extends ColumnMapping<R> = ColumnMapping<R>,\n>({\n header,\n rows,\n width: widthProp,\n roles,\n mapping,\n onMappingChange,\n previewRows = 5,\n totalRows,\n disabled,\n bodyProps,\n rowProps,\n labels: labelsProp,\n className,\n}: ColumnRoleTableProps<R, M>) {\n const labels: ColumnMapperLabels = useKitLabels(\n \"columnMapper\",\n DEFAULT_COLUMN_MAPPER_LABELS,\n labelsProp,\n );\n const locale = useKitLocale();\n const shown = rows.slice(0, previewRows);\n const width =\n widthProp ??\n shown.reduce(\n (widest, row) => Math.max(widest, row.length),\n header?.length ?? 0,\n );\n const columns = Array.from({ length: width }, (_, index) => index);\n const total = totalRows ?? rows.length;\n const nameOf = (column: number) =>\n header?.[column] || labels.columnN(column + 1);\n const labelOf = (value: R) =>\n roles.find((role) => role.value === value)?.label ?? value;\n const gaps = missingRoles(roles, mapping, width).map((gap) =>\n gap.length === 1\n ? labelOf(gap[0])\n : labels.oneOf(formatList(gap.map(labelOf), \"disjunction\", locale)),\n );\n // \"(required)\" only where it tells one option from another.\n const markRequired = roles.some((role) => role.required !== true);\n\n // The Table's own scroll wrapper — the `<table>`'s parent — is what overflows; the\n // fade is measured on it and drawn on the box round it, which has the same edges.\n const scroller = useRef<HTMLElement | null>(null);\n const tableRef = useCallback((table: HTMLTableElement | null) => {\n scroller.current = table?.parentElement ?? null;\n }, []);\n const fade = useStripFade(scroller);\n\n return (\n <div\n className={cn(\"min-w-0 space-y-1.5\", className)}\n data-slot=\"column-role-table\"\n >\n <div\n data-slot=\"column-role-table-scroll\"\n // In reading-direction terms (\"start\", \"end\", \"both\"), for a caller's styling.\n data-overflow={fade.overflow}\n style={\n fade.mask\n ? { maskImage: fade.mask, WebkitMaskImage: fade.mask }\n : undefined\n }\n >\n <Table\n ref={tableRef}\n density=\"compact\"\n framed\n aria-label={labels.table}\n >\n <TableHead>\n <TableRow>\n {columns.map((column) => {\n const role = roleOfColumn(roles, mapping, column);\n const name = nameOf(column);\n return (\n <TableHeaderCell\n key={column}\n scope=\"col\"\n className=\"min-w-36 py-2 align-top\"\n >\n <span className=\"block max-w-56 truncate pb-1 text-[11px] font-normal text-[var(--text-muted)]\">\n {name}\n </span>\n <Select\n size=\"sm\"\n className=\"w-full\"\n aria-label={labels.roleOf(name)}\n value={role ?? \"\"}\n disabled={disabled}\n // Focus brings a select behind the fade clear of it — the browser's\n // own scroll stops at the edge, under the fade.\n onFocus={(event) => {\n const cell = event.currentTarget.closest(\"th\");\n if (scroller.current && cell)\n scrollIntoStrip(scroller.current, cell);\n }}\n onChange={(event) =>\n onMappingChange(\n assignColumnRole(\n roles,\n mapping,\n column,\n event.target.value === \"\"\n ? null\n : (event.target.value as R),\n ),\n )\n }\n >\n <option value=\"\">{labels.ignore}</option>\n {roles.map((option) => (\n <option key={option.value} value={option.value}>\n {option.required === true && markRequired\n ? labels.requiredRole(option.label)\n : option.label}\n </option>\n ))}\n </Select>\n </TableHeaderCell>\n );\n })}\n </TableRow>\n </TableHead>\n <TableBody {...bodyProps}>\n {shown.map((row, index) => (\n <TableRow {...rowProps?.(row, index)} key={index}>\n {columns.map((column) => (\n <TableCell\n key={column}\n data-ignored={\n roleOfColumn(roles, mapping, column) === null || undefined\n }\n className={cn(\n \"font-mono whitespace-nowrap\",\n // Dimmed, not hidden: its values are what tell you whether ignoring\n // it was right.\n roleOfColumn(roles, mapping, column) === null &&\n \"text-[var(--text-muted)]\",\n )}\n >\n <span className=\"block max-w-56 truncate\">\n {row[column] ?? \"\"}\n </span>\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n {total > shown.length && (\n <p className=\"text-xs text-[var(--text-muted)]\">\n {labels.previewOf(shown.length, total)}\n </p>\n )}\n {gaps.length > 0 && (\n <AlertBanner tone=\"warning\" variant=\"inline\" size=\"sm\" block>\n {labels.missing(formatList(gaps, \"conjunction\", locale))}\n </AlertBanner>\n )}\n </div>\n );\n}\n\n// ── ColumnMapper ──────────────────────────────────────────────────────────────\n\nexport interface ColumnMapperProps<R extends string> {\n /** The parts the columns play — translated labels, which are required, which must\n * be numbers. See {@link ColumnRole}. */\n roles: readonly ColumnRole<R>[];\n /**\n * The table read through the current mapping, on every change: the text, the header\n * checkbox, a role. `null` while there is no table at all (an empty box). Use it when\n * `result.complete`; until then `result.missing` says what is not placed yet.\n *\n * The rows are strings. A numeric role's cells are guaranteed to read with\n * `tableNumber(cell, result.decimalComma)`; anything else is the caller's to convert.\n */\n onChange: (result: ColumnMapperResult<R> | null) => void;\n /** The paste box's label. Default: `labels.paste`. */\n label?: ReactNode;\n /** The caption under the paste box. Default: `labels.pasteHint`. */\n hint?: ReactNode;\n /** What the file dialog offers, and what a drop is checked against. Default:\n * `.csv,.tsv,.txt,.dat,.asc`. */\n accept?: string;\n /** The largest file taken, in bytes. Default: no limit. */\n maxSize?: number;\n /** Text to start with. `onChange` is called with its result once, on mount. */\n defaultText?: string;\n /** Rows in the preview. Default 5. */\n previewRows?: number;\n /** The first mapping for a new table. Default {@link guessMapping}: a column named\n * like a role gets it, and the required roles left over take the free columns in\n * order. */\n guess?: (table: TextTable) => ColumnMapping<R>;\n disabled?: boolean;\n /** The preview table's `<tbody>` attributes — {@link ColumnRoleTableProps.bodyProps}\n * (0.24): `{ \"data-private\": \"\" }` for a table of someone's own data. */\n bodyProps?: ColumnRoleTableBodyProps;\n /** One preview row's `<tr>` attributes — {@link ColumnRoleTableProps.rowProps}\n * (0.24). `row` is the row as read, `index` its place in the preview. */\n rowProps?: (row: readonly string[], index: number) => ColumnRoleTableRowProps | undefined;\n labels?: Partial<ColumnMapperLabels>;\n className?: string;\n}\n\ninterface MapperState<R extends string> {\n text: string;\n /** The reader's answer to \"does the first line name the columns\", or `null` for\n * the parse's own. */\n header: boolean | null;\n table: TextTable;\n mapping: ColumnMapping<R>;\n}\n\nconst hasFiles = (event: DragEvent) =>\n Array.from(event.dataTransfer?.types ?? []).includes(\"Files\");\n\n/**\n * Paste, drop or choose a table, see what it was read as, and say which column is\n * which — Kurvenschmiede's playground signal and comparison input as one kit part.\n *\n * Everything the parse assumed is stated, because a guess the reader cannot see is a\n * guess they cannot correct: the shape it found, the separator, the decimal\n * convention (\"decimal comma (1,5)\"), and every line it could not read, by number and\n * with its text. The header line is a checkbox, since the detection is a guess either\n * way and toggling it does not move a column (the mapping is kept, keksdose's\n * `keepRoles`). A new file is a new table and is mapped afresh; typing that changes the\n * column count re-guesses, because the old indexes point at nothing.\n *\n * A file can be chosen, dropped on the button, or dropped on the paste box — which,\n * left to the browser, would open the file in place of the page. It is read as UTF-8,\n * or as Windows-1252 when it is not UTF-8 ({@link readTextFile}).\n *\n * A two-step wizard that keeps the drop and the mapping apart (keksdose's) uses the\n * parts: {@link parseTextTable} or its own server's sniff, then {@link ColumnRoleTable},\n * then {@link readMappedTable}.\n */\nexport function ColumnMapper<R extends string>({\n roles,\n onChange,\n label,\n hint,\n accept = DEFAULT_ACCEPT,\n maxSize,\n defaultText = \"\",\n previewRows = 5,\n guess,\n disabled = false,\n bodyProps,\n rowProps,\n labels: labelsProp,\n className,\n}: ColumnMapperProps<R>) {\n const labels: ColumnMapperLabels = useKitLabels(\n \"columnMapper\",\n DEFAULT_COLUMN_MAPPER_LABELS,\n labelsProp,\n );\n const firstMapping = (table: TextTable) =>\n guess ? guess(table) : guessMapping(roles, table.header, table.width);\n const [state, setState] = useState<MapperState<R>>(() => {\n const table = parseTextTable(defaultText);\n return {\n text: defaultText,\n header: null,\n table,\n mapping: firstMapping(table),\n };\n });\n const [reading, setReading] = useState(false);\n const [refusal, setRefusal] = useState<string | null>(null);\n const [dragOver, setDragOver] = useState(false);\n\n // What is drawn and what is handed over are the same computation. Not memoised: a\n // caller writes `roles={[…]}` inline, so a memo keyed on them would miss every time,\n // and the read is one pass over rows that are already split.\n const result = readMappedTable(state.table, roles, state.mapping);\n\n const commit = (next: MapperState<R>) => {\n setState(next);\n onChange(\n next.table.width === 0\n ? null\n : readMappedTable(next.table, roles, next.mapping),\n );\n };\n\n /** New text. `fresh` (a file): the reader's header answer and the mapping start over. */\n const take = (text: string, fresh: boolean) => {\n const header = fresh ? null : state.header;\n const table = parseTextTable(text, header === null ? {} : { header });\n const keep =\n !fresh && table.width === state.table.width && state.table.width > 0;\n commit({\n text,\n header,\n table,\n mapping: keep ? state.mapping : firstMapping(table),\n });\n };\n\n const load = (file: File) => {\n setRefusal(null);\n setReading(true);\n void readTextFile(file)\n .then(\n (text) => take(text, true),\n // Only the read: an error thrown by the caller's onChange is not the file's.\n () => setRefusal(labels.readError(file.name)),\n )\n .finally(() => setReading(false));\n };\n\n const refuse = (rejections: { message: string }[]) =>\n setRefusal(rejections[0]?.message ?? null);\n\n // A file dropped on the paste box. The same screening as the button's.\n const drop = useFilePicker({\n accept,\n maxSize,\n disabled,\n onFiles: ([file]) => load(file),\n onReject: refuse,\n });\n\n const seeded = useEffectEvent(() => {\n if (state.table.width > 0) onChange(result);\n });\n useEffect(() => {\n seeded();\n }, []);\n\n const { table } = state;\n const separator = labels[SEPARATOR_LABEL[table.separator]];\n const unread = result.unread;\n\n return (\n <div\n className={cn(\"min-w-0 space-y-3\", className)}\n data-slot=\"column-mapper\"\n >\n <Textarea\n label={label ?? labels.paste}\n hint={hint ?? labels.pasteHint}\n rows={5}\n wrap=\"off\"\n spellCheck={false}\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n value={state.text}\n disabled={disabled}\n className={cn(\n \"font-mono text-xs\",\n dragOver && \"rounded-md ring-2 ring-[var(--brand)]\",\n )}\n data-drag-over={dragOver || undefined}\n onChange={(event: ChangeEvent<HTMLTextAreaElement>) => {\n setRefusal(null);\n take(event.target.value, false);\n }}\n onDragEnter={(event) => {\n if (!hasFiles(event)) return;\n event.preventDefault();\n if (!disabled) setDragOver(true);\n }}\n onDragOver={(event) => {\n if (!hasFiles(event)) return;\n // Cancelled for every file drag: an uncancelled one makes the browser open\n // the file in place of the page.\n event.preventDefault();\n event.dataTransfer.dropEffect = disabled ? \"none\" : \"copy\";\n }}\n onDragLeave={() => setDragOver(false)}\n onDrop={(event) => {\n if (!hasFiles(event)) return;\n event.preventDefault();\n setDragOver(false);\n drop.take(event.dataTransfer.files);\n }}\n />\n {drop.element}\n\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n <FileButton\n variant=\"secondary\"\n accept={accept}\n maxSize={maxSize}\n droppable\n pending={reading}\n disabled={disabled}\n onFiles={([file]) => load(file)}\n onReject={refuse}\n >\n <Upload className=\"size-4\" aria-hidden />\n {labels.chooseFile}\n </FileButton>\n {table.width > 0 && (\n <Checkbox\n label={labels.headerRow}\n checked={table.header !== null}\n disabled={disabled}\n onCheckedChange={(checked) => {\n const next = parseTextTable(state.text, { header: checked });\n // Same text, same split: the columns are where they were, and so are the\n // roles on them.\n commit({ ...state, header: checked, table: next });\n }}\n />\n )}\n </div>\n\n {refusal && (\n <AlertBanner tone=\"danger\" variant=\"inline\" size=\"sm\" block>\n {refusal}\n </AlertBanner>\n )}\n\n {table.width > 0 && (\n <>\n <p\n className=\"text-xs text-[var(--text-secondary)]\"\n data-slot=\"column-mapper-summary\"\n >\n {[\n labels.summary(table.width, result.rows.length),\n separator,\n table.decimalComma ? labels.decimalComma : labels.decimalPoint,\n ].join(\" · \")}\n </p>\n {result.rows.length === 0 && (\n <AlertBanner tone=\"warning\" variant=\"inline\" size=\"sm\" block>\n {labels.noRows}\n </AlertBanner>\n )}\n <ColumnRoleTable\n header={table.header}\n rows={result.rows}\n width={table.width}\n roles={roles}\n mapping={state.mapping}\n onMappingChange={(mapping) => commit({ ...state, mapping })}\n previewRows={previewRows}\n disabled={disabled}\n bodyProps={bodyProps}\n rowProps={rowProps}\n labels={labelsProp}\n />\n {unread.length > 0 && (\n <Disclosure\n variant=\"bare\"\n title={labels.unreadCount(unread.length)}\n data-slot=\"column-mapper-unread\"\n >\n <ul className=\"space-y-1 text-xs\">\n {unread.slice(0, UNREAD_LISTED).map((line) => (\n <li key={line.line} className=\"min-w-0\">\n <span className=\"block text-[var(--text-secondary)]\">\n {labels.unreadLine(line.line)}\n </span>\n <code className=\"block truncate font-mono text-[var(--text-muted)]\">\n {line.text}\n </code>\n </li>\n ))}\n {unread.length > UNREAD_LISTED && (\n <li className=\"text-[var(--text-muted)]\">\n {labels.unreadMore(unread.length - UNREAD_LISTED)}\n </li>\n )}\n </ul>\n </Disclosure>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAiXoB,SAoVZ,UApVY,KAGA,YAHA;AA6CN;AA9Zd,SAAS,aAAa,WAAW,gBAAgB,QAAQ,gBAAgB;AAEzE,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAoB;AAC3C,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,iBAAiB,oBAAoB;AAC9C,SAAS,sBAAsB;AAE/B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,YAAY,qBAAqB;AAC1C;AAAA,EACE;AAAA,EACA;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K;AAAA;AAAA,UACd;AAAA,UACC,OAAO,KAAK,WAAW,KACtB,oBAAC,eAAY,MAAK,WAAU,SAAQ,UAAS,MAAK,MAAK,OAAK,MACzD,iBAAO,QACV;AAAA,UAEF;AAAA,YAAC;AAAA;AAAA,cACC,QAAQ,MAAM;AAAA,cACd,MAAM,OAAO;AAAA,cACb,OAAO,MAAM;AAAA,cACb;AAAA,cACA,SAAS,MAAM;AAAA,cACf,iBAAiB,CAAC,YAAY,OAAO,EAAE,GAAG,OAAO,QAAQ,CAAC;AAAA,cAC1D;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,QAAQ;AAAA;AAAA,UACV;AAAA,UACC,OAAO,SAAS,KACf;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,OAAO,OAAO,YAAY,OAAO,MAAM;AAAA,cACvC,aAAU;AAAA,cAEV,+BAAC,QAAG,WAAU,qBACX;AAAA,uBAAO,MAAM,GAAG,aAAa,EAAE,IAAI,CAAC,SACnC,qBAAC,QAAmB,WAAU,WAC5B;AAAA,sCAAC,UAAK,WAAU,sCACb,iBAAO,WAAW,KAAK,IAAI,GAC9B;AAAA,kBACA,oBAAC,UAAK,WAAU,qDACb,eAAK,MACR;AAAA,qBANO,KAAK,IAOd,CACD;AAAA,gBACA,OAAO,SAAS,iBACf,oBAAC,QAAG,WAAU,4BACX,iBAAO,WAAW,OAAO,SAAS,aAAa,GAClD;AAAA,iBAEJ;AAAA;AAAA,UACF;AAAA,WAEJ;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["table"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/column-mapper.tsx"],"sourcesContent":["import { useEffect, useEffectEvent, useState } from \"react\";\nimport type { ChangeEvent, DragEvent, HTMLAttributes, ReactNode } from \"react\";\nimport { Upload } from \"lucide-react\";\n\nimport { useKitLabels, useKitLocale } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport {\n assignColumnRole,\n guessMapping,\n missingRoles,\n readMappedTable,\n readTextFile,\n roleOfColumn,\n} from \"../lib/column-mapping\";\nimport type {\n ColumnMapperResult,\n ColumnMapping,\n ColumnRole,\n} from \"../lib/column-mapping\";\nimport { parseTextTable } from \"../lib/table-text\";\nimport type { TableSeparator, TextTable } from \"../lib/table-text\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { Checkbox } from \"./checkbox\";\nimport { Disclosure } from \"./disclosure\";\nimport { FileButton, useFilePicker } from \"./file-button\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeaderCell,\n TableRow,\n} from \"./table\";\nimport { Select, Textarea } from \"./ui\";\n\n/**\n * A table pasted, dropped or chosen as a file, and which of its columns plays which\n * part — Kurvenschmiede's columns input and keksdose's bank-file mapping step, once.\n *\n * Kurvenschmiede (`features/control/columns-input.tsx` + `csv.ts`) reads a recorder's\n * export into a playground signal (time, value) and a comparison (time, setpoint,\n * actual): a textarea, a file button, a parse, a select per role, and a line that says\n * which decimal convention was assumed and how many lines were skipped. keksdose\n * (`import-map-step.tsx`) shows a bank's CSV as a table with a role select on every\n * column's header, the file's real values under it, ignored columns dimmed, and what\n * the import still needs named under it. Same problem, two hand-built answers.\n *\n * Two layers, so both shapes fit:\n *\n * * {@link ColumnMapper} — the whole single panel: paste, drop or choose → parse\n * ({@link parseTextTable}: separator, decimal convention, header line, all stated\n * back) → preview with a role per column → `onChange(result)`. Kurvenschmiede's.\n * * {@link ColumnRoleTable} — the preview with the role selects alone, controlled, over\n * rows the caller already has. keksdose's map step, whose rows come from its server's\n * sniff (encodings, quoted multi-line cells, skipped title rows) and whose mapping\n * lives in the wizard's state between steps.\n *\n * The rules under both are headless in `lib/column-mapping.ts`: a role moves rather\n * than doubling up, what is missing is named, and the rows a numeric role cannot read\n * are reported by line number rather than dropped.\n */\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\nexport interface ColumnMapperLabels {\n /** The paste box's label. */\n paste: string;\n /** The caption under the paste box. */\n pasteHint: string;\n /** The file button. */\n chooseFile: string;\n /** A chosen or dropped file whose bytes could not be read at all. */\n readError: (name: string) => string;\n /** The checkbox that says whether the first line names the columns. */\n headerRow: string;\n /** What was read: so many columns and rows. */\n summary: (columns: number, rows: number) => string;\n /** The separator that was assumed. */\n separatorSemicolon: string;\n separatorComma: string;\n separatorTab: string;\n separatorSpace: string;\n /** The decimal convention that was assumed — with an example, because \"decimal\n * comma\" alone is a term, and `1,5` is something a reader recognises. */\n decimalComma: string;\n decimalPoint: string;\n /** The title over the lines that could not be read. */\n unreadCount: (count: number) => string;\n /** One of them. */\n unreadLine: (line: number) => string;\n /** Past the first hundred listed. */\n unreadMore: (count: number) => string;\n /** The text has content, and none of it is a row. */\n noRows: string;\n /** The preview table's name. */\n table: string;\n /** A column the table names no header for. */\n columnN: (n: number) => string;\n /** The role select on a column's header — its accessible name. */\n roleOf: (column: string) => string;\n /** The role select's \"no role\" option. */\n ignore: string;\n /** A required role in the select — only while some role is NOT required: when\n * every one is, the mark tells no role from another (0.24, Kurvenschmiede). Since\n * 0.25 this is what a screen reader says for the option (its `aria-label`); the\n * option SHOWS {@link requiredRoleShort}. */\n requiredRole: (role: string) => string;\n /** The same required role as the select shows it (0.25): the role's name and a short\n * mark, so the mark does not cut the name short in a phone-width column — \"Booking\n * date (re…\" was all keksdose's closed select had room for. Spoken as\n * {@link requiredRole}. Optional, so a complete `UiKitLabels` typed before 0.25\n * still compiles; the asterisk needs no translation in most languages. */\n requiredRoleShort?: (role: string) => string;\n /** Under the preview, when it shows fewer rows than were read. */\n previewOf: (shown: number, total: number) => string;\n /** A required group's roles, already joined as a list with \"or\". */\n oneOf: (roles: string) => string;\n /** What the table still needs, already joined as a list with \"and\". */\n missing: (roles: string) => string;\n}\n\n/** {@link ColumnMapperLabels.requiredRoleShort}'s English — and its fallback for a\n * provider whose labels predate the key. */\nconst markedShort = (role: string) => `${role} *`;\n\nexport const DEFAULT_COLUMN_MAPPER_LABELS: ColumnMapperLabels = {\n paste: \"Paste a table\",\n pasteHint:\n \"Copy the rows out of a spreadsheet and paste them here, or drop a CSV or text file.\",\n chooseFile: \"Choose a file\",\n readError: (name) => `“${name}” could not be read`,\n headerRow: \"The first line names the columns\",\n summary: (columns, rows) =>\n `${columns} ${columns === 1 ? \"column\" : \"columns\"}, ${rows} ${rows === 1 ? \"row\" : \"rows\"}`,\n separatorSemicolon: \"separated by semicolons\",\n separatorComma: \"separated by commas\",\n separatorTab: \"separated by tabs\",\n separatorSpace: \"separated by spaces\",\n decimalComma: \"decimal comma (1,5)\",\n decimalPoint: \"decimal point (1.5)\",\n unreadCount: (count) =>\n count === 1\n ? \"1 line could not be read\"\n : `${count} lines could not be read`,\n unreadLine: (line) => `Line ${line} could not be read`,\n unreadMore: (count) => `…and ${count} more`,\n noRows: \"No line of this text reads as a row of the table.\",\n table: \"Columns and their roles\",\n columnN: (n) => `Column ${n}`,\n roleOf: (column) => `What does column “${column}” hold?`,\n ignore: \"Ignore\",\n requiredRole: (role) => `${role} (required)`,\n requiredRoleShort: markedShort,\n previewOf: (shown, total) =>\n shown === 1\n ? `The first of ${total} rows`\n : `The first ${shown} of ${total} rows`,\n oneOf: (roles) => `either ${roles}`,\n missing: (roles) => `Still needed: ${roles}.`,\n};\n\nconst SEPARATOR_LABEL: Record<\n TableSeparator,\n \"separatorSemicolon\" | \"separatorComma\" | \"separatorTab\" | \"separatorSpace\"\n> = {\n \";\": \"separatorSemicolon\",\n \",\": \"separatorComma\",\n \"\\t\": \"separatorTab\",\n \" \": \"separatorSpace\",\n};\n\n/** How many unread lines are listed before \"…and N more\". */\nconst UNREAD_LISTED = 100;\n\n/** A file a table is likely to be in. Extensions only, so a refusal reads \"Only .csv,\n * .tsv, … files\" rather than a list of MIME types; the parse is the real check. */\nconst DEFAULT_ACCEPT = \".csv,.tsv,.txt,.dat,.asc\";\n\nfunction formatList(\n items: string[],\n type: \"conjunction\" | \"disjunction\",\n locale: string | undefined,\n): string {\n try {\n return new Intl.ListFormat(locale, { type, style: \"long\" }).format(items);\n } catch {\n return items.join(\", \");\n }\n}\n\n// ── ColumnRoleTable ───────────────────────────────────────────────────────────\n\n/** A `data-*` attribute, typed so `{ \"data-private\": \"\" }` needs no cast. */\ntype DataAttributes = { [key: `data-${string}`]: string | number | boolean | undefined };\n\n/**\n * What {@link ColumnRoleTableProps.bodyProps} puts on the preview's `<tbody>`: `data-*`\n * hooks, an `id`, a class, a style.\n */\nexport type ColumnRoleTableBodyProps = Omit<\n HTMLAttributes<HTMLTableSectionElement>,\n \"children\" | \"dangerouslySetInnerHTML\"\n> &\n DataAttributes;\n\n/**\n * What {@link ColumnRoleTableProps.rowProps} returns for one preview row's `<tr>` —\n * the same shape as LineItems' `LineItemsRowProps`, on a table row.\n */\nexport type ColumnRoleTableRowProps = Omit<\n HTMLAttributes<HTMLTableRowElement>,\n \"children\" | \"dangerouslySetInnerHTML\"\n> &\n DataAttributes;\n\nexport interface ColumnRoleTableProps<\n R extends string,\n M extends ColumnMapping<R> = ColumnMapping<R>,\n> {\n /** The columns' names — the file's header line — or `null` for a table without one\n * (each column is then \"Column 1\", \"Column 2\", …). */\n header: readonly string[] | null;\n /** The rows to preview, as text. Only the first {@link previewRows} are drawn. */\n rows: readonly (readonly string[])[];\n /** How many columns. Default: the header's length or the widest previewed row. */\n width?: number;\n /** The parts a column can play. */\n roles: readonly ColumnRole<R>[];\n /** Role → column. Any object with the roles as nullable number fields — keksdose's\n * `CsvMapping` as it stands; the other fields are handed back untouched. */\n mapping: M;\n /** The next mapping, with the picked role moved onto its column. */\n onMappingChange: (next: M) => void;\n /** Default 5. */\n previewRows?: number;\n /** How many rows the table has in all, for \"The first 5 of 120 rows\". Default:\n * `rows.length`. */\n totalRows?: number;\n /** Every role select disabled — keksdose locks them while a re-sniff replaces the\n * table they point into. */\n disabled?: boolean;\n /**\n * Extra attributes for the preview's `<tbody>` (0.24) — keksdose: the sample rows are\n * the user's own bank data (payees, memos, amounts), and its demo mode blurs exactly\n * that through `.demo-mode [data-private]` (#336). With nowhere to put the attribute,\n * its map step reached into the table with a `useLayoutEffect` that set it on the\n * `<tbody>` after every commit; `bodyProps={{ \"data-private\": \"\" }}` declares it.\n * There is deliberately no head counterpart: the column names and the role selects\n * are what such a mode is there to show.\n *\n * Spread on the kit `TableBody`; a `className` is added to its own.\n */\n bodyProps?: ColumnRoleTableBodyProps;\n /**\n * Extra attributes for one preview row's `<tr>`, from its cells and its index in the\n * preview (0.24) — the contract of LineItems' `rowProps` (keksdose K20), on a table:\n * `data-*` hooks (a per-row `data-private`, a test id), an `id`, a class. Called for\n * the rows drawn, the first {@link previewRows}. The row has no attributes of its own\n * to protect; a `className` is added after its classes.\n */\n rowProps?: (row: readonly string[], index: number) => ColumnRoleTableRowProps | undefined;\n labels?: Partial<ColumnMapperLabels>;\n className?: string;\n}\n\n/**\n * A table's first rows, with a role select on every column's header.\n *\n * keksdose's mapping step (dev#462: \"make it more table like, where the table columns\n * can be chosen from the input and the column data changes with the chosen column\n * header\"): the file IS the form. The file's own column name sits on top, verbatim —\n * it is how the reader recognises the column; under it the role, picked in place;\n * under that the column's real values, so a column that is one off shows up here and\n * not after the import. A column with no role says \"Ignore\" and its values are dimmed:\n * the state that most needs to be visible in a twelve-column bank export.\n *\n * Picking a role another column holds MOVES it ({@link assignColumnRole}). What the\n * table still needs is named under it — a required group as \"either Amount, Debit or\n * Credit\". Required roles are marked in the list only where some role is not\n * (0.24): Kurvenschmiede's roles are all required, so the mark told no option from\n * another, and on a phone it cut the role's own name short (\"Zeit (s) (erforderl…\")\n * — the part of the option the reader has to read. The \"Still needed\" line already\n * says what is missing; a mark that distinguishes nothing is only noise.\n *\n * Where the mark does tell roles apart, it is short (0.25): keksdose's bank roles, on\n * a phone, still showed \"Booking date (re…\" in the closed select. The option shows\n * \"Booking date *\" ({@link ColumnMapperLabels.requiredRoleShort}) and is NAMED \"Booking\n * date (required)\" ({@link ColumnMapperLabels.requiredRole}, its `aria-label`), so a\n * screen reader hears the word rather than \"star\". And no role is cut at all: each\n * column is at least as wide as its select's longest option — the select's own width,\n * which a table cell otherwise ignores for a `w-full` control — up to 14rem, the width\n * the column's name and values already stop at. A long role name (\"Date de\n * comptabilisation\", \"Betrag (mit Vorzeichen)\") widens the columns, and the edge fade\n * says there are more of them to scroll to.\n *\n * The table scrolls sideways inside its own box (the kit {@link Table}'s wrapper, a\n * named, keyboard-reachable region while it overflows), so a wide export never widens\n * the page at 390px. An edge with columns behind it fades out (0.24, Kurvenschmiede:\n * on a phone the fourth column's select sat off-screen and nothing said there was more\n * to the right; phone scrollbars are overlays that show only while you drag). Since\n * 0.25 that is the kit Table's own `edgeFade`, not a box of this table's round it:\n * measured, so a table that fits is painted as before; both ends once scrolled into\n * the middle; the reading direction's own in RTL; never animated; a `mask-image`,\n * which changes no layout and needs no background colour to fade to. A role select\n * focused behind the fade is scrolled clear of it, cell and all, and the Table's\n * wrapper says which ends are cut in `data-overflow`.\n */\nexport function ColumnRoleTable<\n R extends string,\n M extends ColumnMapping<R> = ColumnMapping<R>,\n>({\n header,\n rows,\n width: widthProp,\n roles,\n mapping,\n onMappingChange,\n previewRows = 5,\n totalRows,\n disabled,\n bodyProps,\n rowProps,\n labels: labelsProp,\n className,\n}: ColumnRoleTableProps<R, M>) {\n const labels: ColumnMapperLabels = useKitLabels(\n \"columnMapper\",\n DEFAULT_COLUMN_MAPPER_LABELS,\n labelsProp,\n );\n const locale = useKitLocale();\n const shown = rows.slice(0, previewRows);\n const width =\n widthProp ??\n shown.reduce(\n (widest, row) => Math.max(widest, row.length),\n header?.length ?? 0,\n );\n const columns = Array.from({ length: width }, (_, index) => index);\n const total = totalRows ?? rows.length;\n const nameOf = (column: number) =>\n header?.[column] || labels.columnN(column + 1);\n const labelOf = (value: R) =>\n roles.find((role) => role.value === value)?.label ?? value;\n const gaps = missingRoles(roles, mapping, width).map((gap) =>\n gap.length === 1\n ? labelOf(gap[0])\n : labels.oneOf(formatList(gap.map(labelOf), \"disjunction\", locale)),\n );\n // The required mark only where it tells one option from another.\n const markRequired = roles.some((role) => role.required !== true);\n\n return (\n <div\n className={cn(\"min-w-0 space-y-1.5\", className)}\n data-slot=\"column-role-table\"\n >\n <Table density=\"compact\" framed edgeFade aria-label={labels.table}>\n <TableHead>\n <TableRow>\n {columns.map((column) => {\n const role = roleOfColumn(roles, mapping, column);\n const name = nameOf(column);\n return (\n <TableHeaderCell\n key={column}\n scope=\"col\"\n className=\"min-w-36 py-2 align-top\"\n >\n <span className=\"block max-w-56 truncate pb-1 text-[11px] font-normal text-[var(--text-muted)]\">\n {name}\n </span>\n <Select\n size=\"sm\"\n className=\"w-full\"\n // Its own width (the longest option) rather than the cell's: a cell\n // takes no width from a `w-full` select, so the role's name was\n // cut at the column's 9rem minimum. Stretched to the cell when that\n // is wider; capped where the column's name and values stop.\n selectClassName=\"w-auto min-w-full max-w-56\"\n aria-label={labels.roleOf(name)}\n value={role ?? \"\"}\n disabled={disabled}\n onChange={(event) =>\n onMappingChange(\n assignColumnRole(\n roles,\n mapping,\n column,\n event.target.value === \"\"\n ? null\n : (event.target.value as R),\n ),\n )\n }\n >\n <option value=\"\">{labels.ignore}</option>\n {roles.map((option) => {\n const marked = option.required === true && markRequired;\n return (\n <option\n key={option.value}\n value={option.value}\n // The short mark on screen, the word for a screen reader.\n aria-label={\n marked ? labels.requiredRole(option.label) : undefined\n }\n >\n {marked\n ? (labels.requiredRoleShort ?? markedShort)(option.label)\n : option.label}\n </option>\n );\n })}\n </Select>\n </TableHeaderCell>\n );\n })}\n </TableRow>\n </TableHead>\n <TableBody {...bodyProps}>\n {shown.map((row, index) => (\n <TableRow {...rowProps?.(row, index)} key={index}>\n {columns.map((column) => (\n <TableCell\n key={column}\n data-ignored={\n roleOfColumn(roles, mapping, column) === null || undefined\n }\n className={cn(\n \"font-mono whitespace-nowrap\",\n // Dimmed, not hidden: its values are what tell you whether ignoring\n // it was right.\n roleOfColumn(roles, mapping, column) === null &&\n \"text-[var(--text-muted)]\",\n )}\n >\n <span className=\"block max-w-56 truncate\">\n {row[column] ?? \"\"}\n </span>\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n {total > shown.length && (\n <p className=\"text-xs text-[var(--text-muted)]\">\n {labels.previewOf(shown.length, total)}\n </p>\n )}\n {gaps.length > 0 && (\n <AlertBanner tone=\"warning\" variant=\"inline\" size=\"sm\" block>\n {labels.missing(formatList(gaps, \"conjunction\", locale))}\n </AlertBanner>\n )}\n </div>\n );\n}\n\n// ── ColumnMapper ──────────────────────────────────────────────────────────────\n\nexport interface ColumnMapperProps<R extends string> {\n /** The parts the columns play — translated labels, which are required, which must\n * be numbers. See {@link ColumnRole}. */\n roles: readonly ColumnRole<R>[];\n /**\n * The table read through the current mapping, on every change: the text, the header\n * checkbox, a role. `null` while there is no table at all (an empty box). Use it when\n * `result.complete`; until then `result.missing` says what is not placed yet.\n *\n * The rows are strings. A numeric role's cells are guaranteed to read with\n * `tableNumber(cell, result.decimalComma)`; anything else is the caller's to convert.\n */\n onChange: (result: ColumnMapperResult<R> | null) => void;\n /** The paste box's label. Default: `labels.paste`. */\n label?: ReactNode;\n /** The caption under the paste box. Default: `labels.pasteHint`. */\n hint?: ReactNode;\n /** What the file dialog offers, and what a drop is checked against. Default:\n * `.csv,.tsv,.txt,.dat,.asc`. */\n accept?: string;\n /** The largest file taken, in bytes. Default: no limit. */\n maxSize?: number;\n /** Text to start with. `onChange` is called with its result once, on mount. */\n defaultText?: string;\n /** Rows in the preview. Default 5. */\n previewRows?: number;\n /** The first mapping for a new table. Default {@link guessMapping}: a column named\n * like a role gets it, and the required roles left over take the free columns in\n * order. */\n guess?: (table: TextTable) => ColumnMapping<R>;\n disabled?: boolean;\n /** The preview table's `<tbody>` attributes — {@link ColumnRoleTableProps.bodyProps}\n * (0.24): `{ \"data-private\": \"\" }` for a table of someone's own data. */\n bodyProps?: ColumnRoleTableBodyProps;\n /** One preview row's `<tr>` attributes — {@link ColumnRoleTableProps.rowProps}\n * (0.24). `row` is the row as read, `index` its place in the preview. */\n rowProps?: (row: readonly string[], index: number) => ColumnRoleTableRowProps | undefined;\n labels?: Partial<ColumnMapperLabels>;\n className?: string;\n}\n\ninterface MapperState<R extends string> {\n text: string;\n /** The reader's answer to \"does the first line name the columns\", or `null` for\n * the parse's own. */\n header: boolean | null;\n table: TextTable;\n mapping: ColumnMapping<R>;\n}\n\nconst hasFiles = (event: DragEvent) =>\n Array.from(event.dataTransfer?.types ?? []).includes(\"Files\");\n\n/**\n * Paste, drop or choose a table, see what it was read as, and say which column is\n * which — Kurvenschmiede's playground signal and comparison input as one kit part.\n *\n * Everything the parse assumed is stated, because a guess the reader cannot see is a\n * guess they cannot correct: the shape it found, the separator, the decimal\n * convention (\"decimal comma (1,5)\"), and every line it could not read, by number and\n * with its text. The header line is a checkbox, since the detection is a guess either\n * way and toggling it does not move a column (the mapping is kept, keksdose's\n * `keepRoles`). A new file is a new table and is mapped afresh; typing that changes the\n * column count re-guesses, because the old indexes point at nothing.\n *\n * A file can be chosen, dropped on the button, or dropped on the paste box — which,\n * left to the browser, would open the file in place of the page. It is read as UTF-8,\n * or as Windows-1252 when it is not UTF-8 ({@link readTextFile}).\n *\n * A two-step wizard that keeps the drop and the mapping apart (keksdose's) uses the\n * parts: {@link parseTextTable} or its own server's sniff, then {@link ColumnRoleTable},\n * then {@link readMappedTable}.\n */\nexport function ColumnMapper<R extends string>({\n roles,\n onChange,\n label,\n hint,\n accept = DEFAULT_ACCEPT,\n maxSize,\n defaultText = \"\",\n previewRows = 5,\n guess,\n disabled = false,\n bodyProps,\n rowProps,\n labels: labelsProp,\n className,\n}: ColumnMapperProps<R>) {\n const labels: ColumnMapperLabels = useKitLabels(\n \"columnMapper\",\n DEFAULT_COLUMN_MAPPER_LABELS,\n labelsProp,\n );\n const firstMapping = (table: TextTable) =>\n guess ? guess(table) : guessMapping(roles, table.header, table.width);\n const [state, setState] = useState<MapperState<R>>(() => {\n const table = parseTextTable(defaultText);\n return {\n text: defaultText,\n header: null,\n table,\n mapping: firstMapping(table),\n };\n });\n const [reading, setReading] = useState(false);\n const [refusal, setRefusal] = useState<string | null>(null);\n const [dragOver, setDragOver] = useState(false);\n\n // What is drawn and what is handed over are the same computation. Not memoised: a\n // caller writes `roles={[…]}` inline, so a memo keyed on them would miss every time,\n // and the read is one pass over rows that are already split.\n const result = readMappedTable(state.table, roles, state.mapping);\n\n const commit = (next: MapperState<R>) => {\n setState(next);\n onChange(\n next.table.width === 0\n ? null\n : readMappedTable(next.table, roles, next.mapping),\n );\n };\n\n /** New text. `fresh` (a file): the reader's header answer and the mapping start over. */\n const take = (text: string, fresh: boolean) => {\n const header = fresh ? null : state.header;\n const table = parseTextTable(text, header === null ? {} : { header });\n const keep =\n !fresh && table.width === state.table.width && state.table.width > 0;\n commit({\n text,\n header,\n table,\n mapping: keep ? state.mapping : firstMapping(table),\n });\n };\n\n const load = (file: File) => {\n setRefusal(null);\n setReading(true);\n void readTextFile(file)\n .then(\n (text) => take(text, true),\n // Only the read: an error thrown by the caller's onChange is not the file's.\n () => setRefusal(labels.readError(file.name)),\n )\n .finally(() => setReading(false));\n };\n\n const refuse = (rejections: { message: string }[]) =>\n setRefusal(rejections[0]?.message ?? null);\n\n // A file dropped on the paste box. The same screening as the button's.\n const drop = useFilePicker({\n accept,\n maxSize,\n disabled,\n onFiles: ([file]) => load(file),\n onReject: refuse,\n });\n\n const seeded = useEffectEvent(() => {\n if (state.table.width > 0) onChange(result);\n });\n useEffect(() => {\n seeded();\n }, []);\n\n const { table } = state;\n const separator = labels[SEPARATOR_LABEL[table.separator]];\n const unread = result.unread;\n\n return (\n <div\n className={cn(\"min-w-0 space-y-3\", className)}\n data-slot=\"column-mapper\"\n >\n <Textarea\n label={label ?? labels.paste}\n hint={hint ?? labels.pasteHint}\n rows={5}\n wrap=\"off\"\n spellCheck={false}\n autoCapitalize=\"off\"\n autoCorrect=\"off\"\n value={state.text}\n disabled={disabled}\n className={cn(\n \"font-mono text-xs\",\n dragOver && \"rounded-md ring-2 ring-[var(--brand)]\",\n )}\n data-drag-over={dragOver || undefined}\n onChange={(event: ChangeEvent<HTMLTextAreaElement>) => {\n setRefusal(null);\n take(event.target.value, false);\n }}\n onDragEnter={(event) => {\n if (!hasFiles(event)) return;\n event.preventDefault();\n if (!disabled) setDragOver(true);\n }}\n onDragOver={(event) => {\n if (!hasFiles(event)) return;\n // Cancelled for every file drag: an uncancelled one makes the browser open\n // the file in place of the page.\n event.preventDefault();\n event.dataTransfer.dropEffect = disabled ? \"none\" : \"copy\";\n }}\n onDragLeave={() => setDragOver(false)}\n onDrop={(event) => {\n if (!hasFiles(event)) return;\n event.preventDefault();\n setDragOver(false);\n drop.take(event.dataTransfer.files);\n }}\n />\n {drop.element}\n\n <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2\">\n <FileButton\n variant=\"secondary\"\n accept={accept}\n maxSize={maxSize}\n droppable\n pending={reading}\n disabled={disabled}\n onFiles={([file]) => load(file)}\n onReject={refuse}\n >\n <Upload className=\"size-4\" aria-hidden />\n {labels.chooseFile}\n </FileButton>\n {table.width > 0 && (\n <Checkbox\n label={labels.headerRow}\n checked={table.header !== null}\n disabled={disabled}\n onCheckedChange={(checked) => {\n const next = parseTextTable(state.text, { header: checked });\n // Same text, same split: the columns are where they were, and so are the\n // roles on them.\n commit({ ...state, header: checked, table: next });\n }}\n />\n )}\n </div>\n\n {refusal && (\n <AlertBanner tone=\"danger\" variant=\"inline\" size=\"sm\" block>\n {refusal}\n </AlertBanner>\n )}\n\n {table.width > 0 && (\n <>\n <p\n className=\"text-xs text-[var(--text-secondary)]\"\n data-slot=\"column-mapper-summary\"\n >\n {[\n labels.summary(table.width, result.rows.length),\n separator,\n table.decimalComma ? labels.decimalComma : labels.decimalPoint,\n ].join(\" · \")}\n </p>\n {result.rows.length === 0 && (\n <AlertBanner tone=\"warning\" variant=\"inline\" size=\"sm\" block>\n {labels.noRows}\n </AlertBanner>\n )}\n <ColumnRoleTable\n header={table.header}\n rows={result.rows}\n width={table.width}\n roles={roles}\n mapping={state.mapping}\n onMappingChange={(mapping) => commit({ ...state, mapping })}\n previewRows={previewRows}\n disabled={disabled}\n bodyProps={bodyProps}\n rowProps={rowProps}\n labels={labelsProp}\n />\n {unread.length > 0 && (\n <Disclosure\n variant=\"bare\"\n title={labels.unreadCount(unread.length)}\n data-slot=\"column-mapper-unread\"\n >\n <ul className=\"space-y-1 text-xs\">\n {unread.slice(0, UNREAD_LISTED).map((line) => (\n <li key={line.line} className=\"min-w-0\">\n <span className=\"block text-[var(--text-secondary)]\">\n {labels.unreadLine(line.line)}\n </span>\n <code className=\"block truncate font-mono text-[var(--text-muted)]\">\n {line.text}\n </code>\n </li>\n ))}\n {unread.length > UNREAD_LISTED && (\n <li className=\"text-[var(--text-muted)]\">\n {labels.unreadMore(unread.length - UNREAD_LISTED)}\n </li>\n )}\n </ul>\n </Disclosure>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAiXkB,SA2VV,UA3VU,KAGA,YAHA;AAqDN;AAtaZ,SAAS,WAAW,gBAAgB,gBAAgB;AAEpD,SAAS,cAAc;AAEvB,SAAS,cAAc,oBAAoB;AAC3C,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAS,sBAAsB;AAE/B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,YAAY,qBAAqB;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,QAAQ,gBAAgB;AA0FjC,MAAM,cAAc,CAAC,SAAiB,GAAG,IAAI;AAEtC,MAAM,+BAAmD;AAAA,EAC9D,OAAO;AAAA,EACP,WACE;AAAA,EACF,YAAY;AAAA,EACZ,WAAW,CAAC,SAAS,SAAI,IAAI;AAAA,EAC7B,WAAW;AAAA,EACX,SAAS,CAAC,SAAS,SACjB,GAAG,OAAO,IA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CAAC,SACnC,qBAAC,QAAmB,WAAU,WAC5B;AAAA,sCAAC,UAAK,WAAU,sCACb,iBAAO,WAAW,KAAK,IAAI,GAC9B;AAAA,kBACA,oBAAC,UAAK,WAAU,qDACb,eAAK,MACR;AAAA,qBANO,KAAK,IAOd,CACD;AAAA,gBACA,OAAO,SAAS,iBACf,oBAAC,QAAG,WAAU,4BACX,iBAAO,WAAW,OAAO,SAAS,aAAa,GAClD;AAAA,iBAEJ;AAAA;AAAA,UACF;AAAA,WAEJ;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["table"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { J as ConfirmDialogLabels, K as ConfirmFn, L as ConfirmOptions, M as ConfirmProvider, N as ConfirmProviderProps, O as ConfirmTone, a0 as DEFAULT_CONFIRM_DIALOG_LABELS, cQ as useConfirm } from '../feedback-
|
|
2
|
+
export { J as ConfirmDialogLabels, K as ConfirmFn, L as ConfirmOptions, M as ConfirmProvider, N as ConfirmProviderProps, O as ConfirmTone, a0 as DEFAULT_CONFIRM_DIALOG_LABELS, cQ as useConfirm } from '../feedback-BXKH-ToU.js';
|
|
3
3
|
import './tooltip.js';
|
|
4
4
|
import '../hooks/use-anchored-rect.js';
|
|
5
5
|
import '../lib/clipping.js';
|
|
6
|
-
import '../data-table-labels-
|
|
6
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
7
7
|
import './data-table-sort.js';
|
|
8
8
|
import './swipeable-row.js';
|
|
9
9
|
import './mini-calendar.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { P as CopyButton, Q as CopyButtonLabels, R as CopyButtonProps, a1 as DEFAULT_COPY_BUTTON_LABELS } from '../feedback-
|
|
2
|
+
export { P as CopyButton, Q as CopyButtonLabels, R as CopyButtonProps, a1 as DEFAULT_COPY_BUTTON_LABELS } from '../feedback-BXKH-ToU.js';
|
|
3
3
|
import './tooltip.js';
|
|
4
|
-
import '../data-table-labels-
|
|
4
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
5
5
|
import './data-table-sort.js';
|
|
6
6
|
import './swipeable-row.js';
|
|
7
7
|
import './mini-calendar.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import 'react';
|
|
2
|
-
export { T as CurrentPasswordInput, U as CurrentPasswordInputLabels, V as CurrentPasswordInputProps, a3 as DEFAULT_DANGER_CONFIRM_LABELS, an as DangerConfirm, ao as DangerConfirmLabels, ap as DangerConfirmProps, aq as DangerConfirmValues, ar as DangerConsequence, cw as TypedConfirmField, cx as TypedConfirmFieldLabels, cy as TypedConfirmFieldProps, cz as TypedMatch, cP as typedMatches, d0 as usePromisePending } from '../feedback-
|
|
2
|
+
export { T as CurrentPasswordInput, U as CurrentPasswordInputLabels, V as CurrentPasswordInputProps, a3 as DEFAULT_DANGER_CONFIRM_LABELS, an as DangerConfirm, ao as DangerConfirmLabels, ap as DangerConfirmProps, aq as DangerConfirmValues, ar as DangerConsequence, cw as TypedConfirmField, cx as TypedConfirmFieldLabels, cy as TypedConfirmFieldProps, cz as TypedMatch, cP as typedMatches, d0 as usePromisePending } from '../feedback-BXKH-ToU.js';
|
|
3
3
|
import './tooltip.js';
|
|
4
4
|
import '../hooks/use-anchored-rect.js';
|
|
5
5
|
import '../lib/clipping.js';
|
|
6
|
-
import '../data-table-labels-
|
|
6
|
+
import '../data-table-labels-Cdn1QS2k.js';
|
|
7
7
|
import './data-table-sort.js';
|
|
8
8
|
import './swipeable-row.js';
|
|
9
9
|
import './mini-calendar.js';
|