Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,33 @@ type Spec = ArraySpec | BooleanSpec | NumberSpec | ObjectSpec | StringSpec;

### ArraySpec

| Property | Type | Required | Description |
| :--------------------------- | :----------------------------------------------------------- | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| defaultValue | `FieldArrayValue` | | Default value |
| type | `"array"` | yes | Entity type |
| required | `boolean` | | Can the value be `undefined` or `null` |
| maxLength | `bigint` | | Maximum number of array elements |
| minLength | `bigint` | | Minimum number of array elements |
| items | `Spec` | | Entity `spec` for an array element |
| enum | `string[]` | | An array of valid values, for example for a select |
| description | `Record<string, string>` | | Beautiful names for values from `enum` |
| validator | `string` | | The key for determining the [validator](./config.md#validators) for the entity, if the value is empty, the base [validator](./config.md#validators) from the entity config will be used |
| viewSpec.disabled | `boolean` | | Is the field available for editing |
| viewSpec.type | `string` | yes | Key to define [Input](./config.md#inputs) for an entity |
| viewSpec.layout | `string` | | Key to define [Layout](./config.md#layouts) for an entity |
| viewSpec.layoutTitle | `string` | | Title for [Layout](./config.md#layouts) |
| viewSpec.layoutDescription | `string` | | Additional description/hint for [Layout](./config.md#layouts) |
| viewSpec.layoutOpen | `boolean` | | Expand [Layout](./config.md#layouts) at the first rendering |
| viewSpec.itemLabel | `string` | | Text for the button that adds an array element |
| viewSpec.itemPrefix | `string` | | Additional text for an element in the array |
| viewSpec.table | `{label: string; property: string; description?: string;}[]` | | An array whose elements are used to establish column names and their order, if `type === "table"`. `description` adds a hint to a field in the table's header |
| viewSpec.link | `any` | | A field containing information for forming a [link](#link) for a value |
| viewSpec.placeholder | `string` | | A short hint displayed in the field before the user enters the value |
| viewSpec.addButtonPosition | `"down"/"right"` | | The location of the button adding a new element to the array. Default value "down". |
| viewSpec.hidden | `boolean` | | Hide field and view |
| viewSpec.selectParams | `object` | | [Parameters](#selectparams) additional options for the selector |
| viewSpec.checkboxGroupParams | `object` | | [Parameters](#checkboxgroupparams) additional options for the checkbox group |
| viewSpec.inputProps | `object` | | [InputProps](./input-props-map.md) Additional properties for internal input components |
| Property | Type | Required | Description |
| :--------------------------- | :--------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| defaultValue | `FieldArrayValue` | | Default value |
| type | `"array"` | yes | Entity type |
| required | `boolean` | | Can the value be `undefined` or `null` |
| maxLength | `bigint` | | Maximum number of array elements |
| minLength | `bigint` | | Minimum number of array elements |
| items | `Spec` | | Entity `spec` for an array element |
| enum | `string[]` | | An array of valid values, for example for a select |
| description | `Record<string, string>` | | Beautiful names for values from `enum` |
| validator | `string` | | The key for determining the [validator](./config.md#validators) for the entity, if the value is empty, the base [validator](./config.md#validators) from the entity config will be used |
| viewSpec.disabled | `boolean` | | Is the field available for editing |
| viewSpec.type | `string` | yes | Key to define [Input](./config.md#inputs) for an entity |
| viewSpec.layout | `string` | | Key to define [Layout](./config.md#layouts) for an entity |
| viewSpec.layoutTitle | `string` | | Title for [Layout](./config.md#layouts) |
| viewSpec.layoutDescription | `string` | | Additional description/hint for [Layout](./config.md#layouts) |
| viewSpec.layoutOpen | `boolean` | | Expand [Layout](./config.md#layouts) at the first rendering |
| viewSpec.itemLabel | `string` | | Text for the button that adds an array element |
| viewSpec.itemPrefix | `string` | | Additional text for an element in the array |
| viewSpec.table | `{label: string; property: string; description?: string; width?: number;}[]` | | An array whose elements are used to establish column names and their order, if `type === "table"`. `description` adds a hint to a field in the table's header. `width` sets the width of the column in pixels. |
| viewSpec.link | `any` | | A field containing information for forming a [link](#link) for a value |
| viewSpec.placeholder | `string` | | A short hint displayed in the field before the user enters the value |
| viewSpec.addButtonPosition | `"down"/"right"` | | The location of the button adding a new element to the array. Default value "down". |
| viewSpec.hidden | `boolean` | | Hide field and view |
| viewSpec.selectParams | `object` | | [Parameters](#selectparams) additional options for the selector |
| viewSpec.checkboxGroupParams | `object` | | [Parameters](#checkboxgroupparams) additional options for the checkbox group |
| viewSpec.inputProps | `object` | | [InputProps](./input-props-map.md) Additional properties for internal input components |

### BooleanSpec

Expand Down
1 change: 1 addition & 0 deletions src/lib/core/types/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface ArraySpec<
label: string;
property: string;
description?: string;
width?: number;
}[];
link?: LinkType;
placeholder?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
}
}

&__column-title {
overflow: hidden;
text-overflow: ellipsis;
}

&__row {
.g-table__cell {
border-bottom: 0px transparent;
Expand Down Expand Up @@ -58,6 +63,20 @@
}
}

&__cell-without-limit {
&_arr,
&_obj {
padding-left: var(--df-table-array-cell-obj-padding-left, var(--g-spacing-half));

& > .simple-vertical-accordeon {
margin-bottom: var(
--df-table-array-cell-obj-simple-vertical-accordeon-margin-bottom,
var(--g-spacing-0)
);
}
}
}

&__idx {
padding-top: var(--df-table-array-idx-padding-top, 6px);
}
Expand Down
Loading