blixify-ui-web 1.3.33 → 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/dataStateModel.d.ts +1 -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 +433 -353
- 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 +2 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +111 -89
- package/lib/components/display/newTable/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -259,17 +259,20 @@ var ALL_COLUMN_TYPES = [
|
|
|
259
259
|
{ key: "multipleFile", label: "Files" },
|
|
260
260
|
{ key: "signature", label: "Signature" },
|
|
261
261
|
{ key: "canvas", label: "Canvas" },
|
|
262
|
-
{ key: "person", label: "
|
|
263
|
-
{ key: "listPerson", label: "
|
|
262
|
+
{ key: "person", label: "Member" },
|
|
263
|
+
{ key: "listPerson", label: "Members" },
|
|
264
264
|
{ key: "roles", label: "Role" },
|
|
265
|
+
// INFO: the four ways to work with another datasheet's records, together —
|
|
266
|
+
// link one, link several, show a field of the linked one, or pick an item
|
|
267
|
+
// from a list inside it
|
|
265
268
|
{ key: "reference", label: "Reference" },
|
|
266
|
-
{ key: "listReference", label: "Reference
|
|
267
|
-
{ key: "
|
|
269
|
+
{ key: "listReference", label: "Reference (multiple)" },
|
|
270
|
+
{ key: "lookup", label: "Reference lookup" },
|
|
271
|
+
{ key: "referenceSelection", label: "Reference option" },
|
|
268
272
|
{ key: "ganttchart", label: "Gantt chart" },
|
|
269
273
|
{ key: "dateRange", label: "Timeline" },
|
|
270
274
|
{ key: "timeTracking", label: "Time tracking" },
|
|
271
275
|
{ key: "button", label: "Button" },
|
|
272
|
-
{ key: "lookup", label: "Lookup" },
|
|
273
276
|
];
|
|
274
277
|
// INFO: how long after the first rows show the columns keep their widths
|
|
275
278
|
var COLUMN_WIDTH_FREEZE_MS = 800;
|
|
@@ -286,6 +289,10 @@ exports.handleRenderColumnTypeLabel = handleRenderColumnTypeLabel;
|
|
|
286
289
|
// be renamed
|
|
287
290
|
var NON_ADDABLE_COLUMN_TYPES = ["listAddress", "ganttchart", "canvas"];
|
|
288
291
|
var ADD_COLUMN_TYPES = ALL_COLUMN_TYPES.filter(function (eachType) { return !NON_ADDABLE_COLUMN_TYPES.includes(eachType.key); });
|
|
292
|
+
// INFO: still drawn and edited where a column already has them, but not
|
|
293
|
+
// offered for a new one — a role column is unused, and a password belongs to
|
|
294
|
+
// sign-in, not a datasheet
|
|
295
|
+
var RETIRED_COLUMN_TYPES = ["roles", "password"];
|
|
289
296
|
var REFERENCE_TYPES = ["reference", "listReference", "referenceSelection"];
|
|
290
297
|
var BUTTON_COLOUR_OPTIONS = buttonCell_1.BUTTON_COLOURS.map(function (eachColour) { return ({
|
|
291
298
|
key: eachColour,
|
|
@@ -584,7 +591,7 @@ var handleGetListColour = function (col, value) {
|
|
|
584
591
|
return column.listSelectionColour[index] || undefined;
|
|
585
592
|
};
|
|
586
593
|
var NewTable = function (rawProps) {
|
|
587
|
-
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;
|
|
588
595
|
// INFO: props are read through the latest render. A row that was not drawn
|
|
589
596
|
// again keeps the handlers of the render that drew it, and those read
|
|
590
597
|
// props.onClickRow, props.data and the rest at the time they run — so a
|
|
@@ -693,8 +700,8 @@ var NewTable = function (rawProps) {
|
|
|
693
700
|
// a row is added, the footer wraps on a narrow screen), so it is watched
|
|
694
701
|
// rather than measured once. A state ref, not useRef, so watching starts
|
|
695
702
|
// when the desktop layout mounts after the mobile one.
|
|
696
|
-
var
|
|
697
|
-
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];
|
|
698
705
|
(0, react_2.useLayoutEffect)(function () {
|
|
699
706
|
if (!desktopRoot)
|
|
700
707
|
return;
|
|
@@ -750,43 +757,43 @@ var NewTable = function (rawProps) {
|
|
|
750
757
|
//=====================================================================================
|
|
751
758
|
// SECTION: Advanced Settings
|
|
752
759
|
//=====================================================================================
|
|
753
|
-
var
|
|
754
|
-
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];
|
|
755
762
|
// INFO: what a DataTemplate around the table lets a cell save
|
|
756
763
|
var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
|
|
757
|
-
var
|
|
758
|
-
var
|
|
759
|
-
var
|
|
760
|
-
var
|
|
761
|
-
var
|
|
762
|
-
var
|
|
763
|
-
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];
|
|
764
771
|
// INFO: the option row whose colour palette is open
|
|
765
|
-
var
|
|
766
|
-
var
|
|
767
|
-
var
|
|
768
|
-
var
|
|
769
|
-
var
|
|
770
|
-
var
|
|
771
|
-
var
|
|
772
|
-
var
|
|
773
|
-
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];
|
|
774
781
|
// INFO: the app's settings for the column (renderColumnSettings), kept apart
|
|
775
782
|
// from the built-in ones because the table does not know their keys
|
|
776
|
-
var
|
|
777
|
-
var
|
|
778
|
-
var
|
|
779
|
-
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];
|
|
780
787
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
781
|
-
var
|
|
788
|
+
var _31 = (0, react_2.useState)(""), newColumnFormula = _31[0], setNewColumnFormula = _31[1];
|
|
782
789
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
783
790
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
784
|
-
var
|
|
791
|
+
var _32 = (0, react_2.useState)(null), editingColumn = _32[0], setEditingColumn = _32[1];
|
|
785
792
|
//=====================================================================================
|
|
786
793
|
// SECTION: Editable & Addable cells
|
|
787
794
|
//=====================================================================================
|
|
788
|
-
var
|
|
789
|
-
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];
|
|
790
797
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
791
798
|
// form, and a row click always landed on a child input. Only the clicked cell
|
|
792
799
|
// becomes its input now (Gantt and canvas cells still on hover, through
|
|
@@ -796,13 +803,24 @@ var NewTable = function (rawProps) {
|
|
|
796
803
|
var pendingFocusRef = (0, react_2.useRef)("");
|
|
797
804
|
// INFO: the cell a coloured multiple list is being picked in — its popover
|
|
798
805
|
// hangs from this element
|
|
799
|
-
var
|
|
800
|
-
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];
|
|
801
808
|
// INFO: whether the modal's signature pad has been drawn on
|
|
802
|
-
var
|
|
803
|
-
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); }; }, []);
|
|
804
822
|
// INFO: rows shown per section when the sections do not page themselves
|
|
805
|
-
var
|
|
823
|
+
var _39 = (0, react_2.useState)({}), groupVisibleCounts = _39[0], setGroupVisibleCounts = _39[1];
|
|
806
824
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
807
825
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
808
826
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -820,36 +838,36 @@ var NewTable = function (rawProps) {
|
|
|
820
838
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
821
839
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
822
840
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
823
|
-
var
|
|
824
|
-
var
|
|
825
|
-
var
|
|
826
|
-
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];
|
|
827
845
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
828
846
|
// always there in an addable table
|
|
829
|
-
var
|
|
847
|
+
var _44 = (0, react_2.useState)(false), addData = _44[0], setAddData = _44[1];
|
|
830
848
|
var isAddRowPinned = props.paginationType === "scroll";
|
|
831
|
-
var
|
|
849
|
+
var _45 = (0, react_2.useState)({}), addDataValue = _45[0], setAddDataValue = _45[1];
|
|
832
850
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
833
851
|
// inputs and its first cell takes the focus
|
|
834
|
-
var
|
|
852
|
+
var _46 = (0, react_2.useState)(0), addRowKey = _46[0], setAddRowKey = _46[1];
|
|
835
853
|
// INFO: the add row's coloured multiple list being picked — its label
|
|
836
854
|
// picker hangs from this cell
|
|
837
855
|
// INFO: the new row's required tag columns left empty on a save — their
|
|
838
856
|
// cells are ringed red until a label is picked
|
|
839
|
-
var
|
|
840
|
-
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];
|
|
841
859
|
// INFO: the group whose own add row is being filled in; "" = the bottom row
|
|
842
|
-
var
|
|
860
|
+
var _49 = (0, react_2.useState)(""), addGroupId = _49[0], setAddGroupId = _49[1];
|
|
843
861
|
// INFO: the row armed by a press on its handle, so only the handle — never
|
|
844
862
|
// a click or a text selection in a cell — starts a drag
|
|
845
|
-
var
|
|
846
|
-
var
|
|
847
|
-
var
|
|
848
|
-
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];
|
|
849
867
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
850
868
|
// results still win per key
|
|
851
|
-
var mergedReferencesOptions = __assign(__assign({}, ((
|
|
852
|
-
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];
|
|
853
871
|
// INFO: per column, the records a search found and the records the parent
|
|
854
872
|
// passes in, matched by id — a search copies the parent's records into the
|
|
855
873
|
// local map, so the parent's copy wins and a reload of the list reaches the
|
|
@@ -859,13 +877,13 @@ var NewTable = function (rawProps) {
|
|
|
859
877
|
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
860
878
|
return handleMergeReferencesDetails(referencesDetails, props.referencesDetails);
|
|
861
879
|
}, [referencesDetails, props.referencesDetails]);
|
|
862
|
-
var
|
|
880
|
+
var _55 = (0, react_2.useState)(false), referenceLoading = _55[0], setReferenceLoading = _55[1];
|
|
863
881
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
864
|
-
var
|
|
882
|
+
var _56 = (0, react_2.useState)({}), measuredPinWidths = _56[0], setMeasuredPinWidths = _56[1];
|
|
865
883
|
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
866
|
-
var
|
|
884
|
+
var _57 = (0, react_2.useState)(0), pinViewWidth = _57[0], setPinViewWidth = _57[1];
|
|
867
885
|
// INFO: per large group, the rows [start, end) drawn; the rest are spacers
|
|
868
|
-
var
|
|
886
|
+
var _58 = (0, react_2.useState)({}), virtualRanges = _58[0], setVirtualRanges = _58[1];
|
|
869
887
|
// INFO: each drawn row's measured height, kept so a spacer is as tall as the
|
|
870
888
|
// rows it stands in for
|
|
871
889
|
var rowHeightsRef = (0, react_2.useRef)(new Map());
|
|
@@ -877,7 +895,7 @@ var NewTable = function (rawProps) {
|
|
|
877
895
|
// its left edge as an offset from the first of them, and its width. Set only
|
|
878
896
|
// when the drawn columns no longer cover it, so scrolling inside them draws
|
|
879
897
|
// nothing
|
|
880
|
-
var
|
|
898
|
+
var _59 = (0, react_2.useState)(null), columnView = _59[0], setColumnView = _59[1];
|
|
881
899
|
// INFO: each drawn unpinned column's measured width, so a spacer is as wide
|
|
882
900
|
// as the columns it stands in for
|
|
883
901
|
var columnWidthsMeasuredRef = (0, react_2.useRef)({});
|
|
@@ -1063,13 +1081,13 @@ var NewTable = function (rawProps) {
|
|
|
1063
1081
|
var bgColor = props.darkMode
|
|
1064
1082
|
? props.darkModeBg || "bg-gray-900"
|
|
1065
1083
|
: "bg-white";
|
|
1066
|
-
var isFlat = !!((
|
|
1084
|
+
var isFlat = !!((_k = props.advSettings) === null || _k === void 0 ? void 0 : _k.flat);
|
|
1067
1085
|
var borderRadius = isFlat ? "" : "rounded-2xl";
|
|
1068
1086
|
var borderColor = props.darkMode ? "border-gray-700" : "border-gray-100";
|
|
1069
1087
|
var selectedRowBg = props.darkMode ? "bg-gray-700" : "bg-primary-50";
|
|
1070
1088
|
var rowHoverBg = props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100";
|
|
1071
1089
|
var dividerColor = props.darkMode ? "divide-gray-700" : "divide-gray-100";
|
|
1072
|
-
var gridLines = (
|
|
1090
|
+
var gridLines = (_l = props.gridLines) !== null && _l !== void 0 ? _l : "horizontal";
|
|
1073
1091
|
// INFO: a coloured list cell paints its whole table cell, like a
|
|
1074
1092
|
// spreadsheet's cell fill, instead of holding a chip. The Select
|
|
1075
1093
|
// inside is told (cellInput.fill) to keep only the label colour. Same shades
|
|
@@ -1139,8 +1157,8 @@ var NewTable = function (rawProps) {
|
|
|
1139
1157
|
var errorFontColor = props.darkMode ? "text-red-300" : "text-red-500";
|
|
1140
1158
|
// INFO: an edit commits on blur, but navigating away unmounts the table
|
|
1141
1159
|
// without one — the cell was left dirty on screen and the value never sent.
|
|
1142
|
-
var onUpdateDataRef = (0, react_2.useRef)((
|
|
1143
|
-
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;
|
|
1144
1162
|
(0, react_2.useEffect)(function () {
|
|
1145
1163
|
return function () {
|
|
1146
1164
|
var _a, _b;
|
|
@@ -1882,9 +1900,9 @@ var NewTable = function (rawProps) {
|
|
|
1882
1900
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1883
1901
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1884
1902
|
// class.
|
|
1885
|
-
var
|
|
1903
|
+
var _60 = (0, react_2.useState)({}), columnWidths = _60[0], setColumnWidths = _60[1];
|
|
1886
1904
|
// INFO: caps measured for content-sized columns — see handleMeasureCaps
|
|
1887
|
-
var
|
|
1905
|
+
var _61 = (0, react_2.useState)({}), cappedWidths = _61[0], setCappedWidths = _61[1];
|
|
1888
1906
|
// INFO: width — the drag's latest width. The release reads it here rather
|
|
1889
1907
|
// than from columnWidths, which holds only what the last drawn render saw: a
|
|
1890
1908
|
// slow table can still be drawing the last moves when the pointer is let go
|
|
@@ -2100,10 +2118,10 @@ var NewTable = function (rawProps) {
|
|
|
2100
2118
|
// stops a value being cut at a character count, and a capped cell still
|
|
2101
2119
|
// holds its whole value — it shows when the column is widened and copies in
|
|
2102
2120
|
// full. Not under grouped headers, which draw without fixed widths.
|
|
2103
|
-
var
|
|
2121
|
+
var _62 = (0, react_2.useState)(0), capCheck = _62[0], setCapCheck = _62[1];
|
|
2104
2122
|
var capsKey = [
|
|
2105
|
-
(
|
|
2106
|
-
(
|
|
2123
|
+
(_p = props.advSettings) === null || _p === void 0 ? void 0 : _p.maxFirstColumnWidth,
|
|
2124
|
+
(_q = props.advSettings) === null || _q === void 0 ? void 0 : _q.maxColumnWidth,
|
|
2107
2125
|
flatColumns.map(function (col) { var _a; return "".concat(col.key, ":").concat((_a = col.width) !== null && _a !== void 0 ? _a : ""); }).join(","),
|
|
2108
2126
|
].join("|");
|
|
2109
2127
|
// INFO: only adds caps — a column already capped is at its widest. Run on
|
|
@@ -2195,7 +2213,7 @@ var NewTable = function (rawProps) {
|
|
|
2195
2213
|
(REFERENCE_TYPES.includes(col.type) || col.type === "lookup");
|
|
2196
2214
|
});
|
|
2197
2215
|
var referencesLoaded = !hasReferenceColumns ||
|
|
2198
|
-
Object.keys((
|
|
2216
|
+
Object.keys((_r = props.referencesDetails) !== null && _r !== void 0 ? _r : {}).length > 0;
|
|
2199
2217
|
var referencesLoadedRef = (0, react_2.useRef)(referencesLoaded);
|
|
2200
2218
|
// INFO: names that came after the widths were kept size the columns once
|
|
2201
2219
|
// more, so a slow load does not leave a reference column cut short
|
|
@@ -2462,13 +2480,17 @@ var NewTable = function (rawProps) {
|
|
|
2462
2480
|
renderOptionColourPalette(eachOption, index)));
|
|
2463
2481
|
}),
|
|
2464
2482
|
react_2.default.createElement(textButton_1.TextButton, { text: "Add option", className: "self-start text-sm", onClick: handleAddOption }))); };
|
|
2465
|
-
// INFO:
|
|
2466
|
-
// reference label
|
|
2483
|
+
// INFO: an app can leave out types it cannot set up, and a lookup needs a
|
|
2484
|
+
// datasheet's columns to choose from, which only the reference label
|
|
2485
|
+
// provider gives
|
|
2467
2486
|
var handleGetAddColumnTypes = function () {
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2487
|
+
return ADD_COLUMN_TYPES.filter(function (eachType) {
|
|
2488
|
+
var _a, _b, _c;
|
|
2489
|
+
return !RETIRED_COLUMN_TYPES.includes(eachType.key) &&
|
|
2490
|
+
!((_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.hiddenColumnTypes) !== null && _b !== void 0 ? _b : []).includes(eachType.key) &&
|
|
2491
|
+
(eachType.key !== "lookup" ||
|
|
2492
|
+
!!((_c = props.advSettings) === null || _c === void 0 ? void 0 : _c.renderReferenceLabelOptions));
|
|
2493
|
+
});
|
|
2472
2494
|
};
|
|
2473
2495
|
// INFO: the reference columns of this datasheet a lookup can read through —
|
|
2474
2496
|
// a lookup drawn as a reference is not one
|
|
@@ -3116,7 +3138,7 @@ var NewTable = function (rawProps) {
|
|
|
3116
3138
|
return Math.max(width, (_b = getTitleMinWidth(key)) !== null && _b !== void 0 ? _b : 0);
|
|
3117
3139
|
};
|
|
3118
3140
|
var pinCheckboxOffset = props.checkbox &&
|
|
3119
|
-
(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))
|
|
3120
3142
|
? CHECKBOX_WIDTH
|
|
3121
3143
|
: 0;
|
|
3122
3144
|
/**
|
|
@@ -3738,7 +3760,7 @@ var NewTable = function (rawProps) {
|
|
|
3738
3760
|
};
|
|
3739
3761
|
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
3740
3762
|
// only read by the render helpers called from the return below
|
|
3741
|
-
var
|
|
3763
|
+
var _63 = handleFitPins(), fittedLeftPins = _63.widths, narrowPins = _63.narrow;
|
|
3742
3764
|
var renderActionColumnHeader = function () {
|
|
3743
3765
|
if (handleShowsActionColumn()) {
|
|
3744
3766
|
var pin = handleGetActionCellPin(true);
|
|
@@ -3966,7 +3988,7 @@ var NewTable = function (rawProps) {
|
|
|
3966
3988
|
};
|
|
3967
3989
|
// INFO: true when maxSelectedCount is set and the current selection has reached the limit
|
|
3968
3990
|
var isMaxReached = !!props.maxSelectedCount &&
|
|
3969
|
-
((
|
|
3991
|
+
((_u = (_t = props.selectedIds) === null || _t === void 0 ? void 0 : _t.length) !== null && _u !== void 0 ? _u : 0) >= props.maxSelectedCount;
|
|
3970
3992
|
// INFO: one desktop row. groupAccent carries the group's colour so member
|
|
3971
3993
|
// rows show the band's colour as a bar down their left edge.
|
|
3972
3994
|
var handleRowDragStart = function (event, rowId) {
|
|
@@ -5261,28 +5283,28 @@ var NewTable = function (rawProps) {
|
|
|
5261
5283
|
};
|
|
5262
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 : "") })); };
|
|
5263
5285
|
if (props.mobileView) {
|
|
5264
|
-
var hasPhoneGroups = !!((
|
|
5286
|
+
var hasPhoneGroups = !!((_v = props.groups) === null || _v === void 0 ? void 0 : _v.length);
|
|
5265
5287
|
// INFO: bands that page themselves show their headers while their rows
|
|
5266
5288
|
// load, so an empty list there is not yet known to be empty. A band that
|
|
5267
5289
|
// holds every loaded row (the Ungrouped band) is, so its empty list still
|
|
5268
5290
|
// says so under the band
|
|
5269
5291
|
var isPhoneEmptyKnown = !hasPhoneGroups ||
|
|
5270
|
-
!!((
|
|
5292
|
+
!!((_w = props.groups) === null || _w === void 0 ? void 0 : _w.every(function (eachGroup) { return eachGroup.unbatched; }));
|
|
5271
5293
|
return (react_2.default.createElement("div", null,
|
|
5272
|
-
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
|
|
5273
5295
|
? ""
|
|
5274
|
-
: "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 : "") },
|
|
5275
5297
|
react_2.default.createElement("div", { className: "p-3 flex items-center justify-between" },
|
|
5276
5298
|
renderSelectAll(),
|
|
5277
5299
|
react_2.default.createElement("div", { className: "flex items-center gap-2" },
|
|
5278
5300
|
renderSelectedCount(),
|
|
5279
|
-
((
|
|
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"); } })))),
|
|
5280
5302
|
props.loading &&
|
|
5281
5303
|
Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
|
|
5282
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") }))); }),
|
|
5283
5305
|
!props.loading && (props.data.length > 0 || hasPhoneGroups) && (react_2.default.createElement("table", { className: "w-full table-fixed", ref: tableRef },
|
|
5284
5306
|
react_2.default.createElement("tbody", { className: "divide-y ".concat(dividerColor) }, renderDesktopRows()))),
|
|
5285
|
-
!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"))),
|
|
5286
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()),
|
|
5287
5309
|
renderFloatingActionBar(),
|
|
5288
5310
|
renderAddColumnModal()));
|
|
@@ -5298,13 +5320,13 @@ var NewTable = function (rawProps) {
|
|
|
5298
5320
|
: [])[0];
|
|
5299
5321
|
return WIDE_EDIT_TYPES.includes((_a = selectedDS === null || selectedDS === void 0 ? void 0 : selectedDS.type) !== null && _a !== void 0 ? _a : "") ? "4xl" : "2xl";
|
|
5300
5322
|
};
|
|
5301
|
-
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 : "") },
|
|
5302
5324
|
react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
|
|
5303
5325
|
var _a, _b;
|
|
5304
5326
|
return (react_2.default.createElement("div", { className: "pb-44" },
|
|
5305
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))));
|
|
5306
5328
|
}, onClose: function () { return setFilterModal(""); } }),
|
|
5307
|
-
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 () {
|
|
5308
5330
|
var _a, _b, _c, _d;
|
|
5309
5331
|
var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
|
|
5310
5332
|
if (!selectedCol)
|
|
@@ -5350,7 +5372,7 @@ var NewTable = function (rawProps) {
|
|
|
5350
5372
|
react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
|
|
5351
5373
|
? ""
|
|
5352
5374
|
: "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode, stickyScrollbar: true, stickyScrollbarOffset: bottomOffset },
|
|
5353
|
-
(props.selectAll || ((
|
|
5375
|
+
(props.selectAll || ((_5 = (_4 = props.selectedIds) === null || _4 === void 0 ? void 0 : _4.length) !== null && _5 !== void 0 ? _5 : 0) > 0) &&
|
|
5354
5376
|
(!props.multiActionFloatingBtns ||
|
|
5355
5377
|
(props.multiActionFloatingBtns &&
|
|
5356
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" },
|
|
@@ -5378,7 +5400,7 @@ var NewTable = function (rawProps) {
|
|
|
5378
5400
|
(addData
|
|
5379
5401
|
? !isAddRowPinned && !addGroupId && renderAddDataRow()
|
|
5380
5402
|
: !handleHasGroupAddRows() && renderEmptyAddRow()))),
|
|
5381
|
-
!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"))),
|
|
5382
5404
|
renderBottomStrip(),
|
|
5383
5405
|
renderFloatingActionBar()));
|
|
5384
5406
|
};
|