@sheinx/hooks 3.3.0-beta.12 → 3.3.0-beta.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAgO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAkO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -145,6 +145,10 @@ var useTableLayout = function useTableLayout(props) {
145
145
  });
146
146
  };
147
147
  var changeColGroup = function changeColGroup(cols, adjust) {
148
+ // 修改`Table`被display:none时,表格头样式错乱的问题
149
+ if (cols && cols.every(function (v) {
150
+ return v === 0;
151
+ })) return;
148
152
  setColgroup(cols);
149
153
  setAdjust(adjust);
150
154
  if (!adjust) {
package/cjs/utils/is.d.ts CHANGED
@@ -23,5 +23,6 @@ export declare const isEmpty: (val: unknown) => boolean;
23
23
  export declare const isLink: (el: unknown) => el is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
24
24
  export declare const isMacOS: () => boolean;
25
25
  export declare const isFirefox: () => boolean;
26
+ export declare const isChromeLowerThan: (version: number) => boolean;
26
27
  export declare function isDomElement(element: any): element is HTMLElement;
27
28
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,SAAS,YAExB;AASD,eAAO,MAAM,OAAO,4BAAgB,CAAC;AACrC,eAAO,MAAM,QAAQ,QAAS,OAAO,sBACc,CAAC;AACpD,eAAO,MAAM,MAAM,QAAS,OAAO,gBAAqC,CAAC;AACzE,eAAO,MAAM,SAAS,QAAS,O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exports, "__esModule", {
5
5
  });
6
6
  exports.isBoolean = exports.isArray = void 0;
7
7
  exports.isBrowser = isBrowser;
8
- exports.isDate = exports.isBuffer = void 0;
8
+ exports.isDate = exports.isChromeLowerThan = exports.isBuffer = void 0;
9
9
  exports.isDomElement = isDomElement;
10
10
  exports.isUndefined = exports.isUnMatchedData = exports.isString = exports.isSet = exports.isRegexp = exports.isPromise = exports.isObject = exports.isNumber = exports.isNan = exports.isMergeable = exports.isMap = exports.isMacOS = exports.isLink = exports.isFunc = exports.isFirefox = exports.isError = exports.isEmpty = void 0;
11
11
  var _react = _interopRequireDefault(require("react"));
@@ -103,6 +103,15 @@ var isFirefox = exports.isFirefox = function isFirefox() {
103
103
  if (!isBrowser()) return false;
104
104
  return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
105
105
  };
106
+ var isChromeLowerThan = exports.isChromeLowerThan = function isChromeLowerThan(version) {
107
+ // 服务器端渲染时,不执行版本检查
108
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
109
+ return false;
110
+ }
111
+ var ua = navigator.userAgent;
112
+ var chrome = ua.match(/chrome\/(\d+)/i);
113
+ return Boolean(chrome && chrome[1] && parseInt(chrome[1], 10) < version);
114
+ };
106
115
  function isDomElement(element) {
107
116
  return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === 'object' ? element instanceof HTMLElement // DOM2
108
117
  : element && _typeof(element) === 'object' && element !== null && element.nodeType === 1 && typeof element.nodeName === 'string';
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAgO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAKlE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAcrE,MAAM,WAAW,mBACf,SAAQ,IAAI,CACV,cAAc,CAAC,GAAG,CAAC,EACnB,MAAM,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,OAAO,CAC7E;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA8CX,MAAM,UAAU,MAAM;;;;;;;;CAkO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -136,6 +136,10 @@ var useTableLayout = function useTableLayout(props) {
136
136
  });
137
137
  };
138
138
  var changeColGroup = function changeColGroup(cols, adjust) {
139
+ // 修改`Table`被display:none时,表格头样式错乱的问题
140
+ if (cols && cols.every(function (v) {
141
+ return v === 0;
142
+ })) return;
139
143
  setColgroup(cols);
140
144
  setAdjust(adjust);
141
145
  if (!adjust) {
package/esm/utils/is.d.ts CHANGED
@@ -23,5 +23,6 @@ export declare const isEmpty: (val: unknown) => boolean;
23
23
  export declare const isLink: (el: unknown) => el is React.ReactElement<any, string | React.JSXElementConstructor<any>>;
24
24
  export declare const isMacOS: () => boolean;
25
25
  export declare const isFirefox: () => boolean;
26
+ export declare const isChromeLowerThan: (version: number) => boolean;
26
27
  export declare function isDomElement(element: any): element is HTMLElement;
27
28
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,SAAS,YAExB;AASD,eAAO,MAAM,OAAO,4BAAgB,CAAC;AACrC,eAAO,MAAM,QAAQ,QAAS,OAAO,sBACc,CAAC;AACpD,eAAO,MAAM,MAAM,QAAS,OAAO,gBAAqC,CAAC;AACzE,eAAO,MAAM,SAAS,QAAS,OAAO,mBAA2C,CAAC;AAClF,eAAO,MAAM,OAAO,QAAS,OAAO,KAAG,OAA+B,CAAC;AACvE,eAAO,MAAM,QAAQ,MAAO,OAAO,gBAAuC,CAAC;AAC3E,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,OAAgC,CAAC;AACzE,eAAO,MAAM,QAAQ,MAAO,OAAO,gBAAuC,CAAC;AAC3E,eAAO,MAAM,WAAW,QAAS,GAAG,qBAAwC,CAAC;AAC7E,eAAO,MAAM,KAAK,QAjBsB,OAAO,mBAiBb,CAAC;AACnC,eAAO,MAAM,KAAK,QAlBsB,OAAO,mBA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3E,eAAO,MAAM,WAAW,QAAS,GAAG,qBAAwC,CAAC;AAC7E,eAAO,MAAM,KAAK,QAjBsB,OAAO,mBAiBb,CAAC;AACnC,eAAO,MAAM,KAAK,QAlBsB,OAAO,mBAkBb,CAAC;AACnC,eAAO,MAAM,QAAQ,QAAS,OAAO,KAAG,OAUvC,CAAC;AACF,eAAO,MAAM,eAAe,QAAS,OAAO,yBAE3C,CAAC;AACF,eAAO,MAAM,WAAW,QAAS,OAAO,KAAG,OAS1C,CAAC;AAEF,eAAO,MAAM,MAAM,MAAO,OAAO,kBAA2C,CAAC;AAE7E,eAAO,MAAM,SAAS,MAAO,OAAO,YACiC,CAAC;AAGtE,eAAO,MAAM,KAAK,MAAO,OAAO,KAAG,OAAkB,CAAC;AAEtD,eAAO,MAAM,OAAO,QAAS,OAAO,KAAG,OActC,CAAC;AAEF,eAAO,MAAM,MAAM,OAAQ,OAAO,6EASjC,CAAC;AAEF,eAAO,MAAM,OAAO,QAAO,OACqC,CAAC;AAEjE,eAAO,MAAM,SAAS,QAAO,OAG5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAY,MAAM,KAAE,OASjD,CAAA;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,WAAW,CAQjE"}
package/esm/utils/is.js CHANGED
@@ -92,6 +92,15 @@ export var isFirefox = function isFirefox() {
92
92
  if (!isBrowser()) return false;
93
93
  return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
94
94
  };
95
+ export var isChromeLowerThan = function isChromeLowerThan(version) {
96
+ // 服务器端渲染时,不执行版本检查
97
+ if (typeof window === 'undefined' || typeof navigator === 'undefined') {
98
+ return false;
99
+ }
100
+ var ua = navigator.userAgent;
101
+ var chrome = ua.match(/chrome\/(\d+)/i);
102
+ return Boolean(chrome && chrome[1] && parseInt(chrome[1], 10) < version);
103
+ };
95
104
  export function isDomElement(element) {
96
105
  return (typeof HTMLElement === "undefined" ? "undefined" : _typeof(HTMLElement)) === 'object' ? element instanceof HTMLElement // DOM2
97
106
  : element && _typeof(element) === 'object' && element !== null && element.nodeType === 1 && typeof element.nodeName === 'string';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.3.0-beta.12",
3
+ "version": "3.3.0-beta.13",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",