@starasia/admin 8.1.0 → 8.1.1
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/FilterPills.d.ts +5 -1
- package/dist/components/FilterBar/components/pills/DatePill.d.ts +7 -1
- package/dist/components/FilterBar/components/pills/SelectPill.d.ts +2 -2
- package/dist/components/FilterBar/index.d.ts +1 -1
- package/dist/components/FilterBar/types.d.ts +6 -14
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +912 -873
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,10 @@ interface FilterPillsProps {
|
|
|
9
9
|
clearValue: (key: string) => void;
|
|
10
10
|
removeFilter: (key: string) => void;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Renders the active filter pills, dispatching each to its editor by type.
|
|
14
|
+
* Each pill is self-contained — removal happens via its own popover's
|
|
15
|
+
* "Remove Filter" action (no external × any more).
|
|
16
|
+
*/
|
|
13
17
|
export declare const FilterPills: React.FC<FilterPillsProps>;
|
|
14
18
|
export {};
|
|
@@ -9,7 +9,13 @@ interface DatePillProps {
|
|
|
9
9
|
} | undefined;
|
|
10
10
|
onChange: (v: unknown) => void;
|
|
11
11
|
onClear: () => void;
|
|
12
|
+
/** Removes the whole pill (the popover's "Remove Filter" action). */
|
|
13
|
+
onRemove: () => void;
|
|
12
14
|
}
|
|
13
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Date / date-range pill. Outer `Menu` for positioning + Remove Filter; the
|
|
17
|
+
* popover hosts a `StarasiaDate` calendar (no `input` mode — the Menu trigger
|
|
18
|
+
* is our pill button).
|
|
19
|
+
*/
|
|
14
20
|
export declare const DatePill: React.FC<DatePillProps>;
|
|
15
21
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { SelectFilterField
|
|
2
|
+
import { SelectFilterField } from '../../types';
|
|
3
3
|
|
|
4
4
|
interface SelectPillProps {
|
|
5
|
-
field: SelectFilterField
|
|
5
|
+
field: SelectFilterField;
|
|
6
6
|
value: {
|
|
7
7
|
label: string;
|
|
8
8
|
value: string;
|
|
@@ -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, CheckboxMultipleFilterField,
|
|
3
|
+
export type { FilterBarProps, FilterFieldConfig, FilterFieldType, SelectFilterField, CheckboxMultipleFilterField, 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' | 'checkbox-multiple' | 'radio'
|
|
11
|
+
export type FilterFieldType = 'date' | 'date-range' | 'dropdown' | 'dropdown-multiple' | 'checkbox-multiple' | 'radio';
|
|
12
12
|
interface BaseFilterField {
|
|
13
13
|
/** Stable key — used as the field name inside the `?filter` blob. */
|
|
14
14
|
key: string;
|
|
@@ -24,6 +24,10 @@ export interface SelectFilterField extends BaseFilterField {
|
|
|
24
24
|
options: {
|
|
25
25
|
label: string;
|
|
26
26
|
value: string;
|
|
27
|
+
/** Optional secondary line under the label (e.g. "ID • Jabatan" for people). */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Optional left adornment — avatar/icon node (e.g. for people pickers). */
|
|
30
|
+
avatar?: ReactNode;
|
|
27
31
|
}[];
|
|
28
32
|
searchable?: boolean;
|
|
29
33
|
isLoading?: boolean;
|
|
@@ -41,18 +45,6 @@ export interface CheckboxMultipleFilterField extends BaseFilterField {
|
|
|
41
45
|
value: string;
|
|
42
46
|
}[];
|
|
43
47
|
}
|
|
44
|
-
export interface PersonFilterField extends BaseFilterField {
|
|
45
|
-
type: 'person';
|
|
46
|
-
options: {
|
|
47
|
-
label: string;
|
|
48
|
-
value: string;
|
|
49
|
-
description?: string;
|
|
50
|
-
avatar?: ReactNode;
|
|
51
|
-
}[];
|
|
52
|
-
searchable?: boolean;
|
|
53
|
-
isLoading?: boolean;
|
|
54
|
-
onSearch?: (q: string) => void;
|
|
55
|
-
}
|
|
56
48
|
export interface DateFilterField extends BaseFilterField {
|
|
57
49
|
type: 'date';
|
|
58
50
|
mode?: 'days' | 'months' | 'years';
|
|
@@ -60,7 +52,7 @@ export interface DateFilterField extends BaseFilterField {
|
|
|
60
52
|
export interface DateRangeFilterField extends BaseFilterField {
|
|
61
53
|
type: 'date-range';
|
|
62
54
|
}
|
|
63
|
-
export type FilterFieldConfig = SelectFilterField | CheckboxMultipleFilterField |
|
|
55
|
+
export type FilterFieldConfig = SelectFilterField | CheckboxMultipleFilterField | DateFilterField | DateRangeFilterField;
|
|
64
56
|
/** A single column entry fed to the Customize Column panel. */
|
|
65
57
|
export interface ColumnConfig {
|
|
66
58
|
key: string;
|