@micha.bigler/ui-core-micha 4.8.0 → 4.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.8.1 - UCM-RCPT-2
4
+
5
+ `ReceiptReviewDialog` matches its prototype again. Each recognised field is one row with the columns label, value and action and a divider between rows (the label above the value on phones); the "uncertain" chip is a soft warning tint beside the action (under the value on phones); the sheet on phones is as high as its content up to the available height, with full-width actions stacked as "Alle uebernehmen", "Nur leere Felder", "Schliessen"; the wide dialog is 640 px wide with a 640 px maximum height; the currency is shown with the amount (a receipt that has a currency but no amount keeps a currency row) and applying the amount hands over amount and currency; the date has a four-digit year in the active language (the picker follows). The review no longer prints line items of the form through string conversion: both the recognised and the current items are lists, blank rows count as empty. "Only empty fields" never overwrites a filled currency. Props and the `onApply` contract are unchanged.
6
+
3
7
  ## 4.8.0 - UCM-BILL-2
4
8
 
5
9
  Operator surfaces for billing and a fuller "Abo" section, against the `django-core-micha` operator endpoints
@@ -1,39 +1,164 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
+ import { alpha } from '@mui/material/styles';
3
4
  import { Box, Button, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Drawer, Stack, Typography, useMediaQuery } from '@mui/material';
4
5
  import { useTheme } from '@mui/material/styles';
5
6
  import { useTranslation } from 'react-i18next';
6
- import { formatReceiptAmount, formatReceiptDate, isEmptyValue, receiptValueEqual } from './format';
7
- export const RECEIPT_REVIEW_ACTIONS_SX = { gap: 1, flexWrap: 'wrap', flexDirection: { xs: 'column', sm: 'row' }, '& > :nth-of-type(1)': { order: { xs: 3, sm: 0 } }, '& > :nth-of-type(2)': { order: { xs: 2, sm: 0 } }, '& > :nth-of-type(3)': { order: { xs: 1, sm: 0 } } };
8
- export const RECEIPT_REVIEW_ROW_SX = { display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) auto', columnGap: 1, alignItems: 'start' };
9
- export const RECEIPT_REVIEW_SHEET_PAPER_SX = { height: '92%' };
10
- export const RECEIPT_REVIEW_ACTION_BUTTON_SX = { flex: '1 1 auto' };
7
+ import { formatReceiptAmount, formatReceiptDate, isEmptyValue, normaliseItems, receiptValueEqual } from './format';
8
+ // The gap spaces the buttons; MUI's own left margin between DialogActions children would shift the stacked buttons.
9
+ export const RECEIPT_REVIEW_ACTIONS_SX = { gap: 1, flexWrap: { xs: 'nowrap', sm: 'wrap' }, flexDirection: { xs: 'column', sm: 'row' }, alignItems: { xs: 'stretch', sm: 'center' }, '& > :not(style):not(:first-of-type)': { marginLeft: 0 } };
10
+ export const RECEIPT_REVIEW_ROW_SX = {
11
+ display: 'grid',
12
+ gridTemplateColumns: { xs: 'minmax(0, 1fr) auto', sm: '120px minmax(0, 1fr) auto' },
13
+ columnGap: 1.25,
14
+ alignItems: 'center',
15
+ py: 1.125,
16
+ borderBottom: '1px solid',
17
+ borderColor: 'divider',
18
+ '&:last-of-type': { borderBottom: 0 },
19
+ '& > :first-child': { gridColumn: { xs: '1 / -1', sm: 'auto' } },
20
+ };
21
+ // The prototype's dialog is 640 px wide; on narrower windows it keeps the usual margin.
22
+ export const RECEIPT_REVIEW_DIALOG_PAPER_SX = { width: 640, maxWidth: 'calc(100% - 64px)', maxHeight: 'min(640px, calc(100% - 64px))' };
23
+ export const RECEIPT_REVIEW_SHEET_PAPER_SX = (theme) => ({
24
+ height: 'auto',
25
+ maxHeight: 'calc(100% - 56px)',
26
+ display: 'flex',
27
+ flexDirection: 'column',
28
+ borderTopLeftRadius: theme.shape.borderRadius * 2,
29
+ borderTopRightRadius: theme.shape.borderRadius * 2,
30
+ });
31
+ export const RECEIPT_REVIEW_ACTION_BUTTON_SX = { flex: { xs: '1 1 100%', sm: '0 0 auto' }, width: { xs: '100%', sm: 'auto' } };
32
+ export const RECEIPT_REVIEW_CHIP_SX = {
33
+ alignSelf: 'flex-start',
34
+ fontWeight: 700,
35
+ backgroundColor: (theme) => alpha(theme.palette.warning.main, 0.12),
36
+ color: 'warning.dark',
37
+ };
38
+ export const RECEIPT_REVIEW_ROW_ACTION_SX = { justifySelf: 'end', alignSelf: 'center' };
39
+ const normaliseScalar = (value) => (typeof value === 'string' || typeof value === 'number' ? String(value).trim() : '');
40
+ const isItemsEmpty = (value) => normaliseItems(value).length === 0;
41
+ const isRowEmpty = (row, values) => row.key === 'items'
42
+ ? isItemsEmpty(values.items)
43
+ : row.key === 'total'
44
+ ? isEmptyValue(values.total)
45
+ : isEmptyValue(values[row.key]);
46
+ function rowApplyValues(row, receipt, values) {
47
+ if (row.key === 'total') {
48
+ const result = { total: row.value };
49
+ if (receipt === null || receipt === void 0 ? void 0 : receipt.currency)
50
+ result.currency = receipt.currency;
51
+ return result;
52
+ }
53
+ return { [row.key]: row.value };
54
+ }
55
+ function emptyApplyRows(rows, receipt, values) {
56
+ const result = {};
57
+ rows.forEach((row) => {
58
+ if (!isRowEmpty(row, values))
59
+ return;
60
+ const handed = rowApplyValues(row, receipt, values);
61
+ // "Only empty fields" never overwrites a filled currency that sits next to an empty amount.
62
+ if (row.key === 'total' && !isEmptyValue(values.currency))
63
+ delete handed.currency;
64
+ Object.assign(result, handed);
65
+ });
66
+ const hasTotalRow = rows.some((row) => row.key === 'total');
67
+ if (hasTotalRow && !isEmptyValue(values.total) && isEmptyValue(values.currency) && (receipt === null || receipt === void 0 ? void 0 : receipt.currency)) {
68
+ result.currency = receipt.currency;
69
+ }
70
+ return result;
71
+ }
72
+ function rowEqual(row, receipt, values) {
73
+ if (row.key === 'items')
74
+ return !isItemsEmpty(values.items) && receiptValueEqual('items', values.items, row.value);
75
+ if (row.key === 'total') {
76
+ const amountMatches = !isEmptyValue(values.total) && receiptValueEqual('total', values.total, row.value);
77
+ if (!amountMatches)
78
+ return false;
79
+ if (!(receipt === null || receipt === void 0 ? void 0 : receipt.currency))
80
+ return true;
81
+ return typeof values.currency === 'string'
82
+ && values.currency.trim().toLowerCase() === receipt.currency.trim().toLowerCase();
83
+ }
84
+ return !isEmptyValue(values[row.key]) && receiptValueEqual(row.key, values[row.key], row.value);
85
+ }
86
+ function ItemLines({ items, struckThrough = false }) {
87
+ const rows = normaliseItems(items);
88
+ if (!rows.length)
89
+ return null;
90
+ return (_jsx(Box, { component: "ul", sx: { display: 'grid', gap: 0.25, m: 0, p: 0, listStyle: 'none', textDecoration: struckThrough ? 'line-through' : 'none' }, children: rows.map((item, index) => (_jsxs(Box, { component: "li", sx: { display: 'flex', justifyContent: 'space-between', gap: 1 }, children: [_jsx(Typography, { component: "span", variant: "body2", sx: { color: struckThrough ? 'text.disabled' : 'text.secondary' }, children: item.description }), item.amount && _jsx(Typography, { component: "span", variant: "body2", sx: { flexShrink: 0, color: struckThrough ? 'text.disabled' : 'text.secondary', fontVariantNumeric: 'tabular-nums' }, children: item.amount })] }, `${item.description}-${item.amount}-${index}`))) }));
91
+ }
11
92
  export function ReceiptReviewDialog({ open, receipt, values = {}, fieldLabels = {}, extraFields = [], accountLabel = (id) => id, onApply, onClose }) {
12
93
  var _a;
13
94
  const { t, i18n } = useTranslation();
14
95
  const theme = useTheme();
15
96
  const mobile = useMediaQuery(theme.breakpoints.down('sm'));
16
97
  const rows = [];
17
- const add = (key, value, recognized = value !== '' && value != null, format = (v) => String(v)) => { if (recognized)
18
- rows.push({ key, value, text: format(value), confidence: receipt === null || receipt === void 0 ? void 0 : receipt.confidence }); };
98
+ const add = (key, value, recognized = value !== '' && value != null, format = (v) => normaliseScalar(v)) => {
99
+ if (recognized) {
100
+ const formatted = format(value);
101
+ rows.push({ key, value, text: formatted !== null && formatted !== void 0 ? formatted : '', confidence: receipt === null || receipt === void 0 ? void 0 : receipt.confidence });
102
+ }
103
+ };
19
104
  add('merchant', receipt === null || receipt === void 0 ? void 0 : receipt.merchant);
20
- add('date', receipt === null || receipt === void 0 ? void 0 : receipt.date, Boolean(receipt === null || receipt === void 0 ? void 0 : receipt.date), (v) => formatReceiptDate(v, i18n.language));
21
- add('total', receipt === null || receipt === void 0 ? void 0 : receipt.total, Boolean(receipt === null || receipt === void 0 ? void 0 : receipt.total), (v) => formatReceiptAmount(v, receipt === null || receipt === void 0 ? void 0 : receipt.currency, i18n.language));
22
- add('currency', receipt === null || receipt === void 0 ? void 0 : receipt.currency);
23
- if ((receipt === null || receipt === void 0 ? void 0 : receipt.payment_method) && receipt.payment_method !== 'unknown')
24
- add('payment_method', receipt.payment_method, true, (v) => t(`Receipts.PAYMENT_${v}`));
25
- const account = (_a = receipt === null || receipt === void 0 ? void 0 : receipt.account_suggestions) === null || _a === void 0 ? void 0 : _a.find((s) => s === null || s === void 0 ? void 0 : s.account_id);
105
+ add('date', receipt === null || receipt === void 0 ? void 0 : receipt.date, Boolean(receipt === null || receipt === void 0 ? void 0 : receipt.date), (value) => formatReceiptDate(value, i18n.language));
106
+ add('total', receipt === null || receipt === void 0 ? void 0 : receipt.total, Boolean(receipt === null || receipt === void 0 ? void 0 : receipt.total), (value) => formatReceiptAmount(value, receipt === null || receipt === void 0 ? void 0 : receipt.currency, i18n.language));
107
+ // A receipt with a currency but no amount keeps its own currency row, so the currency can still be shown and applied.
108
+ if ((receipt === null || receipt === void 0 ? void 0 : receipt.currency) && !(receipt === null || receipt === void 0 ? void 0 : receipt.total))
109
+ add('currency', receipt.currency);
110
+ if ((receipt === null || receipt === void 0 ? void 0 : receipt.payment_method) && receipt.payment_method !== 'unknown') {
111
+ add('payment_method', receipt.payment_method, true, (value) => t(`Receipts.PAYMENT_${value}`));
112
+ }
113
+ const account = (_a = receipt === null || receipt === void 0 ? void 0 : receipt.account_suggestions) === null || _a === void 0 ? void 0 : _a.find((suggestion) => suggestion === null || suggestion === void 0 ? void 0 : suggestion.account_id);
26
114
  if (account)
27
115
  rows.push({ key: 'account', value: account.account_id, text: accountLabel(account.account_id), confidence: account.confidence === 'low' ? 'low' : receipt === null || receipt === void 0 ? void 0 : receipt.confidence });
28
- if (Array.isArray(receipt === null || receipt === void 0 ? void 0 : receipt.items) && receipt.items.length)
29
- rows.push({ key: 'items', value: receipt.items, text: receipt.items.map((item) => `${item.description || ''}${item.amount ? ` · ${item.amount}` : ''}`).join('\n'), confidence: receipt === null || receipt === void 0 ? void 0 : receipt.confidence });
30
- (extraFields || []).forEach(({ key, format }) => { if (!['merchant', 'date', 'total', 'currency', 'payment_method', 'account', 'items'].includes(key) && (receipt === null || receipt === void 0 ? void 0 : receipt[key]) != null && receipt[key] !== '')
31
- add(key, receipt[key], true, format || ((v) => typeof v === 'string' ? v : JSON.stringify(v))); });
116
+ if (normaliseItems(receipt === null || receipt === void 0 ? void 0 : receipt.items).length) {
117
+ rows.push({ key: 'items', value: receipt.items, text: '', confidence: receipt === null || receipt === void 0 ? void 0 : receipt.confidence });
118
+ }
119
+ (extraFields || []).forEach(({ key, format }) => {
120
+ if (['merchant', 'date', 'total', 'currency', 'payment_method', 'account', 'items'].includes(key))
121
+ return;
122
+ const value = receipt === null || receipt === void 0 ? void 0 : receipt[key];
123
+ if (value == null || value === '')
124
+ return;
125
+ add(key, value, true, format || ((item) => (typeof item === 'string' || typeof item === 'number' ? String(item).trim() : JSON.stringify(item))));
126
+ });
32
127
  const label = (key) => { var _a; return fieldLabels[key] || ((_a = extraFields.find((field) => field.key === key)) === null || _a === void 0 ? void 0 : _a.label) || t(`Receipts.FIELD_${key}`); };
33
- const apply = (list, mode, close) => { if (!list.length)
34
- return; onApply === null || onApply === void 0 ? void 0 : onApply(Object.fromEntries(list.map((r) => [r.key, r.value])), { mode }); if (close)
35
- onClose === null || onClose === void 0 ? void 0 : onClose(); };
36
- const content = _jsxs(_Fragment, { children: [_jsx(DialogTitle, { id: "receipt-review-title", children: t('Receipts.REVIEW_TITLE') }), _jsx(DialogContent, { children: _jsx(Stack, { spacing: 2, children: rows.map((row) => { const current = values[row.key]; const equal = !isEmptyValue(current) && receiptValueEqual(row.key, current, row.value); return _jsxs(Box, { sx: RECEIPT_REVIEW_ROW_SX, children: [_jsxs(Box, { sx: { minWidth: 0 }, children: [_jsx(Typography, { variant: "subtitle2", children: label(row.key) }), _jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", children: [row.key === 'items' ? _jsx(Box, { component: "ul", sx: { m: 0, pl: 2 }, children: row.value.map((item, index) => _jsx("li", { children: _jsx(Typography, { component: "span", children: `${item.description || ''}${item.amount ? ` · ${item.amount}` : ''}` }) }, index)) }) : _jsx(Typography, { children: row.text }), row.confidence === 'low' && _jsx(Chip, { size: "small", color: "warning", label: t('Receipts.UNCERTAIN') }), equal ? _jsx(Typography, { variant: "caption", children: t('Receipts.SAME_AS_FORM') }) : !isEmptyValue(current) && _jsx(Typography, { variant: "body2", sx: { textDecoration: 'line-through' }, children: String(current) })] })] }), !equal && _jsx(Button, { size: "small", onClick: () => apply([row], 'field', false), children: t('Receipts.APPLY') })] }, row.key); }) }) }), _jsxs(DialogActions, { sx: RECEIPT_REVIEW_ACTIONS_SX, children: [_jsx(Button, { sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, onClick: onClose, children: t('Receipts.CLOSE') }), _jsx(Button, { variant: "outlined", sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, disabled: !rows.some((r) => isEmptyValue(values[r.key])), onClick: () => apply(rows.filter((r) => isEmptyValue(values[r.key])), 'empty', true), children: t('Receipts.ONLY_EMPTY') }), _jsx(Button, { variant: "contained", sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, disabled: !rows.length, onClick: () => apply(rows, 'all', true), children: t('Receipts.APPLY_ALL') })] })] });
37
- return mobile ? _jsx(Drawer, { anchor: "bottom", open: open, onClose: onClose, PaperProps: { sx: RECEIPT_REVIEW_SHEET_PAPER_SX, role: 'dialog', 'aria-labelledby': 'receipt-review-title' }, children: content }) : _jsx(Dialog, { open: open, onClose: onClose, maxWidth: "sm", fullWidth: true, "aria-labelledby": "receipt-review-title", children: content });
128
+ const apply = (list, mode, close) => {
129
+ if (!list.length)
130
+ return;
131
+ const payload = mode === 'empty'
132
+ ? emptyApplyRows(list, receipt, values)
133
+ : Object.assign({}, ...list.map((row) => rowApplyValues(row, receipt, values)));
134
+ if (Object.keys(payload).length)
135
+ onApply === null || onApply === void 0 ? void 0 : onApply(payload, { mode });
136
+ if (close)
137
+ onClose === null || onClose === void 0 ? void 0 : onClose();
138
+ };
139
+ const rowElements = rows.map((row, index) => {
140
+ const equal = rowEqual(row, receipt, values);
141
+ const currentItems = row.key === 'items' ? normaliseItems(values.items) : [];
142
+ const displayCurrent = row.key === 'items'
143
+ ? currentItems.length > 0
144
+ : typeof values[row.key] === 'string' || typeof values[row.key] === 'number';
145
+ const uncertain = row.confidence === 'low';
146
+ const showCurrent = !equal && !isRowEmpty(row, values) && displayCurrent;
147
+ return (_jsxs(Box, { "data-receipt-review-row": row.key, sx: RECEIPT_REVIEW_ROW_SX, children: [_jsx(Typography, { variant: "caption", color: "text.secondary", children: label(row.key) }), _jsxs(Stack, { spacing: 0.25, sx: { minWidth: 0 }, children: [row.key === 'items'
148
+ ? _jsx(ItemLines, { items: row.value })
149
+ : _jsx(Typography, { sx: { fontWeight: 600, fontVariantNumeric: row.key === 'total' ? 'tabular-nums' : undefined }, children: row.text }), equal && _jsx(Typography, { variant: "caption", color: "text.disabled", children: t('Receipts.SAME_AS_FORM') }), showCurrent && (row.key === 'items'
150
+ ? _jsx(ItemLines, { items: values.items, struckThrough: true })
151
+ : _jsx(Typography, { variant: "body2", color: "text.disabled", sx: { textDecoration: 'line-through' }, children: row.key === 'total' && values.currency ? formatReceiptAmount(normaliseScalar(values.total), values.currency, i18n.language) : normaliseScalar(values[row.key]) })), mobile && uncertain && _jsx(Chip, { size: "small", sx: RECEIPT_REVIEW_CHIP_SX, label: t('Receipts.UNCERTAIN') })] }), (!equal || (!mobile && uncertain)) && (_jsxs(Stack, { direction: "row", spacing: 0.75, alignItems: "center", sx: RECEIPT_REVIEW_ROW_ACTION_SX, children: [!mobile && uncertain && _jsx(Chip, { size: "small", sx: RECEIPT_REVIEW_CHIP_SX, label: t('Receipts.UNCERTAIN') }), !equal && (_jsx(Button, { size: "small", onClick: () => onApply === null || onApply === void 0 ? void 0 : onApply(rowApplyValues(row, receipt, values), { mode: 'field' }), children: t('Receipts.APPLY') }))] }))] }, row.key));
152
+ });
153
+ const closeButton = _jsx(Button, { fullWidth: mobile, sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, onClick: onClose, children: t('Receipts.CLOSE') }, "close");
154
+ const hasEmptyValue = rows.some((row) => isRowEmpty(row, values));
155
+ const hasEmptyCurrency = rows.some((row) => row.key === 'total') && !isEmptyValue(values.total) && isEmptyValue(values.currency) && (receipt === null || receipt === void 0 ? void 0 : receipt.currency);
156
+ const emptyButton = _jsx(Button, { fullWidth: mobile, variant: "outlined", sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, disabled: !hasEmptyValue && !hasEmptyCurrency, onClick: () => apply(rows, 'empty', true), children: t('Receipts.ONLY_EMPTY') }, "empty");
157
+ const allButton = _jsx(Button, { fullWidth: mobile, variant: "contained", sx: RECEIPT_REVIEW_ACTION_BUTTON_SX, disabled: !rows.length, onClick: () => apply(rows, 'all', true), children: t('Receipts.APPLY_ALL') }, "all");
158
+ const actions = mobile ? [allButton, emptyButton, closeButton] : [closeButton, emptyButton, allButton];
159
+ const content = _jsxs(_Fragment, { children: [_jsx(DialogTitle, { id: "receipt-review-title", children: t('Receipts.REVIEW_TITLE') }), _jsx(DialogContent, { sx: { overflowY: mobile ? 'auto' : undefined, flex: mobile ? '1 1 auto' : undefined }, children: _jsx(Box, { children: rowElements }) }), _jsx(DialogActions, { sx: RECEIPT_REVIEW_ACTIONS_SX, children: actions })] });
160
+ return mobile
161
+ ? _jsx(Drawer, { anchor: "bottom", open: open, onClose: onClose, PaperProps: { sx: RECEIPT_REVIEW_SHEET_PAPER_SX, role: 'dialog', 'aria-labelledby': 'receipt-review-title' }, children: content })
162
+ : _jsx(Dialog, { open: open, onClose: onClose, maxWidth: false, PaperProps: { sx: RECEIPT_REVIEW_DIALOG_PAPER_SX }, "aria-labelledby": "receipt-review-title", children: content });
38
163
  }
39
164
  export default ReceiptReviewDialog;
@@ -30,12 +30,29 @@ export function formatReceiptDate(iso, language) {
30
30
  const date = new Date(`${iso}T00:00:00Z`);
31
31
  if (!Number.isFinite(date.getTime()) || date.toISOString().slice(0, 10) !== iso)
32
32
  return iso;
33
- return new Intl.DateTimeFormat(intlLocale(language), { dateStyle: 'short', timeZone: 'UTC' }).format(date);
33
+ return new Intl.DateTimeFormat(intlLocale(language), { day: '2-digit', month: '2-digit', year: 'numeric', timeZone: 'UTC' }).format(date);
34
34
  }
35
35
  export function isEmptyValue(value) { return value === '' || value === null || value === undefined || (Array.isArray(value) && value.length === 0); }
36
+ export function normaliseItems(value) {
37
+ if (!Array.isArray(value))
38
+ return [];
39
+ return value.map((item) => {
40
+ if (typeof item === 'string')
41
+ return { description: item.trim(), amount: '' };
42
+ if (item === null || typeof item !== 'object' || Array.isArray(item))
43
+ return { description: '', amount: '' };
44
+ return { description: normaliseItemPart(item.description), amount: normaliseItemPart(item.amount) };
45
+ }).filter((item) => item.description || item.amount);
46
+ }
47
+ function normaliseItemPart(value) {
48
+ return typeof value === 'string' || typeof value === 'number' ? String(value).trim() : '';
49
+ }
36
50
  export function receiptValueEqual(key, a, b) {
37
- if (key === 'items')
38
- return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => ['description', 'amount'].every((k) => { var _a; var _b, _c; return String((_b = item === null || item === void 0 ? void 0 : item[k]) !== null && _b !== void 0 ? _b : '').trim().toLowerCase() === String((_c = (_a = b[i]) === null || _a === void 0 ? void 0 : _a[k]) !== null && _c !== void 0 ? _c : '').trim().toLowerCase(); }));
51
+ if (key === 'items') {
52
+ const first = normaliseItems(a);
53
+ const second = normaliseItems(b);
54
+ return first.length === second.length && first.every((item, index) => ['description', 'amount'].every((keyPart) => item[keyPart].toLowerCase() === second[index][keyPart].toLowerCase()));
55
+ }
39
56
  if (key === 'total' && a !== '' && b !== '' && Number.isFinite(Number(a)) && Number.isFinite(Number(b)))
40
57
  return Number(a) === Number(b);
41
58
  return String(a !== null && a !== void 0 ? a : '').trim().toLowerCase() === String(b !== null && b !== void 0 ? b : '').trim().toLowerCase();
@@ -44,7 +44,7 @@ import { OPERATOR_OVERVIEW_ALERT_SX } from '../billing/OperatorOverview';
44
44
  import { RECEIPT_CONSENT_ALERT_SX, RECEIPT_CONSENT_CONTROL_SX } from '../receipts/ReceiptConsentSwitch';
45
45
  import { RECEIPT_CAPTURE_ACTION_SX, RECEIPT_CAPTURE_ALERT_SX, RECEIPT_CAPTURE_CARD_SX, RECEIPT_CAPTURE_PROGRESS_SX } from '../receipts/ReceiptCaptureCard';
46
46
  import { RECEIPT_PICKER_ACTION_SX, RECEIPT_PICKER_CARD_SX } from '../receipts/ReceiptPicker';
47
- import { RECEIPT_REVIEW_ACTIONS_SX, RECEIPT_REVIEW_ACTION_BUTTON_SX, RECEIPT_REVIEW_SHEET_PAPER_SX } from '../receipts/ReceiptReviewDialog';
47
+ import { RECEIPT_REVIEW_ACTIONS_SX, RECEIPT_REVIEW_ACTION_BUTTON_SX, RECEIPT_REVIEW_CHIP_SX, RECEIPT_REVIEW_DIALOG_PAPER_SX, RECEIPT_REVIEW_SHEET_PAPER_SX } from '../receipts/ReceiptReviewDialog';
48
48
  const SX_EXPORTS = {
49
49
  ACCESS_CODE_ACTION_SX,
50
50
  ACCESS_ENDED_BANNER_ALERT_SX,
@@ -134,6 +134,8 @@ const SX_EXPORTS = {
134
134
  RECEIPT_PICKER_CARD_SX,
135
135
  RECEIPT_REVIEW_ACTIONS_SX,
136
136
  RECEIPT_REVIEW_ACTION_BUTTON_SX,
137
+ RECEIPT_REVIEW_CHIP_SX,
138
+ RECEIPT_REVIEW_DIALOG_PAPER_SX,
137
139
  RECEIPT_REVIEW_SHEET_PAPER_SX,
138
140
  USER_INVITE_ACTION_SX,
139
141
  USER_INVITE_ALERT_SX,
@@ -253,6 +255,8 @@ export const KIT_COMPONENT_SX_REGISTRY = [
253
255
  entry('ReceiptPicker.card', 'MuiCard', RECEIPT_PICKER_CARD_SX),
254
256
  entry('ReceiptPicker.actions', 'MuiDialogActions', RECEIPT_PICKER_ACTION_SX),
255
257
  entry('ReceiptReviewDialog.actions', 'MuiDialogActions', RECEIPT_REVIEW_ACTIONS_SX),
258
+ entry('ReceiptReviewDialog.dialogPaper', 'MuiPaper', RECEIPT_REVIEW_DIALOG_PAPER_SX),
256
259
  entry('ReceiptReviewDialog.sheetPaper', 'MuiPaper', RECEIPT_REVIEW_SHEET_PAPER_SX),
257
260
  entry('ReceiptReviewDialog.action', 'MuiButton', RECEIPT_REVIEW_ACTION_BUTTON_SX),
261
+ entry('ReceiptReviewDialog.uncertainChip', 'MuiChip', RECEIPT_REVIEW_CHIP_SX),
258
262
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micha.bigler/ui-core-micha",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "exports": {