@cuby-ui/core 0.0.165 → 0.0.166
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/components/input-number/input-number.component.d.ts +13 -30
- package/components/input-number/input-number.module.d.ts +4 -3
- package/esm2020/components/input-number/input-number.component.mjs +38 -129
- package/esm2020/components/input-number/input-number.module.mjs +5 -2
- package/fesm2015/cuby-ui-core.mjs +48 -149
- package/fesm2015/cuby-ui-core.mjs.map +1 -1
- package/fesm2020/cuby-ui-core.mjs +48 -147
- package/fesm2020/cuby-ui-core.mjs.map +1 -1
- package/package.json +3 -3
- package/components/input-number/input-number.options.d.ts +0 -9
- package/esm2020/components/input-number/input-number.options.mjs +0 -11
|
@@ -11,8 +11,8 @@ import * as i2$1 from '@tinkoff/ng-polymorpheus';
|
|
|
11
11
|
import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
12
12
|
import * as i2$2 from '@angular/forms';
|
|
13
13
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
14
|
-
import { maskitoTimeOptionsGenerator } from '@maskito/kit';
|
|
15
|
-
import * as
|
|
14
|
+
import { maskitoParseNumber, maskitoNumberOptionsGenerator, maskitoTimeOptionsGenerator } from '@maskito/kit';
|
|
15
|
+
import * as i3 from '@maskito/angular';
|
|
16
16
|
import { MaskitoDirective } from '@maskito/angular';
|
|
17
17
|
|
|
18
18
|
class CuiAccordionComponent {
|
|
@@ -1213,25 +1213,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1213
1213
|
}]
|
|
1214
1214
|
}] });
|
|
1215
1215
|
|
|
1216
|
-
const CUI_INPUT_NUMBER_DEFAULT_OPTIONS = {
|
|
1217
|
-
min: -Infinity,
|
|
1218
|
-
max: Infinity,
|
|
1219
|
-
step: 1,
|
|
1220
|
-
precision: 3
|
|
1221
|
-
};
|
|
1222
|
-
const CUI_INPUT_NUMBER_OPTIONS = new InjectionToken('', {
|
|
1223
|
-
factory: () => CUI_INPUT_NUMBER_DEFAULT_OPTIONS
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
function cuiRemoveSpaces(value) {
|
|
1227
|
-
return value.replace(/\s+/g, '');
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
function cuiReplace(value, search, replace) {
|
|
1231
|
-
const regex = new RegExp(search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
|
|
1232
|
-
return value.replace(regex, replace);
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
1216
|
class CuiTextFieldController {
|
|
1236
1217
|
constructor(iconLeftDirective, idDirective, isErrorDirective, placeholderDirective, sizeDirective) {
|
|
1237
1218
|
this.iconLeftDirective = iconLeftDirective;
|
|
@@ -1407,22 +1388,22 @@ class CuiInputNumberComponent {
|
|
|
1407
1388
|
constructor() {
|
|
1408
1389
|
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
1409
1390
|
this.cuiTextFieldController = inject(CUI_TEXT_FIELD_CONTROLLER);
|
|
1410
|
-
this.
|
|
1411
|
-
this.
|
|
1412
|
-
this.
|
|
1413
|
-
this.
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
this.
|
|
1417
|
-
this.
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
this.
|
|
1391
|
+
this.maskOptions = this.generateMask();
|
|
1392
|
+
this._precision = 0;
|
|
1393
|
+
this._min = Number.MIN_SAFE_INTEGER;
|
|
1394
|
+
this._max = Number.MAX_SAFE_INTEGER;
|
|
1395
|
+
}
|
|
1396
|
+
set precision(value) {
|
|
1397
|
+
this._precision = value;
|
|
1398
|
+
this.maskOptions = this.generateMask();
|
|
1399
|
+
}
|
|
1400
|
+
set min(value) {
|
|
1401
|
+
this._min = value;
|
|
1402
|
+
this.maskOptions = this.generateMask();
|
|
1403
|
+
}
|
|
1404
|
+
set max(value) {
|
|
1405
|
+
this._max = value;
|
|
1406
|
+
this.maskOptions = this.generateMask();
|
|
1426
1407
|
}
|
|
1427
1408
|
get id() {
|
|
1428
1409
|
return this.cuiTextFieldController.id;
|
|
@@ -1440,8 +1421,7 @@ class CuiInputNumberComponent {
|
|
|
1440
1421
|
return this.cuiTextFieldController.isError;
|
|
1441
1422
|
}
|
|
1442
1423
|
writeValue(value) {
|
|
1443
|
-
this.value = value?.toString()
|
|
1444
|
-
this.formattedValue = this.formatValue(this.value);
|
|
1424
|
+
this.value = value?.toString();
|
|
1445
1425
|
this.changeDetectorRef.markForCheck();
|
|
1446
1426
|
}
|
|
1447
1427
|
registerOnChange(fn) {
|
|
@@ -1454,127 +1434,37 @@ class CuiInputNumberComponent {
|
|
|
1454
1434
|
this.isDisabled = isDisabled;
|
|
1455
1435
|
this.changeDetectorRef.markForCheck();
|
|
1456
1436
|
}
|
|
1457
|
-
onInput(
|
|
1458
|
-
|
|
1459
|
-
const targetValue = eventTarget.value;
|
|
1460
|
-
const selectionStart = this.input.nativeElement.selectionStart ?? 0;
|
|
1461
|
-
const previousFormattedValue = this.formattedValue;
|
|
1462
|
-
if (this.isInputValueCorrect(targetValue)) {
|
|
1463
|
-
const parsedValue = this.parseValue(targetValue);
|
|
1464
|
-
this.changeModel(parsedValue);
|
|
1465
|
-
}
|
|
1466
|
-
this.formattedValue = this.formatValue(this.value);
|
|
1467
|
-
eventTarget.value = this.formattedValue;
|
|
1468
|
-
const currentCaretPosition = selectionStart
|
|
1469
|
-
+ (this.formattedValue.length - previousFormattedValue.length === 2 ? 1 : 0);
|
|
1470
|
-
this.input.nativeElement.setSelectionRange(currentCaretPosition, currentCaretPosition);
|
|
1471
|
-
}
|
|
1472
|
-
onArrowUp() {
|
|
1473
|
-
this.increaseByStep();
|
|
1474
|
-
}
|
|
1475
|
-
onArrowDown() {
|
|
1476
|
-
this.decreaseByStep();
|
|
1437
|
+
onInput({ target }) {
|
|
1438
|
+
this.changeModel(target.value);
|
|
1477
1439
|
}
|
|
1478
1440
|
onFocus() {
|
|
1479
1441
|
this.input.nativeElement.focus();
|
|
1480
1442
|
}
|
|
1481
|
-
isInputValueCorrect(inputValue) {
|
|
1482
|
-
return this.INPUT_VALUE_REGEX.test(inputValue) && this.isInputValueValid(inputValue);
|
|
1483
|
-
}
|
|
1484
|
-
isInputValueValid(inputValue) {
|
|
1485
|
-
const [, fractionPart = ''] = inputValue.split(',');
|
|
1486
|
-
return this.isNumberValid(inputValue) && this.isPrecisionCountCorrect(fractionPart);
|
|
1487
|
-
}
|
|
1488
|
-
isNumberValid(inputValue) {
|
|
1489
|
-
if (inputValue === '-' && this._min > 0) {
|
|
1490
|
-
return false;
|
|
1491
|
-
}
|
|
1492
|
-
if (inputValue === ',' || inputValue === '-' || inputValue === '-,' || inputValue === '') {
|
|
1493
|
-
return true;
|
|
1494
|
-
}
|
|
1495
|
-
const convertedValue = +cuiReplace(cuiRemoveSpaces(inputValue), ',', '.');
|
|
1496
|
-
return convertedValue <= this._max && convertedValue >= this._min;
|
|
1497
|
-
}
|
|
1498
|
-
isPrecisionCountCorrect(fractionPart = '') {
|
|
1499
|
-
return fractionPart.length <= this.precision;
|
|
1500
|
-
}
|
|
1501
|
-
parseValue(inputValue) {
|
|
1502
|
-
const valueWithoutSpaces = cuiRemoveSpaces(inputValue);
|
|
1503
|
-
switch (valueWithoutSpaces) {
|
|
1504
|
-
case ',':
|
|
1505
|
-
return '0.';
|
|
1506
|
-
case '-,':
|
|
1507
|
-
return '-0.';
|
|
1508
|
-
default:
|
|
1509
|
-
return cuiReplace(valueWithoutSpaces, ',', '.');
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
formatValue(value) {
|
|
1513
|
-
if (!value) {
|
|
1514
|
-
return '';
|
|
1515
|
-
}
|
|
1516
|
-
const [integerPart, fractionPart] = value.split('.');
|
|
1517
|
-
let formattedInteger = this.insertSpacesWithInterval(integerPart) || '0';
|
|
1518
|
-
if (fractionPart !== undefined && integerPart.startsWith('-') && !formattedInteger.slice(1)) {
|
|
1519
|
-
formattedInteger = '-0';
|
|
1520
|
-
}
|
|
1521
|
-
return fractionPart !== undefined ? `${formattedInteger},${fractionPart}` : formattedInteger;
|
|
1522
|
-
}
|
|
1523
|
-
insertSpacesWithInterval(value) {
|
|
1524
|
-
const regex = new RegExp(`\\B(?=(\\d{${this.INTERVAL_BETWEEN_SPACES}})+(?!\\d))`, 'g');
|
|
1525
|
-
return value.replace(regex, ' ');
|
|
1526
|
-
}
|
|
1527
1443
|
changeModel(value) {
|
|
1444
|
+
const parsedValue = maskitoParseNumber(value);
|
|
1528
1445
|
this.value = value;
|
|
1529
|
-
this.onChange(
|
|
1446
|
+
this.onChange(Number.isNaN(parsedValue) ? null : parsedValue);
|
|
1530
1447
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
:
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
}
|
|
1538
|
-
const convertedValue = value.toString();
|
|
1539
|
-
this.formattedValue = this.formatValue(convertedValue);
|
|
1540
|
-
this.changeModel(convertedValue);
|
|
1541
|
-
}
|
|
1542
|
-
decreaseByStep() {
|
|
1543
|
-
const value = this.value === '-'
|
|
1544
|
-
? -this.step
|
|
1545
|
-
: (+(Number(this.value) - this.step).toFixed(this.precision));
|
|
1546
|
-
if (value < this._min) {
|
|
1547
|
-
return;
|
|
1548
|
-
}
|
|
1549
|
-
const convertedValue = value.toString();
|
|
1550
|
-
this.formattedValue = this.formatValue(convertedValue);
|
|
1551
|
-
this.changeModel(convertedValue);
|
|
1552
|
-
}
|
|
1553
|
-
calculateValidMinValue(initialValue) {
|
|
1554
|
-
return initialValue >= this.MIN_JS_NUMBER
|
|
1555
|
-
? initialValue
|
|
1556
|
-
: this.MIN_JS_NUMBER;
|
|
1557
|
-
}
|
|
1558
|
-
calculateValidMaxValue(initialValue) {
|
|
1559
|
-
return initialValue <= this.MAX_JS_NUMBER
|
|
1560
|
-
? initialValue
|
|
1561
|
-
: this.MAX_JS_NUMBER;
|
|
1448
|
+
generateMask() {
|
|
1449
|
+
return maskitoNumberOptionsGenerator({
|
|
1450
|
+
precision: this._precision,
|
|
1451
|
+
min: this._min,
|
|
1452
|
+
max: this._max
|
|
1453
|
+
});
|
|
1562
1454
|
}
|
|
1563
1455
|
}
|
|
1564
1456
|
CuiInputNumberComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1565
|
-
CuiInputNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputNumberComponent, selector: "cui-input-number", inputs: {
|
|
1457
|
+
CuiInputNumberComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputNumberComponent, selector: "cui-input-number", inputs: { precision: "precision", min: "min", max: "max" }, host: { listeners: { "click": "onFocus()" }, properties: { "class._disabled": "this.isDisabled", "attr.data-size": "this.size", "class._with-error": "this.isError" } }, providers: [
|
|
1566
1458
|
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
1567
|
-
cuiProvide(NG_VALUE_ACCESSOR, CuiInputNumberComponent, true)
|
|
1568
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<cui-svg\n *ngIf=\"iconLeft\"\n [icon]=\"iconLeft\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"
|
|
1459
|
+
cuiProvide(NG_VALUE_ACCESSOR, CuiInputNumberComponent, true)
|
|
1460
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<cui-svg\n *ngIf=\"iconLeft\"\n [icon]=\"iconLeft\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"value\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n type=\"text\"\n [maskito]=\"maskOptions\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n\n", styles: [":host{padding-right:13px;padding-left:13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}:host[data-size=sm]{padding-top:7px;padding-bottom:7px}:host[data-size=md]{padding-top:8px;padding-bottom:8px}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-danger)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1569
1461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberComponent, decorators: [{
|
|
1570
1462
|
type: Component,
|
|
1571
1463
|
args: [{ selector: 'cui-input-number', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1572
1464
|
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
1573
|
-
cuiProvide(NG_VALUE_ACCESSOR, CuiInputNumberComponent, true)
|
|
1574
|
-
], template: "<cui-svg\n *ngIf=\"iconLeft\"\n [icon]=\"iconLeft\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"
|
|
1575
|
-
}], propDecorators: {
|
|
1576
|
-
type: Input
|
|
1577
|
-
}], precision: [{
|
|
1465
|
+
cuiProvide(NG_VALUE_ACCESSOR, CuiInputNumberComponent, true)
|
|
1466
|
+
], template: "<cui-svg\n *ngIf=\"iconLeft\"\n [icon]=\"iconLeft\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"value\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n type=\"text\"\n [maskito]=\"maskOptions\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>\n\n", styles: [":host{padding-right:13px;padding-left:13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}:host[data-size=sm]{padding-top:7px;padding-bottom:7px}:host[data-size=md]{padding-top:8px;padding-bottom:8px}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-danger)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex}\n"] }]
|
|
1467
|
+
}], propDecorators: { precision: [{
|
|
1578
1468
|
type: Input
|
|
1579
1469
|
}], min: [{
|
|
1580
1470
|
type: Input
|
|
@@ -1602,6 +1492,7 @@ class CuiInputNumberModule {
|
|
|
1602
1492
|
CuiInputNumberModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1603
1493
|
CuiInputNumberModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, declarations: [CuiInputNumberComponent], imports: [CommonModule,
|
|
1604
1494
|
FormsModule,
|
|
1495
|
+
MaskitoDirective,
|
|
1605
1496
|
CuiSvgModule], exports: [CuiInputNumberComponent,
|
|
1606
1497
|
CuiTextFieldControllerModule] });
|
|
1607
1498
|
CuiInputNumberModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputNumberModule, imports: [CommonModule,
|
|
@@ -1613,7 +1504,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
1613
1504
|
imports: [
|
|
1614
1505
|
CommonModule,
|
|
1615
1506
|
FormsModule,
|
|
1616
|
-
|
|
1507
|
+
MaskitoDirective,
|
|
1508
|
+
CuiSvgModule,
|
|
1617
1509
|
],
|
|
1618
1510
|
declarations: [CuiInputNumberComponent],
|
|
1619
1511
|
exports: [
|
|
@@ -1905,7 +1797,7 @@ CuiInputTimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ve
|
|
|
1905
1797
|
CuiInputTimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CuiInputTimeComponent, selector: "cui-input-time", inputs: { mode: "mode" }, host: { listeners: { "click": "onFocus()" }, properties: { "class._disabled": "this.isDisabled", "attr.data-size": "this.size", "class._with-error": "this.isError" } }, providers: [
|
|
1906
1798
|
CUI_TEXT_FILED_CONTROLLER_PROVIDER,
|
|
1907
1799
|
cuiProvide(NG_VALUE_ACCESSOR, CuiInputTimeComponent, true)
|
|
1908
|
-
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<cui-svg\n icon=\"cuiIconClock\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"computedValue\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n type=\"text\"\n [maskito]=\"maskOptions\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>", styles: [":host{padding-right:13px;padding-left:13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}:host[data-size=sm]{padding-top:7px;padding-bottom:7px}:host[data-size=md]{padding-top:8px;padding-bottom:8px}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-danger)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex}\n"], dependencies: [{ kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type:
|
|
1800
|
+
], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<cui-svg\n icon=\"cuiIconClock\"\n color=\"var(--cui-base-500)\"\n></cui-svg>\n<input\n #input\n [ngModel]=\"computedValue\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n type=\"text\"\n [maskito]=\"maskOptions\"\n [disabled]=\"isDisabled\"\n class=\"c-input\"\n (input)=\"onInput($event)\"\n (focus)=\"onTouched()\"\n>", styles: [":host{padding-right:13px;padding-left:13px;font-weight:400;font-size:14px;line-height:20px;display:flex;align-items:center;gap:8px;border:1px solid var(--cui-base-200);border-radius:8px;cursor:text;background:var(--cui-input);color:var(--cui-base-900);font-family:var(--cui-main-font)}:host:hover{border-color:var(--cui-base-300)}:host:focus-within{box-shadow:0 0 0 2px var(--cui-focus);border-color:var(--cui-info)}:host[data-size=sm]{padding-top:7px;padding-bottom:7px}:host[data-size=md]{padding-top:8px;padding-bottom:8px}:host._disabled{cursor:not-allowed;opacity:.5;background:var(--cui-base-50);border-color:var(--cui-base-200)}:host._with-error{border-color:var(--cui-danger)}:host._with-error:focus-within{box-shadow:0 0 0 2px #d92d2040}.c-input{padding:0;outline:none;margin:0;border-width:0;appearance:none;caret-color:currentColor;background:none;color:inherit;font:inherit;line-height:inherit;width:100%}.c-input:disabled{cursor:not-allowed}.c-input::placeholder{color:var(--cui-base-400)}.c-button{padding:0;border:0;flex-shrink:0;outline:none;cursor:pointer;appearance:none;color:inherit;font:inherit;background:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;display:flex}\n"], dependencies: [{ kind: "directive", type: i2$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MaskitoDirective, selector: "[maskito]", inputs: ["maskito", "maskitoElement"] }, { kind: "component", type: CuiSvgComponent, selector: "cui-svg[icon]", inputs: ["width", "height", "strokeWidth", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1909
1801
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CuiInputTimeComponent, decorators: [{
|
|
1910
1802
|
type: Component,
|
|
1911
1803
|
args: [{ selector: 'cui-input-time', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -2331,6 +2223,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
2331
2223
|
}]
|
|
2332
2224
|
}] });
|
|
2333
2225
|
|
|
2226
|
+
function cuiRemoveSpaces(value) {
|
|
2227
|
+
return value.replace(/\s+/g, '');
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
function cuiReplace(value, search, replace) {
|
|
2231
|
+
const regex = new RegExp(search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
|
|
2232
|
+
return value.replace(regex, replace);
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2334
2235
|
/**
|
|
2335
2236
|
* Generated bundle index. Do not edit.
|
|
2336
2237
|
*/
|