@sheinx/hooks 3.8.3-beta.6 → 3.8.3-beta.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"form-schema-builder.d.ts","sourceRoot":"","sources":["form-schema-builder.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG;QAAE,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC5C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAiB;gBACnB,QAAQ,EAAE,MAAM;IAQ5B,OAAO,CAAC,WAAW;IAYnB,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAA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AE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAetG,oBAAoB,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IA0B9H,cAAc,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI;IAwB7F,aAAa,IAAI,cAAc;CAGhC"}
@@ -177,7 +177,46 @@ var SchemaBuilder = exports.SchemaBuilder = /*#__PURE__*/function () {
177
177
  fieldSchemaInfo.type = 'string';
178
178
  fieldSchemaInfo.format = 'date';
179
179
  }
180
- fieldSchemaInfo.description += "\u9ED8\u8BA4\u65F6\u95F4\uFF1A".concat(((_componentElement$pro = componentElement.props.defaultTime) === null || _componentElement$pro === void 0 ? void 0 : _componentElement$pro.toString()) || '', "; \u683C\u5F0F\uFF1A").concat(componentElement.props.format || '', " ");
180
+ var defaultTime = ((_componentElement$pro = componentElement.props.defaultTime) === null || _componentElement$pro === void 0 ? void 0 : _componentElement$pro.toString()) || '';
181
+ if (defaultTime) {
182
+ fieldSchemaInfo.description += "\u9ED8\u8BA4\u65F6\u95F4\uFF1A".concat(defaultTime, " ");
183
+ }
184
+ var dateformat = componentElement.props.format || '';
185
+ if (!dateformat) {
186
+ switch (componentElement.props.type) {
187
+ case 'date':
188
+ dateformat = 'YYYY-MM-DD';
189
+ break;
190
+ case 'time':
191
+ dateformat = 'HH:mm:ss';
192
+ break;
193
+ case 'datetime':
194
+ dateformat = 'YYYY-MM-DD HH:mm:ss';
195
+ break;
196
+ case 'week':
197
+ dateformat = 'GGGG WW';
198
+ break;
199
+ case 'month':
200
+ dateformat = 'YYYY-MM';
201
+ break;
202
+ case 'quarter':
203
+ dateformat = 'YYYY-\[Q]Q';
204
+ break;
205
+ case 'year':
206
+ dateformat = 'YYYY';
207
+ break;
208
+ default:
209
+ dateformat = 'YYYY-MM-DD';
210
+ break;
211
+ }
212
+ }
213
+ fieldSchemaInfo.description += "\u683C\u5F0F\uFF1A".concat(dateformat, " ");
214
+ if (componentElement.props.max) {
215
+ fieldSchemaInfo.description += "\u6700\u5927\u65F6\u95F4\uFF1A".concat(componentElement.props.max, " ");
216
+ }
217
+ if (componentElement.props.min) {
218
+ fieldSchemaInfo.description += "\u6700\u5C0F\u65F6\u95F4\uFF1A".concat(componentElement.props.min, " ");
219
+ }
181
220
  break;
182
221
  case 'ShineoutCheckbox':
183
222
  case 'ShineoutCheckboxGroup':
@@ -3,7 +3,7 @@ import { ObjectType } from '../../common/type';
3
3
  declare const useInput: (params: BaseInputProps) => {
4
4
  focused: boolean;
5
5
  disabled: boolean | undefined;
6
- showClear: string | boolean | undefined;
6
+ showClear: boolean | undefined;
7
7
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => UseInputRootSlotProps<TOther>;
8
8
  getInputProps: <TOther_1 extends ObjectType = ObjectType>(externalProps?: TOther_1) => UseInputSlotProps<TOther_1>;
9
9
  getClearProps: <TOther_2 extends ObjectType = ObjectType>(externalProps?: TOther_2) => UseInputClearProps<TOther_2>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _useForkRef = _interopRequireDefault(require("../../common/use-fork-ref"));
9
9
  var React = _interopRequireWildcard(require("react"));
10
+ var _ = require("../..");
10
11
  var _utils = require("../../utils");
11
12
  var _excluded = ["inputRef", "rootRef", "value", "onChange", "onFocus", "onBlur", "clearable", "disabled", "autoSelect", "onClear", "onClick", "showClear", "onFocusedChange"];
12
13
  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); }
@@ -154,7 +155,7 @@ var useInput = function useInput(params) {
154
155
  onMouseDown: handleClear(externalEventHandlers)
155
156
  });
156
157
  };
157
- var showClearValue = showClear !== undefined ? !!showClear : clearable && value;
158
+ var showClearValue = showClear !== undefined ? !!showClear : clearable && !_.util.isEmpty(value);
158
159
  return {
159
160
  focused: focused,
160
161
  disabled: disabled,
@@ -1 +1 @@
1
- {"version":3,"file":"form-schema-builder.d.ts","sourceRoot":"","sources":["form-schema-builder.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG;QAAE,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG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AAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,GAAG,IAAI;IAMtE;;OAEG;IACH,wBAAwB,CAAC,MAAM,EAAE;QAC/B,gBAAgB,EAAE,GAAG,CAAC;QACtB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,UAAU;IAgPd,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAuCzC,WAAW,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAkB1F,kBAAkB,CAAC,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IAetG,oBAAoB,CAAC,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI;IA0B9H,cAAc,CAAC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI;IAwB7F,aAAa,IAAI,cAAc;CAGhC"}
@@ -171,7 +171,46 @@ export var SchemaBuilder = /*#__PURE__*/function () {
171
171
  fieldSchemaInfo.type = 'string';
172
172
  fieldSchemaInfo.format = 'date';
173
173
  }
174
- fieldSchemaInfo.description += "\u9ED8\u8BA4\u65F6\u95F4\uFF1A".concat(((_componentElement$pro = componentElement.props.defaultTime) === null || _componentElement$pro === void 0 ? void 0 : _componentElement$pro.toString()) || '', "; \u683C\u5F0F\uFF1A").concat(componentElement.props.format || '', " ");
174
+ var defaultTime = ((_componentElement$pro = componentElement.props.defaultTime) === null || _componentElement$pro === void 0 ? void 0 : _componentElement$pro.toString()) || '';
175
+ if (defaultTime) {
176
+ fieldSchemaInfo.description += "\u9ED8\u8BA4\u65F6\u95F4\uFF1A".concat(defaultTime, " ");
177
+ }
178
+ var dateformat = componentElement.props.format || '';
179
+ if (!dateformat) {
180
+ switch (componentElement.props.type) {
181
+ case 'date':
182
+ dateformat = 'YYYY-MM-DD';
183
+ break;
184
+ case 'time':
185
+ dateformat = 'HH:mm:ss';
186
+ break;
187
+ case 'datetime':
188
+ dateformat = 'YYYY-MM-DD HH:mm:ss';
189
+ break;
190
+ case 'week':
191
+ dateformat = 'GGGG WW';
192
+ break;
193
+ case 'month':
194
+ dateformat = 'YYYY-MM';
195
+ break;
196
+ case 'quarter':
197
+ dateformat = 'YYYY-\[Q]Q';
198
+ break;
199
+ case 'year':
200
+ dateformat = 'YYYY';
201
+ break;
202
+ default:
203
+ dateformat = 'YYYY-MM-DD';
204
+ break;
205
+ }
206
+ }
207
+ fieldSchemaInfo.description += "\u683C\u5F0F\uFF1A".concat(dateformat, " ");
208
+ if (componentElement.props.max) {
209
+ fieldSchemaInfo.description += "\u6700\u5927\u65F6\u95F4\uFF1A".concat(componentElement.props.max, " ");
210
+ }
211
+ if (componentElement.props.min) {
212
+ fieldSchemaInfo.description += "\u6700\u5C0F\u65F6\u95F4\uFF1A".concat(componentElement.props.min, " ");
213
+ }
175
214
  break;
176
215
  case 'ShineoutCheckbox':
177
216
  case 'ShineoutCheckboxGroup':
@@ -3,7 +3,7 @@ import { ObjectType } from '../../common/type';
3
3
  declare const useInput: (params: BaseInputProps) => {
4
4
  focused: boolean;
5
5
  disabled: boolean | undefined;
6
- showClear: string | boolean | undefined;
6
+ showClear: boolean | undefined;
7
7
  getRootProps: <TOther extends ObjectType = ObjectType>(externalProps?: TOther) => UseInputRootSlotProps<TOther>;
8
8
  getInputProps: <TOther_1 extends ObjectType = ObjectType>(externalProps?: TOther_1) => UseInputSlotProps<TOther_1>;
9
9
  getClearProps: <TOther_2 extends ObjectType = ObjectType>(externalProps?: TOther_2) => UseInputClearProps<TOther_2>;
@@ -1 +1 @@
1
- {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"use-input.d.ts","sourceRoot":"","sources":["use-input.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa5D,QAAA,MAAM,QAAQ,WAAY,cAAc;;;;;;;CA4IvC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -15,6 +15,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
16
  import useForkRef from "../../common/use-fork-ref";
17
17
  import * as React from 'react';
18
+ import { util } from "../..";
18
19
  import { extractEventHandlers } from "../../utils";
19
20
  /*
20
21
  数据:
@@ -145,7 +146,7 @@ var useInput = function useInput(params) {
145
146
  onMouseDown: handleClear(externalEventHandlers)
146
147
  });
147
148
  };
148
- var showClearValue = showClear !== undefined ? !!showClear : clearable && value;
149
+ var showClearValue = showClear !== undefined ? !!showClear : clearable && !util.isEmpty(value);
149
150
  return {
150
151
  focused: focused,
151
152
  disabled: disabled,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/hooks",
3
- "version": "3.8.3-beta.6",
3
+ "version": "3.8.3-beta.8",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",