@softpak/components 21.0.5 → 21.0.6

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.
@@ -7,7 +7,7 @@ import { Capacitor } from '@capacitor/core';
7
7
  import { NavController } from '@ionic/angular/standalone';
8
8
  import { SpxButtonComponent } from '@softpak/components/spx-button';
9
9
  import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
10
- import { createAction, props, union, createFeature, createReducer, on, Store } from '@ngrx/store';
10
+ import { createActionGroup, props, createFeature, createReducer, on, Store } from '@ngrx/store';
11
11
  import { TranslatePipe } from '@ngx-translate/core';
12
12
  import { map } from 'rxjs';
13
13
  import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
@@ -15,24 +15,19 @@ import { spxTextChange } from '@softpak/components/spx-translate';
15
15
  import { toSignal } from '@angular/core/rxjs-interop';
16
16
  import * as i1 from '@ngrx/effects';
17
17
  import { createEffect, ofType } from '@ngrx/effects';
18
- import { switchMap } from 'rxjs/operators';
19
- import { setConfig } from '@capacitor/live-updates';
20
- import { spxUpdateUrl } from '@softpak/components/spx-update';
21
18
  import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
22
- import { captureMessage } from '@sentry/angular';
23
19
  import { App } from '@capacitor/app';
20
+ import { captureMessage } from '@sentry/angular';
21
+ import { setConfig } from '@capacitor/live-updates';
22
+ import { spxUpdateUrl } from '@softpak/components/spx-update';
23
+ import { switchMap } from 'rxjs/operators';
24
24
 
25
- const choose = createAction('[SPX / Channel] Select', props());
26
- const initialize = createAction('[SPX / Channel] Initialize', props());
27
- const all = union({
28
- choose,
29
- initialize,
30
- });
31
-
32
- var spxChannel_actions = /*#__PURE__*/Object.freeze({
33
- __proto__: null,
34
- choose: choose,
35
- initialize: initialize
25
+ const spxChannelActions = createActionGroup({
26
+ source: 'SpxChannel',
27
+ events: {
28
+ Choose: props(),
29
+ Initialize: props(),
30
+ },
36
31
  });
37
32
 
38
33
  const initialState = {
@@ -68,7 +63,7 @@ const determineActiveChannel = (channels) => {
68
63
  };
69
64
  var spxChannelReducer$1 = createFeature({
70
65
  name: 'spxChannel',
71
- reducer: createReducer(initialState, on(choose, (state, { channel, channelType }) => {
66
+ reducer: createReducer(initialState, on(spxChannelActions.choose, (state, { channel, channelType }) => {
72
67
  SpxStorage.setSetting(SpxStorageKeyEnum.brand, channel?.brand);
73
68
  SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
74
69
  return {
@@ -76,7 +71,7 @@ var spxChannelReducer$1 = createFeature({
76
71
  previousChannel: state.channel,
77
72
  channel,
78
73
  };
79
- }), on(initialize, (state, { channels }) => {
74
+ }), on(spxChannelActions.initialize, (state, { channels }) => {
80
75
  let channelType = null;
81
76
  if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
82
77
  channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) };
@@ -153,7 +148,7 @@ class Effects {
153
148
  this.actions$ = actions$;
154
149
  this.router = router;
155
150
  this.store = inject(Store);
156
- this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(choose), switchMap((action) => {
151
+ this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(spxChannelActions.choose), switchMap((action) => {
157
152
  if (Capacitor.getPlatform() === 'web') {
158
153
  const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType);
159
154
  if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl, '').replace(channelType.oldWebUrl, '').split('/').at(0) !== '') {
@@ -197,5 +192,5 @@ var spxChannel_effects = /*#__PURE__*/Object.freeze({
197
192
  * Generated bundle index. Do not edit.
198
193
  */
199
194
 
200
- export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannel_actions as spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
195
+ export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
201
196
  //# sourceMappingURL=softpak-components-spx-channel-selection.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n}>());\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\n channels: SpxAppChannelI[];\n}>());\n\nconst all = union({\n choose,\n initialize,\n});\n\nexport type Actions = typeof all;\n","\nimport * as actions from './spx-channel.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { Capacitor } from '@capacitor/core';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(actions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n };\n }),\n on(actions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\n\nimport { Capacitor } from '@capacitor/core';\nimport { NavController } from '@ionic/angular/standalone';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { map } from 'rxjs';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { switchMap, withLatestFrom } from 'rxjs/operators';\nimport { inject, Injectable } from '@angular/core';\nimport * as actions from './spx-channel.actions';\nimport { setConfig } from '@capacitor/live-updates';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { captureMessage } from '@sentry/angular';\nimport { App } from '@capacitor/app';\nimport { Store } from '@ngrx/store';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;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components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { createActionGroup, props } from '@ngrx/store';\n\nexport const spxChannelActions = createActionGroup({\n source: 'SpxChannel',\n events: {\n Choose: props<{ channel: SpxAppChannelI; channelType: SpxAppChannelTypeEnum; }>(),\n Initialize: props<{ channels: SpxAppChannelI[]; }>(),\n },\n});\n","import { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { Capacitor } from '@capacitor/core';\nimport { spxChannelActions } from './spx-channel.actions';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(spxChannelActions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n };\n }),\n on(spxChannelActions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\n\nimport { Capacitor } from '@capacitor/core';\nimport { NavController } from '@ionic/angular/standalone';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { map } from 'rxjs';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Injectable, inject } from '@angular/core';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\n\nimport { App } from '@capacitor/app';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { Store } from '@ngrx/store';\nimport { captureMessage } from '@sentry/angular';\nimport { setConfig } from '@capacitor/live-updates';\nimport { spxChannelActions } from './spx-channel.actions';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { switchMap } from 'rxjs/operators';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(spxChannelActions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AACjD,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,MAAM,EAAE;QACN,MAAM,EAAE,KAAK,EAAoE;QACjF,UAAU,EAAE,KAAK,EAAmC;AACrD,KAAA;AACF,CAAA;;ACFM,MAAM,YAAY,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,OAAO,EAAE,CAAA,EAAG,MAAM,CAAC,WAAW,CAAA,CAAA,EAAI,kBAAkB,CAAA,EAAA;AACvD,qBAAA,CAAC;oBACF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,gBAAA,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;oBACb,cAAc,CAAC,CAAA,mBAAA,EAAsB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA,CAAE,CAAC;oBAC3D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,gBAAA,CAAC,CAAC;YACN;AAEA,YAAA,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC;oBACpC,SAAS,EAAE,4BAA4B,CAAC,OAAO;AAC/C,oBAAA,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK;AACrC,iBAAA,CAAC,CAAC;QACP,CAAC,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAK1B;8GAtCK,OAAO,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;ACdD;;AAEG;;;;"}
@@ -5,7 +5,7 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons';
5
5
  import { SpxButtonComponent } from '@softpak/components/spx-button';
6
6
  import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
7
7
  import * as i1 from '@ngrx/store';
8
- import { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
8
+ import { createActionGroup, props, emptyProps, createFeature, createReducer, on } from '@ngrx/store';
9
9
  import * as i1$1 from '@ngrx/effects';
10
10
  import { createEffect, ofType } from '@ngrx/effects';
11
11
  import { withLatestFrom, mergeMap } from 'rxjs/operators';
@@ -55,13 +55,13 @@ class SpxConfirmDisplayerComponent {
55
55
  this.subscriptions?.confirmState?.unsubscribe();
56
56
  }
57
57
  onCancel(id) {
58
- this.appStore.dispatch(answer({
58
+ this.appStore.dispatch(spxConfirmActions.answer({
59
59
  cancel: true,
60
60
  id
61
61
  }));
62
62
  }
63
63
  onConfirm(id) {
64
- this.appStore.dispatch(answer({
64
+ this.appStore.dispatch(spxConfirmActions.answer({
65
65
  confirm: true,
66
66
  id
67
67
  }));
@@ -74,22 +74,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
74
74
  args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}" }]
75
75
  }], ctorParameters: () => [{ type: i1.Store }] });
76
76
 
77
- const answer = createAction('[Confirm] Answer', props());
78
- const reset = createAction('[Confirm] Reset', props());
79
- const show = createAction('[Confirm] Show', props());
80
- const answerConfirm = createAction('[Confirm] Answer Confirm', props());
81
- const all = union({
82
- reset,
83
- show,
84
- answerConfirm,
85
- });
86
-
87
- var spxConfirm_actions = /*#__PURE__*/Object.freeze({
88
- __proto__: null,
89
- answer: answer,
90
- answerConfirm: answerConfirm,
91
- reset: reset,
92
- show: show
77
+ const spxConfirmActions = createActionGroup({
78
+ source: 'SpxConfirm',
79
+ events: {
80
+ Answer: props(),
81
+ AnswerConfirm: props(),
82
+ Reset: emptyProps(),
83
+ Show: props(),
84
+ },
93
85
  });
94
86
 
95
87
  const initialState = {
@@ -97,9 +89,9 @@ const initialState = {
97
89
  };
98
90
  var spxConfirmReducer$1 = createFeature({
99
91
  name: 'spxConfirm',
100
- reducer: createReducer(initialState, on(reset, (state, {}) => ({
92
+ reducer: createReducer(initialState, on(spxConfirmActions.reset, (state, {}) => ({
101
93
  ...state,
102
- })), on(show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
94
+ })), on(spxConfirmActions.show, (state, { content, id, title, noYesButton, onCancel, onOK }) => {
103
95
  const confirms = state.confirms.filter((c) => c.id).length > 0
104
96
  ? state.confirms
105
97
  : [
@@ -117,7 +109,7 @@ var spxConfirmReducer$1 = createFeature({
117
109
  ...state,
118
110
  confirms,
119
111
  };
120
- }), on(answerConfirm, (state, { id }) => ({
112
+ }), on(spxConfirmActions.answerConfirm, (state, { id }) => ({
121
113
  ...state,
122
114
  confirms: [
123
115
  ...state.confirms.filter((c) => c.id !== id),
@@ -134,7 +126,7 @@ class SpxConfirmEffects {
134
126
  constructor(actions$, appStore) {
135
127
  this.actions$ = actions$;
136
128
  this.appStore = appStore;
137
- this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
129
+ this.onAnswer$ = createEffect(() => this.actions$.pipe(ofType(spxConfirmActions.answer), withLatestFrom(this.appStore.select(spxConfirmReducer$1.selectConfirms)), mergeMap(([action, confirms]) => {
138
130
  if (action.confirm) {
139
131
  confirms.find((c) => c.id === action.id)?.onOK?.();
140
132
  }
@@ -142,7 +134,7 @@ class SpxConfirmEffects {
142
134
  confirms.find((c) => c.id === action.id)?.onCancel?.();
143
135
  }
144
136
  return [
145
- answerConfirm({ id: action.id }),
137
+ spxConfirmActions.answerConfirm({ id: action.id }),
146
138
  spxSpinnerActions.hide({
147
139
  action: action.id,
148
140
  })
@@ -165,5 +157,5 @@ var spxConfirm_effects = /*#__PURE__*/Object.freeze({
165
157
  * Generated bundle index. Do not edit.
166
158
  */
167
159
 
168
- export { SpxConfirmComponent, SpxConfirmDisplayerComponent, spxConfirm_actions as spxConfirmActions, spxConfirm_effects as spxConfirmEffects, spxConfirm_reducer as spxConfirmReducer };
160
+ export { SpxConfirmComponent, SpxConfirmDisplayerComponent, spxConfirmActions, spxConfirm_effects as spxConfirmEffects, spxConfirm_reducer as spxConfirmReducer };
169
161
  //# sourceMappingURL=softpak-components-spx-confirm.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import * as actions from './spx-confirm.actions';\n\nimport { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAChC;IAEA,SAAS,GAAA;AACP,QAAA,IAAG,IAAI,CAAC,EAAE,EAAE,EAAE,EAAC;QACf,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACjC;8GAlBW,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,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA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CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI;YACxD;YACA,OAAO;gBACLF,aAAqB,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;gBACtC,iBAAiB,CAAC,IAAI,CAAC;oBACrB,MAAM,EAAE,MAAM,CAAC,EAAE;iBAClB;aACF;QACH,CAAC,CAAC,CACH,CACF;IAKE;8GA1BQ,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createActionGroup, emptyProps, props } from '@ngrx/store';\n\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const spxConfirmActions = createActionGroup({\n source: 'SpxConfirm',\n events: {\n Answer: props<{ cancel?: boolean; confirm?: boolean; id: string; }>(),\n AnswerConfirm: props<{ id: string; }>(),\n Reset: emptyProps(),\n Show: props<SpxConfirmI>(),\n },\n});\n","import { createFeature, createReducer, on } from '@ngrx/store';\n\nimport { spxConfirmActions } from './spx-confirm.actions';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n spxConfirmActions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n spxConfirmActions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n spxConfirmActions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport { spxConfirmActions } from './spx-confirm.actions';\nimport spxConfirmReducer from './spx-confirm.reducer';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(spxConfirmActions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n spxConfirmActions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({\n action: action.id,\n })\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,QAAQ,GAAA;QACN,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IAChC;IAEA,SAAS,GAAA;AACP,QAAA,IAAG,IAAI,CAAC,EAAE,EAAE,EAAE,EAAC;QACf,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACjC;8GAlBW,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,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,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AAE,CAAC,EAAE,QAAQ,IAAI;YACxD;YACA,OAAO;gBACL,iBAAiB,CAAC,aAAa,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;gBAChD,iBAAiB,CAAC,IAAI,CAAC;oBACrB,MAAM,EAAE,MAAM,CAAC,EAAE;iBAClB;aACF;QACH,CAAC,CAAC,CACH,CACF;IAKE;8GA1BQ,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAC,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACVD;;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 { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
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.0.8", 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, spxNavigation_actions as spxNavigationActions, spxNavigation_initial as spxNavigationInitial, spxNavigation_reducer as spxNavigationReducer, spxNavigation_state as spxNavigationState };
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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,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;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,cAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAW;QAC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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 { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
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.0.8", 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 hide = createAction('[SPX / Spinner] Hide', props());
19
- const reset = createAction('[SPX / Spinner] Reset', props());
20
- const show = createAction('[SPX / Spinner] Show', props());
21
- const all = union({
22
- hide,
23
- show,
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, spxSpinner_actions as spxSpinnerActions, spxSpinner_initial as spxSpinnerInitial, spxSpinner_reducer$1 as spxSpinnerReducer, spxSpinner_state as spxSpinnerState };
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