@sheinx/hooks 3.8.3-beta.7 → 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.
- package/cjs/components/use-input/use-input.d.ts +1 -1
- package/cjs/components/use-input/use-input.d.ts.map +1 -1
- package/cjs/components/use-input/use-input.js +2 -1
- package/esm/components/use-input/use-input.d.ts +1 -1
- package/esm/components/use-input/use-input.d.ts.map +1 -1
- package/esm/components/use-input/use-input.js +2 -1
- package/package.json +1 -1
@@ -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:
|
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":"
|
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,
|
@@ -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:
|
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":"
|
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,
|