@softpak/components 21.2.0-capwesome.2 → 21.2.0-capwesome.4
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/fesm2022/softpak-components-spx-app-expiry.mjs +5 -5
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +6 -38
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +40 -24
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +17 -25
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-haptics.mjs +54 -0
- package/fesm2022/softpak-components-spx-haptics.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-helpers.mjs +9 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +14 -21
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +12 -18
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs +1 -0
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +9 -23
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-tabs.mjs +8 -11
- package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +22 -39
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-translate.mjs +5 -2
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +50 -50
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +2 -2
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +5 -1
- package/types/softpak-components-spx-button.d.ts +1 -4
- package/types/softpak-components-spx-channel-selection.d.ts +14 -7
- package/types/softpak-components-spx-confirm.d.ts +21 -33
- package/types/softpak-components-spx-haptics.d.ts +13 -0
- package/types/softpak-components-spx-helpers.d.ts +3 -1
- package/types/softpak-components-spx-navigation.d.ts +20 -36
- package/types/softpak-components-spx-spinner.d.ts +14 -27
- package/types/softpak-components-spx-storage.d.ts +2 -1
- package/types/softpak-components-spx-suggestion.d.ts +1 -1
- package/types/softpak-components-spx-tabs.d.ts +8 -17
- package/types/softpak-components-spx-toaster.d.ts +55 -91
- package/types/softpak-components-spx-translate.d.ts +3 -1
- package/types/softpak-components-spx-update.d.ts +15 -13
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ImpactStyle, Haptics } from '@capacitor/haptics';
|
|
2
|
+
import { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';
|
|
3
|
+
|
|
4
|
+
class SpxHaptics {
|
|
5
|
+
static { this.lastHaptic = 0; }
|
|
6
|
+
static { this.hapticCooldown = 120; }
|
|
7
|
+
constructor() {
|
|
8
|
+
this.touchAreaIsBeingPressed = false;
|
|
9
|
+
}
|
|
10
|
+
async pressDown() {
|
|
11
|
+
this.touchAreaIsBeingPressed = true;
|
|
12
|
+
await this.safeHaptic(ImpactStyle.Medium);
|
|
13
|
+
}
|
|
14
|
+
async pointerUp(wasInsideElement) {
|
|
15
|
+
if (!this.touchAreaIsBeingPressed) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
if (wasInsideElement) {
|
|
20
|
+
// OK haptic
|
|
21
|
+
await this.safeHaptic(ImpactStyle.Heavy);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
// Cancel haptic
|
|
25
|
+
await this.safeHaptic(ImpactStyle.Light);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// Silence if no haptics
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async safeHaptic(style) {
|
|
33
|
+
if (!SpxStorage.getSetting(SpxStorageKeyEnum.noHaptics)) {
|
|
34
|
+
const now = performance.now();
|
|
35
|
+
if (now - SpxHaptics.lastHaptic < SpxHaptics.hapticCooldown) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
SpxHaptics.lastHaptic = now;
|
|
39
|
+
try {
|
|
40
|
+
await Haptics.impact({ style });
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Silence if no haptics
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Generated bundle index. Do not edit.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
export { SpxHaptics };
|
|
54
|
+
//# sourceMappingURL=softpak-components-spx-haptics.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-haptics.mjs","sources":["../../../../projects/softpak/components/spx-haptics/src/spx-haptics.class.ts","../../../../projects/softpak/components/spx-haptics/softpak-components-spx-haptics.ts"],"sourcesContent":["import { Haptics, ImpactStyle } from \"@capacitor/haptics\";\nimport { SpxStorage, SpxStorageKeyEnum } from \"@softpak/components/spx-storage\";\n\nexport class SpxHaptics {\n private static lastHaptic = 0;\n private static hapticCooldown = 120;\n private touchAreaIsBeingPressed = false;\n\n constructor() {\n\n }\n\n public async pressDown() {\n this.touchAreaIsBeingPressed = true;\n await this.safeHaptic(ImpactStyle.Medium);\n }\n\n public async pointerUp(wasInsideElement: boolean) {\n if (!this.touchAreaIsBeingPressed) {\n return;\n }\n \n try {\n if (wasInsideElement) {\n // OK haptic\n await this.safeHaptic(ImpactStyle.Heavy);\n } else {\n // Cancel haptic\n await this.safeHaptic(ImpactStyle.Light);\n }\n } catch {\n // Silence if no haptics\n }\n }\n\n public async safeHaptic(style: ImpactStyle) {\n if (!SpxStorage.getSetting(SpxStorageKeyEnum.noHaptics)) {\n const now = performance.now();\n if (now - SpxHaptics.lastHaptic < SpxHaptics.hapticCooldown) {\n return;\n }\n SpxHaptics.lastHaptic = now;\n\n try {\n await Haptics.impact({ style });\n } catch {\n // Silence if no haptics\n }\n }\n }\n}\n\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAGa,UAAU,CAAA;aACJ,IAAA,CAAA,UAAU,GAAG,CAAH,CAAK;aACf,IAAA,CAAA,cAAc,GAAG,GAAH,CAAO;AAGpC,IAAA,WAAA,GAAA;QAFQ,IAAA,CAAA,uBAAuB,GAAG,KAAK;IAIvC;AAEO,IAAA,MAAM,SAAS,GAAA;AAClB,QAAA,IAAI,CAAC,uBAAuB,GAAG,IAAI;QACnC,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC;IAC7C;IAEO,MAAM,SAAS,CAAC,gBAAyB,EAAA;AAC5C,QAAA,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAC/B;QACJ;AAEA,QAAA,IAAI;YACA,IAAI,gBAAgB,EAAE;;gBAElB,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC;YAC5C;iBAAO;;gBAEH,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC;YAC5C;QACJ;AAAE,QAAA,MAAM;;QAER;IACJ;IAEO,MAAM,UAAU,CAAC,KAAkB,EAAA;QACtC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE;AACrD,YAAA,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,IAAI,GAAG,GAAG,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,cAAc,EAAE;gBACzD;YACJ;AACA,YAAA,UAAU,CAAC,UAAU,GAAG,GAAG;AAE3B,YAAA,IAAI;gBACA,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;YACnC;AAAE,YAAA,MAAM;;YAER;QACJ;IACJ;;;ACjDJ;;AAEG;;;;"}
|
|
@@ -19,6 +19,14 @@ const calcCheckDigit = (container) => {
|
|
|
19
19
|
return outcome.toString();
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
function getBinaryVersionGroup(version) {
|
|
23
|
+
const match = /^(\d+)\.(\d+)\.\d+/.exec(version);
|
|
24
|
+
if (!match) {
|
|
25
|
+
throw new Error(`[UPD] Invalid app version format: ${version}`);
|
|
26
|
+
}
|
|
27
|
+
return `${match[1]}.${match[2]}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
var SpxSeverityEnum;
|
|
23
31
|
(function (SpxSeverityEnum) {
|
|
24
32
|
SpxSeverityEnum["error"] = "error";
|
|
@@ -48,5 +56,5 @@ const valuePairToValue = (pair) => {
|
|
|
48
56
|
* Generated bundle index. Do not edit.
|
|
49
57
|
*/
|
|
50
58
|
|
|
51
|
-
export { SpxSeverityEnum, calcCheckDigit, unsubscribeSubscriptions, valuePairToValue };
|
|
59
|
+
export { SpxSeverityEnum, calcCheckDigit, getBinaryVersionGroup, unsubscribeSubscriptions, valuePairToValue };
|
|
52
60
|
//# sourceMappingURL=softpak-components-spx-helpers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-helpers.mjs","sources":["../../../../projects/softpak/components/spx-helpers/calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/unsubscribe-subscriptions.function.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\n container = container.toUpperCase();\n\n const mapping = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\n };\n\n let total = 0;\n\n for (let i = 0; i < container.length; i++) {\n const cChar = container.substr(i, 1);\n const value = (mapping as any)[cChar];\n const multiplier = Math.pow(2, i);\n total = total + (value * multiplier);\n }\n\n let outcome = total % 11;\n if (outcome === 10) {\n outcome = 0;\n }\n\n return outcome.toString();\n}\n","export enum SpxSeverityEnum {\n error = 'error',\n info = 'info',\n success = 'success',\n unknown = 'unknown',\n warning = 'warning',\n primary = 'primary',\n}\n","import { Subscription } from \"rxjs\";\n\nexport function unsubscribeSubscriptions(subscriptionObject: object): void {\n for (const key in subscriptionObject) {\n if ((subscriptionObject as any)[key]) {\n ((subscriptionObject as any)[key] as Subscription).unsubscribe();\n }\n }\n}","export const valuePairToValue = (pair: any) => {\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\n return null;\n }\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.value : pair;\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAO,MAAM,cAAc,GAAG,CAAC,SAAiB,KAAY;AAC1D,IAAA,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE;AAEnC,IAAA,MAAM,OAAO,GAAG;AACd,QAAA,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1D,CAAC,EAAE,EAAE,EAAE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calc-check-digit.function.ts","../../../../projects/softpak/components/spx-helpers/get-binary-version-group.function.ts","../../../../projects/softpak/components/spx-helpers/spx-severity.enum.ts","../../../../projects/softpak/components/spx-helpers/unsubscribe-subscriptions.function.ts","../../../../projects/softpak/components/spx-helpers/value-pair-to-value.function.ts","../../../../projects/softpak/components/spx-helpers/softpak-components-spx-helpers.ts"],"sourcesContent":["export const calcCheckDigit = (container: string): string => {\n container = container.toUpperCase();\n\n const mapping = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 10, B: 12, C: 13, D: 14, E: 15, F: 16, G: 17, H: 18, I: 19, J: 20, K: 21, L: 23, M: 24,\n N: 25, O: 26, P: 27, Q: 28, R: 29, S: 30, T: 31, U: 32, V: 34, W: 35, X: 36, Y: 37, Z: 38\n };\n\n let total = 0;\n\n for (let i = 0; i < container.length; i++) {\n const cChar = container.substr(i, 1);\n const value = (mapping as any)[cChar];\n const multiplier = Math.pow(2, i);\n total = total + (value * multiplier);\n }\n\n let outcome = total % 11;\n if (outcome === 10) {\n outcome = 0;\n }\n\n return outcome.toString();\n}\n","export function getBinaryVersionGroup(version: string): string {\n const match = /^(\\d+)\\.(\\d+)\\.\\d+/.exec(version);\n if (!match) {\n throw new Error(`[UPD] Invalid app version format: ${version}`);\n }\n return `${match[1]}.${match[2]}`;\n}\n","export enum SpxSeverityEnum {\n error = 'error',\n info = 'info',\n success = 'success',\n unknown = 'unknown',\n warning = 'warning',\n primary = 'primary',\n}\n","import { Subscription } from \"rxjs\";\n\nexport function unsubscribeSubscriptions(subscriptionObject: object): void {\n for (const key in subscriptionObject) {\n if ((subscriptionObject as any)[key]) {\n ((subscriptionObject as any)[key] as Subscription).unsubscribe();\n }\n }\n}","export const valuePairToValue = (pair: any) => {\n if (pair === null || (typeof pair === 'object' && pair.value === undefined)) {\n return null;\n }\n return pair?.value || pair?.value === false || pair?.value === null || pair?.value === '' || pair?.value === 0 ? pair?.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,CAAC,EAAE;AAChC,YAAA,kBAA0B,CAAC,GAAG,CAAkB,CAAC,WAAW,EAAE;QACpE;IACJ;AACJ;;ACRO,MAAM,gBAAgB,GAAG,CAAC,IAAS,KAAI;AAC1C,IAAA,IAAI,IAAI,KAAK,IAAI,KAAK,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,EAAE;AACzE,QAAA,OAAO,IAAI;IACf;AACA,IAAA,OAAO,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI;AACvI;;ACLA;;AAEG;;;;"}
|
|
@@ -7,7 +7,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
|
7
7
|
import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
|
|
8
8
|
import { NgClass } from '@angular/common';
|
|
9
9
|
import * as i1 from '@ngrx/store';
|
|
10
|
-
import {
|
|
10
|
+
import { createActionGroup, props, createFeature, createReducer, on } from '@ngrx/store';
|
|
11
11
|
|
|
12
12
|
class SpxHomeTilesComponent {
|
|
13
13
|
constructor() {
|
|
@@ -42,22 +42,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
42
42
|
], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<button #button\n class=\"border border-transparent flex flex-col w-full px-4 py-2 relative rounded text-center focus:outline-none focus:ring-2 focus:ring-offset-2\"\n type=\"button\"\n part=\"button\"\n [attr.autofocus]=\"this.spxAutofocus() ? this.spxAutofocus() : undefined\"\n [class.bg-blue-600]=\"!this.spxClass()\"\n [class.focus:ring-blue-500]=\"!this.spxClass()\"\n [class.hover:bg-blue-800]=\"!this.spxClass()\"\n [class.text-white]=\"!this.spxClass()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\">\n <div class=\"flex gap-5 items-center\">\n <div class=\"fal my-2 self-center text-xl w-5\"><ng-content></ng-content></div>\n <div class=\"grow flex flex-col text-left\">\n <div class=\"text-lg font-bold text-ellipsis overflow-hidden\">{{ this.spxTitle() }}</div>\n @if (this.spxSubtitle()) {\n <div class=\"text-sm opacity-70 text-ellipsis overflow-hidden\">{{ this.spxSubtitle() }}</div>\n }\n </div>\n </div>\n </button>" }]
|
|
43
43
|
}], propDecorators: { spxAutofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxAutofocus", required: false }] }], spxClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxClass", required: false }] }], spxSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxSubtitle", required: false }] }], spxTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxTitle", required: false }] }], buttonRef: [{ type: i0.ViewChild, args: ['button', { isSignal: true }] }] } });
|
|
44
44
|
|
|
45
|
-
const addPages = createAction('[SPX / Navigation] Add items', props());
|
|
46
|
-
const initialize = createAction('[SPX / Navigation] Initialize', props());
|
|
47
|
-
const update = createAction('[SPX / Navigation] Update', props());
|
|
48
|
-
const all = union({
|
|
49
|
-
addPages,
|
|
50
|
-
initialize,
|
|
51
|
-
update
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
var spxNavigation_actions = /*#__PURE__*/Object.freeze({
|
|
55
|
-
__proto__: null,
|
|
56
|
-
addPages: addPages,
|
|
57
|
-
initialize: initialize,
|
|
58
|
-
update: update
|
|
59
|
-
});
|
|
60
|
-
|
|
61
45
|
const initialState = {
|
|
62
46
|
accessList: [],
|
|
63
47
|
navigationItems: [],
|
|
@@ -71,20 +55,29 @@ var spxNavigation_initial = /*#__PURE__*/Object.freeze({
|
|
|
71
55
|
initialState: initialState
|
|
72
56
|
});
|
|
73
57
|
|
|
58
|
+
const spxNavigationActions = createActionGroup({
|
|
59
|
+
source: 'SpxNavigation',
|
|
60
|
+
events: {
|
|
61
|
+
AddPages: props(),
|
|
62
|
+
Initialize: props(),
|
|
63
|
+
Update: props(),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
74
67
|
var spxNavigationReducer$1 = createFeature({
|
|
75
68
|
name: 'spxNavigation',
|
|
76
|
-
reducer: createReducer(initialState, on(initialize, (state, { navigationItems }) => ({
|
|
69
|
+
reducer: createReducer(initialState, on(spxNavigationActions.initialize, (state, { navigationItems }) => ({
|
|
77
70
|
...state,
|
|
78
71
|
navigationItems: navigationItems,
|
|
79
72
|
menuItems: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && (navigationItem.hasTile === undefined || navigationItem.hasTile)),
|
|
80
73
|
tabs: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && navigationItem.hasTab),
|
|
81
|
-
})), on(update, (state, { accessList, signedIn }) => ({
|
|
74
|
+
})), on(spxNavigationActions.update, (state, { accessList, signedIn }) => ({
|
|
82
75
|
...state,
|
|
83
76
|
accessList,
|
|
84
77
|
menuItems: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),
|
|
85
78
|
signedIn,
|
|
86
79
|
tabs: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),
|
|
87
|
-
})), on(addPages, (state, { navigationItems }) => ({
|
|
80
|
+
})), on(spxNavigationActions.addPages, (state, { navigationItems }) => ({
|
|
88
81
|
...state,
|
|
89
82
|
navigationItems: [...state.navigationItems.slice(), ...navigationItems],
|
|
90
83
|
menuItems: [...state.menuItems.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],
|
|
@@ -142,5 +135,5 @@ var spxNavigation_state = /*#__PURE__*/Object.freeze({
|
|
|
142
135
|
* Generated bundle index. Do not edit.
|
|
143
136
|
*/
|
|
144
137
|
|
|
145
|
-
export { SpxHomeTileComponent, SpxHomeTilesComponent, SpxNavigationComponent,
|
|
138
|
+
export { SpxHomeTileComponent, SpxHomeTilesComponent, SpxNavigationComponent, spxNavigationActions, spxNavigation_initial as spxNavigationInitial, spxNavigation_reducer as spxNavigationReducer, spxNavigation_state as spxNavigationState };
|
|
146
139
|
//# sourceMappingURL=softpak-components-spx-navigation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-navigation.mjs","sources":["../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.html","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.html","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.actions.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.initial.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.reducer.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.html","../../../../projects/softpak/components/spx-navigation/softpak-components-spx-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tiles',\n standalone: true,\n templateUrl: './spx-home-tiles.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTilesComponent {\n readonly spxCols = input<1 | 2>(2);\n}\n","<div class=\"mx-auto max-w-lg grid gap-3\"\n [class.grid-cols-1]=\"this.spxCols() === 1\"\n [class.grid-cols-2]=\"this.spxCols() === 2\"><ng-content></ng-content></div>","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, input, viewChild } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tile',\n imports: [\n NgClass\n ],\n templateUrl: './spx-home-tile.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTileComponent {\n readonly spxAutofocus = input<boolean>();\n readonly spxClass = input<string>();\n readonly spxSubtitle = input<string>();\n readonly spxTitle = input<string>();\n private buttonRef = viewChild<ElementRef<HTMLButtonElement>>('button');\n\n setFocus(): void {\n this.buttonRef()?.nativeElement.focus();\n }\n}\n","<button #button\n class=\"border border-transparent flex flex-col w-full px-4 py-2 relative rounded text-center focus:outline-none focus:ring-2 focus:ring-offset-2\"\n type=\"button\"\n part=\"button\"\n [attr.autofocus]=\"this.spxAutofocus() ? this.spxAutofocus() : undefined\"\n [class.bg-blue-600]=\"!this.spxClass()\"\n [class.focus:ring-blue-500]=\"!this.spxClass()\"\n [class.hover:bg-blue-800]=\"!this.spxClass()\"\n [class.text-white]=\"!this.spxClass()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\">\n <div class=\"flex gap-5 items-center\">\n <div class=\"fal my-2 self-center text-xl w-5\"><ng-content></ng-content></div>\n <div class=\"grow flex flex-col text-left\">\n <div class=\"text-lg font-bold text-ellipsis overflow-hidden\">{{ this.spxTitle() }}</div>\n @if (this.spxSubtitle()) {\n <div class=\"text-sm opacity-70 text-ellipsis overflow-hidden\">{{ this.spxSubtitle() }}</div>\n }\n </div>\n </div>\n </button>","import { createAction, props, union } from '@ngrx/store';\nimport { SpxNavigationItemI } from '../../spx-navigation-item.interface';\n\nexport const addPages = createAction('[SPX / Navigation] Add items', props<{\n navigationItems: SpxNavigationItemI[];\n}>());\nexport const initialize = createAction('[SPX / Navigation] Initialize', props<{\n navigationItems: SpxNavigationItemI[];\n}>());\nexport const update = createAction('[SPX / Navigation] Update', props<{\n accessList: string[];\n signedIn: boolean;\n}>());\n\nconst all = union({\n addPages,\n initialize,\n update\n});\n\nexport type Actions = typeof all;\n","import { StateI } from \"./spx-navigation.state\";\n\nexport const initialState: StateI = {\n accessList: [],\n navigationItems: [],\n menuItems: [],\n signedIn: false,\n tabs: [],\n};\n","\nimport * as actions from './spx-navigation.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { StateI } from './spx-navigation.state';\nimport { initialState } from './spx-navigation.initial';\n\nexport default createFeature({\n name: 'spxNavigation',\n reducer: createReducer(\n initialState,\n on(actions.initialize, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: navigationItems,\n menuItems: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && (navigationItem.hasTile === undefined || navigationItem.hasTile)),\n tabs: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && navigationItem.hasTab),\n })),\n on(actions.update, (state: StateI, { accessList, signedIn }): StateI => ({\n ...state,\n accessList,\n menuItems: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n signedIn,\n tabs: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n })),\n on(actions.addPages, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: [...state.navigationItems.slice(), ...navigationItems],\n menuItems: [...state.menuItems.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n tabs: [...state.tabs.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n })),\n ),\n});\n","import { Component, input, OnDestroy, OnInit, output, signal, viewChildren } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxHomeTilesComponent } from './spx-home-tile/spx-home-tiles.component';\nimport { SpxHomeTileComponent } from './spx-home-tile/spx-home-tile.component';\nimport { Store } from '@ngrx/store';\nimport spxNavigationReducer from './store/spx-navigation/spx-navigation.reducer';\nimport { AsyncPipe } from '@angular/common';\nimport { SpxNavigationItemI } from './spx-navigation-item.interface';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'spx-navigation',\n templateUrl: './spx-navigation.component.html',\n imports: [\n TranslateModule,\n FontAwesomeModule,\n SpxCapitalizePipe,\n SpxHomeTilesComponent,\n SpxHomeTileComponent\n ]\n})\nexport class SpxNavigationComponent implements OnInit, OnDestroy {\n readonly spxOverwriteNavItems = input<SpxNavigationItemI[]>();\n tiles = viewChildren<SpxHomeTileComponent>(\"tiles\");\n spxClick = output<string>();\n navItems = signal<SpxNavigationItemI[]>([]);\n menuItemsSubscription: Subscription | null = null;\n \n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.menuItemsSubscription = this.appStore.select(spxNavigationReducer.selectMenuItems).subscribe((items) => {\n this.navItems.set(items);\n });\n }\n\n ngOnDestroy() {\n this.menuItemsSubscription?.unsubscribe();\n }\n\n setFocus(): void {\n this.tiles()[0]?.setFocus();\n }\n\n onNavigate(link: string) {\n this.spxClick.emit(link);\n }\n}\n","<spx-home-tiles [spxCols]=\"1\">\n @if (spxOverwriteNavItems() && spxOverwriteNavItems()?.length) {\n @for (item of spxOverwriteNavItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n @else {\n @for (item of navItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n</spx-home-tiles>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.initialize","actions.update","actions.addPages","spxNavigationReducer"],"mappings":";;;;;;;;;;;MAQa,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAQ,CAAC,mDAAC;AACnC,IAAA;8GAFY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,oNCRlC,gLAE8E,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDMjE,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,eAAA,EAEC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,gLAAA,EAAA;;;MEMpC,oBAAoB,CAAA;AATjC,IAAA,WAAA,GAAA;QAUW,IAAA,CAAA,YAAY,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA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,CAAA,cAAA,EAAA,UAAA,EAAA,aAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAFpB,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKR,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EAEjB;wBACP,eAAe;wBACf,iBAAiB;wBACjB,iBAAiB;wBACjB,qBAAqB;wBACrB;AACD,qBAAA,EAAA,QAAA,EAAA,ssCAAA,EAAA;0OAI0C,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;;;AEzBpD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-navigation.mjs","sources":["../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tiles.component.html","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.ts","../../../../projects/softpak/components/spx-navigation/spx-home-tile/spx-home-tile.component.html","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.initial.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.actions.ts","../../../../projects/softpak/components/spx-navigation/store/spx-navigation/spx-navigation.reducer.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.ts","../../../../projects/softpak/components/spx-navigation/spx-navigation.component.html","../../../../projects/softpak/components/spx-navigation/softpak-components-spx-navigation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tiles',\n standalone: true,\n templateUrl: './spx-home-tiles.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTilesComponent {\n readonly spxCols = input<1 | 2>(2);\n}\n","<div class=\"mx-auto max-w-lg grid gap-3\"\n [class.grid-cols-1]=\"this.spxCols() === 1\"\n [class.grid-cols-2]=\"this.spxCols() === 2\"><ng-content></ng-content></div>","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ElementRef, input, viewChild } from '@angular/core';\n\n@Component({\n selector: 'spx-home-tile',\n imports: [\n NgClass\n ],\n templateUrl: './spx-home-tile.component.html',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxHomeTileComponent {\n readonly spxAutofocus = input<boolean>();\n readonly spxClass = input<string>();\n readonly spxSubtitle = input<string>();\n readonly spxTitle = input<string>();\n private buttonRef = viewChild<ElementRef<HTMLButtonElement>>('button');\n\n setFocus(): void {\n this.buttonRef()?.nativeElement.focus();\n }\n}\n","<button #button\n class=\"border border-transparent flex flex-col w-full px-4 py-2 relative rounded text-center focus:outline-none focus:ring-2 focus:ring-offset-2\"\n type=\"button\"\n part=\"button\"\n [attr.autofocus]=\"this.spxAutofocus() ? this.spxAutofocus() : undefined\"\n [class.bg-blue-600]=\"!this.spxClass()\"\n [class.focus:ring-blue-500]=\"!this.spxClass()\"\n [class.hover:bg-blue-800]=\"!this.spxClass()\"\n [class.text-white]=\"!this.spxClass()\"\n [ngClass]=\"this.spxClass() ? this.spxClass() : undefined\">\n <div class=\"flex gap-5 items-center\">\n <div class=\"fal my-2 self-center text-xl w-5\"><ng-content></ng-content></div>\n <div class=\"grow flex flex-col text-left\">\n <div class=\"text-lg font-bold text-ellipsis overflow-hidden\">{{ this.spxTitle() }}</div>\n @if (this.spxSubtitle()) {\n <div class=\"text-sm opacity-70 text-ellipsis overflow-hidden\">{{ this.spxSubtitle() }}</div>\n }\n </div>\n </div>\n </button>","import { StateI } from \"./spx-navigation.state\";\n\nexport const initialState: StateI = {\n accessList: [],\n navigationItems: [],\n menuItems: [],\n signedIn: false,\n tabs: [],\n};\n","import { createActionGroup, props } from '@ngrx/store';\n\nimport { SpxNavigationItemI } from '../../spx-navigation-item.interface';\n\nexport const spxNavigationActions = createActionGroup({\n source: 'SpxNavigation',\n events: {\n AddPages: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Initialize: props<{ navigationItems: SpxNavigationItemI[]; }>(),\n Update: props<{ accessList: string[]; signedIn: boolean; }>(),\n },\n});","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { StateI } from './spx-navigation.state';\nimport { initialState } from './spx-navigation.initial';\nimport { spxNavigationActions } from './spx-navigation.actions';\n\nexport default createFeature({\n name: 'spxNavigation',\n reducer: createReducer(\n initialState,\n on(spxNavigationActions.initialize, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: navigationItems,\n menuItems: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && (navigationItem.hasTile === undefined || navigationItem.hasTile)),\n tabs: navigationItems.slice().filter(navigationItem => !navigationItem.signInRequired && navigationItem.hasTab),\n })),\n on(spxNavigationActions.update, (state: StateI, { accessList, signedIn }): StateI => ({\n ...state,\n accessList,\n menuItems: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n signedIn,\n tabs: state.navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || accessList.includes(item.accessKey)),\n })),\n on(spxNavigationActions.addPages, (state: StateI, { navigationItems }): StateI => ({\n ...state,\n navigationItems: [...state.navigationItems.slice(), ...navigationItems],\n menuItems: [...state.menuItems.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem?.hasTile !== false).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n tabs: [...state.tabs.slice(), ...navigationItems.slice().filter(navigationItem => (!navigationItem.signInRequired || state.signedIn) && navigationItem.hasTab).filter(item => item.accessKey === undefined || state.accessList.includes(item.accessKey))],\n })),\n ),\n});\n","import { Component, input, OnDestroy, OnInit, output, signal, viewChildren } from '@angular/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { SpxHomeTilesComponent } from './spx-home-tile/spx-home-tiles.component';\nimport { SpxHomeTileComponent } from './spx-home-tile/spx-home-tile.component';\nimport { Store } from '@ngrx/store';\nimport spxNavigationReducer from './store/spx-navigation/spx-navigation.reducer';\nimport { AsyncPipe } from '@angular/common';\nimport { SpxNavigationItemI } from './spx-navigation-item.interface';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'spx-navigation',\n templateUrl: './spx-navigation.component.html',\n imports: [\n TranslateModule,\n FontAwesomeModule,\n SpxCapitalizePipe,\n SpxHomeTilesComponent,\n SpxHomeTileComponent\n ]\n})\nexport class SpxNavigationComponent implements OnInit, OnDestroy {\n readonly spxOverwriteNavItems = input<SpxNavigationItemI[]>();\n tiles = viewChildren<SpxHomeTileComponent>(\"tiles\");\n spxClick = output<string>();\n navItems = signal<SpxNavigationItemI[]>([]);\n menuItemsSubscription: Subscription | null = null;\n \n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.menuItemsSubscription = this.appStore.select(spxNavigationReducer.selectMenuItems).subscribe((items) => {\n this.navItems.set(items);\n });\n }\n\n ngOnDestroy() {\n this.menuItemsSubscription?.unsubscribe();\n }\n\n setFocus(): void {\n this.tiles()[0]?.setFocus();\n }\n\n onNavigate(link: string) {\n this.spxClick.emit(link);\n }\n}\n","<spx-home-tiles [spxCols]=\"1\">\n @if (spxOverwriteNavItems() && spxOverwriteNavItems()?.length) {\n @for (item of spxOverwriteNavItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n @else {\n @for (item of navItems(); track item; let i = $index) {\n <spx-home-tile #tiles (click)=\"item.onClick ? item.onClick() : (item.routerLink ? onNavigate(item.routerLink) : null)\"\n [spxAutofocus]=\"i === 0\"\n [spxClass]=\"item.tileClasses ? item.tileClasses : undefined\"\n [spxTitle]=\"item.title | translate | capitalize\"\n [spxSubtitle]=\"item.subtite ? (item.subtite | translate | capitalize) : undefined\">\n <fa-icon [icon]=\"item.icon\"></fa-icon>\n </spx-home-tile>\n }\n }\n</spx-home-tiles>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxNavigationReducer"],"mappings":";;;;;;;;;;;MAQa,qBAAqB,CAAA;AANlC,IAAA,WAAA,GAAA;AAOW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAQ,CAAC,mDAAC;AACnC,IAAA;8GAFY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,oNCRlC,gLAE8E,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDMjE,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAN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,EAAA,iBAAA,EAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAEjB,qBAAqB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACrB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,UAAA,EAAA,aAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAFpB,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKR,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EAEjB;wBACP,eAAe;wBACf,iBAAiB;wBACjB,iBAAiB;wBACjB,qBAAqB;wBACrB;AACD,qBAAA,EAAA,QAAA,EAAA,ssCAAA,EAAA;0OAI0C,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;;;;;AEzBpD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, Component } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { createActionGroup, props, emptyProps, createFeature, createReducer, on } from '@ngrx/store';
|
|
4
4
|
|
|
5
5
|
class SpxSpinnerComponent {
|
|
6
6
|
constructor() {
|
|
@@ -15,19 +15,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
15
15
|
args: [{ selector: 'spx-spinner', imports: [], template: "<div class=\"spx-spinner__wrapper spx-spinner2\"\n [class.is-shown]=\"this.spxShow()\">\n <div class=\"rounded-xl bg-white text-black absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[150px] h-[150px]\">\n <div class=\"spx-spinner__content\">\n <svg class=\"spx-spinner__image m-auto\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100px\" height=\"100px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n <g transform=\"rotate(0 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.9166666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(30 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.8333333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(60 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.75s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(90 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.6666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(120 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5833333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(150 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(180 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.4166666666666667s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(210 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.3333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(240 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.25s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(270 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.16666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(300 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.08333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(330 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"0s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n </svg>\n @if (this.spxLoaderText()) {\n <span class=\"text-black pb-2 block text-center\">{{this.spxLoaderText()}}</span>\n }\n </div>\n </div>\n </div>", styles: [":host{background-color:#00000059;color:#000;position:fixed;height:100%;inset:0;z-index:9}.is-shown{display:block!important;opacity:1;animation:fadeIn .2s forwards,fadeOut .2s forwards}.spx-spinner__wrapper{display:none;position:absolute;right:0;left:0;margin:0 auto;text-align:center;opacity:0;z-index:500000}.spx-spinner__wrapper.spx-spinner1{top:calc(50vh - 25px);width:200px;height:50px}.spx-spinner1 .spx-spinner__ball{display:inline-block;width:50px;height:50px;border-radius:100%;background-color:#0065a4;animation:bouncedelay 1.4s infinite ease-in-out both}.spx-spinner1 .spx-spinner__ball--1{animation-delay:-.32s}.spx-spinner1 .spx-spinner__ball--2{animation-delay:-.16s}.spx-spinner__wrapper.spx-spinner2{top:calc(50vh - 65px);width:100%;max-width:120px}.spx-spinner2 .spx-spinner__content{box-shadow:0 19px 38px #0000004d,0 15px 12px #00000038;border-radius:10px;height:100%;width:100%;margin:0 auto;animation:.2s fadeIn forwards;overflow:hidden}.spx-spinner2 .spx-spinner__image{display:block;margin:0 auto;border-radius:10px}.spx-spinner2 svg{margin:auto;background:#fff;display:block;shape-rendering:auto}.spx-spinner__wrapper.spx-spinner3{top:calc(50vh - 30px)}.spx-spinner3 .spx-spinner__box{animation:loader-rotate 2s infinite linear;display:block;width:60px;height:60px;margin:0 auto}.spx-spinner3 .spx-spinner__dot{animation:dot-bounce 2s infinite ease-in-out;display:inline-block;position:relative;top:0;width:50%;height:50%;border-radius:100%;background-color:#555}.spx-spinner3 .spx-spinner__dot--2{top:auto;bottom:0;animation-delay:-1s}@keyframes loader-rotate{to{transform:rotate(360deg)}}@keyframes dot-bounce{0%,to{transform:scale(0)}50%{transform:scale(1)}}@keyframes fadeIn{0%{opacity:0}30%{opacity:.4}to{opacity:1}}@keyframes bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}\n"] }]
|
|
16
16
|
}], propDecorators: { spxShow: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxShow", required: false }] }], spxLoaderText: [{ type: i0.Input, args: [{ isSignal: true, alias: "spxLoaderText", required: true }] }] } });
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var spxSpinner_actions = /*#__PURE__*/Object.freeze({
|
|
27
|
-
__proto__: null,
|
|
28
|
-
hide: hide,
|
|
29
|
-
reset: reset,
|
|
30
|
-
show: show
|
|
18
|
+
const spxSpinnerActions = createActionGroup({
|
|
19
|
+
source: 'SpxSpinner',
|
|
20
|
+
events: {
|
|
21
|
+
Hide: props(),
|
|
22
|
+
Reset: emptyProps(),
|
|
23
|
+
Show: props(),
|
|
24
|
+
},
|
|
31
25
|
});
|
|
32
26
|
|
|
33
27
|
const initialState = {
|
|
@@ -43,7 +37,7 @@ var spxSpinner_initial = /*#__PURE__*/Object.freeze({
|
|
|
43
37
|
|
|
44
38
|
var spxSpinner_reducer = createFeature({
|
|
45
39
|
name: 'spxSpinner',
|
|
46
|
-
reducer: createReducer(initialState, on(hide, (state, { action }) => {
|
|
40
|
+
reducer: createReducer(initialState, on(spxSpinnerActions.hide, (state, { action }) => {
|
|
47
41
|
const loadActions = action ? [...state.loadActions.filter(a => { console.log(a, action); return a !== action; })] : state.loadActions;
|
|
48
42
|
const nrOfLoadActions = !action ? state.nrOfLoadActions : (state.nrOfLoadActions > 1 ? state.nrOfLoadActions - 1 : 0);
|
|
49
43
|
return {
|
|
@@ -52,14 +46,14 @@ var spxSpinner_reducer = createFeature({
|
|
|
52
46
|
nrOfLoadActions,
|
|
53
47
|
show: loadActions.length >= 1 || nrOfLoadActions > 1 ? true : false,
|
|
54
48
|
};
|
|
55
|
-
}), on(reset, (state) => {
|
|
49
|
+
}), on(spxSpinnerActions.reset, (state) => {
|
|
56
50
|
return {
|
|
57
51
|
...state,
|
|
58
52
|
show: false,
|
|
59
53
|
loadActions: [],
|
|
60
54
|
nrOfLoadActions: 0,
|
|
61
55
|
};
|
|
62
|
-
}), on(show, (state, { action }) => {
|
|
56
|
+
}), on(spxSpinnerActions.show, (state, { action }) => {
|
|
63
57
|
return {
|
|
64
58
|
...state,
|
|
65
59
|
show: true,
|
|
@@ -82,5 +76,5 @@ var spxSpinner_state = /*#__PURE__*/Object.freeze({
|
|
|
82
76
|
* Generated bundle index. Do not edit.
|
|
83
77
|
*/
|
|
84
78
|
|
|
85
|
-
export { SpxSpinnerComponent,
|
|
79
|
+
export { SpxSpinnerComponent, spxSpinnerActions, spxSpinner_initial as spxSpinnerInitial, spxSpinner_reducer$1 as spxSpinnerReducer, spxSpinner_state as spxSpinnerState };
|
|
86
80
|
//# sourceMappingURL=softpak-components-spx-spinner.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-spinner.mjs","sources":["../../../../projects/softpak/components/spx-spinner/spx-spinner.component.ts","../../../../projects/softpak/components/spx-spinner/spx-spinner.component.html","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.actions.ts","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.initial.ts","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.reducer.ts","../../../../projects/softpak/components/spx-spinner/softpak-components-spx-spinner.ts"],"sourcesContent":["\nimport { Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-spinner',\n imports: [],\n templateUrl: './spx-spinner.component.html',\n styleUrl: './spx-spinner.component.scss',\n})\nexport class SpxSpinnerComponent {\n readonly spxShow = input<boolean>(true);\n readonly spxLoaderText = input.required<string>();\n}\n","<div class=\"spx-spinner__wrapper spx-spinner2\"\n [class.is-shown]=\"this.spxShow()\">\n <div class=\"rounded-xl bg-white text-black absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[150px] h-[150px]\">\n <div class=\"spx-spinner__content\">\n <svg class=\"spx-spinner__image m-auto\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100px\" height=\"100px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n <g transform=\"rotate(0 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.9166666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(30 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.8333333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(60 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.75s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(90 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.6666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(120 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5833333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(150 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(180 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.4166666666666667s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(210 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.3333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(240 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.25s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(270 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.16666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(300 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.08333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(330 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"0s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n </svg>\n @if (this.spxLoaderText()) {\n <span class=\"text-black pb-2 block text-center\">{{this.spxLoaderText()}}</span>\n }\n </div>\n </div>\n </div>","import { createAction, props, union } from '@ngrx/store';\n\nexport const hide = createAction('[SPX / Spinner] Hide', props<{ action: string; }>());\nexport const reset = createAction('[SPX / Spinner] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[SPX / Spinner] Show', props<{ action: string; }>());\n\nconst all = union({\n hide,\n show,\n});\n\nexport type Actions = typeof all;\n","import { StateI } from \"./spx-spinner.state\";\n\nexport const initialState: StateI = {\n loadActions: [],\n nrOfLoadActions: 0,\n show: false,\n};\n","import * as actions from './spx-spinner.actions';\n\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { StateI } from './spx-spinner.state';\nimport { initialState } from './spx-spinner.initial';\n\nexport default createFeature({\n name: 'spxSpinner',\n reducer: createReducer(\n initialState,\n on(actions.hide, (state: StateI, { action }): StateI => {\n const loadActions = action ? [...state.loadActions.filter(a => { console.log(a, action); return a !== action; })] : state.loadActions;\n const nrOfLoadActions = !action ? state.nrOfLoadActions : (state.nrOfLoadActions > 1 ? state.nrOfLoadActions - 1 : 0);\n return {\n ...state,\n loadActions,\n nrOfLoadActions,\n show: loadActions.length >= 1 || nrOfLoadActions > 1 ? true : false,\n };\n }),\n on(actions.reset, (state: StateI): StateI => {\n return {\n ...state,\n show: false,\n loadActions: [],\n nrOfLoadActions: 0,\n };\n }),\n on(actions.show, (state: StateI, { action }): StateI => {\n return {\n ...state,\n show: true,\n loadActions: action ? (state.loadActions.find(a => a === action) ? state.loadActions : [...state.loadActions, action]) : state.loadActions,\n nrOfLoadActions: action ? state.nrOfLoadActions : (state.nrOfLoadActions + 1),\n };\n }),\n ),\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.hide","actions.reset","actions.show"],"mappings":";;;;MASa,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;AAOW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,IAAI,mDAAC;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDAAU;AAClD,IAAA;8GAHY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,gWCThC,kuJAuEQ,EAAA,MAAA,EAAA,CAAA,gyDAAA,CAAA,EAAA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AAK;YACR,WAAW;YACX,eAAe;AACf,YAAA,IAAI,EAAE,WAAW,CAAC,MAAM,IAAI,CAAC,IAAI,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,KAAK;SACtE;IACL,CAAC,CAAC,EACF,EAAE,CAACC,KAAa,EAAE,CAAC,KAAa,KAAY;QACxC,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,IAAI,EAAE,KAAK;AACX,YAAA,WAAW,EAAE,EAAE;AACf,YAAA,eAAe,EAAE,CAAC;SACrB;AACL,IAAA,CAAC,CAAC,EACF,EAAE,CAACC,IAAY,EAAE,CAAC,KAAa,EAAE,EAAE,MAAM,EAAE,KAAY;QACnD,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,WAAW,EAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW;AAC1I,YAAA,eAAe,EAAE,MAAM,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC;SAChF;AACL,IAAA,CAAC,CAAC,CACL;AACJ,CAAA,CAAC;;;;;;;;;;;ACtCF;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-spinner.mjs","sources":["../../../../projects/softpak/components/spx-spinner/spx-spinner.component.ts","../../../../projects/softpak/components/spx-spinner/spx-spinner.component.html","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.actions.ts","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.initial.ts","../../../../projects/softpak/components/spx-spinner/store/spx-spinner/spx-spinner.reducer.ts","../../../../projects/softpak/components/spx-spinner/softpak-components-spx-spinner.ts"],"sourcesContent":["\nimport { Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-spinner',\n imports: [],\n templateUrl: './spx-spinner.component.html',\n styleUrl: './spx-spinner.component.scss',\n})\nexport class SpxSpinnerComponent {\n readonly spxShow = input<boolean>(true);\n readonly spxLoaderText = input.required<string>();\n}\n","<div class=\"spx-spinner__wrapper spx-spinner2\"\n [class.is-shown]=\"this.spxShow()\">\n <div class=\"rounded-xl bg-white text-black absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-[150px] h-[150px]\">\n <div class=\"spx-spinner__content\">\n <svg class=\"spx-spinner__image m-auto\" xmlns=\"http://www.w3.org/2000/svg\" width=\"100px\" height=\"100px\" viewBox=\"0 0 100 100\" preserveAspectRatio=\"xMidYMid\">\n <g transform=\"rotate(0 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.9166666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(30 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.8333333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(60 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.75s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(90 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.6666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(120 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5833333333333334s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(150 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.5s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(180 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.4166666666666667s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(210 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.3333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(240 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.25s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(270 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.16666666666666666s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(300 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"-0.08333333333333333s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n <g transform=\"rotate(330 50 50)\">\n <rect x=\"47.5\" y=\"23.5\" rx=\"2.5\" ry=\"2.75\" width=\"5\" height=\"11\" fill=\"#00457c\">\n <animate attributeName=\"opacity\" values=\"1;0\" keyTimes=\"0;1\" dur=\"1s\" begin=\"0s\" repeatCount=\"indefinite\"></animate>\n </rect>\n </g>\n </svg>\n @if (this.spxLoaderText()) {\n <span class=\"text-black pb-2 block text-center\">{{this.spxLoaderText()}}</span>\n }\n </div>\n </div>\n </div>","import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nexport const spxSpinnerActions = createActionGroup({\n source: 'SpxSpinner',\n events: {\n Hide: props<{ action: string; }>(),\n Reset: emptyProps(),\n Show: props<{ action: string; }>(),\n },\n});\n","import { StateI } from \"./spx-spinner.state\";\n\nexport const initialState: StateI = {\n loadActions: [],\n nrOfLoadActions: 0,\n show: false,\n};\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { StateI } from './spx-spinner.state';\nimport { initialState } from './spx-spinner.initial';\nimport { spxSpinnerActions } from './spx-spinner.actions';\n\nexport default createFeature({\n name: 'spxSpinner',\n reducer: createReducer(\n initialState,\n on(spxSpinnerActions.hide, (state: StateI, { action }): StateI => {\n const loadActions = action ? [...state.loadActions.filter(a => { console.log(a, action); return a !== action; })] : state.loadActions;\n const nrOfLoadActions = !action ? state.nrOfLoadActions : (state.nrOfLoadActions > 1 ? state.nrOfLoadActions - 1 : 0);\n return {\n ...state,\n loadActions,\n nrOfLoadActions,\n show: loadActions.length >= 1 || nrOfLoadActions > 1 ? true : false,\n };\n }),\n on(spxSpinnerActions.reset, (state: StateI): StateI => {\n return {\n ...state,\n show: false,\n loadActions: [],\n nrOfLoadActions: 0,\n };\n }),\n on(spxSpinnerActions.show, (state: StateI, { action }): StateI => {\n return {\n ...state,\n show: true,\n loadActions: action ? (state.loadActions.find(a => a === action) ? state.loadActions : [...state.loadActions, action]) : state.loadActions,\n nrOfLoadActions: action ? state.nrOfLoadActions : (state.nrOfLoadActions + 1),\n };\n }),\n ),\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MASa,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;AAOW,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAU,IAAI,mDAAC;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDAAU;AAClD,IAAA;8GAHY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,gWCThC,kuJAuEQ,EAAA,MAAA,EAAA,CAAA,gyDAAA,CAAA,EAAA,CAAA,CAAA;;2FD9DK,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,WACd,EAAE,EAAA,QAAA,EAAA,kuJAAA,EAAA,MAAA,EAAA,CAAA,gyDAAA,CAAA,EAAA;;;AEHR,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AACjD,IAAA,MA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SACrB;AACL,IAAA,CAAC,CAAC,EACF,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,MAAM,EAAE,KAAY;QAC7D,OAAO;AACH,YAAA,GAAG,KAAK;AACR,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,WAAW,EAAE,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW;AAC1I,YAAA,eAAe,EAAE,MAAM,GAAG,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC;SAChF;AACL,IAAA,CAAC,CAAC,CACL;AACJ,CAAA,CAAC;;;;;;;;;;;ACrCF;;AAEG;;;;"}
|
|
@@ -17,6 +17,7 @@ var SpxStorageKeyEnum;
|
|
|
17
17
|
SpxStorageKeyEnum["release"] = "release";
|
|
18
18
|
SpxStorageKeyEnum["patch"] = "patch";
|
|
19
19
|
SpxStorageKeyEnum["username"] = "username";
|
|
20
|
+
SpxStorageKeyEnum["noHaptics"] = "noHaptics";
|
|
20
21
|
})(SpxStorageKeyEnum || (SpxStorageKeyEnum = {}));
|
|
21
22
|
;
|
|
22
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-storage.mjs","sources":["../../../../projects/softpak/components/spx-storage/src/spx-storage-key.enum.ts","../../../../projects/softpak/components/spx-storage/src/spx-storage.class.ts","../../../../projects/softpak/components/spx-storage/softpak-components-spx-storage.ts"],"sourcesContent":["export enum SpxStorageKeyEnum {\n afterSignIn = 'afterSignIn',\n brand = 'brand',\n binaryVersionGroup = 'binaryVersionGroup',\n bundleVersion = 'bundleVersion',\n lastBinaryVersionGroup = 'lastBinaryVersionGroup',\n channelType = 'channelType',\n channelSettings = 'companySettings',\n liveUpdate = 'liveUpdate',\n liveUpdateChannel = 'liveUpdateChannel',\n platform = 'platform',\n platformVersion = 'platformVersion',\n token = 'token',\n updateInProgress = 'updateInProgress',\n randomDeviceId = 'randomDeviceId',\n release = 'release',\n patch = 'patch',\n username = 'username',\n};\n","import { SpxStorageKeyEnum } from './spx-storage-key.enum';\n\nexport class SpxStorage {\n private static get channelId() {\n return `${this.getSetting(SpxStorageKeyEnum.brand)?.toUpperCase()}_${this.getSetting(SpxStorageKeyEnum.channelType)?.toUpperCase()}`;\n }\n\n public static clearSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): void {\n localStorage.removeItem(key as string);\n }\n\n public static getSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | null {\n return localStorage.getItem(key as string);\n }\n\n public static setSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: string): void {\n localStorage.setItem(key as string, settingValue);\n }\n\n public static getChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | undefined {\n let storageObj;\n const storageObjStr = localStorage.getItem(SpxStorageKeyEnum.channelSettings);\n\n if (storageObjStr) {\n storageObj = JSON.parse(storageObjStr);\n if (!storageObj[this.channelId]) {\n return undefined;\n }\n return storageObj[this.channelId][key];\n } else {\n return undefined;\n }\n }\n\n public static setChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: any): void {\n const companySettings = this.getSetting(SpxStorageKeyEnum.channelSettings);\n let storageObj;\n\n if (companySettings) {\n storageObj = JSON.parse(companySettings);\n } else {\n storageObj = {};\n }\n\n if (!storageObj[this.channelId]) {\n storageObj[this.channelId] = {};\n }\n\n storageObj[this.channelId][key] = settingValue;\n this.setSetting(SpxStorageKeyEnum.channelSettings, JSON.stringify(storageObj));\n }\n}\n\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,oBAAA,CAAA,GAAA,oBAAyC;AACzC,IAAA,iBAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,iBAAA,CAAA,wBAAA,CAAA,GAAA,wBAAiD;AACjD,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,iBAAA,CAAA,mBAAA,CAAA,GAAA,mBAAuC;AACvC,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrC,IAAA,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-storage.mjs","sources":["../../../../projects/softpak/components/spx-storage/src/spx-storage-key.enum.ts","../../../../projects/softpak/components/spx-storage/src/spx-storage.class.ts","../../../../projects/softpak/components/spx-storage/softpak-components-spx-storage.ts"],"sourcesContent":["export enum SpxStorageKeyEnum {\n afterSignIn = 'afterSignIn',\n brand = 'brand',\n binaryVersionGroup = 'binaryVersionGroup',\n bundleVersion = 'bundleVersion',\n lastBinaryVersionGroup = 'lastBinaryVersionGroup',\n channelType = 'channelType',\n channelSettings = 'companySettings',\n liveUpdate = 'liveUpdate',\n liveUpdateChannel = 'liveUpdateChannel',\n platform = 'platform',\n platformVersion = 'platformVersion',\n token = 'token',\n updateInProgress = 'updateInProgress',\n randomDeviceId = 'randomDeviceId',\n release = 'release',\n patch = 'patch',\n username = 'username',\n noHaptics = 'noHaptics',\n};\n","import { SpxStorageKeyEnum } from './spx-storage-key.enum';\n\nexport class SpxStorage {\n private static get channelId() {\n return `${this.getSetting(SpxStorageKeyEnum.brand)?.toUpperCase()}_${this.getSetting(SpxStorageKeyEnum.channelType)?.toUpperCase()}`;\n }\n\n public static clearSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): void {\n localStorage.removeItem(key as string);\n }\n\n public static getSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | null {\n return localStorage.getItem(key as string);\n }\n\n public static setSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: string): void {\n localStorage.setItem(key as string, settingValue);\n }\n\n public static getChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | undefined {\n let storageObj;\n const storageObjStr = localStorage.getItem(SpxStorageKeyEnum.channelSettings);\n\n if (storageObjStr) {\n storageObj = JSON.parse(storageObjStr);\n if (!storageObj[this.channelId]) {\n return undefined;\n }\n return storageObj[this.channelId][key];\n } else {\n return undefined;\n }\n }\n\n public static setChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: any): void {\n const companySettings = this.getSetting(SpxStorageKeyEnum.channelSettings);\n let storageObj;\n\n if (companySettings) {\n storageObj = JSON.parse(companySettings);\n } else {\n storageObj = {};\n }\n\n if (!storageObj[this.channelId]) {\n storageObj[this.channelId] = {};\n }\n\n storageObj[this.channelId][key] = settingValue;\n this.setSetting(SpxStorageKeyEnum.channelSettings, JSON.stringify(storageObj));\n }\n}\n\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBA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,CAAC,UAAU,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClF;AACH;;ACnDD;;AAEG;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, viewChild, HostListener, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { SpxHaptics } from '@softpak/components/spx-haptics';
|
|
3
4
|
|
|
4
5
|
class SpxSuggestionComponent {
|
|
5
6
|
constructor() {
|
|
@@ -7,40 +8,25 @@ class SpxSuggestionComponent {
|
|
|
7
8
|
this.spxFocused = input(...(ngDevMode ? [undefined, { debugName: "spxFocused" }] : []));
|
|
8
9
|
this.spxSelected = input(...(ngDevMode ? [undefined, { debugName: "spxSelected" }] : []));
|
|
9
10
|
this.spxTabbable = input(...(ngDevMode ? [undefined, { debugName: "spxTabbable" }] : []));
|
|
10
|
-
this.isPressing = false;
|
|
11
11
|
this.suggestionRef = viewChild('suggestionRef', ...(ngDevMode ? [{ debugName: "suggestionRef" }] : []));
|
|
12
|
+
this.spxHaptics = new SpxHaptics();
|
|
13
|
+
// For haptics
|
|
12
14
|
this.handlePress = async () => {
|
|
13
|
-
this.
|
|
14
|
-
|
|
15
|
-
// await Haptics.impact({ style: ImpactStyle.Light });
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
// silence if haptics is not available
|
|
15
|
+
if (this.spxDisabled()) {
|
|
16
|
+
return;
|
|
19
17
|
}
|
|
18
|
+
this.spxHaptics.pressDown();
|
|
20
19
|
};
|
|
21
20
|
this.onDocumentPointerUp = async (event) => {
|
|
22
|
-
if (
|
|
21
|
+
if (this.spxDisabled()) {
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
|
-
this.isPressing = false;
|
|
26
24
|
const btn = this.suggestionRef()?.nativeElement;
|
|
27
25
|
if (!btn) {
|
|
28
26
|
return;
|
|
29
27
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
if (inside) {
|
|
33
|
-
// OK haptic
|
|
34
|
-
// await Haptics.impact({ style: ImpactStyle.Medium });
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
// Cancel haptic
|
|
38
|
-
// await Haptics.impact({ style: ImpactStyle.Light });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
// ignore
|
|
43
|
-
}
|
|
28
|
+
const wasInsideElement = btn.contains(event.target);
|
|
29
|
+
this.spxHaptics.pointerUp(wasInsideElement);
|
|
44
30
|
};
|
|
45
31
|
}
|
|
46
32
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: SpxSuggestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\nimport {
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-suggestion.mjs","sources":["../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.ts","../../../../projects/softpak/components/spx-suggestion/spx-suggestion.component.html","../../../../projects/softpak/components/spx-suggestion/softpak-components-spx-suggestion.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostListener, input, viewChild } from '@angular/core';\n\nimport { SpxHaptics } from '@softpak/components/spx-haptics';\n\n@Component({\n selector: 'spx-suggestion',\n standalone: true,\n templateUrl: './spx-suggestion.component.html',\n styleUrl: './spx-suggestion.component.css',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SpxSuggestionComponent {\n spxDisabled = input<boolean>();\n spxFocused = input<boolean>();\n spxSelected = input<boolean>();\n spxTabbable = input<boolean>();\n suggestionRef = viewChild<ElementRef<HTMLButtonElement>>('suggestionRef');\n private spxHaptics: SpxHaptics = new SpxHaptics();\n\n // For haptics\n handlePress = async () => {\n if (this.spxDisabled()) {\n return;\n }\n this.spxHaptics.pressDown();\n };\n\n @HostListener('document:pointerup', ['$event'])\n onDocumentPointerUp = async (event: PointerEvent) => {\n if (this.spxDisabled()) {\n return;\n }\n\n const btn = this.suggestionRef()?.nativeElement;\n if (!btn) {\n return;\n }\n\n const wasInsideElement = btn.contains(event.target as Node);\n this.spxHaptics.pointerUp(wasInsideElement);\n };\n // End haptics\n}\n","<button\n #suggestionRef\n type=\"button\"\n class=\"spx-suggestion block rounded text-gray-900 text-sm p-3 w-full text-left truncate outline-none\"\n [class.bg-sky-100]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.focus:ring-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.hover:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.active:bg-sky-300]=\"!this.spxSelected() && !this.spxDisabled()\"\n [class.bg-gray-200]=\"this.spxDisabled() && !this.spxSelected()\"\n [class.bg-gray-400]=\"this.spxDisabled() && this.spxSelected()\"\n [class.cursor-not-allowed]=\"this.spxDisabled()\"\n [class.opacity-60]=\"this.spxDisabled()\"\n [class.bg-gradient-to-r]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.from-teal-400]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.to-teal-600]=\"this.spxSelected() && !this.spxDisabled()\"\n [class.font-bold]=\"this.spxSelected()\"\n [attr.tabindex]=\"this.spxTabbable() && !this.spxDisabled() ? 0 : -1\"\n [class.ring-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-offset-2]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n [class.ring-blue-500]=\"this.spxFocused() && this.spxTabbable() && !this.spxDisabled()\"\n (pointerdown)=\"this.handlePress()\">\n <div class=\"text-ellipsis overflow-hidden whitespace-nowrap\"><ng-content></ng-content></div>\n </button>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAWa,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;QAQE,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,UAAU,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC7B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC9B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,SAAS,CAAgC,eAAe,yDAAC;AACjE,QAAA,IAAA,CAAA,UAAU,GAAe,IAAI,UAAU,EAAE;;QAGjD,IAAA,CAAA,WAAW,GAAG,YAAW;AACvB,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;gBACtB;YACF;AACA,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;AAC7B,QAAA,CAAC;AAGD,QAAA,IAAA,CAAA,mBAAmB,GAAG,OAAO,KAAmB,KAAI;AAClD,YAAA,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;gBACtB;YACF;YAEA,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,aAAa;YAC/C,IAAI,CAAC,GAAG,EAAE;gBACR;YACF;YAEA,MAAM,gBAAgB,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC;AAC3D,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAC7C,QAAA,CAAC;AAEF,IAAA;8GA/BY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,y0BCXnC,s8CAsBW,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDXE,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,eAAA,EAGC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,s8CAAA,EAAA;ieAOU,eAAe,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA;sBAWvE,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AE3BhD;;AAEG;;;;"}
|
|
@@ -7,16 +7,13 @@ import { unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
|
|
|
7
7
|
import { spxNavigationReducer } from '@softpak/components/spx-navigation';
|
|
8
8
|
import { NgClass } from '@angular/common';
|
|
9
9
|
import * as i1 from '@ngrx/store';
|
|
10
|
-
import {
|
|
10
|
+
import { createActionGroup, props, createFeature, createReducer, on } from '@ngrx/store';
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var spxShortcuts_actions = /*#__PURE__*/Object.freeze({
|
|
18
|
-
__proto__: null,
|
|
19
|
-
ctrl: ctrl
|
|
12
|
+
const spxShortcutsActions = createActionGroup({
|
|
13
|
+
source: 'SpxShortcuts',
|
|
14
|
+
events: {
|
|
15
|
+
Ctrl: props(),
|
|
16
|
+
},
|
|
20
17
|
});
|
|
21
18
|
|
|
22
19
|
const initialState = {
|
|
@@ -24,7 +21,7 @@ const initialState = {
|
|
|
24
21
|
};
|
|
25
22
|
var spxShortCutsReducer$1 = createFeature({
|
|
26
23
|
name: 'spxShortcuts',
|
|
27
|
-
reducer: createReducer(initialState, on(ctrl, (state, { keyIsDown }) => ({
|
|
24
|
+
reducer: createReducer(initialState, on(spxShortcutsActions.ctrl, (state, { keyIsDown }) => ({
|
|
28
25
|
...state,
|
|
29
26
|
ctrlIsDown: keyIsDown,
|
|
30
27
|
})))
|
|
@@ -86,5 +83,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
86
83
|
* Generated bundle index. Do not edit.
|
|
87
84
|
*/
|
|
88
85
|
|
|
89
|
-
export { SpxTabsComponent,
|
|
86
|
+
export { SpxTabsComponent, spxShortcuts_reducer as spxShortCutsReducer, spxShortcutsActions };
|
|
90
87
|
//# sourceMappingURL=softpak-components-spx-tabs.mjs.map
|