@aglyn/shared-ui-jsx-forms 1.15.1 → 1.16.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/shared-ui-jsx-forms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/shared-data-enums": "1.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.
|
|
30
|
-
"@aglyn/shared-ui-color-picker": "1.
|
|
31
|
-
"@aglyn/shared-ui-jsx": "1.
|
|
32
|
-
"@aglyn/shared-ui-theme": "1.
|
|
33
|
-
"@aglyn/shared-util-tools": "1.
|
|
34
|
-
"@aglyn/shared-util-vendor": "1.
|
|
28
|
+
"@aglyn/shared-data-enums": "1.16.0",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.16.0",
|
|
30
|
+
"@aglyn/shared-ui-color-picker": "1.16.0",
|
|
31
|
+
"@aglyn/shared-ui-jsx": "1.16.0",
|
|
32
|
+
"@aglyn/shared-ui-theme": "1.16.0",
|
|
33
|
+
"@aglyn/shared-util-tools": "1.16.0",
|
|
34
|
+
"@aglyn/shared-util-vendor": "1.16.0",
|
|
35
35
|
"@data-driven-forms/common": "^4.2.0",
|
|
36
36
|
"@data-driven-forms/react-form-renderer": "^4.2.0",
|
|
37
37
|
"@swc/helpers": "0.5.23",
|
|
@@ -16,12 +16,13 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
17
|
* See the License for the specific language governing permissions and
|
|
18
18
|
* limitations under the License.
|
|
19
|
-
*/ import {
|
|
20
|
-
import { mdiFormatAlignCenter, mdiFormatAlignLeft, mdiFormatAlignRight, mdiPlus, mdiTrashCanOutline } from "@aglyn/shared-data-mdi";
|
|
19
|
+
*/ import { dataTableCellText, dataTableStarterValue, editDataTableShape, isDataTableCellMarkup, parseDataTableRows, readDataTableAlignments, readPastedDataTable, serializeDataTable, withCellSet } from "@aglyn/shared-data-enums";
|
|
20
|
+
import { mdiFormatAlignCenter, mdiFormatAlignLeft, mdiFormatAlignRight, mdiFormatClear, mdiPlus, mdiTrashCanOutline } from "@aglyn/shared-data-mdi";
|
|
21
21
|
import { MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
22
22
|
import Box from "@mui/material/Box";
|
|
23
23
|
import Button from "@mui/material/Button";
|
|
24
24
|
import IconButton from "@mui/material/IconButton";
|
|
25
|
+
import InputAdornment from "@mui/material/InputAdornment";
|
|
25
26
|
import Stack from "@mui/material/Stack";
|
|
26
27
|
import TextField from "@mui/material/TextField";
|
|
27
28
|
import ToggleButton from "@mui/material/ToggleButton";
|
|
@@ -92,6 +93,17 @@ export const DataTableField = (props)=>{
|
|
|
92
93
|
alignments
|
|
93
94
|
]);
|
|
94
95
|
/**
|
|
96
|
+
* A change to the table's shape, through the same helper the canvas uses
|
|
97
|
+
* (AGL-4203), so a column's alignment moves with the column instead of
|
|
98
|
+
* sliding onto its neighbour.
|
|
99
|
+
*/ const reshape = useCallback((edit)=>{
|
|
100
|
+
input.onChange(editDataTableShape(stored, edit));
|
|
101
|
+
}, [
|
|
102
|
+
input,
|
|
103
|
+
stored
|
|
104
|
+
]);
|
|
105
|
+
const anyFormatted = rows.some((row)=>row.some(isDataTableCellMarkup));
|
|
106
|
+
/**
|
|
95
107
|
* Importing a markdown table by pasting it into a cell (AGL-2568).
|
|
96
108
|
*
|
|
97
109
|
* It replaces the whole grid rather than splicing at the cell, because what
|
|
@@ -134,22 +146,7 @@ export const DataTableField = (props)=>{
|
|
|
134
146
|
startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
135
147
|
path: mdiPlus.path
|
|
136
148
|
}),
|
|
137
|
-
onClick: ()=>
|
|
138
|
-
[
|
|
139
|
-
'Feature',
|
|
140
|
-
'Us',
|
|
141
|
-
'Them'
|
|
142
|
-
],
|
|
143
|
-
[
|
|
144
|
-
'',
|
|
145
|
-
'',
|
|
146
|
-
''
|
|
147
|
-
]
|
|
148
|
-
], [
|
|
149
|
-
'left',
|
|
150
|
-
'center',
|
|
151
|
-
'center'
|
|
152
|
-
]),
|
|
149
|
+
onClick: ()=>input.onChange(dataTableStarterValue()),
|
|
153
150
|
children: 'Start a table'
|
|
154
151
|
}),
|
|
155
152
|
/*#__PURE__*/ _jsx(Box, {
|
|
@@ -215,7 +212,10 @@ export const DataTableField = (props)=>{
|
|
|
215
212
|
size: "small",
|
|
216
213
|
disabled: locked || width <= 1,
|
|
217
214
|
"aria-label": `Remove column ${columnIndex + 1}`,
|
|
218
|
-
onClick: ()=>
|
|
215
|
+
onClick: ()=>reshape({
|
|
216
|
+
kind: 'removeColumn',
|
|
217
|
+
at: columnIndex
|
|
218
|
+
}),
|
|
219
219
|
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
220
220
|
path: mdiTrashCanOutline.path,
|
|
221
221
|
size: 0.7
|
|
@@ -231,24 +231,57 @@ export const DataTableField = (props)=>{
|
|
|
231
231
|
alignItems: 'center'
|
|
232
232
|
},
|
|
233
233
|
children: [
|
|
234
|
-
row.map((cell, columnIndex)
|
|
234
|
+
row.map((cell, columnIndex)=>{
|
|
235
|
+
// A formatted cell (AGL-4203) holds markup this plain field
|
|
236
|
+
// cannot show or keep, so it shows the cell's words and is
|
|
237
|
+
// edited on the canvas, where its formatting is. Typing here
|
|
238
|
+
// would silently drop the formatting; Remove formatting does
|
|
239
|
+
// the same on purpose.
|
|
240
|
+
const formatted = isDataTableCellMarkup(cell);
|
|
241
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
235
242
|
size: "small",
|
|
236
243
|
fullWidth: true,
|
|
237
244
|
disabled: locked,
|
|
238
|
-
value: cell,
|
|
239
|
-
onPaste: importPaste,
|
|
245
|
+
value: formatted ? dataTableCellText(cell) : cell,
|
|
246
|
+
onPaste: formatted ? undefined : importPaste,
|
|
240
247
|
slotProps: {
|
|
241
248
|
htmlInput: {
|
|
242
|
-
'aria-label': `Row ${rowIndex + 1} column ${columnIndex + 1}
|
|
243
|
-
|
|
249
|
+
'aria-label': `Row ${rowIndex + 1} column ${columnIndex + 1}`,
|
|
250
|
+
readOnly: formatted,
|
|
251
|
+
title: formatted ? 'Formatted. Double-click this cell on the canvas to edit it.' : undefined
|
|
252
|
+
},
|
|
253
|
+
input: formatted ? {
|
|
254
|
+
endAdornment: /*#__PURE__*/ _jsx(InputAdornment, {
|
|
255
|
+
position: "end",
|
|
256
|
+
children: /*#__PURE__*/ _jsx(IconButton, {
|
|
257
|
+
size: "small",
|
|
258
|
+
edge: "end",
|
|
259
|
+
disabled: locked,
|
|
260
|
+
title: "Remove formatting",
|
|
261
|
+
"aria-label": `Remove formatting from row ${rowIndex + 1} column ${columnIndex + 1}`,
|
|
262
|
+
onClick: ()=>commit(withCellSet(rows, rowIndex, columnIndex, dataTableCellText(cell))),
|
|
263
|
+
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
264
|
+
path: mdiFormatClear.path,
|
|
265
|
+
size: 0.6
|
|
266
|
+
})
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
} : undefined
|
|
244
270
|
},
|
|
245
|
-
onChange: (event)=>
|
|
246
|
-
|
|
271
|
+
onChange: (event)=>{
|
|
272
|
+
if (formatted) return;
|
|
273
|
+
commit(withCellSet(rows, rowIndex, columnIndex, event.target.value));
|
|
274
|
+
}
|
|
275
|
+
}, columnIndex);
|
|
276
|
+
}),
|
|
247
277
|
/*#__PURE__*/ _jsx(IconButton, {
|
|
248
278
|
size: "small",
|
|
249
279
|
disabled: locked || rows.length <= 1,
|
|
250
280
|
"aria-label": `Remove row ${rowIndex + 1}`,
|
|
251
|
-
onClick: ()=>
|
|
281
|
+
onClick: ()=>reshape({
|
|
282
|
+
kind: 'removeRow',
|
|
283
|
+
at: rowIndex
|
|
284
|
+
}),
|
|
252
285
|
children: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
253
286
|
path: mdiTrashCanOutline.path,
|
|
254
287
|
size: 0.7
|
|
@@ -266,7 +299,10 @@ export const DataTableField = (props)=>{
|
|
|
266
299
|
startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
267
300
|
path: mdiPlus.path
|
|
268
301
|
}),
|
|
269
|
-
onClick: ()=>
|
|
302
|
+
onClick: ()=>reshape({
|
|
303
|
+
kind: 'insertRow',
|
|
304
|
+
at: rows.length
|
|
305
|
+
}),
|
|
270
306
|
children: 'Row'
|
|
271
307
|
}),
|
|
272
308
|
/*#__PURE__*/ _jsx(Button, {
|
|
@@ -275,11 +311,21 @@ export const DataTableField = (props)=>{
|
|
|
275
311
|
startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
276
312
|
path: mdiPlus.path
|
|
277
313
|
}),
|
|
278
|
-
onClick: ()=>
|
|
314
|
+
onClick: ()=>reshape({
|
|
315
|
+
kind: 'insertColumn',
|
|
316
|
+
at: width
|
|
317
|
+
}),
|
|
279
318
|
children: 'Column'
|
|
280
319
|
})
|
|
281
320
|
]
|
|
282
321
|
}),
|
|
322
|
+
anyFormatted ? /*#__PURE__*/ _jsx(Box, {
|
|
323
|
+
sx: {
|
|
324
|
+
color: 'text.secondary',
|
|
325
|
+
fontSize: 12
|
|
326
|
+
},
|
|
327
|
+
children: 'Formatted cells are edited on the canvas: double-click one.'
|
|
328
|
+
}) : null,
|
|
283
329
|
helperText || description ? /*#__PURE__*/ _jsx(Box, {
|
|
284
330
|
sx: {
|
|
285
331
|
color: 'text.secondary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/data-table.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type DataTableAlignment,\n parseDataTableRows,\n readDataTableAlignments,\n readPastedDataTable,\n serializeDataTable,\n withCellSet,\n withColumnAdded,\n withColumnRemoved,\n withRowAdded,\n withRowRemoved,\n} from '@aglyn/shared-data-enums'\nimport {\n mdiFormatAlignCenter,\n mdiFormatAlignLeft,\n mdiFormatAlignRight,\n mdiPlus,\n mdiTrashCanOutline,\n} from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport IconButton from '@mui/material/IconButton'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport ToggleButton from '@mui/material/ToggleButton'\nimport ToggleButtonGroup from '@mui/material/ToggleButtonGroup'\nimport type { ClipboardEvent } from 'react'\nimport { useCallback, useMemo } from 'react'\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, { type FormFieldGridProps } from './form-field-grid'\nimport type { BaseFieldProps } from './types'\n\n/**\n * DataTable (AGL-2543): the row-and-column editor for the Table element.\n *\n * Without it the element would be a textarea of pipe syntax, which re-ships\n * the complaint the issue was filed about — \"a subscriber who wants to change\n * one cell has to edit markdown pipe syntax, which is exactly the audience\n * the besigner exists to avoid\".\n *\n * The PERSISTED value is unchanged by this control existing: still ONE string\n * in the syntax the element itself parses, via the same shared helpers, so\n * renderers and published documents stay untouched. Same rule the CSS length,\n * border and gradient fields follow.\n *\n * There is no local draft state, deliberately. The border and dimension\n * fields need one because a half-typed decimal must not be rounded out from\n * under the caret; a table cell has no such intermediate — every keystroke is\n * already a valid cell value — so reading straight from the prop keeps the\n * grid honest about what is stored and removes a whole class of re-seed bug.\n */\n\nconst ALIGN_ICONS: Record<DataTableAlignment, string> = {\n left: mdiFormatAlignLeft.path,\n center: mdiFormatAlignCenter.path,\n right: mdiFormatAlignRight.path,\n}\n\nexport interface DataTableFieldProps extends BaseFieldProps {\n FormFieldGridProps?: FormFieldGridProps\n}\n\nexport const DataTableField = (props: DataTableFieldProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n label,\n helperText,\n description,\n help,\n FormFieldGridProps = {},\n // Free-text leftovers from the schema shape these fields share; they\n // must never reach the DOM.\n inputProps: _inputProps,\n InputProps: _InputProps,\n multiline: _multiline,\n type: _type,\n options: _options,\n meta: _meta,\n validateOnMount: _validateOnMount,\n isRequired: _isRequired,\n placeholder: _placeholder,\n ...rest\n } = useFieldApi(props)\n\n const stored = `${input.value ?? ''}`\n const rows = useMemo(() => parseDataTableRows(stored), [stored])\n const width = rows[0]?.length ?? 0\n const alignments = useMemo(\n () => readDataTableAlignments(stored, width),\n [stored, width],\n )\n\n const commit = useCallback(\n (nextRows: string[][], nextAlignments = alignments) => {\n input.onChange(serializeDataTable(nextRows, nextAlignments))\n },\n [input, alignments],\n )\n\n /**\n * Importing a markdown table by pasting it into a cell (AGL-2568).\n *\n * It replaces the whole grid rather than splicing at the cell, because what\n * an author pastes is a table, not a range: the case this exists for is\n * moving a comparison table off the Markdown workaround, where the grid it\n * lands on is the two-row starter. Anything the paste is NOT a table —\n * which includes every ordinary cell value — falls through to the browser\n * and types itself into the cell, so this cannot cost anyone a paste.\n */\n const importPaste = useCallback(\n (event: ClipboardEvent<HTMLElement>) => {\n const pasted = readPastedDataTable(\n event.clipboardData?.getData('text/plain'),\n )\n if (!pasted) return\n event.preventDefault()\n commit(pasted.rows, pasted.alignments)\n },\n [commit],\n )\n\n const locked = isReadOnly || isDisabled\n\n // An empty value has no cell to click, so the grid cannot be typed into\n // and the author is stuck. Offer the one action that unsticks it.\n if (rows.length === 0) {\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <Stack spacing={1} {...rest}>\n <Box sx={{ color: 'text.secondary', fontSize: 13 }}>\n {label ?? 'Rows'}\n </Box>\n <Button\n size=\"small\"\n variant=\"outlined\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() =>\n commit(\n [\n ['Feature', 'Us', 'Them'],\n ['', '', ''],\n ],\n ['left', 'center', 'center'],\n )\n }\n >\n {'Start a table'}\n </Button>\n {/* \"Then\", not \"or\": the import runs on a cell's paste handler, and\n an empty field has no cell to paste into. */}\n <Box sx={{ color: 'text.secondary', fontSize: 12 }}>\n {'Then paste a markdown table into any cell to import one.'}\n </Box>\n </Stack>\n </FormFieldGrid>\n )\n }\n\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <Stack spacing={1} {...rest}>\n {label ? (\n <Box sx={{ color: 'text.secondary', fontSize: 13 }}>{label}</Box>\n ) : null}\n\n {/* Per-column alignment. It sits above its column rather than in a\n separate field because it belongs to the column an author is\n looking at — and because a field editor only ever receives one\n prop, so it has to travel inside this same string. */}\n <Stack direction=\"row\" spacing={0.5} sx={{ pl: 0 }}>\n {alignments.map((alignment, columnIndex) => (\n <Box key={columnIndex} sx={{ flex: 1, minWidth: 0 }}>\n <ToggleButtonGroup\n size=\"small\"\n exclusive\n disabled={locked}\n value={alignment}\n onChange={(_event, next) => {\n if (!next) return\n const nextAlignments = alignments.map((current, index) =>\n index === columnIndex\n ? (next as DataTableAlignment)\n : current,\n )\n commit(rows, nextAlignments)\n }}\n aria-label={`Column ${columnIndex + 1} alignment`}\n >\n {(\n Object.keys(ALIGN_ICONS) as DataTableAlignment[]\n ).map((option) => (\n <ToggleButton key={option} value={option} sx={{ px: 0.75 }}>\n <MdiIcon path={ALIGN_ICONS[option]} size={0.7} />\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n <IconButton\n size=\"small\"\n disabled={locked || width <= 1}\n aria-label={`Remove column ${columnIndex + 1}`}\n onClick={() => commit(withColumnRemoved(rows, columnIndex))}\n >\n <MdiIcon path={mdiTrashCanOutline.path} size={0.7} />\n </IconButton>\n </Box>\n ))}\n </Stack>\n\n {rows.map((row, rowIndex) => (\n <Stack\n key={rowIndex}\n direction=\"row\"\n spacing={0.5}\n sx={{ alignItems: 'center' }}\n >\n {row.map((cell, columnIndex) => (\n <TextField\n key={columnIndex}\n size=\"small\"\n fullWidth\n disabled={locked}\n value={cell}\n onPaste={importPaste}\n slotProps={{\n htmlInput: {\n 'aria-label': `Row ${rowIndex + 1} column ${\n columnIndex + 1\n }`,\n },\n }}\n onChange={(event) =>\n commit(\n withCellSet(rows, rowIndex, columnIndex, event.target.value),\n )\n }\n />\n ))}\n <IconButton\n size=\"small\"\n disabled={locked || rows.length <= 1}\n aria-label={`Remove row ${rowIndex + 1}`}\n onClick={() => commit(withRowRemoved(rows, rowIndex))}\n >\n <MdiIcon path={mdiTrashCanOutline.path} size={0.7} />\n </IconButton>\n </Stack>\n ))}\n\n <Stack direction=\"row\" spacing={1}>\n <Button\n size=\"small\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() => commit(withRowAdded(rows))}\n >\n {'Row'}\n </Button>\n <Button\n size=\"small\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() => commit(withColumnAdded(rows))}\n >\n {'Column'}\n </Button>\n </Stack>\n\n {helperText || description ? (\n <Box sx={{ color: 'text.secondary', fontSize: 12 }}>\n {helperText ?? description}\n </Box>\n ) : null}\n </Stack>\n </FormFieldGrid>\n )\n}\n\nexport default DataTableField\n"],"names":["parseDataTableRows","readDataTableAlignments","readPastedDataTable","serializeDataTable","withCellSet","withColumnAdded","withColumnRemoved","withRowAdded","withRowRemoved","mdiFormatAlignCenter","mdiFormatAlignLeft","mdiFormatAlignRight","mdiPlus","mdiTrashCanOutline","MdiIcon","Box","Button","IconButton","Stack","TextField","ToggleButton","ToggleButtonGroup","useCallback","useMemo","useFieldApi","FormFieldGrid","ALIGN_ICONS","left","path","center","right","DataTableField","props","input","rows","isReadOnly","isDisabled","label","helperText","description","help","FormFieldGridProps","inputProps","_inputProps","InputProps","_InputProps","multiline","_multiline","type","_type","options","_options","meta","_meta","validateOnMount","_validateOnMount","isRequired","_isRequired","placeholder","_placeholder","rest","stored","value","width","length","alignments","commit","nextRows","nextAlignments","onChange","importPaste","event","pasted","clipboardData","getData","preventDefault","locked","spacing","sx","color","fontSize","size","variant","disabled","startIcon","onClick","direction","pl","map","alignment","columnIndex","flex","minWidth","exclusive","_event","next","current","index","aria-label","Object","keys","option","px","row","rowIndex","alignItems","cell","fullWidth","onPaste","slotProps","htmlInput","target"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,kBAAkB,EAClBC,uBAAuB,EACvBC,mBAAmB,EACnBC,kBAAkB,EAClBC,WAAW,EACXC,eAAe,EACfC,iBAAiB,EACjBC,YAAY,EACZC,cAAc,QACT,2BAA0B;AACjC,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,mBAAmB,EACnBC,OAAO,EACPC,kBAAkB,QACb,yBAAwB;AAC/B,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,YAAY,uBAAsB;AACzC,OAAOC,gBAAgB,2BAA0B;AACjD,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,eAAe,0BAAyB;AAC/C,OAAOC,kBAAkB,6BAA4B;AACrD,OAAOC,uBAAuB,kCAAiC;AAE/D,SAASC,WAAW,EAAEC,OAAO,QAAQ,QAAO;AAC5C,SAASC,WAAW,QAAQ,iCAA6B;AACzD,OAAOC,mBAAgD,uBAAmB;AAG1E;;;;;;;;;;;;;;;;;;CAkBC,GAED,MAAMC,cAAkD;IACtDC,MAA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Mf,mBAAmBe,IAAI;oCAAEqD,MAAM;;;;uBAjC3CuB;8BAsCT,MAACtF;oBAAMoE,WAAU;oBAAMT,SAAS;;sCAC9B,KAAC7D;4BACCiE,MAAK;4BACLE,UAAUP;4BACVQ,yBAAW,KAACtE;gCAAQc,MAAMhB,QAAQgB,IAAI;;4BACtCyD,SAAS,IAAMnB,OAAO3D,aAAa2B;sCAElC;;sCAEH,KAAClB;4BACCiE,MAAK;4BACLE,UAAUP;4BACVQ,yBAAW,KAACtE;gCAAQc,MAAMhB,QAAQgB,IAAI;;4BACtCyD,SAAS,IAAMnB,OAAO7D,gBAAgB6B;sCAErC;;;;gBAIJI,cAAcC,4BACb,KAACxB;oBAAI+D,IAAI;wBAAEC,OAAO;wBAAkBC,UAAU;oBAAG;8BAC9C1C,qBAAAA,aAAcC;qBAEf;;;;AAIZ,EAAC;AAED,eAAeR,eAAc"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/shared/ui/jsx-forms/src/lib/mapper/data-table.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type DataTableAlignment,\n type DataTableShapeEdit,\n dataTableCellText,\n dataTableStarterValue,\n editDataTableShape,\n isDataTableCellMarkup,\n parseDataTableRows,\n readDataTableAlignments,\n readPastedDataTable,\n serializeDataTable,\n withCellSet,\n} from '@aglyn/shared-data-enums'\nimport {\n mdiFormatAlignCenter,\n mdiFormatAlignLeft,\n mdiFormatAlignRight,\n mdiFormatClear,\n mdiPlus,\n mdiTrashCanOutline,\n} from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport ToggleButton from '@mui/material/ToggleButton'\nimport ToggleButtonGroup from '@mui/material/ToggleButtonGroup'\nimport type { ClipboardEvent } from 'react'\nimport { useCallback, useMemo } from 'react'\nimport { useFieldApi } from '../vendor/data-driven-forms'\nimport FormFieldGrid, { type FormFieldGridProps } from './form-field-grid'\nimport type { BaseFieldProps } from './types'\n\n/**\n * DataTable (AGL-2543): the row-and-column editor for the Table element.\n *\n * Without it the element would be a textarea of pipe syntax, which re-ships\n * the complaint the issue was filed about — \"a subscriber who wants to change\n * one cell has to edit markdown pipe syntax, which is exactly the audience\n * the besigner exists to avoid\".\n *\n * The PERSISTED value is unchanged by this control existing: still ONE string\n * in the syntax the element itself parses, via the same shared helpers, so\n * renderers and published documents stay untouched. Same rule the CSS length,\n * border and gradient fields follow.\n *\n * There is no local draft state, deliberately. The border and dimension\n * fields need one because a half-typed decimal must not be rounded out from\n * under the caret; a table cell has no such intermediate — every keystroke is\n * already a valid cell value — so reading straight from the prop keeps the\n * grid honest about what is stored and removes a whole class of re-seed bug.\n */\n\nconst ALIGN_ICONS: Record<DataTableAlignment, string> = {\n left: mdiFormatAlignLeft.path,\n center: mdiFormatAlignCenter.path,\n right: mdiFormatAlignRight.path,\n}\n\nexport interface DataTableFieldProps extends BaseFieldProps {\n FormFieldGridProps?: FormFieldGridProps\n}\n\nexport const DataTableField = (props: DataTableFieldProps) => {\n const {\n input,\n isReadOnly,\n isDisabled,\n label,\n helperText,\n description,\n help,\n FormFieldGridProps = {},\n // Free-text leftovers from the schema shape these fields share; they\n // must never reach the DOM.\n inputProps: _inputProps,\n InputProps: _InputProps,\n multiline: _multiline,\n type: _type,\n options: _options,\n meta: _meta,\n validateOnMount: _validateOnMount,\n isRequired: _isRequired,\n placeholder: _placeholder,\n ...rest\n } = useFieldApi(props)\n\n const stored = `${input.value ?? ''}`\n const rows = useMemo(() => parseDataTableRows(stored), [stored])\n const width = rows[0]?.length ?? 0\n const alignments = useMemo(\n () => readDataTableAlignments(stored, width),\n [stored, width],\n )\n\n const commit = useCallback(\n (nextRows: string[][], nextAlignments = alignments) => {\n input.onChange(serializeDataTable(nextRows, nextAlignments))\n },\n [input, alignments],\n )\n\n /**\n * A change to the table's shape, through the same helper the canvas uses\n * (AGL-4203), so a column's alignment moves with the column instead of\n * sliding onto its neighbour.\n */\n const reshape = useCallback(\n (edit: DataTableShapeEdit) => {\n input.onChange(editDataTableShape(stored, edit))\n },\n [input, stored],\n )\n\n const anyFormatted = rows.some((row) => row.some(isDataTableCellMarkup))\n\n /**\n * Importing a markdown table by pasting it into a cell (AGL-2568).\n *\n * It replaces the whole grid rather than splicing at the cell, because what\n * an author pastes is a table, not a range: the case this exists for is\n * moving a comparison table off the Markdown workaround, where the grid it\n * lands on is the two-row starter. Anything the paste is NOT a table —\n * which includes every ordinary cell value — falls through to the browser\n * and types itself into the cell, so this cannot cost anyone a paste.\n */\n const importPaste = useCallback(\n (event: ClipboardEvent<HTMLElement>) => {\n const pasted = readPastedDataTable(\n event.clipboardData?.getData('text/plain'),\n )\n if (!pasted) return\n event.preventDefault()\n commit(pasted.rows, pasted.alignments)\n },\n [commit],\n )\n\n const locked = isReadOnly || isDisabled\n\n // An empty value has no cell to click, so the grid cannot be typed into\n // and the author is stuck. Offer the one action that unsticks it.\n if (rows.length === 0) {\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <Stack spacing={1} {...rest}>\n <Box sx={{ color: 'text.secondary', fontSize: 13 }}>\n {label ?? 'Rows'}\n </Box>\n <Button\n size=\"small\"\n variant=\"outlined\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() => input.onChange(dataTableStarterValue())}\n >\n {'Start a table'}\n </Button>\n {/* \"Then\", not \"or\": the import runs on a cell's paste handler, and\n an empty field has no cell to paste into. */}\n <Box sx={{ color: 'text.secondary', fontSize: 12 }}>\n {'Then paste a markdown table into any cell to import one.'}\n </Box>\n </Stack>\n </FormFieldGrid>\n )\n }\n\n return (\n <FormFieldGrid help={help} {...FormFieldGridProps}>\n <Stack spacing={1} {...rest}>\n {label ? (\n <Box sx={{ color: 'text.secondary', fontSize: 13 }}>{label}</Box>\n ) : null}\n\n {/* Per-column alignment. It sits above its column rather than in a\n separate field because it belongs to the column an author is\n looking at — and because a field editor only ever receives one\n prop, so it has to travel inside this same string. */}\n <Stack direction=\"row\" spacing={0.5} sx={{ pl: 0 }}>\n {alignments.map((alignment, columnIndex) => (\n <Box key={columnIndex} sx={{ flex: 1, minWidth: 0 }}>\n <ToggleButtonGroup\n size=\"small\"\n exclusive\n disabled={locked}\n value={alignment}\n onChange={(_event, next) => {\n if (!next) return\n const nextAlignments = alignments.map((current, index) =>\n index === columnIndex\n ? (next as DataTableAlignment)\n : current,\n )\n commit(rows, nextAlignments)\n }}\n aria-label={`Column ${columnIndex + 1} alignment`}\n >\n {(\n Object.keys(ALIGN_ICONS) as DataTableAlignment[]\n ).map((option) => (\n <ToggleButton key={option} value={option} sx={{ px: 0.75 }}>\n <MdiIcon path={ALIGN_ICONS[option]} size={0.7} />\n </ToggleButton>\n ))}\n </ToggleButtonGroup>\n <IconButton\n size=\"small\"\n disabled={locked || width <= 1}\n aria-label={`Remove column ${columnIndex + 1}`}\n onClick={() =>\n reshape({ kind: 'removeColumn', at: columnIndex })\n }\n >\n <MdiIcon path={mdiTrashCanOutline.path} size={0.7} />\n </IconButton>\n </Box>\n ))}\n </Stack>\n\n {rows.map((row, rowIndex) => (\n <Stack\n key={rowIndex}\n direction=\"row\"\n spacing={0.5}\n sx={{ alignItems: 'center' }}\n >\n {row.map((cell, columnIndex) => {\n // A formatted cell (AGL-4203) holds markup this plain field\n // cannot show or keep, so it shows the cell's words and is\n // edited on the canvas, where its formatting is. Typing here\n // would silently drop the formatting; Remove formatting does\n // the same on purpose.\n const formatted = isDataTableCellMarkup(cell)\n return (\n <TextField\n key={columnIndex}\n size=\"small\"\n fullWidth\n disabled={locked}\n value={formatted ? dataTableCellText(cell) : cell}\n onPaste={formatted ? undefined : importPaste}\n slotProps={{\n htmlInput: {\n 'aria-label': `Row ${rowIndex + 1} column ${\n columnIndex + 1\n }`,\n readOnly: formatted,\n title: formatted\n ? 'Formatted. Double-click this cell on the canvas to edit it.'\n : undefined,\n },\n input: formatted\n ? {\n endAdornment: (\n <InputAdornment position=\"end\">\n <IconButton\n size=\"small\"\n edge=\"end\"\n disabled={locked}\n title=\"Remove formatting\"\n aria-label={`Remove formatting from row ${\n rowIndex + 1\n } column ${columnIndex + 1}`}\n onClick={() =>\n commit(\n withCellSet(\n rows,\n rowIndex,\n columnIndex,\n dataTableCellText(cell),\n ),\n )\n }\n >\n <MdiIcon path={mdiFormatClear.path} size={0.6} />\n </IconButton>\n </InputAdornment>\n ),\n }\n : undefined,\n }}\n onChange={(event) => {\n if (formatted) return\n commit(\n withCellSet(\n rows,\n rowIndex,\n columnIndex,\n event.target.value,\n ),\n )\n }}\n />\n )\n })}\n <IconButton\n size=\"small\"\n disabled={locked || rows.length <= 1}\n aria-label={`Remove row ${rowIndex + 1}`}\n onClick={() => reshape({ kind: 'removeRow', at: rowIndex })}\n >\n <MdiIcon path={mdiTrashCanOutline.path} size={0.7} />\n </IconButton>\n </Stack>\n ))}\n\n <Stack direction=\"row\" spacing={1}>\n <Button\n size=\"small\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() => reshape({ kind: 'insertRow', at: rows.length })}\n >\n {'Row'}\n </Button>\n <Button\n size=\"small\"\n disabled={locked}\n startIcon={<MdiIcon path={mdiPlus.path} />}\n onClick={() => reshape({ kind: 'insertColumn', at: width })}\n >\n {'Column'}\n </Button>\n </Stack>\n\n {anyFormatted ? (\n <Box sx={{ color: 'text.secondary', fontSize: 12 }}>\n {'Formatted cells are edited on the canvas: double-click one.'}\n </Box>\n ) : null}\n\n {helperText || description ? (\n <Box sx={{ color: 'text.secondary', fontSize: 12 }}>\n {helperText ?? description}\n </Box>\n ) : null}\n </Stack>\n </FormFieldGrid>\n )\n}\n\nexport default DataTableField\n"],"names":["dataTableCellText","dataTableStarterValue","editDataTableShape","isDataTableCellMarkup","parseDataTableRows","readDataTableAlignments","readPastedDataTable","serializeDataTable","withCellSet","mdiFormatAlignCenter","mdiFormatAlignLeft","mdiFormatAlignRight","mdiFormatClear","mdiPlus","mdiTrashCanOutline","MdiIcon","Box","Button","IconButton","InputAdornment","Stack","TextField","ToggleButton","ToggleButtonGroup","useCallback","useMemo","useFieldApi","FormFieldGrid","ALIGN_ICONS","left","path","center","right","DataTableField","props","input","rows","isReadOnly","isDisabled","label","helperText","description","help","FormFieldGridProps","inputProps","_inputProps","InputProps","_InputProps","multiline","_multiline","type","_type","options","_options","meta","_meta","validateOnMount","_validateOnMount","isRequired","_isRequired","placeholder","_placeholder","rest","stored","value","width","length","alignments","commit","nextRows","nextAlignments","onChange","reshape","edit","anyFormatted","some","row","importPaste","event","pasted","clipboardData","getData","preventDefault","locked","spacing","sx","color","fontSize","size","variant","disabled","startIcon","onClick","direction","pl","map","alignment","columnIndex","flex","minWidth","exclusive","_event","next","current","index","aria-label","Object","keys","option","px","kind","at","rowIndex","alignItems","cell","formatted","fullWidth","onPaste","undefined","slotProps","htmlInput","readOnly","title","endAdornment","position","edge","target"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAGEA,iBAAiB,EACjBC,qBAAqB,EACrBC,kBAAkB,EAClBC,qBAAqB,EACrBC,kBAAkB,EAClBC,uBAAuB,EACvBC,mBAAmB,EACnBC,kBAAkB,EAClBC,WAAW,QACN,2BAA0B;AACjC,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,mBAAmB,EACnBC,cAAc,EACdC,OAAO,EACPC,kBAAkB,QACb,yBAAwB;AAC/B,S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