@ebscn/ui 1.0.3-beta.0 → 1.0.3-beta.2
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/common-input/common-input.css +28 -0
- package/cjs/components/common-input/common-input.d.ts +27 -0
- package/cjs/components/common-input/common-input.js +88 -0
- package/cjs/components/common-input/index.d.ts +4 -0
- package/cjs/components/common-input/index.js +9 -0
- package/cjs/components/fene-input/fene-input.css +35 -0
- package/cjs/components/fene-input/fene-input.d.ts +14 -0
- package/cjs/components/fene-input/fene-input.js +63 -0
- package/cjs/components/fene-input/index.d.ts +4 -0
- package/cjs/components/fene-input/index.js +9 -0
- package/cjs/components/input/index.d.ts +4 -0
- package/cjs/components/input/index.js +9 -0
- package/cjs/components/input/input.css +96 -0
- package/cjs/components/input/input.d.ts +41 -0
- package/cjs/components/input/input.js +161 -0
- package/cjs/components/marketTag/marketTag.css +4 -4
- package/cjs/components/money-input/index.d.ts +4 -0
- package/cjs/components/money-input/index.js +9 -0
- package/cjs/components/money-input/money-input.css +35 -0
- package/cjs/components/money-input/money-input.d.ts +27 -0
- package/cjs/components/money-input/money-input.js +111 -0
- package/cjs/components/passcode-input/index.d.ts +4 -0
- package/cjs/components/passcode-input/index.js +9 -0
- package/cjs/components/passcode-input/passcode-input.css +136 -0
- package/cjs/components/passcode-input/passcode-input.d.ts +40 -0
- package/cjs/components/passcode-input/passcode-input.js +136 -0
- package/cjs/components/pay-input/index.d.ts +4 -0
- package/cjs/components/pay-input/index.js +10 -0
- package/cjs/components/pay-input/pay-input.css +136 -0
- package/cjs/components/pay-input/pay-input.d.ts +14 -0
- package/cjs/components/pay-input/pay-input.js +126 -0
- package/cjs/components/virtual-input/index.d.ts +4 -0
- package/cjs/components/virtual-input/index.js +9 -0
- package/cjs/components/virtual-input/virtual-input.css +99 -0
- package/cjs/components/virtual-input/virtual-input.d.ts +45 -0
- package/cjs/components/virtual-input/virtual-input.js +145 -0
- package/cjs/index.d.ts +5 -1
- package/cjs/index.js +37 -5
- package/es/components/common-input/common-input.css +28 -0
- package/es/components/common-input/common-input.d.ts +27 -0
- package/es/components/common-input/common-input.js +80 -0
- package/es/components/common-input/index.d.ts +4 -0
- package/es/components/common-input/index.js +3 -0
- package/es/components/fene-input/fene-input.css +35 -0
- package/es/components/fene-input/fene-input.d.ts +14 -0
- package/es/components/fene-input/fene-input.js +56 -0
- package/es/components/fene-input/index.d.ts +4 -0
- package/es/components/fene-input/index.js +3 -0
- package/es/components/input/index.d.ts +4 -0
- package/es/components/input/index.js +3 -0
- package/es/components/input/input.css +96 -0
- package/es/components/input/input.d.ts +41 -0
- package/es/components/input/input.js +152 -0
- package/es/components/marketTag/marketTag.css +4 -4
- package/es/components/money-input/index.d.ts +4 -0
- package/es/components/money-input/index.js +3 -0
- package/es/components/money-input/money-input.css +35 -0
- package/es/components/money-input/money-input.d.ts +27 -0
- package/es/components/money-input/money-input.js +103 -0
- package/es/components/passcode-input/index.d.ts +4 -0
- package/es/components/passcode-input/index.js +3 -0
- package/es/components/passcode-input/passcode-input.css +136 -0
- package/es/components/passcode-input/passcode-input.d.ts +40 -0
- package/es/components/passcode-input/passcode-input.js +127 -0
- package/es/components/pay-input/index.d.ts +4 -0
- package/es/components/pay-input/index.js +3 -0
- package/es/components/pay-input/pay-input.css +136 -0
- package/es/components/pay-input/pay-input.d.ts +14 -0
- package/es/components/pay-input/pay-input.js +115 -0
- package/es/components/virtual-input/index.d.ts +4 -0
- package/es/components/virtual-input/index.js +3 -0
- package/es/components/virtual-input/virtual-input.css +99 -0
- package/es/components/virtual-input/virtual-input.d.ts +45 -0
- package/es/components/virtual-input/virtual-input.js +134 -0
- package/es/index.d.ts +5 -1
- package/es/index.js +7 -2
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.ebscn-Common-input {
|
|
2
|
+
height: 170.5px;
|
|
3
|
+
background: #ffffff;
|
|
4
|
+
padding: 13.5px 16px 13.5px 16px;
|
|
5
|
+
}
|
|
6
|
+
.ebscn-Common-input-middleArea {
|
|
7
|
+
border-bottom: 1px solid ;
|
|
8
|
+
}
|
|
9
|
+
.ebscn-Common-input-middleArea-inputArea {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
.ebscn-Common-input-middleArea-unitBox {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
margin-left: 45px;
|
|
18
|
+
}
|
|
19
|
+
.ebscn-Common-input-middleArea-unitBox-unit {
|
|
20
|
+
height: 15px;
|
|
21
|
+
font-size: 11px;
|
|
22
|
+
font-weight: 400;
|
|
23
|
+
color: #999999;
|
|
24
|
+
}
|
|
25
|
+
.ebscn-Common-input-middleArea-unitBox-line {
|
|
26
|
+
width: 0.5px;
|
|
27
|
+
height: 15px;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import { InputProps } from "../input";
|
|
4
|
+
type tipProps = {
|
|
5
|
+
isShowTip: boolean;
|
|
6
|
+
tipComponent: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type unitProps = {
|
|
9
|
+
isShowUnit: boolean;
|
|
10
|
+
unitComponent: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type CommonInputProps = {
|
|
13
|
+
value?: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onChange?: (val: string) => void;
|
|
16
|
+
isShowUnit?: boolean;
|
|
17
|
+
isShowLine: boolean;
|
|
18
|
+
tipProps?: tipProps;
|
|
19
|
+
unitProps?: unitProps;
|
|
20
|
+
clearable: boolean;
|
|
21
|
+
inputProps?: InputProps;
|
|
22
|
+
inputleftComponent?: React.ReactNode;
|
|
23
|
+
prefixComponent?: React.ReactNode;
|
|
24
|
+
suffixComponent?: React.ReactNode;
|
|
25
|
+
} & NativeProps;
|
|
26
|
+
export declare function CommonInput(p: CommonInputProps): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CommonInput = CommonInput;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _nativeProps = require("../../utils/native-props");
|
|
9
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
10
|
+
var _tip = _interopRequireDefault(require("./demos/component/tip"));
|
|
11
|
+
var _usePropsValue = require("@ebscn/ui/utils/use-props-value");
|
|
12
|
+
var _input = _interopRequireDefault(require("../input"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
17
|
+
__assign = Object.assign || function (t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var classPrefix = 'ebscn-Common-input';
|
|
27
|
+
var defaultProps = {
|
|
28
|
+
// inputleftComponent: <InputLeft></InputLeft>,
|
|
29
|
+
tipComponent: _react.default.createElement(_tip.default, null),
|
|
30
|
+
defaultValue: ''
|
|
31
|
+
};
|
|
32
|
+
function CommonInput(p) {
|
|
33
|
+
var _a, _b, _c;
|
|
34
|
+
var props = (0, _withDefaultProps.mergeProps)(p, defaultProps);
|
|
35
|
+
var _d = (0, _usePropsValue.usePropsValue)(props),
|
|
36
|
+
value = _d[0],
|
|
37
|
+
setValue = _d[1];
|
|
38
|
+
var _e = (0, _react.useState)('#ebebeb'),
|
|
39
|
+
color = _e[0],
|
|
40
|
+
setColor = _e[1];
|
|
41
|
+
var _f = (0, _react.useState)(false),
|
|
42
|
+
showTip = _f[0],
|
|
43
|
+
setShowTip = _f[1];
|
|
44
|
+
var _g = (0, _react.useState)(true),
|
|
45
|
+
clearable = _g[0],
|
|
46
|
+
setClearable = _g[1];
|
|
47
|
+
console.log(p, 'CommonProp');
|
|
48
|
+
function changeColor(isShowLine, color) {
|
|
49
|
+
if (isShowLine) {
|
|
50
|
+
setColor(color);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// const {titleLeftComponent,inputProps,} = props
|
|
54
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
55
|
+
className: "".concat(classPrefix)
|
|
56
|
+
}, _react.default.createElement("div", {
|
|
57
|
+
className: "".concat(classPrefix, "-middleArea"),
|
|
58
|
+
style: {
|
|
59
|
+
'borderBottomColor': "".concat(((_a = props.tipProps) === null || _a === void 0 ? void 0 : _a.isShowTip) ? 'red' : color)
|
|
60
|
+
}
|
|
61
|
+
}, _react.default.createElement("div", {
|
|
62
|
+
className: "".concat(classPrefix, "-middleArea-inputArea")
|
|
63
|
+
}, props.prefixComponent, props.inputleftComponent, _react.default.createElement(_input.default, __assign({
|
|
64
|
+
onFocus: function () {
|
|
65
|
+
changeColor(props.isShowLine, 'blue');
|
|
66
|
+
},
|
|
67
|
+
onBlur: function () {
|
|
68
|
+
changeColor(props.isShowLine, '#ebebeb');
|
|
69
|
+
},
|
|
70
|
+
value: value
|
|
71
|
+
}, props.inputProps, {
|
|
72
|
+
onChange: function (val) {
|
|
73
|
+
var _a;
|
|
74
|
+
console.log((_a = props.tipProps) === null || _a === void 0 ? void 0 : _a.isShowTip, 'isShowTIP');
|
|
75
|
+
// props.tipProps?.isShowTip ? setColor('red') : setColor('blue')
|
|
76
|
+
setValue(val);
|
|
77
|
+
},
|
|
78
|
+
clearable: true
|
|
79
|
+
})), props.suffixComponent), ((_b = props.unitProps) === null || _b === void 0 ? void 0 : _b.isShowUnit) ? _react.default.createElement("div", {
|
|
80
|
+
className: "".concat(classPrefix, "-middleArea-unitBox")
|
|
81
|
+
}, _react.default.createElement("div", {
|
|
82
|
+
className: "".concat(classPrefix, "-middleArea-unitBox-line")
|
|
83
|
+
}), _react.default.createElement("div", {
|
|
84
|
+
className: "".concat(classPrefix, "-middleArea-unitBox-unit")
|
|
85
|
+
}, props.unitProps.unitComponent)) : _react.default.createElement(_react.default.Fragment, null)), ((_c = props.tipProps) === null || _c === void 0 ? void 0 : _c.isShowTip) ? _react.default.createElement("div", {
|
|
86
|
+
className: "".concat(classPrefix, "-tipArea")
|
|
87
|
+
}, props.tipProps.tipComponent) : _react.default.createElement(_react.default.Fragment, null)));
|
|
88
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ebscn-fene-input {
|
|
2
|
+
height: 170.5px;
|
|
3
|
+
background: #ffffff;
|
|
4
|
+
padding: 13.5px 16px 13.5px 16px;
|
|
5
|
+
}
|
|
6
|
+
.ebscn-fene-input-topArea {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
margin-bottom: 23.66px;
|
|
11
|
+
}
|
|
12
|
+
.ebscn-fene-input-middleArea {
|
|
13
|
+
border-bottom: 1px solid #ebebeb;
|
|
14
|
+
}
|
|
15
|
+
.ebscn-fene-input-middleArea-inputArea {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.ebscn-fene-input-middleArea-unitBox {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
margin-left: 45px;
|
|
24
|
+
}
|
|
25
|
+
.ebscn-fene-input-middleArea-unitBox-unit {
|
|
26
|
+
height: 15px;
|
|
27
|
+
font-size: 11px;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
color: #999999;
|
|
30
|
+
}
|
|
31
|
+
.ebscn-fene-input-middleArea-unitBox-line {
|
|
32
|
+
width: 0.5px;
|
|
33
|
+
height: 15px;
|
|
34
|
+
border: 1px dashed #ebebeb;
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import { InputProps } from "../input";
|
|
4
|
+
export type FeneInputProps = {
|
|
5
|
+
titleLeftComponent?: React.ReactNode;
|
|
6
|
+
titleRightComponent?: React.ReactNode;
|
|
7
|
+
inputProps?: InputProps;
|
|
8
|
+
inputleftComponent?: React.ReactNode;
|
|
9
|
+
inputrightComponent?: React.ReactNode;
|
|
10
|
+
tipComponent?: React.ReactNode;
|
|
11
|
+
contentComponent?: React.ReactNode;
|
|
12
|
+
footerComponent?: React.ReactNode;
|
|
13
|
+
} & NativeProps;
|
|
14
|
+
export declare function FeneInput(p: FeneInputProps): JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FeneInput = FeneInput;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _nativeProps = require("../../utils/native-props");
|
|
9
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
10
|
+
var _titleLeft = _interopRequireDefault(require("./demos/component/title-left"));
|
|
11
|
+
var _titleRight = _interopRequireDefault(require("./demos/component/title-right"));
|
|
12
|
+
var _inputLeft = _interopRequireDefault(require("./demos/component/input-left"));
|
|
13
|
+
var _inputRight = _interopRequireDefault(require("./demos/component/input-right"));
|
|
14
|
+
var _tip = _interopRequireDefault(require("./demos/component/tip"));
|
|
15
|
+
var _footer = _interopRequireDefault(require("./demos/component/footer"));
|
|
16
|
+
var _input = _interopRequireDefault(require("../input"));
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
19
|
+
__assign = Object.assign || function (t) {
|
|
20
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
21
|
+
s = arguments[i];
|
|
22
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var classPrefix = 'ebscn-fene-input';
|
|
29
|
+
var defaultProps = {
|
|
30
|
+
titleLeftComponent: _react.default.createElement(_titleLeft.default, null),
|
|
31
|
+
titleRightComponent: _react.default.createElement(_titleRight.default, null),
|
|
32
|
+
inputleftComponent: _react.default.createElement(_inputLeft.default, null),
|
|
33
|
+
inputrightComponent: _react.default.createElement(_inputRight.default, null),
|
|
34
|
+
tipComponent: _react.default.createElement(_tip.default, null),
|
|
35
|
+
// contentComponent: <Content></Content>,
|
|
36
|
+
footerComponent: _react.default.createElement(_footer.default, null)
|
|
37
|
+
};
|
|
38
|
+
function FeneInput(p) {
|
|
39
|
+
var props = (0, _withDefaultProps.mergeProps)(p, defaultProps);
|
|
40
|
+
console.log(p, 'FeneProp');
|
|
41
|
+
// const {titleLeftComponent,inputProps,} = props
|
|
42
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
43
|
+
className: "".concat(classPrefix)
|
|
44
|
+
}, _react.default.createElement("div", {
|
|
45
|
+
className: "".concat(classPrefix, "-topArea")
|
|
46
|
+
}, props.titleLeftComponent, props.titleRightComponent), _react.default.createElement("div", {
|
|
47
|
+
className: "".concat(classPrefix, "-middleArea")
|
|
48
|
+
}, _react.default.createElement("div", {
|
|
49
|
+
className: "".concat(classPrefix, "-middleArea-inputArea")
|
|
50
|
+
}, props.inputleftComponent, _react.default.createElement(_input.default, __assign({}, props.inputProps, {
|
|
51
|
+
clearable: true
|
|
52
|
+
})), props.inputrightComponent), _react.default.createElement("div", {
|
|
53
|
+
className: "".concat(classPrefix, "-middleArea-unitBox")
|
|
54
|
+
}, _react.default.createElement("div", {
|
|
55
|
+
className: "".concat(classPrefix, "-middleArea-unitBox-line")
|
|
56
|
+
}))), _react.default.createElement("div", {
|
|
57
|
+
className: "".concat(classPrefix, "-tipArea")
|
|
58
|
+
}, props.tipComponent), _react.default.createElement("div", {
|
|
59
|
+
className: "".concat(classPrefix, "-contentArea")
|
|
60
|
+
}, props.contentComponent), _react.default.createElement("div", {
|
|
61
|
+
className: "".concat(classPrefix, "-bottomArea")
|
|
62
|
+
}, props.footerComponent)));
|
|
63
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
.adm-input {
|
|
2
|
+
--font-size: var(--adm-font-size-9);
|
|
3
|
+
--color: var(--adm-color-text);
|
|
4
|
+
--placeholder-color: var(--adm-color-light);
|
|
5
|
+
--text-align: left;
|
|
6
|
+
--background-color: transparent;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: flex-start;
|
|
9
|
+
align-items: center;
|
|
10
|
+
width: 100%;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
max-height: 100%;
|
|
13
|
+
min-height: 24px;
|
|
14
|
+
background-color: var(--background-color);
|
|
15
|
+
}
|
|
16
|
+
.adm-input-disabled {
|
|
17
|
+
opacity: 0.4;
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
}
|
|
20
|
+
.adm-input-element {
|
|
21
|
+
flex: auto;
|
|
22
|
+
display: inline-block;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
width: 100%;
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
max-height: 100%;
|
|
27
|
+
padding: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
color: var(--color);
|
|
30
|
+
font-size: var(--font-size);
|
|
31
|
+
line-height: 1.5;
|
|
32
|
+
background: transparent;
|
|
33
|
+
border: 0;
|
|
34
|
+
outline: none;
|
|
35
|
+
-webkit-appearance: none;
|
|
36
|
+
appearance: none;
|
|
37
|
+
min-height: 1.5em;
|
|
38
|
+
text-align: var(--text-align);
|
|
39
|
+
}
|
|
40
|
+
.adm-input-element::-webkit-input-placeholder {
|
|
41
|
+
color: var(--placeholder-color);
|
|
42
|
+
font-family: inherit;
|
|
43
|
+
}
|
|
44
|
+
.adm-input-element::placeholder {
|
|
45
|
+
color: var(--placeholder-color);
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
}
|
|
48
|
+
.adm-input-element:-webkit-autofill {
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
}
|
|
51
|
+
.adm-input-element:read-only {
|
|
52
|
+
cursor: default;
|
|
53
|
+
}
|
|
54
|
+
.adm-input-element:invalid {
|
|
55
|
+
box-shadow: none;
|
|
56
|
+
}
|
|
57
|
+
.adm-input-element::-ms-clear {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
.adm-input-element::-ms-reveal {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
.adm-input-element::-webkit-search-cancel-button {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
.adm-input-element::-webkit-search-decoration {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
.adm-input-element:disabled {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
.adm-input-element[type='date'],
|
|
73
|
+
.adm-input-element[type='time'],
|
|
74
|
+
.adm-input-element[type='datetime-local'] {
|
|
75
|
+
min-height: 1.5em;
|
|
76
|
+
}
|
|
77
|
+
.adm-input-element[type='search'] {
|
|
78
|
+
-webkit-appearance: none;
|
|
79
|
+
}
|
|
80
|
+
.adm-input-element[readonly] {
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
.adm-input-clear {
|
|
84
|
+
flex: none;
|
|
85
|
+
margin-left: 8px;
|
|
86
|
+
color: var(--adm-color-light);
|
|
87
|
+
padding: 4px;
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
}
|
|
90
|
+
.adm-input-clear:active {
|
|
91
|
+
color: var(--adm-color-weak);
|
|
92
|
+
}
|
|
93
|
+
.adm-input-clear .antd-mobile-icon {
|
|
94
|
+
display: block;
|
|
95
|
+
font-size: var(--adm-font-size-7);
|
|
96
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
4
|
+
type AriaProps = {
|
|
5
|
+
role?: string;
|
|
6
|
+
};
|
|
7
|
+
export type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step' | 'id' | 'placeholder' | 'readOnly' | 'disabled'> & {
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onChange?: (val: string) => void;
|
|
11
|
+
clearable?: boolean;
|
|
12
|
+
onlyShowClearWhenFocus?: boolean;
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
|
+
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'> & AriaProps;
|
|
19
|
+
export type InputRef = {
|
|
20
|
+
clear: () => void;
|
|
21
|
+
focus: () => void;
|
|
22
|
+
blur: () => void;
|
|
23
|
+
nativeElement: HTMLInputElement | null;
|
|
24
|
+
};
|
|
25
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "onClick" | "disabled" | "name" | "type" | "id" | "autoFocus" | "autoCapitalize" | "autoCorrect" | "inputMode" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "pattern" | "autoComplete" | "maxLength" | "minLength" | "placeholder" | "readOnly" | "step"> & {
|
|
26
|
+
value?: string | undefined;
|
|
27
|
+
defaultValue?: string | undefined;
|
|
28
|
+
onChange?: ((val: string) => void) | undefined;
|
|
29
|
+
clearable?: boolean | undefined;
|
|
30
|
+
onlyShowClearWhenFocus?: boolean | undefined;
|
|
31
|
+
onClear?: (() => void) | undefined;
|
|
32
|
+
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
33
|
+
enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
|
|
34
|
+
min?: number | undefined;
|
|
35
|
+
max?: number | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
39
|
+
tabIndex?: number | undefined;
|
|
40
|
+
} & React.AriaAttributes & AriaProps & React.RefAttributes<InputRef>>;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Input = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _usePropsValue = require("../../utils/use-props-value");
|
|
9
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _ahooks = require("ahooks");
|
|
14
|
+
var _bound = require("../../utils/bound");
|
|
15
|
+
var _validate = require("../../utils/validate");
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
var classPrefix = "adm-input";
|
|
20
|
+
var defaultProps = {
|
|
21
|
+
defaultValue: '',
|
|
22
|
+
onlyShowClearWhenFocus: true
|
|
23
|
+
};
|
|
24
|
+
var Input = exports.Input = (0, _react.forwardRef)(function (p, ref) {
|
|
25
|
+
var props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
26
|
+
var _a = (0, _usePropsValue.usePropsValue)(props),
|
|
27
|
+
value = _a[0],
|
|
28
|
+
setValue = _a[1];
|
|
29
|
+
var _b = (0, _react.useState)(false),
|
|
30
|
+
hasFocus = _b[0],
|
|
31
|
+
setHasFocus = _b[1];
|
|
32
|
+
var compositionStartRef = (0, _react.useRef)(false);
|
|
33
|
+
var nativeInputRef = (0, _react.useRef)(null);
|
|
34
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
35
|
+
return {
|
|
36
|
+
clear: function () {
|
|
37
|
+
setValue('');
|
|
38
|
+
},
|
|
39
|
+
focus: function () {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
42
|
+
},
|
|
43
|
+
blur: function () {
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
46
|
+
},
|
|
47
|
+
get nativeElement() {
|
|
48
|
+
return nativeInputRef.current;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
var handleKeydown = function (e) {
|
|
53
|
+
var _a;
|
|
54
|
+
if (props.onEnterPress && (e.code === 'Enter' || e.keyCode === 13)) {
|
|
55
|
+
props.onEnterPress(e);
|
|
56
|
+
}
|
|
57
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
58
|
+
};
|
|
59
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(function () {
|
|
60
|
+
var _a;
|
|
61
|
+
if (!props.enterKeyHint) return;
|
|
62
|
+
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute('enterkeyhint', props.enterKeyHint);
|
|
63
|
+
return function () {
|
|
64
|
+
var _a;
|
|
65
|
+
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.removeAttribute('enterkeyhint');
|
|
66
|
+
};
|
|
67
|
+
}, [props.enterKeyHint]);
|
|
68
|
+
function checkValue() {
|
|
69
|
+
var nextValue = value;
|
|
70
|
+
if (props.type === 'number') {
|
|
71
|
+
var boundValue = nextValue && (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
|
|
72
|
+
// fix the display issue of numbers starting with 0
|
|
73
|
+
if (Number(nextValue) !== Number(boundValue)) {
|
|
74
|
+
nextValue = boundValue;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (nextValue !== value) {
|
|
78
|
+
setValue(nextValue);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
var shouldShowClear = function () {
|
|
82
|
+
if (!props.clearable || !value || props.readOnly) return false;
|
|
83
|
+
if (props.onlyShowClearWhenFocus) {
|
|
84
|
+
return hasFocus;
|
|
85
|
+
} else {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}();
|
|
89
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
90
|
+
className: (0, _classnames.default)("".concat(classPrefix), props.disabled && "".concat(classPrefix, "-disabled"))
|
|
91
|
+
}, _react.default.createElement("input", {
|
|
92
|
+
ref: nativeInputRef,
|
|
93
|
+
className: "".concat(classPrefix, "-element"),
|
|
94
|
+
value: value,
|
|
95
|
+
onChange: function (e) {
|
|
96
|
+
setValue(e.target.value);
|
|
97
|
+
},
|
|
98
|
+
onFocus: function (e) {
|
|
99
|
+
var _a;
|
|
100
|
+
setHasFocus(true);
|
|
101
|
+
console.log(e, 'e');
|
|
102
|
+
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
103
|
+
},
|
|
104
|
+
onBlur: function (e) {
|
|
105
|
+
var _a;
|
|
106
|
+
setHasFocus(false);
|
|
107
|
+
checkValue();
|
|
108
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
109
|
+
},
|
|
110
|
+
id: props.id,
|
|
111
|
+
placeholder: props.placeholder,
|
|
112
|
+
disabled: props.disabled,
|
|
113
|
+
readOnly: props.readOnly,
|
|
114
|
+
maxLength: props.maxLength,
|
|
115
|
+
minLength: props.minLength,
|
|
116
|
+
max: props.max,
|
|
117
|
+
min: props.min,
|
|
118
|
+
autoComplete: props.autoComplete,
|
|
119
|
+
autoFocus: props.autoFocus,
|
|
120
|
+
pattern: props.pattern,
|
|
121
|
+
inputMode: props.inputMode,
|
|
122
|
+
type: props.type,
|
|
123
|
+
name: props.name,
|
|
124
|
+
autoCapitalize: props.autoCapitalize,
|
|
125
|
+
autoCorrect: props.autoCorrect,
|
|
126
|
+
onKeyDown: handleKeydown,
|
|
127
|
+
onKeyUp: props.onKeyUp,
|
|
128
|
+
onCompositionStart: function (e) {
|
|
129
|
+
var _a;
|
|
130
|
+
compositionStartRef.current = true;
|
|
131
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
132
|
+
},
|
|
133
|
+
onCompositionEnd: function (e) {
|
|
134
|
+
var _a;
|
|
135
|
+
compositionStartRef.current = false;
|
|
136
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
137
|
+
},
|
|
138
|
+
onClick: props.onClick,
|
|
139
|
+
step: props.step,
|
|
140
|
+
role: props.role,
|
|
141
|
+
"aria-valuenow": props['aria-valuenow'],
|
|
142
|
+
"aria-valuemax": props['aria-valuemax'],
|
|
143
|
+
"aria-valuemin": props['aria-valuemin'],
|
|
144
|
+
"aria-label": props['aria-label']
|
|
145
|
+
}), shouldShowClear && _react.default.createElement("div", {
|
|
146
|
+
className: "".concat(classPrefix, "-clear"),
|
|
147
|
+
onMouseDown: function (e) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
},
|
|
150
|
+
onClick: function () {
|
|
151
|
+
var _a, _b;
|
|
152
|
+
setValue('');
|
|
153
|
+
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
154
|
+
// https://github.com/ant-design/ant-design-mobile/issues/5212
|
|
155
|
+
if ((0, _validate.isIOS)() && compositionStartRef.current) {
|
|
156
|
+
compositionStartRef.current = false;
|
|
157
|
+
(_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null))));
|
|
161
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.ebscn-marketTag {
|
|
2
|
-
padding: 0
|
|
3
|
-
font-size: var(--ebscn-font-size-
|
|
4
|
-
line-height:
|
|
5
|
-
height:
|
|
2
|
+
padding: 0 3px;
|
|
3
|
+
font-size: var(--ebscn-font-size-4);
|
|
4
|
+
line-height: 18px;
|
|
5
|
+
height: 18px;
|
|
6
6
|
font-weight: normal;
|
|
7
7
|
display: inline-block;
|
|
8
8
|
white-space: nowrap;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ebscn-money-input {
|
|
2
|
+
height: 170.5px;
|
|
3
|
+
background: #ffffff;
|
|
4
|
+
padding: 13.5px 16px 13.5px 16px;
|
|
5
|
+
}
|
|
6
|
+
.ebscn-money-input-topArea {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
margin-bottom: 23.66px;
|
|
11
|
+
}
|
|
12
|
+
.ebscn-money-input-middleArea {
|
|
13
|
+
border-bottom: 1px solid #ebebeb;
|
|
14
|
+
}
|
|
15
|
+
.ebscn-money-input-middleArea-inputArea {
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.ebscn-money-input-middleArea-unitBox {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
margin-left: 45px;
|
|
24
|
+
}
|
|
25
|
+
.ebscn-money-input-middleArea-unitBox-unit {
|
|
26
|
+
height: 15px;
|
|
27
|
+
font-size: 11px;
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
color: #999999;
|
|
30
|
+
}
|
|
31
|
+
.ebscn-money-input-middleArea-unitBox-line {
|
|
32
|
+
width: 0.5px;
|
|
33
|
+
height: 15px;
|
|
34
|
+
border: 1px dashed #ebebeb;
|
|
35
|
+
}
|