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.
Files changed (46) hide show
  1. package/dist/data/display/index.d.ts +2 -2
  2. package/dist/data/inputs/index.d.ts +8 -8
  3. package/dist/form/{Form.d.ts → form.d.ts} +42 -1
  4. package/dist/form/index.d.ts +3 -3
  5. package/dist/index.js +997 -1113
  6. package/dist/index.umd.cjs +7 -7
  7. package/dist/misc/index.d.ts +5 -5
  8. package/dist/search/index.d.ts +2 -2
  9. package/dist/search/{Search.d.ts → search.d.ts} +1 -1
  10. package/dist/table/{EmbeddedTable.d.ts → embedded-table.d.ts} +2 -2
  11. package/dist/table/index.d.ts +4 -4
  12. package/dist/table/{Table.d.ts → table.d.ts} +2 -2
  13. package/dist/utils/index.d.ts +1 -1
  14. package/dist/view/index.d.ts +2 -2
  15. package/dist/view/{ViewTab.d.ts → view-tab.d.ts} +1 -1
  16. package/package.json +2 -2
  17. /package/dist/data/display/{BooleanDisplay.d.ts → boolean-display.d.ts} +0 -0
  18. /package/dist/data/display/{DateTimeDisplay.d.ts → datetime-display.d.ts} +0 -0
  19. /package/dist/data/display/{EnumDisplay.d.ts → enum-display.d.ts} +0 -0
  20. /package/dist/data/display/{ForeignKeyDisplay.d.ts → foreign-key-display.d.ts} +0 -0
  21. /package/dist/data/display/{TextDisplay.d.ts → text-display.d.ts} +0 -0
  22. /package/dist/data/inputs/{BooleanInput.d.ts → boolean-input.d.ts} +0 -0
  23. /package/dist/data/inputs/{ConfirmationInput.d.ts → confirmation-input.d.ts} +0 -0
  24. /package/dist/data/inputs/{DateInput.d.ts → date-input.d.ts} +0 -0
  25. /package/dist/data/inputs/{DateRangeInput.d.ts → date-range-input.d.ts} +0 -0
  26. /package/dist/data/inputs/{EnumInput.d.ts → enum-input.d.ts} +0 -0
  27. /package/dist/data/inputs/{ForeignKeyInput.d.ts → foreign-key-input.d.ts} +0 -0
  28. /package/dist/data/inputs/{NumberInput.d.ts → number-input.d.ts} +0 -0
  29. /package/dist/data/inputs/{PhoneNumberInput.d.ts → phone-number-input.d.ts} +0 -0
  30. /package/dist/data/inputs/{TextInput.d.ts → text-input.d.ts} +0 -0
  31. /package/dist/form/{FormItemLabel.d.ts → form-item-label.d.ts} +0 -0
  32. /package/dist/form/{FormItem.d.ts → form-item.d.ts} +0 -0
  33. /package/dist/misc/{CountryFlag.d.ts → country-flag.d.ts} +0 -0
  34. /package/dist/misc/{Language.d.ts → language.d.ts} +0 -0
  35. /package/dist/misc/{Locale.d.ts → locale.d.ts} +0 -0
  36. /package/dist/misc/{Menu.d.ts → menu.d.ts} +0 -0
  37. /package/dist/misc/{Transition.d.ts → transition.d.ts} +0 -0
  38. /package/dist/search/{SearchForm.d.ts → search-form.d.ts} +0 -0
  39. /package/dist/table/{makeColumns.d.ts → make-columns.d.ts} +0 -0
  40. /package/dist/table/{TableAction.d.ts → table-action.d.ts} +0 -0
  41. /package/dist/table/{TableContent.d.ts → table-content.d.ts} +0 -0
  42. /package/dist/table/{TablePagination.d.ts → table-pagination.d.ts} +0 -0
  43. /package/dist/utils/{propertyUtils.d.ts → property-utils.d.ts} +0 -0
  44. /package/dist/view/{MultiTabView.d.ts → multi-tab-view.d.ts} +0 -0
  45. /package/dist/view/{ViewItem.d.ts → view-item.d.ts} +0 -0
  46. /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 './DateTimeDisplay';
3
- export { SingleForeignKeyDisplay, MultiForeignKeyDisplay } from './ForeignKeyDisplay';
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 './BooleanInput';
3
- import { NumberInput } from './NumberInput';
4
- import { TextInput } from './TextInput';
5
- import { DateInput } from './DateInput';
6
- import { EnumInput } from './EnumInput';
7
- import { ConfirmationInput, ConfirmationLabel } from './ConfirmationInput';
8
- export { SingleForeignKeyInput, MultiForeignKeyInput } from './ForeignKeyInput';
9
- export { DateRangeInput, DateTimeRangeInput } from './DateRangeInput';
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 './FormItem';
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 {};
@@ -1,3 +1,3 @@
1
- export * from './Form';
2
- export * from './FormItem';
3
- export * from './FormItemLabel';
1
+ export * from './form';
2
+ export * from './form-item';
3
+ export * from './form-item-label';