@ebscn/ui 1.0.3-beta.1 → 1.0.3-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.
Files changed (77) hide show
  1. package/cjs/components/common-input/common-input.css +28 -0
  2. package/cjs/components/common-input/common-input.d.ts +27 -0
  3. package/cjs/components/common-input/common-input.js +88 -0
  4. package/cjs/components/common-input/index.d.ts +4 -0
  5. package/cjs/components/common-input/index.js +9 -0
  6. package/cjs/components/fene-input/fene-input.css +35 -0
  7. package/cjs/components/fene-input/fene-input.d.ts +14 -0
  8. package/cjs/components/fene-input/fene-input.js +63 -0
  9. package/cjs/components/fene-input/index.d.ts +4 -0
  10. package/cjs/components/fene-input/index.js +9 -0
  11. package/cjs/components/input/index.d.ts +4 -0
  12. package/cjs/components/input/index.js +9 -0
  13. package/cjs/components/input/input.css +96 -0
  14. package/cjs/components/input/input.d.ts +41 -0
  15. package/cjs/components/input/input.js +161 -0
  16. package/cjs/components/marketTag/marketTag.css +4 -4
  17. package/cjs/components/money-input/index.d.ts +4 -0
  18. package/cjs/components/money-input/index.js +9 -0
  19. package/cjs/components/money-input/money-input.css +35 -0
  20. package/cjs/components/money-input/money-input.d.ts +27 -0
  21. package/cjs/components/money-input/money-input.js +111 -0
  22. package/cjs/components/passcode-input/index.d.ts +4 -0
  23. package/cjs/components/passcode-input/index.js +9 -0
  24. package/cjs/components/passcode-input/passcode-input.css +136 -0
  25. package/cjs/components/passcode-input/passcode-input.d.ts +40 -0
  26. package/cjs/components/passcode-input/passcode-input.js +136 -0
  27. package/cjs/components/pay-input/index.d.ts +4 -0
  28. package/cjs/components/pay-input/index.js +10 -0
  29. package/cjs/components/pay-input/pay-input.css +136 -0
  30. package/cjs/components/pay-input/pay-input.d.ts +14 -0
  31. package/cjs/components/pay-input/pay-input.js +126 -0
  32. package/cjs/components/virtual-input/index.d.ts +4 -0
  33. package/cjs/components/virtual-input/index.js +9 -0
  34. package/cjs/components/virtual-input/virtual-input.css +99 -0
  35. package/cjs/components/virtual-input/virtual-input.d.ts +45 -0
  36. package/cjs/components/virtual-input/virtual-input.js +145 -0
  37. package/cjs/index.d.ts +1 -0
  38. package/cjs/index.js +9 -1
  39. package/es/components/common-input/common-input.css +28 -0
  40. package/es/components/common-input/common-input.d.ts +27 -0
  41. package/es/components/common-input/common-input.js +80 -0
  42. package/es/components/common-input/index.d.ts +4 -0
  43. package/es/components/common-input/index.js +3 -0
  44. package/es/components/fene-input/fene-input.css +35 -0
  45. package/es/components/fene-input/fene-input.d.ts +14 -0
  46. package/es/components/fene-input/fene-input.js +56 -0
  47. package/es/components/fene-input/index.d.ts +4 -0
  48. package/es/components/fene-input/index.js +3 -0
  49. package/es/components/input/index.d.ts +4 -0
  50. package/es/components/input/index.js +3 -0
  51. package/es/components/input/input.css +96 -0
  52. package/es/components/input/input.d.ts +41 -0
  53. package/es/components/input/input.js +152 -0
  54. package/es/components/marketTag/marketTag.css +4 -4
  55. package/es/components/money-input/index.d.ts +4 -0
  56. package/es/components/money-input/index.js +3 -0
  57. package/es/components/money-input/money-input.css +35 -0
  58. package/es/components/money-input/money-input.d.ts +27 -0
  59. package/es/components/money-input/money-input.js +103 -0
  60. package/es/components/passcode-input/index.d.ts +4 -0
  61. package/es/components/passcode-input/index.js +3 -0
  62. package/es/components/passcode-input/passcode-input.css +136 -0
  63. package/es/components/passcode-input/passcode-input.d.ts +40 -0
  64. package/es/components/passcode-input/passcode-input.js +127 -0
  65. package/es/components/pay-input/index.d.ts +4 -0
  66. package/es/components/pay-input/index.js +3 -0
  67. package/es/components/pay-input/pay-input.css +136 -0
  68. package/es/components/pay-input/pay-input.d.ts +14 -0
  69. package/es/components/pay-input/pay-input.js +115 -0
  70. package/es/components/virtual-input/index.d.ts +4 -0
  71. package/es/components/virtual-input/index.js +3 -0
  72. package/es/components/virtual-input/virtual-input.css +99 -0
  73. package/es/components/virtual-input/virtual-input.d.ts +45 -0
  74. package/es/components/virtual-input/virtual-input.js +134 -0
  75. package/es/index.d.ts +1 -0
  76. package/es/index.js +6 -1
  77. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6
+ }
7
+ return t;
8
+ };
9
+ return __assign.apply(this, arguments);
10
+ };
11
+ import React from "react";
12
+ import { withNativeProps } from '../../utils/native-props';
13
+ import { mergeProps } from '../../utils/with-default-props';
14
+ import TitleLeft from "./demos/component/title-left";
15
+ import TitleRight from "./demos/component/title-right";
16
+ import InputLeft from "./demos/component/input-left";
17
+ import InputRight from "./demos/component/input-right";
18
+ import Tip from "./demos/component/tip";
19
+ import Footer from "./demos/component/footer";
20
+ import Input from "../input";
21
+ var classPrefix = 'ebscn-fene-input';
22
+ var defaultProps = {
23
+ titleLeftComponent: React.createElement(TitleLeft, null),
24
+ titleRightComponent: React.createElement(TitleRight, null),
25
+ inputleftComponent: React.createElement(InputLeft, null),
26
+ inputrightComponent: React.createElement(InputRight, null),
27
+ tipComponent: React.createElement(Tip, null),
28
+ // contentComponent: <Content></Content>,
29
+ footerComponent: React.createElement(Footer, null)
30
+ };
31
+ export function FeneInput(p) {
32
+ var props = mergeProps(p, defaultProps);
33
+ console.log(p, 'FeneProp');
34
+ // const {titleLeftComponent,inputProps,} = props
35
+ return withNativeProps(props, React.createElement("div", {
36
+ className: "".concat(classPrefix)
37
+ }, React.createElement("div", {
38
+ className: "".concat(classPrefix, "-topArea")
39
+ }, props.titleLeftComponent, props.titleRightComponent), React.createElement("div", {
40
+ className: "".concat(classPrefix, "-middleArea")
41
+ }, React.createElement("div", {
42
+ className: "".concat(classPrefix, "-middleArea-inputArea")
43
+ }, props.inputleftComponent, React.createElement(Input, __assign({}, props.inputProps, {
44
+ clearable: true
45
+ })), props.inputrightComponent), React.createElement("div", {
46
+ className: "".concat(classPrefix, "-middleArea-unitBox")
47
+ }, React.createElement("div", {
48
+ className: "".concat(classPrefix, "-middleArea-unitBox-line")
49
+ }))), React.createElement("div", {
50
+ className: "".concat(classPrefix, "-tipArea")
51
+ }, props.tipComponent), React.createElement("div", {
52
+ className: "".concat(classPrefix, "-contentArea")
53
+ }, props.contentComponent), React.createElement("div", {
54
+ className: "".concat(classPrefix, "-bottomArea")
55
+ }, props.footerComponent)));
56
+ }
@@ -0,0 +1,4 @@
1
+ import "./fene-input.less";
2
+ import { FeneInput } from "./fene-input";
3
+ export type { FeneInputProps } from "./fene-input";
4
+ export default FeneInput;
@@ -0,0 +1,3 @@
1
+ import "./fene-input.css";
2
+ import { FeneInput } from "./fene-input";
3
+ export default FeneInput;
@@ -0,0 +1,4 @@
1
+ import './input.less';
2
+ import { Input } from './input';
3
+ export type { InputProps, InputRef } from './input';
4
+ export default Input;
@@ -0,0 +1,3 @@
1
+ import "./input.css";
2
+ import { Input } from './input';
3
+ export default Input;
@@ -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,152 @@
1
+ import React, { useState, forwardRef, useImperativeHandle, useRef } from 'react';
2
+ import { usePropsValue } from '../../utils/use-props-value';
3
+ import { CloseCircleFill } from 'antd-mobile-icons';
4
+ import { withNativeProps } from '../../utils/native-props';
5
+ import { mergeProps } from '../../utils/with-default-props';
6
+ import classNames from 'classnames';
7
+ import { useIsomorphicLayoutEffect } from 'ahooks';
8
+ import { bound } from '../../utils/bound';
9
+ import { isIOS } from '../../utils/validate';
10
+ var classPrefix = "adm-input";
11
+ var defaultProps = {
12
+ defaultValue: '',
13
+ onlyShowClearWhenFocus: true
14
+ };
15
+ export var Input = forwardRef(function (p, ref) {
16
+ var props = mergeProps(defaultProps, p);
17
+ var _a = usePropsValue(props),
18
+ value = _a[0],
19
+ setValue = _a[1];
20
+ var _b = useState(false),
21
+ hasFocus = _b[0],
22
+ setHasFocus = _b[1];
23
+ var compositionStartRef = useRef(false);
24
+ var nativeInputRef = useRef(null);
25
+ useImperativeHandle(ref, function () {
26
+ return {
27
+ clear: function () {
28
+ setValue('');
29
+ },
30
+ focus: function () {
31
+ var _a;
32
+ (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
33
+ },
34
+ blur: function () {
35
+ var _a;
36
+ (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
37
+ },
38
+ get nativeElement() {
39
+ return nativeInputRef.current;
40
+ }
41
+ };
42
+ });
43
+ var handleKeydown = function (e) {
44
+ var _a;
45
+ if (props.onEnterPress && (e.code === 'Enter' || e.keyCode === 13)) {
46
+ props.onEnterPress(e);
47
+ }
48
+ (_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
49
+ };
50
+ useIsomorphicLayoutEffect(function () {
51
+ var _a;
52
+ if (!props.enterKeyHint) return;
53
+ (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute('enterkeyhint', props.enterKeyHint);
54
+ return function () {
55
+ var _a;
56
+ (_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.removeAttribute('enterkeyhint');
57
+ };
58
+ }, [props.enterKeyHint]);
59
+ function checkValue() {
60
+ var nextValue = value;
61
+ if (props.type === 'number') {
62
+ var boundValue = nextValue && bound(parseFloat(nextValue), props.min, props.max).toString();
63
+ // fix the display issue of numbers starting with 0
64
+ if (Number(nextValue) !== Number(boundValue)) {
65
+ nextValue = boundValue;
66
+ }
67
+ }
68
+ if (nextValue !== value) {
69
+ setValue(nextValue);
70
+ }
71
+ }
72
+ var shouldShowClear = function () {
73
+ if (!props.clearable || !value || props.readOnly) return false;
74
+ if (props.onlyShowClearWhenFocus) {
75
+ return hasFocus;
76
+ } else {
77
+ return true;
78
+ }
79
+ }();
80
+ return withNativeProps(props, React.createElement("div", {
81
+ className: classNames("".concat(classPrefix), props.disabled && "".concat(classPrefix, "-disabled"))
82
+ }, React.createElement("input", {
83
+ ref: nativeInputRef,
84
+ className: "".concat(classPrefix, "-element"),
85
+ value: value,
86
+ onChange: function (e) {
87
+ setValue(e.target.value);
88
+ },
89
+ onFocus: function (e) {
90
+ var _a;
91
+ setHasFocus(true);
92
+ console.log(e, 'e');
93
+ (_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
94
+ },
95
+ onBlur: function (e) {
96
+ var _a;
97
+ setHasFocus(false);
98
+ checkValue();
99
+ (_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
100
+ },
101
+ id: props.id,
102
+ placeholder: props.placeholder,
103
+ disabled: props.disabled,
104
+ readOnly: props.readOnly,
105
+ maxLength: props.maxLength,
106
+ minLength: props.minLength,
107
+ max: props.max,
108
+ min: props.min,
109
+ autoComplete: props.autoComplete,
110
+ autoFocus: props.autoFocus,
111
+ pattern: props.pattern,
112
+ inputMode: props.inputMode,
113
+ type: props.type,
114
+ name: props.name,
115
+ autoCapitalize: props.autoCapitalize,
116
+ autoCorrect: props.autoCorrect,
117
+ onKeyDown: handleKeydown,
118
+ onKeyUp: props.onKeyUp,
119
+ onCompositionStart: function (e) {
120
+ var _a;
121
+ compositionStartRef.current = true;
122
+ (_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
123
+ },
124
+ onCompositionEnd: function (e) {
125
+ var _a;
126
+ compositionStartRef.current = false;
127
+ (_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
128
+ },
129
+ onClick: props.onClick,
130
+ step: props.step,
131
+ role: props.role,
132
+ "aria-valuenow": props['aria-valuenow'],
133
+ "aria-valuemax": props['aria-valuemax'],
134
+ "aria-valuemin": props['aria-valuemin'],
135
+ "aria-label": props['aria-label']
136
+ }), shouldShowClear && React.createElement("div", {
137
+ className: "".concat(classPrefix, "-clear"),
138
+ onMouseDown: function (e) {
139
+ e.preventDefault();
140
+ },
141
+ onClick: function () {
142
+ var _a, _b;
143
+ setValue('');
144
+ (_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
145
+ // https://github.com/ant-design/ant-design-mobile/issues/5212
146
+ if (isIOS() && compositionStartRef.current) {
147
+ compositionStartRef.current = false;
148
+ (_b = nativeInputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
149
+ }
150
+ }
151
+ }, React.createElement(CloseCircleFill, null))));
152
+ });
@@ -1,8 +1,8 @@
1
1
  .ebscn-marketTag {
2
- padding: 0 1px;
3
- font-size: var(--ebscn-font-size-2);
4
- line-height: 13px;
5
- height: 13px;
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,4 @@
1
+ import "./money-input.less";
2
+ import { MoneyInput } from "./money-input";
3
+ export type { MoneyInputProps } from "./money-input";
4
+ export default MoneyInput;
@@ -0,0 +1,3 @@
1
+ import "./money-input.css";
2
+ import { MoneyInput } from "./money-input";
3
+ export default MoneyInput;
@@ -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
+ }
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import { NativeProps } from '../../utils/native-props';
3
+ import { VirtualInputProps } from "../virtual-input/virtual-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 MoneyInputProps = {
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?: VirtualInputProps;
22
+ inputleftComponent?: React.ReactNode;
23
+ prefixComponent?: React.ReactNode;
24
+ suffixComponent?: React.ReactNode;
25
+ } & NativeProps;
26
+ export declare function MoneyInput(p: MoneyInputProps): JSX.Element;
27
+ export {};
@@ -0,0 +1,103 @@
1
+ // import cns from "classnames";
2
+ // import { useEffect, useRef } from "react";
3
+ // import React from "react";
4
+ // import { VirtualInputProps, VirtualInput } from "../virtual-input/virtual-input";
5
+ // import { NativeProps, withNativeProps } from '../../utils/native-props'
6
+ // import { mergeProps } from '../../utils/with-default-props'
7
+ // import TitleLeft from "./demos/component/title-left";
8
+ // import TitleRight from "./demos/component/title-right";
9
+ // import InputLeft from "./demos/component/input-left";
10
+ // import InputRight from "./demos/component/input-right";
11
+ // import Tip from "./demos/component/tip";
12
+ // import Footer from "./demos/component/footer";
13
+ // import Content from "./demos/component/content";
14
+ // const classPrefix = 'ebscn-money-input'
15
+ // export type MoneyInputProps = {
16
+ // titleLeftComponent?: React.ReactNode
17
+ // titleRightComponent?: React.ReactNode
18
+ // inputProps?: VirtualInputProps
19
+ // inputleftComponent?: React.ReactNode
20
+ // inputrightComponent?: React.ReactNode
21
+ // tipComponent?: React.ReactNode
22
+ // contentComponent?: React.ReactNode
23
+ // footerComponent?: React.ReactNode
24
+ // } & NativeProps;
25
+ var __assign = this && this.__assign || function () {
26
+ __assign = Object.assign || function (t) {
27
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
28
+ s = arguments[i];
29
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
30
+ }
31
+ return t;
32
+ };
33
+ return __assign.apply(this, arguments);
34
+ };
35
+ import { useState } from "react";
36
+ import React from "react";
37
+ import { withNativeProps } from '../../utils/native-props';
38
+ import { mergeProps } from '../../utils/with-default-props';
39
+ import Tip from "./demos/component/tip";
40
+ import { usePropsValue } from "@ebscn/ui/utils/use-props-value";
41
+ import { VirtualInput } from "../virtual-input/virtual-input";
42
+ var classPrefix = 'ebscn-money-input';
43
+ var defaultProps = {
44
+ // inputleftComponent: <InputLeft></InputLeft>,
45
+ tipComponent: React.createElement(Tip, null),
46
+ defaultValue: ''
47
+ };
48
+ export function MoneyInput(p) {
49
+ var _a, _b, _c;
50
+ var props = mergeProps(p, defaultProps);
51
+ var _d = usePropsValue(props),
52
+ value = _d[0],
53
+ setValue = _d[1];
54
+ var _e = useState('#ebebeb'),
55
+ color = _e[0],
56
+ setColor = _e[1];
57
+ var _f = useState(false),
58
+ showTip = _f[0],
59
+ setShowTip = _f[1];
60
+ var _g = useState(true),
61
+ clearable = _g[0],
62
+ setClearable = _g[1];
63
+ console.log(p, 'CommonProp');
64
+ function changeColor(isShowLine, color) {
65
+ if (isShowLine) {
66
+ setColor(color);
67
+ }
68
+ }
69
+ // const {titleLeftComponent,inputProps,} = props
70
+ return withNativeProps(props, React.createElement("div", {
71
+ className: "".concat(classPrefix)
72
+ }, React.createElement("div", {
73
+ className: "".concat(classPrefix, "-middleArea"),
74
+ style: {
75
+ 'borderBottomColor': "".concat(((_a = props.tipProps) === null || _a === void 0 ? void 0 : _a.isShowTip) ? 'red' : color)
76
+ }
77
+ }, React.createElement("div", {
78
+ className: "".concat(classPrefix, "-middleArea-inputArea")
79
+ }, props.prefixComponent, props.inputleftComponent, React.createElement(VirtualInput, __assign({
80
+ onFocus: function () {
81
+ changeColor(props.isShowLine, 'blue');
82
+ },
83
+ onBlur: function () {
84
+ changeColor(props.isShowLine, '#ebebeb');
85
+ },
86
+ value: value
87
+ }, props.inputProps, {
88
+ onChange: function (val) {
89
+ var _a;
90
+ console.log((_a = props.tipProps) === null || _a === void 0 ? void 0 : _a.isShowTip, 'isShowTIP');
91
+ // props.tipProps?.isShowTip ? setColor('red') : setColor('blue')
92
+ setValue(val);
93
+ }
94
+ }, props.inputProps)), props.suffixComponent), ((_b = props.unitProps) === null || _b === void 0 ? void 0 : _b.isShowUnit) ? React.createElement("div", {
95
+ className: "".concat(classPrefix, "-middleArea-unitBox")
96
+ }, React.createElement("div", {
97
+ className: "".concat(classPrefix, "-middleArea-unitBox-line")
98
+ }), React.createElement("div", {
99
+ className: "".concat(classPrefix, "-middleArea-unitBox-unit")
100
+ }, props.unitProps.unitComponent)) : React.createElement(React.Fragment, null)), ((_c = props.tipProps) === null || _c === void 0 ? void 0 : _c.isShowTip) ? React.createElement("div", {
101
+ className: "".concat(classPrefix, "-tipArea")
102
+ }, props.tipProps.tipComponent) : React.createElement(React.Fragment, null)));
103
+ }
@@ -0,0 +1,4 @@
1
+ import './passcode-input.less';
2
+ import { PasscodeInput } from './passcode-input';
3
+ export type { PasscodeInputProps, PasscodeInputRef } from './passcode-input';
4
+ export default PasscodeInput;
@@ -0,0 +1,3 @@
1
+ import "./passcode-input.css";
2
+ import { PasscodeInput } from './passcode-input';
3
+ export default PasscodeInput;