@nestjs-dash/core 0.1.0 → 1.0.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/actions/handlers.d.ts +1 -1
- package/dist/actions/index.d.ts +10 -10
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +141 -93
- package/dist/actions/index.js.map +1 -1
- package/dist/charts/index.d.ts +6 -6
- package/dist/charts/index.d.ts.map +1 -1
- package/dist/charts/index.js +18 -27
- package/dist/charts/index.js.map +1 -1
- package/dist/forms/index.d.ts +9 -9
- package/dist/forms/index.d.ts.map +1 -1
- package/dist/forms/index.js +124 -76
- package/dist/forms/index.js.map +1 -1
- package/dist/forms/json-fields.d.ts +1 -1
- package/dist/forms/json-fields.js +15 -15
- package/dist/forms/validation.d.ts +2 -2
- package/dist/forms/validation.js +2 -2
- package/dist/index.d.ts +29 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -91
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +44 -24
- package/dist/schemas/index.js.map +1 -1
- package/dist/tables/index.d.ts +12 -12
- package/dist/tables/index.d.ts.map +1 -1
- package/dist/tables/index.js +23 -26
- package/dist/tables/index.js.map +1 -1
- package/dist/tables/list-query-config.d.ts +3 -3
- package/dist/tables/list-query-config.d.ts.map +1 -1
- package/dist/tables/list-query-config.js +4 -4
- package/dist/tables/list-query-config.js.map +1 -1
- package/package.json +6 -21
- package/LICENSE +0 -21
- package/README.md +0 -81
package/package.json
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-dash/core",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Panel, Resource, Table/Form/Action/Schema builders for
|
|
5
|
-
"homepage": "https://github.com/nestjs-dash/core/tree/main/packages/core#readme",
|
|
6
|
-
"bugs": {
|
|
7
|
-
"url": "https://github.com/nestjs-dash/core/issues"
|
|
8
|
-
},
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Panel, Resource, Table/Form/Action/Schema builders for NestJS Dash (the NestJS host module lives in @nestjs-dash/nestjs; ORM adapters in @nestjs-dash/{typeorm,mikroorm,prisma,in-memory})",
|
|
9
5
|
"license": "MIT",
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/nestjs-dash/core.git",
|
|
13
|
-
"directory": "packages/core"
|
|
14
|
-
},
|
|
15
6
|
"files": [
|
|
16
7
|
"dist"
|
|
17
8
|
],
|
|
@@ -26,19 +17,14 @@
|
|
|
26
17
|
"access": "public"
|
|
27
18
|
},
|
|
28
19
|
"dependencies": {
|
|
29
|
-
"@nestjs-dash/adapter": "0.0
|
|
30
|
-
"@nestjs-dash/support": "
|
|
20
|
+
"@nestjs-dash/adapter": "1.0.0",
|
|
21
|
+
"@nestjs-dash/support": "1.0.0",
|
|
31
22
|
"lucide": "^1.45.0",
|
|
32
23
|
"zod": "^4.6.2"
|
|
33
24
|
},
|
|
34
25
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"
|
|
37
|
-
"@vitest/coverage-v8": "5.0.0",
|
|
38
|
-
"oxfmt": "^0.67.0",
|
|
39
|
-
"oxlint": "^1.82.0",
|
|
40
|
-
"release-it": "^21.0.2",
|
|
41
|
-
"typescript": "7.0.2",
|
|
26
|
+
"@nestjs-dash/typescript-config": "0.1.0",
|
|
27
|
+
"typescript": "6.0.3",
|
|
42
28
|
"vitest": "^5.0.0"
|
|
43
29
|
},
|
|
44
30
|
"peerDependencies": {
|
|
@@ -56,7 +42,6 @@
|
|
|
56
42
|
"lint": "oxlint src",
|
|
57
43
|
"test": "vitest run",
|
|
58
44
|
"test:coverage": "vitest run --coverage",
|
|
59
|
-
"release": "release-it",
|
|
60
45
|
"dev": "tsc -p tsconfig.json --watch"
|
|
61
46
|
}
|
|
62
47
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 nestjs-dash
|
|
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
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# @nestjs-dash/core
|
|
2
|
-
|
|
3
|
-
Filament-style fluent builders and the domain model at the heart of nestjs-dash: `Resource`, `Page`, `Panel`, `RelationManager`, and the `Table`/`Schema` (form) builders, plus field/column/action/chart builders. This package depends only on `@nestjs-dash/adapter` and `@nestjs-dash/support` — no ORM, no React, no `@nestjs/*` — so the same `Resource` subclass works no matter which adapter or host you wire it up with.
|
|
4
|
-
|
|
5
|
-
The NestJS host module that actually serves a panel lives in [`@nestjs-dash/nestjs`](https://github.com/nestjs-dash/nestjs-dash); ORM adapters live in their own packages (`@nestjs-dash/typeorm`, `@nestjs-dash/mikroorm`, `@nestjs-dash/prisma`, `@nestjs-dash/in-memory`).
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm add @nestjs-dash/core
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Example resource
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { Resource, TextColumn, TextInput, type Schema, type Table } from "@nestjs-dash/core";
|
|
17
|
-
|
|
18
|
-
export class UserResource extends Resource {
|
|
19
|
-
static override slug = "users";
|
|
20
|
-
static override label = "User";
|
|
21
|
-
|
|
22
|
-
static override table(table: Table) {
|
|
23
|
-
return table.columns([
|
|
24
|
-
TextColumn.make("id").sortable(),
|
|
25
|
-
TextColumn.make("email").searchable().sortable(),
|
|
26
|
-
]);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static override form(form: Schema) {
|
|
30
|
-
return form.components([TextInput.make("email").email().required()]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Field builders
|
|
36
|
-
|
|
37
|
-
| Field | Notes |
|
|
38
|
-
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
-
| `TextInput` | text/email/password, `.icon()`/`.prefix()`/`.suffix()` |
|
|
40
|
-
| `Textarea` | |
|
|
41
|
-
| `Select` | static `.options()` or `.relationship()` (BelongsTo, loaded at runtime) |
|
|
42
|
-
| `Radio` | same `.options()` shape as `Select`, rendered as a radio group |
|
|
43
|
-
| `Checkbox` / `Toggle` | |
|
|
44
|
-
| `DatePicker` / `DateTimePicker` | native `date` / `datetime-local` inputs |
|
|
45
|
-
| `ColorPicker` | native `color` input |
|
|
46
|
-
| `CodeEditor` | monospace textarea with a `.language()` caption (no syntax highlighting) |
|
|
47
|
-
| `TagsInput` | chip input, submits a JSON array |
|
|
48
|
-
| `RichEditor` | markdown-toolbar-over-textarea — not a WYSIWYG editor |
|
|
49
|
-
| `ImageUpload` / `FileUpload` | share `disk()`/`directory()`/`visibility()`/`acceptedFileTypes()`/`maxSize()`; `ImageUpload` adds `shape()`/`croppable()`/`aspectRatio()`/`collection()` |
|
|
50
|
-
| `Repeater` | repeatable field group (`.schema([...])` of `TextInput`/`Textarea`/`Select`/`Checkbox`/`Toggle`), with `.minItems()`/`.maxItems()` |
|
|
51
|
-
|
|
52
|
-
Inputs accept an icon and text prefix/suffix:
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
TextInput.make("price").icon("dollar-sign").prefix("$").suffix("USD");
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Actions
|
|
59
|
-
|
|
60
|
-
`Action` and its `EditAction`/`DeleteAction`/`BulkAction`/… subclasses support an icon position, a badge, a size, and an explicit variant — `.color()` maps to a Button variant (`primary`→`default`, `danger`→`destructive`, `gray`→`outline`, `success`/`warning`→matching variants):
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
Action.make("promote").icon("star").iconPosition("end").badge(3, "red").color("warning");
|
|
64
|
-
Action.make("refresh").icon("refresh-cw").iconOnly(); // tooltip'd icon-only button
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Charts
|
|
68
|
-
|
|
69
|
-
`BarChart`/`LineChart`/`PieChart` builders produce a JSON-serializable `ChartSpec` (from `@nestjs-dash/support`) that `@nestjs-dash/design-system`'s `ChartWidget` renders client-side.
|
|
70
|
-
|
|
71
|
-
## Column-capability precedence
|
|
72
|
-
|
|
73
|
-
`.sortable()`/`.searchable()` on a `table()` column can conflict with an entity's `@Sortable()`/`@Searchable()`/`@Filterable()` decorator or the adapter's own default — see [`@nestjs-dash/adapter`](https://github.com/nestjs-dash/nestjs-dash) for the resolution rule (Resource Builder > Entity Decorator > Adapter Default).
|
|
74
|
-
|
|
75
|
-
## Part of nestjs-dash
|
|
76
|
-
|
|
77
|
-
This package is one piece of [nestjs-dash](https://github.com/nestjs-dash/nestjs-dash), a NestJS-native admin framework. Wire a `Resource` up with `@nestjs-dash/nestjs` and an ORM adapter to actually serve a panel.
|
|
78
|
-
|
|
79
|
-
## License
|
|
80
|
-
|
|
81
|
-
MIT
|