ps-toolkit-ui 0.0.210 → 0.0.214
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 +176 -8
- 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/classes/chart.class.js +2 -2
- package/esm2015/lib/components/chart/chart.component.js +1 -1
- package/esm2015/lib/components/form/tree/form.tree.component.js +6 -4
- package/esm2015/public-api.js +2 -1
- package/fesm2015/ps-toolkit-ui.js +147 -5
- package/fesm2015/ps-toolkit-ui.js.map +1 -1
- package/package.json +2 -1
- package/ps-toolkit-ui.metadata.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('jquery'), require('lodash'), require('jalali-moment'), require('@angular/router'), require('@angular/forms'), require('@angular/common'), require('@angular/platform-browser')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('ps-toolkit-ui', ['exports', '@angular/core', 'jquery', 'lodash', 'jalali-moment', '@angular/router', '@angular/forms', '@angular/common', '@angular/platform-browser'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ps-toolkit-ui'] = {}, global.ng.core, global.$, global._, global.moment, global.ng.router, global.ng.forms, global.ng.common, global.ng.platformBrowser));
|
|
5
|
-
}(this, (function (exports, core, $, _, moment, router, forms, common, platformBrowser) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('jquery'), require('lodash'), require('jalali-moment'), require('@angular/router'), require('@angular/forms'), require('@angular/common'), require('@angular/platform-browser'), require('highcharts')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('ps-toolkit-ui', ['exports', '@angular/core', 'jquery', 'lodash', 'jalali-moment', '@angular/router', '@angular/forms', '@angular/common', '@angular/platform-browser', 'highcharts'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['ps-toolkit-ui'] = {}, global.ng.core, global.$, global._, global.moment, global.ng.router, global.ng.forms, global.ng.common, global.ng.platformBrowser, global.Highcharts));
|
|
5
|
+
}(this, (function (exports, core, $, _, moment, router, forms, common, platformBrowser, Highcharts) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) { return e; } else {
|
|
@@ -5955,9 +5955,11 @@
|
|
|
5955
5955
|
if (r.selected) {
|
|
5956
5956
|
isChecked = true;
|
|
5957
5957
|
}
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5958
|
+
if (this.inp.onlyChild) {
|
|
5959
|
+
cIsChecked = this.check(ids, r.children);
|
|
5960
|
+
if (cIsChecked) {
|
|
5961
|
+
r.selected = r.children.filter(function (x) { return !x.selected; }).length > 0 ? true : null;
|
|
5962
|
+
}
|
|
5961
5963
|
}
|
|
5962
5964
|
}
|
|
5963
5965
|
}
|
|
@@ -7184,7 +7186,7 @@
|
|
|
7184
7186
|
{ type: core.Component, args: [{
|
|
7185
7187
|
selector: 'lib-chart',
|
|
7186
7188
|
template: "<div class=\"chart-con\" [style]=\"chart.style\">\r\n <div *ngIf=\"chart.loading\" class=\"loading\">\r\n <div class=\"text\" [innerHTML]=\"chart.l('LoadingTable', 'Processing')\"></div>\r\n </div>\r\n <div style=\"height: 100%\" [id]=\"this.chart.name + 'Chart'\"></div>\r\n</div>\r\n",
|
|
7187
|
-
styles: [".chart-con{direction:ltr;float:right;position:relative;width:100%}.chart-con .loading{background-color:#fff;height:100%;position:absolute;right:0;top:0;width:100%;z-index:9}.chart-con .loading .text{font-family:VazirBold;height:40px;line-height:40px;position:absolute;text-align:center;top:calc(50% - 20px);width:100%}"]
|
|
7189
|
+
styles: [".chart-con{direction:ltr;float:right;position:relative;width:100%}.chart-con .loading{background-color:#fff;height:100%;position:absolute;right:0;top:0;width:100%;z-index:9}.chart-con .loading .text{direction:rtl;font-family:VazirBold;height:40px;line-height:40px;position:absolute;text-align:center;top:calc(50% - 20px);width:100%}"]
|
|
7188
7190
|
},] }
|
|
7189
7191
|
];
|
|
7190
7192
|
ChartComponent.ctorParameters = function () { return []; };
|
|
@@ -7557,6 +7559,171 @@
|
|
|
7557
7559
|
return TableRowClass;
|
|
7558
7560
|
}());
|
|
7559
7561
|
|
|
7562
|
+
var ChartClass = /** @class */ (function () {
|
|
7563
|
+
function ChartClass(l, name) {
|
|
7564
|
+
this.style = {};
|
|
7565
|
+
this.loading = false;
|
|
7566
|
+
this.options = {};
|
|
7567
|
+
this.l = l;
|
|
7568
|
+
this.name = name;
|
|
7569
|
+
}
|
|
7570
|
+
ChartClass.prototype.setChart = function (cOpt, categories) {
|
|
7571
|
+
if (categories === void 0) { categories = []; }
|
|
7572
|
+
var date = this.l('Date');
|
|
7573
|
+
var min = Math.min.apply(Math, __spread([].concat.apply([], cOpt.series.map(function (o) { return o.data; }))));
|
|
7574
|
+
var th = this;
|
|
7575
|
+
var opt = {
|
|
7576
|
+
chart: {
|
|
7577
|
+
type: 'line',
|
|
7578
|
+
spacing: [30, 30, 30, 30]
|
|
7579
|
+
},
|
|
7580
|
+
title: { text: null },
|
|
7581
|
+
credits: { enabled: false },
|
|
7582
|
+
yAxis: {
|
|
7583
|
+
visible: true, reverse: true,
|
|
7584
|
+
min: min,
|
|
7585
|
+
title: { text: null },
|
|
7586
|
+
labels: {
|
|
7587
|
+
useHTML: true,
|
|
7588
|
+
style: {
|
|
7589
|
+
fontFamily: 'VazirBold',
|
|
7590
|
+
direction: 'rtl',
|
|
7591
|
+
textAlign: 'center'
|
|
7592
|
+
},
|
|
7593
|
+
formatter: function () {
|
|
7594
|
+
return cOpt.unit ? cOpt.unit.replace('{}', this.value.toLocaleString()) : this.value.toLocaleString();
|
|
7595
|
+
}
|
|
7596
|
+
}
|
|
7597
|
+
},
|
|
7598
|
+
plotOptions: {
|
|
7599
|
+
line: {
|
|
7600
|
+
marker: {
|
|
7601
|
+
enabled: false
|
|
7602
|
+
}
|
|
7603
|
+
}
|
|
7604
|
+
},
|
|
7605
|
+
xAxis: {
|
|
7606
|
+
categories: categories,
|
|
7607
|
+
reversed: true,
|
|
7608
|
+
labels: {
|
|
7609
|
+
useHTML: true,
|
|
7610
|
+
style: {
|
|
7611
|
+
fontFamily: 'VazirBold',
|
|
7612
|
+
direction: 'rtl',
|
|
7613
|
+
textAlign: 'center'
|
|
7614
|
+
},
|
|
7615
|
+
step: Math.floor(categories.length / 5),
|
|
7616
|
+
formatter: function () {
|
|
7617
|
+
return this.value.split(' ')[0];
|
|
7618
|
+
}
|
|
7619
|
+
}
|
|
7620
|
+
},
|
|
7621
|
+
legend: {
|
|
7622
|
+
useHTML: true,
|
|
7623
|
+
rtl: true,
|
|
7624
|
+
itemMarginRight: 50,
|
|
7625
|
+
itemMarginLeft: 50,
|
|
7626
|
+
itemStyle: {
|
|
7627
|
+
fontFamily: 'VazirBold',
|
|
7628
|
+
direction: 'rtl'
|
|
7629
|
+
}
|
|
7630
|
+
},
|
|
7631
|
+
tooltip: {
|
|
7632
|
+
shared: true,
|
|
7633
|
+
crosshairs: true,
|
|
7634
|
+
useHTML: true,
|
|
7635
|
+
style: {
|
|
7636
|
+
fontFamily: 'VazirBold',
|
|
7637
|
+
direction: 'rtl',
|
|
7638
|
+
textAlign: 'center'
|
|
7639
|
+
},
|
|
7640
|
+
formatter: function () {
|
|
7641
|
+
var e_1, _a;
|
|
7642
|
+
var s = '<div>' + date + ' : ' + this.x + '</br>';
|
|
7643
|
+
try {
|
|
7644
|
+
for (var _b = __values(this.points.filter(function (x) { return x.y !== 0; })), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7645
|
+
var p = _c.value;
|
|
7646
|
+
var symbol = th.getSymbol(p);
|
|
7647
|
+
s += (symbol ? symbol : '') + '<span class="rtl d-ib">' + (cOpt.showName ?
|
|
7648
|
+
'<span style="' + (symbol ? '' : 'color: ' + p.color) + '" class="m-l-5">' +
|
|
7649
|
+
p.series.name + '</span> ' : '') +
|
|
7650
|
+
'<span style="' + (cOpt.showName ? '' : 'color: ' + p.color) + '">'
|
|
7651
|
+
+ (cOpt.unit ? cOpt.unit.replace('{}', p.y.toLocaleString()) : p.y.toLocaleString()) + '</span>' + '</span></br>';
|
|
7652
|
+
}
|
|
7653
|
+
}
|
|
7654
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7655
|
+
finally {
|
|
7656
|
+
try {
|
|
7657
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7658
|
+
}
|
|
7659
|
+
finally { if (e_1) throw e_1.error; }
|
|
7660
|
+
}
|
|
7661
|
+
s += '</div>';
|
|
7662
|
+
return s;
|
|
7663
|
+
}
|
|
7664
|
+
},
|
|
7665
|
+
series: []
|
|
7666
|
+
};
|
|
7667
|
+
this.options = this.merge(opt, cOpt);
|
|
7668
|
+
Highcharts.chart(this.name + 'Chart', this.options);
|
|
7669
|
+
};
|
|
7670
|
+
ChartClass.prototype.getSymbol = function (point) {
|
|
7671
|
+
var marker = null;
|
|
7672
|
+
if (point.point.graphic && point.point.graphic.symbolName) {
|
|
7673
|
+
switch (point.point.graphic.symbolName) {
|
|
7674
|
+
case 'circle':
|
|
7675
|
+
marker = '●';
|
|
7676
|
+
break;
|
|
7677
|
+
case 'diamond':
|
|
7678
|
+
marker = '♦';
|
|
7679
|
+
break;
|
|
7680
|
+
case 'square':
|
|
7681
|
+
marker = '■';
|
|
7682
|
+
break;
|
|
7683
|
+
case 'triangle':
|
|
7684
|
+
marker = '▲';
|
|
7685
|
+
break;
|
|
7686
|
+
case 'triangle-down':
|
|
7687
|
+
marker = '▼';
|
|
7688
|
+
break;
|
|
7689
|
+
default:
|
|
7690
|
+
marker = '●';
|
|
7691
|
+
break;
|
|
7692
|
+
}
|
|
7693
|
+
return '<span style="margin-left: 10px; color: ' + point.color + '">' + marker + '</span>';
|
|
7694
|
+
}
|
|
7695
|
+
return marker;
|
|
7696
|
+
};
|
|
7697
|
+
ChartClass.prototype.merge = function (b, c) {
|
|
7698
|
+
var e_2, _a;
|
|
7699
|
+
try {
|
|
7700
|
+
for (var _b = __values(Object.keys(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7701
|
+
var k = _c.value;
|
|
7702
|
+
if (Object.keys(b).includes(k)) {
|
|
7703
|
+
if (c[k] != null && c[k].constructor === Object) {
|
|
7704
|
+
b[k] = this.merge(b[k], c[k]);
|
|
7705
|
+
}
|
|
7706
|
+
else {
|
|
7707
|
+
b[k] = c[k];
|
|
7708
|
+
}
|
|
7709
|
+
}
|
|
7710
|
+
else {
|
|
7711
|
+
b[k] = c[k];
|
|
7712
|
+
}
|
|
7713
|
+
}
|
|
7714
|
+
}
|
|
7715
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
7716
|
+
finally {
|
|
7717
|
+
try {
|
|
7718
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7719
|
+
}
|
|
7720
|
+
finally { if (e_2) throw e_2.error; }
|
|
7721
|
+
}
|
|
7722
|
+
return b;
|
|
7723
|
+
};
|
|
7724
|
+
return ChartClass;
|
|
7725
|
+
}());
|
|
7726
|
+
|
|
7560
7727
|
/*
|
|
7561
7728
|
* Public API Surface of ps-toolkit-ui
|
|
7562
7729
|
*/
|
|
@@ -7570,6 +7737,7 @@
|
|
|
7570
7737
|
exports.AccordionRowClass = AccordionRowClass;
|
|
7571
7738
|
exports.AlertComponent = AlertComponent;
|
|
7572
7739
|
exports.BaseComponent = BaseComponent;
|
|
7740
|
+
exports.ChartClass = ChartClass;
|
|
7573
7741
|
exports.ConfirmComponent = ConfirmComponent;
|
|
7574
7742
|
exports.DayClass = DayClass;
|
|
7575
7743
|
exports.EnumUtils = EnumUtils;
|