@motifx-community/ui 0.1.0-beta.13 → 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 +379 -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 +1 -1
- 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/form/MxForm.d.ts +1 -1
- 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/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/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/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 +65982 -49896
- 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/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 +4484 -177
- 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 +1 -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 +1 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +18989 -12344
- package/llms.txt +29 -2
- package/package.json +2 -2
- 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,379 @@
|
|
|
1
|
+
# PivotGrid: Sorting and filtering
|
|
2
|
+
|
|
3
|
+
> PivotGrid · @motifx-community/ui 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
Members stand in the order of their values, their texts, a function of the app's or a data field's totals, and a pivot sums up only the rows its fields keep: given from code, or chosen by the user in a field's header filter.
|
|
6
|
+
|
|
7
|
+
## Order of members
|
|
8
|
+
|
|
9
|
+
Members are ordered by their values (`sortBy: 'value'`, the default: months from January), by their texts (`sortBy: 'text'`), or by a data field's grand total (`sortBySummaryField`: the data field's `name`, `title`, `field` or place among the data fields). With `sortBySummaryPath` as well, they are ordered by their values in one member of the other axis instead, named by its keys from the top level down (`['Tea']`); the pivot's menu sets both from a row or column header. `sortOrder: 'desc'` turns any of them around; members with the same total keep their order.
|
|
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
|
+
## An order of your own
|
|
45
|
+
|
|
46
|
+
`compare` orders a row or column field's members by their keys with a function of your own, as `Array.sort` takes one: sizes from small to large, the stages of a process, the months of a fiscal year. It comes in place of `sortBy`; `sortOrder: 'desc'` turns it around, `sortBySummaryField` comes before it, and members without a value stay last. It orders the members in the browser, a server's too, and the header filter lists them in its order.
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
50
|
+
|
|
51
|
+
const PLACES: [string, string][] = [
|
|
52
|
+
['Marmara', 'İstanbul'],
|
|
53
|
+
['Marmara', 'Bursa'],
|
|
54
|
+
['Central Anatolia', 'Ankara'],
|
|
55
|
+
['Central Anatolia', 'Konya'],
|
|
56
|
+
['Aegean', 'İzmir'],
|
|
57
|
+
['Aegean', 'Muğla'],
|
|
58
|
+
['Black Sea', 'Trabzon'],
|
|
59
|
+
['Mediterranean', 'Antalya'],
|
|
60
|
+
];
|
|
61
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
62
|
+
|
|
63
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
64
|
+
export function makeSales(count: number): Sale[] {
|
|
65
|
+
return Array.from({ length: count }, (_, i) => {
|
|
66
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
67
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
68
|
+
return {
|
|
69
|
+
id: i + 1,
|
|
70
|
+
region,
|
|
71
|
+
city,
|
|
72
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
73
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
74
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
75
|
+
units: 1 + ((i * 31) % 12),
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Sorting from the table
|
|
82
|
+
|
|
83
|
+
Pressing a row or column field's chip in the [field panel](pivotgrid-panel.md#panel), or Enter on it, turns its order around, and the chip's menu sorts it either way. The [context menu](pivotgrid-layout.md#menu) of a member's header sorts each field of the other axis by the values of its row or column, and that of a data field's title by that data field. Each sets the field's `sortOrder`, `sortBySummaryField` and `sortBySummaryPath` as `fieldOption` does, so `state` keeps it and `onFieldsChanged` tells it. A field's `allowSorting: false` keeps its order.
|
|
84
|
+
|
|
85
|
+
## Filtering
|
|
86
|
+
|
|
87
|
+
`filterValues` keeps the rows with those values of the field (`filterType: 'include'`, the default) or every row but those (`'exclude'`); `null` stands for empty values. It applies in every area, and to a field read with `value`. A field grouped by an interval keeps members: a value is a member of its first level (`2025`, a year) and a list a member from the first level down (`[2024, 1]`, the first quarter of 2024). A filter expression among the values (`data.where('amount', '>', 400)`) counts the rows it passes as one of them. A `dataSource`'s own filter applies first.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
91
|
+
|
|
92
|
+
const PLACES: [string, string][] = [
|
|
93
|
+
['Marmara', 'İstanbul'],
|
|
94
|
+
['Marmara', 'Bursa'],
|
|
95
|
+
['Central Anatolia', 'Ankara'],
|
|
96
|
+
['Central Anatolia', 'Konya'],
|
|
97
|
+
['Aegean', 'İzmir'],
|
|
98
|
+
['Aegean', 'Muğla'],
|
|
99
|
+
['Black Sea', 'Trabzon'],
|
|
100
|
+
['Mediterranean', 'Antalya'],
|
|
101
|
+
];
|
|
102
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
103
|
+
|
|
104
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
105
|
+
export function makeSales(count: number): Sale[] {
|
|
106
|
+
return Array.from({ length: count }, (_, i) => {
|
|
107
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
108
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
109
|
+
return {
|
|
110
|
+
id: i + 1,
|
|
111
|
+
region,
|
|
112
|
+
city,
|
|
113
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
114
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
115
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
116
|
+
units: 1 + ((i * 31) % 12),
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Header filter
|
|
123
|
+
|
|
124
|
+
The funnel in a chip, or “Filter values” in its menu, opens the field's header filter: its values over every row of the source, each with its rows, a search box and “Select all”. The values chosen become the field's `filterValues`; choosing every value and then leaving some out keeps every value but those (`filterType: 'exclude'`), so values that come later are kept too. A field grouped in more than one level (`['year', 'quarter']`) shows a tree, and a member is kept from the first level down. The values come from the data layer: in the browser for rows in memory, from the server where the adapter computes pivots. A field's `allowFiltering: false` offers no filter.
|
|
125
|
+
|
|
126
|
+
## Entries of your own
|
|
127
|
+
|
|
128
|
+
`headerFilterItems` gives a field's header filter entries of its own in place of its members: `{ text, value }`, where a value is a member as `filterValues` takes it (`'Marmara'`, `2025`, `[2024, 1]`) or a filter expression over any field of the rows (`data.where('amount', '<', 100)`). A function returns them at each opening, and its `values()` gives the members the list would show, with their texts and rows, to add entries to or to pick from. The entries chosen become `filterValues`. They need not cover every row, so choosing every entry keeps the rows of those entries alone. An entry without `text` reads as its member does.
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
132
|
+
|
|
133
|
+
const PLACES: [string, string][] = [
|
|
134
|
+
['Marmara', 'İstanbul'],
|
|
135
|
+
['Marmara', 'Bursa'],
|
|
136
|
+
['Central Anatolia', 'Ankara'],
|
|
137
|
+
['Central Anatolia', 'Konya'],
|
|
138
|
+
['Aegean', 'İzmir'],
|
|
139
|
+
['Aegean', 'Muğla'],
|
|
140
|
+
['Black Sea', 'Trabzon'],
|
|
141
|
+
['Mediterranean', 'Antalya'],
|
|
142
|
+
];
|
|
143
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
144
|
+
|
|
145
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
146
|
+
export function makeSales(count: number): Sale[] {
|
|
147
|
+
return Array.from({ length: count }, (_, i) => {
|
|
148
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
149
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
150
|
+
return {
|
|
151
|
+
id: i + 1,
|
|
152
|
+
region,
|
|
153
|
+
city,
|
|
154
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
155
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
156
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
157
|
+
units: 1 + ((i * 31) % 12),
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## On a server
|
|
164
|
+
|
|
165
|
+
With rows in memory, the browser does it all. With an adapter that computes pivots (OData with `aggregation`, REST with `pivot`), the server orders the members by their values (each level's `dir`) and keeps the rows: the values of a field as a filter, the members of a field grouped by an interval as `keep`, and filter expressions with either. The order by text, by `compare` and by a data field's totals is the browser's, over the members the server sent. A header filter asks the server for the members of its field alone. A field read with `value` or a custom summary makes the pivot load the rows and group them in memory, and so does an interval the service cannot compute (OData has no day of the week).
|
|
166
|
+
|
|
167
|
+
## Feedback
|
|
168
|
+
|
|
169
|
+
Loading issues…
|
|
170
|
+
|
|
171
|
+
## Example files
|
|
172
|
+
|
|
173
|
+
`Sorting.tsx`
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import { reactive } from '@motifx/core';
|
|
177
|
+
import { ButtonGroup, CheckBox, PivotGrid, Stack, type PivotGridField } from '@motifx-community/ui';
|
|
178
|
+
import { makeSales, type Sale } from './sales';
|
|
179
|
+
|
|
180
|
+
const sales = makeSales(20000);
|
|
181
|
+
|
|
182
|
+
const ORDERS = [
|
|
183
|
+
{ value: 'value', text: 'By value' },
|
|
184
|
+
{ value: 'text', text: 'By text' },
|
|
185
|
+
{ value: 'summary', text: 'By amount' },
|
|
186
|
+
];
|
|
187
|
+
|
|
188
|
+
/** The months in their order, by their names, or by their total amount. */
|
|
189
|
+
export default function Sorting() {
|
|
190
|
+
const s = reactive({ order: 'value', descending: false });
|
|
191
|
+
const fields = (): PivotGridField<Sale>[] => [
|
|
192
|
+
{
|
|
193
|
+
field: 'date',
|
|
194
|
+
title: 'Month',
|
|
195
|
+
type: 'date',
|
|
196
|
+
area: 'row',
|
|
197
|
+
groupInterval: 'month',
|
|
198
|
+
sortBy: s.order === 'text' ? 'text' : 'value',
|
|
199
|
+
sortBySummaryField: s.order === 'summary' ? 'Amount' : undefined,
|
|
200
|
+
sortOrder: s.descending ? 'desc' : 'asc',
|
|
201
|
+
},
|
|
202
|
+
{ field: 'product', title: 'Product', area: 'column' },
|
|
203
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<>
|
|
208
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
209
|
+
<ButtonGroup label="Months" items={ORDERS} x-model={() => s.order} />
|
|
210
|
+
<CheckBox label="Descending" x-model={() => s.descending} />
|
|
211
|
+
</Stack>
|
|
212
|
+
<PivotGrid class="pg-sorting" style="block-size: 22rem" data={sales} fields={fields} label="Sales by month and product" />
|
|
213
|
+
</>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`sales.ts`
|
|
219
|
+
|
|
220
|
+
```tsx
|
|
221
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
222
|
+
|
|
223
|
+
const PLACES: [string, string][] = [
|
|
224
|
+
['Marmara', 'İstanbul'],
|
|
225
|
+
['Marmara', 'Bursa'],
|
|
226
|
+
['Central Anatolia', 'Ankara'],
|
|
227
|
+
['Central Anatolia', 'Konya'],
|
|
228
|
+
['Aegean', 'İzmir'],
|
|
229
|
+
['Aegean', 'Muğla'],
|
|
230
|
+
['Black Sea', 'Trabzon'],
|
|
231
|
+
['Mediterranean', 'Antalya'],
|
|
232
|
+
];
|
|
233
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
234
|
+
|
|
235
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
236
|
+
export function makeSales(count: number): Sale[] {
|
|
237
|
+
return Array.from({ length: count }, (_, i) => {
|
|
238
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
239
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
240
|
+
return {
|
|
241
|
+
id: i + 1,
|
|
242
|
+
region,
|
|
243
|
+
city,
|
|
244
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
245
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
246
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
247
|
+
units: 1 + ((i * 31) % 12),
|
|
248
|
+
};
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
`OwnOrder.tsx`
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
import { reactive } from '@motifx/core';
|
|
257
|
+
import { CheckBox, PivotGrid, Stack, type PivotGridField } from '@motifx-community/ui';
|
|
258
|
+
import { makeSales, type Sale } from './sales';
|
|
259
|
+
|
|
260
|
+
const sales = makeSales(20000);
|
|
261
|
+
|
|
262
|
+
const BANDS = ['Low', 'Medium', 'High'];
|
|
263
|
+
const bandOf = (sale: Sale) => (sale.amount < 100 ? 'Low' : sale.amount < 300 ? 'Medium' : 'High');
|
|
264
|
+
|
|
265
|
+
/** The bands of the sales from low to high, in place of their alphabetical order. */
|
|
266
|
+
export default function OwnOrder() {
|
|
267
|
+
const s = reactive({ own: true, descending: false });
|
|
268
|
+
const fields = (): PivotGridField<Sale>[] => [
|
|
269
|
+
{ field: 'region', title: 'Region', area: 'row' },
|
|
270
|
+
{
|
|
271
|
+
name: 'band',
|
|
272
|
+
title: 'Sale band',
|
|
273
|
+
value: bandOf,
|
|
274
|
+
area: 'column',
|
|
275
|
+
compare: s.own ? (a, b) => BANDS.indexOf(a as string) - BANDS.indexOf(b as string) : undefined,
|
|
276
|
+
sortOrder: s.descending ? 'desc' : 'asc',
|
|
277
|
+
},
|
|
278
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
279
|
+
];
|
|
280
|
+
|
|
281
|
+
return (
|
|
282
|
+
<>
|
|
283
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
284
|
+
<CheckBox label="In their own order" x-model={() => s.own} />
|
|
285
|
+
<CheckBox label="Descending" x-model={() => s.descending} />
|
|
286
|
+
</Stack>
|
|
287
|
+
<PivotGrid class="pg-own-order" style="block-size: 18rem" data={sales} fields={fields} label="Sales by region and band" />
|
|
288
|
+
</>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
`Filtering.tsx`
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
import { data } from '@motifx-community/data';
|
|
297
|
+
import { reactive } from '@motifx/core';
|
|
298
|
+
import { ButtonGroup, CheckBox, PivotGrid, Stack, type PivotGridField } from '@motifx-community/ui';
|
|
299
|
+
import { makeSales, type Sale } from './sales';
|
|
300
|
+
|
|
301
|
+
const sales = makeSales(20000);
|
|
302
|
+
|
|
303
|
+
const REGIONS = ['Aegean', 'Black Sea', 'Central Anatolia', 'Marmara', 'Mediterranean'];
|
|
304
|
+
const PERIODS: { value: string; text: string; members?: unknown[] }[] = [
|
|
305
|
+
{ value: 'all', text: 'Every quarter' },
|
|
306
|
+
{ value: 'first', text: 'First quarters', members: [[2024, 1], [2025, 1]] },
|
|
307
|
+
{ value: '2025', text: '2025', members: [2025] },
|
|
308
|
+
];
|
|
309
|
+
|
|
310
|
+
/** Regions kept or left out by their values or with large sales, and quarters kept by their members. */
|
|
311
|
+
export default function Filtering() {
|
|
312
|
+
const s = reactive({ regions: ['Aegean', 'Marmara'], large: false, exclude: false, period: 'all' });
|
|
313
|
+
const fields = (): PivotGridField<Sale>[] => [
|
|
314
|
+
{
|
|
315
|
+
field: 'region',
|
|
316
|
+
title: 'Region',
|
|
317
|
+
area: 'row',
|
|
318
|
+
expanded: true,
|
|
319
|
+
filterValues: s.large ? [...s.regions, data.where('amount', '>', 400)] : [...s.regions],
|
|
320
|
+
filterType: s.exclude ? 'exclude' : 'include',
|
|
321
|
+
},
|
|
322
|
+
{ field: 'city', title: 'City', area: 'row' },
|
|
323
|
+
{ field: 'date', title: 'Date', type: 'date', area: 'column', groupInterval: ['year', 'quarter'], expanded: true, filterValues: PERIODS.find((p) => p.value === s.period)!.members },
|
|
324
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
325
|
+
];
|
|
326
|
+
|
|
327
|
+
return (
|
|
328
|
+
<>
|
|
329
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
330
|
+
<ButtonGroup label="Regions" selection="multiple" items={REGIONS} x-model={() => s.regions} />
|
|
331
|
+
<CheckBox label="Or sales over 400" x-model={() => s.large} />
|
|
332
|
+
<CheckBox label="Leave these out" x-model={() => s.exclude} />
|
|
333
|
+
</Stack>
|
|
334
|
+
<ButtonGroup label="Quarters" items={PERIODS} x-model={() => s.period} />
|
|
335
|
+
<PivotGrid class="pg-filtering" style="block-size: 22rem" data={sales} fields={fields} label="Sales of the chosen regions and quarters" />
|
|
336
|
+
</>
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`FilterItems.tsx`
|
|
342
|
+
|
|
343
|
+
```tsx
|
|
344
|
+
import { data } from '@motifx-community/data';
|
|
345
|
+
import { PivotGrid, type PivotGridField } from '@motifx-community/ui';
|
|
346
|
+
import { makeSales, type Sale } from './sales';
|
|
347
|
+
|
|
348
|
+
const sales = makeSales(20000);
|
|
349
|
+
|
|
350
|
+
const COAST = ['Aegean', 'Black Sea', 'Marmara', 'Mediterranean'];
|
|
351
|
+
|
|
352
|
+
const fields: PivotGridField<Sale>[] = [
|
|
353
|
+
{
|
|
354
|
+
field: 'region',
|
|
355
|
+
title: 'Region',
|
|
356
|
+
area: 'row',
|
|
357
|
+
// The regions, after an entry of the app's own.
|
|
358
|
+
headerFilterItems: async ({ values }) => [{ text: 'On the coast', value: data.where('region', 'in', COAST) }, ...(await values())],
|
|
359
|
+
},
|
|
360
|
+
{ field: 'date', title: 'Year', type: 'date', area: 'column', groupInterval: 'year' },
|
|
361
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
362
|
+
{
|
|
363
|
+
name: 'size',
|
|
364
|
+
field: 'amount',
|
|
365
|
+
title: 'Sale size',
|
|
366
|
+
area: 'filter',
|
|
367
|
+
headerFilterItems: [
|
|
368
|
+
{ text: 'Under 100', value: data.where('amount', '<', 100) },
|
|
369
|
+
{ text: '100 to 300', value: data.and(data.where('amount', '>=', 100), data.where('amount', '<', 300)) },
|
|
370
|
+
{ text: '300 and over', value: data.where('amount', '>=', 300) },
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
];
|
|
374
|
+
|
|
375
|
+
/** Header filters with entries of their own: a group of regions beside the regions, and ranges of amounts. */
|
|
376
|
+
export default function FilterItems() {
|
|
377
|
+
return <PivotGrid class="pg-filter-items" style="block-size: 20rem" data={sales} fields={fields} fieldPanel={{ visible: true }} label="Sales by region and year" />;
|
|
378
|
+
}
|
|
379
|
+
```
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# PivotGrid: State and selection
|
|
2
|
+
|
|
3
|
+
> PivotGrid · @motifx-community/ui 0.1.0-beta.14
|
|
4
|
+
|
|
5
|
+
What the user arranges and opens, kept in the browser or saved and given back from code, and the cells the user selects and copies to a spreadsheet.
|
|
6
|
+
|
|
7
|
+
## Keeping what the user arranged
|
|
8
|
+
|
|
9
|
+
`state` reads what the user arranged: each field's area, place, order (`sortOrder`, `sortBySummaryField`, `sortBySummaryPath`) and filter (`filterValues`, `filterType`) changed over `fields`, by the field's `name`, `field`, `title` or place, and the members opened or closed on each axis, one by one, a level whole or every one. It is plain data: store it anywhere and assign it back, and the pivot starts again from `fields` with it. The `state` prop gives one at first. Other options changed with `fieldOption` (a title, a format) are not part of it.
|
|
10
|
+
|
|
11
|
+
`layoutKey` keeps the state in the browser's `localStorage` under that name, written on every change, and a pivot made again with the same name takes it back over the `state` prop; `layoutStorage` keeps it in `sessionStorage` or a store of your own. Dates among filter values and member keys come back as dates. Storage that is full or blocked keeps nothing and fails nothing. `resetState()` goes back to `fields` and to the members as their fields open them, and forgets what was kept. A new `fields` list is the app's word: what the user arranged is dropped, and what was kept is not laid over it.
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
15
|
+
|
|
16
|
+
const PLACES: [string, string][] = [
|
|
17
|
+
['Marmara', 'İstanbul'],
|
|
18
|
+
['Marmara', 'Bursa'],
|
|
19
|
+
['Central Anatolia', 'Ankara'],
|
|
20
|
+
['Central Anatolia', 'Konya'],
|
|
21
|
+
['Aegean', 'İzmir'],
|
|
22
|
+
['Aegean', 'Muğla'],
|
|
23
|
+
['Black Sea', 'Trabzon'],
|
|
24
|
+
['Mediterranean', 'Antalya'],
|
|
25
|
+
];
|
|
26
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
27
|
+
|
|
28
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
29
|
+
export function makeSales(count: number): Sale[] {
|
|
30
|
+
return Array.from({ length: count }, (_, i) => {
|
|
31
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
32
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
33
|
+
return {
|
|
34
|
+
id: i + 1,
|
|
35
|
+
region,
|
|
36
|
+
city,
|
|
37
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
38
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
39
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
40
|
+
units: 1 + ((i * 31) % 12),
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Selecting and copying cells
|
|
47
|
+
|
|
48
|
+
`cellSelection` lets the user select data cells: one range (`'single'`) or several (`'multiple'`, a press with Ctrl adds one); the default is `'none'`. A press starts a range, a press with Shift runs it to the cell pressed, and the pointer held down draws it, the table scrolling at its edges. Shift with the arrows, Home, End, Page Up and Page Down runs it from the keys among the data cells, Ctrl+A selects every data cell, and Escape or a move without Shift clears the ranges. A range stays on its cells through a new layout and leaves once a corner is gone.
|
|
49
|
+
|
|
50
|
+
`cellRanges` reads the ranges by their cells' members (`rowPath`, `columnPath`, their kinds and the data field) and takes them from code; `selectCells(from, to, add)` and `clearCellSelection()` do it cell by cell, `selectedCells` gives the cells as `onCellClick` has them, and `onCellSelectionChanged` tells every change. Ctrl+C, or `copy()`, puts the cells of the ranges on the clipboard under the names of their columns and beside those of their rows (a cell outside every range left empty), as tab-separated text and an HTML table that spreadsheets paste as a table; without ranges it copies the active cell's text. `onCopying` can change the text or cancel, and each copy is announced.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
54
|
+
|
|
55
|
+
const PLACES: [string, string][] = [
|
|
56
|
+
['Marmara', 'İstanbul'],
|
|
57
|
+
['Marmara', 'Bursa'],
|
|
58
|
+
['Central Anatolia', 'Ankara'],
|
|
59
|
+
['Central Anatolia', 'Konya'],
|
|
60
|
+
['Aegean', 'İzmir'],
|
|
61
|
+
['Aegean', 'Muğla'],
|
|
62
|
+
['Black Sea', 'Trabzon'],
|
|
63
|
+
['Mediterranean', 'Antalya'],
|
|
64
|
+
];
|
|
65
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
66
|
+
|
|
67
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
68
|
+
export function makeSales(count: number): Sale[] {
|
|
69
|
+
return Array.from({ length: count }, (_, i) => {
|
|
70
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
71
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
72
|
+
return {
|
|
73
|
+
id: i + 1,
|
|
74
|
+
region,
|
|
75
|
+
city,
|
|
76
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
77
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
78
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
79
|
+
units: 1 + ((i * 31) % 12),
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Feedback
|
|
86
|
+
|
|
87
|
+
Loading issues…
|
|
88
|
+
|
|
89
|
+
## Example files
|
|
90
|
+
|
|
91
|
+
`State.tsx`
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { reactive } from '@motifx/core';
|
|
95
|
+
import { Button, PivotGrid, Stack, type PivotGridField, type PivotGridState } from '@motifx-community/ui';
|
|
96
|
+
import { makeSales, type Sale } from './sales';
|
|
97
|
+
|
|
98
|
+
const sales = makeSales(20000);
|
|
99
|
+
|
|
100
|
+
const fields: PivotGridField<Sale>[] = [
|
|
101
|
+
{ field: 'region', title: 'Region', area: 'row' },
|
|
102
|
+
{ field: 'city', title: 'City', area: 'row' },
|
|
103
|
+
{ field: 'product', title: 'Product', area: 'column' },
|
|
104
|
+
{ field: 'date', title: 'Year', type: 'date', groupInterval: 'year' },
|
|
105
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
106
|
+
];
|
|
107
|
+
|
|
108
|
+
/** What the user arranged, kept in the browser under a `layoutKey`, and a state saved and given back from code. */
|
|
109
|
+
export default function State() {
|
|
110
|
+
const s = reactive({ saved: null as PivotGridState | null, shown: '' });
|
|
111
|
+
let pivot: PivotGrid<Sale> | null = null;
|
|
112
|
+
const show = () => {
|
|
113
|
+
if (pivot) s.shown = JSON.stringify(pivot.state, null, 2);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<>
|
|
118
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
119
|
+
<Button text="Save the state" variant="outline" onclick={() => (s.saved = pivot?.state ?? null)} />
|
|
120
|
+
<Button
|
|
121
|
+
text="Give it back"
|
|
122
|
+
variant="outline"
|
|
123
|
+
disabled={() => !s.saved}
|
|
124
|
+
onclick={() => {
|
|
125
|
+
if (pivot && s.saved) pivot.state = s.saved;
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
<Button text="Start again" variant="outline" onclick={() => pivot?.resetState()} />
|
|
129
|
+
</Stack>
|
|
130
|
+
<PivotGrid
|
|
131
|
+
class="pg-state"
|
|
132
|
+
style="block-size: 20rem"
|
|
133
|
+
data={sales}
|
|
134
|
+
fields={fields}
|
|
135
|
+
fieldPanel={{ visible: true }}
|
|
136
|
+
layoutKey="docs-pivotgrid-state"
|
|
137
|
+
label="Sales kept as they are arranged"
|
|
138
|
+
onContentReady={show}
|
|
139
|
+
onFieldsChanged={show}
|
|
140
|
+
onExpanded={show}
|
|
141
|
+
ref={(g: PivotGrid<Sale>) => (pivot = g)}
|
|
142
|
+
/>
|
|
143
|
+
<pre class="pg-state-json" tabindex="0" aria-label="The state">
|
|
144
|
+
{s.shown}
|
|
145
|
+
</pre>
|
|
146
|
+
</>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`sales.ts`
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
export type Sale = { id: number; region: string; city: string; product: string; date: string; amount: number; units: number };
|
|
155
|
+
|
|
156
|
+
const PLACES: [string, string][] = [
|
|
157
|
+
['Marmara', 'İstanbul'],
|
|
158
|
+
['Marmara', 'Bursa'],
|
|
159
|
+
['Central Anatolia', 'Ankara'],
|
|
160
|
+
['Central Anatolia', 'Konya'],
|
|
161
|
+
['Aegean', 'İzmir'],
|
|
162
|
+
['Aegean', 'Muğla'],
|
|
163
|
+
['Black Sea', 'Trabzon'],
|
|
164
|
+
['Mediterranean', 'Antalya'],
|
|
165
|
+
];
|
|
166
|
+
const PRODUCTS = ['Tea', 'Coffee', 'Hazelnuts', 'Figs', 'Olive oil'];
|
|
167
|
+
|
|
168
|
+
/** Sales spread over the places, the products and the days of 2024 and 2025; the same rows every time. */
|
|
169
|
+
export function makeSales(count: number): Sale[] {
|
|
170
|
+
return Array.from({ length: count }, (_, i) => {
|
|
171
|
+
const [region, city] = PLACES[(i * 7) % PLACES.length];
|
|
172
|
+
const day = new Date(2024, 0, 1 + ((i * 13) % 731));
|
|
173
|
+
return {
|
|
174
|
+
id: i + 1,
|
|
175
|
+
region,
|
|
176
|
+
city,
|
|
177
|
+
product: PRODUCTS[(i * 3) % PRODUCTS.length],
|
|
178
|
+
date: `${day.getFullYear()}-${String(day.getMonth() + 1).padStart(2, '0')}-${String(day.getDate()).padStart(2, '0')}`,
|
|
179
|
+
amount: ((i * 7919) % 50000) / 100,
|
|
180
|
+
units: 1 + ((i * 31) % 12),
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`Selection.tsx`
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import { reactive } from '@motifx/core';
|
|
190
|
+
import { Button, ButtonGroup, PivotGrid, Stack, type PivotGridField } from '@motifx-community/ui';
|
|
191
|
+
import { makeSales, type Sale } from './sales';
|
|
192
|
+
|
|
193
|
+
const sales = makeSales(20000);
|
|
194
|
+
|
|
195
|
+
const fields: PivotGridField<Sale>[] = [
|
|
196
|
+
{ field: 'region', title: 'Region', area: 'row' },
|
|
197
|
+
{ field: 'city', title: 'City', area: 'row' },
|
|
198
|
+
{ field: 'product', title: 'Product', area: 'column' },
|
|
199
|
+
{ field: 'amount', title: 'Amount', type: 'number', area: 'data', summaryType: 'sum', format: { maximumFractionDigits: 0 } },
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
const number = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 });
|
|
203
|
+
|
|
204
|
+
/** Cells selected with the pointer and the keys, summed up, and copied with Ctrl+C or a button. */
|
|
205
|
+
export default function Selection() {
|
|
206
|
+
const s = reactive({ mode: 'multiple' as 'none' | 'single' | 'multiple', count: 0, sum: 0, copied: '' });
|
|
207
|
+
let pivot: PivotGrid<Sale> | null = null;
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<>
|
|
211
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
212
|
+
<ButtonGroup
|
|
213
|
+
label="Selection"
|
|
214
|
+
items={[
|
|
215
|
+
{ value: 'none', text: 'None' },
|
|
216
|
+
{ value: 'single', text: 'One range' },
|
|
217
|
+
{ value: 'multiple', text: 'Several ranges' },
|
|
218
|
+
]}
|
|
219
|
+
x-model={() => s.mode}
|
|
220
|
+
/>
|
|
221
|
+
<Button text="Copy" variant="outline" onclick={() => pivot?.copy()} />
|
|
222
|
+
</Stack>
|
|
223
|
+
<PivotGrid
|
|
224
|
+
class="pg-selection"
|
|
225
|
+
style="block-size: 20rem"
|
|
226
|
+
data={sales}
|
|
227
|
+
fields={fields}
|
|
228
|
+
cellSelection={() => s.mode}
|
|
229
|
+
label="Sales whose cells can be selected and copied"
|
|
230
|
+
onCellSelectionChanged={() => {
|
|
231
|
+
const cells = pivot?.selectedCells ?? [];
|
|
232
|
+
s.count = cells.length;
|
|
233
|
+
// The members' own cells only: a total sums them again.
|
|
234
|
+
s.sum = cells.reduce((sum, c) => sum + (c.rowKind === 'member' && c.columnKind === 'member' && typeof c.value === 'number' ? c.value : 0), 0);
|
|
235
|
+
}}
|
|
236
|
+
onCopying={(e) => (s.copied = e.cells ? `${e.cells} cells copied.` : 'The active cell copied.')}
|
|
237
|
+
ref={(g: PivotGrid<Sale>) => (pivot = g)}
|
|
238
|
+
/>
|
|
239
|
+
<p class="pg-selection-note" aria-live="polite">
|
|
240
|
+
{() => `${s.count} cells selected, ${number.format(s.sum)} in the members' own cells. ${s.copied}`}
|
|
241
|
+
</p>
|
|
242
|
+
</>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
```
|