@starasia/admin 8.0.5 → 8.0.7
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/dist/components/FilterBar/components/PaginationCluster.d.ts +1 -0
- package/dist/components/FilterBar/components/pills/CheckboxPill.d.ts +23 -0
- package/dist/components/FilterBar/components/pills/SelectPill.d.ts +5 -3
- package/dist/components/FilterBar/index.d.ts +1 -1
- package/dist/components/FilterBar/types.d.ts +21 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2448 -2269
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CheckboxMultipleFilterField } from '../../types';
|
|
3
|
+
|
|
4
|
+
interface CheckboxPillProps {
|
|
5
|
+
field: CheckboxMultipleFilterField;
|
|
6
|
+
value: {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
onChange: (v: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[]) => void;
|
|
14
|
+
/** Removes the whole pill (the popover's "Remove Filter" action). */
|
|
15
|
+
onRemove: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `checkbox-multiple` pill — fixed (non-API) multi-select rendered with `Menu`
|
|
19
|
+
* + checkboxes. For flag-like filters such as status / document type. Encoded
|
|
20
|
+
* like `dropdown-multiple` in the URL.
|
|
21
|
+
*/
|
|
22
|
+
export declare const CheckboxPill: React.FC<CheckboxPillProps>;
|
|
23
|
+
export {};
|
|
@@ -11,11 +11,13 @@ interface SelectPillProps {
|
|
|
11
11
|
label: string;
|
|
12
12
|
value: string;
|
|
13
13
|
}[]) => void;
|
|
14
|
+
/** Removes the whole pill (the popover's "Remove Filter" action). */
|
|
15
|
+
onRemove: () => void;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
|
-
* Select pill —
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* Select pill — `dropdown` (single), `dropdown-multiple`, `radio`, `person`.
|
|
19
|
+
* Wrapped in `Menu` for positioning/popover behaviour; the searchable list
|
|
20
|
+
* inside the popover is a `Dropdown` with `triggerInput`.
|
|
19
21
|
*/
|
|
20
22
|
export declare const SelectPill: React.FC<SelectPillProps>;
|
|
21
23
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { FilterBar } from './FilterBar';
|
|
2
2
|
export { localStorageAdapter, storageKeys } from './utils/storage-adapter';
|
|
3
|
-
export type { FilterBarProps, FilterFieldConfig, FilterFieldType, SelectFilterField, PersonFilterField, DateFilterField, DateRangeFilterField, ColumnConfig, ColumnPrefState, SavedView, FilterStorageAdapter } from './types';
|
|
3
|
+
export type { FilterBarProps, FilterFieldConfig, FilterFieldType, SelectFilterField, CheckboxMultipleFilterField, PersonFilterField, DateFilterField, DateRangeFilterField, ColumnConfig, ColumnPrefState, SavedView, FilterStorageAdapter } from './types';
|
|
@@ -8,7 +8,7 @@ import { Pagination } from '../TableSection/types';
|
|
|
8
8
|
* (`handleChangeFilter`, `getValuesFilter`, …) so the JSON-blob URL encoding
|
|
9
9
|
* (`?filter={...}`) is reused as-is. `key` is the param name inside that blob.
|
|
10
10
|
*/
|
|
11
|
-
export type FilterFieldType = 'date' | 'date-range' | 'dropdown' | 'dropdown-multiple' | 'radio' | 'person';
|
|
11
|
+
export type FilterFieldType = 'date' | 'date-range' | 'dropdown' | 'dropdown-multiple' | 'checkbox-multiple' | 'radio' | 'person';
|
|
12
12
|
interface BaseFilterField {
|
|
13
13
|
/** Stable key — used as the field name inside the `?filter` blob. */
|
|
14
14
|
key: string;
|
|
@@ -29,6 +29,18 @@ export interface SelectFilterField extends BaseFilterField {
|
|
|
29
29
|
isLoading?: boolean;
|
|
30
30
|
onSearch?: (q: string) => void;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Fixed multi-select rendered with `Menu` + checkboxes (not `Dropdown`).
|
|
34
|
+
* For flag-like filters whose options are static, not fetched from an API
|
|
35
|
+
* (e.g. status, document type). Encoded like `dropdown-multiple`.
|
|
36
|
+
*/
|
|
37
|
+
export interface CheckboxMultipleFilterField extends BaseFilterField {
|
|
38
|
+
type: 'checkbox-multiple';
|
|
39
|
+
options: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}[];
|
|
43
|
+
}
|
|
32
44
|
export interface PersonFilterField extends BaseFilterField {
|
|
33
45
|
type: 'person';
|
|
34
46
|
options: {
|
|
@@ -48,7 +60,7 @@ export interface DateFilterField extends BaseFilterField {
|
|
|
48
60
|
export interface DateRangeFilterField extends BaseFilterField {
|
|
49
61
|
type: 'date-range';
|
|
50
62
|
}
|
|
51
|
-
export type FilterFieldConfig = SelectFilterField | PersonFilterField | DateFilterField | DateRangeFilterField;
|
|
63
|
+
export type FilterFieldConfig = SelectFilterField | CheckboxMultipleFilterField | PersonFilterField | DateFilterField | DateRangeFilterField;
|
|
52
64
|
/** A single column entry fed to the Customize Column panel. */
|
|
53
65
|
export interface ColumnConfig {
|
|
54
66
|
key: string;
|
|
@@ -84,6 +96,11 @@ export interface FilterStorageAdapter {
|
|
|
84
96
|
remove(key: string): void;
|
|
85
97
|
}
|
|
86
98
|
export interface FilterBarProps {
|
|
99
|
+
/**
|
|
100
|
+
* Show container padding (top/bottom `sm`, left/right `md`). Default `false`
|
|
101
|
+
* — keep it off when the host already provides padding (e.g. a page header).
|
|
102
|
+
*/
|
|
103
|
+
withPadding?: boolean;
|
|
87
104
|
/** Catalog of filters offered in the Add Filter menu. */
|
|
88
105
|
filterConfigs?: FilterFieldConfig[];
|
|
89
106
|
/** URL param holding the JSON-blob of filter values. Default `'filter'`. */
|
|
@@ -107,6 +124,8 @@ export interface FilterBarProps {
|
|
|
107
124
|
pageSizeOptions?: number[];
|
|
108
125
|
showPagination?: boolean;
|
|
109
126
|
showResultCount?: boolean;
|
|
127
|
+
/** Show the rows-per-page selector. Default `true`. */
|
|
128
|
+
showPageSize?: boolean;
|
|
110
129
|
/** Columns shown in the Customize Column panel. */
|
|
111
130
|
columns?: ColumnConfig[];
|
|
112
131
|
/** Emitted when visibility/order changes — consumer applies to its table. */
|