@keycloakify/angular 0.0.1-rc.12 → 0.0.1-rc.13
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/dist/LICENSE +21 -0
- package/dist/esm2022/account/classes/component-reference/component-reference.class.mjs +1 -1
- package/dist/esm2022/account/directives/kc-class/kc-class.directive.mjs +10 -6
- package/dist/esm2022/lib/pipes/is-array-with-empty-object/is-array-with-empty-object.pipe.mjs +2 -2
- package/dist/esm2022/lib/pipes/is-array-with-empty-object/public-api.mjs +1 -1
- package/dist/esm2022/lib/pipes/to-array/to-array.pipe.mjs +2 -2
- package/dist/esm2022/lib/pipes/to-number/to-number.pipe.mjs +2 -2
- package/dist/esm2022/lib/public-api.mjs +2 -2
- package/dist/esm2022/public-api.mjs +2 -2
- package/dist/fesm2022/keycloakify-angular-account-classes-component-reference.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular-account-directives-kc-class.mjs +8 -4
- package/dist/fesm2022/keycloakify-angular-account-directives-kc-class.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs +1 -1
- package/dist/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular-lib.mjs +1 -1
- package/dist/fesm2022/keycloakify-angular-lib.mjs.map +1 -1
- package/dist/fesm2022/keycloakify-angular.mjs +1 -1
- package/dist/fesm2022/keycloakify-angular.mjs.map +1 -1
- package/dist/src/account/classes/component-reference/component-reference.class.ts +3 -3
- package/dist/src/account/classes/component-reference/index.ts +1 -1
- package/dist/src/account/containers/template/index.ts +1 -1
- package/dist/src/account/directives/kc-class/index.ts +1 -1
- package/dist/src/account/directives/kc-class/kc-class.directive.ts +141 -121
- package/dist/src/account/pages/account/index.ts +1 -1
- package/dist/src/account/pages/applications/index.ts +1 -1
- package/dist/src/account/pages/federatedIdentity/index.ts +1 -1
- package/dist/src/account/pages/log/index.ts +1 -1
- package/dist/src/account/pages/password/index.ts +1 -1
- package/dist/src/account/pages/sessions/index.ts +1 -1
- package/dist/src/account/pages/totp/index.ts +1 -1
- package/dist/src/account/providers/keycloakify-angular/index.ts +1 -1
- package/dist/src/account/services/account-resource-injector/index.ts +1 -1
- package/dist/src/account/services/i18n/index.ts +1 -1
- package/dist/src/account/tokens/classes/index.ts +1 -1
- package/dist/src/account/tokens/i18n/index.ts +1 -1
- package/dist/src/account/tokens/kc-context/index.ts +1 -1
- package/dist/src/lib/directives/attributes/index.ts +1 -1
- package/dist/src/lib/models/script/index.ts +1 -1
- package/dist/src/lib/pipes/input-type/index.ts +1 -1
- package/dist/src/lib/pipes/is-array-with-empty-object/index.ts +1 -1
- package/dist/src/lib/pipes/is-array-with-empty-object/is-array-with-empty-object.pipe.ts +10 -10
- package/dist/src/lib/pipes/kc-sanitize/index.ts +1 -1
- package/dist/src/lib/pipes/to-array/index.ts +1 -1
- package/dist/src/lib/pipes/to-array/to-array.pipe.ts +8 -8
- package/dist/src/lib/pipes/to-number/index.ts +1 -1
- package/dist/src/lib/pipes/to-number/to-number.pipe.ts +7 -7
- package/dist/src/lib/services/resource-injector/index.ts +1 -1
- package/dist/src/lib/tokens/use-default-css/index.ts +1 -1
- package/dist/src/login/classes/component-reference/index.ts +1 -1
- package/dist/src/login/components/add-remove-buttons-multi-valued-attribute/index.ts +1 -1
- package/dist/src/login/components/field-errors/index.ts +1 -1
- package/dist/src/login/components/group-label/index.ts +1 -1
- package/dist/src/login/components/input-field-by-type/index.ts +1 -1
- package/dist/src/login/components/input-tag/index.ts +1 -1
- package/dist/src/login/components/input-tag-selects/index.ts +1 -1
- package/dist/src/login/components/logout-other-sessions/index.ts +1 -1
- package/dist/src/login/components/password-wrapper/index.ts +1 -1
- package/dist/src/login/components/select-tag/index.ts +1 -1
- package/dist/src/login/components/textarea-tag/index.ts +1 -1
- package/dist/src/login/components/user-profile-form-fields/index.ts +1 -1
- package/dist/src/login/containers/template/index.ts +1 -1
- package/dist/src/login/directives/kc-class/index.ts +1 -1
- package/dist/src/login/pages/code/index.ts +1 -1
- package/dist/src/login/pages/delete-account-confirm/index.ts +1 -1
- package/dist/src/login/pages/delete-credential/index.ts +1 -1
- package/dist/src/login/pages/error/index.ts +1 -1
- package/dist/src/login/pages/frontchannel-logout/index.ts +1 -1
- package/dist/src/login/pages/idp-review-user-profile/index.ts +1 -1
- package/dist/src/login/pages/info/index.ts +1 -1
- package/dist/src/login/pages/login/index.ts +1 -1
- package/dist/src/login/pages/login-config-totp/index.ts +1 -1
- package/dist/src/login/pages/login-idp-link-confirm/index.ts +1 -1
- package/dist/src/login/pages/login-idp-link-confirm-override/index.ts +1 -1
- package/dist/src/login/pages/login-idp-link-email/index.ts +1 -1
- package/dist/src/login/pages/login-oauth-grant/index.ts +1 -1
- package/dist/src/login/pages/login-oauth2-device-verify-user-code/index.ts +1 -1
- package/dist/src/login/pages/login-otp/index.ts +1 -1
- package/dist/src/login/pages/login-page-expired/index.ts +1 -1
- package/dist/src/login/pages/login-passkeys-conditional-authenticate/index.ts +1 -1
- package/dist/src/login/pages/login-password/index.ts +1 -1
- package/dist/src/login/pages/login-recovery-authn-code-config/index.ts +1 -1
- package/dist/src/login/pages/login-recovery-authn-code-input/index.ts +1 -1
- package/dist/src/login/pages/login-reset-otp/index.ts +1 -1
- package/dist/src/login/pages/login-reset-password/index.ts +1 -1
- package/dist/src/login/pages/login-update-password/index.ts +1 -1
- package/dist/src/login/pages/login-update-profile/index.ts +1 -1
- package/dist/src/login/pages/login-username/index.ts +1 -1
- package/dist/src/login/pages/login-verify-email/index.ts +1 -1
- package/dist/src/login/pages/login-x509-info/index.ts +1 -1
- package/dist/src/login/pages/logout-confirm/index.ts +1 -1
- package/dist/src/login/pages/register/index.ts +1 -1
- package/dist/src/login/pages/saml-post-form/index.ts +1 -1
- package/dist/src/login/pages/select-authenticator/index.ts +1 -1
- package/dist/src/login/pages/terms/index.ts +1 -1
- package/dist/src/login/pages/update-email/index.ts +1 -1
- package/dist/src/login/pages/webauthn-authenticate/index.ts +1 -1
- package/dist/src/login/pages/webauthn-error/index.ts +1 -1
- package/dist/src/login/pages/webauthn-register/index.ts +1 -1
- package/dist/src/login/providers/keycloakify-angular/index.ts +1 -1
- package/dist/src/login/services/i18n/index.ts +1 -1
- package/dist/src/login/services/login-resource-injector/index.ts +1 -1
- package/dist/src/login/services/submit/index.ts +1 -1
- package/dist/src/login/services/user-profile-form/index.ts +1 -1
- package/dist/src/login/tokens/classes/index.ts +1 -1
- package/dist/src/login/tokens/i18n/index.ts +1 -1
- package/dist/src/login/tokens/kc-context/index.ts +1 -1
- package/dist/src/login/tokens/make-user-confirm-password/index.ts +1 -1
- package/dist/src/tsconfig.lib.json +7 -9
- package/dist/src/tsconfig.lib.prod.json +8 -8
- package/package.json +1 -1
|
@@ -1,150 +1,170 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* eslint-disable @typescript-eslint/consistent-indexed-object-style */
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
Directive,
|
|
5
|
+
DoCheck,
|
|
6
|
+
ElementRef,
|
|
7
|
+
inject,
|
|
8
|
+
Input,
|
|
9
|
+
isDevMode,
|
|
10
|
+
Renderer2,
|
|
11
|
+
ɵstringify as stringify
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { ClassKey } from 'keycloakify/account';
|
|
14
14
|
import { getKcClsx } from 'keycloakify/account/lib/kcClsx';
|
|
15
15
|
import { ComponentReference } from '@keycloakify/angular/account/classes/component-reference';
|
|
16
16
|
|
|
17
17
|
interface CssClassState {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
// PERF: could use a bit mask to represent state as all fields are boolean flags
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
changed: boolean;
|
|
21
|
+
touched: boolean;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
type KcClassSupportedTypes =
|
|
24
|
+
type KcClassSupportedTypes =
|
|
25
|
+
| ClassKey[]
|
|
26
|
+
| Set<ClassKey>
|
|
27
|
+
| Partial<{ [key in ClassKey]: any }>
|
|
28
|
+
| null
|
|
29
|
+
| undefined;
|
|
25
30
|
|
|
26
|
-
type NgClassSupportedTypes =
|
|
31
|
+
type NgClassSupportedTypes =
|
|
32
|
+
| string[]
|
|
33
|
+
| Set<string>
|
|
34
|
+
| { [key: string]: any }
|
|
35
|
+
| null
|
|
36
|
+
| undefined;
|
|
27
37
|
|
|
28
38
|
@Directive({ selector: '[kcClass]', standalone: true })
|
|
29
39
|
export class KcClassDirective implements DoCheck {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
45
|
-
@Input('ngClass')
|
|
46
|
-
set ngClass(value: string | NgClassSupportedTypes) {
|
|
47
|
-
this.rawClass = typeof value === 'string' ? value.trim().split(/\s+/) : value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
51
|
-
@Input('kcClass')
|
|
52
|
-
set kcClass(value: ClassKey | KcClassSupportedTypes) {
|
|
53
|
-
this.rawKcClass = typeof value === 'string' ? (value.trim().split(/\s+/) as ClassKey[]) : value;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
ngDoCheck(): void {
|
|
57
|
-
for (const klass of this.initialClasses) {
|
|
58
|
-
this._updateState(klass, true);
|
|
59
|
-
}
|
|
60
|
-
// classes from the [ngClass] binding
|
|
61
|
-
const rawClass = this.rawClass;
|
|
62
|
-
if (Array.isArray(rawClass) || rawClass instanceof Set) {
|
|
63
|
-
for (const klass of rawClass) {
|
|
64
|
-
this._updateState(klass, true);
|
|
65
|
-
}
|
|
66
|
-
} else if (rawClass != null) {
|
|
67
|
-
for (const klass of Object.keys(rawClass)) {
|
|
68
|
-
this._updateState(klass, Boolean(rawClass[klass]));
|
|
69
|
-
}
|
|
40
|
+
private initialClasses: string[] = [];
|
|
41
|
+
private rawClass: NgClassSupportedTypes;
|
|
42
|
+
private rawKcClass: KcClassSupportedTypes;
|
|
43
|
+
|
|
44
|
+
private stateMap = new Map<string | ClassKey, CssClassState>();
|
|
45
|
+
readonly #renderer = inject(Renderer2);
|
|
46
|
+
readonly #el = inject(ElementRef);
|
|
47
|
+
readonly #host = inject(ComponentReference);
|
|
48
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
49
|
+
@Input('class')
|
|
50
|
+
set klass(value: string) {
|
|
51
|
+
this.initialClasses = value != null ? value.trim().split(/\s+/) : [];
|
|
70
52
|
}
|
|
71
53
|
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this._updateState(klass, true, true);
|
|
77
|
-
}
|
|
78
|
-
} else if (rawKcClass != null) {
|
|
79
|
-
for (const klass of Object.keys(rawKcClass)) {
|
|
80
|
-
this._updateState(klass, Boolean(rawKcClass[klass as ClassKey]), true);
|
|
81
|
-
}
|
|
54
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
55
|
+
@Input('ngClass')
|
|
56
|
+
set ngClass(value: string | NgClassSupportedTypes) {
|
|
57
|
+
this.rawClass = typeof value === 'string' ? value.trim().split(/\s+/) : value;
|
|
82
58
|
}
|
|
83
59
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (state !== undefined) {
|
|
90
|
-
if (state.enabled !== nextEnabled) {
|
|
91
|
-
state.changed = true;
|
|
92
|
-
state.enabled = nextEnabled;
|
|
93
|
-
}
|
|
94
|
-
state.touched = true;
|
|
95
|
-
} else {
|
|
96
|
-
let klassChecked = klass;
|
|
97
|
-
if (kcClsxCheck) {
|
|
98
|
-
const doUseDefaultCss = this.#host.doUseDefaultCss ?? true;
|
|
99
|
-
const classes = { ...(this.#host.classes ?? {}), ...(this.#host.additionalClasses ?? {}) };
|
|
100
|
-
const kcClsx = getKcClsx({ doUseDefaultCss, classes }).kcClsx;
|
|
101
|
-
klassChecked = kcClsx(klass as ClassKey);
|
|
102
|
-
}
|
|
103
|
-
this.stateMap.set(klassChecked, {
|
|
104
|
-
enabled: nextEnabled,
|
|
105
|
-
changed: true,
|
|
106
|
-
touched: true,
|
|
107
|
-
});
|
|
60
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
61
|
+
@Input('kcClass')
|
|
62
|
+
set kcClass(value: ClassKey | KcClassSupportedTypes) {
|
|
63
|
+
this.rawKcClass =
|
|
64
|
+
typeof value === 'string' ? (value.trim().split(/\s+/) as ClassKey[]) : value;
|
|
108
65
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
66
|
+
|
|
67
|
+
ngDoCheck(): void {
|
|
68
|
+
for (const klass of this.initialClasses) {
|
|
69
|
+
this._updateState(klass, true);
|
|
70
|
+
}
|
|
71
|
+
// classes from the [ngClass] binding
|
|
72
|
+
const rawClass = this.rawClass;
|
|
73
|
+
if (Array.isArray(rawClass) || rawClass instanceof Set) {
|
|
74
|
+
for (const klass of rawClass) {
|
|
75
|
+
this._updateState(klass, true);
|
|
76
|
+
}
|
|
77
|
+
} else if (rawClass != null) {
|
|
78
|
+
for (const klass of Object.keys(rawClass)) {
|
|
79
|
+
this._updateState(klass, Boolean(rawClass[klass]));
|
|
80
|
+
}
|
|
124
81
|
}
|
|
125
|
-
this.stateMap.delete(klass);
|
|
126
|
-
}
|
|
127
82
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
83
|
+
// classes from the [kcClass] binding
|
|
84
|
+
const rawKcClass = this.rawKcClass;
|
|
85
|
+
if (Array.isArray(rawKcClass) || rawKcClass instanceof Set) {
|
|
86
|
+
for (const klass of rawKcClass) {
|
|
87
|
+
this._updateState(klass, true, true);
|
|
88
|
+
}
|
|
89
|
+
} else if (rawKcClass != null) {
|
|
90
|
+
for (const klass of Object.keys(rawKcClass)) {
|
|
91
|
+
this._updateState(klass, Boolean(rawKcClass[klass as ClassKey]), true);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
131
94
|
|
|
132
|
-
|
|
133
|
-
if (isDevMode()) {
|
|
134
|
-
if (typeof klass !== 'string') {
|
|
135
|
-
throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`);
|
|
136
|
-
}
|
|
95
|
+
this._applyStateDiff();
|
|
137
96
|
}
|
|
138
97
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
98
|
+
private _updateState(
|
|
99
|
+
klass: string | ClassKey,
|
|
100
|
+
nextEnabled: boolean,
|
|
101
|
+
kcClsxCheck = false
|
|
102
|
+
) {
|
|
103
|
+
const state = this.stateMap.get(klass);
|
|
104
|
+
if (state !== undefined) {
|
|
105
|
+
if (state.enabled !== nextEnabled) {
|
|
106
|
+
state.changed = true;
|
|
107
|
+
state.enabled = nextEnabled;
|
|
108
|
+
}
|
|
109
|
+
state.touched = true;
|
|
144
110
|
} else {
|
|
145
|
-
|
|
111
|
+
let klassChecked = klass;
|
|
112
|
+
if (kcClsxCheck) {
|
|
113
|
+
const doUseDefaultCss = this.#host.doUseDefaultCss ?? true;
|
|
114
|
+
const classes = {
|
|
115
|
+
...(this.#host.classes ?? {}),
|
|
116
|
+
...(this.#host.additionalClasses ?? {})
|
|
117
|
+
};
|
|
118
|
+
const kcClsx = getKcClsx({ doUseDefaultCss, classes }).kcClsx;
|
|
119
|
+
klassChecked = kcClsx(klass as ClassKey);
|
|
120
|
+
}
|
|
121
|
+
this.stateMap.set(klassChecked, {
|
|
122
|
+
enabled: nextEnabled,
|
|
123
|
+
changed: true,
|
|
124
|
+
touched: true
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private _applyStateDiff() {
|
|
130
|
+
for (const stateEntry of this.stateMap) {
|
|
131
|
+
const klass = stateEntry[0];
|
|
132
|
+
const state = stateEntry[1];
|
|
133
|
+
|
|
134
|
+
if (state.changed) {
|
|
135
|
+
this._toggleClass(klass, state.enabled);
|
|
136
|
+
state.changed = false;
|
|
137
|
+
} else if (!state.touched) {
|
|
138
|
+
// A class that was previously active got removed from the new collection of classes -
|
|
139
|
+
// remove from the DOM as well.
|
|
140
|
+
if (state.enabled) {
|
|
141
|
+
this._toggleClass(klass, false);
|
|
142
|
+
}
|
|
143
|
+
this.stateMap.delete(klass);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
state.touched = false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
private _toggleClass(klass: string, enabled: boolean): void {
|
|
151
|
+
if (isDevMode()) {
|
|
152
|
+
if (typeof klass !== 'string') {
|
|
153
|
+
throw new Error(
|
|
154
|
+
`NgClass can only toggle CSS classes expressed as strings, got ${stringify(klass)}`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
klass = klass.trim();
|
|
160
|
+
if (klass.length > 0) {
|
|
161
|
+
klass.split(/\s+/).forEach(klass => {
|
|
162
|
+
if (enabled) {
|
|
163
|
+
this.#renderer.addClass(this.#el.nativeElement, klass);
|
|
164
|
+
} else {
|
|
165
|
+
this.#renderer.removeClass(this.#el.nativeElement, klass);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
146
168
|
}
|
|
147
|
-
});
|
|
148
169
|
}
|
|
149
|
-
}
|
|
150
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
@Pipe({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
name: 'isArrayWithEmptyObject',
|
|
5
|
+
standalone: true
|
|
6
6
|
})
|
|
7
7
|
export class IsArrayWithEmptyObjectPipe implements PipeTransform {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
transform(variable: unknown): boolean {
|
|
9
|
+
return (
|
|
10
|
+
Array.isArray(variable) &&
|
|
11
|
+
variable.length === 1 &&
|
|
12
|
+
typeof variable[0] === 'object' &&
|
|
13
|
+
Object.keys(variable[0]).length === 0
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
@Pipe({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
name: 'toArray',
|
|
5
|
+
standalone: true
|
|
6
6
|
})
|
|
7
7
|
export class ToArrayPipe implements PipeTransform {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
transform(value: string | string[], emptyWhenString = false): string[] {
|
|
9
|
+
// if (!value) throw new Error('must pass a value');
|
|
10
|
+
if (value instanceof Array) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
return emptyWhenString ? [] : [value];
|
|
12
14
|
}
|
|
13
|
-
return emptyWhenString ? [] : [value];
|
|
14
|
-
}
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
@Pipe({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
name: 'toNumber',
|
|
5
|
+
standalone: true
|
|
6
6
|
})
|
|
7
7
|
export class ToNumberPipe implements PipeTransform {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
transform(value: string | number): number {
|
|
9
|
+
const number = parseInt(`${value}`);
|
|
10
|
+
if (isNaN(number)) throw new Error('number is NaN');
|
|
11
|
+
return number;
|
|
12
|
+
}
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './public-api';
|
|
1
|
+
export * from './public-api';
|