@joster-dev/chaos-control 0.1.2 → 0.3.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 (59) hide show
  1. package/README.md +86 -86
  2. package/fesm2022/joster-dev-chaos-control.mjs +512 -580
  3. package/fesm2022/joster-dev-chaos-control.mjs.map +1 -1
  4. package/{lib/LICENSE → lib} +9 -9
  5. package/package.json +6 -8
  6. package/src/lib/scss/all.scss +7 -0
  7. package/src/lib/scss/card.scss +78 -0
  8. package/src/lib/scss/control.scss +49 -0
  9. package/src/lib/scss/reboot.scss +13 -0
  10. package/src/lib/scss/utility.scss +179 -0
  11. package/src/lib/scss/variables.scss +7 -0
  12. package/src/lib/styles.scss +28 -28
  13. package/types/joster-dev-chaos-control.d.ts +243 -0
  14. package/esm2022/joster-dev-chaos-control.mjs +0 -5
  15. package/esm2022/lib/chaos-control.module.mjs +0 -67
  16. package/esm2022/lib/chaos-control.service.mjs +0 -14
  17. package/esm2022/lib/components/choice/choice.component.mjs +0 -52
  18. package/esm2022/lib/components/color/color.component.mjs +0 -77
  19. package/esm2022/lib/components/file/file.component.mjs +0 -131
  20. package/esm2022/lib/components/index.mjs +0 -8
  21. package/esm2022/lib/components/number/number.component.mjs +0 -134
  22. package/esm2022/lib/components/readonly/readonly.component.mjs +0 -14
  23. package/esm2022/lib/components/select/select.component.mjs +0 -98
  24. package/esm2022/lib/components/text/text.component.mjs +0 -162
  25. package/esm2022/lib/directives/border-radius.directive.mjs +0 -41
  26. package/esm2022/lib/directives/control.directive.mjs +0 -46
  27. package/esm2022/lib/directives/index.mjs +0 -4
  28. package/esm2022/lib/directives/item.directive.mjs +0 -117
  29. package/esm2022/lib/models/index.mjs +0 -7
  30. package/esm2022/lib/models/is-item.function.mjs +0 -8
  31. package/esm2022/lib/models/is-items.function.mjs +0 -5
  32. package/esm2022/lib/models/is-number.function.mjs +0 -5
  33. package/esm2022/lib/models/is-primitive.function.mjs +0 -7
  34. package/esm2022/lib/models/item.interface.mjs +0 -2
  35. package/esm2022/lib/models/primitive.type.mjs +0 -2
  36. package/esm2022/public-api.mjs +0 -6
  37. package/index.d.ts +0 -5
  38. package/lib/chaos-control.module.d.ts +0 -20
  39. package/lib/chaos-control.service.d.ts +0 -6
  40. package/lib/components/choice/choice.component.d.ts +0 -15
  41. package/lib/components/color/color.component.d.ts +0 -22
  42. package/lib/components/file/file.component.d.ts +0 -31
  43. package/lib/components/index.d.ts +0 -7
  44. package/lib/components/number/number.component.d.ts +0 -33
  45. package/lib/components/readonly/readonly.component.d.ts +0 -8
  46. package/lib/components/select/select.component.d.ts +0 -28
  47. package/lib/components/text/text.component.d.ts +0 -41
  48. package/lib/directives/border-radius.directive.d.ts +0 -12
  49. package/lib/directives/control.directive.d.ts +0 -18
  50. package/lib/directives/index.d.ts +0 -3
  51. package/lib/directives/item.directive.d.ts +0 -36
  52. package/lib/models/index.d.ts +0 -6
  53. package/lib/models/is-item.function.d.ts +0 -2
  54. package/lib/models/is-items.function.d.ts +0 -2
  55. package/lib/models/is-number.function.d.ts +0 -1
  56. package/lib/models/is-primitive.function.d.ts +0 -2
  57. package/lib/models/item.interface.d.ts +0 -6
  58. package/lib/models/primitive.type.d.ts +0 -1
  59. package/public-api.d.ts +0 -4
@@ -1,95 +1,127 @@
1
- import * as i2 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
1
+ import { IconComponent, IconStackComponent } from '@joster-dev/icon';
2
+ export { IconComponent, IconStackComponent, iconTypes } from '@joster-dev/icon';
3
3
  import * as i0 from '@angular/core';
4
- import { Directive, Input, Self, Component, EventEmitter, Output, ViewChild, HostListener, HostBinding, NgModule, Injectable } from '@angular/core';
4
+ import { ChangeDetectionStrategy, Component, input, booleanAttribute, Directive, inject, ElementRef, ViewContainerRef, Renderer2, Input, signal, effect, computed, viewChild, numberAttribute, HostListener, output, NgModule, Injectable } from '@angular/core';
5
+ import { Subject, from, interval, map, filter, take, takeUntil } from 'rxjs';
5
6
  import * as i1 from '@angular/forms';
6
- import { Validators, FormsModule } from '@angular/forms';
7
- import { RouterModule } from '@angular/router';
8
- import * as i3 from '@joster-dev/icon';
9
- import { IconModule } from '@joster-dev/icon';
10
- import { Subject } from 'rxjs';
7
+ import { NgControl, Validators, FormsModule } from '@angular/forms';
8
+ import { NgTemplateOutlet } from '@angular/common';
11
9
  import { debounceTime } from 'rxjs/operators';
12
10
 
11
+ class BusyComponent {
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BusyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
13
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.2", type: BusyComponent, isStandalone: true, selector: "jo-busy", ngImport: i0, template: "<!-- <div class=\"spinner spinner-1\"></div> -->\n<div class=\"spinner big\"></div>\n<div class=\"spinner small\"></div>\n", styles: [":host{position:absolute;inset:0;background:color-mix(in srgb,currentColor 30%,transparent);display:flex;align-items:center;justify-content:center}.spinner{position:absolute}.spinner:before{content:\"\";position:absolute;inset:0;border-radius:50%;border:.25rem solid transparent;-webkit-mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.big{width:3rem;height:3rem;animation:rotate-animation 1s linear 0s infinite}.big:before{background:conic-gradient(transparent 40%,currentColor) border-box}.small{width:2rem;height:2rem;animation:anti-rotate-animation 1s linear 0s infinite}.small:before{background:conic-gradient(currentColor,transparent 60%) border-box}@keyframes rotate-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes anti-rotate-animation{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
14
+ }
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BusyComponent, decorators: [{
16
+ type: Component,
17
+ args: [{ selector: 'jo-busy', changeDetection: ChangeDetectionStrategy.Eager, template: "<!-- <div class=\"spinner spinner-1\"></div> -->\n<div class=\"spinner big\"></div>\n<div class=\"spinner small\"></div>\n", styles: [":host{position:absolute;inset:0;background:color-mix(in srgb,currentColor 30%,transparent);display:flex;align-items:center;justify-content:center}.spinner{position:absolute}.spinner:before{content:\"\";position:absolute;inset:0;border-radius:50%;border:.25rem solid transparent;-webkit-mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.big{width:3rem;height:3rem;animation:rotate-animation 1s linear 0s infinite}.big:before{background:conic-gradient(transparent 40%,currentColor) border-box}.small{width:2rem;height:2rem;animation:anti-rotate-animation 1s linear 0s infinite}.small:before{background:conic-gradient(currentColor,transparent 60%) border-box}@keyframes rotate-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes anti-rotate-animation{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
18
+ }] });
19
+
13
20
  class BorderRadiusDirective {
14
- get borderRadiusRight() {
15
- return this._borderRadiusRight;
16
- }
17
- set borderRadiusRight(value) {
18
- if (value === '')
19
- value = true;
20
- if (value == null)
21
- value = false;
22
- this._borderRadiusRight = value;
23
- }
24
- get borderRadiusLeft() {
25
- return this._borderRadiusLeft;
26
- }
27
- set borderRadiusLeft(value) {
28
- if (value === '')
29
- value = true;
30
- if (value == null)
31
- value = false;
32
- this._borderRadiusLeft = value;
33
- }
34
21
  constructor() {
35
- this._borderRadiusRight = true;
36
- this._borderRadiusLeft = true;
22
+ this.borderRadiusRight = input(true, { ...(ngDevMode ? { debugName: "borderRadiusRight" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
23
+ this.borderRadiusLeft = input(true, { ...(ngDevMode ? { debugName: "borderRadiusLeft" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
37
24
  }
38
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: BorderRadiusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
39
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.5", type: BorderRadiusDirective, selector: "[joBorderRadius]", inputs: { borderRadiusRight: "borderRadiusRight", borderRadiusLeft: "borderRadiusLeft" }, ngImport: i0 }); }
25
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BorderRadiusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
26
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: BorderRadiusDirective, isStandalone: true, selector: "[joBorderRadius]", inputs: { borderRadiusRight: { classPropertyName: "borderRadiusRight", publicName: "borderRadiusRight", isSignal: true, isRequired: false, transformFunction: null }, borderRadiusLeft: { classPropertyName: "borderRadiusLeft", publicName: "borderRadiusLeft", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
40
27
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: BorderRadiusDirective, decorators: [{
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BorderRadiusDirective, decorators: [{
42
29
  type: Directive,
43
30
  args: [{
44
31
  selector: '[joBorderRadius]'
45
32
  }]
46
- }], ctorParameters: () => [], propDecorators: { borderRadiusRight: [{
47
- type: Input
48
- }], borderRadiusLeft: [{
49
- type: Input
50
- }] } });
33
+ }], propDecorators: { borderRadiusRight: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadiusRight", required: false }] }], borderRadiusLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadiusLeft", required: false }] }] } });
51
34
 
52
- class ControlDirective extends BorderRadiusDirective {
53
- get required() {
54
- return this._required;
55
- }
56
- set required(value) {
57
- if (value === '')
58
- value = true;
59
- if (value == null)
60
- value = false;
61
- if (typeof value !== 'boolean')
62
- throw new Error('required input must be: boolean');
63
- this._required = value;
64
- this.validation.next();
65
- }
35
+ class BusyDirective {
66
36
  constructor() {
67
- super();
68
- this._required = false;
69
- this.isDisabled = false;
70
- this.validation = new Subject();
37
+ this.element = inject(ElementRef);
38
+ this.viewContainerRef = inject(ViewContainerRef);
39
+ this.renderer = inject(Renderer2);
40
+ this.host = this.element.nativeElement;
41
+ this.endSubscription$ = new Subject();
42
+ }
43
+ ngOnChanges(changes) {
44
+ if (changes['asyncEvents'].currentValue) {
45
+ const valueArray = Array.isArray(changes['asyncEvents'].currentValue)
46
+ ? changes['asyncEvents'].currentValue
47
+ : [changes['asyncEvents'].currentValue];
48
+ const subscriptionValueArray = valueArray
49
+ .filter(item => Boolean(item))
50
+ .map(item => {
51
+ if (item instanceof Promise) {
52
+ return from(item).subscribe();
53
+ }
54
+ return item;
55
+ });
56
+ if (subscriptionValueArray.length > 0) {
57
+ if (this.busySubscription && !this.busySubscription.closed) {
58
+ this.endSubscription$.next();
59
+ }
60
+ this.addSpinner(subscriptionValueArray);
61
+ }
62
+ }
71
63
  }
72
64
  ngOnDestroy() {
73
- this.validation.complete();
65
+ this.endSubscription$.complete();
66
+ }
67
+ addSpinner(asyncEvents) {
68
+ const componentRef = this.viewContainerRef.createComponent(BusyComponent);
69
+ this.insertedNode = this.host.insertBefore(componentRef.location.nativeElement, this.host.firstChild);
70
+ this.renderer.addClass(this.host, 'position-relative');
71
+ this.renderer.addClass(this.host, 'overflow-hidden');
72
+ this.busySubscription = interval()
73
+ .pipe(map(() => asyncEvents.every(item => item.closed)), filter(everySubscriptionClosed => Boolean(everySubscriptionClosed)), take(1), takeUntil(this.endSubscription$))
74
+ .subscribe(({
75
+ complete: () => {
76
+ this.removeSpinner();
77
+ },
78
+ error: () => {
79
+ this.removeSpinner();
80
+ },
81
+ }));
82
+ }
83
+ removeSpinner() {
84
+ if (this.insertedNode)
85
+ this.host.removeChild(this.insertedNode);
86
+ this.renderer.removeClass(this.host, 'position-relative');
87
+ this.renderer.removeClass(this.host, 'overflow-hidden');
88
+ }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BusyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
90
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: BusyDirective, isStandalone: true, selector: "[joBusy]", inputs: { asyncEvents: ["joBusy", "asyncEvents"] }, usesOnChanges: true, ngImport: i0 }); }
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: BusyDirective, decorators: [{
93
+ type: Directive,
94
+ args: [{
95
+ selector: '[joBusy]'
96
+ }]
97
+ }], propDecorators: { asyncEvents: [{
98
+ type: Input,
99
+ args: ['joBusy']
100
+ }] } });
101
+
102
+ class ControlDirective extends BorderRadiusDirective {
103
+ constructor() {
104
+ super(...arguments);
105
+ this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
106
+ this.isDisabled = signal(false, /* @ts-ignore */
107
+ ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
74
108
  }
75
109
  onTouched() { }
76
110
  registerOnTouched(fn) {
77
111
  this.onTouched = fn;
78
112
  }
79
113
  setDisabledState(isDisabled) {
80
- this.isDisabled = isDisabled;
114
+ this.isDisabled.set(isDisabled);
81
115
  }
82
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
83
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.5", type: ControlDirective, selector: "[joControl]", inputs: { required: "required" }, usesInheritance: true, ngImport: i0 }); }
116
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ControlDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
117
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ControlDirective, isStandalone: true, selector: "[joControl]", inputs: { required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
84
118
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ControlDirective, decorators: [{
119
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ControlDirective, decorators: [{
86
120
  type: Directive,
87
121
  args: [{
88
122
  selector: '[joControl]'
89
123
  }]
90
- }], ctorParameters: () => [], propDecorators: { required: [{
91
- type: Input
92
- }] } });
124
+ }], propDecorators: { required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
93
125
 
94
126
  function isNumber(value) {
95
127
  return typeof value === 'number'
@@ -113,60 +145,45 @@ function isItems(value) {
113
145
  return Array.isArray(value) && value.every(item => isItem(item));
114
146
  }
115
147
 
148
+ function toItems(value) {
149
+ if (!isItems(value))
150
+ throw new Error('[items] expects: { key: boolean | number | string, value: string }[]');
151
+ return value;
152
+ }
153
+ function toLimit(value) {
154
+ if (value == null)
155
+ value = 0;
156
+ if (!isNumber(value) || value < 0 || !Number.isInteger(value))
157
+ throw new Error('limit expects: positive integer');
158
+ return value;
159
+ }
116
160
  class ItemDirective extends ControlDirective {
117
- get items() {
118
- return this._items;
119
- }
120
- set items(value) {
121
- if (!isItems(value))
122
- throw new Error('[items] expects: { key: boolean | number | string, value: string }[]');
123
- this._items = value;
124
- this.filteredItems = value;
125
- this.validation.next();
126
- }
127
- get limit() {
128
- return this._limit;
129
- }
130
- set limit(value) {
131
- if (value == null)
132
- value = 0;
133
- if (!isNumber(value) || value < 0 || !Number.isInteger(value))
134
- throw new Error('limit expects: positive integer');
135
- this._limit = value;
136
- this.validation.next();
137
- }
138
- get isMultiple() {
139
- return this._isMultiple;
140
- }
141
- set isMultiple(value) {
142
- if (value === '')
143
- value = true;
144
- if (value == null)
145
- value = false;
146
- if (typeof value !== 'boolean')
147
- throw new Error('multiple expects: boolean');
148
- this._isMultiple = value;
149
- }
150
- set model(value) {
151
- this._model = value;
161
+ constructor() {
162
+ super();
163
+ this.ngControl = inject(NgControl, { self: true });
164
+ this.items = input([], { ...(ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {}), transform: toItems });
165
+ this.limit = input(0, { ...(ngDevMode ? { debugName: "limit" } : /* istanbul ignore next */ {}), transform: toLimit });
166
+ this.isMultiple = input(false, { ...(ngDevMode ? { debugName: "isMultiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
167
+ this.model = signal([], /* @ts-ignore */
168
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
169
+ this.ngControl.valueAccessor = this;
170
+ // Re-run validation synchronously whenever an input that feeds the
171
+ // validators changes. No debounce means validity repaints under zoneless.
172
+ effect(() => {
173
+ this.items();
174
+ this.limit();
175
+ this.isMultiple();
176
+ this.required();
177
+ this.validate();
178
+ });
179
+ }
180
+ setModel(value) {
181
+ this.model.set(value);
152
182
  this.onChange(value.length === 0
153
183
  ? null
154
- : this.isMultiple
155
- ? this._model
156
- : this._model[0]);
157
- }
158
- constructor(ngControl) {
159
- super();
160
- this.ngControl = ngControl;
161
- this._items = [];
162
- this.filteredItems = [];
163
- this._limit = 0;
164
- this._isMultiple = false;
165
- this._model = [];
166
- this.validation
167
- .pipe(debounceTime(100))
168
- .subscribe(() => this.validate());
169
- ngControl.valueAccessor = this;
184
+ : this.isMultiple()
185
+ ? value
186
+ : value[0]);
170
187
  }
171
188
  onChange(_value) { }
172
189
  registerOnChange(fn) {
@@ -178,7 +195,7 @@ class ItemDirective extends ControlDirective {
178
195
  if (!Array.isArray(value))
179
196
  value = [value];
180
197
  if (value.every(item => isPrimitive(item)))
181
- this._model = value;
198
+ this.model.set(value);
182
199
  }
183
200
  invalidValidator(items, isMultiple) {
184
201
  return (control) => (isMultiple
@@ -194,106 +211,116 @@ class ItemDirective extends ControlDirective {
194
211
  }
195
212
  validate() {
196
213
  const validators = [
197
- this.invalidValidator(this._items, this._isMultiple),
214
+ this.invalidValidator(this.items(), this.isMultiple()),
198
215
  ];
199
- if (this._isMultiple)
200
- validators.push(this.limitValidator(this._limit));
201
- if (this.required === true)
216
+ if (this.isMultiple())
217
+ validators.push(this.limitValidator(this.limit()));
218
+ if (this.required() === true)
202
219
  validators.push(Validators.required);
203
- if (this.ngControl.control === null)
204
- throw new Error('expected control to be defined');
205
- this.ngControl.control.setValidators(validators);
206
- this.ngControl.control.updateValueAndValidity();
220
+ this.ngControl.control?.setValidators(validators);
221
+ this.ngControl.control?.updateValueAndValidity();
207
222
  }
208
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ItemDirective, deps: [{ token: i1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Directive }); }
209
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.5", type: ItemDirective, selector: "[joItem]", inputs: { items: "items", limit: "limit", isMultiple: "isMultiple" }, usesInheritance: true, ngImport: i0 }); }
223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
224
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ItemDirective, isStandalone: true, selector: "[joItem]", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, limit: { classPropertyName: "limit", publicName: "limit", isSignal: true, isRequired: false, transformFunction: null }, isMultiple: { classPropertyName: "isMultiple", publicName: "isMultiple", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
210
225
  }
211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ItemDirective, decorators: [{
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ItemDirective, decorators: [{
212
227
  type: Directive,
213
228
  args: [{
214
229
  selector: '[joItem]'
215
230
  }]
216
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
217
- type: Self
218
- }] }], propDecorators: { items: [{
219
- type: Input
220
- }], limit: [{
221
- type: Input
222
- }], isMultiple: [{
231
+ }], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], limit: [{ type: i0.Input, args: [{ isSignal: true, alias: "limit", required: false }] }], isMultiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMultiple", required: false }] }] } });
232
+
233
+ class SizeDirective {
234
+ constructor() {
235
+ this._size = '100%';
236
+ this.sizeChangesSubject = new Subject();
237
+ }
238
+ get size() {
239
+ return this._size;
240
+ }
241
+ set size(value) {
242
+ if (value === null || value === undefined)
243
+ value = '100%';
244
+ if (typeof value === 'number' && value >= 0 && value <= 100)
245
+ value = `${value}%`;
246
+ if (typeof value !== 'string')
247
+ throw new Error('size input must be: string');
248
+ // todo: write regex
249
+ // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/height
250
+ this._size = value;
251
+ this.sizeChangesSubject.next();
252
+ }
253
+ ngOnDestroy() {
254
+ this.sizeChangesSubject.complete();
255
+ }
256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: SizeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
257
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: SizeDirective, isStandalone: true, selector: "[size]", inputs: { size: "size" }, ngImport: i0 }); }
258
+ }
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: SizeDirective, decorators: [{
260
+ type: Directive,
261
+ args: [{
262
+ selector: '[size]'
263
+ }]
264
+ }], propDecorators: { size: [{
223
265
  type: Input
224
266
  }] } });
225
267
 
226
268
  class ChoiceComponent extends ItemDirective {
227
- constructor(ngControl) {
228
- super(ngControl);
229
- this.ngControl = ngControl;
230
- this._isColumn = false;
269
+ constructor() {
270
+ super(...arguments);
271
+ this.isColumn = input(false, { ...(ngDevMode ? { debugName: "isColumn" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
231
272
  this.id = `${Math.random().toString(36).substr(2, 9)}`;
232
273
  }
233
- get isColumn() {
234
- return this._isColumn;
235
- }
236
- set isColumn(value) {
237
- if (value === '')
238
- value = true;
239
- if (value == null)
240
- value = false;
241
- if (typeof value !== 'boolean')
242
- throw new Error('isColumn expects: boolean');
243
- this._isColumn = value;
244
- }
245
274
  onClick(item) {
246
- this._model = this._model
247
- .filter(key => this._items.map(item => item.key).includes(key));
248
- if (this._model.includes(item.key)) {
249
- if (this.required === true && this._model.length === 1)
275
+ const keys = this.items().map(item => item.key);
276
+ const model = this.model().filter(key => keys.includes(key));
277
+ if (model.includes(item.key)) {
278
+ if (this.required() === true && model.length === 1)
250
279
  return;
251
- this.model = this._model.filter(key => key !== item.key);
280
+ this.setModel(model.filter(key => key !== item.key));
252
281
  return;
253
282
  }
254
- if (!this.isMultiple && this._model.length === 1) {
255
- this.model = [item.key];
283
+ if (!this.isMultiple() && model.length === 1) {
284
+ this.setModel([item.key]);
256
285
  return;
257
286
  }
258
- this.model = [...this._model, item.key];
287
+ this.setModel([...model, item.key]);
259
288
  }
260
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChoiceComponent, deps: [{ token: i1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
261
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ChoiceComponent, selector: "jo-choice", inputs: { isColumn: "isColumn" }, usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex justify-content-between\">\r\n <label\r\n id=\"choice_{{id}}\"\r\n [class.required]=\"required\"\r\n >\r\n <ng-content></ng-content>\r\n </label>\r\n <div>\r\n <ng-content select=\"[rightAligned]\"></ng-content>\r\n </div>\r\n</div>\r\n\r\n<div\r\n class=\"d-flex flex-wrap align-items-start\"\r\n role=\"group\"\r\n attr.aria-labelledby=\"choice_{{id}}\"\r\n [class.flex-column]=\"isColumn\"\r\n>\r\n <button\r\n *ngFor=\"let item of items; let idx = index\"\r\n type=\"button\"\r\n class=\"d-flex align-items-center gap-2 text-start\"\r\n role=\"menuitemcheckbox\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"onClick(item)\"\r\n (blur)=\"onTouched()\"\r\n >\r\n <div\r\n class=\"jo-button {{isMultiple ? 'br-20' : 'br-50'}}\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n [class.disabled]=\"isDisabled\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n >\r\n <icon\r\n *ngIf=\"_model.includes(item.key)\"\r\n size=\"1rem\"\r\n [type]=\"isMultiple ? 'check' : 'dot'\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </div>\r\n <span>{{item.value}}</span>\r\n </button>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->", styles: [":host{display:block}:host>.d-flex>button{border-color:transparent;border-width:.075em}:host>.d-flex>button>.jo-button{position:relative;text-align:left}:host>.d-flex>button>.jo-button>icon{position:absolute;top:0;left:0}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }] }); }
289
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChoiceComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
290
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: ChoiceComponent, isStandalone: true, selector: "jo-choice", inputs: { isColumn: { classPropertyName: "isColumn", publicName: "isColumn", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex justify-content-between\">\n <label\n id=\"choice_{{id}}\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div\n class=\"d-flex flex-wrap align-items-start\"\n role=\"group\"\n attr.aria-labelledby=\"choice_{{id}}\"\n [class.flex-column]=\"isColumn()\"\n >\n @for (item of items(); track item; let idx = $index) {\n <button\n type=\"button\"\n class=\"d-flex align-items-center gap-2 text-start\"\n role=\"menuitemcheckbox\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onClick(item)\"\n (blur)=\"onTouched()\"\n >\n <div\n class=\"jo-button {{isMultiple() ? 'br-20' : 'br-50'}}\"\n [class.active]=\"model().includes(item.key)\"\n [class.disabled]=\"isDisabled()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n >\n @if (model().includes(item.key)) {\n <icon\n size=\"1rem\"\n [type]=\"isMultiple() ? 'check' : 'dot'\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n }\n </div>\n <span>{{item.value}}</span>\n </button>\n }\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n</li>\n</ul> -->\n", styles: [":host{display:block}:host>.d-flex>button{border-color:transparent;border-width:.075em}:host>.d-flex>button>.jo-button{position:relative;text-align:left}:host>.d-flex>button>.jo-button>icon{position:absolute;top:0;left:0}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
262
291
  }
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChoiceComponent, decorators: [{
292
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChoiceComponent, decorators: [{
264
293
  type: Component,
265
- args: [{ selector: 'jo-choice', template: "<div class=\"d-flex justify-content-between\">\r\n <label\r\n id=\"choice_{{id}}\"\r\n [class.required]=\"required\"\r\n >\r\n <ng-content></ng-content>\r\n </label>\r\n <div>\r\n <ng-content select=\"[rightAligned]\"></ng-content>\r\n </div>\r\n</div>\r\n\r\n<div\r\n class=\"d-flex flex-wrap align-items-start\"\r\n role=\"group\"\r\n attr.aria-labelledby=\"choice_{{id}}\"\r\n [class.flex-column]=\"isColumn\"\r\n>\r\n <button\r\n *ngFor=\"let item of items; let idx = index\"\r\n type=\"button\"\r\n class=\"d-flex align-items-center gap-2 text-start\"\r\n role=\"menuitemcheckbox\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"onClick(item)\"\r\n (blur)=\"onTouched()\"\r\n >\r\n <div\r\n class=\"jo-button {{isMultiple ? 'br-20' : 'br-50'}}\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n [class.disabled]=\"isDisabled\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n >\r\n <icon\r\n *ngIf=\"_model.includes(item.key)\"\r\n size=\"1rem\"\r\n [type]=\"isMultiple ? 'check' : 'dot'\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </div>\r\n <span>{{item.value}}</span>\r\n </button>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->", styles: [":host{display:block}:host>.d-flex>button{border-color:transparent;border-width:.075em}:host>.d-flex>button>.jo-button{position:relative;text-align:left}:host>.d-flex>button>.jo-button>icon{position:absolute;top:0;left:0}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
266
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
267
- type: Self
268
- }] }], propDecorators: { isColumn: [{
269
- type: Input
270
- }] } });
294
+ args: [{ selector: 'jo-choice', changeDetection: ChangeDetectionStrategy.Eager, imports: [IconComponent], template: "<div class=\"d-flex justify-content-between\">\n <label\n id=\"choice_{{id}}\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div\n class=\"d-flex flex-wrap align-items-start\"\n role=\"group\"\n attr.aria-labelledby=\"choice_{{id}}\"\n [class.flex-column]=\"isColumn()\"\n >\n @for (item of items(); track item; let idx = $index) {\n <button\n type=\"button\"\n class=\"d-flex align-items-center gap-2 text-start\"\n role=\"menuitemcheckbox\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"onClick(item)\"\n (blur)=\"onTouched()\"\n >\n <div\n class=\"jo-button {{isMultiple() ? 'br-20' : 'br-50'}}\"\n [class.active]=\"model().includes(item.key)\"\n [class.disabled]=\"isDisabled()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n >\n @if (model().includes(item.key)) {\n <icon\n size=\"1rem\"\n [type]=\"isMultiple() ? 'check' : 'dot'\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n }\n </div>\n <span>{{item.value}}</span>\n </button>\n }\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n</li>\n</ul> -->\n", styles: [":host{display:block}:host>.d-flex>button{border-color:transparent;border-width:.075em}:host>.d-flex>button>.jo-button{position:relative;text-align:left}:host>.d-flex>button>.jo-button>icon{position:absolute;top:0;left:0}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
295
+ }], propDecorators: { isColumn: [{ type: i0.Input, args: [{ isSignal: true, alias: "isColumn", required: false }] }] } });
271
296
 
272
297
  class ColorComponent extends ControlDirective {
273
- get model() {
274
- return this._model;
275
- }
276
- set model(value) {
277
- this._model = value;
278
- this.onChange(this._model !== null && this.fullHex.test(this._model)
279
- ? this._model
280
- : null);
281
- }
282
- constructor(ngControl) {
298
+ constructor() {
283
299
  super();
284
- this.ngControl = ngControl;
300
+ this.ngControl = inject(NgControl, { self: true });
285
301
  this.partialHex = /^[0-9A-Fa-f]{1,6}$/;
286
302
  this.fullHex = /^[0-9A-Fa-f]{6}$/;
287
- this._model = null;
303
+ this.model = signal(null, /* @ts-ignore */
304
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
288
305
  this.id = `_${Math.random().toString(36).substring(2, 11)}`;
289
- this.validation
290
- .pipe(debounceTime(100))
291
- .subscribe(() => this.validate());
292
- ngControl.valueAccessor = this;
306
+ this.ngControl.valueAccessor = this;
307
+ effect(() => {
308
+ this.required();
309
+ this.validate();
310
+ });
311
+ }
312
+ onModelChange(value) {
313
+ this.setModel(value);
293
314
  }
294
315
  onChangeColor(event) {
295
316
  const ele = event.target;
296
- this.model = ele.value.substring(1).toUpperCase();
317
+ this.setModel(ele.value.substring(1).toUpperCase());
318
+ }
319
+ setModel(value) {
320
+ this.model.set(value);
321
+ this.onChange(value !== null && this.fullHex.test(value)
322
+ ? value
323
+ : null);
297
324
  }
298
325
  onChange(_model) { }
299
326
  registerOnChange(fn) {
@@ -313,7 +340,7 @@ class ColorComponent extends ControlDirective {
313
340
  if (value === undefined || typeof value !== 'string' || !this.partialHex.test(value))
314
341
  value = null;
315
342
  if (value === null || this.partialHex.test(value))
316
- this._model = value;
343
+ this.model.set(value);
317
344
  }
318
345
  invalidValidator() {
319
346
  return (control) => control.value !== null && (typeof control.value !== 'string' || !this.fullHex.test(control.value))
@@ -324,60 +351,48 @@ class ColorComponent extends ControlDirective {
324
351
  const validators = [
325
352
  this.invalidValidator()
326
353
  ];
327
- if (this.required === true)
354
+ if (this.required() === true)
328
355
  validators.push(Validators.required);
329
356
  this.ngControl.control?.setValidators(validators);
330
357
  this.ngControl.control?.updateValueAndValidity();
331
358
  }
332
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ColorComponent, deps: [{ token: i1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
333
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ColorComponent, selector: "jo-color", usesInheritance: true, ngImport: i0, template: "<label\r\n [for]=\"id\"\r\n [class.required]=\"required\"\r\n>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-stretch\">\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Color\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"colorInput.click()\"\r\n >\r\n <icon\r\n size=\"1rem\"\r\n type=\"square\"\r\n [fill]=\"fullHex.test(_model || '') ? _model : [null, 'current']\"\r\n fillRotate=\"90\"\r\n [stroke]=\"fullHex.test(_model || '') ? _model : ['current']\"\r\n ></icon>\r\n </button>\r\n <input\r\n [(ngModel)]=\"model\"\r\n spellcheck=\"false\"\r\n size=\"5\"\r\n type=\"text\"\r\n [class.active]=\"ngControl.control?.value !== null\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n (beforeinput)=\"onBeforeinput($event)\"\r\n (blur)=\"onTouched()\"\r\n />\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->\r\n\r\n<input\r\n #colorInput\r\n type=\"color\"\r\n (change)=\"onChangeColor($event)\"\r\n/>", styles: [":host{display:block}input[type=color]{margin-top:-2em;padding:0;position:absolute;visibility:hidden;transition:none}:host>div>input{border-left:0}:host>div>button{border-right:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }] }); }
359
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ColorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
360
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.2", type: ColorComponent, isStandalone: true, selector: "jo-color", usesInheritance: true, ngImport: i0, template: "<label\n [for]=\"id\"\n [class.required]=\"required()\"\n>\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex align-items-stretch\">\n <button\n class=\"d-flex align-items-center\"\n title=\"Color\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"colorInput.click()\"\n >\n <icon\n size=\"1rem\"\n type=\"square\"\n [fill]=\"fullHex.test(model() || '') ? model() : [null, 'current']\"\n fillRotate=\"90\"\n [stroke]=\"fullHex.test(model() || '') ? model() : ['current']\"\n ></icon>\n </button>\n <input\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n spellcheck=\"false\"\n size=\"5\"\n type=\"text\"\n [class.active]=\"ngControl.control?.value !== null\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n (beforeinput)=\"onBeforeinput($event)\"\n (blur)=\"onTouched()\"\n />\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n </li>\n</ul> -->\n\n<input\n #colorInput\n type=\"color\"\n (change)=\"onChangeColor($event)\"\n/>\n", styles: [":host{display:block}input[type=color]{margin-top:-2em;padding:0;position:absolute;visibility:hidden;transition:none}:host>div>input{border-left:0}:host>div>button{border-right:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
334
361
  }
335
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ColorComponent, decorators: [{
362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ColorComponent, decorators: [{
336
363
  type: Component,
337
- args: [{ selector: 'jo-color', template: "<label\r\n [for]=\"id\"\r\n [class.required]=\"required\"\r\n>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-stretch\">\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Color\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"colorInput.click()\"\r\n >\r\n <icon\r\n size=\"1rem\"\r\n type=\"square\"\r\n [fill]=\"fullHex.test(_model || '') ? _model : [null, 'current']\"\r\n fillRotate=\"90\"\r\n [stroke]=\"fullHex.test(_model || '') ? _model : ['current']\"\r\n ></icon>\r\n </button>\r\n <input\r\n [(ngModel)]=\"model\"\r\n spellcheck=\"false\"\r\n size=\"5\"\r\n type=\"text\"\r\n [class.active]=\"ngControl.control?.value !== null\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n (beforeinput)=\"onBeforeinput($event)\"\r\n (blur)=\"onTouched()\"\r\n />\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->\r\n\r\n<input\r\n #colorInput\r\n type=\"color\"\r\n (change)=\"onChangeColor($event)\"\r\n/>", styles: [":host{display:block}input[type=color]{margin-top:-2em;padding:0;position:absolute;visibility:hidden;transition:none}:host>div>input{border-left:0}:host>div>button{border-right:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
338
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
339
- type: Self
340
- }] }] });
364
+ args: [{ selector: 'jo-color', changeDetection: ChangeDetectionStrategy.Eager, imports: [FormsModule, IconComponent], template: "<label\n [for]=\"id\"\n [class.required]=\"required()\"\n>\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex align-items-stretch\">\n <button\n class=\"d-flex align-items-center\"\n title=\"Color\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"colorInput.click()\"\n >\n <icon\n size=\"1rem\"\n type=\"square\"\n [fill]=\"fullHex.test(model() || '') ? model() : [null, 'current']\"\n fillRotate=\"90\"\n [stroke]=\"fullHex.test(model() || '') ? model() : ['current']\"\n ></icon>\n </button>\n <input\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n spellcheck=\"false\"\n size=\"5\"\n type=\"text\"\n [class.active]=\"ngControl.control?.value !== null\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n (beforeinput)=\"onBeforeinput($event)\"\n (blur)=\"onTouched()\"\n />\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n </li>\n</ul> -->\n\n<input\n #colorInput\n type=\"color\"\n (change)=\"onChangeColor($event)\"\n/>\n", styles: [":host{display:block}input[type=color]{margin-top:-2em;padding:0;position:absolute;visibility:hidden;transition:none}:host>div>input{border-left:0}:host>div>button{border-right:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
365
+ }], ctorParameters: () => [] });
341
366
 
367
+ function toAcceptedTypes(value) {
368
+ if (!Array.isArray(value) || !value.every(item => typeof item === 'string'))
369
+ throw new Error(`acceptedTypes expects: string[]`);
370
+ return value;
371
+ }
372
+ function toSizeLimitMb(value) {
373
+ if (!isNumber(value) || value < 0)
374
+ throw new Error('sizeLimitMb expects: positive number');
375
+ return value;
376
+ }
342
377
  class FileComponent extends ControlDirective {
343
- get acceptedTypes() {
344
- return this._acceptedTypes;
345
- }
346
- set acceptedTypes(value) {
347
- if (!Array.isArray(value) || !value.every(item => typeof item === 'string'))
348
- throw new Error(`acceptedTypes expects: string[]`);
349
- this._acceptedTypes = value;
350
- this.validation.next();
351
- }
352
- get sizeLimitMb() {
353
- return this._sizeLimitMb;
354
- }
355
- set sizeLimitMb(value) {
356
- if (!isNumber(value) || value < 0)
357
- throw new Error('sizeLimitMb expects: positive number');
358
- this._sizeLimitMb = value;
359
- this.validation.next();
360
- }
361
- get multiple() {
362
- return this._multiple;
363
- }
364
- set multiple(value) {
365
- this._multiple = value === true;
366
- this.validation.next();
367
- }
368
- constructor(ngControl) {
378
+ constructor() {
369
379
  super();
370
- this.ngControl = ngControl;
371
- this._acceptedTypes = [];
372
- this._sizeLimitMb = 0;
373
- this._multiple = false;
374
- this.showSize = false;
375
- this.model = null;
380
+ this.ngControl = inject(NgControl, { self: true });
381
+ this.acceptedTypes = input([], { ...(ngDevMode ? { debugName: "acceptedTypes" } : /* istanbul ignore next */ {}), transform: toAcceptedTypes });
382
+ this.sizeLimitMb = input(0, { ...(ngDevMode ? { debugName: "sizeLimitMb" } : /* istanbul ignore next */ {}), transform: toSizeLimitMb });
383
+ this.multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
384
+ this.showSize = input(false, { ...(ngDevMode ? { debugName: "showSize" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
385
+ this.model = signal(null, /* @ts-ignore */
386
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
376
387
  this.id = `${Math.random().toString(36).substr(2, 9)}`;
377
- this.validation
378
- .pipe(debounceTime(100))
379
- .subscribe(() => this.validate());
380
- ngControl.valueAccessor = this;
388
+ this.ngControl.valueAccessor = this;
389
+ effect(() => {
390
+ this.acceptedTypes();
391
+ this.sizeLimitMb();
392
+ this.multiple();
393
+ this.required();
394
+ this.validate();
395
+ });
381
396
  }
382
397
  get fileNames() {
383
398
  if (this.ngControl.value instanceof FileList)
@@ -387,9 +402,9 @@ class FileComponent extends ControlDirective {
387
402
  return '';
388
403
  }
389
404
  get sizeLimit() {
390
- return this.sizeLimitMb < 1
391
- ? `${this.sizeLimitMb * 1000} KB`
392
- : `${this.sizeLimitMb} MB`;
405
+ return this.sizeLimitMb() < 1
406
+ ? `${this.sizeLimitMb() * 1000} KB`
407
+ : `${this.sizeLimitMb()} MB`;
393
408
  }
394
409
  onFileChange(event) {
395
410
  const target = event.target;
@@ -397,6 +412,9 @@ class FileComponent extends ControlDirective {
397
412
  ? target.files
398
413
  : null);
399
414
  }
415
+ onFileCancel() {
416
+ this.onChange(null);
417
+ }
400
418
  onChange(_model) { }
401
419
  registerOnChange(fn) {
402
420
  this.onChange = fn;
@@ -407,7 +425,7 @@ class FileComponent extends ControlDirective {
407
425
  if (value !== null && !(value instanceof FileList))
408
426
  throw new Error('control value must be: File or null');
409
427
  // todo
410
- // this.model = value;
428
+ // this.model.set(value);
411
429
  }
412
430
  acceptedTypesValidator(acceptedTypes) {
413
431
  return (control) => control.value !== null
@@ -432,95 +450,64 @@ class FileComponent extends ControlDirective {
432
450
  }
433
451
  validate() {
434
452
  const validators = [
435
- this.invalidValidator(this.multiple)
453
+ this.invalidValidator(this.multiple())
436
454
  ];
437
- if (this.acceptedTypes.length > 0)
438
- validators.push(this.acceptedTypesValidator(this.acceptedTypes));
439
- if (this.sizeLimitMb > 0)
440
- validators.push(this.sizeLimitMbValidator(this.sizeLimitMb));
441
- if (this.required === true)
455
+ if (this.acceptedTypes().length > 0)
456
+ validators.push(this.acceptedTypesValidator(this.acceptedTypes()));
457
+ if (this.sizeLimitMb() > 0)
458
+ validators.push(this.sizeLimitMbValidator(this.sizeLimitMb()));
459
+ if (this.required() === true)
442
460
  validators.push(Validators.required);
443
461
  this.ngControl.control?.setValidators(validators);
444
462
  this.ngControl.control?.updateValueAndValidity();
445
463
  }
446
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FileComponent, deps: [{ token: i1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
447
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: FileComponent, selector: "jo-file", inputs: { acceptedTypes: "acceptedTypes", sizeLimitMb: "sizeLimitMb", multiple: "multiple", showSize: "showSize" }, usesInheritance: true, ngImport: i0, template: "<label [class.required]=\"required\">\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-center\">\r\n <div>\r\n <button\r\n class=\"white-space-nowrap\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [class.active]=\"ngControl.value !== null\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <icon\r\n type=\"folder\"\r\n size=\"1rem\"\r\n class=\"me-2\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n Choose {{multiple ? 'Files' : 'File'}}\r\n </button>\r\n </div>\r\n <div\r\n *ngIf=\"ngControl.value\"\r\n class=\"ml-2\"\r\n >\r\n {{fileNames}}\r\n </div>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['acceptedTypes']\">\r\n valid types are {{acceptedTypes.join(', ')}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['sizeLimitMb']\">\r\n max file size is {{sizeLimit}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->\r\n\r\n<input\r\n [(ngModel)]=\"model\"\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes.join()\"\r\n [multiple]=\"multiple\"\r\n [id]=\"id\"\r\n (change)=\"onFileChange($event)\"\r\n/>", styles: ["input[type=file]{display:none}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }] }); }
464
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: FileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
465
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: FileComponent, isStandalone: true, selector: "jo-file", inputs: { acceptedTypes: { classPropertyName: "acceptedTypes", publicName: "acceptedTypes", isSignal: true, isRequired: false, transformFunction: null }, sizeLimitMb: { classPropertyName: "sizeLimitMb", publicName: "sizeLimitMb", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showSize: { classPropertyName: "showSize", publicName: "showSize", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex justify-content-between\">\n <label [class.required]=\"required()\">\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div class=\"d-flex align-items-stretch\">\n <button\n class=\"d-flex align-items-center gap-2\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"fileInput.click()\"\n >\n <icon\n type=\"folder\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n Browse...\n </button>\n <button\n class=\"d-flex align-items-center\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.active]=\"ngControl.value !== null\"\n [disabled]=\"isDisabled()\"\n (click)=\"fileInput.click()\"\n >\n @if (!ngControl.value) {\n No {{multiple() ? 'files' : 'file'}} selected\n }\n @if (ngControl.value) {\n {{fileNames}}\n }\n </button>\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['acceptedTypes']\">\n valid types are {{acceptedTypes().join(', ')}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['sizeLimitMb']\">\n max file size is {{sizeLimit}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n</li>\n</ul> -->\n\n<input\n [ngModel]=\"model()\"\n #fileInput\n type=\"file\"\n [accept]=\"acceptedTypes().join()\"\n [multiple]=\"multiple()\"\n [id]=\"id\"\n (change)=\"onFileChange($event)\"\n (cancel)=\"onFileCancel()\"\n />\n", styles: ["input[type=file]{display:none}div button:first-child{border-right:none;flex-shrink:0}div button:last-child{border-left:none;display:block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
448
466
  }
449
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: FileComponent, decorators: [{
467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: FileComponent, decorators: [{
450
468
  type: Component,
451
- args: [{ selector: 'jo-file', template: "<label [class.required]=\"required\">\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-center\">\r\n <div>\r\n <button\r\n class=\"white-space-nowrap\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [class.active]=\"ngControl.value !== null\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"fileInput.click()\"\r\n >\r\n <icon\r\n type=\"folder\"\r\n size=\"1rem\"\r\n class=\"me-2\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n Choose {{multiple ? 'Files' : 'File'}}\r\n </button>\r\n </div>\r\n <div\r\n *ngIf=\"ngControl.value\"\r\n class=\"ml-2\"\r\n >\r\n {{fileNames}}\r\n </div>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['acceptedTypes']\">\r\n valid types are {{acceptedTypes.join(', ')}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['sizeLimitMb']\">\r\n max file size is {{sizeLimit}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['invalid']\">\r\n invalid model\r\n </li>\r\n</ul> -->\r\n\r\n<input\r\n [(ngModel)]=\"model\"\r\n #fileInput\r\n type=\"file\"\r\n [accept]=\"acceptedTypes.join()\"\r\n [multiple]=\"multiple\"\r\n [id]=\"id\"\r\n (change)=\"onFileChange($event)\"\r\n/>", styles: ["input[type=file]{display:none}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
452
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
453
- type: Self
454
- }] }], propDecorators: { acceptedTypes: [{
455
- type: Input
456
- }], sizeLimitMb: [{
457
- type: Input
458
- }], multiple: [{
459
- type: Input
460
- }], showSize: [{
461
- type: Input
462
- }] } });
469
+ args: [{ selector: 'jo-file', changeDetection: ChangeDetectionStrategy.Eager, imports: [FormsModule, IconComponent], template: "<div class=\"d-flex justify-content-between\">\n <label [class.required]=\"required()\">\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div class=\"d-flex align-items-stretch\">\n <button\n class=\"d-flex align-items-center gap-2\"\n [class.br-start]=\"borderRadiusLeft()\"\n [disabled]=\"isDisabled()\"\n (click)=\"fileInput.click()\"\n >\n <icon\n type=\"folder\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n Browse...\n </button>\n <button\n class=\"d-flex align-items-center\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.active]=\"ngControl.value !== null\"\n [disabled]=\"isDisabled()\"\n (click)=\"fileInput.click()\"\n >\n @if (!ngControl.value) {\n No {{multiple() ? 'files' : 'file'}} selected\n }\n @if (ngControl.value) {\n {{fileNames}}\n }\n </button>\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['acceptedTypes']\">\n valid types are {{acceptedTypes().join(', ')}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['sizeLimitMb']\">\n max file size is {{sizeLimit}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['invalid']\">\n invalid model\n</li>\n</ul> -->\n\n<input\n [ngModel]=\"model()\"\n #fileInput\n type=\"file\"\n [accept]=\"acceptedTypes().join()\"\n [multiple]=\"multiple()\"\n [id]=\"id\"\n (change)=\"onFileChange($event)\"\n (cancel)=\"onFileCancel()\"\n />\n", styles: ["input[type=file]{display:none}div button:first-child{border-right:none;flex-shrink:0}div button:last-child{border-left:none;display:block;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
470
+ }], ctorParameters: () => [], propDecorators: { acceptedTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptedTypes", required: false }] }], sizeLimitMb: [{ type: i0.Input, args: [{ isSignal: true, alias: "sizeLimitMb", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSize", required: false }] }] } });
463
471
 
472
+ function toNumber(label) {
473
+ return (value) => {
474
+ const result = typeof value === 'string' ? parseFloat(value) : value;
475
+ if (!isNumber(result))
476
+ throw new Error(`[${label}] expects: number`);
477
+ return result;
478
+ };
479
+ }
464
480
  class NumberComponent extends ControlDirective {
465
- get min() {
466
- return this._min;
467
- }
468
- set min(value) {
469
- if (!isNumber(value))
470
- throw new Error('[min] expects: number');
471
- this._min = value;
472
- this.validation.next();
473
- }
474
- get max() {
475
- return this._max;
476
- }
477
- set max(value) {
478
- if (!isNumber(value))
479
- throw new Error('[max] expects: number');
480
- this._max = value;
481
- this.validation.next();
482
- }
483
- get step() {
484
- return this._step;
485
- }
486
- set step(value) {
487
- if (!isNumber(value))
488
- throw new Error('[step] expects: number');
489
- this._step = value;
490
- this.mustBeInteger = Number.isInteger(this._step);
491
- }
492
- constructor(ngControl) {
481
+ constructor() {
493
482
  super();
494
- this.ngControl = ngControl;
495
- this._min = 0;
496
- this._max = 9;
497
- this._step = 1;
498
- this.mustBeInteger = true;
483
+ this.ngControl = inject(NgControl, { self: true });
484
+ this.min = input(0, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}), transform: toNumber('min') });
485
+ this.max = input(9, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}), transform: toNumber('max') });
486
+ this.step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: toNumber('step') });
499
487
  this.sizePadding = 5;
500
- this._model = null;
501
- this.validation.subscribe(() => this.validate());
502
- this.validation.next();
503
- ngControl.valueAccessor = this;
504
- }
505
- get model() {
506
- return this._model;
507
- }
508
- set model(value) {
509
- this._model = value;
510
- this.onChange(this._model);
511
- }
512
- get isDisabledAdd() {
513
- return this.isDisabled === true
514
- || this.model !== null
515
- && this.model + this.step > this.max;
516
- }
517
- get isDisabledSubtract() {
518
- return this.isDisabled === true
519
- || this._model !== null
520
- && this._model - this.step < this.min;
521
- }
522
- get maxDigitSize() {
523
- return Math.max(this._step.toString().length, this._max.toString().length, this._min.toString().length);
488
+ this.model = signal(null, /* @ts-ignore */
489
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
490
+ this.mustBeInteger = computed(() => Number.isInteger(this.step()), /* @ts-ignore */
491
+ ...(ngDevMode ? [{ debugName: "mustBeInteger" }] : /* istanbul ignore next */ []));
492
+ this.maxDigitSize = computed(() => Math.max(this.step().toString().length, this.max().toString().length, this.min().toString().length), /* @ts-ignore */
493
+ ...(ngDevMode ? [{ debugName: "maxDigitSize" }] : /* istanbul ignore next */ []));
494
+ this.isDisabledAdd = computed(() => this.isDisabled() === true
495
+ || this.model() !== null
496
+ && this.model() + this.step() > this.max(), /* @ts-ignore */
497
+ ...(ngDevMode ? [{ debugName: "isDisabledAdd" }] : /* istanbul ignore next */ []));
498
+ this.isDisabledSubtract = computed(() => this.isDisabled() === true
499
+ || this.model() !== null
500
+ && this.model() - this.step() < this.min(), /* @ts-ignore */
501
+ ...(ngDevMode ? [{ debugName: "isDisabledSubtract" }] : /* istanbul ignore next */ []));
502
+ this.ngControl.valueAccessor = this;
503
+ // Re-run validation synchronously whenever an input that feeds the
504
+ // validators changes. No debounce means validity repaints under zoneless.
505
+ effect(() => {
506
+ this.min();
507
+ this.max();
508
+ this.required();
509
+ this.validate();
510
+ });
524
511
  }
525
512
  onBeforeinput(e) {
526
513
  const event = e;
@@ -528,27 +515,34 @@ class NumberComponent extends ControlDirective {
528
515
  return;
529
516
  const isDigit = /\d/.test(event.data);
530
517
  const isMinus = event.data === '-';
531
- const isMinusAllowed = this.min < 0;
518
+ const isMinusAllowed = this.min() < 0;
532
519
  const isBlockedNonDigit = !isDigit && !(isMinus && isMinusAllowed);
533
- const isPastMax = Number((this._model || '') + event.data) > this.max;
520
+ const isPastMax = Number((this.model() || '') + event.data) > this.max();
534
521
  if (isBlockedNonDigit || isPastMax)
535
522
  event.preventDefault();
536
523
  }
537
524
  add(e) {
538
- if (this.model === null) {
539
- this.model = this.max;
525
+ if (this.model() === null) {
526
+ this.setModel(this.max());
540
527
  return;
541
528
  }
542
529
  e.stepUp();
543
- this.model = e.valueAsNumber;
530
+ this.setModel(e.valueAsNumber);
544
531
  }
545
532
  subtract(e) {
546
- if (this.model === null) {
547
- this.model = this.min;
533
+ if (this.model() === null) {
534
+ this.setModel(this.min());
548
535
  return;
549
536
  }
550
537
  e.stepDown();
551
- this.model = e.valueAsNumber;
538
+ this.setModel(e.valueAsNumber);
539
+ }
540
+ onModelChange(value) {
541
+ this.setModel(value);
542
+ }
543
+ setModel(value) {
544
+ this.model.set(value);
545
+ this.onChange(value);
552
546
  }
553
547
  onChange(_model) { }
554
548
  registerOnChange(fn) {
@@ -560,138 +554,196 @@ class NumberComponent extends ControlDirective {
560
554
  if (typeof value === 'string')
561
555
  value = parseFloat(value);
562
556
  if (value === null || isNumber(value))
563
- this._model = value;
557
+ this.model.set(value);
564
558
  }
565
559
  validate() {
566
560
  const validators = [
567
- Validators.min(this.min),
568
- Validators.max(this.max)
561
+ Validators.min(this.min()),
562
+ Validators.max(this.max())
569
563
  ];
570
- if (this.required === true)
564
+ if (this.required() === true)
571
565
  validators.push(Validators.required);
572
566
  this.ngControl.control?.setValidators(validators);
573
567
  this.ngControl.control?.updateValueAndValidity();
574
568
  }
575
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: NumberComponent, deps: [{ token: i1.NgControl, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
576
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: NumberComponent, selector: "jo-number", inputs: { min: "min", max: "max", step: "step" }, usesInheritance: true, ngImport: i0, template: "<label [class.required]=\"required\">\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-stretch\">\r\n <input\r\n [(ngModel)]=\"model\"\r\n #numberInput\r\n class=\"d-flex align-items-center\"\r\n type=\"number\"\r\n [size]=\"maxDigitSize + sizePadding\"\r\n [class.active]=\"_model !== null\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n (beforeinput)=\"onBeforeinput($event)\"\r\n />\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Subtract\"\r\n type=\"button\"\r\n [disabled]=\"isDisabledSubtract\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n (blur)=\"onTouched()\"\r\n (click)=\"subtract(numberInput)\"\r\n >\r\n <icon\r\n type=\"minus\"\r\n size=\"1rem\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </button>\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Add\"\r\n type=\"button\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [disabled]=\"isDisabledAdd\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n (blur)=\"onTouched()\"\r\n (click)=\"add(numberInput)\"\r\n >\r\n <icon\r\n type=\"plus\"\r\n size=\"1rem\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </button>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['min']\">\r\n minimum number is {{min}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['max']\">\r\n maximum number is {{max}}\r\n </li>\r\n</ul> -->", styles: ["input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host>div>input{border-right:0}:host>div>button:not(:last-child){border-right:0;border-left:0}:host>div>button:last-child{border-left:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }] }); }
569
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: NumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: NumberComponent, isStandalone: true, selector: "jo-number", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<label [class.required]=\"required()\">\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex align-items-stretch\">\n <input\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n #numberInput\n class=\"d-flex align-items-center\"\n type=\"number\"\n [size]=\"maxDigitSize() + sizePadding\"\n [class.active]=\"model() !== null\"\n [class.br-start]=\"borderRadiusLeft()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [min]=\"min()\"\n [max]=\"max()\"\n (beforeinput)=\"onBeforeinput($event)\"\n />\n <button\n class=\"d-flex align-items-center\"\n title=\"Subtract\"\n type=\"button\"\n [disabled]=\"isDisabledSubtract()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n (blur)=\"onTouched()\"\n (click)=\"subtract(numberInput)\"\n >\n <icon\n type=\"minus\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n </button>\n <button\n class=\"d-flex align-items-center\"\n title=\"Add\"\n type=\"button\"\n [class.br-end]=\"borderRadiusRight()\"\n [disabled]=\"isDisabledAdd()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n (blur)=\"onTouched()\"\n (click)=\"add(numberInput)\"\n >\n <icon\n type=\"plus\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n </button>\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n <li *ngIf=\"ngControl.control?.errors?.['min']\">\n minimum number is {{min}}\n </li>\n <li *ngIf=\"ngControl.control?.errors?.['max']\">\n maximum number is {{max}}\n </li>\n</ul> -->", styles: ["input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host>div>input{border-right:0}:host>div>button:not(:last-child){border-right:0;border-left:0}:host>div>button:last-child{border-left:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.MaxValidator, selector: "input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]", inputs: ["max"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
577
571
  }
578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: NumberComponent, decorators: [{
572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: NumberComponent, decorators: [{
579
573
  type: Component,
580
- args: [{ selector: 'jo-number', template: "<label [class.required]=\"required\">\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex align-items-stretch\">\r\n <input\r\n [(ngModel)]=\"model\"\r\n #numberInput\r\n class=\"d-flex align-items-center\"\r\n type=\"number\"\r\n [size]=\"maxDigitSize + sizePadding\"\r\n [class.active]=\"_model !== null\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n (beforeinput)=\"onBeforeinput($event)\"\r\n />\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Subtract\"\r\n type=\"button\"\r\n [disabled]=\"isDisabledSubtract\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n (blur)=\"onTouched()\"\r\n (click)=\"subtract(numberInput)\"\r\n >\r\n <icon\r\n type=\"minus\"\r\n size=\"1rem\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </button>\r\n <button\r\n class=\"d-flex align-items-center\"\r\n title=\"Add\"\r\n type=\"button\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [disabled]=\"isDisabledAdd\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n (blur)=\"onTouched()\"\r\n (click)=\"add(numberInput)\"\r\n >\r\n <icon\r\n type=\"plus\"\r\n size=\"1rem\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </button>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['min']\">\r\n minimum number is {{min}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['max']\">\r\n maximum number is {{max}}\r\n </li>\r\n</ul> -->", styles: ["input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host>div>input{border-right:0}:host>div>button:not(:last-child){border-right:0;border-left:0}:host>div>button:last-child{border-left:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
581
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
582
- type: Self
583
- }] }], propDecorators: { min: [{
584
- type: Input
585
- }], max: [{
586
- type: Input
587
- }], step: [{
588
- type: Input
589
- }] } });
574
+ args: [{ selector: 'jo-number', changeDetection: ChangeDetectionStrategy.Eager, imports: [FormsModule, IconComponent], template: "<label [class.required]=\"required()\">\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex align-items-stretch\">\n <input\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n #numberInput\n class=\"d-flex align-items-center\"\n type=\"number\"\n [size]=\"maxDigitSize() + sizePadding\"\n [class.active]=\"model() !== null\"\n [class.br-start]=\"borderRadiusLeft()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [min]=\"min()\"\n [max]=\"max()\"\n (beforeinput)=\"onBeforeinput($event)\"\n />\n <button\n class=\"d-flex align-items-center\"\n title=\"Subtract\"\n type=\"button\"\n [disabled]=\"isDisabledSubtract()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n (blur)=\"onTouched()\"\n (click)=\"subtract(numberInput)\"\n >\n <icon\n type=\"minus\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n </button>\n <button\n class=\"d-flex align-items-center\"\n title=\"Add\"\n type=\"button\"\n [class.br-end]=\"borderRadiusRight()\"\n [disabled]=\"isDisabledAdd()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n (blur)=\"onTouched()\"\n (click)=\"add(numberInput)\"\n >\n <icon\n type=\"plus\"\n size=\"1rem\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n </button>\n</div>\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n <li *ngIf=\"ngControl.control?.errors?.['min']\">\n minimum number is {{min}}\n </li>\n <li *ngIf=\"ngControl.control?.errors?.['max']\">\n maximum number is {{max}}\n </li>\n</ul> -->", styles: ["input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}:host>div>input{border-right:0}:host>div>button:not(:last-child){border-right:0;border-left:0}:host>div>button:last-child{border-left:0}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
575
+ }], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }] } });
590
576
 
591
577
  class ReadonlyComponent {
592
- constructor() { }
593
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ReadonlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
594
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: ReadonlyComponent, selector: "jo-readonly", inputs: { model: "model" }, ngImport: i0, template: "<label>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"readonly p-2\">\r\n {{model}}\r\n</div>", styles: [":host>div{color:inherit;background:transparent;border-width:.15em;border-color:transparent;border-style:solid}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }); }
578
+ constructor() {
579
+ this.model = input(/* @ts-ignore */
580
+ ...(ngDevMode ? [undefined, { debugName: "model" }] : /* istanbul ignore next */ []));
581
+ }
582
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ReadonlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
583
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.2", type: ReadonlyComponent, isStandalone: true, selector: "jo-readonly", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<label>\n <ng-content></ng-content>\n</label>\n\n<div class=\"readonly p-2\">\n {{model()}}\n</div>", styles: [":host>div{color:inherit;background:transparent;border-width:.15em;border-color:transparent;border-style:solid}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
595
584
  }
596
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ReadonlyComponent, decorators: [{
585
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ReadonlyComponent, decorators: [{
597
586
  type: Component,
598
- args: [{ selector: 'jo-readonly', template: "<label>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"readonly p-2\">\r\n {{model}}\r\n</div>", styles: [":host>div{color:inherit;background:transparent;border-width:.15em;border-color:transparent;border-style:solid}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
599
- }], ctorParameters: () => [], propDecorators: { model: [{
600
- type: Input
601
- }] } });
587
+ args: [{ selector: 'jo-readonly', changeDetection: ChangeDetectionStrategy.Eager, template: "<label>\n <ng-content></ng-content>\n</label>\n\n<div class=\"readonly p-2\">\n {{model()}}\n</div>", styles: [":host>div{color:inherit;background:transparent;border-width:.15em;border-color:transparent;border-style:solid}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
588
+ }], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }] } });
602
589
 
603
- class TextComponent extends ControlDirective {
604
- get placeholder() {
605
- return this._placeholder;
590
+ class SelectComponent extends ItemDirective {
591
+ constructor() {
592
+ super(...arguments);
593
+ this.hostElement = inject(ElementRef);
594
+ this.dropGroup = viewChild.required('dropGroup');
595
+ this.dropup = viewChild.required('dropup');
596
+ this.dropdown = viewChild.required('dropdown');
597
+ this.dropHeightPx = input(200, { ...(ngDevMode ? { debugName: "dropHeightPx" } : /* istanbul ignore next */ {}), transform: numberAttribute });
598
+ this.searchTerm = signal('', /* @ts-ignore */
599
+ ...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
600
+ this.filteredItems = computed(() => {
601
+ const term = this.searchTerm().toLowerCase();
602
+ return term
603
+ ? this.items().filter(item => item.value.toLowerCase().includes(term))
604
+ : this.items();
605
+ }, /* @ts-ignore */
606
+ ...(ngDevMode ? [{ debugName: "filteredItems" }] : /* istanbul ignore next */ []));
607
+ this.isDropdownCloseToBottom = false;
608
+ this.id = `${Math.random().toString(36).substr(2, 9)}`;
609
+ this.activeItemValues = computed(() => this.items()
610
+ .filter(item => this.model().includes(item.key))
611
+ .map(item => item.value)
612
+ .join(', '), /* @ts-ignore */
613
+ ...(ngDevMode ? [{ debugName: "activeItemValues" }] : /* istanbul ignore next */ []));
614
+ this.isSelectedAll = computed(() => this.items().every(item => this.model().includes(item.key)), /* @ts-ignore */
615
+ ...(ngDevMode ? [{ debugName: "isSelectedAll" }] : /* istanbul ignore next */ []));
606
616
  }
607
- set placeholder(v) {
608
- const value = v;
609
- if (typeof value !== 'string')
610
- throw new Error('[placeholder] expects: string');
611
- this._placeholder = value;
617
+ onGlobalClick(event) {
618
+ if (!this.hostElement.nativeElement.contains(event.target))
619
+ this.closeDropdown();
612
620
  }
613
- get minLength() {
614
- return this._minLength;
621
+ onSearchChange(value) {
622
+ this.searchTerm.set(value);
615
623
  }
616
- set minLength(value) {
617
- if (typeof value === 'string')
618
- value = parseInt(value, 10);
619
- if (value === undefined)
620
- value = null;
621
- if (!isNumber(value) || value < 0 || !Number.isInteger(value) || value === null)
622
- throw new Error('[minLength] expects: positive integer');
623
- this._minLength = value;
624
- this.validation.next();
624
+ onClickGroup() {
625
+ this.closeDropdown();
626
+ if (this.dropGroup().nativeElement.getBoundingClientRect().bottom + this.dropHeightPx() > window.innerHeight) {
627
+ this.dropup().nativeElement.show();
628
+ }
629
+ else {
630
+ this.dropdown().nativeElement.show();
631
+ }
632
+ }
633
+ onClick(item) {
634
+ const keys = this.items().map(item => item.key);
635
+ const model = this.model().filter(key => keys.includes(key));
636
+ if (model.includes(item.key)) {
637
+ if (this.required() === true && model.length === 1)
638
+ return;
639
+ this.setModel(model.filter(key => key !== item.key));
640
+ return;
641
+ }
642
+ if (!this.isMultiple() && model.length === 1) {
643
+ this.setModel([item.key]);
644
+ return;
645
+ }
646
+ this.setModel([...model, item.key]);
647
+ }
648
+ onClickSelectAll() {
649
+ this.setModel(this.isSelectedAll()
650
+ ? []
651
+ : this.items().map(item => item.key));
625
652
  }
626
- get maxLength() {
627
- return this._maxLength;
653
+ closeDropdown() {
654
+ this.searchTerm.set('');
655
+ this.dropdown().nativeElement.close();
656
+ this.dropup().nativeElement.close();
628
657
  }
629
- set maxLength(value) {
658
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: SelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
659
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: SelectComponent, isStandalone: true, selector: "jo-select", inputs: { dropHeightPx: { classPropertyName: "dropHeightPx", publicName: "dropHeightPx", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:mousedown": "onGlobalClick($event)" }, properties: { "style.--dropHeightPx": "dropHeightPx()" } }, viewQueries: [{ propertyName: "dropGroup", first: true, predicate: ["dropGroup"], descendants: true, isSignal: true }, { propertyName: "dropup", first: true, predicate: ["dropup"], descendants: true, isSignal: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex justify-content-between\">\n <label\n id=\"select_{{id}}\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div class=\"position-relative\">\n <dialog #dropup>\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\n </dialog>\n</div>\n\n<div\n #dropGroup\n class=\"d-flex align-items-stretch\"\n role=\"group\"\n attr.aria-labelledby=\"select_{{id}}\"\n >\n <button\n class=\"flex-1 br-start text-start\"\n type=\"button\"\n [class.active]=\"model().length > 0\"\n [class.invalid]=\"!ngControl.control?.invalid\"\n (click)=\"onClickGroup()\"\n (blur)=\"onTouched()\"\n >\n {{activeItemValues()}}\n </button>\n <button\n class=\"d-flex br-end d-flex align-items-center justify-content-center\"\n [class.invalid]=\"!ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n (click)=\"onClickGroup()\"\n (blur)=\"onTouched()\"\n >\n <icon\n size=\"1rem\"\n type=\"chevron\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n [stroke]=\"['current']\"\n [class.up]=\"dropup.open\"\n [class.down]=\"dropdown.open\"\n ></icon>\n </button>\n</div>\n\n<dialog #dropdown>\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\n</dialog>\n\n<ng-template #dropContent>\n <div class=\"card\">\n <div class=\"card-body\">\n <div class=\"d-flex gap-2 align-items-stretch\">\n <input\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n class=\"flex-1 br-start br-end\"\n />\n @if (isMultiple()) {\n <button\n type=\"button\"\n class=\"br-start br-end\"\n (click)=\"onClickSelectAll()\"\n >\n {{isSelectedAll() ? 'Deselect' : 'Select'}} All\n </button>\n }\n </div>\n </div>\n <div class=\"d-flex flex-column\">\n @for (item of filteredItems(); track item) {\n <button\n class=\"d-flex flex-1 align-items-center text-start gap-2\"\n [disabled]=\"isDisabled()\"\n [class.active]=\"model().includes(item.key)\"\n (click)=\"onClick(item)\"\n >\n <div\n class=\"jo-button {{isMultiple() ? 'br-20' : 'br-50'}}\"\n [class.active]=\"model().includes(item.key)\"\n [class.disabled]=\"isDisabled()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n >\n @if (model().includes(item.key)) {\n <icon\n size=\"1rem\"\n [type]=\"isMultiple() ? 'check' : 'dot'\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n }\n </div>\n {{item.value}}\n </button>\n }\n </div>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:block}:host>.position-relative>dialog{bottom:0}.drop{max-height:200px;overflow-y:auto}.drop.down{top:100%}.drop.up{bottom:100%}div[role=group]>button:first-child{border-right:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}div[role=group]>button:last-child{border-left:none}dialog{padding:0;border:0;margin:0;background:transparent;width:100%;z-index:2;color:currentColor}dialog>.card{-webkit-backdrop-filter:blur(1.5rem);backdrop-filter:blur(1.5rem);max-height:calc(var(--dropHeightPx) * 1px);overflow-y:auto}dialog>.card>.flex-column>button{border-color:transparent;border-width:.075em}dialog>.card>.flex-column>button>.jo-button{position:relative;text-align:left}dialog>.card>.flex-column>button>.jo-button>icon{position:absolute;top:0;left:0}icon[type=chevron]{transform:rotate(90deg)}icon[type=chevron].up{transform:rotate(0)}icon[type=chevron].down{transform:rotate(180deg)}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
660
+ }
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: SelectComponent, decorators: [{
662
+ type: Component,
663
+ args: [{ selector: 'jo-select', changeDetection: ChangeDetectionStrategy.Eager, host: {
664
+ '[style.--dropHeightPx]': 'dropHeightPx()',
665
+ }, imports: [FormsModule, NgTemplateOutlet, IconComponent], template: "<div class=\"d-flex justify-content-between\">\n <label\n id=\"select_{{id}}\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n </label>\n <div>\n <ng-content select=\"[rightAligned]\"></ng-content>\n </div>\n</div>\n\n<div class=\"position-relative\">\n <dialog #dropup>\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\n </dialog>\n</div>\n\n<div\n #dropGroup\n class=\"d-flex align-items-stretch\"\n role=\"group\"\n attr.aria-labelledby=\"select_{{id}}\"\n >\n <button\n class=\"flex-1 br-start text-start\"\n type=\"button\"\n [class.active]=\"model().length > 0\"\n [class.invalid]=\"!ngControl.control?.invalid\"\n (click)=\"onClickGroup()\"\n (blur)=\"onTouched()\"\n >\n {{activeItemValues()}}\n </button>\n <button\n class=\"d-flex br-end d-flex align-items-center justify-content-center\"\n [class.invalid]=\"!ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n (click)=\"onClickGroup()\"\n (blur)=\"onTouched()\"\n >\n <icon\n size=\"1rem\"\n type=\"chevron\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n [stroke]=\"['current']\"\n [class.up]=\"dropup.open\"\n [class.down]=\"dropdown.open\"\n ></icon>\n </button>\n</div>\n\n<dialog #dropdown>\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\n</dialog>\n\n<ng-template #dropContent>\n <div class=\"card\">\n <div class=\"card-body\">\n <div class=\"d-flex gap-2 align-items-stretch\">\n <input\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n class=\"flex-1 br-start br-end\"\n />\n @if (isMultiple()) {\n <button\n type=\"button\"\n class=\"br-start br-end\"\n (click)=\"onClickSelectAll()\"\n >\n {{isSelectedAll() ? 'Deselect' : 'Select'}} All\n </button>\n }\n </div>\n </div>\n <div class=\"d-flex flex-column\">\n @for (item of filteredItems(); track item) {\n <button\n class=\"d-flex flex-1 align-items-center text-start gap-2\"\n [disabled]=\"isDisabled()\"\n [class.active]=\"model().includes(item.key)\"\n (click)=\"onClick(item)\"\n >\n <div\n class=\"jo-button {{isMultiple() ? 'br-20' : 'br-50'}}\"\n [class.active]=\"model().includes(item.key)\"\n [class.disabled]=\"isDisabled()\"\n [class.invalid]=\"ngControl.control?.invalid\"\n >\n @if (model().includes(item.key)) {\n <icon\n size=\"1rem\"\n [type]=\"isMultiple() ? 'check' : 'dot'\"\n [fill]=\"[null, 'current']\"\n fillRotate=\"90\"\n ></icon>\n }\n </div>\n {{item.value}}\n </button>\n }\n </div>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:block}:host>.position-relative>dialog{bottom:0}.drop{max-height:200px;overflow-y:auto}.drop.down{top:100%}.drop.up{bottom:100%}div[role=group]>button:first-child{border-right:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}div[role=group]>button:last-child{border-left:none}dialog{padding:0;border:0;margin:0;background:transparent;width:100%;z-index:2;color:currentColor}dialog>.card{-webkit-backdrop-filter:blur(1.5rem);backdrop-filter:blur(1.5rem);max-height:calc(var(--dropHeightPx) * 1px);overflow-y:auto}dialog>.card>.flex-column>button{border-color:transparent;border-width:.075em}dialog>.card>.flex-column>button>.jo-button{position:relative;text-align:left}dialog>.card>.flex-column>button>.jo-button>icon{position:absolute;top:0;left:0}icon[type=chevron]{transform:rotate(90deg)}icon[type=chevron].up{transform:rotate(0)}icon[type=chevron].down{transform:rotate(180deg)}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
666
+ }], propDecorators: { dropGroup: [{ type: i0.ViewChild, args: ['dropGroup', { isSignal: true }] }], dropup: [{ type: i0.ViewChild, args: ['dropup', { isSignal: true }] }], dropdown: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }], dropHeightPx: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropHeightPx", required: false }] }], onGlobalClick: [{
667
+ type: HostListener,
668
+ args: ['document:mousedown', ['$event']]
669
+ }] } });
670
+
671
+ function toPlaceholder(value) {
672
+ if (typeof value !== 'string')
673
+ throw new Error('[placeholder] expects: string');
674
+ return value;
675
+ }
676
+ function toLength(label) {
677
+ return (value) => {
630
678
  if (typeof value === 'string')
631
679
  value = parseInt(value, 10);
632
680
  if (value === undefined)
633
681
  value = null;
634
682
  if (!isNumber(value) || value < 0 || !Number.isInteger(value) || value === null)
635
- throw new Error('[maxLength] expects: positive integer');
636
- this._maxLength = value;
637
- this.validation.next();
638
- }
639
- set isGrow(value) {
640
- if (value === '')
641
- value = true;
642
- if (value == null)
643
- value = false;
644
- if (typeof value !== 'boolean')
645
- throw new Error('[isGrow] expects: boolean');
646
- this._isGrow = value;
647
- }
648
- get model() {
649
- return this._model;
650
- }
651
- set model(value) {
652
- if (value === '')
653
- value = null;
654
- this._model = value;
655
- this.onChange(this._model);
656
- setTimeout(() => this.setTextareaHeight());
657
- }
658
- constructor(ngControl, renderer) {
683
+ throw new Error(`[${label}] expects: positive integer`);
684
+ return value;
685
+ };
686
+ }
687
+ class TextComponent extends ControlDirective {
688
+ constructor() {
659
689
  super();
660
- this.ngControl = ngControl;
661
- this.renderer = renderer;
662
- this._placeholder = '';
663
- this._minLength = null;
664
- this._maxLength = null;
665
- this.isSpellCheck = false;
666
- this._isGrow = false;
667
- this.rows = 3;
668
- this.onBlur = new EventEmitter();
669
- this.onFocus = new EventEmitter();
670
- this._model = null;
690
+ this.ngControl = inject(NgControl, { self: true });
691
+ this.renderer = inject(Renderer2);
692
+ this.placeholder = input('', { ...(ngDevMode ? { debugName: "placeholder" } : /* istanbul ignore next */ {}), transform: toPlaceholder });
693
+ this.minLength = input(null, { ...(ngDevMode ? { debugName: "minLength" } : /* istanbul ignore next */ {}), transform: toLength('minLength') });
694
+ this.maxLength = input(null, { ...(ngDevMode ? { debugName: "maxLength" } : /* istanbul ignore next */ {}), transform: toLength('maxLength') });
695
+ this.isSpellCheck = input(false, { ...(ngDevMode ? { debugName: "isSpellCheck" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
696
+ this.isGrow = input(false, { ...(ngDevMode ? { debugName: "isGrow" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
697
+ this.rows = input(3, /* @ts-ignore */
698
+ ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
699
+ this.onBlur = output();
700
+ this.onFocus = output();
701
+ this.textareaElement = viewChild('textarea', /* @ts-ignore */
702
+ ...(ngDevMode ? [{ debugName: "textareaElement" }] : /* istanbul ignore next */ []));
703
+ this.textareaHiddenElement = viewChild('textareaHidden', /* @ts-ignore */
704
+ ...(ngDevMode ? [{ debugName: "textareaHiddenElement" }] : /* istanbul ignore next */ []));
705
+ this.model = signal(null, /* @ts-ignore */
706
+ ...(ngDevMode ? [{ debugName: "model" }] : /* istanbul ignore next */ []));
671
707
  this.id = `_${Math.random().toString(36).substring(2, 11)}`;
672
708
  this.resizeSubject = new Subject();
673
- this.validation.subscribe(() => this.validate());
674
- ngControl.valueAccessor = this;
709
+ this.ngControl.valueAccessor = this;
675
710
  this.resizeSubject
676
711
  .pipe(debounceTime(300))
677
- .subscribe(() => this._isGrow && this.setTextareaHeight());
712
+ .subscribe(() => this.isGrow() && this.setTextareaHeight());
713
+ effect(() => {
714
+ this.minLength();
715
+ this.maxLength();
716
+ this.required();
717
+ this.validate();
718
+ });
678
719
  }
679
720
  ngOnDestroy() {
680
- super.ngOnDestroy();
681
721
  this.resizeSubject.complete();
682
722
  }
683
723
  onWindowResize() {
684
724
  this.resizeSubject.next();
685
725
  }
686
726
  setTextareaHeight() {
687
- if (!this.textareaElement || !this.textareaHiddenElement)
727
+ const textareaRef = this.textareaElement();
728
+ const textareaHiddenRef = this.textareaHiddenElement();
729
+ if (!textareaRef || !textareaHiddenRef)
688
730
  return;
689
- const textarea = this.textareaElement.nativeElement;
690
- const textareaHidden = this.textareaHiddenElement.nativeElement;
731
+ const textarea = textareaRef.nativeElement;
732
+ const textareaHidden = textareaHiddenRef.nativeElement;
691
733
  this.renderer.setStyle(textareaHidden, 'width', `calc(${textarea.scrollWidth}px - 1em)`);
692
734
  this.renderer.setStyle(textareaHidden, 'height', 'auto');
693
735
  this.renderer.setStyle(textarea, 'height', `${textareaHidden.scrollHeight}px`);
694
736
  }
737
+ onModelChange(value) {
738
+ this.setModel(value);
739
+ }
740
+ setModel(value) {
741
+ if (value === '')
742
+ value = null;
743
+ this.model.set(value);
744
+ this.onChange(value);
745
+ setTimeout(() => this.setTextareaHeight());
746
+ }
695
747
  onChange(_model) { }
696
748
  registerOnChange(fn) {
697
749
  this.onChange = fn;
@@ -703,213 +755,93 @@ class TextComponent extends ControlDirective {
703
755
  if (isNumber(value))
704
756
  value = value.toString();
705
757
  if (value === null || typeof value === 'string') {
706
- this._model = value;
758
+ this.model.set(value);
707
759
  setTimeout(() => this.setTextareaHeight());
708
760
  }
709
761
  }
710
762
  validate() {
711
763
  const validators = [];
712
- if (this._minLength != null)
713
- validators.push(Validators.minLength(this._minLength));
714
- if (this._maxLength != null)
715
- validators.push(Validators.maxLength(this._maxLength));
716
- if (this.required === true)
764
+ const minLength = this.minLength();
765
+ if (minLength != null)
766
+ validators.push(Validators.minLength(minLength));
767
+ const maxLength = this.maxLength();
768
+ if (maxLength != null)
769
+ validators.push(Validators.maxLength(maxLength));
770
+ if (this.required() === true)
717
771
  validators.push(Validators.required);
718
772
  this.ngControl.control?.setValidators(validators);
719
773
  this.ngControl.control?.updateValueAndValidity();
720
774
  }
721
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TextComponent, deps: [{ token: i1.NgControl, self: true }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
722
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: TextComponent, selector: "jo-text", inputs: { placeholder: "placeholder", minLength: "minLength", maxLength: "maxLength", isSpellCheck: "isSpellCheck", isGrow: "isGrow", rows: "rows" }, outputs: { onBlur: "onBlur", onFocus: "onFocus" }, host: { listeners: { "window:resize": "onWindowResize()" } }, viewQueries: [{ propertyName: "textareaElement", first: true, predicate: ["textarea"], descendants: true }, { propertyName: "textareaHiddenElement", first: true, predicate: ["textareaHidden"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<label\r\n [for]=\"id\"\r\n [class.required]=\"required\"\r\n>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex\">\r\n <input\r\n *ngIf=\"!_isGrow\"\r\n type=\"text\"\r\n [(ngModel)]=\"model\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n class=\"flex-1\"\r\n [minlength]=\"_minLength\"\r\n [maxlength]=\"_maxLength\"\r\n [class.active]=\"_model !== null\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n [spellcheck]=\"isSpellCheck\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouched(); onBlur.emit($event)\"\r\n (focus)=\"onFocus.emit($event)\"\r\n />\r\n <textarea\r\n *ngIf=\"_isGrow\"\r\n #textarea\r\n [(ngModel)]=\"model\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n class=\"flex-1\"\r\n [rows]=\"rows\"\r\n [minlength]=\"_minLength\"\r\n [maxlength]=\"_maxLength\"\r\n [class.active]=\"_model !== null\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n [spellcheck]=\"isSpellCheck\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouched(); onBlur.emit($event)\"\r\n (focus)=\"onFocus.emit($event)\"\r\n ></textarea>\r\n</div>\r\n\r\n<div\r\n *ngIf=\"_isGrow\"\r\n class=\"d-flex\"\r\n>\r\n <textarea\r\n #textareaHidden\r\n [ngModel]=\"model\"\r\n class=\"hidden flex-1\"\r\n [rows]=\"rows\"\r\n ></textarea>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['minlength']\">\r\n minimum length is {{minLength}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['maxLength']\">\r\n maximum length is {{maxLength}}\r\n </li>\r\n</ul> -->", styles: [":host{display:block}textarea{font-family:inherit;cursor:text;overflow:hidden;resize:none;width:100%}textarea.hidden{padding:0;position:absolute;visibility:hidden;transition:none}input[type=text]{font-family:inherit;width:100%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
775
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: TextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
776
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: TextComponent, isStandalone: true, selector: "jo-text", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minLength: { classPropertyName: "minLength", publicName: "minLength", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, isSpellCheck: { classPropertyName: "isSpellCheck", publicName: "isSpellCheck", isSignal: true, isRequired: false, transformFunction: null }, isGrow: { classPropertyName: "isGrow", publicName: "isGrow", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onBlur: "onBlur", onFocus: "onFocus" }, host: { listeners: { "window:resize": "onWindowResize()" } }, viewQueries: [{ propertyName: "textareaElement", first: true, predicate: ["textarea"], descendants: true, isSignal: true }, { propertyName: "textareaHiddenElement", first: true, predicate: ["textareaHidden"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label\n [for]=\"id\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex\">\n @if (!isGrow()) {\n <input\n type=\"text\"\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n class=\"flex-1\"\n [minlength]=\"minLength()\"\n [maxlength]=\"maxLength()\"\n [class.active]=\"model() !== null\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n [spellcheck]=\"isSpellCheck()\"\n [placeholder]=\"placeholder()\"\n (blur)=\"onTouched(); onBlur.emit($event)\"\n (focus)=\"onFocus.emit($event)\"\n />\n }\n @if (isGrow()) {\n <textarea\n #textarea\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n class=\"flex-1\"\n [rows]=\"rows()\"\n [minlength]=\"minLength()\"\n [maxlength]=\"maxLength()\"\n [class.active]=\"model() !== null\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n [spellcheck]=\"isSpellCheck()\"\n [placeholder]=\"placeholder()\"\n (blur)=\"onTouched(); onBlur.emit($event)\"\n (focus)=\"onFocus.emit($event)\"\n ></textarea>\n }\n</div>\n\n@if (isGrow()) {\n <div\n class=\"d-flex\"\n >\n <textarea\n #textareaHidden\n [ngModel]=\"model()\"\n class=\"hidden flex-1\"\n [rows]=\"rows()\"\n ></textarea>\n </div>\n}\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['minlength']\">\n minimum length is {{minLength()}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['maxLength']\">\n maximum length is {{maxLength()}}\n</li>\n</ul> -->\n", styles: [":host{display:block}textarea{font-family:inherit;cursor:text;overflow:hidden;resize:none;width:100%}textarea.hidden{padding:0;position:absolute;visibility:hidden;transition:none}input[type=text]{font-family:inherit;width:100%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Eager }); }
723
777
  }
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: TextComponent, decorators: [{
778
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: TextComponent, decorators: [{
725
779
  type: Component,
726
- args: [{ selector: 'jo-text', template: "<label\r\n [for]=\"id\"\r\n [class.required]=\"required\"\r\n>\r\n <ng-content></ng-content>\r\n</label>\r\n\r\n<div class=\"d-flex\">\r\n <input\r\n *ngIf=\"!_isGrow\"\r\n type=\"text\"\r\n [(ngModel)]=\"model\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n class=\"flex-1\"\r\n [minlength]=\"_minLength\"\r\n [maxlength]=\"_maxLength\"\r\n [class.active]=\"_model !== null\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n [spellcheck]=\"isSpellCheck\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouched(); onBlur.emit($event)\"\r\n (focus)=\"onFocus.emit($event)\"\r\n />\r\n <textarea\r\n *ngIf=\"_isGrow\"\r\n #textarea\r\n [(ngModel)]=\"model\"\r\n [class.br-end]=\"borderRadiusRight\"\r\n [class.br-start]=\"borderRadiusLeft\"\r\n class=\"flex-1\"\r\n [rows]=\"rows\"\r\n [minlength]=\"_minLength\"\r\n [maxlength]=\"_maxLength\"\r\n [class.active]=\"_model !== null\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n [id]=\"id\"\r\n [spellcheck]=\"isSpellCheck\"\r\n [placeholder]=\"placeholder\"\r\n (blur)=\"onTouched(); onBlur.emit($event)\"\r\n (focus)=\"onFocus.emit($event)\"\r\n ></textarea>\r\n</div>\r\n\r\n<div\r\n *ngIf=\"_isGrow\"\r\n class=\"d-flex\"\r\n>\r\n <textarea\r\n #textareaHidden\r\n [ngModel]=\"model\"\r\n class=\"hidden flex-1\"\r\n [rows]=\"rows\"\r\n ></textarea>\r\n</div>\r\n\r\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\r\n <li *ngIf=\"ngControl.control?.errors?.['minlength']\">\r\n minimum length is {{minLength}}\r\n </li>\r\n <li *ngIf=\"ngControl.control?.errors?.['maxLength']\">\r\n maximum length is {{maxLength}}\r\n </li>\r\n</ul> -->", styles: [":host{display:block}textarea{font-family:inherit;cursor:text;overflow:hidden;resize:none;width:100%}textarea.hidden{padding:0;position:absolute;visibility:hidden;transition:none}input[type=text]{font-family:inherit;width:100%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
727
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
728
- type: Self
729
- }] }, { type: i0.Renderer2 }], propDecorators: { placeholder: [{
730
- type: Input
731
- }], minLength: [{
732
- type: Input
733
- }], maxLength: [{
734
- type: Input
735
- }], isSpellCheck: [{
736
- type: Input
737
- }], isGrow: [{
738
- type: Input
739
- }], rows: [{
740
- type: Input
741
- }], onBlur: [{
742
- type: Output
743
- }], onFocus: [{
744
- type: Output
745
- }], textareaElement: [{
746
- type: ViewChild,
747
- args: ['textarea']
748
- }], textareaHiddenElement: [{
749
- type: ViewChild,
750
- args: ['textareaHidden']
751
- }], onWindowResize: [{
780
+ args: [{ selector: 'jo-text', changeDetection: ChangeDetectionStrategy.Eager, imports: [FormsModule], template: "<label\n [for]=\"id\"\n [class.required]=\"required()\"\n >\n <ng-content></ng-content>\n</label>\n\n<div class=\"d-flex\">\n @if (!isGrow()) {\n <input\n type=\"text\"\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n class=\"flex-1\"\n [minlength]=\"minLength()\"\n [maxlength]=\"maxLength()\"\n [class.active]=\"model() !== null\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n [spellcheck]=\"isSpellCheck()\"\n [placeholder]=\"placeholder()\"\n (blur)=\"onTouched(); onBlur.emit($event)\"\n (focus)=\"onFocus.emit($event)\"\n />\n }\n @if (isGrow()) {\n <textarea\n #textarea\n [ngModel]=\"model()\"\n (ngModelChange)=\"onModelChange($event)\"\n [class.br-end]=\"borderRadiusRight()\"\n [class.br-start]=\"borderRadiusLeft()\"\n class=\"flex-1\"\n [rows]=\"rows()\"\n [minlength]=\"minLength()\"\n [maxlength]=\"maxLength()\"\n [class.active]=\"model() !== null\"\n [class.invalid]=\"ngControl.control?.invalid\"\n [disabled]=\"isDisabled()\"\n [id]=\"id\"\n [spellcheck]=\"isSpellCheck()\"\n [placeholder]=\"placeholder()\"\n (blur)=\"onTouched(); onBlur.emit($event)\"\n (focus)=\"onFocus.emit($event)\"\n ></textarea>\n }\n</div>\n\n@if (isGrow()) {\n <div\n class=\"d-flex\"\n >\n <textarea\n #textareaHidden\n [ngModel]=\"model()\"\n class=\"hidden flex-1\"\n [rows]=\"rows()\"\n ></textarea>\n </div>\n}\n\n<!-- <ul *ngIf=\"ngControl.control?.errors\">\n<li *ngIf=\"ngControl.control?.errors?.['minlength']\">\n minimum length is {{minLength()}}\n</li>\n<li *ngIf=\"ngControl.control?.errors?.['maxLength']\">\n maximum length is {{maxLength()}}\n</li>\n</ul> -->\n", styles: [":host{display:block}textarea{font-family:inherit;cursor:text;overflow:hidden;resize:none;width:100%}textarea.hidden{padding:0;position:absolute;visibility:hidden;transition:none}input[type=text]{font-family:inherit;width:100%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit;min-width:0}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
781
+ }], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "minLength", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], isSpellCheck: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSpellCheck", required: false }] }], isGrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "isGrow", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], onBlur: [{ type: i0.Output, args: ["onBlur"] }], onFocus: [{ type: i0.Output, args: ["onFocus"] }], textareaElement: [{ type: i0.ViewChild, args: ['textarea', { isSignal: true }] }], textareaHiddenElement: [{ type: i0.ViewChild, args: ['textareaHidden', { isSignal: true }] }], onWindowResize: [{
752
782
  type: HostListener,
753
783
  args: ['window:resize']
754
784
  }] } });
755
785
 
756
- class SelectComponent extends ItemDirective {
757
- get searchTerm() {
758
- return this._searchTerm;
759
- }
760
- set searchTerm(value) {
761
- this._searchTerm = value;
762
- this.filteredItems = value
763
- ? this._items.filter(item => item.value.toLowerCase().includes(value.toLowerCase()))
764
- : this._items;
765
- }
766
- constructor(ngControl, hostElement) {
767
- super(ngControl);
768
- this.ngControl = ngControl;
769
- this.hostElement = hostElement;
770
- this.dropHeightPx = 200;
771
- this._searchTerm = '';
772
- this.isDropdownCloseToBottom = false;
773
- this.id = `${Math.random().toString(36).substr(2, 9)}`;
774
- }
775
- get activeItemValues() {
776
- return this._items
777
- .filter(item => this._model.includes(item.key))
778
- .map(item => item.value)
779
- .join(', ');
780
- }
781
- get isSelectedAll() {
782
- return this._items.every(item => this._model.includes(item.key));
783
- }
784
- onGlobalClick(event) {
785
- if (!this.hostElement.nativeElement.contains(event.target))
786
- this.closeDropdown();
787
- }
788
- onClickGroup() {
789
- this.closeDropdown();
790
- if (this.dropGroup.nativeElement.getBoundingClientRect().bottom + this.dropHeightPx > window.innerHeight) {
791
- this.dropup.nativeElement.show();
792
- }
793
- else {
794
- this.dropdown.nativeElement.show();
795
- }
796
- }
797
- onClick(item) {
798
- this._model = this._model.filter(key => this._items.map(item => item.key).includes(key));
799
- if (this._model.includes(item.key)) {
800
- if (this.required === true && this._model.length === 1)
801
- return;
802
- this.model = this._model.filter(key => key !== item.key);
803
- return;
804
- }
805
- if (!this.isMultiple && this._model.length === 1) {
806
- this.model = [item.key];
807
- return;
808
- }
809
- this.model = [...this._model, item.key];
810
- }
811
- onClickSelectAll() {
812
- this.model = this.isSelectedAll
813
- ? []
814
- : this._items.map(item => item.key);
815
- }
816
- closeDropdown() {
817
- this.searchTerm = '';
818
- this.dropdown.nativeElement.close();
819
- this.dropup.nativeElement.close();
820
- }
821
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SelectComponent, deps: [{ token: i1.NgControl, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
822
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.5", type: SelectComponent, selector: "jo-select", inputs: { dropHeightPx: "dropHeightPx" }, host: { listeners: { "document:mousedown": "onGlobalClick($event)" }, properties: { "style.--dropHeightPx": "this.dropHeightPx" } }, viewQueries: [{ propertyName: "dropGroup", first: true, predicate: ["dropGroup"], descendants: true }, { propertyName: "dropup", first: true, predicate: ["dropup"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"d-flex justify-content-between\">\r\n <label\r\n id=\"select_{{id}}\"\r\n [class.required]=\"required\"\r\n >\r\n <ng-content></ng-content>\r\n </label>\r\n <div>\r\n <ng-content select=\"[rightAligned]\"></ng-content>\r\n </div>\r\n</div>\r\n\r\n<div class=\"position-relative\">\r\n <dialog #dropup>\r\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\r\n </dialog>\r\n</div>\r\n\r\n<div\r\n #dropGroup\r\n class=\"d-flex align-items-stretch\"\r\n role=\"group\"\r\n attr.aria-labelledby=\"select_{{id}}\"\r\n>\r\n <button\r\n class=\"flex-1 br-start text-start\"\r\n type=\"button\"\r\n [class.active]=\"_model.length > 0\"\r\n [class.invalid]=\"!ngControl.control?.invalid\"\r\n (click)=\"onClickGroup()\"\r\n (blur)=\"onTouched()\"\r\n >\r\n {{activeItemValues}}\r\n </button>\r\n <button\r\n class=\"d-flex br-end d-flex align-items-center justify-content-center\"\r\n [class.invalid]=\"!ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"onClickGroup()\"\r\n (blur)=\"onTouched()\"\r\n >\r\n <icon\r\n size=\"1rem\"\r\n type=\"chevron\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n [stroke]=\"['current']\"\r\n [class.up]=\"dropup.open\"\r\n [class.down]=\"dropdown.open\"\r\n ></icon>\r\n </button>\r\n</div>\r\n\r\n<dialog #dropdown>\r\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\r\n</dialog>\r\n\r\n<ng-template #dropContent>\r\n <div class=\"card\">\r\n <div class=\"card-body\">\r\n <div class=\"d-flex gap-2 align-items-stretch\">\r\n <input\r\n [(ngModel)]=\"searchTerm\"\r\n class=\"flex-1 br-start br-end\"\r\n />\r\n <button\r\n *ngIf=\"_isMultiple\"\r\n type=\"button\"\r\n class=\"br-start br-end\"\r\n (click)=\"onClickSelectAll()\"\r\n >\r\n {{isSelectedAll ? 'Deselect' : 'Select'}} All\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"d-flex flex-column\">\r\n <button\r\n *ngFor=\"let item of filteredItems\"\r\n class=\"d-flex flex-1 align-items-center text-start gap-2\"\r\n [disabled]=\"isDisabled\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n (click)=\"onClick(item)\"\r\n >\r\n <div\r\n class=\"jo-button {{isMultiple ? 'br-20' : 'br-50'}}\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n [class.disabled]=\"isDisabled\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n >\r\n <icon\r\n *ngIf=\"_model.includes(item.key)\"\r\n size=\"1rem\"\r\n [type]=\"isMultiple ? 'check' : 'dot'\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </div>\r\n {{item.value}}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [":host{position:relative;display:block}:host>.position-relative>dialog{bottom:0}.drop{max-height:200px;overflow-y:auto}.drop.down{top:100%}.drop.up{bottom:100%}div[role=group]>button:first-child{border-right:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}div[role=group]>button:last-child{border-left:none}dialog{padding:0;border:0;margin:0;background:transparent;width:100%;z-index:2;color:currentColor}dialog>.card{-webkit-backdrop-filter:blur(1.5rem);backdrop-filter:blur(1.5rem);max-height:calc(var(--dropHeightPx) * 1px);overflow-y:auto}dialog>.card>.flex-column>button{border-color:transparent;border-width:.075em}dialog>.card>.flex-column>button>.jo-button{position:relative;text-align:left}dialog>.card>.flex-column>button>.jo-button>icon{position:absolute;top:0;left:0}icon[type=chevron]{transform:rotate(90deg)}icon[type=chevron].up{transform:rotate(0)}icon[type=chevron].down{transform:rotate(180deg)}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.IconComponent, selector: "icon[type]", inputs: ["type", "fill", "fillRotate", "fillOpacity", "stroke", "strokeRotate", "spin"] }] }); }
823
- }
824
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: SelectComponent, decorators: [{
825
- type: Component,
826
- args: [{ selector: 'jo-select', template: "<div class=\"d-flex justify-content-between\">\r\n <label\r\n id=\"select_{{id}}\"\r\n [class.required]=\"required\"\r\n >\r\n <ng-content></ng-content>\r\n </label>\r\n <div>\r\n <ng-content select=\"[rightAligned]\"></ng-content>\r\n </div>\r\n</div>\r\n\r\n<div class=\"position-relative\">\r\n <dialog #dropup>\r\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\r\n </dialog>\r\n</div>\r\n\r\n<div\r\n #dropGroup\r\n class=\"d-flex align-items-stretch\"\r\n role=\"group\"\r\n attr.aria-labelledby=\"select_{{id}}\"\r\n>\r\n <button\r\n class=\"flex-1 br-start text-start\"\r\n type=\"button\"\r\n [class.active]=\"_model.length > 0\"\r\n [class.invalid]=\"!ngControl.control?.invalid\"\r\n (click)=\"onClickGroup()\"\r\n (blur)=\"onTouched()\"\r\n >\r\n {{activeItemValues}}\r\n </button>\r\n <button\r\n class=\"d-flex br-end d-flex align-items-center justify-content-center\"\r\n [class.invalid]=\"!ngControl.control?.invalid\"\r\n [disabled]=\"isDisabled\"\r\n (click)=\"onClickGroup()\"\r\n (blur)=\"onTouched()\"\r\n >\r\n <icon\r\n size=\"1rem\"\r\n type=\"chevron\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n [stroke]=\"['current']\"\r\n [class.up]=\"dropup.open\"\r\n [class.down]=\"dropdown.open\"\r\n ></icon>\r\n </button>\r\n</div>\r\n\r\n<dialog #dropdown>\r\n <ng-template [ngTemplateOutlet]=\"dropContent\"></ng-template>\r\n</dialog>\r\n\r\n<ng-template #dropContent>\r\n <div class=\"card\">\r\n <div class=\"card-body\">\r\n <div class=\"d-flex gap-2 align-items-stretch\">\r\n <input\r\n [(ngModel)]=\"searchTerm\"\r\n class=\"flex-1 br-start br-end\"\r\n />\r\n <button\r\n *ngIf=\"_isMultiple\"\r\n type=\"button\"\r\n class=\"br-start br-end\"\r\n (click)=\"onClickSelectAll()\"\r\n >\r\n {{isSelectedAll ? 'Deselect' : 'Select'}} All\r\n </button>\r\n </div>\r\n </div>\r\n <div class=\"d-flex flex-column\">\r\n <button\r\n *ngFor=\"let item of filteredItems\"\r\n class=\"d-flex flex-1 align-items-center text-start gap-2\"\r\n [disabled]=\"isDisabled\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n (click)=\"onClick(item)\"\r\n >\r\n <div\r\n class=\"jo-button {{isMultiple ? 'br-20' : 'br-50'}}\"\r\n [class.active]=\"_model.includes(item.key)\"\r\n [class.disabled]=\"isDisabled\"\r\n [class.invalid]=\"ngControl.control?.invalid\"\r\n >\r\n <icon\r\n *ngIf=\"_model.includes(item.key)\"\r\n size=\"1rem\"\r\n [type]=\"isMultiple ? 'check' : 'dot'\"\r\n [fill]=\"[null, 'current']\"\r\n fillRotate=\"90\"\r\n ></icon>\r\n </div>\r\n {{item.value}}\r\n </button>\r\n </div>\r\n </div>\r\n</ng-template>", styles: [":host{position:relative;display:block}:host>.position-relative>dialog{bottom:0}.drop{max-height:200px;overflow-y:auto}.drop.down{top:100%}.drop.up{bottom:100%}div[role=group]>button:first-child{border-right:none;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}div[role=group]>button:last-child{border-left:none}dialog{padding:0;border:0;margin:0;background:transparent;width:100%;z-index:2;color:currentColor}dialog>.card{-webkit-backdrop-filter:blur(1.5rem);backdrop-filter:blur(1.5rem);max-height:calc(var(--dropHeightPx) * 1px);overflow-y:auto}dialog>.card>.flex-column>button{border-color:transparent;border-width:.075em}dialog>.card>.flex-column>button>.jo-button{position:relative;text-align:left}dialog>.card>.flex-column>button>.jo-button>icon{position:absolute;top:0;left:0}icon[type=chevron]{transform:rotate(90deg)}icon[type=chevron].up{transform:rotate(0)}icon[type=chevron].down{transform:rotate(180deg)}.br-20{border-radius:20%}.br-50{border-radius:50%}\n", "body{font-family:Arial;margin:0}h1,h2,h3,h4,h5,h6{margin:0}a:not(.jo-ignore),button:not(.jo-ignore),.jo-button,input,textarea{color:inherit;background:transparent;border-width:.15rem;border-style:outset;border-color:currentColor;padding:.5rem;margin:0;font-size:1rem;line-height:1rem;font-family:inherit}a:not(.jo-ignore):active,a:not(.jo-ignore).active,button:not(.jo-ignore):active,button:not(.jo-ignore).active,.jo-button:active,.jo-button.active,input:active,input.active,textarea:active,textarea.active{border-style:inset}a:not(.jo-ignore):disabled,a:not(.jo-ignore).disabled,button:not(.jo-ignore):disabled,button:not(.jo-ignore).disabled,.jo-button:disabled,.jo-button.disabled,input:disabled,input.disabled,textarea:disabled,textarea.disabled{cursor:not-allowed;border-style:solid;box-shadow:none;opacity:.5}a,button,.jo-button{cursor:pointer}.card{border:1px solid currentColor;border-radius:.5rem}.card .card-header{padding:1rem;border-bottom:1px solid currentColor}.card .card-body,.card .card-footer{padding:1rem}.card .card-table{overflow-x:auto}.card .card-body+.card-table,.card .card-table+.card-body,.card .card-body+.card-body,.card .card-table+.card-table,.card .card-table+.card-footer,.card .card-body+.card-footer{border-top:1px solid currentColor}.card table{width:100%;border-collapse:collapse}.card table>thead{text-align:left}.card table>thead th{border-bottom:1px solid currentColor}.card table>tfoot td{margin-top:1px;border-top:1px solid currentColor}.card table th,.card table td{padding:1rem}.card table tbody tr>td:last-child{text-align:right}.card table tbody tr:nth-child(odd) td{-webkit-backdrop-filter:brightness(85%);backdrop-filter:brightness(85%)}.card table tbody tr:last-child>td:first-child{border-bottom-left-radius:.5rem}.card table tbody tr:last-child>td:last-child{border-bottom-right-radius:.5rem}.card table tbody tr.active td{font-weight:700}.position-relative{position:relative}.d-flex{display:flex}.flex-row{flex-direction:row}.flex-column{flex-direction:column}.align-items-start{align-items:flex-start}.align-items-end{align-items:flex-end}.align-items-center{align-items:center}.align-items-baseline{align-items:baseline}.align-items-stretch{align-items:stretch}.justify-content-start{justify-content:flex-start}.justify-content-end{justify-content:flex-end}.justify-content-center{justify-content:center}.justify-content-between{justify-content:space-between}.justify-content-around{justify-content:space-around}.justify-content-evenly{justify-content:space-evenly}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}.flex-2{flex:2}.flex-3{flex:3}.flex-4{flex:4}.gap-1{gap:.25rem}.m-1{margin:.25rem}.p-1{padding:.25rem}.mx-1{margin-right:.25rem;margin-left:.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.px-1{padding-right:.25rem;padding-left:.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.ms-1{margin-right:.25rem}.me-1{margin-left:.25rem}.mt-1{margin-top:.25rem}.mb-1{margin-bottom:.25rem}.ps-1{padding-right:.25rem}.pe-1{padding-left:.25rem}.pt-1{padding-top:.25rem}.pb-1{padding-bottom:.25rem}.gap-2{gap:.5rem}.m-2{margin:.5rem}.p-2{padding:.5rem}.mx-2{margin-right:.5rem;margin-left:.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.px-2{padding-right:.5rem;padding-left:.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.ms-2{margin-right:.5rem}.me-2{margin-left:.5rem}.mt-2{margin-top:.5rem}.mb-2{margin-bottom:.5rem}.ps-2{padding-right:.5rem}.pe-2{padding-left:.5rem}.pt-2{padding-top:.5rem}.pb-2{padding-bottom:.5rem}.gap-3{gap:1rem}.m-3{margin:1rem}.p-3{padding:1rem}.mx-3{margin-right:1rem;margin-left:1rem}.my-3{margin-top:1rem;margin-bottom:1rem}.px-3{padding-right:1rem;padding-left:1rem}.py-3{padding-top:1rem;padding-bottom:1rem}.ms-3{margin-right:1rem}.me-3{margin-left:1rem}.mt-3{margin-top:1rem}.mb-3{margin-bottom:1rem}.ps-3{padding-right:1rem}.pe-3{padding-left:1rem}.pt-3{padding-top:1rem}.pb-3{padding-bottom:1rem}.gap-4{gap:1.5rem}.m-4{margin:1.5rem}.p-4{padding:1.5rem}.mx-4{margin-right:1.5rem;margin-left:1.5rem}.my-4{margin-top:1.5rem;margin-bottom:1.5rem}.px-4{padding-right:1.5rem;padding-left:1.5rem}.py-4{padding-top:1.5rem;padding-bottom:1.5rem}.ms-4{margin-right:1.5rem}.me-4{margin-left:1.5rem}.mt-4{margin-top:1.5rem}.mb-4{margin-bottom:1.5rem}.ps-4{padding-right:1.5rem}.pe-4{padding-left:1.5rem}.pt-4{padding-top:1.5rem}.pb-4{padding-bottom:1.5rem}.gap-5{gap:2rem}.m-5{margin:2rem}.p-5{padding:2rem}.mx-5{margin-right:2rem;margin-left:2rem}.my-5{margin-top:2rem;margin-bottom:2rem}.px-5{padding-right:2rem;padding-left:2rem}.py-5{padding-top:2rem;padding-bottom:2rem}.ms-5{margin-right:2rem}.me-5{margin-left:2rem}.mt-5{margin-top:2rem}.mb-5{margin-bottom:2rem}.ps-5{padding-right:2rem}.pe-5{padding-left:2rem}.pt-5{padding-top:2rem}.pb-5{padding-bottom:2rem}.border{border:1px solid currentColor}.br-start{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.br-end{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.white-space-nowrap{white-space:nowrap}.text-end{text-align:right}.text-start{text-align:left}.text-center{text-align:center}label{display:block;padding-bottom:.5rem;font-weight:700}label:empty{display:none}label.required:after{content:\"*\"}ul{list-style:none;margin:0;padding:0}\n"] }]
827
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
828
- type: Self
829
- }] }, { type: i0.ElementRef }], propDecorators: { dropGroup: [{
830
- type: ViewChild,
831
- args: ['dropGroup']
832
- }], dropup: [{
833
- type: ViewChild,
834
- args: ['dropup']
835
- }], dropdown: [{
836
- type: ViewChild,
837
- args: ['dropdown']
838
- }], dropHeightPx: [{
839
- type: Input
840
- }, {
841
- type: HostBinding,
842
- args: ['style.--dropHeightPx']
843
- }], onGlobalClick: [{
844
- type: HostListener,
845
- args: ['document:mousedown', ['$event']]
846
- }] } });
847
-
786
+ // The components and directives are standalone; this module is kept purely as a
787
+ // convenience aggregator so existing consumers can keep importing
788
+ // `ChaosControlModule`. New consumers can import the standalone pieces directly.
789
+ const PUBLIC_DECLARABLES = [
790
+ ReadonlyComponent,
791
+ ChoiceComponent,
792
+ ColorComponent,
793
+ FileComponent,
794
+ NumberComponent,
795
+ TextComponent,
796
+ SelectComponent,
797
+ BusyDirective,
798
+ IconComponent,
799
+ IconStackComponent,
800
+ ];
848
801
  class ChaosControlModule {
849
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
850
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlModule, declarations: [ReadonlyComponent,
802
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
803
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlModule, imports: [ReadonlyComponent,
851
804
  ChoiceComponent,
852
805
  ColorComponent,
853
806
  FileComponent,
854
807
  NumberComponent,
855
808
  TextComponent,
856
- ControlDirective,
857
- ItemDirective,
858
809
  SelectComponent,
859
- BorderRadiusDirective], imports: [CommonModule,
860
- FormsModule,
861
- IconModule,
862
- RouterModule], exports: [ReadonlyComponent,
810
+ BusyDirective,
811
+ IconComponent,
812
+ IconStackComponent], exports: [ReadonlyComponent,
863
813
  ChoiceComponent,
864
814
  ColorComponent,
865
815
  FileComponent,
866
816
  NumberComponent,
867
817
  TextComponent,
868
- SelectComponent] }); }
869
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlModule, imports: [CommonModule,
870
- FormsModule,
871
- IconModule,
872
- RouterModule] }); }
818
+ SelectComponent,
819
+ BusyDirective,
820
+ IconComponent,
821
+ IconStackComponent] }); }
822
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlModule, imports: [ChoiceComponent,
823
+ ColorComponent,
824
+ FileComponent,
825
+ NumberComponent,
826
+ TextComponent,
827
+ SelectComponent,
828
+ IconComponent,
829
+ IconStackComponent] }); }
873
830
  }
874
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlModule, decorators: [{
831
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlModule, decorators: [{
875
832
  type: NgModule,
876
833
  args: [{
877
- declarations: [
878
- ReadonlyComponent,
879
- ChoiceComponent,
880
- ColorComponent,
881
- FileComponent,
882
- NumberComponent,
883
- TextComponent,
884
- ControlDirective,
885
- ItemDirective,
886
- SelectComponent,
887
- BorderRadiusDirective,
888
- ],
889
- imports: [
890
- CommonModule,
891
- FormsModule,
892
- IconModule,
893
- RouterModule,
894
- ],
895
- exports: [
896
- ReadonlyComponent,
897
- ChoiceComponent,
898
- ColorComponent,
899
- FileComponent,
900
- NumberComponent,
901
- TextComponent,
902
- SelectComponent,
903
- ]
834
+ imports: PUBLIC_DECLARABLES,
835
+ exports: PUBLIC_DECLARABLES,
904
836
  }]
905
837
  }] });
906
838
 
907
839
  class ChaosControlService {
908
840
  constructor() { }
909
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
910
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlService, providedIn: 'root' }); }
841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
842
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlService, providedIn: 'root' }); }
911
843
  }
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: ChaosControlService, decorators: [{
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ChaosControlService, decorators: [{
913
845
  type: Injectable,
914
846
  args: [{
915
847
  providedIn: 'root'
@@ -922,5 +854,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImpor
922
854
  * Generated bundle index. Do not edit.
923
855
  */
924
856
 
925
- export { ChaosControlModule, ChaosControlService, ChoiceComponent, ColorComponent, FileComponent, NumberComponent, ReadonlyComponent, SelectComponent, TextComponent, isItem, isItems, isNumber, isPrimitive };
857
+ export { BorderRadiusDirective, BusyComponent, BusyDirective, ChaosControlModule, ChaosControlService, ChoiceComponent, ColorComponent, ControlDirective, FileComponent, ItemDirective, NumberComponent, ReadonlyComponent, SelectComponent, SizeDirective, TextComponent, isItem, isItems, isNumber, isPrimitive };
926
858
  //# sourceMappingURL=joster-dev-chaos-control.mjs.map