Skip to content

Commit f4d1f2e

Browse files
author
Valerio Como
committed
BTN List incomplete
1 parent 9935cc1 commit f4d1f2e

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

packages/ketchup/src/assets/input-panel.js

+63
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ const data = {
3030
title: 'Campionato vinto',
3131
visible: true,
3232
},
33+
{
34+
name: 'BUT',
35+
title: 'Buttons list',
36+
visible: true,
37+
},
3338
],
3439
rows: [
3540
{
@@ -110,6 +115,64 @@ const data = {
110115
mandatory: true,
111116
// shape: 'CHK',
112117
},
118+
BUT: {
119+
cssClass: 'strong-text',
120+
data: {
121+
data: [
122+
{
123+
children: [
124+
{
125+
children: [],
126+
disabled: false,
127+
expandable: false,
128+
icon: 'lightbulb-outline',
129+
isExpanded: false,
130+
obj: {
131+
k: '000050',
132+
p: 'COD_VER',
133+
t: 'VO',
134+
},
135+
options: false,
136+
value: 'Collaboratore',
137+
},
138+
{
139+
children: [],
140+
disabled: false,
141+
expandable: false,
142+
icon: 'briefcase',
143+
isExpanded: false,
144+
obj: {
145+
k: '000050',
146+
p: 'COD_VER',
147+
t: 'VO',
148+
},
149+
options: false,
150+
value: 'Azienda',
151+
},
152+
],
153+
data: {
154+
dropdownOnly: true,
155+
},
156+
disabled: false,
157+
expandable: false,
158+
isExpanded: false,
159+
options: false,
160+
},
161+
],
162+
customStyle:
163+
' #kup-component button { padding: 0; font-size: 0.65em; } ',
164+
icon: 'settings',
165+
className: 'kup-slim',
166+
},
167+
editable: true,
168+
obj: {
169+
k: '000050',
170+
p: 'COD_VER',
171+
t: 'VO',
172+
},
173+
shape: 'BTN',
174+
value: '',
175+
},
113176
},
114177
},
115178
],

packages/ketchup/src/components/kup-input-panel/kup-input-panel.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,50 @@ export class KupInputPanel {
197197
[FCellTypes.COLOR_PICKER, this.#CLPAdapter],
198198
[FCellTypes.COMBOBOX, this.#CMBandACPAdapter],
199199
[FCellTypes.STRING, this.#ITXAdapter],
200+
[FCellTypes.BUTTON_LIST, this.#BTNAdapter],
200201
]);
201202

202203
const adapter = dataAdapterMap.get(cellType);
204+
console.log(cellType, cell.shape, adapter === null);
203205

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

209+
#BTNAdapter(
210+
_options: {
211+
id: string;
212+
label: string;
213+
}[],
214+
_fieldLabel: string,
215+
_currentValue: string
216+
) {
217+
//TODO: come gestire i button list dal protocollo?
218+
return {
219+
data: [
220+
{
221+
// children: [
222+
// {
223+
// children: [],
224+
// disabled: false,
225+
// expandable: false,
226+
// icon: 'lightbulb-outline',
227+
// isExpanded: false,
228+
// obj: {
229+
// k: '000050',
230+
// p: 'COD_VER',
231+
// t: 'VO',
232+
// },
233+
// options: false,
234+
// value: 'Collaboratore',
235+
// },
236+
// ],
237+
data: { dropdownOnly: false, label: 'Pier' },
238+
},
239+
{ data: { dropdownOnly: false, label: 'Valerio' } },
240+
],
241+
};
242+
}
243+
207244
#CMBandACPAdapter(
208245
options: {
209246
id: string;

0 commit comments

Comments
 (0)