@object-ui/components 3.4.0 → 4.0.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 +19 -0
- package/dist/index.css +3 -0
- package/dist/index.js +4963 -4865
- package/dist/index.umd.cjs +11 -11
- package/dist/packages/components/src/custom/grouping-editor.d.ts +50 -0
- package/dist/packages/components/src/custom/index.d.ts +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
export interface GroupingFieldEntry {
|
|
9
|
+
field: string;
|
|
10
|
+
order: 'asc' | 'desc';
|
|
11
|
+
collapsed: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface GroupingConfigValue {
|
|
14
|
+
fields: GroupingFieldEntry[];
|
|
15
|
+
}
|
|
16
|
+
export interface GroupingEditorProps {
|
|
17
|
+
/** Current grouping configuration. `undefined` when no grouping is active. */
|
|
18
|
+
value?: GroupingConfigValue;
|
|
19
|
+
/** Called whenever the user mutates the grouping. Pass `undefined` when the
|
|
20
|
+
* list is cleared so the consumer can detect "no grouping". */
|
|
21
|
+
onChange: (next: GroupingConfigValue | undefined) => void;
|
|
22
|
+
/** Available fields to group by. */
|
|
23
|
+
fieldOptions: Array<{
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Maximum nesting depth. Airtable defaults to 3. */
|
|
28
|
+
maxLevels?: number;
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Optional i18n labels — fall back to English. */
|
|
31
|
+
labels?: {
|
|
32
|
+
addGroup?: string;
|
|
33
|
+
collapseTitle?: string;
|
|
34
|
+
removeTitle?: string;
|
|
35
|
+
ascendingTitle?: string;
|
|
36
|
+
descendingTitle?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Airtable-style multi-level grouping editor.
|
|
41
|
+
*
|
|
42
|
+
* Each level is a row with: field selector, order toggle (↑/↓),
|
|
43
|
+
* "default collapsed" checkbox, and a remove button. A "+ Add group field"
|
|
44
|
+
* button appends a new level up to `maxLevels` (default 3).
|
|
45
|
+
*
|
|
46
|
+
* Field options are filtered per row so a field can only appear in one level
|
|
47
|
+
* at a time. The current row's selected field stays in its own dropdown so the
|
|
48
|
+
* user sees the active selection.
|
|
49
|
+
*/
|
|
50
|
+
export declare function GroupingEditor({ value, onChange, fieldOptions, maxLevels, className, labels, }: GroupingEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ export * from './navigation-overlay';
|
|
|
15
15
|
export * from './section-header';
|
|
16
16
|
export * from './spinner';
|
|
17
17
|
export * from './sort-builder';
|
|
18
|
+
export * from './grouping-editor';
|
|
18
19
|
export * from './action-param-dialog';
|
|
19
20
|
export * from './view-skeleton';
|
|
20
21
|
export * from './view-states';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Standard UI component library for Object UI, built with Shadcn UI + Tailwind CSS",
|
|
@@ -69,10 +69,10 @@
|
|
|
69
69
|
"tailwind-merge": "^3.5.0",
|
|
70
70
|
"tailwindcss-animate": "^1.0.7",
|
|
71
71
|
"vaul": "^1.1.2",
|
|
72
|
-
"@object-ui/core": "
|
|
73
|
-
"@object-ui/i18n": "
|
|
74
|
-
"@object-ui/react": "
|
|
75
|
-
"@object-ui/types": "
|
|
72
|
+
"@object-ui/core": "4.0.1",
|
|
73
|
+
"@object-ui/i18n": "4.0.1",
|
|
74
|
+
"@object-ui/react": "4.0.1",
|
|
75
|
+
"@object-ui/types": "4.0.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "^18.0.0 || ^19.0.0",
|