imm-element-ui 0.2.7 → 0.2.9

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.
@@ -11,7 +11,7 @@ import * as i1$3 from '@angular/common';
11
11
  import { DatePipe, CommonModule, DOCUMENT, isPlatformBrowser, AsyncPipe } from '@angular/common';
12
12
  import * as i2$1 from '@angular/forms';
13
13
  import { FormControl, ReactiveFormsModule, FormGroup, Validators, FormsModule } from '@angular/forms';
14
- import { BehaviorSubject, tap, fromEvent, forkJoin, filter, Observable, of, shareReplay, pipe, lastValueFrom, map as map$1 } from 'rxjs';
14
+ import { BehaviorSubject, tap, fromEvent, forkJoin, filter, Observable, of, shareReplay, pipe, isObservable, lastValueFrom, map as map$1 } from 'rxjs';
15
15
  import * as i1$2 from '@ngx-translate/core';
16
16
  import { TranslatePipe } from '@ngx-translate/core';
17
17
  import * as i2 from 'primeng/inputtext';
@@ -3537,7 +3537,9 @@ class FormComponent {
3537
3537
  field.labelMinWidth = this.labelMinWidth;
3538
3538
  field.interactiveLabel = this.options().interactiveLabel ?? true;
3539
3539
  field.form = this;
3540
- field.hook && this.uniqueHook(field, field.hook);
3540
+ if (isObservable(field.hook)) {
3541
+ this.uniqueHook(field, field.hook);
3542
+ }
3541
3543
  this.handleFieldControl(field);
3542
3544
  });
3543
3545
  }
@@ -6122,16 +6124,16 @@ class UserHistoryService {
6122
6124
  }));
6123
6125
  this.detailName = '';
6124
6126
  this.i18n = inject(I18nService);
6125
- window.addEventListener('beforeunload', (event) => {
6126
- window.sessionStorage.setItem('crumbAction', JSON.stringify(this.historyList()));
6127
- });
6128
- window.addEventListener('load', () => {
6129
- let history = window.sessionStorage.getItem('crumbAction');
6130
- console.log('crumbAction-localstory', history);
6131
- if (history) {
6132
- this.historyList.set(JSON.parse(history));
6133
- }
6134
- });
6127
+ // window.addEventListener('beforeunload',(event) => {
6128
+ // window.sessionStorage.setItem('crumbAction', JSON.stringify(this.historyList()))
6129
+ // })
6130
+ // window.addEventListener('load',() => {
6131
+ // let history = window.sessionStorage.getItem('crumbAction')
6132
+ // console.log('crumbAction-localstory',history)
6133
+ // if(history){
6134
+ // this.historyList.set(JSON.parse(history))
6135
+ // }
6136
+ // })
6135
6137
  }
6136
6138
  createBreadcrumbs(route, url = '', breadcrumbs = []) {
6137
6139
  const children = route.children;
@@ -6162,7 +6164,7 @@ class UserHistoryService {
6162
6164
  // const configPath: string = child.routeConfig?.path as string
6163
6165
  const configPath = child.params.hasOwnProperty('id') ? url.replace(/([^\/]*)$/, "") : url;
6164
6166
  const paramsKeys = Object.keys(child.params);
6165
- // console.log('title',child,configPath,url)
6167
+ console.log('title', child, configPath, url);
6166
6168
  if (title && configPath) {
6167
6169
  let isExit = this.historyList().filter(v => v.configPath == configPath);
6168
6170
  // configPath.indexOf(':') > -1 && paramsKeys.length > 0 && ( title = this.detailName)
@@ -6237,6 +6239,7 @@ class StepsComponent {
6237
6239
  this.widthList = [];
6238
6240
  this.START_BUTTON_WIDTH = 32;
6239
6241
  this.END_BUTTON_WIDTH = 47;
6242
+ this.STEP_ITEM_MARGIN = 2;
6240
6243
  this.startIndex = 0;
6241
6244
  this.endIndex = 0;
6242
6245
  this.startSteps = [];
@@ -6261,7 +6264,7 @@ class StepsComponent {
6261
6264
  if (children[i].classList.contains('end-item')) {
6262
6265
  continue;
6263
6266
  }
6264
- this.widthList.push(children[i].offsetWidth || 0);
6267
+ this.widthList.push((children[i].offsetWidth || 0) + this.STEP_ITEM_MARGIN);
6265
6268
  }
6266
6269
  }
6267
6270
  calcMaxWidth() {
@@ -6377,7 +6380,7 @@ class StepsComponent {
6377
6380
  setTimeout(() => {
6378
6381
  this.alternateWidthList();
6379
6382
  this.handleSteps();
6380
- });
6383
+ }, 300);
6381
6384
  }
6382
6385
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: StepsComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
6383
6386
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: StepsComponent, isStandalone: true, selector: "custom-steps", inputs: { steps: { classPropertyName: "steps", publicName: "steps", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null }, authLevel: { classPropertyName: "authLevel", publicName: "authLevel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }, { propertyName: "endBtn", first: true, predicate: ["endBtn"], descendants: true }], ngImport: i0, template: "<div\r\n\t#container\r\n\tclass=\"flex my-1 w-full justify-end\">\r\n\t@for (st of displaySteps(); track st; let i = $index) {\r\n\t\t@if (st.value === 'start') {\r\n\t\t\t<div\r\n\t\t\t\t#startItem\r\n\t\t\t\t[class]=\"getClass(i, ['start-item'])\"\r\n\t\t\t\t(click)=\"showStartSteps($event, startOp)\">\r\n\t\t\t\t<span>...</span>\r\n\t\t\t</div>\r\n\t\t\t<p-popover\r\n\t\t\t\t#startOp\r\n\t\t\t\t[styleClass]=\"'pop-steps start-steps'\"\r\n\t\t\t\t[appendTo]=\"startItem\">\r\n\t\t\t\t<p-listbox\r\n\t\t\t\t\t[options]=\"startSteps\"\r\n\t\t\t\t\t(onChange)=\"onStartStepsChange($event)\"\r\n\t\t\t\t\toptionLabel=\"label\"\r\n\t\t\t\t\tclass=\"w-full md:w-56\" />\r\n\t\t\t</p-popover>\r\n\t\t} @else if (st.value === 'end') {\r\n\t\t\t<div\r\n\t\t\t\t#endItem\r\n\t\t\t\t[class]=\"getClass(i, ['end-item'])\"\r\n\t\t\t\t(click)=\"showEndSteps($event, endOp)\">\r\n\t\t\t\t<span>...</span>\r\n\t\t\t</div>\r\n\t\t\t<p-popover\r\n\t\t\t\t#endOp\r\n\t\t\t\t[styleClass]=\"'pop-steps end-steps'\"\r\n\t\t\t\t[appendTo]=\"endItem\">\r\n\t\t\t\t<p-listbox\r\n\t\t\t\t\t[options]=\"endSteps\"\r\n\t\t\t\t\t(onChange)=\"onEndStepsChange($event)\"\r\n\t\t\t\t\toptionLabel=\"label\"\r\n\t\t\t\t\tclass=\"w-full md:w-56\" />\r\n\t\t\t</p-popover>\r\n\t\t} @else {\r\n\t\t\t<div\r\n\t\t\t\t[class]=\"getClass(i, [])\"\r\n\t\t\t\t(click)=\"changeStatus(st)\">\r\n\t\t\t\t<span>{{ st.i18nKey ? i18n.fanyi(st.i18nKey) : st.label }}</span>\r\n\t\t\t</div>\r\n\t\t}\r\n\t}\r\n</div>\r\n", styles: ["::ng-deep .pop-steps.p-popover.p-popover-flipped:before{display:none}::ng-deep .pop-steps.p-popover.p-popover-flipped:after{display:none}::ng-deep .pop-steps.p-popover:before{display:none}::ng-deep .pop-steps.p-popover:after{display:none}::ng-deep .pop-steps.p-popover-flipped{margin-top:-5px}::ng-deep .pop-steps .p-popover-content{padding:0}::ng-deep .end-steps.p-popover{margin-top:2.5px;z-index:999;position:absolute!important;left:auto!important;right:0!important;top:100%!important;min-width:125px}::ng-deep .start-steps.p-popover{margin-top:2.5px;z-index:999;position:absolute!important;left:0!important;right:auto!important;top:100%!important;min-width:125px}.step-item{position:relative;height:32px;padding:0 5px;background-color:#e7e9ed}.step-item span{color:#334155c2;white-space:nowrap}.step-item.step-first{padding-left:15px}.step-item.step-last{padding-right:15px}.step-item:not(.step-first){border-left:15px solid transparent;margin-left:2px}.step-item:not(.step-first):before{content:\"\";position:absolute;top:0;left:-15px;width:0;height:0;border-top:15px solid transparent;border-bottom:15px solid transparent;border-left:12px solid white}.step-item:not(.step-last):after{content:\"\";position:absolute;top:0;right:-12px;width:0;height:0;border-top:15px solid transparent;border-bottom:15px solid transparent;border-left:12px solid #e7e9ed;z-index:2}.step-item.step-active{background-color:var(--p-primary-200)}.step-item.step-active span{color:#334155}.step-item.step-active:after{border-left:12px solid var(--p-primary-200)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ListboxModule }, { kind: "component", type: i1$6.Listbox, selector: "p-listbox, p-listBox, p-list-box", inputs: ["id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "style", "styleClass", "listStyle", "listStyleClass", "readonly", "disabled", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll", "striped", "highlightOnSelect", "checkmark"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange", "onLazyLoad"] }, { kind: "component", type: Popover, selector: "p-popover", inputs: ["ariaLabel", "ariaLabelledBy", "dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }] }); }
@@ -6434,6 +6437,14 @@ class PageFormComponent extends AmComponent {
6434
6437
  this.isLog = this.modelLog();
6435
6438
  console.log('model-----', this.isLog, this.modelLog());
6436
6439
  }, { allowSignalWrites: true });
6440
+ effect(() => {
6441
+ if (this.statusSteps().length > 0 && !this.id) {
6442
+ this.upsertPrm.addData[this.statusKey()] = this.statusSteps()[0]['value'];
6443
+ this.getPrm.data = Object.assign(this.getPrm.data || {}, {
6444
+ [this.statusKey()]: this.statusSteps()[0]['value']
6445
+ });
6446
+ }
6447
+ }, { allowSignalWrites: true });
6437
6448
  }
6438
6449
  ngOnInit() {
6439
6450
  this.upCb = this.upCb.bind(this);
@@ -6486,10 +6497,11 @@ class PageFormComponent extends AmComponent {
6486
6497
  });
6487
6498
  }
6488
6499
  }
6489
- getDetail() {
6500
+ getDetail(customSteps) {
6490
6501
  this.web_get(this.getPrm).subscribe(res => {
6491
6502
  this.updateTitle(res);
6492
6503
  this.formDisabled() && this.formDisFunc();
6504
+ customSteps && customSteps.refreshSteps();
6493
6505
  });
6494
6506
  }
6495
6507
  updateTitle(res) {
@@ -6537,8 +6549,7 @@ class PageFormComponent extends AmComponent {
6537
6549
  };
6538
6550
  }
6539
6551
  this.web_write(param).subscribe(res => {
6540
- this.getDetail();
6541
- customSteps.refreshSteps();
6552
+ this.getDetail(customSteps);
6542
6553
  });
6543
6554
  }
6544
6555
  else {