blixify-ui-web 1.3.34 → 1.3.35
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 +412 -333
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/display/groupSection/index.d.ts +8 -0
- package/lib/components/display/groupSection/index.d.ts.map +1 -1
- package/lib/components/display/groupSection/index.js +46 -1
- package/lib/components/display/groupSection/index.js.map +1 -1
- package/lib/components/display/newGrid/index.d.ts.map +1 -1
- package/lib/components/display/newGrid/index.js +4 -1
- package/lib/components/display/newGrid/index.js.map +1 -1
- package/lib/components/display/newList/index.d.ts.map +1 -1
- package/lib/components/display/newList/index.js +4 -1
- package/lib/components/display/newList/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 +89 -78
- package/lib/components/display/newTable/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -591,7 +591,7 @@ var handleGetListColour = function (col, value) {
|
|
|
591
591
|
return column.listSelectionColour[index] || undefined;
|
|
592
592
|
};
|
|
593
593
|
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;
|
|
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;
|
|
595
595
|
// INFO: props are read through the latest render. A row that was not drawn
|
|
596
596
|
// again keeps the handlers of the render that drew it, and those read
|
|
597
597
|
// props.onClickRow, props.data and the rest at the time they run — so a
|
|
@@ -700,8 +700,8 @@ var NewTable = function (rawProps) {
|
|
|
700
700
|
// a row is added, the footer wraps on a narrow screen), so it is watched
|
|
701
701
|
// rather than measured once. A state ref, not useRef, so watching starts
|
|
702
702
|
// when the desktop layout mounts after the mobile one.
|
|
703
|
-
var
|
|
704
|
-
var
|
|
703
|
+
var _7 = (0, react_2.useState)(null), desktopRoot = _7[0], setDesktopRoot = _7[1];
|
|
704
|
+
var _8 = (0, react_2.useState)(0), bottomOffset = _8[0], setBottomOffset = _8[1];
|
|
705
705
|
(0, react_2.useLayoutEffect)(function () {
|
|
706
706
|
if (!desktopRoot)
|
|
707
707
|
return;
|
|
@@ -757,43 +757,43 @@ var NewTable = function (rawProps) {
|
|
|
757
757
|
//=====================================================================================
|
|
758
758
|
// SECTION: Advanced Settings
|
|
759
759
|
//=====================================================================================
|
|
760
|
-
var
|
|
761
|
-
var
|
|
760
|
+
var _9 = (0, react_2.useState)(""), filterModal = _9[0], setFilterModal = _9[1];
|
|
761
|
+
var _10 = (0, react_2.useState)(""), addColumnModal = _10[0], setAddColumnModal = _10[1];
|
|
762
762
|
// INFO: what a DataTemplate around the table lets a cell save
|
|
763
763
|
var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
767
|
-
var
|
|
768
|
-
var
|
|
769
|
-
var
|
|
770
|
-
var
|
|
764
|
+
var _11 = (0, react_2.useState)(""), newColumnName = _11[0], setNewColumnName = _11[1];
|
|
765
|
+
var _12 = (0, react_2.useState)("string"), newColumnType = _12[0], setNewColumnType = _12[1];
|
|
766
|
+
var _13 = (0, react_2.useState)(""), newColumnRefSpace = _13[0], setNewColumnRefSpace = _13[1];
|
|
767
|
+
var _14 = (0, react_2.useState)(""), newColumnRefLabel = _14[0], setNewColumnRefLabel = _14[1];
|
|
768
|
+
var _15 = (0, react_2.useState)(""), newColumnLookupReference = _15[0], setNewColumnLookupReference = _15[1];
|
|
769
|
+
var _16 = (0, react_2.useState)(""), newColumnLookupField = _16[0], setNewColumnLookupField = _16[1];
|
|
770
|
+
var _17 = (0, react_2.useState)([]), newColumnOptions = _17[0], setNewColumnOptions = _17[1];
|
|
771
771
|
// 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
|
|
772
|
+
var _18 = (0, react_2.useState)(null), optionColourKey = _18[0], setOptionColourKey = _18[1];
|
|
773
|
+
var _19 = (0, react_2.useState)(false), newColumnRequired = _19[0], setNewColumnRequired = _19[1];
|
|
774
|
+
var _20 = (0, react_2.useState)(false), newColumnUnique = _20[0], setNewColumnUnique = _20[1];
|
|
775
|
+
var _21 = (0, react_2.useState)(false), newColumnReadOnly = _21[0], setNewColumnReadOnly = _21[1];
|
|
776
|
+
var _22 = (0, react_2.useState)(""), newColumnRatingMax = _22[0], setNewColumnRatingMax = _22[1];
|
|
777
|
+
var _23 = (0, react_2.useState)(""), newColumnDateFormat = _23[0], setNewColumnDateFormat = _23[1];
|
|
778
|
+
var _24 = (0, react_2.useState)(""), newColumnButtonLabel = _24[0], setNewColumnButtonLabel = _24[1];
|
|
779
|
+
var _25 = (0, react_2.useState)(""), newColumnButtonColour = _25[0], setNewColumnButtonColour = _25[1];
|
|
780
|
+
var _26 = (0, react_2.useState)(""), newColumnButtonConfirm = _26[0], setNewColumnButtonConfirm = _26[1];
|
|
781
781
|
// INFO: the app's settings for the column (renderColumnSettings), kept apart
|
|
782
782
|
// from the built-in ones because the table does not know their keys
|
|
783
|
-
var
|
|
784
|
-
var
|
|
785
|
-
var
|
|
786
|
-
var
|
|
783
|
+
var _27 = (0, react_2.useState)({}), newColumnAppSettings = _27[0], setNewColumnAppSettings = _27[1];
|
|
784
|
+
var _28 = (0, react_2.useState)(true), newColumnAppReady = _28[0], setNewColumnAppReady = _28[1];
|
|
785
|
+
var _29 = (0, react_2.useState)(false), addingColumn = _29[0], setAddingColumn = _29[1];
|
|
786
|
+
var _30 = (0, react_2.useState)(false), confirmDeleteColumn = _30[0], setConfirmDeleteColumn = _30[1];
|
|
787
787
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
788
|
-
var
|
|
788
|
+
var _31 = (0, react_2.useState)(""), newColumnFormula = _31[0], setNewColumnFormula = _31[1];
|
|
789
789
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
790
790
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
791
|
-
var
|
|
791
|
+
var _32 = (0, react_2.useState)(null), editingColumn = _32[0], setEditingColumn = _32[1];
|
|
792
792
|
//=====================================================================================
|
|
793
793
|
// SECTION: Editable & Addable cells
|
|
794
794
|
//=====================================================================================
|
|
795
|
-
var
|
|
796
|
-
var
|
|
795
|
+
var _33 = (0, react_2.useState)(""), editDataRowId = _33[0], setEditDataRowId = _33[1];
|
|
796
|
+
var _34 = (0, react_2.useState)(""), editDataHeaderKey = _34[0], setEditDataHeaderKey = _34[1];
|
|
797
797
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
798
798
|
// form, and a row click always landed on a child input. Only the clicked cell
|
|
799
799
|
// becomes its input now (Gantt and canvas cells still on hover, through
|
|
@@ -803,13 +803,24 @@ var NewTable = function (rawProps) {
|
|
|
803
803
|
var pendingFocusRef = (0, react_2.useRef)("");
|
|
804
804
|
// INFO: the cell a coloured multiple list is being picked in — its popover
|
|
805
805
|
// hangs from this element
|
|
806
|
-
var
|
|
807
|
-
var
|
|
806
|
+
var _35 = (0, react_2.useState)(null), labelPickerAnchor = _35[0], setLabelPickerAnchor = _35[1];
|
|
807
|
+
var _36 = (0, react_2.useState)(false), modalEditVisible = _36[0], setModalEditVisible = _36[1];
|
|
808
808
|
// INFO: whether the modal's signature pad has been drawn on
|
|
809
|
-
var
|
|
810
|
-
var
|
|
809
|
+
var _37 = (0, react_2.useState)(false), signatureSigning = _37[0], setSignatureSigning = _37[1];
|
|
810
|
+
var _38 = (0, react_2.useState)([]), collapsedGroupIds = _38[0], setCollapsedGroupIds = _38[1];
|
|
811
|
+
var isAllGroupsCollapsed = !!((_h = props.groups) === null || _h === void 0 ? void 0 : _h.length) &&
|
|
812
|
+
props.groups.every(function (eachGroup) { return collapsedGroupIds.includes(eachGroup.id); });
|
|
813
|
+
var onAllGroupsCollapsedChangeRef = (0, react_2.useRef)(props.onAllGroupsCollapsedChange);
|
|
814
|
+
onAllGroupsCollapsedChangeRef.current = props.onAllGroupsCollapsedChange;
|
|
815
|
+
(0, react_2.useEffect)(function () {
|
|
816
|
+
var _a;
|
|
817
|
+
(_a = onAllGroupsCollapsedChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onAllGroupsCollapsedChangeRef, isAllGroupsCollapsed);
|
|
818
|
+
}, [isAllGroupsCollapsed]);
|
|
819
|
+
// INFO: a table that goes away (another tab, another layout) leaves no band
|
|
820
|
+
// collapsed behind it
|
|
821
|
+
(0, react_2.useEffect)(function () { return function () { var _a; return (_a = onAllGroupsCollapsedChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onAllGroupsCollapsedChangeRef, false); }; }, []);
|
|
811
822
|
// INFO: rows shown per section when the sections do not page themselves
|
|
812
|
-
var
|
|
823
|
+
var _39 = (0, react_2.useState)({}), groupVisibleCounts = _39[0], setGroupVisibleCounts = _39[1];
|
|
813
824
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
814
825
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
815
826
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -827,36 +838,36 @@ var NewTable = function (rawProps) {
|
|
|
827
838
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
828
839
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
829
840
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
830
|
-
var
|
|
831
|
-
var
|
|
832
|
-
var
|
|
833
|
-
var
|
|
841
|
+
var _40 = (0, react_2.useState)(false), isDragSelecting = _40[0], setIsDragSelecting = _40[1];
|
|
842
|
+
var _41 = (0, react_2.useState)(0), copiedCount = _41[0], setCopiedCount = _41[1];
|
|
843
|
+
var _42 = (0, react_2.useState)({}), editDataValue = _42[0], setEditDataValue = _42[1];
|
|
844
|
+
var _43 = (0, react_2.useState)(false), editDataIsLoading = _43[0], setEditDataIsLoading = _43[1];
|
|
834
845
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
835
846
|
// always there in an addable table
|
|
836
|
-
var
|
|
847
|
+
var _44 = (0, react_2.useState)(false), addData = _44[0], setAddData = _44[1];
|
|
837
848
|
var isAddRowPinned = props.paginationType === "scroll";
|
|
838
|
-
var
|
|
849
|
+
var _45 = (0, react_2.useState)({}), addDataValue = _45[0], setAddDataValue = _45[1];
|
|
839
850
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
840
851
|
// inputs and its first cell takes the focus
|
|
841
|
-
var
|
|
852
|
+
var _46 = (0, react_2.useState)(0), addRowKey = _46[0], setAddRowKey = _46[1];
|
|
842
853
|
// INFO: the add row's coloured multiple list being picked — its label
|
|
843
854
|
// picker hangs from this cell
|
|
844
855
|
// INFO: the new row's required tag columns left empty on a save — their
|
|
845
856
|
// cells are ringed red until a label is picked
|
|
846
|
-
var
|
|
847
|
-
var
|
|
857
|
+
var _47 = (0, react_2.useState)([]), addTagErrors = _47[0], setAddTagErrors = _47[1];
|
|
858
|
+
var _48 = (0, react_2.useState)(null), addLabelPicker = _48[0], setAddLabelPicker = _48[1];
|
|
848
859
|
// INFO: the group whose own add row is being filled in; "" = the bottom row
|
|
849
|
-
var
|
|
860
|
+
var _49 = (0, react_2.useState)(""), addGroupId = _49[0], setAddGroupId = _49[1];
|
|
850
861
|
// INFO: the row armed by a press on its handle, so only the handle — never
|
|
851
862
|
// a click or a text selection in a cell — starts a drag
|
|
852
|
-
var
|
|
853
|
-
var
|
|
854
|
-
var
|
|
855
|
-
var
|
|
863
|
+
var _50 = (0, react_2.useState)(""), dragArmedRowId = _50[0], setDragArmedRowId = _50[1];
|
|
864
|
+
var _51 = (0, react_2.useState)(""), draggingRowId = _51[0], setDraggingRowId = _51[1];
|
|
865
|
+
var _52 = (0, react_2.useState)(""), dropGroupId = _52[0], setDropGroupId = _52[1];
|
|
866
|
+
var _53 = (0, react_2.useState)({}), referencesOptions = _53[0], setReferencesOptions = _53[1];
|
|
856
867
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
857
868
|
// results still win per key
|
|
858
|
-
var mergedReferencesOptions = __assign(__assign({}, ((
|
|
859
|
-
var
|
|
869
|
+
var mergedReferencesOptions = __assign(__assign({}, ((_j = props.referencesOptions) !== null && _j !== void 0 ? _j : {})), referencesOptions);
|
|
870
|
+
var _54 = (0, react_2.useState)({}), referencesDetails = _54[0], setReferencesDetails = _54[1];
|
|
860
871
|
// INFO: per column, the records a search found and the records the parent
|
|
861
872
|
// passes in, matched by id — a search copies the parent's records into the
|
|
862
873
|
// local map, so the parent's copy wins and a reload of the list reaches the
|
|
@@ -866,13 +877,13 @@ var NewTable = function (rawProps) {
|
|
|
866
877
|
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
867
878
|
return handleMergeReferencesDetails(referencesDetails, props.referencesDetails);
|
|
868
879
|
}, [referencesDetails, props.referencesDetails]);
|
|
869
|
-
var
|
|
880
|
+
var _55 = (0, react_2.useState)(false), referenceLoading = _55[0], setReferenceLoading = _55[1];
|
|
870
881
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
871
|
-
var
|
|
882
|
+
var _56 = (0, react_2.useState)({}), measuredPinWidths = _56[0], setMeasuredPinWidths = _56[1];
|
|
872
883
|
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
873
|
-
var
|
|
884
|
+
var _57 = (0, react_2.useState)(0), pinViewWidth = _57[0], setPinViewWidth = _57[1];
|
|
874
885
|
// INFO: per large group, the rows [start, end) drawn; the rest are spacers
|
|
875
|
-
var
|
|
886
|
+
var _58 = (0, react_2.useState)({}), virtualRanges = _58[0], setVirtualRanges = _58[1];
|
|
876
887
|
// INFO: each drawn row's measured height, kept so a spacer is as tall as the
|
|
877
888
|
// rows it stands in for
|
|
878
889
|
var rowHeightsRef = (0, react_2.useRef)(new Map());
|
|
@@ -884,7 +895,7 @@ var NewTable = function (rawProps) {
|
|
|
884
895
|
// its left edge as an offset from the first of them, and its width. Set only
|
|
885
896
|
// when the drawn columns no longer cover it, so scrolling inside them draws
|
|
886
897
|
// nothing
|
|
887
|
-
var
|
|
898
|
+
var _59 = (0, react_2.useState)(null), columnView = _59[0], setColumnView = _59[1];
|
|
888
899
|
// INFO: each drawn unpinned column's measured width, so a spacer is as wide
|
|
889
900
|
// as the columns it stands in for
|
|
890
901
|
var columnWidthsMeasuredRef = (0, react_2.useRef)({});
|
|
@@ -1070,13 +1081,13 @@ var NewTable = function (rawProps) {
|
|
|
1070
1081
|
var bgColor = props.darkMode
|
|
1071
1082
|
? props.darkModeBg || "bg-gray-900"
|
|
1072
1083
|
: "bg-white";
|
|
1073
|
-
var isFlat = !!((
|
|
1084
|
+
var isFlat = !!((_k = props.advSettings) === null || _k === void 0 ? void 0 : _k.flat);
|
|
1074
1085
|
var borderRadius = isFlat ? "" : "rounded-2xl";
|
|
1075
1086
|
var borderColor = props.darkMode ? "border-gray-700" : "border-gray-100";
|
|
1076
1087
|
var selectedRowBg = props.darkMode ? "bg-gray-700" : "bg-primary-50";
|
|
1077
1088
|
var rowHoverBg = props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100";
|
|
1078
1089
|
var dividerColor = props.darkMode ? "divide-gray-700" : "divide-gray-100";
|
|
1079
|
-
var gridLines = (
|
|
1090
|
+
var gridLines = (_l = props.gridLines) !== null && _l !== void 0 ? _l : "horizontal";
|
|
1080
1091
|
// INFO: a coloured list cell paints its whole table cell, like a
|
|
1081
1092
|
// spreadsheet's cell fill, instead of holding a chip. The Select
|
|
1082
1093
|
// inside is told (cellInput.fill) to keep only the label colour. Same shades
|
|
@@ -1146,8 +1157,8 @@ var NewTable = function (rawProps) {
|
|
|
1146
1157
|
var errorFontColor = props.darkMode ? "text-red-300" : "text-red-500";
|
|
1147
1158
|
// INFO: an edit commits on blur, but navigating away unmounts the table
|
|
1148
1159
|
// without one — the cell was left dirty on screen and the value never sent.
|
|
1149
|
-
var onUpdateDataRef = (0, react_2.useRef)((
|
|
1150
|
-
onUpdateDataRef.current = (
|
|
1160
|
+
var onUpdateDataRef = (0, react_2.useRef)((_m = props.editable) === null || _m === void 0 ? void 0 : _m.onUpdateData);
|
|
1161
|
+
onUpdateDataRef.current = (_o = props.editable) === null || _o === void 0 ? void 0 : _o.onUpdateData;
|
|
1151
1162
|
(0, react_2.useEffect)(function () {
|
|
1152
1163
|
return function () {
|
|
1153
1164
|
var _a, _b;
|
|
@@ -1889,9 +1900,9 @@ var NewTable = function (rawProps) {
|
|
|
1889
1900
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1890
1901
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1891
1902
|
// class.
|
|
1892
|
-
var
|
|
1903
|
+
var _60 = (0, react_2.useState)({}), columnWidths = _60[0], setColumnWidths = _60[1];
|
|
1893
1904
|
// INFO: caps measured for content-sized columns — see handleMeasureCaps
|
|
1894
|
-
var
|
|
1905
|
+
var _61 = (0, react_2.useState)({}), cappedWidths = _61[0], setCappedWidths = _61[1];
|
|
1895
1906
|
// INFO: width — the drag's latest width. The release reads it here rather
|
|
1896
1907
|
// than from columnWidths, which holds only what the last drawn render saw: a
|
|
1897
1908
|
// slow table can still be drawing the last moves when the pointer is let go
|
|
@@ -2107,10 +2118,10 @@ var NewTable = function (rawProps) {
|
|
|
2107
2118
|
// stops a value being cut at a character count, and a capped cell still
|
|
2108
2119
|
// holds its whole value — it shows when the column is widened and copies in
|
|
2109
2120
|
// full. Not under grouped headers, which draw without fixed widths.
|
|
2110
|
-
var
|
|
2121
|
+
var _62 = (0, react_2.useState)(0), capCheck = _62[0], setCapCheck = _62[1];
|
|
2111
2122
|
var capsKey = [
|
|
2112
|
-
(
|
|
2113
|
-
(
|
|
2123
|
+
(_p = props.advSettings) === null || _p === void 0 ? void 0 : _p.maxFirstColumnWidth,
|
|
2124
|
+
(_q = props.advSettings) === null || _q === void 0 ? void 0 : _q.maxColumnWidth,
|
|
2114
2125
|
flatColumns.map(function (col) { var _a; return "".concat(col.key, ":").concat((_a = col.width) !== null && _a !== void 0 ? _a : ""); }).join(","),
|
|
2115
2126
|
].join("|");
|
|
2116
2127
|
// INFO: only adds caps — a column already capped is at its widest. Run on
|
|
@@ -2202,7 +2213,7 @@ var NewTable = function (rawProps) {
|
|
|
2202
2213
|
(REFERENCE_TYPES.includes(col.type) || col.type === "lookup");
|
|
2203
2214
|
});
|
|
2204
2215
|
var referencesLoaded = !hasReferenceColumns ||
|
|
2205
|
-
Object.keys((
|
|
2216
|
+
Object.keys((_r = props.referencesDetails) !== null && _r !== void 0 ? _r : {}).length > 0;
|
|
2206
2217
|
var referencesLoadedRef = (0, react_2.useRef)(referencesLoaded);
|
|
2207
2218
|
// INFO: names that came after the widths were kept size the columns once
|
|
2208
2219
|
// more, so a slow load does not leave a reference column cut short
|
|
@@ -3127,7 +3138,7 @@ var NewTable = function (rawProps) {
|
|
|
3127
3138
|
return Math.max(width, (_b = getTitleMinWidth(key)) !== null && _b !== void 0 ? _b : 0);
|
|
3128
3139
|
};
|
|
3129
3140
|
var pinCheckboxOffset = props.checkbox &&
|
|
3130
|
-
(props.data.length > 0 || (props.spaceData && ((
|
|
3141
|
+
(props.data.length > 0 || (props.spaceData && ((_s = props.spaceData) === null || _s === void 0 ? void 0 : _s.length) > 0))
|
|
3131
3142
|
? CHECKBOX_WIDTH
|
|
3132
3143
|
: 0;
|
|
3133
3144
|
/**
|
|
@@ -3749,7 +3760,7 @@ var NewTable = function (rawProps) {
|
|
|
3749
3760
|
};
|
|
3750
3761
|
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
3751
3762
|
// only read by the render helpers called from the return below
|
|
3752
|
-
var
|
|
3763
|
+
var _63 = handleFitPins(), fittedLeftPins = _63.widths, narrowPins = _63.narrow;
|
|
3753
3764
|
var renderActionColumnHeader = function () {
|
|
3754
3765
|
if (handleShowsActionColumn()) {
|
|
3755
3766
|
var pin = handleGetActionCellPin(true);
|
|
@@ -3977,7 +3988,7 @@ var NewTable = function (rawProps) {
|
|
|
3977
3988
|
};
|
|
3978
3989
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
3979
3990
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
3980
|
-
((
|
|
3991
|
+
((_u = (_t = props.selectedIds) === null || _t === void 0 ? void 0 : _t.length) !== null && _u !== void 0 ? _u : 0) >= props.maxSelectedCount;
|
|
3981
3992
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
3982
3993
|
// rows show the band's colour as a bar down their left edge.
|
|
3983
3994
|
var handleRowDragStart = function (event, rowId) {
|
|
@@ -5272,28 +5283,28 @@ var NewTable = function (rawProps) {
|
|
|
5272
5283
|
};
|
|
5273
5284
|
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 : "") })); };
|
|
5274
5285
|
if (props.mobileView) {
|
|
5275
|
-
var hasPhoneGroups = !!((
|
|
5286
|
+
var hasPhoneGroups = !!((_v = props.groups) === null || _v === void 0 ? void 0 : _v.length);
|
|
5276
5287
|
// INFO: bands that page themselves show their headers while their rows
|
|
5277
5288
|
// load, so an empty list there is not yet known to be empty. A band that
|
|
5278
5289
|
// holds every loaded row (the Ungrouped band) is, so its empty list still
|
|
5279
5290
|
// says so under the band
|
|
5280
5291
|
var isPhoneEmptyKnown = !hasPhoneGroups ||
|
|
5281
|
-
!!((
|
|
5292
|
+
!!((_w = props.groups) === null || _w === void 0 ? void 0 : _w.every(function (eachGroup) { return eachGroup.unbatched; }));
|
|
5282
5293
|
return (react_2.default.createElement("div", null,
|
|
5283
|
-
react_2.default.createElement("div", { className: "w-full ".concat(((
|
|
5294
|
+
react_2.default.createElement("div", { className: "w-full ".concat(((_x = props.mobileTooltip) === null || _x === void 0 ? void 0 : _x.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
|
|
5284
5295
|
? ""
|
|
5285
|
-
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((
|
|
5296
|
+
: "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_y = props.className) !== null && _y !== void 0 ? _y : "") },
|
|
5286
5297
|
react_2.default.createElement("div", { className: "p-3 flex items-center justify-between" },
|
|
5287
5298
|
renderSelectAll(),
|
|
5288
5299
|
react_2.default.createElement("div", { className: "flex items-center gap-2" },
|
|
5289
5300
|
renderSelectedCount(),
|
|
5290
|
-
((
|
|
5301
|
+
((_z = props.advSettings) === null || _z === void 0 ? void 0 : _z.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"); } })))),
|
|
5291
5302
|
props.loading &&
|
|
5292
5303
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
5293
5304
|
react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
|
|
5294
5305
|
!props.loading && (props.data.length > 0 || hasPhoneGroups) && (react_2.default.createElement("table", { className: "w-full table-fixed", ref: tableRef },
|
|
5295
5306
|
react_2.default.createElement("tbody", { className: "divide-y ".concat(dividerColor) }, renderDesktopRows()))),
|
|
5296
|
-
!props.loading && props.data.length === 0 && isPhoneEmptyKnown && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (
|
|
5307
|
+
!props.loading && props.data.length === 0 && isPhoneEmptyKnown && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_0 = props.emptyTitle) !== null && _0 !== void 0 ? _0 : "No items"))),
|
|
5297
5308
|
isFooterPinned ? (react_2.default.createElement("div", { "data-testid": BOTTOM_STRIP_TEST_ID, className: "sticky bottom-0 z-[4] pb-2 ".concat(bgColor) }, renderFooter())) : (renderFooter()),
|
|
5298
5309
|
renderFloatingActionBar(),
|
|
5299
5310
|
renderAddColumnModal()));
|
|
@@ -5309,13 +5320,13 @@ var NewTable = function (rawProps) {
|
|
|
5309
5320
|
: [])[0];
|
|
5310
5321
|
return WIDE_EDIT_TYPES.includes((_a = selectedDS === null || selectedDS === void 0 ? void 0 : selectedDS.type) !== null && _a !== void 0 ? _a : "") ? "4xl" : "2xl";
|
|
5311
5322
|
};
|
|
5312
|
-
return (react_2.default.createElement("div", { ref: setDesktopRoot, className: "w-full ".concat((
|
|
5323
|
+
return (react_2.default.createElement("div", { ref: setDesktopRoot, className: "w-full ".concat((_1 = props.className) !== null && _1 !== void 0 ? _1 : "") },
|
|
5313
5324
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
5314
5325
|
var _a, _b;
|
|
5315
5326
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
5316
5327
|
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))));
|
|
5317
5328
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
5318
|
-
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (
|
|
5329
|
+
react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_3 = (_2 = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _2 === void 0 ? void 0 : _2.title) !== null && _3 !== void 0 ? _3 : "Edit", maxWidth: handleGetEditModalWidth(), onClose: handleModalEditClose, renderContent: function () {
|
|
5319
5330
|
var _a, _b, _c, _d;
|
|
5320
5331
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
5321
5332
|
if (!selectedCol)
|
|
@@ -5361,7 +5372,7 @@ var NewTable = function (rawProps) {
|
|
|
5361
5372
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
5362
5373
|
? ""
|
|
5363
5374
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode, stickyScrollbar: true, stickyScrollbarOffset: bottomOffset },
|
|
5364
|
-
(props.selectAll || ((
|
|
5375
|
+
(props.selectAll || ((_5 = (_4 = props.selectedIds) === null || _4 === void 0 ? void 0 : _4.length) !== null && _5 !== void 0 ? _5 : 0) > 0) &&
|
|
5365
5376
|
(!props.multiActionFloatingBtns ||
|
|
5366
5377
|
(props.multiActionFloatingBtns &&
|
|
5367
5378
|
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" },
|
|
@@ -5389,7 +5400,7 @@ var NewTable = function (rawProps) {
|
|
|
5389
5400
|
(addData
|
|
5390
5401
|
? !isAddRowPinned && !addGroupId && renderAddDataRow()
|
|
5391
5402
|
: !handleHasGroupAddRows() && renderEmptyAddRow()))),
|
|
5392
|
-
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (
|
|
5403
|
+
!props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_6 = props.emptyTitle) !== null && _6 !== void 0 ? _6 : "No items"))),
|
|
5393
5404
|
renderBottomStrip(),
|
|
5394
5405
|
renderFloatingActionBar()));
|
|
5395
5406
|
};
|