blixify-ui-web 1.2.56 → 1.2.59
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/chat/chatBase/index.d.ts +1 -1
- package/lib/components/chat/chatBase/index.d.ts.map +1 -1
- package/lib/components/chat/chatBase/index.js +8 -5
- package/lib/components/chat/chatBase/index.js.map +1 -1
- 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 +337 -221
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.d.ts +9 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.d.ts.map +1 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.js +33 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.js.map +1 -0
- package/lib/components/data/dataWrapper/index.d.ts +36 -1
- package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
- package/lib/components/data/dataWrapper/index.js +206 -61
- package/lib/components/data/dataWrapper/index.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +2 -3
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +2 -3
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readQuery/index.d.ts.map +1 -1
- package/lib/components/data/readQuery/index.js +9 -2
- package/lib/components/data/readQuery/index.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +18 -11
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts +9 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +74 -1
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/display/drawer/index.d.ts +22 -6
- package/lib/components/display/drawer/index.d.ts.map +1 -1
- package/lib/components/display/drawer/index.js +138 -17
- package/lib/components/display/drawer/index.js.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.d.ts.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.js +1 -2
- package/lib/components/display/flexTable/newMobileItemCard.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 +198 -23
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts +19 -4
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +217 -36
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +1 -0
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +5 -2
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textArea/index.d.ts +5 -0
- package/lib/components/input/textArea/index.d.ts.map +1 -1
- package/lib/components/input/textArea/index.js +10 -3
- package/lib/components/input/textArea/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ interface EditableProps {
|
|
|
28
28
|
active: boolean;
|
|
29
29
|
onUpdateData: (rowId: string, columnId: string, data: any) => Promise<void>;
|
|
30
30
|
};
|
|
31
|
+
onObjectEdit?: (rowId: string, columnId: string, data: any) => void;
|
|
31
32
|
}
|
|
32
33
|
interface DeleteableProps {
|
|
33
34
|
deleteable?: {
|
|
@@ -100,9 +101,8 @@ export interface State {
|
|
|
100
101
|
addColumnModal: string;
|
|
101
102
|
referenceLoading: boolean;
|
|
102
103
|
referencesOptions: {
|
|
103
|
-
key: string;
|
|
104
|
-
|
|
105
|
-
}[];
|
|
104
|
+
[key: string]: Option[];
|
|
105
|
+
};
|
|
106
106
|
referencesDetails: any;
|
|
107
107
|
editDataRowId: string;
|
|
108
108
|
editDataHeaderKey: string;
|
|
@@ -110,6 +110,7 @@ export interface State {
|
|
|
110
110
|
[key: string]: any;
|
|
111
111
|
};
|
|
112
112
|
editDataIsLoading: boolean;
|
|
113
|
+
modalEditVisible: boolean;
|
|
113
114
|
}
|
|
114
115
|
export declare class Table extends Component<Props> {
|
|
115
116
|
state: State;
|
|
@@ -119,7 +120,6 @@ export declare class Table extends Component<Props> {
|
|
|
119
120
|
originalEditData: {
|
|
120
121
|
[key: string]: any;
|
|
121
122
|
};
|
|
122
|
-
hasActionFeatures: () => boolean | undefined;
|
|
123
123
|
setReferencesOptions: (options: {}) => void;
|
|
124
124
|
setReferencesDetails: (options: {}) => void;
|
|
125
125
|
setReferenceLoading: (value: boolean) => void;
|
|
@@ -136,7 +136,21 @@ export declare class Table extends Component<Props> {
|
|
|
136
136
|
handleOnChangeText: (e: any) => void;
|
|
137
137
|
handleOnChangeSelect: (id: string, value: string) => void;
|
|
138
138
|
handleOnChangeDate: (id: string, value: Date) => void;
|
|
139
|
+
handleOnChangeFile: (e: any) => void;
|
|
140
|
+
handleOnChangeFiles: (id: string, value: any, action: "upload" | "remove" | "tagEdit") => void;
|
|
141
|
+
renderUpdateMethods: () => {
|
|
142
|
+
handleOnChangeAddress: (id: string, address: AddressClass) => void;
|
|
143
|
+
handleOnChangeText: (e: any) => void;
|
|
144
|
+
handleOnChangeSelect: (id: string, value: string) => void;
|
|
145
|
+
handleOnChangeDate: (id: string, value: Date) => void;
|
|
146
|
+
handleOnChangeFile: (e: any) => void;
|
|
147
|
+
handleOnChangeFiles: (id: string, value: any, action: "upload" | "remove" | "tagEdit") => void;
|
|
148
|
+
};
|
|
149
|
+
handleNormalizeEditValue: (headerKey: string, data: any) => any;
|
|
139
150
|
handleEditDataOnClick: (id: string, headerKey: string, data: {}) => void;
|
|
151
|
+
handleModalEditOnClick: (id: string, headerKey: string, data: {}) => void;
|
|
152
|
+
handleModalEditClose: () => void;
|
|
153
|
+
handleModalEditSave: () => Promise<void>;
|
|
140
154
|
handleEditDataOnBlur: (rowId: string, columnId: string, data: any) => Promise<void>;
|
|
141
155
|
handleRefreshTrigger: () => void;
|
|
142
156
|
handleSelect: (data: any, event: any) => void;
|
|
@@ -178,6 +192,7 @@ export declare class Table extends Component<Props> {
|
|
|
178
192
|
dataColor: string;
|
|
179
193
|
textColor: string;
|
|
180
194
|
};
|
|
195
|
+
renderModalEditor: () => React.JSX.Element | null;
|
|
181
196
|
render(): React.JSX.Element;
|
|
182
197
|
}
|
|
183
198
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/table/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAIlE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/table/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAIlE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAY5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC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;IAEF,oBAAoB,UACX,MAAM,cACD,WAAW,QACjB,GAAG,SACF,MAAM,uBA2Db;IAEF,gBAAgB,4BAkCd;IAEF,gBAAgB,0BAqFd;IAEF,gBAAgB,eAMd;IAEF,sBAAsB;;;;;;;;;;;;MA4CpB;IAEF,iBAAiB,iCAuEf;IAEF,MAAM;CA6FP"}
|
|
@@ -84,6 +84,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
84
84
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
88
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
89
|
+
if (ar || !(i in from)) {
|
|
90
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
91
|
+
ar[i] = from[i];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
95
|
+
};
|
|
87
96
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
88
97
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
89
98
|
};
|
|
@@ -101,8 +110,25 @@ var popUp_1 = require("../../advanced/popUp");
|
|
|
101
110
|
var readModule_1 = require("../../data/readModule");
|
|
102
111
|
var updateModule_1 = require("../../data/updateModule");
|
|
103
112
|
var utils_1 = require("../../data/utils");
|
|
113
|
+
var button_1 = require("../../action/button");
|
|
104
114
|
var link_1 = require("../../structure/link");
|
|
105
115
|
var modal_1 = require("../modal");
|
|
116
|
+
var handleCheckModalEditEmpty = function (value) {
|
|
117
|
+
if (value === undefined || value === null)
|
|
118
|
+
return true;
|
|
119
|
+
if (typeof value === "string") {
|
|
120
|
+
var trimmed = value.trim();
|
|
121
|
+
return trimmed === "" || trimmed === "-";
|
|
122
|
+
}
|
|
123
|
+
if (Array.isArray(value))
|
|
124
|
+
return value.length === 0;
|
|
125
|
+
if (typeof value === "object") {
|
|
126
|
+
if (Array.isArray(value.data))
|
|
127
|
+
return value.data.length === 0;
|
|
128
|
+
return Object.values(value).every(function (each) { return each === undefined || each === null || each === ""; });
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
};
|
|
106
132
|
var defaultLimit = 10;
|
|
107
133
|
var defaultPageSize = 5;
|
|
108
134
|
var Table = /** @class */ (function (_super) {
|
|
@@ -119,12 +145,13 @@ var Table = /** @class */ (function (_super) {
|
|
|
119
145
|
addColumnModal: "",
|
|
120
146
|
filterModal: "",
|
|
121
147
|
referenceLoading: false,
|
|
122
|
-
referencesOptions:
|
|
148
|
+
referencesOptions: {},
|
|
123
149
|
referencesDetails: {},
|
|
124
150
|
editDataRowId: "",
|
|
125
151
|
editDataHeaderKey: "",
|
|
126
152
|
editDataValue: {},
|
|
127
153
|
editDataIsLoading: false,
|
|
154
|
+
modalEditVisible: false,
|
|
128
155
|
};
|
|
129
156
|
_this.dbModule = ((_a = _this.props.devSettings) === null || _a === void 0 ? void 0 : _a.server) === "firebase"
|
|
130
157
|
? (_b = _this.props.lib) === null || _b === void 0 ? void 0 : _b.firebase
|
|
@@ -133,15 +160,11 @@ var Table = /** @class */ (function (_super) {
|
|
|
133
160
|
_this.editDataInputRefs = [];
|
|
134
161
|
// INFO: snapshot of row data when editing starts — used for diff check on blur
|
|
135
162
|
_this.originalEditData = {};
|
|
136
|
-
_this.hasActionFeatures = function () {
|
|
137
|
-
var _a, _b;
|
|
138
|
-
return ((_a = _this.props.addable) === null || _a === void 0 ? void 0 : _a.active) || ((_b = _this.props.deleteable) === null || _b === void 0 ? void 0 : _b.active);
|
|
139
|
-
};
|
|
140
163
|
_this.setReferencesOptions = function (options) {
|
|
141
164
|
_this.setState({ referencesOptions: options });
|
|
142
165
|
};
|
|
143
166
|
_this.setReferencesDetails = function (options) {
|
|
144
|
-
_this.setState({
|
|
167
|
+
_this.setState({ referencesDetails: options });
|
|
145
168
|
};
|
|
146
169
|
_this.setReferenceLoading = function (value) {
|
|
147
170
|
_this.setState({ referenceLoading: value });
|
|
@@ -153,18 +176,8 @@ var Table = /** @class */ (function (_super) {
|
|
|
153
176
|
var _a;
|
|
154
177
|
if ((_a = _this.props.addable) === null || _a === void 0 ? void 0 : _a.active)
|
|
155
178
|
_this.handleCreateFormInputRefs("add");
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
// this.handleConvertTableHeaderToDataStructure(this.props.header);
|
|
159
|
-
// handleRetrieveReferenceOptions(
|
|
160
|
-
// {},
|
|
161
|
-
// tableHeaderAsDataStructure,
|
|
162
|
-
// this.props.lib?.axios,
|
|
163
|
-
// this.props.devSettings,
|
|
164
|
-
// this.setReferencesOptions,
|
|
165
|
-
// this.setReferencesDetails
|
|
166
|
-
// );
|
|
167
|
-
}
|
|
179
|
+
// INFO: reference options are fetched per-cell by the Select component's
|
|
180
|
+
// own on-focus handler — one call per column focus, cached in state
|
|
168
181
|
if (_this.props.fixedPagination)
|
|
169
182
|
window.addEventListener("scroll", _this.handleScroll);
|
|
170
183
|
};
|
|
@@ -290,17 +303,130 @@ var Table = /** @class */ (function (_super) {
|
|
|
290
303
|
clonedData[id] = value;
|
|
291
304
|
_this.handleUpdateChangeData(clonedData);
|
|
292
305
|
};
|
|
306
|
+
_this.handleOnChangeFile = function (e) {
|
|
307
|
+
var clonedData = _this.handleGenerateClonedData();
|
|
308
|
+
clonedData[e.target.id] =
|
|
309
|
+
e.target.files.length > 0 ? e.target.files[0] : undefined;
|
|
310
|
+
_this.handleUpdateChangeData(clonedData);
|
|
311
|
+
};
|
|
312
|
+
// INFO: mirrors DataTemplate's FilesObj bookkeeping — {data, upload, remove} —
|
|
313
|
+
// so a multipleImage edited from the list goes through the exact same upload
|
|
314
|
+
// pipeline on submit as one edited from the update form
|
|
315
|
+
_this.handleOnChangeFiles = function (id, value, action) {
|
|
316
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
317
|
+
var clonedData = _this.handleGenerateClonedData();
|
|
318
|
+
var previousData = (_b = (_a = clonedData[id]) === null || _a === void 0 ? void 0 : _a["data"]) !== null && _b !== void 0 ? _b : [];
|
|
319
|
+
var previousUploadData = (_d = (_c = clonedData[id]) === null || _c === void 0 ? void 0 : _c["upload"]) !== null && _d !== void 0 ? _d : [];
|
|
320
|
+
var previousRemoveData = (_f = (_e = clonedData[id]) === null || _e === void 0 ? void 0 : _e["remove"]) !== null && _f !== void 0 ? _f : [];
|
|
321
|
+
if (action === "tagEdit") {
|
|
322
|
+
var applyTagUpdates = function (target, source) {
|
|
323
|
+
return target.map(function (item) {
|
|
324
|
+
var match = source.find(function (s) { return s.token === item.token; });
|
|
325
|
+
if (match) {
|
|
326
|
+
return __assign(__assign({}, item), { tags: match.tags, description: match.description, hidden: match.hidden });
|
|
327
|
+
}
|
|
328
|
+
return item;
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
clonedData[id] = __assign(__assign({}, clonedData[id]), { data: applyTagUpdates(previousData, (_g = value.data) !== null && _g !== void 0 ? _g : []), upload: applyTagUpdates(previousUploadData, (_h = value.upload) !== null && _h !== void 0 ? _h : []) });
|
|
332
|
+
}
|
|
333
|
+
else if (action === "upload") {
|
|
334
|
+
clonedData[id] = __assign(__assign({}, clonedData[id]), { upload: __spreadArray(__spreadArray([], value, true), previousUploadData, true) });
|
|
335
|
+
}
|
|
336
|
+
else {
|
|
337
|
+
if (previousData.some(function (file) { return file.token === value.token; })) {
|
|
338
|
+
clonedData[id] = __assign(__assign({}, clonedData[id]), { data: previousData.filter(function (file) { return file.token !== value.token; }), remove: __spreadArray(__spreadArray([], previousRemoveData, true), [value], false) });
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
clonedData[id] = __assign(__assign({}, clonedData[id]), { upload: previousUploadData.filter(function (file) { return file.token !== value.token; }) });
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
_this.handleUpdateChangeData(clonedData);
|
|
345
|
+
};
|
|
346
|
+
_this.renderUpdateMethods = function () {
|
|
347
|
+
return {
|
|
348
|
+
handleOnChangeAddress: _this.handleOnChangeAddress,
|
|
349
|
+
handleOnChangeText: _this.handleOnChangeText,
|
|
350
|
+
handleOnChangeSelect: _this.handleOnChangeSelect,
|
|
351
|
+
handleOnChangeDate: _this.handleOnChangeDate,
|
|
352
|
+
handleOnChangeFile: _this.handleOnChangeFile,
|
|
353
|
+
handleOnChangeFiles: _this.handleOnChangeFiles,
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
// INFO: multiple-file fields store a plain [{token, fileName}] array but the
|
|
357
|
+
// form input works on the {data, upload, remove} FilesObj shape — normalise on
|
|
358
|
+
// the way into the editor, never in the row data itself
|
|
359
|
+
_this.handleNormalizeEditValue = function (headerKey, data) {
|
|
360
|
+
var _a;
|
|
361
|
+
var selectedHeader = _this.props.header.find(function (eachHeader) { return eachHeader.key === headerKey; });
|
|
362
|
+
if (!selectedHeader)
|
|
363
|
+
return data;
|
|
364
|
+
if (selectedHeader.type === "multipleImage" ||
|
|
365
|
+
selectedHeader.type === "multipleFile") {
|
|
366
|
+
var value = data[headerKey];
|
|
367
|
+
if (Array.isArray(value) || value === undefined || value === null) {
|
|
368
|
+
return __assign(__assign({}, data), (_a = {}, _a[headerKey] = { data: value !== null && value !== void 0 ? value : [], upload: [], remove: [] }, _a));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return data;
|
|
372
|
+
};
|
|
293
373
|
_this.handleEditDataOnClick = function (id, headerKey, data) {
|
|
294
374
|
if (_this.state.editDataRowId !== id) {
|
|
295
375
|
_this.originalEditData = data;
|
|
296
376
|
_this.setState({
|
|
297
377
|
editDataRowId: id,
|
|
298
|
-
editDataValue: data,
|
|
378
|
+
editDataValue: _this.handleNormalizeEditValue(headerKey, data),
|
|
299
379
|
});
|
|
300
380
|
_this.handleCreateFormInputRefs("edit");
|
|
301
381
|
}
|
|
302
382
|
_this.setState({ addData: false, editDataHeaderKey: headerKey });
|
|
303
383
|
};
|
|
384
|
+
_this.handleModalEditOnClick = function (id, headerKey, data) {
|
|
385
|
+
_this.originalEditData = data;
|
|
386
|
+
_this.setState({
|
|
387
|
+
editDataRowId: id,
|
|
388
|
+
editDataValue: _this.handleNormalizeEditValue(headerKey, data),
|
|
389
|
+
editDataHeaderKey: headerKey,
|
|
390
|
+
addData: false,
|
|
391
|
+
modalEditVisible: true,
|
|
392
|
+
});
|
|
393
|
+
_this.handleCreateFormInputRefs("edit");
|
|
394
|
+
};
|
|
395
|
+
_this.handleModalEditClose = function () {
|
|
396
|
+
_this.setState({
|
|
397
|
+
modalEditVisible: false,
|
|
398
|
+
editDataRowId: "",
|
|
399
|
+
editDataValue: {},
|
|
400
|
+
editDataHeaderKey: "",
|
|
401
|
+
});
|
|
402
|
+
};
|
|
403
|
+
_this.handleModalEditSave = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
404
|
+
var _a, editDataRowId, editDataHeaderKey, editDataValue, value, isUntouchedFilesObj;
|
|
405
|
+
var _b, _c, _d, _e, _f, _g;
|
|
406
|
+
return __generator(this, function (_h) {
|
|
407
|
+
switch (_h.label) {
|
|
408
|
+
case 0:
|
|
409
|
+
_a = this.state, editDataRowId = _a.editDataRowId, editDataHeaderKey = _a.editDataHeaderKey, editDataValue = _a.editDataValue;
|
|
410
|
+
value = editDataValue[editDataHeaderKey];
|
|
411
|
+
isUntouchedFilesObj = value &&
|
|
412
|
+
typeof value === "object" &&
|
|
413
|
+
!Array.isArray(value) &&
|
|
414
|
+
Array.isArray(value.data) &&
|
|
415
|
+
((_c = (_b = value.upload) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) === 0 &&
|
|
416
|
+
((_e = (_d = value.remove) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0) === 0 &&
|
|
417
|
+
JSON.stringify(value.data) ===
|
|
418
|
+
JSON.stringify((_g = (_f = this.originalEditData) === null || _f === void 0 ? void 0 : _f[editDataHeaderKey]) !== null && _g !== void 0 ? _g : []);
|
|
419
|
+
if (!!isUntouchedFilesObj) return [3 /*break*/, 2];
|
|
420
|
+
return [4 /*yield*/, this.handleEditDataOnBlur(editDataRowId, editDataHeaderKey, editDataValue)];
|
|
421
|
+
case 1:
|
|
422
|
+
_h.sent();
|
|
423
|
+
_h.label = 2;
|
|
424
|
+
case 2:
|
|
425
|
+
this.handleModalEditClose();
|
|
426
|
+
return [2 /*return*/];
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}); };
|
|
304
430
|
_this.handleEditDataOnBlur = function (rowId, columnId, data) { return __awaiter(_this, void 0, void 0, function () {
|
|
305
431
|
var completedCond, isDiff;
|
|
306
432
|
var _a, _b, _c;
|
|
@@ -745,12 +871,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
745
871
|
var originalHeaderType = (_a = filteredTableHeaderList[index]["type"]) !== null && _a !== void 0 ? _a : "string";
|
|
746
872
|
if (utils_1.supportedTableAddList.includes(originalHeaderType)) {
|
|
747
873
|
renderAddDataList.push(react_2.default.createElement("td", { key: eachHeader.id + String(index), className: "px-4 py-4 whitespace-nowrap align-top" },
|
|
748
|
-
react_2.default.createElement("div", null, (0, updateModule_1.renderDataTemplateForm)(_this.state.addDataValue, [eachHeader], [_this.addDataInputRefs[index]], {
|
|
749
|
-
handleOnChangeAddress: _this.handleOnChangeAddress,
|
|
750
|
-
handleOnChangeText: _this.handleOnChangeText,
|
|
751
|
-
handleOnChangeSelect: _this.handleOnChangeSelect,
|
|
752
|
-
handleOnChangeDate: _this.handleOnChangeDate,
|
|
753
|
-
}, false, undefined, undefined, {
|
|
874
|
+
react_2.default.createElement("div", null, (0, updateModule_1.renderDataTemplateForm)(_this.state.addDataValue, [eachHeader], [_this.addDataInputRefs[index]], _this.renderUpdateMethods(), false, undefined, undefined, {
|
|
754
875
|
dbModule: axios_1.default,
|
|
755
876
|
devSettings: _this.props.devSettings,
|
|
756
877
|
referencesOptions: _this.state.referencesOptions,
|
|
@@ -804,14 +925,23 @@ var Table = /** @class */ (function (_super) {
|
|
|
804
925
|
? _this.props.header
|
|
805
926
|
: _this.props.header.filter(function (eachHeader) { return eachHeader.key !== "id"; });
|
|
806
927
|
filteredTableHeaderList.map(function (eachHeader, colIndex) {
|
|
807
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
928
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
808
929
|
var value = selectedSpaceData
|
|
809
930
|
? selectedSpaceData[eachHeader.key]
|
|
810
931
|
: eachData[eachHeader.key];
|
|
811
932
|
var editRowSelected = rowId === _this.state.editDataRowId;
|
|
812
933
|
// INFO: default to "string" when type is undefined so editable cells still work
|
|
813
934
|
var resolvedType = (_a = eachHeader.type) !== null && _a !== void 0 ? _a : "string";
|
|
814
|
-
|
|
935
|
+
// INFO: "update" is DataTemplate's action column — its cell value is a
|
|
936
|
+
// React element, never data. Treating it as an editable string cell mounts
|
|
937
|
+
// a required empty TextInput whose validation silently blocks EVERY inline
|
|
938
|
+
// commit on the row
|
|
939
|
+
var isActionColumn = eachHeader.key === "update" && !eachHeader.type;
|
|
940
|
+
var validateHeaderType = !isActionColumn && utils_1.supportedInlineEditList.includes(resolvedType);
|
|
941
|
+
var modalEditType = !isActionColumn && utils_1.supportedModalEditList.includes(resolvedType);
|
|
942
|
+
var objectEditType = !isActionColumn &&
|
|
943
|
+
resolvedType === "object" &&
|
|
944
|
+
!!_this.props.onObjectEdit;
|
|
815
945
|
var rowClassName = function (header, isGroupHeader) {
|
|
816
946
|
var className = "px-6 py-4 text-sm ";
|
|
817
947
|
if (header.width) {
|
|
@@ -845,8 +975,30 @@ var Table = /** @class */ (function (_super) {
|
|
|
845
975
|
}
|
|
846
976
|
else {
|
|
847
977
|
var data = editRowSelected ? _this.state.editDataValue : eachData;
|
|
848
|
-
if (((_d = _this.props.editable) === null || _d === void 0 ? void 0 : _d.active) &&
|
|
849
|
-
|
|
978
|
+
if (((_d = _this.props.editable) === null || _d === void 0 ? void 0 : _d.active) && objectEditType) {
|
|
979
|
+
renderRowData.push(react_2.default.createElement("td", { key: eachHeader.key + String(index), className: "".concat(rowClassName(eachHeader), " ").concat(dataColor) },
|
|
980
|
+
react_2.default.createElement("div", { className: "cursor-pointer group/modaledit flex items-center gap-x-2 min-h-6", "data-testid": "table-object-edit-".concat(eachHeader.key), onClick: function (e) {
|
|
981
|
+
var _a, _b;
|
|
982
|
+
e.stopPropagation();
|
|
983
|
+
(_b = (_a = _this.props).onObjectEdit) === null || _b === void 0 ? void 0 : _b.call(_a, rowId, eachHeader.key, eachData);
|
|
984
|
+
} },
|
|
985
|
+
handleCheckModalEditEmpty(value) ? (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add")) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord)),
|
|
986
|
+
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
987
|
+
}
|
|
988
|
+
else if (((_e = _this.props.editable) === null || _e === void 0 ? void 0 : _e.active) && modalEditType) {
|
|
989
|
+
// INFO: heavy editors (image upload, address autocomplete) get a Modal
|
|
990
|
+
// instead of an in-cell input — the cell itself stays a read-only
|
|
991
|
+
// preview that opens the editor on click
|
|
992
|
+
renderRowData.push(react_2.default.createElement("td", { key: eachHeader.key + String(index), className: "".concat(rowClassName(eachHeader), " ").concat(dataColor) },
|
|
993
|
+
react_2.default.createElement("div", { className: "cursor-pointer group/modaledit flex items-center gap-x-2 min-h-6", "data-testid": "table-modal-edit-".concat(eachHeader.key), onClick: function (e) {
|
|
994
|
+
e.stopPropagation();
|
|
995
|
+
_this.handleModalEditOnClick(rowId, eachHeader.key, eachData);
|
|
996
|
+
} },
|
|
997
|
+
handleCheckModalEditEmpty(value) ? (react_2.default.createElement("span", { className: "text-gray-400 italic" }, "Add")) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord)),
|
|
998
|
+
react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
|
|
999
|
+
}
|
|
1000
|
+
else if (((_f = _this.props.editable) === null || _f === void 0 ? void 0 : _f.active) && validateHeaderType) {
|
|
1001
|
+
var bareListDescription = (_h = (_g = _this.props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListDescription) === null || _h === void 0 ? void 0 : _h.call(_g, eachHeader.key, value);
|
|
850
1002
|
if (bareListDescription) {
|
|
851
1003
|
renderRowData.push(react_2.default.createElement("td", { key: eachHeader.key + String(index), className: "".concat(rowClassName(eachHeader), " ").concat(dataColor) }, (0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord)));
|
|
852
1004
|
}
|
|
@@ -857,7 +1009,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
857
1009
|
else if (_this.props.onClickRow) {
|
|
858
1010
|
renderRowData.push(react_2.default.createElement("td", { key: eachHeader.key + String(index), className: clickableClassName }, _this.props.newTabUrl ? (react_2.default.createElement(link_1.Link, { href: _this.props.newTabUrl +
|
|
859
1011
|
rowId +
|
|
860
|
-
((
|
|
1012
|
+
((_j = _this.props.addNewTabUrl) !== null && _j !== void 0 ? _j : ""), className: "w-full block", linkType: _this.props.linkType, custom: _this.props.custom }, (0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord))) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord))));
|
|
861
1013
|
}
|
|
862
1014
|
else {
|
|
863
1015
|
renderRowData.push(react_2.default.createElement("td", { key: eachHeader.key + String(index), className: "".concat(rowClassName(eachHeader), " ").concat(dataColor) }, (0, readModule_1.renderEachRowDataBasedOnDataType)(eachHeader.key, value, _this.props.bareSettings, true, _this.props.disableEllipsisOnLongWord)));
|
|
@@ -879,12 +1031,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
879
1031
|
react_2.default.createElement("div", { onClick: function (e) {
|
|
880
1032
|
e.stopPropagation();
|
|
881
1033
|
_this.handleEditDataOnClick(rowId, eachHeader.key, data);
|
|
882
|
-
}, className: "w-max p-[1px]" }, (0, updateModule_1.renderDataTemplateForm)(data, [tempDS], refs, {
|
|
883
|
-
handleOnChangeAddress: _this.handleOnChangeAddress,
|
|
884
|
-
handleOnChangeText: _this.handleOnChangeText,
|
|
885
|
-
handleOnChangeSelect: _this.handleOnChangeSelect,
|
|
886
|
-
handleOnChangeDate: _this.handleOnChangeDate,
|
|
887
|
-
}, false, {
|
|
1034
|
+
}, className: "w-max p-[1px]" }, (0, updateModule_1.renderDataTemplateForm)(data, [tempDS], refs, _this.renderUpdateMethods(), false, {
|
|
888
1035
|
active: true,
|
|
889
1036
|
onBlur: function (updateData) {
|
|
890
1037
|
return _this.handleEditDataOnBlur(_this.state.editDataRowId, eachHeader.key, updateData !== null && updateData !== void 0 ? updateData : data);
|
|
@@ -1009,6 +1156,39 @@ var Table = /** @class */ (function (_super) {
|
|
|
1009
1156
|
textColor: textColor,
|
|
1010
1157
|
};
|
|
1011
1158
|
};
|
|
1159
|
+
_this.renderModalEditor = function () {
|
|
1160
|
+
var _a;
|
|
1161
|
+
var _b = _this.state, editDataHeaderKey = _b.editDataHeaderKey, editDataValue = _b.editDataValue, modalEditVisible = _b.modalEditVisible;
|
|
1162
|
+
var selectedHeader = _this.props.header.find(function (eachHeader) { return eachHeader.key === editDataHeaderKey; });
|
|
1163
|
+
if (!modalEditVisible || !selectedHeader)
|
|
1164
|
+
return null;
|
|
1165
|
+
var tempDS = __assign(__assign({}, selectedHeader), { id: selectedHeader.key, name: selectedHeader.title, type: (_a = selectedHeader.type) !== null && _a !== void 0 ? _a : "string" });
|
|
1166
|
+
return (react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: "Edit ".concat(selectedHeader.title), maxWidth: "3xl", testId: "table-modal-editor", renderContent: function () {
|
|
1167
|
+
var _a, _b, _c, _d;
|
|
1168
|
+
return (react_2.default.createElement("div", { className: "text-left space-y-6 pt-2" },
|
|
1169
|
+
(0, updateModule_1.renderDataTemplateForm)(editDataValue, [tempDS], _this.editDataInputRefs, _this.renderUpdateMethods(), true, undefined, {
|
|
1170
|
+
id: _this.state.editDataRowId,
|
|
1171
|
+
type: "list",
|
|
1172
|
+
showId: _this.props.showId,
|
|
1173
|
+
}, {
|
|
1174
|
+
dbModule: axios_1.default,
|
|
1175
|
+
devSettings: _this.props.devSettings,
|
|
1176
|
+
referencesOptions: _this.state.referencesOptions,
|
|
1177
|
+
referencesDetails: _this.state.referencesDetails,
|
|
1178
|
+
referenceLoading: _this.state.referenceLoading,
|
|
1179
|
+
setReferenceLoading: _this.setReferenceLoading,
|
|
1180
|
+
setReferencesOptions: _this.setReferencesOptions,
|
|
1181
|
+
setReferencesDetails: _this.setReferencesDetails,
|
|
1182
|
+
}, {
|
|
1183
|
+
imageEndpoint: (_b = (_a = _this.props.devSettings) === null || _a === void 0 ? void 0 : _a.imageEndpoint) !== null && _b !== void 0 ? _b : "",
|
|
1184
|
+
imageBucketName: (_c = _this.props.devSettings) === null || _c === void 0 ? void 0 : _c.bucketName,
|
|
1185
|
+
maxFileSize: (_d = _this.props.devSettings) === null || _d === void 0 ? void 0 : _d.maxFileSize,
|
|
1186
|
+
}),
|
|
1187
|
+
react_2.default.createElement("div", { className: "flex justify-end gap-3", "data-testid": "table-modal-editor-actions" },
|
|
1188
|
+
react_2.default.createElement(button_1.Button, { text: "Cancel", type: "light", onClick: _this.handleModalEditClose }),
|
|
1189
|
+
react_2.default.createElement(button_1.Button, { text: _this.state.editDataIsLoading ? "Saving" : "Save", type: "normal", disable: _this.state.editDataIsLoading, onClick: _this.handleModalEditSave }))));
|
|
1190
|
+
}, onClose: _this.handleModalEditClose }));
|
|
1191
|
+
};
|
|
1012
1192
|
return _this;
|
|
1013
1193
|
}
|
|
1014
1194
|
Table.prototype.componentWillUnmount = function () {
|
|
@@ -1036,6 +1216,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
1036
1216
|
}, onClose: function () {
|
|
1037
1217
|
_this.handleAddColumnModal("");
|
|
1038
1218
|
} }),
|
|
1219
|
+
this.renderModalEditor(),
|
|
1039
1220
|
react_2.default.createElement("div", { className: "relative align-middle min-w-full overflow-x-auto shadow ".concat(bgColor, " sm:rounded-t-lg") },
|
|
1040
1221
|
(this.props.selectAll ||
|
|
1041
1222
|
(this.props.selectedIds
|