@etsoo/appscript 1.2.82 → 1.2.85
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/cjs/app/CoreApp.d.ts +9 -9
- package/lib/cjs/business/BusinessUtils.d.ts +6 -6
- package/lib/cjs/dto/IdLabelDto.d.ts +2 -2
- package/lib/mjs/app/CoreApp.d.ts +9 -9
- package/lib/mjs/business/BusinessUtils.d.ts +6 -6
- package/lib/mjs/dto/IdLabelDto.d.ts +2 -2
- package/package.json +2 -2
- package/src/app/CoreApp.ts +10 -8
- package/src/business/BusinessUtils.ts +7 -7
- package/src/dto/IdLabelDto.ts +3 -3
package/lib/cjs/app/CoreApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
|
-
import { DataTypes, DateUtils, IStorage } from '@etsoo/shared';
|
|
3
|
+
import { DataTypes, DateUtils, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
5
|
import { ProductUnit } from '../business/ProductUnit';
|
|
6
6
|
import { InitCallDto } from '../dto/InitCallDto';
|
|
@@ -269,7 +269,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
269
269
|
* Get roles
|
|
270
270
|
* @param role Combination role value
|
|
271
271
|
*/
|
|
272
|
-
getRoles(role: number):
|
|
272
|
+
getRoles(role: number): ListType[];
|
|
273
273
|
/**
|
|
274
274
|
* Get status label
|
|
275
275
|
* @param status Status value
|
|
@@ -279,7 +279,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
279
279
|
* Get status list
|
|
280
280
|
* @returns list
|
|
281
281
|
*/
|
|
282
|
-
getStatusList():
|
|
282
|
+
getStatusList(): ListType[];
|
|
283
283
|
/**
|
|
284
284
|
* Get refresh token from response headers
|
|
285
285
|
* @param rawResponse Raw response from API call
|
|
@@ -348,7 +348,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
348
348
|
* @param serviceId Service id
|
|
349
349
|
* @returns Result
|
|
350
350
|
*/
|
|
351
|
-
orgList(items?: number, serviceId?: number): Promise<
|
|
351
|
+
orgList(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
|
|
352
352
|
/**
|
|
353
353
|
* Persist settings to source when application exit
|
|
354
354
|
*/
|
|
@@ -717,7 +717,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
717
717
|
* @param filter Filter
|
|
718
718
|
* @returns List
|
|
719
719
|
*/
|
|
720
|
-
protected getEnumList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined):
|
|
720
|
+
protected getEnumList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined): ListType[];
|
|
721
721
|
/**
|
|
722
722
|
* Get enum item string id list
|
|
723
723
|
* @param em Enum
|
|
@@ -725,7 +725,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
725
725
|
* @param filter Filter
|
|
726
726
|
* @returns List
|
|
727
727
|
*/
|
|
728
|
-
protected getEnumStrList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined):
|
|
728
|
+
protected getEnumStrList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined): ListType1[];
|
|
729
729
|
/**
|
|
730
730
|
* Get all regions
|
|
731
731
|
* @returns Regions
|
|
@@ -735,12 +735,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
735
735
|
* Get roles
|
|
736
736
|
* @param role Combination role value
|
|
737
737
|
*/
|
|
738
|
-
getRoles(role: number):
|
|
738
|
+
getRoles(role: number): ListType[];
|
|
739
739
|
/**
|
|
740
740
|
* Get status list
|
|
741
741
|
* @returns list
|
|
742
742
|
*/
|
|
743
|
-
getStatusList():
|
|
743
|
+
getStatusList(): ListType[];
|
|
744
744
|
/**
|
|
745
745
|
* Get status label
|
|
746
746
|
* @param status Status value
|
|
@@ -823,7 +823,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
823
823
|
* @param serviceId Service id
|
|
824
824
|
* @returns Result
|
|
825
825
|
*/
|
|
826
|
-
orgList(items?: number, serviceId?: number): Promise<
|
|
826
|
+
orgList(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
|
|
827
827
|
/**
|
|
828
828
|
* Switch organization
|
|
829
829
|
* @param id Organization id
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
1
|
+
import { DataTypes, ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
import { ICultureGet } from '../state/Culture';
|
|
3
3
|
import { ProductUnit } from './ProductUnit';
|
|
4
4
|
/**
|
|
@@ -19,14 +19,14 @@ export declare namespace BusinessUtils {
|
|
|
19
19
|
* @param func Label delegate
|
|
20
20
|
* @returns Collection
|
|
21
21
|
*/
|
|
22
|
-
function getCurrencies(currencyNames: string[], func: ICultureGet):
|
|
22
|
+
function getCurrencies(currencyNames: string[], func: ICultureGet): ListType1[];
|
|
23
23
|
/**
|
|
24
24
|
* Get 12-month items
|
|
25
25
|
* @param monthLabels Month labels
|
|
26
26
|
* @param startMonth Start month, 0 as Jan.
|
|
27
27
|
* @returns 12 months
|
|
28
28
|
*/
|
|
29
|
-
function getMonths(monthLabels: string[], startMonth?: number):
|
|
29
|
+
function getMonths(monthLabels: string[], startMonth?: number): ListType[];
|
|
30
30
|
/**
|
|
31
31
|
* Get product unit's label
|
|
32
32
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -41,7 +41,7 @@ export declare namespace BusinessUtils {
|
|
|
41
41
|
* @param func Label delegate
|
|
42
42
|
* @returns Units
|
|
43
43
|
*/
|
|
44
|
-
function getUnits(func: ICultureGet):
|
|
44
|
+
function getUnits(func: ICultureGet): ListType[];
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
47
|
* Get all product units
|
|
@@ -50,7 +50,7 @@ export declare namespace BusinessUtils {
|
|
|
50
50
|
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
51
51
|
* @returns Units
|
|
52
52
|
*/
|
|
53
|
-
function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean):
|
|
53
|
+
function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean): ListType[];
|
|
54
54
|
/**
|
|
55
55
|
*
|
|
56
56
|
* Get all repeat options
|
|
@@ -59,7 +59,7 @@ export declare namespace BusinessUtils {
|
|
|
59
59
|
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
60
60
|
* @returns Units
|
|
61
61
|
*/
|
|
62
|
-
function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean):
|
|
62
|
+
function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean): ListType[];
|
|
63
63
|
/**
|
|
64
64
|
* Set id value
|
|
65
65
|
* @param item QueryRQ or TiplistRQ or similiar item
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
/**
|
|
3
3
|
* Conditional IdLabel type
|
|
4
4
|
*/
|
|
5
|
-
export declare type IdLabelConditional<T extends boolean> = T extends true ?
|
|
5
|
+
export declare type IdLabelConditional<T extends boolean> = T extends true ? ListType[] : ListType1[];
|
package/lib/mjs/app/CoreApp.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { INotifier, NotificationAlign, NotificationCallProps, NotificationContent, NotificationReturn } from '@etsoo/notificationbase';
|
|
2
2
|
import { ApiDataError, IApi, IPData } from '@etsoo/restclient';
|
|
3
|
-
import { DataTypes, DateUtils, IStorage } from '@etsoo/shared';
|
|
3
|
+
import { DataTypes, DateUtils, IStorage, ListType, ListType1 } from '@etsoo/shared';
|
|
4
4
|
import { AddressRegion } from '../address/AddressRegion';
|
|
5
5
|
import { ProductUnit } from '../business/ProductUnit';
|
|
6
6
|
import { InitCallDto } from '../dto/InitCallDto';
|
|
@@ -269,7 +269,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
269
269
|
* Get roles
|
|
270
270
|
* @param role Combination role value
|
|
271
271
|
*/
|
|
272
|
-
getRoles(role: number):
|
|
272
|
+
getRoles(role: number): ListType[];
|
|
273
273
|
/**
|
|
274
274
|
* Get status label
|
|
275
275
|
* @param status Status value
|
|
@@ -279,7 +279,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
279
279
|
* Get status list
|
|
280
280
|
* @returns list
|
|
281
281
|
*/
|
|
282
|
-
getStatusList():
|
|
282
|
+
getStatusList(): ListType[];
|
|
283
283
|
/**
|
|
284
284
|
* Get refresh token from response headers
|
|
285
285
|
* @param rawResponse Raw response from API call
|
|
@@ -348,7 +348,7 @@ export interface ICoreApp<U extends IUser, S extends IAppSettings, N, C extends
|
|
|
348
348
|
* @param serviceId Service id
|
|
349
349
|
* @returns Result
|
|
350
350
|
*/
|
|
351
|
-
orgList(items?: number, serviceId?: number): Promise<
|
|
351
|
+
orgList(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
|
|
352
352
|
/**
|
|
353
353
|
* Persist settings to source when application exit
|
|
354
354
|
*/
|
|
@@ -717,7 +717,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
717
717
|
* @param filter Filter
|
|
718
718
|
* @returns List
|
|
719
719
|
*/
|
|
720
|
-
protected getEnumList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined):
|
|
720
|
+
protected getEnumList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined): ListType[];
|
|
721
721
|
/**
|
|
722
722
|
* Get enum item string id list
|
|
723
723
|
* @param em Enum
|
|
@@ -725,7 +725,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
725
725
|
* @param filter Filter
|
|
726
726
|
* @returns List
|
|
727
727
|
*/
|
|
728
|
-
protected getEnumStrList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined):
|
|
728
|
+
protected getEnumStrList<E extends DataTypes.EnumBase = DataTypes.EnumBase>(em: E, prefix: string, filter?: (id: E[keyof E], key: keyof E & string) => E[keyof E] | undefined): ListType1[];
|
|
729
729
|
/**
|
|
730
730
|
* Get all regions
|
|
731
731
|
* @returns Regions
|
|
@@ -735,12 +735,12 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
735
735
|
* Get roles
|
|
736
736
|
* @param role Combination role value
|
|
737
737
|
*/
|
|
738
|
-
getRoles(role: number):
|
|
738
|
+
getRoles(role: number): ListType[];
|
|
739
739
|
/**
|
|
740
740
|
* Get status list
|
|
741
741
|
* @returns list
|
|
742
742
|
*/
|
|
743
|
-
getStatusList():
|
|
743
|
+
getStatusList(): ListType[];
|
|
744
744
|
/**
|
|
745
745
|
* Get status label
|
|
746
746
|
* @param status Status value
|
|
@@ -823,7 +823,7 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
|
|
|
823
823
|
* @param serviceId Service id
|
|
824
824
|
* @returns Result
|
|
825
825
|
*/
|
|
826
|
-
orgList(items?: number, serviceId?: number): Promise<
|
|
826
|
+
orgList(items?: number, serviceId?: number): Promise<ListType[] | undefined>;
|
|
827
827
|
/**
|
|
828
828
|
* Switch organization
|
|
829
829
|
* @param id Organization id
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
1
|
+
import { DataTypes, ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
import { ICultureGet } from '../state/Culture';
|
|
3
3
|
import { ProductUnit } from './ProductUnit';
|
|
4
4
|
/**
|
|
@@ -19,14 +19,14 @@ export declare namespace BusinessUtils {
|
|
|
19
19
|
* @param func Label delegate
|
|
20
20
|
* @returns Collection
|
|
21
21
|
*/
|
|
22
|
-
function getCurrencies(currencyNames: string[], func: ICultureGet):
|
|
22
|
+
function getCurrencies(currencyNames: string[], func: ICultureGet): ListType1[];
|
|
23
23
|
/**
|
|
24
24
|
* Get 12-month items
|
|
25
25
|
* @param monthLabels Month labels
|
|
26
26
|
* @param startMonth Start month, 0 as Jan.
|
|
27
27
|
* @returns 12 months
|
|
28
28
|
*/
|
|
29
|
-
function getMonths(monthLabels: string[], startMonth?: number):
|
|
29
|
+
function getMonths(monthLabels: string[], startMonth?: number): ListType[];
|
|
30
30
|
/**
|
|
31
31
|
* Get product unit's label
|
|
32
32
|
* Please define the label in culture with key 'unitPC' for ProductUnit.PC like that
|
|
@@ -41,7 +41,7 @@ export declare namespace BusinessUtils {
|
|
|
41
41
|
* @param func Label delegate
|
|
42
42
|
* @returns Units
|
|
43
43
|
*/
|
|
44
|
-
function getUnits(func: ICultureGet):
|
|
44
|
+
function getUnits(func: ICultureGet): ListType[];
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
47
|
* Get all product units
|
|
@@ -50,7 +50,7 @@ export declare namespace BusinessUtils {
|
|
|
50
50
|
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
51
51
|
* @returns Units
|
|
52
52
|
*/
|
|
53
|
-
function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean):
|
|
53
|
+
function getUnits(func: ICultureGet, options?: string[], isJoined?: boolean): ListType[];
|
|
54
54
|
/**
|
|
55
55
|
*
|
|
56
56
|
* Get all repeat options
|
|
@@ -59,7 +59,7 @@ export declare namespace BusinessUtils {
|
|
|
59
59
|
* @param isJoined Add the join label like 'per Kg' for Kg
|
|
60
60
|
* @returns Units
|
|
61
61
|
*/
|
|
62
|
-
function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean):
|
|
62
|
+
function getRepeatOptions(func: ICultureGet, options?: string[], isJoined?: boolean): ListType[];
|
|
63
63
|
/**
|
|
64
64
|
* Set id value
|
|
65
65
|
* @param item QueryRQ or TiplistRQ or similiar item
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
/**
|
|
3
3
|
* Conditional IdLabel type
|
|
4
4
|
*/
|
|
5
|
-
export declare type IdLabelConditional<T extends boolean> = T extends true ?
|
|
5
|
+
export declare type IdLabelConditional<T extends boolean> = T extends true ? ListType[] : ListType1[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.85",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"jest": "^28.1.3",
|
|
74
74
|
"jest-environment-jsdom": "^28.1.3",
|
|
75
75
|
"ts-jest": "^28.0.8",
|
|
76
|
-
"typescript": "^4.
|
|
76
|
+
"typescript": "^4.8.2"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/src/app/CoreApp.ts
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
DateUtils,
|
|
14
14
|
DomUtils,
|
|
15
15
|
IStorage,
|
|
16
|
+
ListType,
|
|
17
|
+
ListType1,
|
|
16
18
|
NumberUtils,
|
|
17
19
|
Utils
|
|
18
20
|
} from '@etsoo/shared';
|
|
@@ -385,7 +387,7 @@ export interface ICoreApp<
|
|
|
385
387
|
* Get roles
|
|
386
388
|
* @param role Combination role value
|
|
387
389
|
*/
|
|
388
|
-
getRoles(role: number):
|
|
390
|
+
getRoles(role: number): ListType[];
|
|
389
391
|
|
|
390
392
|
/**
|
|
391
393
|
* Get status label
|
|
@@ -397,7 +399,7 @@ export interface ICoreApp<
|
|
|
397
399
|
* Get status list
|
|
398
400
|
* @returns list
|
|
399
401
|
*/
|
|
400
|
-
getStatusList():
|
|
402
|
+
getStatusList(): ListType[];
|
|
401
403
|
|
|
402
404
|
/**
|
|
403
405
|
* Get refresh token from response headers
|
|
@@ -486,7 +488,7 @@ export interface ICoreApp<
|
|
|
486
488
|
orgList(
|
|
487
489
|
items?: number,
|
|
488
490
|
serviceId?: number
|
|
489
|
-
): Promise<
|
|
491
|
+
): Promise<ListType[] | undefined>;
|
|
490
492
|
|
|
491
493
|
/**
|
|
492
494
|
* Persist settings to source when application exit
|
|
@@ -1620,8 +1622,8 @@ export abstract class CoreApp<
|
|
|
1620
1622
|
id: E[keyof E],
|
|
1621
1623
|
key: keyof E & string
|
|
1622
1624
|
) => E[keyof E] | undefined
|
|
1623
|
-
):
|
|
1624
|
-
const list:
|
|
1625
|
+
): ListType[] {
|
|
1626
|
+
const list: ListType[] = [];
|
|
1625
1627
|
const keys = DataTypes.getEnumKeys(em);
|
|
1626
1628
|
for (const key of keys) {
|
|
1627
1629
|
let id = em[key as keyof E];
|
|
@@ -1651,8 +1653,8 @@ export abstract class CoreApp<
|
|
|
1651
1653
|
id: E[keyof E],
|
|
1652
1654
|
key: keyof E & string
|
|
1653
1655
|
) => E[keyof E] | undefined
|
|
1654
|
-
):
|
|
1655
|
-
const list:
|
|
1656
|
+
): ListType1[] {
|
|
1657
|
+
const list: ListType1[] = [];
|
|
1656
1658
|
const keys = DataTypes.getEnumKeys(em);
|
|
1657
1659
|
for (const key of keys) {
|
|
1658
1660
|
let id = em[key as keyof E];
|
|
@@ -1883,7 +1885,7 @@ export abstract class CoreApp<
|
|
|
1883
1885
|
* @returns Result
|
|
1884
1886
|
*/
|
|
1885
1887
|
async orgList(items?: number, serviceId?: number) {
|
|
1886
|
-
return await this.api.post<
|
|
1888
|
+
return await this.api.post<ListType[]>(
|
|
1887
1889
|
'Organization/List',
|
|
1888
1890
|
{
|
|
1889
1891
|
items,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTypes } from '@etsoo/shared';
|
|
1
|
+
import { DataTypes, ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
import { ICultureGet } from '../state/Culture';
|
|
3
3
|
import { ProductUnit } from './ProductUnit';
|
|
4
4
|
import { RepeatOption } from './RepeatOption';
|
|
@@ -55,7 +55,7 @@ export namespace BusinessUtils {
|
|
|
55
55
|
export function getCurrencies(
|
|
56
56
|
currencyNames: string[],
|
|
57
57
|
func: ICultureGet
|
|
58
|
-
):
|
|
58
|
+
): ListType1[] {
|
|
59
59
|
return currencyNames.map((name) => ({
|
|
60
60
|
id: name,
|
|
61
61
|
label: func(`currency${name}`) ?? name
|
|
@@ -69,7 +69,7 @@ export namespace BusinessUtils {
|
|
|
69
69
|
* @returns 12 months
|
|
70
70
|
*/
|
|
71
71
|
export function getMonths(monthLabels: string[], startMonth: number = 0) {
|
|
72
|
-
const months:
|
|
72
|
+
const months: ListType[] = [];
|
|
73
73
|
|
|
74
74
|
for (let i = 0; i < 12; i++) {
|
|
75
75
|
if (startMonth >= 12) startMonth = 0;
|
|
@@ -109,7 +109,7 @@ export namespace BusinessUtils {
|
|
|
109
109
|
* @param func Label delegate
|
|
110
110
|
* @returns Units
|
|
111
111
|
*/
|
|
112
|
-
export function getUnits(func: ICultureGet):
|
|
112
|
+
export function getUnits(func: ICultureGet): ListType[];
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
*
|
|
@@ -123,7 +123,7 @@ export namespace BusinessUtils {
|
|
|
123
123
|
func: ICultureGet,
|
|
124
124
|
options?: string[],
|
|
125
125
|
isJoined?: boolean
|
|
126
|
-
):
|
|
126
|
+
): ListType[];
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
*
|
|
@@ -137,7 +137,7 @@ export namespace BusinessUtils {
|
|
|
137
137
|
func: ICultureGet,
|
|
138
138
|
options?: string[],
|
|
139
139
|
isJoined?: boolean
|
|
140
|
-
):
|
|
140
|
+
): ListType[] {
|
|
141
141
|
options ??= DataTypes.getEnumKeys(ProductUnit);
|
|
142
142
|
return options.map((key) => {
|
|
143
143
|
const id = DataTypes.getEnumByKey(ProductUnit, key)! as number;
|
|
@@ -160,7 +160,7 @@ export namespace BusinessUtils {
|
|
|
160
160
|
func: ICultureGet,
|
|
161
161
|
options?: string[],
|
|
162
162
|
isJoined: boolean = true
|
|
163
|
-
):
|
|
163
|
+
): ListType[] {
|
|
164
164
|
options ??= DataTypes.getEnumKeys(RepeatOption);
|
|
165
165
|
isJoined ??= true;
|
|
166
166
|
|
package/src/dto/IdLabelDto.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListType, ListType1 } from '@etsoo/shared';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Conditional IdLabel type
|
|
5
5
|
*/
|
|
6
6
|
export type IdLabelConditional<T extends boolean> = T extends true
|
|
7
|
-
?
|
|
8
|
-
:
|
|
7
|
+
? ListType[]
|
|
8
|
+
: ListType1[];
|