@koalarx/ui 21.2.2 → 21.2.4

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 (94) hide show
  1. package/fesm2022/koalarx-ui-core-base.mjs +16 -16
  2. package/fesm2022/koalarx-ui-core-base.mjs.map +1 -1
  3. package/fesm2022/koalarx-ui-core-components-dialog.mjs +3 -3
  4. package/fesm2022/koalarx-ui-core-components-kl-root.mjs +4 -4
  5. package/fesm2022/koalarx-ui-core-components-kl-root.mjs.map +1 -1
  6. package/fesm2022/koalarx-ui-core-components-loader-page.mjs +7 -7
  7. package/fesm2022/koalarx-ui-core-components-loader-page.mjs.map +1 -1
  8. package/fesm2022/koalarx-ui-core-components-loader.mjs +4 -4
  9. package/fesm2022/koalarx-ui-core-components-loader.mjs.map +1 -1
  10. package/fesm2022/koalarx-ui-core-components-side-window.mjs +3 -3
  11. package/fesm2022/koalarx-ui-core-components-snackbar.mjs +3 -3
  12. package/fesm2022/koalarx-ui-core-config.mjs +1 -1
  13. package/fesm2022/koalarx-ui-core-config.mjs.map +1 -1
  14. package/fesm2022/koalarx-ui-core-guards.mjs +3 -3
  15. package/fesm2022/koalarx-ui-core-guards.mjs.map +1 -1
  16. package/fesm2022/koalarx-ui-shared-components-accordion.mjs +4 -4
  17. package/fesm2022/koalarx-ui-shared-components-accordion.mjs.map +1 -1
  18. package/fesm2022/koalarx-ui-shared-components-alert.mjs +6 -6
  19. package/fesm2022/koalarx-ui-shared-components-alert.mjs.map +1 -1
  20. package/fesm2022/koalarx-ui-shared-components-code-viewer.mjs +11 -11
  21. package/fesm2022/koalarx-ui-shared-components-code-viewer.mjs.map +1 -1
  22. package/fesm2022/koalarx-ui-shared-components-collapse.mjs +3 -3
  23. package/fesm2022/koalarx-ui-shared-components-confirm.mjs +6 -6
  24. package/fesm2022/koalarx-ui-shared-components-confirm.mjs.map +1 -1
  25. package/fesm2022/koalarx-ui-shared-components-datatable.mjs +47 -47
  26. package/fesm2022/koalarx-ui-shared-components-datatable.mjs.map +1 -1
  27. package/fesm2022/koalarx-ui-shared-components-dialog.mjs +9 -9
  28. package/fesm2022/koalarx-ui-shared-components-dialog.mjs.map +1 -1
  29. package/fesm2022/koalarx-ui-shared-components-dropdown.mjs +6 -6
  30. package/fesm2022/koalarx-ui-shared-components-dropdown.mjs.map +1 -1
  31. package/fesm2022/koalarx-ui-shared-components-field-errors.mjs +4 -4
  32. package/fesm2022/koalarx-ui-shared-components-field-errors.mjs.map +1 -1
  33. package/fesm2022/koalarx-ui-shared-components-horizontal-menu.mjs +7 -7
  34. package/fesm2022/koalarx-ui-shared-components-horizontal-menu.mjs.map +1 -1
  35. package/fesm2022/koalarx-ui-shared-components-input-field-field-group.mjs +3 -3
  36. package/fesm2022/koalarx-ui-shared-components-input-field-fieldset.mjs +3 -3
  37. package/fesm2022/koalarx-ui-shared-components-input-field-input-checkbox.mjs +6 -6
  38. package/fesm2022/koalarx-ui-shared-components-input-field-input-checkbox.mjs.map +1 -1
  39. package/fesm2022/koalarx-ui-shared-components-input-field-input-cnpj.mjs +3 -3
  40. package/fesm2022/koalarx-ui-shared-components-input-field-input-cnpj.mjs.map +1 -1
  41. package/fesm2022/koalarx-ui-shared-components-input-field-input-cpf.mjs +3 -3
  42. package/fesm2022/koalarx-ui-shared-components-input-field-input-cpf.mjs.map +1 -1
  43. package/fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs +5 -5
  44. package/fesm2022/koalarx-ui-shared-components-input-field-input-currency.mjs.map +1 -1
  45. package/fesm2022/koalarx-ui-shared-components-input-field-input-date.mjs +5 -5
  46. package/fesm2022/koalarx-ui-shared-components-input-field-input-date.mjs.map +1 -1
  47. package/fesm2022/koalarx-ui-shared-components-input-field-input-datetime.mjs +5 -5
  48. package/fesm2022/koalarx-ui-shared-components-input-field-input-datetime.mjs.map +1 -1
  49. package/fesm2022/koalarx-ui-shared-components-input-field-input-email.mjs +3 -3
  50. package/fesm2022/koalarx-ui-shared-components-input-field-input-email.mjs.map +1 -1
  51. package/fesm2022/koalarx-ui-shared-components-input-field-input-month.mjs +5 -5
  52. package/fesm2022/koalarx-ui-shared-components-input-field-input-month.mjs.map +1 -1
  53. package/fesm2022/koalarx-ui-shared-components-input-field-input-number.mjs +3 -3
  54. package/fesm2022/koalarx-ui-shared-components-input-field-input-password.mjs +5 -5
  55. package/fesm2022/koalarx-ui-shared-components-input-field-input-password.mjs.map +1 -1
  56. package/fesm2022/koalarx-ui-shared-components-input-field-input-radio.mjs +9 -9
  57. package/fesm2022/koalarx-ui-shared-components-input-field-input-radio.mjs.map +1 -1
  58. package/fesm2022/koalarx-ui-shared-components-input-field-input-text.mjs +4 -4
  59. package/fesm2022/koalarx-ui-shared-components-input-field-input-text.mjs.map +1 -1
  60. package/fesm2022/koalarx-ui-shared-components-input-field-input-time.mjs +5 -5
  61. package/fesm2022/koalarx-ui-shared-components-input-field-input-time.mjs.map +1 -1
  62. package/fesm2022/koalarx-ui-shared-components-input-field-input-url.mjs +3 -3
  63. package/fesm2022/koalarx-ui-shared-components-input-field-input-url.mjs.map +1 -1
  64. package/fesm2022/koalarx-ui-shared-components-input-field-range.mjs +14 -14
  65. package/fesm2022/koalarx-ui-shared-components-input-field-range.mjs.map +1 -1
  66. package/fesm2022/koalarx-ui-shared-components-input-field-select.mjs +22 -22
  67. package/fesm2022/koalarx-ui-shared-components-input-field-select.mjs.map +1 -1
  68. package/fesm2022/koalarx-ui-shared-components-input-field-switcher.mjs +6 -6
  69. package/fesm2022/koalarx-ui-shared-components-input-field-switcher.mjs.map +1 -1
  70. package/fesm2022/koalarx-ui-shared-components-input-field-textarea.mjs +6 -6
  71. package/fesm2022/koalarx-ui-shared-components-input-field-textarea.mjs.map +1 -1
  72. package/fesm2022/koalarx-ui-shared-components-input-field.mjs +18 -18
  73. package/fesm2022/koalarx-ui-shared-components-input-field.mjs.map +1 -1
  74. package/fesm2022/koalarx-ui-shared-components-on-this-page.mjs +6 -6
  75. package/fesm2022/koalarx-ui-shared-components-on-this-page.mjs.map +1 -1
  76. package/fesm2022/koalarx-ui-shared-components-side-window.mjs +9 -9
  77. package/fesm2022/koalarx-ui-shared-components-side-window.mjs.map +1 -1
  78. package/fesm2022/koalarx-ui-shared-components-snackbar.mjs +15 -15
  79. package/fesm2022/koalarx-ui-shared-components-snackbar.mjs.map +1 -1
  80. package/fesm2022/koalarx-ui-shared-components-stepper.mjs +13 -13
  81. package/fesm2022/koalarx-ui-shared-components-stepper.mjs.map +1 -1
  82. package/fesm2022/koalarx-ui-shared-components-vertical-menu.mjs +7 -7
  83. package/fesm2022/koalarx-ui-shared-components-vertical-menu.mjs.map +1 -1
  84. package/fesm2022/koalarx-ui-shared-directives.mjs +28 -28
  85. package/fesm2022/koalarx-ui-shared-directives.mjs.map +1 -1
  86. package/fesm2022/koalarx-ui-shared-services.mjs +12 -8
  87. package/fesm2022/koalarx-ui-shared-services.mjs.map +1 -1
  88. package/fesm2022/koalarx-ui-shared-utils.mjs +3 -3
  89. package/fesm2022/koalarx-ui-shared-utils.mjs.map +1 -1
  90. package/fesm2022/koalarx-ui-shared-validators.mjs.map +1 -1
  91. package/fesm2022/koalarx-ui.mjs +7 -7
  92. package/fesm2022/koalarx-ui.mjs.map +1 -1
  93. package/package.json +23 -23
  94. package/types/koalarx-ui-core-models.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-input-field.mjs","sources":["../../projects/koala-ui/shared/components/input-field/input-field.base.ts","../../projects/koala-ui/shared/components/input-field/input-field.ts","../../projects/koala-ui/shared/components/input-field/input-field.html","../../projects/koala-ui/shared/components/input-field/koalarx-ui-shared-components-input-field.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, Validators } from '@angular/forms';\nimport { CURRENT_THEME } from '@koalarx/ui/core/config';\nimport { randomString } from '@koalarx/utils/KlString';\n\n@Directive()\nexport abstract class InputFieldBase {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly required = signal(false);\n\n readonly destroyRef = inject(DestroyRef);\n readonly isDisabled = linkedSignal(() => this.disabled());\n readonly isRequired = this.required.asReadonly();\n readonly fieldId = randomString(10, {\n lowercase: true,\n uppercase: true,\n });\n readonly valueChange = signal<any>(null);\n\n control = input.required<FormControl>();\n label = input<string>();\n placeholder = input<string>('');\n hint = input<string>();\n disabled = input(false, { transform: booleanAttribute });\n\n constructor() {\n effect(() => this.checkIsRequired(this.control()));\n\n effect(() => {\n CURRENT_THEME();\n\n if (\n this.elementRef.nativeElement?.tagName.toLowerCase() !==\n 'kl-input-field'\n ) {\n const container = this.elementRef.nativeElement.parentElement;\n\n if (container) {\n const containerBgColor = this.getBgColorParent(container);\n\n this.elementRef.nativeElement.style = `--bg-input: ${containerBgColor}`;\n }\n }\n });\n\n afterRenderEffect(() => {\n this.valueChange.set(this.control().value);\n\n this.control()\n .valueChanges.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(this.valueChange.set);\n });\n }\n\n private getBgColorParent(element: HTMLElement): string {\n const containerBgColor = window.getComputedStyle(element).backgroundColor;\n\n if (!containerBgColor || containerBgColor === 'rgba(0, 0, 0, 0)') {\n if (!element.parentElement) {\n return 'var(--color-base-100)';\n }\n\n return this.getBgColorParent(element.parentElement!);\n }\n\n return containerBgColor;\n }\n\n private checkIsRequired(control: FormControl) {\n this.required.set(control.hasValidator(Validators.required));\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FieldErrors } from '@koalarx/ui/shared/components/field-errors';\nimport { InputMask } from '@koalarx/ui/shared/directives';\nimport { InputFieldBase } from './input-field.base';\n\ntype InputTypeField =\n | 'text'\n | 'email'\n | 'password'\n | 'number'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'time'\n | 'search';\n\n@Component({\n selector: 'kl-input-field',\n templateUrl: './input-field.html',\n imports: [ReactiveFormsModule, InputMask, FieldErrors],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputField extends InputFieldBase {\n type = input<InputTypeField>('text');\n mask = input<string>('');\n min = input<string>();\n max = input<string>();\n}\n","<label [attr.for]=\"fieldId\" class=\"floating-label input validator w-full rounded-sm\">\n @if (label(); as label) {\n <span>\n <ng-content select=\"[icon]\" />\n {{ label }} {{ isRequired() ? '*' : '' }}\n </span>\n }\n\n <input\n [id]=\"fieldId\"\n [formControl]=\"control()\"\n [placeholder]=\"label()\n ? label() + (isRequired() ? '*' : '')\n : placeholder()\"\n [required]=\"isRequired()\"\n [mask]=\"mask()\"\n [type]=\"type()\"\n [min]=\"min()\"\n [max]=\"max()\"\n />\n\n <ng-content select=\"[suffix]\" />\n</label>\n\n@if (hint()) {\n <span class=\"hint-content\">{{hint()}}</span>\n}\n\n<kl-field-errors [field]=\"control()\">\n <ng-container errors>\n <ng-content select=\"[errors]\" />\n </ng-container>\n</kl-field-errors>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAkBsB,cAAc,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AAEhC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,UAAU,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAC;AAChD,IAAA,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AACvC,IAAA,OAAO,GAAG,YAAY,CAAC,EAAE,EAAE;AAClC,QAAA,SAAS,EAAE,IAAI;AACf,QA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CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,SAAS,0EAAE,WAAW,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAG1C,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;+BACE,gBAAgB,EAAA,OAAA,EAEjB,CAAC,mBAAmB,EAAE,SAAS,EAAE,WAAW,CAAC,EAAA,eAAA,EACrC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kyBAAA,EAAA;;;AEvBjD;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-input-field.mjs","sources":["../../projects/koala-ui/shared/components/input-field/input-field.base.ts","../../projects/koala-ui/shared/components/input-field/input-field.ts","../../projects/koala-ui/shared/components/input-field/input-field.html","../../projects/koala-ui/shared/components/input-field/koalarx-ui-shared-components-input-field.ts"],"sourcesContent":["import {\n afterRenderEffect,\n booleanAttribute,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n linkedSignal,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, Validators } from '@angular/forms';\nimport { CURRENT_THEME } from '@koalarx/ui/core/config';\nimport { randomString } from '@koalarx/utils/KlString';\n\n@Directive()\nexport abstract class InputFieldBase {\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly required = signal(false);\n\n readonly destroyRef = inject(DestroyRef);\n readonly isDisabled = linkedSignal(() => this.disabled());\n readonly isRequired = this.required.asReadonly();\n readonly fieldId = randomString(10, {\n lowercase: true,\n uppercase: true,\n });\n readonly valueChange = signal<any>(null);\n\n control = input.required<FormControl>();\n label = input<string>();\n placeholder = input<string>('');\n hint = input<string>();\n disabled = input(false, { transform: booleanAttribute });\n\n constructor() {\n effect(() => this.checkIsRequired(this.control()));\n\n effect(() => {\n CURRENT_THEME();\n\n if (\n this.elementRef.nativeElement?.tagName.toLowerCase() !==\n 'kl-input-field'\n ) {\n const container = this.elementRef.nativeElement.parentElement;\n\n if (container) {\n const containerBgColor = this.getBgColorParent(container);\n\n this.elementRef.nativeElement.style = `--bg-input: ${containerBgColor}`;\n }\n }\n });\n\n afterRenderEffect(() => {\n this.valueChange.set(this.control().value);\n\n this.control()\n .valueChanges.pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(this.valueChange.set);\n });\n }\n\n private getBgColorParent(element: HTMLElement): string {\n const containerBgColor = window.getComputedStyle(element).backgroundColor;\n\n if (!containerBgColor || containerBgColor === 'rgba(0, 0, 0, 0)') {\n if (!element.parentElement) {\n return 'var(--color-base-100)';\n }\n\n return this.getBgColorParent(element.parentElement!);\n }\n\n return containerBgColor;\n }\n\n private checkIsRequired(control: FormControl) {\n this.required.set(control.hasValidator(Validators.required));\n }\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FieldErrors } from '@koalarx/ui/shared/components/field-errors';\nimport { InputMask } from '@koalarx/ui/shared/directives';\nimport { InputFieldBase } from './input-field.base';\n\ntype InputTypeField =\n | 'text'\n | 'email'\n | 'password'\n | 'number'\n | 'tel'\n | 'url'\n | 'date'\n | 'datetime-local'\n | 'month'\n | 'time'\n | 'search';\n\n@Component({\n selector: 'kl-input-field',\n templateUrl: './input-field.html',\n imports: [ReactiveFormsModule, InputMask, FieldErrors],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class InputField extends InputFieldBase {\n type = input<InputTypeField>('text');\n mask = input<string>('');\n min = input<string>();\n max = input<string>();\n}\n","<label [attr.for]=\"fieldId\" class=\"floating-label input validator w-full rounded-sm\">\n @if (label(); as label) {\n <span>\n <ng-content select=\"[icon]\" />\n {{ label }} {{ isRequired() ? '*' : '' }}\n </span>\n }\n\n <input\n [id]=\"fieldId\"\n [formControl]=\"control()\"\n [placeholder]=\"label()\n ? label() + (isRequired() ? '*' : '')\n : placeholder()\"\n [required]=\"isRequired()\"\n [mask]=\"mask()\"\n [type]=\"type()\"\n [min]=\"min()\"\n [max]=\"max()\"\n />\n\n <ng-content select=\"[suffix]\" />\n</label>\n\n@if (hint()) {\n <span class=\"hint-content\">{{hint()}}</span>\n}\n\n<kl-field-errors [field]=\"control()\">\n <ng-container errors>\n <ng-content select=\"[errors]\" />\n </ng-container>\n</kl-field-errors>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MAkBsB,cAAc,CAAA;AACjB,IAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,IAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,+EAAC;AAEhC,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC/B,UAAU,GAAG,YAAY,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAChD,IAAA,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;AACvC,IAAA,OAAO,GAAG,YAAY,CAAC,EAAE,EAAE;AAClC,QAAA,SAAS,EAAE,IAAI;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,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,2CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,iBAAA,EAAA,QAAA,EAAA,wIAAA,EAAA,MAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,UAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,SAAS,0EAAE,WAAW,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAG1C,UAAU,EAAA,UAAA,EAAA,CAAA;kBANtB,SAAS;+BACE,gBAAgB,EAAA,OAAA,EAEjB,CAAC,mBAAmB,EAAE,SAAS,EAAE,WAAW,CAAC,EAAA,eAAA,EACrC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kyBAAA,EAAA;;;AEvBjD;;AAEG;;;;"}
@@ -7,8 +7,8 @@ import { AppConfig } from '@koalarx/ui/core/config';
7
7
  class OnThisPage {
8
8
  router = inject(Router);
9
9
  translations = inject(AppConfig).translation.onThisPage;
10
- links = input.required(...(ngDevMode ? [{ debugName: "links" }] : []));
11
- activeSection = signal(null, ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
10
+ links = input.required(...(ngDevMode ? [{ debugName: "links" }] : /* istanbul ignore next */ []));
11
+ activeSection = signal(null, ...(ngDevMode ? [{ debugName: "activeSection" }] : /* istanbul ignore next */ []));
12
12
  linkSections = linkedSignal(() => {
13
13
  const links = this.links();
14
14
  const currentSection = this.activeSection();
@@ -17,7 +17,7 @@ class OnThisPage {
17
17
  elementId: link.elementId,
18
18
  isActive: link.elementId === currentSection,
19
19
  }));
20
- }, ...(ngDevMode ? [{ debugName: "linkSections" }] : []));
20
+ }, ...(ngDevMode ? [{ debugName: "linkSections" }] : /* istanbul ignore next */ []));
21
21
  onScroll = () => {
22
22
  const links = this.links();
23
23
  let current = null;
@@ -63,10 +63,10 @@ class OnThisPage {
63
63
  });
64
64
  }
65
65
  }
66
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: OnThisPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: OnThisPage, isStandalone: true, selector: "kl-on-this-page", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
66
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: OnThisPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
67
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: OnThisPage, isStandalone: true, selector: "kl-on-this-page", inputs: { links: { classPropertyName: "links", publicName: "links", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
68
68
  }
69
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: OnThisPage, decorators: [{
69
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: OnThisPage, decorators: [{
70
70
  type: Component,
71
71
  args: [{ selector: 'kl-on-this-page', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n" }]
72
72
  }], ctorParameters: () => [], propDecorators: { links: [{ type: i0.Input, args: [{ isSignal: true, alias: "links", required: true }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-on-this-page.mjs","sources":["../../projects/koala-ui/shared/components/on-this-page/on-this-page.ts","../../projects/koala-ui/shared/components/on-this-page/on-this-page.html","../../projects/koala-ui/shared/components/on-this-page/koalarx-ui-shared-components-on-this-page.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n linkedSignal,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { AppConfig } from '@koalarx/ui/core/config';\n\nexport interface OnThisPageLink {\n label: string;\n elementId: string;\n}\n\n@Component({\n selector: 'kl-on-this-page',\n templateUrl: './on-this-page.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OnThisPage implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n\n readonly translations = inject(AppConfig).translation.onThisPage;\n\n links = input.required<OnThisPageLink[]>();\n activeSection = signal<string | null>(null);\n\n linkSections = linkedSignal(() => {\n const links = this.links();\n const currentSection = this.activeSection();\n\n return links.map((link) => ({\n label: link.label,\n elementId: link.elementId,\n isActive: link.elementId === currentSection,\n }));\n });\n\n private onScroll = () => {\n const links = this.links();\n let current: string | null = null;\n for (const link of links) {\n const el = document.getElementById(link.elementId);\n if (el) {\n const rect = el.getBoundingClientRect();\n if (rect.top <= 250) {\n current = link.elementId;\n }\n }\n }\n if (current) {\n this.activeSection.set(current);\n }\n };\n\n constructor() {\n this.router.events.pipe(takeUntilDestroyed()).subscribe((event) => {\n if (event instanceof NavigationEnd) {\n window.scrollTo({ top: 0 });\n }\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('scroll', this.onScroll);\n }\n\n ngOnInit(): void {\n this.activeSection.set(\n location.hash.match(/#[a-zA-Z]+/)?.[0]?.replace(/#/g, '') || null\n );\n window.addEventListener('scroll', this.onScroll, { passive: true });\n }\n\n scrollTo(elementId: string) {\n const element = document.getElementById(elementId);\n if (element) {\n this.activeSection.set(elementId);\n const link = location.hash.match(/#[a-zA-Z]+/)\n ? location.hash.replace(/#([^#]*)$/, `#${elementId}`)\n : `${location.hash}#${elementId}`;\n\n history.pushState({}, '', link);\n\n const scrollPosition =\n element.getBoundingClientRect().top + window.scrollY - 100;\n\n window.scrollTo({\n top: scrollPosition,\n behavior: 'smooth',\n });\n }\n }\n}\n","<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item.label }}\n </a>\n }\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAwBa,UAAU,CAAA;AACJ,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAE/B,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU;AAEhE,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,gDAAoB;AAC1C,IAAA,aAAa,GAAG,MAAM,CAAgB,IAAI,yDAAC;AAE3C,IAAA,YAAY,GAAG,YAAY,CAAC,MAAK;AAC/B,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAA,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE;QAE3C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;AACzB,YAAA,QAAQ,EAAE,IAAI,CAAC,SAAS,KAAK,cAAc;AAC5C,SAAA,CAAC,CAAC;AACL,KAAC,wDAAC;IAEM,QAAQ,GAAG,MAAK;AACtB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,IAAI,OAAO,GAAkB,IAAI;AACjC,QAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC;YAClD,IAAI,EAAE,EAAE;AACN,gBAAA,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE;AACvC,gBAAA,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE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AAO,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC;AAE/B,YAAA,MAAM,cAAc,GAClB,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG;YAE5D,MAAM,CAAC,QAAQ,CAAC;AACd,gBAAA,GAAG,EAAE,cAAc;AACnB,gBAAA,QAAQ,EAAE,QAAQ;AACnB,aAAA,CAAC;;;uGAvEK,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,8MCxBvB,yeAeA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDSa,UAAU,EAAA,UAAA,EAAA,CAAA;kBALtB,SAAS;+BACE,iBAAiB,EAAA,eAAA,EAEV,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yeAAA,EAAA;;;AEtBjD;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-on-this-page.mjs","sources":["../../projects/koala-ui/shared/components/on-this-page/on-this-page.ts","../../projects/koala-ui/shared/components/on-this-page/on-this-page.html","../../projects/koala-ui/shared/components/on-this-page/koalarx-ui-shared-components-on-this-page.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n inject,\n input,\n linkedSignal,\n OnDestroy,\n OnInit,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { AppConfig } from '@koalarx/ui/core/config';\n\nexport interface OnThisPageLink {\n label: string;\n elementId: string;\n}\n\n@Component({\n selector: 'kl-on-this-page',\n templateUrl: './on-this-page.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class OnThisPage implements OnInit, OnDestroy {\n private readonly router = inject(Router);\n\n readonly translations = inject(AppConfig).translation.onThisPage;\n\n links = input.required<OnThisPageLink[]>();\n activeSection = signal<string | null>(null);\n\n linkSections = linkedSignal(() => {\n const links = this.links();\n const currentSection = this.activeSection();\n\n return links.map((link) => ({\n label: link.label,\n elementId: link.elementId,\n isActive: link.elementId === currentSection,\n }));\n });\n\n private onScroll = () => {\n const links = this.links();\n let current: string | null = null;\n for (const link of links) {\n const el = document.getElementById(link.elementId);\n if (el) {\n const rect = el.getBoundingClientRect();\n if (rect.top <= 250) {\n current = link.elementId;\n }\n }\n }\n if (current) {\n this.activeSection.set(current);\n }\n };\n\n constructor() {\n this.router.events.pipe(takeUntilDestroyed()).subscribe((event) => {\n if (event instanceof NavigationEnd) {\n window.scrollTo({ top: 0 });\n }\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('scroll', this.onScroll);\n }\n\n ngOnInit(): void {\n this.activeSection.set(\n location.hash.match(/#[a-zA-Z]+/)?.[0]?.replace(/#/g, '') || null\n );\n window.addEventListener('scroll', this.onScroll, { passive: true });\n }\n\n scrollTo(elementId: string) {\n const element = document.getElementById(elementId);\n if (element) {\n this.activeSection.set(elementId);\n const link = location.hash.match(/#[a-zA-Z]+/)\n ? location.hash.replace(/#([^#]*)$/, `#${elementId}`)\n : `${location.hash}#${elementId}`;\n\n history.pushState({}, '', link);\n\n const scrollPosition =\n element.getBoundingClientRect().top + window.scrollY - 100;\n\n window.scrollTo({\n top: scrollPosition,\n behavior: 'smooth',\n });\n }\n }\n}\n","<div class=\"fixed\">\n <small class=\"opacity-70\">\n <ng-content select=\"[title]\">\n {{translations.title}}\n </ng-content>\n </small>\n\n <div class=\"flex flex-col gap-2 mt-2\">\n @for (item of linkSections(); track $index) {\n <a class=\"hover:cursor-pointer hover:opacity-90 transition duration-100 opacity-60\" [class]=\"{'opacity-100': item.isActive}\" (click)=\"scrollTo(item.elementId)\">\n {{ item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qBAAqB,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG;YAE5D,MAAM,CAAC,QAAQ,CAAC;AACd,gBAAA,GAAG,EAAE,cAAc;AACnB,gBAAA,QAAQ,EAAE,QAAQ;AACnB,aAAA,CAAC;QACJ;IACF;uGAzEW,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,8MCxBvB,yeAeA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDSa,UAAU,EAAA,UAAA,EAAA,CAAA;kBALtB,SAAS;+BACE,iBAAiB,EAAA,eAAA,EAEV,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yeAAA,EAAA;;;AEtBjD;;AAEG;;;;"}
@@ -3,10 +3,10 @@ import { ChangeDetectionStrategy, Component, InjectionToken, inject, Application
3
3
  import { randomString } from '@koalarx/utils/KlString';
4
4
 
5
5
  class SideWindowContent {
6
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindowContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: SideWindowContent, isStandalone: true, selector: "kl-side-window-content", ngImport: i0, template: "<div class=\"backdrop fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"side-window-content w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
6
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindowContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: SideWindowContent, isStandalone: true, selector: "kl-side-window-content", ngImport: i0, template: "<div class=\"backdrop fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"side-window-content w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
8
8
  }
9
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindowContent, decorators: [{
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindowContent, decorators: [{
10
10
  type: Component,
11
11
  args: [{ selector: 'kl-side-window-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"backdrop fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"side-window-content w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n" }]
12
12
  }] });
@@ -76,10 +76,10 @@ class SideWindow {
76
76
  document.body.style.overflowY = 'hidden';
77
77
  }
78
78
  }
79
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindow, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
80
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindow, providedIn: 'root' });
79
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindow, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
80
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindow, providedIn: 'root' });
81
81
  }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindow, decorators: [{
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindow, decorators: [{
83
83
  type: Injectable,
84
84
  args: [{ providedIn: 'root' }]
85
85
  }] });
@@ -124,10 +124,10 @@ class SideWindowRef {
124
124
  }
125
125
  }, 50);
126
126
  }
127
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
128
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindowRef });
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
128
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindowRef });
129
129
  }
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SideWindowRef, decorators: [{
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SideWindowRef, decorators: [{
131
131
  type: Injectable
132
132
  }], ctorParameters: () => [] });
133
133
 
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-side-window.mjs","sources":["../../projects/koala-ui/shared/components/side-window/side-window-content.ts","../../projects/koala-ui/shared/components/side-window/side-window-content.html","../../projects/koala-ui/shared/components/side-window/side-window.ts","../../projects/koala-ui/shared/components/side-window/side-window-ref.ts","../../projects/koala-ui/shared/components/side-window/koalarx-ui-shared-components-side-window.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'kl-side-window-content',\n templateUrl: './side-window-content.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SideWindowContent {}\n","<div class=\"backdrop fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"side-window-content w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n","import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n Type,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SIDE_WINDOW_REF_TOKEN, SideWindowRef } from './side-window-ref';\n\nexport type SideWindowAfterCloseTrigger = string | Record<string, any>;\nexport type SideWindowAfterCloseTriggerFn = (\n trigger: SideWindowAfterCloseTrigger\n) => void;\nexport const SIDE_WINDOW_CONFIG = new InjectionToken('SideWindowConfig');\nexport const SIDE_WINDOW_DATA = new InjectionToken('SideWindowData');\nexport const SIDE_WINDOW_APP_REF = new InjectionToken('SideWindowAppRef');\nexport const SIDE_WINDOW_AFTER_CLOSE_TRIGGER =\n new InjectionToken<SideWindowAfterCloseTriggerFn>(\n 'SideWindowAfterCloseTrigger'\n );\n\nexport interface SideWindowConfig {\n data?: any;\n afterClosed?: {\n trigger: SideWindowAfterCloseTrigger;\n callback: (trigger: any) => void;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SideWindow {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n open(component: Type<any>, config?: SideWindowConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-side-window-container .side-window-container'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n\n container.id = elementId;\n\n const componentRef = createComponent(component, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SIDE_WINDOW_CONFIG, useValue: config },\n { provide: SIDE_WINDOW_APP_REF, useValue: this.appRef },\n {\n provide: SIDE_WINDOW_REF_TOKEN,\n useValue: () => componentRef,\n },\n { provide: SIDE_WINDOW_DATA, useValue: config?.data },\n {\n provide: SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n useValue: (trigger: SideWindowAfterCloseTrigger) => {\n if (\n config?.afterClosed &&\n (config.afterClosed.trigger === trigger ||\n typeof trigger === 'object')\n ) {\n config.afterClosed.callback(trigger);\n }\n },\n },\n {\n provide: SideWindowRef,\n deps: [\n SIDE_WINDOW_CONFIG,\n SIDE_WINDOW_APP_REF,\n SIDE_WINDOW_REF_TOKEN,\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_DATA,\n ],\n },\n ],\n }),\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n\n document.body.style.overflowY = 'hidden';\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Type,\n} from '@angular/core';\nimport {\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_APP_REF,\n SideWindowAfterCloseTrigger,\n SideWindowAfterCloseTriggerFn,\n} from './side-window';\n\nexport const SIDE_WINDOW_REF_TOKEN = new InjectionToken('SideWindowRefToken');\n\n@Injectable()\nexport class SideWindowRef implements OnDestroy {\n private readonly appRef = inject<ApplicationRef>(SIDE_WINDOW_APP_REF);\n private readonly componentRef = inject<() => ComponentRef<Type<any>>>(\n SIDE_WINDOW_REF_TOKEN,\n );\n private readonly afterCloseTrigger = inject<SideWindowAfterCloseTriggerFn>(\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n );\n private readonly onKeyUp = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.dismiss();\n }\n };\n private readonly onClick = (event: MouseEvent) => {\n if (\n event.target instanceof HTMLElement &&\n event.target.classList.contains('backdrop')\n ) {\n this.dismiss();\n }\n };\n\n constructor() {\n setTimeout(() => {\n document.addEventListener('keyup', this.onKeyUp);\n document.addEventListener('click', this.onClick);\n }, 150);\n }\n\n ngOnDestroy() {\n document.removeEventListener('keyup', this.onKeyUp);\n document.removeEventListener('click', this.onClick);\n }\n\n dismiss(afterCloseTrigger?: SideWindowAfterCloseTrigger) {\n const componentRef = this.componentRef();\n componentRef.location.nativeElement\n .querySelector('div div')\n .classList.add('animate-slide-out-right');\n\n document.body.style.overflowY = 'auto';\n\n setTimeout(() => {\n componentRef.destroy();\n this.appRef.detachView(componentRef.hostView);\n\n if (afterCloseTrigger) {\n this.afterCloseTrigger(afterCloseTrigger);\n }\n }, 50);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,iBAAiB,CAAA;uGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAjB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,kFCP9B,uSAKA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDEa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACE,wBAAwB,EAAA,eAAA,EAEjB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,uSAAA,EAAA;;;MEYpC,kBAAkB,GAAG,IAAI,cAAc,CAAC,kBAAkB;MAC1D,gBAAgB,GAAG,IAAI,cAAc,CAAC,gBA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AEtC,UAAU,CAAC,MAAK;YACd,YAAY,CAAC,OAAO,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;YAE7C,IAAI,iBAAiB,EAAE;AACrB,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;;SAE5C,EAAE,EAAE,CAAC;;uGAjDG,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAb,aAAa,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBADzB;;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-side-window.mjs","sources":["../../projects/koala-ui/shared/components/side-window/side-window-content.ts","../../projects/koala-ui/shared/components/side-window/side-window-content.html","../../projects/koala-ui/shared/components/side-window/side-window.ts","../../projects/koala-ui/shared/components/side-window/side-window-ref.ts","../../projects/koala-ui/shared/components/side-window/koalarx-ui-shared-components-side-window.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'kl-side-window-content',\n templateUrl: './side-window-content.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SideWindowContent {}\n","<div class=\"backdrop fixed flex z-10000 bg-base-100/20 h-screen w-screen justify-end p-2\">\n <div class=\"side-window-content w-auto h-full bg-base-200 rounded-xl shadow-2xl border-4 border-neutral-200 dark:border-neutral-900 animate-slide-in-left\">\n <ng-content />\n </div>\n</div>\n","import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n Type,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SIDE_WINDOW_REF_TOKEN, SideWindowRef } from './side-window-ref';\n\nexport type SideWindowAfterCloseTrigger = string | Record<string, any>;\nexport type SideWindowAfterCloseTriggerFn = (\n trigger: SideWindowAfterCloseTrigger\n) => void;\nexport const SIDE_WINDOW_CONFIG = new InjectionToken('SideWindowConfig');\nexport const SIDE_WINDOW_DATA = new InjectionToken('SideWindowData');\nexport const SIDE_WINDOW_APP_REF = new InjectionToken('SideWindowAppRef');\nexport const SIDE_WINDOW_AFTER_CLOSE_TRIGGER =\n new InjectionToken<SideWindowAfterCloseTriggerFn>(\n 'SideWindowAfterCloseTrigger'\n );\n\nexport interface SideWindowConfig {\n data?: any;\n afterClosed?: {\n trigger: SideWindowAfterCloseTrigger;\n callback: (trigger: any) => void;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SideWindow {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n open(component: Type<any>, config?: SideWindowConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-side-window-container .side-window-container'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n\n container.id = elementId;\n\n const componentRef = createComponent(component, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SIDE_WINDOW_CONFIG, useValue: config },\n { provide: SIDE_WINDOW_APP_REF, useValue: this.appRef },\n {\n provide: SIDE_WINDOW_REF_TOKEN,\n useValue: () => componentRef,\n },\n { provide: SIDE_WINDOW_DATA, useValue: config?.data },\n {\n provide: SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n useValue: (trigger: SideWindowAfterCloseTrigger) => {\n if (\n config?.afterClosed &&\n (config.afterClosed.trigger === trigger ||\n typeof trigger === 'object')\n ) {\n config.afterClosed.callback(trigger);\n }\n },\n },\n {\n provide: SideWindowRef,\n deps: [\n SIDE_WINDOW_CONFIG,\n SIDE_WINDOW_APP_REF,\n SIDE_WINDOW_REF_TOKEN,\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_DATA,\n ],\n },\n ],\n }),\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n\n document.body.style.overflowY = 'hidden';\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n OnDestroy,\n Type,\n} from '@angular/core';\nimport {\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n SIDE_WINDOW_APP_REF,\n SideWindowAfterCloseTrigger,\n SideWindowAfterCloseTriggerFn,\n} from './side-window';\n\nexport const SIDE_WINDOW_REF_TOKEN = new InjectionToken('SideWindowRefToken');\n\n@Injectable()\nexport class SideWindowRef implements OnDestroy {\n private readonly appRef = inject<ApplicationRef>(SIDE_WINDOW_APP_REF);\n private readonly componentRef = inject<() => ComponentRef<Type<any>>>(\n SIDE_WINDOW_REF_TOKEN,\n );\n private readonly afterCloseTrigger = inject<SideWindowAfterCloseTriggerFn>(\n SIDE_WINDOW_AFTER_CLOSE_TRIGGER,\n );\n private readonly onKeyUp = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n this.dismiss();\n }\n };\n private readonly onClick = (event: MouseEvent) => {\n if (\n event.target instanceof HTMLElement &&\n event.target.classList.contains('backdrop')\n ) {\n this.dismiss();\n }\n };\n\n constructor() {\n setTimeout(() => {\n document.addEventListener('keyup', this.onKeyUp);\n document.addEventListener('click', this.onClick);\n }, 150);\n }\n\n ngOnDestroy() {\n document.removeEventListener('keyup', this.onKeyUp);\n document.removeEventListener('click', this.onClick);\n }\n\n dismiss(afterCloseTrigger?: SideWindowAfterCloseTrigger) {\n const componentRef = this.componentRef();\n componentRef.location.nativeElement\n .querySelector('div div')\n .classList.add('animate-slide-out-right');\n\n document.body.style.overflowY = 'auto';\n\n setTimeout(() => {\n componentRef.destroy();\n this.appRef.detachView(componentRef.hostView);\n\n if (afterCloseTrigger) {\n this.afterCloseTrigger(afterCloseTrigger);\n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0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Snackbar, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
88
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Snackbar, providedIn: 'root' });
87
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Snackbar, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
88
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Snackbar, providedIn: 'root' });
89
89
  }
90
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Snackbar, decorators: [{
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Snackbar, decorators: [{
91
91
  type: Injectable,
92
92
  args: [{ providedIn: 'root' }]
93
93
  }] });
@@ -100,21 +100,21 @@ class SnackbarRef {
100
100
  this.componentRef().destroy();
101
101
  this.appRef.detachView(this.componentRef().hostView);
102
102
  }
103
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SnackbarRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
104
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SnackbarRef });
103
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SnackbarRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
104
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SnackbarRef });
105
105
  }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SnackbarRef, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SnackbarRef, decorators: [{
107
107
  type: Injectable
108
108
  }] });
109
109
 
110
110
  class SnackbarContent {
111
- alertContentRef = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContentRef" }] : []));
112
- alertIconRef = viewChild('alertIcon', ...(ngDevMode ? [{ debugName: "alertIconRef" }] : []));
111
+ alertContentRef = viewChild('alertContent', ...(ngDevMode ? [{ debugName: "alertContentRef" }] : /* istanbul ignore next */ []));
112
+ alertIconRef = viewChild('alertIcon', ...(ngDevMode ? [{ debugName: "alertIconRef" }] : /* istanbul ignore next */ []));
113
113
  snackbarRef = inject(SnackbarRef);
114
- type = input.required(...(ngDevMode ? [{ debugName: "type" }] : []));
115
- message = input.required(...(ngDevMode ? [{ debugName: "message" }] : []));
116
- timeout = input(0, ...(ngDevMode ? [{ debugName: "timeout" }] : []));
117
- timePast = signal(0, ...(ngDevMode ? [{ debugName: "timePast" }] : []));
114
+ type = input.required(...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
115
+ message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
116
+ timeout = input(0, ...(ngDevMode ? [{ debugName: "timeout" }] : /* istanbul ignore next */ []));
117
+ timePast = signal(0, ...(ngDevMode ? [{ debugName: "timePast" }] : /* istanbul ignore next */ []));
118
118
  constructor() {
119
119
  effect(() => this.addAlertClass());
120
120
  effect(() => this.addIconClass());
@@ -177,10 +177,10 @@ class SnackbarContent {
177
177
  dismiss() {
178
178
  this.snackbarRef.dismiss();
179
179
  }
180
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SnackbarContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
181
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: SnackbarContent, isStandalone: true, selector: "kl-snackbar-content", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, timeout: { classPropertyName: "timeout", publicName: "timeout", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "alertContentRef", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }, { propertyName: "alertIconRef", first: true, predicate: ["alertIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div role=\"alert\" #alertContent class=\"relative alert dark:alert-soft w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
180
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SnackbarContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
181
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: SnackbarContent, isStandalone: true, selector: "kl-snackbar-content", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, timeout: { classPropertyName: "timeout", publicName: "timeout", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "alertContentRef", first: true, predicate: ["alertContent"], descendants: true, isSignal: true }, { propertyName: "alertIconRef", first: true, predicate: ["alertIcon"], descendants: true, isSignal: true }], ngImport: i0, template: "<div role=\"alert\" #alertContent class=\"relative alert dark:alert-soft w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
182
182
  }
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SnackbarContent, decorators: [{
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: SnackbarContent, decorators: [{
184
184
  type: Component,
185
185
  args: [{ selector: 'kl-snackbar-content', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div role=\"alert\" #alertContent class=\"relative alert dark:alert-soft w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n" }]
186
186
  }], ctorParameters: () => [], propDecorators: { alertContentRef: [{ type: i0.ViewChild, args: ['alertContent', { isSignal: true }] }], alertIconRef: [{ type: i0.ViewChild, args: ['alertIcon', { isSignal: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], timeout: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeout", required: false }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-snackbar.mjs","sources":["../../projects/koala-ui/shared/components/snackbar/snackbar.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-ref.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.html","../../projects/koala-ui/shared/components/snackbar/koalarx-ui-shared-components-snackbar.ts"],"sourcesContent":["import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n inputBinding,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SnackbarContent } from './snackbar-content';\nimport { SNACKBAR_REF_TOKEN, SnackbarRef } from './snackbar-ref';\n\nexport const SNACKBAR_CONFIG = new InjectionToken('SnackbarConfig');\nexport const SNACKBAR_APP_REF = new InjectionToken('SnackbarAppRef');\n\nexport type SnackbarType = 'info' | 'success' | 'warning' | 'error';\n\nexport interface SnackbarConfig {\n type: SnackbarType;\n message: string;\n timeout?: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class Snackbar {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n success(message: string, timeout = 5000) {\n this.open({\n type: 'success',\n message,\n timeout,\n });\n }\n\n warning(message: string, timeout = 5000) {\n this.open({\n type: 'warning',\n message,\n timeout,\n });\n }\n\n error(message: string, timeout = 5000) {\n this.open({\n type: 'error',\n message,\n timeout,\n });\n }\n\n info(message: string, timeout = 5000) {\n this.open({\n type: 'info',\n message,\n timeout,\n });\n }\n\n open(config: SnackbarConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-snackbar-container div'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n container.id = elementId;\n container.classList.add('flex', 'item-center', 'justify-end');\n\n const componentRef = createComponent(SnackbarContent, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SNACKBAR_CONFIG, useValue: config },\n { provide: SNACKBAR_APP_REF, useValue: this.appRef },\n {\n provide: SNACKBAR_REF_TOKEN,\n useValue: () => componentRef,\n },\n {\n provide: SnackbarRef,\n deps: [SNACKBAR_CONFIG, SNACKBAR_APP_REF, SNACKBAR_REF_TOKEN],\n },\n ],\n }),\n bindings: [\n inputBinding('type', () => config.type),\n inputBinding('message', () => config.message),\n inputBinding('timeout', () => config.timeout ?? 0),\n ],\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport { SNACKBAR_APP_REF } from './snackbar';\nimport { SnackbarContent } from './snackbar-content';\n\nexport const SNACKBAR_REF_TOKEN = new InjectionToken('SnackbarRefToken');\n\n@Injectable()\nexport class SnackbarRef {\n private readonly appRef = inject<ApplicationRef>(SNACKBAR_APP_REF);\n private readonly componentRef =\n inject<() => ComponentRef<SnackbarContent>>(SNACKBAR_REF_TOKEN);\n\n dismiss() {\n this.componentRef().destroy();\n this.appRef.detachView(this.componentRef().hostView);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SnackbarType } from './snackbar';\nimport { SnackbarRef } from './snackbar-ref';\nimport { interval } from 'rxjs/internal/observable/interval';\nimport { startWith } from 'rxjs/internal/operators/startWith';\nimport { map } from 'rxjs/internal/operators/map';\n\n@Component({\n selector: 'kl-snackbar-content',\n templateUrl: './snackbar-content.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackbarContent implements OnInit {\n private readonly alertContentRef =\n viewChild<ElementRef<HTMLDivElement>>('alertContent');\n private readonly alertIconRef =\n viewChild<ElementRef<HTMLElement>>('alertIcon');\n private readonly snackbarRef = inject(SnackbarRef);\n\n type = input.required<SnackbarType>();\n message = input.required<string>();\n timeout = input<number>(0);\n timePast = signal(0);\n\n constructor() {\n effect(() => this.addAlertClass());\n effect(() => this.addIconClass());\n }\n\n private addAlertClass() {\n const alertContent = this.alertContentRef()?.nativeElement;\n\n if (alertContent) {\n let className = `alert-${this.type()}`;\n\n switch (this.type()) {\n case 'info':\n className = 'alert-info';\n break;\n case 'success':\n className = 'alert-success';\n break;\n case 'warning':\n className = 'alert-warning';\n break;\n case 'error':\n className = 'alert-error';\n break;\n }\n\n alertContent.classList.add(className);\n }\n }\n\n private addIconClass() {\n const alertIcon = this.alertIconRef()?.nativeElement;\n\n if (alertIcon) {\n let className = '';\n\n switch (this.type()) {\n case 'info':\n className = 'fa-circle-info';\n break;\n case 'success':\n className = 'fa-circle-check';\n break;\n case 'warning':\n className = 'fa-triangle-exclamation';\n break;\n case 'error':\n className = 'fa-circle-xmark';\n break;\n }\n\n alertIcon.classList.add(className);\n }\n }\n\n ngOnInit(): void {\n const timeout = this.timeout();\n\n if (timeout > 0) {\n const timePastInterval = interval(1000)\n .pipe(\n startWith(0),\n map(() => this.timePast.update((past) => past + 1000)),\n map(() => this.timePast())\n )\n .subscribe((timePast) => {\n if (timePast > timeout) {\n timePastInterval?.unsubscribe();\n this.dismiss();\n }\n });\n }\n }\n\n dismiss() {\n this.snackbarRef.dismiss();\n }\n}\n","<div role=\"alert\" #alertContent class=\"relative alert dark:alert-soft w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\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,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,cAAc,sEAEjB,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1BlD;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-snackbar.mjs","sources":["../../projects/koala-ui/shared/components/snackbar/snackbar.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-ref.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.ts","../../projects/koala-ui/shared/components/snackbar/snackbar-content.html","../../projects/koala-ui/shared/components/snackbar/koalarx-ui-shared-components-snackbar.ts"],"sourcesContent":["import {\n ApplicationRef,\n createComponent,\n EnvironmentInjector,\n inject,\n Injectable,\n InjectionToken,\n Injector,\n inputBinding,\n} from '@angular/core';\nimport { randomString } from '@koalarx/utils/KlString';\nimport { SnackbarContent } from './snackbar-content';\nimport { SNACKBAR_REF_TOKEN, SnackbarRef } from './snackbar-ref';\n\nexport const SNACKBAR_CONFIG = new InjectionToken('SnackbarConfig');\nexport const SNACKBAR_APP_REF = new InjectionToken('SnackbarAppRef');\n\nexport type SnackbarType = 'info' | 'success' | 'warning' | 'error';\n\nexport interface SnackbarConfig {\n type: SnackbarType;\n message: string;\n timeout?: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class Snackbar {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n\n private generateElementId() {\n let elementId: string;\n\n do {\n elementId = randomString(50, {\n numbers: false,\n lowercase: true,\n uppercase: true,\n specialCharacters: false,\n });\n } while (document.getElementById(elementId));\n\n return elementId;\n }\n\n success(message: string, timeout = 5000) {\n this.open({\n type: 'success',\n message,\n timeout,\n });\n }\n\n warning(message: string, timeout = 5000) {\n this.open({\n type: 'warning',\n message,\n timeout,\n });\n }\n\n error(message: string, timeout = 5000) {\n this.open({\n type: 'error',\n message,\n timeout,\n });\n }\n\n info(message: string, timeout = 5000) {\n this.open({\n type: 'info',\n message,\n timeout,\n });\n }\n\n open(config: SnackbarConfig) {\n const main = document.querySelector<HTMLElement>(\n 'kl-snackbar-container div'\n );\n\n if (main) {\n const elementId = this.generateElementId();\n const container = main.appendChild(document.createElement('div'));\n container.id = elementId;\n container.classList.add('flex', 'item-center', 'justify-end');\n\n const componentRef = createComponent(SnackbarContent, {\n environmentInjector: this.injector,\n hostElement: container,\n elementInjector: Injector.create({\n providers: [\n { provide: SNACKBAR_CONFIG, useValue: config },\n { provide: SNACKBAR_APP_REF, useValue: this.appRef },\n {\n provide: SNACKBAR_REF_TOKEN,\n useValue: () => componentRef,\n },\n {\n provide: SnackbarRef,\n deps: [SNACKBAR_CONFIG, SNACKBAR_APP_REF, SNACKBAR_REF_TOKEN],\n },\n ],\n }),\n bindings: [\n inputBinding('type', () => config.type),\n inputBinding('message', () => config.message),\n inputBinding('timeout', () => config.timeout ?? 0),\n ],\n });\n\n this.appRef.attachView(componentRef.hostView);\n\n componentRef.changeDetectorRef.detectChanges();\n }\n }\n}\n","import {\n ApplicationRef,\n ComponentRef,\n inject,\n Injectable,\n InjectionToken,\n} from '@angular/core';\nimport { SNACKBAR_APP_REF } from './snackbar';\nimport { SnackbarContent } from './snackbar-content';\n\nexport const SNACKBAR_REF_TOKEN = new InjectionToken('SnackbarRefToken');\n\n@Injectable()\nexport class SnackbarRef {\n private readonly appRef = inject<ApplicationRef>(SNACKBAR_APP_REF);\n private readonly componentRef =\n inject<() => ComponentRef<SnackbarContent>>(SNACKBAR_REF_TOKEN);\n\n dismiss() {\n this.componentRef().destroy();\n this.appRef.detachView(this.componentRef().hostView);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n viewChild,\n} from '@angular/core';\nimport { SnackbarType } from './snackbar';\nimport { SnackbarRef } from './snackbar-ref';\nimport { interval } from 'rxjs/internal/observable/interval';\nimport { startWith } from 'rxjs/internal/operators/startWith';\nimport { map } from 'rxjs/internal/operators/map';\n\n@Component({\n selector: 'kl-snackbar-content',\n templateUrl: './snackbar-content.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackbarContent implements OnInit {\n private readonly alertContentRef =\n viewChild<ElementRef<HTMLDivElement>>('alertContent');\n private readonly alertIconRef =\n viewChild<ElementRef<HTMLElement>>('alertIcon');\n private readonly snackbarRef = inject(SnackbarRef);\n\n type = input.required<SnackbarType>();\n message = input.required<string>();\n timeout = input<number>(0);\n timePast = signal(0);\n\n constructor() {\n effect(() => this.addAlertClass());\n effect(() => this.addIconClass());\n }\n\n private addAlertClass() {\n const alertContent = this.alertContentRef()?.nativeElement;\n\n if (alertContent) {\n let className = `alert-${this.type()}`;\n\n switch (this.type()) {\n case 'info':\n className = 'alert-info';\n break;\n case 'success':\n className = 'alert-success';\n break;\n case 'warning':\n className = 'alert-warning';\n break;\n case 'error':\n className = 'alert-error';\n break;\n }\n\n alertContent.classList.add(className);\n }\n }\n\n private addIconClass() {\n const alertIcon = this.alertIconRef()?.nativeElement;\n\n if (alertIcon) {\n let className = '';\n\n switch (this.type()) {\n case 'info':\n className = 'fa-circle-info';\n break;\n case 'success':\n className = 'fa-circle-check';\n break;\n case 'warning':\n className = 'fa-triangle-exclamation';\n break;\n case 'error':\n className = 'fa-circle-xmark';\n break;\n }\n\n alertIcon.classList.add(className);\n }\n }\n\n ngOnInit(): void {\n const timeout = this.timeout();\n\n if (timeout > 0) {\n const timePastInterval = interval(1000)\n .pipe(\n startWith(0),\n map(() => this.timePast.update((past) => past + 1000)),\n map(() => this.timePast())\n )\n .subscribe((timePast) => {\n if (timePast > timeout) {\n timePastInterval?.unsubscribe();\n this.dismiss();\n }\n });\n }\n }\n\n dismiss() {\n this.snackbarRef.dismiss();\n }\n}\n","<div role=\"alert\" #alertContent class=\"relative alert dark:alert-soft w-full lg:max-w-1/4 rounded-sm text-sm py-3 border-neutral-600\">\n <i #alertIcon class=\"h-4 w-4 shrink-0 stroke-current text-base fa-solid\"></i>\n <span [innerHTML]=\"message()\"></span>\n <div>\n <button class=\"btn btn-xs btn-outline\" (click)=\"dismiss()\">OK</button>\n </div>\n @if (timePast() > 0) {\n <progress class=\"absolute left-0 bottom-0 progress w-full opacity-20\"\n [value]=\"timePast()\"\n [max]=\"timeout()\">\n </progress>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAca,eAAe,GAAG,IAAI,cAAc,CAAC,gBAAgB;MACrD,gBAAgB,GAAG,IAAI,cAAc,CAAC,gBAAgB;MAWtD,QAAQ,CAAA;AACF,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,QAAQ,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAE/C,iBAAiB,GAAA;AACvB,QAAA,IAAI,SAAiB;AAErB,QAAA,GAAG;AACD,YAAA,SAAS,GAAG,YAAY,CAAC,EAAE,EAAE;AAC3B,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,i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AA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1BlD;;AAEG;;;;"}
@@ -7,19 +7,19 @@ class StepGroup {
7
7
  ngOnInit() {
8
8
  this.elementRef.nativeElement.classList.add('steps');
9
9
  }
10
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.6", type: StepGroup, isStandalone: true, selector: "ul[klStepGroup]", ngImport: i0 });
10
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StepGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive });
11
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.8", type: StepGroup, isStandalone: true, selector: "ul[klStepGroup]", ngImport: i0 });
12
12
  }
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepGroup, decorators: [{
13
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StepGroup, decorators: [{
14
14
  type: Directive,
15
15
  args: [{ selector: 'ul[klStepGroup]' }]
16
16
  }] });
17
17
 
18
18
  class StepItem {
19
19
  elementRef = inject((ElementRef));
20
- label = input.required(...(ngDevMode ? [{ debugName: "label" }] : []));
21
- indexStep = signal(0, ...(ngDevMode ? [{ debugName: "indexStep" }] : []));
22
- currentStep = input.required(...(ngDevMode ? [{ debugName: "currentStep" }] : []));
20
+ label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
21
+ indexStep = signal(0, ...(ngDevMode ? [{ debugName: "indexStep" }] : /* istanbul ignore next */ []));
22
+ currentStep = input.required(...(ngDevMode ? [{ debugName: "currentStep" }] : /* istanbul ignore next */ []));
23
23
  constructor() {
24
24
  effect(() => {
25
25
  const currentStep = this.currentStep();
@@ -54,16 +54,16 @@ class StepItem {
54
54
  this.elementRef.nativeElement.classList.add('step');
55
55
  this.elementRef.nativeElement.innerText = this.label();
56
56
  }
57
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
58
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: StepItem, isStandalone: true, selector: "li[klStepItem]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StepItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
58
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.8", type: StepItem, isStandalone: true, selector: "li[klStepItem]", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
59
59
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: StepItem, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: StepItem, decorators: [{
61
61
  type: Directive,
62
62
  args: [{ selector: 'li[klStepItem]' }]
63
63
  }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], currentStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentStep", required: true }] }] } });
64
64
 
65
65
  class Stepper {
66
- _currentStep = signal(1, ...(ngDevMode ? [{ debugName: "_currentStep" }] : []));
66
+ _currentStep = signal(1, ...(ngDevMode ? [{ debugName: "_currentStep" }] : /* istanbul ignore next */ []));
67
67
  get currentStep() {
68
68
  return this._currentStep.asReadonly();
69
69
  }
@@ -73,10 +73,10 @@ class Stepper {
73
73
  previous() {
74
74
  this._currentStep.update((step) => (step > 1 ? step - 1 : step));
75
75
  }
76
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Stepper, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
77
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Stepper });
76
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Stepper, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
77
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Stepper });
78
78
  }
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Stepper, decorators: [{
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: Stepper, decorators: [{
80
80
  type: Injectable
81
81
  }] });
82
82
 
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-stepper.mjs","sources":["../../projects/koala-ui/shared/components/stepper/step-group.ts","../../projects/koala-ui/shared/components/stepper/step-item.ts","../../projects/koala-ui/shared/components/stepper/stepper.ts","../../projects/koala-ui/shared/components/stepper/koalarx-ui-shared-components-stepper.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnInit } from '@angular/core';\n\n@Directive({ selector: 'ul[klStepGroup]' })\nexport class StepGroup implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLUListElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('steps');\n }\n}\n","import {\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n} from '@angular/core';\nimport { generateQuerySelector } from '@koalarx/ui/shared/utils';\n\n@Directive({ selector: 'li[klStepItem]' })\nexport class StepItem implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLLIElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n label = input.required<string>();\n indexStep = signal<number>(0);\n currentStep = input.required<number>();\n\n constructor() {\n effect(() => {\n const currentStep = this.currentStep();\n const stepIndex = this.getStepIndex();\n\n if (stepIndex < currentStep) {\n this.elementRef.nativeElement.classList.add('step-primary');\n this.elementRef.nativeElement.dataset['content'] = '✓';\n } else if (currentStep === stepIndex) {\n this.elementRef.nativeElement.classList.add('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n } else {\n this.elementRef.nativeElement.classList.remove('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n }\n });\n }\n\n private getStepIndex(): number {\n const elementSelector = generateQuerySelector(\n this.elementRef.nativeElement\n );\n const elements = document.querySelectorAll(elementSelector);\n\n let elementCountPosition = 0;\n\n elements.forEach((el, index) => {\n if (el === this.elementRef.nativeElement) {\n elementCountPosition = index + 1;\n return;\n }\n });\n\n return elementCountPosition;\n }\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('step');\n this.elementRef.nativeElement.innerText = this.label();\n }\n}\n","import { Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class Stepper {\n private readonly _currentStep = signal<number>(1);\n\n get currentStep() {\n return this._currentStep.asReadonly();\n }\n\n next() {\n this._currentStep.update((step) => step + 1);\n }\n\n previous() {\n this._currentSt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iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBADpB,SAAS;mBAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE;;;MCR5B,OAAO,CAAA;AACD,IAAA,YAAY,GAAG,MAAM,CAAS,CAAC,wDAAC;AAEjD,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;;IAGvC,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;;IAG9C,QAAQ,GAAA;QACN,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;;uGAZvD,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAP,OAAO,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;ACFD;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-stepper.mjs","sources":["../../projects/koala-ui/shared/components/stepper/step-group.ts","../../projects/koala-ui/shared/components/stepper/step-item.ts","../../projects/koala-ui/shared/components/stepper/stepper.ts","../../projects/koala-ui/shared/components/stepper/koalarx-ui-shared-components-stepper.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnInit } from '@angular/core';\n\n@Directive({ selector: 'ul[klStepGroup]' })\nexport class StepGroup implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLUListElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('steps');\n }\n}\n","import {\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n OnInit,\n signal,\n} from '@angular/core';\nimport { generateQuerySelector } from '@koalarx/ui/shared/utils';\n\n@Directive({ selector: 'li[klStepItem]' })\nexport class StepItem implements OnInit {\n private readonly elementRef = inject<ElementRef<HTMLLIElement>>(\n ElementRef<HTMLButtonElement>\n );\n\n label = input.required<string>();\n indexStep = signal<number>(0);\n currentStep = input.required<number>();\n\n constructor() {\n effect(() => {\n const currentStep = this.currentStep();\n const stepIndex = this.getStepIndex();\n\n if (stepIndex < currentStep) {\n this.elementRef.nativeElement.classList.add('step-primary');\n this.elementRef.nativeElement.dataset['content'] = '✓';\n } else if (currentStep === stepIndex) {\n this.elementRef.nativeElement.classList.add('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n } else {\n this.elementRef.nativeElement.classList.remove('step-primary');\n delete this.elementRef.nativeElement.dataset['content'];\n }\n });\n }\n\n private getStepIndex(): number {\n const elementSelector = generateQuerySelector(\n this.elementRef.nativeElement\n );\n const elements = document.querySelectorAll(elementSelector);\n\n let elementCountPosition = 0;\n\n elements.forEach((el, index) => {\n if (el === this.elementRef.nativeElement) {\n elementCountPosition = index + 1;\n return;\n }\n });\n\n return elementCountPosition;\n }\n\n ngOnInit(): void {\n this.elementRef.nativeElement.classList.add('step');\n this.elementRef.nativeElement.innerText = this.label();\n }\n}\n","import { Injectable, signal } from '@angular/core';\n\n@Injectable()\nexport class Stepper {\n private readonly _currentStep = signal<number>(1);\n\n get currentStep() {\n return this._currentStep.asReadonly();\n }\n\n next() {\n this._currentStep.update((step) => step + 1);\n }\n\n previous() {\n this._currentStep.update((step) => (step > 1 ? step - 1 : step));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,SAAS,CAAA;AACH,IAAA,UAAU,GAAG,MAAM,EAClC,UAA6B,EAC9B;IAED,QAAQ,GAAA;Q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AA,EAAA,EAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBADpB,SAAS;mBAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE;;;MCR5B,OAAO,CAAA;AACD,IAAA,YAAY,GAAG,MAAM,CAAS,CAAC,mFAAC;AAEjD,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE;IACvC;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,GAAG,CAAC,CAAC;IAC9C;IAEA,QAAQ,GAAA;QACN,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAClE;uGAbW,OAAO,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAAP,OAAO,EAAA,CAAA;;2FAAP,OAAO,EAAA,UAAA,EAAA,CAAA;kBADnB;;;ACFD;;AAEG;;;;"}
@@ -3,20 +3,20 @@ import { ChangeDetectionStrategy, Component, input } from '@angular/core';
3
3
  import { RouterLink, RouterLinkActive } from '@angular/router';
4
4
 
5
5
  class VerticalMenuContainer {
6
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: VerticalMenuContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: VerticalMenuContainer, isStandalone: true, selector: "kl-vertical-menu-container", ngImport: i0, template: "<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
6
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: VerticalMenuContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
7
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.8", type: VerticalMenuContainer, isStandalone: true, selector: "kl-vertical-menu-container", ngImport: i0, template: "<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
8
8
  }
9
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: VerticalMenuContainer, decorators: [{
9
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: VerticalMenuContainer, decorators: [{
10
10
  type: Component,
11
11
  args: [{ selector: 'kl-vertical-menu-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n" }]
12
12
  }] });
13
13
 
14
14
  class VerticalMenuItem {
15
- link = input.required(...(ngDevMode ? [{ debugName: "link" }] : []));
16
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: VerticalMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: VerticalMenuItem, isStandalone: true, selector: "kl-vertical-menu-item", inputs: { link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
15
+ link = input.required(...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
16
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: VerticalMenuItem, deps: [], target: i0.ɵɵFactoryTarget.Component });
17
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: VerticalMenuItem, isStandalone: true, selector: "kl-vertical-menu-item", inputs: { link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
18
18
  }
19
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: VerticalMenuItem, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: VerticalMenuItem, decorators: [{
20
20
  type: Component,
21
21
  args: [{ selector: 'kl-vertical-menu-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink, RouterLinkActive], template: "<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n" }]
22
22
  }], propDecorators: { link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: true }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"koalarx-ui-shared-components-vertical-menu.mjs","sources":["../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.html","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.html","../../projects/koala-ui/shared/components/vertical-menu/koalarx-ui-shared-components-vertical-menu.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'kl-vertical-menu-container',\n templateUrl: './vertical-menu-container.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VerticalMenuContainer {}\n","<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\n@Component({\n selector: 'kl-vertical-menu-item',\n templateUrl: './vertical-menu-item.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLink, RouterLinkActive],\n})\nexport class VerticalMenuItem {\n link = input.required<string>();\n}\n","<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,qBAAqB,CAAA;uGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OA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;;2FAE3B,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAN5B,SAAS;+BACE,uBAAuB,EAAA,eAAA,EAEhB,uBAAuB,CAAC,MAAM,WACtC,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAA,QAAA,EAAA,0IAAA,EAAA;;;AEPzC;;AAEG;;;;"}
1
+ {"version":3,"file":"koalarx-ui-shared-components-vertical-menu.mjs","sources":["../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-container.html","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.ts","../../projects/koala-ui/shared/components/vertical-menu/vertical-menu-item.html","../../projects/koala-ui/shared/components/vertical-menu/koalarx-ui-shared-components-vertical-menu.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'kl-vertical-menu-container',\n templateUrl: './vertical-menu-container.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VerticalMenuContainer {}\n","<ul class=\"menu rounded-box w-full\">\n <li class=\"menu-title\">\n <ng-content select=\"[title]\" />\n </li>\n <ng-content select=\"[items]\" />\n</ul>\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\n@Component({\n selector: 'kl-vertical-menu-item',\n templateUrl: './vertical-menu-item.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLink, RouterLinkActive],\n})\nexport class VerticalMenuItem {\n link = input.required<string>();\n}\n","<li>\n <a class=\"opacity-70\"\n [routerLink]=\"link()\"\n routerLinkActive=\"opacity-100\">\n <ng-content />\n </a>\n</li>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,qBAAqB,CAAA;uGAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,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