@destyler/popper 0.0.3 → 0.0.4
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/README.md +7 -0
- package/dist/component.cjs +455 -11
- package/dist/component.d.cts +628 -5
- package/dist/component.d.mts +628 -5
- package/dist/component.d.ts +628 -5
- package/dist/component.mjs +451 -7
- package/dist/index.cjs +15 -414
- package/dist/index.d.cts +5 -405
- package/dist/index.d.mts +5 -405
- package/dist/index.d.ts +5 -405
- package/dist/index.mjs +8 -414
- package/dist/resolver.cjs +6 -6
- package/dist/resolver.d.cts +2 -2
- package/dist/resolver.d.mts +2 -2
- package/dist/resolver.d.ts +2 -2
- package/dist/resolver.mjs +6 -6
- package/package.json +15 -17
package/dist/index.mjs
CHANGED
|
@@ -1,414 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const DestylerPopperRoot = defineComponent({
|
|
10
|
-
name: "DestylerPopperRoot",
|
|
11
|
-
setup() {
|
|
12
|
-
const anchor = ref();
|
|
13
|
-
providePopperRootContext({
|
|
14
|
-
anchor,
|
|
15
|
-
onAnchorChange: (element) => anchor.value = element
|
|
16
|
-
});
|
|
17
|
-
},
|
|
18
|
-
render() {
|
|
19
|
-
return this.$slots.default?.();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const destylerPopperAnchorProps = {
|
|
24
|
-
as: {
|
|
25
|
-
type: [String, Object],
|
|
26
|
-
required: false,
|
|
27
|
-
default: "div"
|
|
28
|
-
},
|
|
29
|
-
asChild: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
required: false,
|
|
32
|
-
default: false
|
|
33
|
-
},
|
|
34
|
-
element: {
|
|
35
|
-
type: Object
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const DestylerPopperAnchor = defineComponent({
|
|
39
|
-
name: "DestylerPopperAnchor",
|
|
40
|
-
props: destylerPopperAnchorProps,
|
|
41
|
-
setup(props) {
|
|
42
|
-
const { forwardRef, currentElement } = useForwardExpose();
|
|
43
|
-
const rootContext = injectPopperRootContext();
|
|
44
|
-
watch(currentElement, () => {
|
|
45
|
-
rootContext.onAnchorChange(props.element ?? currentElement.value);
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
forwardRef
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
render() {
|
|
52
|
-
return h(DestylerPrimitive, {
|
|
53
|
-
as: this.$props.as,
|
|
54
|
-
asChild: this.$props.asChild,
|
|
55
|
-
ref: (el) => this.forwardRef(el)
|
|
56
|
-
}, {
|
|
57
|
-
default: () => this.$slots.default?.()
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
function isNotNull(value) {
|
|
63
|
-
return value !== null;
|
|
64
|
-
}
|
|
65
|
-
function transformOrigin(options) {
|
|
66
|
-
return {
|
|
67
|
-
name: "transformOrigin",
|
|
68
|
-
options,
|
|
69
|
-
fn(data) {
|
|
70
|
-
const { placement, rects, middlewareData } = data;
|
|
71
|
-
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
72
|
-
const isArrowHidden = cannotCenterArrow;
|
|
73
|
-
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
74
|
-
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
75
|
-
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
76
|
-
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
77
|
-
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
78
|
-
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
79
|
-
let x = "";
|
|
80
|
-
let y = "";
|
|
81
|
-
if (placedSide === "bottom") {
|
|
82
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
83
|
-
y = `${-arrowHeight}px`;
|
|
84
|
-
} else if (placedSide === "top") {
|
|
85
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
86
|
-
y = `${rects.floating.height + arrowHeight}px`;
|
|
87
|
-
} else if (placedSide === "right") {
|
|
88
|
-
x = `${-arrowHeight}px`;
|
|
89
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
90
|
-
} else if (placedSide === "left") {
|
|
91
|
-
x = `${rects.floating.width + arrowHeight}px`;
|
|
92
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
93
|
-
}
|
|
94
|
-
return { data: { x, y } };
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function getSideAndAlignFromPlacement(placement) {
|
|
99
|
-
const [side, align = "center"] = placement.split("-");
|
|
100
|
-
return [side, align];
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const [injectPopperContentContext, providePopperContentContext] = createContext("DestylerPopperContent");
|
|
104
|
-
const destylerPopperContentProps = {
|
|
105
|
-
as: {
|
|
106
|
-
type: [String, Object],
|
|
107
|
-
required: false,
|
|
108
|
-
default: "div"
|
|
109
|
-
},
|
|
110
|
-
asChild: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
required: false,
|
|
113
|
-
default: false
|
|
114
|
-
},
|
|
115
|
-
side: {
|
|
116
|
-
type: String,
|
|
117
|
-
required: false,
|
|
118
|
-
default: "bottom"
|
|
119
|
-
},
|
|
120
|
-
sideOffset: {
|
|
121
|
-
type: Number,
|
|
122
|
-
required: false,
|
|
123
|
-
default: 0
|
|
124
|
-
},
|
|
125
|
-
align: {
|
|
126
|
-
type: String,
|
|
127
|
-
required: false,
|
|
128
|
-
default: "center"
|
|
129
|
-
},
|
|
130
|
-
alignOffset: {
|
|
131
|
-
type: Number,
|
|
132
|
-
required: false,
|
|
133
|
-
default: 0
|
|
134
|
-
},
|
|
135
|
-
avoidCollisions: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
required: false,
|
|
138
|
-
default: true
|
|
139
|
-
},
|
|
140
|
-
collisionBoundary: {
|
|
141
|
-
type: [Object, Array, null],
|
|
142
|
-
required: false,
|
|
143
|
-
default: () => []
|
|
144
|
-
},
|
|
145
|
-
collisionPadding: {
|
|
146
|
-
type: [Number, Object],
|
|
147
|
-
required: false,
|
|
148
|
-
default: 0
|
|
149
|
-
},
|
|
150
|
-
arrowPadding: {
|
|
151
|
-
type: Number,
|
|
152
|
-
required: false,
|
|
153
|
-
default: 0
|
|
154
|
-
},
|
|
155
|
-
sticky: {
|
|
156
|
-
type: String,
|
|
157
|
-
required: false,
|
|
158
|
-
default: "partial"
|
|
159
|
-
},
|
|
160
|
-
hideWhenDetached: {
|
|
161
|
-
type: Boolean,
|
|
162
|
-
required: false,
|
|
163
|
-
default: false
|
|
164
|
-
},
|
|
165
|
-
updatePositionStrategy: {
|
|
166
|
-
type: String,
|
|
167
|
-
required: false,
|
|
168
|
-
default: "optimized"
|
|
169
|
-
},
|
|
170
|
-
onPlaced: {
|
|
171
|
-
type: Function,
|
|
172
|
-
required: false
|
|
173
|
-
},
|
|
174
|
-
prioritizePosition: {
|
|
175
|
-
type: Boolean,
|
|
176
|
-
required: false,
|
|
177
|
-
default: false
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
const DestylerPopperContent = defineComponent({
|
|
181
|
-
name: "DestylerPopperContent",
|
|
182
|
-
inheritAttrs: false,
|
|
183
|
-
props: destylerPopperContentProps,
|
|
184
|
-
setup(props, { attrs }) {
|
|
185
|
-
const rootContext = injectPopperRootContext();
|
|
186
|
-
const { forwardRef, currentElement: contentElement } = useForwardExpose();
|
|
187
|
-
const floatingRef = ref();
|
|
188
|
-
const arrow$1 = ref();
|
|
189
|
-
const { width: arrowWidth, height: arrowHeight } = useSize(arrow$1);
|
|
190
|
-
const desiredPlacement = computed(() => props.side + (props.align !== "center" ? `-${props.align}` : ""));
|
|
191
|
-
const collisionPadding = computed(() => {
|
|
192
|
-
return typeof props.collisionPadding === "number" ? props.collisionPadding : { top: 0, right: 0, bottom: 0, left: 0, ...props.collisionPadding };
|
|
193
|
-
});
|
|
194
|
-
const boundary = computed(() => {
|
|
195
|
-
return Array.isArray(props.collisionBoundary) ? props.collisionBoundary : [props.collisionBoundary];
|
|
196
|
-
});
|
|
197
|
-
const detectOverflowOptions = computed(() => {
|
|
198
|
-
return {
|
|
199
|
-
padding: collisionPadding.value,
|
|
200
|
-
boundary: boundary.value.filter(isNotNull),
|
|
201
|
-
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
202
|
-
altBoundary: boundary.value.length > 0
|
|
203
|
-
};
|
|
204
|
-
});
|
|
205
|
-
const computedMiddleware = computedEager(() => {
|
|
206
|
-
return [
|
|
207
|
-
offset({
|
|
208
|
-
mainAxis: props.sideOffset + arrowHeight.value,
|
|
209
|
-
alignmentAxis: props.alignOffset
|
|
210
|
-
}),
|
|
211
|
-
props.avoidCollisions && shift({
|
|
212
|
-
mainAxis: true,
|
|
213
|
-
crossAxis: !!props.prioritizePosition,
|
|
214
|
-
limiter: props.sticky === "partial" ? limitShift() : void 0,
|
|
215
|
-
...detectOverflowOptions.value
|
|
216
|
-
}),
|
|
217
|
-
!props.prioritizePosition && props.avoidCollisions && flip({
|
|
218
|
-
...detectOverflowOptions.value
|
|
219
|
-
}),
|
|
220
|
-
size({
|
|
221
|
-
...detectOverflowOptions.value,
|
|
222
|
-
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
223
|
-
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
224
|
-
const contentStyle = elements.floating.style;
|
|
225
|
-
Object.assign(elements.floating.style, {
|
|
226
|
-
maxWidth: `${availableWidth}px`,
|
|
227
|
-
maxHeight: `${availableHeight}px`
|
|
228
|
-
});
|
|
229
|
-
contentStyle.setProperty(
|
|
230
|
-
"--destyler_popper_available_width",
|
|
231
|
-
`${availableWidth}px`
|
|
232
|
-
);
|
|
233
|
-
contentStyle.setProperty(
|
|
234
|
-
"--destyler_popper_available_height",
|
|
235
|
-
`${availableHeight}px`
|
|
236
|
-
);
|
|
237
|
-
contentStyle.setProperty(
|
|
238
|
-
"--destyler_popper_anchor_width",
|
|
239
|
-
`${anchorWidth}px`
|
|
240
|
-
);
|
|
241
|
-
contentStyle.setProperty(
|
|
242
|
-
"--destyler_popper_anchor_height",
|
|
243
|
-
`${anchorHeight}px`
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
}),
|
|
247
|
-
arrow$1.value && arrow({ element: arrow$1.value, padding: props.arrowPadding }),
|
|
248
|
-
transformOrigin({
|
|
249
|
-
arrowWidth: arrowWidth.value,
|
|
250
|
-
arrowHeight: arrowHeight.value
|
|
251
|
-
}),
|
|
252
|
-
props.hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions.value })
|
|
253
|
-
];
|
|
254
|
-
});
|
|
255
|
-
const { floatingStyles, placement, isPositioned, middlewareData } = useFloating(
|
|
256
|
-
rootContext.anchor,
|
|
257
|
-
floatingRef,
|
|
258
|
-
{
|
|
259
|
-
strategy: "fixed",
|
|
260
|
-
placement: desiredPlacement,
|
|
261
|
-
whileElementsMounted: (...args) => {
|
|
262
|
-
const cleanup = autoUpdate(...args, {
|
|
263
|
-
animationFrame: props.updatePositionStrategy === "always"
|
|
264
|
-
});
|
|
265
|
-
return cleanup;
|
|
266
|
-
},
|
|
267
|
-
middleware: computedMiddleware
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
const placedSide = computed(() => getSideAndAlignFromPlacement(placement.value)[0]);
|
|
271
|
-
const placedAlign = computed(() => getSideAndAlignFromPlacement(placement.value)[1]);
|
|
272
|
-
watchEffect(() => {
|
|
273
|
-
if (isPositioned.value)
|
|
274
|
-
props.onPlaced?.();
|
|
275
|
-
});
|
|
276
|
-
const cannotCenterArrow = computed(
|
|
277
|
-
() => middlewareData.value.arrow?.centerOffset !== 0
|
|
278
|
-
);
|
|
279
|
-
const contentZIndex = ref("");
|
|
280
|
-
watchEffect(() => {
|
|
281
|
-
if (contentElement.value)
|
|
282
|
-
contentZIndex.value = window.getComputedStyle(contentElement.value).zIndex;
|
|
283
|
-
});
|
|
284
|
-
const arrowX = computed(() => middlewareData.value.arrow?.x ?? 0);
|
|
285
|
-
const arrowY = computed(() => middlewareData.value.arrow?.y ?? 0);
|
|
286
|
-
providePopperContentContext({
|
|
287
|
-
placedSide,
|
|
288
|
-
onArrowChange: (element) => arrow$1.value = element,
|
|
289
|
-
arrowX,
|
|
290
|
-
arrowY,
|
|
291
|
-
shouldHideArrow: cannotCenterArrow
|
|
292
|
-
});
|
|
293
|
-
return {
|
|
294
|
-
floatingRef,
|
|
295
|
-
floatingStyles,
|
|
296
|
-
isPositioned,
|
|
297
|
-
contentZIndex,
|
|
298
|
-
middlewareData,
|
|
299
|
-
forwardRef,
|
|
300
|
-
placedSide,
|
|
301
|
-
placedAlign,
|
|
302
|
-
attrStyle: attrs.style
|
|
303
|
-
};
|
|
304
|
-
},
|
|
305
|
-
render() {
|
|
306
|
-
return h("div", {
|
|
307
|
-
"data-destyler-popper-content-wrapper": "",
|
|
308
|
-
"ref": "floatingRef",
|
|
309
|
-
"style": {
|
|
310
|
-
...this.floatingStyles,
|
|
311
|
-
transform: this.isPositioned ? this.floatingStyles.transform : "translate(0, -200%)",
|
|
312
|
-
minWidth: "max-content",
|
|
313
|
-
zIndex: this.contentZIndex,
|
|
314
|
-
["--destyler_popper_transform_origin"]: [
|
|
315
|
-
this.middlewareData.transformOrigin?.x,
|
|
316
|
-
this.middlewareData.transformOrigin?.y
|
|
317
|
-
].join(" ")
|
|
318
|
-
}
|
|
319
|
-
}, h(DestylerPrimitive, mergeProps(this.$attrs, {
|
|
320
|
-
"ref": (el) => this.forwardRef(el),
|
|
321
|
-
"as": this.$props.as,
|
|
322
|
-
"asChild": this.$props.asChild,
|
|
323
|
-
"data-side": this.placedSide,
|
|
324
|
-
"data-align": this.placedAlign,
|
|
325
|
-
"style": {
|
|
326
|
-
animation: !this.isPositioned ? "none" : void 0,
|
|
327
|
-
opacity: this.middlewareData.hide?.referenceHidden ? 0 : void 0
|
|
328
|
-
}
|
|
329
|
-
}), {
|
|
330
|
-
default: () => this.$slots.default?.()
|
|
331
|
-
}));
|
|
332
|
-
}
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
const OPPOSITE_SIDE = {
|
|
336
|
-
top: "bottom",
|
|
337
|
-
right: "left",
|
|
338
|
-
bottom: "top",
|
|
339
|
-
left: "right"
|
|
340
|
-
};
|
|
341
|
-
const destylerPopperArrowProps = {
|
|
342
|
-
asChild: {
|
|
343
|
-
type: Boolean,
|
|
344
|
-
required: false,
|
|
345
|
-
default: false
|
|
346
|
-
},
|
|
347
|
-
width: {
|
|
348
|
-
type: Number,
|
|
349
|
-
required: false,
|
|
350
|
-
default: 5
|
|
351
|
-
},
|
|
352
|
-
height: {
|
|
353
|
-
type: Number,
|
|
354
|
-
required: false,
|
|
355
|
-
default: 10
|
|
356
|
-
},
|
|
357
|
-
as: {
|
|
358
|
-
type: [String, Object],
|
|
359
|
-
required: false,
|
|
360
|
-
default: "svg"
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
const DestylerPopperArrow = defineComponent({
|
|
364
|
-
name: "DestylerPopperArrow",
|
|
365
|
-
inheritAttrs: false,
|
|
366
|
-
props: destylerPopperArrowProps,
|
|
367
|
-
setup() {
|
|
368
|
-
const contentContext = injectPopperContentContext();
|
|
369
|
-
const baseSide = computed(() => OPPOSITE_SIDE[contentContext.placedSide.value]);
|
|
370
|
-
return {
|
|
371
|
-
contentContext,
|
|
372
|
-
baseSide
|
|
373
|
-
};
|
|
374
|
-
},
|
|
375
|
-
render() {
|
|
376
|
-
return h("span", {
|
|
377
|
-
ref: (el) => {
|
|
378
|
-
this.contentContext.onArrowChange(el);
|
|
379
|
-
return void 0;
|
|
380
|
-
},
|
|
381
|
-
style: {
|
|
382
|
-
position: "absolute",
|
|
383
|
-
left: this.contentContext.arrowX?.value ? `${this.contentContext.arrowX?.value}px` : void 0,
|
|
384
|
-
top: this.contentContext.arrowY?.value ? `${this.contentContext.arrowY?.value}px` : void 0,
|
|
385
|
-
[this.baseSide]: 0,
|
|
386
|
-
transformOrigin: {
|
|
387
|
-
top: "",
|
|
388
|
-
right: "0 0",
|
|
389
|
-
bottom: "center 0",
|
|
390
|
-
left: "100% 0"
|
|
391
|
-
}[this.contentContext.placedSide.value],
|
|
392
|
-
transform: {
|
|
393
|
-
top: "translateY(100%)",
|
|
394
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
395
|
-
bottom: `rotate(180deg)`,
|
|
396
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
397
|
-
}[this.contentContext.placedSide.value],
|
|
398
|
-
visibility: this.contentContext.shouldHideArrow.value ? "hidden" : void 0
|
|
399
|
-
}
|
|
400
|
-
}, h(DestylerArrow, mergeProps(this.$attrs, {
|
|
401
|
-
as: this.$props.as,
|
|
402
|
-
asChild: this.$props.asChild,
|
|
403
|
-
width: this.$props.width,
|
|
404
|
-
height: this.$props.height,
|
|
405
|
-
style: {
|
|
406
|
-
display: "block"
|
|
407
|
-
}
|
|
408
|
-
}), {
|
|
409
|
-
default: () => this.$slots.default?.()
|
|
410
|
-
}));
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
|
|
414
|
-
export { DestylerPopperAnchor, DestylerPopperArrow, DestylerPopperContent, DestylerPopperRoot };
|
|
1
|
+
export { PopperAnchor, PopperArrow, PopperContent, PopperRoot, popperAnchorProps, popperArrowProps, popperContentProps } from './component.mjs';
|
|
2
|
+
import 'vue';
|
|
3
|
+
import '@destyler/shared';
|
|
4
|
+
import '@destyler/primitive';
|
|
5
|
+
import '@destyler/composition';
|
|
6
|
+
import '@floating-ui/vue';
|
|
7
|
+
import '@destyler/arrow';
|
|
8
|
+
import '@destyler/arrow/component';
|
package/dist/resolver.cjs
CHANGED
|
@@ -4,12 +4,12 @@ const name = "@destyler/popper";
|
|
|
4
4
|
|
|
5
5
|
const packageName = name;
|
|
6
6
|
const popperComponentName = [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"PopperRoot",
|
|
8
|
+
"PopperAnchor",
|
|
9
|
+
"PopperContent",
|
|
10
|
+
"PopperArrow"
|
|
11
11
|
];
|
|
12
|
-
function
|
|
12
|
+
function PopperResolver() {
|
|
13
13
|
return {
|
|
14
14
|
type: "component",
|
|
15
15
|
resolve: (name2) => {
|
|
@@ -19,5 +19,5 @@ function DestylerPopperResolver() {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
exports.
|
|
22
|
+
exports.PopperResolver = PopperResolver;
|
|
23
23
|
exports.popperComponentName = popperComponentName;
|
package/dist/resolver.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentResolver } from 'unplugin-vue-components';
|
|
2
2
|
|
|
3
3
|
declare const popperComponentName: string[];
|
|
4
|
-
declare function
|
|
4
|
+
declare function PopperResolver(): ComponentResolver;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { PopperResolver, popperComponentName };
|
package/dist/resolver.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentResolver } from 'unplugin-vue-components';
|
|
2
2
|
|
|
3
3
|
declare const popperComponentName: string[];
|
|
4
|
-
declare function
|
|
4
|
+
declare function PopperResolver(): ComponentResolver;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { PopperResolver, popperComponentName };
|
package/dist/resolver.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentResolver } from 'unplugin-vue-components';
|
|
2
2
|
|
|
3
3
|
declare const popperComponentName: string[];
|
|
4
|
-
declare function
|
|
4
|
+
declare function PopperResolver(): ComponentResolver;
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export { PopperResolver, popperComponentName };
|
package/dist/resolver.mjs
CHANGED
|
@@ -2,12 +2,12 @@ const name = "@destyler/popper";
|
|
|
2
2
|
|
|
3
3
|
const packageName = name;
|
|
4
4
|
const popperComponentName = [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
5
|
+
"PopperRoot",
|
|
6
|
+
"PopperAnchor",
|
|
7
|
+
"PopperContent",
|
|
8
|
+
"PopperArrow"
|
|
9
9
|
];
|
|
10
|
-
function
|
|
10
|
+
function PopperResolver() {
|
|
11
11
|
return {
|
|
12
12
|
type: "component",
|
|
13
13
|
resolve: (name2) => {
|
|
@@ -17,4 +17,4 @@ function DestylerPopperResolver() {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export {
|
|
20
|
+
export { PopperResolver, popperComponentName };
|
package/package.json
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@destyler/popper",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.0.4",
|
|
5
|
+
"description": "popper is a component that allows you to create popups, tooltips, and dropdowns.",
|
|
6
6
|
"author": "Elone Hoo <elonehoo@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/index.d.
|
|
11
|
-
"
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
13
12
|
},
|
|
14
13
|
"./resolver": {
|
|
15
|
-
"types": "./dist/resolver.d.
|
|
16
|
-
"
|
|
17
|
-
"require": "./dist/resolver.cjs"
|
|
14
|
+
"types": "./dist/resolver.d.mts",
|
|
15
|
+
"default": "./dist/resolver.mjs"
|
|
18
16
|
},
|
|
19
17
|
"./component": {
|
|
20
|
-
"types": "./dist/component.d.
|
|
21
|
-
"
|
|
22
|
-
"require": "./dist/component.cjs"
|
|
18
|
+
"types": "./dist/component.d.mts",
|
|
19
|
+
"default": "./dist/component.mjs"
|
|
23
20
|
},
|
|
24
21
|
"./*": "./*"
|
|
25
22
|
},
|
|
@@ -31,17 +28,18 @@
|
|
|
31
28
|
"dist"
|
|
32
29
|
],
|
|
33
30
|
"peerDependencies": {
|
|
34
|
-
"vue": ">=3.
|
|
31
|
+
"vue": ">=3.4.21"
|
|
35
32
|
},
|
|
36
33
|
"dependencies": {
|
|
37
34
|
"@floating-ui/vue": "^1.0.6",
|
|
38
|
-
"@destyler/
|
|
39
|
-
"@destyler/
|
|
40
|
-
"@destyler/
|
|
41
|
-
"@destyler/
|
|
35
|
+
"@destyler/shared": "0.0.4",
|
|
36
|
+
"@destyler/composition": "0.0.4",
|
|
37
|
+
"@destyler/primitive": "0.0.4",
|
|
38
|
+
"@destyler/arrow": "0.0.4"
|
|
42
39
|
},
|
|
43
40
|
"scripts": {
|
|
44
41
|
"clear": "rimraf ./dist",
|
|
45
|
-
"build": "pnpm run clear && unbuild"
|
|
42
|
+
"build": "pnpm run clear && unbuild",
|
|
43
|
+
"stub": "unbuild --stub"
|
|
46
44
|
}
|
|
47
45
|
}
|