@object-ui/plugin-dashboard 3.1.5 → 3.3.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +21 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1162 -939
  5. package/dist/index.umd.cjs +4 -4
  6. package/dist/packages/plugin-dashboard/src/DashboardConfigPanel.d.ts.map +1 -0
  7. package/dist/packages/plugin-dashboard/src/DashboardConfigPanel.stories.d.ts.map +1 -0
  8. package/dist/packages/plugin-dashboard/src/DashboardGridLayout.d.ts.map +1 -0
  9. package/dist/{src → packages/plugin-dashboard/src}/DashboardRenderer.d.ts +5 -0
  10. package/dist/packages/plugin-dashboard/src/DashboardRenderer.d.ts.map +1 -0
  11. package/dist/packages/plugin-dashboard/src/DashboardRenderer.stories.d.ts.map +1 -0
  12. package/dist/packages/plugin-dashboard/src/DashboardWithConfig.d.ts.map +1 -0
  13. package/dist/{src → packages/plugin-dashboard/src}/MetricCard.d.ts +4 -0
  14. package/dist/packages/plugin-dashboard/src/MetricCard.d.ts.map +1 -0
  15. package/dist/packages/plugin-dashboard/src/MetricWidget.d.ts +31 -0
  16. package/dist/packages/plugin-dashboard/src/MetricWidget.d.ts.map +1 -0
  17. package/dist/packages/plugin-dashboard/src/ObjectDataTable.d.ts.map +1 -0
  18. package/dist/packages/plugin-dashboard/src/ObjectMetricWidget.d.ts +59 -0
  19. package/dist/packages/plugin-dashboard/src/ObjectMetricWidget.d.ts.map +1 -0
  20. package/dist/packages/plugin-dashboard/src/ObjectPivotTable.d.ts.map +1 -0
  21. package/dist/packages/plugin-dashboard/src/PivotTable.d.ts.map +1 -0
  22. package/dist/packages/plugin-dashboard/src/WidgetConfigPanel.d.ts.map +1 -0
  23. package/dist/{src → packages/plugin-dashboard/src}/index.d.ts +4 -2
  24. package/dist/packages/plugin-dashboard/src/index.d.ts.map +1 -0
  25. package/dist/packages/plugin-dashboard/src/utils.d.ts.map +1 -0
  26. package/package.json +44 -11
  27. package/.turbo/turbo-build.log +0 -34
  28. package/dist/src/DashboardConfigPanel.d.ts.map +0 -1
  29. package/dist/src/DashboardConfigPanel.stories.d.ts.map +0 -1
  30. package/dist/src/DashboardGridLayout.d.ts.map +0 -1
  31. package/dist/src/DashboardRenderer.d.ts.map +0 -1
  32. package/dist/src/DashboardRenderer.stories.d.ts.map +0 -1
  33. package/dist/src/DashboardWithConfig.d.ts.map +0 -1
  34. package/dist/src/MetricCard.d.ts.map +0 -1
  35. package/dist/src/MetricWidget.d.ts +0 -24
  36. package/dist/src/MetricWidget.d.ts.map +0 -1
  37. package/dist/src/ObjectDataTable.d.ts.map +0 -1
  38. package/dist/src/ObjectPivotTable.d.ts.map +0 -1
  39. package/dist/src/PivotTable.d.ts.map +0 -1
  40. package/dist/src/WidgetConfigPanel.d.ts.map +0 -1
  41. package/dist/src/index.d.ts.map +0 -1
  42. package/dist/src/utils.d.ts.map +0 -1
  43. package/src/DashboardConfigPanel.stories.tsx +0 -164
  44. package/src/DashboardConfigPanel.tsx +0 -158
  45. package/src/DashboardGridLayout.tsx +0 -367
  46. package/src/DashboardRenderer.stories.tsx +0 -173
  47. package/src/DashboardRenderer.tsx +0 -445
  48. package/src/DashboardWithConfig.tsx +0 -211
  49. package/src/MetricCard.tsx +0 -82
  50. package/src/MetricWidget.tsx +0 -76
  51. package/src/ObjectDataTable.tsx +0 -226
  52. package/src/ObjectPivotTable.tsx +0 -160
  53. package/src/PivotTable.tsx +0 -262
  54. package/src/WidgetConfigPanel.tsx +0 -540
  55. package/src/__tests__/DashboardConfigPanel.test.tsx +0 -206
  56. package/src/__tests__/DashboardGridLayout.test.tsx +0 -199
  57. package/src/__tests__/DashboardRenderer.autoRefresh.test.tsx +0 -124
  58. package/src/__tests__/DashboardRenderer.designMode.test.tsx +0 -386
  59. package/src/__tests__/DashboardRenderer.header.test.tsx +0 -114
  60. package/src/__tests__/DashboardRenderer.mobile.test.tsx +0 -214
  61. package/src/__tests__/DashboardRenderer.widgetData.test.tsx +0 -1283
  62. package/src/__tests__/DashboardWithConfig.test.tsx +0 -276
  63. package/src/__tests__/MetricCard.test.tsx +0 -82
  64. package/src/__tests__/ObjectDataTable.test.tsx +0 -211
  65. package/src/__tests__/ObjectPivotTable.test.tsx +0 -192
  66. package/src/__tests__/PivotTable.test.tsx +0 -162
  67. package/src/__tests__/WidgetConfigPanel.test.tsx +0 -492
  68. package/src/__tests__/ensureWidgetIds.test.tsx +0 -103
  69. package/src/index.tsx +0 -214
  70. package/src/utils.ts +0 -17
  71. package/tsconfig.json +0 -19
  72. package/vite.config.ts +0 -63
  73. package/vitest.config.ts +0 -9
  74. package/vitest.setup.tsx +0 -18
  75. /package/dist/{src → packages/plugin-dashboard/src}/DashboardConfigPanel.d.ts +0 -0
  76. /package/dist/{src → packages/plugin-dashboard/src}/DashboardConfigPanel.stories.d.ts +0 -0
  77. /package/dist/{src → packages/plugin-dashboard/src}/DashboardGridLayout.d.ts +0 -0
  78. /package/dist/{src → packages/plugin-dashboard/src}/DashboardRenderer.stories.d.ts +0 -0
  79. /package/dist/{src → packages/plugin-dashboard/src}/DashboardWithConfig.d.ts +0 -0
  80. /package/dist/{src → packages/plugin-dashboard/src}/ObjectDataTable.d.ts +0 -0
  81. /package/dist/{src → packages/plugin-dashboard/src}/ObjectPivotTable.d.ts +0 -0
  82. /package/dist/{src → packages/plugin-dashboard/src}/PivotTable.d.ts +0 -0
  83. /package/dist/{src → packages/plugin-dashboard/src}/WidgetConfigPanel.d.ts +0 -0
  84. /package/dist/{src → packages/plugin-dashboard/src}/utils.d.ts +0 -0
package/src/index.tsx DELETED
@@ -1,214 +0,0 @@
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
-
9
- import { ComponentRegistry } from '@object-ui/core';
10
- import { DashboardRenderer } from './DashboardRenderer';
11
- import { DashboardGridLayout } from './DashboardGridLayout';
12
- import { MetricWidget } from './MetricWidget';
13
- import { MetricCard } from './MetricCard';
14
- import { PivotTable } from './PivotTable';
15
- import { ObjectPivotTable } from './ObjectPivotTable';
16
- import { ObjectDataTable } from './ObjectDataTable';
17
- import { DashboardConfigPanel } from './DashboardConfigPanel';
18
- import { WidgetConfigPanel } from './WidgetConfigPanel';
19
- import { DashboardWithConfig } from './DashboardWithConfig';
20
-
21
- export { DashboardRenderer, DashboardGridLayout, MetricWidget, MetricCard, PivotTable, ObjectPivotTable, ObjectDataTable, DashboardConfigPanel, WidgetConfigPanel, DashboardWithConfig };
22
-
23
- // Register dashboard component
24
- ComponentRegistry.register(
25
- 'dashboard',
26
- DashboardRenderer,
27
- {
28
- namespace: 'view',
29
- label: 'Dashboard',
30
- category: 'Complex',
31
- icon: 'layout-dashboard',
32
- inputs: [
33
- { name: 'columns', type: 'number', label: 'Columns', defaultValue: 3 },
34
- { name: 'gap', type: 'number', label: 'Gap', defaultValue: 4 },
35
- { name: 'className', type: 'string', label: 'CSS Class' }
36
- ],
37
- defaultProps: {
38
- columns: 3,
39
- widgets: []
40
- }
41
- }
42
- );
43
-
44
- // Register metric widget (legacy)
45
- ComponentRegistry.register(
46
- 'metric',
47
- MetricWidget,
48
- {
49
- namespace: 'plugin-dashboard',
50
- label: 'Metric Widget',
51
- category: 'Dashboard',
52
- inputs: [
53
- { name: 'label', type: 'string', label: 'Label' },
54
- { name: 'value', type: 'string', label: 'Value' },
55
- ]
56
- }
57
- );
58
-
59
- // Register metric card (new standalone component)
60
- ComponentRegistry.register(
61
- 'metric-card',
62
- MetricCard,
63
- {
64
- namespace: 'plugin-dashboard',
65
- label: 'Metric Card',
66
- category: 'Dashboard',
67
- inputs: [
68
- { name: 'title', type: 'string', label: 'Title' },
69
- { name: 'value', type: 'string', label: 'Value', required: true },
70
- { name: 'icon', type: 'string', label: 'Icon (Lucide name)' },
71
- { name: 'trend', type: 'enum', label: 'Trend', enum: [
72
- { label: 'Up', value: 'up' },
73
- { label: 'Down', value: 'down' },
74
- { label: 'Neutral', value: 'neutral' }
75
- ]},
76
- { name: 'trendValue', type: 'string', label: 'Trend Value (e.g., +12%)' },
77
- { name: 'description', type: 'string', label: 'Description' },
78
- ],
79
- defaultProps: {
80
- title: 'Metric',
81
- value: '0'
82
- }
83
- }
84
- );
85
-
86
- // Register pivot table component
87
- ComponentRegistry.register(
88
- 'pivot',
89
- PivotTable,
90
- {
91
- namespace: 'plugin-dashboard',
92
- label: 'Pivot Table',
93
- category: 'Dashboard',
94
- icon: 'table-2',
95
- inputs: [
96
- { name: 'title', type: 'string', label: 'Title' },
97
- { name: 'rowField', type: 'string', label: 'Row Field', required: true },
98
- { name: 'columnField', type: 'string', label: 'Column Field', required: true },
99
- { name: 'valueField', type: 'string', label: 'Value Field', required: true },
100
- { name: 'aggregation', type: 'enum', label: 'Aggregation', enum: [
101
- { label: 'Sum', value: 'sum' },
102
- { label: 'Count', value: 'count' },
103
- { label: 'Average', value: 'avg' },
104
- { label: 'Min', value: 'min' },
105
- { label: 'Max', value: 'max' },
106
- ]},
107
- { name: 'showRowTotals', type: 'boolean', label: 'Show Row Totals' },
108
- { name: 'showColumnTotals', type: 'boolean', label: 'Show Column Totals' },
109
- { name: 'format', type: 'string', label: 'Number Format' },
110
- ],
111
- defaultProps: {
112
- rowField: '',
113
- columnField: '',
114
- valueField: '',
115
- aggregation: 'sum',
116
- data: [],
117
- }
118
- }
119
- );
120
-
121
- // Register object-aware pivot table (async data loading)
122
- ComponentRegistry.register(
123
- 'object-pivot',
124
- ObjectPivotTable,
125
- {
126
- namespace: 'plugin-dashboard',
127
- label: 'Object Pivot Table',
128
- category: 'Dashboard',
129
- icon: 'table-2',
130
- inputs: [
131
- { name: 'objectName', type: 'string', label: 'Object Name', required: true },
132
- { name: 'title', type: 'string', label: 'Title' },
133
- { name: 'rowField', type: 'string', label: 'Row Field', required: true },
134
- { name: 'columnField', type: 'string', label: 'Column Field', required: true },
135
- { name: 'valueField', type: 'string', label: 'Value Field', required: true },
136
- { name: 'aggregation', type: 'enum', label: 'Aggregation', enum: [
137
- { label: 'Sum', value: 'sum' },
138
- { label: 'Count', value: 'count' },
139
- { label: 'Average', value: 'avg' },
140
- { label: 'Min', value: 'min' },
141
- { label: 'Max', value: 'max' },
142
- ]},
143
- { name: 'showRowTotals', type: 'boolean', label: 'Show Row Totals' },
144
- { name: 'showColumnTotals', type: 'boolean', label: 'Show Column Totals' },
145
- { name: 'filter', type: 'array', label: 'Filter' },
146
- { name: 'format', type: 'string', label: 'Number Format' },
147
- ],
148
- defaultProps: {
149
- rowField: '',
150
- columnField: '',
151
- valueField: '',
152
- aggregation: 'sum',
153
- }
154
- }
155
- );
156
-
157
- // Register dashboard grid layout component
158
- ComponentRegistry.register(
159
- 'dashboard-grid',
160
- DashboardGridLayout,
161
- {
162
- namespace: 'plugin-dashboard',
163
- label: 'Dashboard Grid (Editable)',
164
- category: 'Complex',
165
- icon: 'layout-grid',
166
- inputs: [
167
- { name: 'title', type: 'string', label: 'Title' },
168
- { name: 'persistLayoutKey', type: 'string', label: 'Layout Storage Key', defaultValue: 'dashboard-layout' },
169
- { name: 'className', type: 'string', label: 'CSS Class' }
170
- ],
171
- defaultProps: {
172
- title: 'Dashboard',
173
- widgets: [],
174
- persistLayoutKey: 'dashboard-layout',
175
- }
176
- }
177
- );
178
-
179
- // Register object-aware data table (async data loading)
180
- ComponentRegistry.register(
181
- 'object-data-table',
182
- ObjectDataTable,
183
- {
184
- namespace: 'plugin-dashboard',
185
- label: 'Object Data Table',
186
- category: 'Dashboard',
187
- icon: 'table',
188
- inputs: [
189
- { name: 'objectName', type: 'string', label: 'Object Name', required: true },
190
- { name: 'columns', type: 'array', label: 'Columns' },
191
- { name: 'filter', type: 'array', label: 'Filter' },
192
- { name: 'searchable', type: 'boolean', label: 'Searchable' },
193
- { name: 'pagination', type: 'boolean', label: 'Pagination' },
194
- ],
195
- defaultProps: {
196
- searchable: false,
197
- pagination: false,
198
- }
199
- }
200
- );
201
-
202
- // Standard Export Protocol - for manual integration
203
- export const dashboardComponents = {
204
- DashboardRenderer,
205
- DashboardGridLayout,
206
- MetricWidget,
207
- MetricCard,
208
- PivotTable,
209
- ObjectPivotTable,
210
- ObjectDataTable,
211
- DashboardConfigPanel,
212
- WidgetConfigPanel,
213
- DashboardWithConfig,
214
- };
package/src/utils.ts DELETED
@@ -1,17 +0,0 @@
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
-
9
- /** Returns true when the widget data config uses provider: 'object' (async data source). */
10
- export function isObjectProvider(widgetData: unknown): widgetData is { provider: 'object'; object?: string; aggregate?: any; filter?: any } {
11
- return (
12
- widgetData != null &&
13
- typeof widgetData === 'object' &&
14
- !Array.isArray(widgetData) &&
15
- (widgetData as any).provider === 'object'
16
- );
17
- }
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "jsx": "react-jsx",
6
- "baseUrl": ".",
7
- "paths": {
8
- "@/*": ["src/*"]
9
- },
10
- // Removed explicit rootDir to prevent file not under rootDir errors when importing from workspace dependencies
11
- "noEmit": false,
12
- "declaration": true,
13
- "composite": true,
14
- "declarationMap": true,
15
- "skipLibCheck": true
16
- },
17
- "include": ["src"],
18
- "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
19
- }
package/vite.config.ts DELETED
@@ -1,63 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import dts from 'vite-plugin-dts';
4
- import { resolve } from 'path';
5
-
6
- export default defineConfig({
7
- plugins: [
8
- react(),
9
- dts({
10
- insertTypesEntry: true,
11
- include: ['src'],
12
- exclude: ['**/*.test.ts', '**/*.test.tsx', 'node_modules'],
13
- skipDiagnostics: true,
14
- }),
15
- ],
16
- resolve: {
17
- alias: {
18
- '@': resolve(__dirname, './src'),
19
- '@object-ui/core': resolve(__dirname, '../core/src'),
20
- '@object-ui/types': resolve(__dirname, '../types/src'),
21
- '@object-ui/react': resolve(__dirname, '../react/src'),
22
- '@object-ui/components': resolve(__dirname, '../components/src'),
23
- '@object-ui/fields': resolve(__dirname, '../fields/src'),
24
- '@object-ui/plugin-grid': resolve(__dirname, '../plugin-grid/src'),
25
- },
26
- },
27
- build: {
28
- lib: {
29
- entry: resolve(__dirname, 'src/index.tsx'),
30
- name: 'ObjectUIPluginDashboard',
31
- fileName: 'index',
32
- },
33
- rollupOptions: {
34
- external: [
35
- 'react',
36
- 'react-dom',
37
- '@object-ui/components',
38
- '@object-ui/core',
39
- '@object-ui/react',
40
- '@object-ui/types',
41
- 'tailwind-merge',
42
- 'clsx',
43
- 'lucide-react'
44
- ],
45
- output: {
46
- globals: {
47
- react: 'React',
48
- 'react-dom': 'ReactDOM',
49
- '@object-ui/components': 'ObjectUIComponents',
50
- '@object-ui/core': 'ObjectUICore',
51
- '@object-ui/react': 'ObjectUIReact',
52
- '@object-ui/types': 'ObjectUITypes',
53
- },
54
- },
55
- },
56
- },
57
- test: {
58
- globals: true,
59
- environment: 'happy-dom',
60
- setupFiles: ['./vitest.setup.tsx'],
61
- passWithNoTests: true,
62
- },
63
- });
package/vitest.config.ts DELETED
@@ -1,9 +0,0 @@
1
- import { mergeConfig } from 'vitest/config';
2
- import rootConfig from '../../vitest.config.mts';
3
- import viteConfig from './vite.config';
4
-
5
- export default mergeConfig(rootConfig, mergeConfig(viteConfig, {
6
- test: {
7
- environment: 'jsdom',
8
- },
9
- }));
package/vitest.setup.tsx DELETED
@@ -1,18 +0,0 @@
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
-
9
- import { expect, afterEach } from 'vitest';
10
- import { cleanup } from '@testing-library/react';
11
- import * as matchers from '@testing-library/jest-dom/matchers';
12
- import '@testing-library/jest-dom';
13
-
14
- expect.extend(matchers);
15
-
16
- afterEach(() => {
17
- cleanup();
18
- });