imm-element-ui 0.5.7 → 0.5.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.
@@ -11,7 +11,7 @@ import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
11
11
  import * as i1$5 from '@angular/common';
12
12
  import { DOCUMENT, isPlatformBrowser, DatePipe, AsyncPipe, CommonModule, PlatformLocation } from '@angular/common';
13
13
  import * as i2$1 from '@angular/forms';
14
- import { FormControl, ReactiveFormsModule, FormsModule, FormGroup, Validators } from '@angular/forms';
14
+ import { FormControl, ReactiveFormsModule, FormGroup, FormsModule, Validators } from '@angular/forms';
15
15
  import { BehaviorSubject, tap, fromEvent, forkJoin, filter, Observable, of, shareReplay, pipe, lastValueFrom, isObservable, map as map$1 } from 'rxjs';
16
16
  import * as i1$2 from '@ngx-translate/core';
17
17
  import { TranslatePipe } from '@ngx-translate/core';
@@ -2409,9 +2409,8 @@ class RadioComponent {
2409
2409
  fromEvent(this.radioContainer.nativeElement, 'mouseenter')
2410
2410
  .pipe(debounceTime(100))
2411
2411
  .subscribe(() => {
2412
- if (this.props?.disabled) {
2412
+ if (this.field()?.fieldControl?.disabled)
2413
2413
  return;
2414
- }
2415
2414
  this.isEnter = true;
2416
2415
  });
2417
2416
  fromEvent(this.radioContainer.nativeElement, 'mouseleave')
@@ -3553,6 +3552,126 @@ const convertAct = (act) => {
3553
3552
  });
3554
3553
  return act;
3555
3554
  };
3555
+ /**
3556
+ * formpage 通用content函数转移
3557
+ * @param content
3558
+ * @param thisArg
3559
+ */
3560
+ const changeContent = (content, thisArg) => {
3561
+ let { gridList, hrefBtnList, getPrm, groups, statusKey, status, statusSteps, statusConf = null } = parseFunctions(content, thisArg);
3562
+ if (statusKey) {
3563
+ thisArg.statusKey = statusKey;
3564
+ thisArg.steps = statusSteps;
3565
+ statusConf && (thisArg.statusConf = statusConf);
3566
+ }
3567
+ // let act = parseFunctions(content.actions,thisArg)
3568
+ thisArg.actions = convertAct(content.actions);
3569
+ // content.formDisabled && (thisArg.formDisabled = parseFunctions(content.formDisabled, thisArg));
3570
+ content.formDisabled && (thisArg.formDisabled = content.formDisabled);
3571
+ thisArg.getPrm = getPrm;
3572
+ thisArg.getPrm.orgField = content.orgField || '';
3573
+ thisArg.grids = [];
3574
+ let fiterPreloads = [];
3575
+ // gridList = parseFunctions(gridList, thisArg);
3576
+ // let groupArr = parseFunctions(groups, thisArg);
3577
+ groups.forEach((item) => {
3578
+ if (thisArg.authLevel < 3) {
3579
+ item[formTypeToProps[item.type]].disabled = true;
3580
+ }
3581
+ });
3582
+ thisArg.formOptions = {
3583
+ fields: [
3584
+ {
3585
+ groupClass: 'flex flex-row flex-wrap',
3586
+ group: groups,
3587
+ },
3588
+ ],
3589
+ form: new FormGroup({}),
3590
+ mainField: content.sourceData.model.mainFields,
3591
+ };
3592
+ gridList.forEach(async (item) => {
3593
+ !item.type && (item.type = 'grid');
3594
+ let grid = { type: item.type };
3595
+ if (item.fiterPreloads instanceof Array) {
3596
+ fiterPreloads = [...fiterPreloads, ...item.fiterPreloads];
3597
+ }
3598
+ if (item.type == 'grid') {
3599
+ let { gridOptions: { columnDefs, ...restGridOptions }, subTableSource, subDataKey, title, selectDataCb, fk, mainField, uniqueField, addDataCb, showDelete = true, scrollHeight, dragSort } = item;
3600
+ grid = { subTableSource, subDataKey, title, showDelete, ...grid };
3601
+ let gridOptions = {
3602
+ ...restGridOptions,
3603
+ fk,
3604
+ subTableSource,
3605
+ subDataKey,
3606
+ mainField,
3607
+ };
3608
+ if (scrollHeight) {
3609
+ gridOptions.scrollHeight = `${scrollHeight}px`;
3610
+ }
3611
+ if (dragSort) {
3612
+ gridOptions.rowDragManaged = true;
3613
+ gridOptions.dragSort = dragSort;
3614
+ }
3615
+ convertCol(columnDefs, thisArg.authLevel, gridOptions.modelName, dragSort);
3616
+ gridOptions.columnDefs = columnDefs;
3617
+ if (subTableSource === 'select') {
3618
+ thisArg.webget({ code: item.selectModelCode }).subscribe((res) => {
3619
+ let selectContent = JSON.parse(res.content);
3620
+ grid.selectOptions = parseFunctions(selectContent, thisArg)?.gridOptions;
3621
+ grid.selectOptions.rowModelType = grid.selectOptions.rowModelType || 'serverSide';
3622
+ if (grid.selectOptions.rowModelType == 'serverSide') {
3623
+ grid.selectOptions.serverFunc = grid.selectOptions.serverFunc || thisArg.web_search.bind(thisArg);
3624
+ }
3625
+ else {
3626
+ grid.selectOptions.clientFunc = grid.selectOptions.clientFunc || thisArg.web_search.bind(thisArg);
3627
+ }
3628
+ grid.uniqueField = uniqueField;
3629
+ grid.selectDataCb = selectDataCb;
3630
+ grid.selectOptions.scrollHeight = '300px';
3631
+ gridOptionsHooker(grid.selectOptions, selectContent);
3632
+ });
3633
+ grid.searchPrm = { ...thisArg.searchPrm };
3634
+ }
3635
+ else {
3636
+ addDataCb && (gridOptions.addDataCb = addDataCb);
3637
+ }
3638
+ grid.gridOptions = gridOptions;
3639
+ }
3640
+ else {
3641
+ item.interactiveLabel = true;
3642
+ grid = {
3643
+ ...item
3644
+ };
3645
+ grid.form = new FormGroup({});
3646
+ }
3647
+ thisArg.grids.push(grid);
3648
+ });
3649
+ thisArg.formDetail = content.formDetail;
3650
+ thisArg.saveFunc = content.saveFunc;
3651
+ thisArg.isLog = content.sourceData.model.log;
3652
+ thisArg.getPrm['getLog'] = content.sourceData.model.log;
3653
+ thisArg.getPrm['fiterPreloads'] = fiterPreloads;
3654
+ thisArg.hrefBtnList = hrefBtnList;
3655
+ };
3656
+ const convertCol = (col, authLevel, modelName, dragSort) => {
3657
+ col.forEach((item, index) => {
3658
+ item.hide = item.hideCol;
3659
+ if (authLevel < 3) {
3660
+ item.editable = false;
3661
+ }
3662
+ if (dragSort && index === 0) {
3663
+ item.rowDrag = true;
3664
+ }
3665
+ });
3666
+ };
3667
+ const gridOptionsHooker = (gridOptions, selectContent) => {
3668
+ gridOptions?.columnDefs?.forEach((col) => {
3669
+ if (col.hideCol) {
3670
+ col.hide = col.hideCol;
3671
+ delete col.hideCol;
3672
+ }
3673
+ });
3674
+ };
3556
3675
 
3557
3676
  const _gridUtils = {
3558
3677
  calcRowIds: (api, isServerSide) => {
@@ -4351,6 +4470,7 @@ const components = {
4351
4470
  };
4352
4471
 
4353
4472
  const defaultOption = {
4473
+ // popupParent: document.body,
4354
4474
  defaultColDef: {
4355
4475
  flex: 1,
4356
4476
  minWidth: 100,
@@ -7668,5 +7788,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7668
7788
  * Generated bundle index. Do not edit.
7669
7789
  */
7670
7790
 
7671
- export { ActionService, ActionsComponent, AmComponent, AsyncRenderer, CellEditAutoCompleteComponent, CellEditDatePickerComponent, CellEditInputNumberCompoent, CellEditInputTextCompoent, CellEditSelectComponent, CrumbActionComponent, FormComponent, GridComponent, HeadComponent, HrefBtnListComponent, I18N_Token, I18nService, ImportComponent, LANGS, LinkRenderer, LogComponent, PageActionService, PageFormComponent, PageGridListComponent, PagerComponent, PopActionService, RowSelectorComponent$1 as RowSelectorComponent, SearchComponent, StepsComponent, ThemeConfigComponent, ThemeConfigService, UserHistoryService, compileTsToJs, convertAct, createCircularIterator, filterObjectByKeys, formTypeToProps, generateUniqueId, gridUtils, isJSONParsable, parseFunctions, toPascalCase };
7791
+ export { ActionService, ActionsComponent, AmComponent, AsyncRenderer, CellEditAutoCompleteComponent, CellEditDatePickerComponent, CellEditInputNumberCompoent, CellEditInputTextCompoent, CellEditSelectComponent, CrumbActionComponent, FormComponent, GridComponent, HeadComponent, HrefBtnListComponent, I18N_Token, I18nService, ImportComponent, LANGS, LinkRenderer, LogComponent, PageActionService, PageFormComponent, PageGridListComponent, PagerComponent, PopActionService, RowSelectorComponent$1 as RowSelectorComponent, SearchComponent, StepsComponent, ThemeConfigComponent, ThemeConfigService, UserHistoryService, changeContent, compileTsToJs, convertAct, convertCol, createCircularIterator, filterObjectByKeys, formTypeToProps, generateUniqueId, gridOptionsHooker, gridUtils, isJSONParsable, parseFunctions, toPascalCase };
7672
7792
  //# sourceMappingURL=imm-element-ui.mjs.map