@softpak/components 20.0.2 → 20.2.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.
@@ -1,48 +1,41 @@
1
+ import * as i2 from '@angular/router';
2
+ import { Router } from '@angular/router';
1
3
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, signal, computed } from '@angular/core';
4
+ import { inject, Injectable, ChangeDetectionStrategy, Component } from '@angular/core';
3
5
  import { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';
4
- import * as i1 from '@angular/router';
6
+ import { createAction, props, union, createFeature, createReducer, on, Store } from '@ngrx/store';
5
7
  import { SpxButtonComponent } from '@softpak/components/spx-button';
6
- import * as i2 from '@ngrx/store';
7
- import { createAction, props, union, createFeature, createReducer, on } from '@ngrx/store';
8
8
  import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
9
- import { AsyncPipe } from '@angular/common';
10
9
  import { TranslatePipe } from '@ngx-translate/core';
11
10
  import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
12
- import { spxTextChange, spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';
13
- import * as i1$1 from '@ionic/angular';
14
- import * as i2$1 from '@angular/forms';
15
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
16
- import { SpxFormButtonTypeEnum, SpxFormViewComponent } from '@softpak/components/spx-form-view';
17
- import { valuePairToValue, SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
18
- import { SpxInputTypeEnum } from '@softpak/components/spx-inputs';
19
- import { spxValidatorRequired } from '@softpak/components/spx-validation';
20
- import { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';
21
- import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
22
- import * as i1$2 from '@ngrx/effects';
11
+ import { spxTextChange } from '@softpak/components/spx-translate';
12
+ import { NavController } from '@ionic/angular';
13
+ import { toSignal } from '@angular/core/rxjs-interop';
14
+ import { map } from 'rxjs';
15
+ import * as i1 from '@ngrx/effects';
23
16
  import { createEffect, ofType } from '@ngrx/effects';
24
17
  import { switchMap } from 'rxjs/operators';
25
18
  import { setConfig } from '@capacitor/live-updates';
26
19
  import { Capacitor } from '@capacitor/core';
27
20
  import { spxUpdateUrl } from '@softpak/components/spx-update';
21
+ import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
28
22
  import { captureMessage } from '@sentry/angular';
29
23
  import { App } from '@capacitor/app';
30
24
 
31
- const spxChannelSelectionUrl = 'wlc';
32
-
25
+ // import { spxChannelSelectionUrl } from '../../src/app.const';
33
26
  class SpxChannelGuard {
34
- constructor(router) {
35
- this.router = router;
27
+ constructor() {
28
+ this.router = inject(Router);
36
29
  }
37
30
  canActivate() {
38
31
  if (!SpxStorage.getSetting(SpxStorageKeyEnum.brand) ||
39
32
  !SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
40
- this.router.navigate([spxChannelSelectionUrl]);
33
+ this.router.navigate(['wlc']);
41
34
  return false;
42
35
  }
43
36
  return true;
44
37
  }
45
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
46
39
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, providedIn: 'root' }); }
47
40
  }
48
41
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelGuard, decorators: [{
@@ -50,7 +43,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImpor
50
43
  args: [{
51
44
  providedIn: 'root'
52
45
  }]
53
- }], ctorParameters: () => [{ type: i1.Router }] });
46
+ }] });
54
47
 
55
48
  const choose = createAction('[SPX / Channel] Select', props());
56
49
  const initialize = createAction('[SPX / Channel] Initialize', props());
@@ -71,15 +64,9 @@ const initialState = {
71
64
  channelType: null,
72
65
  channels: [],
73
66
  };
74
-
75
- var spxChannel_initial = /*#__PURE__*/Object.freeze({
76
- __proto__: null,
77
- initialState: initialState
78
- });
79
-
80
67
  const determineActiveChannel = (channels) => {
81
68
  if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
82
- const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.includes(SpxStorage.getSetting(SpxStorageKeyEnum.channelType)));
69
+ const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType)));
83
70
  if (channelResult) {
84
71
  return channelResult;
85
72
  }
@@ -106,225 +93,63 @@ var spxChannelReducer$1 = createFeature({
106
93
  name: 'spxChannel',
107
94
  reducer: createReducer(initialState, on(choose, (state, { channel, channelType }) => {
108
95
  SpxStorage.setSetting(SpxStorageKeyEnum.brand, channel?.brand);
109
- SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType);
96
+ SpxStorage.setSetting(SpxStorageKeyEnum.channelType, channelType.name);
97
+ SpxStorage.setSetting(SpxStorageKeyEnum.channelTypeWithWebUrl, JSON.stringify(channelType));
110
98
  return {
111
99
  ...state,
112
100
  previousChannel: state.channel,
113
101
  channel,
114
102
  channelType,
115
103
  };
116
- }), on(initialize, (state, { channels }) => ({
117
- ...state,
118
- channel: determineActiveChannel(channels),
119
- channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),
120
- channelType: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) ? SpxStorage.getSetting(SpxStorageKeyEnum.channelType) : SpxAppChannelTypeEnum.production,
121
- }))),
104
+ }), on(initialize, (state, { channels }) => {
105
+ let channelType = null;
106
+ if (SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl)) {
107
+ channelType = JSON.parse(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl));
108
+ }
109
+ else if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {
110
+ channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) };
111
+ }
112
+ else {
113
+ channelType = { name: SpxAppChannelTypeEnum.production }; // Default to production if no type is set
114
+ }
115
+ return {
116
+ ...state,
117
+ channel: determineActiveChannel(channels),
118
+ channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),
119
+ channelType: channelType,
120
+ };
121
+ })),
122
122
  });
123
123
 
124
124
  var spxChannel_reducer = /*#__PURE__*/Object.freeze({
125
125
  __proto__: null,
126
- default: spxChannelReducer$1
126
+ default: spxChannelReducer$1,
127
+ initialState: initialState
127
128
  });
128
129
 
130
+ const spxChannelSelectionUrl = 'wlc';
129
131
  class SpxChannelIndicatorComponent {
130
- constructor(navController, store) {
131
- this.navController = navController;
132
- this.store = store;
133
- this.channel = this.store.select(spxChannelReducer$1.selectChannel);
134
- this.channelType = this.store.select(spxChannelReducer$1.selectChannelType);
132
+ constructor() {
133
+ this.navController = inject(NavController);
134
+ this.store = inject(Store);
135
+ this.channel = toSignal(this.store.select(spxChannelReducer$1.selectChannel));
136
+ this.channelType = toSignal(this.store.select(spxChannelReducer$1.selectChannelType).pipe(map(channelType => channelType?.name)));
135
137
  this.spxTextChange = spxTextChange;
136
138
  }
137
139
  onChange() {
138
140
  this.navController.navigateRoot([spxChannelSelectionUrl]);
139
141
  }
140
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelIndicatorComponent, deps: [{ token: i1$1.NavController }, { token: i2.Store }], target: i0.ɵɵFactoryTarget.Component }); }
141
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: SpxChannelIndicatorComponent, isStandalone: true, selector: "spx-channel-indicator", ngImport: i0, template: `<div class="bg-white p-3 rounded flex gap-3 items-center text-black">
142
- <div class="grow">
143
- <div class="text-lg font-bold">{{ (channel | async)?.brand }}</div>
144
- @if ((channelType | async) !== 'Production') {
145
- <div class="text-base text-gray-600">{{ channelType | async }}</div>
146
- }
147
- </div>
148
- <spx-button (click)="onChange()" [spxType]="'button'">{{ spxTextChange | translate | capitalize }}</spx-button>
149
- </div>`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
142
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
143
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: SpxChannelIndicatorComponent, isStandalone: true, selector: "spx-channel-indicator", ngImport: i0, 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()?.brand }}</div>\r\n @if (channelType() !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n</div>", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
150
144
  }
151
145
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxChannelIndicatorComponent, decorators: [{
152
146
  type: Component,
153
- args: [{
154
- selector: 'spx-channel-indicator',
155
- template: `<div class="bg-white p-3 rounded flex gap-3 items-center text-black">
156
- <div class="grow">
157
- <div class="text-lg font-bold">{{ (channel | async)?.brand }}</div>
158
- @if ((channelType | async) !== 'Production') {
159
- <div class="text-base text-gray-600">{{ channelType | async }}</div>
160
- }
161
- </div>
162
- <spx-button (click)="onChange()" [spxType]="'button'">{{ spxTextChange | translate | capitalize }}</spx-button>
163
- </div>`,
164
- imports: [
165
- AsyncPipe,
147
+ args: [{ selector: 'spx-channel-indicator', imports: [
166
148
  SpxButtonComponent,
167
149
  SpxCapitalizePipe,
168
150
  TranslatePipe,
169
- ]
170
- }]
171
- }], ctorParameters: () => [{ type: i1$1.NavController }, { type: i2.Store }] });
172
-
173
- const spxCectionWelcome = 'welcome';
174
- const spxCtrlChannel = 'channel';
175
- const spxCtrlChannelType = 'channelType';
176
- class SpxWelcomeComponent {
177
- get formSection() { return this.formGroup.get(spxCectionWelcome); }
178
- get ctrlChannel() { return this.formSection.get(spxCtrlChannel); }
179
- get ctrlChannelType() { return this.formSection.get(spxCtrlChannelType); }
180
- constructor(appStore, formBuilder) {
181
- this.appStore = appStore;
182
- this.formBuilder = formBuilder;
183
- this.channels = signal([]);
184
- this.filteredCompanies = computed(() => this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));
185
- this.channelTypes = [
186
- SpxAppChannelTypeEnum.production,
187
- SpxAppChannelTypeEnum.beta,
188
- SpxAppChannelTypeEnum.alpha,
189
- SpxAppChannelTypeEnum.development,
190
- ];
191
- this.textChannel = spxTextChannel;
192
- this.textCompany = spxTextCompany;
193
- this.textSelect = spxTextSelect;
194
- this.textSelectYourCompany = spxTextSelectYourCompany;
195
- this.suggestions = {
196
- [spxCtrlChannelType]: [],
197
- [spxCtrlChannel]: [],
198
- };
199
- this.subscriptions = {};
200
- this.form = {
201
- buttons: [
202
- {
203
- severity: SpxSeverityEnum.success,
204
- type: SpxFormButtonTypeEnum.submit,
205
- label: () => this.textSelect,
206
- }
207
- ],
208
- sections: [
209
- {
210
- key: spxCectionWelcome,
211
- showTitle: () => false,
212
- fields: [
213
- {
214
- key: spxCtrlChannel,
215
- type: () => SpxInputTypeEnum.radio,
216
- label: () => this.textCompany,
217
- validators: () => [spxValidatorRequired()],
218
- },
219
- {
220
- key: spxCtrlChannelType,
221
- type: () => SpxInputTypeEnum.radio,
222
- label: () => this.textChannel,
223
- capitalize: () => true,
224
- show: () => valuePairToValue(this.ctrlChannel.value),
225
- validators: () => [spxValidatorRequired()],
226
- },
227
- ]
228
- }
229
- ]
230
- };
231
- this.formGroup = this.formBuilder.group({
232
- [spxCectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form.sections)
233
- });
234
- }
235
- ngOnDestroy() {
236
- unsubscribeSubscriptions(this.subscriptions);
237
- }
238
- ngOnInit() {
239
- this.subscriptions.channels = this.appStore.select(spxChannelReducer$1.selectChannels).subscribe(channels => {
240
- this.channels.set(channels);
241
- this.suggestions[spxCtrlChannel] = this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));
242
- });
243
- this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {
244
- const brandFound = this.channels().find(c => c.brand === valuePairToValue(valuePair));
245
- this.suggestions[spxCtrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({
246
- description: channelType,
247
- value: channelType
248
- }));
249
- this.ctrlChannelType.setValue({
250
- value: SpxAppChannelTypeEnum.production,
251
- });
252
- });
253
- }
254
- onSubmit() {
255
- const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel.value));
256
- const channelType = valuePairToValue(this.ctrlChannelType.value);
257
- if (!channel) {
258
- this.appStore.dispatch(spxToasterActions.createWarning({
259
- autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
260
- messageText: 'Please select a company',
261
- }));
262
- }
263
- else {
264
- this.appStore.dispatch(choose({
265
- channel,
266
- channelType,
267
- }));
268
- }
269
- }
270
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxWelcomeComponent, deps: [{ token: i2.Store }, { token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
271
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: SpxWelcomeComponent, isStandalone: true, selector: "spx-welcome", ngImport: i0, template: `
272
- <ion-header>
273
- <ion-toolbar>
274
- <ion-title>
275
- {{ textSelectYourCompany | translate | capitalize }}
276
- </ion-title>
277
- <ion-buttons slot="end">
278
- </ion-buttons>
279
- </ion-toolbar>
280
- </ion-header>
281
- <ion-content class="ion-padding">
282
- <form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
283
- <spx-form-view
284
- [spxForm]="form"
285
- [spxFormGroup]="formSection"
286
- [spxSuggestions]="suggestions">
287
- </spx-form-view>
288
- </form>
289
- </ion-content>`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] }); }
290
- }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
292
- type: Component,
293
- args: [{
294
- selector: 'spx-welcome',
295
- template: `
296
- <ion-header>
297
- <ion-toolbar>
298
- <ion-title>
299
- {{ textSelectYourCompany | translate | capitalize }}
300
- </ion-title>
301
- <ion-buttons slot="end">
302
- </ion-buttons>
303
- </ion-toolbar>
304
- </ion-header>
305
- <ion-content class="ion-padding">
306
- <form [formGroup]="formGroup" class="max-w-lg mx-auto flex flex-col gap-3" (ngSubmit)="onSubmit()">
307
- <spx-form-view
308
- [spxForm]="form"
309
- [spxFormGroup]="formSection"
310
- [spxSuggestions]="suggestions">
311
- </spx-form-view>
312
- </form>
313
- </ion-content>`,
314
- imports: [
315
- FormsModule,
316
- ReactiveFormsModule,
317
- SpxCapitalizePipe,
318
- SpxFormViewComponent,
319
- IonHeader,
320
- IonToolbar,
321
- IonTitle,
322
- IonButtons,
323
- IonContent,
324
- TranslatePipe,
325
- ]
326
- }]
327
- }], ctorParameters: () => [{ type: i2.Store }, { type: i2$1.FormBuilder }] });
151
+ ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, 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()?.brand }}</div>\r\n @if (channelType() !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n</div>" }]
152
+ }] });
328
153
 
329
154
  class Effects {
330
155
  constructor(actions$, router) {
@@ -332,7 +157,12 @@ class Effects {
332
157
  this.router = router;
333
158
  this.onChoose$ = createEffect(() => this.actions$.pipe(ofType(choose), switchMap((action) => {
334
159
  if (Capacitor.getPlatform() === 'web') {
335
- this.router.navigate(['tabs/hme']);
160
+ if (action.channelType.webUrl) {
161
+ window.location.href = action.channelType.webUrl;
162
+ }
163
+ else {
164
+ this.router.navigate(['tabs/hme']);
165
+ }
336
166
  }
337
167
  else {
338
168
  App.getInfo().then((binaryInfo) => {
@@ -352,25 +182,21 @@ class Effects {
352
182
  })];
353
183
  })), { dispatch: true });
354
184
  }
355
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Effects, deps: [{ token: i1$2.Actions }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Effects, deps: [{ token: i1.Actions }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
356
186
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Effects }); }
357
187
  }
358
188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: Effects, decorators: [{
359
189
  type: Injectable
360
- }], ctorParameters: () => [{ type: i1$2.Actions }, { type: i1.Router }] });
190
+ }], ctorParameters: () => [{ type: i1.Actions }, { type: i2.Router }] });
361
191
 
362
192
  var spxChannel_effects = /*#__PURE__*/Object.freeze({
363
193
  __proto__: null,
364
194
  Effects: Effects
365
195
  });
366
196
 
367
- var spxChannel_state = /*#__PURE__*/Object.freeze({
368
- __proto__: null
369
- });
370
-
371
197
  /**
372
198
  * Generated bundle index. Do not edit.
373
199
  */
374
200
 
375
- export { SpxChannelGuard, SpxChannelIndicatorComponent, SpxWelcomeComponent, spxCectionWelcome, spxChannel_actions as spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_initial as spxChannelInitial, spxChannel_reducer as spxChannelReducer, spxChannel_state as spxChannelState, spxCtrlChannel, spxCtrlChannelType };
201
+ export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannel_actions as spxChannelActions, spxChannel_effects as spxChannelEffects, spxChannel_reducer as spxChannelReducer, spxChannelSelectionUrl };
376
202
  //# 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/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 spxCectionWelcome = 'welcome';\r\nexport const spxCtrlChannel = 'channel';\r\nexport const spxCtrlChannelType = 'channelType';\r\nexport interface SpxWelcomeValueI {\r\n [spxCtrlChannel]?: SpxAppChannelI;\r\n [spxCtrlChannelType]: 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 [spxCtrlChannelType]?: SpxValuePair<string>[];\r\n [spxCtrlChannel]?: SpxValuePair<string>[];\r\n } = {\r\n [spxCtrlChannelType]: [],\r\n [spxCtrlChannel]: [],\r\n };\r\n\r\n get formSection(): FormGroup { return this.formGroup.get(spxCectionWelcome) as FormGroup; }\r\n get ctrlChannel(): FormControl { return this.formSection.get(spxCtrlChannel) as FormControl; }\r\n get ctrlChannelType(): FormControl { return this.formSection.get(spxCtrlChannelType) 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: spxCectionWelcome,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: spxCtrlChannel,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textCompany,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlChannelType,\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 [spxCectionWelcome]: 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[spxCtrlChannel] = 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[spxCtrlChannelType] = !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: ${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,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,CAAG,EAAA,MAAM,CAAC,WAAW,CAAA,CAAA,EAAI,kBAAkB,CAAI,EAAA;AAC3D,qBAAA,CAAC;oBACF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;AACxC,iBAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAI;oBACb,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;;8GA1BrB,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-guard.ts","../../../../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/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { Router } from '@angular/router';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\n// import { spxChannelSelectionUrl } from '../../src/app.const';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SpxChannelGuard {\r\n\r\n private readonly router = inject(Router);\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(['wlc']);\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, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\r\n\r\nexport const choose = createAction('[SPX / Channel] Select', props<{\r\n channel: SpxAppChannelI;\r\n channelType: SpxChannelTypeI;\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","\r\nimport * as actions from './spx-channel.actions';\r\nimport { createFeature, createReducer, on } from '@ngrx/store';\r\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\r\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\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\nexport interface StateI {\r\n previousChannel: SpxAppChannelI | null;\r\n channel: SpxAppChannelI | null;\r\n channels: SpxAppChannelI[];\r\n channelType: SpxChannelTypeI | null;\r\n}\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.some((e: SpxChannelTypeI) => e.name === 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.name);\r\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelTypeWithWebUrl, JSON.stringify(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 \r\n let channelType: SpxChannelTypeI | null = null;\r\n \r\n if(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl)) {\r\n channelType = JSON.parse(SpxStorage.getSetting(SpxStorageKeyEnum.channelTypeWithWebUrl) as string);\r\n }\r\n else if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\r\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\r\n }\r\n else {\r\n channelType = { name: SpxAppChannelTypeEnum.production }; // Default to production if no type is set\r\n }\r\n\r\n return {\r\n ...state,\r\n channel: determineActiveChannel(channels),\r\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\r\n channelType: channelType,\r\n }\r\n }),\r\n ),\r\n});\r\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { Store } from '@ngrx/store';\r\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\r\nimport spxChannelReducer from '../../store/spx-channel.reducer';\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 { NavController } from '@ionic/angular';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { map } from 'rxjs';\r\nexport const spxChannelSelectionUrl = 'wlc';\r\n\r\n@Component({\r\n selector: 'spx-channel-indicator',\r\n templateUrl: './spx-channel-indicator.component.html',\r\n imports: [\r\n SpxButtonComponent,\r\n SpxCapitalizePipe,\r\n TranslatePipe,\r\n ],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxChannelIndicatorComponent {\r\n private readonly navController = inject(NavController);\r\n private readonly store = inject(Store);\r\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\r\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\r\n map(channelType => channelType?.name)\r\n ));\r\n protected readonly spxTextChange = spxTextChange;\r\n\r\n protected onChange() {\r\n this.navController.navigateRoot([spxChannelSelectionUrl]);\r\n }\r\n}\r\n","<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()?.brand }}</div>\r\n @if (channelType() !== 'Production') {\r\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\r\n }\r\n </div>\r\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\r\n</div>","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 if(action.channelType.webUrl) {\r\n window.location.href = action.channelType.webUrl;\r\n }\r\n else {\r\n this.router.navigate(['tabs/hme']);\r\n }\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: ${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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA;MAKa,eAAe,CAAA;AA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AI;oBACb,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;;8GA/BrB,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;;;;;;;;ACZD;;AAEG;;;;"}
@@ -4,6 +4,7 @@ var SpxStorageKeyEnum;
4
4
  SpxStorageKeyEnum["brand"] = "brand";
5
5
  SpxStorageKeyEnum["bundleVersion"] = "bundleVersion";
6
6
  SpxStorageKeyEnum["channelType"] = "channelType";
7
+ SpxStorageKeyEnum["channelTypeWithWebUrl"] = "channelTypeWithWebUrl";
7
8
  SpxStorageKeyEnum["channelSettings"] = "companySettings";
8
9
  SpxStorageKeyEnum["liveUpdate"] = "liveUpdate";
9
10
  SpxStorageKeyEnum["platform"] = "platform";
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-storage.mjs","sources":["../../../../projects/softpak/components/spx-storage/src/spx-storage-key.enum.ts","../../../../projects/softpak/components/spx-storage/src/spx-storage.class.ts","../../../../projects/softpak/components/spx-storage/softpak-components-spx-storage.ts"],"sourcesContent":["export enum SpxStorageKeyEnum {\r\n afterSignIn = 'afterSignIn',\r\n brand = 'brand',\r\n bundleVersion = 'bundleVersion',\r\n channelType = 'channelType',\r\n channelSettings = 'companySettings',\r\n liveUpdate = 'liveUpdate',\r\n platform = 'platform',\r\n platformVersion = 'platformVersion',\r\n token = 'token',\r\n updateInProgress = 'updateInProgress',\r\n randomDeviceId = 'randomDeviceId',\r\n release = 'release',\r\n patch = 'patch',\r\n};\r\n","import { SpxStorageKeyEnum } from './spx-storage-key.enum';\r\n\r\nexport class SpxStorage {\r\n private static get channelId() {\r\n return `${this.getSetting(SpxStorageKeyEnum.brand)?.toUpperCase()}_${this.getSetting(SpxStorageKeyEnum.channelType)?.toUpperCase()}`;\r\n }\r\n\r\n public static clearSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): void {\r\n localStorage.removeItem(key as string);\r\n }\r\n\r\n public static getSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | null {\r\n return localStorage.getItem(key as string);\r\n }\r\n\r\n public static setSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: string): void {\r\n localStorage.setItem(key as string, settingValue);\r\n }\r\n\r\n public static getChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | undefined {\r\n let storageObj;\r\n const storageObjStr = localStorage.getItem(SpxStorageKeyEnum.channelSettings);\r\n\r\n if (storageObjStr) {\r\n storageObj = JSON.parse(storageObjStr);\r\n if (!storageObj[this.channelId]) {\r\n return undefined;\r\n }\r\n return storageObj[this.channelId][key];\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n public static setChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: any): void {\r\n const companySettings = this.getSetting(SpxStorageKeyEnum.channelSettings);\r\n let storageObj;\r\n\r\n if (companySettings) {\r\n storageObj = JSON.parse(companySettings);\r\n } else {\r\n storageObj = {};\r\n }\r\n\r\n if (!storageObj[this.channelId]) {\r\n storageObj[this.channelId] = {};\r\n }\r\n\r\n storageObj[this.channelId][key] = settingValue;\r\n this.setSetting(SpxStorageKeyEnum.channelSettings, JSON.stringify(storageObj));\r\n }\r\n}\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrC,IAAA,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACnB,CAAC,EAdW,iBAAiB,KAAjB,iBAAiB,GAc5B,EAAA,CAAA,CAAA;AAAA;;MCZY,UAAU,CAAA;AACX,IAAA,WAAW,SAAS,GAAA;QACxB,OAAO,CAAA,EAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAA,CAAE;;IAGjI,OAAO,YAAY,CAAU,GAAgC,EAAA;A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,UAAU,CAAC,CAAC;;AAErF;;ACnDD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-storage.mjs","sources":["../../../../projects/softpak/components/spx-storage/src/spx-storage-key.enum.ts","../../../../projects/softpak/components/spx-storage/src/spx-storage.class.ts","../../../../projects/softpak/components/spx-storage/softpak-components-spx-storage.ts"],"sourcesContent":["export enum SpxStorageKeyEnum {\r\n afterSignIn = 'afterSignIn',\r\n brand = 'brand',\r\n bundleVersion = 'bundleVersion',\r\n channelType = 'channelType',\r\n channelTypeWithWebUrl = \"channelTypeWithWebUrl\",\r\n channelSettings = 'companySettings',\r\n liveUpdate = 'liveUpdate',\r\n platform = 'platform',\r\n platformVersion = 'platformVersion',\r\n token = 'token',\r\n updateInProgress = 'updateInProgress',\r\n randomDeviceId = 'randomDeviceId',\r\n release = 'release',\r\n patch = 'patch',\r\n};\r\n","import { SpxStorageKeyEnum } from './spx-storage-key.enum';\r\n\r\nexport class SpxStorage {\r\n private static get channelId() {\r\n return `${this.getSetting(SpxStorageKeyEnum.brand)?.toUpperCase()}_${this.getSetting(SpxStorageKeyEnum.channelType)?.toUpperCase()}`;\r\n }\r\n\r\n public static clearSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): void {\r\n localStorage.removeItem(key as string);\r\n }\r\n\r\n public static getSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | null {\r\n return localStorage.getItem(key as string);\r\n }\r\n\r\n public static setSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: string): void {\r\n localStorage.setItem(key as string, settingValue);\r\n }\r\n\r\n public static getChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum): string | undefined {\r\n let storageObj;\r\n const storageObjStr = localStorage.getItem(SpxStorageKeyEnum.channelSettings);\r\n\r\n if (storageObjStr) {\r\n storageObj = JSON.parse(storageObjStr);\r\n if (!storageObj[this.channelId]) {\r\n return undefined;\r\n }\r\n return storageObj[this.channelId][key];\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n public static setChannelSetting<KeyEnum>(key: KeyEnum | SpxStorageKeyEnum, settingValue: any): void {\r\n const companySettings = this.getSetting(SpxStorageKeyEnum.channelSettings);\r\n let storageObj;\r\n\r\n if (companySettings) {\r\n storageObj = JSON.parse(companySettings);\r\n } else {\r\n storageObj = {};\r\n }\r\n\r\n if (!storageObj[this.channelId]) {\r\n storageObj[this.channelId] = {};\r\n }\r\n\r\n storageObj[this.channelId][key] = settingValue;\r\n this.setSetting(SpxStorageKeyEnum.channelSettings, JSON.stringify(storageObj));\r\n }\r\n}\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"IAAY;AAAZ,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,eAAA,CAAA,GAAA,eAA+B;AAC/B,IAAA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAA2B;AAC3B,IAAA,iBAAA,CAAA,uBAAA,CAAA,GAAA,uBAA+C;AAC/C,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,YAAA,CAAA,GAAA,YAAyB;AACzB,IAAA,iBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC;AACnC,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACrC,IAAA,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAiC;AACjC,IAAA,iBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,iBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACnB,CAAC,EAfW,iBAAiB,KAA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rC;YACH,UAAU,GAAG,EAAE;;QAGnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AAC7B,YAAA,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;;QAGnC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,YAAY;AAC9C,QAAA,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;;AAErF;;ACnDD;;AAEG;;;;"}
@@ -0,0 +1,135 @@
1
+ import * as i0 from '@angular/core';
2
+ import { signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i2 from '@angular/forms';
4
+ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
5
+ import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
6
+ import { SpxFormButtonTypeEnum, SpxFormViewComponent } from '@softpak/components/spx-form-view';
7
+ import { valuePairToValue, SpxSeverityEnum, unsubscribeSubscriptions } from '@softpak/components/spx-helpers';
8
+ import { SpxInputTypeEnum } from '@softpak/components/spx-inputs';
9
+ import { spxValidatorRequired } from '@softpak/components/spx-validation';
10
+ import { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';
11
+ import { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';
12
+ import { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';
13
+ import { TranslatePipe } from '@ngx-translate/core';
14
+ import { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
15
+ import { spxChannelReducer, spxChannelActions } from '@softpak/components/spx-channel-selection';
16
+ import * as i1 from '@ngrx/store';
17
+
18
+ const spxSectionWelcome = 'welcome';
19
+ const spxCtrlChannel = 'channel';
20
+ const spxCtrlChannelType = 'channelType';
21
+ class SpxWelcomeComponent {
22
+ constructor(store, formBuilder) {
23
+ this.store = store;
24
+ this.formBuilder = formBuilder;
25
+ this.channels = signal([]);
26
+ this.formGroup = signal(undefined);
27
+ this.suggestions = signal({
28
+ [spxCtrlChannelType]: [],
29
+ [spxCtrlChannel]: [],
30
+ });
31
+ this.textChannel = spxTextChannel;
32
+ this.textCompany = spxTextCompany;
33
+ this.textSelect = spxTextSelect;
34
+ this.textSelectYourCompany = spxTextSelectYourCompany;
35
+ this.formSection = computed(() => this.formGroup()?.get("welc"));
36
+ this.ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel));
37
+ this.ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType));
38
+ this.subscriptions = {};
39
+ this.form = signal({
40
+ buttons: [
41
+ {
42
+ severity: SpxSeverityEnum.success,
43
+ type: SpxFormButtonTypeEnum.submit,
44
+ label: () => this.textSelect,
45
+ }
46
+ ],
47
+ sections: [
48
+ {
49
+ key: spxSectionWelcome,
50
+ showTitle: () => false,
51
+ fields: [
52
+ {
53
+ key: spxCtrlChannel,
54
+ type: () => SpxInputTypeEnum.radio,
55
+ label: () => this.textCompany,
56
+ validators: () => [spxValidatorRequired()],
57
+ },
58
+ {
59
+ key: spxCtrlChannelType,
60
+ type: () => SpxInputTypeEnum.radio,
61
+ label: () => this.textChannel,
62
+ capitalize: () => true,
63
+ show: () => valuePairToValue(this.ctrlChannel().value),
64
+ validators: () => [spxValidatorRequired()],
65
+ },
66
+ ]
67
+ }
68
+ ]
69
+ });
70
+ this.formGroup.set(this.formBuilder.group({
71
+ [spxSectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form().sections)
72
+ }));
73
+ }
74
+ ngOnDestroy() {
75
+ unsubscribeSubscriptions(this.subscriptions);
76
+ }
77
+ ngOnInit() {
78
+ let channels = [];
79
+ this.subscriptions.channels = this.store.select(spxChannelReducer.default.selectChannels).subscribe(channelsD => {
80
+ channels = channelsD;
81
+ this.channels.set(channels);
82
+ this.suggestions()[spxCtrlChannel] = channels.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));
83
+ });
84
+ this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {
85
+ const brandFound = channels.find(c => c.brand === valuePairToValue(valuePair));
86
+ this.suggestions()[spxCtrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({
87
+ description: channelType.name,
88
+ value: channelType.name
89
+ }));
90
+ this.ctrlChannelType().setValue({
91
+ value: SpxAppChannelTypeEnum.production,
92
+ });
93
+ });
94
+ }
95
+ onSubmit() {
96
+ const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel().value));
97
+ const channelType = valuePairToValue(this.ctrlChannelType().value);
98
+ if (!channel) {
99
+ this.store.dispatch(spxToasterActions.createWarning({
100
+ autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,
101
+ messageText: 'Please select a company',
102
+ }));
103
+ }
104
+ else {
105
+ this.store.dispatch(spxChannelActions.choose({
106
+ channel,
107
+ channelType,
108
+ }));
109
+ }
110
+ }
111
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxWelcomeComponent, deps: [{ token: i1.Store }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
112
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.0", type: SpxWelcomeComponent, isStandalone: true, selector: "spx-welcome", ngImport: i0, template: "<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>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "component", type: SpxFormViewComponent, selector: "spx-form-view", inputs: ["spxFormGroup", "spxForm", "spxSuggestions"], outputs: ["spxBlur", "spxClick", "spxSearch"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
113
+ }
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
115
+ type: Component,
116
+ args: [{ selector: 'spx-welcome', imports: [
117
+ FormsModule,
118
+ ReactiveFormsModule,
119
+ SpxCapitalizePipe,
120
+ SpxFormViewComponent,
121
+ IonHeader,
122
+ IonToolbar,
123
+ IonTitle,
124
+ IonButtons,
125
+ IonContent,
126
+ TranslatePipe,
127
+ ], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<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>" }]
128
+ }], ctorParameters: () => [{ type: i1.Store }, { type: i2.FormBuilder }] });
129
+
130
+ /**
131
+ * Generated bundle index. Do not edit.
132
+ */
133
+
134
+ export { SpxWelcomeComponent, spxCtrlChannel, spxCtrlChannelType, spxSectionWelcome };
135
+ //# sourceMappingURL=softpak-components-spx-welcome.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"softpak-components-spx-welcome.mjs","sources":["../../../../projects/softpak/components/spx-welcome/spx-welcome.component.ts","../../../../projects/softpak/components/spx-welcome/spx-welcome.component.html","../../../../projects/softpak/components/spx-welcome/softpak-components-spx-welcome.ts"],"sourcesContent":["import { Component, OnInit, OnDestroy, signal, computed, ChangeDetectionStrategy } 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 { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\r\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\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\nimport { spxChannelReducer, spxChannelActions } from '@softpak/components/spx-channel-selection';\r\n\r\nexport const spxSectionWelcome = 'welcome';\r\nexport const spxCtrlChannel = 'channel';\r\nexport const spxCtrlChannelType = 'channelType';\r\n\r\n@Component({\r\n selector: 'spx-welcome',\r\n templateUrl: './spx-welcome.component.html',\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 changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n})\r\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\r\n private readonly channels = signal<SpxAppChannelI[]>([]);\r\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\r\n protected readonly suggestions = signal<{\r\n [spxCtrlChannelType]?: SpxValuePair<string>[];\r\n [spxCtrlChannel]?: SpxValuePair<string>[];\r\n}>({\r\n [spxCtrlChannelType]: [],\r\n [spxCtrlChannel]: [],\r\n });\r\n\r\n textChannel = spxTextChannel;\r\n textCompany = spxTextCompany;\r\n textSelect = spxTextSelect;\r\n textSelectYourCompany = spxTextSelectYourCompany;\r\n\r\n protected readonly formSection = computed(() => this.formGroup()?.get(\"welc\") as FormGroup);\r\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\r\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\r\n private subscriptions: {\r\n channel?: Subscription;\r\n channels?: Subscription;\r\n } = {};\r\n\r\n protected readonly form = signal<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: spxSectionWelcome,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: spxCtrlChannel,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textCompany,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: spxCtrlChannelType,\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 store: Store,\r\n private readonly formBuilder: FormBuilder\r\n ) {\r\n this.formGroup.set(this.formBuilder.group({\r\n [spxSectionWelcome]: 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 let channels: SpxAppChannelI[] = [];\r\n\r\n this.subscriptions.channels = this.store.select(spxChannelReducer.default.selectChannels).subscribe(channelsD => {\r\n channels = channelsD;\r\n this.channels.set(channels);\r\n this.suggestions()[spxCtrlChannel] = channels.filter(channel => channel.channelTypes.map(type => type.name).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 = channels.find(c => c.brand === valuePairToValue(valuePair));\r\n this.suggestions()[spxCtrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({\r\n description: channelType.name,\r\n value: channelType.name\r\n }));\r\n this.ctrlChannelType().setValue({\r\n value: SpxAppChannelTypeEnum.production,\r\n });\r\n });\r\n }\r\n\r\n protected 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.store.dispatch(spxToasterActions.createWarning({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: 'Please select a company',\r\n }))\r\n } else {\r\n this.store.dispatch(spxChannelActions.choose({\r\n channel,\r\n channelType,\r\n }));\r\n }\r\n }\r\n}\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>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;MAoBrB,mBAAmB,CAAA;IAwD9B,WACmB,CAAA,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAK,CAAA,KAAA,GAAL,KAAK;QACL,IAAW,CAAA,WAAA,GAAX,WAAW;AAzDb,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAmB,EAAE,CAAC;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAwB,SAAS,CAAC;QACpD,IAAW,CAAA,WAAA,GAAG,MAAM,CAGtC;YACC,CAAC,kBAAkB,GAAG,EAAE;YACxB,CAAC,cAAc,GA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A,EAAA,cAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACV,aAAa,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKJ,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAlB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAEd,OAAA,EAAA;wBACP,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,oBAAoB;wBACpB,SAAS;wBACT,UAAU;wBACV,QAAQ;wBACR,UAAU;wBACV,UAAU;wBACV,aAAa;AACd,qBAAA,EAAA,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,QAAA,EAAA,8jBAAA,EAAA;;;AEpClB;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softpak/components",
3
- "version": "20.0.2",
3
+ "version": "20.2.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "19.x.x || 20.x.x",
@@ -10,8 +10,8 @@
10
10
  "@capacitor/live-updates": "0.3.x || 0.4.x",
11
11
  "@fortawesome/free-solid-svg-icons": "6.x.x",
12
12
  "@ionic/angular": "8.x.x",
13
- "@ngrx/effects": "19.x.x",
14
- "@ngrx/store": "19.x.x",
13
+ "@ngrx/effects": "19.x.x || 20.x.x",
14
+ "@ngrx/store": "19.x.x || 20.x.x",
15
15
  "@ngx-translate/core": "16.x.x",
16
16
  "@sentry/angular": "9.x.x"
17
17
  },
@@ -32,22 +32,22 @@
32
32
  "types": "./index.d.ts",
33
33
  "default": "./fesm2022/softpak-components.mjs"
34
34
  },
35
- "./spx-404-page": {
36
- "types": "./spx-404-page/index.d.ts",
37
- "default": "./fesm2022/softpak-components-spx-404-page.mjs"
38
- },
39
- "./spx-app-configuration": {
40
- "types": "./spx-app-configuration/index.d.ts",
41
- "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
42
- },
43
35
  "./spx-alert": {
44
36
  "types": "./spx-alert/index.d.ts",
45
37
  "default": "./fesm2022/softpak-components-spx-alert.mjs"
46
38
  },
39
+ "./spx-404-page": {
40
+ "types": "./spx-404-page/index.d.ts",
41
+ "default": "./fesm2022/softpak-components-spx-404-page.mjs"
42
+ },
47
43
  "./spx-app-expiry": {
48
44
  "types": "./spx-app-expiry/index.d.ts",
49
45
  "default": "./fesm2022/softpak-components-spx-app-expiry.mjs"
50
46
  },
47
+ "./spx-app-configuration": {
48
+ "types": "./spx-app-configuration/index.d.ts",
49
+ "default": "./fesm2022/softpak-components-spx-app-configuration.mjs"
50
+ },
51
51
  "./spx-button": {
52
52
  "types": "./spx-button/index.d.ts",
53
53
  "default": "./fesm2022/softpak-components-spx-button.mjs"
@@ -84,22 +84,18 @@
84
84
  "types": "./spx-form-view/index.d.ts",
85
85
  "default": "./fesm2022/softpak-components-spx-form-view.mjs"
86
86
  },
87
- "./spx-helpers": {
88
- "types": "./spx-helpers/index.d.ts",
89
- "default": "./fesm2022/softpak-components-spx-helpers.mjs"
90
- },
91
87
  "./spx-inputs": {
92
88
  "types": "./spx-inputs/index.d.ts",
93
89
  "default": "./fesm2022/softpak-components-spx-inputs.mjs"
94
90
  },
91
+ "./spx-helpers": {
92
+ "types": "./spx-helpers/index.d.ts",
93
+ "default": "./fesm2022/softpak-components-spx-helpers.mjs"
94
+ },
95
95
  "./spx-navigation": {
96
96
  "types": "./spx-navigation/index.d.ts",
97
97
  "default": "./fesm2022/softpak-components-spx-navigation.mjs"
98
98
  },
99
- "./spx-number-check": {
100
- "types": "./spx-number-check/index.d.ts",
101
- "default": "./fesm2022/softpak-components-spx-number-check.mjs"
102
- },
103
99
  "./spx-pagination": {
104
100
  "types": "./spx-pagination/index.d.ts",
105
101
  "default": "./fesm2022/softpak-components-spx-pagination.mjs"
@@ -108,17 +104,17 @@
108
104
  "types": "./spx-pipes/index.d.ts",
109
105
  "default": "./fesm2022/softpak-components-spx-pipes.mjs"
110
106
  },
111
- "./spx-patch": {
112
- "types": "./spx-patch/index.d.ts",
113
- "default": "./fesm2022/softpak-components-spx-patch.mjs"
107
+ "./spx-progress-bar": {
108
+ "types": "./spx-progress-bar/index.d.ts",
109
+ "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
114
110
  },
115
111
  "./spx-spinner": {
116
112
  "types": "./spx-spinner/index.d.ts",
117
113
  "default": "./fesm2022/softpak-components-spx-spinner.mjs"
118
114
  },
119
- "./spx-progress-bar": {
120
- "types": "./spx-progress-bar/index.d.ts",
121
- "default": "./fesm2022/softpak-components-spx-progress-bar.mjs"
115
+ "./spx-storage": {
116
+ "types": "./spx-storage/index.d.ts",
117
+ "default": "./fesm2022/softpak-components-spx-storage.mjs"
122
118
  },
123
119
  "./spx-suggestion": {
124
120
  "types": "./spx-suggestion/index.d.ts",
@@ -128,10 +124,6 @@
128
124
  "types": "./spx-tabs/index.d.ts",
129
125
  "default": "./fesm2022/softpak-components-spx-tabs.mjs"
130
126
  },
131
- "./spx-stock-info": {
132
- "types": "./spx-stock-info/index.d.ts",
133
- "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
134
- },
135
127
  "./spx-toaster": {
136
128
  "types": "./spx-toaster/index.d.ts",
137
129
  "default": "./fesm2022/softpak-components-spx-toaster.mjs"
@@ -140,25 +132,37 @@
140
132
  "types": "./spx-toggle/index.d.ts",
141
133
  "default": "./fesm2022/softpak-components-spx-toggle.mjs"
142
134
  },
143
- "./spx-storage": {
144
- "types": "./spx-storage/index.d.ts",
145
- "default": "./fesm2022/softpak-components-spx-storage.mjs"
135
+ "./spx-translate": {
136
+ "types": "./spx-translate/index.d.ts",
137
+ "default": "./fesm2022/softpak-components-spx-translate.mjs"
146
138
  },
147
139
  "./spx-update": {
148
140
  "types": "./spx-update/index.d.ts",
149
141
  "default": "./fesm2022/softpak-components-spx-update.mjs"
150
142
  },
151
- "./spx-validation-messages": {
152
- "types": "./spx-validation-messages/index.d.ts",
153
- "default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
143
+ "./spx-number-check": {
144
+ "types": "./spx-number-check/index.d.ts",
145
+ "default": "./fesm2022/softpak-components-spx-number-check.mjs"
154
146
  },
155
- "./spx-translate": {
156
- "types": "./spx-translate/index.d.ts",
157
- "default": "./fesm2022/softpak-components-spx-translate.mjs"
147
+ "./spx-stock-info": {
148
+ "types": "./spx-stock-info/index.d.ts",
149
+ "default": "./fesm2022/softpak-components-spx-stock-info.mjs"
150
+ },
151
+ "./spx-patch": {
152
+ "types": "./spx-patch/index.d.ts",
153
+ "default": "./fesm2022/softpak-components-spx-patch.mjs"
158
154
  },
159
155
  "./spx-validation": {
160
156
  "types": "./spx-validation/index.d.ts",
161
157
  "default": "./fesm2022/softpak-components-spx-validation.mjs"
158
+ },
159
+ "./spx-validation-messages": {
160
+ "types": "./spx-validation-messages/index.d.ts",
161
+ "default": "./fesm2022/softpak-components-spx-validation-messages.mjs"
162
+ },
163
+ "./spx-welcome": {
164
+ "types": "./spx-welcome/index.d.ts",
165
+ "default": "./fesm2022/softpak-components-spx-welcome.mjs"
162
166
  }
163
167
  }
164
168
  }
@@ -22,12 +22,17 @@ declare enum SpxAppChannelTypeEnum {
22
22
  development = "Development"
23
23
  }
24
24
 
25
+ interface SpxChannelTypeI {
26
+ name: SpxAppChannelTypeEnum;
27
+ webUrl?: string;
28
+ }
29
+
25
30
  interface SpxAppChannelI {
26
31
  backendCompanyCode: string;
27
32
  brand: string;
28
33
  catalogFileName: string;
29
34
  catalogPrefix: string;
30
- channelTypes: SpxAppChannelTypeEnum[];
35
+ channelTypes: SpxChannelTypeI[];
31
36
  default?: boolean;
32
37
  serviceURI: string;
33
38
  }
@@ -63,4 +68,4 @@ interface SpxAppConfigI {
63
68
  }
64
69
 
65
70
  export { SpxAppChannelTypeEnum, SpxAppIdEnum, SpxAppLangEnum };
66
- export type { SpxAppAlertI, SpxAppBundleSetI, SpxAppChannelI, SpxAppConfigI };
71
+ export type { SpxAppAlertI, SpxAppBundleSetI, SpxAppChannelI, SpxAppConfigI, SpxChannelTypeI };
@@ -1,83 +1,38 @@
1
- import { Router } from '@angular/router';
2
1
  import * as i0 from '@angular/core';
3
- import { OnInit, OnDestroy } from '@angular/core';
4
- import * as rxjs from 'rxjs';
5
2
  import * as _softpak_components_spx_app_configuration from '@softpak/components/spx-app-configuration';
6
- import { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
3
+ import { SpxAppChannelI, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';
7
4
  import * as _ngrx_store from '@ngrx/store';
8
- import { Store } from '@ngrx/store';
9
- import { NavController } from '@ionic/angular';
10
- import { FormBuilder, FormGroup, FormControl } from '@angular/forms';
11
- import { SpxFormI } from '@softpak/components/spx-form-view';
12
- import { SpxValuePair } from '@softpak/components/spx-inputs';
13
5
  import * as _ngrx_effects from '@ngrx/effects';
14
6
  import { Actions as Actions$1 } from '@ngrx/effects';
7
+ import * as rxjs from 'rxjs';
8
+ import { Router } from '@angular/router';
15
9
  import { SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';
16
10
 
17
11
  declare class SpxChannelGuard {
18
- router: Router;
19
- constructor(router: Router);
12
+ private readonly router;
20
13
  canActivate(): boolean;
21
14
  static ɵfac: i0.ɵɵFactoryDeclaration<SpxChannelGuard, never>;
22
15
  static ɵprov: i0.ɵɵInjectableDeclaration<SpxChannelGuard>;
23
16
  }
24
17
 
18
+ declare const spxChannelSelectionUrl = "wlc";
25
19
  declare class SpxChannelIndicatorComponent {
26
- private navController;
27
- private store;
28
- channel: rxjs.Observable<_softpak_components_spx_app_configuration.SpxAppChannelI | null>;
29
- channelType: rxjs.Observable<_softpak_components_spx_app_configuration.SpxAppChannelTypeEnum | null>;
30
- spxTextChange: string;
31
- constructor(navController: NavController, store: Store);
32
- onChange(): void;
20
+ private readonly navController;
21
+ private readonly store;
22
+ protected readonly channel: i0.Signal<_softpak_components_spx_app_configuration.SpxAppChannelI | null | undefined>;
23
+ protected readonly channelType: i0.Signal<_softpak_components_spx_app_configuration.SpxAppChannelTypeEnum | undefined>;
24
+ protected readonly spxTextChange = "spxTextChange";
25
+ protected onChange(): void;
33
26
  static ɵfac: i0.ɵɵFactoryDeclaration<SpxChannelIndicatorComponent, never>;
34
27
  static ɵcmp: i0.ɵɵComponentDeclaration<SpxChannelIndicatorComponent, "spx-channel-indicator", never, {}, {}, never, never, true, never>;
35
28
  }
36
29
 
37
- declare const spxCectionWelcome = "welcome";
38
- declare const spxCtrlChannel = "channel";
39
- declare const spxCtrlChannelType = "channelType";
40
- interface SpxWelcomeValueI {
41
- [spxCtrlChannel]?: SpxAppChannelI;
42
- [spxCtrlChannelType]: SpxAppChannelTypeEnum;
43
- }
44
- declare class SpxWelcomeComponent implements OnInit, OnDestroy {
45
- private readonly appStore;
46
- readonly formBuilder: FormBuilder;
47
- channels: i0.WritableSignal<SpxAppChannelI[]>;
48
- filteredCompanies: i0.Signal<{
49
- description: string;
50
- value: string;
51
- }[]>;
52
- channelTypes: SpxAppChannelTypeEnum[];
53
- formGroup: FormGroup;
54
- textChannel: string;
55
- textCompany: string;
56
- textSelect: string;
57
- textSelectYourCompany: string;
58
- suggestions: {
59
- [spxCtrlChannelType]?: SpxValuePair<string>[];
60
- [spxCtrlChannel]?: SpxValuePair<string>[];
61
- };
62
- get formSection(): FormGroup;
63
- get ctrlChannel(): FormControl;
64
- get ctrlChannelType(): FormControl;
65
- private subscriptions;
66
- form: SpxFormI;
67
- constructor(appStore: Store, formBuilder: FormBuilder);
68
- ngOnDestroy(): void;
69
- ngOnInit(): void;
70
- onSubmit(): void;
71
- static ɵfac: i0.ɵɵFactoryDeclaration<SpxWelcomeComponent, never>;
72
- static ɵcmp: i0.ɵɵComponentDeclaration<SpxWelcomeComponent, "spx-welcome", never, {}, {}, never, never, true, never>;
73
- }
74
-
75
30
  declare const choose: _ngrx_store.ActionCreator<"[SPX / Channel] Select", (props: {
76
31
  channel: SpxAppChannelI;
77
- channelType: SpxAppChannelTypeEnum;
32
+ channelType: SpxChannelTypeI;
78
33
  }) => {
79
34
  channel: SpxAppChannelI;
80
- channelType: SpxAppChannelTypeEnum;
35
+ channelType: SpxChannelTypeI;
81
36
  } & _ngrx_store.Action<"[SPX / Channel] Select">>;
82
37
  declare const initialize: _ngrx_store.ActionCreator<"[SPX / Channel] Initialize", (props: {
83
38
  channels: SpxAppChannelI[];
@@ -86,7 +41,7 @@ declare const initialize: _ngrx_store.ActionCreator<"[SPX / Channel] Initialize"
86
41
  } & _ngrx_store.Action<"[SPX / Channel] Initialize">>;
87
42
  declare const all: ({
88
43
  channel: SpxAppChannelI;
89
- channelType: SpxAppChannelTypeEnum;
44
+ channelType: SpxChannelTypeI;
90
45
  } & _ngrx_store.Action<"[SPX / Channel] Select">) | ({
91
46
  channels: SpxAppChannelI[];
92
47
  } & _ngrx_store.Action<"[SPX / Channel] Initialize">);
@@ -122,42 +77,28 @@ declare namespace spxChannel_effects_d {
122
77
  };
123
78
  }
124
79
 
80
+ declare const initialState: StateI;
125
81
  interface StateI {
126
82
  previousChannel: SpxAppChannelI | null;
127
83
  channel: SpxAppChannelI | null;
128
84
  channels: SpxAppChannelI[];
129
- channelType: SpxAppChannelTypeEnum | null;
130
- }
131
-
132
- type spxChannel_state_d_StateI = StateI;
133
- declare namespace spxChannel_state_d {
134
- export type { spxChannel_state_d_StateI as StateI };
135
- }
136
-
137
- declare const initialState: StateI;
138
-
139
- declare const spxChannel_initial_d_initialState: typeof initialState;
140
- declare namespace spxChannel_initial_d {
141
- export {
142
- spxChannel_initial_d_initialState as initialState,
143
- };
85
+ channelType: SpxChannelTypeI | null;
144
86
  }
145
-
146
87
  declare const _default: {
147
88
  name: "spxChannel";
148
89
  reducer: _ngrx_store.ActionReducer<StateI, _ngrx_store.Action<string>>;
149
90
  selectSpxChannelState: _ngrx_store.MemoizedSelector<Record<string, any>, StateI, (featureState: StateI) => StateI>;
150
91
  selectChannel: _ngrx_store.MemoizedSelector<Record<string, any>, SpxAppChannelI | null, (featureState: StateI) => SpxAppChannelI | null>;
151
- selectChannelType: _ngrx_store.MemoizedSelector<Record<string, any>, SpxAppChannelTypeEnum | null, (featureState: StateI) => SpxAppChannelTypeEnum | null>;
92
+ selectChannelType: _ngrx_store.MemoizedSelector<Record<string, any>, SpxChannelTypeI | null, (featureState: StateI) => SpxChannelTypeI | null>;
152
93
  selectChannels: _ngrx_store.MemoizedSelector<Record<string, any>, SpxAppChannelI[], (featureState: StateI) => SpxAppChannelI[]>;
153
94
  selectPreviousChannel: _ngrx_store.MemoizedSelector<Record<string, any>, SpxAppChannelI | null, (featureState: StateI) => SpxAppChannelI | null>;
154
95
  };
155
96
 
97
+ type spxChannel_reducer_d_StateI = StateI;
98
+ declare const spxChannel_reducer_d_initialState: typeof initialState;
156
99
  declare namespace spxChannel_reducer_d {
157
- export {
158
- _default as default,
159
- };
100
+ export { _default as default, spxChannel_reducer_d_initialState as initialState };
101
+ export type { spxChannel_reducer_d_StateI as StateI };
160
102
  }
161
103
 
162
- export { SpxChannelGuard, SpxChannelIndicatorComponent, SpxWelcomeComponent, spxCectionWelcome, spxChannel_actions_d as spxChannelActions, spxChannel_effects_d as spxChannelEffects, spxChannel_initial_d as spxChannelInitial, spxChannel_reducer_d as spxChannelReducer, spxChannel_state_d as spxChannelState, spxCtrlChannel, spxCtrlChannelType };
163
- export type { SpxWelcomeValueI };
104
+ export { SpxChannelGuard, SpxChannelIndicatorComponent, spxChannel_actions_d as spxChannelActions, spxChannel_effects_d as spxChannelEffects, spxChannel_reducer_d as spxChannelReducer, spxChannelSelectionUrl };
@@ -3,6 +3,7 @@ declare enum SpxStorageKeyEnum {
3
3
  brand = "brand",
4
4
  bundleVersion = "bundleVersion",
5
5
  channelType = "channelType",
6
+ channelTypeWithWebUrl = "channelTypeWithWebUrl",
6
7
  channelSettings = "companySettings",
7
8
  liveUpdate = "liveUpdate",
8
9
  platform = "platform",
@@ -0,0 +1,37 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit, OnDestroy } from '@angular/core';
3
+ import { FormGroup, FormBuilder } from '@angular/forms';
4
+ import { Store } from '@ngrx/store';
5
+ import { SpxFormI } from '@softpak/components/spx-form-view';
6
+ import { SpxValuePair } from '@softpak/components/spx-inputs';
7
+
8
+ declare const spxSectionWelcome = "welcome";
9
+ declare const spxCtrlChannel = "channel";
10
+ declare const spxCtrlChannelType = "channelType";
11
+ declare class SpxWelcomeComponent implements OnInit, OnDestroy {
12
+ private readonly store;
13
+ private readonly formBuilder;
14
+ private readonly channels;
15
+ protected readonly formGroup: _angular_core.WritableSignal<FormGroup<any> | undefined>;
16
+ protected readonly suggestions: _angular_core.WritableSignal<{
17
+ channelType?: SpxValuePair<string>[];
18
+ channel?: SpxValuePair<string>[];
19
+ }>;
20
+ textChannel: string;
21
+ textCompany: string;
22
+ textSelect: string;
23
+ textSelectYourCompany: string;
24
+ protected readonly formSection: _angular_core.Signal<FormGroup<any>>;
25
+ private readonly ctrlChannel;
26
+ private readonly ctrlChannelType;
27
+ private subscriptions;
28
+ protected readonly form: _angular_core.WritableSignal<SpxFormI>;
29
+ constructor(store: Store, formBuilder: FormBuilder);
30
+ ngOnDestroy(): void;
31
+ ngOnInit(): void;
32
+ protected onSubmit(): void;
33
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxWelcomeComponent, never>;
34
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxWelcomeComponent, "spx-welcome", never, {}, {}, never, never, true, never>;
35
+ }
36
+
37
+ export { SpxWelcomeComponent, spxCtrlChannel, spxCtrlChannelType, spxSectionWelcome };