@kronor/dtv 0.2.9 → 0.3.0
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/assets/InterVariable-CWi-zmRD.woff2 +0 -0
- package/dist/assets/InterVariable-Italic-d6KXgdvN.woff2 +0 -0
- package/dist/assets/index-BNgm6iTo.js +2105 -0
- package/dist/assets/index-CKkrV_Rb.css +1 -0
- package/dist/assets/primeicons-C6QP2o4f.woff2 +0 -0
- package/dist/assets/primeicons-DMOk5skT.eot +0 -0
- package/dist/assets/primeicons-Dr5RGzOO.svg +345 -0
- package/dist/assets/primeicons-MpK4pl85.ttf +0 -0
- package/dist/assets/primeicons-WjwUDZjB.woff +0 -0
- package/dist/index.html +17 -0
- package/package.json +5 -1
- package/.editorconfig +0 -12
- package/.github/copilot-instructions.md +0 -64
- package/.github/workflows/ci.yml +0 -51
- package/.husky/pre-commit +0 -8
- package/e2e/app.spec.ts +0 -6
- package/e2e/cell-renderer-setfilterstate.spec.ts +0 -63
- package/e2e/filter-sharing.spec.ts +0 -113
- package/e2e/filter-url-persistence.spec.ts +0 -36
- package/e2e/graphqlMock.ts +0 -144
- package/e2e/multi-field-filters.spec.ts +0 -95
- package/e2e/pagination.spec.ts +0 -38
- package/e2e/payment-request-email-filter.spec.ts +0 -67
- package/e2e/save-filter-splitbutton.spec.ts +0 -68
- package/e2e/simple-view-email-filter.spec.ts +0 -67
- package/e2e/simple-view-transforms.spec.ts +0 -171
- package/e2e/simple-view.spec.ts +0 -104
- package/e2e/transform-regression.spec.ts +0 -108
- package/eslint.config.js +0 -30
- package/index.html +0 -17
- package/jest.config.js +0 -10
- package/playwright.config.ts +0 -54
- package/src/App.externalRuntime.test.ts +0 -190
- package/src/App.tsx +0 -540
- package/src/assets/react.svg +0 -1
- package/src/components/AIAssistantForm.tsx +0 -241
- package/src/components/FilterForm.test.ts +0 -82
- package/src/components/FilterForm.tsx +0 -375
- package/src/components/PhoneNumberFilter.tsx +0 -102
- package/src/components/SavedFilterList.tsx +0 -181
- package/src/components/SpeechInput.tsx +0 -67
- package/src/components/Table.tsx +0 -119
- package/src/components/TablePagination.tsx +0 -40
- package/src/components/aiAssistant.test.ts +0 -270
- package/src/components/aiAssistant.ts +0 -291
- package/src/framework/cell-renderer-components/CurrencyAmount.tsx +0 -30
- package/src/framework/cell-renderer-components/LayoutHelpers.tsx +0 -74
- package/src/framework/cell-renderer-components/Link.tsx +0 -28
- package/src/framework/cell-renderer-components/Mapping.tsx +0 -11
- package/src/framework/cell-renderer-components.test.ts +0 -353
- package/src/framework/column-definition.tsx +0 -85
- package/src/framework/currency.test.ts +0 -46
- package/src/framework/currency.ts +0 -62
- package/src/framework/data.staticConditions.test.ts +0 -46
- package/src/framework/data.test.ts +0 -167
- package/src/framework/data.ts +0 -162
- package/src/framework/filter-form-state.test.ts +0 -189
- package/src/framework/filter-form-state.ts +0 -185
- package/src/framework/filter-sharing.test.ts +0 -135
- package/src/framework/filter-sharing.ts +0 -118
- package/src/framework/filters.ts +0 -194
- package/src/framework/graphql.buildHasuraConditions.test.ts +0 -473
- package/src/framework/graphql.paginationKey.test.ts +0 -29
- package/src/framework/graphql.test.ts +0 -286
- package/src/framework/graphql.ts +0 -462
- package/src/framework/native-runtime/index.tsx +0 -33
- package/src/framework/native-runtime/nativeComponents.test.ts +0 -108
- package/src/framework/runtime-reference.test.ts +0 -172
- package/src/framework/runtime.ts +0 -15
- package/src/framework/saved-filters.test.ts +0 -422
- package/src/framework/saved-filters.ts +0 -293
- package/src/framework/state.test.ts +0 -86
- package/src/framework/state.ts +0 -148
- package/src/framework/transform.test.ts +0 -51
- package/src/framework/view-parser-initialvalues.test.ts +0 -228
- package/src/framework/view-parser.ts +0 -714
- package/src/framework/view.test.ts +0 -1805
- package/src/framework/view.ts +0 -38
- package/src/index.css +0 -6
- package/src/main.tsx +0 -99
- package/src/views/index.ts +0 -12
- package/src/views/payment-requests/components/NoRowsExtendDateRange.tsx +0 -37
- package/src/views/payment-requests/components/PaymentMethod.tsx +0 -184
- package/src/views/payment-requests/components/PaymentStatusTag.tsx +0 -61
- package/src/views/payment-requests/index.ts +0 -1
- package/src/views/payment-requests/runtime.tsx +0 -145
- package/src/views/payment-requests/view.json +0 -692
- package/src/views/payment-requests-initial-values.test.ts +0 -73
- package/src/views/request-log/index.ts +0 -2
- package/src/views/request-log/runtime.tsx +0 -47
- package/src/views/request-log/view.json +0 -123
- package/src/views/simple-test-view/index.ts +0 -3
- package/src/views/simple-test-view/runtime.tsx +0 -85
- package/src/views/simple-test-view/view.json +0 -191
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.js +0 -7
- package/tsconfig.app.json +0 -26
- package/tsconfig.jest.json +0 -6
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -24
- package/vite.config.ts +0 -11
- /package/{public → dist}/vite.svg +0 -0
package/index.html
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en" class="h-full">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<link href="./src/index.css" rel="stylesheet">
|
|
9
|
-
<title>Filters Demo</title>
|
|
10
|
-
</head>
|
|
11
|
-
|
|
12
|
-
<body class="h-full w-full">
|
|
13
|
-
<div id="root"></div>
|
|
14
|
-
<script type="module" src="./src/main.tsx"></script>
|
|
15
|
-
</body>
|
|
16
|
-
|
|
17
|
-
</html>
|
package/jest.config.js
DELETED
package/playwright.config.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineConfig, devices } from '@playwright/test';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* See https://playwright.dev/docs/test-configuration.
|
|
5
|
-
*/
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
testDir: './e2e',
|
|
8
|
-
/* Run tests in files in parallel */
|
|
9
|
-
fullyParallel: !process.env.CI,
|
|
10
|
-
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
11
|
-
forbidOnly: !!process.env.CI,
|
|
12
|
-
/* Retry on CI only */
|
|
13
|
-
retries: process.env.CI ? 2 : 0,
|
|
14
|
-
/* Opt out of parallel tests on CI. */
|
|
15
|
-
workers: process.env.CI ? 1 : undefined,
|
|
16
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
17
|
-
reporter: process.env.CI ? [['github'], ['html']] : 'html',
|
|
18
|
-
/* Expect timeout for assertions */
|
|
19
|
-
expect: {
|
|
20
|
-
timeout: 10 * 1000, // 10 seconds for expect assertions
|
|
21
|
-
},
|
|
22
|
-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
23
|
-
use: {
|
|
24
|
-
/* Base URL to use in actions like \`await page.goto('/')\`. */
|
|
25
|
-
baseURL: 'http://localhost:5173',
|
|
26
|
-
|
|
27
|
-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
28
|
-
trace: 'on-first-retry',
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
/* Configure projects for major browsers */
|
|
32
|
-
projects: [
|
|
33
|
-
{
|
|
34
|
-
name: 'chromium',
|
|
35
|
-
use: { ...devices['Desktop Chrome'] },
|
|
36
|
-
},
|
|
37
|
-
// {
|
|
38
|
-
// name: 'firefox',
|
|
39
|
-
// use: { ...devices['Desktop Firefox'] },
|
|
40
|
-
// },
|
|
41
|
-
|
|
42
|
-
// {
|
|
43
|
-
// name: 'webkit',
|
|
44
|
-
// use: { ...devices['Desktop Safari'] },
|
|
45
|
-
// },
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
/* Run your local dev server before starting the tests */
|
|
49
|
-
webServer: {
|
|
50
|
-
command: 'npm run dev',
|
|
51
|
-
url: 'http://localhost:5173',
|
|
52
|
-
reuseExistingServer: !process.env.CI,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Tag } from 'primereact/tag';
|
|
3
|
-
import { parseViewJson } from './framework/view-parser';
|
|
4
|
-
import { FlexRow, FlexColumn, DateTime } from './framework/cell-renderer-components/LayoutHelpers';
|
|
5
|
-
import { CurrencyAmount } from './framework/cell-renderer-components/CurrencyAmount';
|
|
6
|
-
import { Mapping } from './framework/cell-renderer-components/Mapping';
|
|
7
|
-
import { Link } from './framework/cell-renderer-components/Link';
|
|
8
|
-
|
|
9
|
-
describe('External Runtime Integration', () => {
|
|
10
|
-
it('should use external runtime when available', () => {
|
|
11
|
-
const builtInRuntime = {
|
|
12
|
-
cellRenderers: {},
|
|
13
|
-
queryTransforms: {},
|
|
14
|
-
noRowsComponents: {},
|
|
15
|
-
customFilterComponents: {},
|
|
16
|
-
initialValues: {}
|
|
17
|
-
};
|
|
18
|
-
const externalRuntime = {
|
|
19
|
-
cellRenderers: {
|
|
20
|
-
customCellRenderer: () => 'Custom Cell',
|
|
21
|
-
},
|
|
22
|
-
queryTransforms: {
|
|
23
|
-
customTransform: {
|
|
24
|
-
toQuery: (input: any) => ({ value: input }),
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
noRowsComponents: {
|
|
28
|
-
customNoRows: () => 'No rows custom component',
|
|
29
|
-
},
|
|
30
|
-
customFilterComponents: {
|
|
31
|
-
customFilter: () => 'Custom filter',
|
|
32
|
-
},
|
|
33
|
-
initialValues: {}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const testView = {
|
|
37
|
-
title: 'Test External Runtime View',
|
|
38
|
-
id: 'test-external-runtime',
|
|
39
|
-
collectionName: 'testCollection',
|
|
40
|
-
paginationKey: 'id',
|
|
41
|
-
boolExpType: 'TestBoolExp',
|
|
42
|
-
orderByType: '[TestOrderBy!]',
|
|
43
|
-
columns: [
|
|
44
|
-
{
|
|
45
|
-
data: [{ type: 'field', path: 'id' }],
|
|
46
|
-
name: 'ID',
|
|
47
|
-
cellRenderer: { section: 'cellRenderers', key: 'customCellRenderer' },
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
filterSchema: {
|
|
51
|
-
groups: [{ name: 'default', label: null }],
|
|
52
|
-
filters: [],
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
// Test that parseViewJson works with external runtime
|
|
57
|
-
expect(() => {
|
|
58
|
-
const view = parseViewJson(testView, builtInRuntime, externalRuntime);
|
|
59
|
-
expect(view.title).toBe('Test External Runtime View');
|
|
60
|
-
expect(view.columnDefinitions).toHaveLength(1);
|
|
61
|
-
expect(view.columnDefinitions[0].name).toBe('ID');
|
|
62
|
-
expect(typeof view.columnDefinitions[0].cellRenderer).toBe('function');
|
|
63
|
-
}).not.toThrow();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('should fall back to built-in runtime when external runtime key not found', () => {
|
|
67
|
-
const builtInRuntime = {
|
|
68
|
-
cellRenderers: {
|
|
69
|
-
text: () => 'Built-in Text Cell',
|
|
70
|
-
},
|
|
71
|
-
queryTransforms: {},
|
|
72
|
-
noRowsComponents: {},
|
|
73
|
-
customFilterComponents: {},
|
|
74
|
-
initialValues: {}
|
|
75
|
-
};
|
|
76
|
-
const externalRuntime = undefined; // No external runtime provided
|
|
77
|
-
|
|
78
|
-
const testView = {
|
|
79
|
-
title: 'Test Fallback Runtime View',
|
|
80
|
-
id: 'test-fallback-runtime',
|
|
81
|
-
collectionName: 'testCollection',
|
|
82
|
-
paginationKey: 'id',
|
|
83
|
-
boolExpType: 'TestBoolExp',
|
|
84
|
-
orderByType: '[TestOrderBy!]',
|
|
85
|
-
columns: [
|
|
86
|
-
{
|
|
87
|
-
data: [{ type: 'field', path: 'id' }],
|
|
88
|
-
name: 'ID',
|
|
89
|
-
cellRenderer: { section: 'cellRenderers', key: 'text' },
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
filterSchema: {
|
|
93
|
-
groups: [{ name: 'default', label: null }],
|
|
94
|
-
filters: [],
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// Test that built-in runtime is used when external doesn't have the key
|
|
99
|
-
expect(() => {
|
|
100
|
-
const view = parseViewJson(testView, builtInRuntime, externalRuntime);
|
|
101
|
-
expect(view.title).toBe('Test Fallback Runtime View');
|
|
102
|
-
// Test the cell renderer function
|
|
103
|
-
const cellRenderer = view.columnDefinitions[0].cellRenderer;
|
|
104
|
-
const mockProps = {
|
|
105
|
-
data: { id: 'test' },
|
|
106
|
-
setFilterState: () => { },
|
|
107
|
-
applyFilters: () => { },
|
|
108
|
-
updateFilterById: () => { },
|
|
109
|
-
createElement: React.createElement,
|
|
110
|
-
components: {
|
|
111
|
-
Badge: Tag,
|
|
112
|
-
FlexRow,
|
|
113
|
-
FlexColumn,
|
|
114
|
-
Mapping,
|
|
115
|
-
DateTime,
|
|
116
|
-
CurrencyAmount,
|
|
117
|
-
Link
|
|
118
|
-
},
|
|
119
|
-
currency: { majorToMinor: (n: number) => n, minorToMajor: (n: number) => n }
|
|
120
|
-
};
|
|
121
|
-
expect(cellRenderer(mockProps)).toBe('Built-in Text Cell');
|
|
122
|
-
}).not.toThrow();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('should prefer external runtime over built-in when both have same key', () => {
|
|
126
|
-
const builtInRuntime = {
|
|
127
|
-
cellRenderers: {
|
|
128
|
-
text: () => 'Built-in Default',
|
|
129
|
-
},
|
|
130
|
-
queryTransforms: {},
|
|
131
|
-
noRowsComponents: {},
|
|
132
|
-
customFilterComponents: {},
|
|
133
|
-
initialValues: {}
|
|
134
|
-
};
|
|
135
|
-
const externalRuntime = {
|
|
136
|
-
cellRenderers: {
|
|
137
|
-
text: () => 'External Override',
|
|
138
|
-
},
|
|
139
|
-
queryTransforms: {},
|
|
140
|
-
noRowsComponents: {},
|
|
141
|
-
customFilterComponents: {},
|
|
142
|
-
initialValues: {}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const testView = {
|
|
146
|
-
title: 'Test Precedence View',
|
|
147
|
-
id: 'test-precedence',
|
|
148
|
-
collectionName: 'testCollection',
|
|
149
|
-
paginationKey: 'id',
|
|
150
|
-
boolExpType: 'TestBoolExp',
|
|
151
|
-
orderByType: '[TestOrderBy!]',
|
|
152
|
-
columns: [
|
|
153
|
-
{
|
|
154
|
-
data: [{ type: 'field', path: 'id' }],
|
|
155
|
-
name: 'ID',
|
|
156
|
-
cellRenderer: { section: 'cellRenderers', key: 'text' },
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
filterSchema: {
|
|
160
|
-
groups: [{ name: 'default', label: null }],
|
|
161
|
-
filters: [],
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
expect(() => {
|
|
166
|
-
const view = parseViewJson(testView, builtInRuntime, externalRuntime);
|
|
167
|
-
expect(view.title).toBe('Test Precedence View');
|
|
168
|
-
// Test that external runtime took precedence
|
|
169
|
-
const cellRenderer = view.columnDefinitions[0].cellRenderer;
|
|
170
|
-
const mockProps = {
|
|
171
|
-
data: { id: 'test' },
|
|
172
|
-
setFilterState: () => { },
|
|
173
|
-
applyFilters: () => { },
|
|
174
|
-
updateFilterById: () => { },
|
|
175
|
-
createElement: React.createElement,
|
|
176
|
-
components: {
|
|
177
|
-
Badge: Tag,
|
|
178
|
-
FlexRow,
|
|
179
|
-
FlexColumn,
|
|
180
|
-
Mapping,
|
|
181
|
-
DateTime,
|
|
182
|
-
CurrencyAmount,
|
|
183
|
-
Link
|
|
184
|
-
},
|
|
185
|
-
currency: { majorToMinor: (n: number) => n, minorToMajor: (n: number) => n }
|
|
186
|
-
};
|
|
187
|
-
expect(cellRenderer(mockProps)).toBe('External Override');
|
|
188
|
-
}).not.toThrow();
|
|
189
|
-
});
|
|
190
|
-
});
|