@sheinx/hooks 3.3.7-beta.4 → 3.3.7-beta.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBAiJc,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -92,6 +92,13 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
92
92
  var getCurrentArr = function getCurrentArr() {
93
93
  var arr = convertValueToDateArr(value, format, options);
94
94
  var currentArr = convertValueToDateArr(props.defaultCurrent, 'YYYY-MM-DD', options);
95
+ var validArr = arr.filter(function (item) {
96
+ return item;
97
+ });
98
+ var validCurrentArr = currentArr.filter(function (item) {
99
+ return item;
100
+ });
101
+ if (!validArr.length && currentArr.length) return validCurrentArr;
95
102
  if (!arr[0]) arr[0] = arr[1] || currentArr[0] || new Date();
96
103
  if (range && !arr[1]) arr[1] = arr[0] || currentArr[1] || new Date();
97
104
  return arr;
@@ -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;;;;;;;;CAmO5D,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;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;;CAmO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -103,6 +103,7 @@ var useTableLayout = function useTableLayout(props) {
103
103
  return;
104
104
  }
105
105
  context.clientWidth = scrollEl.clientWidth;
106
+ if (scrollEl.clientHeight === 0) return;
106
107
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
107
108
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
108
109
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
@@ -1 +1 @@
1
- {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBA4Ic,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"use-datepicker-format.d.ts","sourceRoot":"","sources":["use-datepicker-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,8BAA8B,CAAC;AAkEtC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;yBAiJc,gBAAgB;iCA8BR,MAAM,SAAS,MAAM;yCA7HrD,OAAO,GAAG,KAAK,GAAG,SAAS,QAAQ,MAAM,UAAU,IAAI,KAAK,OAAO;uCAWvE,MAAM,cAAc,CAAC,IAAI,EAAE,CAAC,QAC3B,MAAM;kBACG,MAAM,SAAS;mBAAS,GAAG;;+BAQH,IAAI,YAAY,OAAO,GAAG,KAAK,GAAG,SAAS;;CAwKvF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -85,6 +85,13 @@ var useDatePickerFormat = function useDatePickerFormat(props) {
85
85
  var getCurrentArr = function getCurrentArr() {
86
86
  var arr = convertValueToDateArr(value, format, options);
87
87
  var currentArr = convertValueToDateArr(props.defaultCurrent, 'YYYY-MM-DD', options);
88
+ var validArr = arr.filter(function (item) {
89
+ return item;
90
+ });
91
+ var validCurrentArr = currentArr.filter(function (item) {
92
+ return item;
93
+ });
94
+ if (!validArr.length && currentArr.length) return validCurrentArr;
88
95
  if (!arr[0]) arr[0] = arr[1] || currentArr[0] || new Date();
89
96
  if (range && !arr[1]) arr[1] = arr[0] || currentArr[1] || new Date();
90
97
  return arr;
@@ -1 +1 @@
1
- {"version":3,"file":"use-table-layout.d.ts","sourceRoot":"","sources":["use-table-layout.tsx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AAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,QAAA,MAAM,cAAc,UAAW,mBAAmB;;;;;;;;;;;yBA+CX,MAAM,UAAU,MAAM;;;;;;;;CAmO5D,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -94,6 +94,7 @@ var useTableLayout = function useTableLayout(props) {
94
94
  return;
95
95
  }
96
96
  context.clientWidth = scrollEl.clientWidth;
97
+ if (scrollEl.clientHeight === 0) return;
97
98
  var overHeight = scrollEl.scrollHeight > scrollEl.clientHeight;
98
99
  var overWidth = scrollEl.scrollWidth > context.clientWidth;
99
100
  var newScrollBarWidth = overHeight ? scrollEl.offsetWidth - scrollEl.clientWidth : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.3.7-beta.4",
3
+ "version": "3.3.7-beta.6",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",