@ng-atomic/common 16.1.1 → 16.3.1
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/directives/fallback-src/fallback-src.directive.d.ts +9 -0
- package/directives/fallback-src/index.d.ts +1 -0
- package/esm2022/directives/fallback-src/fallback-src.directive.mjs +25 -0
- package/esm2022/directives/fallback-src/index.mjs +2 -0
- package/esm2022/directives/fallback-src/ng-atomic-common-directives-fallback-src.mjs +5 -0
- package/esm2022/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.directive.mjs +4 -4
- package/esm2022/directives/ios-safari-scroll-buggyfill/ios-safari-scroll-buggyfill.module.mjs +5 -5
- package/esm2022/interceptors/authorization/authorization.interceptor.mjs +4 -4
- package/esm2022/interceptors/index.mjs +2 -0
- package/esm2022/interceptors/interceptors.module.mjs +54 -0
- package/esm2022/interceptors/ng-atomic-common-interceptors.mjs +5 -0
- package/esm2022/interceptors/throttle/throttle.interceptor.mjs +8 -8
- package/esm2022/interceptors/token/authorization.interceptor.mjs +4 -4
- package/esm2022/models/index.mjs +1 -1
- package/esm2022/pipes/actions/actions.pipe.mjs +4 -4
- package/esm2022/pipes/data-accessor/data-accessor.pipe.mjs +14 -14
- package/esm2022/pipes/domain/domain.pipe.mjs +50 -21
- package/esm2022/pipes/error/error.pipe.mjs +4 -4
- package/esm2022/pipes/grouped-by/grouped-by.pipe.mjs +6 -4
- package/esm2022/pipes/index/index.mjs +2 -0
- package/esm2022/pipes/index/index.pipe.mjs +29 -0
- package/esm2022/pipes/index/ng-atomic-common-pipes-index.mjs +5 -0
- package/esm2022/pipes/index-length/index-length.pipe.mjs +22 -0
- package/esm2022/pipes/index-length/index.mjs +2 -0
- package/esm2022/pipes/index-length/ng-atomic-common-pipes-index-length.mjs +5 -0
- package/esm2022/pipes/keys/keys.pipe.mjs +4 -4
- package/esm2022/pipes/page/index.mjs +2 -0
- package/esm2022/pipes/page/ng-atomic-common-pipes-page.mjs +5 -0
- package/esm2022/pipes/page/page.pipe.mjs +25 -0
- package/esm2022/pipes/pagination/pagination.pipe.mjs +9 -9
- package/esm2022/pipes/query/query.pipe.mjs +14 -7
- package/esm2022/pipes/secret/index.mjs +2 -0
- package/esm2022/pipes/secret/ng-atomic-common-pipes-secret.mjs +5 -0
- package/esm2022/pipes/secret/secret.pipe.mjs +21 -0
- package/esm2022/pipes/select-id/select-id.pipe.mjs +6 -6
- package/esm2022/pipes/signal/signal.pipe.mjs +8 -4
- package/esm2022/pipes/smart-exp/smart-exp.module.mjs +5 -5
- package/esm2022/pipes/smart-exp/smart-exp.pipe.mjs +6 -6
- package/esm2022/pipes/smart-field/smart-field.pipe.mjs +21 -21
- package/esm2022/pipes/sort-by/index.mjs +2 -0
- package/esm2022/pipes/sort-by/ng-atomic-common-pipes-sort-by.mjs +5 -0
- package/esm2022/pipes/sort-by/sort-by.pipe.mjs +32 -0
- package/esm2022/pipes/yen/yen.pipe.mjs +4 -4
- package/esm2022/services/auth/auth.service.mjs +35 -20
- package/esm2022/services/chips-manager/chips.manager.mjs +4 -4
- package/esm2022/services/csv/csv.service.mjs +4 -4
- package/esm2022/services/form/pagination/pagination.service.mjs +4 -4
- package/esm2022/services/form/sort/sort.service.mjs +5 -5
- package/esm2022/services/loading/loading.service.mjs +42 -21
- package/esm2022/services/navigation-history/index.mjs +2 -0
- package/esm2022/services/navigation-history/navigation-history.service.mjs +50 -0
- package/esm2022/services/navigation-history/ng-atomic-common-services-navigation-history.mjs +5 -0
- package/esm2022/services/query-resolver/query-resolver.service.mjs +87 -25
- package/esm2022/services/root-property/index.mjs +2 -0
- package/esm2022/services/root-property/ng-atomic-common-services-root-property.mjs +5 -0
- package/esm2022/services/root-property/root-property.service.mjs +122 -0
- package/esm2022/services/router/index.mjs +2 -0
- package/esm2022/services/router/ng-atomic-common-services-router.mjs +5 -0
- package/esm2022/services/router/router.service.mjs +25 -0
- package/esm2022/services/secret/index.mjs +2 -0
- package/esm2022/services/secret/ng-atomic-common-services-secret.mjs +5 -0
- package/esm2022/services/secret/secret.service.mjs +16 -0
- package/esm2022/services/side-app/index.mjs +2 -0
- package/esm2022/services/side-app/ng-atomic-common-services-side-app.mjs +5 -0
- package/esm2022/services/side-app/side-app.service.mjs +25 -0
- package/esm2022/services/side-nav-mode/index.mjs +2 -0
- package/esm2022/services/side-nav-mode/ng-atomic-common-services-side-nav-mode.mjs +5 -0
- package/esm2022/services/side-nav-mode/side-nav-mode.service.mjs +27 -0
- package/esm2022/services/snack-bar/snack-bar.module.mjs +5 -5
- package/esm2022/services/snack-bar/snack-bar.service.mjs +6 -6
- package/esm2022/services/ui/index.mjs +2 -1
- package/esm2022/services/ui/ui.helpers.mjs +186 -0
- package/esm2022/services/ui/ui.service.mjs +55 -173
- package/esm2022/stores/entities/di.mjs +56 -0
- package/esm2022/stores/entities/entity-store-manager.mjs +42 -0
- package/esm2022/stores/entities/entity-store.mjs +127 -0
- package/esm2022/stores/entities/index.mjs +6 -2
- package/esm2022/stores/entities/proxy-id.service.mjs +29 -0
- package/esm2022/stores/entities/task-composer.mjs +71 -0
- package/esm2022/stores/pagination/pagination.store.mjs +5 -5
- package/esm2022/stores/query/query.store.mjs +7 -7
- package/esm2022/stores/selection/selection.store.mjs +5 -5
- package/esm2022/stores/sort/sort.store.mjs +5 -5
- package/esm2022/utils/form/form.mjs +26 -0
- package/esm2022/utils/form/index.mjs +2 -0
- package/esm2022/utils/get/get.mjs +2 -1
- package/esm2022/utils/index.mjs +5 -2
- package/esm2022/utils/inject/index.mjs +2 -0
- package/esm2022/utils/inject/inject.mjs +120 -0
- package/esm2022/utils/mat-dayjs-date/dayjs-date.adapter.mjs +3 -2
- package/esm2022/utils/mat-dayjs-date/dayjs-date.module.mjs +22 -26
- package/esm2022/utils/page/page.mjs +1 -1
- package/esm2022/utils/router/index.mjs +2 -0
- package/esm2022/utils/router/router.mjs +54 -0
- package/esm2022/utils/time.mjs +8 -0
- package/fesm2022/ng-atomic-common-directives-fallback-src.mjs +32 -0
- package/fesm2022/ng-atomic-common-directives-fallback-src.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs +7 -7
- package/fesm2022/ng-atomic-common-directives-ios-safari-scroll-buggyfill.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-authorization.mjs +3 -3
- package/fesm2022/ng-atomic-common-interceptors-authorization.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-throttle.mjs +7 -7
- package/fesm2022/ng-atomic-common-interceptors-throttle.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors-token.mjs +3 -3
- package/fesm2022/ng-atomic-common-interceptors-token.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-interceptors.mjs +61 -0
- package/fesm2022/ng-atomic-common-interceptors.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-actions.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-actions.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-data-accessor.mjs +14 -14
- package/fesm2022/ng-atomic-common-pipes-data-accessor.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-domain.mjs +50 -21
- package/fesm2022/ng-atomic-common-pipes-domain.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-error.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-error.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-grouped-by.mjs +5 -3
- package/fesm2022/ng-atomic-common-pipes-grouped-by.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-index-length.mjs +29 -0
- package/fesm2022/ng-atomic-common-pipes-index-length.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-index.mjs +36 -0
- package/fesm2022/ng-atomic-common-pipes-index.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-keys.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-keys.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-page.mjs +32 -0
- package/fesm2022/ng-atomic-common-pipes-page.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-pagination.mjs +8 -8
- package/fesm2022/ng-atomic-common-pipes-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-query.mjs +14 -7
- package/fesm2022/ng-atomic-common-pipes-query.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-secret.mjs +28 -0
- package/fesm2022/ng-atomic-common-pipes-secret.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-select-id.mjs +5 -5
- package/fesm2022/ng-atomic-common-pipes-select-id.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-signal.mjs +8 -4
- package/fesm2022/ng-atomic-common-pipes-signal.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-smart-exp.mjs +9 -9
- package/fesm2022/ng-atomic-common-pipes-smart-exp.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-smart-field.mjs +21 -21
- package/fesm2022/ng-atomic-common-pipes-smart-field.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-pipes-sort-by.mjs +39 -0
- package/fesm2022/ng-atomic-common-pipes-sort-by.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-pipes-yen.mjs +3 -3
- package/fesm2022/ng-atomic-common-pipes-yen.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-auth.mjs +35 -20
- package/fesm2022/ng-atomic-common-services-auth.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-chips-manager.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-chips-manager.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-csv.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-csv.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-pagination.mjs +3 -3
- package/fesm2022/ng-atomic-common-services-form-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-form-sort.mjs +4 -4
- package/fesm2022/ng-atomic-common-services-form-sort.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-loading.mjs +42 -21
- package/fesm2022/ng-atomic-common-services-loading.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-navigation-history.mjs +57 -0
- package/fesm2022/ng-atomic-common-services-navigation-history.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-query-resolver.mjs +86 -25
- package/fesm2022/ng-atomic-common-services-query-resolver.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-root-property.mjs +129 -0
- package/fesm2022/ng-atomic-common-services-root-property.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-router.mjs +32 -0
- package/fesm2022/ng-atomic-common-services-router.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-secret.mjs +23 -0
- package/fesm2022/ng-atomic-common-services-secret.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-side-app.mjs +32 -0
- package/fesm2022/ng-atomic-common-services-side-app.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-side-nav-mode.mjs +34 -0
- package/fesm2022/ng-atomic-common-services-side-nav-mode.mjs.map +1 -0
- package/fesm2022/ng-atomic-common-services-snack-bar.mjs +9 -9
- package/fesm2022/ng-atomic-common-services-snack-bar.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-services-ui.mjs +237 -174
- package/fesm2022/ng-atomic-common-services-ui.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-entities.mjs +297 -19
- package/fesm2022/ng-atomic-common-stores-entities.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-pagination.mjs +4 -4
- package/fesm2022/ng-atomic-common-stores-pagination.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-query.mjs +6 -6
- package/fesm2022/ng-atomic-common-stores-query.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-selection.mjs +4 -4
- package/fesm2022/ng-atomic-common-stores-selection.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-stores-sort.mjs +4 -4
- package/fesm2022/ng-atomic-common-stores-sort.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-utils-page.mjs.map +1 -1
- package/fesm2022/ng-atomic-common-utils.mjs +227 -124
- package/fesm2022/ng-atomic-common-utils.mjs.map +1 -1
- package/interceptors/index.d.ts +1 -0
- package/interceptors/interceptors.module.d.ts +7 -0
- package/models/index.d.ts +34 -0
- package/package.json +79 -7
- package/pipes/data-accessor/data-accessor.pipe.d.ts +7 -3
- package/pipes/domain/domain.pipe.d.ts +51 -5
- package/pipes/grouped-by/grouped-by.pipe.d.ts +1 -1
- package/pipes/index/index.d.ts +1 -0
- package/pipes/index/index.pipe.d.ts +11 -0
- package/pipes/index-length/index-length.pipe.d.ts +10 -0
- package/pipes/index-length/index.d.ts +1 -0
- package/pipes/page/index.d.ts +1 -0
- package/pipes/page/page.pipe.d.ts +11 -0
- package/pipes/query/query.pipe.d.ts +5 -4
- package/pipes/secret/index.d.ts +1 -0
- package/pipes/secret/secret.pipe.d.ts +8 -0
- package/pipes/signal/signal.pipe.d.ts +1 -0
- package/pipes/smart-field/smart-field.pipe.d.ts +48 -15
- package/pipes/sort-by/index.d.ts +1 -0
- package/pipes/sort-by/sort-by.pipe.d.ts +17 -0
- package/services/auth/auth.service.d.ts +32 -25
- package/services/loading/loading.service.d.ts +20 -8
- package/services/navigation-history/index.d.ts +1 -0
- package/services/navigation-history/navigation-history.service.d.ts +14 -0
- package/services/query-resolver/query-resolver.service.d.ts +25 -8
- package/services/root-property/index.d.ts +1 -0
- package/services/root-property/root-property.service.d.ts +91 -0
- package/services/router/index.d.ts +1 -0
- package/services/router/router.service.d.ts +10 -0
- package/services/secret/index.d.ts +1 -0
- package/services/secret/secret.service.d.ts +6 -0
- package/services/side-app/index.d.ts +1 -0
- package/services/side-app/side-app.service.d.ts +9 -0
- package/services/side-nav-mode/index.d.ts +1 -0
- package/services/side-nav-mode/side-nav-mode.service.d.ts +11 -0
- package/services/snack-bar/snack-bar.service.d.ts +1 -1
- package/services/ui/index.d.ts +1 -0
- package/services/ui/ui.helpers.d.ts +28 -0
- package/services/ui/ui.service.d.ts +42 -47
- package/stores/entities/di.d.ts +15 -0
- package/stores/entities/entity-store-manager.d.ts +12 -0
- package/stores/entities/entity-store.d.ts +86 -0
- package/stores/entities/index.d.ts +5 -1
- package/stores/entities/proxy-id.service.d.ts +10 -0
- package/stores/entities/task-composer.d.ts +35 -0
- package/stores/query/query.store.d.ts +3 -3
- package/utils/form/form.d.ts +10 -0
- package/utils/form/index.d.ts +1 -0
- package/utils/get/get.d.ts +1 -0
- package/utils/index.d.ts +4 -1
- package/utils/inject/index.d.ts +1 -0
- package/utils/inject/inject.d.ts +50 -0
- package/utils/mat-dayjs-date/dayjs-date.module.d.ts +2 -5
- package/utils/page/page.d.ts +1 -1
- package/utils/router/index.d.ts +1 -0
- package/utils/router/router.d.ts +4 -0
- package/utils/time.d.ts +1 -0
- package/esm2022/pipes/smart-sort-by/index.mjs +0 -4
- package/esm2022/pipes/smart-sort-by/ng-atomic-common-pipes-smart-sort-by.mjs +0 -5
- package/esm2022/pipes/smart-sort-by/smart-sort-by.module.mjs +0 -24
- package/esm2022/pipes/smart-sort-by/smart-sort-by.pipe.mjs +0 -28
- package/esm2022/pipes/smart-sort-by/smart-sort-by.transformer.mjs +0 -5
- package/esm2022/stores/entities/entities.store.mjs +0 -32
- package/esm2022/utils/query/index.mjs +0 -2
- package/esm2022/utils/query/query.resolver.mjs +0 -100
- package/fesm2022/ng-atomic-common-pipes-smart-sort-by.mjs +0 -60
- package/fesm2022/ng-atomic-common-pipes-smart-sort-by.mjs.map +0 -1
- package/pipes/smart-sort-by/index.d.ts +0 -3
- package/pipes/smart-sort-by/smart-sort-by.module.d.ts +0 -8
- package/pipes/smart-sort-by/smart-sort-by.pipe.d.ts +0 -11
- package/pipes/smart-sort-by/smart-sort-by.transformer.d.ts +0 -2
- package/stores/entities/entities.store.d.ts +0 -19
- package/utils/query/index.d.ts +0 -1
- package/utils/query/query.resolver.d.ts +0 -2
|
@@ -1,35 +1,64 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, inject, Pipe, signal } from '@angular/core';
|
|
3
|
+
import { getLangMap, getProps, getModelName } from '@nx-ddd/common/domain/models';
|
|
4
|
+
import { wrapFactory } from '@ng-atomic/common/pipes/signal';
|
|
3
5
|
|
|
6
|
+
const DOMAIN_MODEL = new InjectionToken('Domain Model');
|
|
4
7
|
const DOMAIN_LANG_MAP = new InjectionToken('domain lang map');
|
|
8
|
+
const DOMAIN_PROPS = new InjectionToken('Domain Props');
|
|
9
|
+
const DOMAIN_MODEL_NAME = new InjectionToken('Domain Model Name');
|
|
5
10
|
class DomainPipe {
|
|
6
|
-
constructor(
|
|
7
|
-
this.map =
|
|
8
|
-
this.map ??= {};
|
|
11
|
+
constructor() {
|
|
12
|
+
this.map = inject(DOMAIN_LANG_MAP, { optional: true }) ?? {};
|
|
9
13
|
}
|
|
10
|
-
transform(input) {
|
|
11
|
-
return
|
|
14
|
+
transform(input, map = this.map) {
|
|
15
|
+
return map[input] ?? input;
|
|
12
16
|
}
|
|
13
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
14
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: DomainPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
18
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: DomainPipe, isStandalone: true, name: "domain" }); }
|
|
15
19
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: DomainPipe, decorators: [{
|
|
17
21
|
type: Pipe,
|
|
18
|
-
args: [{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
args: [{ standalone: true, name: 'domain', pure: true }]
|
|
23
|
+
}] });
|
|
24
|
+
function provideLangMap(useFactory) {
|
|
25
|
+
return { provide: DOMAIN_LANG_MAP, useFactory };
|
|
26
|
+
}
|
|
27
|
+
function provideDomainLang(domain, mergeObj = {}) {
|
|
28
|
+
return provideLangMap(() => getLangMap(domain, mergeObj));
|
|
29
|
+
}
|
|
30
|
+
function provideModel(useFactory) {
|
|
31
|
+
return { provide: DOMAIN_MODEL, useFactory };
|
|
32
|
+
}
|
|
33
|
+
function injectModel() {
|
|
34
|
+
return inject(DOMAIN_MODEL, { optional: true }) ?? null;
|
|
35
|
+
}
|
|
36
|
+
function provideProps(useFactory) {
|
|
37
|
+
return { provide: DOMAIN_PROPS, useFactory: wrapFactory(useFactory) };
|
|
38
|
+
}
|
|
39
|
+
function provideModelName(useFactory) {
|
|
40
|
+
return { provide: DOMAIN_MODEL_NAME, useFactory: wrapFactory(useFactory) };
|
|
41
|
+
}
|
|
42
|
+
function injectProps() {
|
|
43
|
+
return inject(DOMAIN_PROPS, { optional: true }) ?? signal([]);
|
|
44
|
+
}
|
|
45
|
+
function injectModelName(injector) {
|
|
46
|
+
if (injector)
|
|
47
|
+
return injector.get(DOMAIN_MODEL_NAME, null) ?? signal(null);
|
|
48
|
+
return inject(DOMAIN_MODEL_NAME, { optional: true }) ?? signal(null);
|
|
49
|
+
}
|
|
50
|
+
function provideDomain(useFactory) {
|
|
51
|
+
return [
|
|
52
|
+
provideModel(useFactory),
|
|
53
|
+
provideLangMap(() => getLangMap(useFactory())),
|
|
54
|
+
provideProps(() => getProps(useFactory())),
|
|
55
|
+
provideModelName(() => getModelName(useFactory()))
|
|
56
|
+
];
|
|
57
|
+
}
|
|
29
58
|
|
|
30
59
|
/**
|
|
31
60
|
* Generated bundle index. Do not edit.
|
|
32
61
|
*/
|
|
33
62
|
|
|
34
|
-
export { DOMAIN_LANG_MAP, DomainPipe };
|
|
63
|
+
export { DOMAIN_LANG_MAP, DOMAIN_MODEL, DOMAIN_MODEL_NAME, DOMAIN_PROPS, DomainPipe, injectModel, injectModelName, injectProps, provideDomain, provideDomainLang, provideLangMap, provideModel, provideModelName, provideProps };
|
|
35
64
|
//# sourceMappingURL=ng-atomic-common-pipes-domain.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-domain.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/domain/domain.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/domain/ng-atomic-common-pipes-domain.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-domain.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/domain/domain.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/domain/ng-atomic-common-pipes-domain.ts"],"sourcesContent":["import { InjectionToken, Injector, Pipe, Signal, inject, signal } from '@angular/core';\nimport { Entity, Type, getLangMap, getModelName, getProps } from '@nx-ddd/common/domain/models';\nimport { SignalOrValue, wrapFactory } from '@ng-atomic/common/pipes/signal';\n\nexport type DomainLangMap = Record<string, string>;\nexport const DOMAIN_MODEL = new InjectionToken<Type<{id: string}>>('Domain Model');\nexport const DOMAIN_LANG_MAP = new InjectionToken<DomainLangMap>('domain lang map');\nexport const DOMAIN_PROPS = new InjectionToken<Signal<string[]>>('Domain Props');\nexport const DOMAIN_MODEL_NAME = new InjectionToken<Signal<string>>('Domain Model Name');\n\n@Pipe({standalone: true, name: 'domain', pure: true})\nexport class DomainPipe {\n protected map = inject(DOMAIN_LANG_MAP, {optional: true}) ?? {};\n\n transform(input: string, map: DomainLangMap = this.map) {\n return map[input] ?? input;\n }\n}\n\nexport function provideLangMap(useFactory: () => DomainLangMap) {\n return { provide: DOMAIN_LANG_MAP, useFactory };\n}\n\nexport function provideDomainLang<E>(domain: Type<E>, mergeObj: DomainLangMap = {}) {\n return provideLangMap(() => getLangMap(domain, mergeObj));\n}\n\nexport function provideModel<E>(useFactory: () => Type<E>) {\n return { provide: DOMAIN_MODEL, useFactory};\n}\n\nexport function injectModel<E = Entity>(): Type<E> {\n return inject(DOMAIN_MODEL, {optional: true}) as Type<E> ?? null;\n}\n\nexport function provideProps(useFactory: () => SignalOrValue<string[]>) {\n return { provide: DOMAIN_PROPS, useFactory: wrapFactory(useFactory)}\n}\n\nexport function provideModelName(useFactory: () => SignalOrValue<string>) {\n return { provide: DOMAIN_MODEL_NAME, useFactory: wrapFactory(useFactory)}\n}\n\nexport function injectProps(): Signal<string[]> {\n return inject(DOMAIN_PROPS, {optional: true}) ?? signal([]);\n}\n\nexport function injectModelName(injector?: Injector): Signal<string> {\n if (injector) return injector.get(DOMAIN_MODEL_NAME, null) ?? signal(null);\n return inject(DOMAIN_MODEL_NAME, {optional: true}) ?? signal(null);\n}\n\nexport function provideDomain<E>(useFactory: () => Type<E>) {\n return [\n provideModel(useFactory),\n provideLangMap(() => getLangMap(useFactory())),\n provideProps(() => getProps(useFactory())),\n provideModelName(() => getModelName(useFactory()))\n ]\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAKa,YAAY,GAAG,IAAI,cAAc,CAAqB,cAAc,EAAE;MACtE,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,EAAE;MACvE,YAAY,GAAG,IAAI,cAAc,CAAmB,cAAc,EAAE;MACpE,iBAAiB,GAAG,IAAI,cAAc,CAAiB,mBAAmB,EAAE;MAG5E,UAAU,CAAA;AADvB,IAAA,WAAA,GAAA;AAEY,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,EAAE,CAAC;AAKjE,KAAA;AAHC,IAAA,SAAS,CAAC,KAAa,EAAE,GAAqB,GAAA,IAAI,CAAC,GAAG,EAAA;AACpD,QAAA,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;KAC5B;8GALU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,CAAA,EAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,IAAI;mBAAC,EAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;;AAS9C,SAAU,cAAc,CAAC,UAA+B,EAAA;AAC5D,IAAA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC;SAEe,iBAAiB,CAAI,MAAe,EAAE,WAA0B,EAAE,EAAA;AAChF,IAAA,OAAO,cAAc,CAAC,MAAM,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC;AAEK,SAAU,YAAY,CAAI,UAAyB,EAAA;AACvD,IAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAC,CAAC;AAC9C,CAAC;SAEe,WAAW,GAAA;AACzB,IAAA,OAAO,MAAM,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAY,IAAI,IAAI,CAAC;AACnE,CAAC;AAEK,SAAU,YAAY,CAAC,UAAyC,EAAA;AACpE,IAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,EAAC,CAAA;AACtE,CAAC;AAEK,SAAU,gBAAgB,CAAC,UAAuC,EAAA;AACtE,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,EAAC,CAAA;AAC3E,CAAC;SAEe,WAAW,GAAA;AACzB,IAAA,OAAO,MAAM,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAEK,SAAU,eAAe,CAAC,QAAmB,EAAA;AACjD,IAAA,IAAI,QAAQ;AAAE,QAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3E,IAAA,OAAO,MAAM,CAAC,iBAAiB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAEK,SAAU,aAAa,CAAI,UAAyB,EAAA;IACxD,OAAO;QACL,YAAY,CAAC,UAAU,CAAC;QACxB,cAAc,CAAC,MAAM,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;QAC9C,YAAY,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QAC1C,gBAAgB,CAAC,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC,CAAC;KACnD,CAAA;AACH;;AC3DA;;AAEG;;;;"}
|
|
@@ -31,10 +31,10 @@ class ErrorPipe {
|
|
|
31
31
|
transform(errors) {
|
|
32
32
|
return this.resolver(errors);
|
|
33
33
|
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
35
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: ErrorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
35
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: ErrorPipe, isStandalone: true, name: "error" }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: ErrorPipe, decorators: [{
|
|
38
38
|
type: Pipe,
|
|
39
39
|
args: [{
|
|
40
40
|
standalone: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-error.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/error/error.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/error/ng-atomic-common-pipes-error.ts"],"sourcesContent":["import { InjectionToken, Pipe, inject } from \"@angular/core\";\nimport { ValidationErrors } from \"@angular/forms\";\n\nexport type ErrorMessageResolver = (errors: ValidationErrors) => string;\nexport const ERROR_MESSAGE_RESOLVER = new InjectionToken<ErrorMessageResolver>('[@ng-atomic/common] Error message resolver');\n\nexport const defaultErrorMessageResolver: ErrorMessageResolver = (errors: ValidationErrors): string => {\n if (!errors) return '';\n const value = Object.entries(errors)[0][0];\n switch (value) {\n case 'required':\n return '必須項目です';\n case 'minlength':\n return `最低${errors[value].requiredLength}文字以上で入力してください`;\n case 'maxlength':\n return `最大${errors[value].requiredLength}文字以下で入力してください`;\n case 'email':\n return 'メールアドレスの形式で入力してください';\n case 'pattern':\n return '半角英数字で入力してください';\n default:\n return '値を確認してください';\n }\n};\n\nexport function provideErrorMessageResolver(resolver: ErrorMessageResolver) {\n return {provide: ERROR_MESSAGE_RESOLVER, useValue: resolver};\n}\n\n@Pipe({\n standalone: true,\n name: 'error',\n pure: true,\n})\nexport class ErrorPipe {\n protected resolver = inject(ERROR_MESSAGE_RESOLVER, {optional: true}) ?? defaultErrorMessageResolver;\n\n transform(errors: ValidationErrors): string {\n return this.resolver(errors);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAIa,sBAAsB,GAAG,IAAI,cAAc,CAAuB,4CAA4C,EAAE;AAEhH,MAAA,2BAA2B,GAAyB,CAAC,MAAwB,KAAY;AACpG,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE,CAAC;AACvB,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,IAAA,QAAQ,KAAK;AACX,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,QAAQ,CAAC;AAClB,QAAA,KAAK,WAAW;YACd,OAAO,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,eAAe,CAAC;AAC1D,QAAA,KAAK,WAAW;YACd,OAAO,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,eAAe,CAAC;AAC1D,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,qBAAqB,CAAC;AAC/B,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,gBAAgB,CAAC;AAC1B,QAAA;AACE,YAAA,OAAO,YAAY,CAAC;AACvB,KAAA;AACH,EAAE;AAEI,SAAU,2BAA2B,CAAC,QAA8B,EAAA;IACxE,OAAO,EAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;AAC/D,CAAC;MAOY,SAAS,CAAA;AALtB,IAAA,WAAA,GAAA;AAMY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,sBAAsB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,2BAA2B,CAAC;AAKtG,KAAA;AAHC,IAAA,SAAS,CAAC,MAAwB,EAAA;AAChC,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC9B
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-error.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/error/error.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/error/ng-atomic-common-pipes-error.ts"],"sourcesContent":["import { InjectionToken, Pipe, inject } from \"@angular/core\";\nimport { ValidationErrors } from \"@angular/forms\";\n\nexport type ErrorMessageResolver = (errors: ValidationErrors) => string;\nexport const ERROR_MESSAGE_RESOLVER = new InjectionToken<ErrorMessageResolver>('[@ng-atomic/common] Error message resolver');\n\nexport const defaultErrorMessageResolver: ErrorMessageResolver = (errors: ValidationErrors): string => {\n if (!errors) return '';\n const value = Object.entries(errors)[0][0];\n switch (value) {\n case 'required':\n return '必須項目です';\n case 'minlength':\n return `最低${errors[value].requiredLength}文字以上で入力してください`;\n case 'maxlength':\n return `最大${errors[value].requiredLength}文字以下で入力してください`;\n case 'email':\n return 'メールアドレスの形式で入力してください';\n case 'pattern':\n return '半角英数字で入力してください';\n default:\n return '値を確認してください';\n }\n};\n\nexport function provideErrorMessageResolver(resolver: ErrorMessageResolver) {\n return {provide: ERROR_MESSAGE_RESOLVER, useValue: resolver};\n}\n\n@Pipe({\n standalone: true,\n name: 'error',\n pure: true,\n})\nexport class ErrorPipe {\n protected resolver = inject(ERROR_MESSAGE_RESOLVER, {optional: true}) ?? defaultErrorMessageResolver;\n\n transform(errors: ValidationErrors): string {\n return this.resolver(errors);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAIa,sBAAsB,GAAG,IAAI,cAAc,CAAuB,4CAA4C,EAAE;AAEhH,MAAA,2BAA2B,GAAyB,CAAC,MAAwB,KAAY;AACpG,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,EAAE,CAAC;AACvB,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,IAAA,QAAQ,KAAK;AACX,QAAA,KAAK,UAAU;AACb,YAAA,OAAO,QAAQ,CAAC;AAClB,QAAA,KAAK,WAAW;YACd,OAAO,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,eAAe,CAAC;AAC1D,QAAA,KAAK,WAAW;YACd,OAAO,CAAA,EAAA,EAAK,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,eAAe,CAAC;AAC1D,QAAA,KAAK,OAAO;AACV,YAAA,OAAO,qBAAqB,CAAC;AAC/B,QAAA,KAAK,SAAS;AACZ,YAAA,OAAO,gBAAgB,CAAC;AAC1B,QAAA;AACE,YAAA,OAAO,YAAY,CAAC;AACvB,KAAA;AACH,EAAE;AAEI,SAAU,2BAA2B,CAAC,QAA8B,EAAA;IACxE,OAAO,EAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC;AAC/D,CAAC;MAOY,SAAS,CAAA;AALtB,IAAA,WAAA,GAAA;AAMY,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,sBAAsB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,IAAI,2BAA2B,CAAC;AAKtG,KAAA;AAHC,IAAA,SAAS,CAAC,MAAwB,EAAA;AAChC,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC9B;8GALU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,CAAA,EAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBALrB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,OAAO;AACb,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA,CAAA;;;ACjCD;;AAEG;;;;"}
|
|
@@ -7,6 +7,8 @@ class GroupedByPipe {
|
|
|
7
7
|
this.dataAccessor = inject(DATA_ACCESSOR) ?? defaultDataAccessor;
|
|
8
8
|
}
|
|
9
9
|
transform(items, groupedBy) {
|
|
10
|
+
if (!groupedBy)
|
|
11
|
+
return {};
|
|
10
12
|
return (items ?? []).reduce((acc, item) => {
|
|
11
13
|
const key = this.dataAccessor(item, groupedBy);
|
|
12
14
|
acc[key] ??= [],
|
|
@@ -14,10 +16,10 @@ class GroupedByPipe {
|
|
|
14
16
|
return acc;
|
|
15
17
|
}, {});
|
|
16
18
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: GroupedByPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: GroupedByPipe, isStandalone: true, name: "groupedBy" }); }
|
|
19
21
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: GroupedByPipe, decorators: [{
|
|
21
23
|
type: Pipe,
|
|
22
24
|
args: [{
|
|
23
25
|
name: 'groupedBy',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-grouped-by.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/grouped-by/grouped-by.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/grouped-by/ng-atomic-common-pipes-grouped-by.ts"],"sourcesContent":["import { Pipe, inject } from \"@angular/core\";\nimport { DATA_ACCESSOR, defaultDataAccessor } from \"@ng-atomic/common/pipes/data-accessor\";\n\n@Pipe({\n name: 'groupedBy',\n standalone: true,\n pure: true,\n})\nexport class GroupedByPipe {\n private dataAccessor = inject(DATA_ACCESSOR) ?? defaultDataAccessor;\n\n transform<T>(items: T[], groupedBy
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-grouped-by.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/grouped-by/grouped-by.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/grouped-by/ng-atomic-common-pipes-grouped-by.ts"],"sourcesContent":["import { Pipe, inject } from \"@angular/core\";\nimport { DATA_ACCESSOR, defaultDataAccessor } from \"@ng-atomic/common/pipes/data-accessor\";\n\n@Pipe({\n name: 'groupedBy',\n standalone: true,\n pure: true,\n})\nexport class GroupedByPipe {\n private dataAccessor = inject(DATA_ACCESSOR) ?? defaultDataAccessor;\n\n transform<T>(items: T[], groupedBy?: string): { [id: string]: T[] } {\n if (!groupedBy) return {};\n\n return (items ?? []).reduce((acc, item) => {\n const key = this.dataAccessor(item, groupedBy);\n acc[key] ??= [],\n acc[key].push(item);\n return acc;\n }, {} as { [id: string]: T[] });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,aAAa,CAAA;AAL1B,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,mBAAmB,CAAC;AAYrE,KAAA;IAVC,SAAS,CAAI,KAAU,EAAE,SAAkB,EAAA;AACzC,QAAA,IAAI,CAAC,SAAS;AAAE,YAAA,OAAO,EAAE,CAAC;AAE1B,QAAA,OAAO,CAAC,KAAK,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAI;YACxC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC/C,YAAA,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE;gBACf,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpB,YAAA,OAAO,GAAG,CAAC;SACZ,EAAE,EAA2B,CAAC,CAAC;KACjC;8GAZU,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,CAAA,EAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBALzB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,WAAW;AACjB,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe } from '@angular/core';
|
|
3
|
+
import { injectQueryTransformer } from '@ng-atomic/common/pipes/query';
|
|
4
|
+
import { injectSortByTransformer } from '@ng-atomic/common/pipes/sort-by';
|
|
5
|
+
|
|
6
|
+
class IndexLengthPipe {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.query = injectQueryTransformer();
|
|
9
|
+
this.sortBy = injectSortByTransformer();
|
|
10
|
+
}
|
|
11
|
+
transform(items, prams) {
|
|
12
|
+
items = this.query(items, prams?.query ?? '');
|
|
13
|
+
items = this.sortBy(items, prams?.sort);
|
|
14
|
+
return items.length;
|
|
15
|
+
}
|
|
16
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: IndexLengthPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
17
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: IndexLengthPipe, isStandalone: true, name: "indexLength" }); }
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: IndexLengthPipe, decorators: [{
|
|
20
|
+
type: Pipe,
|
|
21
|
+
args: [{ name: 'indexLength', standalone: true, pure: true }]
|
|
22
|
+
}] });
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Generated bundle index. Do not edit.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
export { IndexLengthPipe };
|
|
29
|
+
//# sourceMappingURL=ng-atomic-common-pipes-index-length.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-index-length.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/index-length/index-length.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/index-length/ng-atomic-common-pipes-index-length.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { Index } from '@ng-atomic/common/models';\nimport { injectQueryTransformer } from '@ng-atomic/common/pipes/query';\nimport { injectSortByTransformer } from '@ng-atomic/common/pipes/sort-by';\n\n@Pipe({name: 'indexLength', standalone: true, pure: true})\nexport class IndexLengthPipe<T> implements PipeTransform {\n protected query = injectQueryTransformer<T>();\n protected sortBy = injectSortByTransformer<T>();\n\n transform(items: T[], prams: Partial<Index>): number {\n items = this.query(items, prams?.query ?? '');\n items = this.sortBy(items, prams?.sort);\n return items.length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAMa,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;QAEY,IAAK,CAAA,KAAA,GAAG,sBAAsB,EAAK,CAAC;QACpC,IAAM,CAAA,MAAA,GAAG,uBAAuB,EAAK,CAAC;AAOjD,KAAA;IALC,SAAS,CAAC,KAAU,EAAE,KAAqB,EAAA;AACzC,QAAA,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC9C,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACxC,OAAO,KAAK,CAAC,MAAM,CAAC;KACrB;8GARU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA,EAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;;;ACLzD;;AAEG;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe } from '@angular/core';
|
|
3
|
+
import { injectSortByTransformer } from '@ng-atomic/common/pipes/sort-by';
|
|
4
|
+
import { injectQueryTransformer } from '@ng-atomic/common/pipes/query';
|
|
5
|
+
import { injectPageTransformer } from '@ng-atomic/common/pipes/page';
|
|
6
|
+
|
|
7
|
+
class IndexPipe {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.query = injectQueryTransformer();
|
|
10
|
+
this.sortBy = injectSortByTransformer();
|
|
11
|
+
this.page = injectPageTransformer();
|
|
12
|
+
}
|
|
13
|
+
transform(items, params) {
|
|
14
|
+
items = this.query(items, params?.query ?? '');
|
|
15
|
+
items = this.sortBy(items, params?.sort);
|
|
16
|
+
items = this.page(items, params?.page);
|
|
17
|
+
return items;
|
|
18
|
+
}
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: IndexPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: IndexPipe, isStandalone: true, name: "index" }); }
|
|
21
|
+
}
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: IndexPipe, decorators: [{
|
|
23
|
+
type: Pipe,
|
|
24
|
+
args: [{
|
|
25
|
+
name: 'index',
|
|
26
|
+
standalone: true,
|
|
27
|
+
pure: true,
|
|
28
|
+
}]
|
|
29
|
+
}] });
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Generated bundle index. Do not edit.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
export { IndexPipe };
|
|
36
|
+
//# sourceMappingURL=ng-atomic-common-pipes-index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-index.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/index/index.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/index/ng-atomic-common-pipes-index.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { Index } from '@ng-atomic/common/models';\nimport { injectSortByTransformer } from '@ng-atomic/common/pipes/sort-by';\nimport { injectQueryTransformer } from '@ng-atomic/common/pipes/query';\nimport { injectPageTransformer } from '@ng-atomic/common/pipes/page';\n\n@Pipe({\n name: 'index',\n standalone: true,\n pure: true,\n})\nexport class IndexPipe<T> implements PipeTransform {\n protected query = injectQueryTransformer<T>();\n protected sortBy = injectSortByTransformer<T>();\n protected page = injectPageTransformer<T>();\n\n transform(items: T[], params: Partial<Index>): T[] {\n items = this.query(items, params?.query ?? '');\n items = this.sortBy(items, params?.sort);\n items = this.page(items, params?.page);\n return items;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAWa,SAAS,CAAA;AALtB,IAAA,WAAA,GAAA;QAMY,IAAK,CAAA,KAAA,GAAG,sBAAsB,EAAK,CAAC;QACpC,IAAM,CAAA,MAAA,GAAG,uBAAuB,EAAK,CAAC;QACtC,IAAI,CAAA,IAAA,GAAG,qBAAqB,EAAK,CAAC;AAQ7C,KAAA;IANC,SAAS,CAAC,KAAU,EAAE,MAAsB,EAAA;AAC1C,QAAA,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC/C,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACvC,QAAA,OAAO,KAAK,CAAC;KACd;8GAVU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,CAAA,EAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBALrB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,OAAO;AACb,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -5,10 +5,10 @@ class KeysPipe {
|
|
|
5
5
|
transform(obj) {
|
|
6
6
|
return Object.keys(obj);
|
|
7
7
|
}
|
|
8
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
9
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
8
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: KeysPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
9
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: KeysPipe, isStandalone: true, name: "keys" }); }
|
|
10
10
|
}
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: KeysPipe, decorators: [{
|
|
12
12
|
type: Pipe,
|
|
13
13
|
args: [{
|
|
14
14
|
name: 'keys',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-keys.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/keys/keys.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/keys/ng-atomic-common-pipes-keys.ts"],"sourcesContent":["import { Pipe } from \"@angular/core\";\n\n@Pipe({\n name: 'keys',\n standalone: true,\n pure: true,\n})\nexport class KeysPipe {\n transform(obj: { [id: string]: any }) {\n return Object.keys(obj);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAOa,QAAQ,CAAA;AACnB,IAAA,SAAS,CAAC,GAA0B,EAAA;AAClC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-keys.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/keys/keys.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/keys/ng-atomic-common-pipes-keys.ts"],"sourcesContent":["import { Pipe } from \"@angular/core\";\n\n@Pipe({\n name: 'keys',\n standalone: true,\n pure: true,\n})\nexport class KeysPipe {\n transform(obj: { [id: string]: any }) {\n return Object.keys(obj);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAOa,QAAQ,CAAA;AACnB,IAAA,SAAS,CAAC,GAA0B,EAAA;AAClC,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzB;8GAHU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBALpB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,MAAM;AACZ,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Pipe } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
function defaultPageTransformer(items, { pageIndex = 0, pageSize = 100 } = {}) {
|
|
5
|
+
const start = pageIndex * pageSize;
|
|
6
|
+
const end = start + pageSize;
|
|
7
|
+
return items.slice(start, end);
|
|
8
|
+
}
|
|
9
|
+
function injectPageTransformer() {
|
|
10
|
+
return defaultPageTransformer;
|
|
11
|
+
}
|
|
12
|
+
class PagePipe {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.transformer = injectPageTransformer();
|
|
15
|
+
}
|
|
16
|
+
transform(items, params = {}) {
|
|
17
|
+
return this.transformer(items, params);
|
|
18
|
+
}
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: PagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: PagePipe, isStandalone: true, name: "page" }); }
|
|
21
|
+
}
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: PagePipe, decorators: [{
|
|
23
|
+
type: Pipe,
|
|
24
|
+
args: [{ name: 'page', standalone: true, pure: true }]
|
|
25
|
+
}] });
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Generated bundle index. Do not edit.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export { PagePipe, defaultPageTransformer, injectPageTransformer };
|
|
32
|
+
//# sourceMappingURL=ng-atomic-common-pipes-page.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-page.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/page/page.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/page/ng-atomic-common-pipes-page.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { Page } from '@ng-atomic/common/models';\n\nexport function defaultPageTransformer<T>(items: T[], {pageIndex = 0, pageSize = 100}: Partial<Page> = {}): T[] {\n const start = pageIndex * pageSize;\n const end = start + pageSize;\n return items.slice(start, end);\n}\n\nexport function injectPageTransformer<T>() {\n return defaultPageTransformer;\n}\n\n@Pipe({name: 'page', standalone: true, pure: true})\nexport class PagePipe<T> implements PipeTransform {\n protected transformer = injectPageTransformer<T>();\n\n transform(items: T[], params: Partial<Page> = {}): T[] {\n return this.transformer(items, params);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGgB,SAAA,sBAAsB,CAAI,KAAU,EAAE,EAAC,SAAS,GAAG,CAAC,EAAE,QAAQ,GAAG,GAAG,KAAmB,EAAE,EAAA;AACvG,IAAA,MAAM,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AACnC,IAAA,MAAM,GAAG,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC;SAEe,qBAAqB,GAAA;AACnC,IAAA,OAAO,sBAAsB,CAAC;AAChC,CAAC;MAGY,QAAQ,CAAA;AADrB,IAAA,WAAA,GAAA;QAEY,IAAW,CAAA,WAAA,GAAG,qBAAqB,EAAK,CAAC;AAKpD,KAAA;AAHC,IAAA,SAAS,CAAC,KAAU,EAAE,MAAA,GAAwB,EAAE,EAAA;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KACxC;8GALU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAR,QAAQ,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBADpB,IAAI;mBAAC,EAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;;;ACblD;;AAEG;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, Injectable, Pipe, Optional, Inject } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { sortByTransformer } from '@ng-atomic/common/pipes/sort-by';
|
|
4
4
|
|
|
5
5
|
const PAGINATION_TRANSFORMER = new InjectionToken('[@ng-atomic/pipes] Pagination Transformer');
|
|
6
6
|
function paginationTransformer(items, page) {
|
|
7
|
-
return
|
|
7
|
+
return sortByTransformer(items, page).slice(page.start, page.end);
|
|
8
8
|
}
|
|
9
9
|
class PaginationPipe {
|
|
10
10
|
constructor(transformer) {
|
|
@@ -14,22 +14,22 @@ class PaginationPipe {
|
|
|
14
14
|
transform(items, { sortKey = null, sortOrder = 'asc', start = 0, end = 0 } = {}) {
|
|
15
15
|
return this.transformer(items, { key: sortKey, order: sortOrder, start, end });
|
|
16
16
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
19
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
17
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: PaginationPipe, deps: [{ token: PAGINATION_TRANSFORMER, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
18
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: PaginationPipe, isStandalone: true, name: "pagination" }); }
|
|
19
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: PaginationPipe, providedIn: 'root' }); }
|
|
20
20
|
}
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: PaginationPipe, decorators: [{
|
|
22
22
|
type: Injectable,
|
|
23
23
|
args: [{ providedIn: 'root' }]
|
|
24
24
|
}, {
|
|
25
25
|
type: Pipe,
|
|
26
26
|
args: [{ standalone: true, name: 'pagination', pure: true }]
|
|
27
|
-
}], ctorParameters:
|
|
27
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
28
28
|
type: Optional
|
|
29
29
|
}, {
|
|
30
30
|
type: Inject,
|
|
31
31
|
args: [PAGINATION_TRANSFORMER]
|
|
32
|
-
}] }]
|
|
32
|
+
}] }] });
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-pagination.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/pagination/pagination.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/pagination/ng-atomic-common-pipes-pagination.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, Optional, Pipe, PipeTransform } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-pagination.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/pagination/pagination.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/pagination/ng-atomic-common-pipes-pagination.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, Optional, Pipe, PipeTransform } from '@angular/core';\nimport { sortByTransformer } from '@ng-atomic/common/pipes/sort-by';\n\ninterface Page {\n start: number;\n end: number;\n key: string;\n order: 'asc' | 'desc';\n}\n\nexport const PAGINATION_TRANSFORMER = new InjectionToken('[@ng-atomic/pipes] Pagination Transformer');\nexport type PaginationTransformer<E> = (items: E[], page: Page) => E[];\nexport function paginationTransformer<E>(items: E[], page: Page): E[] {\n return sortByTransformer(items, page).slice(page.start, page.end) as E[];\n}\n\n@Injectable({ providedIn: 'root' })\n@Pipe({standalone: true, name: 'pagination', pure: true})\nexport class PaginationPipe<E> implements PipeTransform {\n\n constructor(\n @Optional()\n @Inject(PAGINATION_TRANSFORMER)\n private transformer: PaginationTransformer<E>,\n ) {\n this.transformer ??= paginationTransformer;\n }\n\n transform(items: E[], {\n sortKey = null, \n sortOrder = 'asc',\n start = 0,\n end = 0\n }: {sortKey?: string, sortOrder?: 'asc' | 'desc', start?: number, end?: number} = {}) {\n return this.transformer(items, { key: sortKey, order: sortOrder, start, end });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAUa,sBAAsB,GAAG,IAAI,cAAc,CAAC,2CAA2C,EAAE;AAEtF,SAAA,qBAAqB,CAAI,KAAU,EAAE,IAAU,EAAA;AAC7D,IAAA,OAAO,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAQ,CAAC;AAC3E,CAAC;MAIY,cAAc,CAAA;AAEzB,IAAA,WAAA,CAGU,WAAqC,EAAA;QAArC,IAAW,CAAA,WAAA,GAAX,WAAW,CAA0B;AAE7C,QAAA,IAAI,CAAC,WAAW,KAAK,qBAAqB,CAAC;KAC5C;IAED,SAAS,CAAC,KAAU,EAAE,EACpB,OAAO,GAAG,IAAI,EACd,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,CAAC,EACT,GAAG,GAAG,CAAC,KACyE,EAAE,EAAA;QAClF,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;KAChF;AAjBU,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,kBAIf,sBAAsB,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAJrB,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,CAAA,EAAA;AAAd,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFD,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAF1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;kBACjC,IAAI;mBAAC,EAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;;0BAInD,QAAQ;;0BACR,MAAM;2BAAC,sBAAsB,CAAA;;;ACtBlC;;AAEG;;;;"}
|
|
@@ -2,18 +2,25 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, Injectable, Pipe } from '@angular/core';
|
|
3
3
|
import { QueryResolverService } from '@ng-atomic/common/services/query-resolver';
|
|
4
4
|
|
|
5
|
+
function defaultQueryTransformer(items, query) {
|
|
6
|
+
return items.filter((item) => JSON.stringify(item).toLowerCase().includes(query.toLowerCase()));
|
|
7
|
+
}
|
|
8
|
+
function injectQueryTransformer() {
|
|
9
|
+
const resolver = inject(QueryResolverService);
|
|
10
|
+
return (items, query) => resolver.resolve(items, query);
|
|
11
|
+
}
|
|
5
12
|
class QueryPipe {
|
|
6
13
|
constructor() {
|
|
7
|
-
this.
|
|
14
|
+
this.transformer = injectQueryTransformer();
|
|
8
15
|
}
|
|
9
16
|
transform(items, query) {
|
|
10
|
-
return this.
|
|
17
|
+
return this.transformer(items, query);
|
|
11
18
|
}
|
|
12
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
13
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
14
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: QueryPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: QueryPipe, isStandalone: true, name: "query" }); }
|
|
21
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: QueryPipe, providedIn: 'any' }); }
|
|
15
22
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: QueryPipe, decorators: [{
|
|
17
24
|
type: Injectable,
|
|
18
25
|
args: [{ providedIn: 'any' }]
|
|
19
26
|
}, {
|
|
@@ -29,5 +36,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
29
36
|
* Generated bundle index. Do not edit.
|
|
30
37
|
*/
|
|
31
38
|
|
|
32
|
-
export { QueryPipe };
|
|
39
|
+
export { QueryPipe, defaultQueryTransformer, injectQueryTransformer };
|
|
33
40
|
//# sourceMappingURL=ng-atomic-common-pipes-query.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-query.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/query/query.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/query/ng-atomic-common-pipes-query.ts"],"sourcesContent":["import { Injectable, Pipe, PipeTransform, inject } from '@angular/core';\nimport { QueryResolverService } from '@ng-atomic/common/services/query-resolver';\n\n@Injectable({ providedIn: 'any' })\n@Pipe({\n name: 'query',\n standalone: true,\n pure: true,\n})\nexport class QueryPipe<
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-query.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/query/query.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/query/ng-atomic-common-pipes-query.ts"],"sourcesContent":["import { Injectable, Pipe, PipeTransform, inject } from '@angular/core';\nimport { QueryResolverService } from '@ng-atomic/common/services/query-resolver';\n\nexport function defaultQueryTransformer<T>(items: T[], query: string): T[] {\n return items.filter((item) => JSON.stringify(item).toLowerCase().includes(query.toLowerCase()));\n}\n\nexport function injectQueryTransformer<T>() {\n const resolver = inject(QueryResolverService);\n return (items: T[], query: string) => resolver.resolve(items, query);\n}\n\n@Injectable({ providedIn: 'any' })\n@Pipe({\n name: 'query',\n standalone: true,\n pure: true,\n})\nexport class QueryPipe<T> implements PipeTransform {\n\n protected transformer = injectQueryTransformer<T>();\n\n transform(items: T[], query: string): T[] {\n return this.transformer(items, query);\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGgB,SAAA,uBAAuB,CAAI,KAAU,EAAE,KAAa,EAAA;IAClE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AAClG,CAAC;SAEe,sBAAsB,GAAA;AACpC,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAC9C,IAAA,OAAO,CAAC,KAAU,EAAE,KAAa,KAAK,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACvE,CAAC;MAQY,SAAS,CAAA;AANtB,IAAA,WAAA,GAAA;QAQY,IAAW,CAAA,WAAA,GAAG,sBAAsB,EAAK,CAAC;AAMrD,KAAA;IAJC,SAAS,CAAC,KAAU,EAAE,KAAa,EAAA;QACjC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KACvC;8GANU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,CAAA,EAAA;AAAT,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,cANI,KAAK,EAAA,CAAA,CAAA,EAAA;;2FAMlB,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,UAAU;mBAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;;kBAChC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,OAAO;AACb,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE,IAAI;AACX,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, Pipe } from '@angular/core';
|
|
3
|
+
import { SecretService } from '@ng-atomic/common/services/secret';
|
|
4
|
+
|
|
5
|
+
class SecretPipe {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.secret = inject(SecretService);
|
|
8
|
+
}
|
|
9
|
+
transform(value) {
|
|
10
|
+
return this.secret.isSecret() ? value.replace(/./g, '*') : value;
|
|
11
|
+
}
|
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SecretPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
13
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: SecretPipe, isStandalone: true, name: "secret" }); }
|
|
14
|
+
}
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SecretPipe, decorators: [{
|
|
16
|
+
type: Pipe,
|
|
17
|
+
args: [{
|
|
18
|
+
name: 'secret',
|
|
19
|
+
standalone: true
|
|
20
|
+
}]
|
|
21
|
+
}] });
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generated bundle index. Do not edit.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export { SecretPipe };
|
|
28
|
+
//# sourceMappingURL=ng-atomic-common-pipes-secret.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-secret.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/secret/secret.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/secret/ng-atomic-common-pipes-secret.ts"],"sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { SecretService } from '@ng-atomic/common/services/secret';\n\n@Pipe({\n name: 'secret',\n standalone: true\n})\nexport class SecretPipe implements PipeTransform {\n private secret = inject(SecretService);\n\n transform(value: string) {\n return this.secret.isSecret() ? value.replace(/./g, '*') : value;\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,UAAU,CAAA;AAJvB,IAAA,WAAA,GAAA;AAKU,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAMxC,KAAA;AAJC,IAAA,SAAS,CAAC,KAAa,EAAA;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC;KAClE;8GALU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,CAAA,EAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBAJtB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,QAAQ;AACd,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -11,22 +11,22 @@ class SelectIdPipe {
|
|
|
11
11
|
transform(entity) {
|
|
12
12
|
return this.selectId(entity);
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
15
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SelectIdPipe, deps: [{ token: SELECT_ID, optional: true }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
15
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: SelectIdPipe, isStandalone: true, name: "selectId" }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SelectIdPipe, decorators: [{
|
|
18
18
|
type: Pipe,
|
|
19
19
|
args: [{
|
|
20
20
|
name: 'selectId',
|
|
21
21
|
pure: true,
|
|
22
22
|
standalone: true,
|
|
23
23
|
}]
|
|
24
|
-
}], ctorParameters:
|
|
24
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
25
25
|
type: Optional
|
|
26
26
|
}, {
|
|
27
27
|
type: Inject,
|
|
28
28
|
args: [SELECT_ID]
|
|
29
|
-
}] }]
|
|
29
|
+
}] }] });
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-select-id.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/select-id/select-id.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/select-id/ng-atomic-common-pipes-select-id.ts"],"sourcesContent":["import { Inject, InjectionToken, Optional, Pipe } from \"@angular/core\";\n\nexport type SelectId = (entity: object) => string | number;\nexport const SELECT_ID = new InjectionToken<SelectId>('[@ng-atomic/common] Select Id');\nexport const defaultSelectId: SelectId = (entity: any) => entity.id;\n\n@Pipe({\n name: 'selectId',\n pure: true,\n standalone: true,\n})\nexport class SelectIdPipe {\n constructor(\n @Optional() @Inject(SELECT_ID) protected selectId: SelectId\n ) {\n this.selectId ??= defaultSelectId;\n }\n\n transform(entity: any): string | number {\n return this.selectId(entity);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAGa,SAAS,GAAG,IAAI,cAAc,CAAW,+BAA+B,EAAE;AAChF,MAAM,eAAe,GAAa,CAAC,MAAW,KAAK,MAAM,CAAC,GAAG;MAOvD,YAAY,CAAA;AACvB,IAAA,WAAA,CAC2C,QAAkB,EAAA;QAAlB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AAE3D,QAAA,IAAI,CAAC,QAAQ,KAAK,eAAe,CAAC;KACnC;AAED,IAAA,SAAS,CAAC,MAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC9B;AATU,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-select-id.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/select-id/select-id.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/select-id/ng-atomic-common-pipes-select-id.ts"],"sourcesContent":["import { Inject, InjectionToken, Optional, Pipe } from \"@angular/core\";\n\nexport type SelectId = (entity: object) => string | number;\nexport const SELECT_ID = new InjectionToken<SelectId>('[@ng-atomic/common] Select Id');\nexport const defaultSelectId: SelectId = (entity: any) => entity.id;\n\n@Pipe({\n name: 'selectId',\n pure: true,\n standalone: true,\n})\nexport class SelectIdPipe {\n constructor(\n @Optional() @Inject(SELECT_ID) protected selectId: SelectId\n ) {\n this.selectId ??= defaultSelectId;\n }\n\n transform(entity: any): string | number {\n return this.selectId(entity);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAGa,SAAS,GAAG,IAAI,cAAc,CAAW,+BAA+B,EAAE;AAChF,MAAM,eAAe,GAAa,CAAC,MAAW,KAAK,MAAM,CAAC,GAAG;MAOvD,YAAY,CAAA;AACvB,IAAA,WAAA,CAC2C,QAAkB,EAAA;QAAlB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AAE3D,QAAA,IAAI,CAAC,QAAQ,KAAK,eAAe,CAAC;KACnC;AAED,IAAA,SAAS,CAAC,MAAW,EAAA;AACnB,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC9B;AATU,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,kBAED,SAAS,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAFpB,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA,EAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AAChB,oBAAA,IAAI,EAAE,IAAI;AACV,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA,CAAA;;0BAGI,QAAQ;;0BAAI,MAAM;2BAAC,SAAS,CAAA;;;ACbjC;;AAEG;;;;"}
|
|
@@ -4,6 +4,10 @@ import { isSignal, signal, Pipe } from '@angular/core';
|
|
|
4
4
|
function signalize(valueOrSignal) {
|
|
5
5
|
return isSignal(valueOrSignal) ? valueOrSignal : signal(valueOrSignal);
|
|
6
6
|
}
|
|
7
|
+
function wrapFactory(valueOrSignalFactory) {
|
|
8
|
+
return (...args) => signalize(valueOrSignalFactory(...args));
|
|
9
|
+
}
|
|
10
|
+
;
|
|
7
11
|
function resolveSignal(valueOrSignal) {
|
|
8
12
|
return isSignal(valueOrSignal) ? valueOrSignal() : valueOrSignal;
|
|
9
13
|
}
|
|
@@ -12,10 +16,10 @@ class SignalPipe {
|
|
|
12
16
|
return resolveSignal(obj);
|
|
13
17
|
}
|
|
14
18
|
;
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
16
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SignalPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
20
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.2.2", ngImport: i0, type: SignalPipe, isStandalone: true, name: "signal", pure: false }); }
|
|
17
21
|
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SignalPipe, decorators: [{
|
|
19
23
|
type: Pipe,
|
|
20
24
|
args: [{ standalone: true, name: 'signal', pure: false }]
|
|
21
25
|
}] });
|
|
@@ -24,5 +28,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
24
28
|
* Generated bundle index. Do not edit.
|
|
25
29
|
*/
|
|
26
30
|
|
|
27
|
-
export { SignalPipe, resolveSignal, signalize };
|
|
31
|
+
export { SignalPipe, resolveSignal, signalize, wrapFactory };
|
|
28
32
|
//# sourceMappingURL=ng-atomic-common-pipes-signal.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-atomic-common-pipes-signal.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/signal/signal.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/signal/ng-atomic-common-pipes-signal.ts"],"sourcesContent":["import { Pipe, Signal, isSignal, signal } from '@angular/core';\n\nexport type SignalOrValue<T> = T | Signal<T>;\n\nexport function signalize<T = any>(valueOrSignal: T | Signal<T>): Signal<T> {\n return isSignal(valueOrSignal) ? valueOrSignal : signal(valueOrSignal);\n}\n\nexport function resolveSignal<T>(valueOrSignal: T | Signal<T>): T {\n return isSignal(valueOrSignal) ? valueOrSignal() : valueOrSignal;\n}\n\n@Pipe({standalone: true, name: 'signal', pure: false})\nexport class SignalPipe {\n transform<T>(obj: T | Signal<T>): T {\n return resolveSignal(obj);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIM,SAAU,SAAS,CAAU,aAA4B,EAAA;AAC7D,IAAA,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AACzE,CAAC;AAEK,SAAU,aAAa,CAAI,aAA4B,EAAA;AAC3D,IAAA,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,EAAE,GAAG,aAAa,CAAC;AACnE,CAAC;MAGY,UAAU,CAAA;AACrB,IAAA,SAAS,CAAI,GAAkB,EAAA;AAC7B,QAAA,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;KAC3B
|
|
1
|
+
{"version":3,"file":"ng-atomic-common-pipes-signal.mjs","sources":["../../../../../packages/@ng-atomic/common/src/lib/pipes/signal/signal.pipe.ts","../../../../../packages/@ng-atomic/common/src/lib/pipes/signal/ng-atomic-common-pipes-signal.ts"],"sourcesContent":["import { Pipe, Signal, isSignal, signal } from '@angular/core';\n\nexport type SignalOrValue<T> = T | Signal<T>;\n\nexport function signalize<T = any>(valueOrSignal: T | Signal<T>): Signal<T> {\n return isSignal(valueOrSignal) ? valueOrSignal : signal(valueOrSignal);\n}\n\nexport function wrapFactory<T>(valueOrSignalFactory: (...args: any[]) => T | Signal<T>): () => Signal<T> {\n return (...args: any[]) => signalize(valueOrSignalFactory(...args));\n};\n\nexport function resolveSignal<T>(valueOrSignal: T | Signal<T>): T {\n return isSignal(valueOrSignal) ? valueOrSignal() : valueOrSignal;\n}\n\n@Pipe({standalone: true, name: 'signal', pure: false})\nexport class SignalPipe {\n transform<T>(obj: T | Signal<T>): T {\n return resolveSignal(obj);\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAIM,SAAU,SAAS,CAAU,aAA4B,EAAA;AAC7D,IAAA,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AACzE,CAAC;AAEK,SAAU,WAAW,CAAI,oBAAuD,EAAA;AACpF,IAAA,OAAO,CAAC,GAAG,IAAW,KAAK,SAAS,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AACtE,CAAC;AAAA,CAAC;AAEI,SAAU,aAAa,CAAI,aAA4B,EAAA;AAC3D,IAAA,OAAO,QAAQ,CAAC,aAAa,CAAC,GAAG,aAAa,EAAE,GAAG,aAAa,CAAC;AACnE,CAAC;MAGY,UAAU,CAAA;AACrB,IAAA,SAAS,CAAI,GAAkB,EAAA;AAC7B,QAAA,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;KAC3B;;8GAHU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;4GAAV,UAAU,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA,CAAA,EAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBADtB,IAAI;mBAAC,EAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAC,CAAA;;;AChBrD;;AAEG;;;;"}
|