@softpak/components 20.8.1 → 20.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/fesm2022/softpak-components-spx-404-page.mjs +3 -3
  2. package/fesm2022/softpak-components-spx-404-page.mjs.map +1 -1
  3. package/fesm2022/softpak-components-spx-alert.mjs +3 -3
  4. package/fesm2022/softpak-components-spx-alert.mjs.map +1 -1
  5. package/fesm2022/softpak-components-spx-app-expiry.mjs +3 -3
  6. package/fesm2022/softpak-components-spx-app-expiry.mjs.map +1 -1
  7. package/fesm2022/softpak-components-spx-button.mjs +3 -3
  8. package/fesm2022/softpak-components-spx-button.mjs.map +1 -1
  9. package/fesm2022/softpak-components-spx-capitalize.mjs +3 -3
  10. package/fesm2022/softpak-components-spx-capitalize.mjs.map +1 -1
  11. package/fesm2022/softpak-components-spx-card.mjs +12 -12
  12. package/fesm2022/softpak-components-spx-card.mjs.map +1 -1
  13. package/fesm2022/softpak-components-spx-change-details.mjs +3 -3
  14. package/fesm2022/softpak-components-spx-change-details.mjs.map +1 -1
  15. package/fesm2022/softpak-components-spx-channel-selection.mjs +9 -9
  16. package/fesm2022/softpak-components-spx-channel-selection.mjs.map +1 -1
  17. package/fesm2022/softpak-components-spx-check-digit.mjs +3 -3
  18. package/fesm2022/softpak-components-spx-check-digit.mjs.map +1 -1
  19. package/fesm2022/softpak-components-spx-confirm.mjs +9 -9
  20. package/fesm2022/softpak-components-spx-confirm.mjs.map +1 -1
  21. package/fesm2022/softpak-components-spx-form-section.mjs +3 -3
  22. package/fesm2022/softpak-components-spx-form-section.mjs.map +1 -1
  23. package/fesm2022/softpak-components-spx-form-view.mjs +6 -6
  24. package/fesm2022/softpak-components-spx-form-view.mjs.map +1 -1
  25. package/fesm2022/softpak-components-spx-helpers.mjs.map +1 -1
  26. package/fesm2022/softpak-components-spx-inputs.mjs +36 -36
  27. package/fesm2022/softpak-components-spx-inputs.mjs.map +1 -1
  28. package/fesm2022/softpak-components-spx-navigation.mjs +9 -9
  29. package/fesm2022/softpak-components-spx-navigation.mjs.map +1 -1
  30. package/fesm2022/softpak-components-spx-number-check.mjs +3 -3
  31. package/fesm2022/softpak-components-spx-number-check.mjs.map +1 -1
  32. package/fesm2022/softpak-components-spx-pagination.mjs +3 -3
  33. package/fesm2022/softpak-components-spx-pagination.mjs.map +1 -1
  34. package/fesm2022/softpak-components-spx-patch.mjs +3 -3
  35. package/fesm2022/softpak-components-spx-patch.mjs.map +1 -1
  36. package/fesm2022/softpak-components-spx-pipes.mjs +3 -3
  37. package/fesm2022/softpak-components-spx-pipes.mjs.map +1 -1
  38. package/fesm2022/softpak-components-spx-progress-bar.mjs +3 -3
  39. package/fesm2022/softpak-components-spx-progress-bar.mjs.map +1 -1
  40. package/fesm2022/softpak-components-spx-spinner.mjs +3 -3
  41. package/fesm2022/softpak-components-spx-spinner.mjs.map +1 -1
  42. package/fesm2022/softpak-components-spx-stock-info.mjs +3 -3
  43. package/fesm2022/softpak-components-spx-stock-info.mjs.map +1 -1
  44. package/fesm2022/softpak-components-spx-storage.mjs.map +1 -1
  45. package/fesm2022/softpak-components-spx-suggestion.mjs +3 -3
  46. package/fesm2022/softpak-components-spx-suggestion.mjs.map +1 -1
  47. package/fesm2022/softpak-components-spx-tabs.mjs +3 -3
  48. package/fesm2022/softpak-components-spx-tabs.mjs.map +1 -1
  49. package/fesm2022/softpak-components-spx-toaster.mjs +3 -3
  50. package/fesm2022/softpak-components-spx-toaster.mjs.map +1 -1
  51. package/fesm2022/softpak-components-spx-toggle.mjs +3 -3
  52. package/fesm2022/softpak-components-spx-toggle.mjs.map +1 -1
  53. package/fesm2022/softpak-components-spx-update.mjs +18 -18
  54. package/fesm2022/softpak-components-spx-update.mjs.map +1 -1
  55. package/fesm2022/softpak-components-spx-validation-messages.mjs +3 -3
  56. package/fesm2022/softpak-components-spx-validation-messages.mjs.map +1 -1
  57. package/fesm2022/softpak-components-spx-validation.mjs +3 -3
  58. package/fesm2022/softpak-components-spx-validation.mjs.map +1 -1
  59. package/fesm2022/softpak-components-spx-welcome.mjs +3 -3
  60. package/fesm2022/softpak-components-spx-welcome.mjs.map +1 -1
  61. package/package.json +22 -22
  62. package/spx-update/index.d.ts +1 -2
  63. package/spx-validation-messages/index.d.ts +2 -2
@@ -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 { ChangeDetectionStrategy, computed, effect, input, output } from '@angular/core';\nimport { Component } from '@angular/core';\nimport {\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 spxSectionChangeDetails = 'changeDetails';\nexport const spxCtrlContainerNumber = 'containerNumber';\nexport const spxCtrlContainerSeqNr = 'containerSeqNr';\nexport const spxCtrlContainerType = 'containerType';\nexport const spxCtrlCustomer = 'customer';\nexport const spxCtrlTonsTested = 'tonsTested';\nexport const spxCtrlLicensePlate = 'licensePlate';\nexport const spxCtrlCategory = 'category';\nexport const spxCtrlUseCategories = '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<FormGroup>();\n readonly suggestions = input<any>();\n private readonly showTonsTested = computed(() =>\n this.suggestions()?.[spxCtrlTonsTested] &&\n this.suggestions()?.[spxCtrlTonsTested].length &&\n this.suggestions()?.[spxCtrlTonsTested].length > 0\n );\n readonly textCategory = input<string>();\n readonly textContainerNumber = input<string>();\n readonly textContainerType = input<string>();\n readonly textCustomer = input<string>();\n readonly textLicensePlate = input<string>();\n readonly textSave = input<string>();\n readonly textTonsTested = input<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: spxSectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber()!,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer()!,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType()!,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested()!,\n show: () => this.showTonsTested(),\n },\n {\n key: spxCtrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate()!,\n capitalize: () => true,\n },\n {\n key: spxCtrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: spxCtrlCategory,\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(spxCtrlCategory) as FormControl);\n readonly ctrlCustomer = computed(() => this.formGroup()?.get(spxCtrlCustomer) as FormControl);\n readonly ctrlContainerType = computed(() => this.formGroup()?.get(spxCtrlContainerType) as FormControl);\n readonly ctrlLicensePlate = computed(() => this.formGroup()?.get(spxCtrlLicensePlate) as FormControl);\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(spxCtrlTonsTested) as FormControl);\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(spxCtrlUseCategories) as FormControl);\n\n private subContainerType?: Subscription;\n\n constructor() {\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.form\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 setTimeout(() => {\n if (data.field.key === spxCtrlCategory && valuePairToValue(this.formGroup()!.get(spxCtrlCategory)!.value) !== null) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType && valuePairToValue(this.formGroup()!.get(spxCtrlContainerType)!.value) !== null) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }, 300);\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === spxCtrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlTonsTested) {\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":";;;;;;;;;AAeO,MAAM,uBAAuB,GAAG;AAChC,MAAM,sBAAsB,GAAG;AAC/B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,oBAAoB,GAAG;AAC7B,MAAM,eAAe,GAAG;AACxB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,eAAe,GAAG;AACxB,MAAM,oBAAoB,GAAG;MAavB,yBAAyB,CAAA;AAqGpC,IAAA,WAAA,GAAA;QApGS,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EA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IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,omDCpCtC,2UAQO,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDqBH,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,QAAA,EAAA,8CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,0FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACX,mBAAmB,gLACnB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAXrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,OAAA,EAErB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2UAAA,EAAA;;;AElCjD;;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 } from '@angular/core';\nimport {\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 spxSectionChangeDetails = 'changeDetails';\nexport const spxCtrlContainerNumber = 'containerNumber';\nexport const spxCtrlContainerSeqNr = 'containerSeqNr';\nexport const spxCtrlContainerType = 'containerType';\nexport const spxCtrlCustomer = 'customer';\nexport const spxCtrlTonsTested = 'tonsTested';\nexport const spxCtrlLicensePlate = 'licensePlate';\nexport const spxCtrlCategory = 'category';\nexport const spxCtrlUseCategories = '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<FormGroup>();\n readonly suggestions = input<any>();\n private readonly showTonsTested = computed(() =>\n this.suggestions()?.[spxCtrlTonsTested] &&\n this.suggestions()?.[spxCtrlTonsTested].length &&\n this.suggestions()?.[spxCtrlTonsTested].length > 0\n );\n readonly textCategory = input<string>();\n readonly textContainerNumber = input<string>();\n readonly textContainerType = input<string>();\n readonly textCustomer = input<string>();\n readonly textLicensePlate = input<string>();\n readonly textSave = input<string>();\n readonly textTonsTested = input<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: spxSectionChangeDetails,\n showTitle: () => false,\n fields: [\n {\n key: spxCtrlContainerSeqNr,\n type: () => SpxInputTypeEnum.hidden,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerNumber,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textContainerNumber()!,\n readonly: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlCustomer,\n type: () => SpxInputTypeEnum.text,\n capitalize: () => true,\n readonly: () => true,\n label: () => this.textCustomer()!,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlContainerType,\n type: () => SpxInputTypeEnum.autocomplete,\n label: () => this.textContainerType()!,\n capitalize: () => true,\n validators: () => [spxValidatorRequired()],\n },\n {\n key: spxCtrlTonsTested,\n type: () => SpxInputTypeEnum.radio,\n label: () => this.textTonsTested()!,\n show: () => this.showTonsTested(),\n },\n {\n key: spxCtrlLicensePlate,\n type: () => SpxInputTypeEnum.text,\n label: () => this.textLicensePlate()!,\n capitalize: () => true,\n },\n {\n key: spxCtrlUseCategories,\n type: () => SpxInputTypeEnum.hidden,\n capitalize: () => true,\n },\n {\n key: spxCtrlCategory,\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(spxCtrlCategory) as FormControl);\n readonly ctrlCustomer = computed(() => this.formGroup()?.get(spxCtrlCustomer) as FormControl);\n readonly ctrlContainerType = computed(() => this.formGroup()?.get(spxCtrlContainerType) as FormControl);\n readonly ctrlLicensePlate = computed(() => this.formGroup()?.get(spxCtrlLicensePlate) as FormControl);\n readonly ctrlTonsTested = computed(() => this.formGroup()?.get(spxCtrlTonsTested) as FormControl);\n readonly ctrlUseCategories = computed(() => this.formGroup()?.get(spxCtrlUseCategories) as FormControl);\n\n private subContainerType?: Subscription;\n\n constructor() {\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.form\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 setTimeout(() => {\n if (data.field.key === spxCtrlCategory && valuePairToValue(this.formGroup()!.get(spxCtrlCategory)!.value) !== null) {\n this.spxBlurCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType && valuePairToValue(this.formGroup()!.get(spxCtrlContainerType)!.value) !== null) {\n this.spxBlurContainerType.emit(data.valuePair);\n }\n }, 300);\n }\n\n onSearch(data: { field: SpxFormFieldI; valuePair: SpxValuePair<any> }) {\n if (data.field.key === spxCtrlCategory) {\n this.spxSearchCategory.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlContainerType) {\n this.spxSearchContainerType.emit(data.valuePair);\n }\n if (data.field.key === spxCtrlTonsTested) {\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":";;;;;;;;;AAeO,MAAM,uBAAuB,GAAG;AAChC,MAAM,sBAAsB,GAAG;AAC/B,MAAM,qBAAqB,GAAG;AAC9B,MAAM,oBAAoB,GAAG;AAC7B,MAAM,eAAe,GAAG;AACxB,MAAM,iBAAiB,GAAG;AAC1B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,eAAe,GAAG;AACxB,MAAM,oBAAoB,GAAG;MAavB,yBAAyB,CAAA;AAqGpC,IAAA,WAAA,GAAA;QApGS,IAAA,CAAA,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAa;QAC9B,IAAA,CAAA,WAAW,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,aAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAO;AAClB,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MACzC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC;YACvC,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC,MAAM;AAC9C,YAAA,IAAI,CAAC,WAAW,EAAE,GAAG,iBAAiB,CAAC,CAAC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AA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,0FAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACX,mBAAmB,gLACnB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,SAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,EAAA,UAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKX,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAXrC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,oBAAoB,EAAA,OAAA,EAErB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,oBAAoB;AACrB,qBAAA,EAAA,UAAA,EACW,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2UAAA,EAAA;;;AElCjD;;AAEG;;;;"}
@@ -114,10 +114,10 @@ class SpxChannelIndicatorComponent {
114
114
  canShowChannelType() {
115
115
  return Capacitor.getPlatform() !== 'web';
116
116
  }
117
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxChannelIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
118
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", 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\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxChannelIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
118
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", 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\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>", dependencies: [{ kind: "component", type: SpxButtonComponent, selector: "spx-button", inputs: ["spxDisabled", "spxClass", "spxClassObject", "spxForm", "spxFullHeight", "spxFullWidth", "spxSeverity", "spxSize", "spxTabIndex", "spxType", "spxName"], outputs: ["spxClick"] }, { kind: "pipe", type: SpxCapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
119
119
  }
120
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxChannelIndicatorComponent, decorators: [{
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxChannelIndicatorComponent, decorators: [{
121
121
  type: Component,
122
122
  args: [{ selector: 'spx-channel-indicator', imports: [
123
123
  SpxButtonComponent,
@@ -138,10 +138,10 @@ class SpxChannelGuard {
138
138
  }
139
139
  return true;
140
140
  }
141
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxChannelGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
142
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxChannelGuard, providedIn: 'root' }); }
141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxChannelGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
142
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxChannelGuard, providedIn: 'root' }); }
143
143
  }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxChannelGuard, decorators: [{
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxChannelGuard, decorators: [{
145
145
  type: Injectable,
146
146
  args: [{
147
147
  providedIn: 'root'
@@ -181,10 +181,10 @@ class Effects {
181
181
  })];
182
182
  })), { dispatch: true });
183
183
  }
184
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: Effects, deps: [{ token: i1.Actions }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
185
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: Effects }); }
184
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Effects, deps: [{ token: i1.Actions }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
185
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Effects }); }
186
186
  }
187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: Effects, decorators: [{
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: Effects, decorators: [{
188
188
  type: Injectable
189
189
  }], ctorParameters: () => [{ type: i1.Actions }, { type: i2.Router }] });
190
190
 
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n}>());\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\n channels: SpxAppChannelI[];\n}>());\n\nconst all = union({\n choose,\n initialize,\n});\n\nexport type Actions = typeof all;\n","\nimport * as actions from './spx-channel.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { Capacitor } from '@capacitor/core';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(actions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n };\n }),\n on(actions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { NavController } from '@ionic/angular';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map } from 'rxjs';\nimport { Capacitor } from '@capacitor/core';\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { switchMap, withLatestFrom } from 'rxjs/operators';\nimport { inject, Injectable } from '@angular/core';\nimport * as actions from './spx-channel.actions';\nimport { setConfig } from '@capacitor/live-updates';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { captureMessage } from '@sentry/angular';\nimport { App } from '@capacitor/app';\nimport { Store } from '@ngrx/store';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,MAAM,GAAG,YAAY,CAAC,wBAAwB,EAAE,KAAK,EAG9D,CAAC;AACE,MAAM,UAAU,GAAG,YAAY,CAAC,4BAA4B,EAAE,KAAK,EAEtE,CAAC;AAEL,MAAM,GAAG,GAAG,KAAK,CAAC;IACd,MAAM;IACN,UAAU;AACb,CAAA,CAAC;;;;;;;;ACPK,MAAM,YAAY,GAAW;AAClC,IAAA,eAAe,EAAE,IAAI;AACrB,IAAA,OAAO,EAAE,IAAI;AACb,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,EAAE;CACb;AASD,MAAM,sBAAsB,GAAG,CAAC,QAA0B,KAA2B;AACnF,IAAA,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;QAC1G,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAkB,KAAK,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC,WAAW,CAA0B,CAAC,CAAC;QAC/P,IAAI,aAAa,EAAE;AACjB,YAAA,OAAO,aAAa;;aACf;AACL,YAAA,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,IAA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,EAAA,CAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;;;;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-channel-selection.mjs","sources":["../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.actions.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.reducer.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.ts","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-indicator/spx-channel-indicator.component.html","../../../../projects/softpak/components/spx-channel-selection/src/spx-channel-guard.ts","../../../../projects/softpak/components/spx-channel-selection/store/spx-channel.effects.ts","../../../../projects/softpak/components/spx-channel-selection/softpak-components-spx-channel-selection.ts"],"sourcesContent":["import { createAction, props, union } from '@ngrx/store';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum } from '@softpak/components/spx-app-configuration';\n\nexport const choose = createAction('[SPX / Channel] Select', props<{\n channel: SpxAppChannelI;\n channelType: SpxAppChannelTypeEnum;\n}>());\nexport const initialize = createAction('[SPX / Channel] Initialize', props<{\n channels: SpxAppChannelI[];\n}>());\n\nconst all = union({\n choose,\n initialize,\n});\n\nexport type Actions = typeof all;\n","\nimport * as actions from './spx-channel.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { SpxAppChannelI, SpxAppChannelTypeEnum, SpxChannelTypeI } from '@softpak/components/spx-app-configuration';\nimport { Capacitor } from '@capacitor/core';\n\nexport const initialState: StateI = {\n previousChannel: null,\n channel: null,\n channelType: null,\n channels: [],\n};\n\nexport interface StateI {\n previousChannel: SpxAppChannelI | null;\n channel: SpxAppChannelI | null;\n channels: SpxAppChannelI[];\n channelType: SpxChannelTypeI | null;\n}\n\nconst determineActiveChannel = (channels: SpxAppChannelI[]): SpxAppChannelI | null => {\n if (SpxStorage.getSetting(SpxStorageKeyEnum.brand) && SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n const channelResult = channels.find(channel => channel.brand === SpxStorage.getSetting(SpxStorageKeyEnum.brand) && channel.channelTypes.some((e: SpxChannelTypeI) => e.name === SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum));\n if (channelResult) {\n return channelResult;\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n } else {\n SpxStorage.clearSetting(SpxStorageKeyEnum.brand);\n return null;\n }\n }\n } else {\n const defaultBrandResult = channels.find(channel => channel.default);\n if (defaultBrandResult) {\n return defaultBrandResult;\n }\n return null;\n }\n}\n\nexport default createFeature({\n name: 'spxChannel',\n reducer: createReducer(\n initialState,\n on(actions.choose, (state, { channel, channelType }): StateI => {\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand, channel?.brand);\n SpxStorage.setSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType, channelType);\n return {\n ...state,\n previousChannel: state.channel,\n channel,\n };\n }),\n on(actions.initialize, (state, { channels }): StateI => {\n\n let channelType: SpxChannelTypeI | null = null;\n\n if (SpxStorage.getSetting(SpxStorageKeyEnum.channelType)) {\n channelType = { name: SpxStorage.getSetting(SpxStorageKeyEnum.channelType) as SpxAppChannelTypeEnum };\n }\n else {\n channelType = { name: Capacitor.getPlatform() === 'web' ? SpxAppChannelTypeEnum.webLive : SpxAppChannelTypeEnum.production }; // Default to production if no type is set\n }\n\n return {\n ...state,\n channel: determineActiveChannel(channels),\n channels: channels.slice().sort((a, b) => a.brand.localeCompare(b.brand)),\n channelType: channelType,\n }\n }),\n ),\n});\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport spxChannelReducer from '../../store/spx-channel.reducer';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { SpxCapitalizePipe } from '@softpak/components/spx-capitalize';\nimport { spxTextChange } from '@softpak/components/spx-translate';\nimport { NavController } from '@ionic/angular';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { map } from 'rxjs';\nimport { Capacitor } from '@capacitor/core';\nexport const spxChannelSelectionUrl = 'wlc';\n\n@Component({\n selector: 'spx-channel-indicator',\n templateUrl: './spx-channel-indicator.component.html',\n imports: [\n SpxButtonComponent,\n SpxCapitalizePipe,\n TranslatePipe,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxChannelIndicatorComponent {\n private readonly navController = inject(NavController);\n private readonly store = inject(Store);\n protected readonly channel = toSignal(this.store.select(spxChannelReducer.selectChannel));\n protected readonly channelType = toSignal(this.store.select(spxChannelReducer.selectChannelType).pipe(\n map(channelType => channelType?.name)\n ));\n protected readonly spxTextChange = spxTextChange;\n\n protected onChange() {\n this.navController.navigateRoot([spxChannelSelectionUrl]);\n }\n\n protected canShowChannelType() {\n return Capacitor.getPlatform() !== 'web';\n }\n}\n","<div class=\"bg-white p-3 rounded flex gap-3 items-center text-black\">\n <div class=\"grow\">\n <div class=\"text-lg font-bold\">{{ channel()?.brand }}</div>\n @if (canShowChannelType() && channelType() !== 'Production') {\n <div class=\"text-base text-gray-600\">{{ channelType() }}</div>\n }\n </div>\n <spx-button (click)=\"onChange()\" [spxType]=\"'button'\">{{ spxTextChange | translate | capitalize }}</spx-button>\n</div>","import { Router } from '@angular/router';\nimport { inject, Injectable } from '@angular/core';\nimport { SpxStorage, SpxStorageKeyEnum } from '@softpak/components/spx-storage';\nimport { spxChannelSelectionUrl } from './spx-channel-indicator/spx-channel-indicator.component';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SpxChannelGuard {\n\n private readonly router = inject(Router);\n\n canActivate(): boolean {\n if (\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.brand) ||\n !SpxStorage.getSetting<SpxStorageKeyEnum>(SpxStorageKeyEnum.channelType)\n ) {\n this.router.navigate([spxChannelSelectionUrl]);\n return false;\n }\n return true;\n }\n}\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { switchMap, withLatestFrom } from 'rxjs/operators';\nimport { inject, Injectable } from '@angular/core';\nimport * as actions from './spx-channel.actions';\nimport { setConfig } from '@capacitor/live-updates';\nimport { Capacitor } from '@capacitor/core';\nimport { Router } from '@angular/router';\nimport { spxUpdateUrl } from '@softpak/components/spx-update';\nimport { spxToasterActions, SpxToasterAutoCloseSpeedEnum } from '@softpak/components/spx-toaster';\nimport { captureMessage } from '@sentry/angular';\nimport { App } from '@capacitor/app';\nimport { Store } from '@ngrx/store';\n\n@Injectable()\nexport class Effects {\n store = inject(Store);\n\n onChoose$ =\n createEffect(() =>\n this.actions$.pipe(\n ofType(actions.choose),\n switchMap((action) => {\n if (Capacitor.getPlatform() === 'web') {\n const channelType = action.channel.channelTypes.find(channelType => channelType.name === action.channelType)!;\n if (channelType.webUrl && !window.location.href.includes('http://localhost') && window.location.href.replace(channelType.webUrl!,'').replace(channelType.oldWebUrl!,'').split('/').at(0) !== '') {\n window.location.href = channelType.webUrl!;\n } else {\n this.router.navigate(['tabs/hme']);\n }\n } else {\n App.getInfo().then((binaryInfo) => {\n const binaryVersionGroup = binaryInfo.version.substring(0, 3);\n setConfig({\n channel: `${action.channelType}-${binaryVersionGroup}.x`\n });\n this.router.navigate([spxUpdateUrl]);\n }).catch((err) => {\n captureMessage(`SPX Channel Error: ${JSON.stringify(err)}`);\n this.router.navigate([spxUpdateUrl]);\n });\n }\n\n return [spxToasterActions.createSuccess({\n autoClose: SpxToasterAutoCloseSpeedEnum.DEFAULT,\n messageText: action.channel?.brand,\n })];\n }),\n ), { dispatch: true });\n\n constructor(\n private readonly actions$: Actions,\n private readonly router: Router,\n ) { }\n}\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["actions.choose","actions.initialize","spxChannelReducer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAM,MAAM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90
90
  }
91
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
92
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", 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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\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: ["spxSpeedDial", "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", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }] }); }
91
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxCheckDigitComponent, deps: [{ token: i1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
92
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", 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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\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: ["spxSpeedDial", "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", "spxCycleConfig"], outputs: ["spxClear", "spxEdit", "spxHelp", "spxSearch", "spxBlur"] }, { kind: "component", type: SpxValidateControlComponent, selector: "spx-validate-control", inputs: ["control", "label", "submitTried", "errors", "touched"] }] }); }
93
93
  }
94
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxCheckDigitComponent, decorators: [{
95
95
  type: Component,
96
96
  args: [{ selector: 'spx-check-digit', imports: [
97
97
  FormsModule,
@@ -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, computed, input, signal, viewChild } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SpxCycleConfig, SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { calcCheckDigit, valuePairToValue } from '@softpak/components/spx-helpers';\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 protected readonly inputTypeCycleNumeric = SpxInputTypeEnum.cycleNumeric;\n protected readonly inputTypeCycle = SpxInputTypeEnum.cycle;\n protected readonly 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 protected readonly containerNumberCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 0,\n fieldPattern: '[0-9]*',\n focusOrder: [0, 1, 2, 3, 4, 5],\n length: 6,\n requiredPositions: [true, true, true, true, true, true]\n };\n protected readonly containerPrefixCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 0,\n fieldPattern: '[a-zA-Z]*',\n focusOrder: [0, 1, 2, 3],\n length: 4,\n requiredPositions: [true, true, true, true]\n };\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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\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;AA8BjC,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AA9BrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDAAU;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,uDAAU;AACvC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAU;AAC7C,QAAA,IAAA,CAAA,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,kEAAC;AAClC,QAAA,IAAA,CAAA,qBAAqB,GAAG,gBAAgB,CAAC,YAAY;AACrD,QAAA,IAAA,CAAA,cAAc,GAAG,gBAAgB,CAAC,KAAK;AACvC,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI;AACxD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI,qDAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,cAAc,CAAgB,0DAAC;AACrF,QAAA,IAAA,CAAA,mBAAmB,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,mBAAmB,CAAgB,+DAAC;AAC/F,QAAA,IAAA,CAAA,mBAA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AAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,aAAA,EAAA,QAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGlB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,OAAA,EAElB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,4pDAAA,EAAA;;;AEnBH;;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 { SpxCycleConfig, SpxInputComponent, SpxInputTypeEnum } from '@softpak/components/spx-inputs';\nimport { SpxValidateControlComponent, spxValidatorMaxLength, spxValidatorMinLength, spxValidatorPattern, spxValidatorRequired } from '@softpak/components/spx-validation';\nimport { Subscription, combineLatest, map, startWith } from 'rxjs';\nimport { calcCheckDigit, valuePairToValue } from '@softpak/components/spx-helpers';\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 protected readonly inputTypeCycleNumeric = SpxInputTypeEnum.cycleNumeric;\n protected readonly inputTypeCycle = SpxInputTypeEnum.cycle;\n protected readonly 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 protected readonly containerNumberCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 0,\n fieldPattern: '[0-9]*',\n focusOrder: [0, 1, 2, 3, 4, 5],\n length: 6,\n requiredPositions: [true, true, true, true, true, true]\n };\n protected readonly containerPrefixCycleConfig: SpxCycleConfig = {\n defaultFocusPosition: 0,\n fieldPattern: '[a-zA-Z]*',\n focusOrder: [0, 1, 2, 3],\n length: 4,\n requiredPositions: [true, true, true, true]\n };\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]=\"inputTypeCycleNumeric\"\n [spxCycleConfig]=\"containerNumberCycleConfig\"\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]=\"inputTypeCycle\"\n [spxCycleConfig]=\"containerPrefixCycleConfig\"\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;AA8BjC,IAAA,WAAA,CACmB,WAAwB,EAAA;QAAxB,IAAA,CAAA,WAAW,GAAX,WAAW;AA9BrB,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,QAAQ,wDAAU;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,QAAQ,uDAAU;AACvC,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ,oDAAU;AAC7C,QAAA,IAAA,CAAA,sBAAsB,GAAG,SAAS,CAAC,iBAAiB,kEAAC;AAClC,QAAA,IAAA,CAAA,qBAAqB,GAAG,gBAAgB,CAAC,YAAY;AACrD,QAAA,IAAA,CAAA,cAAc,GAAG,gBAAgB,CAAC,KAAK;AACvC,QAAA,IAAA,CAAA,aAAa,GAAG,gBAAgB,CAAC,IAAI;AACxD,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAmB,IAAI,qDAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,G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,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,aAAA,EAAA,aAAA,EAAA,cAAA,EAAA,YAAA,EAAA,cAAA,EAAA,eAAA,EAAA,UAAA,EAAA,2BAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,SAAA,EAAA,eAAA,EAAA,eAAA,EAAA,gBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,UAAA,EAAA,SAAA,EAAA,SAAA,EAAA,WAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACjB,2BAA2B,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,OAAA,EAAA,aAAA,EAAA,QAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGlB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAVlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,EAAA,OAAA,EAElB;wBACP,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,2BAA2B;AAC5B,qBAAA,EAAA,QAAA,EAAA,4pDAAA,EAAA;;;AEnBH;;AAEG;;;;"}
@@ -28,10 +28,10 @@ class SpxConfirmComponent {
28
28
  if (this.id()) { }
29
29
  this.spxConfirm.emit(this.id());
30
30
  }
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
32
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.2", 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\">\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", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
31
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
32
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.2.3", 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\">\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", "spxName"], outputs: ["spxClick"] }, { kind: "component", type: FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "mask", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "transform", "a11yRole"], outputs: ["iconChange", "titleChange", "animationChange", "maskChange", "flipChange", "sizeChange", "pullChange", "borderChange", "inverseChange", "symbolChange", "rotateChange", "fixedWidthChange", "transformChange", "a11yRoleChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
33
33
  }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmComponent, decorators: [{
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmComponent, decorators: [{
35
35
  type: Component,
36
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\">\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: () => [] });
@@ -66,10 +66,10 @@ class SpxConfirmDisplayerComponent {
66
66
  id
67
67
  }));
68
68
  }
69
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmDisplayerComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
70
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", 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 }); }
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmDisplayerComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
70
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", 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
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmDisplayerComponent, decorators: [{
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmDisplayerComponent, decorators: [{
73
73
  type: Component,
74
74
  args: [{ selector: 'spx-confirm-displayer', imports: [SpxConfirmComponent], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}" }]
75
75
  }], ctorParameters: () => [{ type: i1.Store }] });
@@ -147,10 +147,10 @@ class SpxConfirmEffects {
147
147
  ];
148
148
  })));
149
149
  }
150
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmEffects, deps: [{ token: i1$1.Actions }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
151
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmEffects }); }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmEffects, deps: [{ token: i1$1.Actions }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
151
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmEffects }); }
152
152
  }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxConfirmEffects, decorators: [{
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxConfirmEffects, decorators: [{
154
154
  type: Injectable
155
155
  }], ctorParameters: () => [{ type: i1$1.Actions }, { type: i1.Store }] });
156
156
 
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Observable } from 'rxjs';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './spx-confirm.actions';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({})\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;;IAIzC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,QAAQ;QACR,IAAA,CAAA,QAAQ,GAAR,QAAQ;AAtB3B,QAAA,IAAA,CAAA,SAAS,GAAoB,YAAY,CAAC,MACxC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAChB,MAAM,CAACC,MAAc,CAAC,EACtB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAACC,mBAAiB,CAAC,cAAc,CAAC,CAAC,EACtE,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAI;AAE9B,YAAA,IAAI,MAAM,CAAC,OAAO,EAAE;gBAClB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,IAAI,IAAI;;AAEpD,YAAA,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,EAAE,QAAQ,IAAI;;YAExD,OAAO;gBACLF,aAAqB,CAAC,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,EAAC,CAAC;AACtC,gBAAA,iBAAiB,CAAC,IAAI,CAAC,EAAE;aAC1B;SACF,CAAC,CACH,CACF;;8GAnBU,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAG,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,EAAA,CAAA,KAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;;;;;;ACTD;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-confirm.mjs","sources":["../../../../projects/softpak/components/spx-confirm/spx-confirm.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm.component.html","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.ts","../../../../projects/softpak/components/spx-confirm/spx-confirm-displayer/spx-confirm-displayer.component.html","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.actions.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.reducer.ts","../../../../projects/softpak/components/spx-confirm/store/spx-confirm.effects.ts","../../../../projects/softpak/components/spx-confirm/softpak-components-spx-confirm.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\nimport { FaIconComponent } from '@fortawesome/angular-fontawesome';\nimport { faTimes } from '@fortawesome/free-solid-svg-icons';\nimport { SpxButtonComponent } from '@softpak/components/spx-button';\nimport { SpxSeverityEnum } from '@softpak/components/spx-helpers';\n\n@Component({\n selector: 'spx-confirm',\n templateUrl: './spx-confirm.component.html',\n styleUrls: ['./spx-confirm.component.scss'],\n imports: [SpxButtonComponent, FaIconComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmComponent {\n id = input.required<string>();\n spxCancel = output<string>();\n spxConfirm = output<string>();\n faTimes = faTimes;\n severityError = SpxSeverityEnum.error;\n severityInfo = SpxSeverityEnum.info;\n severitySuccess = SpxSeverityEnum.success;\n\n constructor() { }\n\n onCancel() {\n this.spxCancel.emit(this.id());\n }\n\n onConfirm() {\n if(this.id()) {}\n this.spxConfirm.emit(this.id());\n }\n\n}\n","<div class=\"block spx-confirm h-full mt-12\">\n <div class=\"bg-amber-400 flex gap-3 items-center px-3 py-1 rounded-t text-black\">\n <div class=\"grow font-bold\">\n <ng-content select=\"[confirm__title]\"></ng-content>\n </div>\n <spx-button (spxClick)=\"onCancel()\" [spxType]=\"'button'\" [spxSeverity]=\"severityInfo\"><fa-icon\n [icon]=\"faTimes\"></fa-icon>\n </spx-button>\n </div>\n <div class=\"flex flex-col gap-3 dark:bg-gray-700 bg-white p-3\">\n <ng-content select=\"[confirm__content]\"></ng-content>\n <div class=\"grid grid-cols-1 grid-rows-2 sm:grid-rows-1 sm:grid-cols-2 gap-3 grid-flow-row\">\n <spx-button (spxClick)=\"onCancel()\" [spxFullWidth]=\"true\" [spxType]=\"'button'\"\n [spxSeverity]=\"severityError\">\n <ng-content select=\"[confirm__btn_cancel]\"></ng-content>\n </spx-button>\n <spx-button #confirm (spxClick)=\"onConfirm()\" [spxFullWidth]=\"true\" [spxType]=\"'submit'\"\n [spxSeverity]=\"severitySuccess\">\n <ng-content select=\"[confirm__btn_confirm]\"></ng-content>\n </spx-button>\n </div>\n </div>\n</div>","import { ChangeDetectionStrategy, Component, OnDestroy, OnInit, signal } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { Subscription } from 'rxjs';\nimport { SpxConfirmComponent } from '../spx-confirm.component';\nimport { spxConfirmActions, spxConfirmReducer } from '../public-api';\n\n@Component({\n selector: 'spx-confirm-displayer',\n templateUrl: './spx-confirm-displayer.component.html',\n styleUrls: ['./spx-confirm-displayer.component.scss'],\n imports: [SpxConfirmComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true\n})\nexport class SpxConfirmDisplayerComponent implements OnInit, OnDestroy {\n confirms = signal<{\n content: string;\n id: string;\n title: string;\n cancelled?: boolean;\n confirmed?: boolean;\n noYesButton?: boolean;\n }[]>([]);\n\n private subscriptions: {\n confirmState?: Subscription;\n } = {};\n\n constructor(\n private readonly appStore: Store,\n ) { }\n\n ngOnInit() {\n this.subscriptions.confirmState = this.appStore.select(spxConfirmReducer.default.selectConfirms).subscribe(confirms => {\n if (confirms?.length === 0) {\n this.confirms.set([]);\n return;\n }\n\n this.confirms.set(confirms);\n });\n }\n\n ngOnDestroy() {\n this.subscriptions?.confirmState?.unsubscribe();\n }\n\n onCancel(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n cancel: true,\n id\n }));\n }\n\n onConfirm(id: string) {\n this.appStore.dispatch(spxConfirmActions.answer({\n confirm: true,\n id\n }));\n }\n\n}\n","@if (confirms().length > 0) {\n <div class=\"bg-black/75 block relative h-full\" style=\"z-index: 1000\">\n @for (confirm of confirms(); track confirm.id) {\n <spx-confirm [id]=\"confirm.id\" (spxCancel)=\"onCancel($event)\"\n (spxConfirm)=\"onConfirm($event)\">\n <ng-container confirm__title>{{ confirm.title }}</ng-container>\n <ng-container confirm__content>{{ confirm.content }}</ng-container>\n <ng-container confirm__btn_cancel>{{confirm.noYesButton ? 'NO' : 'Cancel'}}</ng-container>\n <ng-container confirm__btn_confirm>{{confirm.noYesButton ? 'YES' : 'OK'}}</ng-container>\n </spx-confirm>\n }\n </div>\n}","import { createAction, props, union } from '@ngrx/store';\nimport { SpxConfirmI } from './spx-confirm.reducer';\n\nexport const answer = createAction('[Confirm] Answer', props<{\n cancel?: boolean;\n confirm?: boolean;\n id: string;\n}>());\nexport const reset = createAction('[Confirm] Reset', props<Record<string, unknown>>());\nexport const show = createAction('[Confirm] Show', props<SpxConfirmI>());\n\nexport const answerConfirm = createAction('[Confirm] Answer Confirm', props<{\n id: string;\n}>());\n\nconst all = union({\n reset,\n show,\n answerConfirm,\n});\nexport type Actions = typeof all;\n","import * as actions from './spx-confirm.actions';\nimport { createFeature, createReducer, on } from '@ngrx/store';\n\nexport interface SpxConfirmI {\n content: string;\n id: string;\n title: string;\n noYesButton?: boolean;\n onOK?: () => void;\n onCancel?: () => void;\n}\n\nexport interface State {\n confirms: SpxConfirmI[];\n}\n\nconst initialState: State = {\n confirms: [],\n};\n\nexport default createFeature({\n name: 'spxConfirm',\n reducer: createReducer(\n initialState,\n on(\n actions.reset,\n (state: State, {}): State => ({\n ...state,\n })\n ),\n on(\n actions.show,\n (state: State, { content, id, title, noYesButton, onCancel, onOK }): State => {\n const confirms =\n state.confirms.filter((c) => c.id).length > 0\n ? state.confirms\n : [\n ...state.confirms,\n {\n content,\n id,\n title,\n noYesButton,\n onCancel,\n onOK,\n },\n ];\n return {\n ...state,\n confirms,\n };\n }\n ),\n on(\n actions.answerConfirm,\n (state: State, { id }): State => ({\n ...state,\n confirms: [\n ...state.confirms.filter((c) => c.id !== id),\n ],\n })\n )\n ),\n});\n","import { Actions, createEffect, ofType } from '@ngrx/effects';\nimport { Observable } from 'rxjs';\nimport { mergeMap, withLatestFrom } from 'rxjs/operators';\nimport { Injectable } from '@angular/core';\nimport * as actions from './spx-confirm.actions';\nimport { spxSpinnerActions } from '@softpak/components/spx-spinner';\nimport { Store } from '@ngrx/store';\nimport spxConfirmReducer from './spx-confirm.reducer';\n\n@Injectable()\nexport class SpxConfirmEffects {\n onAnswer$: Observable<any> = createEffect(() =>\n this.actions$.pipe(\n ofType(actions.answer),\n withLatestFrom(this.appStore.select(spxConfirmReducer.selectConfirms)),\n mergeMap(([action, confirms]) => {\n\n if (action.confirm) {\n confirms.find((c) => c.id === action.id)?.onOK?.();\n }\n if (action.cancel) {\n confirms.find((c) => c.id === action.id)?.onCancel?.();\n }\n return [\n actions.answerConfirm({id: action.id}),\n spxSpinnerActions.hide({})\n ];\n })\n )\n );\n\n constructor(\n private readonly actions$: Actions,\n private readonly appStore: Store,\n ) {}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["spxConfirmReducer.default","spxConfirmActions.answer","actions.reset","actions.show","actions.answerConfirm","actions.answer","spxConfirmReducer","i1","i2"],"mappings":";;;;;;;;;;;;;MAca,mBAAmB,CAAA;AAS9B,IAAA,WAAA,GAAA;AARA,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,QAAQ,6CAAU;QAC7B,IAAA,CAAA,SAAS,GAAG,MAAM,EAAU;QAC5B,IAAA,CAAA,UAAU,GAAG,MAAM,EAAU;QAC7B,IAAA,CAAA,OAAO,GAAG,OAAO;AACjB,QAAA,IAAA,CAAA,aAAa,GAAG,eAAe,CAAC,KAAK;AACrC,QAAA,IAAA,CAAA,YAAY,GAAG,eAAe,CAAC,IAAI;AACnC,QAAA,IAAA,CAAA,eAAe,GAAG,eAAe,CAAC,OAAO;IAEzB;IAEhB,QAAQ,G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evMode ? [undefined, { debugName: "spxTitle" }] : []));
9
9
  this.spxShowTitle = input(true, ...(ngDevMode ? [{ debugName: "spxShowTitle" }] : []));
10
10
  }
11
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxFormSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: { classPropertyName: "spxIndex", publicName: "spxIndex", isSignal: true, isRequired: false, transformFunction: null }, spxIndexSecondary: { classPropertyName: "spxIndexSecondary", publicName: "spxIndexSecondary", isSignal: true, isRequired: false, transformFunction: null }, spxTitle: { classPropertyName: "spxTitle", publicName: "spxTitle", isSignal: true, isRequired: false, transformFunction: null }, spxShowTitle: { classPropertyName: "spxShowTitle", publicName: "spxShowTitle", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (this.spxShowTitle()) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\n {{ this.spxIndexSecondary() }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>", styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxFormSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: SpxFormSectionComponent, isStandalone: true, selector: "spx-form-section", inputs: { spxIndex: { classPropertyName: "spxIndex", publicName: "spxIndex", isSignal: true, isRequired: false, transformFunction: null }, spxIndexSecondary: { classPropertyName: "spxIndexSecondary", publicName: "spxIndexSecondary", isSignal: true, isRequired: false, transformFunction: null }, spxTitle: { classPropertyName: "spxTitle", publicName: "spxTitle", isSignal: true, isRequired: false, transformFunction: null }, spxShowTitle: { classPropertyName: "spxShowTitle", publicName: "spxShowTitle", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (this.spxShowTitle()) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\n {{ this.spxIndexSecondary() }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>", styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13
13
  }
14
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: SpxFormSectionComponent, decorators: [{
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: SpxFormSectionComponent, decorators: [{
15
15
  type: Component,
16
16
  args: [{ selector: 'spx-form-section', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "@if (this.spxShowTitle()) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\n {{ this.spxIndexSecondary() }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>", styles: [":host{display:block}.spx-form-section__title-index{background-color:#000;display:inline-block;vertical-align:middle}.spx-form-section__title{color:var(--spx-form-section--color, #FFFFFF)}.spx-form-section__content{color:#000}@media (prefers-color-scheme: dark){.spx-form-section__title-index{background-color:var(--spx-form-section--color, #FFFFFF);color:#000}.spx-form-section__content{color:var(--spx-form-section--color, #FFFFFF)}}\n"] }]
17
17
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/spx-form-section.component.html","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n imports: [],\n templateUrl: './spx-form-section.component.html',\n styleUrl: './spx-form-section.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormSectionComponent {\n readonly spxIndex = input<number>();\n readonly spxIndexSecondary = input<number>();\n readonly spxTitle = input<string>();\n readonly spxShowTitle = input<boolean>(true);\n}\n","@if (this.spxShowTitle()) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\n {{ this.spxIndexSecondary() }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAWa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;QASW,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC1B,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QACnC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC1B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAU,IAAI,wDAAC;AAC7C;8GALY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uBAAuB,moBCXpC,mhBAUM,EAAA,MAAA,EAAA,CAAA,sbAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FDCO,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AACI,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,WACnB,EAAE,EAAA,eAAA,EAGM,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,QAAA,EAAA,mhBAAA,EAAA,MAAA,EAAA,CAAA,sbAAA,CAAA,EAAA;;;AETpB;;AAEG;;;;"}
1
+ {"version":3,"file":"softpak-components-spx-form-section.mjs","sources":["../../../../projects/softpak/components/spx-form-section/spx-form-section.component.ts","../../../../projects/softpak/components/spx-form-section/spx-form-section.component.html","../../../../projects/softpak/components/spx-form-section/softpak-components-spx-form-section.ts"],"sourcesContent":["\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n selector: 'spx-form-section',\n imports: [],\n templateUrl: './spx-form-section.component.html',\n styleUrl: './spx-form-section.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class SpxFormSectionComponent {\n readonly spxIndex = input<number>();\n readonly spxIndexSecondary = input<number>();\n readonly spxTitle = input<string>();\n readonly spxShowTitle = input<boolean>(true);\n}\n","@if (this.spxShowTitle()) {\n <div class=\"spx-form-section__title mb-3 flex gap-3 items-center\">\n <div class=\"spx-form-section__title-index flex content-center text-center text-sm h-[30px] w-[30px] font-bold rounded\">{{this.spxIndex()}}@if (this.spxIndexSecondary()) {\n {{ this.spxIndexSecondary() }}\n }</div>\n <div class=\"spx-form-section__content font-bold grow text-black dark:text-white\">{{this.spxTitle()}}</div>\n </div>\n}\n<div class=\"flex flex-col gap-3\">\n <ng-content></ng-content>\n</div>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAWa,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;QASW,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,UAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;QAC1B,IAAA,CAAA,iBAAiB,GAAG,KAAK,CAAA,IA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