boruto-xrmui 1.0.12 → 1.0.14
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/fesm2022/boruto-xrmui.mjs +126 -145
- package/fesm2022/boruto-xrmui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/boruto-xrmui.d.ts +34 -27
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ViewEncapsulation, Component, effect, input, output, HostListener, Directive, inject, ElementRef, Input, signal, ChangeDetectorRef, ViewChild, NgModule, Injectable, computed, EventEmitter, Output } from '@angular/core';
|
|
2
|
+
import { ViewEncapsulation, Component, effect, input, output, HostListener, Directive, inject, ElementRef, Input, signal, ChangeDetectorRef, ViewChild, NgModule, Injectable, computed, model, EventEmitter, Output } from '@angular/core';
|
|
3
3
|
import { NgClass, NgStyle } from '@angular/common';
|
|
4
|
+
import { NativeDateAdapter } from '@angular/material/core';
|
|
4
5
|
import { MatIcon } from '@angular/material/icon';
|
|
5
6
|
import { MatBadge } from '@angular/material/badge';
|
|
6
7
|
import { Subject, BehaviorSubject } from 'rxjs';
|
|
@@ -8,6 +9,8 @@ import { CdkDrag } from '@angular/cdk/drag-drop';
|
|
|
8
9
|
import * as i1 from '@angular/forms';
|
|
9
10
|
import { FormsModule } from '@angular/forms';
|
|
10
11
|
import { TextFieldModule } from '@angular/cdk/text-field';
|
|
12
|
+
import * as i2 from '@angular/material/datepicker';
|
|
13
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
11
14
|
import * as i1$1 from '@angular/material/progress-spinner';
|
|
12
15
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
13
16
|
import * as i1$2 from '@angular/material/menu';
|
|
@@ -804,6 +807,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
804
807
|
}]
|
|
805
808
|
}] });
|
|
806
809
|
|
|
810
|
+
class DKCustomDateAdapter extends NativeDateAdapter {
|
|
811
|
+
format(date, displayFormat) {
|
|
812
|
+
if (!date)
|
|
813
|
+
return '';
|
|
814
|
+
const day = this.pad(date.getDate());
|
|
815
|
+
const month = this.pad(date.getMonth() + 1);
|
|
816
|
+
const year = date.getFullYear();
|
|
817
|
+
return `${day}-${month}-${year}`;
|
|
818
|
+
}
|
|
819
|
+
parse(value) {
|
|
820
|
+
if (typeof value !== 'string' || !value.trim())
|
|
821
|
+
return null;
|
|
822
|
+
const parts = value.split('-');
|
|
823
|
+
if (parts.length !== 3)
|
|
824
|
+
return null;
|
|
825
|
+
const day = Number(parts[0]);
|
|
826
|
+
const month = Number(parts[1]) - 1;
|
|
827
|
+
const year = Number(parts[2]);
|
|
828
|
+
const date = new Date(year, month, day);
|
|
829
|
+
return isNaN(date.getTime()) ? null : date;
|
|
830
|
+
}
|
|
831
|
+
pad(n) {
|
|
832
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
807
836
|
class SelectedService {
|
|
808
837
|
selectedItems = {};
|
|
809
838
|
notSelectedItems = {};
|
|
@@ -1359,28 +1388,26 @@ const CTRL_KEYS = ['c', 'C', 'v', 'V', 'x', 'X'];
|
|
|
1359
1388
|
class XrmuiInput {
|
|
1360
1389
|
searchElement;
|
|
1361
1390
|
textareaElement;
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
disabled = false;
|
|
1368
|
-
showlock = true;
|
|
1369
|
-
required = false;
|
|
1370
|
-
type = 'text';
|
|
1371
|
-
setfocus = false;
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
decimalsUsed = new EventEmitter();
|
|
1383
|
-
onEnter = new EventEmitter();
|
|
1391
|
+
datefieldElement;
|
|
1392
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1393
|
+
shortLabel = input(false, { ...(ngDevMode ? { debugName: "shortLabel" } : {}), alias: 'short-label' });
|
|
1394
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1395
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1396
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1397
|
+
showlock = input(true, ...(ngDevMode ? [{ debugName: "showlock" }] : []));
|
|
1398
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
1399
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1400
|
+
setfocus = model(false, ...(ngDevMode ? [{ debugName: "setfocus" }] : []));
|
|
1401
|
+
autocomplete = input(null, ...(ngDevMode ? [{ debugName: "autocomplete" }] : []));
|
|
1402
|
+
selected = model(undefined, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
1403
|
+
onselect = output();
|
|
1404
|
+
error = input(false, ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1405
|
+
validate = model(null, ...(ngDevMode ? [{ debugName: "validate" }] : []));
|
|
1406
|
+
onfocusEvent = output({ alias: 'focus' });
|
|
1407
|
+
onblurEvent = output({ alias: 'blur' });
|
|
1408
|
+
click = output();
|
|
1409
|
+
decimalsUsed = output();
|
|
1410
|
+
onEnter = output();
|
|
1384
1411
|
numberoflines = input(1, ...(ngDevMode ? [{ debugName: "numberoflines" }] : []));
|
|
1385
1412
|
maxlength = input(null, ...(ngDevMode ? [{ debugName: "maxlength" }] : []));
|
|
1386
1413
|
hasfocus = signal(false, ...(ngDevMode ? [{ debugName: "hasfocus" }] : []));
|
|
@@ -1392,31 +1419,46 @@ class XrmuiInput {
|
|
|
1392
1419
|
searchnumber = 0;
|
|
1393
1420
|
current;
|
|
1394
1421
|
currentindex = -1;
|
|
1395
|
-
shadowValue = '';
|
|
1422
|
+
shadowValue = signal('', ...(ngDevMode ? [{ debugName: "shadowValue" }] : []));
|
|
1423
|
+
shadowDate = signal(null, ...(ngDevMode ? [{ debugName: "shadowDate" }] : []));
|
|
1396
1424
|
constructor() {
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
}, 10);
|
|
1405
|
-
}
|
|
1406
|
-
if (this.type == 'number' && this.validate == null) {
|
|
1407
|
-
this.validate = 'decimal';
|
|
1408
|
-
}
|
|
1409
|
-
if (this.value == null) {
|
|
1410
|
-
this.shadowValue = '';
|
|
1411
|
-
}
|
|
1412
|
-
else {
|
|
1413
|
-
if (this.validate == 'decimal') {
|
|
1414
|
-
this.shadowValue = this.value.toString().replace('.', ',');
|
|
1425
|
+
effect(() => {
|
|
1426
|
+
const sf = this.setfocus();
|
|
1427
|
+
if (sf == true) {
|
|
1428
|
+
this.focusMe(undefined);
|
|
1429
|
+
setTimeout(() => {
|
|
1430
|
+
this.setfocus.set(false);
|
|
1431
|
+
}, 10);
|
|
1415
1432
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1433
|
+
});
|
|
1434
|
+
effect(() => {
|
|
1435
|
+
const type = this.type();
|
|
1436
|
+
const validate = this.validate();
|
|
1437
|
+
if (type == 'number' && validate == null) {
|
|
1438
|
+
this.validate.set('decimal');
|
|
1418
1439
|
}
|
|
1419
|
-
}
|
|
1440
|
+
});
|
|
1441
|
+
effect(() => {
|
|
1442
|
+
const value = this.value();
|
|
1443
|
+
if (value == null) {
|
|
1444
|
+
this.shadowValue.set('');
|
|
1445
|
+
this.shadowDate.set(null);
|
|
1446
|
+
return;
|
|
1447
|
+
}
|
|
1448
|
+
if (this.validate() == 'decimal') {
|
|
1449
|
+
this.shadowValue.set(value.toString().replace('.', ','));
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
if (this.validate() == 'date') {
|
|
1453
|
+
this.shadowDate.set(value);
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
this.shadowValue.set(value.toString());
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
pickDate(d) {
|
|
1460
|
+
this.shadowDate.set(d.value);
|
|
1461
|
+
this.value.set(d.value);
|
|
1420
1462
|
}
|
|
1421
1463
|
formatNumber(n) {
|
|
1422
1464
|
if (Math.abs(n) < 1e21) {
|
|
@@ -1428,31 +1470,31 @@ class XrmuiInput {
|
|
|
1428
1470
|
}
|
|
1429
1471
|
}
|
|
1430
1472
|
onValueChanged() {
|
|
1431
|
-
|
|
1432
|
-
|
|
1473
|
+
const sv = this.shadowValue();
|
|
1474
|
+
if (sv == '') {
|
|
1475
|
+
this.value.set(null);
|
|
1433
1476
|
}
|
|
1434
1477
|
else {
|
|
1435
|
-
const next =
|
|
1436
|
-
switch (this.validate) {
|
|
1478
|
+
const next = sv.replace(',', '.');
|
|
1479
|
+
switch (this.validate()) {
|
|
1437
1480
|
case 'number': {
|
|
1438
|
-
this.value
|
|
1481
|
+
this.value.set(Number(this.shadowValue));
|
|
1439
1482
|
break;
|
|
1440
1483
|
}
|
|
1441
1484
|
case 'decimal': {
|
|
1442
|
-
this.value
|
|
1485
|
+
this.value.set(Number(next));
|
|
1443
1486
|
break;
|
|
1444
1487
|
}
|
|
1445
1488
|
default:
|
|
1446
|
-
this.value
|
|
1489
|
+
this.value.set(sv);
|
|
1447
1490
|
}
|
|
1448
|
-
this.
|
|
1449
|
-
if (this.decimalsUsed.observed) {
|
|
1491
|
+
if (this.type() == 'number' && this.validate() == 'decimal') {
|
|
1450
1492
|
var spl = next.split('.');
|
|
1451
1493
|
if (spl.length <= 1) {
|
|
1452
|
-
this.decimalsUsed.
|
|
1494
|
+
this.decimalsUsed.emit(0);
|
|
1453
1495
|
}
|
|
1454
1496
|
else {
|
|
1455
|
-
this.decimalsUsed.
|
|
1497
|
+
this.decimalsUsed.emit(spl[1].length);
|
|
1456
1498
|
}
|
|
1457
1499
|
}
|
|
1458
1500
|
}
|
|
@@ -1466,13 +1508,14 @@ class XrmuiInput {
|
|
|
1466
1508
|
setTimeout(() => {
|
|
1467
1509
|
this.hasfocus.set(false);
|
|
1468
1510
|
this.showitems.set(false);
|
|
1469
|
-
|
|
1470
|
-
|
|
1511
|
+
const sel = this.selected();
|
|
1512
|
+
if (sel && sel.name != this.shadowValue()) {
|
|
1513
|
+
this.selected.set(undefined);
|
|
1471
1514
|
this.onselect.emit(undefined);
|
|
1472
|
-
this.shadowValue
|
|
1515
|
+
this.shadowValue.set('');
|
|
1473
1516
|
}
|
|
1474
1517
|
this.onblurEvent.emit();
|
|
1475
|
-
},
|
|
1518
|
+
}, 200);
|
|
1476
1519
|
}
|
|
1477
1520
|
ondown(e) {
|
|
1478
1521
|
e.stopPropagation();
|
|
@@ -1487,17 +1530,14 @@ class XrmuiInput {
|
|
|
1487
1530
|
onenter(e) {
|
|
1488
1531
|
e.stopPropagation();
|
|
1489
1532
|
e.preventDefault();
|
|
1490
|
-
|
|
1491
|
-
this.onEnter.emit();
|
|
1492
|
-
return;
|
|
1493
|
-
}
|
|
1533
|
+
this.onEnter.emit();
|
|
1494
1534
|
if (this.showitems() == false) {
|
|
1495
1535
|
this.searchbyname();
|
|
1496
1536
|
return;
|
|
1497
1537
|
}
|
|
1498
1538
|
if (this.current != null) {
|
|
1499
|
-
this.value
|
|
1500
|
-
this.selected
|
|
1539
|
+
this.value.set(this.current.name ?? '');
|
|
1540
|
+
this.selected.set(this.current);
|
|
1501
1541
|
this.onselect.emit(this.current);
|
|
1502
1542
|
this.showitems.set(false);
|
|
1503
1543
|
}
|
|
@@ -1510,7 +1550,7 @@ class XrmuiInput {
|
|
|
1510
1550
|
}
|
|
1511
1551
|
onkeydown(e) {
|
|
1512
1552
|
const k = e;
|
|
1513
|
-
if (this.validate != null) {
|
|
1553
|
+
if (this.validate() != null) {
|
|
1514
1554
|
if (NAVIGATIONKEYS.indexOf(k.key) >= 0) {
|
|
1515
1555
|
return;
|
|
1516
1556
|
}
|
|
@@ -1519,13 +1559,13 @@ class XrmuiInput {
|
|
|
1519
1559
|
return;
|
|
1520
1560
|
}
|
|
1521
1561
|
}
|
|
1522
|
-
if (this.validate == 'number') {
|
|
1562
|
+
if (this.validate() == 'number') {
|
|
1523
1563
|
if (NUMBERS.indexOf(k.key) < 0) {
|
|
1524
1564
|
e.preventDefault();
|
|
1525
1565
|
e.stopPropagation();
|
|
1526
1566
|
}
|
|
1527
1567
|
}
|
|
1528
|
-
if (this.validate == 'decimal') {
|
|
1568
|
+
if (this.validate() == 'decimal') {
|
|
1529
1569
|
if (DECIMALS.indexOf(k.key) < 0) {
|
|
1530
1570
|
e.preventDefault();
|
|
1531
1571
|
e.stopPropagation();
|
|
@@ -1536,8 +1576,8 @@ class XrmuiInput {
|
|
|
1536
1576
|
select(e, v) {
|
|
1537
1577
|
e.stopImmediatePropagation();
|
|
1538
1578
|
e.stopPropagation();
|
|
1539
|
-
this.value
|
|
1540
|
-
this.selected
|
|
1579
|
+
this.value.set(v.name ?? '');
|
|
1580
|
+
this.selected.set(v);
|
|
1541
1581
|
this.onselect.emit(v);
|
|
1542
1582
|
}
|
|
1543
1583
|
next(e) {
|
|
@@ -1557,12 +1597,15 @@ class XrmuiInput {
|
|
|
1557
1597
|
}
|
|
1558
1598
|
focusMe(e) {
|
|
1559
1599
|
e?.stopPropagation();
|
|
1560
|
-
if (!this.disabled && this.searchElement != null) {
|
|
1600
|
+
if (!this.disabled() && this.searchElement != null) {
|
|
1561
1601
|
this.searchElement.nativeElement.focus();
|
|
1562
1602
|
}
|
|
1563
|
-
if (!this.disabled && this.textareaElement != null) {
|
|
1603
|
+
if (!this.disabled() && this.textareaElement != null) {
|
|
1564
1604
|
this.textareaElement.nativeElement.focus();
|
|
1565
1605
|
}
|
|
1606
|
+
if (!this.disabled() && this.datefieldElement != null) {
|
|
1607
|
+
this.datefieldElement.nativeElement.focus();
|
|
1608
|
+
}
|
|
1566
1609
|
this.click.emit();
|
|
1567
1610
|
}
|
|
1568
1611
|
searchbyname() {
|
|
@@ -1574,12 +1617,13 @@ class XrmuiInput {
|
|
|
1574
1617
|
}, 600);
|
|
1575
1618
|
}
|
|
1576
1619
|
async dosearchbyname() {
|
|
1577
|
-
|
|
1620
|
+
const ap = this.autocomplete();
|
|
1621
|
+
if (ap != null) {
|
|
1578
1622
|
this.currentindex = -1;
|
|
1579
1623
|
this.current = undefined;
|
|
1580
1624
|
this.searchnumber++;
|
|
1581
1625
|
var next = this.searchnumber;
|
|
1582
|
-
var nextlist = await
|
|
1626
|
+
var nextlist = await ap.search(this.value()?.toString() ?? '');
|
|
1583
1627
|
if (this.searchnumber == next) {
|
|
1584
1628
|
this.items = nextlist;
|
|
1585
1629
|
}
|
|
@@ -1594,84 +1638,21 @@ class XrmuiInput {
|
|
|
1594
1638
|
}
|
|
1595
1639
|
}
|
|
1596
1640
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: XrmuiInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1597
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: XrmuiInput, isStandalone: true, selector: "xrmui-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal:
|
|
1641
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: XrmuiInput, isStandalone: true, selector: "xrmui-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, shortLabel: { classPropertyName: "shortLabel", publicName: "short-label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showlock: { classPropertyName: "showlock", publicName: "showlock", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, setfocus: { classPropertyName: "setfocus", publicName: "setfocus", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, validate: { classPropertyName: "validate", publicName: "validate", isSignal: true, isRequired: false, transformFunction: null }, numberoflines: { classPropertyName: "numberoflines", publicName: "numberoflines", isSignal: true, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", setfocus: "setfocusChange", selected: "selectedChange", onselect: "onselect", validate: "validateChange", onfocusEvent: "focus", onblurEvent: "blur", click: "click", decimalsUsed: "decimalsUsed", onEnter: "onEnter" }, viewQueries: [{ propertyName: "searchElement", first: true, predicate: ["inputfield"], descendants: true }, { propertyName: "textareaElement", first: true, predicate: ["textareafield"], descendants: true }, { propertyName: "datefieldElement", first: true, predicate: ["datefield"], descendants: true }], ngImport: i0, template: "@if (showitems()) {\r\n <div class=\"autocomplete\" [ngClass]=\"{ nolabel: (!label() || label().length == 0), shortLabel: shortLabel() }\">\r\n @if (itemlist().length == 0) {\r\n <div class=\"element\"><div class=\"item\">Ingen fundet</div>div></div>\r\n }\r\n @for (elm of itemlist(); track elm) {\r\n <div class=\"element\" [ngClass]=\"{ current: current == elm, selectable: !elm.disabled }\" (click)=\"select($event, elm)\">\r\n <div class=\"item\">{{ elm.name }}</div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@if (label() != '' && label().length > 0) {\r\n<div class=\"label\" [ngClass]=\"{ short: shortLabel() }\" (click)=\"focusMe($event)\">{{ label() }}</div>\r\n}\r\n@if (label() != '' || type() == 'number') {\r\n<div class=\"locked\">\r\n @if (required()) {\r\n <div style=\"display: inline-block;height: 10px;color: red; position: relative; top: -8px; right: 0\">*</div>\r\n }\r\n @if (disabled() && showlock()) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n</div>\r\n}\r\n<div class=\"input\" [ngClass]=\"{ focus: hasfocus(), error: error(), textarea: numberoflines() > 1 }\" (click)=\"focusMe($event)\">\r\n @if (numberoflines() == 1 && validate() != 'date') {\r\n <input \r\n #inputfield \r\n [ngClass]=\"type()\"\r\n [type]=\"type() != 'password'? 'text' : 'password'\"\r\n [disabled]=\"disabled()\" \r\n [placeholder]=\"placeholder()\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"\r\n [maxlength]=\"maxlength()\"/>\r\n }\r\n @if (numberoflines() == 1 && validate() == 'date') {\r\n <input\r\n class=\"datepicker\"\r\n [matDatepicker]=\"picker\"\r\n [value]=\"shadowDate\"\r\n (dateChange)=\"pickDate($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n #datefield/>\r\n <mat-icon \r\n class=\"calendar-icon\" \r\n (click)=\"picker.open()\" \r\n style=\"font-size: 25px; width: 25px; height: 25px; color: darkgray\">calendar_month</mat-icon>\r\n <mat-datepicker #picker></mat-datepicker>\r\n }\r\n @if (numberoflines() > 1) {\r\n <textarea\r\n #textareafield\r\n [maxlength]=\"maxlength()\"\r\n [rows]=\"numberoflines()\"\r\n [disabled]=\"disabled()\" \r\n [placeholder]=\"placeholder()\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"></textarea>\r\n }\r\n</div>\r\n\r\n@if (label() == '' && type() != 'number') {\r\n <div class=\"locked\" style=\"text-align: left;\">\r\n @if (disabled() && showlock()) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{position:relative;display:flex;margin-bottom:10px}:host div.autocomplete{position:absolute;z-index:100;top:37px;left:215px;right:0;background-color:red;min-height:40px;background-color:#fff;color:#000;border:solid;border-width:1px 1px 1px 1px;border-color:#d3d3d3;border-radius:4px;padding:5px}:host div.autocomplete.nolabel{left:0}:host div.autocomplete.shortLabel{left:124px}:host div.autocomplete div.element.selectable{cursor:pointer}@media(prefers-color-scheme:dark){:host div.autocomplete{background-color:#000;color:#fff}}:host div.autocomplete div.element{margin:5px;padding:5px;display:flex;border:solid;border-width:0 0 1px 0;border-color:#d3d3d3;font-size:14px;color:gray}:host div.autocomplete div.element.current{border-color:#0f6cbd;color:#000}:host div.autocomplete div.element div.item{flex-grow:1}:host div.label{width:180px;min-width:180px;max-height:180px;height:32px;line-height:32px}:host div.label.short{width:90px;min-width:90px}:host div.locked{width:30px;min-width:30px;max-width:30px;height:32px;line-height:32px;text-align:right;padding-right:3px}:host div.input{flex-grow:1;height:32px;line-height:32px;background-color:#e6e8e8;border-radius:3px;margin:0;padding:0;border:solid;border-width:0 0 3px 0;border-color:transparent}:host div.input.textarea{height:inherit}:host div textarea{background-color:#e6e8e8;border-radius:3px;margin:0;padding:10px 15px;border:solid;border-width:0 0 3px 0;border-color:transparent;width:100%;box-sizing:border-box}:host div.input.focus,:host div.textarea.focus{border-color:#0f6cbd}:host div.input.error,:host div.input.focus.error{border-color:red;color:red}:host input{background-color:transparent;margin:0;border:none;height:29px;padding:0 0 0 15px;width:100%;box-sizing:border-box}:host input.datepicker{width:calc(100% - 35px)}@media(prefers-color-scheme:dark){:host input{color:#000}:host input:disabled{color:#5f615f}}:host input.number{text-align:right;padding-right:15px;padding-left:0}:host *:focus{outline:none}:host mat-icon{color:#d3d3d3;font-size:12px;position:relative;top:5px;width:12px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TextFieldModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i2.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i2.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }] });
|
|
1598
1642
|
}
|
|
1599
1643
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: XrmuiInput, decorators: [{
|
|
1600
1644
|
type: Component,
|
|
1601
|
-
args: [{ selector: 'xrmui-input', imports: [FormsModule, NgClass, MatIcon, TextFieldModule], template: "@if (showitems()) {\r\n <div class=\"autocomplete\" [ngClass]=\"{ nolabel: (!label || label.length == 0) }\">\r\n @if (itemlist().length == 0) {\r\n <div class=\"element\"><div class=\"item\">Ingen fundet</div>div></div>\r\n }\r\n @for (elm of itemlist(); track elm) {\r\n <div class=\"element\" [ngClass]=\"{ current: current == elm, selectable: !elm.disabled }\" (click)=\"select($event, elm)\">\r\n <div class=\"item\">{{ elm.name }}</div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@if (label != '') {\r\n<div class=\"label\" [ngClass]=\"{ short: shortLabel }\" (click)=\"focusMe($event)\">{{ label }}</div>\r\n}\r\n@if (label != '' || type == 'number') {\r\n<div class=\"locked\">\r\n @if (required) {\r\n <div style=\"display: inline-block;height: 10px;color: red; position: relative; top: -8px; right: 0\">*</div>\r\n }\r\n @if (disabled && showlock) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n</div>\r\n}\r\n<div class=\"input\" [ngClass]=\"{ focus: hasfocus(), error: error, textarea: numberoflines() > 1 }\" (click)=\"focusMe($event)\">\r\n @if (numberoflines() == 1) {\r\n <input \r\n #inputfield \r\n [ngClass]=\"type\"\r\n [type]=\"type != 'password'? 'text' : 'password'\"\r\n [disabled]=\"disabled\" \r\n [placeholder]=\"placeholder\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"\r\n [maxlength]=\"maxlength()\"/>\r\n }\r\n @if (numberoflines() > 1) {\r\n <textarea\r\n #textareafield\r\n [maxlength]=\"maxlength()\"\r\n [rows]=\"numberoflines()\"\r\n [disabled]=\"disabled\" \r\n [placeholder]=\"placeholder\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"></textarea>\r\n }\r\n</div>\r\n\r\n@if (label == '' && type != 'number') {\r\n <div class=\"locked\" style=\"text-align: left;\">\r\n @if (disabled && showlock) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{position:relative;display:flex;margin-bottom:10px}:host div.autocomplete{position:absolute;z-index:100;top:37px;left:215px;right:0;background-color:red;min-height:40px;background-color:#fff;color:#000;border:solid;border-width:1px 1px 1px 1px;border-color:#d3d3d3;border-radius:4px;padding:5px}:host div.autocomplete.nolabel{left:0}:host div.autocomplete div.element.selectable{cursor:pointer}@media(prefers-color-scheme:dark){:host div.autocomplete{background-color:#000;color:#fff}}:host div.autocomplete div.element{margin:5px;padding:5px;display:flex;border:solid;border-width:0 0 1px 0;border-color:#d3d3d3;font-size:14px;color:gray}:host div.autocomplete div.element.current{border-color:#0f6cbd;color:#000}:host div.autocomplete div.element div.item{flex-grow:1}:host div.label{width:180px;min-width:180px;max-height:180px;height:32px;line-height:32px}:host div.label.short{width:90px;min-width:90px}:host div.locked{width:30px;min-width:30px;max-width:30px;height:32px;line-height:32px;text-align:right;padding-right:3px}:host div.input{flex-grow:1;height:32px;line-height:32px;background-color:#e6e8e8;border-radius:3px;margin:0;padding:0;border:solid;border-width:0 0 3px 0;border-color:transparent}:host div.input.textarea{height:inherit}:host div textarea{background-color:#e6e8e8;border-radius:3px;margin:0;padding:
|
|
1645
|
+
args: [{ selector: 'xrmui-input', imports: [FormsModule, NgClass, MatIcon, TextFieldModule, MatDatepickerModule], template: "@if (showitems()) {\r\n <div class=\"autocomplete\" [ngClass]=\"{ nolabel: (!label() || label().length == 0), shortLabel: shortLabel() }\">\r\n @if (itemlist().length == 0) {\r\n <div class=\"element\"><div class=\"item\">Ingen fundet</div>div></div>\r\n }\r\n @for (elm of itemlist(); track elm) {\r\n <div class=\"element\" [ngClass]=\"{ current: current == elm, selectable: !elm.disabled }\" (click)=\"select($event, elm)\">\r\n <div class=\"item\">{{ elm.name }}</div>\r\n </div>\r\n }\r\n </div>\r\n}\r\n@if (label() != '' && label().length > 0) {\r\n<div class=\"label\" [ngClass]=\"{ short: shortLabel() }\" (click)=\"focusMe($event)\">{{ label() }}</div>\r\n}\r\n@if (label() != '' || type() == 'number') {\r\n<div class=\"locked\">\r\n @if (required()) {\r\n <div style=\"display: inline-block;height: 10px;color: red; position: relative; top: -8px; right: 0\">*</div>\r\n }\r\n @if (disabled() && showlock()) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n</div>\r\n}\r\n<div class=\"input\" [ngClass]=\"{ focus: hasfocus(), error: error(), textarea: numberoflines() > 1 }\" (click)=\"focusMe($event)\">\r\n @if (numberoflines() == 1 && validate() != 'date') {\r\n <input \r\n #inputfield \r\n [ngClass]=\"type()\"\r\n [type]=\"type() != 'password'? 'text' : 'password'\"\r\n [disabled]=\"disabled()\" \r\n [placeholder]=\"placeholder()\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"\r\n [maxlength]=\"maxlength()\"/>\r\n }\r\n @if (numberoflines() == 1 && validate() == 'date') {\r\n <input\r\n class=\"datepicker\"\r\n [matDatepicker]=\"picker\"\r\n [value]=\"shadowDate\"\r\n (dateChange)=\"pickDate($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n #datefield/>\r\n <mat-icon \r\n class=\"calendar-icon\" \r\n (click)=\"picker.open()\" \r\n style=\"font-size: 25px; width: 25px; height: 25px; color: darkgray\">calendar_month</mat-icon>\r\n <mat-datepicker #picker></mat-datepicker>\r\n }\r\n @if (numberoflines() > 1) {\r\n <textarea\r\n #textareafield\r\n [maxlength]=\"maxlength()\"\r\n [rows]=\"numberoflines()\"\r\n [disabled]=\"disabled()\" \r\n [placeholder]=\"placeholder()\" \r\n [(ngModel)]=\"shadowValue\" \r\n (ngModelChange)=\"onValueChanged()\" \r\n (focus)=\"onFocus()\" \r\n (blur)=\"onBlur()\"\r\n (keydown.arrowdown)=\"ondown($event)\"\r\n (keydown.arrowup)=\"onup($event)\"\r\n (keydown.enter)=\"onenter($event)\"\r\n (keydown.esc)=\"onesc($event)\"\r\n (keydown)=\"onkeydown($event)\"></textarea>\r\n }\r\n</div>\r\n\r\n@if (label() == '' && type() != 'number') {\r\n <div class=\"locked\" style=\"text-align: left;\">\r\n @if (disabled() && showlock()) {\r\n <mat-icon>lock</mat-icon>\r\n }\r\n </div>\r\n}\r\n", styles: [":host{position:relative;display:flex;margin-bottom:10px}:host div.autocomplete{position:absolute;z-index:100;top:37px;left:215px;right:0;background-color:red;min-height:40px;background-color:#fff;color:#000;border:solid;border-width:1px 1px 1px 1px;border-color:#d3d3d3;border-radius:4px;padding:5px}:host div.autocomplete.nolabel{left:0}:host div.autocomplete.shortLabel{left:124px}:host div.autocomplete div.element.selectable{cursor:pointer}@media(prefers-color-scheme:dark){:host div.autocomplete{background-color:#000;color:#fff}}:host div.autocomplete div.element{margin:5px;padding:5px;display:flex;border:solid;border-width:0 0 1px 0;border-color:#d3d3d3;font-size:14px;color:gray}:host div.autocomplete div.element.current{border-color:#0f6cbd;color:#000}:host div.autocomplete div.element div.item{flex-grow:1}:host div.label{width:180px;min-width:180px;max-height:180px;height:32px;line-height:32px}:host div.label.short{width:90px;min-width:90px}:host div.locked{width:30px;min-width:30px;max-width:30px;height:32px;line-height:32px;text-align:right;padding-right:3px}:host div.input{flex-grow:1;height:32px;line-height:32px;background-color:#e6e8e8;border-radius:3px;margin:0;padding:0;border:solid;border-width:0 0 3px 0;border-color:transparent}:host div.input.textarea{height:inherit}:host div textarea{background-color:#e6e8e8;border-radius:3px;margin:0;padding:10px 15px;border:solid;border-width:0 0 3px 0;border-color:transparent;width:100%;box-sizing:border-box}:host div.input.focus,:host div.textarea.focus{border-color:#0f6cbd}:host div.input.error,:host div.input.focus.error{border-color:red;color:red}:host input{background-color:transparent;margin:0;border:none;height:29px;padding:0 0 0 15px;width:100%;box-sizing:border-box}:host input.datepicker{width:calc(100% - 35px)}@media(prefers-color-scheme:dark){:host input{color:#000}:host input:disabled{color:#5f615f}}:host input.number{text-align:right;padding-right:15px;padding-left:0}:host *:focus{outline:none}:host mat-icon{color:#d3d3d3;font-size:12px;position:relative;top:5px;width:12px}\n"] }]
|
|
1602
1646
|
}], ctorParameters: () => [], propDecorators: { searchElement: [{
|
|
1603
1647
|
type: ViewChild,
|
|
1604
1648
|
args: ['inputfield']
|
|
1605
1649
|
}], textareaElement: [{
|
|
1606
1650
|
type: ViewChild,
|
|
1607
1651
|
args: ['textareafield']
|
|
1608
|
-
}],
|
|
1609
|
-
type:
|
|
1610
|
-
args: ['
|
|
1611
|
-
}], shortLabel: [{
|
|
1612
|
-
type: Input,
|
|
1613
|
-
args: ['short-label']
|
|
1614
|
-
}], placeholder: [{
|
|
1615
|
-
type: Input,
|
|
1616
|
-
args: ['placeholder']
|
|
1617
|
-
}], value: [{
|
|
1618
|
-
type: Input,
|
|
1619
|
-
args: ['value']
|
|
1620
|
-
}], valueChange: [{
|
|
1621
|
-
type: Output,
|
|
1622
|
-
args: ['valueChange']
|
|
1623
|
-
}], disabled: [{
|
|
1624
|
-
type: Input,
|
|
1625
|
-
args: ['disabled']
|
|
1626
|
-
}], showlock: [{
|
|
1627
|
-
type: Input,
|
|
1628
|
-
args: ['showlock']
|
|
1629
|
-
}], required: [{
|
|
1630
|
-
type: Input,
|
|
1631
|
-
args: ['required']
|
|
1632
|
-
}], type: [{
|
|
1633
|
-
type: Input,
|
|
1634
|
-
args: ['type']
|
|
1635
|
-
}], setfocus: [{
|
|
1636
|
-
type: Input,
|
|
1637
|
-
args: ['setfocus']
|
|
1638
|
-
}], setfocusChange: [{
|
|
1639
|
-
type: Output,
|
|
1640
|
-
args: ['setfocusChange']
|
|
1641
|
-
}], autocomplete: [{
|
|
1642
|
-
type: Input,
|
|
1643
|
-
args: ['autocomplete']
|
|
1644
|
-
}], selected: [{
|
|
1645
|
-
type: Input,
|
|
1646
|
-
args: ['selected']
|
|
1647
|
-
}], onselect: [{
|
|
1648
|
-
type: Output,
|
|
1649
|
-
args: ['onselect']
|
|
1650
|
-
}], error: [{
|
|
1651
|
-
type: Input,
|
|
1652
|
-
args: ['error']
|
|
1653
|
-
}], message: [{
|
|
1654
|
-
type: Input,
|
|
1655
|
-
args: ['message']
|
|
1656
|
-
}], validate: [{
|
|
1657
|
-
type: Input,
|
|
1658
|
-
args: ['validate']
|
|
1659
|
-
}], onfocusEvent: [{
|
|
1660
|
-
type: Output,
|
|
1661
|
-
args: ['focus']
|
|
1662
|
-
}], onblurEvent: [{
|
|
1663
|
-
type: Output,
|
|
1664
|
-
args: ['blur']
|
|
1665
|
-
}], click: [{
|
|
1666
|
-
type: Output,
|
|
1667
|
-
args: ['click']
|
|
1668
|
-
}], decimalsUsed: [{
|
|
1669
|
-
type: Output,
|
|
1670
|
-
args: ['decimalsUsed']
|
|
1671
|
-
}], onEnter: [{
|
|
1672
|
-
type: Output,
|
|
1673
|
-
args: ['onEnter']
|
|
1674
|
-
}], numberoflines: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberoflines", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }] } });
|
|
1652
|
+
}], datefieldElement: [{
|
|
1653
|
+
type: ViewChild,
|
|
1654
|
+
args: ['datefield']
|
|
1655
|
+
}], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], shortLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "short-label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showlock: [{ type: i0.Input, args: [{ isSignal: true, alias: "showlock", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], setfocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "setfocus", required: false }] }, { type: i0.Output, args: ["setfocusChange"] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }, { type: i0.Output, args: ["selectedChange"] }], onselect: [{ type: i0.Output, args: ["onselect"] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], validate: [{ type: i0.Input, args: [{ isSignal: true, alias: "validate", required: false }] }, { type: i0.Output, args: ["validateChange"] }], onfocusEvent: [{ type: i0.Output, args: ["focus"] }], onblurEvent: [{ type: i0.Output, args: ["blur"] }], click: [{ type: i0.Output, args: ["click"] }], decimalsUsed: [{ type: i0.Output, args: ["decimalsUsed"] }], onEnter: [{ type: i0.Output, args: ["onEnter"] }], numberoflines: [{ type: i0.Input, args: [{ isSignal: true, alias: "numberoflines", required: false }] }], maxlength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxlength", required: false }] }] } });
|
|
1675
1656
|
|
|
1676
1657
|
class XrmuiRibbon {
|
|
1677
1658
|
fill = input(true, ...(ngDevMode ? [{ debugName: "fill" }] : []));
|
|
@@ -1837,5 +1818,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
1837
1818
|
* Generated bundle index. Do not edit.
|
|
1838
1819
|
*/
|
|
1839
1820
|
|
|
1840
|
-
export { BorutoXrmUIModule, CTRL_KEYS, DECIMALS, KiponUiModule, KoAlertComponent, KoButtonGroupComponent, KoDecimalDirective, KoDivider, KoExpansionPanelComponent, KoFocusDirective, KoHeaderComponent, KoHorizontalScrollComponent, KoHorizontalSplitComponent, KoLeftMenuComponent, KoMainComponent, KoNavigationByCssClass, KoNavigationByImageUrl, KoOverDirective, KoTablePanelComponent, KoTitlePanelComponent, KoTopMenuComponent, KoVerticalScrollComponent, KoVerticalSplitComponent, KoViewComponent, KoWriteDirective, NAVIGATIONKEYS, NUMBERS, XrmuiButton, XrmuiIcon, XrmuiInfo, XrmuiInput, XrmuiLayout, XrmuiPanel, XrmuiRibbon, XrmuiSpinner };
|
|
1821
|
+
export { BorutoXrmUIModule, CTRL_KEYS, DECIMALS, DKCustomDateAdapter, KiponUiModule, KoAlertComponent, KoButtonGroupComponent, KoDecimalDirective, KoDivider, KoExpansionPanelComponent, KoFocusDirective, KoHeaderComponent, KoHorizontalScrollComponent, KoHorizontalSplitComponent, KoLeftMenuComponent, KoMainComponent, KoNavigationByCssClass, KoNavigationByImageUrl, KoOverDirective, KoTablePanelComponent, KoTitlePanelComponent, KoTopMenuComponent, KoVerticalScrollComponent, KoVerticalSplitComponent, KoViewComponent, KoWriteDirective, NAVIGATIONKEYS, NUMBERS, XrmuiButton, XrmuiIcon, XrmuiInfo, XrmuiInput, XrmuiLayout, XrmuiPanel, XrmuiRibbon, XrmuiSpinner };
|
|
1841
1822
|
//# sourceMappingURL=boruto-xrmui.mjs.map
|