@nubitio/devextreme 0.6.8
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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/index.cjs +1141 -0
- package/dist/index.d.cts +126 -0
- package/dist/index.d.mts +126 -0
- package/dist/index.mjs +1104 -0
- package/dist/style.css +184 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Johan Guerreros
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @nubitio/devextreme
|
|
2
|
+
|
|
3
|
+
Optional DevExtreme-backed grid and form views for `@nubitio/crud`. Use this package when your team already has a DevExtreme license and wants DataGrid / Form instead of the native Nubit controls.
|
|
4
|
+
|
|
5
|
+
The CRUD engine (field DSL, adapters, RBAC, routing, shells) stays in `@nubitio/crud`. This package only swaps the two view implementations.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @nubitio/devextreme @nubitio/crud @nubitio/core @nubitio/ui devextreme devextreme-react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`devextreme`, `devextreme-react`, and `@nubitio/ui` are **peer dependencies** — install them in your app. DevExtreme requires a valid commercial license.
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
Import DevExtreme styles in your app entry (before or after Nubit styles):
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import 'devextreme/dist/css/dx.light.css';
|
|
21
|
+
import '@nubitio/ui/style.css';
|
|
22
|
+
import '@nubitio/crud/style.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Wrap CRUD pages with the provider:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { DevExtremeCrudProvider } from '@nubitio/devextreme';
|
|
29
|
+
import { SchemaCrudPage, defineResource, textField } from '@nubitio/crud';
|
|
30
|
+
|
|
31
|
+
const products = defineResource('/api/products', {
|
|
32
|
+
title: 'Products',
|
|
33
|
+
fields: [textField('name').label('Name')],
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export function ProductsPage() {
|
|
37
|
+
return (
|
|
38
|
+
<DevExtremeCrudProvider>
|
|
39
|
+
<SchemaCrudPage resource={products} />
|
|
40
|
+
</DevExtremeCrudProvider>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`CrudPage`, `SchemaCrudPage`, and `SmartCrudPage` all read the active view pair from `CrudViewProvider`.
|
|
46
|
+
|
|
47
|
+
## Partial override
|
|
48
|
+
|
|
49
|
+
Swap only one view if needed:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
<DevExtremeCrudProvider views={{ DataGridView: DevExtremeDataGridView }} />
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Supported today
|
|
56
|
+
|
|
57
|
+
| Feature | DevExtreme adapter |
|
|
58
|
+
|---------|-------------------|
|
|
59
|
+
| Remote paging / sort | `CustomStore` → `ResourceStore` |
|
|
60
|
+
| Server-side filters | `convertDxFilterToNubit` + per-field `buildFilterTerms` |
|
|
61
|
+
| Routing filters (`CrudPage` URL state) | merged via `mergeGridFilters` |
|
|
62
|
+
| Popup CRUD (add/edit/delete) | toolbar + command column |
|
|
63
|
+
| Inline edit `row` / `cell` / `batch` | `Editing` + `CustomStore.update` |
|
|
64
|
+
| Batch save hook | `onBatchSave` / `GridHandle.saveChanges()` |
|
|
65
|
+
| Dialog form save | `useFormSubmit` + dxForm |
|
|
66
|
+
| Master-detail form lines | `DevExtremeFormDetailGrid` |
|
|
67
|
+
| Expanded-row grid detail | `DevExtremeDetailGridSection` via `MasterDetail` |
|
|
68
|
+
| File fields | `FileUploadField` from `@nubitio/crud` |
|
|
69
|
+
|
|
70
|
+
## Demo
|
|
71
|
+
|
|
72
|
+
`examples/admin-demo` includes a **Users (DevExtreme)** route at `/users-dx` that wraps `CrudPage` with `DevExtremeCrudProvider` and demonstrates master-detail posts per user.
|
|
73
|
+
|
|
74
|
+
## Still native-only
|
|
75
|
+
|
|
76
|
+
- Mobile card layout for the main grid
|
|
77
|
+
- `html` / `contentRender` custom field renderers
|
|
78
|
+
- Column presets UI (fields still respect `visibleColumns`)
|
|
79
|
+
|
|
80
|
+
Extend `mapFieldsToDxColumns` / `mapFieldsToDxFormItems` or pass custom components through `views` for further parity.
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
`@nubitio/devextreme` is MIT. DevExtreme itself requires a separate commercial license from DevExpress.
|