sera-components 1.0.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/components/src/basic/CountryFlag.d.ts +75 -0
- package/dist/components/src/basic/Language.d.ts +48 -0
- package/dist/components/src/basic/Menu.d.ts +62 -0
- package/dist/components/src/basic/Transition.d.ts +18 -0
- package/dist/components/src/basic/index.d.ts +4 -0
- package/dist/components/src/data/display/ForeignKeyDisplay.d.ts +7 -0
- package/dist/components/src/data/display/TextDisplay.d.ts +2 -0
- package/dist/components/src/data/display/index.d.ts +13 -0
- package/dist/components/src/data/index.d.ts +2 -0
- package/dist/components/src/data/inputs/BooleanInput.d.ts +2 -0
- package/dist/components/src/data/inputs/ForeignKeyInput.d.ts +22 -0
- package/dist/components/src/data/inputs/NumberInput.d.ts +2 -0
- package/dist/components/src/data/inputs/PhoneNumberInput.d.ts +13 -0
- package/dist/components/src/data/inputs/TextInput.d.ts +2 -0
- package/dist/components/src/data/inputs/index.d.ts +21 -0
- package/dist/components/src/form/Form.d.ts +61 -0
- package/dist/components/src/form/FormItem.d.ts +31 -0
- package/dist/components/src/form/FormItemLabel.d.ts +9 -0
- package/dist/components/src/form/index.d.ts +3 -0
- package/dist/components/src/index.d.ts +5 -0
- package/dist/components/src/misc/index.d.ts +2 -0
- package/dist/components/src/misc/trie.d.ts +36 -0
- package/dist/components/src/misc/utils.d.ts +9 -0
- package/dist/components/src/table/EmbeddedTable.d.ts +13 -0
- package/dist/components/src/table/Table.d.ts +16 -0
- package/dist/components/src/table/TableAction.d.ts +16 -0
- package/dist/components/src/table/TableContent.d.ts +9 -0
- package/dist/components/src/table/TablePagination.d.ts +14 -0
- package/dist/components/src/table/index.d.ts +4 -0
- package/dist/components/src/table/makeColumns.d.ts +28 -0
- package/dist/components/src/view/MultiTabView.d.ts +1 -0
- package/dist/components/src/view/View.d.ts +25 -0
- package/dist/components/src/view/ViewItem.d.ts +15 -0
- package/dist/components/src/view/ViewNestedPropertyItem.d.ts +46 -0
- package/dist/components/src/view/ViewTab.d.ts +18 -0
- package/dist/components/src/view/index.d.ts +2 -0
- package/dist/index.css +1 -0
- package/dist/index.js +3344 -0
- package/dist/index.umd.cjs +33 -0
- package/package.json +45 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ClassName, DataProperty, DraftRecord, GenericRecord, ObjectProperty, Table } from '../../../db/src/index.ts';
|
|
2
|
+
import { DisplayInterface } from '../data/display';
|
|
3
|
+
import { NoQueryArgsPathDef } from '../../../route/src/index.ts';
|
|
4
|
+
export interface ViewNestedPropertyItemProps<ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>> {
|
|
5
|
+
store: Table<ID, R, DR>;
|
|
6
|
+
record: R;
|
|
7
|
+
properties: (DataProperty | ObjectProperty)[];
|
|
8
|
+
DisplayComponent: React.ComponentType<DisplayInterface<any>>;
|
|
9
|
+
entityRoutes: Record<ClassName, NoQueryArgsPathDef<{
|
|
10
|
+
id: "string";
|
|
11
|
+
}, any>>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A component that renders a nested property item.
|
|
15
|
+
*
|
|
16
|
+
* This component traverses through a chain of properties to display a deeply nested
|
|
17
|
+
* property value from a record. It shows the last property label and renders the value
|
|
18
|
+
* using the provided DisplayComponent.
|
|
19
|
+
*
|
|
20
|
+
* @template ID - The type of the record identifier (string or number)
|
|
21
|
+
* @template R - The type of the generic record extending GenericRecord
|
|
22
|
+
* @template DR - The type of the draft record extending DraftRecord
|
|
23
|
+
* @template PF - The property field type constrained to keys of R
|
|
24
|
+
* @template F - The field type constrained to keys of DR
|
|
25
|
+
*
|
|
26
|
+
* @param props - The component properties
|
|
27
|
+
* @param props.store - The table store containing the record data
|
|
28
|
+
* @param props.record - The record being viewed
|
|
29
|
+
* @param props.properties - Array of properties defining the path to the nested value
|
|
30
|
+
* @param props.DisplayComponent - React component used to render the field value
|
|
31
|
+
*
|
|
32
|
+
* @returns A JSX element displaying the nested property with its label and value
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <ViewNestedPropertyItem
|
|
37
|
+
* store={userStore}
|
|
38
|
+
* record={user}
|
|
39
|
+
* properties={[addressProperty, streetProperty]}
|
|
40
|
+
* DisplayComponent={TextDisplay}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const ViewNestedPropertyItem: (<ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>>({ store, record, properties, DisplayComponent, entityRoutes, }: ViewNestedPropertyItemProps<ID, R, DR>) => import("react/jsx-runtime").JSX.Element) & {
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClassName, DraftRecord, GenericRecord, Schema, SchemaType, Table } from '../../../db/src/index.ts';
|
|
2
|
+
import { FieldGroup } from './View';
|
|
3
|
+
import { NoQueryArgsPathDef } from '../../../route/src/index.ts';
|
|
4
|
+
export interface SeraViewTabProps<ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>, PF extends keyof R, F extends keyof DR, ST extends SchemaType<ID, R, DR, PF, F>> {
|
|
5
|
+
schema: Schema<ID, R, DR, PF, F, ST>;
|
|
6
|
+
store: Table<ID, R, DR>;
|
|
7
|
+
fieldTabs: {
|
|
8
|
+
tabName: string;
|
|
9
|
+
fieldGroups: FieldGroup<ID, R, DR, PF, F, ST>[];
|
|
10
|
+
}[];
|
|
11
|
+
record: R;
|
|
12
|
+
tabStyles?: React.CSSProperties;
|
|
13
|
+
tabClassName?: string;
|
|
14
|
+
entityRoutes: Record<ClassName, NoQueryArgsPathDef<{
|
|
15
|
+
id: "string";
|
|
16
|
+
}, any>>;
|
|
17
|
+
}
|
|
18
|
+
export declare const SeraViewTab: <ID extends string | number, R extends GenericRecord<ID, DR>, DR extends DraftRecord<ID>, PF extends keyof R, F extends keyof DR, ST extends SchemaType<ID, R, DR, PF, F>>(props: SeraViewTabProps<ID, R, DR, PF, F, ST>) => import("react/jsx-runtime").JSX.Element;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._requiredLabelLeft_l5p83_1:before{color:#ff4d4f;content:"*";font-family:SimSun,sans-serif;display:inline-block;margin-inline-end:4px;line-height:1px;font-size:14px}._requiredLabelRight_l5p83_11:after{color:#ff4d4f;content:"*";font-family:SimSun,sans-serif;display:inline-block;margin-inline-start:4px;line-height:1px;font-size:14px}._pageSizeSelectorActive_1wv6j_1{color:var(--mantine-color-text);opacity:1}._pageSizeSelectorActive_1wv6j_1 .mantine-Menu-itemLabel .mantine-Text-root{font-weight:700!important}
|