@monstermann/signals-modal 0.6.0 → 0.7.1
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 +0 -377
- package/dist/anchor/withAnchorElement.mjs +3 -16
- package/dist/anchor/withAnchorMeasurement.mjs +4 -14
- package/dist/anchor/withMouseAnchor.mjs +4 -14
- package/dist/createModal.d.mts +2 -2
- package/dist/createModal.mjs +2 -4
- package/dist/floating/withFloatingElement.mjs +3 -16
- package/dist/floating/withFloatingMeasurement.mjs +4 -14
- package/dist/groups/getDialogs.mjs +1 -3
- package/dist/groups/getGroupsForModal.mjs +1 -3
- package/dist/groups/getModalsForGroup.mjs +1 -3
- package/dist/groups/getPopovers.mjs +1 -3
- package/dist/groups/getTooltips.mjs +1 -3
- package/dist/groups/internals.mjs +1 -3
- package/dist/groups/isDialog.mjs +1 -3
- package/dist/groups/isModalInGroup.mjs +1 -3
- package/dist/groups/isPopover.mjs +1 -3
- package/dist/groups/isTooltip.mjs +1 -3
- package/dist/groups/modalGroups.mjs +1 -2
- package/dist/groups/withModalGroups.mjs +1 -3
- package/dist/index.d.mts +2 -14
- package/dist/index.mjs +5 -18
- package/dist/internals/observeDimensions.mjs +1 -2
- package/dist/internals/observePosition.mjs +8 -3
- package/dist/internals/roundByDPR.mjs +1 -2
- package/dist/position/internals.mjs +1 -23
- package/dist/position/withBoundary.mjs +1 -3
- package/dist/position/withPlacement.mjs +4 -16
- package/dist/position/withPosition.mjs +6 -18
- package/dist/scroll/withCloseOnScroll.mjs +1 -3
- package/dist/status/closeAllModals.mjs +1 -3
- package/dist/status/closeModal.mjs +1 -3
- package/dist/status/getClosedModals.mjs +1 -3
- package/dist/status/getClosingModals.mjs +1 -3
- package/dist/status/getModalStatus.mjs +1 -3
- package/dist/status/getOpenModals.mjs +1 -3
- package/dist/status/getOpenedModals.mjs +1 -3
- package/dist/status/getOpeningModals.mjs +1 -3
- package/dist/status/getVisibleModals.mjs +1 -3
- package/dist/status/internals.mjs +7 -38
- package/dist/status/isAnyModalClosed.mjs +1 -3
- package/dist/status/isAnyModalClosing.mjs +1 -3
- package/dist/status/isAnyModalOpen.mjs +1 -3
- package/dist/status/isAnyModalOpened.mjs +1 -3
- package/dist/status/isAnyModalOpening.mjs +1 -3
- package/dist/status/isAnyModalVisible.mjs +1 -3
- package/dist/status/isModalClosed.mjs +1 -3
- package/dist/status/isModalClosing.mjs +1 -3
- package/dist/status/isModalOpen.mjs +1 -3
- package/dist/status/isModalOpened.mjs +1 -3
- package/dist/status/isModalOpening.mjs +1 -3
- package/dist/status/isModalVisible.mjs +1 -3
- package/dist/status/onModalClosed.d.mts +2 -2
- package/dist/status/onModalClosed.mjs +6 -10
- package/dist/status/onModalClosing.d.mts +2 -2
- package/dist/status/onModalClosing.mjs +6 -10
- package/dist/status/onModalOpened.d.mts +2 -2
- package/dist/status/onModalOpened.mjs +6 -10
- package/dist/status/onModalOpening.d.mts +2 -2
- package/dist/status/onModalOpening.mjs +6 -10
- package/dist/status/openModal.mjs +1 -3
- package/dist/status/setModalStatus.mjs +1 -3
- package/dist/status/withModalStatus.mjs +4 -6
- package/package.json +1 -1
- package/dist/anchor/getAnchorElement.d.mts +0 -34
- package/dist/anchor/getAnchorElement.mjs +0 -39
- package/dist/anchor/getAnchorMeasurement.d.mts +0 -43
- package/dist/anchor/getAnchorMeasurement.mjs +0 -47
- package/dist/anchor/internals.mjs +0 -25
- package/dist/anchor/setAnchorElement.d.mts +0 -30
- package/dist/anchor/setAnchorElement.mjs +0 -35
- package/dist/floating/getFloatingElement.d.mts +0 -34
- package/dist/floating/getFloatingElement.mjs +0 -39
- package/dist/floating/getFloatingMeasurement.d.mts +0 -43
- package/dist/floating/getFloatingMeasurement.mjs +0 -47
- package/dist/floating/internals.mjs +0 -25
- package/dist/floating/setFloatingElement.d.mts +0 -30
- package/dist/floating/setFloatingElement.mjs +0 -35
- package/dist/internals/findParentElement.mjs +0 -9
- package/dist/position/getModalPlacement.d.mts +0 -55
- package/dist/position/getModalPlacement.mjs +0 -58
- package/dist/position/getModalPosition.d.mts +0 -64
- package/dist/position/getModalPosition.mjs +0 -67
- package/dist/status/closeLastModal.d.mts +0 -22
- package/dist/status/closeLastModal.mjs +0 -29
- package/dist/utils/closeLastModalOnClickOutside.d.mts +0 -22
- package/dist/utils/closeLastModalOnClickOutside.mjs +0 -37
- package/dist/utils/closeLastModalOnEsc.d.mts +0 -22
- package/dist/utils/closeLastModalOnEsc.mjs +0 -35
- package/dist/utils/syncModalGroupsToBody.d.mts +0 -41
- package/dist/utils/syncModalGroupsToBody.mjs +0 -72
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getOpenModals } from "./getOpenModals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isAnyModalOpen.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isAnyModalOpen
|
|
@@ -36,6 +35,5 @@ import { getOpenModals } from "./getOpenModals.mjs";
|
|
|
36
35
|
function isAnyModalOpen() {
|
|
37
36
|
return getOpenModals().length > 0;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
|
-
export { isAnyModalOpen };
|
|
39
|
+
export { isAnyModalOpen };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getOpenedModals } from "./getOpenedModals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isAnyModalOpened.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isAnyModalOpened
|
|
@@ -36,6 +35,5 @@ import { getOpenedModals } from "./getOpenedModals.mjs";
|
|
|
36
35
|
function isAnyModalOpened() {
|
|
37
36
|
return getOpenedModals().length > 0;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
|
-
export { isAnyModalOpened };
|
|
39
|
+
export { isAnyModalOpened };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getOpeningModals } from "./getOpeningModals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isAnyModalOpening.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isAnyModalOpening
|
|
@@ -39,6 +38,5 @@ import { getOpeningModals } from "./getOpeningModals.mjs";
|
|
|
39
38
|
function isAnyModalOpening() {
|
|
40
39
|
return getOpeningModals().length > 0;
|
|
41
40
|
}
|
|
42
|
-
|
|
43
41
|
//#endregion
|
|
44
|
-
export { isAnyModalOpening };
|
|
42
|
+
export { isAnyModalOpening };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getVisibleModals } from "./getVisibleModals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isAnyModalVisible.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isAnyModalVisible
|
|
@@ -36,6 +35,5 @@ import { getVisibleModals } from "./getVisibleModals.mjs";
|
|
|
36
35
|
function isAnyModalVisible() {
|
|
37
36
|
return getVisibleModals().length > 0;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
|
-
export { isAnyModalVisible };
|
|
39
|
+
export { isAnyModalVisible };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isModalClosed.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isModalClosed
|
|
@@ -33,6 +32,5 @@ function isModalClosed(key) {
|
|
|
33
32
|
const $status = $keysToStatus().get(key);
|
|
34
33
|
return $status === void 0 || $status() === "closed";
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
//#endregion
|
|
38
|
-
export { isModalClosed };
|
|
36
|
+
export { isModalClosed };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isModalClosing.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isModalClosing
|
|
@@ -36,6 +35,5 @@ import { $keysToStatus } from "./internals.mjs";
|
|
|
36
35
|
function isModalClosing(key) {
|
|
37
36
|
return $keysToStatus().get(key)?.() === "closing";
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
|
-
export { isModalClosing };
|
|
39
|
+
export { isModalClosing };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isModalOpened } from "./isModalOpened.mjs";
|
|
2
2
|
import { isModalOpening } from "./isModalOpening.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/status/isModalOpen.ts
|
|
5
4
|
/**
|
|
6
5
|
* # isModalOpen
|
|
@@ -33,6 +32,5 @@ import { isModalOpening } from "./isModalOpening.mjs";
|
|
|
33
32
|
function isModalOpen(key) {
|
|
34
33
|
return isModalOpening(key) || isModalOpened(key);
|
|
35
34
|
}
|
|
36
|
-
|
|
37
35
|
//#endregion
|
|
38
|
-
export { isModalOpen };
|
|
36
|
+
export { isModalOpen };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isModalOpened.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isModalOpened
|
|
@@ -34,6 +33,5 @@ import { $keysToStatus } from "./internals.mjs";
|
|
|
34
33
|
function isModalOpened(key) {
|
|
35
34
|
return $keysToStatus().get(key)?.() === "opened";
|
|
36
35
|
}
|
|
37
|
-
|
|
38
36
|
//#endregion
|
|
39
|
-
export { isModalOpened };
|
|
37
|
+
export { isModalOpened };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isModalOpening.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isModalOpening
|
|
@@ -34,6 +33,5 @@ import { $keysToStatus } from "./internals.mjs";
|
|
|
34
33
|
function isModalOpening(key) {
|
|
35
34
|
return $keysToStatus().get(key)?.() === "opening";
|
|
36
35
|
}
|
|
37
|
-
|
|
38
36
|
//#endregion
|
|
39
|
-
export { isModalOpening };
|
|
37
|
+
export { isModalOpening };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { isModalClosed } from "./isModalClosed.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/isModalVisible.ts
|
|
4
3
|
/**
|
|
5
4
|
* # isModalVisible
|
|
@@ -34,6 +33,5 @@ import { isModalClosed } from "./isModalClosed.mjs";
|
|
|
34
33
|
function isModalVisible(key) {
|
|
35
34
|
return !isModalClosed(key);
|
|
36
35
|
}
|
|
37
|
-
|
|
38
36
|
//#endregion
|
|
39
|
-
export { isModalVisible };
|
|
37
|
+
export { isModalVisible };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as _monstermann_signals0 from "@monstermann/signals";
|
|
1
|
+
import * as _$_monstermann_signals0 from "@monstermann/signals";
|
|
2
2
|
|
|
3
3
|
//#region src/status/onModalClosed.d.ts
|
|
4
4
|
/**
|
|
@@ -31,6 +31,6 @@ import * as _monstermann_signals0 from "@monstermann/signals";
|
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
declare const onModalClosed: _monstermann_signals0.Emitter<string>;
|
|
34
|
+
declare const onModalClosed: _$_monstermann_signals0.Emitter<string>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { onModalClosed };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { emitter } from "@monstermann/signals";
|
|
2
|
-
|
|
3
|
-
//#region src/status/onModalClosed.ts
|
|
4
|
-
const meta = {
|
|
5
|
-
path: "@signals-modal/status/onModalClosed.ts",
|
|
6
|
-
line: 33,
|
|
7
|
-
name: "onModalClosed"
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* # onModalClosed
|
|
11
4
|
*
|
|
@@ -36,7 +29,10 @@ const meta = {
|
|
|
36
29
|
* ```
|
|
37
30
|
*
|
|
38
31
|
*/
|
|
39
|
-
const onModalClosed = emitter(void 0,
|
|
40
|
-
|
|
32
|
+
const onModalClosed = emitter(void 0, {
|
|
33
|
+
path: "@signals-modal/status/onModalClosed.ts",
|
|
34
|
+
line: 33,
|
|
35
|
+
name: "onModalClosed"
|
|
36
|
+
});
|
|
41
37
|
//#endregion
|
|
42
|
-
export { onModalClosed };
|
|
38
|
+
export { onModalClosed };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as _monstermann_signals0 from "@monstermann/signals";
|
|
1
|
+
import * as _$_monstermann_signals0 from "@monstermann/signals";
|
|
2
2
|
|
|
3
3
|
//#region src/status/onModalClosing.d.ts
|
|
4
4
|
/**
|
|
@@ -31,6 +31,6 @@ import * as _monstermann_signals0 from "@monstermann/signals";
|
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
declare const onModalClosing: _monstermann_signals0.Emitter<string>;
|
|
34
|
+
declare const onModalClosing: _$_monstermann_signals0.Emitter<string>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { onModalClosing };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { emitter } from "@monstermann/signals";
|
|
2
|
-
|
|
3
|
-
//#region src/status/onModalClosing.ts
|
|
4
|
-
const meta = {
|
|
5
|
-
path: "@signals-modal/status/onModalClosing.ts",
|
|
6
|
-
line: 33,
|
|
7
|
-
name: "onModalClosing"
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* # onModalClosing
|
|
11
4
|
*
|
|
@@ -36,7 +29,10 @@ const meta = {
|
|
|
36
29
|
* ```
|
|
37
30
|
*
|
|
38
31
|
*/
|
|
39
|
-
const onModalClosing = emitter(void 0,
|
|
40
|
-
|
|
32
|
+
const onModalClosing = emitter(void 0, {
|
|
33
|
+
path: "@signals-modal/status/onModalClosing.ts",
|
|
34
|
+
line: 33,
|
|
35
|
+
name: "onModalClosing"
|
|
36
|
+
});
|
|
41
37
|
//#endregion
|
|
42
|
-
export { onModalClosing };
|
|
38
|
+
export { onModalClosing };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as _monstermann_signals0 from "@monstermann/signals";
|
|
1
|
+
import * as _$_monstermann_signals0 from "@monstermann/signals";
|
|
2
2
|
|
|
3
3
|
//#region src/status/onModalOpened.d.ts
|
|
4
4
|
/**
|
|
@@ -31,6 +31,6 @@ import * as _monstermann_signals0 from "@monstermann/signals";
|
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
declare const onModalOpened: _monstermann_signals0.Emitter<string>;
|
|
34
|
+
declare const onModalOpened: _$_monstermann_signals0.Emitter<string>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { onModalOpened };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { emitter } from "@monstermann/signals";
|
|
2
|
-
|
|
3
|
-
//#region src/status/onModalOpened.ts
|
|
4
|
-
const meta = {
|
|
5
|
-
path: "@signals-modal/status/onModalOpened.ts",
|
|
6
|
-
line: 33,
|
|
7
|
-
name: "onModalOpened"
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* # onModalOpened
|
|
11
4
|
*
|
|
@@ -36,7 +29,10 @@ const meta = {
|
|
|
36
29
|
* ```
|
|
37
30
|
*
|
|
38
31
|
*/
|
|
39
|
-
const onModalOpened = emitter(void 0,
|
|
40
|
-
|
|
32
|
+
const onModalOpened = emitter(void 0, {
|
|
33
|
+
path: "@signals-modal/status/onModalOpened.ts",
|
|
34
|
+
line: 33,
|
|
35
|
+
name: "onModalOpened"
|
|
36
|
+
});
|
|
41
37
|
//#endregion
|
|
42
|
-
export { onModalOpened };
|
|
38
|
+
export { onModalOpened };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as _monstermann_signals0 from "@monstermann/signals";
|
|
1
|
+
import * as _$_monstermann_signals0 from "@monstermann/signals";
|
|
2
2
|
|
|
3
3
|
//#region src/status/onModalOpening.d.ts
|
|
4
4
|
/**
|
|
@@ -31,6 +31,6 @@ import * as _monstermann_signals0 from "@monstermann/signals";
|
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
|
-
declare const onModalOpening: _monstermann_signals0.Emitter<string>;
|
|
34
|
+
declare const onModalOpening: _$_monstermann_signals0.Emitter<string>;
|
|
35
35
|
//#endregion
|
|
36
36
|
export { onModalOpening };
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { emitter } from "@monstermann/signals";
|
|
2
|
-
|
|
3
|
-
//#region src/status/onModalOpening.ts
|
|
4
|
-
const meta = {
|
|
5
|
-
path: "@signals-modal/status/onModalOpening.ts",
|
|
6
|
-
line: 33,
|
|
7
|
-
name: "onModalOpening"
|
|
8
|
-
};
|
|
9
2
|
/**
|
|
10
3
|
* # onModalOpening
|
|
11
4
|
*
|
|
@@ -36,7 +29,10 @@ const meta = {
|
|
|
36
29
|
* ```
|
|
37
30
|
*
|
|
38
31
|
*/
|
|
39
|
-
const onModalOpening = emitter(void 0,
|
|
40
|
-
|
|
32
|
+
const onModalOpening = emitter(void 0, {
|
|
33
|
+
path: "@signals-modal/status/onModalOpening.ts",
|
|
34
|
+
line: 33,
|
|
35
|
+
name: "onModalOpening"
|
|
36
|
+
});
|
|
41
37
|
//#endregion
|
|
42
|
-
export { onModalOpening };
|
|
38
|
+
export { onModalOpening };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
2
|
import { untrack } from "@monstermann/signals";
|
|
3
|
-
|
|
4
3
|
//#region src/status/openModal.ts
|
|
5
4
|
/**
|
|
6
5
|
* # openModal
|
|
@@ -37,6 +36,5 @@ function openModal(key) {
|
|
|
37
36
|
$status("opening");
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
//#endregion
|
|
42
|
-
export { openModal };
|
|
40
|
+
export { openModal };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/status/setModalStatus.ts
|
|
4
3
|
/**
|
|
5
4
|
* # setModalStatus
|
|
@@ -32,6 +31,5 @@ import { $keysToStatus } from "./internals.mjs";
|
|
|
32
31
|
function setModalStatus(key, status) {
|
|
33
32
|
$keysToStatus().get(key)?.(status);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
|
-
export { setModalStatus };
|
|
35
|
+
export { setModalStatus };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { onModalClosed } from "./onModalClosed.mjs";
|
|
2
|
-
import { onModalOpened } from "./onModalOpened.mjs";
|
|
3
|
-
import { onModalOpening } from "./onModalOpening.mjs";
|
|
4
1
|
import { $keysToStatus } from "./internals.mjs";
|
|
5
2
|
import { closeModal } from "./closeModal.mjs";
|
|
3
|
+
import { onModalClosed } from "./onModalClosed.mjs";
|
|
6
4
|
import { currentModal } from "../createModal.mjs";
|
|
7
5
|
import { isModalOpen } from "./isModalOpen.mjs";
|
|
8
6
|
import { onModalClosing } from "./onModalClosing.mjs";
|
|
7
|
+
import { onModalOpened } from "./onModalOpened.mjs";
|
|
8
|
+
import { onModalOpening } from "./onModalOpening.mjs";
|
|
9
9
|
import { openModal } from "./openModal.mjs";
|
|
10
10
|
import { INTERNAL, memo, signal, watch } from "@monstermann/signals";
|
|
11
|
-
|
|
12
11
|
//#region src/status/withModalStatus.ts
|
|
13
12
|
const path = "@signals-modal/status/withModalStatus.ts";
|
|
14
13
|
const meta = {
|
|
@@ -87,6 +86,5 @@ function withModalStatus(status = "closed") {
|
|
|
87
86
|
open: () => openModal(modal.key)
|
|
88
87
|
};
|
|
89
88
|
}
|
|
90
|
-
|
|
91
89
|
//#endregion
|
|
92
|
-
export { withModalStatus };
|
|
90
|
+
export { withModalStatus };
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region src/anchor/getAnchorElement.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* # getAnchorElement
|
|
4
|
-
*
|
|
5
|
-
* <Badge type="tip">Reactive</Badge>
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* function getAnchorElement(key: string): HTMLElement | undefined;
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* Retrieves the current anchor element for the given `key`.
|
|
12
|
-
*
|
|
13
|
-
* ## Example
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* import {
|
|
17
|
-
* createModal,
|
|
18
|
-
* withAnchorElement,
|
|
19
|
-
* setAnchorElement,
|
|
20
|
-
* getAnchorElement,
|
|
21
|
-
* } from "@monstermann/signals-modal";
|
|
22
|
-
*
|
|
23
|
-
* createModal("key", () => {
|
|
24
|
-
* withAnchorElement();
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* setAnchorElement("key", document.querySelector(".anchor"));
|
|
28
|
-
* getAnchorElement("key"); // HTMLElement
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
declare function getAnchorElement(key: string): HTMLElement | undefined;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { getAnchorElement };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { $anchorElements } from "./internals.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/anchor/getAnchorElement.ts
|
|
4
|
-
/**
|
|
5
|
-
* # getAnchorElement
|
|
6
|
-
*
|
|
7
|
-
* <Badge type="tip">Reactive</Badge>
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* function getAnchorElement(key: string): HTMLElement | undefined;
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* Retrieves the current anchor element for the given `key`.
|
|
14
|
-
*
|
|
15
|
-
* ## Example
|
|
16
|
-
*
|
|
17
|
-
* ```ts
|
|
18
|
-
* import {
|
|
19
|
-
* createModal,
|
|
20
|
-
* withAnchorElement,
|
|
21
|
-
* setAnchorElement,
|
|
22
|
-
* getAnchorElement,
|
|
23
|
-
* } from "@monstermann/signals-modal";
|
|
24
|
-
*
|
|
25
|
-
* createModal("key", () => {
|
|
26
|
-
* withAnchorElement();
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* setAnchorElement("key", document.querySelector(".anchor"));
|
|
30
|
-
* getAnchorElement("key"); // HTMLElement
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
function getAnchorElement(key) {
|
|
35
|
-
return $anchorElements().get(key)?.() ?? void 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { getAnchorElement };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Rect } from "@monstermann/geometry";
|
|
2
|
-
|
|
3
|
-
//#region src/anchor/getAnchorMeasurement.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* # getAnchorMeasurement
|
|
6
|
-
*
|
|
7
|
-
* <Badge type="tip">Reactive</Badge>
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* function getAnchorMeasurement(key: string): Rect;
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* Retrieves the current result of `withAnchorMeasurement` or `withMouseAnchor`, falling back to an empty `Rect`.
|
|
14
|
-
*
|
|
15
|
-
* ## Example
|
|
16
|
-
*
|
|
17
|
-
* ```ts
|
|
18
|
-
* import {
|
|
19
|
-
* createModal,
|
|
20
|
-
* withAnchorElement,
|
|
21
|
-
* withModalStatus,
|
|
22
|
-
* withAnchorMeasurement,
|
|
23
|
-
* getAnchorMeasurement,
|
|
24
|
-
* } from "@monstermann/signals-modal";
|
|
25
|
-
*
|
|
26
|
-
* createModal("key", () => {
|
|
27
|
-
* const { $status } = withModalStatus();
|
|
28
|
-
* const $anchorElement = withAnchorElement();
|
|
29
|
-
* // Memo({ top: number, left: number, width: number, height: number })
|
|
30
|
-
* const $anchorMeasurement = withAnchorMeasurement({
|
|
31
|
-
* $status,
|
|
32
|
-
* $anchorElement,
|
|
33
|
-
* });
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* // { top: number, left: number, width: number, height: number }
|
|
37
|
-
* getAnchorMeasurement("key");
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
*/
|
|
41
|
-
declare function getAnchorMeasurement(key: string): Rect;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { getAnchorMeasurement };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { $anchorMeasurements } from "./internals.mjs";
|
|
2
|
-
import { origin } from "@monstermann/geometry/Rect/origin.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/anchor/getAnchorMeasurement.ts
|
|
5
|
-
/**
|
|
6
|
-
* # getAnchorMeasurement
|
|
7
|
-
*
|
|
8
|
-
* <Badge type="tip">Reactive</Badge>
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* function getAnchorMeasurement(key: string): Rect;
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Retrieves the current result of `withAnchorMeasurement` or `withMouseAnchor`, falling back to an empty `Rect`.
|
|
15
|
-
*
|
|
16
|
-
* ## Example
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* import {
|
|
20
|
-
* createModal,
|
|
21
|
-
* withAnchorElement,
|
|
22
|
-
* withModalStatus,
|
|
23
|
-
* withAnchorMeasurement,
|
|
24
|
-
* getAnchorMeasurement,
|
|
25
|
-
* } from "@monstermann/signals-modal";
|
|
26
|
-
*
|
|
27
|
-
* createModal("key", () => {
|
|
28
|
-
* const { $status } = withModalStatus();
|
|
29
|
-
* const $anchorElement = withAnchorElement();
|
|
30
|
-
* // Memo({ top: number, left: number, width: number, height: number })
|
|
31
|
-
* const $anchorMeasurement = withAnchorMeasurement({
|
|
32
|
-
* $status,
|
|
33
|
-
* $anchorElement,
|
|
34
|
-
* });
|
|
35
|
-
* });
|
|
36
|
-
*
|
|
37
|
-
* // { top: number, left: number, width: number, height: number }
|
|
38
|
-
* getAnchorMeasurement("key");
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
function getAnchorMeasurement(key) {
|
|
43
|
-
return $anchorMeasurements().get(key)?.() ?? origin;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { getAnchorMeasurement };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { signal } from "@monstermann/signals";
|
|
2
|
-
|
|
3
|
-
//#region src/anchor/internals.ts
|
|
4
|
-
const path = "@signals-modal/anchor/internals.ts";
|
|
5
|
-
const meta = {
|
|
6
|
-
path,
|
|
7
|
-
line: 5,
|
|
8
|
-
name: "$anchorElements"
|
|
9
|
-
};
|
|
10
|
-
const meta1 = {
|
|
11
|
-
path,
|
|
12
|
-
line: 10,
|
|
13
|
-
name: "$anchorMeasurements"
|
|
14
|
-
};
|
|
15
|
-
const $anchorElements = signal(/* @__PURE__ */ new Map(), {
|
|
16
|
-
mutable: true,
|
|
17
|
-
silent: true
|
|
18
|
-
}, meta);
|
|
19
|
-
const $anchorMeasurements = signal(/* @__PURE__ */ new Map(), {
|
|
20
|
-
mutable: true,
|
|
21
|
-
silent: true
|
|
22
|
-
}, meta1);
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { $anchorElements, $anchorMeasurements };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
//#region src/anchor/setAnchorElement.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* # setAnchorElement
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* function setAnchorElement(key: string, element: HTMLElement | null): void;
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Sets the current anchor element for the given `key`.
|
|
10
|
-
*
|
|
11
|
-
* ## Example
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* import {
|
|
15
|
-
* createModal,
|
|
16
|
-
* withAnchorElement,
|
|
17
|
-
* getAnchorElement,
|
|
18
|
-
* } from "@monstermann/signals-modal";
|
|
19
|
-
*
|
|
20
|
-
* createModal("key", () => {
|
|
21
|
-
* withAnchorElement();
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* setAnchorElement("key", document.querySelector(".anchor"));
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
declare function setAnchorElement(key: string, element: HTMLElement | null): void;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { setAnchorElement };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { $anchorElements } from "./internals.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/anchor/setAnchorElement.ts
|
|
4
|
-
/**
|
|
5
|
-
* # setAnchorElement
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* function setAnchorElement(key: string, element: HTMLElement | null): void;
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* Sets the current anchor element for the given `key`.
|
|
12
|
-
*
|
|
13
|
-
* ## Example
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* import {
|
|
17
|
-
* createModal,
|
|
18
|
-
* withAnchorElement,
|
|
19
|
-
* getAnchorElement,
|
|
20
|
-
* } from "@monstermann/signals-modal";
|
|
21
|
-
*
|
|
22
|
-
* createModal("key", () => {
|
|
23
|
-
* withAnchorElement();
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* setAnchorElement("key", document.querySelector(".anchor"));
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
function setAnchorElement(key, element) {
|
|
31
|
-
$anchorElements().get(key)?.(element);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
export { setAnchorElement };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region src/floating/getFloatingElement.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* # getFloatingElement
|
|
4
|
-
*
|
|
5
|
-
* <Badge type="tip">Reactive</Badge>
|
|
6
|
-
*
|
|
7
|
-
* ```ts
|
|
8
|
-
* function getFloatingElement(key: string): HTMLElement | undefined;
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* Retrieves the current floating element for the given `key`.
|
|
12
|
-
*
|
|
13
|
-
* ## Example
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* import {
|
|
17
|
-
* createModal,
|
|
18
|
-
* withFloatingElement,
|
|
19
|
-
* setFloatingElement,
|
|
20
|
-
* getFloatingElement,
|
|
21
|
-
* } from "@monstermann/signals-modal";
|
|
22
|
-
*
|
|
23
|
-
* createModal("key", () => {
|
|
24
|
-
* withFloatingElement();
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* setFloatingElement("key", document.querySelector(".floating"));
|
|
28
|
-
* getFloatingElement("key"); // HTMLElement
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
declare function getFloatingElement(key: string): HTMLElement | undefined;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { getFloatingElement };
|