handsontable 0.0.0-next-ff10728-20250410 → 0.0.0-next-d9b3885-20250415
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.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/range.js +14 -0
- package/3rdparty/walkontable/src/cell/range.mjs +14 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
- package/3rdparty/walkontable/src/selection/border/border.js +5 -0
- package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
- package/3rdparty/walkontable/src/table.js +5 -2
- package/3rdparty/walkontable/src/table.mjs +5 -2
- package/CHANGELOG.md +39 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +1 -1
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +266 -0
- package/core/hooks/constants.mjs +266 -0
- package/core/hooks/index.d.ts +1 -0
- package/core.d.ts +0 -1
- package/core.js +71 -25
- package/core.mjs +72 -26
- package/dataMap/dataMap.js +0 -7
- package/dataMap/dataMap.mjs +0 -7
- package/dataMap/metaManager/metaSchema.js +28 -0
- package/dataMap/metaManager/metaSchema.mjs +28 -0
- package/dist/handsontable.css +3 -3
- package/dist/handsontable.full.css +3 -3
- package/dist/handsontable.full.js +1375 -350
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +17 -17
- package/dist/handsontable.js +1375 -350
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +18 -18
- package/editorManager.js +1 -7
- package/editorManager.mjs +1 -7
- package/editors/autocompleteEditor/autocompleteEditor.js +14 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +14 -4
- package/editors/textEditor/textEditor.js +1 -1
- package/editors/textEditor/textEditor.mjs +2 -2
- package/helpers/browser.js +1 -1
- package/helpers/browser.mjs +1 -1
- package/helpers/dom/element.js +2 -2
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +3 -0
- package/helpers/object.mjs +3 -0
- package/package.json +1 -1
- package/plugins/autoColumnSize/autoColumnSize.js +48 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +48 -1
- package/plugins/autoRowSize/autoRowSize.js +46 -6
- package/plugins/autoRowSize/autoRowSize.mjs +46 -6
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +13 -0
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +13 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +31 -0
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +31 -0
- package/plugins/columnSorting/columnSorting.js +0 -4
- package/plugins/columnSorting/columnSorting.mjs +0 -4
- package/plugins/columnSummary/columnSummary.js +33 -0
- package/plugins/columnSummary/columnSummary.mjs +33 -0
- package/plugins/comments/comments.js +54 -0
- package/plugins/comments/comments.mjs +54 -0
- package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +1 -0
- package/plugins/contextMenu/menu/menu.mjs +1 -0
- package/plugins/contextMenu/menu/positioner.js +10 -2
- package/plugins/contextMenu/menu/positioner.mjs +10 -2
- package/plugins/copyPaste/copyPaste.js +12 -15
- package/plugins/copyPaste/copyPaste.mjs +13 -16
- package/plugins/copyPaste/pasteEvent.js +3 -0
- package/plugins/copyPaste/pasteEvent.mjs +3 -0
- package/plugins/dropdownMenu/dropdownMenu.js +15 -0
- package/plugins/dropdownMenu/dropdownMenu.mjs +15 -0
- package/plugins/exportFile/exportFile.js +58 -0
- package/plugins/exportFile/exportFile.mjs +58 -0
- package/plugins/filters/filters.js +99 -24
- package/plugins/filters/filters.mjs +99 -24
- package/plugins/filters/ui/multipleSelect.js +7 -1
- package/plugins/filters/ui/multipleSelect.mjs +7 -1
- package/plugins/hiddenColumns/hiddenColumns.js +65 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +65 -1
- package/plugins/hiddenRows/hiddenRows.js +65 -1
- package/plugins/hiddenRows/hiddenRows.mjs +65 -1
- package/plugins/manualColumnResize/manualColumnResize.js +4 -6
- package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
- package/plugins/manualRowResize/manualRowResize.js +4 -6
- package/plugins/manualRowResize/manualRowResize.mjs +4 -6
- package/plugins/mergeCells/mergeCells.js +26 -29
- package/plugins/mergeCells/mergeCells.mjs +26 -29
- package/plugins/mergeCells/renderer.js +15 -0
- package/plugins/mergeCells/renderer.mjs +15 -0
- package/plugins/mergeCells/utils.js +31 -0
- package/plugins/mergeCells/utils.mjs +27 -0
- package/plugins/nestedHeaders/nestedHeaders.js +25 -0
- package/plugins/nestedHeaders/nestedHeaders.mjs +25 -0
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/stretchColumns/stretchColumns.js +13 -0
- package/plugins/stretchColumns/stretchColumns.mjs +13 -0
- package/plugins/trimRows/trimRows.js +61 -0
- package/plugins/trimRows/trimRows.mjs +61 -0
- package/plugins/undoRedo/actions/removeColumn.js +19 -14
- package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
- package/plugins/undoRedo/actions/removeRow.js +12 -4
- package/plugins/undoRedo/actions/removeRow.mjs +12 -4
- package/selection/selection.js +3 -1
- package/selection/selection.mjs +3 -1
- package/styles/handsontable.css +14 -15
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/tableView.js +5 -8
- package/tableView.mjs +5 -8
- package/utils/ghostTable.js +3 -0
- package/utils/ghostTable.mjs +3 -0
|
@@ -81,6 +81,64 @@ export const PLUGIN_PRIORITY = 240;
|
|
|
81
81
|
* });
|
|
82
82
|
* ```
|
|
83
83
|
* :::
|
|
84
|
+
*
|
|
85
|
+
* ::: only-for angular
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
88
|
+
* import {
|
|
89
|
+
* GridSettings,
|
|
90
|
+
* HotTableModule,
|
|
91
|
+
* HotTableComponent,
|
|
92
|
+
* } from "@handsontable/angular-wrapper";
|
|
93
|
+
*
|
|
94
|
+
* `@Component`({
|
|
95
|
+
* selector: "app-example",
|
|
96
|
+
* standalone: true,
|
|
97
|
+
* imports: [HotTableModule],
|
|
98
|
+
* template: ` <div class="ht-theme-main">
|
|
99
|
+
* <hot-table [settings]="gridSettings" />
|
|
100
|
+
* </div>`,
|
|
101
|
+
* })
|
|
102
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
103
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
104
|
+
* readonly hotTable!: HotTableComponent;
|
|
105
|
+
*
|
|
106
|
+
* readonly gridSettings = <GridSettings>{
|
|
107
|
+
* data: this.getData(),
|
|
108
|
+
* };
|
|
109
|
+
*
|
|
110
|
+
* ngAfterViewInit(): void {
|
|
111
|
+
* // Access to plugin instance:
|
|
112
|
+
* const hot = this.hotTable.hotInstance;
|
|
113
|
+
* // Access to exportFile plugin instance
|
|
114
|
+
* const exportPlugin = hot.getPlugin("exportFile");
|
|
115
|
+
*
|
|
116
|
+
* // Export as a string
|
|
117
|
+
* exportPlugin.exportAsString("csv");
|
|
118
|
+
*
|
|
119
|
+
* // Export as a blob object
|
|
120
|
+
* exportPlugin.exportAsBlob("csv");
|
|
121
|
+
*
|
|
122
|
+
* // Export to downloadable file (named: MyFile.csv)
|
|
123
|
+
* exportPlugin.downloadFile("csv", { filename: "MyFile" });
|
|
124
|
+
*
|
|
125
|
+
* // Export as a string (with specified data range):
|
|
126
|
+
* exportPlugin.exportAsString("csv", {
|
|
127
|
+
* exportHiddenRows: true, // default false
|
|
128
|
+
* exportHiddenColumns: true, // default false
|
|
129
|
+
* columnHeaders: true, // default false
|
|
130
|
+
* rowHeaders: true, // default false
|
|
131
|
+
* columnDelimiter: ";", // default ','
|
|
132
|
+
* range: [1, 1, 6, 6], // [startRow, endRow, startColumn, endColumn]
|
|
133
|
+
* });
|
|
134
|
+
* }
|
|
135
|
+
*
|
|
136
|
+
* private getData(): any[] {
|
|
137
|
+
* // get some data
|
|
138
|
+
* }
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
* :::
|
|
84
142
|
*/
|
|
85
143
|
export class ExportFile extends BasePlugin {
|
|
86
144
|
static get PLUGIN_KEY() {
|
|
@@ -78,6 +78,22 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
|
78
78
|
* />
|
|
79
79
|
* ```
|
|
80
80
|
* :::
|
|
81
|
+
*
|
|
82
|
+
* ::: only-for angular
|
|
83
|
+
* ```ts
|
|
84
|
+
* settings = {
|
|
85
|
+
* data: getData(),
|
|
86
|
+
* colHeaders: true,
|
|
87
|
+
* rowHeaders: true,
|
|
88
|
+
* dropdownMenu: true,
|
|
89
|
+
* filters: true,
|
|
90
|
+
* };
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* ```html
|
|
94
|
+
* <hot-table [settings]="settings"></hot-table>
|
|
95
|
+
* ```
|
|
96
|
+
* :::
|
|
81
97
|
*/
|
|
82
98
|
var _menuFocusNavigator = /*#__PURE__*/new WeakMap();
|
|
83
99
|
var _dropdownMenuTraces = /*#__PURE__*/new WeakMap();
|
|
@@ -460,6 +476,64 @@ class Filters extends _base.BasePlugin {
|
|
|
460
476
|
* ```
|
|
461
477
|
* :::
|
|
462
478
|
*
|
|
479
|
+
* ::: only-for angular
|
|
480
|
+
* ```ts
|
|
481
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
482
|
+
* import {
|
|
483
|
+
* GridSettings,
|
|
484
|
+
* HotTableModule,
|
|
485
|
+
* HotTableComponent,
|
|
486
|
+
* } from "@handsontable/angular-wrapper";
|
|
487
|
+
*
|
|
488
|
+
* `@Component`({
|
|
489
|
+
* selector: "app-example",
|
|
490
|
+
* standalone: true,
|
|
491
|
+
* imports: [HotTableModule],
|
|
492
|
+
* template: ` <div class="ht-theme-main">
|
|
493
|
+
* <hot-table [settings]="gridSettings" />
|
|
494
|
+
* </div>`,
|
|
495
|
+
* })
|
|
496
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
497
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
498
|
+
* readonly hotTable!: HotTableComponent;
|
|
499
|
+
*
|
|
500
|
+
* readonly gridSettings = <GridSettings>{
|
|
501
|
+
* data: this.getData(),
|
|
502
|
+
* filters: true,
|
|
503
|
+
* };
|
|
504
|
+
*
|
|
505
|
+
* ngAfterViewInit(): void {
|
|
506
|
+
* // Access to filters plugin instance
|
|
507
|
+
* const hot = this.hotTable.hotInstance;
|
|
508
|
+
* const filtersPlugin = hot.getPlugin("filters");
|
|
509
|
+
*
|
|
510
|
+
* // Add filter "Greater than" 95 to column at index 1
|
|
511
|
+
* filtersPlugin.addCondition(1, "gt", [95]);
|
|
512
|
+
* filtersPlugin.filter();
|
|
513
|
+
*
|
|
514
|
+
* // Add filter "By value" to column at index 1
|
|
515
|
+
* // In this case, all values that don't match will be filtered.
|
|
516
|
+
* filtersPlugin.addCondition(1, "by_value", [["ing", "ed", "as", "on"]]);
|
|
517
|
+
* filtersPlugin.filter();
|
|
518
|
+
*
|
|
519
|
+
* // Add filter "Begins with" with value "de" AND "Not contains" with value "ing"
|
|
520
|
+
* filtersPlugin.addCondition(1, "begins_with", ["de"], "conjunction");
|
|
521
|
+
* filtersPlugin.addCondition(1, "not_contains", ["ing"], "conjunction");
|
|
522
|
+
* filtersPlugin.filter();
|
|
523
|
+
*
|
|
524
|
+
* // Add filter "Begins with" with value "de" OR "Not contains" with value "ing"
|
|
525
|
+
* filtersPlugin.addCondition(1, "begins_with", ["de"], "disjunction");
|
|
526
|
+
* filtersPlugin.addCondition(1, "not_contains", ["ing"], "disjunction");
|
|
527
|
+
* filtersPlugin.filter();
|
|
528
|
+
* }
|
|
529
|
+
*
|
|
530
|
+
* private getData(): any[] {
|
|
531
|
+
* // Get some data
|
|
532
|
+
* }
|
|
533
|
+
* }
|
|
534
|
+
* ```
|
|
535
|
+
* :::
|
|
536
|
+
*
|
|
463
537
|
* @param {number} column Visual column index.
|
|
464
538
|
* @param {string} name Condition short name.
|
|
465
539
|
* @param {Array} args Condition arguments.
|
|
@@ -542,10 +616,10 @@ class Filters extends _base.BasePlugin {
|
|
|
542
616
|
*
|
|
543
617
|
* @returns {Array}
|
|
544
618
|
*/
|
|
545
|
-
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
546
619
|
exportConditions() {
|
|
547
620
|
return this.conditionCollection.exportAllConditions();
|
|
548
621
|
}
|
|
622
|
+
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
549
623
|
|
|
550
624
|
/**
|
|
551
625
|
* Filters data based on added filter conditions.
|
|
@@ -562,38 +636,39 @@ class Filters extends _base.BasePlugin {
|
|
|
562
636
|
let visibleVisualRows = [];
|
|
563
637
|
const conditions = this.exportConditions();
|
|
564
638
|
const allowFiltering = this.hot.runHooks('beforeFilter', conditions, _classPrivateFieldGet(_previousConditionStack, this));
|
|
565
|
-
if (allowFiltering !== false) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
this.hot.batchExecution(() => {
|
|
569
|
-
this.filtersRowsMap.clear();
|
|
570
|
-
visibleVisualRows = (0, _array.arrayMap)(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
571
|
-
const visibleVisualRowsAssertion = (0, _utils.createArrayAssertion)(visibleVisualRows);
|
|
572
|
-
(0, _number.rangeEach)(this.hot.countSourceRows() - 1, row => {
|
|
573
|
-
if (!visibleVisualRowsAssertion(row)) {
|
|
574
|
-
trimmedRows.push(row);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
(0, _array.arrayEach)(trimmedRows, physicalRow => {
|
|
578
|
-
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
579
|
-
});
|
|
580
|
-
}, true);
|
|
581
|
-
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
582
|
-
this.hot.deselectCell();
|
|
583
|
-
}
|
|
584
|
-
} else {
|
|
639
|
+
if (allowFiltering !== false && needToFilter) {
|
|
640
|
+
const trimmedRows = [];
|
|
641
|
+
this.hot.batchExecution(() => {
|
|
585
642
|
this.filtersRowsMap.clear();
|
|
643
|
+
visibleVisualRows = (0, _array.arrayMap)(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
644
|
+
const visibleVisualRowsAssertion = (0, _utils.createArrayAssertion)(visibleVisualRows);
|
|
645
|
+
(0, _number.rangeEach)(this.hot.countSourceRows() - 1, row => {
|
|
646
|
+
if (!visibleVisualRowsAssertion(row)) {
|
|
647
|
+
trimmedRows.push(row);
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
(0, _array.arrayEach)(trimmedRows, physicalRow => {
|
|
651
|
+
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
652
|
+
});
|
|
653
|
+
}, true);
|
|
654
|
+
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
655
|
+
this.hot.deselectCell();
|
|
586
656
|
}
|
|
587
657
|
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
588
|
-
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
658
|
+
} else if (allowFiltering !== false && !needToFilter) {
|
|
659
|
+
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
660
|
+
this.filtersRowsMap.clear();
|
|
591
661
|
} else {
|
|
592
662
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
|
593
663
|
}
|
|
594
664
|
if (this.hot.selection.isSelected()) {
|
|
595
665
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
|
596
666
|
}
|
|
667
|
+
if (allowFiltering !== false) {
|
|
668
|
+
this.hot.runHooks('afterFilter', conditions);
|
|
669
|
+
this.hot.view.adjustElementsSize();
|
|
670
|
+
this.hot.render();
|
|
671
|
+
}
|
|
597
672
|
}
|
|
598
673
|
|
|
599
674
|
/**
|
|
@@ -72,6 +72,22 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
|
72
72
|
* />
|
|
73
73
|
* ```
|
|
74
74
|
* :::
|
|
75
|
+
*
|
|
76
|
+
* ::: only-for angular
|
|
77
|
+
* ```ts
|
|
78
|
+
* settings = {
|
|
79
|
+
* data: getData(),
|
|
80
|
+
* colHeaders: true,
|
|
81
|
+
* rowHeaders: true,
|
|
82
|
+
* dropdownMenu: true,
|
|
83
|
+
* filters: true,
|
|
84
|
+
* };
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* ```html
|
|
88
|
+
* <hot-table [settings]="settings"></hot-table>
|
|
89
|
+
* ```
|
|
90
|
+
* :::
|
|
75
91
|
*/
|
|
76
92
|
var _menuFocusNavigator = /*#__PURE__*/new WeakMap();
|
|
77
93
|
var _dropdownMenuTraces = /*#__PURE__*/new WeakMap();
|
|
@@ -454,6 +470,64 @@ export class Filters extends BasePlugin {
|
|
|
454
470
|
* ```
|
|
455
471
|
* :::
|
|
456
472
|
*
|
|
473
|
+
* ::: only-for angular
|
|
474
|
+
* ```ts
|
|
475
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
476
|
+
* import {
|
|
477
|
+
* GridSettings,
|
|
478
|
+
* HotTableModule,
|
|
479
|
+
* HotTableComponent,
|
|
480
|
+
* } from "@handsontable/angular-wrapper";
|
|
481
|
+
*
|
|
482
|
+
* `@Component`({
|
|
483
|
+
* selector: "app-example",
|
|
484
|
+
* standalone: true,
|
|
485
|
+
* imports: [HotTableModule],
|
|
486
|
+
* template: ` <div class="ht-theme-main">
|
|
487
|
+
* <hot-table [settings]="gridSettings" />
|
|
488
|
+
* </div>`,
|
|
489
|
+
* })
|
|
490
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
491
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
492
|
+
* readonly hotTable!: HotTableComponent;
|
|
493
|
+
*
|
|
494
|
+
* readonly gridSettings = <GridSettings>{
|
|
495
|
+
* data: this.getData(),
|
|
496
|
+
* filters: true,
|
|
497
|
+
* };
|
|
498
|
+
*
|
|
499
|
+
* ngAfterViewInit(): void {
|
|
500
|
+
* // Access to filters plugin instance
|
|
501
|
+
* const hot = this.hotTable.hotInstance;
|
|
502
|
+
* const filtersPlugin = hot.getPlugin("filters");
|
|
503
|
+
*
|
|
504
|
+
* // Add filter "Greater than" 95 to column at index 1
|
|
505
|
+
* filtersPlugin.addCondition(1, "gt", [95]);
|
|
506
|
+
* filtersPlugin.filter();
|
|
507
|
+
*
|
|
508
|
+
* // Add filter "By value" to column at index 1
|
|
509
|
+
* // In this case, all values that don't match will be filtered.
|
|
510
|
+
* filtersPlugin.addCondition(1, "by_value", [["ing", "ed", "as", "on"]]);
|
|
511
|
+
* filtersPlugin.filter();
|
|
512
|
+
*
|
|
513
|
+
* // Add filter "Begins with" with value "de" AND "Not contains" with value "ing"
|
|
514
|
+
* filtersPlugin.addCondition(1, "begins_with", ["de"], "conjunction");
|
|
515
|
+
* filtersPlugin.addCondition(1, "not_contains", ["ing"], "conjunction");
|
|
516
|
+
* filtersPlugin.filter();
|
|
517
|
+
*
|
|
518
|
+
* // Add filter "Begins with" with value "de" OR "Not contains" with value "ing"
|
|
519
|
+
* filtersPlugin.addCondition(1, "begins_with", ["de"], "disjunction");
|
|
520
|
+
* filtersPlugin.addCondition(1, "not_contains", ["ing"], "disjunction");
|
|
521
|
+
* filtersPlugin.filter();
|
|
522
|
+
* }
|
|
523
|
+
*
|
|
524
|
+
* private getData(): any[] {
|
|
525
|
+
* // Get some data
|
|
526
|
+
* }
|
|
527
|
+
* }
|
|
528
|
+
* ```
|
|
529
|
+
* :::
|
|
530
|
+
*
|
|
457
531
|
* @param {number} column Visual column index.
|
|
458
532
|
* @param {string} name Condition short name.
|
|
459
533
|
* @param {Array} args Condition arguments.
|
|
@@ -536,10 +610,10 @@ export class Filters extends BasePlugin {
|
|
|
536
610
|
*
|
|
537
611
|
* @returns {Array}
|
|
538
612
|
*/
|
|
539
|
-
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
540
613
|
exportConditions() {
|
|
541
614
|
return this.conditionCollection.exportAllConditions();
|
|
542
615
|
}
|
|
616
|
+
/* eslint-enable jsdoc/require-description-complete-sentence */
|
|
543
617
|
|
|
544
618
|
/**
|
|
545
619
|
* Filters data based on added filter conditions.
|
|
@@ -556,38 +630,39 @@ export class Filters extends BasePlugin {
|
|
|
556
630
|
let visibleVisualRows = [];
|
|
557
631
|
const conditions = this.exportConditions();
|
|
558
632
|
const allowFiltering = this.hot.runHooks('beforeFilter', conditions, _classPrivateFieldGet(_previousConditionStack, this));
|
|
559
|
-
if (allowFiltering !== false) {
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
this.hot.batchExecution(() => {
|
|
563
|
-
this.filtersRowsMap.clear();
|
|
564
|
-
visibleVisualRows = arrayMap(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
565
|
-
const visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
|
|
566
|
-
rangeEach(this.hot.countSourceRows() - 1, row => {
|
|
567
|
-
if (!visibleVisualRowsAssertion(row)) {
|
|
568
|
-
trimmedRows.push(row);
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
arrayEach(trimmedRows, physicalRow => {
|
|
572
|
-
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
573
|
-
});
|
|
574
|
-
}, true);
|
|
575
|
-
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
576
|
-
this.hot.deselectCell();
|
|
577
|
-
}
|
|
578
|
-
} else {
|
|
633
|
+
if (allowFiltering !== false && needToFilter) {
|
|
634
|
+
const trimmedRows = [];
|
|
635
|
+
this.hot.batchExecution(() => {
|
|
579
636
|
this.filtersRowsMap.clear();
|
|
637
|
+
visibleVisualRows = arrayMap(dataFilter.filter(), rowData => rowData.meta.visualRow);
|
|
638
|
+
const visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
|
|
639
|
+
rangeEach(this.hot.countSourceRows() - 1, row => {
|
|
640
|
+
if (!visibleVisualRowsAssertion(row)) {
|
|
641
|
+
trimmedRows.push(row);
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
arrayEach(trimmedRows, physicalRow => {
|
|
645
|
+
this.filtersRowsMap.setValueAtIndex(physicalRow, true);
|
|
646
|
+
});
|
|
647
|
+
}, true);
|
|
648
|
+
if (!navigableHeaders && !visibleVisualRows.length) {
|
|
649
|
+
this.hot.deselectCell();
|
|
580
650
|
}
|
|
581
651
|
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
582
|
-
|
|
583
|
-
this.
|
|
584
|
-
this.
|
|
652
|
+
} else if (allowFiltering !== false && !needToFilter) {
|
|
653
|
+
_classPrivateFieldSet(_previousConditionStack, this, this.exportConditions());
|
|
654
|
+
this.filtersRowsMap.clear();
|
|
585
655
|
} else {
|
|
586
656
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
|
587
657
|
}
|
|
588
658
|
if (this.hot.selection.isSelected()) {
|
|
589
659
|
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeLast().highlight.col);
|
|
590
660
|
}
|
|
661
|
+
if (allowFiltering !== false) {
|
|
662
|
+
this.hot.runHooks('afterFilter', conditions);
|
|
663
|
+
this.hot.view.adjustElementsSize();
|
|
664
|
+
this.hot.render();
|
|
665
|
+
}
|
|
591
666
|
}
|
|
592
667
|
|
|
593
668
|
/**
|
|
@@ -253,7 +253,13 @@ class MultipleSelectUI extends _base.BaseUI {
|
|
|
253
253
|
beforeOnCellMouseUp: () => {
|
|
254
254
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
|
255
255
|
},
|
|
256
|
-
|
|
256
|
+
modifyColWidth: width => {
|
|
257
|
+
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - (0, _element.getScrollbarWidth)(rootDocument);
|
|
258
|
+
if (width !== undefined && width < minWidth) {
|
|
259
|
+
return minWidth;
|
|
260
|
+
}
|
|
261
|
+
return width;
|
|
262
|
+
},
|
|
257
263
|
maxCols: 1,
|
|
258
264
|
autoWrapCol: true,
|
|
259
265
|
height: 110,
|
|
@@ -248,7 +248,13 @@ export class MultipleSelectUI extends BaseUI {
|
|
|
248
248
|
beforeOnCellMouseUp: () => {
|
|
249
249
|
_classPrivateFieldGet(_itemsBox, this).listen();
|
|
250
250
|
},
|
|
251
|
-
|
|
251
|
+
modifyColWidth: width => {
|
|
252
|
+
const minWidth = _classPrivateFieldGet(_itemsBox, this).container.scrollWidth - getScrollbarWidth(rootDocument);
|
|
253
|
+
if (width !== undefined && width < minWidth) {
|
|
254
|
+
return minWidth;
|
|
255
|
+
}
|
|
256
|
+
return width;
|
|
257
|
+
},
|
|
252
258
|
maxCols: 1,
|
|
253
259
|
autoWrapCol: true,
|
|
254
260
|
height: 110,
|
|
@@ -141,6 +141,70 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 310;
|
|
|
141
141
|
* hot.render();
|
|
142
142
|
* ```
|
|
143
143
|
* :::
|
|
144
|
+
*
|
|
145
|
+
* ::: only-for angular
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
148
|
+
* import {
|
|
149
|
+
* GridSettings,
|
|
150
|
+
* HotTableModule,
|
|
151
|
+
* HotTableComponent,
|
|
152
|
+
* } from "@handsontable/angular-wrapper";
|
|
153
|
+
*
|
|
154
|
+
* `@Component`({
|
|
155
|
+
* selector: "app-example",
|
|
156
|
+
* standalone: true,
|
|
157
|
+
* imports: [HotTableModule],
|
|
158
|
+
* template: ` <div class="ht-theme-main">
|
|
159
|
+
* <hot-table [settings]="gridSettings" />
|
|
160
|
+
* </div>`,
|
|
161
|
+
* })
|
|
162
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
163
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
164
|
+
* readonly hotTable!: HotTableComponent;
|
|
165
|
+
*
|
|
166
|
+
* readonly gridSettings = <GridSettings>{
|
|
167
|
+
* data: this.getData(),
|
|
168
|
+
* hiddenColumns: {
|
|
169
|
+
* copyPasteEnabled: true,
|
|
170
|
+
* indicators: true,
|
|
171
|
+
* columns: [1, 2, 5],
|
|
172
|
+
* },
|
|
173
|
+
* };
|
|
174
|
+
*
|
|
175
|
+
* ngAfterViewInit(): void {
|
|
176
|
+
* // Access the `HiddenColumns` plugin's instance
|
|
177
|
+
* const hot = this.hotTable.hotInstance;
|
|
178
|
+
* const hiddenColumnsPlugin = hot.getPlugin("hiddenColumns");
|
|
179
|
+
*
|
|
180
|
+
* // Hide a single column
|
|
181
|
+
* hiddenColumnsPlugin.hideColumn(1);
|
|
182
|
+
*
|
|
183
|
+
* // Hide multiple columns
|
|
184
|
+
* hiddenColumnsPlugin.hideColumn(1, 2, 9);
|
|
185
|
+
*
|
|
186
|
+
* // Hide multiple columns as an array
|
|
187
|
+
* hiddenColumnsPlugin.hideColumns([1, 2, 9]);
|
|
188
|
+
*
|
|
189
|
+
* // Unhide a single column
|
|
190
|
+
* hiddenColumnsPlugin.showColumn(1);
|
|
191
|
+
*
|
|
192
|
+
* // Unhide multiple columns
|
|
193
|
+
* hiddenColumnsPlugin.showColumn(1, 2, 9);
|
|
194
|
+
*
|
|
195
|
+
* // Unhide multiple columns as an array
|
|
196
|
+
* hiddenColumnsPlugin.showColumns([1, 2, 9]);
|
|
197
|
+
*
|
|
198
|
+
* // To see your changes, re-render your Handsontable instance
|
|
199
|
+
* hot.render();
|
|
200
|
+
* }
|
|
201
|
+
*
|
|
202
|
+
* private getData(): any[] {
|
|
203
|
+
* // Get some data
|
|
204
|
+
* }
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
* :::
|
|
144
208
|
*/
|
|
145
209
|
var _hiddenColumnsMap = /*#__PURE__*/new WeakMap();
|
|
146
210
|
var _HiddenColumns_brand = /*#__PURE__*/new WeakSet();
|
|
@@ -231,8 +295,8 @@ class HiddenColumns extends _base.BasePlugin {
|
|
|
231
295
|
* Disables the plugin functionality for this Handsontable instance.
|
|
232
296
|
*/
|
|
233
297
|
disablePlugin() {
|
|
234
|
-
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
235
298
|
super.disablePlugin();
|
|
299
|
+
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
236
300
|
this.resetCellsMeta();
|
|
237
301
|
}
|
|
238
302
|
|
|
@@ -137,6 +137,70 @@ export const PLUGIN_PRIORITY = 310;
|
|
|
137
137
|
* hot.render();
|
|
138
138
|
* ```
|
|
139
139
|
* :::
|
|
140
|
+
*
|
|
141
|
+
* ::: only-for angular
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
144
|
+
* import {
|
|
145
|
+
* GridSettings,
|
|
146
|
+
* HotTableModule,
|
|
147
|
+
* HotTableComponent,
|
|
148
|
+
* } from "@handsontable/angular-wrapper";
|
|
149
|
+
*
|
|
150
|
+
* `@Component`({
|
|
151
|
+
* selector: "app-example",
|
|
152
|
+
* standalone: true,
|
|
153
|
+
* imports: [HotTableModule],
|
|
154
|
+
* template: ` <div class="ht-theme-main">
|
|
155
|
+
* <hot-table [settings]="gridSettings" />
|
|
156
|
+
* </div>`,
|
|
157
|
+
* })
|
|
158
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
159
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
160
|
+
* readonly hotTable!: HotTableComponent;
|
|
161
|
+
*
|
|
162
|
+
* readonly gridSettings = <GridSettings>{
|
|
163
|
+
* data: this.getData(),
|
|
164
|
+
* hiddenColumns: {
|
|
165
|
+
* copyPasteEnabled: true,
|
|
166
|
+
* indicators: true,
|
|
167
|
+
* columns: [1, 2, 5],
|
|
168
|
+
* },
|
|
169
|
+
* };
|
|
170
|
+
*
|
|
171
|
+
* ngAfterViewInit(): void {
|
|
172
|
+
* // Access the `HiddenColumns` plugin's instance
|
|
173
|
+
* const hot = this.hotTable.hotInstance;
|
|
174
|
+
* const hiddenColumnsPlugin = hot.getPlugin("hiddenColumns");
|
|
175
|
+
*
|
|
176
|
+
* // Hide a single column
|
|
177
|
+
* hiddenColumnsPlugin.hideColumn(1);
|
|
178
|
+
*
|
|
179
|
+
* // Hide multiple columns
|
|
180
|
+
* hiddenColumnsPlugin.hideColumn(1, 2, 9);
|
|
181
|
+
*
|
|
182
|
+
* // Hide multiple columns as an array
|
|
183
|
+
* hiddenColumnsPlugin.hideColumns([1, 2, 9]);
|
|
184
|
+
*
|
|
185
|
+
* // Unhide a single column
|
|
186
|
+
* hiddenColumnsPlugin.showColumn(1);
|
|
187
|
+
*
|
|
188
|
+
* // Unhide multiple columns
|
|
189
|
+
* hiddenColumnsPlugin.showColumn(1, 2, 9);
|
|
190
|
+
*
|
|
191
|
+
* // Unhide multiple columns as an array
|
|
192
|
+
* hiddenColumnsPlugin.showColumns([1, 2, 9]);
|
|
193
|
+
*
|
|
194
|
+
* // To see your changes, re-render your Handsontable instance
|
|
195
|
+
* hot.render();
|
|
196
|
+
* }
|
|
197
|
+
*
|
|
198
|
+
* private getData(): any[] {
|
|
199
|
+
* // Get some data
|
|
200
|
+
* }
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
* :::
|
|
140
204
|
*/
|
|
141
205
|
var _hiddenColumnsMap = /*#__PURE__*/new WeakMap();
|
|
142
206
|
var _HiddenColumns_brand = /*#__PURE__*/new WeakSet();
|
|
@@ -227,8 +291,8 @@ export class HiddenColumns extends BasePlugin {
|
|
|
227
291
|
* Disables the plugin functionality for this Handsontable instance.
|
|
228
292
|
*/
|
|
229
293
|
disablePlugin() {
|
|
230
|
-
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
231
294
|
super.disablePlugin();
|
|
295
|
+
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
232
296
|
this.resetCellsMeta();
|
|
233
297
|
}
|
|
234
298
|
|
|
@@ -141,6 +141,70 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 320;
|
|
|
141
141
|
* hot.render();
|
|
142
142
|
* ```
|
|
143
143
|
* :::
|
|
144
|
+
*
|
|
145
|
+
* ::: only-for angular
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
|
|
148
|
+
* import {
|
|
149
|
+
* GridSettings,
|
|
150
|
+
* HotTableModule,
|
|
151
|
+
* HotTableComponent,
|
|
152
|
+
* } from "@handsontable/angular-wrapper";
|
|
153
|
+
*
|
|
154
|
+
* `@Component`({
|
|
155
|
+
* selector: "app-example",
|
|
156
|
+
* standalone: true,
|
|
157
|
+
* imports: [HotTableModule],
|
|
158
|
+
* template: ` <div class="ht-theme-main">
|
|
159
|
+
* <hot-table [settings]="gridSettings" />
|
|
160
|
+
* </div>`,
|
|
161
|
+
* })
|
|
162
|
+
* export class ExampleComponent implements AfterViewInit {
|
|
163
|
+
* `@ViewChild`(HotTableComponent, { static: false })
|
|
164
|
+
* readonly hotTable!: HotTableComponent;
|
|
165
|
+
*
|
|
166
|
+
* readonly gridSettings = <GridSettings>{
|
|
167
|
+
* data: this.getData(),
|
|
168
|
+
* hiddenRows: {
|
|
169
|
+
* copyPasteEnabled: true,
|
|
170
|
+
* indicators: true,
|
|
171
|
+
* rows: [1, 2, 5],
|
|
172
|
+
* },
|
|
173
|
+
* };
|
|
174
|
+
*
|
|
175
|
+
* ngAfterViewInit(): void {
|
|
176
|
+
* // Access the `HiddenRows` plugin's instance
|
|
177
|
+
* const hot = this.hotTable.hotInstance;
|
|
178
|
+
* const hiddenRowsPlugin = hot.getPlugin("hiddenRows");
|
|
179
|
+
*
|
|
180
|
+
* // Hide a single row
|
|
181
|
+
* hiddenRowsPlugin.hideRow(1);
|
|
182
|
+
*
|
|
183
|
+
* // Hide multiple rows
|
|
184
|
+
* hiddenRowsPlugin.hideRow(1, 2, 9);
|
|
185
|
+
*
|
|
186
|
+
* // Hide multiple rows as an array
|
|
187
|
+
* hiddenRowsPlugin.hideRows([1, 2, 9]);
|
|
188
|
+
*
|
|
189
|
+
* // Unhide a single row
|
|
190
|
+
* hiddenRowsPlugin.showRow(1);
|
|
191
|
+
*
|
|
192
|
+
* // Unhide multiple rows
|
|
193
|
+
* hiddenRowsPlugin.showRow(1, 2, 9);
|
|
194
|
+
*
|
|
195
|
+
* // Unhide multiple rows as an array
|
|
196
|
+
* hiddenRowsPlugin.showRows([1, 2, 9]);
|
|
197
|
+
*
|
|
198
|
+
* // To see your changes, re-render your Handsontable instance
|
|
199
|
+
* hot.render();
|
|
200
|
+
* }
|
|
201
|
+
*
|
|
202
|
+
* private getData(): any[] {
|
|
203
|
+
* // Get some data
|
|
204
|
+
* }
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
* :::
|
|
144
208
|
*/
|
|
145
209
|
var _hiddenRowsMap = /*#__PURE__*/new WeakMap();
|
|
146
210
|
var _HiddenRows_brand = /*#__PURE__*/new WeakSet();
|
|
@@ -231,8 +295,8 @@ class HiddenRows extends _base.BasePlugin {
|
|
|
231
295
|
* Disables the plugin functionality for this Handsontable instance.
|
|
232
296
|
*/
|
|
233
297
|
disablePlugin() {
|
|
234
|
-
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
235
298
|
super.disablePlugin();
|
|
299
|
+
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
236
300
|
this.resetCellsMeta();
|
|
237
301
|
}
|
|
238
302
|
|