coer-elements 2.0.41 → 2.0.42
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/lib/coer-button/coer-button.component.d.ts +1 -1
- package/components/lib/coer-datebox/coer-datebox.component.d.ts +1 -1
- package/components/lib/coer-modal/coer-modal.component.d.ts +1 -1
- package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +1 -1
- package/components/lib/coer-secretbox/coer-secretbox.component.d.ts +2 -2
- package/components/lib/coer-textarea/coer-textarea.component.d.ts +1 -1
- package/components/lib/coer-textbox/coer-textbox.component.d.ts +1 -1
- package/fesm2022/coer-elements-components.mjs +86 -87
- package/fesm2022/coer-elements-components.mjs.map +1 -1
- package/package.json +1 -1
@@ -6,7 +6,7 @@ export declare class CoerButton implements AfterViewInit {
|
|
6
6
|
protected _innerButton: HTMLElement;
|
7
7
|
protected _innerButtonIcon: HTMLElement;
|
8
8
|
id: import("@angular/core").InputSignal<string>;
|
9
|
-
color: import("@angular/core").InputSignal<"default" | "primary" | "secondary" | "success" | "warning" | "danger" | "navigation" | "
|
9
|
+
color: import("@angular/core").InputSignal<"default" | "primary" | "secondary" | "success" | "warning" | "danger" | "navigation" | "information" | "dark" | "light">;
|
10
10
|
type: import("@angular/core").InputSignal<"filled" | "outline" | "icon" | "icon-outline" | "icon-no-border">;
|
11
11
|
typeBreakpoint: import("@angular/core").InputSignal<IButtonType>;
|
12
12
|
icon: import("@angular/core").InputSignal<string | null | undefined>;
|
@@ -17,7 +17,7 @@ export declare class CoerDateBox extends ControlValue implements AfterViewInit,
|
|
17
17
|
value: import("@angular/core").InputSignal<string | null | undefined>;
|
18
18
|
label: import("@angular/core").InputSignal<string>;
|
19
19
|
placeholder: import("@angular/core").InputSignal<string>;
|
20
|
-
textPosition: import("@angular/core").InputSignal<"
|
20
|
+
textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
|
21
21
|
isInvalid: import("@angular/core").InputSignal<boolean>;
|
22
22
|
isValid: import("@angular/core").InputSignal<boolean>;
|
23
23
|
isLoading: import("@angular/core").InputSignal<boolean>;
|
@@ -13,7 +13,7 @@ export declare class CoerModal implements AfterViewInit {
|
|
13
13
|
title: import("@angular/core").InputSignal<string>;
|
14
14
|
icon: import("@angular/core").InputSignal<string>;
|
15
15
|
showCloseButton: import("@angular/core").InputSignal<boolean>;
|
16
|
-
width: import("@angular/core").InputSignal<"
|
16
|
+
width: import("@angular/core").InputSignal<"small" | "full" | "auto">;
|
17
17
|
height: import("@angular/core").InputSignal<string>;
|
18
18
|
maxHeight: import("@angular/core").InputSignal<string>;
|
19
19
|
onOpen: import("@angular/core").OutputEmitterRef<void>;
|
@@ -17,7 +17,7 @@ export declare class CoerNumberBox extends ControlValue implements AfterViewInit
|
|
17
17
|
value: import("@angular/core").InputSignal<string | number | null | undefined>;
|
18
18
|
label: import("@angular/core").InputSignal<string>;
|
19
19
|
placeholder: import("@angular/core").InputSignal<string>;
|
20
|
-
textPosition: import("@angular/core").InputSignal<"
|
20
|
+
textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
|
21
21
|
min: import("@angular/core").InputSignal<number>;
|
22
22
|
max: import("@angular/core").InputSignal<number>;
|
23
23
|
isInvalid: import("@angular/core").InputSignal<boolean>;
|
@@ -14,7 +14,7 @@ export declare class CoerSecretBox extends ControlValue implements AfterViewInit
|
|
14
14
|
value: import("@angular/core").InputSignal<string | number | null | undefined>;
|
15
15
|
label: import("@angular/core").InputSignal<string>;
|
16
16
|
placeholder: import("@angular/core").InputSignal<string>;
|
17
|
-
textPosition: import("@angular/core").InputSignal<"
|
17
|
+
textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
|
18
18
|
minLength: import("@angular/core").InputSignal<string | number>;
|
19
19
|
maxLength: import("@angular/core").InputSignal<string | number>;
|
20
20
|
isInvalid: import("@angular/core").InputSignal<boolean>;
|
@@ -43,7 +43,7 @@ export declare class CoerSecretBox extends ControlValue implements AfterViewInit
|
|
43
43
|
protected get _passwordType(): boolean;
|
44
44
|
protected _isEnable: import("@angular/core").Signal<boolean>;
|
45
45
|
protected _floatLabel: import("@angular/core").Signal<"auto" | "always">;
|
46
|
-
protected _paddingRight: import("@angular/core").Signal<"0px" | "
|
46
|
+
protected _paddingRight: import("@angular/core").Signal<"0px" | "18px" | "45px">;
|
47
47
|
/** */
|
48
48
|
Focus(select?: boolean, delay?: number): void;
|
49
49
|
/** */
|
@@ -12,7 +12,7 @@ export declare class CoerTextarea extends ControlValue implements AfterViewInit,
|
|
12
12
|
value: import("@angular/core").InputSignal<string | number | null | undefined>;
|
13
13
|
label: import("@angular/core").InputSignal<string>;
|
14
14
|
placeholder: import("@angular/core").InputSignal<string>;
|
15
|
-
textPosition: import("@angular/core").InputSignal<"
|
15
|
+
textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
|
16
16
|
minLength: import("@angular/core").InputSignal<string | number>;
|
17
17
|
maxLength: import("@angular/core").InputSignal<string | number>;
|
18
18
|
isInvalid: import("@angular/core").InputSignal<boolean>;
|
@@ -16,7 +16,7 @@ export declare class CoerTextBox extends ControlValue implements AfterViewInit,
|
|
16
16
|
value: import("@angular/core").InputSignal<string | number | null | undefined>;
|
17
17
|
label: import("@angular/core").InputSignal<string>;
|
18
18
|
placeholder: import("@angular/core").InputSignal<string>;
|
19
|
-
textPosition: import("@angular/core").InputSignal<"
|
19
|
+
textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
|
20
20
|
minLength: import("@angular/core").InputSignal<string | number>;
|
21
21
|
maxLength: import("@angular/core").InputSignal<string | number>;
|
22
22
|
isInvalid: import("@angular/core").InputSignal<boolean>;
|
@@ -271,15 +271,20 @@ class CoerButton {
|
|
271
271
|
Focus(timeout = 0) {
|
272
272
|
Tools.Sleep(timeout).then(() => {
|
273
273
|
if (this._isEnable()) {
|
274
|
-
this.
|
274
|
+
if (this._showButton()) {
|
275
|
+
this._innerButton?.focus();
|
276
|
+
}
|
277
|
+
else if (this._showButtonIcon()) {
|
278
|
+
this._innerButtonIcon?.focus();
|
279
|
+
}
|
275
280
|
}
|
276
281
|
});
|
277
282
|
}
|
278
283
|
/** */
|
279
284
|
Blur(timeout = 0) {
|
280
285
|
Tools.Sleep(timeout).then(() => {
|
281
|
-
this._innerButton
|
282
|
-
this._innerButtonIcon
|
286
|
+
this._innerButton?.blur();
|
287
|
+
this._innerButtonIcon?.blur();
|
283
288
|
});
|
284
289
|
}
|
285
290
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: CoerButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
@@ -640,7 +645,7 @@ class CoerModal {
|
|
640
645
|
}
|
641
646
|
/** */
|
642
647
|
Open() {
|
643
|
-
this._modal
|
648
|
+
this._modal?.show();
|
644
649
|
if (!this._isOpen) {
|
645
650
|
this._isOpen = true;
|
646
651
|
this._isModalOpen.set(true);
|
@@ -649,7 +654,7 @@ class CoerModal {
|
|
649
654
|
}
|
650
655
|
/** */
|
651
656
|
Close() {
|
652
|
-
this._modal
|
657
|
+
this._modal?.hide();
|
653
658
|
if (this._isOpen) {
|
654
659
|
HTMLElements.GetElement(`#${this._id}-button-close`)?.blur();
|
655
660
|
this._isOpen = false;
|
@@ -1290,95 +1295,89 @@ class CoerSelectbox extends ControlValue {
|
|
1290
1295
|
Tools.Sleep().then(_ => {
|
1291
1296
|
//Container
|
1292
1297
|
const container = document.getElementById(`${this._id}-container`);
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
});
|
1300
|
-
}
|
1298
|
+
container?.addEventListener('mouseenter', () => {
|
1299
|
+
this._isOverMenu.set(true);
|
1300
|
+
});
|
1301
|
+
container?.addEventListener('mouseleave', () => {
|
1302
|
+
this._isOverMenu.set(false);
|
1303
|
+
});
|
1301
1304
|
//DropDown
|
1302
1305
|
this._dropDownMenu = document.getElementById(`${this._id}-dropdown-menu`);
|
1303
|
-
|
1304
|
-
this.
|
1305
|
-
|
1306
|
-
|
1307
|
-
this.
|
1308
|
-
|
1309
|
-
});
|
1310
|
-
}
|
1306
|
+
this._dropDownMenu?.addEventListener('mouseenter', () => {
|
1307
|
+
this._isOverMenu.set(true);
|
1308
|
+
});
|
1309
|
+
this._dropDownMenu?.addEventListener('mouseleave', () => {
|
1310
|
+
this._isOverMenu.set(false);
|
1311
|
+
});
|
1311
1312
|
//TextBox
|
1312
1313
|
this._textbox = document.getElementById(this._id);
|
1313
|
-
|
1314
|
-
this.
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
if (
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
else
|
1330
|
-
this._scroll.set(0);
|
1331
|
-
this._dropDownMenu.scrollTo(0, this._scroll());
|
1332
|
-
}
|
1333
|
-
else {
|
1314
|
+
this._textbox?.addEventListener('focus', () => {
|
1315
|
+
if (this._isEnable())
|
1316
|
+
this.Focus();
|
1317
|
+
else
|
1318
|
+
this.Blur();
|
1319
|
+
});
|
1320
|
+
this._textbox?.addEventListener('keyup', (event) => {
|
1321
|
+
const { key } = event;
|
1322
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) {
|
1323
|
+
if (key === 'ArrowUp') {
|
1324
|
+
const firstIndex = (this._dataSource().length <= 0) ? -1 : 0;
|
1325
|
+
if ((this._index() - 1) >= firstIndex) {
|
1326
|
+
this._index.update(index => index - 1);
|
1327
|
+
if (this._index() >= 3)
|
1328
|
+
this._scroll.update(scroll => scroll -= this._scrollByRow);
|
1329
|
+
else
|
1334
1330
|
this._scroll.set(0);
|
1335
|
-
|
1336
|
-
this._textbox.focus();
|
1337
|
-
this._textbox.select();
|
1338
|
-
}
|
1339
|
-
this._dropDownMenu.scrollTo(0, this._scroll());
|
1331
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1340
1332
|
}
|
1341
|
-
else
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
this._scroll.update(scroll => scroll += this._scrollByRow);
|
1347
|
-
}
|
1348
|
-
this._dropDownMenu.scrollTo(0, this._scroll());
|
1333
|
+
else {
|
1334
|
+
this._scroll.set(0);
|
1335
|
+
this._index.set(-1);
|
1336
|
+
this._textbox.focus();
|
1337
|
+
this._textbox.select();
|
1349
1338
|
}
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
this.
|
1339
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1340
|
+
}
|
1341
|
+
else if (key === 'ArrowDown') {
|
1342
|
+
const lastIndex = (this._dataSource().length - 1);
|
1343
|
+
if ((this._index() + 1) <= lastIndex) {
|
1344
|
+
this._index.update(index => index + 1);
|
1345
|
+
if (this._index() >= 3)
|
1346
|
+
this._scroll.update(scroll => scroll += this._scrollByRow);
|
1357
1347
|
}
|
1348
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1358
1349
|
}
|
1359
|
-
else {
|
1360
|
-
if (
|
1361
|
-
this.
|
1350
|
+
else if (['ArrowLeft', 'ArrowRight'].includes(key)) {
|
1351
|
+
if (Tools.IsNotNull(this._value) && !this._isDirty()) {
|
1352
|
+
this._scroll.set(0);
|
1353
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1354
|
+
this._Search(this._displayed);
|
1362
1355
|
}
|
1363
1356
|
this._isDirty.set(true);
|
1364
1357
|
}
|
1358
|
+
}
|
1359
|
+
else {
|
1360
|
+
if (key == 'Delete' && this._search() == '') {
|
1361
|
+
this.Unselect();
|
1362
|
+
}
|
1363
|
+
this._isDirty.set(true);
|
1364
|
+
}
|
1365
|
+
});
|
1366
|
+
this._textbox.addEventListener('keydown', () => {
|
1367
|
+
if (!this._isOpen())
|
1368
|
+
this._Open();
|
1369
|
+
});
|
1370
|
+
this._textbox.addEventListener('mouseenter', () => {
|
1371
|
+
this._isOverMenu.set(true);
|
1372
|
+
});
|
1373
|
+
this._textbox.addEventListener('mouseleave', () => {
|
1374
|
+
this._isOverMenu.set(false);
|
1375
|
+
});
|
1376
|
+
this._textbox.addEventListener('paste', () => {
|
1377
|
+
Tools.Sleep().then(_ => {
|
1378
|
+
this._search.update(search => search = search.toString().trim());
|
1365
1379
|
});
|
1366
|
-
|
1367
|
-
if (!this._isOpen())
|
1368
|
-
this._Open();
|
1369
|
-
});
|
1370
|
-
this._textbox.addEventListener('mouseenter', () => {
|
1371
|
-
this._isOverMenu.set(true);
|
1372
|
-
});
|
1373
|
-
this._textbox.addEventListener('mouseleave', () => {
|
1374
|
-
this._isOverMenu.set(false);
|
1375
|
-
});
|
1376
|
-
this._textbox.addEventListener('paste', () => {
|
1377
|
-
Tools.Sleep().then(_ => {
|
1378
|
-
this._search.update(search => search = search.toString().trim());
|
1379
|
-
});
|
1380
|
-
});
|
1381
|
-
}
|
1380
|
+
});
|
1382
1381
|
//Document
|
1383
1382
|
document.addEventListener('click', () => {
|
1384
1383
|
if (!this._isOverMenu())
|
@@ -1502,7 +1501,7 @@ class CoerSelectbox extends ControlValue {
|
|
1502
1501
|
this._isDirty.set(false);
|
1503
1502
|
this._index.set(-1);
|
1504
1503
|
this._scroll.set(0);
|
1505
|
-
this._dropDownMenu
|
1504
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1506
1505
|
this._search.set(this._displayed);
|
1507
1506
|
Tools.Sleep().then(_ => {
|
1508
1507
|
this._textbox.blur();
|
@@ -1517,15 +1516,15 @@ class CoerSelectbox extends ControlValue {
|
|
1517
1516
|
}
|
1518
1517
|
/** */
|
1519
1518
|
_Open() {
|
1520
|
-
if (!this._dropDownMenu
|
1521
|
-
this._dropDownMenu
|
1519
|
+
if (!this._dropDownMenu?.classList.contains('show')) {
|
1520
|
+
this._dropDownMenu?.classList.add('show');
|
1522
1521
|
}
|
1523
1522
|
this._isOpen.set(true);
|
1524
1523
|
}
|
1525
1524
|
/** */
|
1526
1525
|
_Close() {
|
1527
|
-
if (this._dropDownMenu
|
1528
|
-
this._dropDownMenu
|
1526
|
+
if (this._dropDownMenu?.classList.contains('show')) {
|
1527
|
+
this._dropDownMenu?.classList.remove('show');
|
1529
1528
|
}
|
1530
1529
|
this._isOpen.set(false);
|
1531
1530
|
}
|
@@ -1542,7 +1541,7 @@ class CoerSelectbox extends ControlValue {
|
|
1542
1541
|
else {
|
1543
1542
|
this._scroll.set(0);
|
1544
1543
|
}
|
1545
|
-
this._dropDownMenu
|
1544
|
+
this._dropDownMenu?.scrollTo(0, this._scroll());
|
1546
1545
|
}
|
1547
1546
|
});
|
1548
1547
|
}
|