@x-plat/design-system 0.14.9 → 0.14.10

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.
@@ -102,6 +102,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
102
102
  if (left < clip.left + 8) left = clip.left + 8;
103
103
  pop.style.top = `${top + window.scrollY}px`;
104
104
  pop.style.left = `${left + window.scrollX}px`;
105
+ const over = {
106
+ top: Math.max(0, clip.top - top),
107
+ right: Math.max(0, left + popW - clip.right),
108
+ bottom: Math.max(0, top + popH - clip.bottom),
109
+ left: Math.max(0, clip.left - left)
110
+ };
111
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
105
112
  if (next !== directionRef.current) {
106
113
  directionRef.current = next;
107
114
  setDirection(next);
@@ -66,6 +66,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  if (left < clip.left + 8) left = clip.left + 8;
67
67
  pop.style.top = `${top + window.scrollY}px`;
68
68
  pop.style.left = `${left + window.scrollX}px`;
69
+ const over = {
70
+ top: Math.max(0, clip.top - top),
71
+ right: Math.max(0, left + popW - clip.right),
72
+ bottom: Math.max(0, top + popH - clip.bottom),
73
+ left: Math.max(0, clip.left - left)
74
+ };
75
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
69
76
  if (next !== directionRef.current) {
70
77
  directionRef.current = next;
71
78
  setDirection(next);
@@ -102,6 +102,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
102
102
  if (left < clip.left + 8) left = clip.left + 8;
103
103
  pop.style.top = `${top + window.scrollY}px`;
104
104
  pop.style.left = `${left + window.scrollX}px`;
105
+ const over = {
106
+ top: Math.max(0, clip.top - top),
107
+ right: Math.max(0, left + popW - clip.right),
108
+ bottom: Math.max(0, top + popH - clip.bottom),
109
+ left: Math.max(0, clip.left - left)
110
+ };
111
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
105
112
  if (next !== directionRef.current) {
106
113
  directionRef.current = next;
107
114
  setDirection(next);
@@ -66,6 +66,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  if (left < clip.left + 8) left = clip.left + 8;
67
67
  pop.style.top = `${top + window.scrollY}px`;
68
68
  pop.style.left = `${left + window.scrollX}px`;
69
+ const over = {
70
+ top: Math.max(0, clip.top - top),
71
+ right: Math.max(0, left + popW - clip.right),
72
+ bottom: Math.max(0, top + popH - clip.bottom),
73
+ left: Math.max(0, clip.left - left)
74
+ };
75
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
69
76
  if (next !== directionRef.current) {
70
77
  directionRef.current = next;
71
78
  setDirection(next);
@@ -103,6 +103,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
103
103
  if (left < clip.left + 8) left = clip.left + 8;
104
104
  pop.style.top = `${top + window.scrollY}px`;
105
105
  pop.style.left = `${left + window.scrollX}px`;
106
+ const over = {
107
+ top: Math.max(0, clip.top - top),
108
+ right: Math.max(0, left + popW - clip.right),
109
+ bottom: Math.max(0, top + popH - clip.bottom),
110
+ left: Math.max(0, clip.left - left)
111
+ };
112
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
106
113
  if (next !== directionRef.current) {
107
114
  directionRef.current = next;
108
115
  setDirection(next);
@@ -66,6 +66,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  if (left < clip.left + 8) left = clip.left + 8;
67
67
  pop.style.top = `${top + window.scrollY}px`;
68
68
  pop.style.left = `${left + window.scrollX}px`;
69
+ const over = {
70
+ top: Math.max(0, clip.top - top),
71
+ right: Math.max(0, left + popW - clip.right),
72
+ bottom: Math.max(0, top + popH - clip.bottom),
73
+ left: Math.max(0, clip.left - left)
74
+ };
75
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
69
76
  if (next !== directionRef.current) {
70
77
  directionRef.current = next;
71
78
  setDirection(next);
@@ -102,6 +102,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
102
102
  if (left < clip.left + 8) left = clip.left + 8;
103
103
  pop.style.top = `${top + window.scrollY}px`;
104
104
  pop.style.left = `${left + window.scrollX}px`;
105
+ const over = {
106
+ top: Math.max(0, clip.top - top),
107
+ right: Math.max(0, left + popW - clip.right),
108
+ bottom: Math.max(0, top + popH - clip.bottom),
109
+ left: Math.max(0, clip.left - left)
110
+ };
111
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
105
112
  if (next !== directionRef.current) {
106
113
  directionRef.current = next;
107
114
  setDirection(next);
@@ -66,6 +66,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
66
66
  if (left < clip.left + 8) left = clip.left + 8;
67
67
  pop.style.top = `${top + window.scrollY}px`;
68
68
  pop.style.left = `${left + window.scrollX}px`;
69
+ const over = {
70
+ top: Math.max(0, clip.top - top),
71
+ right: Math.max(0, left + popW - clip.right),
72
+ bottom: Math.max(0, top + popH - clip.bottom),
73
+ left: Math.max(0, clip.left - left)
74
+ };
75
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
69
76
  if (next !== directionRef.current) {
70
77
  directionRef.current = next;
71
78
  setDirection(next);
@@ -4046,6 +4046,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
4046
4046
  if (left < clip.left + 8) left = clip.left + 8;
4047
4047
  pop.style.top = `${top + window.scrollY}px`;
4048
4048
  pop.style.left = `${left + window.scrollX}px`;
4049
+ const over = {
4050
+ top: Math.max(0, clip.top - top),
4051
+ right: Math.max(0, left + popW - clip.right),
4052
+ bottom: Math.max(0, top + popH - clip.bottom),
4053
+ left: Math.max(0, clip.left - left)
4054
+ };
4055
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
4049
4056
  if (next !== directionRef.current) {
4050
4057
  directionRef.current = next;
4051
4058
  setDirection(next);
@@ -3944,6 +3944,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
3944
3944
  if (left < clip.left + 8) left = clip.left + 8;
3945
3945
  pop.style.top = `${top + window.scrollY}px`;
3946
3946
  pop.style.left = `${left + window.scrollX}px`;
3947
+ const over = {
3948
+ top: Math.max(0, clip.top - top),
3949
+ right: Math.max(0, left + popW - clip.right),
3950
+ bottom: Math.max(0, top + popH - clip.bottom),
3951
+ left: Math.max(0, clip.left - left)
3952
+ };
3953
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
3947
3954
  if (next !== directionRef.current) {
3948
3955
  directionRef.current = next;
3949
3956
  setDirection(next);
package/dist/index.cjs CHANGED
@@ -8458,6 +8458,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
8458
8458
  if (left < clip.left + 8) left = clip.left + 8;
8459
8459
  pop.style.top = `${top + window.scrollY}px`;
8460
8460
  pop.style.left = `${left + window.scrollX}px`;
8461
+ const over = {
8462
+ top: Math.max(0, clip.top - top),
8463
+ right: Math.max(0, left + popW - clip.right),
8464
+ bottom: Math.max(0, top + popH - clip.bottom),
8465
+ left: Math.max(0, clip.left - left)
8466
+ };
8467
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
8461
8468
  if (next !== directionRef.current) {
8462
8469
  directionRef.current = next;
8463
8470
  setDirection(next);
package/dist/index.js CHANGED
@@ -8047,6 +8047,13 @@ var useAutoPosition = (triggerRef, popRef, enabled = true) => {
8047
8047
  if (left < clip.left + 8) left = clip.left + 8;
8048
8048
  pop.style.top = `${top + window.scrollY}px`;
8049
8049
  pop.style.left = `${left + window.scrollX}px`;
8050
+ const over = {
8051
+ top: Math.max(0, clip.top - top),
8052
+ right: Math.max(0, left + popW - clip.right),
8053
+ bottom: Math.max(0, top + popH - clip.bottom),
8054
+ left: Math.max(0, clip.left - left)
8055
+ };
8056
+ pop.style.clipPath = over.top || over.right || over.bottom || over.left ? `inset(${over.top}px ${over.right}px ${over.bottom}px ${over.left}px)` : "none";
8050
8057
  if (next !== directionRef.current) {
8051
8058
  directionRef.current = next;
8052
8059
  setDirection(next);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x-plat/design-system",
3
- "version": "0.14.9",
3
+ "version": "0.14.10",
4
4
  "description": "XPLAT UI Design System",
5
5
  "author": "XPLAT WOONG",
6
6
  "main": "dist/index.cjs",