ngx-rs-ant 2.1.0 → 2.1.2
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.
- package/esm2020/data-grid/cell-component-template/cell-component-template.component.mjs +13 -11
- package/esm2020/data-grid/data-grid.component.mjs +2 -2
- package/esm2020/form/form.component.mjs +5 -2
- package/esm2020/util/utils.mjs +36 -3
- package/fesm2015/ngx-rs-ant.mjs +53 -15
- package/fesm2015/ngx-rs-ant.mjs.map +1 -1
- package/fesm2020/ngx-rs-ant.mjs +53 -15
- package/fesm2020/ngx-rs-ant.mjs.map +1 -1
- package/package.json +1 -1
- package/util/utils.d.ts +1 -0
package/fesm2020/ngx-rs-ant.mjs
CHANGED
|
@@ -1948,7 +1948,10 @@ function validateGroup(validationGroup, brokenElementParent) {
|
|
|
1948
1948
|
const validateResult = validationGroup.validate();
|
|
1949
1949
|
if (!validateResult.isValid) {
|
|
1950
1950
|
const brokenElement = (validateResult.brokenRules?.[0]).validator.element();
|
|
1951
|
-
findTargetNode(brokenElement).scrollIntoView(
|
|
1951
|
+
findTargetNode(brokenElement).scrollIntoView({
|
|
1952
|
+
block: 'center',
|
|
1953
|
+
inline: 'center'
|
|
1954
|
+
});
|
|
1952
1955
|
resolve(false);
|
|
1953
1956
|
}
|
|
1954
1957
|
if (validateResult.status === 'pending') {
|
|
@@ -1958,7 +1961,10 @@ function validateGroup(validationGroup, brokenElementParent) {
|
|
|
1958
1961
|
}
|
|
1959
1962
|
else {
|
|
1960
1963
|
const brokenElement = (result.brokenRules?.[0]).validator.element();
|
|
1961
|
-
findTargetNode(brokenElement).scrollIntoView(
|
|
1964
|
+
findTargetNode(brokenElement).scrollIntoView({
|
|
1965
|
+
block: 'center',
|
|
1966
|
+
inline: 'center'
|
|
1967
|
+
});
|
|
1962
1968
|
resolve(false);
|
|
1963
1969
|
}
|
|
1964
1970
|
});
|
|
@@ -1972,6 +1978,33 @@ function openBrowserTab(pluginName, title, pluginConfig, params) {
|
|
|
1972
1978
|
return window.open('custom/' + pluginName + '?title=' + encodeURIComponent(title || '')
|
|
1973
1979
|
+ '&pluginConfig=' + encodeURIComponent(JSON.stringify(pluginConfig || {}))
|
|
1974
1980
|
+ '¶ms=' + encodeURIComponent(JSON.stringify(params || {})));
|
|
1981
|
+
}
|
|
1982
|
+
function deepClone(obj) {
|
|
1983
|
+
// 如果是基础数据类型,直接返回
|
|
1984
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
1985
|
+
return obj;
|
|
1986
|
+
}
|
|
1987
|
+
// 获取对象的构造函数
|
|
1988
|
+
const constructor = obj.constructor;
|
|
1989
|
+
// 处理数组和对象
|
|
1990
|
+
let result;
|
|
1991
|
+
if (constructor === Array) {
|
|
1992
|
+
result = [];
|
|
1993
|
+
// 遍历数组,递归深拷贝
|
|
1994
|
+
for (let i = 0; i < obj.length; i++) {
|
|
1995
|
+
result[i] = deepClone(obj[i]);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
else {
|
|
1999
|
+
result = new constructor();
|
|
2000
|
+
// 递归拷贝对象属性
|
|
2001
|
+
for (const key in obj) {
|
|
2002
|
+
if (obj.hasOwnProperty(key)) {
|
|
2003
|
+
result[key] = deepClone(obj[key]);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
return result;
|
|
1975
2008
|
}
|
|
1976
2009
|
|
|
1977
2010
|
class CustomTemplateDirective {
|
|
@@ -2627,7 +2660,10 @@ class FormComponent extends UniqueId {
|
|
|
2627
2660
|
scrollToAnchorPoint(anchorPointId) {
|
|
2628
2661
|
const points = this.elementRef.nativeElement.getElementsByClassName('__anchor_point_' + anchorPointId);
|
|
2629
2662
|
if (points.length > 0) {
|
|
2630
|
-
points[0].scrollIntoView(
|
|
2663
|
+
points[0].scrollIntoView({
|
|
2664
|
+
block: 'center',
|
|
2665
|
+
inline: 'center'
|
|
2666
|
+
});
|
|
2631
2667
|
}
|
|
2632
2668
|
}
|
|
2633
2669
|
validate() {
|
|
@@ -2747,16 +2783,18 @@ class CellComponentTemplateComponent {
|
|
|
2747
2783
|
this.cellComponentRef.createComponent(PluginNotFoundComponent);
|
|
2748
2784
|
return;
|
|
2749
2785
|
}
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2786
|
+
setTimeout(() => {
|
|
2787
|
+
const componentRef = this.cellComponentRef.createComponent(plugin.component);
|
|
2788
|
+
const instance = componentRef.instance;
|
|
2789
|
+
Object.assign(instance, cellComponentConfig);
|
|
2790
|
+
instance.field = this.cellInfo.column.dataField;
|
|
2791
|
+
instance.fieldConfig = fieldConfig;
|
|
2792
|
+
instance.rowData = this.cellInfo.data;
|
|
2793
|
+
instance.columnLookup = this.cellInfo.column.lookup;
|
|
2794
|
+
instance.value = this.cellInfo.value;
|
|
2795
|
+
instance.displayValue = this.cellInfo.displayValue;
|
|
2796
|
+
instance.loaded$ = this.service.cellTemplateLoaded$;
|
|
2797
|
+
});
|
|
2760
2798
|
}
|
|
2761
2799
|
}
|
|
2762
2800
|
CellComponentTemplateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CellComponentTemplateComponent, deps: [{ token: DataGridService }], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -2804,7 +2842,7 @@ class DataGridComponent {
|
|
|
2804
2842
|
this.allowedPageSizes.push(this.pageSize);
|
|
2805
2843
|
}
|
|
2806
2844
|
this.reload();
|
|
2807
|
-
this.service.cellTemplateLoaded$.pipe(debounceTime(
|
|
2845
|
+
this.service.cellTemplateLoaded$.pipe(debounceTime(100)).subscribe(() => {
|
|
2808
2846
|
this.dxDataGrid.instance.resize();
|
|
2809
2847
|
});
|
|
2810
2848
|
}
|
|
@@ -3893,5 +3931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
3893
3931
|
* Generated bundle index. Do not edit.
|
|
3894
3932
|
*/
|
|
3895
3933
|
|
|
3896
|
-
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, 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, download_file, 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 };
|
|
3934
|
+
export { BoxContainerComponent, BoxContainerModule, CamundaBpmnEditorComponent, CamundaBpmnEditorModule, CamundaBpmnViewerComponent, CamundaBpmnViewerModule, CellComponentBase, CellConfigBase, ChangeFilter, CodeEditorComponent, CodeEditorModule, CustomTemplateDirective, DataGridComponent, DataGridFactory, DataGridModule, DataGridService, DrawerComponent, DrawerModule, DrawerService, 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, 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 };
|
|
3897
3935
|
//# sourceMappingURL=ngx-rs-ant.mjs.map
|