@storepass/components 0.6.1 → 0.8.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/CHANGELOG.md +53 -0
- package/README.md +21 -14
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/AlertDialog/index.js +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Carousel/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Collapsible/index.js +1 -1
- package/dist/components/Combobox/index.js +1 -1
- package/dist/components/Command/index.js +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +92 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -0
- package/dist/components/DataGrid/cells.d.ts +26 -0
- package/dist/components/DataGrid/cells.d.ts.map +1 -0
- package/dist/components/DataGrid/columns.d.ts +273 -0
- package/dist/components/DataGrid/columns.d.ts.map +1 -0
- package/dist/components/DataGrid/fixtures.d.ts +29 -0
- package/dist/components/DataGrid/fixtures.d.ts.map +1 -0
- package/dist/components/DataGrid/index.d.ts +12 -0
- package/dist/components/DataGrid/index.d.ts.map +1 -0
- package/dist/components/DataGrid/index.js +1 -0
- package/dist/components/DataGrid/parts.d.ts +127 -0
- package/dist/components/DataGrid/parts.d.ts.map +1 -0
- package/dist/components/DataGrid/query.d.ts +320 -0
- package/dist/components/DataGrid/query.d.ts.map +1 -0
- package/dist/components/DataGrid/server.d.ts +52 -0
- package/dist/components/DataGrid/server.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +10 -2
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/dateLogic.d.ts +10 -0
- package/dist/components/DatePicker/dateLogic.d.ts.map +1 -0
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/DropdownMenu/index.js +1 -1
- package/dist/components/FeaturedIcon/FeaturedIcon.d.ts +2 -2
- package/dist/components/FeaturedIcon/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Gloss/Gloss.d.ts +6 -0
- package/dist/components/Gloss/Gloss.d.ts.map +1 -0
- package/dist/components/Gloss/datetime.d.ts +24 -0
- package/dist/components/Gloss/datetime.d.ts.map +1 -0
- package/dist/components/Gloss/disclosure.d.ts +35 -0
- package/dist/components/Gloss/disclosure.d.ts.map +1 -0
- package/dist/components/Gloss/index.d.ts +2 -0
- package/dist/components/Gloss/index.d.ts.map +1 -0
- package/dist/components/Gloss/index.js +1 -0
- package/dist/components/Gloss/money.d.ts +33 -0
- package/dist/components/Gloss/money.d.ts.map +1 -0
- package/dist/components/Gloss/read.d.ts +25 -0
- package/dist/components/Gloss/read.d.ts.map +1 -0
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/ImperativeDialog/index.js +1 -1
- package/dist/components/InlineAlert/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputGroup/InputGroup.d.ts +1 -1
- package/dist/components/InputGroup/index.js +1 -1
- package/dist/components/Item/index.js +1 -1
- package/dist/components/Kbd/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/LoadingIndicator/index.js +1 -1
- package/dist/components/MoneyAmount/index.js +1 -1
- package/dist/components/Navbar/index.js +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/PageHeading/index.js +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/PinInput/index.js +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/Rating/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Settings/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/Tabs.d.ts +8 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Tags/index.js +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/VideoDialog/index.js +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index-0k26fpsr.js +2 -0
- package/dist/index-0x3exa89.js +1 -0
- package/dist/index-12m8pd4x.js +1 -0
- package/dist/index-1n7ke68v.js +1 -0
- package/dist/index-207wxbj2.js +1 -0
- package/dist/index-2cbcq1ak.js +1 -0
- package/dist/index-39gyjttt.js +2 -0
- package/dist/index-3nj3vfyf.js +1 -0
- package/dist/index-3qz0mz4s.js +1 -0
- package/dist/index-3xevqp5j.js +1 -0
- package/dist/index-3y89rrea.js +1 -0
- package/dist/index-3yf2yecs.js +1 -0
- package/dist/index-4p3htnp4.js +1 -0
- package/dist/index-5k17f917.js +0 -0
- package/dist/index-626k16zr.js +0 -0
- package/dist/index-6bayqdg2.js +0 -0
- package/dist/index-6hjt8vvj.js +2 -0
- package/dist/index-6wj27sgg.js +1 -0
- package/dist/index-77e650nh.js +0 -0
- package/dist/index-79863hrw.js +1 -0
- package/dist/index-7nb0kh49.js +1 -0
- package/dist/index-80vgqvbb.js +1 -0
- package/dist/index-8bvab16j.js +1 -0
- package/dist/index-8e82vsma.js +1 -0
- package/dist/index-99dvdfty.js +122 -0
- package/dist/index-9w3q13x9.js +1 -0
- package/dist/index-a5xdyq4r.js +1 -0
- package/dist/index-awgxtt2c.js +2 -0
- package/dist/index-aym8f7kk.js +1 -0
- package/dist/index-bfj32kdy.js +1 -0
- package/dist/index-czhrx6qc.js +1 -0
- package/dist/index-dha7m2cb.js +2 -0
- package/dist/index-dyqfzdwm.js +1 -0
- package/dist/index-dzrvgand.js +1 -0
- package/dist/index-e3jk5qws.js +1 -0
- package/dist/index-e57a5m40.js +1 -0
- package/dist/index-f7d8em7k.js +1 -0
- package/dist/index-fse0pbfb.js +1 -0
- package/dist/index-gerw8wbs.js +1 -0
- package/dist/index-h0evkh77.js +2 -0
- package/dist/index-h0t7cb54.js +2 -0
- package/dist/index-heb6hak3.js +2 -0
- package/dist/index-hjxh9rqy.js +1 -0
- package/dist/index-jbzvn81j.js +1 -0
- package/dist/index-jk047paq.js +1 -0
- package/dist/index-m532p9sh.js +0 -0
- package/dist/index-mq3xffc2.js +0 -0
- package/dist/index-mtn2afhs.js +1 -0
- package/dist/index-n11bq2ez.js +1 -0
- package/dist/index-n7fq9hv6.js +1 -0
- package/dist/index-nbp2rcyj.js +1 -0
- package/dist/index-qkjr9w4c.js +1 -0
- package/dist/index-s3543vem.js +0 -0
- package/dist/index-s3888qb0.js +1 -0
- package/dist/index-s4wzrj6b.js +1 -0
- package/dist/index-s7qkq2f8.js +1 -0
- package/dist/index-s7ttw4jf.js +1 -0
- package/dist/index-sxaagzqf.js +1 -0
- package/dist/index-warqb7rs.js +2 -0
- package/dist/index-whmj1gae.js +1 -0
- package/dist/index-wv5wqvwb.js +1 -0
- package/dist/index-xqphyc4g.js +1 -0
- package/dist/index-yeehx7kc.js +2 -0
- package/dist/index-yzm4k2ye.js +1 -0
- package/dist/index-zke98cz9.js +1 -0
- package/dist/index-zxjkp0aj.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/utils.js +1 -2
- package/package.json +7 -1
- package/dist/index-2nc1awt9.js +0 -2
- package/dist/index-9scn04dv.js +0 -2
- package/dist/index-aq782dhn.js +0 -2
- package/dist/index-dsdw1626.js +0 -2
- package/dist/index-mmas6ncx.js +0 -2
- package/dist/index-mq6f0tgx.js +0 -2
- package/dist/index-nr793zrn.js +0 -2
- package/dist/index-tnergzh9.js +0 -2
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import type { ColumnsOf, GridSchema } from "./columns";
|
|
2
|
+
export type { ColumnsOf, GridSchema } from "./columns";
|
|
3
|
+
export type Density = "compact" | "default" | "comfortable";
|
|
4
|
+
/**
|
|
5
|
+
* Block padding per density. Single-line rows land at 32 / 40 / 52px; the
|
|
6
|
+
* two-line entity cell collapses to one line in compact.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DENSITY_ROW_PY: Record<Density, string>;
|
|
9
|
+
export declare const PAGE_SIZE_DEFAULT = 10;
|
|
10
|
+
export declare const PAGE_SIZE_MAX = 100;
|
|
11
|
+
/** 16px checkbox with 16px of padding on each side, so the control is not flush with the next cell. */
|
|
12
|
+
export declare const SELECT_COLUMN_WIDTH = 48;
|
|
13
|
+
export declare const ACTIONS_COLUMN_WIDTH = 44;
|
|
14
|
+
/** Bounds for user-resized columns, in px. */
|
|
15
|
+
export declare const COLUMN_MIN_WIDTH = 64;
|
|
16
|
+
export declare const COLUMN_MAX_WIDTH = 800;
|
|
17
|
+
export type SortDir = "asc" | "desc";
|
|
18
|
+
export type ColumnId<S extends ColumnsOf> = S["columns"][number]["id"];
|
|
19
|
+
export type SortableId<S extends ColumnsOf> = Exclude<S["columns"][number], {
|
|
20
|
+
sortable: false;
|
|
21
|
+
}>["id"];
|
|
22
|
+
export type HideableId<S extends ColumnsOf> = Exclude<S["columns"][number], {
|
|
23
|
+
hideable: false;
|
|
24
|
+
}>["id"];
|
|
25
|
+
export type FacetValue<S extends ColumnsOf> = Extract<S["columns"][number], {
|
|
26
|
+
facet: true;
|
|
27
|
+
}> extends infer Column ? Column extends {
|
|
28
|
+
options: readonly (infer Option)[];
|
|
29
|
+
} ? Option : never : never;
|
|
30
|
+
type StringOp = "contains" | "equals" | "startsWith";
|
|
31
|
+
type EnumOpSingle = "is" | "isNot";
|
|
32
|
+
type NumberOpSingle = "eq" | "gt" | "gte" | "lt" | "lte";
|
|
33
|
+
type StringFilter<Id extends string> = {
|
|
34
|
+
id: string;
|
|
35
|
+
column: Id;
|
|
36
|
+
op: StringOp;
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
39
|
+
type EnumFilter<Id extends string, Option extends string> = {
|
|
40
|
+
id: string;
|
|
41
|
+
column: Id;
|
|
42
|
+
op: EnumOpSingle;
|
|
43
|
+
value: Option;
|
|
44
|
+
} | {
|
|
45
|
+
id: string;
|
|
46
|
+
column: Id;
|
|
47
|
+
op: "isAny";
|
|
48
|
+
value: readonly Option[];
|
|
49
|
+
};
|
|
50
|
+
type NumberFilter<Id extends string> = {
|
|
51
|
+
id: string;
|
|
52
|
+
column: Id;
|
|
53
|
+
op: NumberOpSingle;
|
|
54
|
+
value: number;
|
|
55
|
+
} | {
|
|
56
|
+
id: string;
|
|
57
|
+
column: Id;
|
|
58
|
+
op: "between";
|
|
59
|
+
value: readonly [number, number];
|
|
60
|
+
};
|
|
61
|
+
type TagsFilter<Id extends string> = {
|
|
62
|
+
id: string;
|
|
63
|
+
column: Id;
|
|
64
|
+
op: "has";
|
|
65
|
+
value: string;
|
|
66
|
+
} | {
|
|
67
|
+
id: string;
|
|
68
|
+
column: Id;
|
|
69
|
+
op: "hasAny" | "hasAll";
|
|
70
|
+
value: readonly string[];
|
|
71
|
+
};
|
|
72
|
+
type FilterFor<C> = C extends {
|
|
73
|
+
filterable: false;
|
|
74
|
+
} ? never : C extends {
|
|
75
|
+
kind: "enum";
|
|
76
|
+
id: infer Id extends string;
|
|
77
|
+
options: readonly (infer Option extends string)[];
|
|
78
|
+
} ? EnumFilter<Id, Option> : C extends {
|
|
79
|
+
kind: "number" | "money";
|
|
80
|
+
id: infer Id extends string;
|
|
81
|
+
} ? NumberFilter<Id> : C extends {
|
|
82
|
+
kind: "tags";
|
|
83
|
+
id: infer Id extends string;
|
|
84
|
+
} ? TagsFilter<Id> : C extends {
|
|
85
|
+
kind: "text" | "entity" | "avatar" | "link";
|
|
86
|
+
id: infer Id extends string;
|
|
87
|
+
} ? StringFilter<Id> : never;
|
|
88
|
+
export type FilterOf<S extends ColumnsOf> = FilterFor<S["columns"][number]>;
|
|
89
|
+
export type SortOf<S extends ColumnsOf> = {
|
|
90
|
+
column: SortableId<S>;
|
|
91
|
+
dir: SortDir;
|
|
92
|
+
};
|
|
93
|
+
/** `rows` names ids. `query` is every current match minus `except`. */
|
|
94
|
+
export type Selection = {
|
|
95
|
+
kind: "rows";
|
|
96
|
+
ids: readonly string[];
|
|
97
|
+
} | {
|
|
98
|
+
kind: "query";
|
|
99
|
+
except: readonly string[];
|
|
100
|
+
};
|
|
101
|
+
export type GridQuery<S extends ColumnsOf = ColumnsOf> = {
|
|
102
|
+
v: 1;
|
|
103
|
+
facet: FacetValue<S> | null;
|
|
104
|
+
/** Free-text quick filter across every text-bearing column. */
|
|
105
|
+
search: string;
|
|
106
|
+
filters: readonly FilterOf<S>[];
|
|
107
|
+
sorts: readonly SortOf<S>[];
|
|
108
|
+
hidden: readonly ColumnId<S>[];
|
|
109
|
+
order: readonly ColumnId<S>[];
|
|
110
|
+
/** User-resized widths in px; columns not listed use their schema width or auto. */
|
|
111
|
+
widths: Readonly<Partial<Record<ColumnId<S>, number>>>;
|
|
112
|
+
selection: Selection;
|
|
113
|
+
page: number;
|
|
114
|
+
pageSize: number;
|
|
115
|
+
inspect: string | null;
|
|
116
|
+
};
|
|
117
|
+
export type GridAction<S extends ColumnsOf> = {
|
|
118
|
+
type: "facet";
|
|
119
|
+
value: FacetValue<S> | null;
|
|
120
|
+
} | {
|
|
121
|
+
type: "search";
|
|
122
|
+
value: string;
|
|
123
|
+
} | {
|
|
124
|
+
type: "addFilter";
|
|
125
|
+
filter: FilterOf<S>;
|
|
126
|
+
} | {
|
|
127
|
+
type: "replaceFilter";
|
|
128
|
+
filter: FilterOf<S>;
|
|
129
|
+
} | {
|
|
130
|
+
type: "removeFilter";
|
|
131
|
+
id: string;
|
|
132
|
+
} | {
|
|
133
|
+
type: "clearFilters";
|
|
134
|
+
} | {
|
|
135
|
+
type: "clearConstraints";
|
|
136
|
+
} | {
|
|
137
|
+
type: "addSort";
|
|
138
|
+
column: SortableId<S>;
|
|
139
|
+
dir: SortDir;
|
|
140
|
+
} | {
|
|
141
|
+
type: "setSortDir";
|
|
142
|
+
column: SortableId<S>;
|
|
143
|
+
dir: SortDir;
|
|
144
|
+
} | {
|
|
145
|
+
type: "removeSort";
|
|
146
|
+
column: SortableId<S>;
|
|
147
|
+
} | {
|
|
148
|
+
type: "moveSort";
|
|
149
|
+
column: SortableId<S>;
|
|
150
|
+
to: number;
|
|
151
|
+
} | {
|
|
152
|
+
type: "clearSorts";
|
|
153
|
+
} | {
|
|
154
|
+
type: "primarySort";
|
|
155
|
+
column: SortableId<S>;
|
|
156
|
+
dir: SortDir;
|
|
157
|
+
} | {
|
|
158
|
+
type: "hideColumn";
|
|
159
|
+
column: HideableId<S>;
|
|
160
|
+
} | {
|
|
161
|
+
type: "showColumn";
|
|
162
|
+
column: ColumnId<S>;
|
|
163
|
+
} | {
|
|
164
|
+
type: "moveColumn";
|
|
165
|
+
column: ColumnId<S>;
|
|
166
|
+
dir: "left" | "right";
|
|
167
|
+
}
|
|
168
|
+
/** Drop a column at a visible index. Pinned columns neither move nor get crossed. */
|
|
169
|
+
| {
|
|
170
|
+
type: "placeColumn";
|
|
171
|
+
column: ColumnId<S>;
|
|
172
|
+
to: number;
|
|
173
|
+
} | {
|
|
174
|
+
type: "resizeColumn";
|
|
175
|
+
column: ColumnId<S>;
|
|
176
|
+
width: number;
|
|
177
|
+
} | {
|
|
178
|
+
type: "resetColumnWidth";
|
|
179
|
+
column: ColumnId<S>;
|
|
180
|
+
} | {
|
|
181
|
+
type: "toggleRow";
|
|
182
|
+
id: string;
|
|
183
|
+
} | {
|
|
184
|
+
type: "togglePage";
|
|
185
|
+
ids: readonly string[];
|
|
186
|
+
} | {
|
|
187
|
+
type: "selectMatching";
|
|
188
|
+
} | {
|
|
189
|
+
type: "clearSelection";
|
|
190
|
+
} | {
|
|
191
|
+
type: "page";
|
|
192
|
+
page: number;
|
|
193
|
+
} | {
|
|
194
|
+
type: "pageSize";
|
|
195
|
+
pageSize: number;
|
|
196
|
+
} | {
|
|
197
|
+
type: "inspect";
|
|
198
|
+
id: string | null;
|
|
199
|
+
};
|
|
200
|
+
export type GridQueryWire = {
|
|
201
|
+
v?: unknown;
|
|
202
|
+
facet?: unknown;
|
|
203
|
+
search?: unknown;
|
|
204
|
+
filters?: unknown;
|
|
205
|
+
sorts?: unknown;
|
|
206
|
+
hidden?: unknown;
|
|
207
|
+
order?: unknown;
|
|
208
|
+
widths?: unknown;
|
|
209
|
+
selection?: unknown;
|
|
210
|
+
page?: unknown;
|
|
211
|
+
pageSize?: unknown;
|
|
212
|
+
inspect?: unknown;
|
|
213
|
+
};
|
|
214
|
+
export type ParseDrop = {
|
|
215
|
+
path: string;
|
|
216
|
+
reason: "bad-json" | "bad-version" | "unknown-column" | "bad-operator" | "bad-value" | "duplicate" | "bad-selection";
|
|
217
|
+
};
|
|
218
|
+
export type ParseGridQueryResult<S extends ColumnsOf> = {
|
|
219
|
+
query: GridQuery<S>;
|
|
220
|
+
dropped: readonly ParseDrop[];
|
|
221
|
+
};
|
|
222
|
+
export type AggregateValue = {
|
|
223
|
+
kind: "count";
|
|
224
|
+
value: number;
|
|
225
|
+
} | {
|
|
226
|
+
kind: "sum";
|
|
227
|
+
value: number;
|
|
228
|
+
} | {
|
|
229
|
+
kind: "money";
|
|
230
|
+
value: number;
|
|
231
|
+
currency: string;
|
|
232
|
+
decimalPlaces: number;
|
|
233
|
+
};
|
|
234
|
+
export type ColumnLayout<S extends ColumnsOf> = {
|
|
235
|
+
id: ColumnId<S>;
|
|
236
|
+
stickyLeft: number | undefined;
|
|
237
|
+
stickyEdge: boolean;
|
|
238
|
+
/** Effective width: the user's resize, else the schema width, else auto. */
|
|
239
|
+
width: number | undefined;
|
|
240
|
+
sort: {
|
|
241
|
+
dir: SortDir;
|
|
242
|
+
rank: number;
|
|
243
|
+
} | null;
|
|
244
|
+
canMoveLeft: boolean;
|
|
245
|
+
canMoveRight: boolean;
|
|
246
|
+
canHide: boolean;
|
|
247
|
+
};
|
|
248
|
+
export type ResolvedSelection = {
|
|
249
|
+
count: number;
|
|
250
|
+
/**
|
|
251
|
+
* Selected ids the grid can name. With a server `result` and a `query`
|
|
252
|
+
* selection that is only the current page; send the request and
|
|
253
|
+
* `selection.except` to act on every match.
|
|
254
|
+
*/
|
|
255
|
+
ids: readonly string[];
|
|
256
|
+
allMatching: boolean;
|
|
257
|
+
pageChecked: boolean | "indeterminate";
|
|
258
|
+
};
|
|
259
|
+
export type GridModel<TRow, S extends ColumnsOf> = {
|
|
260
|
+
pageRows: readonly TRow[];
|
|
261
|
+
total: number;
|
|
262
|
+
range: {
|
|
263
|
+
from: number;
|
|
264
|
+
to: number;
|
|
265
|
+
};
|
|
266
|
+
/** Effective page after the slice is clamped. Does not write the document. */
|
|
267
|
+
page: number;
|
|
268
|
+
pageCount: number;
|
|
269
|
+
/** `count` is null when a server result leaves facet counts out. */
|
|
270
|
+
facets: readonly {
|
|
271
|
+
value: string | null;
|
|
272
|
+
label: string;
|
|
273
|
+
count: number | null;
|
|
274
|
+
}[];
|
|
275
|
+
columns: readonly ColumnLayout<S>[];
|
|
276
|
+
aggregates: Partial<Record<ColumnId<S>, AggregateValue>>;
|
|
277
|
+
selection: ResolvedSelection;
|
|
278
|
+
/** Lookup of `inspect` in the full row array, not the page. */
|
|
279
|
+
inspected: TRow | null;
|
|
280
|
+
};
|
|
281
|
+
export type FilterDraft = {
|
|
282
|
+
columnId: string | null;
|
|
283
|
+
op: string | null;
|
|
284
|
+
raw: string;
|
|
285
|
+
rawTo: string;
|
|
286
|
+
values: readonly string[];
|
|
287
|
+
lockedColumn: boolean;
|
|
288
|
+
};
|
|
289
|
+
export type StoredColumn = {
|
|
290
|
+
id: string;
|
|
291
|
+
kind: string;
|
|
292
|
+
header: string;
|
|
293
|
+
hideable: boolean;
|
|
294
|
+
sortable: boolean;
|
|
295
|
+
filterable: boolean;
|
|
296
|
+
sticky?: "left";
|
|
297
|
+
width?: number;
|
|
298
|
+
aggregate?: "sum" | "count";
|
|
299
|
+
currency?: string;
|
|
300
|
+
decimalPlaces?: number;
|
|
301
|
+
facet?: boolean;
|
|
302
|
+
options?: readonly string[];
|
|
303
|
+
labels?: Readonly<Record<string, string>>;
|
|
304
|
+
};
|
|
305
|
+
export declare function clampPage(page: number): number;
|
|
306
|
+
export declare function clampPageSize(pageSize: number): number;
|
|
307
|
+
export declare function storedColumns(schema: ColumnsOf): readonly StoredColumn[];
|
|
308
|
+
export declare function emptyGridQuery<S extends ColumnsOf>(schema: S): GridQuery<S>;
|
|
309
|
+
export declare function parseGridQuery<S extends ColumnsOf>(schema: S, source: string | URLSearchParams | GridQueryWire | null | undefined): ParseGridQueryResult<S>;
|
|
310
|
+
export declare function serializeGridQuery<S extends ColumnsOf>(schema: S, query: GridQuery<S>): string;
|
|
311
|
+
export declare function transitionGridQuery<S extends ColumnsOf>(schema: S, query: GridQuery<S>, action: GridAction<S>): GridQuery<S>;
|
|
312
|
+
export declare function draftToFilter<S extends ColumnsOf>(schema: S, draft: FilterDraft, id: string): FilterOf<S> | null;
|
|
313
|
+
export declare function filterLabel<S extends ColumnsOf>(schema: S, filter: FilterOf<S>): string;
|
|
314
|
+
export declare function filterOperators(kind: string): readonly {
|
|
315
|
+
value: string;
|
|
316
|
+
label: string;
|
|
317
|
+
}[];
|
|
318
|
+
export declare function layoutColumns<S extends ColumnsOf>(columns: readonly StoredColumn[], query: GridQuery<S>): readonly ColumnLayout<S>[];
|
|
319
|
+
export declare function applyGridQuery<TRow, S extends GridSchema<TRow>>(schema: S, rows: readonly TRow[], query: GridQuery<S>): GridModel<TRow, S>;
|
|
320
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/query.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAa,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAIlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC,uGAAuG;AACvG,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,8CAA8C;AAC9C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAErC,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,SAAS,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEvE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,IAAI,OAAO,CACpD,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EACpB;IAAE,QAAQ,EAAE,KAAK,CAAA;CAAE,CACnB,CAAC,IAAI,CAAC,CAAC;AAER,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,IAAI,OAAO,CACpD,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EACpB;IAAE,QAAQ,EA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0 +1,52 @@
|
|
|
1
|
+
import type { ColumnsOf } from "./columns";
|
|
2
|
+
import { type AggregateValue, type ColumnId, type FacetValue, type FilterOf, type GridModel, type GridQuery, type SortOf } from "./query";
|
|
3
|
+
type OmitId<F> = F extends unknown ? Omit<F, "id"> : never;
|
|
4
|
+
/** A filter as a server applies it. The chip `id` is UI state and stays behind. */
|
|
5
|
+
export type GridRequestFilter<S extends ColumnsOf = ColumnsOf> = OmitId<FilterOf<S>>;
|
|
6
|
+
/**
|
|
7
|
+
* The part of a grid query that decides which rows come back: plain JSON for
|
|
8
|
+
* a request body or a TanStack Query key. Column layout, selection, and the
|
|
9
|
+
* open drawer are view state and are not part of it.
|
|
10
|
+
*
|
|
11
|
+
* TanStack Query hashes keys, so pass the request as is; elsewhere compare
|
|
12
|
+
* requests by value, since `toGridRequest` returns a new object each call.
|
|
13
|
+
*
|
|
14
|
+
* Every condition is ANDed. `search` is trimmed; the client grid matches each
|
|
15
|
+
* whitespace-separated term somewhere in the row's text. Money filter values
|
|
16
|
+
* are minor units. `page` is 1-based, so skip `(page - 1) * pageSize`.
|
|
17
|
+
*/
|
|
18
|
+
export type GridRequest<S extends ColumnsOf = ColumnsOf> = {
|
|
19
|
+
facet: FacetValue<S> | null;
|
|
20
|
+
search: string;
|
|
21
|
+
filters: readonly GridRequestFilter<S>[];
|
|
22
|
+
sorts: readonly SortOf<S>[];
|
|
23
|
+
page: number;
|
|
24
|
+
pageSize: number;
|
|
25
|
+
};
|
|
26
|
+
/** One page of rows that a server filtered, sorted, and sliced for a request. */
|
|
27
|
+
export type GridResult<TRow, S extends ColumnsOf = ColumnsOf> = {
|
|
28
|
+
/** The requested page, in order. */
|
|
29
|
+
rows: readonly TRow[];
|
|
30
|
+
/** Rows matching the request across every page. */
|
|
31
|
+
total: number;
|
|
32
|
+
/**
|
|
33
|
+
* Matches per facet option under every constraint except the facet itself.
|
|
34
|
+
* "All" shows `total` while no tab is selected and the sum of these counts
|
|
35
|
+
* while one is, so the options should cover every value the server returns.
|
|
36
|
+
* Leave it out and the tabs show no counts.
|
|
37
|
+
*/
|
|
38
|
+
facetCounts?: Readonly<Partial<Record<FacetValue<S>, number>>>;
|
|
39
|
+
/** Footer totals across every match, keyed by column. */
|
|
40
|
+
aggregates?: Readonly<Partial<Record<ColumnId<S>, AggregateValue>>>;
|
|
41
|
+
};
|
|
42
|
+
type RequestFields<S extends ColumnsOf> = Pick<GridQuery<S>, "facet" | "search" | "filters" | "sorts" | "page" | "pageSize">;
|
|
43
|
+
export declare function toGridRequest<S extends ColumnsOf>(query: RequestFields<S>): GridRequest<S>;
|
|
44
|
+
/**
|
|
45
|
+
* The server-side counterpart of `applyGridQuery`: the grid model for a page
|
|
46
|
+
* the server already filtered, sorted, and sliced.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveGridResult<TRow, S extends ColumnsOf>(schema: S & {
|
|
49
|
+
getRowId: (row: TRow) => string;
|
|
50
|
+
}, result: GridResult<TRow, S>, query: GridQuery<S>): GridModel<TRow, S>;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,QAAQ,EAGb,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EAId,KAAK,MAAM,EAEX,MAAM,SAAS,CAAC;AAEjB,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC;AAE3D,mFAAmF;AACnF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,MAAM,CACtE,QAAQ,CAAC,CA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AC,SAAS,SAAS,EAC1D,MAAM,EAAE,CAAC,GAAG;IAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,CAAA;CAAE,EAC/C,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,EAC3B,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAuDpB"}
|
|
@@ -15,19 +15,27 @@ export interface DatePickerProps {
|
|
|
15
15
|
onValueChange?: (date: Date | null) => void;
|
|
16
16
|
placeholder?: string;
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
/** Display only; editing always uses YYYY-MM-DD (signed six-digit years beyond 9999). */
|
|
18
19
|
format?: (date: Date) => string;
|
|
20
|
+
/** Accessible name for the text input. */
|
|
21
|
+
"aria-label"?: string;
|
|
19
22
|
min?: Date;
|
|
20
23
|
max?: Date;
|
|
21
24
|
size?: DatePickerSize;
|
|
22
25
|
className?: string;
|
|
23
26
|
}
|
|
24
27
|
/**
|
|
25
|
-
* A single-date picker
|
|
28
|
+
* A single-date picker with direct month/year navigation and editable local dates.
|
|
29
|
+
*
|
|
30
|
+
* Text edits use YYYY-MM-DD (signed six-digit years outside 0000–9999),
|
|
31
|
+
* independently of the display-only format callback. Enter or blur commits;
|
|
32
|
+
* invalid drafts stay visible, Escape restores the value, and empty edits clear.
|
|
33
|
+
* Opening recenters on the selected day (or today), clamped to min/max.
|
|
26
34
|
*
|
|
27
35
|
* Size follows the shared control-size contract (h-8 / h-9 / h-10,
|
|
28
36
|
* text-sm/font-medium) so the trigger aligns with Button, Input, and Select
|
|
29
37
|
* in a row. The calendar uses the leading-icon edge inset.
|
|
30
38
|
*/
|
|
31
|
-
export declare function DatePicker({ value, defaultValue, onValueChange, placeholder, disabled, format, min, max, size, className, }: DatePickerProps): import("react").JSX.Element;
|
|
39
|
+
export declare function DatePicker({ value, defaultValue, onValueChange, placeholder, disabled, format, min, max, size, className, "aria-label": ariaLabel, }: DatePickerProps): import("react").JSX.Element;
|
|
32
40
|
export { datePickerDayVariants, datePickerPopupVariants, datePickerTriggerVariants, };
|
|
33
41
|
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAmBlE,QAAA,MAAM,yBAAyB;;8EAmB9B,CAAC;AAEF,QAAA,MAAM,uBAAuB,oFAU3B,CAAC;AAEH,QAAA,MAAM,qBAAqB;;;;8EA8B1B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,YAAY,CACxC,OAAO,yBAAyB,CAChC,CAAC,MAAM,CAAC,CAAC;AAEV,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yFAAyF;IACzF,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IAChC,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EAC1B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAA2B,EAC3B,QAAQ,EACR,MAAsB,EACtB,GAAG,EACH,GAAG,EACH,IAAI,EACJ,SAAS,EACT,YAAY,EAAE,SAAkB,GAChC,EAAE,eAAe,+BAmYjB;AAED,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,GACzB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Construct local dates without the Date constructor's 1900 offset for years 0–99. */
|
|
2
|
+
export declare function localDate(year: number, month: number, day?: number): Date;
|
|
3
|
+
export declare function startOfDay(date: Date): Date;
|
|
4
|
+
/** Four-digit years, or signed six-digit expanded years, matching ISO calendar notation. */
|
|
5
|
+
export declare function formatDateEntry(date: Date): string;
|
|
6
|
+
export declare function parseDateEntry(text: string): Date | null;
|
|
7
|
+
export declare function isDateInBounds(date: Date, min?: Date, max?: Date): boolean;
|
|
8
|
+
export declare function monthIntersectsBounds(month: Date, min?: Date, max?: Date): boolean;
|
|
9
|
+
export declare function boundedMonth(date: Date, min?: Date, max?: Date): Date;
|
|
10
|
+
//# sourceMappingURL=dateLogic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateLogic.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/dateLogic.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,QAK7D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,QAEpC;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UAOzC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAYxD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,WAMhE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,WASxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,QAQ9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ct,wt,Nt,aa}from"../../index-s4wzrj6b.js";import"../../index-yzm4k2ye.js";import"../../index-3yf2yecs.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{aa as DatePicker,Nt as datePickerDayVariants,wt as datePickerPopupVariants,Ct as datePickerTriggerVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{mn,gn,fn,bn,xn,v}from"../../index-e3jk5qws.js";import"../../index-6hjt8vvj.js";export{v as Dialog,xn as dialogActionsVariants,bn as dialogDescriptionVariants,mn as dialogOverlayVariants,gn as dialogPopupVariants,fn as dialogTitleVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../index-6hjt8vvj.js";import"../../index-39gyjttt.js";import"../../index-yeehx7kc.js";import"../../index-s3543vem.js";import{rn,g}from"../../index-dha7m2cb.js";export{g as Drawer,rn as drawerPopupVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{Rt,St,Tt,kt,It,Dt,Vt,r}from"../../index-jbzvn81j.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{r as DropdownMenu,Rt as dropdownMenuContentVariants,St as dropdownMenuItemVariants,Tt as dropdownMenuLabelVariants,kt as dropdownMenuSeparatorVariants,It as dropdownMenuShortcutVariants,Vt as dropdownMenuSubContentVariants,Dt as dropdownMenuSubTriggerVariants};
|
|
@@ -2,8 +2,8 @@ import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import type * as React from "react";
|
|
4
4
|
declare const featuredIconVariants: (props?: ({
|
|
5
|
-
color?: "info" | "warning" | "success" | "error" | "
|
|
6
|
-
variant?: "ghost" | "
|
|
5
|
+
color?: "info" | "warning" | "success" | "error" | "gray" | "brand" | null | undefined;
|
|
6
|
+
variant?: "ghost" | "solid" | "light" | "modern" | null | undefined;
|
|
7
7
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
export interface FeaturedIconProps extends Omit<React.ComponentProps<"div">, "color">, VariantProps<typeof featuredIconVariants> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Et,P}from"../../index-4p3htnp4.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{P as FeaturedIcon,Et as featuredIconVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d,V,Ft,na,ia,sa,la,da,K,ca,j,pa,X}from"../../index-3yf2yecs.js";import"../../index-6hjt8vvj.js";export{na as Field,V as FieldContainerProvider,da as FieldContent,j as FieldDescription,X as FieldError,la as FieldGroup,K as FieldLabel,sa as FieldLegend,pa as FieldSeparator,ia as FieldSet,ca as FieldTitle,Ft as fieldVariants,d as useInFieldContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ot,ua}from"../../index-80vgqvbb.js";import"../../index-207wxbj2.js";import"../../index-4p3htnp4.js";import"../../index-626k16zr.js";import"../../index-39gyjttt.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{ua as FileUpload,Ot as fileUploadVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Vr,Fr,Or,Mr,Lr}from"../../index-xqphyc4g.js";import"../../index-6hjt8vvj.js";export{Vr as Footer,Lr as FooterLink,Or as FooterMeta,Mr as FooterNav,Fr as FooterRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Er,Ar,Br,zr,Gr}from"../../index-6wj27sgg.js";import"../../index-3yf2yecs.js";import"../../index-6hjt8vvj.js";export{Er as Form,Gr as FormActions,Ar as FormField,zr as FormRow,Br as FormSection};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { type GlossProps } from "./read";
|
|
3
|
+
/** A short reading of a datetime or an amount, with the exact value on hover or focus. */
|
|
4
|
+
export declare function Gloss(props: GlossProps): ReactElement;
|
|
5
|
+
export type { GlossProps };
|
|
6
|
+
//# sourceMappingURL=Gloss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gloss.d.ts","sourceRoot":"","sources":["../../../src/components/Gloss/Gloss.tsx"],"names":[],"mappings":"AAKA,OAAO,EACN,KAAK,YAAY,EAMjB,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,KAAK,UAAU,EAAsB,MAAM,QAAQ,CAAC;AAiL7D,0FAA0F;AAC1F,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,CAgDrD;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
|