ps-toolkit-ui 1.14.91 → 1.14.93

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.
@@ -1450,7 +1450,7 @@
1450
1450
  return moment__namespace(d).locale('fa').format('jYYYY/jMM/jDD HH:mm');
1451
1451
  };
1452
1452
  HelperClass.toPrice = function (l, cv) {
1453
- return parseFloat(cv).toLocaleString() + ' ' + l('Rial');
1453
+ return !isNaN(parseFloat(cv)) ? parseFloat(cv).toLocaleString() + ' ' + l('Rial') : l(cv);
1454
1454
  };
1455
1455
  HelperClass.getFileSize = function (bytes) {
1456
1456
  var suffix = ['B', 'KB', 'MB', 'GB', 'TB'];
@@ -3857,7 +3857,7 @@
3857
3857
  { type: core.Component, args: [{
3858
3858
  selector: 'lib-table',
3859
3859
  template: "<div [id]=\"table.id + 'Table'\" [style]=\"table.style\" #tableDiv [className]=\"(table.class ? table.class : '') + (table.sortable ? 'sortable' : '') + (table.hasChildren ? ' has-children' : '') + (table.vertical ? ' vertical' : '') + ' table-con w-100'\">\r\n <div *ngIf=\"table.displayLabel\" class=\"title\">\r\n <div class=\"f-r\">{{this.table.title ? this.table.title : table.l('List')}}</div>\r\n <span class=\"description\" *ngIf=\"this.table.description != null\" [innerHTML]=\"'( ' + this.table.description + ' )'\"></span>\r\n <div class=\"extra-buttons\" *ngIf=\"table.showExtraButtons\">\r\n <span *ngIf=\"isSelected()\">\r\n <lib-form-icon *ngFor=\"let btn of table.extraButtons\" [inp]=\"btn\"></lib-form-icon>\r\n </span>\r\n <span *ngIf=\"!isSelected()\">\r\n <lib-form-icon [inp]=\"reload\"></lib-form-icon>\r\n <lib-form-icon [inp]=\"maximum\"></lib-form-icon>\r\n </span>\r\n </div>\r\n <div *ngIf=\"table.buttons.length > 0\" class=\"buttons\">\r\n <span *ngFor=\"let btn of table.buttons\">\r\n <lib-form-button [inp]=\"btn\" *ngIf=\"btn.type == type.Button\"></lib-form-button>\r\n <lib-form-label [inp]=\"btn\" *ngIf=\"btn.type == type.Label\"></lib-form-label>\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"search-form\" *ngIf=\"table.searchForm\">\r\n <lib-form [form]=\"table.searchForm\"></lib-form>\r\n </div>\r\n <lib-form *ngIf=\"table.form && table.form.onTop\" [form]=\"table.form\"></lib-form>\r\n <div class=\"table\">\r\n <div class=\"header\">\r\n <div [className]=\"(table.hasChildren ? 'with-handle-children ' : '') + (table.sortable ? 'with-handle-sortable ' : '') + (table.withSelect ? 'with-handle-select ' : '') + 'row'\">\r\n <div class=\"handle-con\">\r\n <div class=\"handle handle-sortable\" *ngIf=\"table.sortable\"></div>\r\n <div class=\"handle handle-select\" *ngIf=\"table.hasChildren\"></div>\r\n <div class=\"handle handle-children\" *ngIf=\"table.withSelect\">\r\n <i (click)=\"selectAll()\" [className]=\"(allSelected() ? 'fa-solid fa-square-check c-green' : isSelected() ? 'fa-solid fa-square-minus c-green' : 'fa-regular fa-square') + ' select-row'\" *ngIf=\"table.rows.length > 0\"></i>\r\n </div>\r\n </div>\r\n <div (click)=\"!table.sortable && col.sort && changeSort($event, col.name)\" [className]=\"(!table.sortable && col.sort ? 'sort ' : '') + col.class + ' ' + col.name + '-cell cell w-100'\" *ngFor=\"let col of table.cols\">\r\n <div class=\"header-title\" *ngIf=\"col.search == null || table.sortable\" [innerHTML]=\"table.l(col.name)\"></div>\r\n <div class=\"header-search\" *ngIf=\"!table.sortable && col.search != null\">\r\n <lib-form-textbox *ngIf=\"col.type != colType.Date && col.type != colType.DateTime && col.type != colType.Month && col.enum == null\" [inp]=\"col.search\"></lib-form-textbox>\r\n <lib-form-date *ngIf=\"(col.type == colType.Date || col.type == colType.DateTime || col.type == colType.Month) && col.enum == null\" [inp]=\"col.search\"></lib-form-date>\r\n <lib-form-select *ngIf=\"col.enum != null\" [inp]=\"col.search\"></lib-form-select>\r\n </div>\r\n <i *ngIf=\"!table.sortable && col.sort\" [className]=\"'sort-icon fas' + (table.sort === col.name ? (table.sortType === 'ASC' ? ' fa-sort-up' : ' fa-sort-down') : ' fa-sort')\"></i>\r\n </div>\r\n <div class=\"cell options\" *ngIf=\"table.optionType == tableOptionType.Show\">{{table.l('Options')}}</div>\r\n </div>\r\n </div>\r\n <div class=\"body\" #rows [style]=\"table.perPage > 0 ? {minHeight: table.height * table.perPage + 'px'} : {minHeight: '120px'}\">\r\n <lib-table-row (confirmShow)=\"onConfirmShow($event)\" [level]=\"1\" (changeRows)=\"onChangeRows($event)\" [id]=\"row.id ? row.id : ''\" [table]=\"table\" [row]=\"row\" *ngFor=\"let row of getRows()\"></lib-table-row>\r\n <lib-table-loading [table]=\"table\"></lib-table-loading>\r\n </div>\r\n </div>\r\n <lib-table-pagination [table]=\"table\" *ngIf=\"table.perPage > 0\"></lib-table-pagination>\r\n <lib-modal *ngIf=\"table.modal != null\" [modal]=\"table.modal\"></lib-modal>\r\n <lib-modal [modal]=\"opt\" *ngFor=\"let opt of getModals()\"></lib-modal>\r\n <lib-confirm #confirm [tableId]=\"table.name\"></lib-confirm>\r\n</div>\r\n",
3860
- styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:102}.table-con>.title{float:right;font-size:16px;font-weight:700;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .description{font-size:13px;font-weight:200;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.title .extra-buttons{min-width:80px}.table-con>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con .table,.table-con .table .header{float:right;width:100%}.table-con .table .header .row{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;background-color:var(--base-white);border-radius:var(--border-radius-base);display:flex;flex-wrap:wrap;float:right;justify-content:right;position:relative;width:100%}.table-con .table .header .row.with-handle-children,.table-con .table .header .row.with-handle-select,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-select,.table-con .table .header .row.with-handle-sortable.with-handle-children,.table-con .table .header .row.with-handle-sortable.with-handle-select{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-select{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-size:12px;font-weight:200;font-weight:400;height:45px;justify-content:center;position:relative}.table-con .table .header .row .cell.options{margin-left:auto;margin-right:auto}.table-con .table .header .row .handle-con{height:100%;position:absolute;right:0;top:0}.table-con .table .header .row .handle-con .handle{align-items:center;display:flex;float:right;height:100%;justify-content:center;width:30px}.table-con .table .header .row .handle-con .handle i{cursor:pointer;font-size:18px}.table-con .table .header .row .cell.sort{cursor:pointer}.table-con .table .header .row .cell .header-title{float:right;padding:0 15px;text-align:center;width:calc(100% - 20px)}.table-con .table .header .row .cell .header-search{float:right;width:calc(100% - 20px)}.table-con .table .header .row .cell .sort-icon{float:right;font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;top:calc(50% - 10px);width:20px}.table-con .table .body{float:right;position:relative;width:100%}::ng-deep .table-con .table .header .row .cell .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}::ng-deep .table-con.vertical .table lib-table-row>.row-con>.row:after{background-image:linear-gradient(180deg,rgba(0,0,0,.05),rgba(50,50,50,.15),rgba(0,0,0,.05));height:100%;left:0;right:unset;width:1px}::ng-deep .table-con.vertical:not(.sortable) .table lib-table-row:first-of-type>.row-con>.row:after,::ng-deep .table-con:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}.table-con.vertical .table .header{display:none}::ng-deep .table-con .table lib-table-row{display:contents}.table-con.vertical .table .body{display:flex}::ng-deep .table-con.vertical .table lib-table-row:first-of-type>.row-con{background-color:var(--base-white);border-radius:var(--border-radius-base);max-width:150px;width:auto}"]
3860
+ styles: [".table-con{background-color:#fff;border-radius:var(--border-radius-base);box-shadow:var(--box-shadow-table);float:right;padding:20px;position:relative}.table-con.maximum{border-radius:0;height:100%;overflow-y:auto;position:fixed;right:0;top:0;width:100%;z-index:102}.table-con>.title{float:right;font-size:16px;font-weight:700;line-height:40px;margin-bottom:10px;position:relative;text-align:right;width:100%}.table-con>.title .description{font-size:13px;font-weight:200;margin-right:10px}.table-con>.title .buttons,.table-con>.title .extra-buttons{float:left;margin-top:5px;position:relative;z-index:1}.table-con>.title .extra-buttons{min-width:80px}.table-con>.search-form{border-radius:var(--border-radius-base);float:right;margin-bottom:10px;width:100%}.table-con .table,.table-con .table .header{float:right;width:100%}.table-con .table .header .row{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;align-items:center;background-color:var(--base-white);border-radius:var(--border-radius-base);display:flex;flex-wrap:wrap;float:right;justify-content:right;position:relative;width:100%}.table-con .table .header .row.with-handle-children,.table-con .table .header .row.with-handle-select,.table-con .table .header .row.with-handle-sortable{padding-right:30px}.table-con .table .header .row.with-handle-children.with-handle-select,.table-con .table .header .row.with-handle-sortable.with-handle-children,.table-con .table .header .row.with-handle-sortable.with-handle-select{padding-right:60px}.table-con .table .header .row.with-handle-sortable.with-handle-children.with-handle-select{padding-right:90px}.table-con .table .header .row .cell{align-items:center;color:var(--black-light);display:flex;float:right;font-size:12px;font-weight:200;font-weight:400;height:45px;justify-content:center;position:relative}.table-con .table .header .row .cell.options{margin-left:auto;margin-right:auto}.table-con .table .header .row .handle-con{height:100%;position:absolute;right:0;top:0}.table-con .table .header .row .handle-con .handle{align-items:center;display:flex;float:right;height:100%;justify-content:center;width:30px}.table-con .table .header .row .handle-con .handle i{cursor:pointer;font-size:18px}.table-con .table .header .row .cell.sort{cursor:pointer}.table-con .table .header .row .cell .header-title{float:right;padding:0 15px;text-align:center;width:calc(100% - 20px)}.table-con .table .header .row .cell .header-search{float:right;width:calc(100% - 20px)}.table-con .table .header .row .cell .sort-icon{float:right;font-size:13px;height:20px;left:5px;line-height:20px;opacity:.6;top:calc(50% - 10px);width:20px}.table-con .table .body{float:right;position:relative;width:100%}::ng-deep .table-con .table .header .row .cell .select-row{cursor:pointer;font-size:18px;height:30px;line-height:30px}::ng-deep .table-con.vertical .table lib-table-row>.row-con>.row:after{background-image:linear-gradient(180deg,rgba(0,0,0,.05),rgba(50,50,50,.15),rgba(0,0,0,.05));height:100%;left:0;right:unset;width:1px}::ng-deep .table-con.vertical:not(.sortable) .table lib-table-row:first-of-type>.row-con>.row:after,::ng-deep .table-con:not(.sortable) .table lib-table-row:last-of-type>.row-con>.row:after{background-image:unset}.table-con.vertical .table .header{display:none}::ng-deep .table-con .table lib-table-row{display:contents}.table-con.vertical .table .body{display:flex}::ng-deep .table-con.vertical .table lib-table-row:first-of-type>.row-con{background-color:var(--base-white);border-radius:var(--border-radius-base);max-width:150px}"]
3861
3861
  },] }
3862
3862
  ];
3863
3863
  TableComponent.ctorParameters = function () { return [
@@ -8608,6 +8608,89 @@
8608
8608
  inputBase: [{ type: core.ViewChild, args: ['inputBase',] }]
8609
8609
  };
8610
8610
 
8611
+ var FormSlideComponent = /** @class */ (function () {
8612
+ function FormSlideComponent() {
8613
+ this.changeIndex = new core.EventEmitter();
8614
+ }
8615
+ FormSlideComponent.prototype.ngOnInit = function () {
8616
+ var _this = this;
8617
+ this.inp.load();
8618
+ this.inp.setValue = function (v, isEdit) {
8619
+ _this.inp.value = v !== null ? v.toString() : _this.inp.default.toString();
8620
+ if (_this.inp.value == null && _this.inp.options.length > 0) {
8621
+ _this.inp.value = _this.inp.options.find(function (x) { return true; }).value;
8622
+ }
8623
+ _this.onChange(isEdit);
8624
+ };
8625
+ this.inp.setValue(this.inp.value, false);
8626
+ this.inp.isValid = function () {
8627
+ _this.inp.error = null;
8628
+ if (_this.inp.required && _this.inp.value === null) {
8629
+ _this.inp.error = exports.InputError.Required;
8630
+ return false;
8631
+ }
8632
+ return true;
8633
+ };
8634
+ this.inp.clear = function () {
8635
+ _this.inp.error = null;
8636
+ _this.inp.setValue(_this.inp.default, false);
8637
+ };
8638
+ this.inp.data = function () {
8639
+ return _this.inp.value;
8640
+ };
8641
+ this.inp.focus = function () {
8642
+ _this.onFocusIn();
8643
+ };
8644
+ };
8645
+ FormSlideComponent.prototype.onClick = function () {
8646
+ this.onFocusIn();
8647
+ };
8648
+ FormSlideComponent.prototype.onKeyDown = function (e) {
8649
+ var _this = this;
8650
+ var code = e.keyCode || e.which;
8651
+ if (code === 9 || code === 13) {
8652
+ e.preventDefault();
8653
+ this.changeIndex.emit(e.shiftKey ? 'ShiftTab' : 'Tab');
8654
+ }
8655
+ var selected = this.inp.options.findIndex(function (x) { return x.value === _this.inp.value; });
8656
+ if (code === 37) {
8657
+ var next = (selected >= this.inp.options.length - 1) ? selected : selected + 1;
8658
+ this.inp.value = this.inp.options[next].value;
8659
+ }
8660
+ if (code === 39) {
8661
+ var next = (selected > 0) ? selected - 1 : 0;
8662
+ this.inp.value = this.inp.options[next].value;
8663
+ }
8664
+ };
8665
+ FormSlideComponent.prototype.onChange = function (isEdit) {
8666
+ if (isEdit === void 0) { isEdit = false; }
8667
+ this.inp.error = null;
8668
+ if (this.inp.onChange) {
8669
+ this.inp.onChange(this.inp);
8670
+ }
8671
+ if (!isEdit) {
8672
+ this.changeIndex.emit('Tab');
8673
+ }
8674
+ };
8675
+ FormSlideComponent.prototype.onFocusIn = function () {
8676
+ $__namespace(this.inputBase.nativeElement).focus();
8677
+ };
8678
+ return FormSlideComponent;
8679
+ }());
8680
+ FormSlideComponent.decorators = [
8681
+ { type: core.Component, args: [{
8682
+ selector: 'lib-form-radio',
8683
+ template: "<div #inputDiv [id]=\"inp.id + 'RadioInput'\" [className]=\"'form-input-con radio w-100' + (inp.error == null ? '' : ' error') + (inp.disabled ? ' disabled' : '') + ' ' + inp.class\">\r\n <div class=\"form-input\" (click)=\"onClick()\">\r\n <input #inputBase type=\"text\" class=\"input-base\" (keydown)=\"onKeyDown($event)\" (focusin)=\"onFocusIn()\">\r\n <div class=\"control\">\r\n <label [className]=\"(o.class ? o.class + ' ' : '') + 'option'\" *ngFor=\"let o of inp.options\">\r\n <input [disabled]=\"inp.disabled || o.disabled\" (change)=\"onChange()\" [value]=\"o.value\" [(ngModel)]=\"inp.value\" [checked]=\"inp.value == o.value\" type=\"radio\" [name]=\"inp.name\">\r\n <div class=\"text\">{{inp.l(o.name)}}</div>\r\n </label>\r\n </div>\r\n </div>\r\n</div>\r\n",
8684
+ styles: [".form-input-con.radio{padding:0 15px;position:relative}.form-input-con.radio .form-input{float:right;position:relative;width:100%}.form-input-con.radio .form-input .label{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;cursor:default;direction:rtl;float:right;font-size:12px;height:20px;line-height:20px;margin-bottom:3px;padding:0 10px;text-align:right;width:100%}.form-input-con.radio.error .form-input .label{color:var(--red);font-size:10px}.form-input-con.radio .form-input .label .required-icon{color:var(--red);font-size:9px;height:20px;line-height:20px;text-align:center;width:20px}.form-input-con.radio .form-input i.icon{bottom:0;color:var(--primary);cursor:default;font-size:13px;height:35px;left:0;line-height:35px;position:absolute;text-align:center;transition:all .35s ease-in-out;width:35px;z-index:1}.form-input-con.radio .form-input>.control{background-color:#fff;border:var(--border-input);border-radius:var(--border-radius-base);float:right;min-height:35px;overflow:hidden;width:100%}.form-input-con.radio .form-input .input-base{cursor:pointer;height:0;opacity:0;position:absolute;right:50%;top:50%;width:0;z-index:1}.form-input-con.radio.disabled .form-input .label,.form-input-con.radio.disabled .form-input>.control,.form-input-con.radio.disabled .form-input i.icon{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-shadow:unset;cursor:default;filter:blur(.5px);opacity:.7}.form-input-con.radio .form-input .input-base:focus+.control,.form-input-con.radio .form-input:hover .control{border:var(--border-input-dark);outline:none}.form-input-con.radio.error .form-input>.control{border:var(--border-input-red)}.form-input-con.radio.error .form-input i.icon{color:var(--red)}.form-input-con.radio .form-input .control .option{-webkit-user-select:none;align-items:center;cursor:pointer;display:flex;float:right;font-size:11px;height:35px;justify-content:center;position:relative;text-align:center;user-select:none}.form-input-con.radio .form-input .control .option.disabled{-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;box-shadow:unset;cursor:default;filter:blur(.5px);opacity:.7}.form-input-con.radio .form-input .control .option .text{align-items:center;display:flex;float:right;height:100%;justify-content:center;padding:5px 20px;width:100%}.form-input-con.radio .form-input .control .option input{cursor:pointer;opacity:0;position:absolute;right:0}.form-input-con.radio .form-input .control .option input:checked~.text{background-color:var(--primary);color:var(--white)}.form-input-con.radio.h-40 .form-input i.icon{font-size:15px;height:40px;line-height:45px}.form-input-con.radio.h-40 .form-input>.control{min-height:40px}.form-input-con.radio.h-40 .form-input .control .option{font-size:12px}@media (max-width:599.99px){.form-input-con.radio .form-input .control .option-con{display:table-row}}"]
8685
+ },] }
8686
+ ];
8687
+ FormSlideComponent.ctorParameters = function () { return []; };
8688
+ FormSlideComponent.propDecorators = {
8689
+ inp: [{ type: core.Input }],
8690
+ changeIndex: [{ type: core.Output }],
8691
+ inputBase: [{ type: core.ViewChild, args: ['inputBase',] }]
8692
+ };
8693
+
8611
8694
  var PsToolkitUiModule = /** @class */ (function () {
8612
8695
  function PsToolkitUiModule() {
8613
8696
  }
@@ -8631,7 +8714,7 @@
8631
8714
  TooltipComponent, ConfirmComponent, TableComponent, ModalComponent, FormComponent, TableRowComponent, FormTreeComponent, AlertComponent,
8632
8715
  FormTimeComponent, NotificationComponent, FormFingerComponent, FormVehicleSearchComponent, FormCkeditorComponent, FormUploaderComponent,
8633
8716
  LayoutComponent, LoadingComponent, NotfoundComponent, FormVehicleComponent, FormHiddenComponent, CalendarComponent, FormToggleComponent,
8634
- ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, LoginComponent, FormStarComponent,
8717
+ ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, LoginComponent, FormStarComponent, FormSlideComponent,
8635
8718
  SafeStylePipe, SafeHtmlPipe,
8636
8719
  ],
8637
8720
  imports: [
@@ -8649,7 +8732,7 @@
8649
8732
  TooltipComponent, ConfirmComponent, TableComponent, ModalComponent, FormComponent, TableRowComponent, FormTreeComponent, AlertComponent,
8650
8733
  FormTimeComponent, NotificationComponent, FormFingerComponent, FormVehicleSearchComponent, FormCkeditorComponent, FormUploaderComponent,
8651
8734
  LayoutComponent, LoadingComponent, NotfoundComponent, FormVehicleComponent, FormHiddenComponent, CalendarComponent, FormToggleComponent,
8652
- ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, LoginComponent, FormStarComponent
8735
+ ClockComponent, ChartComponent, FormTagComponent, ErrorComponent, LoginComponent, FormStarComponent, FormSlideComponent,
8653
8736
  ]
8654
8737
  },] }
8655
8738
  ];
@@ -9402,6 +9485,7 @@
9402
9485
  exports.FormPlaqueSelectComponent = FormPlaqueSelectComponent;
9403
9486
  exports.FormRadioComponent = FormRadioComponent;
9404
9487
  exports.FormSelectComponent = FormSelectComponent;
9488
+ exports.FormSlideComponent = FormSlideComponent;
9405
9489
  exports.FormStarComponent = FormStarComponent;
9406
9490
  exports.FormTableComponent = FormTableComponent;
9407
9491
  exports.FormTextareaComponent = FormTextareaComponent;