sera-components 1.6.0 → 1.6.2
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/data/display/index.d.ts +2 -2
- package/dist/data/inputs/index.d.ts +8 -8
- package/dist/form/{Form.d.ts → form.d.ts} +42 -1
- package/dist/form/index.d.ts +3 -3
- package/dist/index.js +997 -1113
- package/dist/index.umd.cjs +7 -7
- package/dist/misc/index.d.ts +5 -5
- package/dist/search/index.d.ts +2 -2
- package/dist/search/{Search.d.ts → search.d.ts} +1 -1
- package/dist/table/{EmbeddedTable.d.ts → embedded-table.d.ts} +2 -2
- package/dist/table/index.d.ts +4 -4
- package/dist/table/{Table.d.ts → table.d.ts} +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/view/index.d.ts +2 -2
- package/dist/view/{ViewTab.d.ts → view-tab.d.ts} +1 -1
- package/package.json +2 -2
- /package/dist/data/display/{BooleanDisplay.d.ts → boolean-display.d.ts} +0 -0
- /package/dist/data/display/{DateTimeDisplay.d.ts → datetime-display.d.ts} +0 -0
- /package/dist/data/display/{EnumDisplay.d.ts → enum-display.d.ts} +0 -0
- /package/dist/data/display/{ForeignKeyDisplay.d.ts → foreign-key-display.d.ts} +0 -0
- /package/dist/data/display/{TextDisplay.d.ts → text-display.d.ts} +0 -0
- /package/dist/data/inputs/{BooleanInput.d.ts → boolean-input.d.ts} +0 -0
- /package/dist/data/inputs/{ConfirmationInput.d.ts → confirmation-input.d.ts} +0 -0
- /package/dist/data/inputs/{DateInput.d.ts → date-input.d.ts} +0 -0
- /package/dist/data/inputs/{DateRangeInput.d.ts → date-range-input.d.ts} +0 -0
- /package/dist/data/inputs/{EnumInput.d.ts → enum-input.d.ts} +0 -0
- /package/dist/data/inputs/{ForeignKeyInput.d.ts → foreign-key-input.d.ts} +0 -0
- /package/dist/data/inputs/{NumberInput.d.ts → number-input.d.ts} +0 -0
- /package/dist/data/inputs/{PhoneNumberInput.d.ts → phone-number-input.d.ts} +0 -0
- /package/dist/data/inputs/{TextInput.d.ts → text-input.d.ts} +0 -0
- /package/dist/form/{FormItemLabel.d.ts → form-item-label.d.ts} +0 -0
- /package/dist/form/{FormItem.d.ts → form-item.d.ts} +0 -0
- /package/dist/misc/{CountryFlag.d.ts → country-flag.d.ts} +0 -0
- /package/dist/misc/{Language.d.ts → language.d.ts} +0 -0
- /package/dist/misc/{Locale.d.ts → locale.d.ts} +0 -0
- /package/dist/misc/{Menu.d.ts → menu.d.ts} +0 -0
- /package/dist/misc/{Transition.d.ts → transition.d.ts} +0 -0
- /package/dist/search/{SearchForm.d.ts → search-form.d.ts} +0 -0
- /package/dist/table/{makeColumns.d.ts → make-columns.d.ts} +0 -0
- /package/dist/table/{TableAction.d.ts → table-action.d.ts} +0 -0
- /package/dist/table/{TableContent.d.ts → table-content.d.ts} +0 -0
- /package/dist/table/{TablePagination.d.ts → table-pagination.d.ts} +0 -0
- /package/dist/utils/{propertyUtils.d.ts → property-utils.d.ts} +0 -0
- /package/dist/view/{MultiTabView.d.ts → multi-tab-view.d.ts} +0 -0
- /package/dist/view/{ViewItem.d.ts → view-item.d.ts} +0 -0
- /package/dist/view/{View.d.ts → view.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataProperty, DataType, DB, ObjectProperty, NestedProperty } from 'sera-db';
|
|
2
|
-
import { DateDisplay, DateTimeDisplay, DateTimeHideTimeDisplay } from './
|
|
3
|
-
export { SingleForeignKeyDisplay, MultiForeignKeyDisplay } from './
|
|
2
|
+
import { DateDisplay, DateTimeDisplay, DateTimeHideTimeDisplay } from './datetime-display';
|
|
3
|
+
export { SingleForeignKeyDisplay, MultiForeignKeyDisplay } from './foreign-key-display';
|
|
4
4
|
export type DisplayInterface<T> = {
|
|
5
5
|
db: DB;
|
|
6
6
|
property: DataProperty | ObjectProperty | NestedProperty;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DataProperty, DataType, DB, ObjectProperty, NestedProperty } from 'sera-db';
|
|
2
|
-
import { BooleanInput } from './
|
|
3
|
-
import { NumberInput } from './
|
|
4
|
-
import { TextInput } from './
|
|
5
|
-
import { DateInput } from './
|
|
6
|
-
import { EnumInput } from './
|
|
7
|
-
import { ConfirmationInput, ConfirmationLabel } from './
|
|
8
|
-
export { SingleForeignKeyInput, MultiForeignKeyInput } from './
|
|
9
|
-
export { DateRangeInput, DateTimeRangeInput } from './
|
|
2
|
+
import { BooleanInput } from './boolean-input';
|
|
3
|
+
import { NumberInput } from './number-input';
|
|
4
|
+
import { TextInput } from './text-input';
|
|
5
|
+
import { DateInput } from './date-input';
|
|
6
|
+
import { EnumInput } from './enum-input';
|
|
7
|
+
import { ConfirmationInput, ConfirmationLabel } from './confirmation-input';
|
|
8
|
+
export { SingleForeignKeyInput, MultiForeignKeyInput } from './foreign-key-input';
|
|
9
|
+
export { DateRangeInput, DateTimeRangeInput } from './date-range-input';
|
|
10
10
|
/**
|
|
11
11
|
* Interface for input components in forms
|
|
12
12
|
* @interface InputInterface
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PropertyNames, DraftRecord, GenericRecord, Schema, SchemaType, Table, NestedProperty } from 'sera-db';
|
|
2
2
|
import { InputInterface } from '../data/inputs';
|
|
3
|
-
import { FormItemLayout } from './
|
|
3
|
+
import { FormItemLayout } from './form-item';
|
|
4
4
|
interface FieldArgs<R, DR> {
|
|
5
5
|
label?: React.ReactNode;
|
|
6
6
|
input?: React.ComponentType<InputInterface<any>>;
|
|
@@ -68,4 +68,45 @@ export interface SeraFormProps<ID extends string | number, R extends GenericReco
|
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
70
|
export declare const SeraForm: <ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>, PF extends PropertyNames<R>, F extends PropertyNames<DR>, ST extends SchemaType<ID, R, DR, PF, F>>(props: SeraFormProps<ID, R, DR, PF, F, ST>) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
/**
|
|
72
|
+
* Groups multiple form fields together in a row layout using Mantine's Group component.
|
|
73
|
+
*
|
|
74
|
+
* This function creates a renderer that displays multiple form fields side-by-side
|
|
75
|
+
* in a flexible row layout with equal column widths.
|
|
76
|
+
*
|
|
77
|
+
* @template ID - The type of the record identifier (string or number)
|
|
78
|
+
* @template R - The generic record type extending GenericRecord
|
|
79
|
+
* @template DR - The draft record type extending DraftRecord
|
|
80
|
+
* @template PF - The type of public fields in R
|
|
81
|
+
* @template F - The type of fields in DR
|
|
82
|
+
* @template ST - The schema type that extends SchemaType
|
|
83
|
+
*
|
|
84
|
+
* @param schema - The schema definition containing property information
|
|
85
|
+
* @param fields - Array of field definitions to display in the group
|
|
86
|
+
* @param args - Optional arguments for visibility, layout, and flex properties
|
|
87
|
+
*
|
|
88
|
+
* @returns A function that takes a store and record, returning a React node with grouped form fields
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* const groupedFields = groupFormFields(
|
|
93
|
+
* userSchema,
|
|
94
|
+
* [{ prop: "firstName" }, { prop: "lastName" }]
|
|
95
|
+
* );
|
|
96
|
+
* // Use in fieldGroups:
|
|
97
|
+
* fieldGroups: [{ fields: [[groupedFields]] }]
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export declare function groupFormFields<ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>, PF extends PropertyNames<R>, F extends PropertyNames<DR>, ST extends SchemaType<ID, R, DR, PF, F>>(schema: Schema<ID, R, DR, PF, F, ST>, fields: (ST["allProperties"] | {
|
|
101
|
+
prop: ST["allProperties"];
|
|
102
|
+
args?: FieldArgs<R, DR>;
|
|
103
|
+
} | NestedProperty | {
|
|
104
|
+
prop: NestedProperty;
|
|
105
|
+
args?: FieldArgs<R, DR>;
|
|
106
|
+
} | ((store: Table<ID, R, DR>, record: R | DR) => React.ReactNode))[], args?: {
|
|
107
|
+
visible?: (record: R | DR) => boolean;
|
|
108
|
+
layout?: FormItemLayout;
|
|
109
|
+
flexGrow?: boolean;
|
|
110
|
+
flexGap?: import('@mantine/core').MantineSpacing;
|
|
111
|
+
}): (store: Table<ID, R, DR>, record: R | DR) => React.ReactNode;
|
|
71
112
|
export {};
|
package/dist/form/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './form';
|
|
2
|
+
export * from './form-item';
|
|
3
|
+
export * from './form-item-label';
|