@stoker-platform/types 0.5.18 → 0.5.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/types",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "src/main.ts",
@@ -565,7 +565,10 @@ export type SelectFilter = {
565
565
  title?: string | (() => string)
566
566
  roles?: StokerRole[]
567
567
  condition?: (value: boolean | string | number | undefined) => boolean
568
- defaultValue?: string | number | (() => string | number)
568
+ defaultValue?:
569
+ | string
570
+ | number
571
+ | ((parentCollection: CollectionSchema, parentRecord?: StokerRecord) => string | number | undefined)
569
572
  value?: string | number
570
573
  style?: "select" | "radio" | "buttons"
571
574
  }
@@ -658,6 +661,13 @@ export interface CustomRecordPage {
658
661
  condition?: (record: StokerRecord | undefined) => boolean
659
662
  icon?: React.FC<{ className?: string }>
660
663
  }
664
+
665
+ export interface Assignable {
666
+ collection: string
667
+ isAvailable: (record: StokerRecord) => boolean
668
+ unavailableField?: string
669
+ }
670
+
661
671
  export interface CollectionAdmin {
662
672
  hidden?: boolean | (() => boolean | Promise<boolean>)
663
673
  navbarPosition?: number | (() => number)
@@ -682,7 +692,10 @@ export interface CollectionAdmin {
682
692
  | "images"
683
693
  | "map"
684
694
  | "calendar"
685
- | (() => "list" | "cards" | "images" | "map" | "calendar")
695
+ | ((
696
+ parentCollection: CollectionSchema,
697
+ parentRecord?: StokerRecord,
698
+ ) => "list" | "cards" | "images" | "map" | "calendar")
686
699
  defaultRoute?: string | (() => string)
687
700
  defaultSort?:
688
701
  | {
@@ -740,6 +753,7 @@ export interface CollectionAdmin {
740
753
  disableRangeSelector?: boolean | (() => boolean)
741
754
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
742
755
  retriever?: () => any | Promise<any>
756
+ assignable?: Assignable[] | (() => Assignable[] | Promise<Assignable[]>)
743
757
  }
744
758
  export interface CollectionAdminCache {
745
759
  navbarPosition?: number