ng-hub-ui-spreadsheet 22.4.0 → 22.6.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/README.md
CHANGED
|
@@ -179,6 +179,14 @@ A column says what it is called and how to get a cell out of a row:
|
|
|
179
179
|
|
|
180
180
|
**Why two names.** Make the visible name the key and renaming a column means rewriting every reference to it — the mistake Excel made, and the reason a renamed column there breaks formulas across the workbook. Keep them apart and a rename is a rename.
|
|
181
181
|
|
|
182
|
+
A column can also **hint at an empty cell**: `placeholder` is shown while the pointer rests on a cell that holds nothing, never in place of a value. A **cell can carry one of its own**, for the row where the column's hint would not tell the truth:
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
cell: (row) => ({ value: row.due, editable: true, placeholder: row.id === 'c' ? 'after the cabling' : null })
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Left out or `null`, the column's placeholder is used.
|
|
189
|
+
|
|
182
190
|
Read the sheet back as plain data keyed by alias:
|
|
183
191
|
|
|
184
192
|
```typescript
|
|
@@ -205,6 +213,27 @@ what keeps `Enter` for the cell:
|
|
|
205
213
|
itself. An editable cell keeps `Enter` for editing, and the clipboard still carries the value rather
|
|
206
214
|
than the drawing.
|
|
207
215
|
|
|
216
|
+
`hubSpreadsheetCellAction` may also be **a function of the row**, for a column where only some cells
|
|
217
|
+
open — a product whose folded row opens its variants while its own row is only read:
|
|
218
|
+
|
|
219
|
+
```html
|
|
220
|
+
<ng-template
|
|
221
|
+
hubSpreadsheetCell="name"
|
|
222
|
+
[hubSpreadsheetCellRows]="products()"
|
|
223
|
+
[hubSpreadsheetCellAction]="opensItsVariants"
|
|
224
|
+
let-row="row"
|
|
225
|
+
let-open="open"
|
|
226
|
+
>
|
|
227
|
+
@if (opensItsVariants(row)) {
|
|
228
|
+
<a (click)="open()">{{ row.name }}</a>
|
|
229
|
+
} @else {
|
|
230
|
+
{{ row.name }}
|
|
231
|
+
}
|
|
232
|
+
</ng-template>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Then `Enter` opens the rows the function answers for, and leaves every other cell the sheet's.
|
|
236
|
+
|
|
208
237
|
For a cell that opens the row's own detail, put the detail in an `expansion` template and let `expandedRow` name the open row:
|
|
209
238
|
|
|
210
239
|
```html
|