@motifx-community/ui 0.1.0-beta.12 → 0.1.0-beta.14
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/CHANGELOG.md +414 -0
- package/README.md +2 -0
- package/dist/components/chart/Chart.d.ts +6 -4
- package/dist/components/chart/ChartPlot.d.ts +2 -1
- package/dist/components/chart/plot-view.d.ts +10 -2
- package/dist/components/chat/Chat.d.ts +276 -0
- package/dist/components/chat/ChatComposer.d.ts +172 -0
- package/dist/components/chat/ChatReply.d.ts +53 -0
- package/dist/components/chat/ChatWriter.d.ts +119 -0
- package/dist/components/chat/chat-ask-form.d.ts +64 -0
- package/dist/components/chat/chat-asked-entry.d.ts +21 -0
- package/dist/components/chat/chat-attachment-entry.d.ts +18 -0
- package/dist/components/chat/chat-choices-view.d.ts +40 -0
- package/dist/components/chat/chat-command.d.ts +7 -0
- package/dist/components/chat/chat-compaction-entry.d.ts +19 -0
- package/dist/components/chat/chat-composer-props.d.ts +63 -0
- package/dist/components/chat/chat-context-changed-event-args.d.ts +8 -0
- package/dist/components/chat/chat-context-item.d.ts +14 -0
- package/dist/components/chat/chat-copy-button.d.ts +11 -0
- package/dist/components/chat/chat-entry.d.ts +20 -0
- package/dist/components/chat/chat-flow-view.d.ts +32 -0
- package/dist/components/chat/chat-form-entry.d.ts +24 -0
- package/dist/components/chat/chat-form-view.d.ts +48 -0
- package/dist/components/chat/chat-history-event-args.d.ts +31 -0
- package/dist/components/chat/chat-load-older-event-args.d.ts +17 -0
- package/dist/components/chat/chat-look.d.ts +33 -0
- package/dist/components/chat/chat-mention.d.ts +21 -0
- package/dist/components/chat/chat-message-status.d.ts +2 -0
- package/dist/components/chat/chat-message.d.ts +23 -0
- package/dist/components/chat/chat-notice-entry.d.ts +20 -0
- package/dist/components/chat/chat-option.d.ts +7 -0
- package/dist/components/chat/chat-part.d.ts +110 -0
- package/dist/components/chat/chat-plan-entry.d.ts +25 -0
- package/dist/components/chat/chat-props.d.ts +70 -0
- package/dist/components/chat/chat-question-view.d.ts +41 -0
- package/dist/components/chat/chat-request.d.ts +173 -0
- package/dist/components/chat/chat-role.d.ts +2 -0
- package/dist/components/chat/chat-search-bar.d.ts +27 -0
- package/dist/components/chat/chat-search.d.ts +33 -0
- package/dist/components/chat/chat-send-event-args.d.ts +12 -0
- package/dist/components/chat/chat-sources-entry.d.ts +22 -0
- package/dist/components/chat/chat-text-entry.d.ts +20 -0
- package/dist/components/chat/chat-text-part.d.ts +5 -0
- package/dist/components/chat/chat-thinking-entry.d.ts +32 -0
- package/dist/components/chat/chat-todo-entry.d.ts +15 -0
- package/dist/components/chat/chat-tool-entry.d.ts +66 -0
- package/dist/components/chat/chat-tool-init.d.ts +18 -0
- package/dist/components/chat/chat-turn-view.d.ts +53 -0
- package/dist/components/chat/chat-turn.d.ts +8 -0
- package/dist/components/chat/chat-value-changed-event-args.d.ts +6 -0
- package/dist/components/chat/index.d.ts +22 -0
- package/dist/components/contextmenu/ContextMenu.d.ts +4 -0
- package/dist/components/contextmenu/context-menu-props.d.ts +6 -0
- package/dist/components/datagrid/DataGrid.d.ts +0 -12
- package/dist/components/datagrid/column-type.d.ts +2 -1
- package/dist/components/datagrid/grid-column.d.ts +4 -1
- package/dist/components/datagrid/grid-date-interval.d.ts +2 -1
- package/dist/components/datagrid/grid-filter-value.d.ts +2 -7
- package/dist/components/datagrid/grid-header-filter-interval.d.ts +2 -2
- package/dist/components/datagrid/grid-settings.d.ts +6 -3
- package/dist/components/datagrid/grid-sheet-cell.d.ts +3 -6
- package/dist/components/datagrid/grid-sheet-column.d.ts +2 -9
- package/dist/components/datagrid/grid-sheet-merge.d.ts +2 -7
- package/dist/components/datagrid/grid-sheet-row.d.ts +2 -5
- package/dist/components/datagrid/grid-sheet.d.ts +3 -2
- package/dist/components/datagrid/grid-summary-item.d.ts +5 -2
- package/dist/components/datagrid/grid-summary-texts.d.ts +2 -0
- package/dist/components/datagrid/grid-summary-type.d.ts +5 -2
- package/dist/components/datagrid/grid-summary.d.ts +3 -2
- package/dist/components/datagrid/list-option.d.ts +2 -4
- package/dist/components/datagrid/model/ColumnModel.d.ts +21 -3
- package/dist/components/datagrid/model/FilterValues.d.ts +15 -7
- package/dist/components/datagrid/model/GridExport.d.ts +1 -1
- package/dist/components/datagrid/model/GridModel.d.ts +2 -2
- package/dist/components/datagrid/model/LookupTexts.d.ts +1 -1
- package/dist/components/datagrid/view/CellEditor.d.ts +1 -1
- package/dist/components/datagrid/view/ColumnStyles.d.ts +4 -2
- package/dist/components/datagrid/view/GridBody.d.ts +1 -1
- package/dist/components/datagrid/view/HeaderRow.d.ts +3 -1
- package/dist/components/draggable/Draggable.d.ts +14 -3
- package/dist/components/dropdown/drop-down-props.d.ts +5 -2
- package/dist/components/form/MxForm.d.ts +1 -1
- package/dist/components/listbox/item-template.d.ts +4 -0
- package/dist/components/markdown/Markdown.d.ts +87 -0
- package/dist/components/markdown/code-block.d.ts +57 -0
- package/dist/components/markdown/code-colorer.d.ts +11 -0
- package/dist/components/markdown/code-highlighter.d.ts +9 -0
- package/dist/components/markdown/code-run.d.ts +6 -0
- package/dist/components/markdown/diagram-renderer.d.ts +21 -0
- package/dist/components/markdown/entities.d.ts +2 -0
- package/dist/components/markdown/index.d.ts +8 -0
- package/dist/components/markdown/inline-writer.d.ts +85 -0
- package/dist/components/markdown/markdown-context.d.ts +53 -0
- package/dist/components/markdown/markdown-link-click-event-args.d.ts +9 -0
- package/dist/components/markdown/markdown-props.d.ts +40 -0
- package/dist/components/markdown/markdown-writer.d.ts +95 -0
- package/dist/components/markdown/math-block.d.ts +22 -0
- package/dist/components/markdown/math-renderer.d.ts +18 -0
- package/dist/components/markdown/safe-href.d.ts +5 -0
- package/dist/components/markdown/text-run.d.ts +7 -0
- package/dist/components/menubar/MenuBar.d.ts +4 -0
- package/dist/components/menubar/menu-bar-props.d.ts +6 -0
- package/dist/components/pivotgrid/PivotGrid.d.ts +415 -0
- package/dist/components/pivotgrid/index.d.ts +44 -0
- package/dist/components/pivotgrid/model/PivotArrangement.d.ts +29 -0
- package/dist/components/pivotgrid/model/PivotAxisWindow.d.ts +169 -0
- package/dist/components/pivotgrid/model/PivotCellRanges.d.ts +63 -0
- package/dist/components/pivotgrid/model/PivotCellWindow.d.ts +47 -0
- package/dist/components/pivotgrid/model/PivotChart.d.ts +49 -0
- package/dist/components/pivotgrid/model/PivotDisplay.d.ts +61 -0
- package/dist/components/pivotgrid/model/PivotDrill.d.ts +19 -0
- package/dist/components/pivotgrid/model/PivotExpansion.d.ts +44 -0
- package/dist/components/pivotgrid/model/PivotFields.d.ts +55 -0
- package/dist/components/pivotgrid/model/PivotFilterValues.d.ts +36 -0
- package/dist/components/pivotgrid/model/PivotLayout.d.ts +75 -0
- package/dist/components/pivotgrid/model/PivotLoader.d.ts +29 -0
- package/dist/components/pivotgrid/model/PivotSheet.d.ts +44 -0
- package/dist/components/pivotgrid/model/PivotStateStore.d.ts +19 -0
- package/dist/components/pivotgrid/model/PivotTable.d.ts +78 -0
- package/dist/components/pivotgrid/model/PivotTexts.d.ts +47 -0
- package/dist/components/pivotgrid/model/PivotWindows.d.ts +120 -0
- package/dist/components/pivotgrid/model/pivot-copy.d.ts +26 -0
- package/dist/components/pivotgrid/model/pivot-csv.d.ts +9 -0
- package/dist/components/pivotgrid/model/pivot-header-cell.d.ts +19 -0
- package/dist/components/pivotgrid/model/pivot-line-key.d.ts +17 -0
- package/dist/components/pivotgrid/model/pivot-line.d.ts +14 -0
- package/dist/components/pivotgrid/pivot-grid-area.d.ts +2 -0
- package/dist/components/pivotgrid/pivot-grid-cell-click-event-args.d.ts +5 -0
- package/dist/components/pivotgrid/pivot-grid-cell-context.d.ts +19 -0
- package/dist/components/pivotgrid/pivot-grid-cell-dbl-click-event-args.d.ts +5 -0
- package/dist/components/pivotgrid/pivot-grid-cell-range.d.ts +16 -0
- package/dist/components/pivotgrid/pivot-grid-cell-selection-changed-event-args.d.ts +6 -0
- package/dist/components/pivotgrid/pivot-grid-chart-data.d.ts +15 -0
- package/dist/components/pivotgrid/pivot-grid-chart-options.d.ts +19 -0
- package/dist/components/pivotgrid/pivot-grid-column-resized-event-args.d.ts +8 -0
- package/dist/components/pivotgrid/pivot-grid-column-resizing.d.ts +15 -0
- package/dist/components/pivotgrid/pivot-grid-column.d.ts +19 -0
- package/dist/components/pivotgrid/pivot-grid-content-ready-event-args.d.ts +6 -0
- package/dist/components/pivotgrid/pivot-grid-context-menu-preparing-event-args.d.ts +22 -0
- package/dist/components/pivotgrid/pivot-grid-copying-event-args.d.ts +10 -0
- package/dist/components/pivotgrid/pivot-grid-custom-summary-info.d.ts +15 -0
- package/dist/components/pivotgrid/pivot-grid-data-error-event-args.d.ts +5 -0
- package/dist/components/pivotgrid/pivot-grid-drill-down.d.ts +14 -0
- package/dist/components/pivotgrid/pivot-grid-expanded-event-args.d.ts +6 -0
- package/dist/components/pivotgrid/pivot-grid-expanding-event-args.d.ts +9 -0
- package/dist/components/pivotgrid/pivot-grid-export-cell.d.ts +21 -0
- package/dist/components/pivotgrid/pivot-grid-export-options.d.ts +16 -0
- package/dist/components/pivotgrid/pivot-grid-export.d.ts +17 -0
- package/dist/components/pivotgrid/pivot-grid-exported-event-args.d.ts +9 -0
- package/dist/components/pivotgrid/pivot-grid-exporting-event-args.d.ts +17 -0
- package/dist/components/pivotgrid/pivot-grid-field-chooser.d.ts +20 -0
- package/dist/components/pivotgrid/pivot-grid-field-panel.d.ts +16 -0
- package/dist/components/pivotgrid/pivot-grid-field.d.ts +110 -0
- package/dist/components/pivotgrid/pivot-grid-fields-changed-event-args.d.ts +8 -0
- package/dist/components/pivotgrid/pivot-grid-filter-value.d.ts +4 -0
- package/dist/components/pivotgrid/pivot-grid-group-interval.d.ts +7 -0
- package/dist/components/pivotgrid/pivot-grid-header-filter-items-request.d.ts +9 -0
- package/dist/components/pivotgrid/pivot-grid-header-filter-items.d.ts +7 -0
- package/dist/components/pivotgrid/pivot-grid-load-panel.d.ts +11 -0
- package/dist/components/pivotgrid/pivot-grid-props.d.ts +121 -0
- package/dist/components/pivotgrid/pivot-grid-sheet-options.d.ts +14 -0
- package/dist/components/pivotgrid/pivot-grid-sheet.d.ts +19 -0
- package/dist/components/pivotgrid/pivot-grid-state.d.ts +54 -0
- package/dist/components/pivotgrid/pivot-grid-summary-cell.d.ts +29 -0
- package/dist/components/pivotgrid/pivot-grid-summary-display-mode.d.ts +5 -0
- package/dist/components/pivotgrid/pivot-grid-summary-type.d.ts +5 -0
- package/dist/components/pivotgrid/view/PivotFieldChooser.d.ts +71 -0
- package/dist/components/pivotgrid/view/PivotFieldPanel.d.ts +92 -0
- package/dist/components/pivotgrid/view/PivotView.d.ts +263 -0
- package/dist/components/resizable/Resizable.d.ts +2 -0
- package/dist/components/ribbonmenu/RibbonKeyHints.d.ts +4 -0
- package/dist/components/ribbonmenu/RibbonMenu.d.ts +4 -1
- package/dist/components/ribbonmenu/ribbon-menu-custom-menu-opening-event-args.d.ts +8 -4
- package/dist/components/ribbonmenu/ribbon-menu-props.d.ts +6 -0
- package/dist/components/scheduler/view/TimeView.d.ts +2 -0
- package/dist/components/scrollview/ScrollView.d.ts +48 -1
- package/dist/components/scrollview/index.d.ts +1 -0
- package/dist/components/scrollview/scroll-end-changed-event-args.d.ts +7 -0
- package/dist/components/scrollview/scroll-view-props.d.ts +9 -0
- package/dist/components/splitter/Splitter.d.ts +1 -3
- package/dist/components/tabdocs/DocumentTab.d.ts +0 -1
- package/dist/components/tabdocs/PhoneBar.d.ts +0 -1
- package/dist/components/tabdocs/TabDocumentManager.d.ts +3 -2
- package/dist/components/textarea/TextArea.d.ts +11 -0
- package/dist/components/textarea/text-area-props.d.ts +12 -1
- package/dist/components/textbox/TextBox.d.ts +3 -0
- package/dist/components/textbox/text-box-props.d.ts +3 -0
- package/dist/components/toolbar/Toolbar.d.ts +70 -1
- package/dist/components/toolbar/index.d.ts +5 -0
- package/dist/components/toolbar/toolbar-added-item.d.ts +9 -0
- package/dist/components/toolbar/toolbar-custom-menu-opening-event-args.d.ts +23 -0
- package/dist/components/toolbar/toolbar-customization.d.ts +18 -0
- package/dist/components/toolbar/toolbar-customized-event-args.d.ts +7 -0
- package/dist/components/toolbar/toolbar-item-display.d.ts +2 -0
- package/dist/components/toolbar/toolbar-item.d.ts +11 -1
- package/dist/components/toolbar/toolbar-props.d.ts +26 -0
- package/dist/components/toolbar/toolbar-targets.d.ts +22 -0
- package/dist/components/treeview/TreeView.d.ts +8 -4
- package/dist/components/treeview/tree-view-item-template.d.ts +4 -0
- package/dist/core/clipboard.d.ts +11 -0
- package/dist/core/enter-key-hint.d.ts +2 -0
- package/dist/core/look-watch.d.ts +2 -2
- package/dist/core/measure/look.d.ts +1 -1
- package/dist/core/measure/on-layout.d.ts +1 -1
- package/dist/core/measure/scroll.d.ts +3 -1
- package/dist/core/save-text.d.ts +2 -0
- package/dist/core/show-icon.d.ts +3 -3
- package/dist/core/ui-strings.d.ts +190 -0
- package/dist/excel/excel-pivot-customize-cell-args.d.ts +8 -0
- package/dist/excel/excel-pivot-export-options.d.ts +44 -0
- package/dist/excel/excel-pivot-export-result.d.ts +6 -0
- package/dist/excel/export-pivot-grid.d.ts +35 -0
- package/dist/excel/index.d.ts +4 -0
- package/dist/excel/index.js +190 -56
- package/dist/excel/index.js.map +1 -1
- package/dist/excel/write-sheet.d.ts +16 -0
- package/dist/{formula-guard-NYlpoA-t.js → formula-guard-Bx48S0u3.js} +2 -2
- package/dist/formula-guard-Bx48S0u3.js.map +1 -0
- package/dist/generated/tokens.d.ts +7527 -4097
- package/dist/index.d.ts +6 -0
- package/dist/index.js +66924 -50915
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +179 -1
- package/dist/locales/tr.json +179 -1
- package/dist/parts/customizer/Customizer.d.ts +12 -6
- package/dist/parts/customizer/customizer-display.d.ts +2 -0
- package/dist/parts/customizer/customizer-node.d.ts +5 -0
- package/dist/parts/customizer/customizer-source.d.ts +15 -3
- package/dist/parts/item-layout/layout-added-item.d.ts +2 -2
- package/dist/parts/list/OptionList.d.ts +4 -3
- package/dist/parts/list/option-parts.d.ts +1 -1
- package/dist/parts/menu/MenuList.d.ts +5 -0
- package/dist/parts/popup/Popup.d.ts +2 -0
- package/dist/{components/datagrid/model → parts/table}/CellFormatter.d.ts +8 -8
- package/dist/{components/datagrid/view → parts/table}/HeaderFilter.d.ts +16 -11
- package/dist/parts/table/OffsetList.d.ts +21 -0
- package/dist/parts/table/ScaledOffsets.d.ts +32 -0
- package/dist/{components/datagrid/model → parts/table}/ValueIntervals.d.ts +12 -5
- package/dist/{components/datagrid/model → parts/table}/ValueListAdapter.d.ts +4 -4
- package/dist/parts/table/date-interval.d.ts +2 -0
- package/dist/parts/table/date-type.d.ts +3 -0
- package/dist/{components/datagrid/model → parts/table}/filter-tree-node.d.ts +3 -1
- package/dist/parts/table/filter-value.d.ts +9 -0
- package/dist/parts/table/format-column.d.ts +14 -0
- package/dist/parts/table/header-filter-host.d.ts +27 -0
- package/dist/parts/table/option-of.d.ts +6 -0
- package/dist/parts/table/slice-sheet.d.ts +8 -0
- package/dist/parts/table/table-sheet-cell.d.ts +13 -0
- package/dist/parts/table/table-sheet-column.d.ts +11 -0
- package/dist/parts/table/table-sheet-merge.d.ts +9 -0
- package/dist/parts/table/table-sheet-row.d.ts +8 -0
- package/dist/parts/table/table-sheet.d.ts +24 -0
- package/dist/parts/table/value-interval.d.ts +6 -0
- package/dist/{components/datagrid/model → parts/table}/value-list.d.ts +7 -2
- package/dist/parts/table/value-loader.d.ts +8 -0
- package/dist/parts/table/value-option.d.ts +5 -0
- package/dist/parts/table/value-type.d.ts +5 -0
- package/dist/parts/table/values-result.d.ts +6 -0
- package/dist/parts/window/follow-pointer.d.ts +9 -3
- package/dist/parts/window-list/WindowList.d.ts +105 -0
- package/dist/parts/window-list/window-list-source.d.ts +10 -0
- package/dist/pdf/export-pivot-grid.d.ts +21 -0
- package/dist/pdf/index.d.ts +3 -0
- package/dist/pdf/index.js +143 -16
- package/dist/pdf/index.js.map +1 -1
- package/dist/pdf/pdf-customize-cell-args.d.ts +1 -1
- package/dist/pdf/pdf-pivot-cell-args.d.ts +25 -0
- package/dist/pdf/pdf-pivot-export-options.d.ts +61 -0
- package/dist/pdf/pdf-table.d.ts +38 -6
- package/dist/slice-sheet-C116M42H.js +43 -0
- package/dist/slice-sheet-C116M42H.js.map +1 -0
- package/dist/styles.css +4527 -201
- package/dist/tokens/index.d.ts +7527 -4097
- package/dist/tokens/index.js +7527 -4097
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-BvKE8jSF.js → tr-BGbF9uCs.js} +359 -3
- package/dist/tr-BGbF9uCs.js.map +1 -0
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +1 -1
- package/docs/appmenu-api.md +1 -1
- package/docs/appmenu-programmatic.md +1 -1
- package/docs/appmenu-search.md +1 -1
- package/docs/appmenu.md +1 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +1 -1
- package/docs/bar-gauge-data.md +1 -1
- package/docs/bar-gauge-labels.md +1 -1
- package/docs/bar-gauge.md +1 -1
- package/docs/barcode.md +1 -1
- package/docs/bottomnavigation.md +1 -1
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +1 -1
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +1 -1
- package/docs/chart-candles.md +1 -1
- package/docs/chart-funnel.md +1 -1
- package/docs/chart-heatmap.md +1 -1
- package/docs/chart-lines.md +1 -1
- package/docs/chart-live.md +1 -1
- package/docs/chart-pie.md +1 -1
- package/docs/chart-radar.md +1 -1
- package/docs/chart-ranges.md +1 -1
- package/docs/chart-references.md +1 -1
- package/docs/chart-scatter.md +1 -1
- package/docs/chart-waterfall.md +1 -1
- package/docs/chart-zoom.md +1 -1
- package/docs/chart.md +1 -1
- package/docs/chat.md +1512 -0
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +2 -2
- package/docs/choice.md +1 -1
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +2 -1
- package/docs/commands.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +1 -1
- package/docs/datagrid-api.md +3 -3
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +2 -2
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +7 -7
- package/docs/datagrid-layout.md +2 -2
- package/docs/datagrid-lookups.md +4 -1
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/display.md +1 -1
- package/docs/draggable.md +2 -2
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +4 -3
- package/docs/editors.md +1 -1
- package/docs/feedback.md +1 -1
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout.md +1 -1
- package/docs/foundations.md +1 -1
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +1 -1
- package/docs/gauge-circular.md +1 -1
- package/docs/gauge-dashboards.md +1 -1
- package/docs/gauge-linear.md +1 -1
- package/docs/gauge-markers.md +1 -1
- package/docs/gauge-marks.md +1 -1
- package/docs/gauge-ranges.md +1 -1
- package/docs/gauge-scales.md +1 -1
- package/docs/gauge.md +1 -1
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +1 -1
- package/docs/listbox.md +4 -3
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/markdown.md +343 -0
- package/docs/menus-api.md +3 -1
- package/docs/menus-context.md +2 -1
- package/docs/menus-customization.md +5 -1
- package/docs/menus-merging.md +1 -1
- package/docs/menus-programmatic.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +1 -1
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +1 -1
- package/docs/pagination.md +1 -1
- package/docs/pivotgrid-api.md +180 -0
- package/docs/pivotgrid-chart.md +132 -0
- package/docs/pivotgrid-drilldown.md +142 -0
- package/docs/pivotgrid-export.md +207 -0
- package/docs/pivotgrid-fields.md +245 -0
- package/docs/pivotgrid-keyboard.md +223 -0
- package/docs/pivotgrid-layout.md +663 -0
- package/docs/pivotgrid-panel.md +223 -0
- package/docs/pivotgrid-remote.md +397 -0
- package/docs/pivotgrid-sorting.md +379 -0
- package/docs/pivotgrid-state.md +245 -0
- package/docs/pivotgrid-summaries.md +330 -0
- package/docs/pivotgrid.md +295 -0
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +1 -1
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/ribbonmenu-api.md +2 -1
- package/docs/ribbonmenu-commands.md +1 -1
- package/docs/ribbonmenu-customization.md +3 -2
- package/docs/ribbonmenu-display.md +3 -3
- package/docs/ribbonmenu-layouts.md +1 -1
- package/docs/ribbonmenu-programmatic.md +1 -1
- package/docs/ribbonmenu.md +3 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/shortcuteditor.md +1 -1
- package/docs/showcase-home.md +1 -1
- package/docs/showcase-mail.md +39 -0
- package/docs/showcase.md +1 -1
- package/docs/signature.md +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +3 -6
- package/docs/sparkline.md +1 -1
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tagbox.md +4 -3
- package/docs/textarea.md +4 -1
- package/docs/textbox.md +2 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +687 -1
- package/docs/toolbar-api.md +80 -0
- package/docs/toolbar-customization.md +261 -0
- package/docs/toolbar.md +4 -52
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +3 -3
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +19005 -12353
- package/llms.txt +29 -2
- package/package.json +5 -5
- package/dist/components/datagrid/model/date-type.d.ts +0 -3
- package/dist/components/datagrid/model/option-of.d.ts +0 -6
- package/dist/components/datagrid/model/value-loader.d.ts +0 -8
- package/dist/formula-guard-NYlpoA-t.js.map +0 -1
- package/dist/tr-BvKE8jSF.js.map +0 -1
- /package/dist/{components/datagrid/model → core}/text-ranges.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/ExtraHeights.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/ScrollGeometry.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/cell-list.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/date-like.d.ts +0 -0
- /package/dist/{components/datagrid/view → parts/table}/editor-value.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/formula-guard.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/parse-date-text.d.ts +0 -0
- /package/dist/{components/datagrid/model → parts/table}/same-value.d.ts +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# PivotGrid: API reference
|
|
2
|
+
|
|
3
|
+
> PivotGrid · @motifx-community/ui 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Prop | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| `data` | `Bind<readonly T[]>` | — | Rows in memory, pivoted in the browser. The array is read as it is on every load: after changing it in place, call `refresh()`. |
|
|
10
|
+
| `dataSource` | `Bind<DataSource \| null>` | — | A `DataSource` of any adapter. The pivot covers its query (filter, search) and loads again when the query changes or the source reloads. An adapter with `capabilities.pivot` computes the pivot (the members open only), one with `capabilities.pivotWindow` the parts the view reaches as it scrolls ([Remote data](pivotgrid-remote.md)); any other adapter's rows are loaded and pivoted in the browser. Takes precedence over `data`. |
|
|
11
|
+
| `fields` | `Bind<readonly PivotGridField<T>[]>` | `[]` | The fields and their areas; see Fields below. A new list loads the pivot again and drops what the user arranged. |
|
|
12
|
+
| `fieldPanel` | `Bind<PivotGridFieldPanel>` | `{}` | The field panel over the table: `visible`, `showFilterFields`, `showDataFields`, `showColumnFields`, `showRowFields` and `allowFieldDragging`. See [Field panel](pivotgrid-panel.md#panel). |
|
|
13
|
+
| `fieldChooser` | `Bind<PivotGridFieldChooser>` | `{}` | The field chooser window: `enabled`, `layout` (`'side'` or `'stacked'`), `applyChangesMode` (`'instantly'` or `'onDemand'`), `allowSearch`, `title`, `width` and `height`. See [Field chooser](pivotgrid-panel.md#chooser). |
|
|
14
|
+
| `cellSelection` | `Bind<'none' \| 'single' \| 'multiple'>` | `'none'` | Whether the user selects data cells: one range, or several with Ctrl. Ctrl+C copies the ranges, and the active cell without them. See [Selecting and copying cells](pivotgrid-state.md#selection). |
|
|
15
|
+
| `state` | `PivotGridState` | — | What the user arranged, as `state` read it before, laid over `fields` at first. Read once. |
|
|
16
|
+
| `layoutKey` | `string` | — | Keeps the state in the browser's `localStorage` under this name; a pivot made again with the same name takes it back, over `state`. Read once. See [Keeping what the user arranged](pivotgrid-state.md#state). |
|
|
17
|
+
| `layoutStorage` | `LayoutStorage` | `localStorage` | Where `layoutKey` keeps the state: `sessionStorage`, or any object with `getItem`, `setItem` and `removeItem`. Read once. |
|
|
18
|
+
| `partSize` | `{ rows?: number; columns?: number }` | `{ rows: 100, columns: 40 }` | The members a part holds on each axis, where the pivot is read in parts. Read at each load. See [Read in parts as it scrolls](pivotgrid-remote.md#parts). |
|
|
19
|
+
| `rowHeaderLayout` | `Bind<'tree' \| 'tabular'>` | `'tree'` | Row headers in one column, each level further in, or a column per row field. See [Row headers and data fields](pivotgrid-layout.md#layout). |
|
|
20
|
+
| `dataFieldArea` | `Bind<'column' \| 'row'>` | `'column'` | Where several data fields run: across the columns under each column member, or down the rows. |
|
|
21
|
+
| `showRowTotals, showColumnTotals` | `Bind<boolean>` | `true` | The totals of open members on each axis. A field's `showTotals: false` leaves out those of its own members. |
|
|
22
|
+
| `showRowGrandTotals, showColumnGrandTotals` | `Bind<boolean>` | `true` | The grand total on each axis. An axis without fields shows it anyway, as its only line. |
|
|
23
|
+
| `showTotalsPrior` | `Bind<'none' \| 'rows' \| 'columns' \| 'both'>` | `'none'` | Puts totals before their members' children on these axes. |
|
|
24
|
+
| `showEmptyRows` | `Bind<boolean>` | `true` | `false` leaves out the rows whose data fields are all empty at the grand total column, with what is below them. See [Empty rows and columns](pivotgrid-layout.md#empty). |
|
|
25
|
+
| `showEmptyColumns` | `Bind<boolean>` | `true` | `false` leaves out the columns whose data fields are all empty at the grand total row, with what is below them. |
|
|
26
|
+
| `emptyText` | `Bind<string>` | `''` | The text of a cell no row falls in. It is not read: such a cell is named with `pivotNoValue`. |
|
|
27
|
+
| `rowHeight` | `Bind<number>` | from CSS | The height of a row in pixels. By default it follows the design language and the density. |
|
|
28
|
+
| `cellTemplate` | `(ctx: PivotGridCellContext<T>) => component \| string` | — | Content of a data cell in place of its text, made once per cell. The context is written in place, so read it in getters. |
|
|
29
|
+
| `cellClass` | `(ctx: PivotGridCellContext<T>) => string \| undefined` | — | Class names of a data cell, read again whenever its value changes. |
|
|
30
|
+
| `locale` | `Bind<string>` | the kit's language | The locale of numbers, dates, the names of months and days, and the order of texts. |
|
|
31
|
+
| `texts` | `Bind<Partial<UiStrings>>` | — | Strings of this pivot over `uiLocale.strings` (the `pivot…` keys and `retry`). |
|
|
32
|
+
| `label` | `Bind<string>` | — | The accessible name of the table (`aria-label` of its `grid`). |
|
|
33
|
+
| `export` | `Bind<PivotGridExport \| undefined>` | — | What the pivot offers to export: `formats` (default `['csv']`), `fileName` and `enabled`. Given, an export button stands at the end of the field panel and “Export” in the table's menu. See [Export](pivotgrid-export.md). |
|
|
34
|
+
| `wrapColumnHeaders` | `Bind<boolean>` | `false` | Lets the text of the column headers and of the corner's titles wrap onto more lines, the rows of column headers as tall as it takes; row headers and cells keep one line. The pivot has `data-wrap-headers` then. |
|
|
35
|
+
| `columnResizing` | `Bind<PivotGridColumnResizing>` | `{}` | How the user resizes columns: `enabled` (default `true`), `minWidth` (48), and the arrow keys' `step` and `fineStep` (10 and 1 pixels). See [Column widths](pivotgrid-layout.md#widths). |
|
|
36
|
+
| `onCellClick, onCellDblClick, onExpanding, onExpanded, onContentReady, onDataErrorOccurred, onFieldsChanged, onContextMenuPreparing, onCellSelectionChanged, onCopying, onExporting, onExported, onColumnResized` | `(e) => void` | — | The events below, by name. |
|
|
37
|
+
| `enabled / disabled, visible, tabStop` | see Control | | Properties shared by all controls. |
|
|
38
|
+
|
|
39
|
+
## Fields
|
|
40
|
+
|
|
41
|
+
`PivotGridField<T>`: a value of the rows placed in an area. See [Fields and areas](pivotgrid-fields.md).
|
|
42
|
+
|
|
43
|
+
| Field | Description |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `field` | The key of the value in the row; a dotted path reads a nested value. |
|
|
46
|
+
| `name` | The name `fieldOption` finds the field by, before its `field` and its `title`: two fields of one `field` need one. |
|
|
47
|
+
| `value` | `(row) => unknown`. Reads the value from the row instead of `field`. Such a field is grouped and summed in memory. |
|
|
48
|
+
| `title` | The text in headers, the corner and cell names. The default is `field`. |
|
|
49
|
+
| `type` | `'text' \| 'number' \| 'date' \| 'datetime' \| 'boolean'`. Determines the format, the order of members and how a date's parts are read. The default is `'text'`. |
|
|
50
|
+
| `format` | `Intl` options for numbers and dates, or `(value) => string`, for members and values alike. |
|
|
51
|
+
| `area, areaIndex` | `'row' \| 'column' \| 'data' \| 'filter'`, and the place in the area; fields without one follow in the order of `fields`. A field without an area takes no part. |
|
|
52
|
+
| `visible` | The default is `true`; a hidden field takes no part. |
|
|
53
|
+
| `allowDragging, allowSorting, allowFiltering` | Whether the user can move the field in the field panel or hide it from the menu, turn the order of its members around or sort them by a row or column, and choose the values it keeps in its header filter. The defaults are `true`. |
|
|
54
|
+
| `allowResizing` | Whether the user can resize the field's columns (`columnResizing`). The default is `true`. |
|
|
55
|
+
| `allowExpanding` | Whether the user can open and close the field's members: by their headers, Enter and Space, and the menu. The default is `true`; `expanded`, `expandAll`, `collapseAll` and the state open them either way. |
|
|
56
|
+
| `groupInterval` | A part of a date (`'year'`, `'quarter'`, `'month'`, `'day'`, `'dayOfWeek'`, `'date'`), the width of number ranges, or a list of them, a level per entry, the largest first. See [Dates and number ranges](pivotgrid-fields.md#intervals). |
|
|
57
|
+
| `sortBy, sortOrder` | `'value' \| 'text'` (default `'value'`), and `'asc' \| 'desc'` (default `'asc'`). See [Order of members](pivotgrid-sorting.md#sorting). |
|
|
58
|
+
| `compare` | `(a, b) => number`. Orders the members by their keys with this function, as `Array.sort` takes one, instead of by their values or texts; members without a value stay last, and the header filter lists them in its order. See [An order of your own](pivotgrid-sorting.md#compare). |
|
|
59
|
+
| `sortBySummaryField` | Orders the members by a data field's grand total: its `name`, its `title`, its `field` or its place among the data fields. |
|
|
60
|
+
| `sortBySummaryPath` | With `sortBySummaryField`, orders the members by their values in one member of the other axis instead: its keys from the top level down (`['Tea']`). See [Order of members](pivotgrid-sorting.md#sorting). |
|
|
61
|
+
| `filterValues, filterType` | The values kept (`'include'`, the default) or left out (`'exclude'`); `null` stands for empty values. A field grouped by an interval takes members: a value of its first level, or a list from the first level down (`[2024, 1]`). A filter expression among them counts the rows it passes as one of them. See [Filtering](pivotgrid-sorting.md#filtering). |
|
|
62
|
+
| `headerFilterItems` | `PivotGridHeaderFilterItems<T>`: `{ text, value, count }` entries of the field's header filter in place of its members, a value being a member or a filter expression, or `({ field, signal, values }) => entries` (or a promise of them), `values()` giving the members the list would show. See [Entries of your own](pivotgrid-sorting.md#items). |
|
|
63
|
+
| `expanded` | Opens every member of the field's levels at first. |
|
|
64
|
+
| `showTotals` | The totals of the field's open members. The default is `true`; the pivot's `show…Totals` come first. |
|
|
65
|
+
| `width` | In pixels: the field's column of row headers in the tabular layout, or a data field's cells. |
|
|
66
|
+
| `summaryType` | How a data field sums up its rows: `'count'` (default), `'countDistinct'`, `'sum'`, `'avg'`, `'min'`, `'max'`, `'custom'`. |
|
|
67
|
+
| `calculateCustomSummary` | `(info: PivotGridCustomSummaryInfo<T>) => void`. The summary of a `custom` data field, in memory: called with `summaryProcess` `'start'`, `'calculate'` per row (`value`, `row`) and `'finalize'`, keeping its value in `totalValue`. |
|
|
68
|
+
| `summaryDisplayMode` | `'value'` (default), `'percentOfRowTotal'`, `'percentOfColumnTotal'`, `'percentOfGrandTotal'`, `'percentOfRowParent'`, `'percentOfColumnParent'`, `'absoluteVariation'`, `'percentVariation'`. What a data field shows of its summary: the value, a share of a total or of its parent member's value, or how far it moved from the member before it. A share shows as a percentage unless the field has a `format`. See [Shares](pivotgrid-summaries.md#shares). |
|
|
69
|
+
| `displayAlong` | `'column' \| 'row'`. The axis a variation looks back along; the default is `'column'`. |
|
|
70
|
+
| `runningTotal` | `'column' \| 'row'`. Adds up a data field's values along the columns or the rows, among the members of one parent; the display mode works on the sums. See [Changes and running totals](pivotgrid-summaries.md#running). |
|
|
71
|
+
| `calculateSummaryValue` | `(cell: PivotGridSummaryCell<T>) => unknown`. What a data field shows, worked out from the cell and the cells around it (`value()`, `parent()`, `previous()`, `next()`, `total()`, `grandTotal()`); `null` shows nothing. See [A calculation of your own](pivotgrid-summaries.md#own). |
|
|
72
|
+
|
|
73
|
+
## Properties and methods
|
|
74
|
+
|
|
75
|
+
| Property | Access | Description |
|
|
76
|
+
| --- | --- | --- |
|
|
77
|
+
| `every prop above` | read/write | `pivot.rowHeaderLayout = 'tabular'`, or a tracked function. Props that change the layout lay the last result out again; `data`, `dataSource` and `fields` load it again. |
|
|
78
|
+
| `arrangedFields` | read-only | The fields as arranged now: `fields`, with the changes the user or `fieldOption` made since it was given. |
|
|
79
|
+
| `state` | read/write | `PivotGridState`: the fields' areas, places, order, filters and column widths changed over `fields` (`fields`, by `id`), the members opened or closed on each axis (`expanded.row`, `expanded.column`: `all`, `levels`, `members`), and the widths of the columns of no field (`widths`). Assigned, the pivot starts again from `fields` with it. |
|
|
80
|
+
| `cellRanges` | read/write | The cell ranges, each `{ from, to }` by its cells' `rowPath`, `columnPath`, `rowKind`, `columnKind` and `dataField`. Assign to set them; `[]` clears them. |
|
|
81
|
+
| `selectedCells` | read-only | The cells of the ranges, each once, row by row, as `onCellClick` has a cell. |
|
|
82
|
+
| `status` | read-only, reactive | `'idle' \| 'loading' \| 'ready' \| 'error'`. |
|
|
83
|
+
| `error` | read-only | The `DataError` of the last load, while `status` is `'error'`. |
|
|
84
|
+
| `result` | read-only | The last `PivotLoadResult` of the data layer: the member trees of both axes (`rows`, `columns`) and `values(row, column)`. `null` while the pivot is read in parts: no whole result is read. |
|
|
85
|
+
| `layout` | read-only | The result as drawn (`PivotLayout`): the lines of both axes (`rows`, `columns`, each a `PivotLine` of `kind` `member`, `total`, `grand` or `header`), their header cells (`rowHeaders`, `columnHeaders`), `rowDepth`, `columnDepth`, and `value(row, column)`. `null` while the pivot is read in parts. |
|
|
86
|
+
| `viewport, head, body` | read-only | The scrolling area (`role="grid"`), the column headers and the rows. |
|
|
87
|
+
|
|
88
|
+
### Methods
|
|
89
|
+
|
|
90
|
+
| Method | Returns | Description |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `refresh()` | `void` | Loads the pivot again, after the rows changed. |
|
|
93
|
+
| `expandAll(area, level?)` | `void` | Opens every member of `'row'` or `'column'`, or of one of its levels (0 is the top level). On a server, the members are loaded. |
|
|
94
|
+
| `collapseAll(area, level?)` | `void` | Closes every member of an axis, or of one of its levels. |
|
|
95
|
+
| `resetState()` | `void` | Back to `fields` as given and the members as their fields open them; with `layoutKey`, forgets what was kept. |
|
|
96
|
+
| `selectCells(from, to?, add?)` | `boolean` | Selects the cells from `from` to `to` (one cell without it), in place of the ranges or after them (`add`, with `cellSelection: 'multiple'`). Returns whether the table shows the range. |
|
|
97
|
+
| `clearCellSelection()` | `void` | Clears the cell ranges. |
|
|
98
|
+
| `chartData(options?)` | `PivotGridChartData` | What a `Chart` draws of the pivot, `{ data, xField, series }`: the lines of `argumentAxis` (the rows by default) along its axis, the other axis's lines as series, the cells' values and texts; `data` and `series` follow the pivot. Options: `totals`, `grandTotals`, `dataFields`, `level`, `type`. See [Chart](pivotgrid-chart.md). |
|
|
99
|
+
| `drillDown(cell, options?)` | `Promise<PivotGridDrillDown<T>>` | The rows a data cell sums up: `filter` (its members on every level, through their intervals, the fields' filters and the members they keep) and `dataSource` (over the pivot's source and query where its backend applies the filter, otherwise over the rows read and filtered here); `options` are the data source's. See [Drill-down](pivotgrid-drilldown.md). |
|
|
100
|
+
| `copy()` | `Promise<string>` | Copies as Ctrl+C does and resolves to the text, or `''` when nothing was copied. Read in parts, the pivot reads the cells of the ranges first, up to 100,000 of them. |
|
|
101
|
+
| `exportCsv(options?)` | `Promise<string>` | Saves the pivot in a CSV file a spreadsheet opens, after `onExporting`, and resolves to the text (`''` when it was canceled). Options: `values` (`'shown'` or `'raw'`), `fileName`, `download`, `separator`, `bom`, `escapeFormulas`, `headers`, `onProgress`, `signal`, `loadPanel`. See [Export](pivotgrid-export.md). |
|
|
102
|
+
| `exportTo(format, options?)` | `Promise<void>` | Exports as the export button does: `'csv'` runs `exportCsv`, any other format raises `onExporting`, where the file is written. |
|
|
103
|
+
| `exportSheet(options, write)` | `Promise<R>` | Gives `write` the pivot as a `PivotGridSheet`: the rows of column headers and the corner, the columns of row headers, the merges, and each cell's value, text and number format with its `pivotCell`; read whole where the pivot is read in parts. Options: `format`, `headers`, `onProgress`, `signal`, `loadPanel`. `exportPivotGrid` of the `excel` and `pdf` entries is written on it. |
|
|
104
|
+
| `cancelExport()` | `void` | Stops the export the load panel shows; its promise rejects with an `AbortError`. |
|
|
105
|
+
| `columnWidth(column)` | `number` | A column's width in pixels: `{ area: 'row', field }`, `{ area: 'tree' }`, `{ area: 'titles' }` or `{ area: 'data', field? }`. As the user made it, else its field's `width`, else the default. |
|
|
106
|
+
| `resizeColumn(column, width)` | `void` | Resizes a column as the user does: kept in the `state`, told by `onColumnResized` with `byUser: false`. See [Column widths](pivotgrid-layout.md#widths). |
|
|
107
|
+
| `openFieldChooser() / closeFieldChooser()` | `void` | Opens the field chooser, unless `fieldChooser.enabled` is `false`, and closes it; with `onDemand`, closing it so applies nothing. |
|
|
108
|
+
| `fieldOption(field) / fieldOption(field, name) / fieldOption(field, name, value) / fieldOption(field, options)` | `PivotGridField` / its option / `void` | Reads a copy of a field as arranged or one of its options, or changes them the way the user's changes are kept. A field is named by its place in `fields`, its `name`, its `field` or its `title`. See [Arranging from code](pivotgrid-panel.md#code). |
|
|
109
|
+
|
|
110
|
+
## Events
|
|
111
|
+
|
|
112
|
+
Each is a prop (`onExpanded={…}`) and an event of the pivot: `pivot.onExpanded((e) => …)` returns a handle whose `dispose()` ends the subscription.
|
|
113
|
+
|
|
114
|
+
| Event | Arguments | Description |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| `onCellClick` | `PivotGridCellClickEventArgs` | A data cell was clicked: its context (see below) and the `event`. |
|
|
117
|
+
| `onCellDblClick` | `PivotGridCellDblClickEventArgs` | A data cell was double-clicked, or Enter was pressed on it: its context and the `event`. Where drilling down starts. |
|
|
118
|
+
| `onExpanding` | `{ area, path, expanded, cancel }` | Before a member opens (`expanded: true`) or closes, by the pointer or the keys. `cancel = true` keeps it as it is. |
|
|
119
|
+
| `onExpanded` | `{ area, path, expanded }` | After a member opened or closed and the table shows it; on a server, once its children arrived. |
|
|
120
|
+
| `onContentReady` | `{ result }` | A loaded pivot was drawn: after the first load, a reload, or a server's answer for an opened member. Read in parts, `result` is `null`. |
|
|
121
|
+
| `onDataErrorOccurred` | `{ error }` | A load failed (`DataError`). The pivot also tells it under the table, with Retry. |
|
|
122
|
+
| `onFieldsChanged` | `{ fields, byUser }` | The fields were arranged anew: by the user in the field panel, a header filter, the field chooser or the menu (`byUser`), or by `fieldOption`. `fields` is `arrangedFields`. |
|
|
123
|
+
| `onContextMenuPreparing` | `{ area, kind, path, field, cell, items, cancel }` | Before the menu of a header (`area` `'row'` or `'column'`, `kind` `member`, `total`, `grand` or `dataField`, `path`), a title of the corner (`'corner'`) or a data cell (`'data'`, `cell` as `onCellClick` has it) opens; `field` is the header's or title's field. Change `items`; `cancel = true` or an empty list opens none. See [Context menu](pivotgrid-layout.md#menu). |
|
|
124
|
+
| `onCellSelectionChanged` | `{ ranges, byUser }` | The cell ranges changed: by the user (`byUser`), or from code and as a new layout left a range without its corner. |
|
|
125
|
+
| `onCopying` | `{ text, html, cells, cancel }` | Before cells are copied (Ctrl+C, `copy()`): the tab-separated text and the HTML table, which it can change, and the cells copied (0 for the active cell alone). `cancel = true` copies nothing. |
|
|
126
|
+
| `onExporting` | `{ format, component, options, cancel }` | Before an export starts (`exportCsv`, `exportTo`, the export button, the menu). For `'csv'`, change `options` or set `cancel = true`; another format (`'xlsx'`, `'pdf'`) is written here with `exportPivotGrid`. |
|
|
127
|
+
| `onExported` | `{ format, rows, text? }` | After an export was written: its format, the rows of lines written, and for CSV the text. |
|
|
128
|
+
| `onColumnResized` | `{ column, width, byUser }` | After a column was resized: by the user's drag or keys (`byUser`), or by `resizeColumn`. |
|
|
129
|
+
|
|
130
|
+
### Cell context
|
|
131
|
+
|
|
132
|
+
`PivotGridCellContext<T>`: what `cellTemplate`, `cellClass` and `onCellClick` receive.
|
|
133
|
+
|
|
134
|
+
| Field | Description |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `rowPath, columnPath` | The keys from the top level down to the cell's member; empty for the grand total. |
|
|
137
|
+
| `rowKind, columnKind` | `'member' \| 'total' \| 'grand'`. |
|
|
138
|
+
| `dataField` | The data field the cell shows; `undefined` without data fields. |
|
|
139
|
+
| `value, text` | The value the cell shows: the summary, or what its data field's display calculation makes of it (a share as a fraction, `0.25` for 25%; `undefined` when no row falls in both); and the cell's text. |
|
|
140
|
+
|
|
141
|
+
## Styling
|
|
142
|
+
|
|
143
|
+
| Hook | Description |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| `.mx-pivot-grid` | The pivot. |
|
|
146
|
+
| `.mx-pivot-grid__viewport, __head, __body` | The scrolling area with `role="grid"` (`--_columns`: the column widths), the sticky column headers, and the rows. |
|
|
147
|
+
| `.mx-pivot-grid__head-row` | A row of column headers, for assistive technology (`display: contents`). |
|
|
148
|
+
| `.mx-pivot-grid__row` | A row of the body: `data-kind` `member`, `total`, `grand`, `header` (a tree's line over an open member's children), or `loading` (a member not read yet, read in parts). |
|
|
149
|
+
| `.mx-pivot-grid__corner` | The corner over the row headers, with the row fields' titles. |
|
|
150
|
+
| `.mx-pivot-grid__header` | A header: `data-axis` (`row` \| `column`), `data-kind` (`member`, `total`, `grand`, `measure`), `data-expandable` and `aria-expanded` for a member that opens, `--_level` (tree depth) and `--_at` (where a row header sticks). |
|
|
151
|
+
| `.mx-pivot-grid__expand, __expand-icon, __text` | The arrow and text of a member that opens, the arrow, and a header's text. |
|
|
152
|
+
| `.mx-pivot-grid__cell` | A data cell, with `data-row-kind` and `data-column-kind` (`total` \| `grand`) and the classes of `cellClass`; in a cell range, `data-range` with the edges it draws (`top`, `bottom`, `start`, `end`) and `anchor` where the last range started, and `aria-selected`; `data-loading` while its value is read. The viewport has `data-selecting` while the pointer draws a range. |
|
|
153
|
+
| `.mx-pivot-grid__note, __note-text` | The line that tells a failed load, with its Retry button. |
|
|
154
|
+
| `.mx-pivot-grid__field-panel, __field-area, __field-caption, __field-empty` | The field panel, an area (`data-area`, `data-drop` while a dragged chip would land in it), its name, and its text while it has no field. |
|
|
155
|
+
| `.mx-pivot-grid__field-chip, __field-chip-text, __field-chip-sort, __field-chip-filter` | A field's chip (`data-area`, `data-sort`, `data-sortable`, `data-filterable`, `data-filtered`, `data-locked`, `data-dragging`), its text, its arrow and its funnel. |
|
|
156
|
+
| `.mx-pivot-grid__field-drop, __ghost, __menu` | Where a dragged chip lands, the copy next to the pointer, and a chip's menu. |
|
|
157
|
+
| `.mx-pivot-grid__values, __values-list, __values-tree, __values-all, __values-bar, __apply, __dismiss, __value-text, __value-count` | The header filter window: its list or tree, “Select all”, its buttons, and a value's text and rows. |
|
|
158
|
+
| `.mx-pivot-grid__chooser-window, __chooser, __chooser-list, __chooser-areas, __chooser-bar, __chooser-button` | The field chooser: its window, its content (`data-layout`), the list of every field, the areas, OK and Cancel, and the field panel's button that opens it. |
|
|
159
|
+
| `.mx-pivot-grid__export-button` | The field panel's export button, beside the field chooser's. |
|
|
160
|
+
| `.mx-pivot-grid__resize` | The place at the end of a column header or a title of the corner where its column is resized; the header or title has `data-resizing` while it is. |
|
|
161
|
+
| `.mx-pivot-grid > .mx-context-menu` | The menu of the headers and cells: the kit's `ContextMenu`, with its look and tokens. |
|
|
162
|
+
|
|
163
|
+
### Component tokens
|
|
164
|
+
|
|
165
|
+
| Token | Description |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| `pivotgrid.grid, head, corner, header, row, cell, expand, expand-icon, note` | Units: the pivot, the column headers, the corner, a header (`expandable`, `hover`, `focus`, `column`, `row`, `total`, `grand`, `measure`), a row (`total`, `grand`), a cell (`total`, `grand`, `focus`), the arrow and text of a member that opens, the arrow, and the error line. |
|
|
168
|
+
| `pivotgrid.record-height, row-space, cell-inset, indent, line-width, icon-size` | Sizes used by the layout: a row's content and the room it adds, a cell's inset, the step of a tree's level, the lines, the arrow. |
|
|
169
|
+
| `pivotgrid.expand-rotate-open` | How far the arrow turns while its member is open. |
|
|
170
|
+
| `pivotgrid.range-fill, range-fill-opacity, range-border-color, range-border-width, range-anchor-fill` | The cell ranges, as `DataGrid` has them: the fill over their cells and how much of it shows, their frame, and the fill of the cell the last range started on. |
|
|
171
|
+
| `pivotgrid.field-panel, field-area, field-caption, field-empty, field-chip, field-chip-sort, field-chip-filter, field-drop, ghost` | Units of the field panel: the panel, an area (`next`, `drop`), its name and empty text, a chip (`hover`, `focus`, `dragging`), its arrow, its funnel (`active`), the drop mark and the dragged copy (`target`). |
|
|
172
|
+
| `pivotgrid.chip-spacing, chip-height` | The room between areas and chips, and a chip's height. |
|
|
173
|
+
| `pivotgrid.values, values-list, values-note, values-bar, value-count, values-window-width, values-row-height` | The header filter window, as `DataGrid` has it; its buttons, popup and list are the places `values-apply`, `values-dismiss`, `values-popup` and `header-filter-list`. |
|
|
174
|
+
| `pivotgrid.chooser, chooser-panel, chooser-area, chooser-bar, chooser-width` | The field chooser: the room in it, its areas without the panel's frame, an area as a box, its buttons' bar and its width; its OK, Cancel and the panel's button are the places `chooser-apply`, `chooser-dismiss` and `chooser-button`. |
|
|
175
|
+
| `pivotgrid.export-button` | The field panel's export button: a place of the kit's `Button` (`variant`, `size`). |
|
|
176
|
+
| `pivotgrid.resize, resize-hit-width` | The line at a header's end where its column is resized (`active` under the pointer and while it is), and how wide the place to press there is. |
|
|
177
|
+
|
|
178
|
+
## Feedback
|
|
179
|
+
|
|
180
|
+
Loading issues…
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# PivotGrid: Chart
|
|
2
|
+
|
|
3
|
+
> PivotGrid · @motifx-community/ui 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
`chartData` gives the kit's `Chart` what a pivot shows: its rows and series follow the pivot as it loads, as a member opens or closes, and as it is arranged anew. The chart knows nothing of the pivot.
|
|
6
|
+
|
|
7
|
+
## A chart of the pivot
|
|
8
|
+
|
|
9
|
+
`chartData(options)` returns `{ data, xField, series }`, given to a `Chart` as they are. The lines of one axis (the rows by default, `argumentAxis`) stand along the chart's axis, a row each; the lines of the other axis are the series, one per data field where there are several. A value and its text are the cell's, its display calculation done. `data` and `series` are tracked functions: the chart draws again with the pivot.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
13
|
+
|
|
14
|
+
const PLACES: [string, string][] = [
|
|
15
|
+
['Marmara', 'İstanbul'],
|
|
16
|
+
['Marmara', 'Bursa'],
|
|
17
|
+
['Central Anatolia', 'Ankara'],
|
|
18
|
+
['Central Anatolia', 'Konya'],
|
|
19
|
+
['Aegean', 'İzmir'],
|
|
20
|
+
['Aegean', 'Muğla'],
|
|
21
|
+
['Black Sea', 'Trabzon'],
|
|
22
|
+
['Mediterranean', 'Antalya'],
|
|
23
|
+
];
|
|
24
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
25
|
+
|
|
26
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
27
|
+
export function makeSales(count: number): Sale[] {
|
|
28
|
+
return Array.from({ length: count }, (_, i) => {
|
|
29
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
30
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
31
|
+
return {
|
|
32
|
+
id: i + 1,
|
|
33
|
+
region,
|
|
34
|
+
city,
|
|
35
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
36
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
37
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
38
|
+
units: 1 + ((i * 31) % 12),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## What it draws
|
|
45
|
+
|
|
46
|
+
Members are drawn, totals and grand totals as asked (`totals`, `grandTotals`). `dataFields` names the data fields drawn, by their `name`, `title`, `field` or place. `level` draws every member of one level of the argument axis, each with its summary, wherever the table stands: the regions, say, while the table shows their cities. `type` is how the series draw, `'bar'` by default.
|
|
47
|
+
|
|
48
|
+
## Read in parts
|
|
49
|
+
|
|
50
|
+
A pivot [read in parts](pivotgrid-remote.md#parts) draws the lines in view, and the chart follows the scroll. A `level` is read whole from the source: its members, level by level, and their values.
|
|
51
|
+
|
|
52
|
+
## Feedback
|
|
53
|
+
|
|
54
|
+
Loading issues…
|
|
55
|
+
|
|
56
|
+
## Example files
|
|
57
|
+
|
|
58
|
+
`PivotChart.tsx`
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { reactive } from '@motifx/core';
|
|
62
|
+
import { ButtonGroup, Chart, PivotGrid, type PivotGridChartData, type PivotGridField } from '@motifx-community/ui';
|
|
63
|
+
import { makeSales, type Sale } from './sales';
|
|
64
|
+
|
|
65
|
+
const sales = makeSales(20000);
|
|
66
|
+
|
|
67
|
+
const fields: PivotGridField<Sale>[] = [
|
|
68
|
+
{ field: 'region', title: 'Region', area: 'row' },
|
|
69
|
+
{ field: 'city', title: 'City', area: 'row' },
|
|
70
|
+
{ field: 'date', title: 'Year', type: 'date', area: 'column', groupInterval: 'year' },
|
|
71
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const AXES = [
|
|
75
|
+
{ value: 'row', text: 'Regions along' },
|
|
76
|
+
{ value: 'column', text: 'Years along' },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
/** The pivot's cells as a chart, which follows it: open a region, and its cities stand in the chart too. */
|
|
80
|
+
export default function PivotChart() {
|
|
81
|
+
const s = reactive({ axis: 'row' as 'row' | 'column', made: false });
|
|
82
|
+
let charts: Record<'row' | 'column', PivotGridChartData> | null = null;
|
|
83
|
+
// The pivot's two charts: its rows along the chart's axis, or its columns.
|
|
84
|
+
const made = (pivot: PivotGrid<Sale>) => {
|
|
85
|
+
charts = { row: pivot.chartData({ argumentAxis: 'row', type: 'bar' }), column: pivot.chartData({ argumentAxis: 'column', type: 'bar' }) };
|
|
86
|
+
s.made = true;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<ButtonGroup label="Chart" items={AXES} x-model={() => s.axis} />
|
|
92
|
+
<PivotGrid class="pg-chart" style="block-size: 16rem" data={sales} fields={fields} label="Sales by region and year" ref={made} />
|
|
93
|
+
<Chart class="pg-chart-chart" title="Sales" data={() => (s.made ? charts![s.axis].data() : [])} xField="x" series={() => (s.made ? charts![s.axis].series() : [])} />
|
|
94
|
+
</>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`sales.ts`
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
103
|
+
|
|
104
|
+
const PLACES: [string, string][] = [
|
|
105
|
+
['Marmara', 'İstanbul'],
|
|
106
|
+
['Marmara', 'Bursa'],
|
|
107
|
+
['Central Anatolia', 'Ankara'],
|
|
108
|
+
['Central Anatolia', 'Konya'],
|
|
109
|
+
['Aegean', 'İzmir'],
|
|
110
|
+
['Aegean', 'Muğla'],
|
|
111
|
+
['Black Sea', 'Trabzon'],
|
|
112
|
+
['Mediterranean', 'Antalya'],
|
|
113
|
+
];
|
|
114
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
115
|
+
|
|
116
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
117
|
+
export function makeSales(count: number): Sale[] {
|
|
118
|
+
return Array.from({ length: count }, (_, i) => {
|
|
119
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
120
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
121
|
+
return {
|
|
122
|
+
id: i + 1,
|
|
123
|
+
region,
|
|
124
|
+
city,
|
|
125
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
126
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
127
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
128
|
+
units: 1 + ((i * 31) % 12),
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# PivotGrid: Drill-down
|
|
2
|
+
|
|
3
|
+
> PivotGrid · @motifx-community/ui 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
A cell sums up rows. `drillDown` gives them as a filter and as a data source: for a `DataGrid` in a window, a report, or rows to export.
|
|
6
|
+
|
|
7
|
+
## Drilling down
|
|
8
|
+
|
|
9
|
+
`drillDown(cell)` takes a cell as `onCellClick` gives it or as `selectCells` names it, and resolves to `{ filter, dataSource }`. `onCellDblClick` occurs on a double click on a data cell and on Enter there, so the keys open the rows too; `options` are the data source's (`loadMode`, `pageSize`, `sort`). The data source is the app's to dispose of.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
13
|
+
|
|
14
|
+
const PLACES: [string, string][] = [
|
|
15
|
+
['Marmara', 'İstanbul'],
|
|
16
|
+
['Marmara', 'Bursa'],
|
|
17
|
+
['Central Anatolia', 'Ankara'],
|
|
18
|
+
['Central Anatolia', 'Konya'],
|
|
19
|
+
['Aegean', 'İzmir'],
|
|
20
|
+
['Aegean', 'Muğla'],
|
|
21
|
+
['Black Sea', 'Trabzon'],
|
|
22
|
+
['Mediterranean', 'Antalya'],
|
|
23
|
+
];
|
|
24
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
25
|
+
|
|
26
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
27
|
+
export function makeSales(count: number): Sale[] {
|
|
28
|
+
return Array.from({ length: count }, (_, i) => {
|
|
29
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
30
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
31
|
+
return {
|
|
32
|
+
id: i + 1,
|
|
33
|
+
region,
|
|
34
|
+
city,
|
|
35
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
36
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
37
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
38
|
+
units: 1 + ((i * 31) % 12),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## The filter
|
|
45
|
+
|
|
46
|
+
The filter names the cell's members on every level: a field's value, or its value through the level's interval (`data.where('date', '=', 2024, { interval: 'year' })`), blank for the empty member. A total names its member's levels, the grand total none. With them come the fields' filters and the members they keep, and the data source's query.
|
|
47
|
+
|
|
48
|
+
## On a server
|
|
49
|
+
|
|
50
|
+
Where the backend applies the filter, the data source reads the rows from it with the pivot's own adapter, a part at a time: OData writes the parts of dates with `year()`, `month()` and `day()`, REST sends the filter as it is. A field read with `value`, and what a backend cannot write (OData has no day of the week, `canFilter()` says so), have the rows read without it and filtered in the browser.
|
|
51
|
+
|
|
52
|
+
## Feedback
|
|
53
|
+
|
|
54
|
+
Loading issues…
|
|
55
|
+
|
|
56
|
+
## Example files
|
|
57
|
+
|
|
58
|
+
`DrillDown.tsx`
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { reactive } from '@motifx/core';
|
|
62
|
+
import type { data } from '@motifx-community/data';
|
|
63
|
+
import { DataGrid, MxForm, PivotGrid, type GridColumn, type PivotGridCellDblClickEventArgs, type PivotGridField } from '@motifx-community/ui';
|
|
64
|
+
import { makeSales, type Sale } from './sales';
|
|
65
|
+
|
|
66
|
+
const sales = makeSales(20000);
|
|
67
|
+
|
|
68
|
+
const fields: PivotGridField<Sale>[] = [
|
|
69
|
+
{ field: 'region', title: 'Region', area: 'row' },
|
|
70
|
+
{ field: 'date', title: 'Date', type: 'date', area: 'column', groupInterval: ['year', 'quarter'] },
|
|
71
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const columns: GridColumn<Sale>[] = [
|
|
75
|
+
{ field: 'date', title: 'Date', type: 'date', width: 130 },
|
|
76
|
+
{ field: 'city', title: 'City', width: 140 },
|
|
77
|
+
{ field: 'product', title: 'Product', width: 140, flex: 1 },
|
|
78
|
+
{ field: 'units', title: 'Units', type: 'number', width: 90 },
|
|
79
|
+
{ field: 'amount', title: 'Amount', type: 'number', width: 120, format: { maximumFractionDigits: 2 } },
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
/** A double click or Enter on a cell shows the sales it sums up, in a window. */
|
|
83
|
+
export default function DrillDown() {
|
|
84
|
+
// The data source of the rows shown stays out of the reactive state; `shown` tells a new one.
|
|
85
|
+
const s = reactive({ open: false, title: '', shown: 0 });
|
|
86
|
+
let rows: data.DataSource<Sale, any> | null = null;
|
|
87
|
+
let pivot: PivotGrid<Sale> | null = null;
|
|
88
|
+
|
|
89
|
+
const drill = async (e: PivotGridCellDblClickEventArgs<Sale>) => {
|
|
90
|
+
const { dataSource } = await pivot!.drillDown(e, { loadMode: 'blocks', sort: [{ field: 'date', dir: 'desc' }] });
|
|
91
|
+
rows?.dispose();
|
|
92
|
+
rows = dataSource;
|
|
93
|
+
s.shown++;
|
|
94
|
+
s.title = `${e.text} · ${[...e.rowPath, ...e.columnPath].join(' · ') || 'all sales'}`;
|
|
95
|
+
s.open = true;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<>
|
|
100
|
+
<PivotGrid class="pg-drill" style="block-size: 18rem" data={sales} fields={fields} label="Sales by region and quarter" onCellDblClick={drill} ref={(g: PivotGrid<Sale>) => (pivot = g)} />
|
|
101
|
+
<MxForm class="pg-drill-window" title={() => s.title} x-model={() => s.open} width={720} resizable>
|
|
102
|
+
<DataGrid style="block-size: 22rem" dataSource={() => (s.shown ? rows : null)} columns={columns} label="The sales of the cell" locale="en" />
|
|
103
|
+
</MxForm>
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`sales.ts`
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
113
|
+
|
|
114
|
+
const PLACES: [string, string][] = [
|
|
115
|
+
['Marmara', 'İstanbul'],
|
|
116
|
+
['Marmara', 'Bursa'],
|
|
117
|
+
['Central Anatolia', 'Ankara'],
|
|
118
|
+
['Central Anatolia', 'Konya'],
|
|
119
|
+
['Aegean', 'İzmir'],
|
|
120
|
+
['Aegean', 'Muğla'],
|
|
121
|
+
['Black Sea', 'Trabzon'],
|
|
122
|
+
['Mediterranean', 'Antalya'],
|
|
123
|
+
];
|
|
124
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
125
|
+
|
|
126
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
127
|
+
export function makeSales(count: number): Sale[] {
|
|
128
|
+
return Array.from({ length: count }, (_, i) => {
|
|
129
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
130
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
131
|
+
return {
|
|
132
|
+
id: i + 1,
|
|
133
|
+
region,
|
|
134
|
+
city,
|
|
135
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
136
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
137
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
138
|
+
units: 1 + ((i * 31) % 12),
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
```
|