react-resize-demo 2.0.1 → 2.0.3

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +5 -0
  3. package/dist/components/ResizeHandle/index.js +1 -91
  4. package/dist/components/ResizeHandle/index.js.map +1 -1
  5. package/dist/components/ResizePanel/index.d.ts +16 -0
  6. package/dist/components/ResizePanel/index.js +1 -32
  7. package/dist/components/ResizePanel/index.js.map +1 -1
  8. package/dist/components/ResizePanelGroup/index.d.ts +19 -0
  9. package/dist/components/ResizePanelGroup/index.js +1 -60
  10. package/dist/components/ResizePanelGroup/index.js.map +1 -1
  11. package/dist/components/shared/context.js +1 -34
  12. package/dist/components/shared/context.js.map +1 -1
  13. package/dist/esm/components/ResizeHandle/index.js +1 -89
  14. package/dist/esm/components/ResizeHandle/index.js.map +1 -1
  15. package/dist/esm/components/ResizePanel/index.d.ts +16 -0
  16. package/dist/esm/components/ResizePanel/index.js +1 -30
  17. package/dist/esm/components/ResizePanel/index.js.map +1 -1
  18. package/dist/esm/components/ResizePanelGroup/index.d.ts +19 -0
  19. package/dist/esm/components/ResizePanelGroup/index.js +1 -58
  20. package/dist/esm/components/ResizePanelGroup/index.js.map +1 -1
  21. package/dist/esm/components/shared/context.js +1 -31
  22. package/dist/esm/components/shared/context.js.map +1 -1
  23. package/dist/esm/index.d.ts +3 -0
  24. package/dist/esm/index.js +1 -5
  25. package/dist/esm/index.js.map +1 -1
  26. package/dist/esm/types/index.d.ts +44 -0
  27. package/dist/esm/utils/resizeAble.js +1 -426
  28. package/dist/esm/utils/resizeAble.js.map +1 -1
  29. package/dist/esm/utils/virtualNode.js +1 -163
  30. package/dist/esm/utils/virtualNode.js.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.js +1 -14
  33. package/dist/index.js.map +1 -1
  34. package/dist/types/index.d.ts +0 -27
  35. package/dist/utils/resizeAble.js +1 -430
  36. package/dist/utils/resizeAble.js.map +1 -1
  37. package/dist/utils/virtualNode.js +1 -167
  38. package/dist/utils/virtualNode.js.map +1 -1
  39. package/package.json +134 -88
@@ -1,164 +1,2 @@
1
- /**
2
- * 虚拟节点管理模块
3
- * 负责创建、更新、销毁虚拟节点,用于虚拟化拖拽
4
- */
5
- class VirtualNodeManager {
6
- constructor() {
7
- Object.defineProperty(this, "virtualNodes", {
8
- enumerable: true,
9
- configurable: true,
10
- writable: true,
11
- value: new Map()
12
- }); // 存储虚拟节点映射:realEl -> virtualEl
13
- }
14
- /**
15
- * 创建虚拟节点
16
- * @param originalEl - 原始节点
17
- * @param config - 虚拟化配置
18
- * @returns 虚拟节点
19
- */
20
- createVirtualNode(originalEl, config = {}) {
21
- if (!originalEl || !originalEl.parentElement) {
22
- return null;
23
- }
24
- // 如果已存在虚拟节点,先移除
25
- if (this.virtualNodes.has(originalEl)) {
26
- this.removeVirtualNode(originalEl);
27
- }
28
- // 获取原始节点的位置和尺寸信息
29
- const rect = originalEl.getBoundingClientRect();
30
- const parentRect = originalEl.parentElement.getBoundingClientRect();
31
- const computedStyle = window.getComputedStyle(originalEl);
32
- // 创建虚拟节点(只复制结构,不复制内容以提高性能)
33
- const virtualEl = originalEl.cloneNode(false); // false 表示不复制子节点
34
- // 计算相对于父容器的位置
35
- const top = rect.top - parentRect.top + (originalEl.parentElement.scrollTop || 0);
36
- const left = rect.left - parentRect.left + (originalEl.parentElement.scrollLeft || 0);
37
- // 设置虚拟节点样式
38
- virtualEl.style.cssText = `
39
- position: absolute;
40
- top: ${top}px;
41
- left: ${left}px;
42
- width: ${rect.width}px;
43
- height: ${rect.height}px;
44
- margin: 0;
45
- padding: ${computedStyle.padding};
46
- border: ${computedStyle.border};
47
- box-sizing: ${computedStyle.boxSizing};
48
- pointer-events: none;
49
- z-index: 10000;
50
- opacity: 0.6;
51
- background-color: ${computedStyle.backgroundColor || 'rgba(0, 123, 255, 0.1)'};
52
- overflow: hidden;
53
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
54
- `;
55
- // 应用自定义样式
56
- if (config.style) {
57
- Object.assign(virtualEl.style, config.style);
58
- }
59
- // 应用自定义类名
60
- if (config.className) {
61
- virtualEl.className = config.className;
62
- }
63
- // 隐藏原始节点的内容(可选,通过设置透明度)
64
- const originalOpacity = originalEl.style.opacity;
65
- originalEl.style.opacity = '0.3';
66
- originalEl.dataset.originalOpacity = originalOpacity || '';
67
- // 将虚拟节点插入到父容器中
68
- originalEl.parentElement.appendChild(virtualEl);
69
- // 存储映射关系
70
- this.virtualNodes.set(originalEl, virtualEl);
71
- return virtualEl;
72
- }
73
- /**
74
- * 更新虚拟节点尺寸
75
- * @param originalEl - 原始节点
76
- * @param size - 新尺寸
77
- * @param direction - 方向 'horizontal' | 'vertical'
78
- */
79
- updateVirtualNode(originalEl, size, direction) {
80
- const virtualEl = this.virtualNodes.get(originalEl);
81
- if (!virtualEl)
82
- return;
83
- const sizeProperty = direction === 'horizontal' ? 'width' : 'height';
84
- virtualEl.style[sizeProperty] = `${size}px`;
85
- }
86
- /**
87
- * 更新虚拟节点位置(用于级联调整)
88
- * @param originalEl - 原始节点
89
- * @param newPosition - 新位置(绝对位置,不是偏移量)
90
- * @param direction - 方向 'horizontal' | 'vertical'
91
- */
92
- updateVirtualNodePosition(originalEl, newPosition, direction) {
93
- const virtualEl = this.virtualNodes.get(originalEl);
94
- if (!virtualEl)
95
- return;
96
- const positionProperty = direction === 'horizontal' ? 'left' : 'top';
97
- virtualEl.style[positionProperty] = `${newPosition}px`;
98
- }
99
- /**
100
- * 移除虚拟节点
101
- * @param originalEl - 原始节点
102
- */
103
- removeVirtualNode(originalEl) {
104
- const virtualEl = this.virtualNodes.get(originalEl);
105
- if (!virtualEl)
106
- return;
107
- // 恢复原始节点透明度
108
- if (originalEl.dataset.originalOpacity !== undefined) {
109
- originalEl.style.opacity = originalEl.dataset.originalOpacity;
110
- delete originalEl.dataset.originalOpacity;
111
- }
112
- // 移除虚拟节点
113
- if (virtualEl.parentElement) {
114
- virtualEl.parentElement.removeChild(virtualEl);
115
- }
116
- // 移除映射关系
117
- this.virtualNodes.delete(originalEl);
118
- }
119
- /**
120
- * 将最终尺寸应用到真实节点
121
- * @param originalEl - 原始节点
122
- * @param finalSize - 最终尺寸
123
- * @param direction - 方向 'horizontal' | 'vertical'
124
- */
125
- applyToRealNode(originalEl, finalSize, direction) {
126
- const sizeProperty = direction === 'horizontal' ? 'width' : 'height';
127
- originalEl.style[sizeProperty] = `${finalSize}px`;
128
- }
129
- /**
130
- * 移除所有虚拟节点
131
- */
132
- removeAllVirtualNodes() {
133
- const nodesToRemove = Array.from(this.virtualNodes.keys());
134
- nodesToRemove.forEach(originalEl => {
135
- this.removeVirtualNode(originalEl);
136
- });
137
- this.virtualNodes.clear();
138
- }
139
- /**
140
- * 检查是否存在虚拟节点
141
- * @param originalEl - 原始节点
142
- * @returns 是否存在
143
- */
144
- hasVirtualNode(originalEl) {
145
- return this.virtualNodes.has(originalEl);
146
- }
147
- /**
148
- * 获取虚拟节点
149
- * @param originalEl - 原始节点
150
- * @returns 虚拟节点或null
151
- */
152
- getVirtualNode(originalEl) {
153
- return this.virtualNodes.get(originalEl) || null;
154
- }
155
- /**
156
- * 销毁管理器,清理所有资源
157
- */
158
- destroy() {
159
- this.removeAllVirtualNodes();
160
- }
161
- }
162
-
163
- export { VirtualNodeManager as default };
1
+ class e{constructor(){Object.defineProperty(this,"virtualNodes",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}createVirtualNode(e,t={}){if(!e||!e.parentElement)return null;this.virtualNodes.has(e)&&this.removeVirtualNode(e);const o=e.getBoundingClientRect(),i=e.parentElement.getBoundingClientRect(),a=window.getComputedStyle(e),l=e.cloneNode(!1),n=o.top-i.top+(e.parentElement.scrollTop||0),r=o.left-i.left+(e.parentElement.scrollLeft||0);l.style.cssText=`\n position: absolute;\n top: ${n}px;\n left: ${r}px;\n width: ${o.width}px;\n height: ${o.height}px;\n margin: 0;\n padding: ${a.padding};\n border: ${a.border};\n box-sizing: ${a.boxSizing};\n pointer-events: none;\n z-index: 10000;\n opacity: 0.6;\n background-color: ${a.backgroundColor||"rgba(0, 123, 255, 0.1)"};\n overflow: hidden;\n box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);\n `,t.style&&Object.assign(l.style,t.style),t.className&&(l.className=t.className);const s=e.style.opacity;return e.style.opacity="0.3",e.dataset.originalOpacity=s||"",e.parentElement.appendChild(l),this.virtualNodes.set(e,l),l}updateVirtualNode(e,t,o){const i=this.virtualNodes.get(e);if(!i)return;const a="horizontal"===o?"width":"height";i.style[a]=`${t}px`}updateVirtualNodePosition(e,t,o){const i=this.virtualNodes.get(e);if(!i)return;const a="horizontal"===o?"left":"top";i.style[a]=`${t}px`}removeVirtualNode(e){const t=this.virtualNodes.get(e);t&&(void 0!==e.dataset.originalOpacity&&(e.style.opacity=e.dataset.originalOpacity,delete e.dataset.originalOpacity),t.parentElement&&t.parentElement.removeChild(t),this.virtualNodes.delete(e))}applyToRealNode(e,t,o){const i="horizontal"===o?"width":"height";e.style[i]=`${t}px`}removeAllVirtualNodes(){Array.from(this.virtualNodes.keys()).forEach(e=>{this.removeVirtualNode(e)}),this.virtualNodes.clear()}hasVirtualNode(e){return this.virtualNodes.has(e)}getVirtualNode(e){return this.virtualNodes.get(e)||null}destroy(){this.removeAllVirtualNodes()}}export{e as default};
164
2
  //# sourceMappingURL=virtualNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtualNode.js","sources":["../../../src/utils/virtualNode.ts"],"sourcesContent":["/**\r\n * 虚拟节点管理模块\r\n * 负责创建、更新、销毁虚拟节点,用于虚拟化拖拽\r\n */\r\n\r\nimport { VirtualNodeConfig, ResizeDirection } from '../types';\r\n\r\nclass VirtualNodeManager {\r\n private virtualNodes: Map<HTMLElement, HTMLElement> = new Map(); // 存储虚拟节点映射:realEl -> virtualEl\r\n\r\n /**\r\n * 创建虚拟节点\r\n * @param originalEl - 原始节点\r\n * @param config - 虚拟化配置\r\n * @returns 虚拟节点\r\n */\r\n createVirtualNode(originalEl: HTMLElement, config: VirtualNodeConfig = {}): HTMLElement | null {\r\n if (!originalEl || !originalEl.parentElement) {\r\n return null;\r\n }\r\n\r\n // 如果已存在虚拟节点,先移除\r\n if (this.virtualNodes.has(originalEl)) {\r\n this.removeVirtualNode(originalEl);\r\n }\r\n\r\n // 获取原始节点的位置和尺寸信息\r\n const rect = originalEl.getBoundingClientRect();\r\n const parentRect = originalEl.parentElement.getBoundingClientRect();\r\n const computedStyle = window.getComputedStyle(originalEl);\r\n\r\n // 创建虚拟节点(只复制结构,不复制内容以提高性能)\r\n const virtualEl = originalEl.cloneNode(false) as HTMLElement; // false 表示不复制子节点\r\n \r\n // 计算相对于父容器的位置\r\n const top = rect.top - parentRect.top + (originalEl.parentElement.scrollTop || 0);\r\n const left = rect.left - parentRect.left + (originalEl.parentElement.scrollLeft || 0);\r\n \r\n // 设置虚拟节点样式\r\n virtualEl.style.cssText = `\r\n position: absolute;\r\n top: ${top}px;\r\n left: ${left}px;\r\n width: ${rect.width}px;\r\n height: ${rect.height}px;\r\n margin: 0;\r\n padding: ${computedStyle.padding};\r\n border: ${computedStyle.border};\r\n box-sizing: ${computedStyle.boxSizing};\r\n pointer-events: none;\r\n z-index: 10000;\r\n opacity: 0.6;\r\n background-color: ${computedStyle.backgroundColor || 'rgba(0, 123, 255, 0.1)'};\r\n overflow: hidden;\r\n box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);\r\n `;\r\n\r\n // 应用自定义样式\r\n if (config.style) {\r\n Object.assign(virtualEl.style, config.style);\r\n }\r\n\r\n // 应用自定义类名\r\n if (config.className) {\r\n virtualEl.className = config.className;\r\n }\r\n\r\n // 隐藏原始节点的内容(可选,通过设置透明度)\r\n const originalOpacity = originalEl.style.opacity;\r\n originalEl.style.opacity = '0.3';\r\n originalEl.dataset.originalOpacity = originalOpacity || '';\r\n\r\n // 将虚拟节点插入到父容器中\r\n originalEl.parentElement.appendChild(virtualEl);\r\n\r\n // 存储映射关系\r\n this.virtualNodes.set(originalEl, virtualEl);\r\n\r\n return virtualEl;\r\n }\r\n\r\n /**\r\n * 更新虚拟节点尺寸\r\n * @param originalEl - 原始节点\r\n * @param size - 新尺寸\r\n * @param direction - 方向 'horizontal' | 'vertical'\r\n */\r\n updateVirtualNode(originalEl: HTMLElement, size: number, direction: ResizeDirection): void {\r\n const virtualEl = this.virtualNodes.get(originalEl);\r\n if (!virtualEl) return;\r\n\r\n const sizeProperty = direction === 'horizontal' ? 'width' : 'height';\r\n virtualEl.style[sizeProperty] = `${size}px`;\r\n }\r\n\r\n /**\r\n * 更新虚拟节点位置(用于级联调整)\r\n * @param originalEl - 原始节点\r\n * @param newPosition - 新位置(绝对位置,不是偏移量)\r\n * @param direction - 方向 'horizontal' | 'vertical'\r\n */\r\n updateVirtualNodePosition(originalEl: HTMLElement, newPosition: number, direction: ResizeDirection): void {\r\n const virtualEl = this.virtualNodes.get(originalEl);\r\n if (!virtualEl) return;\r\n\r\n const positionProperty = direction === 'horizontal' ? 'left' : 'top';\r\n virtualEl.style[positionProperty] = `${newPosition}px`;\r\n }\r\n\r\n /**\r\n * 移除虚拟节点\r\n * @param originalEl - 原始节点\r\n */\r\n removeVirtualNode(originalEl: HTMLElement): void {\r\n const virtualEl = this.virtualNodes.get(originalEl);\r\n if (!virtualEl) return;\r\n\r\n // 恢复原始节点透明度\r\n if (originalEl.dataset.originalOpacity !== undefined) {\r\n originalEl.style.opacity = originalEl.dataset.originalOpacity;\r\n delete originalEl.dataset.originalOpacity;\r\n }\r\n\r\n // 移除虚拟节点\r\n if (virtualEl.parentElement) {\r\n virtualEl.parentElement.removeChild(virtualEl);\r\n }\r\n\r\n // 移除映射关系\r\n this.virtualNodes.delete(originalEl);\r\n }\r\n\r\n /**\r\n * 将最终尺寸应用到真实节点\r\n * @param originalEl - 原始节点\r\n * @param finalSize - 最终尺寸\r\n * @param direction - 方向 'horizontal' | 'vertical'\r\n */\r\n applyToRealNode(originalEl: HTMLElement, finalSize: number, direction: ResizeDirection): void {\r\n const sizeProperty = direction === 'horizontal' ? 'width' : 'height';\r\n originalEl.style[sizeProperty] = `${finalSize}px`;\r\n }\r\n\r\n /**\r\n * 移除所有虚拟节点\r\n */\r\n removeAllVirtualNodes(): void {\r\n const nodesToRemove = Array.from(this.virtualNodes.keys());\r\n nodesToRemove.forEach(originalEl => {\r\n this.removeVirtualNode(originalEl);\r\n });\r\n this.virtualNodes.clear();\r\n }\r\n\r\n /**\r\n * 检查是否存在虚拟节点\r\n * @param originalEl - 原始节点\r\n * @returns 是否存在\r\n */\r\n hasVirtualNode(originalEl: HTMLElement): boolean {\r\n return this.virtualNodes.has(originalEl);\r\n }\r\n\r\n /**\r\n * 获取虚拟节点\r\n * @param originalEl - 原始节点\r\n * @returns 虚拟节点或null\r\n */\r\n getVirtualNode(originalEl: HTMLElement): HTMLElement | null {\r\n return this.virtualNodes.get(originalEl) || null;\r\n }\r\n\r\n /**\r\n * 销毁管理器,清理所有资源\r\n */\r\n destroy(): void {\r\n this.removeAllVirtualNodes();\r\n }\r\n}\r\n\r\nexport default VirtualNodeManager;\r\n\r\n"],"names":[],"mappings":"AAAA;;;AAGG;AAIH,MAAM,kBAAkB,CAAA;AAAxB,IAAA,WAAA,GAAA;AACY,QAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,cAAA,EAAA;;;;AAA8C,YAAA,KAAA,EAAA,IAAI,GAAG;AAAG,SAAA,CAAA,CAAA;IA0KpE;AAxKI;;;;;AAKG;AACH,IAAA,iBAAiB,CAAC,UAAuB,EAAE,MAAA,GAA4B,EAAE,EAAA;QACrE,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;AAC1C,YAAA,OAAO,IAAI;QACf;;QAGA,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;AACnC,YAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;QACtC;;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7D,YAAA,OAAO,UAAU,CAAC,OAAO,CAAC,eAAe;QAC7C;;AAGA,QAAA,IAAI,SAAS,CAAC,aAAa,EAAE;AACzB,YAAA,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC;QAClD;;AAGA,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;IACxC;AAEA;;;;;AAKG;AACH,IAAA,eAAe,CAAC,UAAuB,EAAE,SAAiB,EAAE,SAA0B,EAAA;AAClF,QAAA,MAAM,YAAY,GAAG,SAAS,KAAK,YAAY,GAAG,OAAO,GAAG,QAAQ;QACpE,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAA,EAAG,SAAS,CAAA,EAAA,CAAI;IACrD;AAEA;;AAEG;IACH,qBAAqB,GAAA;AACjB,QAAA,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;AAC1D,QAAA,aAAa,CAAC,OAAO,CAAC,UAAU,IAAG;AAC/B,YAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;AACtC,QAAA,CAAC,CAAC;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE;IAC7B;AAEA;;;;AAIG;AACH,IAAA,cAAc,CAAC,UAAuB,EAAA;QAClC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC;IAC5C;AAEA;;;;AAIG;AACH,IAAA,cAAc,CAAC,UAAuB,EAAA;QAClC,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI;IACpD;AAEA;;AAEG;IACH,OAAO,GAAA;QACH,IAAI,CAAC,qBAAqB,EAAE;IAChC;AACH;;;;"}
1
+ {"version":3,"file":"virtualNode.js","sources":["../../../src/utils/virtualNode.ts"],"sourcesContent":[null],"names":["VirtualNodeManager","constructor","Object","defineProperty","this","value","Map","createVirtualNode","originalEl","config","parentElement","virtualNodes","has","removeVirtualNode","rect","getBoundingClientRect","parentRect","computedStyle","window","getComputedStyle","virtualEl","cloneNode","top","scrollTop","left","scrollLeft","style","cssText","width","height","padding","border","boxSizing","backgroundColor","assign","className","originalOpacity","opacity","dataset","appendChild","set","updateVirtualNode","size","direction","get","sizeProperty","updateVirtualNodePosition","newPosition","positionProperty","undefined","removeChild","delete","applyToRealNode","finalSize","removeAllVirtualNodes","Array","from","keys","forEach","clear","hasVirtualNode","getVirtualNode","destroy"],"mappings":"AAOA,MAAMA,EAAN,WAAAC,GACYC,OAAAC,eAAAC,KAAA,eAAA,2CAA8CC,MAAA,IAAIC,KA0K9D,CAlKI,iBAAAC,CAAkBC,EAAyBC,EAA4B,IACnE,IAAKD,IAAeA,EAAWE,cAC3B,OAAO,KAIPN,KAAKO,aAAaC,IAAIJ,IACtBJ,KAAKS,kBAAkBL,GAI3B,MAAMM,EAAON,EAAWO,wBAClBC,EAAaR,EAAWE,cAAcK,wBACtCE,EAAgBC,OAAOC,iBAAiBX,GAGxCY,EAAYZ,EAAWa,WAAU,GAGjCC,EAAMR,EAAKQ,IAAMN,EAAWM,KAAOd,EAAWE,cAAca,WAAa,GACzEC,EAAOV,EAAKU,KAAOR,EAAWQ,MAAQhB,EAAWE,cAAce,YAAc,GAGnFL,EAAUM,MAAMC,QAAU,uDAEfL,2BACCE,4BACCV,EAAKc,iCACJd,EAAKe,2DAEJZ,EAAca,iCACfb,EAAcc,oCACVd,EAAce,wIAIRf,EAAcgB,iBAAmB,gIAMrDxB,EAAOiB,OACPxB,OAAOgC,OAAOd,EAAUM,MAAOjB,EAAOiB,OAItCjB,EAAO0B,YACPf,EAAUe,UAAY1B,EAAO0B,WAIjC,MAAMC,EAAkB5B,EAAWkB,MAAMW,QAUzC,OATA7B,EAAWkB,MAAMW,QAAU,MAC3B7B,EAAW8B,QAAQF,gBAAkBA,GAAmB,GAGxD5B,EAAWE,cAAc6B,YAAYnB,GAGrChB,KAAKO,aAAa6B,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{ ResizePanel as ResizablePanel, ResizePanel as ResizeablePanel } from './components/ResizePanel/index.js';
3
+ export { PanelInfo, ResizeAbleCoreOptions, ResizeDirection, VirtualConfig, VirtualNodeConfig } from './types/index.js';
package/dist/index.js CHANGED
@@ -1,15 +1,2 @@
1
- 'use strict';
2
-
3
- var index = require('./components/ResizePanelGroup/index.js');
4
- var index$1 = require('./components/ResizePanel/index.js');
5
- require('react/jsx-runtime');
6
- require('react');
7
- require('./components/shared/context.js');
8
-
9
-
10
-
11
- exports.ResizablePanelGroup = index.ResizePanelGroup;
12
- exports.ResizeablePanelGroup = index.ResizePanelGroup;
13
- exports.ResizablePanel = index$1.ResizePanel;
14
- exports.ResizeablePanel = index$1.ResizePanel;
1
+ "use strict";const e=require("./components/ResizePanelGroup/index.js"),s=require("./components/ResizePanel/index.js");exports.ResizablePanelGroup=e.ResizePanelGroup,exports.ResizeablePanelGroup=e.ResizePanelGroup,exports.ResizablePanel=s.ResizePanel,exports.ResizeablePanel=s.ResizePanel;
15
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -41,31 +41,4 @@ interface ResizeAbleCoreOptions {
41
41
  handleSize?: number;
42
42
  }
43
43
 
44
- /**
45
- * 可调整大小的面板组容器组件
46
- * 负责管理多个面板的布局和拖拽手柄的插入
47
- */
48
-
49
- interface ResizePanelGroupProps {
50
- children: React.ReactNode;
51
- direction?: ResizeDirection;
52
- virtual?: boolean;
53
- virtualConfig?: VirtualConfig;
54
- style?: React.CSSProperties;
55
- }
56
- declare const ResizePanelGroup: React.FC<ResizePanelGroupProps>;
57
-
58
- /**
59
- * 可调整大小的面板组件
60
- * 负责展示面板内容和管理面板的注册/注销
61
- */
62
-
63
- interface ResizePanelProps {
64
- children: React.ReactNode;
65
- minSize?: number;
66
- onResize?: (width: number) => void;
67
- }
68
- declare const ResizePanel: React.FC<ResizePanelProps>;
69
-
70
- export { ResizePanel as ResizablePanel, ResizePanelGroup as ResizablePanelGroup, ResizePanel as ResizeablePanel, ResizePanelGroup as ResizeablePanelGroup };
71
44
  export type { PanelInfo, ResizeAbleCoreOptions, ResizeDirection, VirtualConfig, VirtualNodeConfig };