|
50 | 50 | </ng-template> |
51 | 51 |
|
52 | 52 | <ng-template #inputTemplate let-ex let-placeholder="placeholder"> |
53 | | - <div class="flex"> |
| 53 | + <!-- Reactive Forms (FormControl) --> |
| 54 | + <div class="flex flex-col gap-1 mb-2"> |
| 55 | + <span class="text-xs text-white/50 uppercase tracking-wider">Reactive Forms</span> |
54 | 56 | <input |
55 | 57 | [placeholder]="placeholder || ''" |
56 | 58 | [placeHolderCharacter]="ex._placholderCharacter || '_'" |
|
59 | 61 | [dropSpecialCharacters]="ex._dropSpecialCharacters ?? true" |
60 | 62 | [mask]="ex._mask || ''" |
61 | 63 | [thousandSeparator]="ex._thousandSeparator || ' '" |
62 | | - [formField]="ex.control.form" |
63 | 64 | [allowNegativeNumbers]="ex._allowNegativeNumbers || null" |
64 | 65 | [specialCharacters]="ex._specialCharacters || specialCharacters" |
65 | 66 | [shownMaskExpression]="ex._shownMaskExpression" |
66 | | - [(ngModel)]="ex.control.model" |
| 67 | + [formControl]="ex.control.formControl" |
67 | 68 | [apm]="ex._apm || false" |
68 | 69 | [decimalMarker]="ex._decimalMarker || '.'" |
69 | 70 | [leadZero]="ex._leadZero || false" |
|
75 | 76 | [outputTransformFn]="ex._outputTransformFn || outputTransformFn" |
76 | 77 | [inputTransformFn]="ex._inputTransformFn || inputTransformFn" |
77 | 78 | class="w-full h-[51px] placeholder:text-white/25 text-full-white py-3 px-5 outline-none bg-black border-b-2px border-b-white rounded-10px focus:border-b-yellow hover:border-b-yellow hover:bg-full-white/25 focus:bg-full-white/25" /> |
78 | | - </div> |
79 | | - <div class="flex gap-50px"> |
80 | 79 | <jsdaddy-open-source-card-content |
81 | | - [value]="ex.control.form().value() | isEmpty" |
82 | | - title="Form Control:" |
| 80 | + [value]="ex.control.formControl.value | isEmpty" |
| 81 | + title="FormControl:" |
83 | 82 | color="yellow-view" /> |
| 83 | + </div> |
| 84 | + |
| 85 | + <!-- Template-driven (ngModel) --> |
| 86 | + <div class="flex flex-col gap-1 mb-2"> |
| 87 | + <span class="text-xs text-white/50 uppercase tracking-wider">Template-driven</span> |
| 88 | + <input |
| 89 | + [placeholder]="placeholder || ''" |
| 90 | + [placeHolderCharacter]="ex._placholderCharacter || '_'" |
| 91 | + [prefix]="ex._prefix || ''" |
| 92 | + [suffix]="ex._suffix || ''" |
| 93 | + [dropSpecialCharacters]="ex._dropSpecialCharacters ?? true" |
| 94 | + [mask]="ex._mask || ''" |
| 95 | + [thousandSeparator]="ex._thousandSeparator || ' '" |
| 96 | + [allowNegativeNumbers]="ex._allowNegativeNumbers || null" |
| 97 | + [specialCharacters]="ex._specialCharacters || specialCharacters" |
| 98 | + [shownMaskExpression]="ex._shownMaskExpression" |
| 99 | + [(ngModel)]="ex.control.model" |
| 100 | + [apm]="ex._apm || false" |
| 101 | + [decimalMarker]="ex._decimalMarker || '.'" |
| 102 | + [leadZero]="ex._leadZero || false" |
| 103 | + [keepCharacterPositions]="ex._keepCharacterPositions || false" |
| 104 | + [validation]="ex._validation || false" |
| 105 | + [showMaskTyped]="ex._showMaskTyped || false" |
| 106 | + [clearIfNotMatch]="ex._clearIfNotMatch" |
| 107 | + [hiddenInput]="ex._hiddenInput || null" |
| 108 | + [outputTransformFn]="ex._outputTransformFn || outputTransformFn" |
| 109 | + [inputTransformFn]="ex._inputTransformFn || inputTransformFn" |
| 110 | + class="w-full h-[51px] placeholder:text-white/25 text-full-white py-3 px-5 outline-none bg-black border-b-2px border-b-white rounded-10px focus:border-b-yellow hover:border-b-yellow hover:bg-full-white/25 focus:bg-full-white/25" /> |
84 | 111 | <jsdaddy-open-source-card-content |
85 | | - [value]="ex.control.model | isEmpty" |
86 | | - title="Ng Model:" |
| 112 | + [value]="ex.control.model() | isEmpty" |
| 113 | + title="NgModel:" |
87 | 114 | color="yellow-view" /> |
88 | 115 | </div> |
89 | | - <jsdaddy-open-source-card-content [value]="ex._mask" title="Mask:" color="green-view" /> |
90 | | - @if (ex._validation) { |
| 116 | + |
| 117 | + <!-- Signal Forms --> |
| 118 | + <div class="flex flex-col gap-1 mb-2"> |
| 119 | + <span class="text-xs text-white/50 uppercase tracking-wider">Signal Forms</span> |
| 120 | + <input |
| 121 | + [placeholder]="placeholder || ''" |
| 122 | + [placeHolderCharacter]="ex._placholderCharacter || '_'" |
| 123 | + [prefix]="ex._prefix || ''" |
| 124 | + [suffix]="ex._suffix || ''" |
| 125 | + [dropSpecialCharacters]="ex._dropSpecialCharacters ?? true" |
| 126 | + [mask]="ex._mask || ''" |
| 127 | + [thousandSeparator]="ex._thousandSeparator || ' '" |
| 128 | + [allowNegativeNumbers]="ex._allowNegativeNumbers || null" |
| 129 | + [specialCharacters]="ex._specialCharacters || specialCharacters" |
| 130 | + [shownMaskExpression]="ex._shownMaskExpression" |
| 131 | + [formField]="ex.control.signalForm.value" |
| 132 | + [apm]="ex._apm || false" |
| 133 | + [decimalMarker]="ex._decimalMarker || '.'" |
| 134 | + [leadZero]="ex._leadZero || false" |
| 135 | + [keepCharacterPositions]="ex._keepCharacterPositions || false" |
| 136 | + [validation]="ex._validation || false" |
| 137 | + [showMaskTyped]="ex._showMaskTyped || false" |
| 138 | + [clearIfNotMatch]="ex._clearIfNotMatch" |
| 139 | + [hiddenInput]="ex._hiddenInput || null" |
| 140 | + [outputTransformFn]="ex._outputTransformFn || outputTransformFn" |
| 141 | + [inputTransformFn]="ex._inputTransformFn || inputTransformFn" |
| 142 | + class="w-full h-[51px] placeholder:text-white/25 text-full-white py-3 px-5 outline-none bg-black border-b-2px border-b-white rounded-10px focus:border-b-yellow hover:border-b-yellow hover:bg-full-white/25 focus:bg-full-white/25" /> |
91 | 143 | <jsdaddy-open-source-card-content |
92 | | - [value]="ex.control.form().errors() | json" |
93 | | - title="Mask error:" |
| 144 | + [value]="ex.control.signalForm.value().value() | isEmpty" |
| 145 | + title="Signal Form:" |
94 | 146 | color="yellow-view" /> |
95 | | - } |
| 147 | + </div> |
| 148 | + |
| 149 | + <jsdaddy-open-source-card-content [value]="ex._mask" title="Mask:" color="green-view" /> |
96 | 150 | </ng-template> |
97 | 151 |
|
98 | 152 | <ng-template #pipeTemplate> |
|
0 commit comments