@softpak/components 19.18.0 → 19.21.0-beta.1
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/README.md +24 -24
- package/fesm2022/softpak-components-spx-404-page.mjs +2 -2
- package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-alert.mjs +7 -6
- package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-configuration.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-app-expiry.mjs +23 -91
- package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-button.mjs +8 -22
- package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-card.mjs +20 -91
- package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-change-details.mjs +54 -64
- package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-channel-selection.mjs +52 -52
- package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-check-digit.mjs +24 -28
- package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-confirm.mjs +4 -4
- package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-section.mjs +8 -33
- package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-form-view.mjs +39 -53
- package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-inputs.mjs +33 -24
- package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-navigation.mjs +34 -89
- package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-number-check.mjs +91 -198
- package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pagination.mjs +12 -21
- package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-patch.mjs +8 -39
- package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-progress-bar.mjs +8 -22
- package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-spinner.mjs +15 -160
- package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-stock-info.mjs +71 -128
- package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-suggestion.mjs +2 -2
- package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toaster.mjs +36 -163
- package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-toggle.mjs +34 -0
- package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -0
- package/fesm2022/softpak-components-spx-translate.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-update.mjs +5 -5
- package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
- package/fesm2022/softpak-components-spx-validation.mjs +56 -55
- package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
- package/package.json +32 -28
- package/spx-alert/spx-alert.component.d.ts +1 -1
- package/spx-app-expiry/spx-app-expiry.component.d.ts +14 -14
- package/spx-button/spx-button.component.d.ts +0 -3
- package/spx-card/spx-card-item/spx-card-item.component.d.ts +0 -1
- package/spx-card/spx-card.component.d.ts +8 -9
- package/spx-change-details/spx-change-details.component.d.ts +23 -23
- package/spx-check-digit/spx-check-digit.component.d.ts +9 -9
- package/spx-form-section/spx-form-section.component.d.ts +5 -5
- package/spx-form-view/spx-autocomplete-search.component.d.ts +15 -16
- package/spx-form-view/spx-form-view.component.d.ts +1 -1
- package/spx-helpers/input-alert.interface.d.ts +5 -0
- package/spx-helpers/public-api.d.ts +1 -0
- package/spx-inputs/spx-input-text/spx-input-text.component.d.ts +4 -1
- package/spx-inputs/spx-input.component.d.ts +2 -1
- package/spx-navigation/public-api.d.ts +2 -2
- package/spx-navigation/spx-home-tile/spx-home-tile.component.d.ts +11 -0
- package/spx-navigation/{spx-home-tiles.component.d.ts → spx-home-tile/spx-home-tiles.component.d.ts} +2 -2
- package/spx-navigation/spx-navigation.component.d.ts +11 -8
- package/spx-number-check/spx-number-check.component.d.ts +26 -32
- package/spx-pagination/spx-pagination.component.d.ts +9 -10
- package/spx-patch/spx-patch.component.d.ts +4 -4
- package/spx-progress-bar/spx-progress-bar.component.d.ts +3 -3
- package/spx-spinner/spx-spinner.component.d.ts +3 -3
- package/spx-stock-info/spx-stock-info.component.d.ts +48 -49
- package/spx-toaster/src/spx-toaster-message.interface.d.ts +5 -1
- package/spx-toaster/src/spx-toaster.component.d.ts +6 -14
- package/spx-toggle/index.d.ts +5 -0
- package/spx-toggle/public-api.d.ts +1 -0
- package/spx-toggle/src/spx-toggle.component.d.ts +12 -0
- package/spx-validation/spx-validate-control.component.d.ts +22 -20
- package/tailwind.css +1 -1
- package/spx-navigation/spx-home-tile.component.d.ts +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Subscription } from 'rxjs';\r\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\r\nimport { SpxFormViewComponent, SpxFormI, SpxFormButtonTypeEnum, SpxFormFieldI } from '@softpak/components/spx-form-view';\r\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\r\nimport { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\r\n\r\nexport const sectionChangeDetails = 'changeDetails';\r\nexport const ctrlContainerNumber = 'containerNumber';\r\nexport const ctrlContainerSeqNr = 'containerSeqNr';\r\nexport const ctrlContainerType = 'containerType';\r\nexport const ctrlCustomer = 'customer';\r\nexport const ctrlTonsTested = 'tonsTested';\r\nexport const ctrlLicensePlate = 'licensePlate';\r\nexport const ctrlCategory = 'category';\r\nexport const ctrlUseCategories = 'useCategories';\r\n\r\n@Component({\r\n selector: 'spx-change-details',\r\n templateUrl: './spx-change-details.component.html',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxFormViewComponent,\r\n ]\r\n})\r\nexport class SpxChangeDetailsComponent {\r\n @Input() formGroup!: FormGroup;\r\n @Input() suggestions: any = {};\r\n @Input() textCategory!: string;\r\n @Input() textContainerNumber!: string;\r\n @Input() textContainerType!: string;\r\n @Input() textCustomer!: string;\r\n @Input() textLicensePlate!: string;\r\n @Input() textSave!: string;\r\n @Input() textTonsTested!: string;\r\n @Output() spxBlurCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\r\n @Output() spxBlurContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\r\n @Output() spxSearchCategory: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\r\n @Output() spxSearchContainerType: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\r\n @Output() spxSearchTonsTested: EventEmitter<SpxValuePair<string>> = new EventEmitter<SpxValuePair<string>>();\r\n @Output() submit: EventEmitter<SpxChangeDetailsValueI> = new EventEmitter<SpxChangeDetailsValueI>();\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.textSave,\r\n }\r\n ],\r\n sections: [\r\n {\r\n key: sectionChangeDetails,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlContainerSeqNr,\r\n type: () => SpxInputTypeEnum.hidden,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlContainerNumber,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.textContainerNumber,\r\n readonly: () => true,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlCustomer,\r\n type: () => SpxInputTypeEnum.text,\r\n capitalize: () => true,\r\n readonly: () => true,\r\n label: () => this.textCustomer,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlContainerType,\r\n type: () => SpxInputTypeEnum.autocomplete,\r\n label: () => this.textContainerType,\r\n capitalize: () => true,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlTonsTested,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textTonsTested,\r\n show: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0,\r\n validators: () => this.suggestions?.[ctrlTonsTested] && this.suggestions?.[ctrlTonsTested].length && this.suggestions?.[ctrlTonsTested].length > 0 ? [spxValidatorRequired()] : [],\r\n },\r\n {\r\n key: ctrlLicensePlate,\r\n type: () => SpxInputTypeEnum.text,\r\n label: () => this.textLicensePlate,\r\n capitalize: () => true,\r\n },\r\n {\r\n key: ctrlUseCategories,\r\n type: () => SpxInputTypeEnum.hidden,\r\n capitalize: () => true,\r\n },\r\n {\r\n key: ctrlCategory,\r\n type: () => SpxInputTypeEnum.autocomplete,\r\n label: () => this.textCategory,\r\n capitalize: () => true,\r\n show: () => valuePairToValue(this.ctrlUseCategories?.value),\r\n validators: () => valuePairToValue(this.ctrlUseCategories?.value) ? [spxValidatorRequired()] : [],\r\n }\r\n ]\r\n }\r\n ]\r\n };\r\n\r\n get ctrlCategory(): FormControl { return this.formGroup.get(ctrlCategory) as FormControl; }\r\n get ctrlCustomer(): FormControl { return this.formGroup.get(ctrlCustomer) as FormControl; }\r\n get ctrlContainerType(): FormControl { return this.formGroup.get(ctrlContainerType) as FormControl; }\r\n get ctrlLicensePlate(): FormControl { return this.formGroup.get(ctrlLicensePlate) as FormControl; }\r\n get ctrlTonsTested(): FormControl { return this.formGroup?.get(ctrlTonsTested) as FormControl; }\r\n get ctrlUseCategories(): FormControl { return this.formGroup?.get(ctrlUseCategories) as FormControl; }\r\n\r\n private subContainerType?: Subscription;\r\n\r\n constructor(readonly formBuilder: FormBuilder) {\r\n }\r\n\r\n createForm(): FormGroup {\r\n return SpxFormViewComponent.createForm(this.formBuilder, this.form.sections);\r\n }\r\n\r\n ngOnInit(): void {\r\n this.listenToContainerType();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.subContainerType) {\r\n this.subContainerType.unsubscribe();\r\n }\r\n }\r\n\r\n getRawValidators(formControl: FormControl) {\r\n return (formControl as any)._rawValidators;\r\n }\r\n\r\n onBlur(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\r\n if (data.field.key === ctrlCategory) {\r\n this.spxBlurCategory.emit(data.valuePair);\r\n }\r\n if (data.field.key === ctrlContainerType) {\r\n this.spxBlurContainerType.emit(data.valuePair);\r\n }\r\n }\r\n\r\n onSearch(data: { field: SpxFormFieldI, valuePair: SpxValuePair<any> }) {\r\n if (data.field.key === ctrlCategory) {\r\n this.spxSearchCategory.emit(data.valuePair);\r\n }\r\n if (data.field.key === ctrlContainerType) {\r\n this.spxSearchContainerType.emit(data.valuePair);\r\n }\r\n if (data.field.key === ctrlTonsTested) {\r\n this.spxSearchTonsTested.emit(data.valuePair);\r\n }\r\n }\r\n\r\n onSubmit(): void {\r\n this.submit.emit({\r\n category: valuePairToValue(this.ctrlUseCategories.value) ? this.ctrlCategory.value : null,\r\n containerType: this.ctrlContainerType.value,\r\n licensePlate: this.ctrlLicensePlate.value,\r\n tonsTested: this.ctrlTonsTested.value,\r\n })\r\n }\r\n\r\n private listenToContainerType(): void {\r\n this.subContainerType = this.ctrlContainerType.valueChanges.subscribe(valuePair => {\r\n this.ctrlTonsTested.setValue({ value: null });\r\n this.spxSearchTonsTested.emit(valuePair);\r\n });\r\n }\r\n}\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 [spxFormGroup]=\"formGroup\"\r\n [spxForm]=\"form\"\r\n [spxSuggestions]=\"suggestions\"\r\n (spxBlur)=\"onBlur($event)\"\r\n (spxSearch)=\"onSearch($event)\">\r\n </spx-form-view>\r\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AASO,MAAM,oBAAoB,GAAG;AAC7B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,iBAAiB,GAAG;AAC1B,MAAM,YAAY,GAAG;AACrB,MAAM,cAAc,GAAG;AACvB,MAAM,gBAAgB,GAAG;AACzB,MAAM,YAAY,GAAG;AACrB,MAAM,iBAAiB,GAAG;MAWpB,yBAAyB,CAAA;AAwFpC,IAAA,IAAI,YAAY,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAgB,CAAC;AACzF,IAAA,IAAI,YAAY,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,CAAgB,CAAC;AACzF,IAAA,IAAI,iBAAiB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAgB,CAAC;AACnG,IAAA,IAAI,gBAAg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mB;wBACnB,oBAAoB;AACvB,qBAAA,EAAA,QAAA,EAAA,mVAAA,EAAA;gFAGM,SAAS,EAAA,CAAA;sBAAjB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,mBAAmB,EAAA,CAAA;sBAA3B;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACS,eAAe,EAAA,CAAA;sBAAxB;gBACS,oBAAoB,EAAA,CAAA;sBAA7B;gBACS,iBAAiB,EAAA,CAAA;sBAA1B;gBACS,sBAAsB,EAAA,CAAA;sBAA/B;gBACS,mBAAmB,EAAA,CAAA;sBAA5B;gBACS,MAAM,EAAA,CAAA;sBAAf;;;AE3CH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-change-details.mjs","sources":["../../../../projects/softpak/components/spx-change-details/spx-change-details.component.ts","../../../../projects/softpak/components/spx-change-details/spx-change-details.component.html","../../../../projects/softpak/components/spx-change-details/softpak-components-spx-change-details.ts"],"sourcesContent":["import { ChangeDetectionStrategy, computed, effect, input, output } from '@angular/core';\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport {\n FormBuilder,\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n} from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { SpxChangeDetailsValueI } from './spx-change-details-value.interface';\nimport { SpxFormViewComponent, SpxFormI, SpxFormButtonTypeEnum, SpxFormFieldI } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxValuePair, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\n\nexport const sectionChangeDetails = 'changeDetails';\nexport const ctrlContainerNumber = 'containerNumber';\nexport const ctrlContainerSeqNr = 'containerSeqNr';\nexport const ctrlContainerType = 'containerType';\nexport const ctrlCustomer = 'customer';\nexport const ctrlTonsTested = 'tonsTested';\nexport const ctrlLicensePlate = 'licensePlate';\nexport const ctrlCategory = 'category';\nexport const ctrlUseCategories = 'useCategories';\n\n@Component({\n selector: 'spx-change-details',\n templateUrl: './spx-change-details.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxFormViewComponent,\n ],\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SpxChangeDetailsComponent {\n readonly formGroup = input.required<FormGroup>();\n readonly suggestions = input.required<any>();\n private readonly showTonsTested = computed(() =>\n this.suggestions()?.[ctrlTonsTested] &&\n this.suggestions()?.[ctrlTonsTested].length &&\n this.suggestions()?.[ctrlTonsTested].length > 0\n );\n readonly textCategory = input.required<string>();\n readonly textContainerNumber = input.required<string>();\n readonly textContainerType = input.required<string>();\n readonly textCustomer = input.required<string>();\n readonly textLicensePlate = input.required<string>();\n readonly textSave = input.required<string>();\n readonly textTonsTested = input.required<string>();\n spxBlurCategory = output<SpxValuePair<string>>();\n spxBlurContainerType = output<SpxValuePair<string>>();\n spxSearchCategory = output<SpxValuePair<string>>();\n spxSearchContainerType = output<SpxValuePair<string>>();\n spxSearchTonsTested = output<SpxValuePair<string>>();\n submit = output<SpxChangeDetailsValueI>();\n\n form: SpxFormI = {\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSave(),\n }\n ],\n sections: [\n {\n key: sectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: ctrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber(),\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer(),\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType(),\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested(),\n show: () => this.showTonsTested(),\n },\n {\n key: ctrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate(),\n capitalize: () => true,\n },\n {\n key: ctrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: ctrlCategory,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textCategory(),\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlUseCategories()?.value),\n validators: () => valuePairToValue(this.ctrlUseCategories()?.value) ? [spxValidatorRequired()] : [],\n }\n ]\n }\n ]\n };\n\n readonly ctrlCategory = computed(() => this.formGroup().get(ctrlCategory) as FormControl);\n readonly ctrlCustomer = computed(() => this.formGroup().get(ctrlCustomer) as FormControl);\n readonly ctrlContainerType = computed(() => this.formGroup().get(ctrlContainerType) as FormControl);\n readonly ctrlLicensePlate = computed(() => this.formGroup().get(ctrlLicensePlate) as FormControl);\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(ctrlTonsTested) as FormControl);\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(ctrlUseCategories) as FormControl);\n\n private subContainerType?: Subscription;\n\n constructor(readonly formBuilder: FormBuilder) {\n effect(() => {\n if (\n this.showTonsTested()\n ) {\n this.ctrlTonsTested().addValidators([spxValidatorRequired()]);\n this.ctrlTonsTested().updateValueAndValidity();\n } else {\n this.ctrlTonsTested().clearValidators();\n this.ctrlTonsTested().updateValueAndValidity();\n }\n });\n }\n\n createForm(): FormGroup {\n return SpxFormViewComponent.createForm(\n this.formBuilder,\n this.form.sections\n );\n }\n\n ngOnInit(): void {\n this.listenToContainerType();\n }\n\n ngOnDestroy(): void {\n if (this.subContainerType) {\n this.subContainerType.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n\n onBlur(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === ctrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === ctrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === ctrlTonsTested) {\n this.spxSearchTonsTested.emit(data.valuePair);\n }\n }\n\n onSubmit(): void {\n this.submit.emit({\n category: valuePairToValue(this.ctrlUseCategories().value) ? this.ctrlCategory().value : null,\n containerType: this.ctrlContainerType().value,\n licensePlate: this.ctrlLicensePlate().value,\n tonsTested: this.ctrlTonsTested().value,\n })\n }\n\n private listenToContainerType(): void {\n this.subContainerType = this.ctrlContainerType().valueChanges.subscribe(valuePair => {\n this.ctrlTonsTested().setValue({ value: null });\n this.spxSearchTonsTested.emit(valuePair);\n });\n }\n}\n","<form [formGroup]=\"formGroup()\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\n <spx-form-view\n [spxFormGroup]=\"formGroup()\"\n [spxForm]=\"form\"\n [spxSuggestions]=\"suggestions()\"\n (spxBlur)=\"onBlur($event)\"\n (spxSearch)=\"onSearch($event)\">\n </spx-form-view>\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAgBO,MAAM,oBAAoB,GAAG;AAC7B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,i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,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKf,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAXrC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAErB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACvB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yUAAA,EAAA;;;AEnCnD;;AAEG;;;;"}
|
|
@@ -138,28 +138,28 @@ class SpxChannelIndicatorComponent {
|
|
|
138
138
|
this.navController.navigateRoot([spxChannelSelectionUrl]);
|
|
139
139
|
}
|
|
140
140
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", 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: "19.0.5", 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>
|
|
141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", 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
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" }] }); }
|
|
150
150
|
}
|
|
151
151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxChannelIndicatorComponent, decorators: [{
|
|
152
152
|
type: Component,
|
|
153
153
|
args: [{
|
|
154
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>
|
|
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
163
|
</div>`,
|
|
164
164
|
imports: [
|
|
165
165
|
AsyncPipe,
|
|
@@ -268,48 +268,48 @@ class SpxWelcomeComponent {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", 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: "19.0.5", 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>
|
|
271
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", 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
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
290
|
}
|
|
291
291
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxWelcomeComponent, decorators: [{
|
|
292
292
|
type: Component,
|
|
293
293
|
args: [{
|
|
294
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>
|
|
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
313
|
</ion-content>`,
|
|
314
314
|
imports: [
|
|
315
315
|
FormsModule,
|
|
@@ -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 sectionWelcome = 'welcome';\r\nexport const ctrlChannel = 'channel';\r\nexport const ctrlChannelType = 'channelType';\r\nexport interface SpxWelcomeValueI {\r\n [ctrlChannel]?: SpxAppChannelI;\r\n [ctrlChannelType]: SpxAppChannelTypeEnum;\r\n}\r\n\r\n@Component({\r\n selector: 'spx-welcome',\r\n template: `\r\n <ion-header>\r\n <ion-toolbar>\r\n <ion-title>\r\n {{ textSelectYourCompany | translate | capitalize }}\r\n </ion-title>\r\n <ion-buttons slot=\"end\">\r\n </ion-buttons>\r\n </ion-toolbar>\r\n</ion-header>\r\n<ion-content class=\"ion-padding\">\r\n <form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\" (ngSubmit)=\"onSubmit()\">\r\n <spx-form-view\r\n [spxForm]=\"form\"\r\n [spxFormGroup]=\"formSection\"\r\n [spxSuggestions]=\"suggestions\">\r\n </spx-form-view>\r\n </form>\r\n</ion-content>`,\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxCapitalizePipe,\r\n SpxFormViewComponent,\r\n IonHeader,\r\n IonToolbar,\r\n IonTitle,\r\n IonButtons,\r\n IonContent,\r\n TranslatePipe,\r\n ]\r\n})\r\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\r\n channels = signal<SpxAppChannelI[]>([]);\r\n filteredCompanies = computed(() => this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\r\n channelTypes = [\r\n SpxAppChannelTypeEnum.production,\r\n SpxAppChannelTypeEnum.beta,\r\n SpxAppChannelTypeEnum.alpha,\r\n SpxAppChannelTypeEnum.development,\r\n ];\r\n formGroup!: FormGroup;\r\n textChannel = spxTextChannel;\r\n textCompany = spxTextCompany;\r\n textSelect = spxTextSelect;\r\n textSelectYourCompany = spxTextSelectYourCompany;\r\n suggestions: {\r\n [ctrlChannelType]?: SpxValuePair<string>[];\r\n [ctrlChannel]?: SpxValuePair<string>[];\r\n } = {\r\n [ctrlChannelType]: [],\r\n [ctrlChannel]: [],\r\n };\r\n\r\n get formSection(): FormGroup { return this.formGroup.get(sectionWelcome) as FormGroup; }\r\n get ctrlChannel(): FormControl { return this.formSection.get(ctrlChannel) as FormControl; }\r\n get ctrlChannelType(): FormControl { return this.formSection.get(ctrlChannelType) as FormControl; }\r\n private subscriptions: {\r\n channel?: Subscription;\r\n channels?: Subscription;\r\n } = {};\r\n\r\n form: SpxFormI = {\r\n buttons: [\r\n {\r\n severity: SpxSeverityEnum.success,\r\n type: SpxFormButtonTypeEnum.submit,\r\n label: () => this.textSelect,\r\n }\r\n ],\r\n sections: [\r\n {\r\n key: sectionWelcome,\r\n showTitle: () => false,\r\n fields: [\r\n {\r\n key: ctrlChannel,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textCompany,\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n {\r\n key: ctrlChannelType,\r\n type: () => SpxInputTypeEnum.radio,\r\n label: () => this.textChannel,\r\n capitalize: () => true,\r\n show: () => valuePairToValue(this.ctrlChannel.value),\r\n validators: () => [spxValidatorRequired()],\r\n },\r\n ]\r\n }\r\n ]\r\n };\r\n\r\n constructor(\r\n private readonly appStore: Store,\r\n readonly formBuilder: FormBuilder\r\n ) {\r\n this.formGroup = this.formBuilder.group({\r\n [sectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form.sections)\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n unsubscribeSubscriptions(this.subscriptions);\r\n }\r\n\r\n ngOnInit(): void {\r\n this.subscriptions.channels = this.appStore.select(spxChannelReducer.selectChannels).subscribe(channels => {\r\n this.channels.set(channels);\r\n this.suggestions[ctrlChannel] = this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));\r\n });\r\n\r\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\r\n const brandFound = this.channels().find(c => c.brand === valuePairToValue(valuePair));\r\n this.suggestions[ctrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({\r\n description: channelType,\r\n value: channelType\r\n }));\r\n this.ctrlChannelType.setValue({\r\n value: SpxAppChannelTypeEnum.production,\r\n });\r\n });\r\n }\r\n\r\n onSubmit(): void {\r\n const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel.value))!;\r\n const channelType = valuePairToValue(this.ctrlChannelType.value);\r\n\r\n if (!channel) {\r\n this.appStore.dispatch(spxToasterActions.createWarning({\r\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\r\n messageText: 'Please select a company',\r\n }))\r\n } else {\r\n this.appStore.dispatch(choose({\r\n channel,\r\n channelType,\r\n }));\r\n }\r\n }\r\n}\r\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { Injectable } from '@angular/core';\r\nimport * as actions from './spx-channel.actions';\r\nimport { setConfig } from '@capacitor/live-updates';\r\nimport { Capacitor } from '@capacitor/core';\r\nimport { Router } from '@angular/router';\r\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\r\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\r\nimport { captureMessage } from '@sentry/angular';\r\nimport { App } from '@capacitor/app';\r\n\r\n@Injectable()\r\nexport class Effects {\r\n onChoose$ =\r\n createEffect(() =>\r\n this.actions$.pipe(\r\n ofType(actions.choose),\r\n switchMap((action) => {\r\n if (Capacitor.getPlatform() === 'web') {\r\n this.router.navigate(['tabs/hme']);\r\n } else {\r\n App.getInfo().then((binaryInfo) => {\r\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\r\n setConfig({\r\n channel: `${action.channelType}-${binaryVersionGroup}.x`\r\n });\r\n this.router.navigate([spxUpdateUrl]);\r\n }).catch((err) => {\r\n captureMessage(`SPX Channel Error: ${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,CA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,CAAA;kHAAP,OAAO,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;;;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-selection-url.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.initial.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-welcome.component.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["export const spxChannelSelectionUrl = 'wlc';","import { Router } from '@angular/router';\nimport { Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n constructor(\n public router: Router,\n ) {}\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n}>());\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\n channels: SpxAppChannelI[];\n}>());\n\nconst all = union({\n choose,\n initialize,\n});\n\nexport type Actions = typeof all;\n","import { StateI } from \"./spx-channel.state\";\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n","\nimport * as actions from './spx-channel.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { StateI } from './spx-channel.state';\nimport { initialState } from './spx-channel.initial';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.includes(SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(actions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n channelType,\n };\n }),\n on(actions.initialize, (state, { channels }): StateI => ({\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) ? SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum : SpxAppChannelTypeEnum.production,\n })),\n ),\n});\n","import { Component } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\nimport { AsyncPipe } from '@angular/common';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { spxChannelSelectionUrl } from './spx-channel-selection-url';\nimport { NavController } from '@ionic/angular';\n\n@Component({\n selector: 'spx-channel-indicator',\n template: `<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ (channel | async)?.brand }}</div>\n @if ((channelType | async) !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType | async }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n </div>`,\n imports: [\n AsyncPipe,\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ]\n})\nexport class SpxChannelIndicatorComponent {\n channel = this.store.select(spxChannelReducer.selectChannel);\n channelType = this.store.select(spxChannelReducer.selectChannelType);\n spxTextChange = spxTextChange;\n\n constructor(\n private navController: NavController,\n private store: Store,\n ) { }\n\n onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n}\n","import { Component, OnInit, OnDestroy, signal, computed } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Store } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\nimport { SpxFormButtonTypeEnum, SpxFormI, SpxFormViewComponent } from '@softpak/components/spx-form-view';\nimport { SpxSeverityEnum, unsubscribeSubscriptions, valuePairToValue } from '@softpak/components/spx-helpers';\nimport { SpxInputTypeEnum, SpxValuePair } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription } from 'rxjs';\nimport spxChannelReducer from '../store/spx-channel/spx-channel.reducer';\nimport { spxTextChannel, spxTextCompany, spxTextSelect, spxTextSelectYourCompany } from '@softpak/components/spx-translate';\nimport { IonHeader, IonToolbar, IonTitle, IonButtons, IonContent } from '@ionic/angular/standalone';\nimport { choose } from '../store/spx-channel/spx-channel.actions';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\n\nexport const sectionWelcome = 'welcome';\nexport const ctrlChannel = 'channel';\nexport const ctrlChannelType = 'channelType';\nexport interface SpxWelcomeValueI {\n [ctrlChannel]?: SpxAppChannelI;\n [ctrlChannelType]: SpxAppChannelTypeEnum;\n}\n\n@Component({\n selector: 'spx-welcome',\n template: `\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 imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxCapitalizePipe,\n SpxFormViewComponent,\n IonHeader,\n IonToolbar,\n IonTitle,\n IonButtons,\n IonContent,\n TranslatePipe,\n ]\n})\nexport class SpxWelcomeComponent implements OnInit, OnDestroy {\n channels = signal<SpxAppChannelI[]>([]);\n filteredCompanies = computed(() => this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand })));\n channelTypes = [\n SpxAppChannelTypeEnum.production,\n SpxAppChannelTypeEnum.beta,\n SpxAppChannelTypeEnum.alpha,\n SpxAppChannelTypeEnum.development,\n ];\n formGroup!: FormGroup;\n textChannel = spxTextChannel;\n textCompany = spxTextCompany;\n textSelect = spxTextSelect;\n textSelectYourCompany = spxTextSelectYourCompany;\n suggestions: {\n [ctrlChannelType]?: SpxValuePair<string>[];\n [ctrlChannel]?: SpxValuePair<string>[];\n } = {\n [ctrlChannelType]: [],\n [ctrlChannel]: [],\n };\n\n get formSection(): FormGroup { return this.formGroup.get(sectionWelcome) as FormGroup; }\n get ctrlChannel(): FormControl { return this.formSection.get(ctrlChannel) as FormControl; }\n get ctrlChannelType(): FormControl { return this.formSection.get(ctrlChannelType) as FormControl; }\n private subscriptions: {\n channel?: Subscription;\n channels?: Subscription;\n } = {};\n\n form: SpxFormI = {\n buttons: [\n {\n severity: SpxSeverityEnum.success,\n type: SpxFormButtonTypeEnum.submit,\n label: () => this.textSelect,\n }\n ],\n sections: [\n {\n key: sectionWelcome,\n showTitle: () => false,\n fields: [\n {\n key: ctrlChannel,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textCompany,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: ctrlChannelType,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textChannel,\n capitalize: () => true,\n show: () => valuePairToValue(this.ctrlChannel.value),\n validators: () => [spxValidatorRequired()],\n },\n ]\n }\n ]\n };\n\n constructor(\n private readonly appStore: Store,\n readonly formBuilder: FormBuilder\n ) {\n this.formGroup = this.formBuilder.group({\n [sectionWelcome]: SpxFormViewComponent.createForm(this.formBuilder, this.form.sections)\n });\n }\n\n ngOnDestroy(): void {\n unsubscribeSubscriptions(this.subscriptions);\n }\n\n ngOnInit(): void {\n this.subscriptions.channels = this.appStore.select(spxChannelReducer.selectChannels).subscribe(channels => {\n this.channels.set(channels);\n this.suggestions[ctrlChannel] = this.channels().filter(channel => channel.channelTypes.includes(SpxAppChannelTypeEnum.production)).map(c => ({ description: c.brand, value: c.brand }));\n });\n\n this.subscriptions.channel = this.ctrlChannel.valueChanges.subscribe(valuePair => {\n const brandFound = this.channels().find(c => c.brand === valuePairToValue(valuePair));\n this.suggestions[ctrlChannelType] = !brandFound ? [] : brandFound?.channelTypes?.map(channelType => ({\n description: channelType,\n value: channelType\n }));\n this.ctrlChannelType.setValue({\n value: SpxAppChannelTypeEnum.production,\n });\n });\n }\n\n onSubmit(): void {\n const channel = this.channels().find(c => c.brand === valuePairToValue(this.ctrlChannel.value))!;\n const channelType = valuePairToValue(this.ctrlChannelType.value);\n\n if (!channel) {\n this.appStore.dispatch(spxToasterActions.createWarning({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: 'Please select a company',\n }))\n } else {\n this.appStore.dispatch(choose({\n channel,\n channelType,\n }));\n }\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { switchMap } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './spx-channel.actions';\nimport { setConfig } from '@capacitor/live-updates';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { captureMessage } from '@sentry/angular';\nimport { App } from '@capacitor/app';\n\n@Injectable()\nexport class Effects {\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n this.router.navigate(['tabs/hme']);\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer","i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,sBAAsB,GAAG,KAAK;;MCQ9B,eAAe,CAAA;AAE1B,IAAA,WAAA,CACS,MAAc,EAAA;QAAd,IAAM,CAAA,MAAA,GAAN,MAAM;;IAGf,WAAW,GAAA;QACT,IACE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,KAAK,CAAC;YAClE,CAAC,UAAU,CAAC,UAAU,CAAoB,iBAAiB,CAAC,WAAW,CAAC,EACxE;YACA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CAAC;AAC9C,YAAA,OAAO,KAAK;;AAEd,QAAA,OAAO,IAAI;;8GAdF,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACJM,MAAM,MAAM,GAAG,Y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,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,24 +1,29 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, viewChild, signal, computed, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import { combineLatest, startWith, map } from 'rxjs';
|
|
6
6
|
import { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';
|
|
7
|
-
import {
|
|
7
|
+
import { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';
|
|
8
8
|
import { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';
|
|
9
9
|
|
|
10
10
|
const ctrlCheckDigit = 'checkDigit';
|
|
11
11
|
const ctrlContainerNumber = 'containerNumber';
|
|
12
12
|
const ctrlPrefix = 'prefix';
|
|
13
13
|
class SpxCheckDigitComponent {
|
|
14
|
-
get ctrlCheckDigit() { return this.formGroup.get(ctrlCheckDigit); }
|
|
15
|
-
get ctrlContainerNumber() { return this.formGroup.get(ctrlContainerNumber); }
|
|
16
|
-
get ctrlContainerPrefix() { return this.formGroup.get(ctrlPrefix); }
|
|
17
14
|
constructor(formBuilder) {
|
|
18
15
|
this.formBuilder = formBuilder;
|
|
16
|
+
this.txtCheckDigit = input.required();
|
|
17
|
+
this.txtContainer = input.required();
|
|
18
|
+
this.txtPrefix = input.required();
|
|
19
|
+
this.ctrlContainerNumberRef = viewChild(SpxInputComponent);
|
|
19
20
|
this.inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;
|
|
20
21
|
this.inputTypeText = SpxInputTypeEnum.text;
|
|
21
|
-
this.formGroup =
|
|
22
|
+
this.formGroup = signal(null);
|
|
23
|
+
this.ctrlCheckDigit = computed(() => this.formGroup()?.get(ctrlCheckDigit));
|
|
24
|
+
this.ctrlContainerNumber = computed(() => this.formGroup()?.get(ctrlContainerNumber));
|
|
25
|
+
this.ctrlContainerPrefix = computed(() => this.formGroup()?.get(ctrlPrefix));
|
|
26
|
+
this.formGroup.set(this.formBuilder.group({
|
|
22
27
|
[ctrlCheckDigit]: [null, []],
|
|
23
28
|
[ctrlContainerNumber]: [null, [
|
|
24
29
|
spxValidatorRequired(),
|
|
@@ -32,32 +37,32 @@ class SpxCheckDigitComponent {
|
|
|
32
37
|
spxValidatorMinLength(4),
|
|
33
38
|
spxValidatorPattern(/[a-zA-Z]{4}/),
|
|
34
39
|
]],
|
|
35
|
-
});
|
|
40
|
+
}));
|
|
36
41
|
}
|
|
37
42
|
ngOnInit() {
|
|
38
43
|
this.inputChanges = combineLatest([
|
|
39
|
-
this.ctrlContainerNumber.valueChanges.pipe(startWith(this.ctrlContainerNumber.value)),
|
|
40
|
-
this.ctrlContainerPrefix.valueChanges.pipe(startWith(this.ctrlContainerPrefix.value)),
|
|
44
|
+
this.ctrlContainerNumber().valueChanges.pipe(startWith(this.ctrlContainerNumber().value)),
|
|
45
|
+
this.ctrlContainerPrefix().valueChanges.pipe(startWith(this.ctrlContainerPrefix().value)),
|
|
41
46
|
])
|
|
42
47
|
.pipe(map(([containerNumber$, prefix$]) => ({
|
|
43
48
|
containerNumber: containerNumber$,
|
|
44
49
|
prefix: prefix$
|
|
45
50
|
})))
|
|
46
51
|
.subscribe((v) => {
|
|
47
|
-
if (this.ctrlContainerNumber.invalid || this.ctrlContainerPrefix.invalid) {
|
|
48
|
-
this.ctrlCheckDigit.setValue(null, { emitEvent: false });
|
|
52
|
+
if (this.ctrlContainerNumber().invalid || this.ctrlContainerPrefix().invalid) {
|
|
53
|
+
this.ctrlCheckDigit().setValue(null, { emitEvent: false });
|
|
49
54
|
}
|
|
50
55
|
else {
|
|
51
|
-
const prefix = valuePairToValue(this.ctrlContainerPrefix.value);
|
|
52
|
-
const containerNumber = valuePairToValue(this.ctrlContainerNumber.value);
|
|
56
|
+
const prefix = valuePairToValue(this.ctrlContainerPrefix().value);
|
|
57
|
+
const containerNumber = valuePairToValue(this.ctrlContainerNumber().value);
|
|
53
58
|
const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);
|
|
54
|
-
this.ctrlCheckDigit.setValue({ value: checkDigit }, { emitEvent: false });
|
|
59
|
+
this.ctrlCheckDigit().setValue({ value: checkDigit }, { emitEvent: false });
|
|
55
60
|
}
|
|
56
61
|
});
|
|
57
62
|
}
|
|
58
63
|
ngAfterViewInit() {
|
|
59
64
|
setTimeout(() => {
|
|
60
|
-
this.ctrlContainerNumberRef?.setFocusIn();
|
|
65
|
+
this.ctrlContainerNumberRef()?.setFocusIn();
|
|
61
66
|
}, 250);
|
|
62
67
|
}
|
|
63
68
|
ngOnDestroy() {
|
|
@@ -69,26 +74,17 @@ class SpxCheckDigitComponent {
|
|
|
69
74
|
return formControl._rawValidators;
|
|
70
75
|
}
|
|
71
76
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: "txtCheckDigit", txtContainer: "txtContainer", txtPrefix: "txtPrefix" }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate:
|
|
77
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxCheckDigitComponent, isStandalone: true, selector: "spx-check-digit", inputs: { txtCheckDigit: { classPropertyName: "txtCheckDigit", publicName: "txtCheckDigit", isSignal: true, isRequired: true, transformFunction: null }, txtContainer: { classPropertyName: "txtContainer", publicName: "txtContainer", isSignal: true, isRequired: true, transformFunction: null }, txtPrefix: { classPropertyName: "txtPrefix", publicName: "txtPrefix", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "ctrlContainerNumberRef", first: true, predicate: SpxInputComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber()\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer()\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber() && ctrlContainerNumber().errors && ctrlContainerNumber().touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [control]=\"ctrlContainerNumber()\" [label]=\"txtContainer()\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix()\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix()\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix() && ctrlContainerPrefix().errors && ctrlContainerPrefix().touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [control]=\"ctrlContainerPrefix()\" [label]=\"txtPrefix()\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit().value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit()\"\n [spxLabel]=\"txtCheckDigit()\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: SpxInputComponent, selector: "spx-input", inputs: ["spxLabel", "spxMax", "spxMin", "spxName", "spxReadonly", "spxAutocomplete", "spxAutofocus", "spxInputMode", "spxPattern", "spxRequired", "spxSelectMonth", "spxSelectDay", "spxShowEdit", "spxShowHelp", "spxShowLabel", "spxCompact", "spxShowClear", "spxShowSearch", "spxAlert", "spxShowValidationMessages", "spxStep", "spxSuggestions", "spxType", "spxValidators", "spxCapitalize"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }] }); }
|
|
73
78
|
}
|
|
74
79
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
|
|
75
80
|
type: Component,
|
|
76
81
|
args: [{ selector: 'spx-check-digit', imports: [
|
|
77
82
|
FormsModule,
|
|
78
83
|
ReactiveFormsModule,
|
|
84
|
+
SpxInputComponent,
|
|
79
85
|
SpxValidateControlComponent,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }], propDecorators: { txtCheckDigit: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], txtContainer: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], txtPrefix: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], ctrlContainerNumberRef: [{
|
|
89
|
-
type: ViewChild,
|
|
90
|
-
args: ['ctrlContainerNumberRef']
|
|
91
|
-
}] } });
|
|
86
|
+
], template: "<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber()\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer()\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber() && ctrlContainerNumber().errors && ctrlContainerNumber().touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [control]=\"ctrlContainerNumber()\" [label]=\"txtContainer()\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix()\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix()\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix() && ctrlContainerPrefix().errors && ctrlContainerPrefix().touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [control]=\"ctrlContainerPrefix()\" [label]=\"txtPrefix()\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit().value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit()\"\n [spxLabel]=\"txtCheckDigit()\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>" }]
|
|
87
|
+
}], ctorParameters: () => [{ type: i1.FormBuilder }] });
|
|
92
88
|
|
|
93
89
|
/**
|
|
94
90
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"softpak-components-spx-check-digit.mjs","sources":["../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.ts","../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.html","../../../../projects/softpak/components/spx-check-digit/softpak-components-spx-check-digit.ts"],"sourcesContent":["import { Component, Input, ViewChild } from '@angular/core';\r\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\r\nimport { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';\r\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\r\nimport { SpxValidateControlComponent, spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern } from '@softpak/components/spx-validation';\r\n\r\nconst ctrlCheckDigit = 'checkDigit';\r\nconst ctrlContainerNumber = 'containerNumber';\r\nconst ctrlPrefix = 'prefix';\r\n\r\n@Component({\r\n selector: 'spx-check-digit',\r\n templateUrl: './spx-check-digit.component.html',\r\n imports: [\r\n FormsModule,\r\n ReactiveFormsModule,\r\n SpxValidateControlComponent,\r\n SpxInputComponent\r\n ]\r\n})\r\nexport class SpxCheckDigitComponent {\r\n @Input() txtCheckDigit!: string;\r\n @Input() txtContainer!: string;\r\n @Input() txtPrefix!: string;\r\n @ViewChild('ctrlContainerNumberRef') ctrlContainerNumberRef?: SpxInputComponent;\r\n inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;\r\n inputTypeText = SpxInputTypeEnum.text;\r\n formGroup: FormGroup;\r\n\r\n get ctrlCheckDigit(): FormControl { return this.formGroup.get(ctrlCheckDigit) as FormControl; }\r\n get ctrlContainerNumber(): FormControl { return this.formGroup.get(ctrlContainerNumber) as FormControl; }\r\n get ctrlContainerPrefix(): FormControl { return this.formGroup.get(ctrlPrefix) as FormControl; }\r\n\r\n private inputChanges?: Subscription;\r\n\r\n constructor(\r\n private readonly formBuilder: FormBuilder,\r\n ) {\r\n this.formGroup = this.formBuilder.group({\r\n [ctrlCheckDigit]: [null, []],\r\n [ctrlContainerNumber]: [null, [\r\n spxValidatorRequired(),\r\n spxValidatorMaxLength(6),\r\n spxValidatorMinLength(6),\r\n spxValidatorPattern(/[0-9]{6}/),\r\n ]],\r\n [ctrlPrefix]: [null, [\r\n spxValidatorRequired(),\r\n spxValidatorMaxLength(4),\r\n spxValidatorMinLength(4),\r\n spxValidatorPattern(/[a-zA-Z]{4}/),\r\n ]],\r\n })\r\n }\r\n\r\n ngOnInit(): void {\r\n this.inputChanges = combineLatest([\r\n this.ctrlContainerNumber.valueChanges.pipe(startWith(this.ctrlContainerNumber.value)),\r\n this.ctrlContainerPrefix.valueChanges.pipe(startWith(this.ctrlContainerPrefix.value)),\r\n ])\r\n .pipe(map(([containerNumber$, prefix$]) => ({\r\n containerNumber: containerNumber$,\r\n prefix: prefix$\r\n })))\r\n .subscribe((v) => {\r\n if (this.ctrlContainerNumber.invalid || this.ctrlContainerPrefix.invalid) {\r\n this.ctrlCheckDigit.setValue(null, { emitEvent: false });\r\n } else {\r\n const prefix = valuePairToValue(this.ctrlContainerPrefix.value);\r\n const containerNumber = valuePairToValue(this.ctrlContainerNumber.value);\r\n const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);\r\n this.ctrlCheckDigit.setValue({ value: checkDigit }, { emitEvent: false });\r\n }\r\n });\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n setTimeout(() => {\r\n this.ctrlContainerNumberRef?.setFocusIn(); \r\n }, 250);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n if (this.inputChanges) {\r\n this.inputChanges.unsubscribe();\r\n }\r\n }\r\n\r\n getRawValidators(formControl: FormControl) {\r\n return (formControl as any)._rawValidators;\r\n }\r\n}\r\n","<form [formGroup]=\"formGroup\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\r\n <spx-input\r\n #ctrlContainerNumberRef\r\n [formControl]=\"ctrlContainerNumber\"\r\n [spxAutofocus]=\"true\"\r\n [spxCapitalize]=\"true\"\r\n [spxLabel]=\"txtContainer\"\r\n [spxPattern]=\"'[0-9]*'\"\r\n [spxRequired]=\"true\"\r\n [spxShowValidationMessages]=\"ctrlContainerNumber && ctrlContainerNumber.errors && ctrlContainerNumber.touched\"\r\n [spxType]=\"inputTypeOverlayNumber\"\r\n [spxValidators]=\"getRawValidators(ctrlContainerNumber)\">\r\n <spx-validate-control [control]=\"ctrlContainerNumber\" [label]=\"txtContainer\"></spx-validate-control>\r\n </spx-input>\r\n <spx-input\r\n [formControl]=\"ctrlContainerPrefix\"\r\n [spxCapitalize]=\"true\"\r\n [spxLabel]=\"txtPrefix\"\r\n [spxRequired]=\"true\"\r\n [spxShowValidationMessages]=\"ctrlContainerPrefix && ctrlContainerPrefix.errors && ctrlContainerPrefix.touched\"\r\n [spxType]=\"inputTypeText\"\r\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix)\">\r\n <spx-validate-control [control]=\"ctrlContainerPrefix\" [label]=\"txtPrefix\"></spx-validate-control>\r\n </spx-input>\r\n @if (ctrlCheckDigit.value) {\r\n <spx-input\r\n [formControl]=\"ctrlCheckDigit\"\r\n [spxLabel]=\"txtCheckDigit\"\r\n [spxReadonly]=\"true\"\r\n [spxType]=\"inputTypeText\">\r\n </spx-input>\r\n }\r\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,YAAY;AACnC,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,UAAU,GAAG,QAAQ;MAYd,sBAAsB,CAAA;AASjC,IAAA,IAAI,cAAc,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAgB,CAAC;AAC7F,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAgB,CAAC;AACvG,IAAA,IAAI,mBAAmB,GAAA,EAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAgB,CAAC;AAI9F,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AAX9B,QAAA,IAAA,CAAA,sBAAsB,GAAG,gBAAgB,CAAC,aAAa;AACvD,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI;QAYnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;AACtC,YAAA,CAAC,cAAc,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;AAC5B,YAAA,CAAC,mBAAmB,GAAG,CAAC,IAAI,EAAE;AAC5B,oBAAA,oBAAoB,EAAE;oBACtB,qBAAqB,CAAC,CAAC,CAAC;oBACxB,qBAAqB,CAAC,CAAC,CAAC;oBACxB,mBAAmB,CAAC,UAAU,CAAC;iBAChC,CAAC;AACF,YAAA,CAAC,UAAU,GAA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C;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"softpak-components-spx-check-digit.mjs","sources":["../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.ts","../../../../projects/softpak/components/spx-check-digit/spx-check-digit.component.html","../../../../projects/softpak/components/spx-check-digit/softpak-components-spx-check-digit.ts"],"sourcesContent":["import { Component, computed, input, signal, viewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { valuePairToValue, calcCheckDigit } from '@softpak/components/spx-helpers';\nimport { SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { spxValidatorRequired, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, SpxValidateControlComponent } from '@softpak/components/spx-validation';\n\nconst ctrlCheckDigit = 'checkDigit';\nconst ctrlContainerNumber = 'containerNumber';\nconst ctrlPrefix = 'prefix';\n\n@Component({\n selector: 'spx-check-digit',\n templateUrl: './spx-check-digit.component.html',\n imports: [\n FormsModule,\n ReactiveFormsModule,\n SpxInputComponent,\n SpxValidateControlComponent,\n ]\n})\nexport class SpxCheckDigitComponent {\n readonly txtCheckDigit = input.required<string>();\n readonly txtContainer = input.required<string>();\n readonly txtPrefix = input.required<string>();\n ctrlContainerNumberRef = viewChild(SpxInputComponent);\n inputTypeOverlayNumber = SpxInputTypeEnum.overlayNumber;\n inputTypeText = SpxInputTypeEnum.text;\n formGroup = signal<FormGroup | null>(null);\n ctrlCheckDigit = computed(() => this.formGroup()?.get(ctrlCheckDigit) as FormControl);\n ctrlContainerNumber = computed(() => this.formGroup()?.get(ctrlContainerNumber) as FormControl);\n ctrlContainerPrefix = computed(() => this.formGroup()?.get(ctrlPrefix) as FormControl);\n\n private inputChanges?: Subscription;\n\n constructor(\n private readonly formBuilder: FormBuilder,\n ) {\n this.formGroup.set(this.formBuilder.group({\n [ctrlCheckDigit]: [null, []],\n [ctrlContainerNumber]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(6),\n spxValidatorMinLength(6),\n spxValidatorPattern(/[0-9]{6}/),\n ]],\n [ctrlPrefix]: [null, [\n spxValidatorRequired(),\n spxValidatorMaxLength(4),\n spxValidatorMinLength(4),\n spxValidatorPattern(/[a-zA-Z]{4}/),\n ]],\n }));\n }\n\n ngOnInit(): void {\n this.inputChanges = combineLatest([\n this.ctrlContainerNumber().valueChanges.pipe(startWith(this.ctrlContainerNumber().value)),\n this.ctrlContainerPrefix().valueChanges.pipe(startWith(this.ctrlContainerPrefix().value)),\n ])\n .pipe(map(([containerNumber$, prefix$]) => ({\n containerNumber: containerNumber$,\n prefix: prefix$\n })))\n .subscribe((v) => {\n if (this.ctrlContainerNumber().invalid || this.ctrlContainerPrefix().invalid) {\n this.ctrlCheckDigit().setValue(null, { emitEvent: false });\n } else {\n const prefix = valuePairToValue(this.ctrlContainerPrefix().value);\n const containerNumber = valuePairToValue(this.ctrlContainerNumber().value);\n const checkDigit = calcCheckDigit(`${prefix}${containerNumber}`);\n this.ctrlCheckDigit().setValue({ value: checkDigit }, { emitEvent: false });\n }\n });\n }\n\n ngAfterViewInit(): void {\n setTimeout(() => {\n this.ctrlContainerNumberRef()?.setFocusIn(); \n }, 250);\n }\n\n ngOnDestroy(): void {\n if (this.inputChanges) {\n this.inputChanges.unsubscribe();\n }\n }\n\n getRawValidators(formControl: FormControl) {\n return (formControl as any)._rawValidators;\n }\n}\n","<form [formGroup]=\"formGroup()!\" class=\"max-w-lg mx-auto flex flex-col gap-3\">\n <spx-input\n #ctrlContainerNumberRef\n [formControl]=\"ctrlContainerNumber()\"\n [spxAutofocus]=\"true\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtContainer()\"\n [spxPattern]=\"'[0-9]*'\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerNumber() && ctrlContainerNumber().errors && ctrlContainerNumber().touched\"\n [spxType]=\"inputTypeOverlayNumber\"\n [spxValidators]=\"getRawValidators(ctrlContainerNumber())\">\n <spx-validate-control [errors]=\"ctrlContainerNumber().errors\" [touched]=\"ctrlContainerNumber().touched\" [control]=\"ctrlContainerNumber()\" [label]=\"txtContainer()\"></spx-validate-control>\n </spx-input>\n <spx-input\n [formControl]=\"ctrlContainerPrefix()\"\n [spxCapitalize]=\"true\"\n [spxLabel]=\"txtPrefix()\"\n [spxRequired]=\"true\"\n [spxShowValidationMessages]=\"ctrlContainerPrefix() && ctrlContainerPrefix().errors && ctrlContainerPrefix().touched\"\n [spxType]=\"inputTypeText\"\n [spxValidators]=\"getRawValidators(ctrlContainerPrefix())\">\n <spx-validate-control [errors]=\"ctrlContainerPrefix().errors\" [touched]=\"ctrlContainerPrefix().touched\" [control]=\"ctrlContainerPrefix()\" [label]=\"txtPrefix()\"></spx-validate-control>\n </spx-input>\n @if (ctrlCheckDigit().value) {\n <spx-input\n [formControl]=\"ctrlCheckDigit()\"\n [spxLabel]=\"txtCheckDigit()\"\n [spxReadonly]=\"true\"\n [spxType]=\"inputTypeText\">\n </spx-input>\n }\n</form>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,cAAc,GAAG,YAAY;AACnC,MAAM,mBAAmB,GAAG,iBAAiB;AAC7C,MAAM,UAAU,GAAG,QAAQ;MAYd,sBAAsB,CAAA;AAcjC,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAW,CAAA,WAAA,GAAX,WAAW;AAdrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,EAAU;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,EAAU;AACvC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAU;AAC7C,QAAA,IAAA,CAAA,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,CAAC;AACrD,QAAA,IAAA,CAAA,sBAAsB,GAAG,gBAAgB,C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EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAElB,OAAA,EAAA;wBACL,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,2BAA2B;AAC9B,qBAAA,EAAA,QAAA,EAAA,kjDAAA,EAAA;;;AEnBL;;AAEG;;;;"}
|
|
@@ -29,11 +29,11 @@ class SpxConfirmComponent {
|
|
|
29
29
|
this.spxConfirm.emit(this.id());
|
|
30
30
|
}
|
|
31
31
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
32
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: SpxConfirmComponent, isStandalone: true, selector: "spx-confirm", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxConfirm: "spxConfirm" }, ngImport: i0, template: "<div class=\"block spx-confirm h-full mt-12\">\
|
|
32
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.5", type: SpxConfirmComponent, isStandalone: true, selector: "spx-confirm", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { spxCancel: "spxCancel", spxConfirm: "spxConfirm" }, ngImport: i0, template: "<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black dark:text-white\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>", styles: [":host{position:absolute;z-index:var(--z-index--confirm);top:0;left:0;right:0;background-color:var(--color--backdrop)}.spx-confirm{background-color:var(--color--item--background);border-radius:3px;color:var(--ion-text-color, #000);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:90%;max-width:960px}\n"], dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType"], outputs: ["spxClick"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
33
33
|
}
|
|
34
34
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxConfirmComponent, decorators: [{
|
|
35
35
|
type: Component,
|
|
36
|
-
args: [{ selector: 'spx-confirm', imports: [SpxButtonComponent, FaIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"block spx-confirm h-full mt-12\">\
|
|
36
|
+
args: [{ selector: 'spx-confirm', imports: [SpxButtonComponent, FaIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black dark:text-white\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>", styles: [":host{position:absolute;z-index:var(--z-index--confirm);top:0;left:0;right:0;background-color:var(--color--backdrop)}.spx-confirm{background-color:var(--color--item--background);border-radius:3px;color:var(--ion-text-color, #000);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:90%;max-width:960px}\n"] }]
|
|
37
37
|
}], ctorParameters: () => [] });
|
|
38
38
|
|
|
39
39
|
class SpxConfirmDisplayerComponent {
|
|
@@ -67,11 +67,11 @@ class SpxConfirmDisplayerComponent {
|
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
69
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxConfirmDisplayerComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxConfirmDisplayerComponent, isStandalone: true, selector: "spx-confirm-displayer", ngImport: i0, template: "@if (confirms().length > 0) {\
|
|
70
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: SpxConfirmDisplayerComponent, isStandalone: true, selector: "spx-confirm-displayer", ngImport: i0, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}", styles: [""], dependencies: [{ kind: "component", type: SpxConfirmComponent, selector: "spx-confirm", inputs: ["id"], outputs: ["spxCancel", "spxConfirm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
71
71
|
}
|
|
72
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: SpxConfirmDisplayerComponent, decorators: [{
|
|
73
73
|
type: Component,
|
|
74
|
-
args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\
|
|
74
|
+
args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}" }]
|
|
75
75
|
}], ctorParameters: () => [{ type: i1.Store }] });
|
|
76
76
|
|
|
77
77
|
const answer = createAction('[Confirm] Answer', props());
|