@@ -37,21 +37,21 @@ export class UmbDefaultCollectionContext<
3737 implements UmbCollectionContext , UmbApi
3838{
3939 #config?: UmbCollectionConfiguration = { pageSize : 50 } ;
40- #manifest ?: ManifestCollection ;
41- #repository ?: UmbCollectionRepository ;
40+ protected _manifest ?: ManifestCollection ;
41+ protected _repository ?: UmbCollectionRepository ;
4242
4343 // TODO: replace with a state manager
44- #loading = new UmbObjectState < boolean > ( false ) ;
45- public readonly loading = this . #loading . asObservable ( ) ;
44+ protected _loading = new UmbObjectState < boolean > ( false ) ;
45+ public readonly loading = this . _loading . asObservable ( ) ;
4646
47- #items = new UmbArrayState < CollectionItemType > ( [ ] , ( x ) => x . unique ) ;
48- public readonly items = this . #items . asObservable ( ) ;
47+ protected _items = new UmbArrayState < CollectionItemType > ( [ ] , ( x ) => x . unique ) ;
48+ public readonly items = this . _items . asObservable ( ) ;
4949
50- #totalItems = new UmbNumberState ( 0 ) ;
51- public readonly totalItems = this . #totalItems . asObservable ( ) ;
50+ protected _totalItems = new UmbNumberState ( 0 ) ;
51+ public readonly totalItems = this . _totalItems . asObservable ( ) ;
5252
53- #filter = new UmbObjectState < FilterModelType | object > ( { } ) ;
54- public readonly filter = this . #filter . asObservable ( ) ;
53+ protected _filter = new UmbObjectState < FilterModelType | object > ( { } ) ;
54+ public readonly filter = this . _filter . asObservable ( ) ;
5555
5656 #userDefinedProperties = new UmbArrayState < UmbCollectionColumnConfiguration > ( [ ] , ( x ) => x . alias ) ;
5757 public readonly userDefinedProperties = this . #userDefinedProperties. asObservable ( ) ;
@@ -69,7 +69,7 @@ export class UmbDefaultCollectionContext<
6969 #initResolver?: ( ) => void ;
7070 #initialized = false ;
7171
72- #init = new Promise < void > ( ( resolve ) => {
72+ protected _init = new Promise < void > ( ( resolve ) => {
7373 if ( this . #initialized) {
7474 resolve ( ) ;
7575 } else {
@@ -115,9 +115,9 @@ export class UmbDefaultCollectionContext<
115115 } ) ;
116116 }
117117
118- #configured = false ;
118+ protected _configured = false ;
119119
120- #configure ( ) {
120+ protected _configure ( ) {
121121 if ( ! this . #config) return ;
122122
123123 this . selection . setMultiple ( true ) ;
@@ -126,9 +126,9 @@ export class UmbDefaultCollectionContext<
126126 this . pagination . setPageSize ( this . #config. pageSize ) ;
127127 }
128128
129- const filterValue = this . #filter . getValue ( ) as FilterModelType ;
129+ const filterValue = this . _filter . getValue ( ) as FilterModelType ;
130130
131- this . #filter . setValue ( {
131+ this . _filter . setValue ( {
132132 ...this . #defaultFilter,
133133 ...this . #config,
134134 ...filterValue ,
@@ -148,11 +148,11 @@ export class UmbDefaultCollectionContext<
148148
149149 this . view . setConfig ( viewManagerConfig ) ;
150150
151- this . #configured = true ;
151+ this . _configured = true ;
152152 }
153153
154154 #checkIfInitialized( ) {
155- if ( this . #repository ) {
155+ if ( this . _repository ) {
156156 this . #initialized = true ;
157157 this . #initResolver?.( ) ;
158158 }
@@ -167,7 +167,7 @@ export class UmbDefaultCollectionContext<
167167 repositoryAlias ,
168168 [ this . _host ] ,
169169 ( permitted , ctrl ) => {
170- this . #repository = permitted ? ctrl . api : undefined ;
170+ this . _repository = permitted ? ctrl . api : undefined ;
171171 this . #checkIfInitialized( ) ;
172172 } ,
173173 ) ;
@@ -193,12 +193,12 @@ export class UmbDefaultCollectionContext<
193193 }
194194
195195 public set manifest ( manifest : ManifestCollection | undefined ) {
196- if ( this . #manifest === manifest ) return ;
197- this . #manifest = manifest ;
198- this . #observeRepository( this . #manifest ?. meta . repositoryAlias ) ;
196+ if ( this . _manifest === manifest ) return ;
197+ this . _manifest = manifest ;
198+ this . #observeRepository( this . _manifest ?. meta . repositoryAlias ) ;
199199 }
200200 public get manifest ( ) {
201- return this . #manifest ;
201+ return this . _manifest ;
202202 }
203203
204204 /**
@@ -207,24 +207,24 @@ export class UmbDefaultCollectionContext<
207207 * @memberof UmbCollectionContext
208208 */
209209 public async requestCollection ( ) {
210- await this . #init ;
210+ await this . _init ;
211211
212- if ( ! this . #configured ) this . #configure ( ) ;
212+ if ( ! this . _configured ) this . _configure ( ) ;
213213
214- if ( ! this . #repository ) throw new Error ( `Missing repository for ${ this . #manifest } ` ) ;
214+ if ( ! this . _repository ) throw new Error ( `Missing repository for ${ this . _manifest } ` ) ;
215215
216- this . #loading . setValue ( true ) ;
216+ this . _loading . setValue ( true ) ;
217217
218- const filter = this . #filter . getValue ( ) ;
219- const { data } = await this . #repository . requestCollection ( filter ) ;
218+ const filter = this . _filter . getValue ( ) ;
219+ const { data } = await this . _repository . requestCollection ( filter ) ;
220220
221221 if ( data ) {
222- this . #items . setValue ( data . items ) ;
223- this . #totalItems . setValue ( data . total ) ;
222+ this . _items . setValue ( data . items ) ;
223+ this . _totalItems . setValue ( data . total ) ;
224224 this . pagination . setTotalItems ( data . total ) ;
225225 }
226226
227- this . #loading . setValue ( false ) ;
227+ this . _loading . setValue ( false ) ;
228228 }
229229
230230 /**
@@ -233,7 +233,7 @@ export class UmbDefaultCollectionContext<
233233 * @memberof UmbCollectionContext
234234 */
235235 public setFilter ( filter : Partial < FilterModelType > ) {
236- this . #filter . setValue ( { ...this . #filter . getValue ( ) , ...filter } ) ;
236+ this . _filter . setValue ( { ...this . _filter . getValue ( ) , ...filter } ) ;
237237 this . requestCollection ( ) ;
238238 }
239239
@@ -258,7 +258,7 @@ export class UmbDefaultCollectionContext<
258258 }
259259
260260 #onReloadStructureRequest = ( event : UmbRequestReloadStructureForEntityEvent ) => {
261- const items = this . #items . getValue ( ) ;
261+ const items = this . _items . getValue ( ) ;
262262 const hasItem = items . some ( ( item ) => item . unique === event . getUnique ( ) ) ;
263263 if ( hasItem ) {
264264 this . requestCollection ( ) ;
@@ -297,11 +297,11 @@ export class UmbDefaultCollectionContext<
297297 * @deprecated Use set the `.manifest` property instead.
298298 */
299299 public setManifest ( manifest : ManifestCollection | undefined ) {
300- if ( this . #manifest === manifest ) return ;
301- this . #manifest = manifest ;
300+ if ( this . _manifest === manifest ) return ;
301+ this . _manifest = manifest ;
302302
303- if ( ! this . #manifest ) return ;
304- this . #observeRepository( this . #manifest . meta . repositoryAlias ) ;
303+ if ( ! this . _manifest ) return ;
304+ this . #observeRepository( this . _manifest . meta . repositoryAlias ) ;
305305 }
306306
307307 /**
@@ -311,6 +311,6 @@ export class UmbDefaultCollectionContext<
311311 * @deprecated Use get the `.manifest` property instead.
312312 */
313313 public getManifest ( ) {
314- return this . #manifest ;
314+ return this . _manifest ;
315315 }
316316}
0 commit comments