@sheinx/base 3.6.2-beta.1 → 3.6.2-beta.3
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/date-picker/date-picker.d.ts.map +1 -1
- package/cjs/date-picker/date-picker.js +9 -0
- package/cjs/input/input-group.js +5 -3
- package/cjs/input/input-group.type.d.ts +19 -6
- package/cjs/input/input-group.type.d.ts.map +1 -1
- package/esm/date-picker/date-picker.d.ts.map +1 -1
- package/esm/date-picker/date-picker.js +9 -0
- package/esm/input/input-group.js +5 -3
- package/esm/input/input-group.type.d.ts +19 -6
- package/esm/input/input-group.type.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["date-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB1E,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["date-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB1E,QAAA,MAAM,UAAU,gHAqVf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -202,6 +202,15 @@ var DatePicker = function DatePicker(props0) {
|
|
|
202
202
|
var _props$onBlur;
|
|
203
203
|
setFocused(false);
|
|
204
204
|
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
|
|
205
|
+
if (props.needConfirm) return;
|
|
206
|
+
|
|
207
|
+
// 当输入框有值时,失焦时需要立即触发 onChange,否则触控板的轻触模拟出来的click事件就获取不到最新的值
|
|
208
|
+
if (inputArr.some(function (d) {
|
|
209
|
+
return d !== undefined;
|
|
210
|
+
})) {
|
|
211
|
+
func.finishEdit();
|
|
212
|
+
}
|
|
213
|
+
;
|
|
205
214
|
});
|
|
206
215
|
var handleClose = function handleClose(isFromConfirm) {
|
|
207
216
|
setIsCloseFromConfirm(isFromConfirm || false);
|
package/cjs/input/input-group.js
CHANGED
|
@@ -82,10 +82,12 @@ var _default = exports.default = function _default(props) {
|
|
|
82
82
|
var children = props.children,
|
|
83
83
|
className = props.className,
|
|
84
84
|
width = props.width,
|
|
85
|
-
style = props.style
|
|
86
|
-
|
|
85
|
+
style = props.style,
|
|
86
|
+
_props$seperate = props.seperate,
|
|
87
|
+
seperate = _props$seperate === void 0 ? true : _props$seperate;
|
|
88
|
+
var rootClass = (0, _classnames.default)(className, inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.group, seperate && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSeperate), size === 'small' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSmall), size === 'large' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupLarge), !!disabled && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupDisabled), !!focus && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupFocus), (status === 'error' || error) && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupError));
|
|
87
89
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, _hooks.util.getDataAttribute({
|
|
88
|
-
role:
|
|
90
|
+
role: seperate ? 'input-group-seperate' : 'input-group'
|
|
89
91
|
})), {}, {
|
|
90
92
|
className: rootClass,
|
|
91
93
|
style: _objectSpread({
|
|
@@ -2,12 +2,26 @@ import * as React from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { InputStyle } from './input.type';
|
|
4
4
|
import { CommonType } from '../common/type';
|
|
5
|
-
export interface InputGroupProps {
|
|
6
|
-
|
|
5
|
+
export interface InputGroupProps extends Pick<CommonType, 'status' | 'style' | 'size'> {
|
|
6
|
+
/**
|
|
7
|
+
* @en Custom class name
|
|
8
|
+
* @cn 自定义类名
|
|
9
|
+
*/
|
|
7
10
|
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @en children
|
|
13
|
+
* @cn 子元素
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* @en width
|
|
18
|
+
* @cn 宽度
|
|
19
|
+
*/
|
|
8
20
|
width?: string | number;
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @cn 是否禁用 Input.Group 区域内容
|
|
23
|
+
* @en Whether to disable
|
|
24
|
+
*/
|
|
11
25
|
disabled?: boolean;
|
|
12
26
|
jssStyle: InputStyle;
|
|
13
27
|
/**
|
|
@@ -23,11 +37,10 @@ export interface InputGroupProps {
|
|
|
23
37
|
* @cn 失去焦点后的回调
|
|
24
38
|
*/
|
|
25
39
|
onBlur?: React.FocusEventHandler;
|
|
26
|
-
status?: CommonType['status'];
|
|
27
40
|
/**
|
|
28
41
|
* @en Whether to seperate the border
|
|
29
42
|
* @cn 是否分离边框
|
|
30
|
-
* @default
|
|
43
|
+
* @default true
|
|
31
44
|
*/
|
|
32
45
|
seperate?: boolean;
|
|
33
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.type.d.ts","sourceRoot":"","sources":["input-group.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"input-group.type.d.ts","sourceRoot":"","sources":["input-group.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACpF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["date-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB1E,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["date-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAmB1E,QAAA,MAAM,UAAU,gHAqVf,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -195,6 +195,15 @@ var DatePicker = function DatePicker(props0) {
|
|
|
195
195
|
var _props$onBlur;
|
|
196
196
|
setFocused(false);
|
|
197
197
|
(_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 || _props$onBlur.call(props, e);
|
|
198
|
+
if (props.needConfirm) return;
|
|
199
|
+
|
|
200
|
+
// 当输入框有值时,失焦时需要立即触发 onChange,否则触控板的轻触模拟出来的click事件就获取不到最新的值
|
|
201
|
+
if (inputArr.some(function (d) {
|
|
202
|
+
return d !== undefined;
|
|
203
|
+
})) {
|
|
204
|
+
func.finishEdit();
|
|
205
|
+
}
|
|
206
|
+
;
|
|
198
207
|
});
|
|
199
208
|
var handleClose = function handleClose(isFromConfirm) {
|
|
200
209
|
setIsCloseFromConfirm(isFromConfirm || false);
|
package/esm/input/input-group.js
CHANGED
|
@@ -74,10 +74,12 @@ export default (function (props) {
|
|
|
74
74
|
var children = props.children,
|
|
75
75
|
className = props.className,
|
|
76
76
|
width = props.width,
|
|
77
|
-
style = props.style
|
|
78
|
-
|
|
77
|
+
style = props.style,
|
|
78
|
+
_props$seperate = props.seperate,
|
|
79
|
+
seperate = _props$seperate === void 0 ? true : _props$seperate;
|
|
80
|
+
var rootClass = classNames(className, inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.group, seperate && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSeperate), size === 'small' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSmall), size === 'large' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupLarge), !!disabled && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupDisabled), !!focus && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupFocus), (status === 'error' || error) && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupError));
|
|
79
81
|
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, util.getDataAttribute({
|
|
80
|
-
role:
|
|
82
|
+
role: seperate ? 'input-group-seperate' : 'input-group'
|
|
81
83
|
})), {}, {
|
|
82
84
|
className: rootClass,
|
|
83
85
|
style: _objectSpread({
|
|
@@ -2,12 +2,26 @@ import * as React from 'react';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { InputStyle } from './input.type';
|
|
4
4
|
import { CommonType } from '../common/type';
|
|
5
|
-
export interface InputGroupProps {
|
|
6
|
-
|
|
5
|
+
export interface InputGroupProps extends Pick<CommonType, 'status' | 'style' | 'size'> {
|
|
6
|
+
/**
|
|
7
|
+
* @en Custom class name
|
|
8
|
+
* @cn 自定义类名
|
|
9
|
+
*/
|
|
7
10
|
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @en children
|
|
13
|
+
* @cn 子元素
|
|
14
|
+
*/
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* @en width
|
|
18
|
+
* @cn 宽度
|
|
19
|
+
*/
|
|
8
20
|
width?: string | number;
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @cn 是否禁用 Input.Group 区域内容
|
|
23
|
+
* @en Whether to disable
|
|
24
|
+
*/
|
|
11
25
|
disabled?: boolean;
|
|
12
26
|
jssStyle: InputStyle;
|
|
13
27
|
/**
|
|
@@ -23,11 +37,10 @@ export interface InputGroupProps {
|
|
|
23
37
|
* @cn 失去焦点后的回调
|
|
24
38
|
*/
|
|
25
39
|
onBlur?: React.FocusEventHandler;
|
|
26
|
-
status?: CommonType['status'];
|
|
27
40
|
/**
|
|
28
41
|
* @en Whether to seperate the border
|
|
29
42
|
* @cn 是否分离边框
|
|
30
|
-
* @default
|
|
43
|
+
* @default true
|
|
31
44
|
*/
|
|
32
45
|
seperate?: boolean;
|
|
33
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.type.d.ts","sourceRoot":"","sources":["input-group.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"input-group.type.d.ts","sourceRoot":"","sources":["input-group.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACpF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.6.2-beta.
|
|
3
|
+
"version": "3.6.2-beta.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"module": "./esm/index.js",
|
|
11
11
|
"typings": "./cjs/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sheinx/hooks": "3.6.2-beta.
|
|
13
|
+
"@sheinx/hooks": "3.6.2-beta.3",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|