@softpak/components 21.3.17 → 21.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/softpak-components-spx-check-digit.mjs +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +3 -3
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +16 -9
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-welcome.mjs +3 -0
- package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
- package/package.json +1 -1
- package/types/softpak-components-spx-form-view.d.ts +4 -0
- package/types/softpak-components-spx-inputs.d.ts +9 -4
- package/types/softpak-components-spx-welcome.d.ts +2 -2
|
@@ -102,6 +102,9 @@ class SpxWelcomeComponent {
|
|
|
102
102
|
type: () => SpxInputTypeEnum.checkbox,
|
|
103
103
|
label: () => this.textDoYouComeHereOften,
|
|
104
104
|
checkboxText: () => this.textFavorite,
|
|
105
|
+
checkboxIcon: () => faHeart,
|
|
106
|
+
checkboxIconClass: () => 'text-red-800',
|
|
107
|
+
checkboxBgClass: () => 'bg-red-100',
|
|
105
108
|
show: () => valuePairToValue(this.ctrlChannel().value),
|
|
106
109
|
defaultValue: () => ({ value: false }),
|
|
107
110
|
},
|
|
@@ -1 +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 { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { spxChannelActions, spxChannelReducer } from '@softpak/components/spx-channel-selection';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxTextChannel, spxTextCompany, spxTextDoYouComeHereOften, spxTextFavorite, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\n\nimport { Capacitor } from '@capacitor/core';\nimport { faHeart } from '@fortawesome/free-solid-svg-icons';\nimport { SpxAppChannelTypeEnum, } from '@softpak/components/spx-app-configuration';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\nexport const spxCtrlFavorite = 'favorite';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n private favouritesVersion = signal(0);\n allBrands = computed(() => {\n this.favouritesVersion();\n const favourites = this.getFavourites();\n const brands = this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({\n description: c.brand,\n value: c.brand,\n ...(favourites.includes(c.brand) ? { icon: faHeart, iconClass: 'text-red-800', bgClass: 'bg-red-100' } : {})\n }));\n return brands?.sort((a, b) => {\n const aFav = favourites.includes(a.value);\n const bFav = favourites.includes(b.value);\n if (aFav && !bFav) return -1;\n if (!aFav && bFav) return 1;\n return a.value.localeCompare(b.value);\n });\n });\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n textDoYouComeHereOften = spxTextDoYouComeHereOften;\n textFavorite = spxTextFavorite;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private readonly ctrlFavorite = computed(() => this.formSection()?.get(spxCtrlFavorite) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n favorite?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlFavorite,\n type: () => SpxInputTypeEnum.checkbox,\n label: () => this.textDoYouComeHereOften,\n checkboxText: () => this.textFavorite,\n show: () => valuePairToValue(this.ctrlChannel().value),\n defaultValue: () => ({ value: false }),\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n const brand = valuePairToValue(valuePair) as string | null;\n this.inputBrand.set(brand);\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n\n const favourites = this.getFavourites();\n const isFavourite = brand ? favourites.includes(brand) : false;\n this.ctrlFavorite().setValue({ value: isFavourite }, { emitEvent: false });\n });\n\n this.subscriptions.favorite = this.ctrlFavorite().valueChanges.subscribe(valuePair => {\n const brand = this.inputBrand();\n if (!brand) return;\n const favourites = this.getFavourites();\n const isFavourite = valuePairToValue(valuePair) as boolean;\n const updated = isFavourite\n ? [...new Set([...favourites, brand])]\n : favourites.filter(f => f !== brand);\n SpxStorage.setSetting(SpxStorageKeyEnum.channelFavourites, JSON.stringify(updated));\n this.favouritesVersion.update(v => v + 1);\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n private getFavourites(): string[] {\n const raw = SpxStorage.getSetting(SpxStorageKeyEnum.channelFavourites);\n if (!raw) return [];\n try { return JSON.parse(raw) as string[]; } catch { return []; }\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,eAAe,GAAG;MAoBlB,mBAAmB,CAAA;IA6F9B,WAAA,CACmB,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,WAAW,GAAX,WAAW;AA9F9B,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CA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EAAA,MAAA,EAAA,IAAA,EANV,iBAAiB,EAAA,IAAA,EAAA,YAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAOjB,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,EAAA,OAAA,EAEd;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,4hBAAA,EAAA;;;AE1ClB;;AAEG;;;;"}
|
|
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 { ChangeDetectionStrategy, Component, OnDestroy, OnInit, computed, signal } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { IonButtons, IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxInputTypeEnum, SpxSuggestionValuePair, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxToasterAutoCloseSpeedEnum, spxToasterActions } from '@softpak/components/spx-toaster';\nimport { spxChannelActions, spxChannelReducer } from '@softpak/components/spx-channel-selection';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxTextChannel, spxTextCompany, spxTextDoYouComeHereOften, spxTextFavorite, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\n\nimport { Capacitor } from '@capacitor/core';\nimport { faHeart } from '@fortawesome/free-solid-svg-icons';\nimport { SpxAppChannelTypeEnum, } from '@softpak/components/spx-app-configuration';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\nexport const spxSectionWelcome = 'welcome';\nexport const spxCtrlChannel = 'channel';\nexport const spxCtrlChannelType = 'channelType';\nexport const spxCtrlFavorite = 'favorite';\n\n@Component({\n selector: 'spx-welcome',\n templateUrl: './spx-welcome.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n allChannels = toSignal(this.store.select(spxChannelReducer.default.selectChannels));\n private favouritesVersion = signal(0);\n allBrands = computed(() => {\n this.favouritesVersion();\n const favourites = this.getFavourites();\n const brands = this.allChannels()?.filter(channel => channel.channelTypes.map(type => type.name).includes(SpxAppChannelTypeEnum.production)).map(c => ({\n description: c.brand,\n value: c.brand,\n ...(favourites.includes(c.brand) ? { icon: faHeart, iconClass: 'text-red-800', bgClass: 'bg-red-100' } : {})\n }));\n return brands?.sort((a, b) => {\n const aFav = favourites.includes(a.value);\n const bFav = favourites.includes(b.value);\n if (aFav && !bFav) return -1;\n if (!aFav && bFav) return 1;\n return a.value.localeCompare(b.value);\n });\n });\n inputBrand = signal<string | null>(null);\n inputChannelType = signal<SpxAppChannelTypeEnum | null>(null);\n selectedBrand = computed(() => this.allChannels()?.find(c => c.brand === this.inputBrand()));\n channelTypeSuggestions = computed(() => this.selectedBrand()?.channelTypes?.filter(channelType => Capacitor.getPlatform() === 'web' ? channelType.webUrl !== undefined : channelType.webUrl === undefined)?.map(channelType => ({\n description: channelType.name,\n value: channelType.name\n })));\n\n protected readonly formGroup = signal<FormGroup | undefined>(undefined);\n protected readonly suggestions = signal<{\n [spxCtrlChannelType]?: SpxValuePair<string>[];\n [spxCtrlChannel]?: SpxSuggestionValuePair<string>[];\n }>({\n [spxCtrlChannelType]: [],\n [spxCtrlChannel]: [],\n });\n\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n textDoYouComeHereOften = spxTextDoYouComeHereOften;\n textFavorite = spxTextFavorite;\n\n protected readonly formSection = computed(() => this.formGroup()?.get(spxSectionWelcome) as FormGroup);\n private readonly ctrlChannel = computed(() => this.formSection()?.get(spxCtrlChannel) as FormControl);\n private readonly ctrlChannelType = computed(() => this.formSection()?.get(spxCtrlChannelType) as FormControl);\n private readonly ctrlFavorite = computed(() => this.formSection()?.get(spxCtrlFavorite) as FormControl);\n private subscriptions: {\n channel?: Subscription;\n channelType?: Subscription;\n favorite?: Subscription;\n } = {};\n\n protected readonly form = signal<SpxFormI>({\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: spxSectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel().value),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlFavorite,\n type: () => SpxInputTypeEnum.checkbox,\n label: () => this.textDoYouComeHereOften,\n checkboxText: () => this.textFavorite,\n checkboxIcon: () => faHeart,\n checkboxIconClass: () => 'text-red-800',\n checkboxBgClass: () => 'bg-red-100',\n show: () => valuePairToValue(this.ctrlChannel().value),\n defaultValue: () => ({ value: false }),\n },\n ]\n }\n ]\n });\n\n constructor(\n private readonly store: Store,\n private readonly formBuilder: FormBuilder\n ) {\n this.formGroup.set(this.formBuilder.group({\n [spxSectionWelcome]: SpxFormViewComponent.createForm(this.form())\n }));\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n\n this.subscriptions.channel = this.ctrlChannel().valueChanges.subscribe(valuePair => {\n const brand = valuePairToValue(valuePair) as string | null;\n this.inputBrand.set(brand);\n this.suggestions()[spxCtrlChannelType] = this.channelTypeSuggestions();\n this.ctrlChannelType().setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n\n const favourites = this.getFavourites();\n const isFavourite = brand ? favourites.includes(brand) : false;\n this.ctrlFavorite().setValue({ value: isFavourite }, { emitEvent: false });\n });\n\n this.subscriptions.favorite = this.ctrlFavorite().valueChanges.subscribe(valuePair => {\n const brand = this.inputBrand();\n if (!brand) return;\n const favourites = this.getFavourites();\n const isFavourite = valuePairToValue(valuePair) as boolean;\n const updated = isFavourite\n ? [...new Set([...favourites, brand])]\n : favourites.filter(f => f !== brand);\n SpxStorage.setSetting(SpxStorageKeyEnum.channelFavourites, JSON.stringify(updated));\n this.favouritesVersion.update(v => v + 1);\n this.suggestions()[spxCtrlChannel] = this.allBrands();\n });\n\n this.subscriptions.channelType = this.ctrlChannelType().valueChanges.subscribe(valuePair => {\n this.inputChannelType.set(valuePairToValue(this.ctrlChannelType().value));\n });\n }\n\n private getFavourites(): string[] {\n const raw = SpxStorage.getSetting(SpxStorageKeyEnum.channelFavourites);\n if (!raw) return [];\n try { return JSON.parse(raw) as string[]; } catch { return []; }\n }\n\n protected onSubmit(): void {\n if (!this.selectedBrand() || !this.inputChannelType()) {\n this.store.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.store.dispatch(spxChannelActions.choose({\n channel: this.selectedBrand()!,\n channelType: this.inputChannelType()!,\n }));\n }\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-title>\n {{ textSelectYourCompany | translate | capitalize }}\n </ion-title>\n <ion-buttons slot=\"end\">\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n<ion-content class=\"ion-padding\">\n <form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxForm]=\"form()\"\n [spxFormGroup]=\"formSection()\"\n [spxSuggestions]=\"suggestions()\">\n </spx-form-view>\n </form>\n</ion-content>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,cAAc,GAAG;AACvB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,eAAe,GAAG;MAoBlB,mBAAmB,CAAA;IAgG9B,WAAA,CACmB,KAAY,EACZ,WAAwB,EAAA;QADxB,IAAA,CAAA,KAAK,GAAL,KAAK;QACL,IAAA,CAAA,WAAW,GAAX,WAAW;AAjG9B,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAC3E,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,CAAC,6DAAC;AACrC,QAAA,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAK;YAC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EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAOjB,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,EAAA,OAAA,EAEd;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,4hBAAA,EAAA;;;AE1ClB;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SpxSeverityEnum } from '@softpak/components/spx-helpers';
|
|
2
2
|
import { ValidatorFn, AbstractControl, FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { IconDefinition } from '@fortawesome/angular-fontawesome';
|
|
3
4
|
import { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';
|
|
4
5
|
import * as _angular_core from '@angular/core';
|
|
5
6
|
import { ElementRef } from '@angular/core';
|
|
@@ -33,6 +34,9 @@ interface SpxFormFieldI {
|
|
|
33
34
|
defaultValidators?: () => ValidatorFn[];
|
|
34
35
|
defaultValue?: () => SpxValuePair<string | number | boolean> | null;
|
|
35
36
|
checkboxText?: () => string;
|
|
37
|
+
checkboxIcon?: () => IconDefinition;
|
|
38
|
+
checkboxIconClass?: () => string;
|
|
39
|
+
checkboxBgClass?: () => string;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
interface SpxFormSectionI {
|
|
@@ -9,6 +9,8 @@ import { ModalController } from '@ionic/angular/standalone';
|
|
|
9
9
|
interface SpxValuePair<A> {
|
|
10
10
|
description?: string | null;
|
|
11
11
|
value: A;
|
|
12
|
+
}
|
|
13
|
+
interface SpxSuggestionValuePair<A> extends SpxValuePair<A> {
|
|
12
14
|
icon?: IconDefinition;
|
|
13
15
|
iconClass?: string;
|
|
14
16
|
bgClass?: string;
|
|
@@ -317,13 +319,13 @@ declare class SpxInputNumberComponent {
|
|
|
317
319
|
}
|
|
318
320
|
|
|
319
321
|
declare class SpxInputRadioComponent {
|
|
320
|
-
readonly cachedSuggestions: _angular_core.WritableSignal<
|
|
322
|
+
readonly cachedSuggestions: _angular_core.WritableSignal<SpxSuggestionValuePair<any>[]>;
|
|
321
323
|
readonly focusPosition: _angular_core.WritableSignal<number>;
|
|
322
324
|
readonly spxName: _angular_core.InputSignal<string | undefined>;
|
|
323
325
|
readonly spxValidators: _angular_core.InputSignal<any[] | undefined>;
|
|
324
326
|
readonly spxShowLabel: _angular_core.InputSignal<boolean>;
|
|
325
327
|
readonly spxReadonly: _angular_core.InputSignal<true | undefined>;
|
|
326
|
-
readonly spxSuggestions: _angular_core.InputSignal<
|
|
328
|
+
readonly spxSuggestions: _angular_core.InputSignal<SpxSuggestionValuePair<any>[]>;
|
|
327
329
|
readonly value: _angular_core.ModelSignal<SpxValuePair<any> | undefined>;
|
|
328
330
|
readonly selectedInputService: SelectedInputService;
|
|
329
331
|
readonly spxElementId: _angular_core.InputSignal<number | undefined>;
|
|
@@ -405,6 +407,9 @@ declare class SpxInputComponent {
|
|
|
405
407
|
readonly spxCapitalize: _angular_core.InputSignal<boolean>;
|
|
406
408
|
readonly spxCycleConfig: _angular_core.InputSignal<SpxCycleConfig | undefined>;
|
|
407
409
|
readonly spxCheckboxText: _angular_core.InputSignal<string | undefined>;
|
|
410
|
+
readonly spxCheckboxIcon: _angular_core.InputSignal<IconDefinition | undefined>;
|
|
411
|
+
readonly spxCheckboxIconClass: _angular_core.InputSignal<string | undefined>;
|
|
412
|
+
readonly spxCheckboxBgClass: _angular_core.InputSignal<string | undefined>;
|
|
408
413
|
value: _angular_core.WritableSignal<SpxValuePair<any>>;
|
|
409
414
|
spxClear: _angular_core.OutputEmitterRef<void>;
|
|
410
415
|
spxEdit: _angular_core.OutputEmitterRef<void>;
|
|
@@ -462,8 +467,8 @@ declare class SpxInputComponent {
|
|
|
462
467
|
registerOnChange(fn: (value: any) => void): void;
|
|
463
468
|
registerOnTouched(fn: () => void): void;
|
|
464
469
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SpxInputComponent, never>;
|
|
465
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxInputComponent, "spx-input", never, { "spxSpeedDial": { "alias": "spxSpeedDial"; "required": false; "isSignal": true; }; "spxLabel": { "alias": "spxLabel"; "required": false; "isSignal": true; }; "spxMax": { "alias": "spxMax"; "required": false; "isSignal": true; }; "spxMin": { "alias": "spxMin"; "required": false; "isSignal": true; }; "spxName": { "alias": "spxName"; "required": false; "isSignal": true; }; "spxReadonly": { "alias": "spxReadonly"; "required": false; "isSignal": true; }; "spxAutocomplete": { "alias": "spxAutocomplete"; "required": false; "isSignal": true; }; "spxAutofocus": { "alias": "spxAutofocus"; "required": false; "isSignal": true; }; "spxInputMode": { "alias": "spxInputMode"; "required": false; "isSignal": true; }; "spxPattern": { "alias": "spxPattern"; "required": false; "isSignal": true; }; "spxRequired": { "alias": "spxRequired"; "required": false; "isSignal": true; }; "spxSelectMonth": { "alias": "spxSelectMonth"; "required": false; "isSignal": true; }; "spxSelectDay": { "alias": "spxSelectDay"; "required": false; "isSignal": true; }; "spxShowEdit": { "alias": "spxShowEdit"; "required": false; "isSignal": true; }; "spxShowHelp": { "alias": "spxShowHelp"; "required": false; "isSignal": true; }; "spxLeftIcon": { "alias": "spxLeftIcon"; "required": false; "isSignal": true; }; "spxShowLabel": { "alias": "spxShowLabel"; "required": false; "isSignal": true; }; "spxCompact": { "alias": "spxCompact"; "required": false; "isSignal": true; }; "spxShowClear": { "alias": "spxShowClear"; "required": false; "isSignal": true; }; "spxShowSearch": { "alias": "spxShowSearch"; "required": false; "isSignal": true; }; "spxAlert": { "alias": "spxAlert"; "required": false; "isSignal": true; }; "spxShowValidationMessages": { "alias": "spxShowValidationMessages"; "required": false; "isSignal": true; }; "spxStep": { "alias": "spxStep"; "required": false; "isSignal": true; }; "spxSuggestions": { "alias": "spxSuggestions"; "required": false; "isSignal": true; }; "spxType": { "alias": "spxType"; "required": false; "isSignal": true; }; "spxValidators": { "alias": "spxValidators"; "required": false; "isSignal": true; }; "spxCapitalize": { "alias": "spxCapitalize"; "required": false; "isSignal": true; }; "spxCycleConfig": { "alias": "spxCycleConfig"; "required": false; "isSignal": true; }; "spxCheckboxText": { "alias": "spxCheckboxText"; "required": false; "isSignal": true; }; }, { "spxClear": "spxClear"; "spxEdit": "spxEdit"; "spxHelp": "spxHelp"; "spxSearch": "spxSearch"; "spxBlur": "spxBlur"; }, never, ["[spxInputLeftIcon]", "*"], true, never>;
|
|
470
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SpxInputComponent, "spx-input", never, { "spxSpeedDial": { "alias": "spxSpeedDial"; "required": false; "isSignal": true; }; "spxLabel": { "alias": "spxLabel"; "required": false; "isSignal": true; }; "spxMax": { "alias": "spxMax"; "required": false; "isSignal": true; }; "spxMin": { "alias": "spxMin"; "required": false; "isSignal": true; }; "spxName": { "alias": "spxName"; "required": false; "isSignal": true; }; "spxReadonly": { "alias": "spxReadonly"; "required": false; "isSignal": true; }; "spxAutocomplete": { "alias": "spxAutocomplete"; "required": false; "isSignal": true; }; "spxAutofocus": { "alias": "spxAutofocus"; "required": false; "isSignal": true; }; "spxInputMode": { "alias": "spxInputMode"; "required": false; "isSignal": true; }; "spxPattern": { "alias": "spxPattern"; "required": false; "isSignal": true; }; "spxRequired": { "alias": "spxRequired"; "required": false; "isSignal": true; }; "spxSelectMonth": { "alias": "spxSelectMonth"; "required": false; "isSignal": true; }; "spxSelectDay": { "alias": "spxSelectDay"; "required": false; "isSignal": true; }; "spxShowEdit": { "alias": "spxShowEdit"; "required": false; "isSignal": true; }; "spxShowHelp": { "alias": "spxShowHelp"; "required": false; "isSignal": true; }; "spxLeftIcon": { "alias": "spxLeftIcon"; "required": false; "isSignal": true; }; "spxShowLabel": { "alias": "spxShowLabel"; "required": false; "isSignal": true; }; "spxCompact": { "alias": "spxCompact"; "required": false; "isSignal": true; }; "spxShowClear": { "alias": "spxShowClear"; "required": false; "isSignal": true; }; "spxShowSearch": { "alias": "spxShowSearch"; "required": false; "isSignal": true; }; "spxAlert": { "alias": "spxAlert"; "required": false; "isSignal": true; }; "spxShowValidationMessages": { "alias": "spxShowValidationMessages"; "required": false; "isSignal": true; }; "spxStep": { "alias": "spxStep"; "required": false; "isSignal": true; }; "spxSuggestions": { "alias": "spxSuggestions"; "required": false; "isSignal": true; }; "spxType": { "alias": "spxType"; "required": false; "isSignal": true; }; "spxValidators": { "alias": "spxValidators"; "required": false; "isSignal": true; }; "spxCapitalize": { "alias": "spxCapitalize"; "required": false; "isSignal": true; }; "spxCycleConfig": { "alias": "spxCycleConfig"; "required": false; "isSignal": true; }; "spxCheckboxText": { "alias": "spxCheckboxText"; "required": false; "isSignal": true; }; "spxCheckboxIcon": { "alias": "spxCheckboxIcon"; "required": false; "isSignal": true; }; "spxCheckboxIconClass": { "alias": "spxCheckboxIconClass"; "required": false; "isSignal": true; }; "spxCheckboxBgClass": { "alias": "spxCheckboxBgClass"; "required": false; "isSignal": true; }; }, { "spxClear": "spxClear"; "spxEdit": "spxEdit"; "spxHelp": "spxHelp"; "spxSearch": "spxSearch"; "spxBlur": "spxBlur"; }, never, ["[spxInputLeftIcon]", "*"], true, never>;
|
|
466
471
|
}
|
|
467
472
|
|
|
468
473
|
export { SpxInputBoxComponent, SpxInputComponent, SpxInputLeftIconDirective, SpxInputTextComponent, SpxInputTypeEnum };
|
|
469
|
-
export type { SpxCycleConfig, SpxInputAlertI, SpxInputLeftIcon, SpxSpeedDial, SpxValuePair };
|
|
474
|
+
export type { SpxCycleConfig, SpxInputAlertI, SpxInputLeftIcon, SpxSpeedDial, SpxSuggestionValuePair, SpxValuePair };
|
|
@@ -5,7 +5,7 @@ import * as _softpak_components_spx_app_configuration from '@softpak/components/
|
|
|
5
5
|
import { SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';
|
|
6
6
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
|
7
7
|
import { SpxFormI } from '@softpak/components/spx-form-view';
|
|
8
|
-
import { SpxValuePair } from '@softpak/components/spx-inputs';
|
|
8
|
+
import { SpxValuePair, SpxSuggestionValuePair } from '@softpak/components/spx-inputs';
|
|
9
9
|
import { Store } from '@ngrx/store';
|
|
10
10
|
|
|
11
11
|
declare const spxSectionWelcome = "welcome";
|
|
@@ -34,7 +34,7 @@ declare class SpxWelcomeComponent implements OnInit, OnDestroy {
|
|
|
34
34
|
protected readonly formGroup: _angular_core.WritableSignal<FormGroup<any> | undefined>;
|
|
35
35
|
protected readonly suggestions: _angular_core.WritableSignal<{
|
|
36
36
|
channelType?: SpxValuePair<string>[];
|
|
37
|
-
channel?:
|
|
37
|
+
channel?: SpxSuggestionValuePair<string>[];
|
|
38
38
|
}>;
|
|
39
39
|
textChannel: string;
|
|
40
40
|
textCompany: string;
|