@sheinx/hooks 3.6.0-beta.7 → 3.6.0-beta.9

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.
@@ -163,7 +163,7 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
163
163
  var overRight = 0;
164
164
  var overLeft = 0;
165
165
  if (h === 'left') {
166
- style.left = rect.left - containerRect.left + containerScroll.left;
166
+ style.left = rect.left - containerRect.left + containerScroll.left - (offset ? offset[0] : 0);
167
167
  style.transform = '';
168
168
  arrayStyle.left = "8px";
169
169
  if (adjust) {
@@ -173,7 +173,7 @@ var usePositionStyle = exports.usePositionStyle = function usePositionStyle(conf
173
173
  }
174
174
  }
175
175
  } else if (h === 'right') {
176
- style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
176
+ style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left - (offset ? offset[0] : 0);
177
177
  style.left = 'auto';
178
178
  style.transform = '';
179
179
  arrayStyle.right = "8px";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare const FieldsetContext: React.Context<{
2
+ export declare const FieldsetContext: React.Context<{
3
3
  path: string;
4
4
  validateFieldSet: () => void;
5
5
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"fieldset-context.d.ts","sourceRoot":"","sources":["fieldset-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,QAAA,MAAM,eAAe;;;EAA0D,CAAC;AAEhF,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAiBD,eAAO,MAAM,mBAAmB;;;;CAe/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"fieldset-context.d.ts","sourceRoot":"","sources":["fieldset-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,eAAO,MAAM,eAAe;;;EAA0D,CAAC;AAGvF,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAiBD,eAAO,MAAM,mBAAmB;;;;CAe/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -4,7 +4,7 @@
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.useFieldSetConsumer = exports.default = void 0;
7
+ exports.useFieldSetConsumer = exports.default = exports.FieldsetContext = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -14,10 +14,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
14
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
16
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
- var FieldsetContext = /*#__PURE__*/(0, _react.createContext)({
17
+ var FieldsetContext = exports.FieldsetContext = /*#__PURE__*/(0, _react.createContext)({
18
18
  path: '',
19
19
  validateFieldSet: function validateFieldSet() {}
20
20
  });
21
+ FieldsetContext.displayName = 'FieldsetContext';
21
22
  function extendName() {
22
23
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
23
24
  var name = arguments.length > 1 ? arguments[1] : undefined;
@@ -1,4 +1,5 @@
1
1
  export { default as useFormFieldSet, default } from './use-form-fieldset';
2
2
  export { useFieldSetConsumer } from './fieldset-context';
3
+ export { FieldsetContext } from './fieldset-context';
3
4
  export type { BaseFormFieldSetProps } from './use-form-fieldset.type';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -4,6 +4,12 @@
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "FieldsetContext", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _fieldsetContext.FieldsetContext;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "default", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -154,7 +154,7 @@ export var usePositionStyle = function usePositionStyle(config) {
154
154
  var overRight = 0;
155
155
  var overLeft = 0;
156
156
  if (h === 'left') {
157
- style.left = rect.left - containerRect.left + containerScroll.left;
157
+ style.left = rect.left - containerRect.left + containerScroll.left - (offset ? offset[0] : 0);
158
158
  style.transform = '';
159
159
  arrayStyle.left = "8px";
160
160
  if (adjust) {
@@ -164,7 +164,7 @@ export var usePositionStyle = function usePositionStyle(config) {
164
164
  }
165
165
  }
166
166
  } else if (h === 'right') {
167
- style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left;
167
+ style.right = containerRect.right - rect.right + containerScrollBarWidth - containerScroll.left - (offset ? offset[0] : 0);
168
168
  style.left = 'auto';
169
169
  style.transform = '';
170
170
  arrayStyle.right = "8px";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- declare const FieldsetContext: React.Context<{
2
+ export declare const FieldsetContext: React.Context<{
3
3
  path: string;
4
4
  validateFieldSet: () => void;
5
5
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"fieldset-context.d.ts","sourceRoot":"","sources":["fieldset-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,QAAA,MAAM,eAAe;;;EAA0D,CAAC;AAEhF,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAiBD,eAAO,MAAM,mBAAmB;;;;CAe/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"fieldset-context.d.ts","sourceRoot":"","sources":["fieldset-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,eAAO,MAAM,eAAe;;;EAA0D,CAAC;AAGvF,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACzB;AAiBD,eAAO,MAAM,mBAAmB;;;;CAe/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -7,10 +7,11 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
7
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
8
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
9
  import React, { createContext } from 'react';
10
- var FieldsetContext = /*#__PURE__*/createContext({
10
+ export var FieldsetContext = /*#__PURE__*/createContext({
11
11
  path: '',
12
12
  validateFieldSet: function validateFieldSet() {}
13
13
  });
14
+ FieldsetContext.displayName = 'FieldsetContext';
14
15
  function extendName() {
15
16
  var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
16
17
  var name = arguments.length > 1 ? arguments[1] : undefined;
@@ -1,4 +1,5 @@
1
1
  export { default as useFormFieldSet, default } from './use-form-fieldset';
2
2
  export { useFieldSetConsumer } from './fieldset-context';
3
+ export { FieldsetContext } from './fieldset-context';
3
4
  export type { BaseFormFieldSetProps } from './use-form-fieldset.type';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,3 +1,4 @@
1
1
  "use client";
2
2
  export { default as useFormFieldSet, default } from "./use-form-fieldset";
3
- export { useFieldSetConsumer } from "./fieldset-context";
3
+ export { useFieldSetConsumer } from "./fieldset-context";
4
+ export { FieldsetContext } from "./fieldset-context";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.6.0-beta.7",
3
+ "version": "3.6.0-beta.9",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",