sera-components 1.8.0 → 1.8.1

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.
@@ -1,6 +1,6 @@
1
- import { DataProperty, DB, DraftEmbeddedRecord, DraftRecord, EmbeddedSchema, GenericEmbeddedRecord, GenericRecord, ObjectProperty, PropertyNames, Schema, SchemaType } from 'sera-db';
1
+ import { DataProperty, DB, DraftEmbeddedRecord, DraftRecord, EmbeddedSchema, GenericEmbeddedRecord, GenericRecord, NestedProperty, ObjectProperty, PropertyNames, Schema, SchemaType } from 'sera-db';
2
2
  import { DisplayInterface } from '../data/display';
3
- type DOP = DataProperty | ObjectProperty;
3
+ type DOP = DataProperty | ObjectProperty | NestedProperty;
4
4
  /**
5
5
  * Represents a column configuration for a table component.
6
6
  */
@@ -60,11 +60,6 @@ export declare function makeTableColumn<R>(db: DB, property: DOP, { title, neste
60
60
  rowSpan?: (record: R, rowIndex: number) => number | undefined;
61
61
  colSpan?: (record: R, rowIndex: number) => number | undefined;
62
62
  }): SeraColumn<R>;
63
- export declare function makeTableColumnFromNestedProperty<R>(db: DB, property: DOP, nestedProperty: DOP, { title, nestedKey, component, }?: {
64
- title?: React.ReactNode;
65
- nestedKey?: string;
66
- component?: React.ComponentType<DisplayInterface<any>>;
67
- }): SeraColumn<R>;
68
63
  export declare function makeTableColumns<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>, OR>(db: DB, schema: Schema<ID, R, DR, PF, F, ST> | EmbeddedSchema<R, DR, PF, F>, selectedColumns: (PF | SeraColumn<OR>)[], options?: {
69
64
  nestedKey?: string;
70
65
  }): SeraColumn<OR>[];
@@ -9,7 +9,8 @@ import { DataProperty, ObjectProperty, NestedProperty } from 'sera-db';
9
9
  * @example
10
10
  * ```typescript
11
11
  * const value = getPropertyValue(supplier, paymentPolicyProp);
12
- * const nestedValue = getPropertyValue(supplier, new NestedProperty(supplier.paymentPolicy, paymentPolicy.type));
12
+ * const nestedValue = getPropertyValue(supplier, supplier.paymentPolicy.property("type"));
13
+ * // Or manually: new NestedProperty(supplier.paymentPolicy, paymentPolicy.type)
13
14
  * ```
14
15
  */
15
16
  export declare function getPropertyValue(record: any, property: DataProperty | ObjectProperty | NestedProperty): any;
@@ -27,7 +28,7 @@ export declare function getPropertyValue(record: any, property: DataProperty | O
27
28
  * @example
28
29
  * ```typescript
29
30
  * setPropertyValue(draftSupplier, paymentPolicyProp, newPolicy);
30
- * setPropertyValue(draftSupplier, new NestedProperty(supplier.paymentPolicy, paymentPolicy.type), PaymentPolicyType.PaymentBeforeService);
31
+ * setPropertyValue(draftSupplier, supplier.paymentPolicy.property("type"), PaymentPolicyType.PaymentBeforeService);
31
32
  * ```
32
33
  */
33
34
  export declare function setPropertyValue(record: any, property: DataProperty | ObjectProperty | NestedProperty, value: any): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sera-components",
3
3
  "private": false,
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -46,7 +46,7 @@
46
46
  "react-dom": "^19.2.3",
47
47
  "react-imask": "^7.6.1",
48
48
  "react-router": "^7.7.1",
49
- "sera-db": "^1.13.1",
49
+ "sera-db": "^1.13.2",
50
50
  "throttle-debounce": "^5.0.2"
51
51
  }
52
52
  }