ps-toolkit-ui 1.3.7 → 1.3.8
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/bundles/ps-toolkit-ui.umd.js +10 -26
- package/bundles/ps-toolkit-ui.umd.js.map +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js +1 -1
- package/bundles/ps-toolkit-ui.umd.min.js.map +1 -1
- package/esm2015/lib/components/form/bank-card/form.bank-card.component.js +1 -2
- package/esm2015/lib/components/form/checkbox/form.checkbox.component.js +6 -19
- package/esm2015/lib/components/table/row/table.row.component.js +1 -3
- package/fesm2015/ps-toolkit-ui.js +85 -101
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/lib/components/form/checkbox/form.checkbox.component.d.ts +0 -2
- package/package.json +1 -1
- package/ps-toolkit-ui.metadata.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inject, Component, Input, EventEmitter, Output, ViewChild, Pipe, NgModule, Injectable } from '@angular/core';
|
|
2
|
-
import * as
|
|
2
|
+
import * as $ from 'jquery';
|
|
3
3
|
import { ajax, param } from 'jquery';
|
|
4
4
|
import { merge, get, set, cloneDeep } from 'lodash';
|
|
5
5
|
import * as moment from 'jalali-moment';
|
|
@@ -28,9 +28,9 @@ class AccordionComponent {
|
|
|
28
28
|
constructor() {
|
|
29
29
|
}
|
|
30
30
|
toggle(e) {
|
|
31
|
-
const chOpen =
|
|
31
|
+
const chOpen = $(e.target).closest('.accordion').find('.content.open');
|
|
32
32
|
const ocOpen = chOpen.closest('.accordion-item').find('.header > .icon');
|
|
33
|
-
const ch =
|
|
33
|
+
const ch = $(e.target).closest('.accordion-item').find(' > .content');
|
|
34
34
|
const oc = ch.closest('.accordion-item').find(' > .header > .icon');
|
|
35
35
|
if (ch.hasClass('open')) {
|
|
36
36
|
ch.removeClass('open');
|
|
@@ -783,9 +783,9 @@ class HelperClass {
|
|
|
783
783
|
static addNotification(m, e = true) {
|
|
784
784
|
const id = HelperClass.random(20);
|
|
785
785
|
// tslint:disable-next-line
|
|
786
|
-
|
|
786
|
+
$('#Notifications').append('<div id="' + id + '" class="con"><div class="item ' + (e ? 'error' : 'success') + '"><i class="fas fa-times"></i><div>' + m + '</div></div></div>');
|
|
787
787
|
setTimeout(() => {
|
|
788
|
-
const d =
|
|
788
|
+
const d = $('#' + id);
|
|
789
789
|
d.fadeOut(300, () => {
|
|
790
790
|
d.remove();
|
|
791
791
|
});
|
|
@@ -1547,13 +1547,13 @@ class AccordionRowClass {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
toggle() {
|
|
1549
1549
|
setTimeout(() => {
|
|
1550
|
-
|
|
1550
|
+
$('#AccordionRow' + this.id + ' > .header').click();
|
|
1551
1551
|
}, 100);
|
|
1552
1552
|
}
|
|
1553
1553
|
open() {
|
|
1554
1554
|
setTimeout(() => {
|
|
1555
|
-
if (
|
|
1556
|
-
|
|
1555
|
+
if (!$('#AccordionRow' + this.id + ' > .content').hasClass('open')) {
|
|
1556
|
+
$('#AccordionRow' + this.id + ' > .header').click();
|
|
1557
1557
|
}
|
|
1558
1558
|
}, 100);
|
|
1559
1559
|
}
|
|
@@ -1573,7 +1573,7 @@ class HeaderComponent {
|
|
|
1573
1573
|
};
|
|
1574
1574
|
}
|
|
1575
1575
|
showUserDropDown(e) {
|
|
1576
|
-
|
|
1576
|
+
$(e.target).closest('#Header').find('.user-drop-down').slideToggle(100);
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
1579
|
HeaderComponent.decorators = [
|
|
@@ -1621,7 +1621,7 @@ class SidebarItemComponent {
|
|
|
1621
1621
|
};
|
|
1622
1622
|
}
|
|
1623
1623
|
openClose(e) {
|
|
1624
|
-
const op =
|
|
1624
|
+
const op = $(e.target).closest('.user-sidebar-item');
|
|
1625
1625
|
if (op.hasClass('open')) {
|
|
1626
1626
|
op.removeClass('open');
|
|
1627
1627
|
op.find(' > .children').slideUp();
|
|
@@ -1643,7 +1643,7 @@ class SidebarItemComponent {
|
|
|
1643
1643
|
return false;
|
|
1644
1644
|
}
|
|
1645
1645
|
closeSidebar() {
|
|
1646
|
-
|
|
1646
|
+
$('#Sidebar').addClass('open').removeClass('close');
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
SidebarItemComponent.decorators = [
|
|
@@ -1720,7 +1720,7 @@ class SidebarComponent {
|
|
|
1720
1720
|
return null;
|
|
1721
1721
|
}
|
|
1722
1722
|
toggleSidebar() {
|
|
1723
|
-
|
|
1723
|
+
$('#Sidebar').toggleClass('open').toggleClass('close');
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
1726
|
SidebarComponent.decorators = [
|
|
@@ -1990,15 +1990,15 @@ class TableRowComponent {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
this.showChildren = new InputClass(this.table.environment, this.table.l, this.table.name + 'SubsetTitle', 'fa-duotone fa-angle-left f-s-22', this.row.Data.CountChild > 0 || (!this.table.childrenAutoLoad && this.children.length > 0) ? InputType.Icon : InputType.Hidden, 'h-25 m-h-5 d-ib va-m f-u');
|
|
1992
1992
|
this.showChildren.onClick = () => {
|
|
1993
|
-
if (
|
|
1994
|
-
|
|
1993
|
+
if ($(this.childrenDiv.nativeElement).is(':visible')) {
|
|
1994
|
+
$(this.childrenDiv.nativeElement).slideUp();
|
|
1995
1995
|
this.showChildren.icon = 'fa-duotone fa-angle-left f-s-22';
|
|
1996
1996
|
}
|
|
1997
1997
|
else if (this.children.length === 0) {
|
|
1998
1998
|
this.loadChildren(this.row.Data.Id);
|
|
1999
1999
|
}
|
|
2000
2000
|
else {
|
|
2001
|
-
|
|
2001
|
+
$(this.childrenDiv.nativeElement).slideDown();
|
|
2002
2002
|
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
2003
2003
|
}
|
|
2004
2004
|
};
|
|
@@ -2022,7 +2022,7 @@ class TableRowComponent {
|
|
|
2022
2022
|
new RequestClass(this.table.environment, this.table.l).send(this.table.url + `List/${p}`, Method.Post, null, this.showChildren, (result) => {
|
|
2023
2023
|
this.children = result.List;
|
|
2024
2024
|
setTimeout(() => {
|
|
2025
|
-
|
|
2025
|
+
$(this.childrenDiv.nativeElement).slideDown();
|
|
2026
2026
|
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
2027
2027
|
}, 50);
|
|
2028
2028
|
});
|
|
@@ -2040,13 +2040,13 @@ class TableRowComponent {
|
|
|
2040
2040
|
setTimeout(() => {
|
|
2041
2041
|
if (this.table.hasChildren) {
|
|
2042
2042
|
// @ts-ignore
|
|
2043
|
-
|
|
2043
|
+
$(this.childrenDiv.nativeElement).sortable({
|
|
2044
2044
|
axis: 'y',
|
|
2045
2045
|
handle: '> .row > .item-con > .handle-sortable',
|
|
2046
2046
|
update: () => {
|
|
2047
2047
|
const data = [];
|
|
2048
2048
|
// @ts-ignore
|
|
2049
|
-
|
|
2049
|
+
$(this.childrenDiv.nativeElement).sortable('toArray').forEach(x => data.push(x));
|
|
2050
2050
|
new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, data, null, () => {
|
|
2051
2051
|
if (this.table.onSort) {
|
|
2052
2052
|
this.table.onSort();
|
|
@@ -2058,13 +2058,11 @@ class TableRowComponent {
|
|
|
2058
2058
|
}, 500);
|
|
2059
2059
|
}
|
|
2060
2060
|
setOptions() {
|
|
2061
|
-
console.log('setOptionssetOptionssetOptionssetOptions');
|
|
2062
2061
|
const opts = [];
|
|
2063
2062
|
for (const option of this.row.Options.filter(x => x.Type === PermissionTypeEnum.Option && x.InputAction === PermissionInputActionEnum.Input)) {
|
|
2064
2063
|
const inp = new InputClass(this.table.environment, this.table.l, null, null, InputType.Check, 'h-25 without-border m-h-5 d-ib va-m f-u', this.row.Data[option.Action] === true);
|
|
2065
2064
|
inp.row = this.row;
|
|
2066
2065
|
inp.onChange = () => {
|
|
2067
|
-
console.log(inp.data(), 'onChangeonChangeonChange');
|
|
2068
2066
|
this.row.Data[option.Action] = !inp.data();
|
|
2069
2067
|
const p = new PermissionClass();
|
|
2070
2068
|
p.RelatedId = this.table.permissions.RelatedId;
|
|
@@ -2373,8 +2371,8 @@ class ModalClass {
|
|
|
2373
2371
|
if (this.onShow) {
|
|
2374
2372
|
this.onShow();
|
|
2375
2373
|
}
|
|
2376
|
-
|
|
2377
|
-
|
|
2374
|
+
$('body').addClass('open-modal');
|
|
2375
|
+
$('#' + this.id + 'Modal').fadeIn(300, () => {
|
|
2378
2376
|
if (this.form != null) {
|
|
2379
2377
|
const i = this.form.inputs.find(x => !x.disabled && x.type !== InputType.Label && x.type !== InputType.Hidden &&
|
|
2380
2378
|
x.type !== InputType.Constant && x.type !== InputType.Submit && x.type !== InputType.Button && x.type !== InputType.Icon &&
|
|
@@ -2386,8 +2384,8 @@ class ModalClass {
|
|
|
2386
2384
|
});
|
|
2387
2385
|
}
|
|
2388
2386
|
hide() {
|
|
2389
|
-
|
|
2390
|
-
|
|
2387
|
+
$('body').removeClass('open-modal');
|
|
2388
|
+
$('#' + this.id + 'Modal').fadeOut(300, () => {
|
|
2391
2389
|
if (this.form && this.form.name !== 'Confirm' && this.form.name !== 'Alert') {
|
|
2392
2390
|
this.form.clear();
|
|
2393
2391
|
if (this.form.onHideModal) {
|
|
@@ -2469,7 +2467,7 @@ class TableComponent {
|
|
|
2469
2467
|
this.table.load(this.reload);
|
|
2470
2468
|
};
|
|
2471
2469
|
this.maximum.onClick = () => {
|
|
2472
|
-
|
|
2470
|
+
$(this.tableDiv.nativeElement).toggleClass('maximum');
|
|
2473
2471
|
this.maximum.icon = this.maximum.name === 'Minimum' ? 'fa-duotone fa-arrows-maximize' : 'fa-duotone fa-arrows-minimize';
|
|
2474
2472
|
this.maximum.name = this.maximum.name === 'Minimum' ? 'Maximum' : 'Minimum';
|
|
2475
2473
|
};
|
|
@@ -2508,13 +2506,13 @@ class TableComponent {
|
|
|
2508
2506
|
setSortable() {
|
|
2509
2507
|
setTimeout(() => {
|
|
2510
2508
|
// @ts-ignore
|
|
2511
|
-
|
|
2509
|
+
$(this.rows.nativeElement).sortable({
|
|
2512
2510
|
axis: 'y',
|
|
2513
2511
|
items: 'tr',
|
|
2514
2512
|
update: () => {
|
|
2515
2513
|
const data = [];
|
|
2516
2514
|
// @ts-ignore
|
|
2517
|
-
|
|
2515
|
+
$(this.rows.nativeElement).sortable('toArray').forEach(x => data.push(x));
|
|
2518
2516
|
new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, { Ids: data }, null, () => {
|
|
2519
2517
|
if (this.table.onSort) {
|
|
2520
2518
|
this.table.onSort();
|
|
@@ -2545,7 +2543,7 @@ class TableComponent {
|
|
|
2545
2543
|
this.confirm.show(this.table.l('DeleteConfirm'), this.table.url + 'Delete/' + e.id, null, e.accept);
|
|
2546
2544
|
}
|
|
2547
2545
|
changeSort(e, s) {
|
|
2548
|
-
if (
|
|
2546
|
+
if ($(e.target).closest('.header-search').hasClass('header-search')) {
|
|
2549
2547
|
return;
|
|
2550
2548
|
}
|
|
2551
2549
|
this.table.sortType = this.table.sort === s ? this.table.sortType === 'ASC' ? 'DESC' : 'ASC' : 'ASC';
|
|
@@ -2712,13 +2710,12 @@ class FormBankCardComponent {
|
|
|
2712
2710
|
};
|
|
2713
2711
|
}
|
|
2714
2712
|
setIcon() {
|
|
2715
|
-
console.log(this.part1.data().toString() + this.part2.data().toString());
|
|
2716
2713
|
const b = this.banks.filter(x => x.startWith.includes(this.part1.data().toString() + this.part2.data().toString().substring(0, 2)));
|
|
2717
2714
|
if (b.length > 0) {
|
|
2718
|
-
|
|
2715
|
+
$(this.inputIcon.nativeElement).removeClass('fa-money-check').addClass(b[0].name);
|
|
2719
2716
|
}
|
|
2720
2717
|
else {
|
|
2721
|
-
|
|
2718
|
+
$(this.inputIcon.nativeElement).addClass('fa-money-check').removeClass(this.banks.map(x => x.name));
|
|
2722
2719
|
}
|
|
2723
2720
|
}
|
|
2724
2721
|
changeFocus(p, a) {
|
|
@@ -2799,7 +2796,7 @@ class FormButtonComponent {
|
|
|
2799
2796
|
};
|
|
2800
2797
|
}
|
|
2801
2798
|
onFocusIn() {
|
|
2802
|
-
|
|
2799
|
+
$(this.inputBase.nativeElement).focus();
|
|
2803
2800
|
}
|
|
2804
2801
|
onClick(e) {
|
|
2805
2802
|
if (e.screenX && e.screenX !== 0 && e.screenY && e.screenY !== 0) {
|
|
@@ -2860,10 +2857,9 @@ class FormCheckboxComponent {
|
|
|
2860
2857
|
this.changeIndex = new EventEmitter();
|
|
2861
2858
|
}
|
|
2862
2859
|
ngOnInit() {
|
|
2863
|
-
console.log(this.inp.value, 'ngOnInitngOnInitngOnInit');
|
|
2864
2860
|
this.inp.clear = () => {
|
|
2865
2861
|
this.inp.error = null;
|
|
2866
|
-
this.
|
|
2862
|
+
this.inp.value = this.inp.default;
|
|
2867
2863
|
};
|
|
2868
2864
|
this.inp.isValid = () => {
|
|
2869
2865
|
this.inp.error = null;
|
|
@@ -2877,7 +2873,7 @@ class FormCheckboxComponent {
|
|
|
2877
2873
|
return this.inp.value;
|
|
2878
2874
|
};
|
|
2879
2875
|
this.inp.setValue = (v) => {
|
|
2880
|
-
this.
|
|
2876
|
+
this.inp.value = v;
|
|
2881
2877
|
};
|
|
2882
2878
|
this.inp.focus = () => {
|
|
2883
2879
|
this.onFocusIn();
|
|
@@ -2888,18 +2884,7 @@ class FormCheckboxComponent {
|
|
|
2888
2884
|
this.inputBase.nativeElement.focus();
|
|
2889
2885
|
}
|
|
2890
2886
|
onClick() {
|
|
2891
|
-
this.
|
|
2892
|
-
console.log(this.inp.value, 'onClickonClickonClick');
|
|
2893
|
-
this.onChange();
|
|
2894
|
-
}
|
|
2895
|
-
setValue(v) {
|
|
2896
|
-
this.inp.value = v;
|
|
2897
|
-
if (v) {
|
|
2898
|
-
$(this.inputCon.nativeElement).addClass('checked');
|
|
2899
|
-
}
|
|
2900
|
-
else {
|
|
2901
|
-
$(this.inputCon.nativeElement).removeClass('checked');
|
|
2902
|
-
}
|
|
2887
|
+
this.inputBase.nativeElement.click();
|
|
2903
2888
|
}
|
|
2904
2889
|
onChange() {
|
|
2905
2890
|
if (this.inp.onChange) {
|
|
@@ -2919,7 +2904,7 @@ class FormCheckboxComponent {
|
|
|
2919
2904
|
FormCheckboxComponent.decorators = [
|
|
2920
2905
|
{ type: Component, args: [{
|
|
2921
2906
|
selector: 'lib-form-checkbox',
|
|
2922
|
-
template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [style]=\"inp.style\" [className]=\"'form-input-con checkbox w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + (!inp.displayLabel ? ' without-label' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onFocusIn()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"></div>\r\n <input (keydown)=\"onKeyDown($event)\" #inputBase type=\"checkbox\" class=\"check\">\r\n <div (click)=\"onClick()\"
|
|
2907
|
+
template: "<div #inputDiv [id]=\"inp.name + 'Input'\" [style]=\"inp.style\" [className]=\"'form-input-con checkbox w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + (inp.icon == null ? ' without-icon' : '') + (!inp.displayLabel ? ' without-label' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onFocusIn()\">\r\n <div *ngIf=\"inp.displayLabel\" class=\"label\"></div>\r\n <input (keydown)=\"onKeyDown($event)\" (change)=\"onChange()\" [disabled]=\"inp.disabled\" [(ngModel)]=\"inp.value\" #inputBase type=\"checkbox\" [name]=\"inp.name\" class=\"check\">\r\n <div (click)=\"onClick()\" class=\"control\">{{inp.l(inp.name)}}</div>\r\n <i *ngIf=\"inp.icon != null || inp.loading\" #inputIcon [className]=\"(inp.loading ? 'fa-duotone fa-spin fa-spinner' : inp.icon) + ' icon'\"></i>\r\n </div>\r\n</div>\r\n",
|
|
2923
2908
|
styles: [".form-input-con.checkbox{padding:0 15px;position:relative}.form-input-con.checkbox .form-input{float:right;position:relative;width:100%}.form-input-con.checkbox .form-input .label{cursor:default;direction:rtl;font-size:12px;height:20px;margin-bottom:3px;padding:0 10px;text-align:right}.form-input-con.checkbox .form-input .control,.form-input-con.checkbox .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;float:right;line-height:20px;width:100%}.form-input-con.checkbox .form-input .control{align-items:center;background-color:#fff;border:var(--border-input);border-radius:var(--border-radius-base);cursor:pointer;display:flex;font-size:11px;justify-content:center;min-height:35px;padding:5px 45px;position:relative;text-align:center;z-index:2}.form-input-con.checkbox.without-border .form-input .control{border:unset}.form-input-con.checkbox .form-input .control:after{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:17px;font-weight:400;height:35px;line-height:32px;position:absolute;right:0;top:0;width:35px}.form-input-con.checkbox:not(.without-border) .form-input .check:focus+.control,.form-input-con.checkbox:not(.without-border) .form-input .control:hover{border:var(--border-input-dark);outline:none}.form-input-con.checkbox.error .form-input .control{border:var(--border-input-red)}.form-input-con.checkbox.error .form-input .control,.form-input-con.checkbox.error .form-input span.icon{color:var(--red)}.form-input-con.checkbox .form-input .check{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.form-input-con.checkbox .form-input .control.checked:after{animation:pop .18s ease-in;color:var(--green);content:\"\\f14a\";font-weight:900}.form-input-con.checkbox .form-input i.icon{color:var(--primary);cursor:pointer;font-size:13px;height:35px;left:0;line-height:35px;position:absolute;text-align:center;top:24px;transition:all .35s ease-in-out;width:35px;z-index:2}.form-input-con.checkbox.without-label .form-input i.icon{top:0}.form-input-con.checkbox.without-icon .form-input .control{padding:0 35px 0 0}.form-input-con.checkbox.h-30 .form-input .control{font-size:10px;line-height:28px;min-height:30px;padding:0 40px}.form-input-con.checkbox.h-30 .form-input .control:after{font-size:14px;height:30px;line-height:28px;width:30px}.form-input-con.checkbox.h-30 .form-input i.icon{font-size:11px;height:30px;line-height:30px;width:30px}.form-input-con.checkbox.h-30.without-icon .form-input .control{padding:0 30px 0 0}.form-input-con.checkbox.h-25 .form-input .control{font-size:10px;line-height:23px;min-height:25px;padding:0 25px}.form-input-con.checkbox.h-25 .form-input .control:after{font-size:14px;height:25px;line-height:23px;width:25px}.form-input-con.checkbox.h-25 .form-input i.icon{font-size:11px;height:25px;line-height:25px;width:25px}.form-input-con.checkbox.h-25.without-icon .form-input .control{padding:0 25px 0 0}"]
|
|
2924
2909
|
},] }
|
|
2925
2910
|
];
|
|
@@ -2928,8 +2913,7 @@ FormCheckboxComponent.propDecorators = {
|
|
|
2928
2913
|
inp: [{ type: Input }],
|
|
2929
2914
|
changeIndex: [{ type: Output }],
|
|
2930
2915
|
inputBase: [{ type: ViewChild, args: ['inputBase',] }],
|
|
2931
|
-
inputDiv: [{ type: ViewChild, args: ['inputDiv',] }]
|
|
2932
|
-
inputCon: [{ type: ViewChild, args: ['inputCon',] }]
|
|
2916
|
+
inputDiv: [{ type: ViewChild, args: ['inputDiv',] }]
|
|
2933
2917
|
};
|
|
2934
2918
|
|
|
2935
2919
|
class FormDateComponent {
|
|
@@ -2984,7 +2968,7 @@ class FormDateComponent {
|
|
|
2984
2968
|
this.openCalendar();
|
|
2985
2969
|
};
|
|
2986
2970
|
this.inp.focusOut = () => {
|
|
2987
|
-
|
|
2971
|
+
$(this.inputBase.nativeElement).blur();
|
|
2988
2972
|
};
|
|
2989
2973
|
}
|
|
2990
2974
|
setInpValue(v) {
|
|
@@ -3069,16 +3053,16 @@ class FormDateComponent {
|
|
|
3069
3053
|
}
|
|
3070
3054
|
openCalendar() {
|
|
3071
3055
|
this.setPosition();
|
|
3072
|
-
|
|
3056
|
+
$(this.inputBase.nativeElement).focus();
|
|
3073
3057
|
}
|
|
3074
3058
|
onKeyDown(e) {
|
|
3075
3059
|
const code = e.keyCode || e.which;
|
|
3076
3060
|
if (code === 9 || code === 13) {
|
|
3077
3061
|
e.preventDefault();
|
|
3078
|
-
|
|
3062
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
3079
3063
|
this.changeIndex.emit(code === 9 ? e.shiftKey ? 'ShiftTab' : 'Tab' : e.shiftKey ? 'ShiftEnter' : 'Enter');
|
|
3080
3064
|
if (!this.inForm) {
|
|
3081
|
-
|
|
3065
|
+
$(this.inputBase.nativeElement).blur();
|
|
3082
3066
|
}
|
|
3083
3067
|
}
|
|
3084
3068
|
}
|
|
@@ -3110,7 +3094,7 @@ class FormDateComponent {
|
|
|
3110
3094
|
}
|
|
3111
3095
|
}
|
|
3112
3096
|
onFocusOut() {
|
|
3113
|
-
|
|
3097
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
3114
3098
|
this.inp.search = this.inp.value;
|
|
3115
3099
|
this.state = 'day';
|
|
3116
3100
|
}
|
|
@@ -3119,10 +3103,10 @@ class FormDateComponent {
|
|
|
3119
3103
|
const offsetOfBottom = window.innerHeight - rect.bottom;
|
|
3120
3104
|
const height = this.inputCalendarDiv.nativeElement.offsetHeight;
|
|
3121
3105
|
if (offsetOfBottom < height) {
|
|
3122
|
-
|
|
3106
|
+
$(this.inputDiv.nativeElement).addClass('top');
|
|
3123
3107
|
}
|
|
3124
3108
|
else {
|
|
3125
|
-
|
|
3109
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
3126
3110
|
}
|
|
3127
3111
|
}
|
|
3128
3112
|
selectDate(d) {
|
|
@@ -3137,10 +3121,10 @@ class FormDateComponent {
|
|
|
3137
3121
|
d.selected = true;
|
|
3138
3122
|
this.cSearch = this.inp.search;
|
|
3139
3123
|
setTimeout(() => {
|
|
3140
|
-
|
|
3124
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
3141
3125
|
this.changeIndex.emit('Tab');
|
|
3142
3126
|
if (!this.inForm) {
|
|
3143
|
-
|
|
3127
|
+
$(this.inputBase.nativeElement).blur();
|
|
3144
3128
|
}
|
|
3145
3129
|
}, 10);
|
|
3146
3130
|
if (this.inp.onChange) {
|
|
@@ -3365,7 +3349,7 @@ class FormFileComponent {
|
|
|
3365
3349
|
});
|
|
3366
3350
|
}
|
|
3367
3351
|
onClick() {
|
|
3368
|
-
|
|
3352
|
+
$(this.inputBase.nativeElement).focus();
|
|
3369
3353
|
}
|
|
3370
3354
|
onChange(e) {
|
|
3371
3355
|
this.inp.error = null;
|
|
@@ -3384,7 +3368,7 @@ class FormFileComponent {
|
|
|
3384
3368
|
}
|
|
3385
3369
|
}
|
|
3386
3370
|
onFocusIn() {
|
|
3387
|
-
|
|
3371
|
+
$(this.inputBase.nativeElement).focus();
|
|
3388
3372
|
}
|
|
3389
3373
|
title() {
|
|
3390
3374
|
if (this.inp.value == null || (this.inp.value instanceof Array && this.inp.value.length === 0)) {
|
|
@@ -3426,7 +3410,7 @@ class FormIconComponent {
|
|
|
3426
3410
|
};
|
|
3427
3411
|
}
|
|
3428
3412
|
onFocusIn() {
|
|
3429
|
-
|
|
3413
|
+
$(this.inputBase.nativeElement).focus();
|
|
3430
3414
|
}
|
|
3431
3415
|
onClick(e) {
|
|
3432
3416
|
if (e.screenX && e.screenX !== 0 && e.screenY && e.screenY !== 0) {
|
|
@@ -3680,28 +3664,28 @@ class FormPlaqueSelectComponent {
|
|
|
3680
3664
|
}
|
|
3681
3665
|
};
|
|
3682
3666
|
this.part1.onFocusOut = (e) => {
|
|
3683
|
-
if (
|
|
3667
|
+
if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
|
|
3684
3668
|
if (this.open) {
|
|
3685
3669
|
this.closeOptions();
|
|
3686
3670
|
}
|
|
3687
3671
|
}
|
|
3688
3672
|
};
|
|
3689
3673
|
this.part2.onFocusOut = (e) => {
|
|
3690
|
-
if (
|
|
3674
|
+
if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
|
|
3691
3675
|
if (this.open) {
|
|
3692
3676
|
this.closeOptions();
|
|
3693
3677
|
}
|
|
3694
3678
|
}
|
|
3695
3679
|
};
|
|
3696
3680
|
this.part3.onFocusOut = (e) => {
|
|
3697
|
-
if (
|
|
3681
|
+
if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
|
|
3698
3682
|
if (this.open) {
|
|
3699
3683
|
this.closeOptions();
|
|
3700
3684
|
}
|
|
3701
3685
|
}
|
|
3702
3686
|
};
|
|
3703
3687
|
this.part4.onFocusOut = (e) => {
|
|
3704
|
-
if (
|
|
3688
|
+
if (!$(e.relatedTarget).closest('.form-input.plaque-select').hasClass('plaque-select') && !$(e.rangeParent).closest('.form-input.plaque-select').hasClass('plaque-select')) {
|
|
3705
3689
|
if (this.open) {
|
|
3706
3690
|
this.closeOptions();
|
|
3707
3691
|
}
|
|
@@ -3842,8 +3826,8 @@ class FormPlaqueSelectComponent {
|
|
|
3842
3826
|
}
|
|
3843
3827
|
setHoverCenter() {
|
|
3844
3828
|
setTimeout(() => {
|
|
3845
|
-
const hover =
|
|
3846
|
-
const items =
|
|
3829
|
+
const hover = $(this.inputOptionsDiv.nativeElement).find('.option.hover');
|
|
3830
|
+
const items = $(this.inputOptionsDiv.nativeElement).find('.items');
|
|
3847
3831
|
if (hover.length === 0) {
|
|
3848
3832
|
return;
|
|
3849
3833
|
}
|
|
@@ -4180,7 +4164,7 @@ class FormRadioComponent {
|
|
|
4180
4164
|
}
|
|
4181
4165
|
}
|
|
4182
4166
|
onFocusIn() {
|
|
4183
|
-
|
|
4167
|
+
$(this.inputBase.nativeElement).focus();
|
|
4184
4168
|
}
|
|
4185
4169
|
}
|
|
4186
4170
|
FormRadioComponent.decorators = [
|
|
@@ -4209,8 +4193,8 @@ class FormSelectItemComponent {
|
|
|
4209
4193
|
this.select.hover = opt.index;
|
|
4210
4194
|
}
|
|
4211
4195
|
toggleChildren(e) {
|
|
4212
|
-
const ch =
|
|
4213
|
-
const oc =
|
|
4196
|
+
const ch = $(e.target).closest('.option-con').find(' > .children');
|
|
4197
|
+
const oc = $(e.target).closest('.option-con').find(' > .caret-icon');
|
|
4214
4198
|
if (ch.hasClass('open')) {
|
|
4215
4199
|
ch.removeClass('open');
|
|
4216
4200
|
ch.slideUp();
|
|
@@ -4295,7 +4279,7 @@ class FormSelectComponent {
|
|
|
4295
4279
|
return !this.inp.multiple ? (this.inp.addNew ? this.inp.search : this.inp.value) : this.getSelected();
|
|
4296
4280
|
};
|
|
4297
4281
|
this.inp.focusOut = () => {
|
|
4298
|
-
|
|
4282
|
+
$(this.inputBase.nativeElement).blur();
|
|
4299
4283
|
};
|
|
4300
4284
|
}
|
|
4301
4285
|
loadOptions() {
|
|
@@ -4310,14 +4294,14 @@ class FormSelectComponent {
|
|
|
4310
4294
|
openOptions() {
|
|
4311
4295
|
this.setPosition();
|
|
4312
4296
|
this.setHoverCenter();
|
|
4313
|
-
|
|
4297
|
+
$(this.inputBase.nativeElement).focus();
|
|
4314
4298
|
}
|
|
4315
4299
|
onFocusOut() {
|
|
4316
4300
|
this.closeOptions();
|
|
4317
4301
|
}
|
|
4318
4302
|
closeOptions() {
|
|
4319
4303
|
setTimeout(() => {
|
|
4320
|
-
|
|
4304
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
4321
4305
|
this.inp.hover = -1;
|
|
4322
4306
|
if (this.inp.value === null) {
|
|
4323
4307
|
if (!this.inp.addNew) {
|
|
@@ -4338,10 +4322,10 @@ class FormSelectComponent {
|
|
|
4338
4322
|
const offsetOfBottom = window.innerHeight - rect.bottom;
|
|
4339
4323
|
const height = this.inputOptionsDiv.nativeElement.offsetHeight;
|
|
4340
4324
|
if (offsetOfBottom < height) {
|
|
4341
|
-
|
|
4325
|
+
$(this.inputDiv.nativeElement).addClass('top');
|
|
4342
4326
|
}
|
|
4343
4327
|
else {
|
|
4344
|
-
|
|
4328
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
4345
4329
|
}
|
|
4346
4330
|
}
|
|
4347
4331
|
setOptions(r = this.inp.options) {
|
|
@@ -4359,7 +4343,7 @@ class FormSelectComponent {
|
|
|
4359
4343
|
}
|
|
4360
4344
|
else if (code === 13) {
|
|
4361
4345
|
e.preventDefault();
|
|
4362
|
-
if (
|
|
4346
|
+
if ($(this.inputBase.nativeElement).is(':focus')) {
|
|
4363
4347
|
const h = this.getSelectedHover();
|
|
4364
4348
|
if (!h) {
|
|
4365
4349
|
return;
|
|
@@ -4389,7 +4373,7 @@ class FormSelectComponent {
|
|
|
4389
4373
|
}
|
|
4390
4374
|
}
|
|
4391
4375
|
toggleOption(e) {
|
|
4392
|
-
if (this.inp.multiple &&
|
|
4376
|
+
if (this.inp.multiple && $(e.target).closest('.option').hasClass('option')) {
|
|
4393
4377
|
return;
|
|
4394
4378
|
}
|
|
4395
4379
|
this.openOptions();
|
|
@@ -4500,7 +4484,7 @@ class FormSelectComponent {
|
|
|
4500
4484
|
setTimeout(() => {
|
|
4501
4485
|
this.changeIndex.emit(i);
|
|
4502
4486
|
if (!this.inForm) {
|
|
4503
|
-
|
|
4487
|
+
$(this.inputBase.nativeElement).blur();
|
|
4504
4488
|
}
|
|
4505
4489
|
}, 10);
|
|
4506
4490
|
setTimeout(() => {
|
|
@@ -4509,8 +4493,8 @@ class FormSelectComponent {
|
|
|
4509
4493
|
}
|
|
4510
4494
|
setHoverCenter() {
|
|
4511
4495
|
setTimeout(() => {
|
|
4512
|
-
const hover =
|
|
4513
|
-
const items =
|
|
4496
|
+
const hover = $(this.inputOptionsDiv.nativeElement).find('.option.hover');
|
|
4497
|
+
const items = $(this.inputOptionsDiv.nativeElement).find('.items');
|
|
4514
4498
|
if (hover.length === 0) {
|
|
4515
4499
|
return;
|
|
4516
4500
|
}
|
|
@@ -5022,7 +5006,7 @@ class FormTimeComponent {
|
|
|
5022
5006
|
this.openOptions();
|
|
5023
5007
|
};
|
|
5024
5008
|
this.inp.focusOut = () => {
|
|
5025
|
-
|
|
5009
|
+
$(this.inputBase.nativeElement).blur();
|
|
5026
5010
|
};
|
|
5027
5011
|
}
|
|
5028
5012
|
toggleTime() {
|
|
@@ -5030,27 +5014,27 @@ class FormTimeComponent {
|
|
|
5030
5014
|
}
|
|
5031
5015
|
openOptions() {
|
|
5032
5016
|
this.setPosition();
|
|
5033
|
-
|
|
5017
|
+
$(this.inputBase.nativeElement).focus();
|
|
5034
5018
|
}
|
|
5035
5019
|
setPosition() {
|
|
5036
5020
|
const rect = this.inputDiv.nativeElement.getBoundingClientRect();
|
|
5037
5021
|
const offsetOfBottom = window.innerHeight - rect.bottom;
|
|
5038
5022
|
const height = this.inputOptionsDiv.nativeElement.offsetHeight;
|
|
5039
5023
|
if (offsetOfBottom < height) {
|
|
5040
|
-
|
|
5024
|
+
$(this.inputDiv.nativeElement).addClass('top');
|
|
5041
5025
|
}
|
|
5042
5026
|
else {
|
|
5043
|
-
|
|
5027
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
5044
5028
|
}
|
|
5045
5029
|
}
|
|
5046
5030
|
onKeyDown(e) {
|
|
5047
5031
|
const code = e.keyCode || e.which;
|
|
5048
5032
|
if (code === 9 || code === 13) {
|
|
5049
5033
|
e.preventDefault();
|
|
5050
|
-
|
|
5034
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
5051
5035
|
this.changeIndex.emit(code === 9 ? e.shiftKey ? 'ShiftTab' : 'Tab' : e.shiftKey ? 'ShiftEnter' : 'Enter');
|
|
5052
5036
|
if (!this.inForm) {
|
|
5053
|
-
|
|
5037
|
+
$(this.inputBase.nativeElement).blur();
|
|
5054
5038
|
}
|
|
5055
5039
|
}
|
|
5056
5040
|
}
|
|
@@ -5073,7 +5057,7 @@ class FormTimeComponent {
|
|
|
5073
5057
|
}
|
|
5074
5058
|
}
|
|
5075
5059
|
onFocusOut() {
|
|
5076
|
-
|
|
5060
|
+
$(this.inputDiv.nativeElement).removeClass('top');
|
|
5077
5061
|
this.inp.search = this.inp.value;
|
|
5078
5062
|
}
|
|
5079
5063
|
selectTime(v, s) {
|
|
@@ -5117,8 +5101,8 @@ class FormTreeItemComponent {
|
|
|
5117
5101
|
this.item.parent = this.parent;
|
|
5118
5102
|
}
|
|
5119
5103
|
openClose(e) {
|
|
5120
|
-
const ch =
|
|
5121
|
-
const oc =
|
|
5104
|
+
const ch = $(e.target).closest('.row-item').find(' > .children');
|
|
5105
|
+
const oc = $(e.target).closest('.row-item').find(' > .open-close');
|
|
5122
5106
|
if (ch.hasClass('open')) {
|
|
5123
5107
|
ch.removeClass('open');
|
|
5124
5108
|
ch.stop().slideUp();
|
|
@@ -5192,7 +5176,7 @@ class FormTreeComponent {
|
|
|
5192
5176
|
}
|
|
5193
5177
|
}
|
|
5194
5178
|
onFocusIn() {
|
|
5195
|
-
|
|
5179
|
+
$(this.inputBase.nativeElement).focus();
|
|
5196
5180
|
}
|
|
5197
5181
|
getSelected() {
|
|
5198
5182
|
let l = [];
|
|
@@ -6277,15 +6261,15 @@ class TableOldRowComponent {
|
|
|
6277
6261
|
}
|
|
6278
6262
|
this.showChildren = new InputClass(this.table.environment, this.table.l, this.table.name + 'SubsetTitle', 'fa-duotone fa-angle-left f-s-22', this.row.Data.CountChild > 0 || (!this.table.childrenAutoLoad && this.children.length > 0) ? InputType.Icon : InputType.Hidden, 'h-25 m-h-5 d-ib va-m f-u');
|
|
6279
6263
|
this.showChildren.onClick = () => {
|
|
6280
|
-
if (
|
|
6281
|
-
|
|
6264
|
+
if ($(this.childrenDiv.nativeElement).is(':visible')) {
|
|
6265
|
+
$(this.childrenDiv.nativeElement).hide();
|
|
6282
6266
|
this.showChildren.icon = 'fa-duotone fa-angle-left f-s-22';
|
|
6283
6267
|
}
|
|
6284
6268
|
else if (this.children.length === 0) {
|
|
6285
6269
|
this.loadChildren(this.row.Data.Id);
|
|
6286
6270
|
}
|
|
6287
6271
|
else {
|
|
6288
|
-
|
|
6272
|
+
$(this.childrenDiv.nativeElement).show();
|
|
6289
6273
|
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
6290
6274
|
}
|
|
6291
6275
|
};
|
|
@@ -6308,7 +6292,7 @@ class TableOldRowComponent {
|
|
|
6308
6292
|
new RequestClass(this.table.environment, this.table.l).send(this.table.url + `List/${p}`, Method.Post, null, this.showChildren, (result) => {
|
|
6309
6293
|
this.children = result.List;
|
|
6310
6294
|
setTimeout(() => {
|
|
6311
|
-
|
|
6295
|
+
$(this.childrenDiv.nativeElement).slideDown();
|
|
6312
6296
|
this.showChildren.icon = 'fa-duotone fa-angle-down f-s-22';
|
|
6313
6297
|
}, 50);
|
|
6314
6298
|
});
|
|
@@ -6326,13 +6310,13 @@ class TableOldRowComponent {
|
|
|
6326
6310
|
setTimeout(() => {
|
|
6327
6311
|
if (this.table.hasChildren) {
|
|
6328
6312
|
// @ts-ignore
|
|
6329
|
-
|
|
6313
|
+
$(this.childrenDiv.nativeElement).sortable({
|
|
6330
6314
|
axis: 'y',
|
|
6331
6315
|
handle: '> .row > .item-con > .handle-sortable',
|
|
6332
6316
|
update: () => {
|
|
6333
6317
|
const data = [];
|
|
6334
6318
|
// @ts-ignore
|
|
6335
|
-
|
|
6319
|
+
$(this.childrenDiv.nativeElement).sortable('toArray').forEach(x => data.push(x));
|
|
6336
6320
|
new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, data, null, () => {
|
|
6337
6321
|
if (this.table.onSort) {
|
|
6338
6322
|
this.table.onSort();
|
|
@@ -6683,7 +6667,7 @@ class TableOldComponent {
|
|
|
6683
6667
|
this.table.load(this.reload);
|
|
6684
6668
|
};
|
|
6685
6669
|
this.maximum.onClick = () => {
|
|
6686
|
-
|
|
6670
|
+
$(this.tableDiv.nativeElement).toggleClass('maximum');
|
|
6687
6671
|
this.maximum.icon = this.maximum.name === 'Minimum' ? 'fa-duotone fa-arrows-maximize' : 'fa-duotone fa-arrows-minimize';
|
|
6688
6672
|
this.maximum.name = this.maximum.name === 'Minimum' ? 'Maximum' : 'Minimum';
|
|
6689
6673
|
};
|
|
@@ -6722,13 +6706,13 @@ class TableOldComponent {
|
|
|
6722
6706
|
setSortable() {
|
|
6723
6707
|
setTimeout(() => {
|
|
6724
6708
|
// @ts-ignore
|
|
6725
|
-
|
|
6709
|
+
$(this.rows.nativeElement).sortable({
|
|
6726
6710
|
axis: 'y',
|
|
6727
6711
|
items: 'tr',
|
|
6728
6712
|
update: () => {
|
|
6729
6713
|
const data = [];
|
|
6730
6714
|
// @ts-ignore
|
|
6731
|
-
|
|
6715
|
+
$(this.rows.nativeElement).sortable('toArray').forEach(x => data.push(x));
|
|
6732
6716
|
new RequestClass(this.table.l).send(this.table.url + 'Sort', Method.Post, { Ids: data }, null, () => {
|
|
6733
6717
|
if (this.table.onSort) {
|
|
6734
6718
|
this.table.onSort();
|
|
@@ -6759,7 +6743,7 @@ class TableOldComponent {
|
|
|
6759
6743
|
this.confirm.show(this.table.l('DeleteConfirm'), this.table.url + 'Delete/' + e.id, null, e.accept);
|
|
6760
6744
|
}
|
|
6761
6745
|
changeSort(e, s) {
|
|
6762
|
-
if (
|
|
6746
|
+
if ($(e.target).closest('.header-search').hasClass('header-search')) {
|
|
6763
6747
|
return;
|
|
6764
6748
|
}
|
|
6765
6749
|
this.table.sortType = this.table.sort === s ? this.table.sortType === 'ASC' ? 'DESC' : 'ASC' : 'ASC';
|