sanity-plugin-taxonomy-manager 4.2.2 → 4.3.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/lib/index.d.ts CHANGED
@@ -22,8 +22,12 @@ export declare function ArrayHierarchyInput(props: ArrayFieldProps): JSX.Element
22
22
  /**
23
23
  * #### Reference Field Scheme & Branch Filter
24
24
  * A pluggable Function for Filtering to a Top Concept Branch within a SKOS Concept Scheme
25
- * @param schemeId - The unique six character concept identifier for the Concept Scheme to which you wish to filter.
26
- * @param branchId - The unique six character concept identifier of a branch. Child concepts will be returned.
25
+ * @param {string} schemeId - The unique six character concept identifier for
26
+ * the Concept Scheme to which you wish to filter.
27
+ * @param {string} branchId - The unique six character concept identifier of
28
+ * a branch. Child concepts will be returned.
29
+ * @param {boolean} [expanded] - Set to `true` to display open hierarchy trees for
30
+ * input components. Input component trees load closed by default.
27
31
  * @returns A reference type filter for the child concepts of the designated branch in the selected Concept Scheme
28
32
  * @example
29
33
  * ```ts
@@ -37,7 +41,11 @@ export declare function ArrayHierarchyInput(props: ArrayFieldProps): JSX.Element
37
41
  * type: 'reference',
38
42
  * to: {type: 'skosConcept'},
39
43
  * options: {
40
- * filter: branchFilter({schemeId: 'a1b2c3', branchId: 'd4e5f6'}),
44
+ * filter: branchFilter({
45
+ * schemeId: 'a1b2c3',
46
+ * branchId: 'd4e5f6'
47
+ * expanded: true, // optional; defaults to false (closed tree)
48
+ * }),
41
49
  * disableNew: true,
42
50
  * },
43
51
  * },
@@ -55,14 +63,18 @@ export declare const branchFilter: (
55
63
 
56
64
  declare type BranchFilterResult = {
57
65
  filter: string
58
- params: BranchOptions & {
66
+ params: {
67
+ schemeId: string
68
+ branchId: string
59
69
  concepts: string[]
60
70
  }
71
+ expanded?: boolean
61
72
  }
62
73
 
63
74
  declare type BranchOptions = {
64
75
  schemeId: string
65
76
  branchId: string
77
+ expanded?: boolean
66
78
  }
67
79
 
68
80
  declare interface ConceptSchemeDocument extends SanityDocument {
@@ -105,9 +117,11 @@ export declare function ReferenceHierarchyInput(props: ObjectFieldProps<Referenc
105
117
 
106
118
  /**
107
119
  * #### Reference Field Scheme Filter
108
- * Pluggable Function for Filtering to a Single SKOS Concept Scheme
109
- * @param schemeId - The unique six character concept identifier for
120
+ * Pluggable Function for Filtering to a Single SKOS Concept Scheme.
121
+ * @param {string} schemeId - The unique six character concept identifier for
110
122
  * the Concept Scheme to which you wish to filter.
123
+ * @param {boolean} [expanded] - Set to `true` to display open hierarchy trees for
124
+ * input components. Input component trees load closed by default.
111
125
  * @returns A reference type filter for Concepts and Top Concepts in
112
126
  * the selected Concept Scheme test
113
127
  * @example
@@ -122,7 +136,10 @@ export declare function ReferenceHierarchyInput(props: ObjectFieldProps<Referenc
122
136
  * type: 'reference',
123
137
  * to: {type: 'skosConcept'},
124
138
  * options: {
125
- * filter: schemeFilter({schemeId: 'a1b2c3'}),
139
+ * filter: schemeFilter({
140
+ * schemeId: 'a1b2c3',
141
+ * expanded: true, // optional; defaults to false (closed tree)
142
+ * }),
126
143
  * disableNew: true,
127
144
  * },
128
145
  * },
@@ -141,13 +158,16 @@ export declare const schemeFilter: (
141
158
  declare type SchemeFilterResult = {
142
159
  filter: string
143
160
  params: {
161
+ schemeId: string
144
162
  concepts: string[]
145
163
  topConcepts: string[]
146
164
  }
165
+ expanded?: boolean
147
166
  }
148
167
 
149
168
  declare type SchemeOptions = {
150
169
  schemeId: string
170
+ expanded?: boolean
151
171
  }
152
172
 
153
173
  /**
@@ -176,6 +196,7 @@ export declare const TreeView: ({
176
196
  branchId,
177
197
  inputComponent,
178
198
  selectConcept,
199
+ expanded,
179
200
  }: TreeViewProps) => JSX.Element
180
201
 
181
202
  declare interface TreeViewProps {
@@ -183,6 +204,7 @@ declare interface TreeViewProps {
183
204
  branchId: string
184
205
  selectConcept?: (conceptId: {_ref: string; _type: 'reference'; _originalId?: string}) => void
185
206
  inputComponent?: boolean
207
+ expanded?: boolean
186
208
  }
187
209
 
188
210
  export {}
@@ -22,8 +22,12 @@ export declare function ArrayHierarchyInput(props: ArrayFieldProps): JSX.Element
22
22
  /**
23
23
  * #### Reference Field Scheme & Branch Filter
24
24
  * A pluggable Function for Filtering to a Top Concept Branch within a SKOS Concept Scheme
25
- * @param schemeId - The unique six character concept identifier for the Concept Scheme to which you wish to filter.
26
- * @param branchId - The unique six character concept identifier of a branch. Child concepts will be returned.
25
+ * @param {string} schemeId - The unique six character concept identifier for
26
+ * the Concept Scheme to which you wish to filter.
27
+ * @param {string} branchId - The unique six character concept identifier of
28
+ * a branch. Child concepts will be returned.
29
+ * @param {boolean} [expanded] - Set to `true` to display open hierarchy trees for
30
+ * input components. Input component trees load closed by default.
27
31
  * @returns A reference type filter for the child concepts of the designated branch in the selected Concept Scheme
28
32
  * @example
29
33
  * ```ts
@@ -37,7 +41,11 @@ export declare function ArrayHierarchyInput(props: ArrayFieldProps): JSX.Element
37
41
  * type: 'reference',
38
42
  * to: {type: 'skosConcept'},
39
43
  * options: {
40
- * filter: branchFilter({schemeId: 'a1b2c3', branchId: 'd4e5f6'}),
44
+ * filter: branchFilter({
45
+ * schemeId: 'a1b2c3',
46
+ * branchId: 'd4e5f6'
47
+ * expanded: true, // optional; defaults to false (closed tree)
48
+ * }),
41
49
  * disableNew: true,
42
50
  * },
43
51
  * },
@@ -55,14 +63,18 @@ export declare const branchFilter: (
55
63
 
56
64
  declare type BranchFilterResult = {
57
65
  filter: string
58
- params: BranchOptions & {
66
+ params: {
67
+ schemeId: string
68
+ branchId: string
59
69
  concepts: string[]
60
70
  }
71
+ expanded?: boolean
61
72
  }
62
73
 
63
74
  declare type BranchOptions = {
64
75
  schemeId: string
65
76
  branchId: string
77
+ expanded?: boolean
66
78
  }
67
79
 
68
80
  declare interface ConceptSchemeDocument extends SanityDocument {
@@ -105,9 +117,11 @@ export declare function ReferenceHierarchyInput(props: ObjectFieldProps<Referenc
105
117
 
106
118
  /**
107
119
  * #### Reference Field Scheme Filter
108
- * Pluggable Function for Filtering to a Single SKOS Concept Scheme
109
- * @param schemeId - The unique six character concept identifier for
120
+ * Pluggable Function for Filtering to a Single SKOS Concept Scheme.
121
+ * @param {string} schemeId - The unique six character concept identifier for
110
122
  * the Concept Scheme to which you wish to filter.
123
+ * @param {boolean} [expanded] - Set to `true` to display open hierarchy trees for
124
+ * input components. Input component trees load closed by default.
111
125
  * @returns A reference type filter for Concepts and Top Concepts in
112
126
  * the selected Concept Scheme test
113
127
  * @example
@@ -122,7 +136,10 @@ export declare function ReferenceHierarchyInput(props: ObjectFieldProps<Referenc
122
136
  * type: 'reference',
123
137
  * to: {type: 'skosConcept'},
124
138
  * options: {
125
- * filter: schemeFilter({schemeId: 'a1b2c3'}),
139
+ * filter: schemeFilter({
140
+ * schemeId: 'a1b2c3',
141
+ * expanded: true, // optional; defaults to false (closed tree)
142
+ * }),
126
143
  * disableNew: true,
127
144
  * },
128
145
  * },
@@ -141,13 +158,16 @@ export declare const schemeFilter: (
141
158
  declare type SchemeFilterResult = {
142
159
  filter: string
143
160
  params: {
161
+ schemeId: string
144
162
  concepts: string[]
145
163
  topConcepts: string[]
146
164
  }
165
+ expanded?: boolean
147
166
  }
148
167
 
149
168
  declare type SchemeOptions = {
150
169
  schemeId: string
170
+ expanded?: boolean
151
171
  }
152
172
 
153
173
  /**
@@ -176,6 +196,7 @@ export declare const TreeView: ({
176
196
  branchId,
177
197
  inputComponent,
178
198
  selectConcept,
199
+ expanded,
179
200
  }: TreeViewProps) => JSX.Element
180
201
 
181
202
  declare interface TreeViewProps {
@@ -183,6 +204,7 @@ declare interface TreeViewProps {
183
204
  branchId: string
184
205
  selectConcept?: (conceptId: {_ref: string; _type: 'reference'; _originalId?: string}) => void
185
206
  inputComponent?: boolean
207
+ expanded?: boolean
186
208
  }
187
209
 
188
210
  export {}