@bootkit/ng0 0.0.0-alpha.2 → 0.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/index.d.ts +118 -6
- package/components/accordion/index.d.ts +1 -1
- package/components/backdrop/index.d.ts +12 -0
- package/components/button/index.d.ts +48 -0
- package/components/card/index.d.ts +27 -0
- package/components/code/index.d.ts +35 -0
- package/components/confirmation/index.d.ts +66 -0
- package/components/dropdown/index.d.ts +78 -0
- package/components/form-field/index.d.ts +72 -0
- package/components/list/index.d.ts +127 -0
- package/components/modal/index.d.ts +22 -4
- package/components/nav/index.d.ts +23 -19
- package/components/pagination/index.d.ts +35 -9
- package/components/popover/index.d.ts +1 -1
- package/components/select/index.d.ts +116 -0
- package/components/sidenav/index.d.ts +59 -0
- package/components/stepper/index.d.ts +26 -0
- package/components/table/index.d.ts +273 -0
- package/components/toast/index.d.ts +1 -1
- package/components/tooltip/index.d.ts +1 -1
- package/components/vertical-menu/index.d.ts +61 -0
- package/data/index.d.ts +258 -46
- package/date/index.d.ts +34 -0
- package/fesm2022/bootkit-ng0-common.mjs +89 -11
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-accordion.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-backdrop.mjs +46 -0
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-button.mjs +119 -0
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-card.mjs +62 -0
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-code.mjs +70 -0
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-collapse.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +167 -0
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs +189 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs +147 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-list.mjs +331 -0
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +40 -23
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +58 -59
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs +9 -9
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-pagination.mjs +58 -23
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-popover.mjs +10 -10
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +427 -0
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +153 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +91 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-table.mjs +461 -0
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-toast.mjs +7 -7
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +8 -8
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +161 -0
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-data.mjs +291 -90
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-date.mjs +50 -0
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-file.mjs +50 -0
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-form.mjs +514 -0
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-http.mjs +225 -179
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-localization-locales.mjs +115 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization.mjs +481 -0
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs +51 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-script.mjs +59 -0
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-security.mjs +17 -15
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/file/index.d.ts +22 -0
- package/form/index.d.ts +127 -0
- package/http/index.d.ts +141 -40
- package/localization/index.d.ts +305 -0
- package/localization/locales/index.d.ts +7 -0
- package/package.json +90 -10
- package/platform/browser/index.d.ts +22 -0
- package/script/index.d.ts +27 -0
- package/security/index.d.ts +3 -9
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Directive, inject, ElementRef, Renderer2, input, numberAttribute, booleanAttribute, forwardRef, HostListener, NgModule } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, Validators } from '@angular/forms';
|
|
4
|
+
import { formatNumber } from '@angular/common';
|
|
5
|
+
|
|
6
|
+
class FocusDirective {
|
|
7
|
+
elementRef;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
focusOnLoad = true;
|
|
12
|
+
focusWhen;
|
|
13
|
+
focused = false;
|
|
14
|
+
constructor(elementRef) {
|
|
15
|
+
this.elementRef = elementRef;
|
|
16
|
+
}
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
if (this.focusOnLoad) {
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
this.elementRef.nativeElement.focus();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
ngOnChanges(changes) {
|
|
25
|
+
if (changes['focusWhen']) {
|
|
26
|
+
if (this.focusWhen) {
|
|
27
|
+
setTimeout(() => {
|
|
28
|
+
this.elementRef.nativeElement.focus();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FocusDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
34
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: FocusDirective, isStandalone: true, selector: "[ng0Focus]", inputs: { focusOnLoad: "focusOnLoad", focusWhen: "focusWhen" }, exportAs: ["ng0Focus"], usesOnChanges: true, ngImport: i0 });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FocusDirective, decorators: [{
|
|
37
|
+
type: Directive,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: '[ng0Focus]',
|
|
40
|
+
exportAs: 'ng0Focus',
|
|
41
|
+
standalone: true
|
|
42
|
+
}]
|
|
43
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { focusOnLoad: [{
|
|
44
|
+
type: Input
|
|
45
|
+
}], focusWhen: [{
|
|
46
|
+
type: Input
|
|
47
|
+
}] } });
|
|
48
|
+
|
|
49
|
+
const addThousandsSeparator = (str) => str.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
50
|
+
const isValidNumber = (str) => str.trim() !== '' && !isNaN(Number(str));
|
|
51
|
+
const removeChar = (str, charToRemove) => str.split(charToRemove).join('');
|
|
52
|
+
const Keys = {
|
|
53
|
+
backspace: 'Backspace',
|
|
54
|
+
tab: 'Tab',
|
|
55
|
+
arrowLeft: 'ArrowLeft',
|
|
56
|
+
arrowRight: 'ArrowRight',
|
|
57
|
+
delete: 'Delete',
|
|
58
|
+
home: 'Home',
|
|
59
|
+
end: 'End'
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Directive to allow only number input in text fields.
|
|
63
|
+
* It supports integer and decimal numbers, negative numbers, min/max values, thousands separator.
|
|
64
|
+
*/
|
|
65
|
+
class NumberDirective {
|
|
66
|
+
_value;
|
|
67
|
+
_isDisabled;
|
|
68
|
+
_decimalSeparator;
|
|
69
|
+
_thousandsSeparator = ',';
|
|
70
|
+
_onChangeCallback;
|
|
71
|
+
_onTouchedCallback;
|
|
72
|
+
_elmRef = inject((ElementRef));
|
|
73
|
+
_renderer = inject(Renderer2);
|
|
74
|
+
/**
|
|
75
|
+
* The minimum number of digits to display after the decimal point.
|
|
76
|
+
* Applied only when 'numberType' is set to 'decimal'.
|
|
77
|
+
* @default 1
|
|
78
|
+
*/
|
|
79
|
+
minFractionDigits = input(1, ...(ngDevMode ? [{ debugName: "minFractionDigits", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
80
|
+
/**
|
|
81
|
+
* The maximum number of digits to display after the decimal point.
|
|
82
|
+
* Applied only when 'numberType' is set to 'decimal'.
|
|
83
|
+
* @default 2
|
|
84
|
+
*/
|
|
85
|
+
maxFractionDigits = input(2, ...(ngDevMode ? [{ debugName: "maxFractionDigits", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
86
|
+
/**
|
|
87
|
+
* Whether to use grouping separators, such as thousands separators
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
useGrouping = input(false, ...(ngDevMode ? [{ debugName: "useGrouping", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
91
|
+
/**
|
|
92
|
+
* Type of numbers to allow
|
|
93
|
+
* 'decimal' - allow decimal numbers
|
|
94
|
+
* 'integer' - allow integer numbers only
|
|
95
|
+
* @default 'integer'
|
|
96
|
+
*/
|
|
97
|
+
numberType = input('integer', ...(ngDevMode ? [{ debugName: "numberType" }] : []));
|
|
98
|
+
constructor() { }
|
|
99
|
+
ngOnInit() {
|
|
100
|
+
// Use Intl.NumberFormat to find decimal separator for locale
|
|
101
|
+
const formatted = formatNumber(1.1, 'en', '1.1-1');
|
|
102
|
+
this._decimalSeparator = formatted.replace(/\d/g, '') || '.';
|
|
103
|
+
}
|
|
104
|
+
registerOnChange(fn) {
|
|
105
|
+
this._onChangeCallback = fn;
|
|
106
|
+
}
|
|
107
|
+
registerOnTouched(fn) {
|
|
108
|
+
this._onTouchedCallback = fn;
|
|
109
|
+
}
|
|
110
|
+
setDisabledState(isDisabled) {
|
|
111
|
+
this._isDisabled = isDisabled;
|
|
112
|
+
this._renderer.setProperty(this._elmRef.nativeElement, 'disabled', isDisabled);
|
|
113
|
+
}
|
|
114
|
+
writeValue(value) {
|
|
115
|
+
var inputValue;
|
|
116
|
+
if (value === undefined || value === null) {
|
|
117
|
+
inputValue = '';
|
|
118
|
+
this._value = undefined;
|
|
119
|
+
}
|
|
120
|
+
else if (typeof value === 'number') {
|
|
121
|
+
inputValue = this._formatNumber(value);
|
|
122
|
+
this._value = value;
|
|
123
|
+
}
|
|
124
|
+
else if (typeof value === 'string') {
|
|
125
|
+
const parsedValue = this._value = Number.parseFloat(value);
|
|
126
|
+
inputValue = this._formatNumber(parsedValue);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.error('NumberDirective: Unsupported value type', value);
|
|
130
|
+
inputValue = 'Invalid';
|
|
131
|
+
}
|
|
132
|
+
this._setProperty('value', inputValue);
|
|
133
|
+
}
|
|
134
|
+
_onKeyDown(event) {
|
|
135
|
+
const key = event.key;
|
|
136
|
+
const state = this._getInputState();
|
|
137
|
+
if (this._isKeyAllowed(key)) {
|
|
138
|
+
if (key == Keys.backspace) {
|
|
139
|
+
if (state.selectionStart > 1 && (state.selectionStart === state.selectionEnd)) {
|
|
140
|
+
let value = this._elmRef.nativeElement.value;
|
|
141
|
+
let beforeSelection = value.charAt(state.selectionStart - 1);
|
|
142
|
+
if (beforeSelection === ',') {
|
|
143
|
+
// If the character before the cursor is a comma, we need to skip it
|
|
144
|
+
this._setProperty('selectionStart', state.selectionStart - 2);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
_onInput(value) {
|
|
154
|
+
if (value === '') {
|
|
155
|
+
this._value = undefined;
|
|
156
|
+
this._onChangeCallback?.(undefined);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const state = this._getInputState();
|
|
160
|
+
if (state.isCursorInsideIntegerPart && this.useGrouping()) {
|
|
161
|
+
this._formatIntegerPart(value);
|
|
162
|
+
}
|
|
163
|
+
var number = Number(removeChar(this._elmRef.nativeElement.value, this._thousandsSeparator));
|
|
164
|
+
this._value = isNaN(number) ? undefined : number;
|
|
165
|
+
this._onChangeCallback?.(this._value);
|
|
166
|
+
}
|
|
167
|
+
_formatIntegerPart(value) {
|
|
168
|
+
let state = this._getInputState();
|
|
169
|
+
// Format the input value
|
|
170
|
+
const integerPart = value.split(this._decimalSeparator)[0];
|
|
171
|
+
const decimalPart = value.split(this._decimalSeparator)[1];
|
|
172
|
+
if (integerPart.length <= 3) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
let normalizedIntegerPart = removeChar(integerPart, this._thousandsSeparator); // Remove commas
|
|
176
|
+
let formattedValue = addThousandsSeparator(normalizedIntegerPart);
|
|
177
|
+
if (decimalPart !== undefined) {
|
|
178
|
+
formattedValue += this._decimalSeparator + decimalPart;
|
|
179
|
+
}
|
|
180
|
+
this._setProperty('value', formattedValue);
|
|
181
|
+
let newSelectionStart;
|
|
182
|
+
// fix the cursor position after formatting
|
|
183
|
+
if (value.length == 1) {
|
|
184
|
+
newSelectionStart = 1;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
const newValueLength = formattedValue.length;
|
|
188
|
+
const cursorJump = newValueLength - value.length;
|
|
189
|
+
newSelectionStart = Math.max(0, state.selectionStart + cursorJump);
|
|
190
|
+
}
|
|
191
|
+
this._setProperty('selectionStart', newSelectionStart);
|
|
192
|
+
this._setProperty('selectionEnd', newSelectionStart);
|
|
193
|
+
// return formattedValue;
|
|
194
|
+
}
|
|
195
|
+
_onBlur() {
|
|
196
|
+
if (this._value !== undefined) {
|
|
197
|
+
let formattedValue = this._formatNumber(this._value);
|
|
198
|
+
this._setProperty('value', formattedValue);
|
|
199
|
+
}
|
|
200
|
+
this._onTouchedCallback?.();
|
|
201
|
+
}
|
|
202
|
+
_onPaste(event) {
|
|
203
|
+
// event.
|
|
204
|
+
// value = value.trim();
|
|
205
|
+
}
|
|
206
|
+
_getInputState() {
|
|
207
|
+
let value = this._elmRef.nativeElement.value;
|
|
208
|
+
let decimalSeparatorPosition = value.indexOf(this._decimalSeparator);
|
|
209
|
+
let selectionStart = this._elmRef.nativeElement.selectionStart || 0;
|
|
210
|
+
let selectionEnd = this._elmRef.nativeElement.selectionEnd || 0;
|
|
211
|
+
return {
|
|
212
|
+
selectionStart,
|
|
213
|
+
selectionEnd,
|
|
214
|
+
decimalSeparatorPosition,
|
|
215
|
+
isCursorInsideIntegerPart: decimalSeparatorPosition > -1 ? (selectionStart <= decimalSeparatorPosition) : true
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
_formatNumber(n) {
|
|
219
|
+
var isInteger = this.numberType() == 'integer';
|
|
220
|
+
return new Intl.NumberFormat('en-US', {
|
|
221
|
+
useGrouping: this.useGrouping(),
|
|
222
|
+
minimumFractionDigits: isInteger ? 0 : this.minFractionDigits(),
|
|
223
|
+
maximumFractionDigits: isInteger ? 0 : this.maxFractionDigits(),
|
|
224
|
+
style: 'decimal',
|
|
225
|
+
}).format(n);
|
|
226
|
+
}
|
|
227
|
+
_isKeyAllowed(key) {
|
|
228
|
+
const allowedKeys = [Keys.backspace, Keys.tab, Keys.arrowLeft, Keys.arrowRight, Keys.delete, Keys.home, Keys.end];
|
|
229
|
+
const input = this._elmRef.nativeElement;
|
|
230
|
+
const value = input.value;
|
|
231
|
+
const state = this._getInputState();
|
|
232
|
+
if (allowedKeys.includes(key)) {
|
|
233
|
+
return true; // allow control/navigation keys
|
|
234
|
+
}
|
|
235
|
+
// Allow one leading minus
|
|
236
|
+
if (key === '-') {
|
|
237
|
+
return (input.selectionStart === 0 || input.selectionEnd === 0) && value.charAt(0) !== '-';
|
|
238
|
+
}
|
|
239
|
+
// Allow one dot for decimal
|
|
240
|
+
if (key === this._decimalSeparator) {
|
|
241
|
+
return (this.numberType() == 'decimal') &&
|
|
242
|
+
(!value.includes(this._decimalSeparator)) &&
|
|
243
|
+
(state.selectionStart == input.value.length);
|
|
244
|
+
}
|
|
245
|
+
// Allow numbers only
|
|
246
|
+
if (/^\d$/.test(key)) {
|
|
247
|
+
if (state.isCursorInsideIntegerPart) {
|
|
248
|
+
return true;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
var decimalPart = value.split(this._decimalSeparator)[1];
|
|
252
|
+
var maxFractionDigits = this.maxFractionDigits();
|
|
253
|
+
if (maxFractionDigits != undefined && decimalPart.length < maxFractionDigits) {
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
return input.selectionStart !== input.selectionEnd; // allow a new digit if a substring is selected
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
_setProperty(prop, value) {
|
|
264
|
+
this._renderer.setProperty(this._elmRef.nativeElement, prop, value);
|
|
265
|
+
}
|
|
266
|
+
;
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NumberDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
268
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: NumberDirective, isStandalone: true, selector: "[ng0Number]", inputs: { minFractionDigits: { classPropertyName: "minFractionDigits", publicName: "minFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, numberType: { classPropertyName: "numberType", publicName: "numberType", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "_onKeyDown($event)", "input": "_onInput($event.target.value)", "blur": "_onBlur()", "paste": "_onPaste($event)" } }, providers: [
|
|
269
|
+
{
|
|
270
|
+
provide: NG_VALUE_ACCESSOR,
|
|
271
|
+
useExisting: forwardRef(() => NumberDirective),
|
|
272
|
+
multi: true
|
|
273
|
+
}
|
|
274
|
+
], ngImport: i0 });
|
|
275
|
+
}
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: NumberDirective, decorators: [{
|
|
277
|
+
type: Directive,
|
|
278
|
+
args: [{
|
|
279
|
+
selector: '[ng0Number]',
|
|
280
|
+
providers: [
|
|
281
|
+
{
|
|
282
|
+
provide: NG_VALUE_ACCESSOR,
|
|
283
|
+
useExisting: forwardRef(() => NumberDirective),
|
|
284
|
+
multi: true
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
}]
|
|
288
|
+
}], ctorParameters: () => [], propDecorators: { _onKeyDown: [{
|
|
289
|
+
type: HostListener,
|
|
290
|
+
args: ['keydown', ['$event']]
|
|
291
|
+
}], _onInput: [{
|
|
292
|
+
type: HostListener,
|
|
293
|
+
args: ['input', ['$event.target.value']]
|
|
294
|
+
}], _onBlur: [{
|
|
295
|
+
type: HostListener,
|
|
296
|
+
args: ['blur']
|
|
297
|
+
}], _onPaste: [{
|
|
298
|
+
type: HostListener,
|
|
299
|
+
args: ['paste', ['$event']]
|
|
300
|
+
}] } });
|
|
301
|
+
|
|
302
|
+
function equalWithValidator(targetValue, inequalityMessage) {
|
|
303
|
+
return (control) => {
|
|
304
|
+
const isValid = control.value === targetValue;
|
|
305
|
+
return isValid ? null :
|
|
306
|
+
{
|
|
307
|
+
equalWith: {
|
|
308
|
+
value: control.value,
|
|
309
|
+
message: inequalityMessage
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
class EqualWithValidatorDirective {
|
|
316
|
+
targetValue;
|
|
317
|
+
inequalityMessage;
|
|
318
|
+
constructor() {
|
|
319
|
+
}
|
|
320
|
+
validate(control) {
|
|
321
|
+
return equalWithValidator(this.targetValue, this.inequalityMessage)(control);
|
|
322
|
+
}
|
|
323
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: EqualWithValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
324
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: EqualWithValidatorDirective, isStandalone: true, selector: "[ng0EqualWith]", inputs: { targetValue: ["ng0EqualWith", "targetValue"], inequalityMessage: "inequalityMessage" }, providers: [
|
|
325
|
+
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
326
|
+
], exportAs: ["ng0EqualWith"], ngImport: i0 });
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: EqualWithValidatorDirective, decorators: [{
|
|
329
|
+
type: Directive,
|
|
330
|
+
args: [{
|
|
331
|
+
selector: '[ng0EqualWith]',
|
|
332
|
+
exportAs: 'ng0EqualWith',
|
|
333
|
+
standalone: true,
|
|
334
|
+
providers: [
|
|
335
|
+
{ provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }
|
|
336
|
+
]
|
|
337
|
+
}]
|
|
338
|
+
}], ctorParameters: () => [], propDecorators: { targetValue: [{
|
|
339
|
+
type: Input,
|
|
340
|
+
args: ['ng0EqualWith']
|
|
341
|
+
}], inequalityMessage: [{
|
|
342
|
+
type: Input
|
|
343
|
+
}] } });
|
|
344
|
+
|
|
345
|
+
const urlRegEx = new RegExp('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?');
|
|
346
|
+
function urlValidator() {
|
|
347
|
+
return (control) => {
|
|
348
|
+
const value = control.value;
|
|
349
|
+
if (!value || urlRegEx.test(value)) {
|
|
350
|
+
return null;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
return {
|
|
354
|
+
'url': {
|
|
355
|
+
value
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
class UrlValidatorDirective {
|
|
363
|
+
/** Directive is enabled or disabled */
|
|
364
|
+
iscUrl = true;
|
|
365
|
+
validate(control) {
|
|
366
|
+
return urlValidator()(control);
|
|
367
|
+
}
|
|
368
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: UrlValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
369
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.1", type: UrlValidatorDirective, isStandalone: true, selector: "input[ng0Url]", inputs: { iscUrl: "iscUrl" }, providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }], exportAs: ["ng0Url"], ngImport: i0 });
|
|
370
|
+
}
|
|
371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: UrlValidatorDirective, decorators: [{
|
|
372
|
+
type: Directive,
|
|
373
|
+
args: [{
|
|
374
|
+
selector: 'input[ng0Url]',
|
|
375
|
+
exportAs: 'ng0Url',
|
|
376
|
+
standalone: true,
|
|
377
|
+
providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]
|
|
378
|
+
}]
|
|
379
|
+
}], propDecorators: { iscUrl: [{
|
|
380
|
+
type: Input
|
|
381
|
+
}] } });
|
|
382
|
+
|
|
383
|
+
class CustomValidatorDirective {
|
|
384
|
+
validator = input.required(...(ngDevMode ? [{ debugName: "validator", alias: 'ng0CustomValidator' }] : [{ alias: 'ng0CustomValidator' }]));
|
|
385
|
+
constructor() { }
|
|
386
|
+
validate(control) {
|
|
387
|
+
return this.validator()(control);
|
|
388
|
+
}
|
|
389
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: CustomValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
390
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: CustomValidatorDirective, isStandalone: true, selector: "[ng0CustomValidator]", inputs: { validator: { classPropertyName: "validator", publicName: "ng0CustomValidator", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
391
|
+
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
392
|
+
], exportAs: ["ng0CustomValidator"], ngImport: i0 });
|
|
393
|
+
}
|
|
394
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: CustomValidatorDirective, decorators: [{
|
|
395
|
+
type: Directive,
|
|
396
|
+
args: [{
|
|
397
|
+
selector: '[ng0CustomValidator]',
|
|
398
|
+
exportAs: 'ng0CustomValidator',
|
|
399
|
+
standalone: true,
|
|
400
|
+
providers: [
|
|
401
|
+
{ provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }
|
|
402
|
+
]
|
|
403
|
+
}]
|
|
404
|
+
}], ctorParameters: () => [] });
|
|
405
|
+
|
|
406
|
+
/** Min validator */
|
|
407
|
+
class MinValidatorDirective {
|
|
408
|
+
min = input.required(...(ngDevMode ? [{ debugName: "min", transform: numberAttribute }] : [{
|
|
409
|
+
transform: numberAttribute,
|
|
410
|
+
}]));
|
|
411
|
+
validate(control) {
|
|
412
|
+
return Validators.min(this.min())(control);
|
|
413
|
+
}
|
|
414
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MinValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
415
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: MinValidatorDirective, isStandalone: true, selector: "input[type=text][ng0Number][min]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{
|
|
416
|
+
provide: NG_VALIDATORS,
|
|
417
|
+
useExisting: MinValidatorDirective,
|
|
418
|
+
multi: true
|
|
419
|
+
}], exportAs: ["ng0Min"], ngImport: i0 });
|
|
420
|
+
}
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MinValidatorDirective, decorators: [{
|
|
422
|
+
type: Directive,
|
|
423
|
+
args: [{
|
|
424
|
+
selector: 'input[type=text][ng0Number][min]',
|
|
425
|
+
exportAs: 'ng0Min',
|
|
426
|
+
standalone: true,
|
|
427
|
+
providers: [{
|
|
428
|
+
provide: NG_VALIDATORS,
|
|
429
|
+
useExisting: MinValidatorDirective,
|
|
430
|
+
multi: true
|
|
431
|
+
}]
|
|
432
|
+
}]
|
|
433
|
+
}] });
|
|
434
|
+
|
|
435
|
+
/** Max validator */
|
|
436
|
+
class MaxValidatorDirective {
|
|
437
|
+
max = input.required(...(ngDevMode ? [{ debugName: "max", transform: numberAttribute }] : [{
|
|
438
|
+
transform: numberAttribute,
|
|
439
|
+
}]));
|
|
440
|
+
validate(control) {
|
|
441
|
+
return Validators.max(this.max())(control);
|
|
442
|
+
}
|
|
443
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MaxValidatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
444
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.1", type: MaxValidatorDirective, isStandalone: true, selector: "input[type=text][ng0Number][max]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: true, transformFunction: null } }, providers: [{
|
|
445
|
+
provide: NG_VALIDATORS,
|
|
446
|
+
useExisting: MaxValidatorDirective,
|
|
447
|
+
multi: true
|
|
448
|
+
}], exportAs: ["ng0Max"], ngImport: i0 });
|
|
449
|
+
}
|
|
450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MaxValidatorDirective, decorators: [{
|
|
451
|
+
type: Directive,
|
|
452
|
+
args: [{
|
|
453
|
+
selector: 'input[type=text][ng0Number][max]',
|
|
454
|
+
exportAs: 'ng0Max',
|
|
455
|
+
standalone: true,
|
|
456
|
+
providers: [{
|
|
457
|
+
provide: NG_VALIDATORS,
|
|
458
|
+
useExisting: MaxValidatorDirective,
|
|
459
|
+
multi: true
|
|
460
|
+
}]
|
|
461
|
+
}]
|
|
462
|
+
}] });
|
|
463
|
+
|
|
464
|
+
const items = [
|
|
465
|
+
// ErrorDirective,
|
|
466
|
+
// FirstErrorDirective,
|
|
467
|
+
NumberDirective,
|
|
468
|
+
// Validators
|
|
469
|
+
MinValidatorDirective,
|
|
470
|
+
MaxValidatorDirective,
|
|
471
|
+
EqualWithValidatorDirective,
|
|
472
|
+
UrlValidatorDirective,
|
|
473
|
+
CustomValidatorDirective,
|
|
474
|
+
];
|
|
475
|
+
class FormModule {
|
|
476
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
477
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: FormModule, imports: [
|
|
478
|
+
// ErrorDirective,
|
|
479
|
+
// FirstErrorDirective,
|
|
480
|
+
NumberDirective,
|
|
481
|
+
// Validators
|
|
482
|
+
MinValidatorDirective,
|
|
483
|
+
MaxValidatorDirective,
|
|
484
|
+
EqualWithValidatorDirective,
|
|
485
|
+
UrlValidatorDirective,
|
|
486
|
+
CustomValidatorDirective], exports: [
|
|
487
|
+
// ErrorDirective,
|
|
488
|
+
// FirstErrorDirective,
|
|
489
|
+
NumberDirective,
|
|
490
|
+
// Validators
|
|
491
|
+
MinValidatorDirective,
|
|
492
|
+
MaxValidatorDirective,
|
|
493
|
+
EqualWithValidatorDirective,
|
|
494
|
+
UrlValidatorDirective,
|
|
495
|
+
CustomValidatorDirective] });
|
|
496
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormModule });
|
|
497
|
+
}
|
|
498
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: FormModule, decorators: [{
|
|
499
|
+
type: NgModule,
|
|
500
|
+
args: [{
|
|
501
|
+
imports: items,
|
|
502
|
+
exports: items,
|
|
503
|
+
}]
|
|
504
|
+
}] });
|
|
505
|
+
|
|
506
|
+
// export * from './validation/error.directive';
|
|
507
|
+
// export * from './validation/first-error.directive';
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Generated bundle index. Do not edit.
|
|
511
|
+
*/
|
|
512
|
+
|
|
513
|
+
export { CustomValidatorDirective, EqualWithValidatorDirective, FocusDirective, FormModule, MaxValidatorDirective, MinValidatorDirective, NumberDirective, UrlValidatorDirective, equalWithValidator };
|
|
514
|
+
//# sourceMappingURL=bootkit-ng0-form.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootkit-ng0-form.mjs","sources":["../../../projects/ng0/form/focus.directive.ts","../../../projects/ng0/form/number.directive.ts","../../../projects/ng0/form/validation/validators/equal-with/equal-with-validator.ts","../../../projects/ng0/form/validation/validators/equal-with/equal-with.directive.ts","../../../projects/ng0/form/validation/validators/url/url-validator.ts","../../../projects/ng0/form/validation/validators/url/url-validator.directive.ts","../../../projects/ng0/form/validation/validators/custom/custom-validator.directive.ts","../../../projects/ng0/form/validation/validators/min/min-validator.directive.ts","../../../projects/ng0/form/validation/validators/max/max-validator.directive.ts","../../../projects/ng0/form/form.module.ts","../../../projects/ng0/form/public-api.ts","../../../projects/ng0/form/bootkit-ng0-form.ts"],"sourcesContent":["import { Directive, ElementRef, Input, OnChanges, SimpleChanges, OnInit } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[ng0Focus]',\r\n exportAs: 'ng0Focus',\r\n standalone: true\r\n})\r\nexport class FocusDirective implements OnInit, OnChanges {\r\n /** \r\n * \r\n */\r\n @Input() focusOnLoad = true;\r\n @Input() focusWhen?: boolean;\r\n private focused = false;\r\n\r\n constructor(private elementRef: ElementRef) {\r\n }\r\n\r\n ngOnInit(): void {\r\n if (this.focusOnLoad) {\r\n setTimeout(() => {\r\n this.elementRef.nativeElement.focus();\r\n });\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['focusWhen']) {\r\n if (this.focusWhen) {\r\n setTimeout(() => {\r\n this.elementRef.nativeElement.focus();\r\n });\r\n }\r\n }\r\n }\r\n}\r\n","import { Directive, HostListener, forwardRef, ElementRef, Renderer2, input, booleanAttribute, numberAttribute, inject } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { formatNumber } from '@angular/common';\r\n\r\nconst addThousandsSeparator = (str: string) => str.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\nconst isValidNumber = (str: string) => str.trim() !== '' && !isNaN(Number(str));\r\nconst removeChar = (str: string, charToRemove: string) => str.split(charToRemove).join('');\r\n\r\nconst Keys = {\r\n backspace: 'Backspace',\r\n tab: 'Tab',\r\n arrowLeft: 'ArrowLeft',\r\n arrowRight: 'ArrowRight',\r\n delete: 'Delete',\r\n home: 'Home',\r\n end: 'End'\r\n}\r\n\r\ninterface InputElementState {\r\n selectionStart: number;\r\n selectionEnd: number;\r\n isCursorInsideIntegerPart: boolean;\r\n decimalSeparatorPosition: number;\r\n}\r\n\r\n/**\r\n * Directive to allow only number input in text fields.\r\n * It supports integer and decimal numbers, negative numbers, min/max values, thousands separator.\r\n */\r\n@Directive({\r\n selector: '[ng0Number]',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => NumberDirective),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class NumberDirective implements ControlValueAccessor {\r\n private _value?: number;\r\n private _isDisabled?: boolean;\r\n private _decimalSeparator!: string;\r\n private _thousandsSeparator: string = ',';\r\n private _onChangeCallback?: (v: any) => {};\r\n private _onTouchedCallback?: () => {};\r\n private _elmRef = inject(ElementRef<HTMLInputElement>);\r\n private _renderer = inject(Renderer2);\r\n\r\n /**\r\n * The minimum number of digits to display after the decimal point.\r\n * Applied only when 'numberType' is set to 'decimal'.\r\n * @default 1\r\n */\r\n public minFractionDigits = input(1, { transform: numberAttribute });\r\n\r\n /**\r\n * The maximum number of digits to display after the decimal point.\r\n * Applied only when 'numberType' is set to 'decimal'.\r\n * @default 2\r\n */\r\n public maxFractionDigits = input(2, { transform: numberAttribute });\r\n\r\n /**\r\n * Whether to use grouping separators, such as thousands separators\r\n * @default false\r\n */\r\n public useGrouping = input(false, { transform: booleanAttribute });\r\n\r\n /**\r\n * Type of numbers to allow\r\n * 'decimal' - allow decimal numbers\r\n * 'integer' - allow integer numbers only\r\n * @default 'integer'\r\n */\r\n public numberType = input<'integer' | 'decimal'>('integer');\r\n\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n // Use Intl.NumberFormat to find decimal separator for locale\r\n const formatted = formatNumber(1.1, 'en', '1.1-1');\r\n this._decimalSeparator = formatted.replace(/\\d/g, '') || '.';\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this._onChangeCallback = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this._onTouchedCallback = fn;\r\n }\r\n\r\n setDisabledState?(isDisabled: boolean): void {\r\n this._isDisabled = isDisabled;\r\n this._renderer.setProperty(this._elmRef.nativeElement, 'disabled', isDisabled);\r\n }\r\n\r\n writeValue(value: any): void {\r\n var inputValue: string;\r\n\r\n if (value === undefined || value === null) {\r\n inputValue = '';\r\n this._value = undefined;\r\n } else if (typeof value === 'number') {\r\n inputValue = this._formatNumber(value);\r\n this._value = value;\r\n }\r\n else if (typeof value === 'string') {\r\n const parsedValue = this._value = Number.parseFloat(value);\r\n inputValue = this._formatNumber(parsedValue);\r\n } else {\r\n console.error('NumberDirective: Unsupported value type', value);\r\n inputValue = 'Invalid';\r\n }\r\n\r\n this._setProperty('value', inputValue);\r\n }\r\n\r\n @HostListener('keydown', ['$event'])\r\n private _onKeyDown(event: KeyboardEvent) {\r\n const key = event.key;\r\n const state = this._getInputState();\r\n\r\n if (this._isKeyAllowed(key)) {\r\n if (key == Keys.backspace) {\r\n if (state.selectionStart > 1 && (state.selectionStart === state.selectionEnd)) {\r\n let value = this._elmRef.nativeElement.value;\r\n let beforeSelection = value.charAt(state.selectionStart - 1);\r\n if (beforeSelection === ',') {\r\n // If the character before the cursor is a comma, we need to skip it\r\n this._setProperty('selectionStart', state.selectionStart - 2);\r\n }\r\n }\r\n }\r\n } else {\r\n event.preventDefault();\r\n }\r\n }\r\n\r\n @HostListener('input', ['$event.target.value'])\r\n private _onInput(value: string) {\r\n if (value === '') {\r\n this._value = undefined;\r\n this._onChangeCallback?.(undefined);\r\n return;\r\n }\r\n\r\n const state = this._getInputState();\r\n if (state.isCursorInsideIntegerPart && this.useGrouping()) {\r\n this._formatIntegerPart(value);\r\n }\r\n\r\n var number = Number(removeChar(this._elmRef.nativeElement.value, this._thousandsSeparator));\r\n this._value = isNaN(number) ? undefined : number;\r\n this._onChangeCallback?.(this._value);\r\n }\r\n\r\n private _formatIntegerPart(value: string) {\r\n let state = this._getInputState();\r\n\r\n // Format the input value\r\n const integerPart = value.split(this._decimalSeparator)[0];\r\n const decimalPart = value.split(this._decimalSeparator)[1];\r\n\r\n if (integerPart.length <= 3) {\r\n return;\r\n }\r\n\r\n let normalizedIntegerPart = removeChar(integerPart, this._thousandsSeparator); // Remove commas\r\n\r\n let formattedValue = addThousandsSeparator(normalizedIntegerPart);\r\n if (decimalPart !== undefined) {\r\n formattedValue += this._decimalSeparator + decimalPart;\r\n }\r\n\r\n this._setProperty('value', formattedValue);\r\n let newSelectionStart: number;\r\n\r\n\r\n // fix the cursor position after formatting\r\n if (value.length == 1) {\r\n newSelectionStart = 1;\r\n } else {\r\n const newValueLength = formattedValue.length;\r\n const cursorJump = newValueLength - value.length;\r\n newSelectionStart = Math.max(0, state.selectionStart + cursorJump);\r\n }\r\n\r\n this._setProperty('selectionStart', newSelectionStart);\r\n this._setProperty('selectionEnd', newSelectionStart);\r\n\r\n // return formattedValue;\r\n }\r\n\r\n @HostListener('blur')\r\n private _onBlur() {\r\n if (this._value !== undefined) {\r\n let formattedValue = this._formatNumber(this._value);\r\n this._setProperty('value', formattedValue);\r\n }\r\n\r\n this._onTouchedCallback?.();\r\n }\r\n\r\n @HostListener('paste', ['$event'])\r\n private _onPaste(event: ClipboardEvent) {\r\n // event.\r\n // value = value.trim();\r\n }\r\n\r\n private _getInputState(): InputElementState {\r\n let value = this._elmRef.nativeElement.value;\r\n let decimalSeparatorPosition = value.indexOf(this._decimalSeparator);\r\n let selectionStart = this._elmRef.nativeElement.selectionStart || 0;\r\n let selectionEnd = this._elmRef.nativeElement.selectionEnd || 0;\r\n\r\n return {\r\n selectionStart,\r\n selectionEnd,\r\n decimalSeparatorPosition,\r\n isCursorInsideIntegerPart: decimalSeparatorPosition > -1 ? (selectionStart <= decimalSeparatorPosition) : true\r\n }\r\n }\r\n\r\n private _formatNumber(n: number): string {\r\n var isInteger = this.numberType() == 'integer';\r\n return new Intl.NumberFormat('en-US', {\r\n useGrouping: this.useGrouping(),\r\n minimumFractionDigits: isInteger ? 0 : this.minFractionDigits(),\r\n maximumFractionDigits: isInteger ? 0 : this.maxFractionDigits(),\r\n style: 'decimal',\r\n }).format(n);\r\n }\r\n\r\n private _isKeyAllowed(key: string) {\r\n const allowedKeys = [Keys.backspace, Keys.tab, Keys.arrowLeft, Keys.arrowRight, Keys.delete, Keys.home, Keys.end];\r\n const input = this._elmRef.nativeElement;\r\n const value = input.value;\r\n const state = this._getInputState();\r\n\r\n if (allowedKeys.includes(key)) {\r\n return true; // allow control/navigation keys\r\n }\r\n\r\n // Allow one leading minus\r\n if (key === '-') {\r\n return (input.selectionStart === 0 || input.selectionEnd === 0) && value.charAt(0) !== '-';\r\n }\r\n\r\n // Allow one dot for decimal\r\n if (key === this._decimalSeparator) {\r\n return (this.numberType() == 'decimal') &&\r\n (!value.includes(this._decimalSeparator)) &&\r\n (state.selectionStart == input.value.length);\r\n }\r\n\r\n // Allow numbers only\r\n if (/^\\d$/.test(key)) {\r\n if (state.isCursorInsideIntegerPart) {\r\n return true;\r\n } else {\r\n var decimalPart = value.split(this._decimalSeparator)[1];\r\n var maxFractionDigits = this.maxFractionDigits();\r\n if (maxFractionDigits != undefined && decimalPart.length < maxFractionDigits) {\r\n return true;\r\n } else {\r\n return input.selectionStart !== input.selectionEnd; // allow a new digit if a substring is selected\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _setProperty(prop: string, value: any) {\r\n this._renderer.setProperty(this._elmRef.nativeElement, prop, value);\r\n };\r\n}\r\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\r\n\r\nexport function equalWithValidator(targetValue?: string, inequalityMessage?: string): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n const isValid = control.value === targetValue;\r\n\r\n return isValid ? null :\r\n {\r\n equalWith: {\r\n value: control.value,\r\n message: inequalityMessage\r\n }\r\n };\r\n };\r\n}\r\n","import { Directive, Input } from '@angular/core';\r\nimport { AbstractControl, NG_VALIDATORS, Validator } from '@angular/forms';\r\nimport { equalWithValidator } from './equal-with-validator';\r\n\r\n@Directive({\r\n selector: '[ng0EqualWith]',\r\n exportAs: 'ng0EqualWith',\r\n standalone: true,\r\n providers: [\r\n { provide: NG_VALIDATORS, useExisting: EqualWithValidatorDirective, multi: true }\r\n ]\r\n})\r\nexport class EqualWithValidatorDirective implements Validator {\r\n @Input('ng0EqualWith') targetValue?: string;\r\n @Input() inequalityMessage?: string;\r\n\r\n constructor() {\r\n }\r\n\r\n validate(control: AbstractControl): { [key: string]: any } | null {\r\n return equalWithValidator(this.targetValue, this.inequalityMessage)(control);\r\n }\r\n}\r\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\r\nconst urlRegEx = new RegExp('(https?://)?([\\\\da-z.-]+)\\\\.([a-z.]{2,6})[/\\\\w .-]*/?');\r\n\r\nexport function urlValidator(): ValidatorFn {\r\n return (control: AbstractControl): { [key: string]: any } | null => {\r\n const value = (control.value as string);\r\n if (!value || urlRegEx.test(value)) {\r\n return null;\r\n } else {\r\n return {\r\n 'url': {\r\n value\r\n }\r\n };\r\n }\r\n };\r\n}","import { Directive, Input } from '@angular/core';\r\nimport { FormControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\r\nimport { urlValidator } from './url-validator';\r\n\r\n@Directive({\r\n selector: 'input[ng0Url]',\r\n exportAs: 'ng0Url',\r\n standalone: true,\r\n providers: [{ provide: NG_VALIDATORS, useExisting: UrlValidatorDirective, multi: true }]\r\n})\r\nexport class UrlValidatorDirective implements Validator {\r\n /** Directive is enabled or disabled */\r\n @Input() iscUrl?: boolean | string = true;\r\n\r\n validate(control: FormControl): ValidationErrors | null {\r\n return urlValidator()(control);\r\n }\r\n}\r\n","import { Directive, input, Input } from '@angular/core';\r\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\r\n\r\n@Directive({\r\n selector: '[ng0CustomValidator]',\r\n exportAs: 'ng0CustomValidator',\r\n standalone: true,\r\n providers: [\r\n { provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true }\r\n ]\r\n})\r\nexport class CustomValidatorDirective implements Validator {\r\n validator = input.required<(value: any) => ValidationErrors | null>({alias: 'ng0CustomValidator'});\r\n\r\n constructor() { }\r\n\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n return this.validator()(control);\r\n }\r\n}\r\n","import { Directive, input, numberAttribute } from '@angular/core';\r\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, Validators } from '@angular/forms';\r\n\r\n/** Min validator */\r\n@Directive({\r\n selector: 'input[type=text][ng0Number][min]',\r\n exportAs: 'ng0Min',\r\n standalone: true,\r\n providers: [{\r\n provide: NG_VALIDATORS,\r\n useExisting: MinValidatorDirective,\r\n multi: true\r\n }]\r\n})\r\nexport class MinValidatorDirective implements Validator {\r\n min = input.required<number, number | string | undefined | null>({\r\n transform: numberAttribute,\r\n });\r\n\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n return Validators.min(this.min())(control);\r\n }\r\n}\r\n","import { Directive, input, numberAttribute } from '@angular/core';\r\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, Validators } from '@angular/forms';\r\n\r\n/** Max validator */\r\n@Directive({\r\n selector: 'input[type=text][ng0Number][max]',\r\n exportAs: 'ng0Max',\r\n standalone: true,\r\n providers: [{\r\n provide: NG_VALIDATORS,\r\n useExisting: MaxValidatorDirective,\r\n multi: true\r\n }]\r\n})\r\nexport class MaxValidatorDirective implements Validator {\r\n max = input.required<number, number | string | undefined | null>({\r\n transform: numberAttribute,\r\n });\r\n\r\n validate(control: AbstractControl): ValidationErrors | null {\r\n return Validators.max(this.max())(control);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { EqualWithValidatorDirective } from './validation/validators/equal-with/equal-with.directive';\r\nimport { UrlValidatorDirective } from './validation/validators/url/url-validator.directive';\r\nimport { CustomValidatorDirective } from './validation/validators/custom/custom-validator.directive';\r\nimport { MinValidatorDirective } from './validation/validators/min/min-validator.directive';\r\nimport { MaxValidatorDirective } from './validation/validators/max/max-validator.directive';\r\nimport { NumberDirective } from './number.directive';\r\n\r\nconst items = [\r\n // ErrorDirective,\r\n // FirstErrorDirective,\r\n NumberDirective,\r\n\r\n // Validators\r\n MinValidatorDirective,\r\n MaxValidatorDirective,\r\n EqualWithValidatorDirective,\r\n UrlValidatorDirective,\r\n CustomValidatorDirective,\r\n];\r\n\r\n@NgModule({\r\n imports: items,\r\n exports: items,\r\n})\r\nexport class FormModule { }\r\n","\r\nexport * from './focus.directive';\r\nexport * from './number.directive';\r\nexport * from './form.module';\r\n\r\n// Validation\r\nexport * from './validation/validators/custom/custom-validator.directive';\r\nexport * from './validation/validators/equal-with/equal-with-validator';\r\nexport * from './validation/validators/equal-with/equal-with.directive';\r\nexport * from './validation/validators/url/url-validator.directive';\r\nexport * from './validation/validators/min/min-validator.directive';\r\nexport * from './validation/validators/max/max-validator.directive';\r\n// export * from './validation/error.directive';\r\n// export * from './validation/first-error.directive';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAOa,cAAc,CAAA;AAQL,IAAA,UAAA;AAPpB;;AAEG;IACM,WAAW,GAAG,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