blixify-ui-web 1.2.254 → 1.2.256
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/dataTemplate/dataStateModel.d.ts +3 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +110 -90
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +4 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +7 -11
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts +3 -0
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +43 -18
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/display/groupSection/index.d.ts +5 -0
- package/lib/components/display/groupSection/index.d.ts.map +1 -1
- package/lib/components/display/groupSection/index.js +35 -4
- package/lib/components/display/groupSection/index.js.map +1 -1
- package/lib/components/display/hoverTooltip/index.d.ts +22 -0
- package/lib/components/display/hoverTooltip/index.d.ts.map +1 -0
- package/lib/components/display/hoverTooltip/index.js +203 -0
- package/lib/components/display/hoverTooltip/index.js.map +1 -0
- package/lib/components/display/newTable/index.d.ts +3 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +249 -125
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/newTable/tagLine.d.ts +12 -0
- package/lib/components/display/newTable/tagLine.d.ts.map +1 -0
- package/lib/components/display/newTable/tagLine.js +141 -0
- package/lib/components/display/newTable/tagLine.js.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +5 -2
- package/lib/components/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -99,6 +99,7 @@ var solid_1 = require("@heroicons/react/20/solid");
|
|
|
99
99
|
var outline_1 = require("@heroicons/react/24/outline");
|
|
100
100
|
var solid_2 = require("@heroicons/react/24/solid");
|
|
101
101
|
var axios_1 = __importDefault(require("axios"));
|
|
102
|
+
var hoverTooltip_1 = require("../hoverTooltip");
|
|
102
103
|
var react_2 = __importStar(require("react"));
|
|
103
104
|
var button_1 = require("../../action/button");
|
|
104
105
|
var iconButton_1 = require("../../action/iconButton");
|
|
@@ -129,6 +130,7 @@ var recordActions_1 = require("../recordActions");
|
|
|
129
130
|
var scrollShadow_1 = require("../scrollShadow");
|
|
130
131
|
var columnWidth_1 = require("./columnWidth");
|
|
131
132
|
var labelPicker_1 = require("./labelPicker");
|
|
133
|
+
var tagLine_1 = require("./tagLine");
|
|
132
134
|
var tag_1 = require("../tag");
|
|
133
135
|
var defaultColours_1 = require("../../data/columnTypes/defaultColours");
|
|
134
136
|
var personAvatar_1 = require("../../data/columnTypes/personAvatar");
|
|
@@ -383,8 +385,6 @@ var handleGetEditableColumnTypes = function (type) {
|
|
|
383
385
|
], ((_a = SAFE_TYPE_CHANGES[type]) !== null && _a !== void 0 ? _a : []), true);
|
|
384
386
|
};
|
|
385
387
|
exports.handleGetEditableColumnTypes = handleGetEditableColumnTypes;
|
|
386
|
-
// INFO: group band (tinted) — shared with the list and grid sections
|
|
387
|
-
var BAND_CLASS = groupSection_1.GROUP_BAND_CLASS;
|
|
388
388
|
// INFO: the cell padding is an !important class, which beats an inline
|
|
389
389
|
// padding, so the room for the title's actions is an !important class too —
|
|
390
390
|
// without it a squeezed title (a pinned column on a phone) runs under them
|
|
@@ -432,7 +432,9 @@ var ACCENT_CLASS = {
|
|
|
432
432
|
};
|
|
433
433
|
// INFO: the colour a list column assigns to a value, or undefined when the
|
|
434
434
|
// column carries no palette — undefined means "render as before"
|
|
435
|
-
// INFO: tags a closed multi-select cell shows before the rest become +N
|
|
435
|
+
// INFO: tags a closed multi-select cell shows before the rest become +N when
|
|
436
|
+
// its column is sized to its content, and before a column with a set width
|
|
437
|
+
// has been measured; once measured, that width decides how many show
|
|
436
438
|
var TAG_LINE_MAX = 2;
|
|
437
439
|
// INFO: listModule draws thumbnails, signatures and chip rows at the size the
|
|
438
440
|
// list, grid and kanban views show them; inside a table they are held to the
|
|
@@ -515,7 +517,7 @@ var handleGetListColour = function (col, value) {
|
|
|
515
517
|
return column.listSelectionColour[index] || undefined;
|
|
516
518
|
};
|
|
517
519
|
var NewTable = function (rawProps) {
|
|
518
|
-
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
|
|
520
|
+
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;
|
|
519
521
|
// INFO: props are read through the latest render. A row that was not drawn
|
|
520
522
|
// again keeps the handlers of the render that drew it, and those read
|
|
521
523
|
// props.onClickRow, props.data and the rest at the time they run — so a
|
|
@@ -567,6 +569,10 @@ var NewTable = function (rawProps) {
|
|
|
567
569
|
// INFO: the share of the scrolling view the left pins may cover, and the
|
|
568
570
|
// narrowest the first pinned column is made to fit it
|
|
569
571
|
var PIN_VIEW_SHARE = 0.6;
|
|
572
|
+
// INFO: on a wide view the frozen columns may cover all but this much, the
|
|
573
|
+
// room one column needs to scroll under them; the share above still rules
|
|
574
|
+
// a narrow view, where this room would be most of it
|
|
575
|
+
var PIN_SCROLL_ROOM = 240;
|
|
570
576
|
var TITLE_PIN_VIEW_SHARE = 0.7;
|
|
571
577
|
var MIN_PIN_WIDTH = 96;
|
|
572
578
|
// INFO: room for the add row's confirm and cancel buttons plus cell padding.
|
|
@@ -582,14 +588,23 @@ var NewTable = function (rawProps) {
|
|
|
582
588
|
groupData.forEach(function (sub) { return groupedKeys.add("".concat(col.key, ".").concat(sub.key)); });
|
|
583
589
|
}
|
|
584
590
|
});
|
|
591
|
+
// INFO: a pin naming a column the table no longer has, such as one a saved
|
|
592
|
+
// view kept after the column was removed, is left out
|
|
593
|
+
var flatKeys = new Set(flatColumns.map(function (col) { return col.key; }));
|
|
594
|
+
var handleKeepPin = function (key) {
|
|
595
|
+
return flatKeys.has(key) && !groupedKeys.has(key);
|
|
596
|
+
};
|
|
597
|
+
// INFO: the columns the host or the reader froze — not the automatic pin
|
|
598
|
+
// of the title below
|
|
599
|
+
var frozenLeftKeys = ((_d = (_c = props.pinColumns) === null || _c === void 0 ? void 0 : _c.left) !== null && _d !== void 0 ? _d : []).filter(handleKeepPin);
|
|
600
|
+
var rightPinned = ((_f = (_e = props.pinColumns) === null || _e === void 0 ? void 0 : _e.right) !== null && _f !== void 0 ? _f : []).filter(handleKeepPin);
|
|
585
601
|
var activityPin = (props.onRowActivity || props.onRowEdit || props.onRowOpen) &&
|
|
586
|
-
!
|
|
602
|
+
!frozenLeftKeys.length &&
|
|
587
603
|
flatColumns[0] &&
|
|
588
|
-
!
|
|
589
|
-
? [flatColumns[0].key]
|
|
604
|
+
!rightPinned.includes(flatColumns[0].key)
|
|
605
|
+
? [flatColumns[0].key].filter(handleKeepPin)
|
|
590
606
|
: [];
|
|
591
|
-
var leftPinned =
|
|
592
|
-
var rightPinned = ((_k = (_j = props.pinColumns) === null || _j === void 0 ? void 0 : _j.right) !== null && _k !== void 0 ? _k : []).filter(function (key) { return !groupedKeys.has(key); });
|
|
607
|
+
var leftPinned = frozenLeftKeys.length ? frozenLeftKeys : activityPin;
|
|
593
608
|
var hasPinColumns = leftPinned.length > 0 || rightPinned.length > 0;
|
|
594
609
|
// INFO: reorder flatColumns so left-pinned come first, right-pinned come last.
|
|
595
610
|
if (hasPinColumns) {
|
|
@@ -603,7 +618,7 @@ var NewTable = function (rawProps) {
|
|
|
603
618
|
flatColumns.length = 0;
|
|
604
619
|
flatColumns.push.apply(flatColumns, __spreadArray(__spreadArray(__spreadArray([], leftCols, false), middleCols, false), rightCols, false));
|
|
605
620
|
}
|
|
606
|
-
var
|
|
621
|
+
var _3 = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _3[0], setIsFixed = _3[1];
|
|
607
622
|
// INFO: the actions sit over the title cell's right padding: the pencil and
|
|
608
623
|
// the bubble in divided strips at the edge, then 8px from the text — kept
|
|
609
624
|
// clear so they never cover the title, and added to the cell's measured
|
|
@@ -612,7 +627,7 @@ var NewTable = function (rawProps) {
|
|
|
612
627
|
// to take it then, so it never covers the title or its inline editor, and
|
|
613
628
|
// the column is sized and floored for that wider padding.
|
|
614
629
|
var hasRowActions = !!props.onRowEdit || !!props.onRowOpen || !!props.onRowActivity;
|
|
615
|
-
var canDragRows = !!props.onMoveRowToGroup && !!((
|
|
630
|
+
var canDragRows = !!props.onMoveRowToGroup && !!((_g = props.groups) === null || _g === void 0 ? void 0 : _g.length);
|
|
616
631
|
var activityStripWidth = props.onRowActivity ? ACTION_STRIP_WIDTH : 0;
|
|
617
632
|
var editStripWidth = props.onRowEdit ? ACTION_STRIP_WIDTH : 0;
|
|
618
633
|
var titleActionsWidth = hasRowActions
|
|
@@ -622,37 +637,38 @@ var NewTable = function (rawProps) {
|
|
|
622
637
|
//=====================================================================================
|
|
623
638
|
// SECTION: Advanced Settings
|
|
624
639
|
//=====================================================================================
|
|
625
|
-
var
|
|
626
|
-
var
|
|
640
|
+
var _4 = (0, react_2.useState)(""), filterModal = _4[0], setFilterModal = _4[1];
|
|
641
|
+
var _5 = (0, react_2.useState)(""), addColumnModal = _5[0], setAddColumnModal = _5[1];
|
|
627
642
|
// INFO: what a DataTemplate around the table lets a cell save
|
|
628
643
|
var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
|
|
629
|
-
var
|
|
630
|
-
var
|
|
631
|
-
var
|
|
632
|
-
var
|
|
633
|
-
var
|
|
634
|
-
var
|
|
635
|
-
var
|
|
644
|
+
var _6 = (0, react_2.useState)(""), newColumnName = _6[0], setNewColumnName = _6[1];
|
|
645
|
+
var _7 = (0, react_2.useState)("string"), newColumnType = _7[0], setNewColumnType = _7[1];
|
|
646
|
+
var _8 = (0, react_2.useState)(""), newColumnRefSpace = _8[0], setNewColumnRefSpace = _8[1];
|
|
647
|
+
var _9 = (0, react_2.useState)(""), newColumnRefLabel = _9[0], setNewColumnRefLabel = _9[1];
|
|
648
|
+
var _10 = (0, react_2.useState)(""), newColumnLookupReference = _10[0], setNewColumnLookupReference = _10[1];
|
|
649
|
+
var _11 = (0, react_2.useState)(""), newColumnLookupField = _11[0], setNewColumnLookupField = _11[1];
|
|
650
|
+
var _12 = (0, react_2.useState)([]), newColumnOptions = _12[0], setNewColumnOptions = _12[1];
|
|
636
651
|
// INFO: the option row whose colour palette is open
|
|
637
|
-
var
|
|
638
|
-
var
|
|
639
|
-
var
|
|
640
|
-
var
|
|
641
|
-
var
|
|
642
|
-
var
|
|
643
|
-
var
|
|
644
|
-
var
|
|
645
|
-
var
|
|
652
|
+
var _13 = (0, react_2.useState)(null), optionColourKey = _13[0], setOptionColourKey = _13[1];
|
|
653
|
+
var _14 = (0, react_2.useState)(false), newColumnRequired = _14[0], setNewColumnRequired = _14[1];
|
|
654
|
+
var _15 = (0, react_2.useState)(false), newColumnUnique = _15[0], setNewColumnUnique = _15[1];
|
|
655
|
+
var _16 = (0, react_2.useState)(false), newColumnReadOnly = _16[0], setNewColumnReadOnly = _16[1];
|
|
656
|
+
var _17 = (0, react_2.useState)(""), newColumnRatingMax = _17[0], setNewColumnRatingMax = _17[1];
|
|
657
|
+
var _18 = (0, react_2.useState)(""), newColumnButtonLabel = _18[0], setNewColumnButtonLabel = _18[1];
|
|
658
|
+
var _19 = (0, react_2.useState)(""), newColumnButtonColour = _19[0], setNewColumnButtonColour = _19[1];
|
|
659
|
+
var _20 = (0, react_2.useState)(""), newColumnButtonConfirm = _20[0], setNewColumnButtonConfirm = _20[1];
|
|
660
|
+
var _21 = (0, react_2.useState)(false), addingColumn = _21[0], setAddingColumn = _21[1];
|
|
661
|
+
var _22 = (0, react_2.useState)(false), confirmDeleteColumn = _22[0], setConfirmDeleteColumn = _22[1];
|
|
646
662
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
647
|
-
var
|
|
663
|
+
var _23 = (0, react_2.useState)(""), newColumnFormula = _23[0], setNewColumnFormula = _23[1];
|
|
648
664
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
649
665
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
650
|
-
var
|
|
666
|
+
var _24 = (0, react_2.useState)(null), editingColumn = _24[0], setEditingColumn = _24[1];
|
|
651
667
|
//=====================================================================================
|
|
652
668
|
// SECTION: Editable & Addable cells
|
|
653
669
|
//=====================================================================================
|
|
654
|
-
var
|
|
655
|
-
var
|
|
670
|
+
var _25 = (0, react_2.useState)(""), editDataRowId = _25[0], setEditDataRowId = _25[1];
|
|
671
|
+
var _26 = (0, react_2.useState)(""), editDataHeaderKey = _26[0], setEditDataHeaderKey = _26[1];
|
|
656
672
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
657
673
|
// form, and a row click always landed on a child input. Only the hovered cell
|
|
658
674
|
// becomes its input now; NewTableHoverCell keeps that hover to itself.
|
|
@@ -661,13 +677,13 @@ var NewTable = function (rawProps) {
|
|
|
661
677
|
var pendingFocusRef = (0, react_2.useRef)("");
|
|
662
678
|
// INFO: the cell a gridLines="all" multiple list is being picked in — its
|
|
663
679
|
// popover hangs from this element
|
|
664
|
-
var
|
|
665
|
-
var
|
|
680
|
+
var _27 = (0, react_2.useState)(null), labelPickerAnchor = _27[0], setLabelPickerAnchor = _27[1];
|
|
681
|
+
var _28 = (0, react_2.useState)(false), modalEditVisible = _28[0], setModalEditVisible = _28[1];
|
|
666
682
|
// INFO: whether the modal's signature pad has been drawn on
|
|
667
|
-
var
|
|
668
|
-
var
|
|
683
|
+
var _29 = (0, react_2.useState)(false), signatureSigning = _29[0], setSignatureSigning = _29[1];
|
|
684
|
+
var _30 = (0, react_2.useState)([]), collapsedGroupIds = _30[0], setCollapsedGroupIds = _30[1];
|
|
669
685
|
// INFO: rows shown per section when the sections do not page themselves
|
|
670
|
-
var
|
|
686
|
+
var _31 = (0, react_2.useState)({}), groupVisibleCounts = _31[0], setGroupVisibleCounts = _31[1];
|
|
671
687
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
672
688
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
673
689
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -685,50 +701,52 @@ var NewTable = function (rawProps) {
|
|
|
685
701
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
686
702
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
687
703
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
688
|
-
var
|
|
689
|
-
var
|
|
690
|
-
var
|
|
691
|
-
var
|
|
704
|
+
var _32 = (0, react_2.useState)(false), isDragSelecting = _32[0], setIsDragSelecting = _32[1];
|
|
705
|
+
var _33 = (0, react_2.useState)(0), copiedCount = _33[0], setCopiedCount = _33[1];
|
|
706
|
+
var _34 = (0, react_2.useState)({}), editDataValue = _34[0], setEditDataValue = _34[1];
|
|
707
|
+
var _35 = (0, react_2.useState)(false), editDataIsLoading = _35[0], setEditDataIsLoading = _35[1];
|
|
692
708
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
693
709
|
// always there in an addable table
|
|
694
|
-
var
|
|
710
|
+
var _36 = (0, react_2.useState)(false), addData = _36[0], setAddData = _36[1];
|
|
695
711
|
var isAddRowPinned = props.paginationType === "scroll";
|
|
696
|
-
var
|
|
712
|
+
var _37 = (0, react_2.useState)({}), addDataValue = _37[0], setAddDataValue = _37[1];
|
|
697
713
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
698
714
|
// inputs and its first cell takes the focus
|
|
699
|
-
var
|
|
715
|
+
var _38 = (0, react_2.useState)(0), addRowKey = _38[0], setAddRowKey = _38[1];
|
|
700
716
|
// INFO: the add row's coloured multiple list being picked under
|
|
701
717
|
// gridLines="all" — its label picker hangs from this cell
|
|
702
718
|
// INFO: the new row's required tag columns left empty on a save — their
|
|
703
719
|
// cells are ringed red until a label is picked
|
|
704
|
-
var
|
|
705
|
-
var
|
|
720
|
+
var _39 = (0, react_2.useState)([]), addTagErrors = _39[0], setAddTagErrors = _39[1];
|
|
721
|
+
var _40 = (0, react_2.useState)(null), addLabelPicker = _40[0], setAddLabelPicker = _40[1];
|
|
706
722
|
// INFO: the group whose own add row is being filled in; "" = the bottom row
|
|
707
|
-
var
|
|
723
|
+
var _41 = (0, react_2.useState)(""), addGroupId = _41[0], setAddGroupId = _41[1];
|
|
708
724
|
// INFO: the row armed by a press on its handle, so only the handle — never
|
|
709
725
|
// a click or a text selection in a cell — starts a drag
|
|
710
|
-
var
|
|
711
|
-
var
|
|
712
|
-
var
|
|
713
|
-
var
|
|
726
|
+
var _42 = (0, react_2.useState)(""), dragArmedRowId = _42[0], setDragArmedRowId = _42[1];
|
|
727
|
+
var _43 = (0, react_2.useState)(""), draggingRowId = _43[0], setDraggingRowId = _43[1];
|
|
728
|
+
var _44 = (0, react_2.useState)(""), dropGroupId = _44[0], setDropGroupId = _44[1];
|
|
729
|
+
var _45 = (0, react_2.useState)({}), referencesOptions = _45[0], setReferencesOptions = _45[1];
|
|
714
730
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
715
731
|
// results still win per key
|
|
716
|
-
var mergedReferencesOptions = __assign(__assign({}, ((
|
|
717
|
-
var
|
|
732
|
+
var mergedReferencesOptions = __assign(__assign({}, ((_h = props.referencesOptions) !== null && _h !== void 0 ? _h : {})), referencesOptions);
|
|
733
|
+
var _46 = (0, react_2.useState)({}), referencesDetails = _46[0], setReferencesDetails = _46[1];
|
|
718
734
|
// INFO: per column, the records a search found and the records the parent
|
|
719
735
|
// passes in, matched by id — a search copies the parent's records into the
|
|
720
736
|
// local map, so the parent's copy wins and a reload of the list reaches the
|
|
721
737
|
// cells, while a record only the search found is kept
|
|
722
738
|
// INFO: worked out once per change, not on every redraw — a cell being
|
|
723
739
|
// typed into redraws the table on each key
|
|
724
|
-
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
725
|
-
|
|
740
|
+
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
741
|
+
return handleMergeReferencesDetails(referencesDetails, props.referencesDetails);
|
|
742
|
+
}, [referencesDetails, props.referencesDetails]);
|
|
743
|
+
var _47 = (0, react_2.useState)(false), referenceLoading = _47[0], setReferenceLoading = _47[1];
|
|
726
744
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
727
|
-
var
|
|
745
|
+
var _48 = (0, react_2.useState)({}), measuredPinWidths = _48[0], setMeasuredPinWidths = _48[1];
|
|
728
746
|
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
729
|
-
var
|
|
747
|
+
var _49 = (0, react_2.useState)(0), pinViewWidth = _49[0], setPinViewWidth = _49[1];
|
|
730
748
|
// INFO: per large group, the rows [start, end) drawn; the rest are spacers
|
|
731
|
-
var
|
|
749
|
+
var _50 = (0, react_2.useState)({}), virtualRanges = _50[0], setVirtualRanges = _50[1];
|
|
732
750
|
// INFO: each drawn row's measured height, kept so a spacer is as tall as the
|
|
733
751
|
// rows it stands in for
|
|
734
752
|
var rowHeightsRef = (0, react_2.useRef)(new Map());
|
|
@@ -844,21 +862,19 @@ var NewTable = function (rawProps) {
|
|
|
844
862
|
};
|
|
845
863
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
846
864
|
}, []);
|
|
847
|
-
// INFO: ensures pinned column measurement runs only once per mount.
|
|
848
|
-
var hasMeasuredRef = (0, react_2.useRef)(false);
|
|
849
865
|
//=====================================================================================
|
|
850
866
|
// SECTION: Style & Classname
|
|
851
867
|
//=====================================================================================
|
|
852
868
|
var bgColor = props.darkMode
|
|
853
869
|
? props.darkModeBg || "bg-gray-900"
|
|
854
870
|
: "bg-white";
|
|
855
|
-
var isFlat = !!((
|
|
871
|
+
var isFlat = !!((_j = props.advSettings) === null || _j === void 0 ? void 0 : _j.flat);
|
|
856
872
|
var borderRadius = isFlat ? "" : "rounded-2xl";
|
|
857
873
|
var borderColor = props.darkMode ? "border-gray-700" : "border-gray-100";
|
|
858
874
|
var selectedRowBg = props.darkMode ? "bg-gray-700" : "bg-primary-50";
|
|
859
875
|
var rowHoverBg = props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100";
|
|
860
876
|
var dividerColor = props.darkMode ? "divide-gray-700" : "divide-gray-100";
|
|
861
|
-
var gridLines = (
|
|
877
|
+
var gridLines = (_k = props.gridLines) !== null && _k !== void 0 ? _k : "horizontal";
|
|
862
878
|
// INFO: under gridLines="all" a coloured list cell paints its whole table
|
|
863
879
|
// cell, like a spreadsheet's cell fill, instead of holding a chip. The Select
|
|
864
880
|
// inside is told (cellInput.fill) to keep only the label colour. Same shades
|
|
@@ -930,8 +946,8 @@ var NewTable = function (rawProps) {
|
|
|
930
946
|
var errorFontColor = props.darkMode ? "text-red-300" : "text-red-500";
|
|
931
947
|
// INFO: an edit commits on blur, but navigating away unmounts the table
|
|
932
948
|
// without one — the cell was left dirty on screen and the value never sent.
|
|
933
|
-
var onUpdateDataRef = (0, react_2.useRef)((
|
|
934
|
-
onUpdateDataRef.current = (
|
|
949
|
+
var onUpdateDataRef = (0, react_2.useRef)((_l = props.editable) === null || _l === void 0 ? void 0 : _l.onUpdateData);
|
|
950
|
+
onUpdateDataRef.current = (_m = props.editable) === null || _m === void 0 ? void 0 : _m.onUpdateData;
|
|
935
951
|
(0, react_2.useEffect)(function () {
|
|
936
952
|
return function () {
|
|
937
953
|
var _a, _b;
|
|
@@ -1139,15 +1155,16 @@ var NewTable = function (rawProps) {
|
|
|
1139
1155
|
}, [props.groupLoadingStatus]);
|
|
1140
1156
|
// INFO: one-time measurement of pinned columns without an explicit width.
|
|
1141
1157
|
// Measures the first body <td> content after data renders — Capacitor-safe.
|
|
1158
|
+
// INFO: a column frozen later, from its header, is measured when it is
|
|
1159
|
+
// first pinned; one measured before keeps its width
|
|
1160
|
+
var pinnedKeysKey = __spreadArray(__spreadArray(__spreadArray([], leftPinned, true), ["|"], false), rightPinned, true).join(",");
|
|
1142
1161
|
(0, react_2.useEffect)(function () {
|
|
1143
1162
|
if (!hasPinColumns || !tableRef.current || props.data.length === 0)
|
|
1144
1163
|
return;
|
|
1145
|
-
if (hasMeasuredRef.current)
|
|
1146
|
-
return;
|
|
1147
1164
|
var allPinned = __spreadArray(__spreadArray([], leftPinned, true), rightPinned, true);
|
|
1148
1165
|
var needsMeasure = allPinned.filter(function (key) {
|
|
1149
1166
|
var col = flatColumns.find(function (c) { return c.key === key; });
|
|
1150
|
-
return !(col === null || col === void 0 ? void 0 : col.width);
|
|
1167
|
+
return !(col === null || col === void 0 ? void 0 : col.width) && !(key in measuredPinWidths);
|
|
1151
1168
|
});
|
|
1152
1169
|
if (needsMeasure.length === 0)
|
|
1153
1170
|
return;
|
|
@@ -1194,7 +1211,6 @@ var NewTable = function (rawProps) {
|
|
|
1194
1211
|
}
|
|
1195
1212
|
});
|
|
1196
1213
|
if (Object.keys(widths).length > 0) {
|
|
1197
|
-
hasMeasuredRef.current = true;
|
|
1198
1214
|
setMeasuredPinWidths(function (prev) {
|
|
1199
1215
|
var changed = Object.keys(widths).some(function (k) { return prev[k] !== widths[k]; });
|
|
1200
1216
|
return changed ? __assign(__assign({}, prev), widths) : prev;
|
|
@@ -1202,7 +1218,7 @@ var NewTable = function (rawProps) {
|
|
|
1202
1218
|
}
|
|
1203
1219
|
});
|
|
1204
1220
|
return function () { return cancelAnimationFrame(frameId); };
|
|
1205
|
-
}, [hasPinColumns, props.data.length]);
|
|
1221
|
+
}, [hasPinColumns, props.data.length, pinnedKeysKey]);
|
|
1206
1222
|
(0, react_2.useEffect)(function () {
|
|
1207
1223
|
var _a;
|
|
1208
1224
|
if (!hasPinColumns || typeof ResizeObserver === "undefined")
|
|
@@ -1653,7 +1669,7 @@ var NewTable = function (rawProps) {
|
|
|
1653
1669
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1654
1670
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1655
1671
|
// class.
|
|
1656
|
-
var
|
|
1672
|
+
var _51 = (0, react_2.useState)({}), columnWidths = _51[0], setColumnWidths = _51[1];
|
|
1657
1673
|
var resizeRef = (0, react_2.useRef)(null);
|
|
1658
1674
|
// INFO: a dragged width first, else the column's own fixed width in pixels
|
|
1659
1675
|
// whatever form it is stored in ("180px", "w-[180px]", "w-48")
|
|
@@ -1680,7 +1696,7 @@ var NewTable = function (rawProps) {
|
|
|
1680
1696
|
// has a set width — a pinned title, or one dragged or configured. A title
|
|
1681
1697
|
// sized by its content would widen and shift the table on every hover, so
|
|
1682
1698
|
// it keeps the chevron's room all the time instead.
|
|
1683
|
-
var titleKey = (
|
|
1699
|
+
var titleKey = (_o = flatColumns[0]) === null || _o === void 0 ? void 0 : _o.key;
|
|
1684
1700
|
var isTitleWidthFixed = !!titleKey &&
|
|
1685
1701
|
(leftPinned.includes(titleKey) ||
|
|
1686
1702
|
rightPinned.includes(titleKey) ||
|
|
@@ -1754,6 +1770,56 @@ var NewTable = function (rawProps) {
|
|
|
1754
1770
|
(_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onDragColumn) === null || _b === void 0 ? void 0 : _b.call(_a, data, id, clonedHeader);
|
|
1755
1771
|
}
|
|
1756
1772
|
};
|
|
1773
|
+
// INFO: only where the built-in panel can show the column — a type it
|
|
1774
|
+
// offers (a math column opens its formula from its own pencil, an object
|
|
1775
|
+
// column needs the nested schema) — and its definition is read on click
|
|
1776
|
+
var handleCanEditColumn = function (col) {
|
|
1777
|
+
var _a, _b, _c, _d;
|
|
1778
|
+
return !!((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onEditColumn) &&
|
|
1779
|
+
!!((_b = props.advSettings) === null || _b === void 0 ? void 0 : _b.getColumnSchema) &&
|
|
1780
|
+
!!((_c = props.advSettings) === null || _c === void 0 ? void 0 : _c.onAddColumn) &&
|
|
1781
|
+
!((_d = props.advSettings) === null || _d === void 0 ? void 0 : _d.renderAddColumnElements) &&
|
|
1782
|
+
ADD_COLUMN_TYPES.some(function (eachType) { return eachType.key === col.type; });
|
|
1783
|
+
};
|
|
1784
|
+
// INFO: every body cell of a pinned column carries its key, because the
|
|
1785
|
+
// width measurement finds the cell by it; a cell without it is never
|
|
1786
|
+
// measured and the next pinned column is placed by a guessed width
|
|
1787
|
+
var handleGetPinKey = function (key) {
|
|
1788
|
+
return leftPinned.includes(key) || rightPinned.includes(key) ? key : undefined;
|
|
1789
|
+
};
|
|
1790
|
+
// INFO: whether a header can freeze its column — not a grouped column, a
|
|
1791
|
+
// column pinned right, or a system column such as created at
|
|
1792
|
+
var handleCanFreezeColumn = function (col) {
|
|
1793
|
+
var _a, _b;
|
|
1794
|
+
return !!((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onPinColumns) &&
|
|
1795
|
+
!groupedKeys.has(col.key) &&
|
|
1796
|
+
!(((_b = col.groupData) === null || _b === void 0 ? void 0 : _b.length) > 0) &&
|
|
1797
|
+
!rightPinned.includes(col.key) &&
|
|
1798
|
+
!(0, systemColumns_1.handleIsSystemColumn)(col.key);
|
|
1799
|
+
};
|
|
1800
|
+
// INFO: the frozen columns the view has room to keep at the left edge; a
|
|
1801
|
+
// frozen column dropped to fit shows an open lock, as it scrolls
|
|
1802
|
+
var handleGetDrawnFrozenKeys = function () {
|
|
1803
|
+
return frozenLeftKeys.filter(function (key) { return key in fittedLeftPins; });
|
|
1804
|
+
};
|
|
1805
|
+
// INFO: freezes every column shown before this one and the column itself,
|
|
1806
|
+
// in the order they are drawn; freezing the last frozen column again
|
|
1807
|
+
// unfreezes them all
|
|
1808
|
+
var handleFreezeColumn = function (key) {
|
|
1809
|
+
var _a, _b;
|
|
1810
|
+
var order = flatColumns
|
|
1811
|
+
.map(function (col) { return col.key; })
|
|
1812
|
+
.filter(function (eachKey) { return handleKeepPin(eachKey); })
|
|
1813
|
+
.filter(function (eachKey) { return !rightPinned.includes(eachKey); });
|
|
1814
|
+
var index = order.indexOf(key);
|
|
1815
|
+
if (index < 0)
|
|
1816
|
+
return;
|
|
1817
|
+
var drawnFrozenKeys = handleGetDrawnFrozenKeys();
|
|
1818
|
+
var isLastFrozen = drawnFrozenKeys[drawnFrozenKeys.length - 1] === key;
|
|
1819
|
+
(_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onPinColumns) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
1820
|
+
left: isLastFrozen ? [] : order.slice(0, index + 1),
|
|
1821
|
+
});
|
|
1822
|
+
};
|
|
1757
1823
|
var handleSort = function (id, type) {
|
|
1758
1824
|
var _a, _b;
|
|
1759
1825
|
(_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onSortColumn) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
@@ -1762,7 +1828,7 @@ var NewTable = function (rawProps) {
|
|
|
1762
1828
|
});
|
|
1763
1829
|
};
|
|
1764
1830
|
var renderAddColumnPanel = function () {
|
|
1765
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1831
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1766
1832
|
// INFO: a caller that renders its own form keeps full control; the
|
|
1767
1833
|
// built-in one only appears when it hands over onAddColumn instead
|
|
1768
1834
|
if ((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderAddColumnElements)
|
|
@@ -1842,7 +1908,8 @@ var NewTable = function (rawProps) {
|
|
|
1842
1908
|
!derivedId ||
|
|
1843
1909
|
taken ||
|
|
1844
1910
|
addingColumn ||
|
|
1845
|
-
!handleIsNewColumnReady(), onClick: handleSubmitNewColumn }))
|
|
1911
|
+
!handleIsNewColumnReady(), onClick: handleSubmitNewColumn })),
|
|
1912
|
+
editingColumn && ((_k = props.advSettings) === null || _k === void 0 ? void 0 : _k.onDeleteColumn) && (react_2.default.createElement(textButton_1.TextButton, { id: "table-column-panel-delete", className: "self-start text-sm !text-red-600 hover:!text-red-700", text: confirmDeleteColumn ? "Confirm delete" : "Delete column", disable: addingColumn, onClick: handleDeleteEditingColumn }))));
|
|
1846
1913
|
};
|
|
1847
1914
|
var renderAddColumnModal = function () { return (react_2.default.createElement(modal_1.Modal, { open: addColumnModal ? true : false, maxWidth: newColumnType === "formula" ? "2xl" : undefined, title: editingColumn ? "Edit Column" : "Add Column", renderContent: renderAddColumnPanel, onClose: function () { return handleAddColumnModal(""); } })); };
|
|
1848
1915
|
var handleChangeOption = function (key, change) {
|
|
@@ -1971,8 +2038,38 @@ var NewTable = function (rawProps) {
|
|
|
1971
2038
|
var top = panel.getBoundingClientRect().top;
|
|
1972
2039
|
panel.style.maxHeight = "".concat(Math.max(240, window.innerHeight - top - 16), "px");
|
|
1973
2040
|
};
|
|
2041
|
+
var handleDeleteEditingColumn = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2042
|
+
var _a, _b;
|
|
2043
|
+
return __generator(this, function (_c) {
|
|
2044
|
+
switch (_c.label) {
|
|
2045
|
+
case 0:
|
|
2046
|
+
if (!editingColumn)
|
|
2047
|
+
return [2 /*return*/];
|
|
2048
|
+
if (!confirmDeleteColumn) {
|
|
2049
|
+
setConfirmDeleteColumn(true);
|
|
2050
|
+
return [2 /*return*/];
|
|
2051
|
+
}
|
|
2052
|
+
// INFO: the button is disabled while this runs, so a double click on
|
|
2053
|
+
// Confirm delete reports the delete once
|
|
2054
|
+
setAddingColumn(true);
|
|
2055
|
+
_c.label = 1;
|
|
2056
|
+
case 1:
|
|
2057
|
+
_c.trys.push([1, , 3, 4]);
|
|
2058
|
+
return [4 /*yield*/, ((_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onDeleteColumn) === null || _b === void 0 ? void 0 : _b.call(_a, editingColumn.id))];
|
|
2059
|
+
case 2:
|
|
2060
|
+
_c.sent();
|
|
2061
|
+
handleAddColumnModal("");
|
|
2062
|
+
return [3 /*break*/, 4];
|
|
2063
|
+
case 3:
|
|
2064
|
+
setAddingColumn(false);
|
|
2065
|
+
return [7 /*endfinally*/];
|
|
2066
|
+
case 4: return [2 /*return*/];
|
|
2067
|
+
}
|
|
2068
|
+
});
|
|
2069
|
+
}); };
|
|
1974
2070
|
var handleAddColumnModal = function (id) {
|
|
1975
2071
|
setAddColumnModal(id);
|
|
2072
|
+
setConfirmDeleteColumn(false);
|
|
1976
2073
|
if (!id) {
|
|
1977
2074
|
setEditingColumn(null);
|
|
1978
2075
|
setNewColumnName("");
|
|
@@ -2490,14 +2587,15 @@ var NewTable = function (rawProps) {
|
|
|
2490
2587
|
return Math.max(width, (_b = getTitleMinWidth(key)) !== null && _b !== void 0 ? _b : 0);
|
|
2491
2588
|
};
|
|
2492
2589
|
var pinCheckboxOffset = props.checkbox &&
|
|
2493
|
-
(props.data.length > 0 || (props.spaceData && ((
|
|
2590
|
+
(props.data.length > 0 || (props.spaceData && ((_p = props.spaceData) === null || _p === void 0 ? void 0 : _p.length) > 0))
|
|
2494
2591
|
? CHECKBOX_WIDTH
|
|
2495
2592
|
: 0;
|
|
2496
2593
|
/**
|
|
2497
2594
|
* INFO: sticky columns wider than the view cover every column that scrolls,
|
|
2498
2595
|
* so on a phone in portrait the table did scroll, but always underneath the
|
|
2499
2596
|
* pinned title and looked stuck. While every pin (the checkbox, left and
|
|
2500
|
-
* right pins, the "+" and Actions) fits in PIN_VIEW_SHARE of the view,
|
|
2597
|
+
* right pins, the "+" and Actions) fits in PIN_VIEW_SHARE of the view, or
|
|
2598
|
+
* all of it but PIN_SCROLL_ROOM on a wide one,
|
|
2501
2599
|
* nothing changes. Past that only the first column stays pinned, narrowed to
|
|
2502
2600
|
* fit with its text wrapping, and everything else scrolls with the table.
|
|
2503
2601
|
*/
|
|
@@ -2508,12 +2606,27 @@ var NewTable = function (rawProps) {
|
|
|
2508
2606
|
var rightNatural = rightPinned.reduce(function (sum, key) { return sum + handleGetPinWidth(key); }, 0) +
|
|
2509
2607
|
(handleShowsActionColumn() ? ACTION_COLUMN_WIDTH : 0) +
|
|
2510
2608
|
(((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0);
|
|
2511
|
-
var budget = pinViewWidth
|
|
2609
|
+
var budget = pinViewWidth
|
|
2610
|
+
? Math.max(pinViewWidth * PIN_VIEW_SHARE, pinViewWidth - PIN_SCROLL_ROOM)
|
|
2611
|
+
: Infinity;
|
|
2512
2612
|
var widths = {};
|
|
2513
2613
|
if (leftNatural + rightNatural <= budget) {
|
|
2514
2614
|
leftPinned.forEach(function (key) { return (widths[key] = handleGetPinWidth(key)); });
|
|
2515
2615
|
return { widths: widths, narrow: false };
|
|
2516
2616
|
}
|
|
2617
|
+
// INFO: several frozen columns past the share — the last ones scroll
|
|
2618
|
+
// again until the rest fit, so a view frozen on a wide screen still
|
|
2619
|
+
// scrolls on a narrow one. Nothing is saved; a wider view freezes them all
|
|
2620
|
+
// again. Only when the first alone does not fit does the narrow fallback
|
|
2621
|
+
// below take over.
|
|
2622
|
+
var kept = __spreadArray([], leftPinned, true);
|
|
2623
|
+
var keptWidth = leftNatural;
|
|
2624
|
+
while (kept.length > 1 && keptWidth + rightNatural > budget)
|
|
2625
|
+
keptWidth -= handleGetPinWidth(kept.pop());
|
|
2626
|
+
if (kept.length > 0 && keptWidth + rightNatural <= budget) {
|
|
2627
|
+
kept.forEach(function (key) { return (widths[key] = handleGetPinWidth(key)); });
|
|
2628
|
+
return { widths: widths, narrow: false };
|
|
2629
|
+
}
|
|
2517
2630
|
var first = leftPinned[0];
|
|
2518
2631
|
// INFO: a title that carries its row's actions keeps a larger share, so
|
|
2519
2632
|
// its text is not squeezed to a few letters a line beside them
|
|
@@ -2743,19 +2856,14 @@ var NewTable = function (rawProps) {
|
|
|
2743
2856
|
var renderTagLine = function (col, value) {
|
|
2744
2857
|
var picks = (Array.isArray(value) ? value : value ? [value] : []).map(String);
|
|
2745
2858
|
if (!handleColumnShowsTags(col))
|
|
2746
|
-
return react_2.default.createElement(
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
className: "shrink-0 whitespace-nowrap ".concat(gridLines === "all" ? "!mx-0" : "") }));
|
|
2755
|
-
}),
|
|
2756
|
-
picks.length > shown.length && (react_2.default.createElement("span", { className: "shrink-0 text-xs text-gray-500" },
|
|
2757
|
-
"+",
|
|
2758
|
-
picks.length - shown.length))));
|
|
2859
|
+
return (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { className: "min-w-0 truncate", onlyWhenClipped: true }, picks.join(", ")));
|
|
2860
|
+
return (react_2.default.createElement(tagLine_1.TagLine, { picks: picks, getColour: function (pick) { return handleGetListColour(col, pick); }, fallbackMax: TAG_LINE_MAX,
|
|
2861
|
+
// INFO: only a column with a set width (a set or dragged width, or a
|
|
2862
|
+
// pin) is fitted; one sized to its content keeps two tags and the count
|
|
2863
|
+
fit: handleIsReadCellFixed(col),
|
|
2864
|
+
// INFO: under gridLines="all" the row's gap-1 is the only space
|
|
2865
|
+
// between tags — Tag's own mx-1 doubled it to 12px
|
|
2866
|
+
tagClassName: gridLines === "all" ? "!mx-0" : "" }));
|
|
2759
2867
|
};
|
|
2760
2868
|
var renderEditDataInputs = function (colIndex, col, rowData, rowId, rowBgClass, isHoverable) {
|
|
2761
2869
|
var _a, _b, _c, _d;
|
|
@@ -2780,7 +2888,7 @@ var NewTable = function (rawProps) {
|
|
|
2780
2888
|
? "cursor-pointer hover:brightness-95 ".concat(isFillActive ? "!shadow-[inset_0_0_0_2px_rgba(255,255,255,0.85)]" : "")
|
|
2781
2889
|
: "cursor-pointer ".concat(props.darkMode ? "hover:bg-gray-800" : "hover:bg-gray-50", " ").concat(isFillActive ? "!shadow-[inset_0_0_0_2px_#9ca3af]" : "");
|
|
2782
2890
|
var pinProps = getPinProps(col.key, false, rowBgClass, isHoverable);
|
|
2783
|
-
return (react_2.default.createElement("td", { key: col.key + String(colIndex), "data-cell-key": col.key, "data-edit-cell": "".concat(rowId, ":").concat(col.key), "data-cell-fill": cellFill ? "" : undefined,
|
|
2891
|
+
return (react_2.default.createElement("td", { key: col.key + String(colIndex), "data-cell-key": col.key, "data-pin-key": handleGetPinKey(col.key), "data-edit-cell": "".concat(rowId, ":").concat(col.key), "data-cell-fill": cellFill ? "" : undefined,
|
|
2784
2892
|
// INFO: pinned columns use whitespace-normal so text wraps within the fixed width.
|
|
2785
2893
|
// col.width must match the read-only cell's width source so a column keeps one
|
|
2786
2894
|
// width whether a row is being edited or shown read-only — without it the cell
|
|
@@ -2926,7 +3034,7 @@ var NewTable = function (rawProps) {
|
|
|
2926
3034
|
};
|
|
2927
3035
|
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
2928
3036
|
// only read by the render helpers called from the return below
|
|
2929
|
-
var
|
|
3037
|
+
var _52 = handleFitPins(), fittedLeftPins = _52.widths, narrowPins = _52.narrow;
|
|
2930
3038
|
var renderActionColumnHeader = function () {
|
|
2931
3039
|
if (handleShowsActionColumn()) {
|
|
2932
3040
|
var pin = handleGetActionCellPin(true);
|
|
@@ -2997,7 +3105,10 @@ var NewTable = function (rawProps) {
|
|
|
2997
3105
|
setAddLabelPicker({ key: ds.id, anchor: cell });
|
|
2998
3106
|
};
|
|
2999
3107
|
return (react_2.default.createElement("td", { key: ds.id + String(index), "data-add-cell": ds.id, "data-add-error": isMissing ? "" : undefined, className: "".concat(editCellPadding, " ").concat(handleCellMinWidth(ds.type), " text-sm ").concat(cellFontColor, " ").concat(isPicking ? "!shadow-[inset_0_0_0_2px_#9ca3af]" : isMissing ? "!shadow-[inset_0_0_0_2px_#fca5a5]" : "") },
|
|
3000
|
-
react_2.default.createElement("div", { "data-testid": "table-add-tag-line-".concat(ds.id), role: "button", "aria-haspopup": "dialog", "aria-expanded": isPicking, tabIndex: 0, "aria-label": "Pick ".concat(col.title),
|
|
3108
|
+
react_2.default.createElement("div", { "data-testid": "table-add-tag-line-".concat(ds.id), role: "button", "aria-haspopup": "dialog", "aria-expanded": isPicking, tabIndex: 0, "aria-label": "Pick ".concat(col.title),
|
|
3109
|
+
// INFO: width 0 in a column with a set width, as in the read cell,
|
|
3110
|
+
// so the picks never widen the column and fit to its set width
|
|
3111
|
+
className: "flex h-[34px] cursor-pointer items-center gap-1 overflow-hidden whitespace-nowrap ".concat(handleIsReadCellFixed(col) ? "w-0 min-w-full" : ""), onClick: function (e) { return handleOpen_1(e.currentTarget); }, onKeyDown: function (e) {
|
|
3001
3112
|
if (e.key !== "Enter" && e.key !== " ")
|
|
3002
3113
|
return;
|
|
3003
3114
|
e.preventDefault();
|
|
@@ -3111,7 +3222,7 @@ var NewTable = function (rawProps) {
|
|
|
3111
3222
|
};
|
|
3112
3223
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
3113
3224
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
3114
|
-
((
|
|
3225
|
+
((_r = (_q = props.selectedIds) === null || _q === void 0 ? void 0 : _q.length) !== null && _r !== void 0 ? _r : 0) >= props.maxSelectedCount;
|
|
3115
3226
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
3116
3227
|
// rows show the band's colour as a bar down their left edge.
|
|
3117
3228
|
var handleRowDragStart = function (event, rowId) {
|
|
@@ -3510,7 +3621,7 @@ var NewTable = function (rawProps) {
|
|
|
3510
3621
|
columnTypeActions.canUpdate &&
|
|
3511
3622
|
columnTypeActions.onUpdateCell &&
|
|
3512
3623
|
!col.disabled)
|
|
3513
|
-
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key,
|
|
3624
|
+
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key, "data-pin-key": handleGetPinKey(col.key),
|
|
3514
3625
|
// INFO: no padding — the cell's own button carries it, so the
|
|
3515
3626
|
// whole cell is the click target. Under gridLines="all" the
|
|
3516
3627
|
// cell is the box the open cell's ring covers.
|
|
@@ -3577,7 +3688,7 @@ var NewTable = function (rawProps) {
|
|
|
3577
3688
|
var shouldNavigateOnClick = !((_q = props.editable) === null || _q === void 0 ? void 0 : _q.active);
|
|
3578
3689
|
var cellFill = handleGetCellFill(col, rawListValue);
|
|
3579
3690
|
var pinProps = getPinProps(col.key, false, rowBgClass, isRowHoverable);
|
|
3580
|
-
return (react_2.default.createElement("td", { key: col.key, "data-cell-fill": cellFill ? "" : undefined, className: "p-0 align-middle ".concat(cellFill ? handleDropCellBg(pinProps === null || pinProps === void 0 ? void 0 : pinProps.className) : ((_r = pinProps === null || pinProps === void 0 ? void 0 : pinProps.className) !== null && _r !== void 0 ? _r : ""), " ").concat((_s = cellFill === null || cellFill === void 0 ? void 0 : cellFill.className) !== null && _s !== void 0 ? _s : ""), style: __assign(__assign({}, pinProps === null || pinProps === void 0 ? void 0 : pinProps.style), cellFill === null || cellFill === void 0 ? void 0 : cellFill.style) },
|
|
3691
|
+
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key, "data-pin-key": handleGetPinKey(col.key), "data-cell-fill": cellFill ? "" : undefined, className: "p-0 align-middle ".concat(cellFill ? handleDropCellBg(pinProps === null || pinProps === void 0 ? void 0 : pinProps.className) : ((_r = pinProps === null || pinProps === void 0 ? void 0 : pinProps.className) !== null && _r !== void 0 ? _r : ""), " ").concat((_s = cellFill === null || cellFill === void 0 ? void 0 : cellFill.className) !== null && _s !== void 0 ? _s : ""), style: __assign(__assign({}, pinProps === null || pinProps === void 0 ? void 0 : pinProps.style), cellFill === null || cellFill === void 0 ? void 0 : cellFill.style) },
|
|
3581
3692
|
react_2.default.createElement("div", { className: "relative ".concat(cellFill ? "w-full" : "w-max", " whitespace-nowrap p-[1px]") },
|
|
3582
3693
|
renderFormCell(row, readOnlyDS, null, {
|
|
3583
3694
|
active: true,
|
|
@@ -3609,7 +3720,7 @@ var NewTable = function (rawProps) {
|
|
|
3609
3720
|
handleCheckModalEditEmpty(cellValue) ? (
|
|
3610
3721
|
// INFO: an empty cell under gridLines="all" is blank,
|
|
3611
3722
|
// as every other empty cell of the grid is
|
|
3612
|
-
gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(
|
|
3723
|
+
gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { className: "min-w-0 truncate", onlyWhenClipped: true }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))),
|
|
3613
3724
|
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
3614
3725
|
}
|
|
3615
3726
|
if (isModalEdit) {
|
|
@@ -3628,7 +3739,7 @@ var NewTable = function (rawProps) {
|
|
|
3628
3739
|
handleCheckModalEditEmpty(cellValue) ? (
|
|
3629
3740
|
// INFO: an empty cell under gridLines="all" is blank,
|
|
3630
3741
|
// as every other empty cell of the grid is
|
|
3631
|
-
gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(
|
|
3742
|
+
gridLines === "all" ? null : (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add"))) : (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { className: "min-w-0 truncate", onlyWhenClipped: true }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))),
|
|
3632
3743
|
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
3633
3744
|
}
|
|
3634
3745
|
// INFO: a multi-select shows its picks as one line of tags until it is
|
|
@@ -3646,7 +3757,9 @@ var NewTable = function (rawProps) {
|
|
|
3646
3757
|
var isPicking = isLabelPickerColumn && isCellEditing && !!labelPickerAnchor;
|
|
3647
3758
|
var handleOpenCell_1 = function (target) {
|
|
3648
3759
|
if (gridLines === "all") {
|
|
3649
|
-
handleOpenAfterLeaving(target, function () {
|
|
3760
|
+
handleOpenAfterLeaving(target, function () {
|
|
3761
|
+
return handleOpenTagCell_1(target);
|
|
3762
|
+
});
|
|
3650
3763
|
return;
|
|
3651
3764
|
}
|
|
3652
3765
|
handleOpenTagCell_1(target);
|
|
@@ -3661,7 +3774,7 @@ var NewTable = function (rawProps) {
|
|
|
3661
3774
|
pendingFocusRef.current = "".concat(row.id, ":").concat(col.key);
|
|
3662
3775
|
};
|
|
3663
3776
|
var pickedValue = resolveValue((isCellEditing ? rowData : row), col.key);
|
|
3664
|
-
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key, className: "".concat(editCellPadding, " ").concat(handleCellMinWidth(col.type), " ").concat(handleReadCellWidthClass(col), " text-sm ").concat(cellFontColor, " ").concat((_2 = (_1 = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _1 === void 0 ? void 0 : _1.className) !== null && _2 !== void 0 ? _2 : "", " ").concat(isPicking ? "!shadow-[inset_0_0_0_2px_#9ca3af]" : ""), style: (_3 = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _3 === void 0 ? void 0 : _3.style },
|
|
3777
|
+
return (react_2.default.createElement("td", { key: col.key, "data-cell-key": col.key, "data-pin-key": handleGetPinKey(col.key), className: "".concat(editCellPadding, " ").concat(handleCellMinWidth(col.type), " ").concat(handleReadCellWidthClass(col), " text-sm ").concat(cellFontColor, " ").concat((_2 = (_1 = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _1 === void 0 ? void 0 : _1.className) !== null && _2 !== void 0 ? _2 : "", " ").concat(isPicking ? "!shadow-[inset_0_0_0_2px_#9ca3af]" : ""), style: (_3 = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _3 === void 0 ? void 0 : _3.style },
|
|
3665
3778
|
react_2.default.createElement("div", { "data-testid": "table-tag-line-".concat(col.key), role: "button", "aria-haspopup": isLabelPickerColumn ? "dialog" : undefined, "aria-expanded": isLabelPickerColumn ? isPicking : undefined, tabIndex: 0, "aria-label": "Edit ".concat(col.title), className: "flex h-[34px] cursor-pointer items-center gap-1 overflow-hidden whitespace-nowrap ".concat(handleIsReadCellFixed(col) ? "w-0 min-w-full" : ""), onClick: function (e) {
|
|
3666
3779
|
e.stopPropagation();
|
|
3667
3780
|
handleOpenCell_1(e.currentTarget);
|
|
@@ -3734,7 +3847,7 @@ var NewTable = function (rawProps) {
|
|
|
3734
3847
|
handleEditDataOnClick(row.id, col.key, rowData);
|
|
3735
3848
|
});
|
|
3736
3849
|
}
|
|
3737
|
-
: undefined }, handleIsReadCellFixed(col) ? (react_2.default.createElement("div",
|
|
3850
|
+
: undefined }, handleIsReadCellFixed(col) ? (react_2.default.createElement(hoverTooltip_1.HoverTooltip, { as: "div", className: "w-0 min-w-full truncate", onlyWhenClipped: true }, renderReadCellValue(col, row, cellValue))) : (renderReadCellValue(col, row, cellValue))));
|
|
3738
3851
|
if (!isEditable || bareOverride)
|
|
3739
3852
|
return readCell;
|
|
3740
3853
|
if (isClickToEditCell)
|
|
@@ -3815,7 +3928,7 @@ var NewTable = function (rawProps) {
|
|
|
3815
3928
|
}
|
|
3816
3929
|
var indexById = new Map(props.data.map(function (row, index) { return [row.id, index]; }));
|
|
3817
3930
|
return props.groups.map(function (group) {
|
|
3818
|
-
var _a, _b, _c, _d
|
|
3931
|
+
var _a, _b, _c, _d;
|
|
3819
3932
|
var colourKey = (_a = group.colour) !== null && _a !== void 0 ? _a : "none";
|
|
3820
3933
|
var isCollapsed = collapsedGroupIds.includes(group.id);
|
|
3821
3934
|
var memberIndexes = group.rowIds
|
|
@@ -3829,7 +3942,7 @@ var NewTable = function (rawProps) {
|
|
|
3829
3942
|
memberIndexes.length === 0 &&
|
|
3830
3943
|
group.count === undefined;
|
|
3831
3944
|
return (react_2.default.createElement(react_2.default.Fragment, { key: "group-".concat(group.id) },
|
|
3832
|
-
react_2.default.createElement("tr", __assign({ "data-testid": "table-group-".concat(group.id), "data-collapsed": isCollapsed ? "true" : "false", hidden: isPending, className: "border-l-4 ".concat((
|
|
3945
|
+
react_2.default.createElement("tr", __assign({ "data-testid": "table-group-".concat(group.id), "data-collapsed": isCollapsed ? "true" : "false", hidden: isPending, className: "border-l-4 ".concat((0, groupSection_1.handleGetGroupBandClass)(colourKey, props.darkMode), " ").concat(dropGroupId === group.id
|
|
3833
3946
|
? "ring-2 ring-inset ring-primary-400"
|
|
3834
3947
|
: "") }, handleGroupDropProps(group)),
|
|
3835
3948
|
react_2.default.createElement("td", { colSpan: columnCount, className: "px-3 py-2" },
|
|
@@ -3844,7 +3957,7 @@ var NewTable = function (rawProps) {
|
|
|
3844
3957
|
isCollapsed ? (react_2.default.createElement(solid_2.ChevronRightIcon, { className: "h-4 w-4" })) : (react_2.default.createElement(solid_2.ChevronDownIcon, { className: "h-4 w-4" })),
|
|
3845
3958
|
group.avatar && (react_2.default.createElement(personAvatar_1.PersonAvatar, { label: group.avatar.label, image: group.avatar.image })),
|
|
3846
3959
|
react_2.default.createElement("span", null, group.title),
|
|
3847
|
-
react_2.default.createElement("span", { className: "rounded-full
|
|
3960
|
+
react_2.default.createElement("span", { className: "rounded-full ".concat((0, groupSection_1.handleGetGroupCountClass)(props.darkMode), " px-2 py-0.5 text-[11px] font-medium normal-case tracking-normal") }, (_d = (_c = (_b = group.summary) === null || _b === void 0 ? void 0 : _b.count) !== null && _c !== void 0 ? _c : group.count) !== null && _d !== void 0 ? _d : memberIndexes.length)))),
|
|
3848
3961
|
!isCollapsed &&
|
|
3849
3962
|
renderMemberRows(group.id, memberIndexes.slice(0, handleGetGroupVisibleCount(group.id)), tableVersion, columnCount, virtualGroups, colourKey, group),
|
|
3850
3963
|
renderGroupShowMoreRow(group.id, memberIndexes.length, columnCount, isCollapsed),
|
|
@@ -4077,22 +4190,15 @@ var NewTable = function (rawProps) {
|
|
|
4077
4190
|
event.stopPropagation();
|
|
4078
4191
|
(_a = advSettings === null || advSettings === void 0 ? void 0 : advSettings.onHideColumn) === null || _a === void 0 ? void 0 : _a.call(advSettings, col.key);
|
|
4079
4192
|
} })) : null;
|
|
4080
|
-
// INFO:
|
|
4081
|
-
//
|
|
4082
|
-
//
|
|
4083
|
-
var deleteIcon = (advSettings === null || advSettings === void 0 ? void 0 : advSettings.onDeleteColumn) ? (react_2.default.createElement(outline_1.TrashIcon, { "data-testid": "table-column-delete-".concat(col.key), className: "".concat(sortClassname, " ").concat(revealClassname, " text-red-400 hover:text-red-600"), onClick: function (event) {
|
|
4193
|
+
// INFO: a column the edit panel can open is deleted from inside it; the
|
|
4194
|
+
// header keeps a trash only for the columns that panel cannot show, so
|
|
4195
|
+
// a column added from the table can still be removed from it
|
|
4196
|
+
var deleteIcon = (advSettings === null || advSettings === void 0 ? void 0 : advSettings.onDeleteColumn) && !handleCanEditColumn(col) ? (react_2.default.createElement(outline_1.TrashIcon, { "data-testid": "table-column-delete-".concat(col.key), className: "".concat(sortClassname, " ").concat(revealClassname, " text-red-400 hover:text-red-600"), onClick: function (event) {
|
|
4084
4197
|
var _a;
|
|
4085
4198
|
event.stopPropagation();
|
|
4086
4199
|
(_a = advSettings === null || advSettings === void 0 ? void 0 : advSettings.onDeleteColumn) === null || _a === void 0 ? void 0 : _a.call(advSettings, col.key);
|
|
4087
4200
|
} })) : null;
|
|
4088
|
-
|
|
4089
|
-
// offers (a math column opens its formula from its own pencil, an object
|
|
4090
|
-
// column needs the nested schema) — and its definition is read on click
|
|
4091
|
-
var editIcon = (advSettings === null || advSettings === void 0 ? void 0 : advSettings.onEditColumn) &&
|
|
4092
|
-
(advSettings === null || advSettings === void 0 ? void 0 : advSettings.getColumnSchema) &&
|
|
4093
|
-
(advSettings === null || advSettings === void 0 ? void 0 : advSettings.onAddColumn) &&
|
|
4094
|
-
!(advSettings === null || advSettings === void 0 ? void 0 : advSettings.renderAddColumnElements) &&
|
|
4095
|
-
ADD_COLUMN_TYPES.some(function (eachType) { return eachType.key === col.type; }) ? (react_2.default.createElement(outline_1.PencilSquareIcon, { "data-testid": "table-column-edit-".concat(col.key), className: "".concat(sortClassname, " ").concat(revealClassname), onClick: function (event) {
|
|
4201
|
+
var editIcon = handleCanEditColumn(col) ? (react_2.default.createElement(outline_1.PencilSquareIcon, { "data-testid": "table-column-edit-".concat(col.key), className: "".concat(sortClassname, " ").concat(revealClassname), onClick: function (event) {
|
|
4096
4202
|
event.stopPropagation();
|
|
4097
4203
|
handleEditColumnModal(col.key);
|
|
4098
4204
|
} })) : null;
|
|
@@ -4114,9 +4220,27 @@ var NewTable = function (rawProps) {
|
|
|
4114
4220
|
if (filterColumnEnabled && (advSettings === null || advSettings === void 0 ? void 0 : advSettings.filterEnabled)) {
|
|
4115
4221
|
filterIcon = (react_2.default.createElement(outline_1.FunnelIcon, { className: sortClassname, onClick: function () { return handleFilterModal(col.key); } }));
|
|
4116
4222
|
}
|
|
4223
|
+
// INFO: revealed on hover like hide; a frozen column keeps its lock in
|
|
4224
|
+
// view, so the reader sees which columns are frozen and where to undo it
|
|
4225
|
+
var drawnFrozenKeys = handleGetDrawnFrozenKeys();
|
|
4226
|
+
var isFrozen = drawnFrozenKeys.includes(col.key);
|
|
4227
|
+
var isLastFrozen = drawnFrozenKeys[drawnFrozenKeys.length - 1] === col.key;
|
|
4228
|
+
var FreezeIcon = isFrozen ? outline_1.LockClosedIcon : outline_1.LockOpenIcon;
|
|
4229
|
+
var freezeLabel = isLastFrozen
|
|
4230
|
+
? "Unfreeze columns"
|
|
4231
|
+
: "Freeze up to this column";
|
|
4232
|
+
var freezeIcon = handleCanFreezeColumn(col) ? (react_2.default.createElement(FreezeIcon, { "data-testid": "table-column-freeze-".concat(col.key), "data-frozen": isFrozen ? "true" : "false", role: "button", "aria-label": freezeLabel, title: freezeLabel, className: "".concat(sortClassname, " ").concat(isFrozen
|
|
4233
|
+
? props.darkMode
|
|
4234
|
+
? "text-primary-300"
|
|
4235
|
+
: "text-primary-600"
|
|
4236
|
+
: revealClassname), onClick: function (event) {
|
|
4237
|
+
event.stopPropagation();
|
|
4238
|
+
handleFreezeColumn(col.key);
|
|
4239
|
+
} })) : null;
|
|
4117
4240
|
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
4118
4241
|
sortIcon,
|
|
4119
4242
|
filterIcon,
|
|
4243
|
+
freezeIcon,
|
|
4120
4244
|
hideIcon,
|
|
4121
4245
|
editIcon,
|
|
4122
4246
|
deleteIcon,
|
|
@@ -4204,20 +4328,20 @@ var NewTable = function (rawProps) {
|
|
|
4204
4328
|
};
|
|
4205
4329
|
var renderCheckbox = function (checked, onChange, onClick, extraClassName) { return (react_2.default.createElement("input", { type: "checkbox", checked: checked, onChange: onChange, onClick: onClick, className: "rounded ".concat(props.darkMode ? "border-gray-400" : "border-gray-500", " ").concat(bgColor, " focus:ring-0 focus:ring-offset-0 focus:outline-offset-0 checked:text-primary-400 ").concat(extraClassName !== null && extraClassName !== void 0 ? extraClassName : "") })); };
|
|
4206
4330
|
if (props.mobileView) {
|
|
4207
|
-
var hasPhoneGroups = !!((
|
|
4331
|
+
var hasPhoneGroups = !!((_s = props.groups) === null || _s === void 0 ? void 0 : _s.length);
|
|
4208
4332
|
return (react_2.default.createElement("div", null,
|
|
4209
|
-
react_2.default.createElement("div", { className: "w-full ".concat(((
|
|
4333
|
+
react_2.default.createElement("div", { className: "w-full ".concat(((_t = props.mobileTooltip) === null || _t === void 0 ? void 0 : _t.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
|
|
4210
4334
|
? ""
|
|
4211
|
-
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((
|
|
4335
|
+
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_u = props.className) !== null && _u !== void 0 ? _u : "") },
|
|
4212
4336
|
react_2.default.createElement("div", { className: "p-3 flex items-center justify-between" },
|
|
4213
4337
|
renderSelectAll(),
|
|
4214
4338
|
react_2.default.createElement("div", { className: "flex items-center gap-2" },
|
|
4215
4339
|
renderSelectedCount(),
|
|
4216
|
-
((
|
|
4340
|
+
((_v = props.advSettings) === null || _v === void 0 ? void 0 : _v.addColumnEnabled) && (react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-column-btn-mobile", icon: react_2.default.createElement(solid_1.PlusIcon, { className: "h-5 w-5 text-gray" }), onClick: function () { return handleAddColumnModal("new"); } })))),
|
|
4217
4341
|
props.loading &&
|
|
4218
4342
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
4219
4343
|
react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
|
|
4220
|
-
!props.loading && props.data.length === 0 && !hasPhoneGroups && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (
|
|
4344
|
+
!props.loading && props.data.length === 0 && !hasPhoneGroups && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_w = props.emptyTitle) !== null && _w !== void 0 ? _w : "No items")),
|
|
4221
4345
|
!props.loading && (props.data.length > 0 || hasPhoneGroups) && (react_2.default.createElement("table", { className: "w-full table-fixed", ref: tableRef },
|
|
4222
4346
|
react_2.default.createElement("tbody", { className: "divide-y ".concat(dividerColor) }, renderDesktopRows())))),
|
|
4223
4347
|
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
|
|
@@ -4237,13 +4361,13 @@ var NewTable = function (rawProps) {
|
|
|
4237
4361
|
: [])[0];
|
|
4238
4362
|
return WIDE_EDIT_TYPES.includes((_a = selectedDS === null || selectedDS === void 0 ? void 0 : selectedDS.type) !== null && _a !== void 0 ? _a : "") ? "4xl" : "2xl";
|
|
4239
4363
|
};
|
|
4240
|
-
return (react_2.default.createElement("div", { className: "w-full ".concat((
|
|
4364
|
+
return (react_2.default.createElement("div", { className: "w-full ".concat((_x = props.className) !== null && _x !== void 0 ? _x : "") },
|
|
4241
4365
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
4242
4366
|
var _a, _b;
|
|
4243
4367
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
4244
4368
|
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))));
|
|
4245
4369
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
4246
|
-
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (
|
|
4370
|
+
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_z = (_y = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _y === void 0 ? void 0 : _y.title) !== null && _z !== void 0 ? _z : "Edit", maxWidth: handleGetEditModalWidth(), onClose: handleModalEditClose, renderContent: function () {
|
|
4247
4371
|
var _a, _b, _c, _d;
|
|
4248
4372
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
4249
4373
|
if (!selectedCol)
|
|
@@ -4289,7 +4413,7 @@ var NewTable = function (rawProps) {
|
|
|
4289
4413
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
4290
4414
|
? ""
|
|
4291
4415
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode },
|
|
4292
|
-
(props.selectAll || ((
|
|
4416
|
+
(props.selectAll || ((_1 = (_0 = props.selectedIds) === null || _0 === void 0 ? void 0 : _0.length) !== null && _1 !== void 0 ? _1 : 0) > 0) &&
|
|
4293
4417
|
(!props.multiActionFloatingBtns ||
|
|
4294
4418
|
(props.multiActionFloatingBtns &&
|
|
4295
4419
|
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" },
|
|
@@ -4317,7 +4441,7 @@ var NewTable = function (rawProps) {
|
|
|
4317
4441
|
(addData
|
|
4318
4442
|
? !isAddRowPinned && !addGroupId && renderAddDataRow()
|
|
4319
4443
|
: !handleHasGroupAddRows() && renderEmptyAddRow()))),
|
|
4320
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (
|
|
4444
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_2 = props.emptyTitle) !== null && _2 !== void 0 ? _2 : "No items"))),
|
|
4321
4445
|
renderPinnedAddButton(),
|
|
4322
4446
|
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
|
|
4323
4447
|
? "pagination-container w-full ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
|