bbj-screen-widget 2.4.44 → 2.4.45

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.
@@ -12364,6 +12364,7 @@
12364
12364
  left: 0,
12365
12365
  };
12366
12366
  this.checkable = false;
12367
+ this.outputType = 'array';
12367
12368
  this.checkStrictly = false;
12368
12369
  this.showLine = false;
12369
12370
  this.expandAll = false;
@@ -12393,6 +12394,7 @@
12393
12394
  this.keyChange = new i0.EventEmitter();
12394
12395
  this.nodes = [];
12395
12396
  this.selectedKeys = [];
12397
+ // checkedKeys: string[] = [];
12396
12398
  this.style = {};
12397
12399
  }
12398
12400
  TreeControlComponent.prototype.ngOnInit = function () {
@@ -12421,7 +12423,14 @@
12421
12423
  data.forEach(function (_a) {
12422
12424
  var title = _a.title, key = _a.key, parentKey = _a.parentKey, parentKey_value = _a.parentKey_value, icon = _a.icon, count = _a.count;
12423
12425
  if (key) {
12424
- var node = { key: key, title: title, parentKey: parentKey_value || parentKey, icon: icon, isLeaf: true, count: count };
12426
+ var node = {
12427
+ key: key,
12428
+ title: title,
12429
+ parentKey: parentKey_value || parentKey,
12430
+ icon: icon,
12431
+ isLeaf: true,
12432
+ count: count,
12433
+ };
12425
12434
  if (_this.selectedKeys.includes(key)) {
12426
12435
  node.selected = true;
12427
12436
  }
@@ -12478,7 +12487,12 @@
12478
12487
  this.waittingSelect = null;
12479
12488
  this.selectedKeys = keys;
12480
12489
  if (this.checkable) {
12481
- this.keyChange.emit(keys);
12490
+ if (this.outputType === 'string') {
12491
+ this.keyChange.emit(keys === null || keys === void 0 ? void 0 : keys.join(';'));
12492
+ }
12493
+ else {
12494
+ this.keyChange.emit(keys);
12495
+ }
12482
12496
  }
12483
12497
  else {
12484
12498
  this.keyChange.emit(keys[0]);
@@ -12509,18 +12523,39 @@
12509
12523
  this.searchValue = value;
12510
12524
  };
12511
12525
  TreeControlComponent.prototype.select = function (id) {
12526
+ var _this = this;
12512
12527
  var find = false;
12513
- if (this.nodes) {
12514
- var node = this.arrayService.findTree(this.nodes, function (n) { return n.key === id; });
12515
- if (node) {
12516
- this.onKeysChange([id]);
12517
- this.nodeClick(node.key, node.title);
12518
- find = true;
12528
+ var keys = [];
12529
+ if (id) {
12530
+ if (this.checkable) {
12531
+ if (typeof id === 'string') {
12532
+ id = id.split(';');
12533
+ }
12534
+ keys.push.apply(keys, __spread(id));
12535
+ }
12536
+ else {
12537
+ keys.push(id);
12519
12538
  }
12520
12539
  }
12521
- // 数据有可能还没加载,等数据加载了再选中
12522
- if (!find) {
12523
- this.waittingSelect = id;
12540
+ this.selectedKeys = keys;
12541
+ if (keys.length) {
12542
+ if (this.nodes) {
12543
+ var nodes_1 = [];
12544
+ this.arrayService.visitTree(this.nodes, function (n) {
12545
+ if (keys.includes(n.key)) {
12546
+ nodes_1.push(n);
12547
+ }
12548
+ });
12549
+ if (nodes_1.length) {
12550
+ this.onKeysChange(keys);
12551
+ nodes_1.forEach(function (node) { return _this.nodeClick(node.key, node.title); });
12552
+ find = true;
12553
+ }
12554
+ }
12555
+ // 数据有可能还没加载,等数据加载了再选中
12556
+ if (!find) {
12557
+ this.waittingSelect = id;
12558
+ }
12524
12559
  }
12525
12560
  };
12526
12561
  TreeControlComponent.prototype.nodeClick = function (id, title) { };
@@ -12530,7 +12565,7 @@
12530
12565
  exports.ɵct.decorators = [
12531
12566
  { type: i0.Component, args: [{
12532
12567
  selector: 'sc-tree-control',
12533
- template: "<div *ngIf=\"showSearch\" class=\"searchBox\">\n <input\n class=\"search-input\"\n type=\"text\"\n nz-input\n [(ngModel)]=\"searchValue\"\n [placeholder]=\"searchPlaceholder\"\n [style]=\"{ 'border-color': searchBorderColor, background: searchBackgroundColor }\"\n />\n <i nz-icon nzType=\"search\"></i>\n</div>\n\n<div class=\"warp-tree\">\n <nz-tree\n [ngClass]=\"{ 'ant-tree-nodeBgCustom': nodeBackground }\"\n [ngStyle]=\"style\"\n [nzData]=\"nodes\"\n [nzCheckable]=\"checkable\"\n [nzExpandAll]=\"expandAll\"\n [nzShowLine]=\"showLine\"\n [nzExpandedKeys]=\"expandedKeys\"\n [nzCheckStrictly]=\"checkStrictly\"\n [nzExpandedIcon]=\"nodeDefaultIcon ? multiExpandedIconTpl : null\"\n [nzTreeTemplate]=\"nzTreeTemplate\"\n [nzSearchValue]=\"searchValue\"\n [nzHideUnMatched]=\"true\"\n [nzSelectedKeys]=\"selectedKeys\"\n (nzClick)=\"onClick($event)\"\n (nzDblClick)=\"onNodeDblclick($event)\"\n (nzCheckBoxChange)=\"onCheckBoxChange($event)\"\n >\n </nz-tree>\n <ng-template #multiExpandedIconTpl let-node let-origin=\"origin\">\n <img [src]=\"nodeDefaultIcon\" [class]=\"node.isExpanded ? 'nodeImg-open' : ''\" />\n </ng-template>\n\n <ng-template #nzTreeTemplate let-node let-origin=\"origin\">\n <div\n class=\"custom-node\"\n [style.color]=\"node.isSelected ? nodeCheckedColor : ''\"\n [style.backgroundImage]=\"\n node.isSelected ? 'url(' + nodeCheckedBackground + ')' : nodeBackground ? 'url(' + nodeBackground + ')' : ''\n \"\n [style.padding]=\"\n (grid?.top || 0) + 'px ' + (grid?.right || 0) + 'px ' + (grid?.bottom || 0) + 'px ' + (grid?.left || 0) + 'px'\n \"\n >\n <img\n *ngIf=\"origin.icon && iconPosition !== 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n <span\n *ngIf=\"edittingNode !== node\"\n class=\"folder-name\"\n [innerHTML]=\"node.title | nzHighlight: searchValue:'i':'font-highlight'\"\n (click)=\"showNode(node)\"\n ></span>\n <input *ngIf=\"edittingNode === node\" #renameInput nz-input [(ngModel)]=\"node.title\" (blur)=\"renameEnd(node)\" />\n\n <span class=\"node-count\" [class.noCount]=\"origin.count === '0'\" *ngIf=\"origin.count || origin.count === '0'\"\n >({{ origin.count }})</span\n >\n <img\n *ngIf=\"origin.icon && iconPosition === 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n\n <!-- \n\n <img\n *ngIf=\"origin.icon && iconPosition !== 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n <span\n *ngIf=\"edittingNode !== node\"\n class=\"folder-name\"\n [innerHTML]=\"node.title | nzHighlight: searchValue:'i':'font-highlight'\"\n ></span>\n <input *ngIf=\"edittingNode === node\" #renameInput nz-input [(ngModel)]=\"node.title\" (blur)=\"renameEnd(node)\" />\n <img\n *ngIf=\"origin.icon && iconPosition === 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n /> -->\n </div>\n </ng-template>\n</div>\n",
12568
+ template: "<div *ngIf=\"showSearch\" class=\"searchBox\">\n <input\n class=\"search-input\"\n type=\"text\"\n nz-input\n [(ngModel)]=\"searchValue\"\n [placeholder]=\"searchPlaceholder\"\n [style]=\"{ 'border-color': searchBorderColor, background: searchBackgroundColor }\"\n />\n <i nz-icon nzType=\"search\"></i>\n</div>\n\n<div class=\"warp-tree\">\n <nz-tree\n #tree\n [ngClass]=\"{ 'ant-tree-nodeBgCustom': nodeBackground }\"\n [ngStyle]=\"style\"\n [nzData]=\"nodes\"\n [nzCheckable]=\"checkable\"\n [nzMultiple]=\"checkable\"\n [nzExpandAll]=\"expandAll\"\n [nzShowLine]=\"showLine\"\n [nzExpandedKeys]=\"expandedKeys\"\n [nzCheckStrictly]=\"checkStrictly\"\n [nzExpandedIcon]=\"nodeDefaultIcon ? multiExpandedIconTpl : null\"\n [nzTreeTemplate]=\"nzTreeTemplate\"\n [nzSearchValue]=\"searchValue\"\n [nzHideUnMatched]=\"true\"\n [nzSelectedKeys]=\"selectedKeys\"\n [nzCheckedKeys]=\"selectedKeys\"\n (nzClick)=\"onClick($event)\"\n (nzDblClick)=\"onNodeDblclick($event)\"\n (nzCheckBoxChange)=\"onCheckBoxChange($event)\"\n >\n </nz-tree>\n <ng-template #multiExpandedIconTpl let-node let-origin=\"origin\">\n <img [src]=\"nodeDefaultIcon\" [class]=\"node.isExpanded ? 'nodeImg-open' : ''\" />\n </ng-template>\n\n <ng-template #nzTreeTemplate let-node let-origin=\"origin\">\n <div\n class=\"custom-node\"\n [style.color]=\"node.isSelected ? nodeCheckedColor : ''\"\n [style.backgroundImage]=\"\n node.isSelected ? 'url(' + nodeCheckedBackground + ')' : nodeBackground ? 'url(' + nodeBackground + ')' : ''\n \"\n [style.padding]=\"\n (grid?.top || 0) + 'px ' + (grid?.right || 0) + 'px ' + (grid?.bottom || 0) + 'px ' + (grid?.left || 0) + 'px'\n \"\n >\n <img\n *ngIf=\"origin.icon && iconPosition !== 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n <span\n *ngIf=\"edittingNode !== node\"\n class=\"folder-name\"\n [innerHTML]=\"node.title | nzHighlight: searchValue:'i':'font-highlight'\"\n (click)=\"showNode(node)\"\n ></span>\n <input *ngIf=\"edittingNode === node\" #renameInput nz-input [(ngModel)]=\"node.title\" (blur)=\"renameEnd(node)\" />\n\n <span class=\"node-count\" [class.noCount]=\"origin.count === '0'\" *ngIf=\"origin.count || origin.count === '0'\"\n >({{ origin.count }})</span\n >\n <img\n *ngIf=\"origin.icon && iconPosition === 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n\n <!-- \n\n <img\n *ngIf=\"origin.icon && iconPosition !== 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n />\n <span\n *ngIf=\"edittingNode !== node\"\n class=\"folder-name\"\n [innerHTML]=\"node.title | nzHighlight: searchValue:'i':'font-highlight'\"\n ></span>\n <input *ngIf=\"edittingNode === node\" #renameInput nz-input [(ngModel)]=\"node.title\" (blur)=\"renameEnd(node)\" />\n <img\n *ngIf=\"origin.icon && iconPosition === 'right'\"\n [src]=\"origin.icon\"\n [style.width.px]=\"iconWidth\"\n [style.height.px]=\"iconHeight\"\n /> -->\n </div>\n </ng-template>\n</div>\n",
12534
12569
  styles: [":host{display:block;height:100%;width:100%;overflow:hidden;display:flex;flex-direction:column}.ant-tree,.ant-tree ::ng-deep .ant-tree-checkbox-inner,.ant-tree ::ng-deep .ant-tree-switcher{background:initial}.ant-tree ::ng-deep .ant-tree-switcher-icon{font-size:inherit}.ant-tree ::ng-deep .ant-tree-checkbox{color:inherit}.ant-tree ::ng-deep .ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{border-color:#1890ff}.ant-tree ::ng-deep .ant-tree-switcher-noop>i{display:none}.ant-tree ::ng-deep .ant-tree-node-content-wrapper.ant-tree-node-selected,.ant-tree ::ng-deep .ant-tree-node-content-wrapper:hover{background-color:var(--selected-background)}::ng-deep .ant-tree.ant-tree-nodeBgCustom .ant-tree-node-content-wrapper{flex:1}::ng-deep .ant-tree.ant-tree-nodeBgCustom nz-tree-node-switcher{width:16px}.custom-node{display:flex;align-items:center;white-space:nowrap;background-repeat:no-repeat;background-size:180px 8px;background-position:0 bottom}.searchBox{position:relative;margin-bottom:20px}.searchBox .search-input{line-height:32px;height:32px;color:#7a8799;outline:none;box-shadow:none}.searchBox i.anticon{width:16px;height:16px;color:#8f9ab3;position:absolute;top:10px;right:10px}.warp-tree{flex:1;overflow:auto}.warp-tree::-webkit-scrollbar-thumb{background-color:var(--treeScrollbar-thumb-background,\"#ddd\")!important}.warp-tree::-webkit-scrollbar-corner{background-color:transparent}.folder-name{flex:1}.node-count{color:hsla(0,0%,100%,.8)}.node-count.noCount{color:#7a8799}"]
12535
12570
  },] }
12536
12571
  ];
@@ -12539,6 +12574,7 @@
12539
12574
  { type: i0.ElementRef }
12540
12575
  ]; };
12541
12576
  exports.ɵct.propDecorators = {
12577
+ tree: [{ type: i0.ViewChild, args: ['tree',] }],
12542
12578
  renameInput: [{ type: i0.ViewChild, args: ['renameInput',] }]
12543
12579
  };
12544
12580
  __decorate([
@@ -12553,6 +12589,20 @@
12553
12589
  bbjWidgetBase.Property('复选框', { type: 'boolean' }),
12554
12590
  __metadata("design:type", Object)
12555
12591
  ], exports.ɵct.prototype, "checkable", void 0);
12592
+ __decorate([
12593
+ bbjWidgetBase.Property('输出格式', {
12594
+ type: 'string',
12595
+ enum: [
12596
+ { label: '数组', value: 'array' },
12597
+ { label: '字符串', value: 'string' },
12598
+ ],
12599
+ ui: {
12600
+ widget: 'select',
12601
+ visibleIf: { checkable: [true] },
12602
+ },
12603
+ }),
12604
+ __metadata("design:type", Object)
12605
+ ], exports.ɵct.prototype, "outputType", void 0);
12556
12606
  __decorate([
12557
12607
  bbjWidgetBase.Property('选择完全受控', {
12558
12608
  type: 'boolean',
@@ -12598,7 +12648,7 @@
12598
12648
  type: 'string',
12599
12649
  ui: {
12600
12650
  widget: 'myUpload',
12601
- }
12651
+ },
12602
12652
  }),
12603
12653
  __metadata("design:type", Object)
12604
12654
  ], exports.ɵct.prototype, "nodeDefaultIcon", void 0);
@@ -12607,7 +12657,7 @@
12607
12657
  type: 'string',
12608
12658
  ui: {
12609
12659
  widget: 'myUpload',
12610
- }
12660
+ },
12611
12661
  }),
12612
12662
  __metadata("design:type", Object)
12613
12663
  ], exports.ɵct.prototype, "nodeBackground", void 0);
@@ -12624,7 +12674,7 @@
12624
12674
  type: 'string',
12625
12675
  ui: {
12626
12676
  widget: 'myUpload',
12627
- }
12677
+ },
12628
12678
  }),
12629
12679
  __metadata("design:type", Object)
12630
12680
  ], exports.ɵct.prototype, "nodeCheckedBackground", void 0);
@@ -12640,8 +12690,8 @@
12640
12690
  bbjWidgetBase.Property('搜索框颜色', {
12641
12691
  ui: {
12642
12692
  widget: 'myColor',
12643
- visibleIf: { showSearch: [true] }
12644
- }
12693
+ visibleIf: { showSearch: [true] },
12694
+ },
12645
12695
  }),
12646
12696
  __metadata("design:type", Object)
12647
12697
  ], exports.ɵct.prototype, "searchBorderColor", void 0);
@@ -12649,8 +12699,8 @@
12649
12699
  bbjWidgetBase.Property('搜索框背景色', {
12650
12700
  ui: {
12651
12701
  widget: 'myColor',
12652
- visibleIf: { showSearch: [true] }
12653
- }
12702
+ visibleIf: { showSearch: [true] },
12703
+ },
12654
12704
  }),
12655
12705
  __metadata("design:type", Object)
12656
12706
  ], exports.ɵct.prototype, "searchBackgroundColor", void 0);
@@ -12658,8 +12708,8 @@
12658
12708
  bbjWidgetBase.Property('搜索框提示语', {
12659
12709
  type: 'string',
12660
12710
  ui: {
12661
- visibleIf: { showSearch: [true] }
12662
- }
12711
+ visibleIf: { showSearch: [true] },
12712
+ },
12663
12713
  }),
12664
12714
  __metadata("design:type", Object)
12665
12715
  ], exports.ɵct.prototype, "searchPlaceholder", void 0);
@@ -12667,7 +12717,7 @@
12667
12717
  bbjWidgetBase.Property('滚动条颜色', {
12668
12718
  ui: {
12669
12719
  widget: 'myColor',
12670
- }
12720
+ },
12671
12721
  }),
12672
12722
  __metadata("design:type", Object)
12673
12723
  ], exports.ɵct.prototype, "treeScrollbarThumbBackground", void 0);
@@ -12678,11 +12728,15 @@
12678
12728
  key: { type: 'string', title: 'id' },
12679
12729
  parentKey: { type: 'string', title: '父级id' },
12680
12730
  icon: { type: 'string', title: '图标' },
12681
- count: { type: 'string', title: '数量' }
12731
+ count: { type: 'string', title: '数量' },
12682
12732
  },
12683
12733
  }),
12684
12734
  __metadata("design:type", Object)
12685
12735
  ], exports.ɵct.prototype, "data", void 0);
12736
+ __decorate([
12737
+ bbjWidgetBase.DataInput('选中值'),
12738
+ __metadata("design:type", Object)
12739
+ ], exports.ɵct.prototype, "value", void 0);
12686
12740
  __decorate([
12687
12741
  bbjWidgetBase.DataOutput('选中id'),
12688
12742
  bbjWidgetBase.Event('选中值改变', { params: 'id' }),
@@ -12699,7 +12753,7 @@
12699
12753
  bbjWidgetBase.Method('选中'),
12700
12754
  __param(0, bbjWidgetBase.Param('id')),
12701
12755
  __metadata("design:type", Function),
12702
- __metadata("design:paramtypes", [String]),
12756
+ __metadata("design:paramtypes", [Object]),
12703
12757
  __metadata("design:returntype", void 0)
12704
12758
  ], exports.ɵct.prototype, "select", null);
12705
12759
  __decorate([