@94ai/nf-resizable-panels 5.0.11 → 5.0.28
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/lib/index.d.ts
CHANGED
|
@@ -28,6 +28,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
28
28
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
29
29
|
default: string;
|
|
30
30
|
};
|
|
31
|
+
unique: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
divideType: {
|
|
36
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
31
39
|
}>>, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
32
40
|
resizablePanelsContainerTag: {
|
|
33
41
|
type: StringConstructor;
|
|
@@ -57,6 +65,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
57
65
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
58
66
|
default: string;
|
|
59
67
|
};
|
|
68
|
+
unique: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
default: string;
|
|
71
|
+
};
|
|
72
|
+
divideType: {
|
|
73
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
60
76
|
}>>, {}, {
|
|
61
77
|
resizablePanelsContainerTag: string;
|
|
62
78
|
seperatorSize: number;
|
|
@@ -65,6 +81,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
65
81
|
resizeMinWidth: number;
|
|
66
82
|
symbolMode: "symbol" | "border";
|
|
67
83
|
seperatorPosition: "start" | "end" | "center";
|
|
84
|
+
unique: string;
|
|
85
|
+
divideType: "flex" | "calc";
|
|
68
86
|
}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
69
87
|
resizablePanelsContainerTag: {
|
|
70
88
|
type: StringConstructor;
|
|
@@ -94,6 +112,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
94
112
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
95
113
|
default: string;
|
|
96
114
|
};
|
|
115
|
+
unique: {
|
|
116
|
+
type: StringConstructor;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
divideType: {
|
|
120
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
97
123
|
}>>> & import("vue-demi").ShallowUnwrapRef<{
|
|
98
124
|
handleDragSeperator: (parentEl: HTMLElement, e: MouseEvent, idx: number) => void;
|
|
99
125
|
dataId: string;
|
|
@@ -137,6 +163,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
137
163
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
138
164
|
default: string;
|
|
139
165
|
};
|
|
166
|
+
unique: {
|
|
167
|
+
type: StringConstructor;
|
|
168
|
+
default: string;
|
|
169
|
+
};
|
|
170
|
+
divideType: {
|
|
171
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
172
|
+
default: string;
|
|
173
|
+
};
|
|
140
174
|
}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{
|
|
141
175
|
resizablePanelsContainerTag: {
|
|
142
176
|
type: StringConstructor;
|
|
@@ -166,6 +200,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
166
200
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
167
201
|
default: string;
|
|
168
202
|
};
|
|
203
|
+
unique: {
|
|
204
|
+
type: StringConstructor;
|
|
205
|
+
default: string;
|
|
206
|
+
};
|
|
207
|
+
divideType: {
|
|
208
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
209
|
+
default: string;
|
|
210
|
+
};
|
|
169
211
|
}>>, {
|
|
170
212
|
handleDragSeperator: (parentEl: HTMLElement, e: MouseEvent, idx: number) => void;
|
|
171
213
|
dataId: string;
|
|
@@ -188,6 +230,8 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
188
230
|
resizeMinWidth: number;
|
|
189
231
|
symbolMode: "symbol" | "border";
|
|
190
232
|
seperatorPosition: "start" | "end" | "center";
|
|
233
|
+
unique: string;
|
|
234
|
+
divideType: "flex" | "calc";
|
|
191
235
|
}> & {
|
|
192
236
|
props: {
|
|
193
237
|
resizablePanelsContainerTag: {
|
|
@@ -218,6 +262,14 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
|
|
|
218
262
|
type: import("vue-demi").PropType<"start" | "end" | "center">;
|
|
219
263
|
default: string;
|
|
220
264
|
};
|
|
265
|
+
unique: {
|
|
266
|
+
type: StringConstructor;
|
|
267
|
+
default: string;
|
|
268
|
+
};
|
|
269
|
+
divideType: {
|
|
270
|
+
type: import("vue-demi").PropType<"flex" | "calc">;
|
|
271
|
+
default: string;
|
|
272
|
+
};
|
|
221
273
|
};
|
|
222
274
|
} & PluginObject<undefined>;
|
|
223
275
|
export default _default;
|
|
@@ -55,6 +55,14 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
55
55
|
seperatorPosition: {
|
|
56
56
|
type: String,
|
|
57
57
|
default: "start"
|
|
58
|
+
},
|
|
59
|
+
unique: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: CHILD_DATA_ATTR_NAME
|
|
62
|
+
},
|
|
63
|
+
divideType: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "calc"
|
|
58
66
|
}
|
|
59
67
|
},
|
|
60
68
|
setup(_, {
|
|
@@ -67,7 +75,8 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
67
75
|
vertical
|
|
68
76
|
} = commonUtils.getFlexDirection(parentEl);
|
|
69
77
|
const wOrH = vertical ? "height" : "width";
|
|
70
|
-
const
|
|
78
|
+
const wOrHSet = _.divideType === "flex" ? "flex-basis" : vertical ? "height" : "width";
|
|
79
|
+
const children = parentEl.querySelectorAll(`[data-${_.unique}]`);
|
|
71
80
|
const element = children[idx];
|
|
72
81
|
const prevElement = children[idx - 1];
|
|
73
82
|
element.dataset.dragLastSize = commonUtils._getComputedStyle(element, wOrH);
|
|
@@ -86,8 +95,8 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
86
95
|
if (_.resizeMinWidth && (deltaElementSize < _.resizeMinWidth || totalStarSize - deltaElementSize < _.resizeMinWidth)) {
|
|
87
96
|
return;
|
|
88
97
|
}
|
|
89
|
-
deltaElement.style[
|
|
90
|
-
otherElement.style[
|
|
98
|
+
deltaElement.style[wOrHSet] = `${deltaElementSize}px`;
|
|
99
|
+
otherElement.style[wOrHSet] = `${totalStarSize - deltaElementSize}px`;
|
|
91
100
|
deltaElement.dataset.dragLastSize = commonUtils._getComputedStyle(deltaElement, wOrH);
|
|
92
101
|
otherElement.dataset.dragLastSize = commonUtils._getComputedStyle(otherElement, wOrH);
|
|
93
102
|
};
|
|
@@ -144,7 +153,7 @@ const _sfc_main = vueDemi.defineComponent({
|
|
|
144
153
|
const isComment = vNode == null ? void 0 : vNode.isComment;
|
|
145
154
|
if (vNode.data) {
|
|
146
155
|
vNode.data.attrs = vNode.data.attrs ?? {};
|
|
147
|
-
vNode.data.attrs[`data-${
|
|
156
|
+
vNode.data.attrs[`data-${this.unique}`] = dataId;
|
|
148
157
|
}
|
|
149
158
|
if (idx === 0) {
|
|
150
159
|
return vNode;
|
|
@@ -53,6 +53,14 @@ const _sfc_main = defineComponent({
|
|
|
53
53
|
seperatorPosition: {
|
|
54
54
|
type: String,
|
|
55
55
|
default: "start"
|
|
56
|
+
},
|
|
57
|
+
unique: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: CHILD_DATA_ATTR_NAME
|
|
60
|
+
},
|
|
61
|
+
divideType: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "calc"
|
|
56
64
|
}
|
|
57
65
|
},
|
|
58
66
|
setup(_, {
|
|
@@ -65,7 +73,8 @@ const _sfc_main = defineComponent({
|
|
|
65
73
|
vertical
|
|
66
74
|
} = getFlexDirection(parentEl);
|
|
67
75
|
const wOrH = vertical ? "height" : "width";
|
|
68
|
-
const
|
|
76
|
+
const wOrHSet = _.divideType === "flex" ? "flex-basis" : vertical ? "height" : "width";
|
|
77
|
+
const children = parentEl.querySelectorAll(`[data-${_.unique}]`);
|
|
69
78
|
const element = children[idx];
|
|
70
79
|
const prevElement = children[idx - 1];
|
|
71
80
|
element.dataset.dragLastSize = _getComputedStyle(element, wOrH);
|
|
@@ -84,8 +93,8 @@ const _sfc_main = defineComponent({
|
|
|
84
93
|
if (_.resizeMinWidth && (deltaElementSize < _.resizeMinWidth || totalStarSize - deltaElementSize < _.resizeMinWidth)) {
|
|
85
94
|
return;
|
|
86
95
|
}
|
|
87
|
-
deltaElement.style[
|
|
88
|
-
otherElement.style[
|
|
96
|
+
deltaElement.style[wOrHSet] = `${deltaElementSize}px`;
|
|
97
|
+
otherElement.style[wOrHSet] = `${totalStarSize - deltaElementSize}px`;
|
|
89
98
|
deltaElement.dataset.dragLastSize = _getComputedStyle(deltaElement, wOrH);
|
|
90
99
|
otherElement.dataset.dragLastSize = _getComputedStyle(otherElement, wOrH);
|
|
91
100
|
};
|
|
@@ -142,7 +151,7 @@ const _sfc_main = defineComponent({
|
|
|
142
151
|
const isComment = vNode == null ? void 0 : vNode.isComment;
|
|
143
152
|
if (vNode.data) {
|
|
144
153
|
vNode.data.attrs = vNode.data.attrs ?? {};
|
|
145
|
-
vNode.data.attrs[`data-${
|
|
154
|
+
vNode.data.attrs[`data-${this.unique}`] = dataId;
|
|
146
155
|
}
|
|
147
156
|
if (idx === 0) {
|
|
148
157
|
return vNode;
|
|
@@ -28,6 +28,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
28
28
|
type: PropType<"start" | "end" | "center">;
|
|
29
29
|
default: string;
|
|
30
30
|
};
|
|
31
|
+
unique: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
divideType: {
|
|
36
|
+
type: PropType<"flex" | "calc">;
|
|
37
|
+
default: string;
|
|
38
|
+
};
|
|
31
39
|
}, {
|
|
32
40
|
handleDragSeperator: (parentEl: HTMLElement, e: MouseEvent, idx: number) => void;
|
|
33
41
|
dataId: string;
|
|
@@ -71,6 +79,14 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
71
79
|
type: PropType<"start" | "end" | "center">;
|
|
72
80
|
default: string;
|
|
73
81
|
};
|
|
82
|
+
unique: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
default: string;
|
|
85
|
+
};
|
|
86
|
+
divideType: {
|
|
87
|
+
type: PropType<"flex" | "calc">;
|
|
88
|
+
default: string;
|
|
89
|
+
};
|
|
74
90
|
}>>, {
|
|
75
91
|
resizablePanelsContainerTag: string;
|
|
76
92
|
seperatorSize: number;
|
|
@@ -79,5 +95,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
79
95
|
resizeMinWidth: number;
|
|
80
96
|
symbolMode: "symbol" | "border";
|
|
81
97
|
seperatorPosition: "start" | "end" | "center";
|
|
98
|
+
unique: string;
|
|
99
|
+
divideType: "flex" | "calc";
|
|
82
100
|
}>;
|
|
83
101
|
export default _default;
|
|
@@ -65,6 +65,14 @@ export default defineComponent({
|
|
|
65
65
|
type: String as PropType<'start' | 'end' | 'center'>,
|
|
66
66
|
default: 'start'
|
|
67
67
|
},
|
|
68
|
+
unique: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: CHILD_DATA_ATTR_NAME,
|
|
71
|
+
},
|
|
72
|
+
divideType: {
|
|
73
|
+
type: String as PropType<'flex' | 'calc'>,
|
|
74
|
+
default: 'calc'
|
|
75
|
+
}
|
|
68
76
|
},
|
|
69
77
|
setup(_, { emit }) {
|
|
70
78
|
const dataId = `${generateID()}`;
|
|
@@ -72,8 +80,9 @@ export default defineComponent({
|
|
|
72
80
|
function handleDragSeperator(parentEl: HTMLElement, e: MouseEvent, idx: number) {
|
|
73
81
|
const { vertical } = getFlexDirection(parentEl);
|
|
74
82
|
const wOrH = vertical ? 'height' : 'width';
|
|
83
|
+
const wOrHSet = _.divideType === 'flex' ? 'flex-basis' : vertical ? 'height' : 'width';
|
|
75
84
|
|
|
76
|
-
const children = parentEl.querySelectorAll(`[data-${
|
|
85
|
+
const children = parentEl.querySelectorAll(`[data-${_.unique}]`) as ArrayLike<HTMLElement>;
|
|
77
86
|
const element = children[idx]!;
|
|
78
87
|
const prevElement = children[idx - 1]!;
|
|
79
88
|
|
|
@@ -94,8 +103,8 @@ export default defineComponent({
|
|
|
94
103
|
if (_.resizeMinWidth && (deltaElementSize < _.resizeMinWidth || totalStarSize - deltaElementSize < _.resizeMinWidth)) {
|
|
95
104
|
return
|
|
96
105
|
}
|
|
97
|
-
deltaElement.style[
|
|
98
|
-
otherElement.style[
|
|
106
|
+
deltaElement.style[wOrHSet] = `${deltaElementSize}px`;
|
|
107
|
+
otherElement.style[wOrHSet] = `${totalStarSize - deltaElementSize}px`;
|
|
99
108
|
|
|
100
109
|
deltaElement.dataset.dragLastSize = _getComputedStyle(deltaElement, wOrH)!;
|
|
101
110
|
otherElement.dataset.dragLastSize = _getComputedStyle(otherElement, wOrH)!;
|
|
@@ -136,7 +145,7 @@ export default defineComponent({
|
|
|
136
145
|
const isComment = vNode?.isComment;
|
|
137
146
|
if (vNode.data) {
|
|
138
147
|
vNode.data.attrs = vNode.data.attrs ?? {};
|
|
139
|
-
vNode.data.attrs[`data-${
|
|
148
|
+
vNode.data.attrs[`data-${this.unique}`] = dataId;
|
|
140
149
|
}
|
|
141
150
|
if (idx === 0) {
|
|
142
151
|
return vNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-resizable-panels",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.28",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-utils": "^5.0.
|
|
18
|
-
"@94ai/nf-theme-chalk": "^5.0.
|
|
17
|
+
"@94ai/common-utils": "^5.0.28",
|
|
18
|
+
"@94ai/nf-theme-chalk": "^5.0.28",
|
|
19
19
|
"lodash-es": "^4.17.21",
|
|
20
20
|
"vue-demi": "^0.14.5"
|
|
21
21
|
},
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"types": "lib/index.d.ts",
|
|
33
33
|
"main": "lib/nf-resizable-panels.cjs.js",
|
|
34
34
|
"module": "lib/nf-resizable-panels.esm-bundler.js",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6c56c073970ffb6ae376159887eaf8970e3a36da"
|
|
36
36
|
}
|