@object-ui/plugin-grid 3.1.1 → 3.1.3
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +22 -0
- package/dist/index.js +815 -774
- package/dist/index.umd.cjs +8 -8
- package/package.json +10 -10
- package/src/ListColumnExtensions.test.tsx +6 -6
- package/src/ObjectGrid.msw.test.tsx +3 -3
- package/src/ObjectGrid.stories.tsx +7 -7
- package/src/__tests__/accessorKey-inference.test.tsx +2 -2
- package/src/__tests__/airtable-style.test.tsx +8 -8
- package/src/__tests__/column-features.test.tsx +5 -5
- package/src/__tests__/grid-export.test.tsx +3 -3
- package/src/__tests__/mobile-card-view.test.tsx +6 -6
- package/src/__tests__/objectdef-enrichment.test.tsx +6 -6
- package/src/__tests__/row-bulk-actions.test.tsx +4 -4
- package/src/__tests__/row-height.test.tsx +2 -2
|
@@ -18,7 +18,7 @@ registerAllFields();
|
|
|
18
18
|
// --- Mock Data with various field types ---
|
|
19
19
|
const mockData = [
|
|
20
20
|
{
|
|
21
|
-
|
|
21
|
+
id: '1',
|
|
22
22
|
subject: 'Task Alpha',
|
|
23
23
|
status: 'In Progress',
|
|
24
24
|
priority: 'High',
|
|
@@ -29,7 +29,7 @@ const mockData = [
|
|
|
29
29
|
assignee: 'Alice Smith',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
id: '2',
|
|
33
33
|
subject: 'Task Beta',
|
|
34
34
|
status: 'Done',
|
|
35
35
|
priority: 'Low',
|
|
@@ -40,7 +40,7 @@ const mockData = [
|
|
|
40
40
|
assignee: 'Bob Jones',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
|
|
43
|
+
id: '3',
|
|
44
44
|
subject: 'Task Gamma',
|
|
45
45
|
status: 'To Do',
|
|
46
46
|
priority: 'Medium',
|
|
@@ -406,9 +406,9 @@ describe('Primary field auto-link', () => {
|
|
|
406
406
|
describe('Empty value display', () => {
|
|
407
407
|
it('should show styled empty indicator for null/empty values', async () => {
|
|
408
408
|
const dataWithEmpty = [
|
|
409
|
-
{
|
|
410
|
-
{
|
|
411
|
-
{
|
|
409
|
+
{ id: '1', subject: 'Task Alpha', company: null },
|
|
410
|
+
{ id: '2', subject: 'Task Beta', company: '' },
|
|
411
|
+
{ id: '3', subject: 'Task Gamma', company: 'Acme' },
|
|
412
412
|
];
|
|
413
413
|
|
|
414
414
|
const schema: any = {
|
|
@@ -474,8 +474,8 @@ describe('Record detail panel', () => {
|
|
|
474
474
|
// =========================================================================
|
|
475
475
|
describe('Auto-type inference: Currency/Amount fields', () => {
|
|
476
476
|
const currencyData = [
|
|
477
|
-
{
|
|
478
|
-
{
|
|
477
|
+
{ id: '1', name: 'Order 1', total_amount: 15459.99 },
|
|
478
|
+
{ id: '2', name: 'Order 2', total_amount: 289.50 },
|
|
479
479
|
];
|
|
480
480
|
|
|
481
481
|
function renderCurrencyGrid(columns: ListColumn[]) {
|
|
@@ -22,9 +22,9 @@ registerAllFields();
|
|
|
22
22
|
// Test data
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
const numericData = [
|
|
25
|
-
{
|
|
26
|
-
{
|
|
27
|
-
{
|
|
25
|
+
{ id: '1', name: 'Alice', amount: 100, score: 80 },
|
|
26
|
+
{ id: '2', name: 'Bob', amount: 200, score: 90 },
|
|
27
|
+
{ id: '3', name: 'Charlie', amount: 300, score: 70 },
|
|
28
28
|
];
|
|
29
29
|
|
|
30
30
|
// ---------------------------------------------------------------------------
|
|
@@ -150,8 +150,8 @@ describe('useColumnSummary', () => {
|
|
|
150
150
|
|
|
151
151
|
it('handles string numeric values', () => {
|
|
152
152
|
const data = [
|
|
153
|
-
{
|
|
154
|
-
{
|
|
153
|
+
{ id: '1', amount: '100' },
|
|
154
|
+
{ id: '2', amount: '200' },
|
|
155
155
|
];
|
|
156
156
|
const columns = [
|
|
157
157
|
{ field: 'amount', label: 'Amount', summary: { type: 'sum' } },
|
|
@@ -26,9 +26,9 @@ afterEach(() => {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const sampleData = [
|
|
29
|
-
{
|
|
30
|
-
{
|
|
31
|
-
{
|
|
29
|
+
{ id: '1', name: 'Alice', email: 'alice@example.com', status: 'Active' },
|
|
30
|
+
{ id: '2', name: 'Bob', email: 'bob@example.com', status: 'Inactive' },
|
|
31
|
+
{ id: '3', name: 'Charlie', email: 'charlie@example.com', status: 'Active' },
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
describe('Phase 10 - Grid Export', () => {
|
|
@@ -22,7 +22,7 @@ registerAllFields();
|
|
|
22
22
|
// --- Mock CRM Opportunity Data ---
|
|
23
23
|
const opportunityData = [
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
id: '101',
|
|
26
26
|
name: 'ObjectStack Enterprise License',
|
|
27
27
|
amount: 150000,
|
|
28
28
|
stage: 'Closed Won',
|
|
@@ -30,7 +30,7 @@ const opportunityData = [
|
|
|
30
30
|
probability: 100,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
id: '102',
|
|
34
34
|
name: 'Global Fin Q1 Upsell',
|
|
35
35
|
amount: 45000,
|
|
36
36
|
stage: 'Negotiation',
|
|
@@ -38,7 +38,7 @@ const opportunityData = [
|
|
|
38
38
|
probability: 80,
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
id: '103',
|
|
42
42
|
name: 'London Annual Renewal',
|
|
43
43
|
amount: 85000,
|
|
44
44
|
stage: 'Proposal',
|
|
@@ -268,7 +268,7 @@ describe('Mobile Card View: Percent field display', () => {
|
|
|
268
268
|
|
|
269
269
|
it('should hide empty/null percent fields', async () => {
|
|
270
270
|
const dataWithNull = [
|
|
271
|
-
{
|
|
271
|
+
{ id: '201', name: 'Test Deal', amount: 50000, stage: 'Proposal', close_date: '2024-06-01', probability: null },
|
|
272
272
|
];
|
|
273
273
|
renderGrid(dataWithNull, opportunityColumns);
|
|
274
274
|
|
|
@@ -340,8 +340,8 @@ describe('Mobile Card View: Empty field hiding', () => {
|
|
|
340
340
|
{ field: 'description', label: 'Description' },
|
|
341
341
|
];
|
|
342
342
|
const dataWithEmpty = [
|
|
343
|
-
{
|
|
344
|
-
{
|
|
343
|
+
{ id: '301', name: 'Deal A', amount: 10000, stage: 'Proposal', description: null },
|
|
344
|
+
{ id: '302', name: 'Deal B', amount: 20000, stage: 'Proposal', description: 'Has value' },
|
|
345
345
|
];
|
|
346
346
|
renderGrid(dataWithEmpty, columnsWithExtra);
|
|
347
347
|
|
|
@@ -20,9 +20,9 @@ registerAllFields();
|
|
|
20
20
|
|
|
21
21
|
// --- Opportunity-like mock data ---
|
|
22
22
|
const opportunityData = [
|
|
23
|
-
{
|
|
24
|
-
{
|
|
25
|
-
{
|
|
23
|
+
{ id: '1', name: 'Enterprise License', amount: 150000, stage: 'closed_won', close_date: '2024-01-15T00:00:00.000Z', probability: 100, forecast_category: 'commit' },
|
|
24
|
+
{ id: '2', name: 'E-Com Integration', amount: 12000, stage: 'closed_lost', close_date: '2024-02-10T00:00:00.000Z', probability: 0, forecast_category: 'omitted' },
|
|
25
|
+
{ id: '3', name: 'Tower Expansion', amount: 75000, stage: 'negotiation', close_date: '2024-02-28T00:00:00.000Z', probability: 80, forecast_category: 'best_case' },
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
// --- Mock objectSchema that resembles the Opportunity object definition ---
|
|
@@ -448,9 +448,9 @@ describe('Inline data with DataSource schema fetch', () => {
|
|
|
448
448
|
};
|
|
449
449
|
|
|
450
450
|
const inlineOrderData = [
|
|
451
|
-
{
|
|
452
|
-
{
|
|
453
|
-
{
|
|
451
|
+
{ id: 'o1', name: 'Order 001', status: 'pending', assigned_to: 'Alice' },
|
|
452
|
+
{ id: 'o2', name: 'Order 002', status: 'shipped', assigned_to: 'Bob' },
|
|
453
|
+
{ id: 'o3', name: 'Order 003', status: 'delivered', assigned_to: 'Charlie' },
|
|
454
454
|
];
|
|
455
455
|
|
|
456
456
|
const mockDataSource = createMockDataSource(lookupSchema, []);
|
|
@@ -18,11 +18,11 @@ registerAllFields();
|
|
|
18
18
|
// ---------------------------------------------------------------------------
|
|
19
19
|
// Test data
|
|
20
20
|
// ---------------------------------------------------------------------------
|
|
21
|
-
const testRow = {
|
|
21
|
+
const testRow = { id: '1', name: 'Alice', amount: 100 };
|
|
22
22
|
const testData = [
|
|
23
|
-
{
|
|
24
|
-
{
|
|
25
|
-
{
|
|
23
|
+
{ id: '1', name: 'Alice', amount: 100 },
|
|
24
|
+
{ id: '2', name: 'Bob', amount: 200 },
|
|
25
|
+
{ id: '3', name: 'Charlie', amount: 300 },
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
// ---------------------------------------------------------------------------
|
|
@@ -15,8 +15,8 @@ import { ActionProvider } from '@object-ui/react';
|
|
|
15
15
|
registerAllFields();
|
|
16
16
|
|
|
17
17
|
const mockData = [
|
|
18
|
-
{
|
|
19
|
-
{
|
|
18
|
+
{ id: '1', name: 'Alice', role: 'Engineer' },
|
|
19
|
+
{ id: '2', name: 'Bob', role: 'Designer' },
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
function renderGrid(opts?: Record<string, any>) {
|