@libs-ui/components-inputs-input 0.2.306 → 0.2.307-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.
- package/defines/index-iframe-area.define.d.ts +1 -1
- package/esm2022/defines/index-iframe-area.define.mjs +5 -3
- package/esm2022/index.mjs +1 -1
- package/esm2022/input.component.mjs +160 -133
- package/esm2022/interfaces/focus-and-blur-event.interface.mjs +1 -1
- package/esm2022/interfaces/function-control-event.interface.mjs +1 -1
- package/esm2022/interfaces/index.mjs +1 -1
- package/esm2022/interfaces/input.interface.mjs +1 -1
- package/fesm2022/libs-ui-components-inputs-input.mjs +163 -134
- package/fesm2022/libs-ui-components-inputs-input.mjs.map +1 -1
- package/input.component.d.ts +1 -0
- package/package.json +6 -6
|
@@ -93,9 +93,11 @@ const indexInputHtml = (customStyle) => `
|
|
|
93
93
|
margin: 0;
|
|
94
94
|
resize: none;
|
|
95
95
|
}
|
|
96
|
-
${customStyle.borderColor
|
|
96
|
+
${customStyle.borderColor
|
|
97
|
+
? `textarea:focus:not(:read-only):not(:disabled) {
|
|
97
98
|
border: 1px solid ${customStyle.borderColor};
|
|
98
|
-
}`
|
|
99
|
+
}`
|
|
100
|
+
: ''}
|
|
99
101
|
|
|
100
102
|
textarea::-webkit-input-placeholder {
|
|
101
103
|
color: rgba(78, 78, 78, 0.5) !important;
|
|
@@ -146,10 +148,10 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
146
148
|
dataTextPaste = signal('');
|
|
147
149
|
onDestroy = new Subject();
|
|
148
150
|
// #region INPUT
|
|
149
|
-
tagInput = input('input', { transform: value => value || 'input' });
|
|
150
|
-
dataType = input('string', { transform: val => val || 'string' });
|
|
151
|
-
typeInput = input('text', { transform: val => val || 'text' });
|
|
152
|
-
modeInput = input('text', { transform: val => val || 'text' });
|
|
151
|
+
tagInput = input('input', { transform: (value) => value || 'input' });
|
|
152
|
+
dataType = input('string', { transform: (val) => val || 'string' });
|
|
153
|
+
typeInput = input('text', { transform: (val) => val || 'text' });
|
|
154
|
+
modeInput = input('text', { transform: (val) => val || 'text' });
|
|
153
155
|
tabInsertContentTagInput = input(false);
|
|
154
156
|
textAreaEnterNotNewLine = input(false);
|
|
155
157
|
emitEmptyInDataTypeNumber = input(false);
|
|
@@ -176,8 +178,8 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
176
178
|
defaultHeight = input(32, { transform: (value) => value || 32 });
|
|
177
179
|
minHeightTextArea = input();
|
|
178
180
|
maxHeightTextArea = input(this.DEFAULT_MAX_HEIGHT_TEXT_AREA, { transform: (value) => value || this.DEFAULT_MAX_HEIGHT_TEXT_AREA });
|
|
179
|
-
focusTimeOut = input(600, { transform: value => value ?? 600 });
|
|
180
|
-
selectAllTimeOut = input(600, { transform: value => value ?? 600 });
|
|
181
|
+
focusTimeOut = input(600, { transform: (value) => value ?? 600 });
|
|
182
|
+
selectAllTimeOut = input(600, { transform: (value) => value ?? 600 });
|
|
181
183
|
blurTimeOut = input(32, { transform: (value) => value || 32 });
|
|
182
184
|
zIndexPopoverContent = input(10, { transform: (value) => value || 10 });
|
|
183
185
|
classContainerInput = input('w-full', { transform: (value) => value || 'w-full' });
|
|
@@ -193,7 +195,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
193
195
|
popoverContentIconLeft = input('', { transform: (value) => value || '' });
|
|
194
196
|
iconRightClass = input();
|
|
195
197
|
popoverContentIconRight = input('', { transform: (value) => value || '' });
|
|
196
|
-
resetAutoCompletePassword = input(false, { transform: value => value ?? false });
|
|
198
|
+
resetAutoCompletePassword = input(false, { transform: (value) => value ?? false });
|
|
197
199
|
acceptOnlyClickIcon = input(false);
|
|
198
200
|
setIconRightColorSameColorDisableReadOnly = input(false);
|
|
199
201
|
onlyAcceptNegativeValue = input(false);
|
|
@@ -256,15 +258,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
256
258
|
return;
|
|
257
259
|
}
|
|
258
260
|
this.outHeightAreaChange.emit({ isChange: false, height: this.Element?.scrollHeight });
|
|
259
|
-
this.outFunctionsControl.emit(
|
|
260
|
-
focus: this.focus.bind(this),
|
|
261
|
-
blur: this.blur.bind(this),
|
|
262
|
-
insertContent: this.addDataToSelectionInput.bind(this),
|
|
263
|
-
resetValue: this.resetValue.bind(this),
|
|
264
|
-
getElementValue: this.getElementValue.bind(this),
|
|
265
|
-
checkAndDisableUpDownButton: this.checkAndDisableUpDownButton.bind(this),
|
|
266
|
-
selectAllContent: this.selectAllContent.bind(this)
|
|
267
|
-
});
|
|
261
|
+
this.outFunctionsControl.emit(this.FunctionsControl);
|
|
268
262
|
this.init();
|
|
269
263
|
this.initEvent('focus', this.ignoreStopPropagationEvent()).subscribe((e) => this.outFocusAndBlurEvent.emit({ name: 'focus', event: e }));
|
|
270
264
|
this.initEvent('blur', this.ignoreStopPropagationEvent()).subscribe((e) => this.outFocusAndBlurEvent.emit({ name: 'blur', event: e }));
|
|
@@ -275,50 +269,71 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
275
269
|
const pasteEvent = this.initEvent('paste', this.ignoreStopPropagationEvent());
|
|
276
270
|
const keyupEvent = this.initEvent('keyup', this.ignoreStopPropagationEvent());
|
|
277
271
|
this.initEvent('click', this.ignoreStopPropagationEvent() ?? true).subscribe();
|
|
278
|
-
this.initEvent('dragover', this.ignoreStopPropagationEvent())
|
|
272
|
+
this.initEvent('dragover', this.ignoreStopPropagationEvent())
|
|
273
|
+
.pipe(tap((event) => {
|
|
279
274
|
event.preventDefault();
|
|
280
275
|
event.stopPropagation();
|
|
281
276
|
if (event.dataTransfer) {
|
|
282
277
|
event.dataTransfer.dropEffect = 'copy';
|
|
283
278
|
}
|
|
284
|
-
}))
|
|
279
|
+
}))
|
|
280
|
+
.subscribe();
|
|
285
281
|
this.initEvent('drop', this.ignoreStopPropagationEvent()).subscribe(this.checkAndEmitFiles.bind(this));
|
|
286
282
|
pasteEvent.subscribe(this.checkAndEmitFiles.bind(this));
|
|
287
283
|
this.combineObservable(mouseDownEvent, pasteEvent);
|
|
288
284
|
this.combineObservable(mouseDownEvent, cutEvent);
|
|
289
|
-
keyDownEvent
|
|
285
|
+
keyDownEvent
|
|
286
|
+
.pipe(take(1), tap((e) => this.checkTypeNumber(e, 'key')), mergeMap(() => inputEvent), tap((e) => this.checkTypeNumber(e, 'data')))
|
|
287
|
+
.subscribe((e) => {
|
|
290
288
|
if (this.dataType() === 'string' && this.maxLength() && (e.inputType === 'insertCompositionText' || e.inputType === 'insertText') && e.target.value?.length > (this.maxLength() || 0)) {
|
|
291
289
|
e.target.value = e.target.value.slice(0, this.maxLength());
|
|
292
290
|
}
|
|
293
291
|
this.processEventAndEmitValue(e);
|
|
294
292
|
});
|
|
295
|
-
keyupEvent
|
|
293
|
+
keyupEvent
|
|
294
|
+
.pipe(filter((event) => event.keyCode === UtilsKeyCodeConstant.ENTER), filter((event) => !this.textAreaEnterNotNewLine() || (this.textAreaEnterNotNewLine() && !event.shiftKey)))
|
|
295
|
+
.subscribe((event) => this.outEnterEvent.emit(event));
|
|
296
296
|
if (this.dataType() === 'string' && (this.tagInput() !== 'input' || (this.tagInput() === 'input' && this.tabInsertContentTagInput()))) {
|
|
297
|
-
keyDownEvent
|
|
297
|
+
keyDownEvent
|
|
298
|
+
.pipe(filter((event) => event.keyCode === UtilsKeyCodeConstant.TAB), tap((event) => event.preventDefault()), filter((event) => !event.target.value || !this.maxLength() || event.target.value.length < (this.maxLength() || 25)), tap((event) => {
|
|
298
299
|
if (this.readonly() || this.disable()) {
|
|
299
300
|
return;
|
|
300
301
|
}
|
|
301
302
|
this.insetValueToSelectionStart('\t', event);
|
|
302
|
-
}))
|
|
303
|
+
}))
|
|
304
|
+
.subscribe();
|
|
303
305
|
}
|
|
304
306
|
if (this.textAreaEnterNotNewLine()) {
|
|
305
|
-
keyDownEvent
|
|
307
|
+
keyDownEvent
|
|
308
|
+
.pipe(filter((event) => event.keyCode === UtilsKeyCodeConstant.ENTER && !event.shiftKey), tap((e) => e.preventDefault()))
|
|
309
|
+
.subscribe();
|
|
306
310
|
}
|
|
307
311
|
this.countDisplayComputed();
|
|
308
312
|
}
|
|
309
313
|
// #region FUNCTIONS
|
|
314
|
+
get FunctionsControl() {
|
|
315
|
+
return {
|
|
316
|
+
focus: this.focus.bind(this),
|
|
317
|
+
blur: this.blur.bind(this),
|
|
318
|
+
insertContent: this.addDataToSelectionInput.bind(this),
|
|
319
|
+
resetValue: this.resetValue.bind(this),
|
|
320
|
+
getElementValue: this.getElementValue.bind(this),
|
|
321
|
+
checkAndDisableUpDownButton: this.checkAndDisableUpDownButton.bind(this),
|
|
322
|
+
selectAllContent: this.selectAllContent.bind(this),
|
|
323
|
+
};
|
|
324
|
+
}
|
|
310
325
|
updateMaxLengthMinMaxValueByDataType() {
|
|
311
326
|
if (this.dataType() === 'int' || this.dataType() === 'float') {
|
|
312
|
-
this.maxLength.update(value => {
|
|
327
|
+
this.maxLength.update((value) => {
|
|
313
328
|
return !value || value > 21 ? 21 : value;
|
|
314
329
|
});
|
|
315
|
-
this.minValueNumber.update(value => value ?? Number.MIN_SAFE_INTEGER);
|
|
316
|
-
this.maxValueNumber.update(value => value ?? Number.MAX_SAFE_INTEGER);
|
|
330
|
+
this.minValueNumber.update((value) => value ?? Number.MIN_SAFE_INTEGER);
|
|
331
|
+
this.maxValueNumber.update((value) => value ?? Number.MAX_SAFE_INTEGER);
|
|
317
332
|
}
|
|
318
333
|
if (this.dataType() === 'bigint') {
|
|
319
|
-
this.maxLength.update(value => !value || value > 25 ? 25 : value);
|
|
320
|
-
this.fixedFloat.update(value => value ?? 4);
|
|
321
|
-
this.maxLengthNumberCount.update(value => value ?? 19);
|
|
334
|
+
this.maxLength.update((value) => (!value || value > 25 ? 25 : value));
|
|
335
|
+
this.fixedFloat.update((value) => value ?? 4);
|
|
336
|
+
this.maxLengthNumberCount.update((value) => value ?? 19);
|
|
322
337
|
}
|
|
323
338
|
}
|
|
324
339
|
async getElementValue() {
|
|
@@ -396,8 +411,8 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
396
411
|
}
|
|
397
412
|
this.disableAsc.set(false);
|
|
398
413
|
this.disableDesc.set(false);
|
|
399
|
-
this.minValueNumber.update(value => value ?? Number.MIN_SAFE_INTEGER);
|
|
400
|
-
this.maxValueNumber.update(value => value ?? Number.MAX_SAFE_INTEGER);
|
|
414
|
+
this.minValueNumber.update((value) => value ?? Number.MIN_SAFE_INTEGER);
|
|
415
|
+
this.maxValueNumber.update((value) => value ?? Number.MAX_SAFE_INTEGER);
|
|
401
416
|
value = value ?? 0;
|
|
402
417
|
if (!isNil(this.maxValueNumber()) && value >= (this.maxValueNumber() ?? Number.MAX_SAFE_INTEGER)) {
|
|
403
418
|
this.disableAsc.set(true);
|
|
@@ -416,19 +431,23 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
416
431
|
}
|
|
417
432
|
convertValue(value) {
|
|
418
433
|
if (value && this.dataType() === 'bigint') {
|
|
419
|
-
const separator =
|
|
434
|
+
const separator = UtilsCache.getLang() === UtilsLanguageConstants.VI ? '.' : ',';
|
|
420
435
|
let [int, decimal] = value.split(separator);
|
|
421
436
|
const decimalSplit = decimal ? decimal.split('') : [];
|
|
422
|
-
const decimalEveryZero = decimalSplit.every(item => item === '0');
|
|
437
|
+
const decimalEveryZero = decimalSplit.every((item) => item === '0');
|
|
423
438
|
if (int === '-0' && (!decimal || decimalEveryZero)) {
|
|
424
439
|
int = '0';
|
|
425
440
|
}
|
|
426
441
|
if (!decimal || decimalEveryZero) {
|
|
427
442
|
decimal = '0';
|
|
428
443
|
}
|
|
429
|
-
if (decimalSplit.some(item => item !== '0')) {
|
|
444
|
+
if (decimalSplit.some((item) => item !== '0')) {
|
|
430
445
|
const decimalReverse = decimalSplit.reverse().join('');
|
|
431
|
-
decimal = decimalReverse
|
|
446
|
+
decimal = decimalReverse
|
|
447
|
+
.replace(/(^[0]+)/, '')
|
|
448
|
+
.split('')
|
|
449
|
+
.reverse()
|
|
450
|
+
.join('');
|
|
432
451
|
}
|
|
433
452
|
return `${int}${separator}${decimal}`;
|
|
434
453
|
}
|
|
@@ -443,20 +462,27 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
443
462
|
}
|
|
444
463
|
let elementValue = this.convertValue(`${this.value() ?? ''}`);
|
|
445
464
|
if (this.dataType() !== 'string') {
|
|
446
|
-
elementValue = elementValue.replace(
|
|
465
|
+
elementValue = elementValue.replace(new RegExp(`[^0-9.,${this.acceptNegativeValue() ? '-' : ''}]`, 'g'), '');
|
|
447
466
|
if (UtilsCache.getLang() === UtilsLanguageConstants.EN) {
|
|
448
467
|
elementValue = elementValue.replace(/[,]/, '');
|
|
449
468
|
}
|
|
450
469
|
}
|
|
451
470
|
this.Element.value = elementValue;
|
|
452
|
-
const eventFake = {
|
|
471
|
+
const eventFake = {
|
|
472
|
+
preventDefault: () => {
|
|
473
|
+
return;
|
|
474
|
+
},
|
|
475
|
+
target: this.Element,
|
|
476
|
+
data: elementValue,
|
|
477
|
+
fakeEvent: true,
|
|
478
|
+
};
|
|
453
479
|
this.checkTypeNumber(eventFake, 'data');
|
|
454
480
|
this.processEventAndEmitValue(eventFake);
|
|
455
481
|
}
|
|
456
482
|
processEventAndEmitValue(e) {
|
|
457
483
|
const value = this.parseValueByDataType(e.target.value);
|
|
458
484
|
if (this.dataType() !== 'string' && !this.ignoreBlockInputMaxValue() && !isNil(this.maxValueNumber()) && value > (this.maxValueNumber() || 0) && this.value() < value) {
|
|
459
|
-
const valueDisplay = viewDataNumberByLanguage(`${this.value()}`.replace(/[.]/g, ','), this.acceptNegativeValue(),
|
|
485
|
+
const valueDisplay = viewDataNumberByLanguage(`${this.value()}`.replace(/[.]/g, ','), this.acceptNegativeValue(), this.fixedFloat() ?? 14);
|
|
460
486
|
e.target.value = `${this.getCheckZero(+valueDisplay, e.target.value)}${valueDisplay}`;
|
|
461
487
|
return this.processEventAndEmitValue(e);
|
|
462
488
|
}
|
|
@@ -487,18 +513,18 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
487
513
|
const valueCompare = formatNumber(valueDisplay).toString();
|
|
488
514
|
const numbers = valueCompare.split('.');
|
|
489
515
|
let lengthValueCompare = 0;
|
|
490
|
-
let maxLength =
|
|
516
|
+
let maxLength = this.acceptNegativeValue() && typeof +this.value() === 'number' && +this.value() < 0 ? (this.maxLength() || 21) + 1 : this.maxLength() || 21;
|
|
491
517
|
if (this.dataType() === 'float') {
|
|
492
518
|
maxLength--;
|
|
493
519
|
}
|
|
494
520
|
if (numbers && numbers[0]) {
|
|
495
|
-
lengthValueCompare = viewDataNumberByLanguage(`${numbers[0]}`.replace(/[.]/g, ','), this.acceptNegativeValue(),
|
|
521
|
+
lengthValueCompare = viewDataNumberByLanguage(`${numbers[0]}`.replace(/[.]/g, ','), this.acceptNegativeValue(), this.fixedFloat() ?? 14).length;
|
|
496
522
|
}
|
|
497
523
|
if (numbers && numbers[1]) {
|
|
498
524
|
lengthValueCompare += 1 + numbers[1].length;
|
|
499
525
|
}
|
|
500
526
|
if (maxLength && lengthValueCompare >= maxLength) {
|
|
501
|
-
const valueDisplay = viewDataNumberByLanguage((lengthValueCompare === maxLength ? valueCompare : `${this.value()}`).replace(/[.]/g, ','), this.acceptNegativeValue(),
|
|
527
|
+
const valueDisplay = viewDataNumberByLanguage((lengthValueCompare === maxLength ? valueCompare : `${this.value()}`).replace(/[.]/g, ','), this.acceptNegativeValue(), this.fixedFloat() ?? 14);
|
|
502
528
|
e.target.value = `${this.getCheckZero(+valueDisplay, e.target.value)}${valueDisplay}`;
|
|
503
529
|
return true;
|
|
504
530
|
}
|
|
@@ -506,8 +532,8 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
506
532
|
}
|
|
507
533
|
checkTypeNumber(e, fieldName) {
|
|
508
534
|
const currentLang = UtilsCache.getLang();
|
|
509
|
-
const separator =
|
|
510
|
-
const separatorRevert =
|
|
535
|
+
const separator = currentLang === UtilsLanguageConstants.VI ? '.' : ',';
|
|
536
|
+
const separatorRevert = currentLang === UtilsLanguageConstants.VI ? ',' : '.';
|
|
511
537
|
let valueTarget = e.target.value;
|
|
512
538
|
const selectionStart = e.target.selectionStart - 1;
|
|
513
539
|
const { data, keyCode } = e;
|
|
@@ -525,47 +551,46 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
525
551
|
valueTarget = valueTarget.replaceAt(0, '');
|
|
526
552
|
}
|
|
527
553
|
let strRegex = `[^0-9.,${this.acceptNegativeValue() ? '-' : ''}]`;
|
|
528
|
-
if (
|
|
554
|
+
if (new RegExp(strRegex, 'gi').test(e[fieldName]) && keyCode !== UtilsKeyCodeConstant.BACKSPACE) {
|
|
529
555
|
e.preventDefault();
|
|
530
|
-
e.target.value = valueTarget = e.target.value.replace(
|
|
556
|
+
e.target.value = valueTarget = e.target.value.replace(new RegExp(strRegex, 'gi'), '');
|
|
531
557
|
}
|
|
532
558
|
if (!e.fakeEvent) {
|
|
533
559
|
switch (data) {
|
|
534
560
|
case separator:
|
|
535
|
-
valueTarget = valueTarget.replace(
|
|
561
|
+
valueTarget = valueTarget.replace(new RegExp(`[${separator}]`, 'gi'), '');
|
|
536
562
|
break;
|
|
537
|
-
case separatorRevert:
|
|
538
|
-
{
|
|
539
|
-
|
|
540
|
-
e.target.value = valueTarget.replace((new RegExp(`[${separatorRevert}]`, 'gi')), '');
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
if (valueTarget === separatorRevert) {
|
|
544
|
-
e.target.value = '';
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
if (valueTarget && valueTarget.length === 2 && valueTarget.charAt(0) === '-' && data && !/[0-9]/g.test(data)) {
|
|
548
|
-
e.target.value = '-';
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
const occurrencesByCharacter = valueTarget.occurrencesByCharacter(separatorRevert);
|
|
552
|
-
if (occurrencesByCharacter > 1) {
|
|
553
|
-
valueTarget = valueTarget.replaceAt(e.target.selectionStart - 1, '');
|
|
554
|
-
break;
|
|
555
|
-
}
|
|
556
|
-
let maxLength = this.dataType() === 'float' ? (this.maxLength() || 21) - 1 : (this.maxLength() || 21);
|
|
557
|
-
if (valueTarget.indexOf('-') >= 0) {
|
|
558
|
-
maxLength++;
|
|
559
|
-
}
|
|
560
|
-
if (occurrencesByCharacter === 1 && valueTarget.length === maxLength && valueTarget.indexOf(separatorRevert) === valueTarget.length - 1) {
|
|
561
|
-
valueTarget = valueTarget.replaceAt(e.target.selectionStart - 1, '');
|
|
562
|
-
break;
|
|
563
|
-
}
|
|
564
|
-
if (this.onlyAcceptNegativeValue() && valueTarget === `0${separatorRevert}`) {
|
|
565
|
-
e.target.value = '0';
|
|
566
|
-
}
|
|
563
|
+
case separatorRevert: {
|
|
564
|
+
if (currentLang === UtilsLanguageConstants.VI && this.dataType() === 'int') {
|
|
565
|
+
e.target.value = valueTarget.replace(new RegExp(`[${separatorRevert}]`, 'gi'), '');
|
|
567
566
|
return;
|
|
568
567
|
}
|
|
568
|
+
if (valueTarget === separatorRevert) {
|
|
569
|
+
e.target.value = '';
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (valueTarget && valueTarget.length === 2 && valueTarget.charAt(0) === '-' && data && !/[0-9]/g.test(data)) {
|
|
573
|
+
e.target.value = '-';
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const occurrencesByCharacter = valueTarget.occurrencesByCharacter(separatorRevert);
|
|
577
|
+
if (occurrencesByCharacter > 1) {
|
|
578
|
+
valueTarget = valueTarget.replaceAt(e.target.selectionStart - 1, '');
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
let maxLength = this.dataType() === 'float' ? (this.maxLength() || 21) - 1 : this.maxLength() || 21;
|
|
582
|
+
if (valueTarget.indexOf('-') >= 0) {
|
|
583
|
+
maxLength++;
|
|
584
|
+
}
|
|
585
|
+
if (occurrencesByCharacter === 1 && valueTarget.length === maxLength && valueTarget.indexOf(separatorRevert) === valueTarget.length - 1) {
|
|
586
|
+
valueTarget = valueTarget.replaceAt(e.target.selectionStart - 1, '');
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
if (this.onlyAcceptNegativeValue() && valueTarget === `0${separatorRevert}`) {
|
|
590
|
+
e.target.value = '0';
|
|
591
|
+
}
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
569
594
|
}
|
|
570
595
|
valueTarget = formatNumber(valueTarget);
|
|
571
596
|
}
|
|
@@ -582,54 +607,53 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
582
607
|
return;
|
|
583
608
|
}
|
|
584
609
|
switch (this.dataType()) {
|
|
585
|
-
case 'int':
|
|
586
|
-
{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
valueTarget = valueTarget.slice(0, maxTotalNumber - 1);
|
|
596
|
-
}
|
|
597
|
-
if (this.onlyAcceptNegativeValue() && valueTarget[0] !== '-' && valueTarget[0] !== '0') {
|
|
598
|
-
valueTarget = '';
|
|
599
|
-
}
|
|
600
|
-
if (valueTarget && /(^-)?(^[0]+)/.test(valueTarget)) {
|
|
601
|
-
const id = uuid();
|
|
602
|
-
valueTarget = valueTarget.replace(/(^-)?(^[0]+)/, `$1${id}`).replace(id, '0');
|
|
603
|
-
}
|
|
604
|
-
if (valueTarget === '-0') {
|
|
605
|
-
valueTarget = '0';
|
|
606
|
-
}
|
|
607
|
-
if (valueTarget && /(^[0])([1-9])([0-9]+)?/.test(valueTarget)) {
|
|
608
|
-
valueTarget = valueTarget.replace(/(^[0])([1-9])([0-9]+)?/, '$2$3');
|
|
609
|
-
}
|
|
610
|
-
const valueDisplay = viewDataNumberByLanguage(valueTarget, (this.acceptNegativeValue() || false), 0);
|
|
611
|
-
if (this.checkMaxLengthNumberAndSetValue(valueDisplay, e)) {
|
|
612
|
-
break;
|
|
613
|
-
}
|
|
614
|
-
e.target.value = `${this.getCheckZero(+valueDisplay, e.target.value)}${valueDisplay}`;
|
|
615
|
-
break;
|
|
610
|
+
case 'int': {
|
|
611
|
+
strRegex = `[^0-9${this.acceptNegativeValue() ? '-' : ''}]`;
|
|
612
|
+
if (!e.fakeEvent) {
|
|
613
|
+
valueTarget = valueTarget.replace(new RegExp(strRegex, 'gi'), '');
|
|
614
|
+
const maxTotalNumber = valueTarget.includes('-') ? 17 : 16;
|
|
615
|
+
if (valueTarget.length > maxTotalNumber) {
|
|
616
|
+
valueTarget = valueTarget.slice(0, maxTotalNumber);
|
|
617
|
+
}
|
|
618
|
+
if (Math.abs(parseInt(valueTarget)) > (this.maxValueNumber() ?? 9007199254740991)) {
|
|
619
|
+
valueTarget = valueTarget.slice(0, maxTotalNumber - 1);
|
|
616
620
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
let indexChoose = indexOfDot;
|
|
620
|
-
if (indexOfDot < 0 || indexOfDot > indexOfComma) {
|
|
621
|
-
indexChoose = indexOfComma;
|
|
621
|
+
if (this.onlyAcceptNegativeValue() && valueTarget[0] !== '-' && valueTarget[0] !== '0') {
|
|
622
|
+
valueTarget = '';
|
|
622
623
|
}
|
|
623
|
-
if (
|
|
624
|
-
|
|
624
|
+
if (valueTarget && /(^-)?(^[0]+)/.test(valueTarget)) {
|
|
625
|
+
const id = uuid();
|
|
626
|
+
valueTarget = valueTarget.replace(/(^-)?(^[0]+)/, `$1${id}`).replace(id, '0');
|
|
625
627
|
}
|
|
626
|
-
|
|
628
|
+
if (valueTarget === '-0') {
|
|
629
|
+
valueTarget = '0';
|
|
630
|
+
}
|
|
631
|
+
if (valueTarget && /(^[0])([1-9])([0-9]+)?/.test(valueTarget)) {
|
|
632
|
+
valueTarget = valueTarget.replace(/(^[0])([1-9])([0-9]+)?/, '$2$3');
|
|
633
|
+
}
|
|
634
|
+
const valueDisplay = viewDataNumberByLanguage(valueTarget, this.acceptNegativeValue() || false, 0);
|
|
627
635
|
if (this.checkMaxLengthNumberAndSetValue(valueDisplay, e)) {
|
|
628
636
|
break;
|
|
629
637
|
}
|
|
630
638
|
e.target.value = `${this.getCheckZero(+valueDisplay, e.target.value)}${valueDisplay}`;
|
|
631
639
|
break;
|
|
632
640
|
}
|
|
641
|
+
const indexOfDot = valueTarget.indexOf('.');
|
|
642
|
+
const indexOfComma = valueTarget.indexOf(',');
|
|
643
|
+
let indexChoose = indexOfDot;
|
|
644
|
+
if (indexOfDot < 0 || indexOfDot > indexOfComma) {
|
|
645
|
+
indexChoose = indexOfComma;
|
|
646
|
+
}
|
|
647
|
+
if (indexChoose >= 0) {
|
|
648
|
+
valueTarget = valueTarget.substring(0, indexChoose);
|
|
649
|
+
}
|
|
650
|
+
const valueDisplay = viewDataNumberByLanguage(valueTarget, this.acceptNegativeValue() || false, 0);
|
|
651
|
+
if (this.checkMaxLengthNumberAndSetValue(valueDisplay, e)) {
|
|
652
|
+
break;
|
|
653
|
+
}
|
|
654
|
+
e.target.value = `${this.getCheckZero(+valueDisplay, e.target.value)}${valueDisplay}`;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
633
657
|
case 'float':
|
|
634
658
|
// eslint-disable-next-line no-fallthrough
|
|
635
659
|
case 'bigint':
|
|
@@ -661,7 +685,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
661
685
|
valueTarget = valueTarget.replace(new RegExp(strRegex, 'g'), separatorRevert);
|
|
662
686
|
let valueFormat = '';
|
|
663
687
|
let [fontSeparatorNumber, behindSeparatorNumber] = valueTarget.split(separatorRevert);
|
|
664
|
-
let maxFontTotalNumber =
|
|
688
|
+
let maxFontTotalNumber = fontSeparatorNumber && fontSeparatorNumber.includes('-') ? 16 : 15;
|
|
665
689
|
if (this.dataType() === 'bigint') {
|
|
666
690
|
maxFontTotalNumber = (this.maxLengthNumberCount() ?? 19) - (this.fixedFloat() ?? 4) + (fontSeparatorNumber.includes('-') ? 1 : 0);
|
|
667
691
|
}
|
|
@@ -681,7 +705,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
681
705
|
break;
|
|
682
706
|
case 'bigint':
|
|
683
707
|
if (behindSeparatorNumber && behindSeparatorNumber.length && behindSeparatorNumber.length > (this.fixedFloat() ?? 4)) {
|
|
684
|
-
behindSeparatorNumber = behindSeparatorNumber.slice(0,
|
|
708
|
+
behindSeparatorNumber = behindSeparatorNumber.slice(0, this.fixedFloat() ?? 4);
|
|
685
709
|
}
|
|
686
710
|
break;
|
|
687
711
|
}
|
|
@@ -719,7 +743,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
719
743
|
break;
|
|
720
744
|
}
|
|
721
745
|
if (fontSeparatorNumber) {
|
|
722
|
-
fontSeparatorNumber = viewDataNumberByLanguage(fontSeparatorNumber, this.acceptNegativeValue(),
|
|
746
|
+
fontSeparatorNumber = viewDataNumberByLanguage(fontSeparatorNumber, this.acceptNegativeValue(), this.fixedFloat() ?? (this.dataType() === 'bigint' ? 4 : 14));
|
|
723
747
|
}
|
|
724
748
|
const hasSeparatorRevert = (this.dataType() === 'bigint' ? true : !fontOverMaxTotalNumber) && indexOfSeparatorRevert >= 0;
|
|
725
749
|
valueFormat = `${fontSeparatorNumber ?? ''}${hasSeparatorRevert ? separatorRevert : ''}${behindSeparatorNumber ?? ''}`;
|
|
@@ -752,7 +776,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
752
776
|
}
|
|
753
777
|
const valueTarget = e.target.value.replace('-', '');
|
|
754
778
|
let value = UtilsCache.getLang() === UtilsLanguageConstants.VI ? `${this.value() || 0}`.replace('.', ',') : `${this.value() || 0}`;
|
|
755
|
-
value = viewDataNumberByLanguage(value, this.acceptNegativeValue(),
|
|
779
|
+
value = viewDataNumberByLanguage(value, this.acceptNegativeValue(), this.fixedFloat() ?? 14);
|
|
756
780
|
value = `${value}`.replace('-', '');
|
|
757
781
|
if (value === valueTarget && value !== '0' && value !== '-') {
|
|
758
782
|
setCaretPosition(this.Element, selectionStart);
|
|
@@ -768,16 +792,16 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
768
792
|
}
|
|
769
793
|
selectionStart += factor;
|
|
770
794
|
if (inputType === 'insertFromPaste' && this.dataTextPaste()) {
|
|
771
|
-
const dataTextDisplay = `${viewDataNumberByLanguage(this.dataTextPaste(), this.acceptNegativeValue(),
|
|
795
|
+
const dataTextDisplay = `${viewDataNumberByLanguage(this.dataTextPaste(), this.acceptNegativeValue(), this.fixedFloat() ?? 14)}`;
|
|
772
796
|
const indexes = e.target.value.indexesByString(dataTextDisplay);
|
|
773
797
|
selectionStart -= factor;
|
|
774
|
-
if (indexes.some(index => index === selectionStart) || !indexes.length) {
|
|
798
|
+
if (indexes.some((index) => index === selectionStart) || !indexes.length) {
|
|
775
799
|
return setCaretPosition(this.Element, selectionStart);
|
|
776
800
|
}
|
|
777
801
|
let newSelectionStart = indexes[0];
|
|
778
802
|
for (const index of indexes) {
|
|
779
803
|
let replaceValue = formatNumber(`${valueTarget.substring(0, index)}${valueTarget.substring(index + dataTextDisplay.length + 1, valueTarget.length)}`);
|
|
780
|
-
replaceValue = viewDataNumberByLanguage(replaceValue, this.acceptNegativeValue(),
|
|
804
|
+
replaceValue = viewDataNumberByLanguage(replaceValue, this.acceptNegativeValue(), this.fixedFloat() ?? 14);
|
|
781
805
|
if (value === replaceValue) {
|
|
782
806
|
newSelectionStart = index;
|
|
783
807
|
break;
|
|
@@ -798,7 +822,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
798
822
|
if (this.acceptNegativeValue() && (value === '-' || value === ',' || value === '.')) {
|
|
799
823
|
return 0;
|
|
800
824
|
}
|
|
801
|
-
return +
|
|
825
|
+
return +formatNumber(value);
|
|
802
826
|
case 'float':
|
|
803
827
|
if (this.acceptNegativeValue() && (value === '-' || value === ',' || value === '.')) {
|
|
804
828
|
return 0;
|
|
@@ -833,7 +857,9 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
833
857
|
this.preHeightArea.set(height);
|
|
834
858
|
}
|
|
835
859
|
combineObservable(mouseDownEvent, observableMerge) {
|
|
836
|
-
mouseDownEvent
|
|
860
|
+
mouseDownEvent
|
|
861
|
+
.pipe(mergeMap(() => observableMerge), debounceTime(0), tap((e) => this.checkTypeNumber(e, 'key')))
|
|
862
|
+
.subscribe((e) => this.processEventAndEmitValue(e));
|
|
837
863
|
}
|
|
838
864
|
async focus() {
|
|
839
865
|
setTimeout(() => {
|
|
@@ -853,7 +879,14 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
853
879
|
const afterValue = value.substring(selectionStart);
|
|
854
880
|
this.Element.value = `${beforeValue}${data}${afterValue}`;
|
|
855
881
|
setCaretPosition(this.Element, selectionStart + data.toString().length);
|
|
856
|
-
const eventFake = {
|
|
882
|
+
const eventFake = {
|
|
883
|
+
preventDefault: () => {
|
|
884
|
+
return;
|
|
885
|
+
},
|
|
886
|
+
target: this.Element,
|
|
887
|
+
data: '',
|
|
888
|
+
fakeEvent: true,
|
|
889
|
+
};
|
|
857
890
|
this.processEventAndEmitValue(eventFake);
|
|
858
891
|
}
|
|
859
892
|
handlerOnLoad(e, element) {
|
|
@@ -892,7 +925,7 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
892
925
|
this.paddingRightCustom.set(this.textCountRef()?.nativeElement.clientWidth + 16);
|
|
893
926
|
}
|
|
894
927
|
if (this.tagInput() === 'input') {
|
|
895
|
-
this.paddingRightCustom.update(value => {
|
|
928
|
+
this.paddingRightCustom.update((value) => {
|
|
896
929
|
return value + (this.elementRightRef()?.nativeElement.getBoundingClientRect().width || 0);
|
|
897
930
|
});
|
|
898
931
|
}
|
|
@@ -910,15 +943,11 @@ class LibsUiComponentsInputsInputComponent {
|
|
|
910
943
|
this.onDestroy.complete();
|
|
911
944
|
}
|
|
912
945
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
913
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsInputsInputComponent, isStandalone: true, selector: "libs_ui-components-inputs-input", inputs: { tagInput: { classPropertyName: "tagInput", publicName: "tagInput", isSignal: true, isRequired: false, transformFunction: null }, dataType: { classPropertyName: "dataType", publicName: "dataType", isSignal: true, isRequired: false, transformFunction: null }, typeInput: { classPropertyName: "typeInput", publicName: "typeInput", isSignal: true, isRequired: false, transformFunction: null }, modeInput: { classPropertyName: "modeInput", publicName: "modeInput", isSignal: true, isRequired: false, transformFunction: null }, tabInsertContentTagInput: { classPropertyName: "tabInsertContentTagInput", publicName: "tabInsertContentTagInput", isSignal: true, isRequired: false, transformFunction: null }, textAreaEnterNotNewLine: { classPropertyName: "textAreaEnterNotNewLine", publicName: "textAreaEnterNotNewLine", isSignal: true, isRequired: false, transformFunction: null }, emitEmptyInDataTypeNumber: { classPropertyName: "emitEmptyInDataTypeNumber", publicName: "emitEmptyInDataTypeNumber", isSignal: true, isRequired: false, transformFunction: null }, keepZeroInTypeInt: { classPropertyName: "keepZeroInTypeInt", publicName: "keepZeroInTypeInt", isSignal: true, isRequired: false, transformFunction: null }, autoAddZeroLessThan10InTypeInt: { classPropertyName: "autoAddZeroLessThan10InTypeInt", publicName: "autoAddZeroLessThan10InTypeInt", isSignal: true, isRequired: false, transformFunction: null }, ignoreBlockInputMaxValue: { classPropertyName: "ignoreBlockInputMaxValue", publicName: "ignoreBlockInputMaxValue", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, minValueNumber: { classPropertyName: "minValueNumber", publicName: "minValueNumber", isSignal: true, isRequired: false, transformFunction: null }, fixedFloat: { classPropertyName: "fixedFloat", publicName: "fixedFloat", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, classInclude: { classPropertyName: "classInclude", publicName: "classInclude", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, noBorder: { classPropertyName: "noBorder", publicName: "noBorder", isSignal: true, isRequired: false, transformFunction: null }, backgroundNone: { classPropertyName: "backgroundNone", publicName: "backgroundNone", isSignal: true, isRequired: false, transformFunction: null }, borderError: { classPropertyName: "borderError", publicName: "borderError", isSignal: true, isRequired: false, transformFunction: null }, useColorModeExist: { classPropertyName: "useColorModeExist", publicName: "useColorModeExist", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, keepPlaceholderOnly: { classPropertyName: "keepPlaceholderOnly", publicName: "keepPlaceholderOnly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, autoRemoveEmoji: { classPropertyName: "autoRemoveEmoji", publicName: "autoRemoveEmoji", isSignal: true, isRequired: false, transformFunction: null }, defaultHeight: { classPropertyName: "defaultHeight", publicName: "defaultHeight", isSignal: true, isRequired: false, transformFunction: null }, minHeightTextArea: { classPropertyName: "minHeightTextArea", publicName: "minHeightTextArea", isSignal: true, isRequired: false, transformFunction: null }, maxHeightTextArea: { classPropertyName: "maxHeightTextArea", publicName: "maxHeightTextArea", isSignal: true, isRequired: false, transformFunction: null }, focusTimeOut: { classPropertyName: "focusTimeOut", publicName: "focusTimeOut", isSignal: true, isRequired: false, transformFunction: null }, selectAllTimeOut: { classPropertyName: "selectAllTimeOut", publicName: "selectAllTimeOut", isSignal: true, isRequired: false, transformFunction: null }, blurTimeOut: { classPropertyName: "blurTimeOut", publicName: "blurTimeOut", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopoverContent: { classPropertyName: "zIndexPopoverContent", publicName: "zIndexPopoverContent", isSignal: true, isRequired: false, transformFunction: null }, classContainerInput: { classPropertyName: "classContainerInput", publicName: "classContainerInput", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, ignoreStopPropagationEvent: { classPropertyName: "ignoreStopPropagationEvent", publicName: "ignoreStopPropagationEvent", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, templateLeftBottomInput: { classPropertyName: "templateLeftBottomInput", publicName: "templateLeftBottomInput", isSignal: true, isRequired: false, transformFunction: null }, templateRightBottomInput: { classPropertyName: "templateRightBottomInput", publicName: "templateRightBottomInput", isSignal: true, isRequired: false, transformFunction: null }, classContainerBottomInput: { classPropertyName: "classContainerBottomInput", publicName: "classContainerBottomInput", isSignal: true, isRequired: false, transformFunction: null }, ignoreWidthInput100: { classPropertyName: "ignoreWidthInput100", publicName: "ignoreWidthInput100", isSignal: true, isRequired: false, transformFunction: null }, iframeTextareaCustomStyle: { classPropertyName: "iframeTextareaCustomStyle", publicName: "iframeTextareaCustomStyle", isSignal: true, isRequired: false, transformFunction: null }, iconLeftClass: { classPropertyName: "iconLeftClass", publicName: "iconLeftClass", isSignal: true, isRequired: false, transformFunction: null }, popoverContentIconLeft: { classPropertyName: "popoverContentIconLeft", publicName: "popoverContentIconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRightClass: { classPropertyName: "iconRightClass", publicName: "iconRightClass", isSignal: true, isRequired: false, transformFunction: null }, popoverContentIconRight: { classPropertyName: "popoverContentIconRight", publicName: "popoverContentIconRight", isSignal: true, isRequired: false, transformFunction: null }, resetAutoCompletePassword: { classPropertyName: "resetAutoCompletePassword", publicName: "resetAutoCompletePassword", isSignal: true, isRequired: false, transformFunction: null }, acceptOnlyClickIcon: { classPropertyName: "acceptOnlyClickIcon", publicName: "acceptOnlyClickIcon", isSignal: true, isRequired: false, transformFunction: null }, setIconRightColorSameColorDisableReadOnly: { classPropertyName: "setIconRightColorSameColorDisableReadOnly", publicName: "setIconRightColorSameColorDisableReadOnly", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, maxLengthNumberCount: { classPropertyName: "maxLengthNumberCount", publicName: "maxLengthNumberCount", isSignal: true, isRequired: false, transformFunction: null }, focusInput: { classPropertyName: "focusInput", publicName: "focusInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { maxValueNumber: "maxValueNumberChange", minValueNumber: "minValueNumberChange", fixedFloat: "fixedFloatChange", acceptNegativeValue: "acceptNegativeValueChange", maxLength: "maxLengthChange", value: "valueChange", maxLengthNumberCount: "maxLengthNumberCountChange", outHeightAreaChange: "outHeightAreaChange", outChange: "outChange", outFocusAndBlurEvent: "outFocusAndBlurEvent", outEnterEvent: "outEnterEvent", outInputEvent: "outInputEvent", outIconLeft: "outIconLeft", outIconRight: "outIconRight", outFunctionsControl: "outFunctionsControl", outFilesDrop: "outFilesDrop", outFileDrop: "outFileDrop", outChangeValueByButtonUpDown: "outChangeValueByButtonUpDown" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }, { propertyName: "textCountRef", first: true, predicate: ["textCountRef"], descendants: true, isSignal: true }, { propertyName: "elementRightRef", first: true, predicate: ["elementRightRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"'flex relative !text-[#9ca2ad] ' + classContainerInput()\"\n [class.libs-ui-components-input-textarea-container]=\"tagInput() === 'textarea' && resize() === 'auto'\">\n @if (tagInput() === 'input') {\n <input #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r ' + classInclude()\"\n [class.border-primary-focus-general]=\"focusInput()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.!pl-[40px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [attr.type]=\"typeInput()\"\n [attr.inputmode]=\"modeInput()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"\n [autocomplete]=\"resetAutoCompletePassword()? 'new-password':''\" />\n }\n @if (tagInput() === 'textarea') {\n @if (resize() === 'auto') {\n <div class=\"libs-ui-components-input-textarea-container-resize-icon\"></div>\n }\n <textarea #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"minHeightTextArea() ?? defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.resize]=\"resize()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r libs-ui-cursor-auto ' + classInclude()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.pl-[32px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\">\n </textarea>\n }\n\n @if (tagInput() === 'iframe-textarea' && htmlIframeArea()) {\n <span class=\"d-none\">\n </span>\n <iframe #iframeRef\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.height.px]=\"defaultHeight()\"\n [srcdoc]=\"htmlIframeArea()\"\n class=\"w-full\"\n frameBorder=\"0\"\n (load)=\"handlerOnLoad($event,iframeRef)\">\n </iframe>\n }\n @if (iconLeftClass()) {\n <libs_ui-components-popover [ignoreShowPopover]=\"!popoverContentIconLeft()\"\n [config]=\"{maxWidth:250,direction:'bottom',content:popoverContentIconLeft(),zIndex: zIndexPopoverContent()}\">\n <i [attr.tagInput]=\"tagInput()\"\n [class]=\"iconLeftClass() +' libs-ui-input-icon-left !text-[#9ca2ad]'\"\n (click)=\"handlerEventIconLeft($event,'click')\">\n </i>\n </libs_ui-components-popover>\n }\n <div #elementRightRef\n class=\"absolute flex items-center h-full top-0 right-0\">\n @if (value() && placeholder().trim() && keepPlaceholderOnly()) {\n <span [class]=\"'libs-ui-input-placeholder-custom libs-ui-font-h5r'\">\n {{ placeholder() }}\n </span>\n }\n @if (dataType() !=='string' && valueUpDownNumber()) {\n <libs_ui-components-buttons-sort class=\"mr-[12px]\"\n [disableAsc]=\"disableAsc()\"\n [disableDesc]=\"disableDesc()\"\n [attr.tagInput]=\"tagInput()\"\n [onlyEmit]=\"true\"\n [disable]=\"disable() || readonly()\"\n (outChange)=\"handlerChangeValue($event)\" />\n }\n @if (iconRightClass()) {\n <libs_ui-components-popover class=\"flex\"\n [ignoreShowPopover]=\"!popoverContentIconRight()\"\n [config]=\"{maxWidth:250,direction:'bottom',content:popoverContentIconRight(),zIndex: zIndexPopoverContent()}\">\n <i [attr.tagInput]=\"tagInput()\"\n [class.text-[#6a7383]]=\"(!disable() && !readonly()) || acceptOnlyClickIcon()\"\n [class.text-[#cdd0d6]]='((disable() || readonly()) && !acceptOnlyClickIcon()) || setIconRightColorSameColorDisableReadOnly()'\n [class]=\"iconRightClass() +' libs-ui-input-icon-right'\"\n (click)=\"handlerEventIconRight($event,'click')\">\n </i>\n </libs_ui-components-popover>\n }\n </div>\n <div class=\"libs-ui-input-text-bottom {{ classContainerBottomInput() }}\"\n [style.right.px]=\"(tagInput() === 'input' ? (elementRightRef.clientWidth || 0) : 0) + 8\">\n @if (templateLeftBottomInput(); as templateLeftBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateLeftBottomInput\" />\n }\n <div #textCountRef\n class=\"text-[#9ca2ad] libs-ui-font-h7r\"\n [class.hidden]=\"dataType() !== 'string' || !showCount()\">\n <span>{{ countDisplay() }}</span>\n @if (maxLength()) {\n <span>/{{ maxLengthDisplay() }}</span>\n }\n </div>\n @if (templateRightBottomInput(); as templateRightBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateRightBottomInput\" />\n }\n </div>\n</div>\n", styles: [".libs-ui-input{max-width:100%;border-radius:none;color:#071631;padding:7px 12px;background-color:#fff;background-clip:padding-box;min-height:32px}.libs-ui-input:not(.libs-ui-input-not-border){border:1px solid #e6e7ea;border-radius:4px}.libs-ui-input:focus{outline:none}.libs-ui-input:focus:not(:read-only):not(:disabled):not(.libs-ui-input-not-border){border:1px solid var(--libs-ui-color-light-1, #4e8cf7)}.libs-ui-input .libs-ui-input-valid-check{position:absolute;left:-27px}.libs-ui-input-not-border{border:transparent}libs-ui-components-button-sort{position:absolute;right:12px;top:0}libs-ui-components-button-sort[tagInput=textarea]{top:-10px}.libs-ui-input-icon-left{position:absolute;top:8px;left:16px;font-size:16px}.libs-ui-input-icon-right{font-size:16px;margin-right:8px}.libs-ui-input-text-bottom{display:flex;align-items:center;position:absolute;bottom:8px}input::-ms-reveal,input::-ms-clear{display:none}input::-webkit-credentials-auto-fill-button{margin-right:8px!important}textarea::-webkit-resizer{border:transparent;outline:none}.libs-ui-components-input-textarea-container:after{content:\"\";border-top:1.5px solid #9ca2ad;width:15px;transform:rotate(-45deg);background:transparent;position:absolute;right:0;bottom:8px;pointer-events:none;border-radius:25%}.libs-ui-components-input-textarea-container .libs-ui-components-input-textarea-container-resize-icon{border-top:1.5px solid #9ca2ad;width:7px;transform:rotate(-45deg);position:absolute;bottom:5px;right:1px;pointer-events:none;border-radius:25%}.libs-ui-input-placeholder-custom{color:#6a7378;margin-right:16px;background:inherit}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsSortComponent, selector: "libs_ui-components-buttons-sort", inputs: ["size", "mode", "fieldSort", "disable", "disableAsc", "disableDesc", "onlyEmit"], outputs: ["modeChange", "outChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
946
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsInputsInputComponent, isStandalone: true, selector: "libs_ui-components-inputs-input", inputs: { tagInput: { classPropertyName: "tagInput", publicName: "tagInput", isSignal: true, isRequired: false, transformFunction: null }, dataType: { classPropertyName: "dataType", publicName: "dataType", isSignal: true, isRequired: false, transformFunction: null }, typeInput: { classPropertyName: "typeInput", publicName: "typeInput", isSignal: true, isRequired: false, transformFunction: null }, modeInput: { classPropertyName: "modeInput", publicName: "modeInput", isSignal: true, isRequired: false, transformFunction: null }, tabInsertContentTagInput: { classPropertyName: "tabInsertContentTagInput", publicName: "tabInsertContentTagInput", isSignal: true, isRequired: false, transformFunction: null }, textAreaEnterNotNewLine: { classPropertyName: "textAreaEnterNotNewLine", publicName: "textAreaEnterNotNewLine", isSignal: true, isRequired: false, transformFunction: null }, emitEmptyInDataTypeNumber: { classPropertyName: "emitEmptyInDataTypeNumber", publicName: "emitEmptyInDataTypeNumber", isSignal: true, isRequired: false, transformFunction: null }, keepZeroInTypeInt: { classPropertyName: "keepZeroInTypeInt", publicName: "keepZeroInTypeInt", isSignal: true, isRequired: false, transformFunction: null }, autoAddZeroLessThan10InTypeInt: { classPropertyName: "autoAddZeroLessThan10InTypeInt", publicName: "autoAddZeroLessThan10InTypeInt", isSignal: true, isRequired: false, transformFunction: null }, ignoreBlockInputMaxValue: { classPropertyName: "ignoreBlockInputMaxValue", publicName: "ignoreBlockInputMaxValue", isSignal: true, isRequired: false, transformFunction: null }, maxValueNumber: { classPropertyName: "maxValueNumber", publicName: "maxValueNumber", isSignal: true, isRequired: false, transformFunction: null }, minValueNumber: { classPropertyName: "minValueNumber", publicName: "minValueNumber", isSignal: true, isRequired: false, transformFunction: null }, fixedFloat: { classPropertyName: "fixedFloat", publicName: "fixedFloat", isSignal: true, isRequired: false, transformFunction: null }, acceptNegativeValue: { classPropertyName: "acceptNegativeValue", publicName: "acceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, valueUpDownNumber: { classPropertyName: "valueUpDownNumber", publicName: "valueUpDownNumber", isSignal: true, isRequired: false, transformFunction: null }, classInclude: { classPropertyName: "classInclude", publicName: "classInclude", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, noBorder: { classPropertyName: "noBorder", publicName: "noBorder", isSignal: true, isRequired: false, transformFunction: null }, backgroundNone: { classPropertyName: "backgroundNone", publicName: "backgroundNone", isSignal: true, isRequired: false, transformFunction: null }, borderError: { classPropertyName: "borderError", publicName: "borderError", isSignal: true, isRequired: false, transformFunction: null }, useColorModeExist: { classPropertyName: "useColorModeExist", publicName: "useColorModeExist", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, keepPlaceholderOnly: { classPropertyName: "keepPlaceholderOnly", publicName: "keepPlaceholderOnly", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, autoRemoveEmoji: { classPropertyName: "autoRemoveEmoji", publicName: "autoRemoveEmoji", isSignal: true, isRequired: false, transformFunction: null }, defaultHeight: { classPropertyName: "defaultHeight", publicName: "defaultHeight", isSignal: true, isRequired: false, transformFunction: null }, minHeightTextArea: { classPropertyName: "minHeightTextArea", publicName: "minHeightTextArea", isSignal: true, isRequired: false, transformFunction: null }, maxHeightTextArea: { classPropertyName: "maxHeightTextArea", publicName: "maxHeightTextArea", isSignal: true, isRequired: false, transformFunction: null }, focusTimeOut: { classPropertyName: "focusTimeOut", publicName: "focusTimeOut", isSignal: true, isRequired: false, transformFunction: null }, selectAllTimeOut: { classPropertyName: "selectAllTimeOut", publicName: "selectAllTimeOut", isSignal: true, isRequired: false, transformFunction: null }, blurTimeOut: { classPropertyName: "blurTimeOut", publicName: "blurTimeOut", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopoverContent: { classPropertyName: "zIndexPopoverContent", publicName: "zIndexPopoverContent", isSignal: true, isRequired: false, transformFunction: null }, classContainerInput: { classPropertyName: "classContainerInput", publicName: "classContainerInput", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, ignoreStopPropagationEvent: { classPropertyName: "ignoreStopPropagationEvent", publicName: "ignoreStopPropagationEvent", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, templateLeftBottomInput: { classPropertyName: "templateLeftBottomInput", publicName: "templateLeftBottomInput", isSignal: true, isRequired: false, transformFunction: null }, templateRightBottomInput: { classPropertyName: "templateRightBottomInput", publicName: "templateRightBottomInput", isSignal: true, isRequired: false, transformFunction: null }, classContainerBottomInput: { classPropertyName: "classContainerBottomInput", publicName: "classContainerBottomInput", isSignal: true, isRequired: false, transformFunction: null }, ignoreWidthInput100: { classPropertyName: "ignoreWidthInput100", publicName: "ignoreWidthInput100", isSignal: true, isRequired: false, transformFunction: null }, iframeTextareaCustomStyle: { classPropertyName: "iframeTextareaCustomStyle", publicName: "iframeTextareaCustomStyle", isSignal: true, isRequired: false, transformFunction: null }, iconLeftClass: { classPropertyName: "iconLeftClass", publicName: "iconLeftClass", isSignal: true, isRequired: false, transformFunction: null }, popoverContentIconLeft: { classPropertyName: "popoverContentIconLeft", publicName: "popoverContentIconLeft", isSignal: true, isRequired: false, transformFunction: null }, iconRightClass: { classPropertyName: "iconRightClass", publicName: "iconRightClass", isSignal: true, isRequired: false, transformFunction: null }, popoverContentIconRight: { classPropertyName: "popoverContentIconRight", publicName: "popoverContentIconRight", isSignal: true, isRequired: false, transformFunction: null }, resetAutoCompletePassword: { classPropertyName: "resetAutoCompletePassword", publicName: "resetAutoCompletePassword", isSignal: true, isRequired: false, transformFunction: null }, acceptOnlyClickIcon: { classPropertyName: "acceptOnlyClickIcon", publicName: "acceptOnlyClickIcon", isSignal: true, isRequired: false, transformFunction: null }, setIconRightColorSameColorDisableReadOnly: { classPropertyName: "setIconRightColorSameColorDisableReadOnly", publicName: "setIconRightColorSameColorDisableReadOnly", isSignal: true, isRequired: false, transformFunction: null }, onlyAcceptNegativeValue: { classPropertyName: "onlyAcceptNegativeValue", publicName: "onlyAcceptNegativeValue", isSignal: true, isRequired: false, transformFunction: null }, maxLengthNumberCount: { classPropertyName: "maxLengthNumberCount", publicName: "maxLengthNumberCount", isSignal: true, isRequired: false, transformFunction: null }, focusInput: { classPropertyName: "focusInput", publicName: "focusInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { maxValueNumber: "maxValueNumberChange", minValueNumber: "minValueNumberChange", fixedFloat: "fixedFloatChange", acceptNegativeValue: "acceptNegativeValueChange", maxLength: "maxLengthChange", value: "valueChange", maxLengthNumberCount: "maxLengthNumberCountChange", outHeightAreaChange: "outHeightAreaChange", outChange: "outChange", outFocusAndBlurEvent: "outFocusAndBlurEvent", outEnterEvent: "outEnterEvent", outInputEvent: "outInputEvent", outIconLeft: "outIconLeft", outIconRight: "outIconRight", outFunctionsControl: "outFunctionsControl", outFilesDrop: "outFilesDrop", outFileDrop: "outFileDrop", outChangeValueByButtonUpDown: "outChangeValueByButtonUpDown" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, isSignal: true }, { propertyName: "textCountRef", first: true, predicate: ["textCountRef"], descendants: true, isSignal: true }, { propertyName: "elementRightRef", first: true, predicate: ["elementRightRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"'flex relative !text-[#9ca2ad] ' + classContainerInput()\"\n [class.libs-ui-components-input-textarea-container]=\"tagInput() === 'textarea' && resize() === 'auto'\">\n @if (tagInput() === 'input') {\n <input\n #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r ' + classInclude()\"\n [class.border-primary-focus-general]=\"focusInput()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.!pl-[40px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [attr.type]=\"typeInput()\"\n [attr.inputmode]=\"modeInput()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"\n [autocomplete]=\"resetAutoCompletePassword() ? 'new-password' : ''\" />\n }\n @if (tagInput() === 'textarea') {\n @if (resize() === 'auto') {\n <div class=\"libs-ui-components-input-textarea-container-resize-icon\"></div>\n }\n <textarea\n #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"minHeightTextArea() ?? defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.resize]=\"resize()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r libs-ui-cursor-auto ' + classInclude()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.pl-[32px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"></textarea>\n }\n\n @if (tagInput() === 'iframe-textarea' && htmlIframeArea()) {\n <span class=\"d-none\"></span>\n <iframe\n #iframeRef\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.height.px]=\"defaultHeight()\"\n [srcdoc]=\"htmlIframeArea()\"\n class=\"w-full\"\n frameBorder=\"0\"\n (load)=\"handlerOnLoad($event, iframeRef)\"></iframe>\n }\n @if (iconLeftClass()) {\n <libs_ui-components-popover\n [ignoreShowPopover]=\"!popoverContentIconLeft()\"\n [config]=\"{ maxWidth: 250, direction: 'bottom', content: popoverContentIconLeft(), zIndex: zIndexPopoverContent() }\">\n <i\n [attr.tagInput]=\"tagInput()\"\n [class]=\"iconLeftClass() + ' libs-ui-input-icon-left !text-[#9ca2ad]'\"\n (click)=\"handlerEventIconLeft($event, 'click')\"></i>\n </libs_ui-components-popover>\n }\n <div\n #elementRightRef\n class=\"absolute flex items-center h-full top-0 right-0\">\n @if (value() && placeholder().trim() && keepPlaceholderOnly()) {\n <span [class]=\"'libs-ui-input-placeholder-custom libs-ui-font-h5r'\">\n {{ placeholder() }}\n </span>\n }\n @if (dataType() !== 'string' && valueUpDownNumber()) {\n <libs_ui-components-buttons-sort\n class=\"mr-[12px]\"\n [disableAsc]=\"disableAsc()\"\n [disableDesc]=\"disableDesc()\"\n [attr.tagInput]=\"tagInput()\"\n [onlyEmit]=\"true\"\n [disable]=\"disable() || readonly()\"\n (outChange)=\"handlerChangeValue($event)\" />\n }\n @if (iconRightClass()) {\n <libs_ui-components-popover\n class=\"flex\"\n [ignoreShowPopover]=\"!popoverContentIconRight()\"\n [config]=\"{ maxWidth: 250, direction: 'bottom', content: popoverContentIconRight(), zIndex: zIndexPopoverContent() }\">\n <i\n [attr.tagInput]=\"tagInput()\"\n [class.text-[#6a7383]]=\"(!disable() && !readonly()) || acceptOnlyClickIcon()\"\n [class.text-[#cdd0d6]]=\"((disable() || readonly()) && !acceptOnlyClickIcon()) || setIconRightColorSameColorDisableReadOnly()\"\n [class]=\"iconRightClass() + ' libs-ui-input-icon-right'\"\n (click)=\"handlerEventIconRight($event, 'click')\"></i>\n </libs_ui-components-popover>\n }\n </div>\n <div\n class=\"libs-ui-input-text-bottom {{ classContainerBottomInput() }}\"\n [style.right.px]=\"(tagInput() === 'input' ? elementRightRef.clientWidth || 0 : 0) + 8\">\n @if (templateLeftBottomInput(); as templateLeftBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateLeftBottomInput\" />\n }\n <div\n #textCountRef\n class=\"text-[#9ca2ad] libs-ui-font-h7r\"\n [class.hidden]=\"dataType() !== 'string' || !showCount()\">\n <span>{{ countDisplay() }}</span>\n @if (maxLength()) {\n <span>/{{ maxLengthDisplay() }}</span>\n }\n </div>\n @if (templateRightBottomInput(); as templateRightBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateRightBottomInput\" />\n }\n </div>\n</div>\n", styles: [".libs-ui-input{max-width:100%;border-radius:none;color:#071631;padding:7px 12px;background-color:#fff;background-clip:padding-box;min-height:32px}.libs-ui-input:not(.libs-ui-input-not-border){border:1px solid #e6e7ea;border-radius:4px}.libs-ui-input:focus{outline:none}.libs-ui-input:focus:not(:read-only):not(:disabled):not(.libs-ui-input-not-border){border:1px solid var(--libs-ui-color-light-1, #4e8cf7)}.libs-ui-input .libs-ui-input-valid-check{position:absolute;left:-27px}.libs-ui-input-not-border{border:transparent}libs-ui-components-button-sort{position:absolute;right:12px;top:0}libs-ui-components-button-sort[tagInput=textarea]{top:-10px}.libs-ui-input-icon-left{position:absolute;top:8px;left:16px;font-size:16px}.libs-ui-input-icon-right{font-size:16px;margin-right:8px}.libs-ui-input-text-bottom{display:flex;align-items:center;position:absolute;bottom:8px}input::-ms-reveal,input::-ms-clear{display:none}input::-webkit-credentials-auto-fill-button{margin-right:8px!important}textarea::-webkit-resizer{border:transparent;outline:none}.libs-ui-components-input-textarea-container:after{content:\"\";border-top:1.5px solid #9ca2ad;width:15px;transform:rotate(-45deg);background:transparent;position:absolute;right:0;bottom:8px;pointer-events:none;border-radius:25%}.libs-ui-components-input-textarea-container .libs-ui-components-input-textarea-container-resize-icon{border-top:1.5px solid #9ca2ad;width:7px;transform:rotate(-45deg);position:absolute;bottom:5px;right:1px;pointer-events:none;border-radius:25%}.libs-ui-input-placeholder-custom{color:#6a7378;margin-right:16px;background:inherit}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "initEventInElementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsSortComponent, selector: "libs_ui-components-buttons-sort", inputs: ["size", "mode", "fieldSort", "disable", "disableAsc", "disableDesc", "onlyEmit"], outputs: ["modeChange", "outChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
914
947
|
}
|
|
915
948
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsInputsInputComponent, decorators: [{
|
|
916
949
|
type: Component,
|
|
917
|
-
args: [{ selector: 'libs_ui-components-inputs-input', standalone: true, imports: [
|
|
918
|
-
TranslateModule, NgTemplateOutlet,
|
|
919
|
-
LibsUiComponentsPopoverComponent,
|
|
920
|
-
LibsUiComponentsButtonsSortComponent
|
|
921
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"'flex relative !text-[#9ca2ad] ' + classContainerInput()\"\n [class.libs-ui-components-input-textarea-container]=\"tagInput() === 'textarea' && resize() === 'auto'\">\n @if (tagInput() === 'input') {\n <input #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r ' + classInclude()\"\n [class.border-primary-focus-general]=\"focusInput()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.!pl-[40px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [attr.type]=\"typeInput()\"\n [attr.inputmode]=\"modeInput()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"\n [autocomplete]=\"resetAutoCompletePassword()? 'new-password':''\" />\n }\n @if (tagInput() === 'textarea') {\n @if (resize() === 'auto') {\n <div class=\"libs-ui-components-input-textarea-container-resize-icon\"></div>\n }\n <textarea #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"minHeightTextArea() ?? defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.resize]=\"resize()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r libs-ui-cursor-auto ' + classInclude()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.pl-[32px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\">\n </textarea>\n }\n\n @if (tagInput() === 'iframe-textarea' && htmlIframeArea()) {\n <span class=\"d-none\">\n </span>\n <iframe #iframeRef\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.height.px]=\"defaultHeight()\"\n [srcdoc]=\"htmlIframeArea()\"\n class=\"w-full\"\n frameBorder=\"0\"\n (load)=\"handlerOnLoad($event,iframeRef)\">\n </iframe>\n }\n @if (iconLeftClass()) {\n <libs_ui-components-popover [ignoreShowPopover]=\"!popoverContentIconLeft()\"\n [config]=\"{maxWidth:250,direction:'bottom',content:popoverContentIconLeft(),zIndex: zIndexPopoverContent()}\">\n <i [attr.tagInput]=\"tagInput()\"\n [class]=\"iconLeftClass() +' libs-ui-input-icon-left !text-[#9ca2ad]'\"\n (click)=\"handlerEventIconLeft($event,'click')\">\n </i>\n </libs_ui-components-popover>\n }\n <div #elementRightRef\n class=\"absolute flex items-center h-full top-0 right-0\">\n @if (value() && placeholder().trim() && keepPlaceholderOnly()) {\n <span [class]=\"'libs-ui-input-placeholder-custom libs-ui-font-h5r'\">\n {{ placeholder() }}\n </span>\n }\n @if (dataType() !=='string' && valueUpDownNumber()) {\n <libs_ui-components-buttons-sort class=\"mr-[12px]\"\n [disableAsc]=\"disableAsc()\"\n [disableDesc]=\"disableDesc()\"\n [attr.tagInput]=\"tagInput()\"\n [onlyEmit]=\"true\"\n [disable]=\"disable() || readonly()\"\n (outChange)=\"handlerChangeValue($event)\" />\n }\n @if (iconRightClass()) {\n <libs_ui-components-popover class=\"flex\"\n [ignoreShowPopover]=\"!popoverContentIconRight()\"\n [config]=\"{maxWidth:250,direction:'bottom',content:popoverContentIconRight(),zIndex: zIndexPopoverContent()}\">\n <i [attr.tagInput]=\"tagInput()\"\n [class.text-[#6a7383]]=\"(!disable() && !readonly()) || acceptOnlyClickIcon()\"\n [class.text-[#cdd0d6]]='((disable() || readonly()) && !acceptOnlyClickIcon()) || setIconRightColorSameColorDisableReadOnly()'\n [class]=\"iconRightClass() +' libs-ui-input-icon-right'\"\n (click)=\"handlerEventIconRight($event,'click')\">\n </i>\n </libs_ui-components-popover>\n }\n </div>\n <div class=\"libs-ui-input-text-bottom {{ classContainerBottomInput() }}\"\n [style.right.px]=\"(tagInput() === 'input' ? (elementRightRef.clientWidth || 0) : 0) + 8\">\n @if (templateLeftBottomInput(); as templateLeftBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateLeftBottomInput\" />\n }\n <div #textCountRef\n class=\"text-[#9ca2ad] libs-ui-font-h7r\"\n [class.hidden]=\"dataType() !== 'string' || !showCount()\">\n <span>{{ countDisplay() }}</span>\n @if (maxLength()) {\n <span>/{{ maxLengthDisplay() }}</span>\n }\n </div>\n @if (templateRightBottomInput(); as templateRightBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateRightBottomInput\" />\n }\n </div>\n</div>\n", styles: [".libs-ui-input{max-width:100%;border-radius:none;color:#071631;padding:7px 12px;background-color:#fff;background-clip:padding-box;min-height:32px}.libs-ui-input:not(.libs-ui-input-not-border){border:1px solid #e6e7ea;border-radius:4px}.libs-ui-input:focus{outline:none}.libs-ui-input:focus:not(:read-only):not(:disabled):not(.libs-ui-input-not-border){border:1px solid var(--libs-ui-color-light-1, #4e8cf7)}.libs-ui-input .libs-ui-input-valid-check{position:absolute;left:-27px}.libs-ui-input-not-border{border:transparent}libs-ui-components-button-sort{position:absolute;right:12px;top:0}libs-ui-components-button-sort[tagInput=textarea]{top:-10px}.libs-ui-input-icon-left{position:absolute;top:8px;left:16px;font-size:16px}.libs-ui-input-icon-right{font-size:16px;margin-right:8px}.libs-ui-input-text-bottom{display:flex;align-items:center;position:absolute;bottom:8px}input::-ms-reveal,input::-ms-clear{display:none}input::-webkit-credentials-auto-fill-button{margin-right:8px!important}textarea::-webkit-resizer{border:transparent;outline:none}.libs-ui-components-input-textarea-container:after{content:\"\";border-top:1.5px solid #9ca2ad;width:15px;transform:rotate(-45deg);background:transparent;position:absolute;right:0;bottom:8px;pointer-events:none;border-radius:25%}.libs-ui-components-input-textarea-container .libs-ui-components-input-textarea-container-resize-icon{border-top:1.5px solid #9ca2ad;width:7px;transform:rotate(-45deg);position:absolute;bottom:5px;right:1px;pointer-events:none;border-radius:25%}.libs-ui-input-placeholder-custom{color:#6a7378;margin-right:16px;background:inherit}\n"] }]
|
|
950
|
+
args: [{ selector: 'libs_ui-components-inputs-input', standalone: true, imports: [TranslateModule, NgTemplateOutlet, LibsUiComponentsPopoverComponent, LibsUiComponentsButtonsSortComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"'flex relative !text-[#9ca2ad] ' + classContainerInput()\"\n [class.libs-ui-components-input-textarea-container]=\"tagInput() === 'textarea' && resize() === 'auto'\">\n @if (tagInput() === 'input') {\n <input\n #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r ' + classInclude()\"\n [class.border-primary-focus-general]=\"focusInput()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.!pl-[40px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [attr.type]=\"typeInput()\"\n [attr.inputmode]=\"modeInput()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"\n [autocomplete]=\"resetAutoCompletePassword() ? 'new-password' : ''\" />\n }\n @if (tagInput() === 'textarea') {\n @if (resize() === 'auto') {\n <div class=\"libs-ui-components-input-textarea-container-resize-icon\"></div>\n }\n <textarea\n #inputRef\n [class.libs-ui-readonly]=\"readonly()\"\n [class.libs-ui-readonly-background]=\"readonly()\"\n [class.libs-ui-disable]=\"disable()\"\n [class.libs-ui-disable-background]=\"disable()\"\n [style.height.px]=\"defaultHeight()\"\n [style.minHeight.px]=\"minHeightTextArea() ?? defaultHeight()\"\n [style.paddingRight.px.important]=\"paddingRightCustom()\"\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.resize]=\"resize()\"\n [class.w-full]=\"!ignoreWidthInput100()\"\n [class]=\"'libs-ui-input libs-ui-font-h5r libs-ui-cursor-auto ' + classInclude()\"\n [class.libs-ui-input-not-border]=\"noBorder()\"\n [class.libs-ui-bg-special-none]=\"backgroundNone()\"\n [class.libs-ui-border-error-general]=\"borderError()\"\n [class.text-[#29c7cc]]=\"useColorModeExist()\"\n [class.pl-[32px]]=\"iconLeftClass()\"\n [attr.maxLength]=\"maxLength() || undefined\"\n [placeholder]=\"placeholder() | translate\"\n [readonly]=\"readonly()\"\n [disabled]=\"disable()\"></textarea>\n }\n\n @if (tagInput() === 'iframe-textarea' && htmlIframeArea()) {\n <span class=\"d-none\"></span>\n <iframe\n #iframeRef\n [style.maxHeight.px]=\"maxHeightTextArea()\"\n [style.height.px]=\"defaultHeight()\"\n [srcdoc]=\"htmlIframeArea()\"\n class=\"w-full\"\n frameBorder=\"0\"\n (load)=\"handlerOnLoad($event, iframeRef)\"></iframe>\n }\n @if (iconLeftClass()) {\n <libs_ui-components-popover\n [ignoreShowPopover]=\"!popoverContentIconLeft()\"\n [config]=\"{ maxWidth: 250, direction: 'bottom', content: popoverContentIconLeft(), zIndex: zIndexPopoverContent() }\">\n <i\n [attr.tagInput]=\"tagInput()\"\n [class]=\"iconLeftClass() + ' libs-ui-input-icon-left !text-[#9ca2ad]'\"\n (click)=\"handlerEventIconLeft($event, 'click')\"></i>\n </libs_ui-components-popover>\n }\n <div\n #elementRightRef\n class=\"absolute flex items-center h-full top-0 right-0\">\n @if (value() && placeholder().trim() && keepPlaceholderOnly()) {\n <span [class]=\"'libs-ui-input-placeholder-custom libs-ui-font-h5r'\">\n {{ placeholder() }}\n </span>\n }\n @if (dataType() !== 'string' && valueUpDownNumber()) {\n <libs_ui-components-buttons-sort\n class=\"mr-[12px]\"\n [disableAsc]=\"disableAsc()\"\n [disableDesc]=\"disableDesc()\"\n [attr.tagInput]=\"tagInput()\"\n [onlyEmit]=\"true\"\n [disable]=\"disable() || readonly()\"\n (outChange)=\"handlerChangeValue($event)\" />\n }\n @if (iconRightClass()) {\n <libs_ui-components-popover\n class=\"flex\"\n [ignoreShowPopover]=\"!popoverContentIconRight()\"\n [config]=\"{ maxWidth: 250, direction: 'bottom', content: popoverContentIconRight(), zIndex: zIndexPopoverContent() }\">\n <i\n [attr.tagInput]=\"tagInput()\"\n [class.text-[#6a7383]]=\"(!disable() && !readonly()) || acceptOnlyClickIcon()\"\n [class.text-[#cdd0d6]]=\"((disable() || readonly()) && !acceptOnlyClickIcon()) || setIconRightColorSameColorDisableReadOnly()\"\n [class]=\"iconRightClass() + ' libs-ui-input-icon-right'\"\n (click)=\"handlerEventIconRight($event, 'click')\"></i>\n </libs_ui-components-popover>\n }\n </div>\n <div\n class=\"libs-ui-input-text-bottom {{ classContainerBottomInput() }}\"\n [style.right.px]=\"(tagInput() === 'input' ? elementRightRef.clientWidth || 0 : 0) + 8\">\n @if (templateLeftBottomInput(); as templateLeftBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateLeftBottomInput\" />\n }\n <div\n #textCountRef\n class=\"text-[#9ca2ad] libs-ui-font-h7r\"\n [class.hidden]=\"dataType() !== 'string' || !showCount()\">\n <span>{{ countDisplay() }}</span>\n @if (maxLength()) {\n <span>/{{ maxLengthDisplay() }}</span>\n }\n </div>\n @if (templateRightBottomInput(); as templateRightBottomInput) {\n <ng-container *ngTemplateOutlet=\"templateRightBottomInput\" />\n }\n </div>\n</div>\n", styles: [".libs-ui-input{max-width:100%;border-radius:none;color:#071631;padding:7px 12px;background-color:#fff;background-clip:padding-box;min-height:32px}.libs-ui-input:not(.libs-ui-input-not-border){border:1px solid #e6e7ea;border-radius:4px}.libs-ui-input:focus{outline:none}.libs-ui-input:focus:not(:read-only):not(:disabled):not(.libs-ui-input-not-border){border:1px solid var(--libs-ui-color-light-1, #4e8cf7)}.libs-ui-input .libs-ui-input-valid-check{position:absolute;left:-27px}.libs-ui-input-not-border{border:transparent}libs-ui-components-button-sort{position:absolute;right:12px;top:0}libs-ui-components-button-sort[tagInput=textarea]{top:-10px}.libs-ui-input-icon-left{position:absolute;top:8px;left:16px;font-size:16px}.libs-ui-input-icon-right{font-size:16px;margin-right:8px}.libs-ui-input-text-bottom{display:flex;align-items:center;position:absolute;bottom:8px}input::-ms-reveal,input::-ms-clear{display:none}input::-webkit-credentials-auto-fill-button{margin-right:8px!important}textarea::-webkit-resizer{border:transparent;outline:none}.libs-ui-components-input-textarea-container:after{content:\"\";border-top:1.5px solid #9ca2ad;width:15px;transform:rotate(-45deg);background:transparent;position:absolute;right:0;bottom:8px;pointer-events:none;border-radius:25%}.libs-ui-components-input-textarea-container .libs-ui-components-input-textarea-container-resize-icon{border-top:1.5px solid #9ca2ad;width:7px;transform:rotate(-45deg);position:absolute;bottom:5px;right:1px;pointer-events:none;border-radius:25%}.libs-ui-input-placeholder-custom{color:#6a7378;margin-right:16px;background:inherit}\n"] }]
|
|
922
951
|
}], ctorParameters: () => [] });
|
|
923
952
|
|
|
924
953
|
/**
|