Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerio Como committed Mar 21, 2024
1 parent f4d1f2e commit a4dc21b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
23 changes: 23 additions & 0 deletions packages/ketchup/src/assets/input-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const data = {
title: 'Campionato vinto',
visible: true,
},
{
name: 'CHA',
title: 'Chart',
visible: true,
},
{
name: 'BUT',
title: 'Buttons list',
Expand Down Expand Up @@ -115,6 +120,24 @@ const data = {
mandatory: true,
// shape: 'CHK',
},
CHA: {
data: {
sizeX: '50px',
offlineMode: {
value: '8;4;5',
},
id: 'i1012_GREF_0',
cellId: 'i1012_GREF_0',
sizeY: '50px',
},
obj: {
k: '8;4;5',
p: 'GRA_PIE',
t: 'J4',
},
shape: 'Gra',
value: '8;4;5',
},
BUT: {
cssClass: 'strong-text',
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,35 @@ export class KupInputPanel {

const dataAdapterMap = new Map<FCellTypes, DataAdapterFn>([
[FCellTypes.AUTOCOMPLETE, this.#CMBandACPAdapter],
[FCellTypes.BUTTON_LIST, this.#BTNAdapter],
[FCellTypes.CHART, this.#GRAAdapter],
[FCellTypes.CHECKBOX, this.#CHKAdapter],
[FCellTypes.COLOR_PICKER, this.#CLPAdapter],
[FCellTypes.COMBOBOX, this.#CMBandACPAdapter],
[FCellTypes.STRING, this.#ITXAdapter],
[FCellTypes.BUTTON_LIST, this.#BTNAdapter],
]);

const adapter = dataAdapterMap.get(cellType);
console.log(cellType, cell.shape, adapter === null);
console.log(cellType, cell.shape, adapter === undefined);

return adapter ? adapter(options, fieldLabel, currentValue) : null;
}

#GRAAdapter() {
//TODO: definire mapping
return {
data: {
sizeX: '50px',
offlineMode: {
value: '8;4;5',
},
id: 'i1012_GREF_0',
cellId: 'i1012_GREF_0',
sizeY: '50px',
},
};
}

#BTNAdapter(
_options: {
id: string;
Expand Down

0 comments on commit a4dc21b

Please sign in to comment.