/
metaSchema.js
4872 lines (4732 loc) · 218 KB
/
metaSchema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { isEmpty } from '../../helpers/mixed';
import { isObjectEqual } from '../../helpers/object';
/* eslint-disable jsdoc/require-description-complete-sentence */
/**
* @alias Options
* @class Options
* @description
*
* [Configuration options](@/guides/getting-started/configuration-options/configuration-options.md) let you heavily customize your Handsontable instance. For example, you can:
*
* - Enable and disable built-in features
* - Enable and configure additional [plugins](@/api/plugins.md)
* - Personalize Handsontable's look
* - Adjust Handsontable's behavior
* - Implement your own custom features
*
* ::: only-for javascript
*
* To apply [configuration options](@/guides/getting-started/configuration-options/configuration-options.md), pass them as
* a second argument of the [Handsontable constructor](@/guides/getting-started/installation/installation.md#initialize-handsontable),
* using the [object literal notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer):
*
* Read more on the [Configuration options](@/guides/getting-started/configuration-options/configuration-options.md) page.
*
* ```js
* const container = document.getElementById('example');
*
* const hot = new Handsontable(container, {
* // configuration options, in the object literal notation
* licenseKey: 'non-commercial-and-evaluation',
* data: [
* ['A1', 'B1', 'C1', 'D1', 'E1'],
* ['A2', 'B2', 'C2', 'D2', 'E2'],
* ['A3', 'B3', 'C3', 'D3', 'E3'],
* ['A4', 'B4', 'C4', 'D4', 'E4'],
* ['A5', 'B5', 'C5', 'D5', 'E5'],
* ],
* width: 400,
* height: 300,
* colHeaders: true,
* rowHeaders: true,
* customBorders: true,
* dropdownMenu: true,
* multiColumnSorting: true,
* filters: true,
* manualRowMove: true,
* });
* ```
* :::
*
* ::: only-for react
*
* To apply configuration options, pass them as individual props
* of the [`HotTable`](@/guides/getting-started/installation/installation.md#_4-use-the-hottable-component)
* or [`HotColumn`](@/guides/columns/react-hot-column/react-hot-column.md) components.
*
* Read more on the [Configuration options](@/guides/getting-started/configuration-options/configuration-options.md) page.
*
* ```jsx
* <HotTable
* // configuration options, in the object literal notation
* licenseKey='non-commercial-and-evaluation'
* data={[
* ['A1', 'B1', 'C1', 'D1', 'E1'],
* ['A2', 'B2', 'C2', 'D2', 'E2'],
* ['A3', 'B3', 'C3', 'D3', 'E3'],
* ['A4', 'B4', 'C4', 'D4', 'E4'],
* ['A5', 'B5', 'C5', 'D5', 'E5'],
* ]}
* width={400}
* height={300}
* colHeaders={true}
* rowHeaders={true}
* customBorders={true}
* dropdownMenu={true}
* multiColumnSorting={true}
* filters={true}
* manualRowMove={true}
* />
* ```
* :::
*
* Depending on your needs, you can apply [configuration options](@/api/options.md) to different elements of your grid:
* - [The entire grid](@/guides/getting-started/configuration-options/configuration-options.md#set-grid-options)
* - [Individual columns](@/guides/getting-started/configuration-options/configuration-options.md#set-column-options)
* - [Individual rows](@/guides/getting-started/configuration-options/configuration-options.md#set-row-options)
* - [Individual cells](@/guides/getting-started/configuration-options/configuration-options.md#set-cell-options)
* - [Individual grid elements, based on any logic you implement](@/guides/getting-started/configuration-options/configuration-options.md#implementing-custom-logic)
*
* Read more:
* - [Configuration options](@/guides/getting-started/configuration-options/configuration-options.md)
*/
export default () => {
return {
/* eslint-disable jsdoc/require-description-complete-sentence */
/**
* Information on which of the meta properties were added automatically.
* For example: setting the `renderer` property directly won't extend the `_automaticallyAssignedMetaProps`
* entry, but setting a `type` will modify it to `Set(3) {'renderer', 'editor', 'validator', ...}`.
*
* @private
* @type {Set}
* @default undefined
*/
_automaticallyAssignedMetaProps: undefined,
/**
* The `activeHeaderClassName` option lets you add a CSS class name
* to every currently-active, currently-selected header (when a whole column or row is selected).
*
* Read more:
* - [`currentRowClassName`](#currentRowClassName)
* - [`currentColClassName`](#currentColClassName)
* - [`currentHeaderClassName`](#currentHeaderClassName)
* - [`invalidCellClassName`](#invalidCellClassName)
* - [`readOnlyCellClassName`](#readOnlyCellClassName)
* - [`commentedCellClassName`](#commentedCellClassName)
* - [`noWordWrapClassName`](#noWordWrapClassName)
* - [`TableClassName`](#TableClassName)
* - [`className`](#className)
*
* @memberof Options#
* @type {string}
* @since 0.38.2
* @default 'ht__active_highlight'
* @category Core
*
* @example
* ```js
* // add an `ht__active_highlight` CSS class name
* // to every currently-active, currently-selected header
* activeHeaderClassName: 'ht__active_highlight',
* ```
*/
activeHeaderClassName: 'ht__active_highlight',
/**
* The `allowEmpty` option determines whether Handsontable accepts the following values:
* - `null`
* - `undefined`
* - `''`
*
* You can set the `allowEmpty` option to one of the following:
*
* | Setting | Description |
* | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
* | `true` (default) | - Accept `null`, `undefined` and `''` values<br>- Mark cells that contain `null`, `undefined` or `''` values as `valid` |
* | `false` | - Don't accept `null`, `undefined` and `''` values<br>- Mark cells that contain `null`, `undefined` or `''` values with as `invalid` |
*
* ::: tip
* To use the [`allowEmpty`](#allowempty) option, you need to set the [`validator`](#validator) option (or the [`type`](#type) option).
* :::
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // allow empty values in each cell of the entire grid
* allowEmpty: true,
*
* // or
* columns: [
* {
* type: 'date',
* dateFormat: 'DD/MM/YYYY',
* // allow empty values in each cell of the 'date' column
* allowEmpty: true
* }
* ],
* ```
*/
allowEmpty: true,
/**
* The `allowHtml` option configures whether [`autocomplete`](@/guides/cell-types/autocomplete-cell-type/autocomplete-cell-type.md)
* and [`dropdown`](@/guides/cell-types/dropdown-cell-type/dropdown-cell-type.md) cells' [`source`](#source) data
* is treated as HTML.
*
* You can set the `allowHtml` option to one of the following:
*
* | Setting | Description |
* | ----------------- | --------------------------------------------------- |
* | `false` (default) | The [`source`](#source) data is not treated as HTML |
* | `true` | The [`source`](#source) data is treated as HTML |
*
* __Warning:__ Setting the `allowHtml` option to `true` can cause serious XSS vulnerabilities.
*
* Read more:
* - [Autocomplete cell type](@/guides/cell-types/autocomplete-cell-type/autocomplete-cell-type.md)
* - [Dropdown cell type](@/guides/cell-types/dropdown-cell-type/dropdown-cell-type.md)
* - [`source`](#source)
*
* @memberof Options#
* @type {boolean}
* @default false
* @category Core
*
* @example
* ```js
* columns: [
* {
* // set the `type` of each cell in this column to `autocomplete`
* type: 'autocomplete',
* // set options available in every `autocomplete` cell of this column
* source: ['<strong>foo</strong>', '<strong>bar</strong>']
* // use HTML in the `source` list
* allowHtml: true,
* },
* ],
* ```
*/
allowHtml: false,
/**
* If set to `true`, the `allowInsertColumn` option adds the following menu items to the [context menu](@/guides/accessories-and-menus/context-menu/context-menu.md):
* - **Insert column left**
* - **Insert column right**
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // hide the 'Insert column left' and 'Insert column right' menu items from the context menu
* allowInsertColumn: false,
* ```
*/
allowInsertColumn: true,
/**
* If set to `true`, the `allowInsertRow` option adds the following menu items to the [context menu](@/guides/accessories-and-menus/context-menu/context-menu.md):
* - **Insert row above**
* - **Insert row below**
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // hide the 'Insert row above' and 'Insert row below' menu items from the context menu
* allowInsertRow: false,
* ```
*/
allowInsertRow: true,
/**
* The `allowInvalid` option determines whether Handsontable accepts values
* that were marked as `invalid` by the [cell validator](@/guides/cell-functions/cell-validator/cell-validator.md).
*
* You can set the `allowInvalid` option to one of the following:
*
* | Setting | Description |
* | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
* | `true` (default) | - Accept `invalid` values<br>- Allow the user to close the [cell editor](@/guides/cell-functions/cell-editor/cell-editor.md) with `invalid` values<br>- Save `invalid` values into the data source |
* | `false` | - Don't accept `invalid` values<br>- Don't allow the user to close the [cell editor](@/guides/cell-functions/cell-editor/cell-editor.md) with `invalid` values<br>- Don't save `invalid` values into the data source |
*
* Setting the `allowInvalid` option to `false` can be useful when used with the [Autocomplete strict mode](@/guides/cell-types/autocomplete-cell-type/autocomplete-cell-type.md#autocomplete-strict-mode).
*
* Read more:
* - [Cell validator](@/guides/cell-functions/cell-validator/cell-validator.md)
* - [Cell editor](@/guides/cell-functions/cell-editor/cell-editor.md)
* - [Autocomplete strict mode](@/guides/cell-types/autocomplete-cell-type/autocomplete-cell-type.md#autocomplete-strict-mode)
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // don't accept `invalid` values
* // don't allow the user to close the cell editor
* // don't save `invalid` values into the data source
* allowInvalid: false,
* ```
*/
allowInvalid: true,
/**
* If set to `true`, the `allowRemoveColumn` option adds the following menu items to the [context menu](@/guides/accessories-and-menus/context-menu/context-menu.md):
* - **Remove column**
*
* Read more:
* - [Context menu](@/guides/accessories-and-menus/context-menu/context-menu.md)
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // hide the 'Remove column' menu item from the context menu
* allowRemoveColumn: false,
* ```
*/
allowRemoveColumn: true,
/**
* If set to `true`, the `allowRemoveRow` option adds the following menu items to the [context menu](@/guides/accessories-and-menus/context-menu/context-menu.md):
* - **Remove row**
*
* Read more:
* - [Context menu](@/guides/accessories-and-menus/context-menu/context-menu.md)
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
*
* @example
* ```js
* // hide the 'Remove row' menu item from the context menu
* allowRemoveRow: false,
* ```
*/
allowRemoveRow: true,
/**
* If set to `true`, the accessibility-related ARIA tags will be added to the table. If set to `false`, they
* will be omitted.
* Defaults to `true`.
*
* @memberof Options#
* @type {boolean}
* @default true
* @category Core
* @since 14.0.0
*/
ariaTags: true,
/**
* The `autoColumnSize` option configures the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin.
*
* You can set the `autoColumnSize` option to one of the following:
*
* | Setting | Description |
* | --------- | -------------------------------------------------------------------------------------------- |
* | `false` | Disable the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin |
* | `true` | Enable the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin with the default configuration |
* | An object | Enable the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin and modify the plugin options |
*
* If you set the `autoColumnSize` option to an object, you can set the following [`AutoColumnSize`](@/api/autoColumnSize.md) plugin options:
*
* | Property | Possible values | Description |
* | ----------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------- |
* | `syncLimit` | A number \| A percentage string | The number/percentage of columns to keep in sync<br>(default: `50`) |
* | `useHeaders` | `true` \| `false` | When calculating column widths:<br>`true`: use column headers<br>`false`: don't use column headers |
* | `samplingRatio` | A number | The number of samples of the same length to be used in column width calculations |
* | `allowSampleDuplicates` | `true` \| `false` | When calculating column widths:<br>`true`: Allow duplicate samples<br>`false`: Don't allow duplicate samples |
*
* By default, the `autoColumnSize` option is set to `undefined`,
* but the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin acts as enabled.
* To disable the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin completely,
* set the `autoColumnSize` option to `false`.
*
* Using the [`colWidths`](#colWidths) option forcibly disables the [`AutoColumnSize`](@/api/autoColumnSize.md) plugin.
*
* Read more:
* - [Plugins: `AutoColumnSize`](@/api/autoColumnSize.md)
*
* @memberof Options#
* @type {object|boolean}
* @default undefined
* @category AutoColumnSize
*
* @example
* ```js
* autoColumnSize: {
* // keep 40% of columns in sync (the rest of columns: async)
* syncLimit: '40%',
* // when calculating column widths, use column headers
* useHeaders: true,
* // when calculating column widths, use 10 samples of the same length
* samplingRatio: 10,
* // when calculating column widths, allow duplicate samples
* allowSampleDuplicates: true
* },
* ```
*/
autoColumnSize: undefined,
/**
* The `autoRowSize` option configures the [`AutoRowSize`](@/api/autoRowSize.md) plugin.
*
* You can set the `autoRowSize` option to one of the following:
*
* | Setting | Description |
* | --------- | -------------------------------------------------------------------------------------- |
* | `false` | Disable the [`AutoRowSize`](@/api/autoRowSize.md) plugin |
* | `true` | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin with the default configuration |
* | An object | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin and modify the plugin options |
*
* To give Handsontable's [scrollbar](https://handsontable.com/docs/8.0.0/demo-scrolling.html)
* a proper size, set the `autoRowSize` option to `true`.
*
* If you set the `autoRowSize` option to an object, you can set the following [`AutoRowSize`](@/api/autoRowSize.md) plugin options:
*
* | Property | Possible values | Description |
* | ----------- | ------------------------------- | ----------------------------------------------------------------- |
* | `syncLimit` | A number \| A percentage string | The number/percentage of rows to keep in sync<br>(default: `500`) |
*
* Using the [`rowHeights`](#rowHeights) option forcibly disables the [`AutoRowSize`](@/api/autoRowSize.md) plugin.
*
* Read more:
* - [Plugins: `AutoRowSize`](@/api/autoRowSize.md)
*
* @memberof Options#
* @type {object|boolean}
* @default undefined
* @category AutoRowSize
*
* @example
* ```js
* autoRowSize: {
* // keep 40% of rows in sync (the rest of rows: async)
* syncLimit: '40%'
* },
* ```
*/
autoRowSize: undefined,
/**
* | Setting | Description |
* | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
* | `false` (default) | When you select a bottom-most cell, pressing <kbd>**↓**</kbd> doesn't do anything.<br><br>When you select a top-most cell, pressing <kbd>**↑**</kbd> doesn't do anything. |
* | `true` | When you select a bottom-most cell, pressing <kbd>**↓**</kbd> takes you to the top-most cell of the next column.<br><br>When you select a top-most cell, pressing <kbd>**↑**</kbd> takes you to the bottom-most cell of the previous column. |
*
* @memberof Options#
* @type {boolean}
* @default false
* @category Core
*
* @example
* ```js
* // when you select a bottom-most cell, pressing ⬇ doesn't do anything
* // when you select a top-most cell, pressing ⬆ doesn't do anything
* autoWrapCol: false, // default setting
*
* // when you select a bottom-most cell, pressing ⬇ takes you to the top-most cell of the next column
* // when you select a top-most cell, pressing ⬆ takes you to the bottom-most cell of the previous column
* autoWrapCol: true,
* ```
*/
autoWrapCol: false,
/**
* | Setting | Description |
* | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
* | `false` (default) | When you select the first cell of a row, pressing <kbd>**←**</kbd>* (or <kbd>**Shift**</kbd>+<kbd>**Tab**</kbd>\*\*) doesn't do anything.<br><br>When you select the last cell of a row, pressing <kbd>**→**</kbd>* (or <kbd>**Tab**</kbd>**) doesn't do anything. |
* | `true` | When you select the first cell of a row, pressing <kbd>**←**</kbd>* (or <kbd>**Shift**</kbd>+<kbd>**Tab**</kbd>\*\*) takes you to the last cell of the row above.<br><br>When you select the last cell of a row, pressing <kbd>**→**</kbd>* (or <kbd>**Tab**</kbd>**) takes you to the first cell of the row below. |
*
* \* The exact key depends on your [`layoutDirection`](#layoutdirection) configuration.<br>
* \*\* Unless [`tabNavigation`](#tabnavigation) is set to `false`.
*
* @memberof Options#
* @type {boolean}
* @default false
* @category Core
*
* @example
* ```js
* // when you select the first cell of a row, pressing ⬅ (or Shift+Tab) doesn't do anything
* // when you select the last cell of a row, pressing ➡ (or Tab) doesn't do anything
* autoWrapRow: false, // default setting
*
* // when you select the first cell of a row, pressing ⬅ (or Shift+Tab) takes you to the last cell of the row above
* // when you select the last cell of a row, pressing ➡ (or Tab) takes you to the first cell of the row below
* autoWrapRow: true,
* ```
*/
autoWrapRow: false,
/**
* @description
* The `bindRowsWithHeaders` option configures the [`BindRowsWithHeaders`](@/api/bindRowsWithHeaders.md) plugin.
*
* You can set the `bindRowsWithHeaders` option to one of the following:
*
* | Setting | Description |
* | ------- | ---------------------------------------------------------------------------- |
* | `false` | Disable the the [`BindRowsWithHeaders`](@/api/bindRowsWithHeaders.md) plugin |
* | `true` | Enable the the [`BindRowsWithHeaders`](@/api/bindRowsWithHeaders.md) plugin |
*
* Read more:
* - [Plugins: `BindRowsWithHeaders`](@/api/bindRowsWithHeaders.md)
*
* @memberof Options#
* @type {boolean|string}
* @default undefined
* @category BindRowsWithHeaders
*
* @example
* ```js
* // enable the `BindRowsWithHeaders` plugin
* bindRowsWithHeaders: true
* ```
*/
bindRowsWithHeaders: undefined,
/**
* The `cell` option lets you apply [configuration options](@/guides/getting-started/configuration-options/configuration-options.md) to individual cells.
*
* The `cell` option overwrites the [top-level grid options](@/guides/getting-started/configuration-options/configuration-options.md#set-grid-options),
* and the [`columns`](#columns) options.
*
* Read more:
* - [Configuration options: Setting cell options](@/guides/getting-started/configuration-options/configuration-options.md#set-cell-options)
* - [`columns`](#columns)
*
* @memberof Options#
* @type {Array[]}
* @default []
* @category Core
*
* @example
* ```js
* // set the `cell` option to an array of objects
* cell: [
* // make the cell with coordinates (0, 0) read-only
* {
* row: 0,
* col: 0,
* readOnly: true
* }
* ],
* ```
*/
cell: [],
/**
* @description
* The `cells` option lets you apply any other [configuration options](@/guides/getting-started/configuration-options/configuration-options.md) to
* individual grid elements (columns, rows, cells), based on any logic you implement.
*
* The `cells` option overwrites all other options (including options set by [`columns`](#columns) and [`cell`](#cell)).
* It takes the following parameters:
*
* | Parameter | Required | Type | Description |
* | --------- | -------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
* | `row` | Yes | Number | A physical row index |
* | `column` | Yes | Number | A physical column index |
* | `prop` | No | String \| Number | If [`data`](#data) is set to an [array of arrays](@/guides/getting-started/binding-to-data/binding-to-data.md#array-of-arrays), `prop` is the same number as `column`.<br><br>If [`data`](#data) is set to an [array of objects](@/guides/getting-started/binding-to-data/binding-to-data.md#array-of-objects), `prop` is a property name for the column's data object. |
*
* Read more:
* - [Configuration options: Implementing custom logic](@/guides/getting-started/configuration-options/configuration-options.md#implement-custom-logic)
* - [Configuration options: Setting row options](@/guides/getting-started/configuration-options/configuration-options.md#set-row-options)
* - [`columns`](#columns)
* - [`cell`](#cell)
*
* @memberof Options#
* @type {Function}
* @default undefined
* @category Core
*
* @example
* ```js
* // set the `cells` option to your custom function
* cells(row, column, prop) {
* const cellProperties = { readOnly: false };
* const visualRowIndex = this.instance.toVisualRow(row);
* const visualColIndex = this.instance.toVisualColumn(column);
*
* if (visualRowIndex === 0 && visualColIndex === 0) {
* cellProperties.readOnly = true;
* }
*
* return cellProperties;
* },
* ```
*/
cells: undefined,
/**
* The `checkedTemplate` option lets you configure what value
* a checked [`checkbox`](@/guides/cell-types/checkbox-cell-type/checkbox-cell-type.md) cell has.
*
* You can set the `checkedTemplate` option to one of the following:
*
* | Setting | Description |
* | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
* | `true` (default) | If a [`checkbox`](@/guides/cell-types/checkbox-cell-type/checkbox-cell-type.md) cell is checked,<br>the [`getDataAtCell`](@/api/core.md#getDataAtCell) method for this cell returns `true` |
* | A string | If a [`checkbox`](@/guides/cell-types/checkbox-cell-type/checkbox-cell-type.md) cell is checked,<br>the [`getDataAtCell`](@/api/core.md#getDataAtCell) method for this cell returns a string of your choice |
*
* Read more:
* - [Checkbox cell type: Checkbox template](@/guides/cell-types/checkbox-cell-type/checkbox-cell-type.md#checkbox-template)
* - [`getDataAtCell()`](@/api/core.md#getDataAtCell)
* - [`uncheckedTemplate`](#uncheckedTemplate)
*
* @memberof Options#
* @type {boolean|string|number}
* @default true
* @category Core
*
* @example
* ```js
* columns: [
* {
* // set the `type` of each cell in this column to `checkbox`
* // when checked, the cell's value is `true`
* // when unchecked, the cell's value is `false`
* type: 'checkbox',
* },
* {
* // set the `type` of each cell in this column to `checkbox`
* type: 'checkbox',
* // when checked, the cell's value is `'Yes'`
* checkedTemplate: 'Yes',
* // when unchecked, the cell's value is `'No'`
* uncheckedTemplate: 'No'
* }
* ],
* ```
*/
checkedTemplate: undefined,
/**
* The `className` option lets you add CSS class names to every currently-selected element.
*
* You can set the `className` option to one of the following:
*
* | Setting | Description |
* | ------------------- | ---------------------------------------------------------------- |
* | A string | Add a single CSS class name to every currently-selected element |
* | An array of strings | Add multiple CSS class names to every currently-selected element |
*
* ::: tip
* Don't change the `className` metadata of the [column summary](@/guides/columns/column-summary/column-summary.md) row.
* To style the summary row, use the class name assigned automatically by the [`ColumnSummary`](@/api/columnSummary.md) plugin: `columnSummaryResult`.
* :::
*
* To apply different CSS class names on different levels, use Handsontable's [cascading configuration](@/guides/getting-started/configuration-options/configuration-options.md#cascading-configuration).
*
* Read more:
* - [Configuration options: Cascading configuration](@/guides/getting-started/configuration-options/configuration-options.md#cascading-configuration)
* - [`currentRowClassName`](#currentRowClassName)
* - [`currentColClassName`](#currentColClassName)
* - [`currentHeaderClassName`](#currentHeaderClassName)
* - [`activeHeaderClassName`](#activeHeaderClassName)
* - [`invalidCellClassName`](#invalidCellClassName)
* - [`placeholderCellClassName`](#placeholderCellClassName)
* - [`commentedCellClassName`](#commentedCellClassName)
* - [`noWordWrapClassName`](#noWordWrapClassName)
* - [`readOnlyCellClassName`](#readOnlyCellClassName)
* - [`TableClassName`](#TableClassName)
*
* @memberof Options#
* @type {string|string[]}
* @default undefined
* @category Core
*
* @example
* ```js
* // add a `your-class-name` CSS class name
* // to every currently-selected element
* className: 'your-class-name',
*
* // add `first-class-name` and `second-class-name` CSS class names
* // to every currently-selected element
* className: ['first-class-name', 'second-class-name'],
* ```
*/
className: undefined,
/**
* The `colHeaders` option configures your grid's column headers.
*
* You can set the `colHeaders` option to one of the following:
*
* | Setting | Description |
* | -------- | -------------------------------------------------------------------- |
* | `true` | Enable the default column headers ('A', 'B', 'C', ...) |
* | `false` | Disable column headers |
* | An array | Define your own column headers (e.g. `['One', 'Two', 'Three', ...]`) |
* | A function | Define your own column headers, using a function |
*
* Read more:
* - [Column header](@/guides/columns/column-header/column-header.md)
*
* @memberof Options#
* @type {boolean|string[]|Function}
* @default null
* @category Core
*
* @example
* ```js
* // enable the default column headers
* colHeaders: true,
*
* // set your own column headers
* colHeaders: ['One', 'Two', 'Three'],
*
* // set your own column headers, using a function
* colHeaders: function(visualColumnIndex) {
* return `${visualColumnIndex} + : AB`;
* },
* ```
*/
colHeaders: null,
/**
* @description
* The `collapsibleColumns` option configures the [`CollapsibleColumns`](@/api/collapsibleColumns.md) plugin.
*
* You can set the `collapsibleColumns` option to one of the following:
*
* | Setting | Description |
* | -------------------- | ------------------------------------------------------------------------------------------------- |
* | `false` | Disable the [`CollapsibleColumns`](@/api/collapsibleColumns.md) plugin |
* | `true` | Enable the [`CollapsibleColumns`](@/api/collapsibleColumns.md) plugin |
* | An array of objects | Enable the [`CollapsibleColumns`](@/api/collapsibleColumns.md) plugin for selected column headers |
*
* Read more:
* - [Plugins: `CollapsibleColumns`](@/api/collapsibleColumns.md)
*
* @memberof Options#
* @type {boolean|object[]}
* @default undefined
* @category CollapsibleColumns
*
* @example
* ```js
* // enable column collapsing for all headers
* collapsibleColumns: true,
*
* // enable column collapsing for selected headers
* collapsibleColumns: [
* {row: -4, col: 1, collapsible: true},
* {row: -3, col: 5, collapsible: true}
* ],
* ```
*/
collapsibleColumns: undefined,
/**
* @description
* The `columnHeaderHeight` option configures the height of column headers.
*
* You can set the `columnHeaderHeight` option to one of the following:
*
* | Setting | Description |
* | -------- | --------------------------------------------------- |
* | A number | Set the same height for every column header |
* | An array | Set different heights for individual column headers |
*
* @memberof Options#
* @type {number|number[]}
* @default undefined
* @category Core
*
* @example
* ```js
* // set the same height for every column header
* columnHeaderHeight: 25,
*
* // set different heights for individual column headers
* columnHeaderHeight: [25, 30, 55],
* ```
*/
columnHeaderHeight: undefined,
/**
* @description
* The `columns` option lets you apply any other [configuration options](@/guides/getting-started/configuration-options/configuration-options.md) to individual columns (or ranges of columns).
*
* You can set the `columns` option to one of the following:
* - An array of objects (each object represents one column)
* - A function that returns an array of objects
*
* The `columns` option overwrites the [top-level grid options](@/guides/getting-started/configuration-options/configuration-options.md#set-grid-options).
*
* When you use `columns`, the [`startCols`](#startCols), [`minCols`](#minCols), and [`maxCols`](#maxCols) options are ignored.
*
* Read more:
* - [Configuration options: Setting column options](@/guides/getting-started/configuration-options/configuration-options.md#set-column-options)
* - [`startCols`](#startCols)
* - [`minCols`](#minCols)
* - [`maxCols`](#maxCols)
* - [`data`](#data)
*
* @memberof Options#
* @type {object[]|Function}
* @default undefined
* @category Core
*
* @example
* ```js
* // set the `columns` option to an array of objects
* // each object represents one column
* columns: [
* {
* // column options for the first (by physical index) column
* type: 'numeric',
* numericFormat: {
* pattern: '0,0.00 $'
* }
* },
* {
* // column options for the second (by physical index) column
* type: 'text',
* readOnly: true
* }
* ],
*
* // or set the `columns` option to a function, based on physical indexes
* columns(index) {
* return {
* type: index > 0 ? 'numeric' : 'text',
* readOnly: index < 1
* }
* }
* ```
*/
columns: undefined,
/**
* @description
* The `columnSorting` option configures the [`ColumnSorting`](@/api/columnSorting.md) plugin.
*
* You can set the `columnSorting` option to one of the following:
*
* | Setting | Description |
* | ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
* | `true` | Enable the [`ColumnSorting`](@/api/columnSorting.md) plugin with the default configuration |
* | `false` | Disable the [`ColumnSorting`](@/api/columnSorting.md) plugin |
* | An object | - Enable the [`ColumnSorting`](@/api/columnSorting.md) plugin<br>- Modify the [`ColumnSorting`](@/api/columnSorting.md) plugin options |
*
* If you set the `columnSorting` option to an object,
* you can set the following [`ColumnSorting`](@/api/columnSorting.md) plugin options:
*
* | Option | Possible settings |
* | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
* | `indicator` | `true`: Display the arrow icon in the column header, to indicate a sortable column<br>`false`: Don't display the arrow icon in the column header |
* | `headerAction` | `true`: Enable clicking on the column header to sort the column<br>`false`: Disable clicking on the column header to sort the column |
* | `sortEmptyCells` | `true`: Sort empty cells as well<br>`false`: Place empty cells at the end |
* | `compareFunctionFactory` | A [custom compare function](@/guides/rows/rows-sorting/rows-sorting.md#add-a-custom-comparator) |
*
* If you set the `columnSorting` option to an object,
* you can also sort individual columns at Handsontable's initialization.
* In the `columnSorting` object, add an object named `initialConfig`,
* with the following properties:
*
* | Option | Possible settings | Description |
* | ----------- | ------------------- | ---------------------------------------------------------------- |
* | `column` | A number | The index of the column that you want to sort at initialization |
* | `sortOrder` | `'asc'` \| `'desc'` | The sorting order:<br>`'asc'`: ascending<br>`'desc'`: descending |
*
* Read more:
* - [Rows sorting](@/guides/rows/rows-sorting/rows-sorting.md)
* - [Rows sorting: Custom compare functions](@/guides/rows/rows-sorting/rows-sorting.md#add-a-custom-comparator)
* - [`multiColumnSorting`](#multiColumnSorting)
*
* @memberof Options#
* @type {boolean|object}
* @default undefined
* @category ColumnSorting
*
* @example
* ```js
* // enable the `ColumnSorting` plugin
* columnSorting: true
*
* // enable the `ColumnSorting` plugin with custom configuration
* columnSorting: {
* // sort empty cells as well
* sortEmptyCells: true,
* // display the arrow icon in the column header
* indicator: true,
* // disable clicking on the column header to sort the column
* headerAction: false,
* // add a custom compare function
* compareFunctionFactory(sortOrder, columnMeta) {
* return function(value, nextValue) {
* // some value comparisons which will return -1, 0 or 1...
* }
* }
* }
*
* // enable the `ColumnSorting` plugin
* columnSorting: {
* // at initialization, sort column 1 in ascending order
* initialConfig: {
* column: 1,
* sortOrder: 'asc'
* },
* // at initialization, sort column 2 in descending order
* initialConfig: {
* column: 2,
* sortOrder: 'desc'
* }
* }
* ```
*/
columnSorting: undefined,
/**
* @description
* The `columnSummary` option configures the [`ColumnSummary`](@/api/columnSummary.md) plugin.
*
* You can set the `columnSummary` option to an array of objects.
* Each object configures a single column summary, using the following properties:
*
* | Property | Possible values | Description |
* | ------------------------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
* | `sourceColumn` | A number | [Column to summarize](@/guides/columns/column-summary/column-summary.md#step-2-select-cells-that-you-want-to-summarize) |
* | `ranges` | An array | [Ranges of rows to summarize](@/guides/columns/column-summary/column-summary.md#step-2-select-cells-that-you-want-to-summarize) |
* | `type` | `'sum'` \| `'min'` \| `'max'` \| `'count'` \| `'average'` \| `'custom'` | [Summary function](@/guides/columns/column-summary/column-summary.md#step-3-calculate-your-summary) |
* | `destinationRow` | A number | [Destination cell's row coordinate](@/guides/columns/column-summary/column-summary.md#step-4-provide-the-destination-cell-s-coordinates) |
* | `destinationColumn` | A number | [Destination cell's column coordinate](@/guides/columns/column-summary/column-summary.md#step-4-provide-the-destination-cell-s-coordinates) |
* | `forceNumeric` | `true` \| `false` | [Treat non-numerics as numerics](@/guides/columns/column-summary/column-summary.md#force-numeric-values) |
* | `reversedRowCoords` | `true` \| `false` | [Reverse row coordinates](@/guides/columns/column-summary/column-summary.md#step-5-make-room-for-the-destination-cell) |
* | `suppressDataTypeErrors` | `true` \| `false` | [Suppress data type errors](@/guides/columns/column-summary/column-summary.md#throw-data-type-errors) |
* | `readOnly` | `true` \| `false` | Make summary cell read-only |
* | `roundFloat` | `true` \| `false` \| A number | [Round summary result](@/guides/columns/column-summary/column-summary.md#round-a-column-summary-result) |
* | `customFunction` | A function | [Custom summary function](@/guides/columns/column-summary/column-summary.md#implement-a-custom-summary-function) |
*
* Read more:
* - [Column summary](@/guides/columns/column-summary/column-summary.md)
* - [Plugins: `ColumnSummary`](@/api/columnSummary.md)
*
* @memberof Options#
* @type {object[]|Function}
* @default undefined
* @category ColumnSummary
*
* @example
* ```js
* columnSummary: [
* {
* sourceColumn: 0,
* ranges: [
* [0, 2], [4], [6, 8]
* ],
* type: 'custom',
* destinationRow: 4,
* destinationColumn: 1,
* forceNumeric: true,
* reversedRowCoords: true,
* suppressDataTypeErrors: false,
* readOnly: true,
* roundFloat: false,
* customFunction(endpoint) {
* return 100;
* }
* }
* ],
* ```
*/
columnSummary: undefined,
/**
* The `colWidths` option sets columns' widths, in pixels.
*
* The default column width is 50px. To change it, set the `colWidths` option to one of the following:
*
* | Setting | Description | Example |
* | ----------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
* | A number | Set the same width for every column | `colWidths: 100` |
* | A string | Set the same width for every column | `colWidths: '100px'` |
* | An array | Set widths separately for each column | `colWidths: [100, 120, undefined]` |
* | A function | Set column widths dynamically,<br>on each render | `colWidths(visualColumnIndex) { return visualColumnIndex * 10; }` |
* | `undefined` | Used by the [modifyColWidth](@/api/hooks.md#modifyColWidth) hook,<br>to detect column width changes. | `colWidths: undefined` |
*
* Setting `colWidths` even for a single column disables the {@link AutoColumnSize} plugin
* for all columns. For this reason, if you use `colWidths`, we recommend you set a width for each one
* of your columns. Otherwise, every column with an undefined width defaults back to 50px,
* which may cut longer columns names.
*
* Read more:
* - [Column width](@/guides/columns/column-width/column-width.md)
* - [Hooks: `modifyColWidth`](@/api/hooks.md#modifyColWidth)
* - [`autoColumnSize`](#autoColumnSize)
*
* @memberof Options#
* @type {number|number[]|string|string[]|Array<undefined>|Function}
* @default undefined
* @category Core
*
* @example
* ```js
* // set every column's width to 100px
* colWidths: 100,
*
* // set every column's width to 100px
* colWidths: '100px',
*
* // set the first (by visual index) column's width to 100
* // set the second (by visual index) column's width to 120
* // set the third (by visual index) column's width to `undefined`, so that it defaults to 50px
* // set any other column's width to the default 50px (note that longer cell values and column names can get cut)