@masterteam/properties 0.0.29 → 0.0.31

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": "@masterteam/properties",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/properties",
6
6
  "linkDirectory": false,
@@ -19,10 +19,10 @@
19
19
  "tailwindcss": "^4.1.17",
20
20
  "tailwindcss-primeui": "^0.6.1",
21
21
  "@ngxs/store": "^20.1.0",
22
- "@masterteam/forms": "^0.0.34",
23
- "@masterteam/formula-builder": "^0.0.1",
24
- "@masterteam/components": "^0.0.81",
25
- "@masterteam/icons": "^0.0.12"
22
+ "@masterteam/formula-builder": "^0.0.2",
23
+ "@masterteam/icons": "^0.0.13",
24
+ "@masterteam/components": "^0.0.87",
25
+ "@masterteam/forms": "^0.0.35"
26
26
  },
27
27
  "sideEffects": false,
28
28
  "exports": {
@@ -4,11 +4,12 @@ import * as _angular_core from '@angular/core';
4
4
  import { OnDestroy } from '@angular/core';
5
5
  import { ColumnDef, TableAction } from '@masterteam/components/table';
6
6
  import { FormulaBuilderValue } from '@masterteam/formula-builder';
7
- import { DynamicFormConfig } from '@masterteam/components';
7
+ import { CrudStateBase, DynamicFormConfig } from '@masterteam/components';
8
8
  import { FormGroup, FormControl } from '@angular/forms';
9
9
  import * as rxjs from 'rxjs';
10
10
  import { Observable } from 'rxjs';
11
11
  import { StateContext } from '@ngxs/store';
12
+ import * as _masterteam_properties from '@masterteam/properties';
12
13
  import { HttpContextToken } from '@angular/common/http';
13
14
 
14
15
  interface LoadingStateShape<L extends string = string> {
@@ -23,7 +24,7 @@ interface PropertyItem {
23
24
  viewType: string;
24
25
  viewTypeLabel: string;
25
26
  name: string | Record<string, string>;
26
- description?: string;
27
+ description?: Record<string, string>;
27
28
  defaultValue?: unknown;
28
29
  order?: number;
29
30
  canBeDeleted?: boolean;
@@ -120,8 +121,21 @@ interface ApiTestResponse {
120
121
  schema?: ApiSchema | null;
121
122
  data?: unknown;
122
123
  }
123
- type PropertiesLoadingName = 'getAll' | 'getOne' | 'create' | 'update' | 'delete' | 'getLookups' | 'getGroups' | 'getConfigProperties' | 'getConfigAsType' | 'getCountries' | 'testApiConfiguration';
124
- interface PropertiesStateModel extends LoadingStateShape<PropertiesLoadingName> {
124
+ declare enum PropertiesActionKey {
125
+ GetAll = "getAll",
126
+ GetOne = "getOne",
127
+ Create = "create",
128
+ Update = "update",
129
+ Delete = "delete",
130
+ GetLookups = "getLookups",
131
+ GetGroups = "getGroups",
132
+ GetConfigProperties = "getConfigProperties",
133
+ GetConfigAsType = "getConfigAsType",
134
+ GetCountries = "getCountries",
135
+ TestApiConfiguration = "testApiConfiguration"
136
+ }
137
+ type PropertiesLoadingName = PropertiesActionKey;
138
+ interface PropertiesStateModel extends LoadingStateShape<PropertiesActionKey> {
125
139
  properties: PropertyItem[];
126
140
  selectedProperty: PropertyItem | null;
127
141
  moduleType: string | null;
@@ -137,7 +151,7 @@ interface PropertiesStateModel extends LoadingStateShape<PropertiesLoadingName>
137
151
  countries: CountryDefinition[];
138
152
  apiSchema: ApiSchema | null;
139
153
  apiProperties: ApiPropertyOption[];
140
- propertyTypes?: any[];
154
+ propertyTypes?: any;
141
155
  breadcrumbItems: BreadcrumbItem[];
142
156
  defaultViewType: string | null;
143
157
  }
@@ -154,7 +168,7 @@ interface PropertyPayload {
154
168
  isCalculated: boolean;
155
169
  formula?: FormulaBuilderValue | null;
156
170
  name: Record<string, string>;
157
- description?: string;
171
+ description?: Record<string, string>;
158
172
  defaultValue?: any;
159
173
  configuration?: Record<string, any> | string | null;
160
174
  }
@@ -259,7 +273,7 @@ interface Response<T> {
259
273
  cacheSession?: string;
260
274
  }
261
275
 
262
- declare class PropertiesState {
276
+ declare class PropertiesState extends CrudStateBase<PropertyItem, PropertiesStateModel, PropertiesActionKey> {
263
277
  private readonly http;
264
278
  private readonly baseUrl;
265
279
  private readonly lookupsUrl;
@@ -279,55 +293,78 @@ declare class PropertiesState {
279
293
  static countries(state: PropertiesStateModel): CountryDefinition[];
280
294
  static apiSchema(state: PropertiesStateModel): ApiSchema | null;
281
295
  static apiProperties(state: PropertiesStateModel): ApiPropertyOption[];
282
- static propertyTypes(state: PropertiesStateModel): any[];
296
+ static propertyTypes(state: PropertiesStateModel): any;
283
297
  static breadcrumbItems(state: PropertiesStateModel): BreadcrumbItem[];
284
298
  static defaultViewType(state: PropertiesStateModel): string | null;
285
- static isLoadingFactory(state: PropertiesStateModel): (loadingName: PropertiesLoadingName) => boolean;
286
- static errorFactory(state: PropertiesStateModel): (loadingName: PropertiesLoadingName) => string | null;
299
+ static getLoadingActive(state: PropertiesStateModel): string[];
300
+ static getErrors(state: PropertiesStateModel): Record<string, string | null>;
287
301
  static propertyById(state: PropertiesStateModel): (id: number | string) => PropertyItem | null;
288
- getAll(ctx: StateContext<PropertiesStateModel>, action: GetProperties): rxjs.Observable<Response<PropertyItem[]> | null>;
289
- getOne(ctx: StateContext<PropertiesStateModel>, action: GetProperty): rxjs.Observable<Response<PropertyItem> | null>;
290
- getLookups(ctx: StateContext<PropertiesStateModel>, _action: GetLookups): rxjs.Observable<LookupDefinition[]> | rxjs.Observable<never[] | Response<LookupDefinition[]>>;
291
- getGroups(ctx: StateContext<PropertiesStateModel>, _action: GetGroups): rxjs.Observable<GroupDefinition[]> | rxjs.Observable<never[] | Response<GroupDefinition[]>>;
292
- getConfigAsType(ctx: StateContext<PropertiesStateModel>, action: GetConfigAsType): rxjs.Observable<ConfigScope[]> | rxjs.Observable<never[] | Response<ConfigScope[]>>;
302
+ getAll(ctx: StateContext<PropertiesStateModel>, action: GetProperties): rxjs.Observable<Response<PropertyItem[]>>;
303
+ getOne(ctx: StateContext<PropertiesStateModel>, action: GetProperty): rxjs.Observable<Response<PropertyItem>>;
304
+ getLookups(ctx: StateContext<PropertiesStateModel>, _action: GetLookups): rxjs.Observable<LookupDefinition[]> | rxjs.Observable<Response<LookupDefinition[]>>;
305
+ getGroups(ctx: StateContext<PropertiesStateModel>, _action: GetGroups): rxjs.Observable<GroupDefinition[]> | rxjs.Observable<Response<GroupDefinition[]>>;
306
+ getConfigAsType(ctx: StateContext<PropertiesStateModel>, action: GetConfigAsType): rxjs.Observable<ConfigScope[]> | rxjs.Observable<Response<ConfigScope[]>>;
293
307
  getCountries(ctx: StateContext<PropertiesStateModel>, _action: GetCountries): rxjs.Observable<CountryDefinition[]>;
294
308
  testApiConfiguration(ctx: StateContext<PropertiesStateModel>, action: TestApiConfiguration): rxjs.Observable<Response<ApiSchema> | null>;
295
- resetApiConfiguration(ctx: StateContext<PropertiesStateModel>): void;
296
- private mapSchemaToOptions;
297
- getPropertiesForConfigType(ctx: StateContext<PropertiesStateModel>, action: GetPropertiesForConfigType): rxjs.Observable<never[] | Response<PropertyItem[]>>;
309
+ getPropertiesForConfigType(ctx: StateContext<PropertiesStateModel>, action: GetPropertiesForConfigType): rxjs.Observable<Response<PropertyItem[]>>;
298
310
  resetConfigProperties(ctx: StateContext<PropertiesStateModel>): void;
299
311
  resetConfigScopes(ctx: StateContext<PropertiesStateModel>): void;
300
312
  resetSelectedProperty(ctx: StateContext<PropertiesStateModel>): void;
313
+ resetApiConfiguration(ctx: StateContext<PropertiesStateModel>): void;
301
314
  setModuleInfo(ctx: StateContext<PropertiesStateModel>, action: SetPropertiesModuleInfo): void;
302
- create(ctx: StateContext<PropertiesStateModel>, action: CreateProperty): rxjs.Observable<null> | rxjs.Observable<Response<PropertyItem>>;
303
- update(ctx: StateContext<PropertiesStateModel>, action: UpdateProperty): rxjs.Observable<Response<PropertyItem> | null>;
304
- delete(ctx: StateContext<PropertiesStateModel>, action: DeleteProperty): rxjs.Observable<void | null>;
305
315
  SetPropertyTypes(ctx: StateContext<PropertiesStateModel>, action: SetPropertyTypes): void;
306
316
  setBreadcrumb(ctx: StateContext<PropertiesStateModel>, action: SetBreadcrumb): void;
307
317
  setDefaultViewType(ctx: StateContext<PropertiesStateModel>, action: SetDefaultViewType): void;
318
+ createProperty(ctx: StateContext<PropertiesStateModel>, action: CreateProperty): rxjs.Observable<Response<PropertyItem>> | rxjs.Observable<null>;
319
+ updateProperty(ctx: StateContext<PropertiesStateModel>, action: UpdateProperty): rxjs.Observable<Response<PropertyItem>> | rxjs.Observable<null>;
320
+ deleteProperty(ctx: StateContext<PropertiesStateModel>, action: DeleteProperty): rxjs.Observable<void>;
321
+ private mapSchemaToOptions;
308
322
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<PropertiesState, never>;
309
323
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<PropertiesState>;
310
324
  }
311
325
 
312
326
  declare class PropertiesFacade {
313
327
  private readonly store;
314
- readonly list: _angular_core.Signal<PropertyItem[]>;
328
+ readonly list: _angular_core.Signal<_masterteam_properties.PropertyItem[]>;
315
329
  readonly propertyTypes: _angular_core.Signal<any>;
316
- readonly selected: _angular_core.Signal<PropertyItem | null>;
330
+ readonly selected: _angular_core.Signal<_masterteam_properties.PropertyItem | null>;
317
331
  readonly moduleId: _angular_core.Signal<string | number | null>;
318
332
  readonly parentModuleId: _angular_core.Signal<string | number | null>;
319
- readonly lookups: _angular_core.Signal<LookupDefinition[]>;
320
- readonly configProperties: _angular_core.Signal<PropertyItem[]>;
321
- readonly groups: _angular_core.Signal<GroupDefinition[]>;
322
- readonly configScopes: _angular_core.Signal<ConfigScope[]>;
323
- readonly countries: _angular_core.Signal<CountryDefinition[]>;
324
- readonly apiSchema: _angular_core.Signal<ApiSchema | null>;
325
- readonly apiProperties: _angular_core.Signal<ApiPropertyOption[]>;
333
+ readonly lookups: _angular_core.Signal<_masterteam_properties.LookupDefinition[]>;
334
+ readonly configProperties: _angular_core.Signal<_masterteam_properties.PropertyItem[]>;
335
+ readonly groups: _angular_core.Signal<_masterteam_properties.GroupDefinition[]>;
336
+ readonly configScopes: _angular_core.Signal<_masterteam_properties.ConfigScope[]>;
337
+ readonly countries: _angular_core.Signal<_masterteam_properties.CountryDefinition[]>;
338
+ readonly apiSchema: _angular_core.Signal<_masterteam_properties.ApiSchema | null>;
339
+ readonly apiProperties: _angular_core.Signal<_masterteam_properties.ApiPropertyOption[]>;
326
340
  readonly breadcrumbItems: _angular_core.Signal<BreadcrumbItem[]>;
327
341
  readonly defaultViewType: _angular_core.Signal<string | null>;
328
- readonly systemProperties: _angular_core.Signal<PropertyItem[]>;
329
- readonly customProperties: _angular_core.Signal<PropertyItem[]>;
330
- isLoading(loadingName: PropertiesLoadingName): _angular_core.Signal<boolean>;
342
+ private readonly loadingActive;
343
+ private readonly errors;
344
+ readonly isLoadingAll: _angular_core.Signal<boolean>;
345
+ readonly isLoadingOne: _angular_core.Signal<boolean>;
346
+ readonly isCreating: _angular_core.Signal<boolean>;
347
+ readonly isUpdating: _angular_core.Signal<boolean>;
348
+ readonly isDeleting: _angular_core.Signal<boolean>;
349
+ readonly isLoadingLookups: _angular_core.Signal<boolean>;
350
+ readonly isLoadingGroups: _angular_core.Signal<boolean>;
351
+ readonly isLoadingConfigProperties: _angular_core.Signal<boolean>;
352
+ readonly isLoadingConfigAsType: _angular_core.Signal<boolean>;
353
+ readonly isLoadingCountries: _angular_core.Signal<boolean>;
354
+ readonly isTestingApi: _angular_core.Signal<boolean>;
355
+ readonly allError: _angular_core.Signal<string | null>;
356
+ readonly oneError: _angular_core.Signal<string | null>;
357
+ readonly createError: _angular_core.Signal<string | null>;
358
+ readonly updateError: _angular_core.Signal<string | null>;
359
+ readonly deleteError: _angular_core.Signal<string | null>;
360
+ readonly lookupsError: _angular_core.Signal<string | null>;
361
+ readonly groupsError: _angular_core.Signal<string | null>;
362
+ readonly configPropertiesError: _angular_core.Signal<string | null>;
363
+ readonly configAsTypeError: _angular_core.Signal<string | null>;
364
+ readonly countriesError: _angular_core.Signal<string | null>;
365
+ readonly apiTestError: _angular_core.Signal<string | null>;
366
+ readonly systemProperties: _angular_core.Signal<_masterteam_properties.PropertyItem[]>;
367
+ readonly customProperties: _angular_core.Signal<_masterteam_properties.PropertyItem[]>;
331
368
  loadAll(params?: Partial<PropertiesQueryParams>): Observable<unknown>;
332
369
  loadOne(id: string | number, mode?: 'edit'): Observable<unknown>;
333
370
  delete(id: string | number): Observable<unknown>;
@@ -445,5 +482,5 @@ declare class PropertyForm implements OnDestroy {
445
482
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<PropertyForm, "mt-property-form", never, { "propertyId": { "alias": "propertyId"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
446
483
  }
447
484
 
448
- export { CreateProperty, DeleteProperty, GetConfigAsType, GetCountries, GetGroups, GetLookups, GetProperties, GetPropertiesForConfigType, GetProperty, PropertiesFacade, PropertiesList, PropertiesState, PropertyForm, REQUEST_CONTEXT, ResetApiConfiguration, ResetConfigProperties, ResetConfigScopes, ResetSelectedProperty, SetBreadcrumb, SetDefaultViewType, SetPropertiesModuleInfo, SetPropertyTypes, TestApiConfiguration, UpdateProperty };
485
+ export { CreateProperty, DeleteProperty, GetConfigAsType, GetCountries, GetGroups, GetLookups, GetProperties, GetPropertiesForConfigType, GetProperty, PropertiesActionKey, PropertiesFacade, PropertiesList, PropertiesState, PropertyForm, REQUEST_CONTEXT, ResetApiConfiguration, ResetConfigProperties, ResetConfigScopes, ResetSelectedProperty, SetBreadcrumb, SetDefaultViewType, SetPropertiesModuleInfo, SetPropertyTypes, TestApiConfiguration, UpdateProperty };
449
486
  export type { ApiConfigurationValue, ApiPropertyOption, ApiSchema, ApiSchemaProperty, ApiTestPayload, ApiTestResponse, ConfigScope, CountryDefinition, GroupDefinition, LogDefinition, LookupDefinition, LookupDefinitionItem, PropertiesLoadingName, PropertiesQueryParams, PropertiesStateModel, PropertyItem, PropertyPayload };