@sme.up/ketchup 11.0.0-SNAPSHOT-20250623143442 → 11.0.0-SNAPSHOT-20250625150034
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/dist/cjs/kup-input-panel.cjs.entry.js +118 -17
- package/dist/collection/components/kup-input-panel/kup-input-panel.js +118 -17
- package/dist/components/kup-input-panel.js +118 -17
- package/dist/esm/kup-input-panel.entry.js +118 -17
- package/dist/ketchup/ketchup.esm.js +1 -1
- package/dist/ketchup/p-a47935a9.entry.js +1 -0
- package/package.json +1 -1
- package/dist/ketchup/p-42074c8f.entry.js +0 -1
|
@@ -190,7 +190,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
190
190
|
}
|
|
191
191
|
return t;
|
|
192
192
|
};
|
|
193
|
-
var _KupInputPanel_instances, _KupInputPanel_kupManager, _KupInputPanel_formRef, _KupInputPanel_optionsAdapterMap, _KupInputPanel_originalData, _KupInputPanel_listeners, _KupInputPanel_cellTypeComponents, _KupInputPanel_cellTypesNeedingReset, _KupInputPanel_cellCustomRender, _KupInputPanel_sectionRenderMap, _KupInputPanel_readyPromise, _KupInputPanel_readyResolve, _KupInputPanel_getCell, _KupInputPanel_renderRow, _KupInputPanel_renderCell, _KupInputPanel_renderButton, _KupInputPanel_renderDropDownButton, _KupInputPanel_renderDataTable, _KupInputPanel_renderLabel, _KupInputPanel_getLabelComponent, _KupInputPanel_renderGridLayout, _KupInputPanel_renderAbsoluteLayout, _KupInputPanel_renderSection, _KupInputPanel_renderAbsoluteSection, _KupInputPanel_extractContentIds, _KupInputPanel_renderSectionTab, _KupInputPanel_skipRenderField, _KupInputPanel_renderField, _KupInputPanel_renderAbsoluteField, _KupInputPanel_mapCommands, _KupInputPanel_mapCells, _KupInputPanel_setData, _KupInputPanel_deepObjectsMerge, _KupInputPanel_reverseMapCells, _KupInputPanel_mapData, _KupInputPanel_slotData, _KupInputPanel_CHIAdapter, _KupInputPanel_GRAAdapter, _KupInputPanel_BTNAdapter, _KupInputPanel_CMBandACPAdapter, _KupInputPanel_getOptionHandler, _KupInputPanel_CHKAdapter, _KupInputPanel_CLPAdapter, _KupInputPanel_EDTAdapter, _KupInputPanel_ITXAdapter, _KupInputPanel_RADAdapter, _KupInputPanel_SWTAdapter, _KupInputPanel_DateAdapter, _KupInputPanel_ObjectAdapter, _KupInputPanel_ImageListAdapter, _KupInputPanel_FileUploadAdapter, _KupInputPanel_TimeAdapter, _KupInputPanel_NumberAdapter, _KupInputPanel_DataTableAdapter, _KupInputPanel_getTableUpdatedCell, _KupInputPanel_optionsTreeComboAdapter, _KupInputPanel_treeOptionsNodeAdapter, _KupInputPanel_dataTreeOptionsChildrenAdapter, _KupInputPanel_tableOptionsAdapter, _KupInputPanel_commandAdapter, _KupInputPanel_getAutocompleteEventCallback, _KupInputPanel_manageInputPanelCheck, _KupInputPanel_onCellUpdate, _KupInputPanel_setCellError, _KupInputPanel_areValuesUpdated, _KupInputPanel_getFunctionOnClickBTN, _KupInputPanel_findTraversedFCell, _KupInputPanel_getEventDetails, _KupInputPanel_didLoadInteractables, _KupInputPanel_setFocusOnInputElement, _KupInputPanel_findFirstInput, _KupInputPanel_setAutoSkip, _KupInputPanel_upload;
|
|
193
|
+
var _KupInputPanel_instances, _KupInputPanel_kupManager, _KupInputPanel_formRef, _KupInputPanel_optionsAdapterMap, _KupInputPanel_originalData, _KupInputPanel_listeners, _KupInputPanel_cellTypeComponents, _KupInputPanel_cellTypesNeedingReset, _KupInputPanel_cellCustomRender, _KupInputPanel_sectionRenderMap, _KupInputPanel_readyPromise, _KupInputPanel_readyResolve, _KupInputPanel_getCell, _KupInputPanel_renderRow, _KupInputPanel_renderCell, _KupInputPanel_renderButton, _KupInputPanel_renderDropDownButton, _KupInputPanel_renderDataTable, _KupInputPanel_renderLabel, _KupInputPanel_getLabelComponent, _KupInputPanel_renderGridLayout, _KupInputPanel_renderAbsoluteLayout, _KupInputPanel_renderSection, _KupInputPanel_renderAbsoluteSection, _KupInputPanel_extractContentIds, _KupInputPanel_renderSectionTab, _KupInputPanel_skipRenderField, _KupInputPanel_renderField, _KupInputPanel_renderAbsoluteField, _KupInputPanel_mapCommands, _KupInputPanel_mapCells, _KupInputPanel_setData, _KupInputPanel_deepObjectsMerge, _KupInputPanel_reverseMapCells, _KupInputPanel_mapData, _KupInputPanel_slotData, _KupInputPanel_CHIAdapter, _KupInputPanel_GRAAdapter, _KupInputPanel_BTNAdapter, _KupInputPanel_CMBandACPAdapter, _KupInputPanel_getOptionHandler, _KupInputPanel_isFCellEventPayload, _KupInputPanel_CHKAdapter, _KupInputPanel_CLPAdapter, _KupInputPanel_EDTAdapter, _KupInputPanel_ITXAdapter, _KupInputPanel_RADAdapter, _KupInputPanel_SWTAdapter, _KupInputPanel_DateAdapter, _KupInputPanel_ObjectAdapter, _KupInputPanel_ImageListAdapter, _KupInputPanel_FileUploadAdapter, _KupInputPanel_TimeAdapter, _KupInputPanel_NumberAdapter, _KupInputPanel_DataTableAdapter, _KupInputPanel_getTableUpdatedCell, _KupInputPanel_optionsTreeComboAdapter, _KupInputPanel_treeOptionsNodeAdapter, _KupInputPanel_dataTreeOptionsChildrenAdapter, _KupInputPanel_tableOptionsAdapter, _KupInputPanel_commandAdapter, _KupInputPanel_getAutocompleteEventCallback, _KupInputPanel_getTblAutocompleteEventCallback, _KupInputPanel_manageTblItemClick, _KupInputPanel_manageInputPanelCheck, _KupInputPanel_onCellUpdate, _KupInputPanel_setCellError, _KupInputPanel_areValuesUpdated, _KupInputPanel_getFunctionOnClickBTN, _KupInputPanel_findTraversedFCell, _KupInputPanel_getEventDetails, _KupInputPanel_didLoadInteractables, _KupInputPanel_setFocusOnInputElement, _KupInputPanel_findFirstInput, _KupInputPanel_setAutoSkip, _KupInputPanel_upload;
|
|
194
194
|
const dom = document.documentElement;
|
|
195
195
|
const KupInputPanel = class {
|
|
196
196
|
constructor(hostRef) {
|
|
@@ -402,15 +402,17 @@ const KupInputPanel = class {
|
|
|
402
402
|
index.h("p", null, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(kupManager.KupLanguageGeneric.EMPTY_DATA)),
|
|
403
403
|
]
|
|
404
404
|
: this.inputPanelCells.map((inputPanelCell) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_renderRow).call(this, inputPanelCell));
|
|
405
|
-
return (index.h(index.Host, { key: '
|
|
405
|
+
return (index.h(index.Host, { key: '4f83260012e56d294d98bfb0c311306f618f2090', "onKup-cell-blur": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageInputPanelCheck).call(this, e, CheckTriggeringEvents.BLUR), "onKup-cell-update": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_onCellUpdate).bind(this), "onKup-tabbar-click": (e) => {
|
|
406
406
|
this.tabSelected = e.detail.node.id;
|
|
407
|
-
}, "onKup-autocomplete-input": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-autocomplete-iconclick": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-combobox-iconclick": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e, true), "onKup-cell-itemclick": (e) =>
|
|
407
|
+
}, "onKup-autocomplete-input": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-autocomplete-iconclick": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-combobox-iconclick": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e, true), "onKup-cell-itemclick": (e) => {
|
|
408
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageInputPanelCheck).call(this, e, CheckTriggeringEvents.ITEMCLICK);
|
|
409
|
+
}, "onKup-objectfield-searchpayload": (e) => {
|
|
408
410
|
this.kupInputPanelObjectFieldSearchPayload.emit(e.detail);
|
|
409
411
|
}, "onKup-objectfield-opensearchmenu": (e) => {
|
|
410
412
|
this.kupInputPanelObjectFieldOpenSearchMenu.emit(e.detail);
|
|
411
413
|
}, "onKup-objectfield-selectedmenuitem": (e) => {
|
|
412
414
|
this.kupInputPanelObjectFieldSelectedMenuItem.emit(e.detail);
|
|
413
|
-
}, "onKup-file-upload-upload": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_upload).bind(this) }, index.h("style", { key: '
|
|
415
|
+
}, "onKup-file-upload-upload": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_upload).bind(this) }, index.h("style", { key: '90c43ddf4ab75a9811ad94064dee5760a8ad7cf6' }, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").theme.setKupStyle(this.rootElement)), index.h("div", { key: 'eb842ea71f9a4a1900333d180bca051e79d59d1f', id: GenericVariables.componentWrapperId }, inputPanelContent)));
|
|
414
416
|
}
|
|
415
417
|
disconnectedCallback() {
|
|
416
418
|
__classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.unregister(this);
|
|
@@ -545,7 +547,27 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
545
547
|
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getFunctionOnClickBTN).call(this, e.detail.node, e.detail.node.id);
|
|
546
548
|
} })));
|
|
547
549
|
}, _KupInputPanel_renderDataTable = function _KupInputPanel_renderDataTable(cell, { name }) {
|
|
548
|
-
return (index.h("kup-data-table", Object.assign({ id: name, editableData: true, showGroups: true, showFilters: true }, cell.data)
|
|
550
|
+
return (index.h("kup-data-table", Object.assign({ id: name, editableData: true, showGroups: true, showFilters: true }, cell.data, { "onKup-autocomplete-iconclick": (e) => {
|
|
551
|
+
e.preventDefault();
|
|
552
|
+
e.stopPropagation();
|
|
553
|
+
}, "onKup-autocomplete-input": (e) => {
|
|
554
|
+
e.preventDefault();
|
|
555
|
+
e.stopPropagation();
|
|
556
|
+
}, "onKup-datatable-cell-iconclick": (e) => {
|
|
557
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e);
|
|
558
|
+
e.preventDefault();
|
|
559
|
+
e.stopPropagation();
|
|
560
|
+
}, "onKup-datatable-cell-input": (e) => {
|
|
561
|
+
if (e.detail.type === 'autocomplete') {
|
|
562
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e);
|
|
563
|
+
}
|
|
564
|
+
e.preventDefault();
|
|
565
|
+
e.stopPropagation();
|
|
566
|
+
}, "onKup-cell-itemclick": (e) => {
|
|
567
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageTblItemClick).call(this, e);
|
|
568
|
+
e.preventDefault();
|
|
569
|
+
e.stopPropagation();
|
|
570
|
+
} })));
|
|
549
571
|
}, _KupInputPanel_renderLabel = function _KupInputPanel_renderLabel(cell, column, isAbsoluteLayout) {
|
|
550
572
|
const isNumberType = dom.ketchup.objects.isNumber(cell.obj);
|
|
551
573
|
const isFormattableType = isNumberType ||
|
|
@@ -798,11 +820,8 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
798
820
|
.flat();
|
|
799
821
|
}, _KupInputPanel_mapCells = function _KupInputPanel_mapCells(data) {
|
|
800
822
|
var _a, _b, _c, _d;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
const layout = (_c = data === null || data === void 0 ? void 0 : data.rows[0]) === null || _c === void 0 ? void 0 : _c.layout;
|
|
805
|
-
const inpuPanelCells = ((_d = data === null || data === void 0 ? void 0 : data.rows) === null || _d === void 0 ? void 0 : _d.length)
|
|
823
|
+
const layout = (_a = data === null || data === void 0 ? void 0 : data.rows[0]) === null || _a === void 0 ? void 0 : _a.layout;
|
|
824
|
+
const inpuPanelCells = ((_b = data === null || data === void 0 ? void 0 : data.rows) === null || _b === void 0 ? void 0 : _b.length)
|
|
806
825
|
? data.rows.reduce((inpuPanelCells, row) => {
|
|
807
826
|
const cells = data.columns.map((column) => {
|
|
808
827
|
const cell = structuredClone(row.cells[column.name]);
|
|
@@ -826,6 +845,9 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
826
845
|
queryCompNeedsReset ? el === null || el === void 0 ? void 0 : el.reset() : (_a = el === null || el === void 0 ? void 0 : el.setValue) === null || _a === void 0 ? void 0 : _a.call(el, cell.value);
|
|
827
846
|
}));
|
|
828
847
|
this.inputPanelCells = inpuPanelCells;
|
|
848
|
+
if ((_d = (_c = data.setup) === null || _c === void 0 ? void 0 : _c.commands) === null || _d === void 0 ? void 0 : _d.length) {
|
|
849
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_mapCommands).call(this);
|
|
850
|
+
}
|
|
829
851
|
}, _KupInputPanel_setData = function _KupInputPanel_setData(cell, column, layout) {
|
|
830
852
|
const defaultProps = Object.assign(Object.assign({}, __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_mapData).call(this, cell, column, layout)), { disabled: !cell.isEditable || column.useAs === kupManager.UseAsValue.KEY, id: column.name });
|
|
831
853
|
const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);
|
|
@@ -947,10 +969,21 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
947
969
|
},
|
|
948
970
|
};
|
|
949
971
|
}, _KupInputPanel_BTNAdapter = function _KupInputPanel_BTNAdapter(_options, _fieldLabel, _currentValue, cell, id) {
|
|
972
|
+
var _a, _b;
|
|
950
973
|
cell.data = cell.data || {};
|
|
951
974
|
cell.data.onClick = () => {
|
|
952
975
|
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getFunctionOnClickBTN).call(this, cell, id);
|
|
953
976
|
};
|
|
977
|
+
if (cell.data.BtnMap) {
|
|
978
|
+
const concurrentCommand = (_b = (_a = this.data.setup) === null || _a === void 0 ? void 0 : _a.commands) === null || _b === void 0 ? void 0 : _b.find((command) => command.obj.k === cell.data.BtnMap);
|
|
979
|
+
if (concurrentCommand) {
|
|
980
|
+
cell.isEditable = true;
|
|
981
|
+
cell.data.onClick = () => {
|
|
982
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getFunctionOnClickBTN).call(this, cell, concurrentCommand.obj.k);
|
|
983
|
+
};
|
|
984
|
+
this.data.setup.commands = this.data.setup.commands.filter((command) => command.obj.k !== concurrentCommand.obj.k);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
954
987
|
return Object.assign({ label: cell.value, fun: cell.fun }, cell.data);
|
|
955
988
|
}, _KupInputPanel_CMBandACPAdapter = function _KupInputPanel_CMBandACPAdapter(rawOptions, fieldLabel, currentValue, cell) {
|
|
956
989
|
const configCMandACP = kupManager.CMBandACPAdapter(currentValue, fieldLabel, []);
|
|
@@ -959,15 +992,22 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
959
992
|
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, rawOptions, currentValue);
|
|
960
993
|
}
|
|
961
994
|
return configCMandACP;
|
|
962
|
-
}, _KupInputPanel_getOptionHandler = function _KupInputPanel_getOptionHandler({ detail }, checkList = false) {
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if (checkList) {
|
|
966
|
-
triggerCallback = !detail.comp.data['kup-list'].data.length;
|
|
995
|
+
}, _KupInputPanel_getOptionHandler = function _KupInputPanel_getOptionHandler({ detail, }, checkList = false) {
|
|
996
|
+
if (__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_isFCellEventPayload).call(this, detail)) {
|
|
997
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getTblAutocompleteEventCallback).call(this, detail);
|
|
967
998
|
}
|
|
968
|
-
|
|
969
|
-
__classPrivateFieldGet(this, _KupInputPanel_instances, "m",
|
|
999
|
+
else {
|
|
1000
|
+
const cell = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getCell).call(this, detail.id);
|
|
1001
|
+
let triggerCallback = true;
|
|
1002
|
+
if (checkList) {
|
|
1003
|
+
triggerCallback = !detail.comp.data['kup-list'].data.length;
|
|
1004
|
+
}
|
|
1005
|
+
if (cell.fun && triggerCallback) {
|
|
1006
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getAutocompleteEventCallback).call(this, detail, cell);
|
|
1007
|
+
}
|
|
970
1008
|
}
|
|
1009
|
+
}, _KupInputPanel_isFCellEventPayload = function _KupInputPanel_isFCellEventPayload(detail) {
|
|
1010
|
+
return detail.cell ? true : false;
|
|
971
1011
|
}, _KupInputPanel_CHKAdapter = function _KupInputPanel_CHKAdapter(_options, fieldLabel, currentValue) {
|
|
972
1012
|
return kupManager.CHKAdapter(currentValue, fieldLabel);
|
|
973
1013
|
}, _KupInputPanel_CLPAdapter = function _KupInputPanel_CLPAdapter(_options, fieldLabel, _currentValue) {
|
|
@@ -1166,6 +1206,67 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1166
1206
|
}
|
|
1167
1207
|
detail.comp.refresh();
|
|
1168
1208
|
});
|
|
1209
|
+
}, _KupInputPanel_getTblAutocompleteEventCallback = function _KupInputPanel_getTblAutocompleteEventCallback(detail) {
|
|
1210
|
+
// Destructure frequently used properties
|
|
1211
|
+
const { cell, row, column, comp, id, event } = detail;
|
|
1212
|
+
const cellValue = cell === null || cell === void 0 ? void 0 : cell.value;
|
|
1213
|
+
const autocompleteEventDetail = detail.event.detail;
|
|
1214
|
+
try {
|
|
1215
|
+
this.optionsHandler(cell['fun'], autocompleteEventDetail.inputValue, { columns: comp.data.columns, rows: [row] }, column.name).then((options) => {
|
|
1216
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1217
|
+
// Filter visible columns
|
|
1218
|
+
const visibleColumns = ((_a = options === null || options === void 0 ? void 0 : options.columns) !== null && _a !== void 0 ? _a : [])
|
|
1219
|
+
.filter((col) => (col === null || col === void 0 ? void 0 : col.visible) !== false)
|
|
1220
|
+
.map((col) => col.name);
|
|
1221
|
+
// Filter rows to only include visible columns
|
|
1222
|
+
const filteredRows = (_c = (_b = options === null || options === void 0 ? void 0 : options.rows) === null || _b === void 0 ? void 0 : _b.map((rowData) => {
|
|
1223
|
+
const visibleCells = visibleColumns.reduce((acc, colName) => {
|
|
1224
|
+
if (rowData.cells[colName]) {
|
|
1225
|
+
acc[colName] = rowData.cells[colName];
|
|
1226
|
+
}
|
|
1227
|
+
return acc;
|
|
1228
|
+
}, {});
|
|
1229
|
+
return Object.assign(Object.assign({}, rowData), { cells: visibleCells });
|
|
1230
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
1231
|
+
// Prepare the final options with filtered data
|
|
1232
|
+
const visibleColumnsOptions = Object.assign(Object.assign({}, options), { rows: filteredRows });
|
|
1233
|
+
// Get and update table data
|
|
1234
|
+
const tableData = comp.data;
|
|
1235
|
+
const targetCell = tableData.rows[row.id].cells[column.name];
|
|
1236
|
+
// Initialize cell data structure if needed
|
|
1237
|
+
if (!((_e = (_d = targetCell.data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e['kup-list'])) {
|
|
1238
|
+
targetCell.data = {
|
|
1239
|
+
data: {
|
|
1240
|
+
'kup-list': {},
|
|
1241
|
+
'kup-text-field': Object.assign({}, targetCell.data),
|
|
1242
|
+
},
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
// Update the autocomplete list data
|
|
1246
|
+
const kupListData = targetCell.data.data['kup-list'];
|
|
1247
|
+
kupListData.data = filteredRows.length
|
|
1248
|
+
? (_f = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, visibleColumnsOptions, cellValue)) !== null && _f !== void 0 ? _f : []
|
|
1249
|
+
: [];
|
|
1250
|
+
kupListData.options = (_g = options.columns) !== null && _g !== void 0 ? _g : [];
|
|
1251
|
+
// Update the component data and refresh
|
|
1252
|
+
comp.data = tableData;
|
|
1253
|
+
this.data.rows[0].cells[id].value = JSON.stringify(tableData);
|
|
1254
|
+
// // Refresh components
|
|
1255
|
+
event.detail.comp.refresh();
|
|
1256
|
+
comp.refresh();
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
catch (error) {
|
|
1260
|
+
console.error('Error in autocomplete callback:', error);
|
|
1261
|
+
}
|
|
1262
|
+
}, _KupInputPanel_manageTblItemClick = function _KupInputPanel_manageTblItemClick(e) {
|
|
1263
|
+
const { cell, row, column, id, comp } = e.detail;
|
|
1264
|
+
const tableData = comp.data;
|
|
1265
|
+
tableData.rows[row.id].cells[column.name] = cell;
|
|
1266
|
+
comp.data = tableData;
|
|
1267
|
+
this.data.rows[0].cells[id].value = JSON.stringify(tableData);
|
|
1268
|
+
e.detail.event.detail.comp.refresh();
|
|
1269
|
+
comp.refresh();
|
|
1169
1270
|
}, _KupInputPanel_manageInputPanelCheck = async function _KupInputPanel_manageInputPanelCheck(e, eventType) {
|
|
1170
1271
|
var _a, _b, _c, _d, _e;
|
|
1171
1272
|
const { detail: { column, cell }, } = e;
|
|
@@ -26,7 +26,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
26
|
}
|
|
27
27
|
return t;
|
|
28
28
|
};
|
|
29
|
-
var _KupInputPanel_instances, _KupInputPanel_kupManager, _KupInputPanel_formRef, _KupInputPanel_optionsAdapterMap, _KupInputPanel_originalData, _KupInputPanel_listeners, _KupInputPanel_cellTypeComponents, _KupInputPanel_cellTypesNeedingReset, _KupInputPanel_cellCustomRender, _KupInputPanel_sectionRenderMap, _KupInputPanel_readyPromise, _KupInputPanel_readyResolve, _KupInputPanel_getCell, _KupInputPanel_renderRow, _KupInputPanel_renderCell, _KupInputPanel_renderButton, _KupInputPanel_renderDropDownButton, _KupInputPanel_renderEditor, _KupInputPanel_renderDataTable, _KupInputPanel_renderLabel, _KupInputPanel_getLabelComponent, _KupInputPanel_renderGridLayout, _KupInputPanel_renderAbsoluteLayout, _KupInputPanel_renderSection, _KupInputPanel_renderAbsoluteSection, _KupInputPanel_extractContentIds, _KupInputPanel_renderSectionTab, _KupInputPanel_skipRenderField, _KupInputPanel_renderField, _KupInputPanel_renderAbsoluteField, _KupInputPanel_mapCommands, _KupInputPanel_mapCells, _KupInputPanel_setData, _KupInputPanel_deepObjectsMerge, _KupInputPanel_reverseMapCells, _KupInputPanel_mapData, _KupInputPanel_slotData, _KupInputPanel_CHIAdapter, _KupInputPanel_GRAAdapter, _KupInputPanel_BTNAdapter, _KupInputPanel_CMBandACPAdapter, _KupInputPanel_getOptionHandler, _KupInputPanel_CHKAdapter, _KupInputPanel_CLPAdapter, _KupInputPanel_EDTAdapter, _KupInputPanel_ITXAdapter, _KupInputPanel_RADAdapter, _KupInputPanel_SWTAdapter, _KupInputPanel_DateAdapter, _KupInputPanel_ObjectAdapter, _KupInputPanel_ImageListAdapter, _KupInputPanel_FileUploadAdapter, _KupInputPanel_TimeAdapter, _KupInputPanel_NumberAdapter, _KupInputPanel_DataTableAdapter, _KupInputPanel_getTableUpdatedCell, _KupInputPanel_optionsTreeComboAdapter, _KupInputPanel_treeOptionsNodeAdapter, _KupInputPanel_dataTreeOptionsChildrenAdapter, _KupInputPanel_tableOptionsAdapter, _KupInputPanel_commandAdapter, _KupInputPanel_getAutocompleteEventCallback, _KupInputPanel_manageInputPanelCheck, _KupInputPanel_onCellUpdate, _KupInputPanel_setCellError, _KupInputPanel_areValuesUpdated, _KupInputPanel_getFunctionOnClickBTN, _KupInputPanel_findTraversedFCell, _KupInputPanel_getEventDetails, _KupInputPanel_didLoadInteractables, _KupInputPanel_setFocusOnInputElement, _KupInputPanel_findFirstInput, _KupInputPanel_setAutoSkip, _KupInputPanel_upload;
|
|
29
|
+
var _KupInputPanel_instances, _KupInputPanel_kupManager, _KupInputPanel_formRef, _KupInputPanel_optionsAdapterMap, _KupInputPanel_originalData, _KupInputPanel_listeners, _KupInputPanel_cellTypeComponents, _KupInputPanel_cellTypesNeedingReset, _KupInputPanel_cellCustomRender, _KupInputPanel_sectionRenderMap, _KupInputPanel_readyPromise, _KupInputPanel_readyResolve, _KupInputPanel_getCell, _KupInputPanel_renderRow, _KupInputPanel_renderCell, _KupInputPanel_renderButton, _KupInputPanel_renderDropDownButton, _KupInputPanel_renderEditor, _KupInputPanel_renderDataTable, _KupInputPanel_renderLabel, _KupInputPanel_getLabelComponent, _KupInputPanel_renderGridLayout, _KupInputPanel_renderAbsoluteLayout, _KupInputPanel_renderSection, _KupInputPanel_renderAbsoluteSection, _KupInputPanel_extractContentIds, _KupInputPanel_renderSectionTab, _KupInputPanel_skipRenderField, _KupInputPanel_renderField, _KupInputPanel_renderAbsoluteField, _KupInputPanel_mapCommands, _KupInputPanel_mapCells, _KupInputPanel_setData, _KupInputPanel_deepObjectsMerge, _KupInputPanel_reverseMapCells, _KupInputPanel_mapData, _KupInputPanel_slotData, _KupInputPanel_CHIAdapter, _KupInputPanel_GRAAdapter, _KupInputPanel_BTNAdapter, _KupInputPanel_CMBandACPAdapter, _KupInputPanel_getOptionHandler, _KupInputPanel_isFCellEventPayload, _KupInputPanel_CHKAdapter, _KupInputPanel_CLPAdapter, _KupInputPanel_EDTAdapter, _KupInputPanel_ITXAdapter, _KupInputPanel_RADAdapter, _KupInputPanel_SWTAdapter, _KupInputPanel_DateAdapter, _KupInputPanel_ObjectAdapter, _KupInputPanel_ImageListAdapter, _KupInputPanel_FileUploadAdapter, _KupInputPanel_TimeAdapter, _KupInputPanel_NumberAdapter, _KupInputPanel_DataTableAdapter, _KupInputPanel_getTableUpdatedCell, _KupInputPanel_optionsTreeComboAdapter, _KupInputPanel_treeOptionsNodeAdapter, _KupInputPanel_dataTreeOptionsChildrenAdapter, _KupInputPanel_tableOptionsAdapter, _KupInputPanel_commandAdapter, _KupInputPanel_getAutocompleteEventCallback, _KupInputPanel_getTblAutocompleteEventCallback, _KupInputPanel_manageTblItemClick, _KupInputPanel_manageInputPanelCheck, _KupInputPanel_onCellUpdate, _KupInputPanel_setCellError, _KupInputPanel_areValuesUpdated, _KupInputPanel_getFunctionOnClickBTN, _KupInputPanel_findTraversedFCell, _KupInputPanel_getEventDetails, _KupInputPanel_didLoadInteractables, _KupInputPanel_setFocusOnInputElement, _KupInputPanel_findFirstInput, _KupInputPanel_setAutoSkip, _KupInputPanel_upload;
|
|
30
30
|
import { forceUpdate, h, Host, } from "@stencil/core";
|
|
31
31
|
import { FButton } from "../../f-components/f-button/f-button";
|
|
32
32
|
import { FCell } from "../../f-components/f-cell/f-cell";
|
|
@@ -249,15 +249,17 @@ export class KupInputPanel {
|
|
|
249
249
|
h("p", null, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.translate(KupLanguageGeneric.EMPTY_DATA)),
|
|
250
250
|
]
|
|
251
251
|
: this.inputPanelCells.map((inputPanelCell) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_renderRow).call(this, inputPanelCell));
|
|
252
|
-
return (h(Host, { key: '
|
|
252
|
+
return (h(Host, { key: '4f83260012e56d294d98bfb0c311306f618f2090', "onKup-cell-blur": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageInputPanelCheck).call(this, e, CheckTriggeringEvents.BLUR), "onKup-cell-update": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_onCellUpdate).bind(this), "onKup-tabbar-click": (e) => {
|
|
253
253
|
this.tabSelected = e.detail.node.id;
|
|
254
|
-
}, "onKup-autocomplete-input": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-autocomplete-iconclick": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-combobox-iconclick": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e, true), "onKup-cell-itemclick": (e) =>
|
|
254
|
+
}, "onKup-autocomplete-input": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-autocomplete-iconclick": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).bind(this), "onKup-combobox-iconclick": (e) => __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e, true), "onKup-cell-itemclick": (e) => {
|
|
255
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageInputPanelCheck).call(this, e, CheckTriggeringEvents.ITEMCLICK);
|
|
256
|
+
}, "onKup-objectfield-searchpayload": (e) => {
|
|
255
257
|
this.kupInputPanelObjectFieldSearchPayload.emit(e.detail);
|
|
256
258
|
}, "onKup-objectfield-opensearchmenu": (e) => {
|
|
257
259
|
this.kupInputPanelObjectFieldOpenSearchMenu.emit(e.detail);
|
|
258
260
|
}, "onKup-objectfield-selectedmenuitem": (e) => {
|
|
259
261
|
this.kupInputPanelObjectFieldSelectedMenuItem.emit(e.detail);
|
|
260
|
-
}, "onKup-file-upload-upload": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_upload).bind(this) }, h("style", { key: '
|
|
262
|
+
}, "onKup-file-upload-upload": __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_upload).bind(this) }, h("style", { key: '90c43ddf4ab75a9811ad94064dee5760a8ad7cf6' }, __classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").theme.setKupStyle(this.rootElement)), h("div", { key: 'eb842ea71f9a4a1900333d180bca051e79d59d1f', id: componentWrapperId }, inputPanelContent)));
|
|
261
263
|
}
|
|
262
264
|
disconnectedCallback() {
|
|
263
265
|
__classPrivateFieldGet(this, _KupInputPanel_kupManager, "f").language.unregister(this);
|
|
@@ -1051,7 +1053,27 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1051
1053
|
});
|
|
1052
1054
|
return (h("kup-editor", Object.assign({}, cell.data, { id: name, isReadOnly: !cell.isEditable, showToolbar: true })));
|
|
1053
1055
|
}, _KupInputPanel_renderDataTable = function _KupInputPanel_renderDataTable(cell, { name }) {
|
|
1054
|
-
return (h("kup-data-table", Object.assign({ id: name, editableData: true, showGroups: true, showFilters: true }, cell.data)
|
|
1056
|
+
return (h("kup-data-table", Object.assign({ id: name, editableData: true, showGroups: true, showFilters: true }, cell.data, { "onKup-autocomplete-iconclick": (e) => {
|
|
1057
|
+
e.preventDefault();
|
|
1058
|
+
e.stopPropagation();
|
|
1059
|
+
}, "onKup-autocomplete-input": (e) => {
|
|
1060
|
+
e.preventDefault();
|
|
1061
|
+
e.stopPropagation();
|
|
1062
|
+
}, "onKup-datatable-cell-iconclick": (e) => {
|
|
1063
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e);
|
|
1064
|
+
e.preventDefault();
|
|
1065
|
+
e.stopPropagation();
|
|
1066
|
+
}, "onKup-datatable-cell-input": (e) => {
|
|
1067
|
+
if (e.detail.type === 'autocomplete') {
|
|
1068
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getOptionHandler).call(this, e);
|
|
1069
|
+
}
|
|
1070
|
+
e.preventDefault();
|
|
1071
|
+
e.stopPropagation();
|
|
1072
|
+
}, "onKup-cell-itemclick": (e) => {
|
|
1073
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_manageTblItemClick).call(this, e);
|
|
1074
|
+
e.preventDefault();
|
|
1075
|
+
e.stopPropagation();
|
|
1076
|
+
} })));
|
|
1055
1077
|
}, _KupInputPanel_renderLabel = function _KupInputPanel_renderLabel(cell, column, isAbsoluteLayout) {
|
|
1056
1078
|
const isNumberType = dom.ketchup.objects.isNumber(cell.obj);
|
|
1057
1079
|
const isFormattableType = isNumberType ||
|
|
@@ -1304,11 +1326,8 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1304
1326
|
.flat();
|
|
1305
1327
|
}, _KupInputPanel_mapCells = function _KupInputPanel_mapCells(data) {
|
|
1306
1328
|
var _a, _b, _c, _d;
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
const layout = (_c = data === null || data === void 0 ? void 0 : data.rows[0]) === null || _c === void 0 ? void 0 : _c.layout;
|
|
1311
|
-
const inpuPanelCells = ((_d = data === null || data === void 0 ? void 0 : data.rows) === null || _d === void 0 ? void 0 : _d.length)
|
|
1329
|
+
const layout = (_a = data === null || data === void 0 ? void 0 : data.rows[0]) === null || _a === void 0 ? void 0 : _a.layout;
|
|
1330
|
+
const inpuPanelCells = ((_b = data === null || data === void 0 ? void 0 : data.rows) === null || _b === void 0 ? void 0 : _b.length)
|
|
1312
1331
|
? data.rows.reduce((inpuPanelCells, row) => {
|
|
1313
1332
|
const cells = data.columns.map((column) => {
|
|
1314
1333
|
const cell = structuredClone(row.cells[column.name]);
|
|
@@ -1332,6 +1351,9 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1332
1351
|
queryCompNeedsReset ? el === null || el === void 0 ? void 0 : el.reset() : (_a = el === null || el === void 0 ? void 0 : el.setValue) === null || _a === void 0 ? void 0 : _a.call(el, cell.value);
|
|
1333
1352
|
}));
|
|
1334
1353
|
this.inputPanelCells = inpuPanelCells;
|
|
1354
|
+
if ((_d = (_c = data.setup) === null || _c === void 0 ? void 0 : _c.commands) === null || _d === void 0 ? void 0 : _d.length) {
|
|
1355
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_mapCommands).call(this);
|
|
1356
|
+
}
|
|
1335
1357
|
}, _KupInputPanel_setData = function _KupInputPanel_setData(cell, column, layout) {
|
|
1336
1358
|
const defaultProps = Object.assign(Object.assign({}, __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_mapData).call(this, cell, column, layout)), { disabled: !cell.isEditable || column.useAs === UseAsValue.KEY, id: column.name });
|
|
1337
1359
|
const cellType = dom.ketchup.data.cell.getType(cell, cell.shape);
|
|
@@ -1453,10 +1475,21 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1453
1475
|
},
|
|
1454
1476
|
};
|
|
1455
1477
|
}, _KupInputPanel_BTNAdapter = function _KupInputPanel_BTNAdapter(_options, _fieldLabel, _currentValue, cell, id) {
|
|
1478
|
+
var _a, _b;
|
|
1456
1479
|
cell.data = cell.data || {};
|
|
1457
1480
|
cell.data.onClick = () => {
|
|
1458
1481
|
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getFunctionOnClickBTN).call(this, cell, id);
|
|
1459
1482
|
};
|
|
1483
|
+
if (cell.data.BtnMap) {
|
|
1484
|
+
const concurrentCommand = (_b = (_a = this.data.setup) === null || _a === void 0 ? void 0 : _a.commands) === null || _b === void 0 ? void 0 : _b.find((command) => command.obj.k === cell.data.BtnMap);
|
|
1485
|
+
if (concurrentCommand) {
|
|
1486
|
+
cell.isEditable = true;
|
|
1487
|
+
cell.data.onClick = () => {
|
|
1488
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getFunctionOnClickBTN).call(this, cell, concurrentCommand.obj.k);
|
|
1489
|
+
};
|
|
1490
|
+
this.data.setup.commands = this.data.setup.commands.filter((command) => command.obj.k !== concurrentCommand.obj.k);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1460
1493
|
return Object.assign({ label: cell.value, fun: cell.fun }, cell.data);
|
|
1461
1494
|
}, _KupInputPanel_CMBandACPAdapter = function _KupInputPanel_CMBandACPAdapter(rawOptions, fieldLabel, currentValue, cell) {
|
|
1462
1495
|
const configCMandACP = CMBandACPAdapter(currentValue, fieldLabel, [], cell.data);
|
|
@@ -1465,15 +1498,22 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1465
1498
|
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, rawOptions, currentValue);
|
|
1466
1499
|
}
|
|
1467
1500
|
return configCMandACP;
|
|
1468
|
-
}, _KupInputPanel_getOptionHandler = function _KupInputPanel_getOptionHandler({ detail }, checkList = false) {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
if (checkList) {
|
|
1472
|
-
triggerCallback = !detail.comp.data['kup-list'].data.length;
|
|
1501
|
+
}, _KupInputPanel_getOptionHandler = function _KupInputPanel_getOptionHandler({ detail, }, checkList = false) {
|
|
1502
|
+
if (__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_isFCellEventPayload).call(this, detail)) {
|
|
1503
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getTblAutocompleteEventCallback).call(this, detail);
|
|
1473
1504
|
}
|
|
1474
|
-
|
|
1475
|
-
__classPrivateFieldGet(this, _KupInputPanel_instances, "m",
|
|
1505
|
+
else {
|
|
1506
|
+
const cell = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getCell).call(this, detail.id);
|
|
1507
|
+
let triggerCallback = true;
|
|
1508
|
+
if (checkList) {
|
|
1509
|
+
triggerCallback = !detail.comp.data['kup-list'].data.length;
|
|
1510
|
+
}
|
|
1511
|
+
if (cell.fun && triggerCallback) {
|
|
1512
|
+
__classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_getAutocompleteEventCallback).call(this, detail, cell);
|
|
1513
|
+
}
|
|
1476
1514
|
}
|
|
1515
|
+
}, _KupInputPanel_isFCellEventPayload = function _KupInputPanel_isFCellEventPayload(detail) {
|
|
1516
|
+
return detail.cell ? true : false;
|
|
1477
1517
|
}, _KupInputPanel_CHKAdapter = function _KupInputPanel_CHKAdapter(_options, fieldLabel, currentValue) {
|
|
1478
1518
|
return CHKAdapter(currentValue, fieldLabel);
|
|
1479
1519
|
}, _KupInputPanel_CLPAdapter = function _KupInputPanel_CLPAdapter(_options, fieldLabel, _currentValue) {
|
|
@@ -1672,6 +1712,67 @@ _KupInputPanel_kupManager = new WeakMap(), _KupInputPanel_formRef = new WeakMap(
|
|
|
1672
1712
|
}
|
|
1673
1713
|
detail.comp.refresh();
|
|
1674
1714
|
});
|
|
1715
|
+
}, _KupInputPanel_getTblAutocompleteEventCallback = function _KupInputPanel_getTblAutocompleteEventCallback(detail) {
|
|
1716
|
+
// Destructure frequently used properties
|
|
1717
|
+
const { cell, row, column, comp, id, event } = detail;
|
|
1718
|
+
const cellValue = cell === null || cell === void 0 ? void 0 : cell.value;
|
|
1719
|
+
const autocompleteEventDetail = detail.event.detail;
|
|
1720
|
+
try {
|
|
1721
|
+
this.optionsHandler(cell['fun'], autocompleteEventDetail.inputValue, { columns: comp.data.columns, rows: [row] }, column.name).then((options) => {
|
|
1722
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1723
|
+
// Filter visible columns
|
|
1724
|
+
const visibleColumns = ((_a = options === null || options === void 0 ? void 0 : options.columns) !== null && _a !== void 0 ? _a : [])
|
|
1725
|
+
.filter((col) => (col === null || col === void 0 ? void 0 : col.visible) !== false)
|
|
1726
|
+
.map((col) => col.name);
|
|
1727
|
+
// Filter rows to only include visible columns
|
|
1728
|
+
const filteredRows = (_c = (_b = options === null || options === void 0 ? void 0 : options.rows) === null || _b === void 0 ? void 0 : _b.map((rowData) => {
|
|
1729
|
+
const visibleCells = visibleColumns.reduce((acc, colName) => {
|
|
1730
|
+
if (rowData.cells[colName]) {
|
|
1731
|
+
acc[colName] = rowData.cells[colName];
|
|
1732
|
+
}
|
|
1733
|
+
return acc;
|
|
1734
|
+
}, {});
|
|
1735
|
+
return Object.assign(Object.assign({}, rowData), { cells: visibleCells });
|
|
1736
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
1737
|
+
// Prepare the final options with filtered data
|
|
1738
|
+
const visibleColumnsOptions = Object.assign(Object.assign({}, options), { rows: filteredRows });
|
|
1739
|
+
// Get and update table data
|
|
1740
|
+
const tableData = comp.data;
|
|
1741
|
+
const targetCell = tableData.rows[row.id].cells[column.name];
|
|
1742
|
+
// Initialize cell data structure if needed
|
|
1743
|
+
if (!((_e = (_d = targetCell.data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e['kup-list'])) {
|
|
1744
|
+
targetCell.data = {
|
|
1745
|
+
data: {
|
|
1746
|
+
'kup-list': {},
|
|
1747
|
+
'kup-text-field': Object.assign({}, targetCell.data),
|
|
1748
|
+
},
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
// Update the autocomplete list data
|
|
1752
|
+
const kupListData = targetCell.data.data['kup-list'];
|
|
1753
|
+
kupListData.data = filteredRows.length
|
|
1754
|
+
? (_f = __classPrivateFieldGet(this, _KupInputPanel_instances, "m", _KupInputPanel_optionsTreeComboAdapter).call(this, visibleColumnsOptions, cellValue)) !== null && _f !== void 0 ? _f : []
|
|
1755
|
+
: [];
|
|
1756
|
+
kupListData.options = (_g = options.columns) !== null && _g !== void 0 ? _g : [];
|
|
1757
|
+
// Update the component data and refresh
|
|
1758
|
+
comp.data = tableData;
|
|
1759
|
+
this.data.rows[0].cells[id].value = JSON.stringify(tableData);
|
|
1760
|
+
// // Refresh components
|
|
1761
|
+
event.detail.comp.refresh();
|
|
1762
|
+
comp.refresh();
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
catch (error) {
|
|
1766
|
+
console.error('Error in autocomplete callback:', error);
|
|
1767
|
+
}
|
|
1768
|
+
}, _KupInputPanel_manageTblItemClick = function _KupInputPanel_manageTblItemClick(e) {
|
|
1769
|
+
const { cell, row, column, id, comp } = e.detail;
|
|
1770
|
+
const tableData = comp.data;
|
|
1771
|
+
tableData.rows[row.id].cells[column.name] = cell;
|
|
1772
|
+
comp.data = tableData;
|
|
1773
|
+
this.data.rows[0].cells[id].value = JSON.stringify(tableData);
|
|
1774
|
+
e.detail.event.detail.comp.refresh();
|
|
1775
|
+
comp.refresh();
|
|
1675
1776
|
}, _KupInputPanel_manageInputPanelCheck = async function _KupInputPanel_manageInputPanelCheck(e, eventType) {
|
|
1676
1777
|
var _a, _b, _c, _d, _e;
|
|
1677
1778
|
const { detail: { column, cell }, } = e;
|