ngx-rs-ant 2.1.8 → 2.2.0

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.
@@ -2091,6 +2091,37 @@ function evaluateCondition(condition, model) {
2091
2091
  default:
2092
2092
  return false;
2093
2093
  }
2094
+ }
2095
+ function addWatermark(container, watermark) {
2096
+ let watermarkDiv = document.getElementById(watermark.id);
2097
+ if (watermarkDiv) {
2098
+ watermarkDiv.remove();
2099
+ }
2100
+ const width = 5000 / watermark.density;
2101
+ const height = 5000 / watermark.density;
2102
+ const canvas = document.createElement('canvas');
2103
+ canvas.width = width;
2104
+ canvas.height = height;
2105
+ const ctx = canvas.getContext('2d');
2106
+ ctx.textAlign = 'center';
2107
+ ctx.textBaseline = 'middle';
2108
+ ctx.font = `${watermark.size}px ${watermark.font}`;
2109
+ ctx.fillStyle = watermark.color;
2110
+ ctx.translate(width / 2, height / 2);
2111
+ ctx.rotate(watermark.rotate * Math.PI / 180);
2112
+ ctx.translate(-width / 2, -height / 2);
2113
+ ctx.fillText(watermark.text, width / 2, height / 2);
2114
+ const base64Url = canvas.toDataURL();
2115
+ watermarkDiv = document.createElement('div');
2116
+ watermarkDiv.id = watermark.id;
2117
+ watermarkDiv.style.position = 'absolute';
2118
+ watermarkDiv.style.inset = '0';
2119
+ watermarkDiv.style.zIndex = '5000';
2120
+ watermarkDiv.style.pointerEvents = 'none';
2121
+ watermarkDiv.style.backgroundImage = `url(${base64Url})`;
2122
+ watermarkDiv.style.backgroundRepeat = 'repeat';
2123
+ container.style.position = 'relative';
2124
+ container.insertBefore(watermarkDiv, container.firstChild);
2094
2125
  }
2095
2126
 
2096
2127
  class CustomTemplateDirective {
@@ -2235,6 +2266,7 @@ class DataGridFactory {
2235
2266
  break;
2236
2267
  case 'STRING':
2237
2268
  column.headerFilter.dataSource = (options) => {
2269
+ // TODO 超过20条会分页添加多次,不分页前端性能差,考虑在构建dataSource时处理,与日期类型存在冲突
2238
2270
  options.dataSource.postProcess = (data) => {
2239
2271
  data.unshift({
2240
2272
  key: '',
@@ -2421,6 +2453,7 @@ class DataGridFactory {
2421
2453
  if (loadOptions.dataField) {
2422
2454
  // 未重写headerFilter的dataSource时,headerFilter会调用load方法加载筛选树,重写该方法查询该表所有数据
2423
2455
  // 该方式存在风险,无法识别DevExtreme一定是通过headerFilter过滤才存在dataField参数
2456
+ // TODO 需要考虑已存在的过滤条件,与带约束的字段存在冲突,此处存在过滤条件,加载列时带约束的字段构建的dataSource获取不到过滤条件
2424
2457
  return lastValueFrom(this.service.getColumnDataSource(tenant, className, view, loadOptions.dataField));
2425
2458
  }
2426
2459
  let params = '?';
@@ -4073,5 +4106,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4073
4106
  * Generated bundle index. Do not edit.
4074
4107
  */
4075
4108
 
4076
- export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DxNativeElementPipe, DynamicParamsComponent, DynamicParamsModule, FieldSelectorComponent, FormComponent, FormItemComponentBase, FormItemConfigBase, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule, ItemConfigComponent, ItemStyleComponent, ModalComponent, ModalComponentBase, ModalConfigBase, ModalModule, ModalService, PageItemComponentBase, PageItemConfigBase, PdfViewerComponent, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, deepClone, download_file, evaluateFilter, file_type_icon, filename_from_disposition, format_file_size, localeSortMethod, notify_error, notify_success, notify_warning, openBrowserTab, support_preview_ext, validate, validate_group, validate_group_by_name };
4109
+ export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, DxNativeElementPipe, DynamicParamsComponent, DynamicParamsModule, FieldSelectorComponent, FormComponent, FormItemComponentBase, FormItemConfigBase, FormModule, FormService, FullscreenDirective, IconSelectorComponent, IconSelectorModule, ItemConfigComponent, ItemStyleComponent, ModalComponent, ModalComponentBase, ModalConfigBase, ModalModule, ModalService, PageItemComponentBase, PageItemConfigBase, PdfViewerComponent, PluginManager, RowButtonsTemplateDirective, TooltipContentTemplateDirective, WebsocketModule, WebsocketService, addWatermark, deepClone, download_file, evaluateFilter, file_type_icon, filename_from_disposition, format_file_size, localeSortMethod, notify_error, notify_success, notify_warning, openBrowserTab, support_preview_ext, validate, validate_group, validate_group_by_name };
4077
4110
  //# sourceMappingURL=ngx-rs-ant.mjs.map