blixify-ui-web 1.2.202 → 1.2.203
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/lib/components/data/formula/builder.d.ts.map +1 -1
- package/lib/components/data/formula/builder.js +2 -1
- package/lib/components/data/formula/builder.js.map +1 -1
- package/lib/components/display/flexTable/index.d.ts.map +1 -1
- package/lib/components/display/flexTable/index.js +10 -9
- package/lib/components/display/flexTable/index.js.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.d.ts.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.js +7 -6
- package/lib/components/display/flexTable/newMobileItemCard.js.map +1 -1
- package/lib/components/display/newPagination/index.d.ts.map +1 -1
- package/lib/components/display/newPagination/index.js +2 -1
- package/lib/components/display/newPagination/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +150 -105
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +2 -1
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts +1 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +3 -2
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/markdown/index.d.ts.map +1 -1
- package/lib/components/input/markdown/index.js +8 -7
- package/lib/components/input/markdown/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +10 -10
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +6 -11
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/components/input/utils.d.ts +15 -0
- package/lib/components/input/utils.d.ts.map +1 -1
- package/lib/components/input/utils.js +21 -1
- package/lib/components/input/utils.js.map +1 -1
- package/lib/tail.css +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/newTable/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,EACZ,YAAY,EAMb,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAYvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAc5C,OAAO,EAAE,MAAM,EAAU,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAOvD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/newTable/index.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,EACZ,YAAY,EAMb,MAAM,OAAO,CAAC;AAMf,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAYvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAc5C,OAAO,EAAE,MAAM,EAAU,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAOvD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAIvC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,KAAK,CAAC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 = require("../scrollShadow");
|
|
127
127
|
var columnWidth_1 = require("./columnWidth");
|
|
128
128
|
var tag_1 = require("../tag");
|
|
129
|
+
var utils_2 = require("../../input/utils");
|
|
129
130
|
// INFO: rows a section draws before its "Show more" — a 2,000-row section
|
|
130
131
|
// would otherwise mount every row (and every cell's controls) at once
|
|
131
132
|
exports.NEW_TABLE_GROUP_ROW_BATCH = 50;
|
|
@@ -392,7 +393,7 @@ var handleGetListColour = function (col, value) {
|
|
|
392
393
|
return column.listSelectionColour[index] || undefined;
|
|
393
394
|
};
|
|
394
395
|
var NewTable = function (props) {
|
|
395
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
|
|
396
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
396
397
|
var columns = (_b = (_a = props.columns) !== null && _a !== void 0 ? _a : props.header) !== null && _b !== void 0 ? _b : [];
|
|
397
398
|
var defaultLimit = 10;
|
|
398
399
|
// INFO: flatten groupData columns so both mobile and desktop share the same
|
|
@@ -424,6 +425,10 @@ var NewTable = function (props) {
|
|
|
424
425
|
// INFO: compute sticky left/right offsets for pinned columns.
|
|
425
426
|
var DEFAULT_PIN_WIDTH = 150;
|
|
426
427
|
var CHECKBOX_WIDTH = 66;
|
|
428
|
+
// INFO: the share of the scrolling view the left pins may cover, and the
|
|
429
|
+
// narrowest the first pinned column is made to fit it
|
|
430
|
+
var PIN_VIEW_SHARE = 0.6;
|
|
431
|
+
var MIN_PIN_WIDTH = 96;
|
|
427
432
|
// INFO: room for the add row's confirm and cancel buttons plus cell padding.
|
|
428
433
|
// Only enforced when right-pinned columns need to know where to start.
|
|
429
434
|
var ACTION_COLUMN_WIDTH = 136;
|
|
@@ -458,7 +463,7 @@ var NewTable = function (props) {
|
|
|
458
463
|
flatColumns.length = 0;
|
|
459
464
|
flatColumns.push.apply(flatColumns, __spreadArray(__spreadArray(__spreadArray([], leftCols, false), middleCols, false), rightCols, false));
|
|
460
465
|
}
|
|
461
|
-
var
|
|
466
|
+
var _4 = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _4[0], setIsFixed = _4[1];
|
|
462
467
|
// INFO: the pencil and the bubble sit over the title cell's right padding,
|
|
463
468
|
// 36px each plus 4px from the edge and 8px from the text — kept clear so
|
|
464
469
|
// they never cover the title, and added to the cell's measured width so the
|
|
@@ -470,43 +475,43 @@ var NewTable = function (props) {
|
|
|
470
475
|
//=====================================================================================
|
|
471
476
|
// SECTION: Advanced Settings
|
|
472
477
|
//=====================================================================================
|
|
473
|
-
var
|
|
474
|
-
var
|
|
478
|
+
var _5 = (0, react_2.useState)(""), filterModal = _5[0], setFilterModal = _5[1];
|
|
479
|
+
var _6 = (0, react_2.useState)(""), addColumnModal = _6[0], setAddColumnModal = _6[1];
|
|
475
480
|
// INFO: what a DataTemplate around the table lets a cell save
|
|
476
481
|
var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
|
|
477
|
-
var
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
+
var _7 = (0, react_2.useState)(""), newColumnName = _7[0], setNewColumnName = _7[1];
|
|
483
|
+
var _8 = (0, react_2.useState)("string"), newColumnType = _8[0], setNewColumnType = _8[1];
|
|
484
|
+
var _9 = (0, react_2.useState)(""), newColumnRefSpace = _9[0], setNewColumnRefSpace = _9[1];
|
|
485
|
+
var _10 = (0, react_2.useState)(""), newColumnRefLabel = _10[0], setNewColumnRefLabel = _10[1];
|
|
486
|
+
var _11 = (0, react_2.useState)([]), newColumnOptions = _11[0], setNewColumnOptions = _11[1];
|
|
482
487
|
// INFO: the option row whose colour palette is open
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
488
|
+
var _12 = (0, react_2.useState)(null), optionColourKey = _12[0], setOptionColourKey = _12[1];
|
|
489
|
+
var _13 = (0, react_2.useState)(false), newColumnRequired = _13[0], setNewColumnRequired = _13[1];
|
|
490
|
+
var _14 = (0, react_2.useState)(""), newColumnRatingMax = _14[0], setNewColumnRatingMax = _14[1];
|
|
491
|
+
var _15 = (0, react_2.useState)(""), newColumnButtonLabel = _15[0], setNewColumnButtonLabel = _15[1];
|
|
492
|
+
var _16 = (0, react_2.useState)(""), newColumnButtonColour = _16[0], setNewColumnButtonColour = _16[1];
|
|
493
|
+
var _17 = (0, react_2.useState)(""), newColumnButtonConfirm = _17[0], setNewColumnButtonConfirm = _17[1];
|
|
494
|
+
var _18 = (0, react_2.useState)(false), addingColumn = _18[0], setAddingColumn = _18[1];
|
|
490
495
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
491
|
-
var
|
|
496
|
+
var _19 = (0, react_2.useState)(""), newColumnFormula = _19[0], setNewColumnFormula = _19[1];
|
|
492
497
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
493
498
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
494
|
-
var
|
|
499
|
+
var _20 = (0, react_2.useState)(null), editingColumn = _20[0], setEditingColumn = _20[1];
|
|
495
500
|
//=====================================================================================
|
|
496
501
|
// SECTION: Editable & Addable cells
|
|
497
502
|
//=====================================================================================
|
|
498
|
-
var
|
|
499
|
-
var
|
|
503
|
+
var _21 = (0, react_2.useState)(""), editDataRowId = _21[0], setEditDataRowId = _21[1];
|
|
504
|
+
var _22 = (0, react_2.useState)(""), editDataHeaderKey = _22[0], setEditDataHeaderKey = _22[1];
|
|
500
505
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
501
506
|
// form, and a row click always landed on a child input. Only the hovered cell
|
|
502
507
|
// becomes its input now.
|
|
503
|
-
var
|
|
504
|
-
var
|
|
508
|
+
var _23 = (0, react_2.useState)(null), hoveredCell = _23[0], setHoveredCell = _23[1];
|
|
509
|
+
var _24 = (0, react_2.useState)(false), modalEditVisible = _24[0], setModalEditVisible = _24[1];
|
|
505
510
|
// INFO: whether the modal's signature pad has been drawn on
|
|
506
|
-
var
|
|
507
|
-
var
|
|
511
|
+
var _25 = (0, react_2.useState)(false), signatureSigning = _25[0], setSignatureSigning = _25[1];
|
|
512
|
+
var _26 = (0, react_2.useState)([]), collapsedGroupIds = _26[0], setCollapsedGroupIds = _26[1];
|
|
508
513
|
// INFO: rows shown per section when the sections do not page themselves
|
|
509
|
-
var
|
|
514
|
+
var _27 = (0, react_2.useState)({}), groupVisibleCounts = _27[0], setGroupVisibleCounts = _27[1];
|
|
510
515
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
511
516
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
512
517
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -522,25 +527,27 @@ var NewTable = function (props) {
|
|
|
522
527
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
523
528
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
524
529
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
530
|
+
var _28 = (0, react_2.useState)(false), isDragSelecting = _28[0], setIsDragSelecting = _28[1];
|
|
531
|
+
var _29 = (0, react_2.useState)(0), copiedCount = _29[0], setCopiedCount = _29[1];
|
|
532
|
+
var _30 = (0, react_2.useState)({}), editDataValue = _30[0], setEditDataValue = _30[1];
|
|
533
|
+
var _31 = (0, react_2.useState)(false), editDataIsLoading = _31[0], setEditDataIsLoading = _31[1];
|
|
529
534
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
530
535
|
// always there in an addable table
|
|
531
|
-
var
|
|
532
|
-
var
|
|
536
|
+
var _32 = (0, react_2.useState)(false), addData = _32[0], setAddData = _32[1];
|
|
537
|
+
var _33 = (0, react_2.useState)({}), addDataValue = _33[0], setAddDataValue = _33[1];
|
|
533
538
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
534
539
|
// inputs and its first cell takes the focus
|
|
535
|
-
var
|
|
536
|
-
var
|
|
540
|
+
var _34 = (0, react_2.useState)(0), addRowKey = _34[0], setAddRowKey = _34[1];
|
|
541
|
+
var _35 = (0, react_2.useState)({}), referencesOptions = _35[0], setReferencesOptions = _35[1];
|
|
537
542
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
538
543
|
// results still win per key
|
|
539
544
|
var mergedReferencesOptions = __assign(__assign({}, ((_l = props.referencesOptions) !== null && _l !== void 0 ? _l : {})), referencesOptions);
|
|
540
|
-
var
|
|
541
|
-
var
|
|
545
|
+
var _36 = (0, react_2.useState)({}), referencesDetails = _36[0], setReferencesDetails = _36[1];
|
|
546
|
+
var _37 = (0, react_2.useState)(false), referenceLoading = _37[0], setReferenceLoading = _37[1];
|
|
542
547
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
543
|
-
var
|
|
548
|
+
var _38 = (0, react_2.useState)({}), measuredPinWidths = _38[0], setMeasuredPinWidths = _38[1];
|
|
549
|
+
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
550
|
+
var _39 = (0, react_2.useState)(0), pinViewWidth = _39[0], setPinViewWidth = _39[1];
|
|
544
551
|
var editDataValueRef = (0, react_2.useRef)({});
|
|
545
552
|
var editDataRowIdRef = (0, react_2.useRef)("");
|
|
546
553
|
var editDataHeaderKeyRef = (0, react_2.useRef)("");
|
|
@@ -794,6 +801,19 @@ var NewTable = function (props) {
|
|
|
794
801
|
});
|
|
795
802
|
return function () { return cancelAnimationFrame(frameId); };
|
|
796
803
|
}, [hasPinColumns, props.data.length]);
|
|
804
|
+
(0, react_2.useEffect)(function () {
|
|
805
|
+
var _a;
|
|
806
|
+
if (!hasPinColumns || typeof ResizeObserver === "undefined")
|
|
807
|
+
return;
|
|
808
|
+
var view = (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.closest('[data-testid="scroll-shadow-container"]');
|
|
809
|
+
if (!view)
|
|
810
|
+
return;
|
|
811
|
+
var handleMeasureView = function () { return setPinViewWidth(view.clientWidth); };
|
|
812
|
+
handleMeasureView();
|
|
813
|
+
var observer = new ResizeObserver(handleMeasureView);
|
|
814
|
+
observer.observe(view);
|
|
815
|
+
return function () { return observer.disconnect(); };
|
|
816
|
+
}, [hasPinColumns, props.data.length > 0]);
|
|
797
817
|
var handleCancelAdd = function () {
|
|
798
818
|
addDataValueRef.current = {};
|
|
799
819
|
setAddData(false);
|
|
@@ -1194,7 +1214,7 @@ var NewTable = function (props) {
|
|
|
1194
1214
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1195
1215
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1196
1216
|
// class.
|
|
1197
|
-
var
|
|
1217
|
+
var _40 = (0, react_2.useState)({}), columnWidths = _40[0], setColumnWidths = _40[1];
|
|
1198
1218
|
var resizeRef = (0, react_2.useRef)(null);
|
|
1199
1219
|
// INFO: a dragged width first, else the column's own fixed width in pixels
|
|
1200
1220
|
// whatever form it is stored in ("180px", "w-[180px]", "w-48")
|
|
@@ -1383,7 +1403,7 @@ var NewTable = function (props) {
|
|
|
1383
1403
|
newColumnOptions.map(function (eachOption, index) {
|
|
1384
1404
|
var _a;
|
|
1385
1405
|
return (react_2.default.createElement("div", { key: eachOption.key, className: "relative flex flex-row items-center gap-x-2", "data-testid": "column-option-".concat(index) },
|
|
1386
|
-
react_2.default.createElement("input", { id: "newColumnOption-".concat(index), type: "text", value: eachOption.text, placeholder: "Option", className: "block w-full min-w-0 flex-1 rounded-md border px-3 py-1.5
|
|
1406
|
+
react_2.default.createElement("input", { id: "newColumnOption-".concat(index), type: "text", value: eachOption.text, placeholder: "Option", className: "block w-full min-w-0 flex-1 rounded-md border px-3 py-1.5 ".concat(utils_2.touchSafeFontSize.sm, " focus:border-primary-500 focus:outline-none focus:ring-0 ").concat(props.darkMode
|
|
1387
1407
|
? "border-gray-600 bg-gray-800 text-white"
|
|
1388
1408
|
: "border-gray-300"), onChange: function (event) {
|
|
1389
1409
|
return handleChangeOption(eachOption.key, { text: event.target.value });
|
|
@@ -1867,47 +1887,81 @@ var NewTable = function (props) {
|
|
|
1867
1887
|
};
|
|
1868
1888
|
// INFO: returns sticky style, border, and background class for a pinned column cell.
|
|
1869
1889
|
// Returns undefined when the column is not pinned.
|
|
1890
|
+
// INFO: extract numeric px value from a Tailwind width class (e.g. "w-[200px]" → 200, "w-48" → 192).
|
|
1891
|
+
// Falls back to measured DOM width for columns without explicit width.
|
|
1892
|
+
var handleGetPinWidth = function (key) {
|
|
1893
|
+
var _a;
|
|
1894
|
+
// INFO: a dragged or fixed width wins over the measured fallback
|
|
1895
|
+
var fixedWidth = getColumnWidth(key);
|
|
1896
|
+
if (fixedWidth)
|
|
1897
|
+
return fixedWidth;
|
|
1898
|
+
var col = flatColumns.find(function (c) { return c.key === key; });
|
|
1899
|
+
if (!(col === null || col === void 0 ? void 0 : col.width))
|
|
1900
|
+
return (_a = measuredPinWidths[key]) !== null && _a !== void 0 ? _a : DEFAULT_PIN_WIDTH;
|
|
1901
|
+
return DEFAULT_PIN_WIDTH;
|
|
1902
|
+
};
|
|
1903
|
+
var pinCheckboxOffset = props.checkbox &&
|
|
1904
|
+
(props.data.length > 0 || (props.spaceData && ((_q = props.spaceData) === null || _q === void 0 ? void 0 : _q.length) > 0))
|
|
1905
|
+
? CHECKBOX_WIDTH
|
|
1906
|
+
: 0;
|
|
1907
|
+
/**
|
|
1908
|
+
* INFO: sticky columns wider than the view cover every column that scrolls,
|
|
1909
|
+
* so on a phone in portrait the table did scroll, but always underneath the
|
|
1910
|
+
* pinned title and looked stuck. While every pin (the checkbox, left and
|
|
1911
|
+
* right pins, the "+" and Actions) fits in PIN_VIEW_SHARE of the view,
|
|
1912
|
+
* nothing changes. Past that only the first column stays pinned, narrowed to
|
|
1913
|
+
* fit with its text wrapping, and everything else scrolls with the table.
|
|
1914
|
+
*/
|
|
1915
|
+
var handleFitPins = function () {
|
|
1916
|
+
var _a;
|
|
1917
|
+
// INFO: the checkbox column is drawn whenever it is on, rows or not
|
|
1918
|
+
var leftNatural = leftPinned.reduce(function (sum, key) { return sum + handleGetPinWidth(key); }, props.checkbox ? CHECKBOX_WIDTH : 0);
|
|
1919
|
+
var rightNatural = rightPinned.reduce(function (sum, key) { return sum + handleGetPinWidth(key); }, 0) +
|
|
1920
|
+
(handleShowsActionColumn() ? ACTION_COLUMN_WIDTH : 0) +
|
|
1921
|
+
(((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0);
|
|
1922
|
+
var budget = pinViewWidth ? pinViewWidth * PIN_VIEW_SHARE : Infinity;
|
|
1923
|
+
var widths = {};
|
|
1924
|
+
if (leftNatural + rightNatural <= budget) {
|
|
1925
|
+
leftPinned.forEach(function (key) { return (widths[key] = handleGetPinWidth(key)); });
|
|
1926
|
+
return { widths: widths, narrow: false };
|
|
1927
|
+
}
|
|
1928
|
+
var first = leftPinned[0];
|
|
1929
|
+
if (first)
|
|
1930
|
+
widths[first] = Math.min(handleGetPinWidth(first), Math.max(MIN_PIN_WIDTH, Math.floor(budget)));
|
|
1931
|
+
return { widths: widths, narrow: true };
|
|
1932
|
+
};
|
|
1933
|
+
var handleGetCheckboxPinStyle = function (zIndex) {
|
|
1934
|
+
if (!hasPinColumns)
|
|
1935
|
+
return undefined;
|
|
1936
|
+
var size = { width: CHECKBOX_WIDTH, minWidth: CHECKBOX_WIDTH };
|
|
1937
|
+
return narrowPins ? size : __assign({ position: "sticky", left: 0, zIndex: zIndex }, size);
|
|
1938
|
+
};
|
|
1870
1939
|
var getPinProps = function (colKey, isHeader, rowBg, isHoverable) {
|
|
1871
|
-
var _a
|
|
1940
|
+
var _a;
|
|
1872
1941
|
if (!hasPinColumns)
|
|
1873
1942
|
return undefined;
|
|
1874
|
-
|
|
1875
|
-
// Falls back to measured DOM width for columns without explicit width.
|
|
1876
|
-
var parsePinWidth = function (key) {
|
|
1877
|
-
var _a;
|
|
1878
|
-
// INFO: a dragged or fixed width wins over the measured fallback
|
|
1879
|
-
var fixedWidth = getColumnWidth(key);
|
|
1880
|
-
if (fixedWidth)
|
|
1881
|
-
return fixedWidth;
|
|
1882
|
-
var col = flatColumns.find(function (c) { return c.key === key; });
|
|
1883
|
-
if (!(col === null || col === void 0 ? void 0 : col.width))
|
|
1884
|
-
return (_a = measuredPinWidths[key]) !== null && _a !== void 0 ? _a : DEFAULT_PIN_WIDTH;
|
|
1885
|
-
return DEFAULT_PIN_WIDTH;
|
|
1886
|
-
};
|
|
1943
|
+
var parsePinWidth = handleGetPinWidth;
|
|
1887
1944
|
var style;
|
|
1888
1945
|
var borderClass = "";
|
|
1889
|
-
var
|
|
1890
|
-
var
|
|
1946
|
+
var fittedLeftKeys = leftPinned.filter(function (key) { return key in fittedLeftPins; });
|
|
1947
|
+
var leftIdx = fittedLeftKeys.indexOf(colKey);
|
|
1948
|
+
var rightIdx = narrowPins ? -1 : rightPinned.indexOf(colKey);
|
|
1891
1949
|
var pinBase = "sticky z-[2] relative whitespace-normal break-words";
|
|
1892
1950
|
var afterBase = "after:absolute after:top-0 after:bottom-0 after:w-px after:pointer-events-none";
|
|
1893
1951
|
var afterColor = props.darkMode
|
|
1894
1952
|
? "after:bg-gray-700"
|
|
1895
1953
|
: "after:bg-gray-200";
|
|
1896
1954
|
if (leftIdx >= 0) {
|
|
1897
|
-
var baseOffset = props.checkbox &&
|
|
1898
|
-
(props.data.length > 0 ||
|
|
1899
|
-
(props.spaceData && ((_a = props.spaceData) === null || _a === void 0 ? void 0 : _a.length) > 0))
|
|
1900
|
-
? CHECKBOX_WIDTH
|
|
1901
|
-
: 0;
|
|
1902
1955
|
// INFO: offset = sum of widths of all preceding left-pinned columns
|
|
1903
|
-
var left =
|
|
1956
|
+
var left = fittedLeftKeys
|
|
1904
1957
|
.slice(0, leftIdx)
|
|
1905
|
-
.reduce(function (sum, key) { return sum +
|
|
1906
|
-
var colWidth =
|
|
1958
|
+
.reduce(function (sum, key) { return sum + fittedLeftPins[key]; }, narrowPins ? 0 : pinCheckboxOffset);
|
|
1959
|
+
var colWidth = fittedLeftPins[colKey];
|
|
1907
1960
|
var col = flatColumns.find(function (c) { return c.key === colKey; });
|
|
1908
|
-
// INFO: only lock width when the column has an explicit width
|
|
1909
|
-
//
|
|
1910
|
-
|
|
1961
|
+
// INFO: only lock width when the column has an explicit width, has been
|
|
1962
|
+
// measured or is fitted to a narrow view. Unmeasured columns render
|
|
1963
|
+
// unconstrained so the observer can capture natural size.
|
|
1964
|
+
var hasFixedWidth = !!(col === null || col === void 0 ? void 0 : col.width) || !!measuredPinWidths[colKey] || narrowPins;
|
|
1911
1965
|
style = __assign({ left: left, overflowWrap: "break-word" }, (hasFixedWidth && {
|
|
1912
1966
|
width: colWidth,
|
|
1913
1967
|
minWidth: colWidth,
|
|
@@ -1921,7 +1975,7 @@ var NewTable = function (props) {
|
|
|
1921
1975
|
var right = rightPinned
|
|
1922
1976
|
.slice(rightIdx + 1)
|
|
1923
1977
|
.reduce(function (sum, key) { return sum + parsePinWidth(key); }, (handleShowsActionColumn() ? ACTION_COLUMN_WIDTH : 0) +
|
|
1924
|
-
(((
|
|
1978
|
+
(((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0));
|
|
1925
1979
|
var colWidth = parsePinWidth(colKey);
|
|
1926
1980
|
var col = flatColumns.find(function (c) { return c.key === colKey; });
|
|
1927
1981
|
var hasFixedWidth = !!(col === null || col === void 0 ? void 0 : col.width) || !!measuredPinWidths[colKey];
|
|
@@ -2060,7 +2114,7 @@ var NewTable = function (props) {
|
|
|
2060
2114
|
* column carries a background so the scrolling cells pass beneath it.
|
|
2061
2115
|
*/
|
|
2062
2116
|
var handleGetActionCellPin = function (isHeader, rowBg, isHoverable) {
|
|
2063
|
-
var _a;
|
|
2117
|
+
var _a, _b;
|
|
2064
2118
|
var bg = isHeader ? tableHeaderBgColor : (rowBg !== null && rowBg !== void 0 ? rowBg : bgColor);
|
|
2065
2119
|
var hoverClass = !isHeader && isHoverable
|
|
2066
2120
|
? props.darkMode
|
|
@@ -2070,11 +2124,18 @@ var NewTable = function (props) {
|
|
|
2070
2124
|
var divider = props.darkMode
|
|
2071
2125
|
? "before:bg-gray-700"
|
|
2072
2126
|
: "before:bg-gray-200";
|
|
2127
|
+
if (narrowPins)
|
|
2128
|
+
return {
|
|
2129
|
+
className: bg,
|
|
2130
|
+
style: rightPinned.length > 0 || ((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled)
|
|
2131
|
+
? { width: ACTION_COLUMN_WIDTH, minWidth: ACTION_COLUMN_WIDTH }
|
|
2132
|
+
: undefined,
|
|
2133
|
+
};
|
|
2073
2134
|
return {
|
|
2074
2135
|
className: "sticky right-0 z-[3] ".concat(bg, " ").concat(hoverClass, " before:absolute before:inset-y-0 before:left-0 before:w-px before:pointer-events-none ").concat(divider),
|
|
2075
2136
|
// INFO: right-pinned data columns and the add-column "+" offset by this
|
|
2076
2137
|
// width, so it has to be exact while either exists
|
|
2077
|
-
style: rightPinned.length > 0 || ((
|
|
2138
|
+
style: rightPinned.length > 0 || ((_b = props.advSettings) === null || _b === void 0 ? void 0 : _b.addColumnEnabled)
|
|
2078
2139
|
? { width: ACTION_COLUMN_WIDTH, minWidth: ACTION_COLUMN_WIDTH }
|
|
2079
2140
|
: undefined,
|
|
2080
2141
|
};
|
|
@@ -2095,6 +2156,11 @@ var NewTable = function (props) {
|
|
|
2095
2156
|
var divider = props.darkMode
|
|
2096
2157
|
? "before:bg-gray-700"
|
|
2097
2158
|
: "before:bg-gray-200";
|
|
2159
|
+
if (narrowPins)
|
|
2160
|
+
return {
|
|
2161
|
+
className: bg,
|
|
2162
|
+
style: { width: ADD_COLUMN_WIDTH, minWidth: ADD_COLUMN_WIDTH },
|
|
2163
|
+
};
|
|
2098
2164
|
return {
|
|
2099
2165
|
className: "sticky z-[3] ".concat(bg, " ").concat(hoverClass, " before:absolute before:inset-y-0 before:left-0 before:w-px before:pointer-events-none ").concat(divider),
|
|
2100
2166
|
style: {
|
|
@@ -2104,6 +2170,9 @@ var NewTable = function (props) {
|
|
|
2104
2170
|
},
|
|
2105
2171
|
};
|
|
2106
2172
|
};
|
|
2173
|
+
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
2174
|
+
// only read by the render helpers called from the return below
|
|
2175
|
+
var _41 = handleFitPins(), fittedLeftPins = _41.widths, narrowPins = _41.narrow;
|
|
2107
2176
|
var renderActionColumnHeader = function () {
|
|
2108
2177
|
if (handleShowsActionColumn()) {
|
|
2109
2178
|
var pin = handleGetActionCellPin(true);
|
|
@@ -2215,7 +2284,7 @@ var NewTable = function (props) {
|
|
|
2215
2284
|
};
|
|
2216
2285
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
2217
2286
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
2218
|
-
((
|
|
2287
|
+
((_s = (_r = props.selectedIds) === null || _r === void 0 ? void 0 : _r.length) !== null && _s !== void 0 ? _s : 0) >= props.maxSelectedCount;
|
|
2219
2288
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
2220
2289
|
// rows show the band's colour as a bar down their left edge.
|
|
2221
2290
|
var renderDesktopRow = function (row, index, groupAccent) {
|
|
@@ -2253,15 +2322,7 @@ var NewTable = function (props) {
|
|
|
2253
2322
|
: "", " ").concat(groupAccent
|
|
2254
2323
|
? "border-l-4 ".concat((_e = ACCENT_CLASS[groupAccent]) !== null && _e !== void 0 ? _e : ACCENT_CLASS.default)
|
|
2255
2324
|
: "") },
|
|
2256
|
-
props.checkbox && (react_2.default.createElement("td", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? "".concat(rowBgClass, " ").concat(isRowHoverable ? (props.darkMode ? "group-hover:bg-gray-700" : "group-hover:bg-gray-100") : "") : ""), style:
|
|
2257
|
-
? {
|
|
2258
|
-
position: "sticky",
|
|
2259
|
-
left: 0,
|
|
2260
|
-
zIndex: 1,
|
|
2261
|
-
width: CHECKBOX_WIDTH,
|
|
2262
|
-
minWidth: CHECKBOX_WIDTH,
|
|
2263
|
-
}
|
|
2264
|
-
: undefined, onClick: function (e) { return handleSelectRow(row.id, e); }, onMouseDown: function (e) { return handleDragSelectStart(row.id, e); }, onMouseEnter: function () { return handleDragSelectOver(row.id); } }, renderCheckbox(isSelected, function () { }, undefined, isMaxReached && !isSelected
|
|
2325
|
+
props.checkbox && (react_2.default.createElement("td", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? "".concat(rowBgClass, " ").concat(isRowHoverable ? (props.darkMode ? "group-hover:bg-gray-700" : "group-hover:bg-gray-100") : "") : ""), style: handleGetCheckboxPinStyle(1), onClick: function (e) { return handleSelectRow(row.id, e); }, onMouseDown: function (e) { return handleDragSelectStart(row.id, e); }, onMouseEnter: function () { return handleDragSelectOver(row.id); } }, renderCheckbox(isSelected, function () { }, undefined, isMaxReached && !isSelected
|
|
2265
2326
|
? "opacity-50 cursor-not-allowed"
|
|
2266
2327
|
: ""))),
|
|
2267
2328
|
flatColumns.map(function (col, colIndex) {
|
|
@@ -2683,15 +2744,7 @@ var NewTable = function (props) {
|
|
|
2683
2744
|
if (!hasGroupHeaders) {
|
|
2684
2745
|
return (react_2.default.createElement("thead", null,
|
|
2685
2746
|
react_2.default.createElement("tr", { className: "border-b ".concat(dividerColor, " ").concat(tableHeaderBgColor, " ").concat(tableHeaderFontColor) },
|
|
2686
|
-
props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style:
|
|
2687
|
-
? {
|
|
2688
|
-
position: "sticky",
|
|
2689
|
-
left: 0,
|
|
2690
|
-
zIndex: 3,
|
|
2691
|
-
width: CHECKBOX_WIDTH,
|
|
2692
|
-
minWidth: CHECKBOX_WIDTH,
|
|
2693
|
-
}
|
|
2694
|
-
: undefined }, renderSelectAll())),
|
|
2747
|
+
props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: handleGetCheckboxPinStyle(3) }, renderSelectAll())),
|
|
2695
2748
|
flatColumns.map(function (col) {
|
|
2696
2749
|
var _a, _b, _c, _d;
|
|
2697
2750
|
return (react_2.default.createElement("th", { key: col.key, className: "group/th relative ".concat(cellPadding, " text-left text-xs font-semibold uppercase tracking-wide ").concat(cursorClassname, " ").concat((_b = (_a = getPinProps(col.key, true)) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ""), style: __assign(__assign({}, (_c = getPinProps(col.key, true)) === null || _c === void 0 ? void 0 : _c.style), (getColumnWidth(col.key)
|
|
@@ -2720,15 +2773,7 @@ var NewTable = function (props) {
|
|
|
2720
2773
|
});
|
|
2721
2774
|
return (react_2.default.createElement("thead", null,
|
|
2722
2775
|
react_2.default.createElement("tr", { className: "border-b ".concat(dividerColor, " ").concat(tableHeaderBgColor, " ").concat(tableHeaderFontColor) },
|
|
2723
|
-
props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style:
|
|
2724
|
-
? {
|
|
2725
|
-
position: "sticky",
|
|
2726
|
-
left: 0,
|
|
2727
|
-
zIndex: 3,
|
|
2728
|
-
width: CHECKBOX_WIDTH,
|
|
2729
|
-
minWidth: CHECKBOX_WIDTH,
|
|
2730
|
-
}
|
|
2731
|
-
: undefined, rowSpan: 2 }, renderSelectAll())),
|
|
2776
|
+
props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: handleGetCheckboxPinStyle(3), rowSpan: 2 }, renderSelectAll())),
|
|
2732
2777
|
visibleColumns.map(function (col) {
|
|
2733
2778
|
var _a, _b, _c, _d;
|
|
2734
2779
|
var groupData = col.groupData;
|
|
@@ -2759,11 +2804,11 @@ var NewTable = function (props) {
|
|
|
2759
2804
|
var isIdLike_1 = function (c) {
|
|
2760
2805
|
return /^id$/i.test(c.key) || /^_id$/i.test(c.key);
|
|
2761
2806
|
};
|
|
2762
|
-
var titleCol_1 = (
|
|
2807
|
+
var titleCol_1 = (_t = flatColumns.find(function (c) { return !isIdLike_1(c); })) !== null && _t !== void 0 ? _t : flatColumns[0];
|
|
2763
2808
|
var expandHeaderBg_1 = props.darkMode ? "bg-gray-700" : "bg-gray-100";
|
|
2764
2809
|
var expandHeaderFontColor_1 = props.darkMode ? "text-white" : "";
|
|
2765
2810
|
var headerBgColor_1 = props.darkMode
|
|
2766
|
-
? ((
|
|
2811
|
+
? ((_u = props.darkModeBg) !== null && _u !== void 0 ? _u : "bg-gray-900")
|
|
2767
2812
|
: "";
|
|
2768
2813
|
var headerFontColor_1 = props.darkMode ? "text-white" : "";
|
|
2769
2814
|
// INFO: renders tag + trailing text adjacent to the Collapse title
|
|
@@ -2858,16 +2903,16 @@ var NewTable = function (props) {
|
|
|
2858
2903
|
})))));
|
|
2859
2904
|
};
|
|
2860
2905
|
return (react_2.default.createElement("div", null,
|
|
2861
|
-
react_2.default.createElement("div", { className: "w-full ".concat(((
|
|
2906
|
+
react_2.default.createElement("div", { className: "w-full ".concat(((_v = props.mobileTooltip) === null || _v === void 0 ? void 0 : _v.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
|
|
2862
2907
|
? ""
|
|
2863
|
-
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((
|
|
2908
|
+
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_w = props.className) !== null && _w !== void 0 ? _w : "") },
|
|
2864
2909
|
react_2.default.createElement("div", { className: "p-3 flex justify-between" },
|
|
2865
2910
|
renderSelectAll(),
|
|
2866
2911
|
renderSelectedCount()),
|
|
2867
2912
|
props.loading &&
|
|
2868
2913
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
2869
2914
|
react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
|
|
2870
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (
|
|
2915
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_x = props.emptyTitle) !== null && _x !== void 0 ? _x : "No items")),
|
|
2871
2916
|
!props.loading &&
|
|
2872
2917
|
props.data.map(function (row, index) {
|
|
2873
2918
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -2923,13 +2968,13 @@ var NewTable = function (props) {
|
|
|
2923
2968
|
: "") }),
|
|
2924
2969
|
renderFloatingActionBar()));
|
|
2925
2970
|
}
|
|
2926
|
-
return (react_2.default.createElement("div", { className: "w-full ".concat((
|
|
2971
|
+
return (react_2.default.createElement("div", { className: "w-full ".concat((_y = props.className) !== null && _y !== void 0 ? _y : "") },
|
|
2927
2972
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
2928
2973
|
var _a, _b;
|
|
2929
2974
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
2930
2975
|
react_2.default.createElement("div", { className: "pb-48" }, (_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderFilterElements) === null || _b === void 0 ? void 0 : _b.call(_a, filterModal))));
|
|
2931
2976
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
2932
|
-
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (
|
|
2977
|
+
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_0 = (_z = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _z === void 0 ? void 0 : _z.title) !== null && _0 !== void 0 ? _0 : "Edit", onClose: handleModalEditClose, renderContent: function () {
|
|
2933
2978
|
var _a, _b, _c, _d;
|
|
2934
2979
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
2935
2980
|
if (!selectedCol)
|
|
@@ -2971,7 +3016,7 @@ var NewTable = function (props) {
|
|
|
2971
3016
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
2972
3017
|
? ""
|
|
2973
3018
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode },
|
|
2974
|
-
(props.selectAll || ((
|
|
3019
|
+
(props.selectAll || ((_2 = (_1 = props.selectedIds) === null || _1 === void 0 ? void 0 : _1.length) !== null && _2 !== void 0 ? _2 : 0) > 0) &&
|
|
2975
3020
|
(!props.multiActionFloatingBtns ||
|
|
2976
3021
|
(props.multiActionFloatingBtns &&
|
|
2977
3022
|
props.multiActionFloatingBtns.length <= 0)) && (react_2.default.createElement("div", { className: "sticky left-0 flex flex-row items-center px-4 py-3 gap-x-2" },
|
|
@@ -2992,7 +3037,7 @@ var NewTable = function (props) {
|
|
|
2992
3037
|
!props.loading && renderDesktopRows(),
|
|
2993
3038
|
!props.loading &&
|
|
2994
3039
|
(addData ? renderAddDataRow() : renderEmptyAddRow()))),
|
|
2995
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (
|
|
3040
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_3 = props.emptyTitle) !== null && _3 !== void 0 ? _3 : "No items"))),
|
|
2996
3041
|
react_2.default.createElement(newPagination_1.NewPagination, { paginationType: props.paginationType, pageIndex: props.pageIndex, limit: props.limit, size: props.size, cursor: props.cursor, resultCount: props.data.length, customPaginationSize: props.customPaginationSize, hidePagination: props.hidePagination, darkMode: props.darkMode, darkModeBg: props.darkModeBg, handleUpdatePageIndex: props.handleUpdatePageIndex, className: "".concat(props.fixedPagination
|
|
2997
3042
|
? "pagination-container w-full ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
|
|
2998
3043
|
: "") }),
|