Comparing version 3.0.10 to 3.0.11
@@ -14,3 +14,3 @@ import { maximePlaceHolderId, placeHolderStyle } from "./DockData"; | ||
function clone(value, extra) { | ||
let newValue = Object.assign(Object.assign({}, value), extra); | ||
let newValue = { ...value, ...extra }; | ||
if (Array.isArray(newValue.tabs)) { | ||
@@ -381,3 +381,8 @@ newValue.tabs = newValue.tabs.concat(); | ||
} | ||
let placeHodlerPanel = Object.assign(Object.assign({}, panel), { id: maximePlaceHolderId, tabs: [], panelLock: {} }); | ||
let placeHodlerPanel = { | ||
...panel, | ||
id: maximePlaceHolderId, | ||
tabs: [], | ||
panelLock: {} | ||
}; | ||
layout = replacePanel(layout, panel, placeHodlerPanel); | ||
@@ -392,3 +397,3 @@ layout = dockPanelToBox(layout, panel, layout.maxbox, 'middle'); | ||
let { x, y, z, w, h } = placeHolder; | ||
panel = Object.assign(Object.assign({}, panel), { x, y, z, w, h }); | ||
panel = { ...panel, x, y, z, w, h }; | ||
return replacePanel(layout, placeHolder, panel); | ||
@@ -660,12 +665,12 @@ } | ||
if (box.id === layout.dockbox.id || box === layout.dockbox) { | ||
return Object.assign(Object.assign({}, layout), { dockbox: newBox }); | ||
return { ...layout, dockbox: newBox }; | ||
} | ||
else if (box.id === layout.floatbox.id || box === layout.floatbox) { | ||
return Object.assign(Object.assign({}, layout), { floatbox: newBox }); | ||
return { ...layout, floatbox: newBox }; | ||
} | ||
else if (box.id === layout.windowbox.id || box === layout.windowbox) { | ||
return Object.assign(Object.assign({}, layout), { windowbox: newBox }); | ||
return { ...layout, windowbox: newBox }; | ||
} | ||
else if (box.id === layout.maxbox.id || box === layout.maxbox) { | ||
return Object.assign(Object.assign({}, layout), { maxbox: newBox }); | ||
return { ...layout, maxbox: newBox }; | ||
} | ||
@@ -672,0 +677,0 @@ } |
@@ -1,12 +0,1 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import React from "react"; | ||
@@ -65,3 +54,3 @@ import { DockContextType } from "./DockData"; | ||
render() { | ||
let _a = this.props, { children, mode, className } = _a, others = __rest(_a, ["children", "mode", "className"]); | ||
let { children, mode, className, ...others } = this.props; | ||
let isVertical = mode === 'vertical'; | ||
@@ -68,0 +57,0 @@ let childrenRender = []; |
@@ -1,12 +0,1 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import React from "react"; | ||
@@ -133,3 +122,3 @@ import ReactDOM from "react-dom"; | ||
prepareInitData(data) { | ||
let layout = Object.assign({}, data); | ||
let layout = { ...data }; | ||
Algorithm.fixLayoutData(layout, this.props.loadTab); | ||
@@ -344,4 +333,4 @@ return layout; | ||
if (dropRect) { | ||
let { element, direction } = dropRect, rect = __rest(dropRect, ["element", "direction"]); | ||
dropRectStyle = Object.assign(Object.assign({}, rect), { display: 'block' }); | ||
let { element, direction, ...rect } = dropRect; | ||
dropRectStyle = { ...rect, display: 'block' }; | ||
if (direction === 'float') { | ||
@@ -348,0 +337,0 @@ dropRectStyle.transition = 'none'; |
@@ -1,18 +0,7 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import React from "react"; | ||
import { DragDropDiv } from "./dragdrop/DragDropDiv"; | ||
export function DockTabBar(props) { | ||
const { onDragStart, onDragMove, onDragEnd, TabNavList } = props, restProps = __rest(props, ["onDragStart", "onDragMove", "onDragEnd", "TabNavList"]); | ||
const { onDragStart, onDragMove, onDragEnd, TabNavList, ...restProps } = props; | ||
return (React.createElement(DragDropDiv, { onDragStartT: onDragStart, onDragMoveT: onDragMove, onDragEndT: onDragEnd, role: "tablist", className: 'dock-bar', tabIndex: 0 }, | ||
React.createElement(TabNavList, Object.assign({}, restProps)))); | ||
} |
@@ -55,3 +55,3 @@ import React from 'react'; | ||
let getRef = cached ? this.getRef : null; | ||
return (React.createElement("div", { ref: getRef, id: cacheId, role: "tabpanel", tabIndex: active ? 0 : -1, "aria-labelledby": id && `${id}-tab-${tabKey}`, "aria-hidden": !active, style: Object.assign(Object.assign({}, mergedStyle), style), className: classNames(`${prefixCls}-tabpane`, active && `${prefixCls}-tabpane-active`, className) }, (active || this.visited || forceRender) && renderChildren)); | ||
return (React.createElement("div", { ref: getRef, id: cacheId, role: "tabpanel", tabIndex: active ? 0 : -1, "aria-labelledby": id && `${id}-tab-${tabKey}`, "aria-hidden": !active, style: { ...mergedStyle, ...style }, className: classNames(`${prefixCls}-tabpane`, active && `${prefixCls}-tabpane-active`, className) }, (active || this.visited || forceRender) && renderChildren)); | ||
} | ||
@@ -58,0 +58,0 @@ componentDidMount() { |
@@ -25,4 +25,3 @@ import React from "react"; | ||
function isPopupDiv(r) { | ||
var _a, _b; | ||
return (r == null || ((_a = r.parentElement) === null || _a === void 0 ? void 0 : _a.tagName) === 'LI' || ((_b = r.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement.tagName) === 'LI'); | ||
return (r == null || r.parentElement?.tagName === 'LI' || r.parentElement?.parentElement.tagName === 'LI'); | ||
} | ||
@@ -29,0 +28,0 @@ export class TabCache { |
@@ -1,12 +0,1 @@ | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
import React from "react"; | ||
@@ -275,3 +264,3 @@ import * as DragManager from "./DragManager"; | ||
render() { | ||
let _a = this.props, { getRef, children, className, directDragT, onDragStartT, onDragMoveT, onDragEndT, onDragOverT, onDragLeaveT, onDropT, onGestureStartT, onGestureMoveT, onGestureEndT, useRightButtonDragT } = _a, others = __rest(_a, ["getRef", "children", "className", "directDragT", "onDragStartT", "onDragMoveT", "onDragEndT", "onDragOverT", "onDragLeaveT", "onDropT", "onGestureStartT", "onGestureMoveT", "onGestureEndT", "useRightButtonDragT"]); | ||
let { getRef, children, className, directDragT, onDragStartT, onDragMoveT, onDragEndT, onDragOverT, onDragLeaveT, onDropT, onGestureStartT, onGestureMoveT, onGestureEndT, useRightButtonDragT, ...others } = this.props; | ||
let onTouchDown = this.onPointerDown; | ||
@@ -278,0 +267,0 @@ let onMouseDown = this.onPointerDown; |
@@ -7,3 +7,3 @@ import React from "react"; | ||
if (panelData) { | ||
this.hidePanelData = Object.assign(Object.assign({}, panelData), { tabs: [] }); | ||
this.hidePanelData = { ...panelData, tabs: [] }; | ||
return (React.createElement("div", { className: 'dock-box dock-mbox dock-mbox-show' }, | ||
@@ -10,0 +10,0 @@ React.createElement(DockPanel, { size: 100, panelData: panelData }))); |
@@ -90,8 +90,2 @@ import { maximePlaceHolderId } from "./DockData"; | ||
export function loadLayoutData(savedLayout, defaultLayout, loadTab, afterPanelLoaded) { | ||
if (!savedLayout.floatbox) { | ||
savedLayout.floatbox = { mode: 'float', children: [], size: 0 }; | ||
} | ||
if (!savedLayout.maxbox) { | ||
savedLayout.maxbox = { mode: 'maximize', children: [], size: 1 }; | ||
} | ||
let cache = createLayoutCache(defaultLayout); | ||
@@ -131,3 +125,3 @@ function loadTabData(savedTab) { | ||
else if (cache.panels.has(id)) { | ||
panelData = Object.assign(Object.assign({}, cache.panels.get(id)), panelData); | ||
panelData = { ...cache.panels.get(id), ...panelData }; | ||
} | ||
@@ -154,6 +148,6 @@ return panelData; | ||
dockbox: loadBoxData(savedLayout.dockbox), | ||
floatbox: loadBoxData(savedLayout.floatbox), | ||
windowbox: loadBoxData(savedLayout.windowbox), | ||
maxbox: loadBoxData(savedLayout.maxbox), | ||
floatbox: loadBoxData(savedLayout.floatbox ?? { mode: 'float', children: [], size: 0 }), | ||
windowbox: loadBoxData(savedLayout.windowbox ?? { mode: 'window', children: [], size: 0 }), | ||
maxbox: loadBoxData(savedLayout.maxbox ?? { mode: 'maximize', children: [], size: 1 }), | ||
}; | ||
} |
@@ -95,8 +95,3 @@ "use strict"; | ||
function loadLayoutData(savedLayout, defaultLayout, loadTab, afterPanelLoaded) { | ||
if (!savedLayout.floatbox) { | ||
savedLayout.floatbox = { mode: 'float', children: [], size: 0 }; | ||
} | ||
if (!savedLayout.maxbox) { | ||
savedLayout.maxbox = { mode: 'maximize', children: [], size: 1 }; | ||
} | ||
var _a, _b, _c; | ||
let cache = createLayoutCache(defaultLayout); | ||
@@ -158,7 +153,7 @@ function loadTabData(savedTab) { | ||
dockbox: loadBoxData(savedLayout.dockbox), | ||
floatbox: loadBoxData(savedLayout.floatbox), | ||
windowbox: loadBoxData(savedLayout.windowbox), | ||
maxbox: loadBoxData(savedLayout.maxbox), | ||
floatbox: loadBoxData((_a = savedLayout.floatbox) !== null && _a !== void 0 ? _a : { mode: 'float', children: [], size: 0 }), | ||
windowbox: loadBoxData((_b = savedLayout.windowbox) !== null && _b !== void 0 ? _b : { mode: 'window', children: [], size: 0 }), | ||
maxbox: loadBoxData((_c = savedLayout.maxbox) !== null && _c !== void 0 ? _c : { mode: 'maximize', children: [], size: 1 }), | ||
}; | ||
} | ||
exports.loadLayoutData = loadLayoutData; |
{ | ||
"name": "rc-dock", | ||
"version": "3.0.10", | ||
"version": "3.0.11", | ||
"description": "dock layout for react component", | ||
@@ -36,3 +36,3 @@ "repository": { | ||
"rc-menu": "^8.10.5", | ||
"rc-new-window": "^0.1.6", | ||
"rc-new-window": "^0.1.7", | ||
"rc-tabs": "^11.7.3" | ||
@@ -78,4 +78,4 @@ }, | ||
"build-www": "ts-node tool/build-www", | ||
"build-es": "tsc --module es2020 --outDir ./es" | ||
"build-es": "tsc --target es2020 --module es2020 --outDir ./es" | ||
} | ||
} |
@@ -119,9 +119,2 @@ import { | ||
): LayoutData { | ||
if (!savedLayout.floatbox) { | ||
savedLayout.floatbox = {mode: 'float', children: [], size: 0} as BoxBase; | ||
} | ||
if (!savedLayout.maxbox) { | ||
savedLayout.maxbox = {mode: 'maximize', children: [], size: 1} as BoxBase; | ||
} | ||
let cache = createLayoutCache(defaultLayout); | ||
@@ -184,6 +177,6 @@ | ||
dockbox: loadBoxData(savedLayout.dockbox), | ||
floatbox: loadBoxData(savedLayout.floatbox), | ||
windowbox: loadBoxData(savedLayout.windowbox), | ||
maxbox: loadBoxData(savedLayout.maxbox), | ||
floatbox: loadBoxData(savedLayout.floatbox ?? {mode: 'float', children: [], size: 0}), | ||
windowbox: loadBoxData(savedLayout.windowbox ?? {mode: 'window', children: [], size: 0}), | ||
maxbox: loadBoxData(savedLayout.maxbox ?? {mode: 'maximize', children: [], size: 1}), | ||
}; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
775853
13375
+ Addedrc-motion@2.9.5(transitive)
+ Addedrc-resize-observer@1.4.3(transitive)
- Removedrc-motion@2.9.4(transitive)
- Removedrc-resize-observer@1.4.1(transitive)
Updatedrc-new-window@^0.1.7