blixify-ui-web 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +3 -1
- 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 +21 -18
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +14 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +74 -41
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactElement } from "react";
|
|
1
|
+
import React, { ReactElement, ReactNode } from "react";
|
|
2
2
|
import { BareSettings, DataStructure, DevSettings } from "../../data/dataTemplate/model";
|
|
3
3
|
import { Sort } from "../../data/readQuery";
|
|
4
4
|
import { Option } from "../../input/select";
|
|
@@ -59,6 +59,7 @@ interface AdvancedSettings {
|
|
|
59
59
|
getColumnSchema?: (columnId: string) => DataStructure | undefined;
|
|
60
60
|
getSchema?: () => DataStructure[];
|
|
61
61
|
onEditColumn?: (column: DataStructure) => void | Promise<void>;
|
|
62
|
+
renderColumnSettings?: (input: ColumnSettingsInput) => ReactNode;
|
|
62
63
|
renderReferenceSpaceOptions?: () => Option[];
|
|
63
64
|
renderReferenceLabelOptions?: (spaceId?: string, includeReference?: boolean, type?: string) => Option[];
|
|
64
65
|
onDragColumn?: (dragId: string, dropId: string, newHeader: TableHeader[]) => void;
|
|
@@ -177,6 +178,18 @@ export interface NewTableProps extends LinkProps, DeleteableProps, EditableProps
|
|
|
177
178
|
gridLines?: NewTableGridLines;
|
|
178
179
|
}
|
|
179
180
|
export type NewTableGridLines = "horizontal" | "all";
|
|
181
|
+
/**
|
|
182
|
+
* What an app's own column settings receive. column is the column being
|
|
183
|
+
* edited, or null while one is added; handleChange hands back the keys the app
|
|
184
|
+
* owns, merged into the column on save (undefined removes a key), and ready
|
|
185
|
+
* false keeps Save disabled until the app's section is complete.
|
|
186
|
+
*/
|
|
187
|
+
export interface ColumnSettingsInput {
|
|
188
|
+
type: string;
|
|
189
|
+
column: DataStructure | null;
|
|
190
|
+
darkMode?: boolean;
|
|
191
|
+
handleChange: (settings: Record<string, any>, ready?: boolean) => void;
|
|
192
|
+
}
|
|
180
193
|
interface ColumnOption {
|
|
181
194
|
key: number;
|
|
182
195
|
text: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/newTable/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,EACZ,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/newTable/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,EACZ,YAAY,EACZ,SAAS,EASV,MAAM,OAAO,CAAC;AAKf,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAiBvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAe5C,OAAO,EAAc,MAAM,EAAU,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiBvD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAavC,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAKvC,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAmBpE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AA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EAAE,MAAM,CAAC;CAChB;AAyBD,eAAO,MAAM,uBAAuB,WAAY,GAAG,KAAG,YAAY,EAM7D,CAAC;AAIN,eAAO,MAAM,wBAAwB,WAAY,GAAG,QAAQ,YAAY,EAAE,QAazE,CAAC;AAGF,eAAO,MAAM,4BAA4B,SAAU,MAAM,aAGxD,CAAC;AA6LF,eAAO,MAAM,QAAQ,aAAc,aAAa,sBA6lN/C,CAAC"}
|
|
@@ -304,8 +304,6 @@ var SAFE_TYPE_CHANGES = {
|
|
|
304
304
|
image: ["file"],
|
|
305
305
|
multipleImage: ["multipleFile"],
|
|
306
306
|
};
|
|
307
|
-
// INFO: settings of one type that mean nothing on another, dropped when a
|
|
308
|
-
// column changes type
|
|
309
307
|
var TYPE_ONLY_KEYS = {
|
|
310
308
|
string: [
|
|
311
309
|
"stringRegex",
|
|
@@ -699,18 +697,22 @@ var NewTable = function (rawProps) {
|
|
|
699
697
|
var _19 = (0, react_2.useState)(""), newColumnButtonLabel = _19[0], setNewColumnButtonLabel = _19[1];
|
|
700
698
|
var _20 = (0, react_2.useState)(""), newColumnButtonColour = _20[0], setNewColumnButtonColour = _20[1];
|
|
701
699
|
var _21 = (0, react_2.useState)(""), newColumnButtonConfirm = _21[0], setNewColumnButtonConfirm = _21[1];
|
|
702
|
-
|
|
703
|
-
|
|
700
|
+
// INFO: the app's settings for the column (renderColumnSettings), kept apart
|
|
701
|
+
// from the built-in ones because the table does not know their keys
|
|
702
|
+
var _22 = (0, react_2.useState)({}), newColumnAppSettings = _22[0], setNewColumnAppSettings = _22[1];
|
|
703
|
+
var _23 = (0, react_2.useState)(true), newColumnAppReady = _23[0], setNewColumnAppReady = _23[1];
|
|
704
|
+
var _24 = (0, react_2.useState)(false), addingColumn = _24[0], setAddingColumn = _24[1];
|
|
705
|
+
var _25 = (0, react_2.useState)(false), confirmDeleteColumn = _25[0], setConfirmDeleteColumn = _25[1];
|
|
704
706
|
// INFO: the formula as shown in the builder — column names, not ids
|
|
705
|
-
var
|
|
707
|
+
var _26 = (0, react_2.useState)(""), newColumnFormula = _26[0], setNewColumnFormula = _26[1];
|
|
706
708
|
var addColumnPopUpRef = (0, react_2.useRef)(null);
|
|
707
709
|
// INFO: the column being changed — empty while the panel adds a new one
|
|
708
|
-
var
|
|
710
|
+
var _27 = (0, react_2.useState)(null), editingColumn = _27[0], setEditingColumn = _27[1];
|
|
709
711
|
//=====================================================================================
|
|
710
712
|
// SECTION: Editable & Addable cells
|
|
711
713
|
//=====================================================================================
|
|
712
|
-
var
|
|
713
|
-
var
|
|
714
|
+
var _28 = (0, react_2.useState)(""), editDataRowId = _28[0], setEditDataRowId = _28[1];
|
|
715
|
+
var _29 = (0, react_2.useState)(""), editDataHeaderKey = _29[0], setEditDataHeaderKey = _29[1];
|
|
714
716
|
// INFO: an editable table used to mount an input in every cell — it read as a
|
|
715
717
|
// form, and a row click always landed on a child input. Only the hovered cell
|
|
716
718
|
// becomes its input now; NewTableHoverCell keeps that hover to itself.
|
|
@@ -719,13 +721,13 @@ var NewTable = function (rawProps) {
|
|
|
719
721
|
var pendingFocusRef = (0, react_2.useRef)("");
|
|
720
722
|
// INFO: the cell a gridLines="all" multiple list is being picked in — its
|
|
721
723
|
// popover hangs from this element
|
|
722
|
-
var
|
|
723
|
-
var
|
|
724
|
+
var _30 = (0, react_2.useState)(null), labelPickerAnchor = _30[0], setLabelPickerAnchor = _30[1];
|
|
725
|
+
var _31 = (0, react_2.useState)(false), modalEditVisible = _31[0], setModalEditVisible = _31[1];
|
|
724
726
|
// INFO: whether the modal's signature pad has been drawn on
|
|
725
|
-
var
|
|
726
|
-
var
|
|
727
|
+
var _32 = (0, react_2.useState)(false), signatureSigning = _32[0], setSignatureSigning = _32[1];
|
|
728
|
+
var _33 = (0, react_2.useState)([]), collapsedGroupIds = _33[0], setCollapsedGroupIds = _33[1];
|
|
727
729
|
// INFO: rows shown per section when the sections do not page themselves
|
|
728
|
-
var
|
|
730
|
+
var _34 = (0, react_2.useState)({}), groupVisibleCounts = _34[0], setGroupVisibleCounts = _34[1];
|
|
729
731
|
// INFO: per-group scroll pagination. One sentinel element per band, observed
|
|
730
732
|
// by a single IntersectionObserver that fires props.onGroupLoadMore when a
|
|
731
733
|
// band's sentinel scrolls into view. The debounce guard stops repeat fires
|
|
@@ -743,36 +745,36 @@ var NewTable = function (rawProps) {
|
|
|
743
745
|
var lastSelectedRowRef = (0, react_2.useRef)(null);
|
|
744
746
|
var dragSelectRef = (0, react_2.useRef)(null);
|
|
745
747
|
var suppressNextClickRef = (0, react_2.useRef)(false);
|
|
746
|
-
var
|
|
747
|
-
var
|
|
748
|
-
var
|
|
749
|
-
var
|
|
748
|
+
var _35 = (0, react_2.useState)(false), isDragSelecting = _35[0], setIsDragSelecting = _35[1];
|
|
749
|
+
var _36 = (0, react_2.useState)(0), copiedCount = _36[0], setCopiedCount = _36[1];
|
|
750
|
+
var _37 = (0, react_2.useState)({}), editDataValue = _37[0], setEditDataValue = _37[1];
|
|
751
|
+
var _38 = (0, react_2.useState)(false), editDataIsLoading = _38[0], setEditDataIsLoading = _38[1];
|
|
750
752
|
// INFO: true while the empty bottom row is being filled in; the row itself is
|
|
751
753
|
// always there in an addable table
|
|
752
|
-
var
|
|
754
|
+
var _39 = (0, react_2.useState)(false), addData = _39[0], setAddData = _39[1];
|
|
753
755
|
var isAddRowPinned = props.paginationType === "scroll";
|
|
754
|
-
var
|
|
756
|
+
var _40 = (0, react_2.useState)({}), addDataValue = _40[0], setAddDataValue = _40[1];
|
|
755
757
|
// INFO: bumped after each saved row, so the next one starts with fresh
|
|
756
758
|
// inputs and its first cell takes the focus
|
|
757
|
-
var
|
|
759
|
+
var _41 = (0, react_2.useState)(0), addRowKey = _41[0], setAddRowKey = _41[1];
|
|
758
760
|
// INFO: the add row's coloured multiple list being picked under
|
|
759
761
|
// gridLines="all" — its label picker hangs from this cell
|
|
760
762
|
// INFO: the new row's required tag columns left empty on a save — their
|
|
761
763
|
// cells are ringed red until a label is picked
|
|
762
|
-
var
|
|
763
|
-
var
|
|
764
|
+
var _42 = (0, react_2.useState)([]), addTagErrors = _42[0], setAddTagErrors = _42[1];
|
|
765
|
+
var _43 = (0, react_2.useState)(null), addLabelPicker = _43[0], setAddLabelPicker = _43[1];
|
|
764
766
|
// INFO: the group whose own add row is being filled in; "" = the bottom row
|
|
765
|
-
var
|
|
767
|
+
var _44 = (0, react_2.useState)(""), addGroupId = _44[0], setAddGroupId = _44[1];
|
|
766
768
|
// INFO: the row armed by a press on its handle, so only the handle — never
|
|
767
769
|
// a click or a text selection in a cell — starts a drag
|
|
768
|
-
var
|
|
769
|
-
var
|
|
770
|
-
var
|
|
771
|
-
var
|
|
770
|
+
var _45 = (0, react_2.useState)(""), dragArmedRowId = _45[0], setDragArmedRowId = _45[1];
|
|
771
|
+
var _46 = (0, react_2.useState)(""), draggingRowId = _46[0], setDraggingRowId = _46[1];
|
|
772
|
+
var _47 = (0, react_2.useState)(""), dropGroupId = _47[0], setDropGroupId = _47[1];
|
|
773
|
+
var _48 = (0, react_2.useState)({}), referencesOptions = _48[0], setReferencesOptions = _48[1];
|
|
772
774
|
// INFO: seeded options sit under the local map so a cell's own search
|
|
773
775
|
// results still win per key
|
|
774
776
|
var mergedReferencesOptions = __assign(__assign({}, ((_h = props.referencesOptions) !== null && _h !== void 0 ? _h : {})), referencesOptions);
|
|
775
|
-
var
|
|
777
|
+
var _49 = (0, react_2.useState)({}), referencesDetails = _49[0], setReferencesDetails = _49[1];
|
|
776
778
|
// INFO: per column, the records a search found and the records the parent
|
|
777
779
|
// passes in, matched by id — a search copies the parent's records into the
|
|
778
780
|
// local map, so the parent's copy wins and a reload of the list reaches the
|
|
@@ -782,13 +784,13 @@ var NewTable = function (rawProps) {
|
|
|
782
784
|
var mergedReferencesDetails = (0, react_2.useMemo)(function () {
|
|
783
785
|
return handleMergeReferencesDetails(referencesDetails, props.referencesDetails);
|
|
784
786
|
}, [referencesDetails, props.referencesDetails]);
|
|
785
|
-
var
|
|
787
|
+
var _50 = (0, react_2.useState)(false), referenceLoading = _50[0], setReferenceLoading = _50[1];
|
|
786
788
|
// INFO: measured pixel widths for pinned columns without an explicit width.
|
|
787
|
-
var
|
|
789
|
+
var _51 = (0, react_2.useState)({}), measuredPinWidths = _51[0], setMeasuredPinWidths = _51[1];
|
|
788
790
|
// INFO: the scrolling view's width, which caps how much the left pins take
|
|
789
|
-
var
|
|
791
|
+
var _52 = (0, react_2.useState)(0), pinViewWidth = _52[0], setPinViewWidth = _52[1];
|
|
790
792
|
// INFO: per large group, the rows [start, end) drawn; the rest are spacers
|
|
791
|
-
var
|
|
793
|
+
var _53 = (0, react_2.useState)({}), virtualRanges = _53[0], setVirtualRanges = _53[1];
|
|
792
794
|
// INFO: each drawn row's measured height, kept so a spacer is as tall as the
|
|
793
795
|
// rows it stands in for
|
|
794
796
|
var rowHeightsRef = (0, react_2.useRef)(new Map());
|
|
@@ -800,7 +802,7 @@ var NewTable = function (rawProps) {
|
|
|
800
802
|
// its left edge as an offset from the first of them, and its width. Set only
|
|
801
803
|
// when the drawn columns no longer cover it, so scrolling inside them draws
|
|
802
804
|
// nothing
|
|
803
|
-
var
|
|
805
|
+
var _54 = (0, react_2.useState)(null), columnView = _54[0], setColumnView = _54[1];
|
|
804
806
|
// INFO: each drawn unpinned column's measured width, so a spacer is as wide
|
|
805
807
|
// as the columns it stands in for
|
|
806
808
|
var columnWidthsMeasuredRef = (0, react_2.useRef)({});
|
|
@@ -1810,9 +1812,9 @@ var NewTable = function (rawProps) {
|
|
|
1810
1812
|
// it stays here until the table unmounts. Tailwind cannot emit a runtime
|
|
1811
1813
|
// w-[Npx], so a width drives an inline style and wins over the col.width
|
|
1812
1814
|
// class.
|
|
1813
|
-
var
|
|
1815
|
+
var _55 = (0, react_2.useState)({}), columnWidths = _55[0], setColumnWidths = _55[1];
|
|
1814
1816
|
// INFO: caps measured for content-sized columns — see handleMeasureCaps
|
|
1815
|
-
var
|
|
1817
|
+
var _56 = (0, react_2.useState)({}), cappedWidths = _56[0], setCappedWidths = _56[1];
|
|
1816
1818
|
var resizeRef = (0, react_2.useRef)(null);
|
|
1817
1819
|
// INFO: a dragged width first, else the column's own fixed width in pixels
|
|
1818
1820
|
// whatever form it is stored in ("180px", "w-[180px]", "w-48")
|
|
@@ -2019,7 +2021,7 @@ var NewTable = function (rawProps) {
|
|
|
2019
2021
|
// stretching it. disableEllipsisOnLongWord asks for whole values, so then
|
|
2020
2022
|
// content sizes the column as before. Not under grouped headers, which draw
|
|
2021
2023
|
// without fixed widths.
|
|
2022
|
-
var
|
|
2024
|
+
var _57 = (0, react_2.useState)(0), capCheck = _57[0], setCapCheck = _57[1];
|
|
2023
2025
|
var capsKey = [
|
|
2024
2026
|
(_o = props.advSettings) === null || _o === void 0 ? void 0 : _o.maxFirstColumnWidth,
|
|
2025
2027
|
(_p = props.advSettings) === null || _p === void 0 ? void 0 : _p.maxColumnWidth,
|
|
@@ -2181,7 +2183,7 @@ var NewTable = function (rawProps) {
|
|
|
2181
2183
|
(_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.onSortColumn) === null || _b === void 0 ? void 0 : _b.call(_a, { sortId: id, type: type });
|
|
2182
2184
|
};
|
|
2183
2185
|
var renderAddColumnPanel = function () {
|
|
2184
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2186
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2185
2187
|
// INFO: a caller that renders its own form keeps full control; the
|
|
2186
2188
|
// built-in one only appears when it hands over onAddColumn instead
|
|
2187
2189
|
if ((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderAddColumnElements)
|
|
@@ -2209,6 +2211,8 @@ var NewTable = function (rawProps) {
|
|
|
2209
2211
|
(0, exports.handleGetEditableColumnTypes)(editingColumn.type).length < 2, portalDropdown: true, onChange: function (value) {
|
|
2210
2212
|
var _a;
|
|
2211
2213
|
setNewColumnType(value);
|
|
2214
|
+
// INFO: the app's settings belong to the type they were made for
|
|
2215
|
+
handleResetAppSettings();
|
|
2212
2216
|
// INFO: the formula builder needs a modal's room, as monday opens
|
|
2213
2217
|
// its builder — the popup hands over what was typed and closes
|
|
2214
2218
|
if (value === "formula" && !addColumnModal) {
|
|
@@ -2231,9 +2235,15 @@ var NewTable = function (rawProps) {
|
|
|
2231
2235
|
newColumnType === "button" && (react_2.default.createElement(react_2.default.Fragment, null,
|
|
2232
2236
|
react_2.default.createElement(textInput_1.TextInput, { id: "newColumnButtonLabel", type: "text", label: "Button Label", placeholder: newColumnName.trim() || "Send", value: newColumnButtonLabel, darkMode: props.darkMode, onChange: function (event) { var _a, _b; return setNewColumnButtonLabel((_b = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""); } }),
|
|
2233
2237
|
react_2.default.createElement(select_1.Select, { id: "newColumnButtonColour", label: "Button Colour", value: newColumnButtonColour, darkMode: props.darkMode, portalDropdown: true, options: BUTTON_COLOUR_OPTIONS, onChange: function (value) { return setNewColumnButtonColour(value); } }),
|
|
2234
|
-
react_2.default.createElement(textInput_1.TextInput, { id: "newColumnButtonConfirm", type: "text", label: "Confirm Message", placeholder: "Send this to the customer?", value: newColumnButtonConfirm, darkMode: props.darkMode, onChange: function (event) { var _a, _b; return setNewColumnButtonConfirm((_b = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""); } }))),
|
|
2238
|
+
react_2.default.createElement(textInput_1.TextInput, { id: "newColumnButtonConfirm", type: "text", label: "Confirm Message", placeholder: "Send this to the customer?", value: newColumnButtonConfirm, darkMode: props.darkMode, onChange: function (event) { var _a, _b; return setNewColumnButtonConfirm((_b = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""); } }))), (_j = (_h = props.advSettings) === null || _h === void 0 ? void 0 : _h.renderColumnSettings) === null || _j === void 0 ? void 0 :
|
|
2239
|
+
_j.call(_h, {
|
|
2240
|
+
type: newColumnType,
|
|
2241
|
+
column: editingColumn,
|
|
2242
|
+
darkMode: props.darkMode,
|
|
2243
|
+
handleChange: handleChangeAppSettings,
|
|
2244
|
+
}),
|
|
2235
2245
|
ASSET_TYPES.includes(newColumnType) && (react_2.default.createElement("p", { className: "-mt-2 text-xs text-gray-500" }, "Uploads are stored against this space automatically.")),
|
|
2236
|
-
newColumnType === "formula" && (react_2.default.createElement(builder_1.FormulaBuilder, { value: newColumnFormula, schema: handleGetFormulaSchema(), columnId: editingColumn === null || editingColumn === void 0 ? void 0 : editingColumn.id, previewRow: (
|
|
2246
|
+
newColumnType === "formula" && (react_2.default.createElement(builder_1.FormulaBuilder, { value: newColumnFormula, schema: handleGetFormulaSchema(), columnId: editingColumn === null || editingColumn === void 0 ? void 0 : editingColumn.id, previewRow: (_k = props.data) === null || _k === void 0 ? void 0 : _k[0], previewDisplayRow: (_l = props.spaceData) === null || _l === void 0 ? void 0 : _l[0], darkMode: props.darkMode, onChange: setNewColumnFormula })),
|
|
2237
2247
|
!UNREQUIRABLE_TYPES.includes(newColumnType) && (react_2.default.createElement(checkbox_1.Checkbox, { id: "newColumnRequired",
|
|
2238
2248
|
// INFO: the checkbox itself is not a required field — without this it
|
|
2239
2249
|
// renders "Required *", which reads as a validation error on a toggle
|
|
@@ -2262,7 +2272,7 @@ var NewTable = function (rawProps) {
|
|
|
2262
2272
|
taken ||
|
|
2263
2273
|
addingColumn ||
|
|
2264
2274
|
!handleIsNewColumnReady(), onClick: handleSubmitNewColumn })),
|
|
2265
|
-
editingColumn && ((
|
|
2275
|
+
editingColumn && ((_m = props.advSettings) === null || _m === void 0 ? void 0 : _m.onDeleteColumn) && (react_2.default.createElement(textButton_1.TextButton, { id: "table-column-panel-delete", className: "self-start text-sm !text-red-600 hover:!text-red-700", text: confirmDeleteColumn ? "Confirm delete" : "Delete column", disable: addingColumn, onClick: handleDeleteEditingColumn }))));
|
|
2266
2276
|
};
|
|
2267
2277
|
var renderAddColumnModal = function () { return (react_2.default.createElement(modal_1.Modal, { open: addColumnModal ? true : false, maxWidth: newColumnType === "formula" ? "2xl" : undefined, title: editingColumn ? "Edit Column" : "Add Column", renderContent: renderAddColumnPanel, onClose: function () { return handleAddColumnModal(""); } })); };
|
|
2268
2278
|
var handleChangeOption = function (key, change) {
|
|
@@ -2380,6 +2390,7 @@ var NewTable = function (rawProps) {
|
|
|
2380
2390
|
setNewColumnButtonLabel((_j = schema.buttonLabel) !== null && _j !== void 0 ? _j : "");
|
|
2381
2391
|
setNewColumnButtonColour((_k = schema.buttonColour) !== null && _k !== void 0 ? _k : "");
|
|
2382
2392
|
setNewColumnButtonConfirm((_l = schema.buttonConfirm) !== null && _l !== void 0 ? _l : "");
|
|
2393
|
+
handleResetAppSettings();
|
|
2383
2394
|
setNewColumnFormula(schema.type === "formula"
|
|
2384
2395
|
? (0, formula_1.handleGetFormulaDisplay)(schema, handleGetFormulaSchema())
|
|
2385
2396
|
: "");
|
|
@@ -2441,8 +2452,21 @@ var NewTable = function (rawProps) {
|
|
|
2441
2452
|
setNewColumnButtonLabel("");
|
|
2442
2453
|
setNewColumnButtonColour("");
|
|
2443
2454
|
setNewColumnButtonConfirm("");
|
|
2455
|
+
handleResetAppSettings();
|
|
2444
2456
|
}
|
|
2445
2457
|
};
|
|
2458
|
+
var handleResetAppSettings = function () {
|
|
2459
|
+
setNewColumnAppSettings({});
|
|
2460
|
+
setNewColumnAppReady(true);
|
|
2461
|
+
};
|
|
2462
|
+
// INFO: one function for the table's life, so an app section that calls it
|
|
2463
|
+
// from an effect listing it as a dependency does not run the effect again
|
|
2464
|
+
// on every render
|
|
2465
|
+
var handleChangeAppSettings = (0, react_2.useCallback)(function (settings, ready) {
|
|
2466
|
+
if (ready === void 0) { ready = true; }
|
|
2467
|
+
setNewColumnAppSettings(settings !== null && settings !== void 0 ? settings : {});
|
|
2468
|
+
setNewColumnAppReady(ready);
|
|
2469
|
+
}, []);
|
|
2446
2470
|
// INFO: the stored field id is derived from what the user types rather than
|
|
2447
2471
|
// asked for separately — a column is named once, and the id is shown so the
|
|
2448
2472
|
// key that ends up on every record is never a surprise
|
|
@@ -2486,6 +2510,8 @@ var NewTable = function (rawProps) {
|
|
|
2486
2510
|
// INFO: a reference with no target resolves nothing, so it cannot be saved
|
|
2487
2511
|
// half-built. Everything else is complete with a name and a type.
|
|
2488
2512
|
var handleIsNewColumnReady = function () {
|
|
2513
|
+
if (!newColumnAppReady)
|
|
2514
|
+
return false;
|
|
2489
2515
|
if (LIST_TYPES.includes(newColumnType) && handleHasDuplicateOptions())
|
|
2490
2516
|
return false;
|
|
2491
2517
|
if (newColumnType === "number" &&
|
|
@@ -2559,6 +2585,13 @@ var NewTable = function (rawProps) {
|
|
|
2559
2585
|
else
|
|
2560
2586
|
delete column[eachKey];
|
|
2561
2587
|
});
|
|
2588
|
+
Object.entries(newColumnAppSettings).forEach(function (_a) {
|
|
2589
|
+
var eachKey = _a[0], eachValue = _a[1];
|
|
2590
|
+
if (eachValue === undefined)
|
|
2591
|
+
delete column[eachKey];
|
|
2592
|
+
else
|
|
2593
|
+
column[eachKey] = eachValue;
|
|
2594
|
+
});
|
|
2562
2595
|
return column;
|
|
2563
2596
|
};
|
|
2564
2597
|
var handleSubmitNewColumn = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -3499,7 +3532,7 @@ var NewTable = function (rawProps) {
|
|
|
3499
3532
|
};
|
|
3500
3533
|
// INFO: worked out here, after the Actions and "+" helpers it reads, and
|
|
3501
3534
|
// only read by the render helpers called from the return below
|
|
3502
|
-
var
|
|
3535
|
+
var _58 = handleFitPins(), fittedLeftPins = _58.widths, narrowPins = _58.narrow;
|
|
3503
3536
|
var renderActionColumnHeader = function () {
|
|
3504
3537
|
if (handleShowsActionColumn()) {
|
|
3505
3538
|
var pin = handleGetActionCellPin(true);
|