@softpak/components 19.13.0 → 19.14.0

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.
@@ -66,6 +66,7 @@ var spxChannel_actions = /*#__PURE__*/Object.freeze({
66
66
  });
67
67
 
68
68
  const initialState = {
69
+ previousChannel: null,
69
70
  channel: null,
70
71
  channelType: null,
71
72
  channels: [],
@@ -108,6 +109,7 @@ var spxChannelReducer$1 = createFeature({
108
109
  SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
109
110
  return {
110
111
  ...state,
112
+ previousChannel: state.channel,
111
113
  channel,
112
114
  channelType,
113
115
  };
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-selection-url.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.initial.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-welcome.component.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["export const spxChannelSelectionUrl = 'wlc';","import { Router } from '@angular/router';\r\nimport { Injectable } from '@angular/core';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SpxChannelGuard {\r\n\r\n constructor(\r\n public router: Router,\r\n ) {}\r\n\r\n canActivate(): boolean {\r\n if (\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\r\n ) {\r\n this.router.navigate([spxChannelSelectionUrl]);\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { createAction, props, union } from '@ngrx/store';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\n\r\nexport const choose = createAction('[SPX / Channel] Select', props<{\r\n channel: SpxAppChannelI;\r\n channelType: SpxAppChannelTypeEnum;\r\n}>());\r\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\r\n channels: SpxAppChannelI[];\r\n}>());\r\n\r\nconst all = union({\r\n choose,\r\n initialize,\r\n});\r\n\r\nexport type Actions = typeof all;\r\n","import { StateI } from \"./spx-channel.state\";\r\n\r\nexport const initialState: StateI = {\r\n channel: null,\r\n channelType: null,\r\n channels: [],\r\n};\r\n","\r\nimport * as actions from './spx-channel.actions';\r\nimport { createFeature, createReducer, on } from '@ngrx/store';\r\nimport { StateI } from './spx-channel.state';\r\nimport { initialState } from './spx-channel.initial';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\n\r\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\r\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\r\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.includes(SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\r\n if (channelResult) {\r\n return channelResult;\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n } else {\r\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\r\n return null;\r\n }\r\n }\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default createFeature({\r\n name: 'spxChannel',\r\n reducer: createReducer(\r\n initialState,\r\n on(actions.choose, (state, { channel, channelType }): StateI => {\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\r\n return {\r\n ...state,\r\n channel,\r\n channelType,\r\n };\r\n }),\r\n on(actions.initialize, (state, { channels }): StateI => ({\r\n ...state,\r\n channel: determineActiveChannel(channels),\r\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\r\n channelType: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) ? SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum : SpxAppChannelTypeEnum.production,\r\n })),\r\n ),\r\n});\r\n","import { Component } from '@angular/core';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\r\nimport { AsyncPipe } from '@angular/common';\r\nimport { TranslatePipe } from '@ngx-translate/core';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { spxTextChange } from '@softpak/components/spx-translate';\r\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\r\nimport { NavController } from '@ionic/angular';\r\n\r\n@Component({\r\n selector: 'spx-channel-indicator',\r\n template: `<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\r\n <div class=\"grow\">\r\n <div class=\"text-lg font-bold\">{{ (channel | async)?.brand }}</div>\r\n @if ((channelType | async) !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType | async }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n </div>`,\r\n imports: [\r\n AsyncPipe,\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n TranslatePipe,\r\n ]\r\n})\r\nexport class SpxChannelIndicatorComponent {\r\n channel = this.store.select(spxChannelReducer.selectChannel);\r\n channelType = this.store.select(spxChannelReducer.selectChannelType);\r\n spxTextChange = spxTextChange;\r\n\r\n constructor(\r\n private navController: NavController,\r\n private store: Store,\r\n ) { }\r\n\r\n onChange() {\r\n this.navController.navigateRoot([spxChannelSelectionUrl]);\r\n }\r\n}\r\n","import { Component, OnInit, OnDestroy, signal, computed } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\r\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\r\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\r\nimport { Subscription } from 'rxjs';\r\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\r\nimport { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\r\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\r\nimport { choose } from '../store/spx-channel/spx-channel.actions';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { TranslatePipe } from '@ngx-translate/core';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\n\r\nexport const sectionWelcome = 'welcome';\r\nexport const ctrlChannel = 'channel';\r\nexport const ctrlChannelType = 'channelType';\r\nexport interface SpxWelcomeValueI {\r\n [ctrlChannel]?: SpxAppChannelI;\r\n [ctrlChannelType]: SpxAppChannelTypeEnum;\r\n}\r\n\r\n@Component({\r\n selector: 'spx-welcome',\r\n template: `\r\n <ion-header>\r\n <ion-toolbar>\r\n <ion-title>\r\n {{ textSelectYourCompany | translate | capitalize }}\r\n </ion-title>\r\n <ion-buttons slot=\"end\">\r\n </ion-buttons>\r\n </ion-toolbar>\r\n</ion-header>\r\n<ion-content class=\"ion-padding\">\r\n <form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\r\n <spx-form-view\r\n [spxForm]=\"form\"\r\n [spxFormGroup]=\"formSection\"\r\n [spxSuggestions]=\"suggestions\">\r\n </spx-form-view>\r\n </form>\r\n</ion-content>`,\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxCapitalizePipe,\r\n SpxFormViewComponent,\r\n IonHeader,\r\n IonToolbar,\r\n IonTitle,\r\n IonButtons,\r\n IonContent,\r\n TranslatePipe,\r\n ]\r\n})\r\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\r\n channels = signal<SpxAppChannelI[]>([]);\r\n filteredCompanies = computed(() => this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\r\n channelTypes = [\r\n SpxAppChannelTypeEnum.production,\r\n SpxAppChannelTypeEnum.beta,\r\n SpxAppChannelTypeEnum.alpha,\r\n SpxAppChannelTypeEnum.development,\r\n ];\r\n formGroup!: FormGroup;\r\n textChannel = spxTextChannel;\r\n textCompany = spxTextCompany;\r\n textSelect = spxTextSelect;\r\n textSelectYourCompany = spxTextSelectYourCompany;\r\n suggestions: {\r\n [ctrlChannelType]?: SpxValuePair<string>[];\r\n [ctrlChannel]?: SpxValuePair<string>[];\r\n } = {\r\n [ctrlChannelType]: [],\r\n [ctrlChannel]: [],\r\n };\r\n\r\n get formSection(): FormGroup { return this.formGroup.get(sectionWelcome) as FormGroup; }\r\n get ctrlChannel(): FormControl { return this.formSection.get(ctrlChannel) as FormControl; }\r\n get ctrlChannelType(): FormControl { return this.formSection.get(ctrlChannelType) as FormControl; }\r\n private subscriptions: {\r\n channel?: Subscription;\r\n channels?: Subscription;\r\n } = {};\r\n\r\n form: SpxFormI = {\r\n buttons: [\r\n {\r\n severity: SpxSeverityEnum.success,\r\n type: SpxFormButtonTypeEnum.submit,\r\n label: () => this.textSelect,\r\n }\r\n ],\r\n sections: [\r\n {\r\n key: sectionWelcome,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlChannel,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textCompany,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlChannelType,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textChannel,\r\n capitalize: () => true,\r\n show: () => valuePairToValue(this.ctrlChannel.value),\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n ]\r\n }\r\n ]\r\n };\r\n\r\n constructor(\r\n private readonly appStore: Store,\r\n readonly formBuilder: FormBuilder\r\n ) {\r\n this.formGroup = this.formBuilder.group({\r\n [sectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form.sections)\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n unsubscribeSubscriptions(this.subscriptions);\r\n }\r\n\r\n ngOnInit(): void {\r\n this.subscriptions.channels = this.appStore.select(spxChannelReducer.selectChannels).subscribe(channels => {\r\n this.channels.set(channels);\r\n this.suggestions[ctrlChannel] = this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));\r\n });\r\n\r\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\r\n const brandFound = this.channels().find(c => c.brand === valuePairToValue(valuePair));\r\n this.suggestions[ctrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({\r\n description: channelType,\r\n value: channelType\r\n }));\r\n this.ctrlChannelType.setValue({\r\n value: SpxAppChannelTypeEnum.production,\r\n });\r\n });\r\n }\r\n\r\n onSubmit(): void {\r\n const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel.value))!;\r\n const channelType = valuePairToValue(this.ctrlChannelType.value);\r\n\r\n if (!channel) {\r\n this.appStore.dispatch(spxToasterActions.createWarning({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: 'Please select a company',\r\n }))\r\n } else {\r\n this.appStore.dispatch(choose({\r\n channel,\r\n channelType,\r\n }));\r\n }\r\n }\r\n}\r\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { Injectable } from '@angular/core';\r\nimport * as actions from './spx-channel.actions';\r\nimport { setConfig } from '@capacitor/live-updates';\r\nimport { Capacitor } from '@capacitor/core';\r\nimport { Router } from '@angular/router';\r\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\nimport { captureMessage } from '@sentry/angular';\r\nimport { App } from '@capacitor/app';\r\n\r\n@Injectable()\r\nexport class Effects {\r\n onChoose$ =\r\n createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(actions.choose),\r\n switchMap((action) => {\r\n if (Capacitor.getPlatform() === 'web') {\r\n this.router.navigate(['tabs/hme']);\r\n } else {\r\n App.getInfo().then((binaryInfo) => {\r\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\r\n setConfig({\r\n channel: `${action.channelType}-${binaryVersionGroup}.x`\r\n });\r\n this.router.navigate([spxUpdateUrl]);\r\n }).catch((err) => {\r\n captureMessage(`SPX Channel Error`);\r\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\r\n this.router.navigate([spxUpdateUrl]);\r\n });\r\n }\r\n\r\n return [spxToasterActions.createSuccess({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: action.channel?.brand,\r\n })];\r\n }),\r\n ), { dispatch: true });\r\n\r\n constructor(\r\n private readonly actions$: Actions,\r\n private readonly router: Router,\r\n ) { }\r\n}\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer","i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,sBAAsB,GAAG,KAAK;;MCQ9B,eAAe,CAAA;AAE1B,IAAA,WAAA,CACS,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;IAGf,WAAW,GAAA;QACT,IACE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,KAAK,CAAC;YAClE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,WAAW,CAAC,EACxE;YACA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9C,YAAA,OAAO,KAAK;;AAEd,QAAA,OAAO,IAAI;;8GAdF,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACJM,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,EAAE,KAAK,EAG9D,CAAC;AACE,MAAM,UAAU,GAAG,YAA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,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;SACN,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8GA3BrB,OAAO,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,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;;;;;;;;;;;;ACZD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-selection-url.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.initial.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-welcome.component.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["export const spxChannelSelectionUrl = 'wlc';","import { Router } from '@angular/router';\r\nimport { Injectable } from '@angular/core';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SpxChannelGuard {\r\n\r\n constructor(\r\n public router: Router,\r\n ) {}\r\n\r\n canActivate(): boolean {\r\n if (\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\r\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\r\n ) {\r\n this.router.navigate([spxChannelSelectionUrl]);\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n","import { createAction, props, union } from '@ngrx/store';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\n\r\nexport const choose = createAction('[SPX / Channel] Select', props<{\r\n channel: SpxAppChannelI;\r\n channelType: SpxAppChannelTypeEnum;\r\n}>());\r\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\r\n channels: SpxAppChannelI[];\r\n}>());\r\n\r\nconst all = union({\r\n choose,\r\n initialize,\r\n});\r\n\r\nexport type Actions = typeof all;\r\n","import { StateI } from \"./spx-channel.state\";\r\n\r\nexport const initialState: StateI = {\r\n previousChannel: null,\r\n channel: null,\r\n channelType: null,\r\n channels: [],\r\n};\r\n","\r\nimport * as actions from './spx-channel.actions';\r\nimport { createFeature, createReducer, on } from '@ngrx/store';\r\nimport { StateI } from './spx-channel.state';\r\nimport { initialState } from './spx-channel.initial';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\n\r\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\r\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\r\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.includes(SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\r\n if (channelResult) {\r\n return channelResult;\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n } else {\r\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\r\n return null;\r\n }\r\n }\r\n } else {\r\n const defaultBrandResult = channels.find(channel => channel.default);\r\n if (defaultBrandResult) {\r\n return defaultBrandResult;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default createFeature({\r\n name: 'spxChannel',\r\n reducer: createReducer(\r\n initialState,\r\n on(actions.choose, (state, { channel, channelType }): StateI => {\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\r\n return {\r\n ...state,\r\n previousChannel: state.channel,\r\n channel,\r\n channelType,\r\n };\r\n }),\r\n on(actions.initialize, (state, { channels }): StateI => ({\r\n ...state,\r\n channel: determineActiveChannel(channels),\r\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\r\n channelType: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) ? SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum : SpxAppChannelTypeEnum.production,\r\n })),\r\n ),\r\n});\r\n","import { Component } from '@angular/core';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\r\nimport { AsyncPipe } from '@angular/common';\r\nimport { TranslatePipe } from '@ngx-translate/core';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { spxTextChange } from '@softpak/components/spx-translate';\r\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\r\nimport { NavController } from '@ionic/angular';\r\n\r\n@Component({\r\n selector: 'spx-channel-indicator',\r\n template: `<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\r\n <div class=\"grow\">\r\n <div class=\"text-lg font-bold\">{{ (channel | async)?.brand }}</div>\r\n @if ((channelType | async) !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType | async }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n </div>`,\r\n imports: [\r\n AsyncPipe,\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n TranslatePipe,\r\n ]\r\n})\r\nexport class SpxChannelIndicatorComponent {\r\n channel = this.store.select(spxChannelReducer.selectChannel);\r\n channelType = this.store.select(spxChannelReducer.selectChannelType);\r\n spxTextChange = spxTextChange;\r\n\r\n constructor(\r\n private navController: NavController,\r\n private store: Store,\r\n ) { }\r\n\r\n onChange() {\r\n this.navController.navigateRoot([spxChannelSelectionUrl]);\r\n }\r\n}\r\n","import { Component, OnInit, OnDestroy, signal, computed } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\r\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\r\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\r\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\r\nimport { Subscription } from 'rxjs';\r\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\r\nimport { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\r\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\r\nimport { choose } from '../store/spx-channel/spx-channel.actions';\r\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\r\nimport { TranslatePipe } from '@ngx-translate/core';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\n\r\nexport const sectionWelcome = 'welcome';\r\nexport const ctrlChannel = 'channel';\r\nexport const ctrlChannelType = 'channelType';\r\nexport interface SpxWelcomeValueI {\r\n [ctrlChannel]?: SpxAppChannelI;\r\n [ctrlChannelType]: SpxAppChannelTypeEnum;\r\n}\r\n\r\n@Component({\r\n selector: 'spx-welcome',\r\n template: `\r\n <ion-header>\r\n <ion-toolbar>\r\n <ion-title>\r\n {{ textSelectYourCompany | translate | capitalize }}\r\n </ion-title>\r\n <ion-buttons slot=\"end\">\r\n </ion-buttons>\r\n </ion-toolbar>\r\n</ion-header>\r\n<ion-content class=\"ion-padding\">\r\n <form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\r\n <spx-form-view\r\n [spxForm]=\"form\"\r\n [spxFormGroup]=\"formSection\"\r\n [spxSuggestions]=\"suggestions\">\r\n </spx-form-view>\r\n </form>\r\n</ion-content>`,\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxCapitalizePipe,\r\n SpxFormViewComponent,\r\n IonHeader,\r\n IonToolbar,\r\n IonTitle,\r\n IonButtons,\r\n IonContent,\r\n TranslatePipe,\r\n ]\r\n})\r\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\r\n channels = signal<SpxAppChannelI[]>([]);\r\n filteredCompanies = computed(() => this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\r\n channelTypes = [\r\n SpxAppChannelTypeEnum.production,\r\n SpxAppChannelTypeEnum.beta,\r\n SpxAppChannelTypeEnum.alpha,\r\n SpxAppChannelTypeEnum.development,\r\n ];\r\n formGroup!: FormGroup;\r\n textChannel = spxTextChannel;\r\n textCompany = spxTextCompany;\r\n textSelect = spxTextSelect;\r\n textSelectYourCompany = spxTextSelectYourCompany;\r\n suggestions: {\r\n [ctrlChannelType]?: SpxValuePair<string>[];\r\n [ctrlChannel]?: SpxValuePair<string>[];\r\n } = {\r\n [ctrlChannelType]: [],\r\n [ctrlChannel]: [],\r\n };\r\n\r\n get formSection(): FormGroup { return this.formGroup.get(sectionWelcome) as FormGroup; }\r\n get ctrlChannel(): FormControl { return this.formSection.get(ctrlChannel) as FormControl; }\r\n get ctrlChannelType(): FormControl { return this.formSection.get(ctrlChannelType) as FormControl; }\r\n private subscriptions: {\r\n channel?: Subscription;\r\n channels?: Subscription;\r\n } = {};\r\n\r\n form: SpxFormI = {\r\n buttons: [\r\n {\r\n severity: SpxSeverityEnum.success,\r\n type: SpxFormButtonTypeEnum.submit,\r\n label: () => this.textSelect,\r\n }\r\n ],\r\n sections: [\r\n {\r\n key: sectionWelcome,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlChannel,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textCompany,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlChannelType,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textChannel,\r\n capitalize: () => true,\r\n show: () => valuePairToValue(this.ctrlChannel.value),\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n ]\r\n }\r\n ]\r\n };\r\n\r\n constructor(\r\n private readonly appStore: Store,\r\n readonly formBuilder: FormBuilder\r\n ) {\r\n this.formGroup = this.formBuilder.group({\r\n [sectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form.sections)\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n unsubscribeSubscriptions(this.subscriptions);\r\n }\r\n\r\n ngOnInit(): void {\r\n this.subscriptions.channels = this.appStore.select(spxChannelReducer.selectChannels).subscribe(channels => {\r\n this.channels.set(channels);\r\n this.suggestions[ctrlChannel] = this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));\r\n });\r\n\r\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\r\n const brandFound = this.channels().find(c => c.brand === valuePairToValue(valuePair));\r\n this.suggestions[ctrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({\r\n description: channelType,\r\n value: channelType\r\n }));\r\n this.ctrlChannelType.setValue({\r\n value: SpxAppChannelTypeEnum.production,\r\n });\r\n });\r\n }\r\n\r\n onSubmit(): void {\r\n const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel.value))!;\r\n const channelType = valuePairToValue(this.ctrlChannelType.value);\r\n\r\n if (!channel) {\r\n this.appStore.dispatch(spxToasterActions.createWarning({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: 'Please select a company',\r\n }))\r\n } else {\r\n this.appStore.dispatch(choose({\r\n channel,\r\n channelType,\r\n }));\r\n }\r\n }\r\n}\r\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { Injectable } from '@angular/core';\r\nimport * as actions from './spx-channel.actions';\r\nimport { setConfig } from '@capacitor/live-updates';\r\nimport { Capacitor } from '@capacitor/core';\r\nimport { Router } from '@angular/router';\r\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\nimport { captureMessage } from '@sentry/angular';\r\nimport { App } from '@capacitor/app';\r\n\r\n@Injectable()\r\nexport class Effects {\r\n onChoose$ =\r\n createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(actions.choose),\r\n switchMap((action) => {\r\n if (Capacitor.getPlatform() === 'web') {\r\n this.router.navigate(['tabs/hme']);\r\n } else {\r\n App.getInfo().then((binaryInfo) => {\r\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\r\n setConfig({\r\n channel: `${action.channelType}-${binaryVersionGroup}.x`\r\n });\r\n this.router.navigate([spxUpdateUrl]);\r\n }).catch((err) => {\r\n captureMessage(`SPX Channel Error`);\r\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\r\n this.router.navigate([spxUpdateUrl]);\r\n });\r\n }\r\n\r\n return [spxToasterActions.createSuccess({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: action.channel?.brand,\r\n })];\r\n }),\r\n ), { dispatch: true });\r\n\r\n constructor(\r\n private readonly actions$: Actions,\r\n private readonly router: Router,\r\n ) { }\r\n}\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer","i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,sBAAsB,GAAG,KAAK;;MCQ9B,eAAe,CAAA;AAE1B,IAAA,WAAA,CACS,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;IAGf,WAAW,GAAA;QACT,IACE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,KAAK,CAAC;YAClE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,WAAW,CAAC,EACxE;YACA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9C,YAAA,OAAO,KAAK;;AAEd,QAAA,OAAO,IAAI;;8GAdF,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,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CAAC,CAAmB,iBAAA,CAAA,CAAC;oBACnC,cAAc,CAAC,CAAsB,mBAAA,EAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAE,CAAA,CAAC;oBAC3D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,iBAAC,CAAC;;AAGN,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;SACN,CAAC,CACL,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8GA3BrB,OAAO,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,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;;;;;;;;;;;;ACZD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "19.13.0",
3
+ "version": "19.14.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "19.x.x",
@@ -29,38 +29,34 @@
29
29
  "types": "./index.d.ts",
30
30
  "default": "./fesm2022/softpak-components.mjs"
31
31
  },
32
- "./spx-app-configuration": {
33
- "types": "./spx-app-configuration/index.d.ts",
34
- "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
35
- },
36
- "./spx-app-expiry": {
37
- "types": "./spx-app-expiry/index.d.ts",
38
- "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
39
- },
40
32
  "./spx-alert": {
41
33
  "types": "./spx-alert/index.d.ts",
42
34
  "default": "./fesm2022/softpak-components-spx-alert.mjs"
43
35
  },
36
+ "./spx-app-configuration": {
37
+ "types": "./spx-app-configuration/index.d.ts",
38
+ "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
39
+ },
44
40
  "./spx-button": {
45
41
  "types": "./spx-button/index.d.ts",
46
42
  "default": "./fesm2022/softpak-components-spx-button.mjs"
47
43
  },
48
- "./spx-capitalize": {
49
- "types": "./spx-capitalize/index.d.ts",
50
- "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
44
+ "./spx-app-expiry": {
45
+ "types": "./spx-app-expiry/index.d.ts",
46
+ "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
51
47
  },
52
48
  "./spx-card": {
53
49
  "types": "./spx-card/index.d.ts",
54
50
  "default": "./fesm2022/softpak-components-spx-card.mjs"
55
51
  },
56
- "./spx-channel-selection": {
57
- "types": "./spx-channel-selection/index.d.ts",
58
- "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
59
- },
60
52
  "./spx-change-details": {
61
53
  "types": "./spx-change-details/index.d.ts",
62
54
  "default": "./fesm2022/softpak-components-spx-change-details.mjs"
63
55
  },
56
+ "./spx-channel-selection": {
57
+ "types": "./spx-channel-selection/index.d.ts",
58
+ "default": "./fesm2022/softpak-components-spx-channel-selection.mjs"
59
+ },
64
60
  "./spx-check-digit": {
65
61
  "types": "./spx-check-digit/index.d.ts",
66
62
  "default": "./fesm2022/softpak-components-spx-check-digit.mjs"
@@ -89,53 +85,57 @@
89
85
  "types": "./spx-number-check/index.d.ts",
90
86
  "default": "./fesm2022/softpak-components-spx-number-check.mjs"
91
87
  },
92
- "./spx-pagination": {
93
- "types": "./spx-pagination/index.d.ts",
94
- "default": "./fesm2022/softpak-components-spx-pagination.mjs"
95
- },
96
88
  "./spx-patch": {
97
89
  "types": "./spx-patch/index.d.ts",
98
90
  "default": "./fesm2022/softpak-components-spx-patch.mjs"
99
91
  },
100
- "./spx-progress-bar": {
101
- "types": "./spx-progress-bar/index.d.ts",
102
- "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
92
+ "./spx-capitalize": {
93
+ "types": "./spx-capitalize/index.d.ts",
94
+ "default": "./fesm2022/softpak-components-spx-capitalize.mjs"
103
95
  },
104
96
  "./spx-pipes": {
105
97
  "types": "./spx-pipes/index.d.ts",
106
98
  "default": "./fesm2022/softpak-components-spx-pipes.mjs"
107
99
  },
100
+ "./spx-progress-bar": {
101
+ "types": "./spx-progress-bar/index.d.ts",
102
+ "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
103
+ },
108
104
  "./spx-spinner": {
109
105
  "types": "./spx-spinner/index.d.ts",
110
106
  "default": "./fesm2022/softpak-components-spx-spinner.mjs"
111
107
  },
112
- "./spx-storage": {
113
- "types": "./spx-storage/index.d.ts",
114
- "default": "./fesm2022/softpak-components-spx-storage.mjs"
115
- },
116
108
  "./spx-stock-info": {
117
109
  "types": "./spx-stock-info/index.d.ts",
118
110
  "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
119
111
  },
120
- "./spx-suggestion": {
121
- "types": "./spx-suggestion/index.d.ts",
122
- "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
112
+ "./spx-storage": {
113
+ "types": "./spx-storage/index.d.ts",
114
+ "default": "./fesm2022/softpak-components-spx-storage.mjs"
123
115
  },
124
116
  "./spx-toaster": {
125
117
  "types": "./spx-toaster/index.d.ts",
126
118
  "default": "./fesm2022/softpak-components-spx-toaster.mjs"
127
119
  },
120
+ "./spx-suggestion": {
121
+ "types": "./spx-suggestion/index.d.ts",
122
+ "default": "./fesm2022/softpak-components-spx-suggestion.mjs"
123
+ },
128
124
  "./spx-translate": {
129
125
  "types": "./spx-translate/index.d.ts",
130
126
  "default": "./fesm2022/softpak-components-spx-translate.mjs"
131
127
  },
132
- "./spx-validation": {
133
- "types": "./spx-validation/index.d.ts",
134
- "default": "./fesm2022/softpak-components-spx-validation.mjs"
128
+ "./spx-pagination": {
129
+ "types": "./spx-pagination/index.d.ts",
130
+ "default": "./fesm2022/softpak-components-spx-pagination.mjs"
135
131
  },
136
132
  "./spx-update": {
137
133
  "types": "./spx-update/index.d.ts",
138
134
  "default": "./fesm2022/softpak-components-spx-update.mjs"
135
+ },
136
+ "./spx-validation": {
137
+ "types": "./spx-validation/index.d.ts",
138
+ "default": "./fesm2022/softpak-components-spx-validation.mjs"
139
139
  }
140
140
  }
141
141
  }
@@ -7,5 +7,6 @@ declare const _default: {
7
7
  selectChannel: import("@ngrx/store").MemoizedSelector<Record<string, any>, SpxAppChannelI | null, (featureState: StateI) => SpxAppChannelI | null>;
8
8
  selectChannelType: import("@ngrx/store").MemoizedSelector<Record<string, any>, SpxAppChannelTypeEnum | null, (featureState: StateI) => SpxAppChannelTypeEnum | null>;
9
9
  selectChannels: import("@ngrx/store").MemoizedSelector<Record<string, any>, SpxAppChannelI[], (featureState: StateI) => SpxAppChannelI[]>;
10
+ selectPreviousChannel: import("@ngrx/store").MemoizedSelector<Record<string, any>, SpxAppChannelI | null, (featureState: StateI) => SpxAppChannelI | null>;
10
11
  };
11
12
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import { SpxAppChannelI, SpxAppChannelTypeEnum } from "@softpak/components/spx-app-configuration";
2
2
  export interface StateI {
3
+ previousChannel: SpxAppChannelI | null;
3
4
  channel: SpxAppChannelI | null;
4
5
  channels: SpxAppChannelI[];
5
6
  channelType: SpxAppChannelTypeEnum | null;