blixify-ui-web 1.3.52 → 1.3.54
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/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +91 -46
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/timelineBars.d.ts +0 -2
- package/lib/components/data/dataTemplate/timelineBars.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/timelineBars.js +2 -8
- package/lib/components/data/dataTemplate/timelineBars.js.map +1 -1
- package/lib/components/data/formula/index.d.ts.map +1 -1
- package/lib/components/data/formula/index.js +23 -7
- package/lib/components/data/formula/index.js.map +1 -1
- package/lib/components/display/modal/index.d.ts.map +1 -1
- package/lib/components/display/modal/index.js +3 -1
- package/lib/components/display/modal/index.js.map +1 -1
- package/lib/components/display/newPagination/index.d.ts +5 -0
- package/lib/components/display/newPagination/index.d.ts.map +1 -1
- package/lib/components/display/newPagination/index.js +5 -3
- package/lib/components/display/newPagination/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +1 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +191 -94
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/newTable/rowRendering.d.ts +17 -0
- package/lib/components/display/newTable/rowRendering.d.ts.map +1 -1
- package/lib/components/display/newTable/rowRendering.js +16 -1
- package/lib/components/display/newTable/rowRendering.js.map +1 -1
- package/lib/components/display/newTimeline/index.d.ts +19 -0
- package/lib/components/display/newTimeline/index.d.ts.map +1 -0
- package/lib/components/display/newTimeline/index.js +139 -0
- package/lib/components/display/newTimeline/index.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 +3 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +6 -4
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/tail.css +1 -1
- package/package.json +1 -1
|
@@ -294,6 +294,15 @@ var ADD_COLUMN_TYPES = ALL_COLUMN_TYPES.filter(function (eachType) { return !NON
|
|
|
294
294
|
// sign-in, not a datasheet
|
|
295
295
|
var RETIRED_COLUMN_TYPES = ["roles", "password"];
|
|
296
296
|
var REFERENCE_TYPES = ["reference", "listReference", "referenceSelection"];
|
|
297
|
+
// INFO: the columns whose cells read the linked records or their options — a
|
|
298
|
+
// reference picker, a lookup through one, or an object's fields, whose
|
|
299
|
+
// options are kept under the object's own key. A column with no type is
|
|
300
|
+
// counted in, as it may draw anything.
|
|
301
|
+
var handleIsReferenceColumn = function (col) {
|
|
302
|
+
return !col.type ||
|
|
303
|
+
REFERENCE_TYPES.includes(col.type) ||
|
|
304
|
+
["lookup", "object", "listObject"].includes(col.type);
|
|
305
|
+
};
|
|
297
306
|
var BUTTON_COLOUR_OPTIONS = buttonCell_1.BUTTON_COLOURS.map(function (eachColour) { return ({
|
|
298
307
|
key: eachColour,
|
|
299
308
|
label: eachColour.charAt(0).toUpperCase() + eachColour.slice(1),
|
|
@@ -591,7 +600,7 @@ var handleGetListColour = function (col, value) {
|
|
|
591
600
|
return column.listSelectionColour[index] || undefined;
|
|
592
601
|
};
|
|
593
602
|
var NewTable = function (rawProps) {
|
|
594
|
-
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, _4, _5, _6;
|
|
603
|
+
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, _4, _5, _6, _7;
|
|
595
604
|
// INFO: props are read through the latest render. A row that was not drawn
|
|
596
605
|
// again keeps the handlers of the render that drew it, and those read
|
|
597
606
|
// props.onClickRow, props.data and the rest at the time they run — so a
|
|
@@ -700,8 +709,8 @@ var NewTable = function (rawProps) {
|
|
|
700
709
|
// a row is added, the footer wraps on a narrow screen), so it is watched
|
|
701
710
|
// rather than measured once. A state ref, not useRef, so watching starts
|
|
702
711
|
// when the desktop layout mounts after the mobile one.
|
|
703
|
-
var
|
|
704
|
-
var
|
|
712
|
+
var _8 = (0, react_2.useState)(null), desktopRoot = _8[0], setDesktopRoot = _8[1];
|
|
713
|
+
var _9 = (0, react_2.useState)(0), bottomOffset = _9[0], setBottomOffset = _9[1];
|
|
705
714
|
(0, react_2.useLayoutEffect)(function () {
|
|
706
715
|
if (!desktopRoot)
|
|
707
716
|
return;
|
|
@@ -757,43 +766,43 @@ var NewTable = function (rawProps) {
|
|
|
757
766
|
//=====================================================================================
|
|
758
767
|
// SECTION: Advanced Settings
|
|
759
768
|
//=====================================================================================
|
|
760
|
-
var
|
|
761
|
-
var
|
|
769
|
+
var _10 = (0, react_2.useState)(""), filterModal = _10[0], setFilterModal = _10[1];
|
|
770
|
+
var _11 = (0, react_2.useState)(""), addColumnModal = _11[0], setAddColumnModal = _11[1];
|
|
762
771
|
// INFO: what a DataTemplate around the table lets a cell save
|
|
763
772
|
var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
767
|
-
var
|
|
768
|
-
var
|
|
769
|
-
var
|
|
770
|
-
var
|
|
773
|
+
var _12 = (0, react_2.useState)(""), newColumnName = _12[0], setNewColumnName = _12[1];
|
|
774
|
+
var _13 = (0, react_2.useState)("string"), newColumnType = _13[0], setNewColumnType = _13[1];
|
|
775
|
+
var _14 = (0, react_2.useState)(""), newColumnRefSpace = _14[0], setNewColumnRefSpace = _14[1];
|
|
776
|
+
var _15 = (0, react_2.useState)(""), newColumnRefLabel = _15[0], setNewColumnRefLabel = _15[1];
|
|
777
|
+
var _16 = (0, react_2.useState)(""), newColumnLookupReference = _16[0], setNewColumnLookupReference = _16[1];
|
|
778
|
+
var _17 = (0, react_2.useState)(""), newColumnLookupField = _17[0], setNewColumnLookupField = _17[1];
|
|
779
|
+
var _18 = (0, react_2.useState)([]), newColumnOptions = _18[0], setNewColumnOptions = _18[1];
|
|
771
780
|
// INFO: the option row whose colour palette is open
|
|
772
|
-
var
|
|
773
|
-
var
|
|
774
|
-
var
|
|
775
|
-
var
|
|
776
|
-
var
|
|
777
|
-
var
|
|
778
|
-
var
|
|
779
|
-
var
|
|
780
|
-
var
|
|
781
|
+
var _19 = (0, react_2.useState)(null), optionColourKey = _19[0], setOptionColourKey = _19[1];
|
|
782
|
+
var _20 = (0, react_2.useState)(false), newColumnRequired = _20[0], setNewColumnRequired = _20[1];
|
|
783
|
+
var _21 = (0, react_2.useState)(false), newColumnUnique = _21[0], setNewColumnUnique = _21[1];
|
|
784
|
+
var _22 = (0, react_2.useState)(false), newColumnReadOnly = _22[0], setNewColumnReadOnly = _22[1];
|
|
785
|
+
var _23 = (0, react_2.useState)(""), newColumnRatingMax = _23[0], setNewColumnRatingMax = _23[1];
|
|
786
|
+
var _24 = (0, react_2.useState)(""), newColumnDateFormat = _24[0], setNewColumnDateFormat = _24[1];
|
|
787
|
+
var _25 = (0, react_2.useState)(""), newColumnButtonLabel = _25[0], setNewColumnButtonLabel = _25[1];
|
|
788
|
+
var _26 = (0, react_2.useState)(""), newColumnButtonColour = _26[0], setNewColumnButtonColour = _26[1];
|
|
789
|
+
var _27 = (0, react_2.useState)(""), newColumnButtonConfirm = _27[0], setNewColumnButtonConfirm = _27[1];
|
|
781
790
|
// INFO: the app's settings for the column (renderColumnSettings), kept apart
|
|
782
791
|
// from the built-in ones because the table does not know their keys
|
|
783
|
-
var
|
|
784
|
-
var
|
|
785
|
-
var
|
|
786
|
-
var
|
|
792
|
+
var _28 = (0, react_2.useState)({}), newColumnAppSettings = _28[0], setNewColumnAppSettings = _28[1];
|
|
793
|
+
var _29 = (0, react_2.useState)(true), newColumnAppReady = _29[0], setNewColumnAppReady = _29[1];
|
|
794
|
+
var _30 = (0, react_2.useState)(false), addingColumn = _30[0], setAddingColumn = _30[1];
|
|
795
|
+
var _31 = (0, react_2.useState)(false), confirmDeleteColumn = _31[0], setConfirmDeleteColumn = _31[1];
|
|
787
796
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
788
|
-
var
|
|
797
|
+
var _32 = (0, react_2.useState)(""), newColumnFormula = _32[0], setNewColumnFormula = _32[1];
|
|
789
798
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
790
799
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
791
|
-
var
|
|
800
|
+
var _33 = (0, react_2.useState)(null), editingColumn = _33[0], setEditingColumn = _33[1];
|
|
792
801
|
//=====================================================================================
|
|
793
802
|
// SECTION: Editable & Addable cells
|
|
794
803
|
//=====================================================================================
|
|
795
|
-
var
|
|
796
|
-
var
|
|
804
|
+
var _34 = (0, react_2.useState)(""), editDataRowId = _34[0], setEditDataRowId = _34[1];
|
|
805
|
+
var _35 = (0, react_2.useState)(""), editDataHeaderKey = _35[0], setEditDataHeaderKey = _35[1];
|
|
797
806
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
798
807
|
// form, and a row click always landed on a child input. Only the clicked cell
|
|
799
808
|
// becomes its input now (Gantt and canvas cells still on hover, through
|
|
@@ -803,11 +812,11 @@ var NewTable = function (rawProps) {
|
|
|
803
812
|
var pendingFocusRef = (0, react_2.useRef)("");
|
|
804
813
|
// INFO: the cell a coloured multiple list is being picked in — its popover
|
|
805
814
|
// hangs from this element
|
|
806
|
-
var
|
|
807
|
-
var
|
|
815
|
+
var _36 = (0, react_2.useState)(null), labelPickerAnchor = _36[0], setLabelPickerAnchor = _36[1];
|
|
816
|
+
var _37 = (0, react_2.useState)(false), modalEditVisible = _37[0], setModalEditVisible = _37[1];
|
|
808
817
|
// INFO: whether the modal's signature pad has been drawn on
|
|
809
|
-
var
|
|
810
|
-
var
|
|
818
|
+
var _38 = (0, react_2.useState)(false), signatureSigning = _38[0], setSignatureSigning = _38[1];
|
|
819
|
+
var _39 = (0, react_2.useState)([]), collapsedGroupIds = _39[0], setCollapsedGroupIds = _39[1];
|
|
811
820
|
var isAllGroupsCollapsed = !!((_h = props.groups) === null || _h === void 0 ? void 0 : _h.length) &&
|
|
812
821
|
props.groups.every(function (eachGroup) { return collapsedGroupIds.includes(eachGroup.id); });
|
|
813
822
|
var onAllGroupsCollapsedChangeRef = (0, react_2.useRef)(props.onAllGroupsCollapsedChange);
|
|
@@ -820,7 +829,7 @@ var NewTable = function (rawProps) {
|
|
|
820
829
|
// collapsed behind it
|
|
821
830
|
(0, react_2.useEffect)(function () { return function () { var _a; return (_a = onAllGroupsCollapsedChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onAllGroupsCollapsedChangeRef, false); }; }, []);
|
|
822
831
|
// INFO: rows shown per section when the sections do not page themselves
|
|
823
|
-
var
|
|
832
|
+
var _40 = (0, react_2.useState)({}), groupVisibleCounts = _40[0], setGroupVisibleCounts = _40[1];
|
|
824
833
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
825
834
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
826
835
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -838,36 +847,36 @@ var NewTable = function (rawProps) {
|
|
|
838
847
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
839
848
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
840
849
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
841
|
-
var
|
|
842
|
-
var
|
|
843
|
-
var
|
|
844
|
-
var
|
|
850
|
+
var _41 = (0, react_2.useState)(false), isDragSelecting = _41[0], setIsDragSelecting = _41[1];
|
|
851
|
+
var _42 = (0, react_2.useState)(0), copiedCount = _42[0], setCopiedCount = _42[1];
|
|
852
|
+
var _43 = (0, react_2.useState)({}), editDataValue = _43[0], setEditDataValue = _43[1];
|
|
853
|
+
var _44 = (0, react_2.useState)(false), editDataIsLoading = _44[0], setEditDataIsLoading = _44[1];
|
|
845
854
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
846
855
|
// always there in an addable table
|
|
847
|
-
var
|
|
856
|
+
var _45 = (0, react_2.useState)(false), addData = _45[0], setAddData = _45[1];
|
|
848
857
|
var isAddRowPinned = props.paginationType === "scroll";
|
|
849
|
-
var
|
|
858
|
+
var _46 = (0, react_2.useState)({}), addDataValue = _46[0], setAddDataValue = _46[1];
|
|
850
859
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
851
860
|
// inputs and its first cell takes the focus
|
|
852
|
-
var
|
|
861
|
+
var _47 = (0, react_2.useState)(0), addRowKey = _47[0], setAddRowKey = _47[1];
|
|
853
862
|
// INFO: the add row's coloured multiple list being picked — its label
|
|
854
863
|
// picker hangs from this cell
|
|
855
864
|
// INFO: the new row's required tag columns left empty on a save — their
|
|
856
865
|
// cells are ringed red until a label is picked
|
|
857
|
-
var
|
|
858
|
-
var
|
|
866
|
+
var _48 = (0, react_2.useState)([]), addTagErrors = _48[0], setAddTagErrors = _48[1];
|
|
867
|
+
var _49 = (0, react_2.useState)(null), addLabelPicker = _49[0], setAddLabelPicker = _49[1];
|
|
859
868
|
// INFO: the group whose own add row is being filled in; "" = the bottom row
|
|
860
|
-
var
|
|
869
|
+
var _50 = (0, react_2.useState)(""), addGroupId = _50[0], setAddGroupId = _50[1];
|
|
861
870
|
// INFO: the row armed by a press on its handle, so only the handle — never
|
|
862
871
|
// a click or a text selection in a cell — starts a drag
|
|
863
|
-
var
|
|
864
|
-
var
|
|
865
|
-
var
|
|
866
|
-
var
|
|
872
|
+
var _51 = (0, react_2.useState)(""), dragArmedRowId = _51[0], setDragArmedRowId = _51[1];
|
|
873
|
+
var _52 = (0, react_2.useState)(""), draggingRowId = _52[0], setDraggingRowId = _52[1];
|
|
874
|
+
var _53 = (0, react_2.useState)(""), dropGroupId = _53[0], setDropGroupId = _53[1];
|
|
875
|
+
var _54 = (0, react_2.useState)({}), referencesOptions = _54[0], setReferencesOptions = _54[1];
|
|
867
876
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
868
877
|
// results still win per key
|
|
869
878
|
var mergedReferencesOptions = __assign(__assign({}, ((_j = props.referencesOptions) !== null && _j !== void 0 ? _j : {})), referencesOptions);
|
|
870
|
-
var
|
|
879
|
+
var _55 = (0, react_2.useState)({}), referencesDetails = _55[0], setReferencesDetails = _55[1];
|
|
871
880
|
// INFO: per column, the records a search found and the records the parent
|
|
872
881
|
// passes in, matched by id — a search copies the parent's records into the
|
|
873
882
|
// local map, so the parent's copy wins and a reload of the list reaches the
|
|
@@ -877,13 +886,13 @@ var NewTable = function (rawProps) {
|
|
|
877
886
|
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
878
887
|
return handleMergeReferencesDetails(referencesDetails, props.referencesDetails);
|
|
879
888
|
}, [referencesDetails, props.referencesDetails]);
|
|
880
|
-
var
|
|
889
|
+
var _56 = (0, react_2.useState)(false), referenceLoading = _56[0], setReferenceLoading = _56[1];
|
|
881
890
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
882
|
-
var
|
|
891
|
+
var _57 = (0, react_2.useState)({}), measuredPinWidths = _57[0], setMeasuredPinWidths = _57[1];
|
|
883
892
|
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
884
|
-
var
|
|
893
|
+
var _58 = (0, react_2.useState)(0), pinViewWidth = _58[0], setPinViewWidth = _58[1];
|
|
885
894
|
// INFO: per large group, the rows [start, end) drawn; the rest are spacers
|
|
886
|
-
var
|
|
895
|
+
var _59 = (0, react_2.useState)({}), virtualRanges = _59[0], setVirtualRanges = _59[1];
|
|
887
896
|
// INFO: each drawn row's measured height, kept so a spacer is as tall as the
|
|
888
897
|
// rows it stands in for
|
|
889
898
|
var rowHeightsRef = (0, react_2.useRef)(new Map());
|
|
@@ -895,7 +904,7 @@ var NewTable = function (rawProps) {
|
|
|
895
904
|
// its left edge as an offset from the first of them, and its width. Set only
|
|
896
905
|
// when the drawn columns no longer cover it, so scrolling inside them draws
|
|
897
906
|
// nothing
|
|
898
|
-
var
|
|
907
|
+
var _60 = (0, react_2.useState)(null), columnView = _60[0], setColumnView = _60[1];
|
|
899
908
|
// INFO: each drawn unpinned column's measured width, so a spacer is as wide
|
|
900
909
|
// as the columns it stands in for
|
|
901
910
|
var columnWidthsMeasuredRef = (0, react_2.useRef)({});
|
|
@@ -909,6 +918,12 @@ var NewTable = function (rawProps) {
|
|
|
909
918
|
key: "",
|
|
910
919
|
version: 0,
|
|
911
920
|
});
|
|
921
|
+
// INFO: the linked records' version — only a cell that draws a linked
|
|
922
|
+
// record compares it
|
|
923
|
+
var referencesVersionRef = (0, react_2.useRef)({
|
|
924
|
+
key: "",
|
|
925
|
+
version: 0,
|
|
926
|
+
});
|
|
912
927
|
// INFO: the table version without the column window — a body cell compares
|
|
913
928
|
// it, so moving the window redraws rows but not the cells they keep
|
|
914
929
|
var cellVersionRef = (0, react_2.useRef)({
|
|
@@ -1934,9 +1949,9 @@ var NewTable = function (rawProps) {
|
|
|
1934
1949
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1935
1950
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1936
1951
|
// class.
|
|
1937
|
-
var
|
|
1952
|
+
var _61 = (0, react_2.useState)({}), columnWidths = _61[0], setColumnWidths = _61[1];
|
|
1938
1953
|
// INFO: caps measured for content-sized columns — see handleMeasureCaps
|
|
1939
|
-
var
|
|
1954
|
+
var _62 = (0, react_2.useState)({}), cappedWidths = _62[0], setCappedWidths = _62[1];
|
|
1940
1955
|
// INFO: width — the drag's latest width. The release reads it here rather
|
|
1941
1956
|
// than from columnWidths, which holds only what the last drawn render saw: a
|
|
1942
1957
|
// slow table can still be drawing the last moves when the pointer is let go
|
|
@@ -2154,7 +2169,7 @@ var NewTable = function (rawProps) {
|
|
|
2154
2169
|
// stops a value being cut at a character count, and a capped cell still
|
|
2155
2170
|
// holds its whole value — it shows when the column is widened and copies in
|
|
2156
2171
|
// full. Not under grouped headers, which draw without fixed widths.
|
|
2157
|
-
var
|
|
2172
|
+
var _63 = (0, react_2.useState)(0), capCheck = _63[0], setCapCheck = _63[1];
|
|
2158
2173
|
var capsKey = [
|
|
2159
2174
|
(_p = props.advSettings) === null || _p === void 0 ? void 0 : _p.maxFirstColumnWidth,
|
|
2160
2175
|
(_q = props.advSettings) === null || _q === void 0 ? void 0 : _q.maxColumnWidth,
|
|
@@ -3804,7 +3819,7 @@ var NewTable = function (rawProps) {
|
|
|
3804
3819
|
};
|
|
3805
3820
|
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
3806
3821
|
// only read by the render helpers called from the return below
|
|
3807
|
-
var
|
|
3822
|
+
var _64 = handleFitPins(), fittedLeftPins = _64.widths, narrowPins = _64.narrow;
|
|
3808
3823
|
var renderActionColumnHeader = function () {
|
|
3809
3824
|
if (handleShowsActionColumn()) {
|
|
3810
3825
|
var pin = handleGetActionCellPin(true);
|
|
@@ -3982,7 +3997,12 @@ var NewTable = function (rawProps) {
|
|
|
3982
3997
|
// INFO: the list-wide footer. In scroll mode it reads "Showing N of total"
|
|
3983
3998
|
// from the server's count in size; a Firebase list counts nothing, so size
|
|
3984
3999
|
// is the loaded rows and it falls back to "Showing N result(s)"
|
|
3985
|
-
|
|
4000
|
+
// INFO: the sentinel reads ahead of the screen's edge, so the spinner under
|
|
4001
|
+
// the rows is often still out of view while the next rows load
|
|
4002
|
+
var isLoadingMore = props.paginationType === "scroll" &&
|
|
4003
|
+
(!!props.loadingMore ||
|
|
4004
|
+
Object.values((_t = props.groupLoadingStatus) !== null && _t !== void 0 ? _t : {}).some(function (status) { return !!(status === null || status === void 0 ? void 0 : status.loadingMore); }));
|
|
4005
|
+
var renderFooter = function () { return (react_2.default.createElement(newPagination_1.NewPagination, { paginationType: props.paginationType, loadingMore: isLoadingMore, pageIndex: props.pageIndex, limit: props.limit, size: props.size, cursor: props.cursor, resultCount: props.data.length, totalCount: props.paginationType === "scroll" ? props.size : undefined, customPaginationSize: props.customPaginationSize, hidePagination: props.hidePagination, darkMode: props.darkMode, darkModeBg: props.darkModeBg, handleUpdatePageIndex: props.handleUpdatePageIndex })); };
|
|
3986
4006
|
var isFooterShown = !props.hidePagination && !!props.paginationType;
|
|
3987
4007
|
// INFO: scroll-paged rows keep arriving, so a footer under the table is
|
|
3988
4008
|
// almost never reached; it holds the bottom of the screen instead, and so
|
|
@@ -4032,7 +4052,7 @@ var NewTable = function (rawProps) {
|
|
|
4032
4052
|
};
|
|
4033
4053
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
4034
4054
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
4035
|
-
((
|
|
4055
|
+
((_v = (_u = props.selectedIds) === null || _u === void 0 ? void 0 : _u.length) !== null && _v !== void 0 ? _v : 0) >= props.maxSelectedCount;
|
|
4036
4056
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
4037
4057
|
// rows show the band's colour as a bar down their left edge.
|
|
4038
4058
|
var handleRowDragStart = function (event, rowId) {
|
|
@@ -4088,30 +4108,65 @@ var NewTable = function (rawProps) {
|
|
|
4088
4108
|
} },
|
|
4089
4109
|
react_2.default.createElement(solid_2.EllipsisVerticalIcon, { className: "h-4 w-4" }))); };
|
|
4090
4110
|
// INFO: props whose change does not redraw rows — a row is told about its own
|
|
4091
|
-
// record, display row, group and selection directly
|
|
4111
|
+
// record, display row, group and selection directly. The paging props move
|
|
4112
|
+
// as each page loads and no row draws from them; the comment counts and the
|
|
4113
|
+
// linked records are compared per row and per column below, so one page's
|
|
4114
|
+
// new values do not redraw every cell
|
|
4092
4115
|
var ROW_INDEPENDENT_PROPS = new Set([
|
|
4093
4116
|
"data",
|
|
4094
4117
|
"spaceData",
|
|
4095
4118
|
"groups",
|
|
4096
4119
|
"groupLoadingStatus",
|
|
4120
|
+
"loadingMore",
|
|
4097
4121
|
"children",
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
// new records
|
|
4103
|
-
var IDENTITY_PROPS = new Set([
|
|
4104
|
-
"selectedIds",
|
|
4122
|
+
"pageIndex",
|
|
4123
|
+
"cursor",
|
|
4124
|
+
"size",
|
|
4125
|
+
"loading",
|
|
4105
4126
|
"commentCounts",
|
|
4106
4127
|
"commentUnread",
|
|
4128
|
+
"referencesOptions",
|
|
4107
4129
|
"referencesDetails",
|
|
4108
4130
|
]);
|
|
4131
|
+
// INFO: large or parent-held values compared by identity, not content
|
|
4132
|
+
var IDENTITY_PROPS = new Set(["selectedIds"]);
|
|
4133
|
+
// INFO: worked out once per draw — the headers and the rows both ask, and
|
|
4134
|
+
// reading every prop's content twice would double its cost
|
|
4135
|
+
var drawTableVersion;
|
|
4136
|
+
/**
|
|
4137
|
+
* A number that changes whenever the linked records or their options do —
|
|
4138
|
+
* the parent's or those a cell's own search found. Only a column that draws
|
|
4139
|
+
* a linked record compares it.
|
|
4140
|
+
*/
|
|
4141
|
+
var handleGetReferencesVersion = function () {
|
|
4142
|
+
var key = [
|
|
4143
|
+
(0, rowRendering_1.handleGetIdentity)(props.referencesOptions),
|
|
4144
|
+
(0, rowRendering_1.handleGetIdentity)(props.referencesDetails),
|
|
4145
|
+
(0, rowRendering_1.handleGetIdentity)(referencesOptions),
|
|
4146
|
+
(0, rowRendering_1.handleGetIdentity)(referencesDetails),
|
|
4147
|
+
].join("|");
|
|
4148
|
+
if (key !== referencesVersionRef.current.key)
|
|
4149
|
+
referencesVersionRef.current = {
|
|
4150
|
+
key: key,
|
|
4151
|
+
version: referencesVersionRef.current.version + 1,
|
|
4152
|
+
};
|
|
4153
|
+
return referencesVersionRef.current.version;
|
|
4154
|
+
};
|
|
4155
|
+
// INFO: a column's dragged and capped widths. A measured width also decides
|
|
4156
|
+
// whether a cell's value is sized out of its column (w-0) — cells left
|
|
4157
|
+
// holding cleared widths would read as empty when the columns size
|
|
4158
|
+
// themselves again, and every content-sized column would shrink to its title
|
|
4159
|
+
var handleGetColumnWidthKey = function (colKey) { var _a, _b; return "".concat((_a = columnWidths[colKey]) !== null && _a !== void 0 ? _a : "", ":").concat((_b = cappedWidths[colKey]) !== null && _b !== void 0 ? _b : ""); };
|
|
4160
|
+
// INFO: a row's comment bubble is the only thing drawn from the counts
|
|
4161
|
+
var handleGetCommentKey = function (rowId) { var _a, _b, _c, _d; return "".concat((_b = (_a = props.commentCounts) === null || _a === void 0 ? void 0 : _a[rowId]) !== null && _b !== void 0 ? _b : "", "|").concat((_d = (_c = props.commentUnread) === null || _c === void 0 ? void 0 : _c[rowId]) !== null && _d !== void 0 ? _d : ""); };
|
|
4109
4162
|
/**
|
|
4110
4163
|
* A number that changes whenever anything every row draws from changes: the
|
|
4111
4164
|
* table's props apart from the row data, its edit, drag and width state, and
|
|
4112
4165
|
* the column type actions. Rows compare it to decide whether to draw again.
|
|
4113
4166
|
*/
|
|
4114
4167
|
var handleGetTableVersion = function () {
|
|
4168
|
+
if (drawTableVersion !== undefined)
|
|
4169
|
+
return drawTableVersion;
|
|
4115
4170
|
var rawProps = latestPropsRef.current;
|
|
4116
4171
|
var propParts = Object.keys(rawProps)
|
|
4117
4172
|
.filter(function (key) { return !ROW_INDEPENDENT_PROPS.has(key); })
|
|
@@ -4137,22 +4192,22 @@ var NewTable = function (rawProps) {
|
|
|
4137
4192
|
dropGroupId,
|
|
4138
4193
|
referenceLoading,
|
|
4139
4194
|
pinViewWidth,
|
|
4140
|
-
(0, rowRendering_1.handleGetIdentity)(referencesOptions),
|
|
4141
|
-
(0, rowRendering_1.handleGetIdentity)(referencesDetails),
|
|
4142
4195
|
(0, rowRendering_1.handleGetIdentity)(measuredPinWidths),
|
|
4143
|
-
|
|
4144
|
-
//
|
|
4145
|
-
//
|
|
4146
|
-
//
|
|
4147
|
-
|
|
4148
|
-
|
|
4196
|
+
// INFO: a pinned cell sits after the pinned columns before it, so every
|
|
4197
|
+
// cell counts their widths; each cell counts its own column's width
|
|
4198
|
+
// through handleGetColumnWidthKey, so a column measured as it scrolls
|
|
4199
|
+
// into view redraws only its own cells
|
|
4200
|
+
__spreadArray(__spreadArray([], leftPinned, true), rightPinned, true).map(function (key) { return "".concat(key, ":").concat(handleGetColumnWidthKey(key)); })
|
|
4201
|
+
.join(","),
|
|
4149
4202
|
], false).join("|");
|
|
4150
4203
|
if (cellKey !== cellVersionRef.current.key)
|
|
4151
4204
|
cellVersionRef.current = {
|
|
4152
4205
|
key: cellKey,
|
|
4153
4206
|
version: cellVersionRef.current.version + 1,
|
|
4154
4207
|
};
|
|
4155
|
-
|
|
4208
|
+
// INFO: a row draws again for any column's width, so its cells are
|
|
4209
|
+
// handed their columns' new widths
|
|
4210
|
+
var key = "".concat(cellKey, "|").concat((0, rowRendering_1.handleGetIdentity)(columnWidths), "|").concat((0, rowRendering_1.handleGetIdentity)(cappedWidths), "|").concat(handleGetReferencesVersion(), "|").concat(drawnColumnWindow
|
|
4156
4211
|
? "".concat(drawnColumnWindow.start, "-").concat(drawnColumnWindow.end)
|
|
4157
4212
|
: "");
|
|
4158
4213
|
if (key !== tableVersionRef.current.key)
|
|
@@ -4160,7 +4215,8 @@ var NewTable = function (rawProps) {
|
|
|
4160
4215
|
key: key,
|
|
4161
4216
|
version: tableVersionRef.current.version + 1,
|
|
4162
4217
|
};
|
|
4163
|
-
|
|
4218
|
+
drawTableVersion = tableVersionRef.current.version;
|
|
4219
|
+
return drawTableVersion;
|
|
4164
4220
|
};
|
|
4165
4221
|
// INFO: on a phone the first column that is not an id is the row's title
|
|
4166
4222
|
var handleGetPhoneTitleColumn = function () {
|
|
@@ -4347,7 +4403,7 @@ var NewTable = function (rawProps) {
|
|
|
4347
4403
|
var _a, _b, _c, _d;
|
|
4348
4404
|
var isSelected = ((_b = (_a = props.selectedIds) === null || _a === void 0 ? void 0 : _a.includes(row.id)) !== null && _b !== void 0 ? _b : false) ||
|
|
4349
4405
|
((_c = props.selectAll) !== null && _c !== void 0 ? _c : false);
|
|
4350
|
-
return (react_2.default.createElement(rowRendering_1.NewTableMemoRow, { key: row.id, row: row, spaceRow: (_d = props.spaceData) === null || _d === void 0 ? void 0 : _d[index], index: index, groupAccent: groupAccent, dropGroupId: dropGroup === null || dropGroup === void 0 ? void 0 : dropGroup.id, isSelected: isSelected, editValue: editDataRowId === row.id ? editDataValue : undefined, tableVersion: tableVersion, render: function () {
|
|
4406
|
+
return (react_2.default.createElement(rowRendering_1.NewTableMemoRow, { key: row.id, row: row, spaceRow: (_d = props.spaceData) === null || _d === void 0 ? void 0 : _d[index], index: index, groupAccent: groupAccent, dropGroupId: dropGroup === null || dropGroup === void 0 ? void 0 : dropGroup.id, isSelected: isSelected, editValue: editDataRowId === row.id ? editDataValue : undefined, commentKey: handleGetCommentKey(row.id), tableVersion: tableVersion, render: function () {
|
|
4351
4407
|
return props.mobileView
|
|
4352
4408
|
? renderPhoneRowContent(row, index, groupAccent, dropGroup)
|
|
4353
4409
|
: renderDesktopRowContent(row, index, groupAccent, dropGroup);
|
|
@@ -4363,7 +4419,7 @@ var NewTable = function (rawProps) {
|
|
|
4363
4419
|
// INFO: each body cell is kept on the same terms as its row, so the drawn
|
|
4364
4420
|
// columns moving mounts only those coming into view
|
|
4365
4421
|
var memoCells = {
|
|
4366
|
-
wrapCell: function (col,
|
|
4422
|
+
wrapCell: function (col, colIndex, render) { return (react_2.default.createElement(rowRendering_1.NewTableMemoCell, { key: col.key, row: row, spaceRow: spaceRow, colKey: col.key, index: index, groupAccent: groupAccent, dropGroupId: dropGroup === null || dropGroup === void 0 ? void 0 : dropGroup.id, isSelected: isSelected, editValue: editDataRowId === row.id ? editDataValue : undefined, commentKey: colIndex === 0 ? handleGetCommentKey(row.id) : "", widthKey: handleGetColumnWidthKey(col.key), referencesVersion: handleIsReferenceColumn(col) ? handleGetReferencesVersion() : 0, cellVersion: cellVersionRef.current.version, render: render })); },
|
|
4367
4423
|
};
|
|
4368
4424
|
return (react_2.default.createElement("tr", __assign({ key: row.id, "data-dtw-record-id": row.id, draggable: canDragRows && dragArmedRowId === row.id, onDragStart: function (e) { return handleRowDragStart(e, row.id); }, onDragEnd: handleRowDragEnd }, (dropGroup ? handleGroupDropProps(dropGroup) : {}), { onClick: function (e) {
|
|
4369
4425
|
var _a, _b;
|
|
@@ -4832,10 +4888,21 @@ var NewTable = function (rawProps) {
|
|
|
4832
4888
|
(((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? 1 : 0) +
|
|
4833
4889
|
(handleShowsActionColumn() ? 1 : 0);
|
|
4834
4890
|
if (!props.groups || props.groups.length === 0) {
|
|
4835
|
-
return
|
|
4891
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
4892
|
+
renderMemberRows("all", props.data.map(function (_row, index) { return index; }), tableVersion, columnCount, virtualGroups),
|
|
4893
|
+
renderListLoadMoreRow(columnCount)));
|
|
4836
4894
|
}
|
|
4837
4895
|
var indexById = new Map(props.data.map(function (row, index) { return [row.id, index]; }));
|
|
4838
|
-
|
|
4896
|
+
// INFO: when the list pages as a whole (bands that do not page themselves,
|
|
4897
|
+
// or one default band), its loading row goes under the last band's rows,
|
|
4898
|
+
// above its "Add item" row, where a band paging itself shows its own. A
|
|
4899
|
+
// last band that is collapsed or not drawn yet leaves it after the bands
|
|
4900
|
+
var lastGroup = props.groups[props.groups.length - 1];
|
|
4901
|
+
var isListLoadInLastBand = !collapsedGroupIds.includes(lastGroup.id) &&
|
|
4902
|
+
!(!!props.onGroupLoadMore &&
|
|
4903
|
+
!lastGroup.rowIds.length &&
|
|
4904
|
+
lastGroup.count === undefined);
|
|
4905
|
+
var bands = props.groups.map(function (group) {
|
|
4839
4906
|
var _a;
|
|
4840
4907
|
var colourKey = (_a = group.colour) !== null && _a !== void 0 ? _a : "none";
|
|
4841
4908
|
var isCollapsed = collapsedGroupIds.includes(group.id);
|
|
@@ -4871,6 +4938,9 @@ var NewTable = function (rawProps) {
|
|
|
4871
4938
|
renderMemberRows(group.id, memberIndexes.slice(0, handleGetGroupVisibleCount(group.id)), tableVersion, columnCount, virtualGroups, colourKey, group),
|
|
4872
4939
|
renderGroupShowMoreRow(group.id, memberIndexes.length, columnCount, isCollapsed),
|
|
4873
4940
|
renderGroupLoadMoreRow(group.id, columnCount, isCollapsed, isPending),
|
|
4941
|
+
group.id === lastGroup.id &&
|
|
4942
|
+
isListLoadInLastBand &&
|
|
4943
|
+
renderListLoadMoreRow(columnCount),
|
|
4874
4944
|
renderGroupPagerRow(group, columnCount, isCollapsed),
|
|
4875
4945
|
!props.mobileView &&
|
|
4876
4946
|
!isCollapsed &&
|
|
@@ -4881,6 +4951,9 @@ var NewTable = function (rawProps) {
|
|
|
4881
4951
|
!isPending &&
|
|
4882
4952
|
renderGroupSummaryRow(group, colourKey)));
|
|
4883
4953
|
});
|
|
4954
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
4955
|
+
bands,
|
|
4956
|
+
!isListLoadInLastBand && renderListLoadMoreRow(columnCount)));
|
|
4884
4957
|
};
|
|
4885
4958
|
// INFO: a band's total, or a pulse while it is still being counted — the
|
|
4886
4959
|
// rows loaded so far would read as the total and then jump
|
|
@@ -4985,6 +5058,24 @@ var NewTable = function (rawProps) {
|
|
|
4985
5058
|
" ",
|
|
4986
5059
|
remaining))));
|
|
4987
5060
|
};
|
|
5061
|
+
// INFO: the cue under the last row while the next rows load — where the
|
|
5062
|
+
// eye is when the end of the list or a band is reached. Held to the left
|
|
5063
|
+
// edge of the scroller, under the first column like a band's "Add item": a
|
|
5064
|
+
// wide table would carry a centred cue off screen
|
|
5065
|
+
var renderLoadingMoreCue = function () { return (react_2.default.createElement("span", { role: "status", className: "sticky left-0 flex w-max items-center gap-x-2 py-3 !px-6 text-sm ".concat(props.darkMode ? "text-gray-400" : "text-gray-500") },
|
|
5066
|
+
react_2.default.createElement(loading_1.Loading, { sizeClassName: "h-4 w-4 !border-2" }),
|
|
5067
|
+
"Loading for more...")); };
|
|
5068
|
+
// INFO: the list's own next page, read by a sentinel the parent keeps under
|
|
5069
|
+
// the table — drawn after the last row, or the last band when the bands do
|
|
5070
|
+
// not page themselves
|
|
5071
|
+
var renderListLoadMoreRow = function (columnCount) {
|
|
5072
|
+
if (props.paginationType !== "scroll" || !props.loadingMore)
|
|
5073
|
+
return null;
|
|
5074
|
+
if (isGroupPaging)
|
|
5075
|
+
return null;
|
|
5076
|
+
return (react_2.default.createElement("tr", { "data-testid": "table-loading-more", className: "border-l-4 border-transparent" },
|
|
5077
|
+
react_2.default.createElement("td", { colSpan: columnCount, className: "p-0" }, renderLoadingMoreCue())));
|
|
5078
|
+
};
|
|
4988
5079
|
// INFO: per-group scroll sentinel row. Rendered after a band's member rows in
|
|
4989
5080
|
// grouped scroll mode so the group lazily loads its next page as it scrolls
|
|
4990
5081
|
// into view; shows a spinner while that group's page is in flight. Nothing is
|
|
@@ -5004,7 +5095,7 @@ var NewTable = function (rawProps) {
|
|
|
5004
5095
|
var isSpinning = !!(status === null || status === void 0 ? void 0 : status.loadingMore) && !isPending;
|
|
5005
5096
|
return (react_2.default.createElement("tr", { "data-testid": "table-group-sentinel-".concat(groupId), className: "border-l-4 border-transparent" },
|
|
5006
5097
|
react_2.default.createElement("td", { colSpan: columnCount, className: "p-0" },
|
|
5007
|
-
react_2.default.createElement("div", { "data-group-sentinel": groupId, ref: handleGroupSentinelRef(groupId), className: "
|
|
5098
|
+
react_2.default.createElement("div", { "data-group-sentinel": groupId, ref: handleGroupSentinelRef(groupId), className: "min-h-px w-full" }, isSpinning && renderLoadingMoreCue()))));
|
|
5008
5099
|
};
|
|
5009
5100
|
// INFO: page mode pager under a band's rows — the list's own footer
|
|
5010
5101
|
// (numbered pages, chevrons, go-to-page) scoped to that group; hidden while
|
|
@@ -5270,11 +5361,17 @@ var NewTable = function (rawProps) {
|
|
|
5270
5361
|
react_2.default.createElement("div", { className: "flex flex-row items-center md:hidden" },
|
|
5271
5362
|
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"); } }))));
|
|
5272
5363
|
};
|
|
5364
|
+
// INFO: worked out before the headers draw, so they compare this draw's
|
|
5365
|
+
// cell version rather than the last one's
|
|
5366
|
+
handleGetTableVersion();
|
|
5273
5367
|
if (!hasGroupHeaders) {
|
|
5274
5368
|
return (react_2.default.createElement("thead", null,
|
|
5275
5369
|
react_2.default.createElement("tr", { className: "border-b ".concat(dividerColor, " ").concat(tableHeaderBgColor, " ").concat(tableHeaderFontColor) },
|
|
5276
5370
|
props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: handleGetCheckboxPinStyle(3) }, renderSelectAll())),
|
|
5277
|
-
handleMapDrawnColumns({
|
|
5371
|
+
handleMapDrawnColumns({
|
|
5372
|
+
tag: "th",
|
|
5373
|
+
wrapCell: function (col, _colIndex, render) { return (react_2.default.createElement(rowRendering_1.NewTableMemoHeaderCell, { key: col.key, colKey: col.key, widthKey: handleGetColumnWidthKey(col.key), title: col.title, cellVersion: cellVersionRef.current.version, render: render })); },
|
|
5374
|
+
}, function (col) {
|
|
5278
5375
|
var _a, _b, _c, _d;
|
|
5279
5376
|
return (react_2.default.createElement("th", { key: col.key, "data-column-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)
|
|
5280
5377
|
? {
|
|
@@ -5334,28 +5431,28 @@ var NewTable = function (rawProps) {
|
|
|
5334
5431
|
};
|
|
5335
5432
|
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 : "") })); };
|
|
5336
5433
|
if (props.mobileView) {
|
|
5337
|
-
var hasPhoneGroups = !!((
|
|
5434
|
+
var hasPhoneGroups = !!((_w = props.groups) === null || _w === void 0 ? void 0 : _w.length);
|
|
5338
5435
|
// INFO: bands that page themselves show their headers while their rows
|
|
5339
5436
|
// load, so an empty list there is not yet known to be empty. A band that
|
|
5340
5437
|
// holds every loaded row (the Ungrouped band) is, so its empty list still
|
|
5341
5438
|
// says so under the band
|
|
5342
5439
|
var isPhoneEmptyKnown = !hasPhoneGroups ||
|
|
5343
|
-
!!((
|
|
5440
|
+
!!((_x = props.groups) === null || _x === void 0 ? void 0 : _x.every(function (eachGroup) { return eachGroup.unbatched; }));
|
|
5344
5441
|
return (react_2.default.createElement("div", null,
|
|
5345
|
-
react_2.default.createElement("div", { className: "w-full ".concat(((
|
|
5442
|
+
react_2.default.createElement("div", { className: "w-full ".concat(((_y = props.mobileTooltip) === null || _y === void 0 ? void 0 : _y.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
|
|
5346
5443
|
? ""
|
|
5347
|
-
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((
|
|
5444
|
+
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_z = props.className) !== null && _z !== void 0 ? _z : "") },
|
|
5348
5445
|
react_2.default.createElement("div", { className: "p-3 flex items-center justify-between" },
|
|
5349
5446
|
renderSelectAll(),
|
|
5350
5447
|
react_2.default.createElement("div", { className: "flex items-center gap-2" },
|
|
5351
5448
|
renderSelectedCount(),
|
|
5352
|
-
((
|
|
5449
|
+
((_0 = props.advSettings) === null || _0 === void 0 ? void 0 : _0.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"); } })))),
|
|
5353
5450
|
props.loading &&
|
|
5354
5451
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
5355
5452
|
react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
|
|
5356
5453
|
!props.loading && (props.data.length > 0 || hasPhoneGroups) && (react_2.default.createElement("table", { className: "w-full table-fixed", ref: tableRef },
|
|
5357
5454
|
react_2.default.createElement("tbody", { className: "divide-y ".concat(dividerColor) }, renderDesktopRows()))),
|
|
5358
|
-
!props.loading && props.data.length === 0 && isPhoneEmptyKnown && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (
|
|
5455
|
+
!props.loading && props.data.length === 0 && isPhoneEmptyKnown && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_1 = props.emptyTitle) !== null && _1 !== void 0 ? _1 : "No items"))),
|
|
5359
5456
|
isFooterPinned ? (react_2.default.createElement("div", { "data-testid": BOTTOM_STRIP_TEST_ID, className: "sticky bottom-0 z-[4] pb-2 ".concat(bgColor) }, renderFooter())) : (renderFooter()),
|
|
5360
5457
|
renderFloatingActionBar(),
|
|
5361
5458
|
renderAddColumnModal()));
|
|
@@ -5371,13 +5468,13 @@ var NewTable = function (rawProps) {
|
|
|
5371
5468
|
: [])[0];
|
|
5372
5469
|
return WIDE_EDIT_TYPES.includes((_a = selectedDS === null || selectedDS === void 0 ? void 0 : selectedDS.type) !== null && _a !== void 0 ? _a : "") ? "4xl" : "2xl";
|
|
5373
5470
|
};
|
|
5374
|
-
return (react_2.default.createElement("div", { ref: setDesktopRoot, className: "w-full ".concat((
|
|
5471
|
+
return (react_2.default.createElement("div", { ref: setDesktopRoot, className: "w-full ".concat((_2 = props.className) !== null && _2 !== void 0 ? _2 : "") },
|
|
5375
5472
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
5376
5473
|
var _a, _b;
|
|
5377
5474
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
5378
5475
|
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))));
|
|
5379
5476
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
5380
|
-
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (
|
|
5477
|
+
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_4 = (_3 = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _3 === void 0 ? void 0 : _3.title) !== null && _4 !== void 0 ? _4 : "Edit", maxWidth: handleGetEditModalWidth(), onClose: handleModalEditClose, renderContent: function () {
|
|
5381
5478
|
var _a, _b, _c, _d;
|
|
5382
5479
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
5383
5480
|
if (!selectedCol)
|
|
@@ -5423,7 +5520,7 @@ var NewTable = function (rawProps) {
|
|
|
5423
5520
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
5424
5521
|
? ""
|
|
5425
5522
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode, stickyScrollbar: true, stickyScrollbarOffset: bottomOffset },
|
|
5426
|
-
(props.selectAll || ((
|
|
5523
|
+
(props.selectAll || ((_6 = (_5 = props.selectedIds) === null || _5 === void 0 ? void 0 : _5.length) !== null && _6 !== void 0 ? _6 : 0) > 0) &&
|
|
5427
5524
|
(!props.multiActionFloatingBtns ||
|
|
5428
5525
|
(props.multiActionFloatingBtns &&
|
|
5429
5526
|
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" },
|
|
@@ -5451,7 +5548,7 @@ var NewTable = function (rawProps) {
|
|
|
5451
5548
|
(addData
|
|
5452
5549
|
? !isAddRowPinned && !addGroupId && renderAddDataRow()
|
|
5453
5550
|
: !handleHasGroupAddRows() && renderEmptyAddRow()))),
|
|
5454
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (
|
|
5551
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_7 = props.emptyTitle) !== null && _7 !== void 0 ? _7 : "No items"))),
|
|
5455
5552
|
renderBottomStrip(),
|
|
5456
5553
|
renderFloatingActionBar()));
|
|
5457
5554
|
};
|