Skip to content

Commit

Permalink
version 3.2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
rinick committed Feb 10, 2023
1 parent 99ed471 commit bec7fff
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 21 deletions.
3 changes: 2 additions & 1 deletion es/DockPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DockDropLayer } from "./DockDropLayer";
import { getFloatPanelSize, nextZIndex } from "./Algorithm";
import { DockDropEdge } from "./DockDropEdge";
import { groupClassNames } from "./Utils";
import classNames from "classnames";
export class DockPanel extends React.PureComponent {
constructor() {
super(...arguments);
Expand Down Expand Up @@ -249,7 +250,7 @@ export class DockPanel extends React.PureComponent {
heightFlex = panelHeightFlex;
}
}
let panelClass = groupClassNames(styleName);
let panelClass = classNames(groupClassNames(styleName));
let isMax = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'maximize';
let isFloat = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'float';
let isHBox = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'horizontal';
Expand Down
3 changes: 2 additions & 1 deletion es/DockTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import DockTabPane from "./DockTabPane";
import { getFloatPanelSize } from "./Algorithm";
import { WindowBox } from "./WindowBox";
import { groupClassNames } from "./Utils";
import classNames from "classnames";
function findParentPanel(element) {
for (let i = 0; i < 10; ++i) {
if (!element) {
Expand Down Expand Up @@ -255,7 +256,7 @@ export class DockTabs extends React.PureComponent {
for (let [id, tab] of this._cache) {
children.push(tab.content);
}
return (React.createElement(Tabs, { prefixCls: "dock", moreIcon: moreIcon, animated: animated, renderTabBar: this.renderTabBar, activeKey: activeId, onChange: this.onTabChange, popupClassName: groupClassNames(group) }, children));
return (React.createElement(Tabs, { prefixCls: "dock", moreIcon: moreIcon, animated: animated, renderTabBar: this.renderTabBar, activeKey: activeId, onChange: this.onTabChange, popupClassName: classNames(groupClassNames(group)) }, children));
}
}
DockTabs.contextType = DockContextType;
Expand Down
2 changes: 1 addition & 1 deletion es/Utils.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const groupClassNames: (groupName?: string, classes?: string[]) => string;
export declare const groupClassNames: (groupNames?: string) => string[];
10 changes: 4 additions & 6 deletions es/Utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export const groupClassNames = (groupName = '', classes = []) => {
var _a;
return ((_a = groupName.split(' ').map((name) => `dock-style-${name}`)) !== null && _a !== void 0 ? _a : [])
.concat(classes)
.join(' ');
};
export const groupClassNames = (groupNames = '') => groupNames
.split(' ')
.filter((value) => value !== '')
.map((name) => `dock-style-${name}`);
3 changes: 2 additions & 1 deletion es/dragdrop/DragManager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from "classnames";
import { groupClassNames } from "../Utils";
export class DragState {
constructor(event, component, init = false) {
Expand Down Expand Up @@ -151,7 +152,7 @@ function _createDraggingDiv(doc) {
_draggingDiv = doc.createElement('div');
_draggingIcon = doc.createElement('div');
const tabGroup = (_data && 'tabGroup' in _data ? _data['tabGroup'] : undefined);
_draggingDiv.className = groupClassNames(tabGroup, ['dragging-layer']);
_draggingDiv.className = classNames(groupClassNames(tabGroup), 'dragging-layer');
_draggingDiv.appendChild(document.createElement('div')); // place holder for dragging element
_draggingDiv.appendChild(_draggingIcon);
}
Expand Down
6 changes: 5 additions & 1 deletion lib/DockPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DockPanel = void 0;
const React = __importStar(require("react"));
Expand All @@ -29,6 +32,7 @@ const DockDropLayer_1 = require("./DockDropLayer");
const Algorithm_1 = require("./Algorithm");
const DockDropEdge_1 = require("./DockDropEdge");
const Utils_1 = require("./Utils");
const classnames_1 = __importDefault(require("classnames"));
class DockPanel extends React.PureComponent {
constructor() {
super(...arguments);
Expand Down Expand Up @@ -271,7 +275,7 @@ class DockPanel extends React.PureComponent {
heightFlex = panelHeightFlex;
}
}
let panelClass = Utils_1.groupClassNames(styleName);
let panelClass = classnames_1.default(Utils_1.groupClassNames(styleName));
let isMax = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'maximize';
let isFloat = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'float';
let isHBox = (parent === null || parent === void 0 ? void 0 : parent.mode) === 'horizontal';
Expand Down
3 changes: 2 additions & 1 deletion lib/DockTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const DockTabPane_1 = __importDefault(require("./DockTabPane"));
const Algorithm_1 = require("./Algorithm");
const WindowBox_1 = require("./WindowBox");
const Utils_1 = require("./Utils");
const classnames_1 = __importDefault(require("classnames"));
function findParentPanel(element) {
for (let i = 0; i < 10; ++i) {
if (!element) {
Expand Down Expand Up @@ -281,7 +282,7 @@ class DockTabs extends React.PureComponent {
for (let [id, tab] of this._cache) {
children.push(tab.content);
}
return (React.createElement(rc_tabs_1.default, { prefixCls: "dock", moreIcon: moreIcon, animated: animated, renderTabBar: this.renderTabBar, activeKey: activeId, onChange: this.onTabChange, popupClassName: Utils_1.groupClassNames(group) }, children));
return (React.createElement(rc_tabs_1.default, { prefixCls: "dock", moreIcon: moreIcon, animated: animated, renderTabBar: this.renderTabBar, activeKey: activeId, onChange: this.onTabChange, popupClassName: classnames_1.default(Utils_1.groupClassNames(group)) }, children));
}
}
exports.DockTabs = DockTabs;
Expand Down
2 changes: 1 addition & 1 deletion lib/Utils.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const groupClassNames: (groupName?: string, classes?: string[]) => string;
export declare const groupClassNames: (groupNames?: string) => string[];
10 changes: 4 additions & 6 deletions lib/Utils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.groupClassNames = void 0;
const groupClassNames = (groupName = '', classes = []) => {
var _a;
return ((_a = groupName.split(' ').map((name) => `dock-style-${name}`)) !== null && _a !== void 0 ? _a : [])
.concat(classes)
.join(' ');
};
const groupClassNames = (groupNames = '') => groupNames
.split(' ')
.filter((value) => value !== '')
.map((name) => `dock-style-${name}`);
exports.groupClassNames = groupClassNames;
6 changes: 5 additions & 1 deletion lib/dragdrop/DragManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeDragStateListener = exports.addDragStateListener = exports.destroyDraggingElement = exports.removeHandlers = exports.addHandlers = exports.isDragging = exports.DragState = void 0;
const classnames_1 = __importDefault(require("classnames"));
const Utils_1 = require("../Utils");
class DragState {
constructor(event, component, init = false) {
Expand Down Expand Up @@ -158,7 +162,7 @@ function _createDraggingDiv(doc) {
_draggingDiv = doc.createElement('div');
_draggingIcon = doc.createElement('div');
const tabGroup = (_data && 'tabGroup' in _data ? _data['tabGroup'] : undefined);
_draggingDiv.className = Utils_1.groupClassNames(tabGroup, ['dragging-layer']);
_draggingDiv.className = classnames_1.default(Utils_1.groupClassNames(tabGroup), 'dragging-layer');
_draggingDiv.appendChild(document.createElement('div')); // place holder for dragging element
_draggingDiv.appendChild(_draggingIcon);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-dock",
"version": "3.2.16",
"version": "3.2.17",
"description": "dock layout for react component",
"repository": {
"type": "git",
Expand Down

0 comments on commit bec7fff

Please sign in to comment.