runeforge 0.0.23 → 0.0.25
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/README.md +469 -21
- package/dist/components/Modal.svelte +26 -1
- package/dist/components/Modal.svelte.d.ts +9 -0
- package/dist/components/crud/EmbeddedField.svelte +144 -0
- package/dist/components/crud/EmbeddedField.svelte.d.ts +29 -0
- package/dist/components/crud/Field.svelte +5 -1
- package/dist/components/crud/utils/embedded.d.ts +4 -0
- package/dist/components/crud/utils/embedded.js +40 -0
- package/dist/components/crud/utils/resolution.js +5 -1
- package/dist/components/crud/utils/validation.js +16 -1
- package/dist/components/crud/views/Create.svelte +3 -13
- package/dist/components/crud/views/Update.svelte +3 -4
- package/dist/components/form/Select.svelte +55 -56
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/es.js +3 -0
- package/dist/i18n/types.d.ts +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/types/attribute.d.ts +13 -2
- package/dist/types/attribute.js +1 -0
- package/dist/types/crud.d.ts +7 -2
- package/package.json +1 -1
package/dist/types/crud.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component } from 'svelte';
|
|
2
2
|
import type { FullAutoFill } from 'svelte/elements';
|
|
3
|
-
import type { AttributeType, SearchResolver } from './attribute.js';
|
|
3
|
+
import type { AttributeType, SearchResolver, RequiredResolver } from './attribute.js';
|
|
4
4
|
import type { CellComponent, CellFormatter } from './table.js';
|
|
5
5
|
export type ColumnDefinition<T extends object = Record<string, unknown>> = {
|
|
6
6
|
[K in keyof T & string]: {
|
|
@@ -17,7 +17,7 @@ export interface FieldDefinition<T extends object = Record<string, unknown>> {
|
|
|
17
17
|
attribute: keyof T & string;
|
|
18
18
|
title?: string;
|
|
19
19
|
type?: AttributeType;
|
|
20
|
-
required?: boolean;
|
|
20
|
+
required?: boolean | RequiredResolver;
|
|
21
21
|
autocomplete?: FullAutoFill;
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
default?: any;
|
|
@@ -39,6 +39,11 @@ export interface FieldDefinition<T extends object = Record<string, unknown>> {
|
|
|
39
39
|
minLength?: number;
|
|
40
40
|
maxLength?: number;
|
|
41
41
|
pattern?: string;
|
|
42
|
+
/** Embedded fields only: sub-field definitions for each item, built from
|
|
43
|
+
* the metadata's `fields`. */
|
|
44
|
+
fields?: FieldDefinition<Record<string, unknown>>[];
|
|
45
|
+
/** Embedded fields only: short label for an item in the list. */
|
|
46
|
+
itemLabel?: (item: Record<string, unknown>) => string;
|
|
42
47
|
}
|
|
43
48
|
export interface ActionConfiguration<T extends object = Record<string, unknown>> {
|
|
44
49
|
enabled?: boolean;
|