@mescius/wijmo.grid.filter 5.20232.939

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/index.d.ts ADDED
@@ -0,0 +1,950 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+ /**
14
+ * {@module wijmo.grid.filter}
15
+ * Extension that provides an Excel-style filtering UI for {@link FlexGrid} controls.
16
+ */
17
+ /**
18
+ *
19
+ */
20
+ export declare var ___keepComment: any;
21
+ import { Column, DataMap, FlexGrid, HitTestInfo, CellRangeEventArgs } from '@grapecity/wijmo.grid';
22
+ import { Control, Event, EventArgs } from '@grapecity/wijmo';
23
+ import * as selfModule from '@grapecity/wijmo.grid.filter';
24
+ /**
25
+ * Specifies types of column filter.
26
+ */
27
+ export declare enum FilterType {
28
+ /** No filter. */
29
+ None = 0,
30
+ /** A filter based on two conditions. */
31
+ Condition = 1,
32
+ /** A filter based on a set of values. */
33
+ Value = 2,
34
+ /** A filter that combines condition and value filters. */
35
+ Both = 3
36
+ }
37
+ /**
38
+ * Implements an Excel-style filter for {@link FlexGrid} controls.
39
+ *
40
+ * To enable filtering on a {@link FlexGrid} control, create an instance
41
+ * of the {@link FlexGridFilter} and pass the grid as a parameter to the
42
+ * constructor. For example:
43
+ *
44
+ * ```typescript
45
+ * import { FlexGrid } from '@grapecity/wijmo.grid';
46
+ * import { FlexGridFilter } from '@grapecity/wijmo.grid.filter';
47
+ * let flex = new FlexGrid('#theGrid'); // create the grid
48
+ * let filter = new FlexGridFilter(flex); // add a filter to the grid
49
+ * ```
50
+ *
51
+ * Once this is done, a filter icon is added to the grid's column headers.
52
+ * Clicking the icon shows an editor where the user can edit the filter
53
+ * conditions for that column.
54
+ *
55
+ * The {@link FlexGridFilter} class depends on the **wijmo.grid** and
56
+ * **wijmo.input** modules.
57
+ *
58
+ * The example below shows how you can use a {@link FlexGridFilter} to add
59
+ * filtering to a {@link FlexGrid} control:
60
+ *
61
+ * {@sample Grid/FilteringSearching/Excel-likeFilter/Overview/purejs Example}
62
+ */
63
+ export declare class FlexGridFilter {
64
+ static _WJC_FILTER: string;
65
+ private _g;
66
+ private _filters;
67
+ private _filterColumns;
68
+ private _divEdt;
69
+ private _edtCol;
70
+ private _edtColPrev;
71
+ private _showIcons;
72
+ private _showSort;
73
+ private _defFilterType;
74
+ private _xValueSearch;
75
+ static _skipColumn: Column;
76
+ /**
77
+ * Initializes a new instance of the {@link FlexGridFilter} class.
78
+ *
79
+ * @param grid The {@link FlexGrid} to filter.
80
+ * @param options Initialization options for the {@link FlexGridFilter}.
81
+ */
82
+ constructor(grid: FlexGrid, options?: any);
83
+ /**
84
+ * Gets a reference to the {@link FlexGrid} that owns this filter.
85
+ */
86
+ readonly grid: FlexGrid;
87
+ /**
88
+ * Gets or sets an array containing the names or bindings of the columns
89
+ * that have filters.
90
+ *
91
+ * Setting this property to null or to an empty array adds filters to
92
+ * all columns.
93
+ */
94
+ filterColumns: string[];
95
+ /**
96
+ * Gets or sets a value indicating whether the {@link FlexGridFilter} adds filter
97
+ * editing buttons to the grid's column headers.
98
+ *
99
+ * If you set this property to false, then you are responsible for providing
100
+ * a way for users to edit, clear, and apply the filters.
101
+ *
102
+ * The default value for this property is **true**.
103
+ */
104
+ showFilterIcons: boolean;
105
+ /**
106
+ * Gets or sets a value indicating whether the filter editor should include
107
+ * sort buttons.
108
+ *
109
+ * By default, the editor shows sort buttons like Excel does. But since users
110
+ * can sort columns by clicking their headers, sort buttons in the filter editor
111
+ * may not be desirable in some circumstances.
112
+ *
113
+ * The default value for this property is **true**.
114
+ */
115
+ showSortButtons: boolean;
116
+ /**
117
+ * Gets the filter for the given column.
118
+ *
119
+ * @param col The {@link Column} that the filter applies to (or column name or index).
120
+ * If the specified column does not exist, the method returns null.
121
+ * @param create Whether to create the filter if it does not exist.
122
+ */
123
+ getColumnFilter(col: Column | string | number, create?: boolean): ColumnFilter;
124
+ /**
125
+ * Gets or sets the default filter type to use.
126
+ *
127
+ * This value can be overridden in filters for specific columns.
128
+ * For example, the code below creates a filter that filters by
129
+ * conditions on all columns except the "ByValue" column:
130
+ *
131
+ * ```typescript
132
+ * import { FlexGridFilter, FilterType } from '@grapecity/wijmo.grid.filter';
133
+ * let filter = new FlexGridFilter(flex);
134
+ * filter.defaultFilterType = FilterType.Condition;
135
+ * let col = flex.getColumn('ByValue'),
136
+ * cf = filter.getColumnFilter(col);
137
+ * cf.filterType = FilterType.Value;
138
+ * ```
139
+ *
140
+ * The default value for this property is **FilterType.Both**.
141
+ */
142
+ defaultFilterType: FilterType;
143
+ /**
144
+ * Gets or sets a value that determines whether the filter should
145
+ * include only values selected by the {@link ValueFilter.filterText}
146
+ * property.
147
+ *
148
+ * The default value for this property is **true**, which matches
149
+ * Excel's behavior.
150
+ *
151
+ * Set it to false to disable this behavior, so searching only affects
152
+ * which items are displayed on the list and not which items are
153
+ * included in the filter.
154
+ */
155
+ exclusiveValueSearch: boolean;
156
+ /**
157
+ * Gets or sets the current filter definition as a JSON string.
158
+ *
159
+ * The {@link filterDefinition} includes information about all
160
+ * currently active column filters. It does not include data maps
161
+ * because data maps are not serializable.
162
+ */
163
+ filterDefinition: string;
164
+ /**
165
+ * Gets the active {@link ColumnFilterEditor}.
166
+ *
167
+ * This property allows you to customize the filter editor when
168
+ * handling the {@link filterChanging} event.
169
+ * It returns null when no filters are being edited.
170
+ */
171
+ readonly activeEditor: ColumnFilterEditor;
172
+ /**
173
+ * Shows the filter editor for the given grid column.
174
+ *
175
+ * @param col The {@link Column} that contains the filter to edit.
176
+ * @param ht A {@link wijmo.grid.HitTestInfo} object containing the range of the cell
177
+ * that triggered the filter display.
178
+ * @param ref An HTMLElement to use as a reference for positioning the editor.
179
+ */
180
+ editColumnFilter(col: any, ht?: HitTestInfo, ref?: HTMLElement): void;
181
+ _setAriaExpanded(cell: HTMLElement, value: boolean): void;
182
+ /**
183
+ * Closes the filter editor.
184
+ */
185
+ closeEditor(): void;
186
+ /**
187
+ * Applies the current column filters to the grid.
188
+ */
189
+ apply(): void;
190
+ /**
191
+ * Clears all column filters.
192
+ */
193
+ clear(): void;
194
+ /**
195
+ * Occurs after the filter is applied.
196
+ */
197
+ readonly filterApplied: Event<FlexGridFilter, EventArgs>;
198
+ /**
199
+ * Raises the {@link filterApplied} event.
200
+ */
201
+ onFilterApplied(e?: EventArgs): void;
202
+ /**
203
+ * Occurs when a column filter is about to be edited by the user.
204
+ * Use this event to customize the column filter if you want to
205
+ * override the default settings for the filter.
206
+ *
207
+ * This event fires before the filter editor is created, so the
208
+ * {@link activeEditor} property is null at this point.
209
+ * If you want to customize the editor, use the {@link filterChanging}
210
+ * event.
211
+ *
212
+ * For example, the code below customizes the list of country names
213
+ * in the value filter editor so "Italy" is always the first value:
214
+ *
215
+ * ```typescript
216
+ * new FlexGridFilter(theGrid, {
217
+ * editingFilter: (s, e) => {
218
+ * if (e.getColumn().binding == 'country') {
219
+ *
220
+ * // start with Italy
221
+ * let vals = ["Italy"];
222
+ *
223
+ * // append other unique values (except Italy)
224
+ * let valueFilter = s.getColumnFilter("country", true).valueFilter;
225
+ * valueFilter.uniqueValues = null;
226
+ * valueFilter.getUniqueValues().forEach(item => {
227
+ * if (item.text != "Italy") {
228
+ * vals.push(item.text);
229
+ * }
230
+ * });
231
+ *
232
+ * // assign custom unique value list to the valueFilter
233
+ * valueFilter.uniqueValues = vals;
234
+ * valueFilter.sortValues = false;
235
+ * }
236
+ * }
237
+ * });
238
+ * ```
239
+ */
240
+ readonly editingFilter: Event<FlexGridFilter, EventArgs>;
241
+ /**
242
+ * Raises the {@link editingFilter} event.
243
+ *
244
+ * @param e {@link CellRangeEventArgs} that contains the event data.
245
+ * @return True if the event was not canceled.
246
+ */
247
+ onEditingFilter(e: CellRangeEventArgs): boolean;
248
+ /**
249
+ * Occurs when a column filter is about to be edited by the user.
250
+ *
251
+ * Use this event to customize the filter editor if you want to
252
+ * override its default settings.
253
+ * You can use the {@link activeEditor} property to get a reference
254
+ * to the currently active filter editor.
255
+ *
256
+ * For example, the code below applies a custom sort to the list of
257
+ * country names in the value filter editor so "Italy" is always the
258
+ * first value:
259
+ *
260
+ * ```typescript
261
+ * new FlexGridFilter(theGrid, {
262
+ * filterChanging: (s, e) => {
263
+ * if (e.getColumn().binding == "country") {
264
+ * let edt = s.activeEditor,
265
+ * lbHost = edt.hostElement.querySelector('[wj-part=div-values]'),
266
+ * lb = Control.getControl(lbHost) as ListBox;
267
+ * (lb.collectionView as CollectionView).sortComparer = (a: any, b: any) => {
268
+ * if (a != b) { // sort Italy first
269
+ * if (a == 'Italy') return -1;
270
+ * if (b == 'Italy') return +1;
271
+ * }
272
+ * return null; // use default sort order
273
+ * }
274
+ * lb.collectionView.refresh();
275
+ * }
276
+ * },
277
+ * });
278
+ * ```
279
+ */
280
+ readonly filterChanging: Event<FlexGridFilter, CellRangeEventArgs>;
281
+ /**
282
+ * Raises the {@link filterChanging} event.
283
+ *
284
+ * @param e {@link CellRangeEventArgs} that contains the event data.
285
+ * @return True if the event was not canceled.
286
+ */
287
+ onFilterChanging(e: CellRangeEventArgs): boolean;
288
+ /**
289
+ * Occurs after a column filter has been edited by the user.
290
+ *
291
+ * Use the event parameters to determine the column that owns
292
+ * the filter and whether changes were applied or canceled.
293
+ */
294
+ readonly filterChanged: Event<FlexGridFilter, CellRangeEventArgs>;
295
+ /**
296
+ * Raises the {@link filterChanged} event.
297
+ */
298
+ onFilterChanged(e: CellRangeEventArgs): void;
299
+ /**
300
+ * Occurs after the exclusiveValueSearch is changed.
301
+ */
302
+ readonly exclusiveValueSearchChanged: Event<FlexGridFilter, EventArgs>;
303
+ /**
304
+ * Raises the {@link exclusiveValueSearchChanged} event.
305
+ */
306
+ onExclusiveValueSearchChanged(e?: EventArgs): void;
307
+ _asColumn(col: Column | string | number): Column;
308
+ private _filter;
309
+ private _formatItem;
310
+ _addFilterButton(col: Column, cf: ColumnFilter, cell: HTMLElement): void;
311
+ _mousedown(e: MouseEvent): void;
312
+ _click(e: MouseEvent): void;
313
+ private _toggleEditor;
314
+ _keydown(e: KeyboardEvent): void;
315
+ }
316
+ /**
317
+ * Defines a filter for a column on a {@link FlexGrid} control.
318
+ *
319
+ * This class is used by the {@link FlexGridFilter} class; you
320
+ * rarely use it directly.
321
+ */
322
+ export interface IColumnFilter {
323
+ column: Column;
324
+ isActive: boolean;
325
+ apply(value: any): boolean;
326
+ clear(): void;
327
+ }
328
+ export declare const empty: {};
329
+ /**
330
+ * Defines a condition filter for a column on a {@link FlexGrid} control.
331
+ *
332
+ * Condition filters contain two conditions that may be combined
333
+ * using an 'and' or an 'or' operator.
334
+ *
335
+ * This class is used by the {@link FlexGridFilter} class; you will
336
+ * rarely use it directly.
337
+ */
338
+ export declare class ConditionFilter implements IColumnFilter {
339
+ private _col;
340
+ private _c1;
341
+ private _c2;
342
+ private _and;
343
+ private _map;
344
+ /**
345
+ * Initializes a new instance of the {@link ConditionFilter} class.
346
+ *
347
+ * @param column The column to filter.
348
+ */
349
+ constructor(column: Column);
350
+ /**
351
+ * Gets the first condition in the filter.
352
+ */
353
+ readonly condition1: FilterCondition;
354
+ /**
355
+ * Gets the second condition in the filter.
356
+ */
357
+ readonly condition2: FilterCondition;
358
+ /**
359
+ * Gets a value that indicates whether to combine the two conditions
360
+ * with an AND or an OR operator.
361
+ *
362
+ * The default value for this property is **true**.
363
+ */
364
+ and: boolean;
365
+ /**
366
+ * Gets or sets the {@link DataMap} used to convert raw values into display
367
+ * values shown when editing this filter.
368
+ */
369
+ dataMap: DataMap;
370
+ /**
371
+ * Gets the {@link Column} to filter.
372
+ */
373
+ readonly column: Column;
374
+ /**
375
+ * Gets a value that indicates whether the filter is active.
376
+ *
377
+ * The filter is active if at least one of the two conditions
378
+ * has its operator and value set to a valid combination.
379
+ */
380
+ readonly isActive: boolean;
381
+ /**
382
+ * Returns a value indicating whether a value passes this filter.
383
+ *
384
+ * @param value The value to test.
385
+ */
386
+ apply(value: any): boolean;
387
+ /**
388
+ * Clears the filter.
389
+ */
390
+ clear(): void;
391
+ _hasDatePart(): boolean;
392
+ _hasTimePart(): boolean;
393
+ /**
394
+ * Returns true if this object supports a given interface.
395
+ *
396
+ * @param interfaceName Name of the interface to look for.
397
+ */
398
+ implementsInterface(interfaceName: string): boolean;
399
+ }
400
+ /**
401
+ * The editor used to inspect and modify {@link ConditionFilter} objects.
402
+ *
403
+ * This class is used by the {@link FlexGridFilter} class; you
404
+ * rarely use it directly.
405
+ */
406
+ export declare class ConditionFilterEditor extends Control {
407
+ private _filter;
408
+ private _cmb1;
409
+ private _val1;
410
+ private _cmb2;
411
+ private _val2;
412
+ private _canApply;
413
+ private _divHdr;
414
+ private _divCmb1;
415
+ private _divVal1;
416
+ private _divCmb2;
417
+ private _divVal2;
418
+ private _spAnd;
419
+ private _spOr;
420
+ private _btnAnd;
421
+ private _btnOr;
422
+ /**
423
+ * Gets or sets the template used to instantiate {@link ConditionFilterEditor} controls.
424
+ */
425
+ static controlTemplate: string;
426
+ /**
427
+ * Initializes a new instance of the {@link ConditionFilterEditor} class.
428
+ *
429
+ * @param element The DOM element that hosts the control, or a selector
430
+ * for the host element (e.g. '#theCtrl').
431
+ * @param filter The {@link ConditionFilter} to edit.
432
+ */
433
+ constructor(element: any, filter: ConditionFilter);
434
+ /**
435
+ * Gets a reference to the {@link ConditionFilter} being edited.
436
+ */
437
+ readonly filter: ConditionFilter;
438
+ /**
439
+ * Gets or sets a value that indicates whether the current edits
440
+ * can be applied to make the filter active.
441
+ */
442
+ canApply: boolean;
443
+ /**
444
+ * Updates editor with current filter settings.
445
+ */
446
+ updateEditor(): void;
447
+ /**
448
+ * Clears the editor without applying changes to the filter.
449
+ */
450
+ clearEditor(): void;
451
+ /**
452
+ * Gets a value that determines whether the editor has been cleared.
453
+ */
454
+ readonly isEditorClear: boolean;
455
+ /**
456
+ * Updates filter to reflect the current editor values.
457
+ */
458
+ updateFilter(): void;
459
+ /**
460
+ * Occurs when the value of the {@linj canApply} property changes.
461
+ */
462
+ readonly canApplyChanged: Event<ConditionFilterEditor, EventArgs>;
463
+ /**
464
+ * Raises the {@link canApplyChanged} event.
465
+ */
466
+ onCanApplyChanged(e?: EventArgs): void;
467
+ private _getComboValue;
468
+ private _createOperatorCombo;
469
+ private _createValueInput;
470
+ private _btnAndOrChanged;
471
+ private _checkRadio;
472
+ private _keydown;
473
+ }
474
+ /**
475
+ * Defines a filter condition.
476
+ *
477
+ * This class is used by the {@link FlexGridFilter} class;
478
+ * you will rarely have to use it directly.
479
+ */
480
+ export declare class FilterCondition {
481
+ private _op;
482
+ private _val;
483
+ private _strVal;
484
+ private _filter;
485
+ static _refDateTime: Date;
486
+ /**
487
+ * Initializes a new instance of the {@link FilterCondition} class.
488
+ *
489
+ * @param filter The {@link ConditionFilter} that owns this {@link FilterCondition}.
490
+ */
491
+ constructor(filter?: ConditionFilter);
492
+ /**
493
+ * Gets or sets the operator used by this {@link FilterCondition}.
494
+ */
495
+ operator: Operator;
496
+ /**
497
+ * Gets or sets the value used by this {@link FilterCondition}.
498
+ */
499
+ value: any;
500
+ /**
501
+ * Gets a value that indicates whether the condition is active.
502
+ */
503
+ readonly isActive: boolean;
504
+ /**
505
+ * Clears the condition.
506
+ */
507
+ clear(): void;
508
+ /**
509
+ * Returns a value that determines whether the given value passes this
510
+ * {@link FilterCondition}.
511
+ *
512
+ * @param value The value to test.
513
+ * @param dateOnly Whether to disregard the time part of **Date** values.
514
+ * @param timeOnly Whether to disregard the date part of **Date** values.
515
+ */
516
+ apply(value: any, dateOnly?: boolean, timeOnly?: boolean): boolean;
517
+ _getCaseString(value: string): string;
518
+ }
519
+ /**
520
+ * Specifies filter condition operators.
521
+ */
522
+ export declare enum Operator {
523
+ /** Equals. */
524
+ EQ = 0,
525
+ /** Does not equal. */
526
+ NE = 1,
527
+ /** Greater than. */
528
+ GT = 2,
529
+ /** Greater than or equal to. */
530
+ GE = 3,
531
+ /** Less than. */
532
+ LT = 4,
533
+ /** Less than or equal to. */
534
+ LE = 5,
535
+ /** Begins with. */
536
+ BW = 6,
537
+ /** Ends with. */
538
+ EW = 7,
539
+ /** Contains. */
540
+ CT = 8,
541
+ /** Does not contain. */
542
+ NC = 9
543
+ }
544
+ /**
545
+ * Defines a value filter for a column on a {@link FlexGrid} control.
546
+ *
547
+ * Value filters contain an explicit list of values that should be
548
+ * displayed by the grid.
549
+ */
550
+ export declare class ValueFilter implements IColumnFilter {
551
+ private _col;
552
+ private _values;
553
+ private _filterText;
554
+ private _xValueSearch;
555
+ private _maxValues;
556
+ private _uniqueValues;
557
+ private _sortValues;
558
+ private _map;
559
+ /**
560
+ * Initializes a new instance of the {@link ValueFilter} class.
561
+ *
562
+ * @param column The column to filter.
563
+ */
564
+ constructor(column: Column);
565
+ /**
566
+ * Gets or sets an object with the selected (checked) values on the
567
+ * value list.
568
+ *
569
+ * If the filter is not active, this property is set to null and all
570
+ * values present in the data source are shown on the list.
571
+ *
572
+ * If the filter is active (the user selected some values from the list
573
+ * but not all), the {@link showValues} property is set to an object
574
+ * whose property names are the display values of the selected values.
575
+ *
576
+ * For example, if the value list contains country names and the user
577
+ * selected "US" and "Japan", the {@link showValues} property returns:
578
+ *
579
+ * ```javascript
580
+ * { Japan: true, US: true }
581
+ * ```
582
+ */
583
+ showValues: any;
584
+ /**
585
+ * Gets or sets a string used to filter the list of display values.
586
+ */
587
+ filterText: string;
588
+ /**
589
+ * Gets or sets a value that determines whether the filter should
590
+ * include only values selected by the {@link filterText} property.
591
+ *
592
+ * The default value for this property is **true**, which matches
593
+ * Excel's behavior.
594
+ *
595
+ * Set it to **false** to disable this behavior, so searching only
596
+ * affects which items are displayed on the list and not which items
597
+ * are included in the filter.
598
+ */
599
+ exclusiveValueSearch: boolean;
600
+ /**
601
+ * Gets or sets the maximum number of elements on the list of display values.
602
+ *
603
+ * Adding too many items to the list makes searching difficult and hurts
604
+ * performance. This property limits the number of items displayed at any time,
605
+ * but users can still use the search box to filter the items they are
606
+ * interested in.
607
+ *
608
+ * The default value for this property is **250**.
609
+ *
610
+ * This code changes the value to 1,000,000, effectively listing all unique
611
+ * values for the field:
612
+ *
613
+ * ```typescript
614
+ * import { FlexGridFilter} from '@grapecity/wijmo.grid.filter';
615
+ *
616
+ * // change the maxItems property for the 'id' column:
617
+ * let f = new FlexGridFilter(theGrid);
618
+ * f.getColumnFilter('id').valueFilter.maxValues = 1000000;
619
+ * ```
620
+ */
621
+ maxValues: number;
622
+ /**
623
+ * Gets or sets an array containing the unique values to be displayed on the list.
624
+ *
625
+ * If this property is set to null, the list will be filled based on the grid data.
626
+ *
627
+ * Explicitly assigning the list of unique values is more efficient than building
628
+ * the list from the data, and is required for value filters to work properly when
629
+ * the data is filtered on the server (because in this case some values might not
630
+ * be present on the client so the list will be incomplete).
631
+ *
632
+ * By default, the filter editor will sort the unique values when displaying them
633
+ * to the user. If you want to prevent that and show the values in the order you
634
+ * provided, set the {@link sortValues} property to false.
635
+ *
636
+ * For example, the code below provides a list of countries to be used in the
637
+ * {@link ValueFilter} for the column bound to the 'country' field:
638
+ *
639
+ * ```typescript
640
+ * import { FlexGridFilter} from '@grapecity/wijmo.grid.filter';
641
+ *
642
+ * // create filter for a FlexGrid
643
+ * let filter = new FlexGridFilter(grid);
644
+ *
645
+ * // assign list of unique values to country filter
646
+ * let cf = filter.getColumnFilter('country');
647
+ * cf.valueFilter.uniqueValues = ['Austria', 'Belgium', 'Chile', 'Denmark'];
648
+ * ```
649
+ */
650
+ uniqueValues: any[] | null;
651
+ /**
652
+ * Gets or sets a value that determines whether the values should be sorted
653
+ * when displayed in the editor.
654
+ *
655
+ * This property is especially useful when you are using the {@link uniqueValues}
656
+ * to provide a custom list of values property and you would like to preserve
657
+ * the order of the values.
658
+ */
659
+ sortValues: boolean;
660
+ /**
661
+ * Gets or sets the {@link DataMap} used to convert raw values into display
662
+ * values shown when editing this filter.
663
+ */
664
+ dataMap: DataMap;
665
+ /**
666
+ * Gets the {@link Column} to filter.
667
+ */
668
+ readonly column: Column;
669
+ /**
670
+ * Gets a value that indicates whether the filter is active.
671
+ *
672
+ * The filter is active if some values are selected and some are not.
673
+ * If all values are in the same state (either selected or un-selected),
674
+ * then the filter is not active.
675
+ */
676
+ readonly isActive: boolean;
677
+ /**
678
+ * Gets a value that indicates whether a value passes the filter.
679
+ *
680
+ * @param value The value to test.
681
+ */
682
+ apply(value: any): boolean;
683
+ /**
684
+ * Clears the filter.
685
+ */
686
+ clear(): void;
687
+ /**
688
+ * Gets an array containing objects that represent all unique values
689
+ * for this {@link column}.
690
+ *
691
+ * The objects in the array returned contain two properties:
692
+ * *value* (the data value) and *text* (the formatted data value).
693
+ *
694
+ * If the {@link uniqueValues} property is set to an array of values,
695
+ * that array is used as a data source.
696
+ *
697
+ * If {@link uniqueValues} is null, the method scans all items in the
698
+ * data source and returns an creates an array containing all unique
699
+ * values.
700
+ *
701
+ * This method is used by the {@link ValueFilterEditor} class to
702
+ * populate the list of values shown to users.
703
+ *
704
+ * @param filtered Whether to apply all other filters when retrieving
705
+ * the values from the data source.
706
+ */
707
+ getUniqueValues(filtered?: boolean): any[];
708
+ /**
709
+ * Returns true if this object supports a given interface.
710
+ *
711
+ * @param interfaceName Name of the interface to look for.
712
+ */
713
+ implementsInterface(interfaceName: string): boolean;
714
+ }
715
+ /**
716
+ * The editor used to inspect and modify {@link ValueFilter} objects.
717
+ *
718
+ * This class is used by the {@link FlexGridFilter} class; you
719
+ * rarely use it directly.
720
+ */
721
+ export declare class ValueFilterEditor extends Control {
722
+ private _filter;
723
+ private _toFilter;
724
+ private _filterText;
725
+ private _rxFilter;
726
+ private _view;
727
+ private _initialItems;
728
+ private _canApply;
729
+ _isFiltering: boolean;
730
+ private _divFilter;
731
+ private _cmbFilter;
732
+ private _cbSelectAll;
733
+ private _spSelectAll;
734
+ private _divValues;
735
+ private _lbValues;
736
+ /**
737
+ * Gets or sets the template used to instantiate {@link ColumnFilterEditor} controls.
738
+ */
739
+ static controlTemplate: string;
740
+ /**
741
+ * Initializes a new instance of the {@link ValueFilterEditor} class.
742
+ *
743
+ * @param element The DOM element that hosts the control, or a selector
744
+ * for the host element (e.g. '#theCtrl').
745
+ * @param filter The {@link ValueFilter} to edit.
746
+ */
747
+ constructor(element: any, filter: ValueFilter);
748
+ /**
749
+ * Gets a reference to the {@link ValueFilter} being edited.
750
+ */
751
+ readonly filter: ValueFilter;
752
+ /**
753
+ * Gets or sets a value that indicates whether the current edits
754
+ * can be applied to make the filter active.
755
+ */
756
+ canApply: boolean;
757
+ /**
758
+ * Updates editor with current filter settings.
759
+ */
760
+ updateEditor(): void;
761
+ /**
762
+ * Clears the editor without applying changes to the filter.
763
+ *
764
+ * @param checkAll Whether to check or uncheck all values
765
+ * (either way, the filter is not applied in this case).
766
+ */
767
+ clearEditor(checkAll?: boolean): void;
768
+ /**
769
+ * Gets a value that determines whether the editor has been cleared.
770
+ */
771
+ readonly isEditorClear: boolean;
772
+ /**
773
+ * Updates filter to reflect the current editor values.
774
+ */
775
+ _updateFilter(): void;
776
+ /**
777
+ * Updates filter to reflect the current editor values.
778
+ * Delay to wait for filtering if needed (WJM-25294).
779
+ */
780
+ updateFilter(): void;
781
+ /**
782
+ * Occurs when the value of the {@linj canApply} property changes.
783
+ */
784
+ readonly canApplyChanged: Event<ValueFilterEditor, EventArgs>;
785
+ /**
786
+ * Raises the {@link canApplyChanged} event.
787
+ */
788
+ onCanApplyChanged(e?: EventArgs): void;
789
+ protected _getCaseSensitive(): boolean;
790
+ protected _getItems(): any[];
791
+ private _filterTextChanged;
792
+ private _filterValues;
793
+ private _cbSelectAllClicked;
794
+ private _updateSelectAllCheck;
795
+ private _adjustWidths;
796
+ }
797
+ /**
798
+ * Defines a filter for a column on a {@link FlexGrid} control.
799
+ *
800
+ * The {@link ColumnFilter} contains a {@link ConditionFilter} and a
801
+ * {@link ValueFilter}; only one of them may be active at a time.
802
+ *
803
+ * This class is used by the {@link FlexGridFilter} class; you
804
+ * rarely use it directly.
805
+ */
806
+ export declare class ColumnFilter implements IColumnFilter {
807
+ private _owner;
808
+ private _col;
809
+ private _valueFilter;
810
+ private _conditionFilter;
811
+ private _filterType;
812
+ /**
813
+ * Initializes a new instance of the {@link ColumnFilter} class.
814
+ *
815
+ * @param owner The {@link FlexGridFilter} that owns this column filter.
816
+ * @param column The {@link Column} to filter.
817
+ */
818
+ constructor(owner: FlexGridFilter, column: Column);
819
+ /**
820
+ * Gets or sets the types of filtering provided by this filter.
821
+ *
822
+ * Setting this property to null causes the filter to use the value
823
+ * defined by the owner filter's {@link FlexGridFilter.defaultFilterType}
824
+ * property.
825
+ */
826
+ filterType: FilterType;
827
+ /**
828
+ * Gets or sets the {@link DataMap} used to convert raw values into display
829
+ * values shown when editing this filter.
830
+ *
831
+ * The example below assigns a {@link DataMap} to Boolean column filters
832
+ * so the filter editor displays 'Yes' and 'No' instead of 'true' and 'false':
833
+ *
834
+ * ```typescript
835
+ * import { FlexGridFilter } from '@grapecity/wijmo.grid.filter';
836
+ * var filter = new FlexGridFilter(grid),
837
+ * map = new wijmo.grid.DataMap([
838
+ * { value: true, caption: 'Yes' },
839
+ * { value: false, caption: 'No' },
840
+ * ], 'value', 'caption');
841
+ * for (var c = 0; c &lt; grid.columns.length; c++) {
842
+ * if (grid.columns[c].dataType == wijmo.DataType.Boolean) {
843
+ * filter.getColumnFilter(c).dataMap = map;
844
+ * }
845
+ * }
846
+ * ```
847
+ */
848
+ dataMap: DataMap;
849
+ /**
850
+ * Gets the {@link ValueFilter} in this {@link ColumnFilter}.
851
+ */
852
+ readonly valueFilter: ValueFilter;
853
+ /**
854
+ * Gets the {@link ConditionFilter} in this {@link ColumnFilter}.
855
+ */
856
+ readonly conditionFilter: ConditionFilter;
857
+ /**
858
+ * Gets the {@link Column} being filtered.
859
+ */
860
+ readonly column: Column;
861
+ /**
862
+ * Gets a value that indicates whether the filter is active.
863
+ */
864
+ readonly isActive: boolean;
865
+ /**
866
+ * Gets a value that indicates whether a value passes the filter.
867
+ *
868
+ * @param value The value to test.
869
+ */
870
+ apply(value: any): boolean;
871
+ /**
872
+ * Clears the filter.
873
+ */
874
+ clear(): void;
875
+ /**
876
+ * Returns true if this object supports a given interface.
877
+ *
878
+ * @param interfaceName Name of the interface to look for.
879
+ */
880
+ implementsInterface(interfaceName: string): boolean;
881
+ }
882
+ /**
883
+ * The editor used to inspect and modify column filters.
884
+ *
885
+ * This class is used by the {@link FlexGridFilter} class; you
886
+ * rarely use it directly.
887
+ */
888
+ export declare class ColumnFilterEditor extends Control {
889
+ private _filter;
890
+ _edtVal: ValueFilterEditor;
891
+ private _edtCnd;
892
+ private _wasTouching;
893
+ private _divSort;
894
+ private _btnAsc;
895
+ private _btnDsc;
896
+ private _divType;
897
+ private _aCnd;
898
+ private _aVal;
899
+ private _divEdtVal;
900
+ private _divEdtCnd;
901
+ private _btnApply;
902
+ private _btnCancel;
903
+ private _btnClear;
904
+ /**
905
+ * Gets or sets the template used to instantiate {@link ColumnFilterEditor} controls.
906
+ */
907
+ static controlTemplate: string;
908
+ /**
909
+ * Initializes a new instance of the {@link ColumnFilterEditor} class.
910
+ *
911
+ * @param element The DOM element that hosts the control, or a selector
912
+ * for the host element (e.g. '#theCtrl').
913
+ * @param filter The {@link ColumnFilter} to edit.
914
+ * @param sortButtons Whether to show sort buttons in the editor.
915
+ */
916
+ constructor(element: any, filter: ColumnFilter, sortButtons?: boolean);
917
+ /**
918
+ * Gets a reference to the {@link ColumnFilter} being edited.
919
+ */
920
+ readonly filter: ColumnFilter;
921
+ /**
922
+ * Updates editor with current filter settings.
923
+ */
924
+ updateEditor(): void;
925
+ /**
926
+ * Updates filter with current editor settings.
927
+ */
928
+ updateFilter(): void;
929
+ /**
930
+ * Occurs after the filter is modified.
931
+ */
932
+ readonly filterChanged: Event<ColumnFilterEditor, EventArgs>;
933
+ /**
934
+ * Raises the {@link filterChanged} event.
935
+ */
936
+ onFilterChanged(e?: EventArgs): void;
937
+ /**
938
+ * Occurs when one of the editor buttons is clicked.
939
+ */
940
+ readonly buttonClicked: Event<ColumnFilterEditor, EventArgs>;
941
+ /**
942
+ * Raises the {@link buttonClicked} event.
943
+ */
944
+ onButtonClicked(e?: EventArgs): void;
945
+ _showFilter(filterType: FilterType): void;
946
+ private _enableLink;
947
+ private _updateSortButtonState;
948
+ private _getFilterType;
949
+ private _btnClicked;
950
+ }