@fiscozen/composables 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiscozen/composables",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Design System utility composables",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -100,73 +100,73 @@ export const useFloating = (
100
100
  }
101
101
  switch (position) {
102
102
  case 'bottom':
103
- float.position.y = openerRect.bottom - containerRect.top
103
+ float.position.y = openerRect.bottom
104
104
  float.position.x = openerRect.left + openerRect.width / 2
105
105
  translateX = -50
106
106
  translateY = 0
107
107
  break
108
108
  case 'bottom-start':
109
- float.position.y = openerRect.bottom - containerRect.top
109
+ float.position.y = openerRect.bottom
110
110
  float.position.x = openerRect.left
111
111
  translateX = 0
112
112
  translateY = 0
113
113
  break
114
114
  case 'bottom-end':
115
- float.position.y = openerRect.bottom - containerRect.top
115
+ float.position.y = openerRect.bottom
116
116
  float.position.x = openerRect.right
117
117
  translateX = -100
118
118
  translateY = 0
119
119
  break
120
120
  case 'left-start':
121
- float.position.y = openerRect.top - containerRect.top
121
+ float.position.y = openerRect.top
122
122
  float.position.x = openerRect.left
123
123
  translateX = -100
124
124
  translateY = 0
125
125
  break
126
126
  case 'left':
127
- float.position.y = openerRect.top - containerRect.top + openerRect.height / 2
127
+ float.position.y = openerRect.top + openerRect.height / 2
128
128
  float.position.x = openerRect.left
129
129
  translateY = -50
130
130
  translateX = -100
131
131
  break
132
132
  case 'left-end':
133
- float.position.y = openerRect.bottom - containerRect.top
133
+ float.position.y = openerRect.bottom
134
134
  float.position.x = openerRect.left
135
135
  translateY = -100
136
136
  translateX = -100
137
137
  break
138
138
  case 'top-start':
139
- float.position.y = openerRect.top - containerRect.top
139
+ float.position.y = openerRect.top
140
140
  float.position.x = openerRect.left
141
141
  translateY = -100
142
142
  translateX = 0
143
143
  break
144
144
  case 'top':
145
- float.position.y = openerRect.top - containerRect.top
145
+ float.position.y = openerRect.top
146
146
  float.position.x = openerRect.left + openerRect.width / 2
147
147
  translateX = -50
148
148
  translateY = -100
149
149
  break
150
150
  case 'top-end':
151
- float.position.y = openerRect.top - containerRect.top
151
+ float.position.y = openerRect.top
152
152
  float.position.x = openerRect.right
153
153
  translateX = -100
154
154
  translateY = -100
155
155
  break
156
156
  case 'right-start':
157
- float.position.y = openerRect.top - containerRect.top
157
+ float.position.y = openerRect.top
158
158
  float.position.x = openerRect.right
159
159
  translateX = 0
160
160
  translateY = 0
161
161
  break
162
162
  case 'right':
163
- float.position.y = openerRect.top - containerRect.top + openerRect.height / 2
163
+ float.position.y = openerRect.top + openerRect.height / 2
164
164
  float.position.x = openerRect.right
165
165
  translateY = -50
166
166
  translateX = 0
167
167
  break
168
168
  case 'right-end':
169
- float.position.y = openerRect.bottom - containerRect.top
169
+ float.position.y = openerRect.bottom
170
170
  float.position.x = openerRect.right
171
171
  translateY = -100
172
172
  translateX = 0
@@ -237,14 +237,14 @@ export const useFloating = (
237
237
  translateY = 0
238
238
  }
239
239
 
240
- if ((realPos.y + rect.value.height) > containerRect.bottom - containerRect.top) {
240
+ if ((realPos.y + rect.value.height) > containerRect.bottom) {
241
241
  float.position.y = containerRect.bottom - rect.value.height;
242
242
  translateY = 0
243
243
  }
244
244
 
245
245
  safeElementDomRef.value.style.top = `${float.position.y}px`
246
246
  safeElementDomRef.value.style.left = `${float.position.x}px`
247
- safeElementDomRef.value.style.position = 'absolute'
247
+ safeElementDomRef.value.style.position = 'fixed'
248
248
  safeElementDomRef.value.style.display = 'flex'
249
249
 
250
250
  rect.value = safeElementDomRef.value.getBoundingClientRect()
package/src/types.ts CHANGED
@@ -7,8 +7,8 @@ export type FzFloatingPosition = PositionPrimary | `${PositionPrimary}-${Positio
7
7
  export interface FzFloatingProps {
8
8
  isOpen: boolean
9
9
  position?: FzFloatingPosition
10
- container?: string | null,
11
- contentClass?: string | string[] | Record<string, boolean>
10
+ container?: string | null
11
+ contentClass?: string | string[] | Record<string, boolean|undefined> | Array<string|Record<string,boolean|undefined>>
12
12
  }
13
13
 
14
14
  export interface FzAbsolutePosition {