@arqel-dev/types 0.16.0 → 0.17.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/index.d.ts +1 -0
- package/dist/relations.d.ts +27 -0
- package/dist/relations.js +3 -0
- package/dist/relations.js.map +1 -0
- package/dist/resources.d.ts +7 -0
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { ActionColor, ActionFormField, ActionMethod, ActionSchema, ActionType, A
|
|
|
2
2
|
export { BelongsToFieldProps, BelongsToFieldSchema, BooleanFieldProps, BooleanFieldSchema, ColorFieldProps, ColorFieldSchema, ColorFormat, CurrencyFieldProps, CurrencyFieldSchema, DateFieldProps, DateFieldSchema, DateTimeFieldProps, DateTimeFieldSchema, EmailFieldSchema, FieldSchema, FieldType, FieldValidation, FieldVisibility, FileFieldProps, FileFieldSchema, HasManyFieldProps, HasManyFieldSchema, HiddenFieldSchema, ImageFieldProps, ImageFieldSchema, MultiSelectFieldProps, MultiSelectFieldSchema, NumberFieldProps, NumberFieldSchema, PasswordFieldSchema, RadioFieldProps, RadioFieldSchema, SelectFieldProps, SelectFieldSchema, SelectOption, SlugFieldProps, SlugFieldSchema, TextFieldProps, TextFieldSchema, TextareaFieldSchema, ToggleFieldProps, ToggleFieldSchema, UrlFieldSchema, isFieldType } from './fields.js';
|
|
3
3
|
export { ColumnsEntry, ColumnsProps, FieldEntry, FieldsetEntry, FieldsetProps, FormSchema, GridEntry, GridProps, GroupEntry, GroupOrientation, GroupProps, LayoutEntry, LayoutType, SchemaEntry, SectionEntry, SectionProps, TabEntry, TabProps, TabsEntry, TabsOrientation, TabsProps, isFieldEntry, isLayoutEntry, resolveFieldEntry } from './forms.js';
|
|
4
4
|
export { ArqelMeta, ArqelPageProps, AuthPayload, AuthUserPayload, FlashPayload, PanelPayload, SharedProps } from './inertia.js';
|
|
5
|
+
export { RelationManagerAbilities, RelationManagerProps } from './relations.js';
|
|
5
6
|
export { PaginationMeta, PlainResourceIndexProps, RecordType, ResourceCreateProps, ResourceDetailProps, ResourceEditProps, ResourceIndexProps, ResourceMeta } from './resources.js';
|
|
6
7
|
export { BadgeColumnProps, BadgeColumnSchema, BadgeOption, BooleanColumnProps, BooleanColumnSchema, ColumnAlign, ColumnSchema, ColumnType, ComputedColumnProps, ComputedColumnSchema, DateColumnMode, DateColumnProps, DateColumnSchema, DateRangeFilterProps, DateRangeFilterSchema, FilterSchema, FilterType, IconColumnProps, IconColumnSchema, ImageColumnProps, ImageColumnSchema, ImageColumnShape, MultiSelectFilterSchema, NumberColumnProps, NumberColumnSchema, RelationshipColumnProps, RelationshipColumnSchema, ScopeFilterSchema, SelectFilterProps, SelectFilterSchema, SortDirection, TableSort, TernaryFilterProps, TernaryFilterSchema, TernaryState, TextColumnProps, TextColumnSchema, TextFilterSchema } from './tables.js';
|
|
7
8
|
export { TenantContextProps, TenantSummary } from './tenant.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relation manager payload — the shape returned by
|
|
3
|
+
* `Arqel\Core\Relations\RelationManager::toArray()`.
|
|
4
|
+
*
|
|
5
|
+
* `table` and `fields` are typed `unknown`/`unknown[]` here (matching the
|
|
6
|
+
* PHP method's own untyped return) rather than `TableSchema`/`FieldSchema[]`:
|
|
7
|
+
* `arqel-dev/types` mirrors `arqel-dev/core`'s deliberate decoupling from
|
|
8
|
+
* `arqel-dev/table`/`arqel-dev/form` (see `RelationManager`'s class docblock).
|
|
9
|
+
* Consumers narrow as needed when wiring the real `DataTable`.
|
|
10
|
+
*/
|
|
11
|
+
interface RelationManagerAbilities {
|
|
12
|
+
create: boolean;
|
|
13
|
+
update: boolean;
|
|
14
|
+
delete: boolean;
|
|
15
|
+
attach: boolean;
|
|
16
|
+
detach: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface RelationManagerProps {
|
|
19
|
+
slug: string;
|
|
20
|
+
label: string;
|
|
21
|
+
type: 'hasMany' | 'morphMany' | 'belongsToMany';
|
|
22
|
+
table: unknown;
|
|
23
|
+
fields: unknown[];
|
|
24
|
+
abilities: RelationManagerAbilities;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type { RelationManagerAbilities, RelationManagerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"relations.js"}
|
package/dist/resources.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ResourceActions } from './actions.js';
|
|
2
2
|
import { FieldSchema } from './fields.js';
|
|
3
|
+
import { RelationManagerProps } from './relations.js';
|
|
3
4
|
import { ColumnSchema, FilterSchema, TableSort } from './tables.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -106,6 +107,12 @@ interface ResourceEditProps<TRecord extends RecordType = RecordType> {
|
|
|
106
107
|
recordTitle: string;
|
|
107
108
|
recordSubtitle: string | null;
|
|
108
109
|
fields: FieldSchema[];
|
|
110
|
+
/**
|
|
111
|
+
* One entry per `RelationManager` declared on the Resource
|
|
112
|
+
* (`InertiaDataBuilder::serializeRelations`) — `[]` for Resources
|
|
113
|
+
* without relation managers (the common case; purely additive prop).
|
|
114
|
+
*/
|
|
115
|
+
relations?: RelationManagerProps[];
|
|
109
116
|
}
|
|
110
117
|
/**
|
|
111
118
|
* Show / detail page props — same shape as edit; React renders
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arqel-dev/types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Shared TypeScript types for Arqel — fields, resources, tables, forms, actions, and Inertia shared props.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://arqel.dev",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"types": "./dist/inertia.d.ts",
|
|
48
48
|
"import": "./dist/inertia.js"
|
|
49
49
|
},
|
|
50
|
+
"./relations": {
|
|
51
|
+
"types": "./dist/relations.d.ts",
|
|
52
|
+
"import": "./dist/relations.js"
|
|
53
|
+
},
|
|
50
54
|
"./tenant": {
|
|
51
55
|
"types": "./dist/tenant.d.ts",
|
|
52
56
|
"import": "./dist/tenant.js"
|