@destyler/popper 0.1.0 → 0.2.0
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.
|
@@ -154,9 +154,8 @@ function getOffsetMiddleware(arrowElement, opts) {
|
|
|
154
154
|
const mainAxis = typeof gutter === "number" ? gutter + arrowOffset : gutter ?? arrowOffset;
|
|
155
155
|
const { hasAlign } = getPlacementDetails(placement);
|
|
156
156
|
const shift$1 = !hasAlign ? opts.shift : void 0;
|
|
157
|
-
const crossAxis = opts.offset?.crossAxis ?? shift$1;
|
|
158
157
|
return compact({
|
|
159
|
-
crossAxis,
|
|
158
|
+
crossAxis: opts.offset?.crossAxis ?? shift$1,
|
|
160
159
|
mainAxis,
|
|
161
160
|
alignmentAxis: opts.shift
|
|
162
161
|
});
|
|
@@ -242,15 +241,12 @@ function getPlacementImpl(referenceOrVirtual, floating, opts = {}) {
|
|
|
242
241
|
const y = roundByDpr(win, pos.y);
|
|
243
242
|
floating.style.setProperty("--x", `${x}px`);
|
|
244
243
|
floating.style.setProperty("--y", `${y}px`);
|
|
245
|
-
if (options.hideWhenDetached) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
floating.style.removeProperty("visibility");
|
|
252
|
-
floating.style.removeProperty("pointer-events");
|
|
253
|
-
}
|
|
244
|
+
if (options.hideWhenDetached) if (pos.middlewareData.hide?.referenceHidden) {
|
|
245
|
+
floating.style.setProperty("visibility", "hidden");
|
|
246
|
+
floating.style.setProperty("pointer-events", "none");
|
|
247
|
+
} else {
|
|
248
|
+
floating.style.removeProperty("visibility");
|
|
249
|
+
floating.style.removeProperty("pointer-events");
|
|
254
250
|
}
|
|
255
251
|
const contentEl = floating.firstElementChild;
|
|
256
252
|
if (contentEl) {
|
|
@@ -273,7 +269,7 @@ function getPlacementImpl(referenceOrVirtual, floating, opts = {}) {
|
|
|
273
269
|
};
|
|
274
270
|
}
|
|
275
271
|
function getPlacement(referenceOrFn, floatingOrFn, opts = {}) {
|
|
276
|
-
const { defer
|
|
272
|
+
const { defer, ...options } = opts;
|
|
277
273
|
const func = defer ? raf : (v) => v();
|
|
278
274
|
const cleanups = [];
|
|
279
275
|
cleanups.push(func(() => {
|
package/package.json
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@destyler/popper",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "Dynamic positioning logic for UI machines",
|
|
6
6
|
"author": "Elone Hoo <elonehoo@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/destyler/destyler",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/destyler/destyler.git",
|
|
12
|
+
"directory": "packages/shareds/popper"
|
|
13
|
+
},
|
|
8
14
|
"exports": {
|
|
9
|
-
".": "./dist/index.
|
|
15
|
+
".": "./dist/index.mjs"
|
|
10
16
|
},
|
|
11
|
-
"main": "dist/index.
|
|
12
|
-
"module": "dist/index.
|
|
13
|
-
"types": "dist/index.d.
|
|
17
|
+
"main": "dist/index.mjs",
|
|
18
|
+
"module": "dist/index.mjs",
|
|
19
|
+
"types": "dist/index.d.mts",
|
|
14
20
|
"files": [
|
|
15
21
|
"*.d.ts",
|
|
16
22
|
"dist"
|
|
17
23
|
],
|
|
18
24
|
"dependencies": {
|
|
19
|
-
"@floating-ui/dom": "1.7.
|
|
20
|
-
"@destyler/dom": "0.
|
|
21
|
-
"@destyler/utils": "0.
|
|
25
|
+
"@floating-ui/dom": "1.7.4",
|
|
26
|
+
"@destyler/dom": "0.2.0",
|
|
27
|
+
"@destyler/utils": "0.2.0"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
22
31
|
},
|
|
23
32
|
"scripts": {
|
|
24
33
|
"clear": "rimraf ./dist",
|
|
File without changes
|