@natoora-libs/core 0.2.11-dev-doug-2 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TableDesktop-Z0KE59L4.d.cts → TableDesktop-CZe649rr.d.cts} +5 -6
- package/dist/{TableDesktop-Z0KE59L4.d.ts → TableDesktop-CZe649rr.d.ts} +5 -6
- package/dist/components/index.cjs +49 -70
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -6
- package/dist/components/index.d.ts +5 -6
- package/dist/components/index.js +49 -70
- package/dist/components/index.js.map +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ type ExportCsvDialogProps = {
|
|
|
32
32
|
};
|
|
33
33
|
type BulkChangesDialogProps = {
|
|
34
34
|
bulkChanges: BulkChanges;
|
|
35
|
-
selectedRows:
|
|
35
|
+
selectedRows: (string | number)[];
|
|
36
36
|
shouldUpdateAll: boolean;
|
|
37
37
|
visibleEditableColumns: HeadCell[];
|
|
38
38
|
isBulkChangesDialogOpen: boolean;
|
|
@@ -43,7 +43,7 @@ type TableDesktopToolbarProps = {
|
|
|
43
43
|
toolbarLabel?: string;
|
|
44
44
|
headCells: HeadCell[];
|
|
45
45
|
headerFilters: HeaderFilters;
|
|
46
|
-
selectedRows:
|
|
46
|
+
selectedRows: (string | number)[];
|
|
47
47
|
isDataEmpty: boolean;
|
|
48
48
|
totalDataCount?: number;
|
|
49
49
|
isRowsFromAllPagesSelected: boolean;
|
|
@@ -73,12 +73,11 @@ type HeaderFilters = {
|
|
|
73
73
|
[key: string]: HeaderFilterOptions;
|
|
74
74
|
};
|
|
75
75
|
type UpdateEditableCellParams = {
|
|
76
|
-
rowId?:
|
|
76
|
+
rowId?: number;
|
|
77
77
|
columnId: string;
|
|
78
78
|
value: string | number | boolean | (string | number)[] | null;
|
|
79
79
|
label: string | number | boolean | (string | number)[] | null;
|
|
80
80
|
};
|
|
81
|
-
type RowId = string | number;
|
|
82
81
|
type HeadCell = {
|
|
83
82
|
id: string;
|
|
84
83
|
label?: string;
|
|
@@ -123,7 +122,7 @@ type TableDesktopProps = {
|
|
|
123
122
|
showClearFilterButton?: boolean;
|
|
124
123
|
handleClickOnClearFiltersButton?: () => void;
|
|
125
124
|
deleteItem?: (id: number, contentTypeName?: string, appTypeName?: string) => void;
|
|
126
|
-
keyField?: string
|
|
125
|
+
keyField?: string;
|
|
127
126
|
tableLayout?: 'fixed' | 'auto';
|
|
128
127
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
129
128
|
refetchData?: () => Promise<unknown>;
|
|
@@ -131,4 +130,4 @@ type TableDesktopProps = {
|
|
|
131
130
|
};
|
|
132
131
|
declare const TableDesktop: ({ data, headCells, RenderItem, renderToolbar, renderFooter, appliedFilters, headerFilters, children, height, rowHeight, rowsPerPage, totalDataCount, isLoading, enableEditMode, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, refetchData, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
133
132
|
|
|
134
|
-
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type
|
|
133
|
+
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
@@ -32,7 +32,7 @@ type ExportCsvDialogProps = {
|
|
|
32
32
|
};
|
|
33
33
|
type BulkChangesDialogProps = {
|
|
34
34
|
bulkChanges: BulkChanges;
|
|
35
|
-
selectedRows:
|
|
35
|
+
selectedRows: (string | number)[];
|
|
36
36
|
shouldUpdateAll: boolean;
|
|
37
37
|
visibleEditableColumns: HeadCell[];
|
|
38
38
|
isBulkChangesDialogOpen: boolean;
|
|
@@ -43,7 +43,7 @@ type TableDesktopToolbarProps = {
|
|
|
43
43
|
toolbarLabel?: string;
|
|
44
44
|
headCells: HeadCell[];
|
|
45
45
|
headerFilters: HeaderFilters;
|
|
46
|
-
selectedRows:
|
|
46
|
+
selectedRows: (string | number)[];
|
|
47
47
|
isDataEmpty: boolean;
|
|
48
48
|
totalDataCount?: number;
|
|
49
49
|
isRowsFromAllPagesSelected: boolean;
|
|
@@ -73,12 +73,11 @@ type HeaderFilters = {
|
|
|
73
73
|
[key: string]: HeaderFilterOptions;
|
|
74
74
|
};
|
|
75
75
|
type UpdateEditableCellParams = {
|
|
76
|
-
rowId?:
|
|
76
|
+
rowId?: number;
|
|
77
77
|
columnId: string;
|
|
78
78
|
value: string | number | boolean | (string | number)[] | null;
|
|
79
79
|
label: string | number | boolean | (string | number)[] | null;
|
|
80
80
|
};
|
|
81
|
-
type RowId = string | number;
|
|
82
81
|
type HeadCell = {
|
|
83
82
|
id: string;
|
|
84
83
|
label?: string;
|
|
@@ -123,7 +122,7 @@ type TableDesktopProps = {
|
|
|
123
122
|
showClearFilterButton?: boolean;
|
|
124
123
|
handleClickOnClearFiltersButton?: () => void;
|
|
125
124
|
deleteItem?: (id: number, contentTypeName?: string, appTypeName?: string) => void;
|
|
126
|
-
keyField?: string
|
|
125
|
+
keyField?: string;
|
|
127
126
|
tableLayout?: 'fixed' | 'auto';
|
|
128
127
|
onApplyFilters?: (updatedFilters: HeaderFilters, shouldSave: boolean) => void;
|
|
129
128
|
refetchData?: () => Promise<unknown>;
|
|
@@ -131,4 +130,4 @@ type TableDesktopProps = {
|
|
|
131
130
|
};
|
|
132
131
|
declare const TableDesktop: ({ data, headCells, RenderItem, renderToolbar, renderFooter, appliedFilters, headerFilters, children, height, rowHeight, rowsPerPage, totalDataCount, isLoading, enableEditMode, disableInternalSort, updateSort, showClearFilterButton, handleClickOnClearFiltersButton, deleteItem, keyField, tableLayout, onApplyFilters, shouldShowCheckOnFilter, refetchData, }: TableDesktopProps) => react_jsx_runtime.JSX.Element;
|
|
133
132
|
|
|
134
|
-
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type
|
|
133
|
+
export { type BulkChanges as B, type EditableCellType as E, type HeadCell as H, type Order as O, type TableDesktopProps as T, type UpdateEditableCellParams as U, type HeaderFilters as a, type HeaderFilterOptions as b, type HeaderFilterObject as c, TableDesktop as d, TableDesktopFooter as e, type TableDesktopFooterProps as f, TableDesktopToolbar as g, type TableDesktopToolbarProps as h, type TableColumnConfigurationMenuProps as i, type BulkChangesDialogProps as j, type ExportCsvDialogProps as k };
|
|
@@ -3730,7 +3730,7 @@ var CheckboxFilterMenuContent = ({
|
|
|
3730
3730
|
)
|
|
3731
3731
|
}
|
|
3732
3732
|
),
|
|
3733
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_material23.Divider, {
|
|
3733
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_material23.Divider, {}),
|
|
3734
3734
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
3735
3735
|
import_material23.Box,
|
|
3736
3736
|
{
|
|
@@ -7311,7 +7311,6 @@ var SmartMultipleSelect = ({
|
|
|
7311
7311
|
inputLabel,
|
|
7312
7312
|
variant = "standard",
|
|
7313
7313
|
size,
|
|
7314
|
-
error,
|
|
7315
7314
|
values,
|
|
7316
7315
|
defaultValues,
|
|
7317
7316
|
onChange,
|
|
@@ -7367,48 +7366,38 @@ var SmartMultipleSelect = ({
|
|
|
7367
7366
|
option.value ?? index
|
|
7368
7367
|
);
|
|
7369
7368
|
}) });
|
|
7370
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
7371
|
-
import_material62.
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_material62.FormControl, { fullWidth: true, size, variant, disabled, children: [
|
|
7370
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.InputLabel, { children: inputLabel }),
|
|
7371
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7372
|
+
import_material62.Select,
|
|
7373
|
+
{
|
|
7374
|
+
multiple: true,
|
|
7375
|
+
size,
|
|
7376
|
+
disabled,
|
|
7377
|
+
value: values ?? localValues,
|
|
7378
|
+
defaultValue: defaultValues,
|
|
7379
|
+
MenuProps: menuProps,
|
|
7380
|
+
onOpen,
|
|
7381
|
+
onClose: () => onClose?.(localValues),
|
|
7382
|
+
renderValue: (selectedValues) => {
|
|
7383
|
+
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7385
|
+
},
|
|
7386
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
7387
|
+
import_material62.Box,
|
|
7382
7388
|
{
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
defaultValue: defaultValues,
|
|
7388
|
-
MenuProps: menuProps,
|
|
7389
|
-
onOpen,
|
|
7390
|
-
onClose: () => onClose?.(localValues),
|
|
7391
|
-
renderValue: (selectedValues) => {
|
|
7392
|
-
const valuesString = selectedValues.map((v) => v.label)?.join(", ");
|
|
7393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DynamicOverflowTooltip, { tooltipDescription: valuesString, children: valuesString });
|
|
7389
|
+
sx: {
|
|
7390
|
+
display: "flex",
|
|
7391
|
+
justifyContent: "center",
|
|
7392
|
+
alignItems: "center"
|
|
7394
7393
|
},
|
|
7395
|
-
children:
|
|
7396
|
-
import_material62.Box,
|
|
7397
|
-
{
|
|
7398
|
-
sx: {
|
|
7399
|
-
display: "flex",
|
|
7400
|
-
justifyContent: "center",
|
|
7401
|
-
alignItems: "center"
|
|
7402
|
-
},
|
|
7403
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.CircularProgress, { size: 24 })
|
|
7404
|
-
}
|
|
7405
|
-
) : renderMenuContent()
|
|
7394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.CircularProgress, { size: 24 })
|
|
7406
7395
|
}
|
|
7407
|
-
)
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
}
|
|
7411
|
-
);
|
|
7396
|
+
) : renderMenuContent()
|
|
7397
|
+
}
|
|
7398
|
+
),
|
|
7399
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_material62.FormHelperText, { children: helperText })
|
|
7400
|
+
] });
|
|
7412
7401
|
};
|
|
7413
7402
|
|
|
7414
7403
|
// src/components/SmartSelect/SmartSelect.tsx
|
|
@@ -8201,7 +8190,7 @@ var TableDesktopRows = ({
|
|
|
8201
8190
|
data,
|
|
8202
8191
|
RenderItem,
|
|
8203
8192
|
visibleHeadCells,
|
|
8204
|
-
|
|
8193
|
+
keyField,
|
|
8205
8194
|
order,
|
|
8206
8195
|
orderBy,
|
|
8207
8196
|
disableInternalSort,
|
|
@@ -8214,8 +8203,7 @@ var TableDesktopRows = ({
|
|
|
8214
8203
|
}) => {
|
|
8215
8204
|
const sortedData = disableInternalSort ? data : stableSort2(data, getComparator(order, orderBy));
|
|
8216
8205
|
return sortedData.map((row, index) => {
|
|
8217
|
-
const
|
|
8218
|
-
const isItemSelected = selectedRows.has(rowId);
|
|
8206
|
+
const isItemSelected = selectedRows.has(row[keyField]);
|
|
8219
8207
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
8220
8208
|
RenderItem,
|
|
8221
8209
|
{
|
|
@@ -8227,12 +8215,12 @@ var TableDesktopRows = ({
|
|
|
8227
8215
|
enableEditMode,
|
|
8228
8216
|
enableCheckboxSelection,
|
|
8229
8217
|
rowHeight,
|
|
8230
|
-
rowId,
|
|
8218
|
+
rowId: row[keyField],
|
|
8231
8219
|
onRowCheckboxChange,
|
|
8232
8220
|
visibleHeadCells
|
|
8233
8221
|
}
|
|
8234
8222
|
},
|
|
8235
|
-
|
|
8223
|
+
row[keyField] ?? index
|
|
8236
8224
|
);
|
|
8237
8225
|
});
|
|
8238
8226
|
};
|
|
@@ -8333,12 +8321,6 @@ var TableEmptyResult_default = TableEmptyResult;
|
|
|
8333
8321
|
|
|
8334
8322
|
// src/components/TableDesktop/TableDesktop.tsx
|
|
8335
8323
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
8336
|
-
var resolveKeyValue = (keyField, rowData) => {
|
|
8337
|
-
if (typeof keyField === "string") {
|
|
8338
|
-
return rowData[keyField];
|
|
8339
|
-
}
|
|
8340
|
-
return keyField?.(rowData);
|
|
8341
|
-
};
|
|
8342
8324
|
var TableDesktop = ({
|
|
8343
8325
|
data = [],
|
|
8344
8326
|
headCells,
|
|
@@ -8371,14 +8353,14 @@ var TableDesktop = ({
|
|
|
8371
8353
|
const [orderBy, setOrderBy] = (0, import_react41.useState)(
|
|
8372
8354
|
appliedFilters?.sortField || "delivery_date"
|
|
8373
8355
|
);
|
|
8374
|
-
const [selectedRows, setSelectedRows] = (0, import_react41.useState)(
|
|
8356
|
+
const [selectedRows, setSelectedRows] = (0, import_react41.useState)(
|
|
8357
|
+
/* @__PURE__ */ new Set()
|
|
8358
|
+
);
|
|
8375
8359
|
const [isRowsFromAllPagesSelected, setIsRowsFromAllPagesSelected] = (0, import_react41.useState)(false);
|
|
8376
8360
|
const [isBulkChangesMode, setIsBulkChangesMode] = (0, import_react41.useState)(false);
|
|
8377
8361
|
const numRows = data.length;
|
|
8378
8362
|
const numSelectedRows = (0, import_react41.useMemo)(() => {
|
|
8379
|
-
const currentPageIds = new Set(
|
|
8380
|
-
data.map((row) => resolveKeyValue(keyField, row))
|
|
8381
|
-
);
|
|
8363
|
+
const currentPageIds = new Set(data.map((row) => row[keyField]));
|
|
8382
8364
|
return [...selectedRows].filter((id) => currentPageIds.has(id)).length;
|
|
8383
8365
|
}, [data, selectedRows, keyField]);
|
|
8384
8366
|
const isEveryRowInPageSelected = numRows > 0 && numSelectedRows === numRows;
|
|
@@ -8399,9 +8381,7 @@ var TableDesktop = ({
|
|
|
8399
8381
|
}
|
|
8400
8382
|
};
|
|
8401
8383
|
const selectAllRowsInPage = () => {
|
|
8402
|
-
const allRowsIds = new Set(
|
|
8403
|
-
data.map((row) => resolveKeyValue(keyField, row))
|
|
8404
|
-
);
|
|
8384
|
+
const allRowsIds = new Set(data.map((obj) => obj[keyField]));
|
|
8405
8385
|
setSelectedRows(allRowsIds);
|
|
8406
8386
|
};
|
|
8407
8387
|
const resetSelectedRows = () => {
|
|
@@ -8480,7 +8460,7 @@ var TableDesktop = ({
|
|
|
8480
8460
|
data,
|
|
8481
8461
|
RenderItem,
|
|
8482
8462
|
visibleHeadCells,
|
|
8483
|
-
|
|
8463
|
+
keyField,
|
|
8484
8464
|
order,
|
|
8485
8465
|
orderBy,
|
|
8486
8466
|
disableInternalSort,
|
|
@@ -8623,7 +8603,7 @@ var TableDesktopSmartMultipleSelect = ({
|
|
|
8623
8603
|
onUpdateEditableCell
|
|
8624
8604
|
}) => {
|
|
8625
8605
|
const defaultValues = (0, import_react42.useMemo)(() => {
|
|
8626
|
-
return initialValue
|
|
8606
|
+
return initialValue.map((val) => ({
|
|
8627
8607
|
value: val.id,
|
|
8628
8608
|
label: val[fieldName].toString()
|
|
8629
8609
|
}));
|
|
@@ -8646,12 +8626,11 @@ var TableDesktopSmartMultipleSelect = ({
|
|
|
8646
8626
|
},
|
|
8647
8627
|
onClose: (values) => {
|
|
8648
8628
|
const optionsValues = values.map((option) => option.value ?? "");
|
|
8649
|
-
const optionsLabels = values.map((option) => option.label ?? "");
|
|
8650
8629
|
onUpdateEditableCell?.({
|
|
8651
8630
|
rowId,
|
|
8652
8631
|
columnId,
|
|
8653
8632
|
value: optionsValues,
|
|
8654
|
-
label:
|
|
8633
|
+
label: optionsValues
|
|
8655
8634
|
});
|
|
8656
8635
|
}
|
|
8657
8636
|
}
|
|
@@ -8910,9 +8889,10 @@ var TableDesktopEditableField = ({
|
|
|
8910
8889
|
date: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
8911
8890
|
import_x_date_pickers.DatePicker,
|
|
8912
8891
|
{
|
|
8913
|
-
defaultValue:
|
|
8892
|
+
defaultValue: (0, import_moment3.default)(editInitialValue),
|
|
8914
8893
|
label: inputLabel,
|
|
8915
8894
|
format: "DD/MM/YYYY",
|
|
8895
|
+
sx: { overflowY: "hidden" },
|
|
8916
8896
|
onAccept: (value) => {
|
|
8917
8897
|
const formattedValue = value?.format("YYYY-MM-DD") ?? null;
|
|
8918
8898
|
const formattedLabel = value?.format("DD/MM/YYYY") ?? null;
|
|
@@ -8929,8 +8909,7 @@ var TableDesktopEditableField = ({
|
|
|
8929
8909
|
clearButton: { sx: { p: 0.5 } },
|
|
8930
8910
|
openPickerButton: { sx: { p: 0 } },
|
|
8931
8911
|
textField: {
|
|
8932
|
-
variant,
|
|
8933
|
-
size,
|
|
8912
|
+
variant: "standard",
|
|
8934
8913
|
error: false
|
|
8935
8914
|
}
|
|
8936
8915
|
}
|
|
@@ -8939,8 +8918,9 @@ var TableDesktopEditableField = ({
|
|
|
8939
8918
|
time: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
8940
8919
|
import_x_date_pickers.TimePicker,
|
|
8941
8920
|
{
|
|
8942
|
-
defaultValue:
|
|
8921
|
+
defaultValue: (0, import_moment3.default)(editInitialValue, "HH:mm:ss"),
|
|
8943
8922
|
label: inputLabel,
|
|
8923
|
+
sx: { overflowY: "hidden" },
|
|
8944
8924
|
onAccept: (value) => {
|
|
8945
8925
|
const formattedValue = value?.format("HH:mm") ?? null;
|
|
8946
8926
|
onUpdateEditableCell?.({
|
|
@@ -8956,8 +8936,7 @@ var TableDesktopEditableField = ({
|
|
|
8956
8936
|
clearButton: { sx: { p: 0.5 } },
|
|
8957
8937
|
openPickerButton: { sx: { p: 0 } },
|
|
8958
8938
|
textField: {
|
|
8959
|
-
variant,
|
|
8960
|
-
size,
|
|
8939
|
+
variant: "standard",
|
|
8961
8940
|
error: false
|
|
8962
8941
|
}
|
|
8963
8942
|
}
|
|
@@ -9350,7 +9329,7 @@ var TableDesktopToolbar = ({
|
|
|
9350
9329
|
)
|
|
9351
9330
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_material79.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
9352
9331
|
renderInfoIcons,
|
|
9353
|
-
renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Download List", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
9332
|
+
renderExportCsvDialog ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_material79.Tooltip, { title: "Download Customer List", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("span", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
|
|
9354
9333
|
import_material79.IconButton,
|
|
9355
9334
|
{
|
|
9356
9335
|
disableRipple: true,
|