blixify-ui-web-mcp 0.1.46 → 0.1.47
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.
|
@@ -123,6 +123,36 @@ grey dashboard, but on a page that is already white it shows only a stray
|
|
|
123
123
|
outline and a shadow floating for no reason. Through `DataTemplate` the flag is
|
|
124
124
|
`bareSettings.bareFlatTable`.
|
|
125
125
|
|
|
126
|
+
##### Changing a column
|
|
127
|
+
|
|
128
|
+
`advSettings.onEditColumn` with `advSettings.getColumnSchema` puts a pencil
|
|
129
|
+
beside the hide icon, revealed on hover — not on a math column, which opens its
|
|
130
|
+
formula from its own pencil. It opens
|
|
131
|
+
the add-column panel filled in from `getColumnSchema(columnId)` (the headers do
|
|
132
|
+
not carry options or a reference target), and saving hands the changed column
|
|
133
|
+
to `onEditColumn`. The id never changes, so the column's values stay attached;
|
|
134
|
+
settings that belong to a type the column no longer has (options, a reference
|
|
135
|
+
target) are dropped.
|
|
136
|
+
|
|
137
|
+
The values already in the rows are never converted, so a column only changes to
|
|
138
|
+
a type its existing values are always valid as — specific to general, never back
|
|
139
|
+
(`handleGetEditableColumnTypes`): Phone or Email to Text or Long text, Single
|
|
140
|
+
select to Text or Long text, Text, Long text and Markdown among themselves,
|
|
141
|
+
Image to File and Images to Files. Text never becomes Phone, Email or Single
|
|
142
|
+
select, whose values it may not meet. Any other column keeps its type; its name,
|
|
143
|
+
options and reference target can still change.
|
|
144
|
+
|
|
145
|
+
Options are edited as one comma-separated line. Unchanged, they are kept exactly
|
|
146
|
+
as stored; changed, each option keeps its own colour and label
|
|
147
|
+
(`listSelectionColour`, `listSelectionLabel`), which follow it by value. A list
|
|
148
|
+
whose options contain a comma cannot be edited this way, and its options are
|
|
149
|
+
left as they are. Settings of the old type, and those read from an old reference
|
|
150
|
+
target, are dropped with the change. The pencil only shows where the built-in
|
|
151
|
+
panel can show the column — with `onAddColumn` and no `renderAddColumnElements`,
|
|
152
|
+
on a type the panel offers. Through `DataTemplate` (with `bareSettings.bareAddColumns`)
|
|
153
|
+
it arrives at the same `organise.onAddColumns(model)` as adding one, with the
|
|
154
|
+
column replaced in place.
|
|
155
|
+
|
|
126
156
|
##### Deleting a column
|
|
127
157
|
|
|
128
158
|
`advSettings.onDeleteColumn` puts a bin beside the hide icon, revealed on hover.
|
|
@@ -205,6 +205,26 @@ const EditableWithAddColumn = () => {
|
|
|
205
205
|
setColumns((previous) =>
|
|
206
206
|
previous.filter((eachColumn) => eachColumn.key !== columnId),
|
|
207
207
|
),
|
|
208
|
+
// INFO: an app hands back its stored column definition; the story
|
|
209
|
+
// builds one from the header's own fields
|
|
210
|
+
getColumnSchema: (columnId: string) => {
|
|
211
|
+
const column: any = columns.find(
|
|
212
|
+
(eachColumn) => eachColumn.key === columnId,
|
|
213
|
+
);
|
|
214
|
+
if (!column) return undefined;
|
|
215
|
+
const { key, title, ...rest } = column;
|
|
216
|
+
return { ...rest, id: key, name: title, optional: true };
|
|
217
|
+
},
|
|
218
|
+
onEditColumn: (column: any) => {
|
|
219
|
+
setLastAdded(column);
|
|
220
|
+
setColumns((previous) =>
|
|
221
|
+
previous.map((eachColumn) =>
|
|
222
|
+
eachColumn.key === column.id
|
|
223
|
+
? { ...column, key: column.id, title: column.name }
|
|
224
|
+
: eachColumn,
|
|
225
|
+
),
|
|
226
|
+
);
|
|
227
|
+
},
|
|
208
228
|
}}
|
|
209
229
|
/>
|
|
210
230
|
{lastAdded && (
|
|
@@ -586,7 +606,7 @@ export const NewTable = () => {
|
|
|
586
606
|
|
|
587
607
|
<StorySection
|
|
588
608
|
title="Editable"
|
|
589
|
-
description="editable.active=true makes cells clickable for inline editing. The + at the end of the header row adds a column — name it, pick a type, and the field id is derived from the name. Reference types ask for their endpoint and label; list types ask for options. The new column is editable straight away."
|
|
609
|
+
description="editable.active=true makes cells clickable for inline editing. The + at the end of the header row adds a column — name it, pick a type, and the field id is derived from the name. Reference types ask for their endpoint and label; list types ask for options. The new column is editable straight away. Hover a header for ✎ (onEditColumn with getColumnSchema): the same panel, filled in, changes the column's name, type, options or reference under the same id."
|
|
590
610
|
>
|
|
591
611
|
<EditableWithAddColumn />
|
|
592
612
|
</StorySection>
|