Skip to content

Commit

Permalink
Release 20.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
BingoRUS committed May 4, 2020
1 parent 1772823 commit 11c99f7
Show file tree
Hide file tree
Showing 49 changed files with 1,115 additions and 133 deletions.
3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion build/gulp/scss/theme-replacements.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ module.exports = {
{ import: '../list/sizes', type: 'index' },
{ import: '../button', type: 'index' },
{ import: '../button/colors', type: 'index' },
{ import: '../menuBase', type: 'index' },
{ import: '../button/sizes', type: 'index' },
{ regex: /@mixin dx-toolbar-item-padding\(\$MATERIAL_TOOLBAR_ITEM_SPACING\),/, replacement: '@include dx-toolbar-item-padding($MATERIAL_TOOLBAR_ITEM_SPACING);' },
{ regex: /.dx-toolbar-item-padding\(\$MATERIAL_MOBILE_TOOLBAR_ITEM_SPACING\),/, replacement: '@include dx-toolbar-item-padding($MATERIAL_MOBILE_TOOLBAR_ITEM_SPACING);' },
{ regex: /(-bg|-color|: 0|MATERIAL_LIST_ITEM_HEIGHT|MATERIAL_LIST_ITEM_HORIZONTAL_PADDING|4px|2 0|50%),/g, replacement: '$1;' },
Expand Down
8 changes: 7 additions & 1 deletion js/file_management/remote_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class RemoteFileSystemProvider extends FileSystemProviderBase {
renameItem(item, name) {
return this._executeRequest('Rename', {
pathInfo: item.getFullPathInfo(),
isDirectory: item.isDirectory,
name
});
}
Expand All @@ -47,19 +48,24 @@ class RemoteFileSystemProvider extends FileSystemProviderBase {
}

deleteItems(items) {
return items.map(item => this._executeRequest('Remove', { pathInfo: item.getFullPathInfo() }));
return items.map(item => this._executeRequest('Remove', {
pathInfo: item.getFullPathInfo(),
isDirectory: item.isDirectory
}));
}

moveItems(items, destinationDirectory) {
return items.map(item => this._executeRequest('Move', {
sourcePathInfo: item.getFullPathInfo(),
sourceIsDirectory: item.isDirectory,
destinationPathInfo: destinationDirectory.getFullPathInfo()
}));
}

copyItems(items, destinationFolder) {
return items.map(item => this._executeRequest('Copy', {
sourcePathInfo: item.getFullPathInfo(),
sourceIsDirectory: item.isDirectory,
destinationPathInfo: destinationFolder.getFullPathInfo()
}));
}
Expand Down
2 changes: 1 addition & 1 deletion js/ui/data_grid/ui.data_grid.editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gridCore.registerModule('editing', extend(true, {}, editingModule, {
editingController && editingController.refresh();
}

this.callBase.apply(this, arguments);
return this.callBase.apply(this, arguments);
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions js/ui/data_grid/ui.data_grid.grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,14 @@ const GroupingDataControllerExtender = (function() {
const that = this;
const dataSource = this._dataSource;

if(!dataSource) return;

const d = new Deferred();
when(dataSource.changeRowExpand(key)).done(function() {
that.load().done(d.resolve).fail(d.reject);
}).fail(d.reject);

if(!dataSource) {
d.resolve();
} else {
when(dataSource.changeRowExpand(key)).done(function() {
that.load().done(d.resolve).fail(d.reject);
}).fail(d.reject);
}
return d;
},
isRowExpanded: function(key) {
Expand Down
8 changes: 8 additions & 0 deletions js/ui/diagram.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ export interface dxDiagramOptions extends WidgetOptions<dxDiagram> {
* @public
*/
customShapes?: Array<{ allowEditImage?: boolean, allowEditText?: boolean, allowResize?: boolean, backgroundImageHeight?: number, backgroundImageLeft?: number, backgroundImageTop?: number, backgroundImageUrl?: string, backgroundImageToolboxUrl?: string, backgroundImageWidth?: number, baseType?: 'text' | 'rectangle' | 'ellipse' | 'cross' | 'triangle' | 'diamond' | 'heart' | 'pentagon' | 'octagon' | 'star' | 'arrowLeft' | 'arrowTop' | 'arrowRight' | 'arrowBottom' | 'arrowNorthSouth' | 'arrowEastWest' | 'process' | 'decision' | 'terminator' | 'predefinedProcess' | 'document' | 'multipleDocuments' | 'manualInput' | 'preparation' | 'data' | 'database' | 'hardDisk' | 'internalStorage' | 'paperTape' | 'manualOperation' | 'delay' | 'storedData' | 'display' | 'merge' | 'connector' | 'or' | 'summingJunction' | 'verticalContainer' | 'horizontalContainer' | 'cardWithImageOnLeft' | 'cardWithImageOnTop' | 'cardWithImageOnRight' | string, category?: string, connectionPoints?: Array<{ x?: number, y?: number }>, defaultHeight?: number, defaultImageUrl?: string, defaultText?: string, defaultWidth?: number, imageHeight?: number, imageLeft?: number, imageTop?: number, imageWidth?: number, maxHeight?: number, maxWidth?: number, minHeight?: number, minWidth?: number, template?: template | ((container: dxElement, data: { item?: dxDiagramShape }) => any), templateHeight?: number, templateLeft?: number, templateTop?: number, templateWidth?: number, textHeight?: number, textLeft?: number, textTop?: number, textWidth?: number, title?: string, type?: string }>;
/**
* @docid dxDiagramOptions.defaultItemProperties
* @type Object
* @default {}
* @prevFileNamespace DevExpress.ui
* @public
*/
defaultItemProperties?: { style?: Object, textStyle?: Object, connectorLineType?: 'straight' | 'orthogonal', connectorLineStart?: 'none' | 'arrow' | 'outlinedTriangle' | 'filledTriangle', connectorLineEnd?: 'none' | 'arrow' | 'outlinedTriangle' | 'filledTriangle' };
/**
* @docid dxDiagramOptions.edges
* @type Object
Expand Down
120 changes: 83 additions & 37 deletions js/ui/diagram/ui.diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Diagram extends Widget {
this._updateFullscreenState();
}

this._diagramInstance.barManager.registerBar(this.optionsUpdateBar);
this._diagramInstance.registerBar(this.optionsUpdateBar);

if(hasWindow()) {
resizeCallbacks.add(() => {
Expand Down Expand Up @@ -228,7 +228,7 @@ class Diagram extends Widget {
}
_registerBar(component) {
component.bar.onChanged.add(this);
this._diagramInstance.barManager.registerBar(component.bar);
this._diagramInstance.registerBar(component.bar);
}
_getExcludeCommands() {
const excludeCommands = [];
Expand All @@ -243,7 +243,7 @@ class Diagram extends Widget {
_getToolbarBaseOptions() {
return {
onContentReady: ({ component }) => this._registerToolbar(component),
onSubMenuVisibilityChanging: ({ component }) => this._diagramInstance.barManager.updateBarItemsState(component.bar),
onSubMenuVisibilityChanging: ({ component }) => this._diagramInstance.updateBarItemsState(component.bar),
onPointerUp: this._onPanelPointerUp.bind(this),
export: this.option('export'),
excludeCommands: this._getExcludeCommands(),
Expand Down Expand Up @@ -369,7 +369,7 @@ class Diagram extends Widget {
}
},
onVisibilityChanged: (e) => {
if(!e.visible) {
if(!e.visible && !this._textInputStarted) {
this._diagramCaptureFocus();
}

Expand Down Expand Up @@ -521,7 +521,7 @@ class Diagram extends Widget {
}
},
onVisibilityChanged: (e) => {
if(!e.visible) {
if(!e.visible && !this._textInputStarted) {
this._diagramCaptureFocus();
}
},
Expand All @@ -541,7 +541,7 @@ class Diagram extends Widget {
}
_updatePropertiesPanelGroupBars(component) {
component.getActiveToolbars().forEach(toolbar => {
this._diagramInstance.barManager.updateBarItemsState(toolbar.bar);
this._diagramInstance.updateBarItemsState(toolbar.bar);
});
}
_onPanelPointerUp() {
Expand All @@ -562,7 +562,7 @@ class Diagram extends Widget {
this._contextMenu = this._createComponent($contextMenu, DiagramContextMenuWrapper, {
commands: this.option('contextMenu.commands'),
onContentReady: ({ component }) => this._registerBar(component),
onVisibilityChanging: ({ component }) => this._diagramInstance.barManager.updateBarItemsState(component.bar),
onVisibilityChanging: ({ component }) => this._diagramInstance.updateBarItemsState(component.bar),
onItemClick: (itemData) => { return this._onBeforeCommandExecuted(itemData.command); },
export: this.option('export'),
excludeCommands: this._getExcludeCommands(),
Expand Down Expand Up @@ -630,7 +630,7 @@ class Diagram extends Widget {
if(this._dialogInstance) {
this._dialogInstance.option('onGetContent', dialogParameters.onGetContent);
this._dialogInstance.option('onHidden', function() { this._diagramCaptureFocus(); }.bind(this));
this._dialogInstance.option('command', this._diagramInstance.commandManager.getCommand(dialogParameters.command));
this._dialogInstance.option('command', this._diagramInstance.getCommand(dialogParameters.command));
this._dialogInstance.option('title', dialogParameters.title);
this._dialogInstance._show();
}
Expand Down Expand Up @@ -674,6 +674,7 @@ class Diagram extends Widget {
notifySelectionChanged: this._raiseSelectionChanged.bind(this)
});
this._updateEventSubscriptionMethods();
this._updateDefaultItemProperties();

this._updateShapeTexts();
this._updateUnitItems();
Expand Down Expand Up @@ -731,7 +732,7 @@ class Diagram extends Widget {
this._diagramInstance = undefined;
}
_executeDiagramCommand(command, parameter) {
this._diagramInstance.commandManager.getCommand(command).execute(parameter);
this._diagramInstance.getCommand(command).execute(parameter);
}
_refreshDataSources() {
this._beginUpdateDiagram();
Expand Down Expand Up @@ -871,12 +872,7 @@ class Diagram extends Widget {
setText: this._createOptionSetter('edges.textExpr'),
getLineOption: (lineOptionGetter = this._createOptionGetter('edges.lineTypeExpr')) && function(obj) {
const lineType = lineOptionGetter(obj);
switch(lineType) {
case 'straight':
return ConnectorLineOption.Straight;
default:
return ConnectorLineOption.Orthogonal;
}
return this._getConnectorLineOption(lineType);
}.bind(this),
setLineOption: (lineOptionSetter = this._createOptionSetter('edges.lineTypeExpr')) && function(obj, value) {
switch(value) {
Expand All @@ -890,17 +886,8 @@ class Diagram extends Widget {
lineOptionSetter(obj, value);
}.bind(this),
getStartLineEnding: (startLineEndingGetter = this._createOptionGetter('edges.fromLineEndExpr')) && function(obj) {
const lineType = startLineEndingGetter(obj);
switch(lineType) {
case 'arrow':
return ConnectorLineEnding.Arrow;
case 'outlinedTriangle':
return ConnectorLineEnding.OutlinedTriangle;
case 'filledTriangle':
return ConnectorLineEnding.FilledTriangle;
default:
return ConnectorLineEnding.None;
}
const lineEnd = startLineEndingGetter(obj);
return this._getConnectorLineEnding(lineEnd);
}.bind(this),
setStartLineEnding: (startLineEndingSetter = this._createOptionSetter('edges.fromLineEndExpr')) && function(obj, value) {
switch(value) {
Expand All @@ -920,17 +907,8 @@ class Diagram extends Widget {
startLineEndingSetter(obj, value);
}.bind(this),
getEndLineEnding: (endLineEndingGetter = this._createOptionGetter('edges.toLineEndExpr')) && function(obj) {
const lineType = endLineEndingGetter(obj);
switch(lineType) {
case 'none':
return ConnectorLineEnding.None;
case 'outlinedTriangle':
return ConnectorLineEnding.OutlinedTriangle;
case 'filledTriangle':
return ConnectorLineEnding.FilledTriangle;
default:
return ConnectorLineEnding.Arrow;
}
const lineEnd = endLineEndingGetter(obj);
return this._getConnectorLineEnding(lineEnd);
}.bind(this),
setEndLineEnding: (endLineEndingSetter = this._createOptionSetter('edges.toLineEndExpr')) && function(obj, value) {
switch(value) {
Expand All @@ -954,6 +932,28 @@ class Diagram extends Widget {
};
this._executeDiagramCommand(DiagramCommand.BindDocument, data);
}
_getConnectorLineOption(lineType) {
const { ConnectorLineOption } = getDiagram();
switch(lineType) {
case 'straight':
return ConnectorLineOption.Straight;
default:
return ConnectorLineOption.Orthogonal;
}
}
_getConnectorLineEnding(lineEnd) {
const { ConnectorLineEnding } = getDiagram();
switch(lineEnd) {
case 'arrow':
return ConnectorLineEnding.Arrow;
case 'outlinedTriangle':
return ConnectorLineEnding.OutlinedTriangle;
case 'filledTriangle':
return ConnectorLineEnding.FilledTriangle;
default:
return ConnectorLineEnding.None;
}
}
_getDataBindingLayoutParameters() {
const { DataLayoutType, DataLayoutOrientation } = getDiagram();
const layoutParametersOption = this.option('nodes.autoLayout') || 'off';
Expand Down Expand Up @@ -1370,6 +1370,19 @@ class Diagram extends Widget {
eventsEngine.off(element, eventName, handler);
};
}
_updateDefaultItemProperties() {
if(this.option('defaultItemProperties.style')) {
this._diagramInstance.setInitialStyleProperties(this.option('defaultItemProperties.style'));
}
if(this.option('defaultItemProperties.textStyle')) {
this._diagramInstance.setInitialTextStyleProperties(this.option('defaultItemProperties.textStyle'));
}
this._diagramInstance.setInitialConnectorProperties({
lineOption: this._getConnectorLineOption(this.option('defaultItemProperties.connectorLineType')),
startLineEnding: this._getConnectorLineEnding(this.option('defaultItemProperties.connectorLineStart')),
endLineEnding: this._getConnectorLineEnding(this.option('defaultItemProperties.connectorLineEnd'))
});
}

focus() {
this._diagramCaptureFocus();
Expand Down Expand Up @@ -1988,6 +2001,34 @@ class Diagram extends Widget {
*/
},

defaultItemProperties: {
/**
* @name dxDiagramOptions.defaultItemProperties.style
* @type Object
*/
/**
* @name dxDiagramOptions.defaultItemProperties.textStyle
* @type Object
*/
/**
* @name dxDiagramOptions.defaultItemProperties.connectorLineType
* @type Enums.DiagramConnectorLineType
* @default 'orthogonal'
*/
connectorLineType: 'orthogonal',
/**
* @name dxDiagramOptions.defaultItemProperties.connectorLineStart
* @type Enums.DiagramConnectorLineEnd
* @default 'none'
*/
connectorLineStart: 'none',
/**
* @name dxDiagramOptions.defaultItemProperties.connectorLineEnd
* @type Enums.DiagramConnectorLineEnd
* @default 'arrow'
*/
connectorLineEnd: 'arrow',
},
export: {
/**
* @name dxDiagramOptions.export.fileName
Expand Down Expand Up @@ -2095,6 +2136,7 @@ class Diagram extends Widget {
}
}
_raiseTextInputStart() {
this._textInputStarted = true;
if(this._propertiesPanel) {
if(this.isMobileScreenSize() && this._propertiesPanel.isVisible()) {
this._propertiesPanel.hide();
Expand All @@ -2121,6 +2163,7 @@ class Diagram extends Widget {
delete this._toolboxTextInputHidden;
}
}
this._textInputStarted = false;
}

_createItemClickAction() {
Expand Down Expand Up @@ -2370,6 +2413,9 @@ class Diagram extends Widget {
case 'onCustomCommand':
this._createCustomCommand();
break;
case 'defaultItemProperties':
this._updateDefaultItemProperties();
break;
case 'export':
if(this._mainToolbar) {
this._mainToolbar.option('export', args.value);
Expand Down
29 changes: 26 additions & 3 deletions js/ui/draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ const Draggable = DOMComponent.inherit({
}
},

getElementsFromPoint: function(position) {
const ownerDocument = this._$dragElement.get(0).ownerDocument;
getElementsFromPoint: function(position, dragElement) {
const ownerDocument = (dragElement || this._$dragElement.get(0)).ownerDocument;

if(browser.msie) {
const msElements = ownerDocument.msElementsFromPoint(position.x, position.y);
Expand Down Expand Up @@ -817,8 +817,31 @@ const Draggable = DOMComponent.inherit({
}
},

_isTargetOverAnotherDraggable: function(e) {
const sourceDraggable = this._getSourceDraggable();

if(this === sourceDraggable) {
return false;
}

if(!sourceDraggable._dragElementIsCloned()) {
return true;
}

const $sourceDraggableElement = sourceDraggable.$element();
const elements = this.getElementsFromPoint({
x: e.pageX,
y: e.pageY
}, e.target);
const firstWidgetElement = elements.filter((element) => $(element).hasClass(this._addWidgetPrefix()))[0];

return firstWidgetElement !== $sourceDraggableElement.get(0);
},

_dragEnterHandler: function(e) {
this._setTargetDraggable();
if(this._isTargetOverAnotherDraggable(e)) {
this._setTargetDraggable();
}

const sourceDraggable = this._getSourceDraggable();
sourceDraggable.dragEnter(e);
Expand Down
Loading

0 comments on commit 11c99f7

Please sign in to comment.