ps-toolkit-ui 0.2.37 → 0.2.40

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.
@@ -1160,6 +1160,12 @@
1160
1160
  }
1161
1161
  return data;
1162
1162
  };
1163
+ HelperClass.getColorByBgColor = function (bgColor) {
1164
+ if (!bgColor) {
1165
+ return '';
1166
+ }
1167
+ return (parseInt(bgColor.replace('#', ''), 16) > 0xffffff / 2) ? '#000' : '#fff';
1168
+ };
1163
1169
  return HelperClass;
1164
1170
  }());
1165
1171
 
@@ -2820,7 +2826,7 @@
2820
2826
  return HelperClass.getTime(cv);
2821
2827
  }
2822
2828
  else if (col.type === exports.TableCollType.Color) {
2823
- return '<div class="color" style="background-color: ' + cv + '">' + cv + '</div>';
2829
+ return '<div class="color" style="background-color: ' + cv + '; color: ' + HelperClass.getColorByBgColor(cv) + '">' + cv + '</div>';
2824
2830
  }
2825
2831
  else if (col.type === exports.TableCollType.Url) {
2826
2832
  return '<a target="_blank" href="' + cv + '">' + cv + '</a>';
@@ -4909,7 +4915,7 @@
4909
4915
  FormSelectItemComponent.decorators = [
4910
4916
  { type: core.Component, args: [{
4911
4917
  selector: 'lib-form-select-item',
4912
- template: "<div [className]=\"'option-con' + (item.value == select.value ? ' selected' : '') + (item.index == select.hover ? ' hover' : '')\" *ngIf=\"item.show\">\r\n<!-- <i class=\"fas fa-caret-left caret-icon\" (click)=\"toggleChildren($event)\" *ngIf=\"item.options.length > 0\"></i>-->\r\n <div (mousemove)=\"hoverOption(item)\" (click)=\"selectOption.emit(item.value)\" class=\"option\">\r\n <div [className]=\"(item.selected ? 'checked ' : item.selected == null ? 'null ' : '') + ' check'\" *ngIf=\"select.multiple\"></div>\r\n <span [innerHTML]=\"select.l(item.name)\"></span>\r\n </div>\r\n <div *ngIf=\"item.options.length > 0 && (select.level === null || select.level > index)\" class=\"children rightline\">\r\n <lib-form-select-item (selectOption)=\"selectOption.emit($event)\" [index]=\"index + 1\" [parent]=\"item\" [item]=\"op\" [select]=\"select\" *ngFor=\"let op of item.options\"></lib-form-select-item>\r\n </div>\r\n</div>\r\n",
4918
+ template: "<div [className]=\"'option-con' + (item.value == select.value ? ' selected' : '') + (item.index == select.hover ? ' hover' : '')\" *ngIf=\"item.show\">\r\n<!-- <i class=\"fas fa-caret-left caret-icon\" (click)=\"toggleChildren($event)\" *ngIf=\"item.options.length > 0\"></i>-->\r\n <div (mousemove)=\"hoverOption(item)\" (click)=\"selectOption.emit(item.value)\" class=\"option\">\r\n <div [className]=\"(item.selected ? 'checked ' : item.selected == null ? 'null ' : '') + ' check'\" *ngIf=\"select.multiple\"></div>\r\n <span [innerHTML]=\"select.l(item.name) | safeHtml\"></span>\r\n </div>\r\n <div *ngIf=\"item.options.length > 0 && (select.level === null || select.level > index)\" class=\"children rightline\">\r\n <lib-form-select-item (selectOption)=\"selectOption.emit($event)\" [index]=\"index + 1\" [parent]=\"item\" [item]=\"op\" [select]=\"select\" *ngFor=\"let op of item.options\"></lib-form-select-item>\r\n </div>\r\n</div>\r\n",
4913
4919
  styles: [".option-con{float:right;width:100%}.option-con .caret-icon{float:right;font-size:20px;height:35px;line-height:33px;text-align:center;width:35px}.option-con .children{float:left;position:relative;width:calc(100% - 35px)}.option{align-items:center;border-radius:0;display:flex;float:left;font-size:10px;justify-content:center;line-height:15px;min-height:30px;padding:3px 10px;position:relative;text-align:center;width:100%}.option .check:after{content:\"\\f0c8\";font-family:Font Awesome\\ 5 Pro;font-size:18px;font-weight:400;height:20px;line-height:20px;position:absolute;right:5px;top:5px;width:20px}.option .check.checked:after{content:\"\\f14a\"}.option .check.checked:after,.option .check.null:after{animation:pop .18s ease-in;color:var(--green);font-weight:900}.option .check.null:after{content:\"\\f146\"}.option-con.hover>.option,.option-con.selected>.option{background-color:var(--black-white)}"]
4914
4920
  },] }
4915
4921
  ];