@mirai/ui 1.0.0 → 1.0.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/build/components/Calendar/Calendar.Month.js +11 -12
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +1 -3
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +40 -0
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -0
- package/build/components/Calendar/Calendar.js +11 -6
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/Calendar.module.css +8 -4
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +17546 -17490
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +2 -2
- package/build/components/InputSelect/InputSelect.js +93 -0
- package/build/components/InputSelect/InputSelect.js.map +1 -0
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +490 -0
- package/build/components/InputSelect/index.js +19 -0
- package/build/components/InputSelect/index.js.map +1 -0
- package/build/components/InputText/InputText.js +13 -5
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.module.css +40 -19
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +62 -19
- package/build/components/index.js +13 -0
- package/build/components/index.js.map +1 -1
- package/build/primitives/Input/Input.module.css +0 -5
- package/build/primitives/Select/Select.js +70 -0
- package/build/primitives/Select/Select.js.map +1 -0
- package/build/primitives/Select/Select.module.css +24 -0
- package/build/primitives/Select/__tests__/__snapshots__/Select.test.js.snap +178 -0
- package/build/primitives/Select/index.js +19 -0
- package/build/primitives/Select/index.js.map +1 -0
- package/build/primitives/index.js +13 -0
- package/build/primitives/index.js.map +1 -1
- package/build/theme/default.theme.css +2 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ exports[`component:<Form> prop:children 1`] = `
|
|
|
10
10
|
<DocumentFragment>
|
|
11
11
|
<form>
|
|
12
12
|
<div
|
|
13
|
-
class="view
|
|
13
|
+
class="view inputContainer"
|
|
14
14
|
>
|
|
15
15
|
<span
|
|
16
16
|
class="text paragraph text label"
|
|
@@ -18,7 +18,7 @@ exports[`component:<Form> prop:children 1`] = `
|
|
|
18
18
|
label
|
|
19
19
|
</span>
|
|
20
20
|
<div
|
|
21
|
-
class="view
|
|
21
|
+
class="view row inputBorder"
|
|
22
22
|
>
|
|
23
23
|
<input
|
|
24
24
|
class="input input"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.InputSelect = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _helpers = require("../../helpers");
|
|
19
|
+
|
|
20
|
+
var _primitives = require("../../primitives");
|
|
21
|
+
|
|
22
|
+
var _InputTextModule = _interopRequireDefault(require("../InputText/InputText.module.css"));
|
|
23
|
+
|
|
24
|
+
var _excluded = ["disabled", "error", "hint", "label", "onChange", "onEnter", "onLeave"];
|
|
25
|
+
|
|
26
|
+
var InputSelect = function InputSelect(_ref) {
|
|
27
|
+
var _others$value;
|
|
28
|
+
|
|
29
|
+
var disabled = _ref.disabled,
|
|
30
|
+
error = _ref.error,
|
|
31
|
+
hint = _ref.hint,
|
|
32
|
+
label = _ref.label,
|
|
33
|
+
_ref$onChange = _ref.onChange,
|
|
34
|
+
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
35
|
+
_ref$onEnter = _ref.onEnter,
|
|
36
|
+
onEnter = _ref$onEnter === void 0 ? function () {} : _ref$onEnter,
|
|
37
|
+
_ref$onLeave = _ref.onLeave,
|
|
38
|
+
onLeave = _ref$onLeave === void 0 ? function () {} : _ref$onLeave,
|
|
39
|
+
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
40
|
+
|
|
41
|
+
var _useState = (0, _react.useState)(false),
|
|
42
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
43
|
+
focus = _useState2[0],
|
|
44
|
+
setFocus = _useState2[1];
|
|
45
|
+
|
|
46
|
+
var handleChange = function handleChange(value, event) {
|
|
47
|
+
var _event$target;
|
|
48
|
+
|
|
49
|
+
onChange(value, event);
|
|
50
|
+
(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.blur();
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
var handleEnter = function handleEnter(event) {
|
|
54
|
+
setFocus(true);
|
|
55
|
+
onEnter(event);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var handleLeave = function handleLeave(event) {
|
|
59
|
+
setFocus(false);
|
|
60
|
+
onLeave(event);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var has = {
|
|
64
|
+
value: others.value !== undefined && ((_others$value = others.value) === null || _others$value === void 0 ? void 0 : _others$value.length) > 0
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
67
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputContainer, others.className),
|
|
68
|
+
style: others.style
|
|
69
|
+
}, label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
70
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label, focus && _InputTextModule.default.focus, error && _InputTextModule.default.error, (focus || error || has.value) && _InputTextModule.default.value)
|
|
71
|
+
}, label), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
72
|
+
row: true,
|
|
73
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, focus && !error && _InputTextModule.default.focus, error && _InputTextModule.default.error)
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Select, Object.assign({}, others, {
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
value: others.value || '',
|
|
77
|
+
className: _InputTextModule.default.input,
|
|
78
|
+
style: undefined,
|
|
79
|
+
onChange: handleChange,
|
|
80
|
+
onEnter: handleEnter,
|
|
81
|
+
onLeave: handleLeave
|
|
82
|
+
})), !disabled && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
83
|
+
name: "CloseArrow",
|
|
84
|
+
className: [_InputTextModule.default.icon, _InputTextModule.default.right]
|
|
85
|
+
})), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
86
|
+
small: true,
|
|
87
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, error && _InputTextModule.default.error)
|
|
88
|
+
}, hint));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
exports.InputSelect = InputSelect;
|
|
92
|
+
InputSelect.displayName = 'Component:InputSelect';
|
|
93
|
+
//# sourceMappingURL=InputSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InputSelect/InputSelect.jsx"],"names":["InputSelect","disabled","error","hint","label","onChange","onEnter","onLeave","others","focus","setFocus","handleChange","value","event","target","blur","handleEnter","handleLeave","has","undefined","length","style","inputContainer","className","text","inputBorder","input","icon","right","displayName"],"mappings":"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","sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Select, Text, View } from '../../primitives';\nimport style from '../InputText/InputText.module.css';\nconst InputSelect = ({\n disabled,\n error,\n hint,\n label,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n event.target?.blur();\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const has = {\n value: others.value !== undefined && others.value?.length > 0,\n };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n focus && style.focus,\n error && style.error,\n (focus || error || has.value) && style.value,\n )}\n >\n {label}\n </Text>\n )}\n\n <View row className={styles(style.inputBorder, focus && !error && style.focus, error && style.error)}>\n <Select\n {...others}\n disabled={disabled}\n value={others.value || ''}\n className={style.input}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n {!disabled && <Icon name=\"CloseArrow\" className={[style.icon, style.right]} />}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputSelect.displayName = 'Component:InputSelect';\n\nInputSelect.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputSelect };\n"],"file":"InputSelect.js"}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`component:<InputSelect> inherit:className 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="view inputContainer mirai"
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
class="view row inputBorder"
|
|
10
|
+
>
|
|
11
|
+
<select
|
|
12
|
+
class="select empty input"
|
|
13
|
+
name="name"
|
|
14
|
+
>
|
|
15
|
+
<option
|
|
16
|
+
svalue="one"
|
|
17
|
+
>
|
|
18
|
+
one
|
|
19
|
+
</option>
|
|
20
|
+
<option
|
|
21
|
+
svalue="two"
|
|
22
|
+
>
|
|
23
|
+
two
|
|
24
|
+
</option>
|
|
25
|
+
<option
|
|
26
|
+
svalue="three"
|
|
27
|
+
>
|
|
28
|
+
three
|
|
29
|
+
</option>
|
|
30
|
+
<option
|
|
31
|
+
svalue="four"
|
|
32
|
+
>
|
|
33
|
+
four
|
|
34
|
+
</option>
|
|
35
|
+
<option
|
|
36
|
+
svalue="five"
|
|
37
|
+
>
|
|
38
|
+
five
|
|
39
|
+
</option>
|
|
40
|
+
</select>
|
|
41
|
+
<span
|
|
42
|
+
class="icon icon right"
|
|
43
|
+
>
|
|
44
|
+
<svg
|
|
45
|
+
fill="none"
|
|
46
|
+
height="1em"
|
|
47
|
+
stroke="currentColor"
|
|
48
|
+
stroke-linecap="round"
|
|
49
|
+
stroke-linejoin="round"
|
|
50
|
+
stroke-width="2"
|
|
51
|
+
viewBox="0 0 24 24"
|
|
52
|
+
width="1em"
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
>
|
|
55
|
+
<polyline
|
|
56
|
+
points="6 9 12 15 18 9"
|
|
57
|
+
/>
|
|
58
|
+
</svg>
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</DocumentFragment>
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
exports[`component:<InputSelect> prop:disabled 1`] = `
|
|
66
|
+
<DocumentFragment>
|
|
67
|
+
<div
|
|
68
|
+
class="view inputContainer"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
class="view row inputBorder"
|
|
72
|
+
>
|
|
73
|
+
<select
|
|
74
|
+
class="select empty input"
|
|
75
|
+
disabled=""
|
|
76
|
+
name="name"
|
|
77
|
+
>
|
|
78
|
+
<option
|
|
79
|
+
svalue="one"
|
|
80
|
+
>
|
|
81
|
+
one
|
|
82
|
+
</option>
|
|
83
|
+
<option
|
|
84
|
+
svalue="two"
|
|
85
|
+
>
|
|
86
|
+
two
|
|
87
|
+
</option>
|
|
88
|
+
<option
|
|
89
|
+
svalue="three"
|
|
90
|
+
>
|
|
91
|
+
three
|
|
92
|
+
</option>
|
|
93
|
+
<option
|
|
94
|
+
svalue="four"
|
|
95
|
+
>
|
|
96
|
+
four
|
|
97
|
+
</option>
|
|
98
|
+
<option
|
|
99
|
+
svalue="five"
|
|
100
|
+
>
|
|
101
|
+
five
|
|
102
|
+
</option>
|
|
103
|
+
</select>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</DocumentFragment>
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
exports[`component:<InputSelect> prop:error 1`] = `
|
|
110
|
+
<DocumentFragment>
|
|
111
|
+
<div
|
|
112
|
+
class="view inputContainer"
|
|
113
|
+
>
|
|
114
|
+
<div
|
|
115
|
+
class="view row inputBorder"
|
|
116
|
+
>
|
|
117
|
+
<select
|
|
118
|
+
class="select empty input"
|
|
119
|
+
name="name"
|
|
120
|
+
>
|
|
121
|
+
<option
|
|
122
|
+
svalue="one"
|
|
123
|
+
>
|
|
124
|
+
one
|
|
125
|
+
</option>
|
|
126
|
+
<option
|
|
127
|
+
svalue="two"
|
|
128
|
+
>
|
|
129
|
+
two
|
|
130
|
+
</option>
|
|
131
|
+
<option
|
|
132
|
+
svalue="three"
|
|
133
|
+
>
|
|
134
|
+
three
|
|
135
|
+
</option>
|
|
136
|
+
<option
|
|
137
|
+
svalue="four"
|
|
138
|
+
>
|
|
139
|
+
four
|
|
140
|
+
</option>
|
|
141
|
+
<option
|
|
142
|
+
svalue="five"
|
|
143
|
+
>
|
|
144
|
+
five
|
|
145
|
+
</option>
|
|
146
|
+
</select>
|
|
147
|
+
<span
|
|
148
|
+
class="icon icon right"
|
|
149
|
+
>
|
|
150
|
+
<svg
|
|
151
|
+
fill="none"
|
|
152
|
+
height="1em"
|
|
153
|
+
stroke="currentColor"
|
|
154
|
+
stroke-linecap="round"
|
|
155
|
+
stroke-linejoin="round"
|
|
156
|
+
stroke-width="2"
|
|
157
|
+
viewBox="0 0 24 24"
|
|
158
|
+
width="1em"
|
|
159
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
+
>
|
|
161
|
+
<polyline
|
|
162
|
+
points="6 9 12 15 18 9"
|
|
163
|
+
/>
|
|
164
|
+
</svg>
|
|
165
|
+
</span>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</DocumentFragment>
|
|
169
|
+
`;
|
|
170
|
+
|
|
171
|
+
exports[`component:<InputSelect> prop:hint 1`] = `
|
|
172
|
+
<DocumentFragment>
|
|
173
|
+
<div
|
|
174
|
+
class="view inputContainer"
|
|
175
|
+
>
|
|
176
|
+
<div
|
|
177
|
+
class="view row inputBorder"
|
|
178
|
+
>
|
|
179
|
+
<select
|
|
180
|
+
class="select empty input"
|
|
181
|
+
name="name"
|
|
182
|
+
>
|
|
183
|
+
<option
|
|
184
|
+
svalue="one"
|
|
185
|
+
>
|
|
186
|
+
one
|
|
187
|
+
</option>
|
|
188
|
+
<option
|
|
189
|
+
svalue="two"
|
|
190
|
+
>
|
|
191
|
+
two
|
|
192
|
+
</option>
|
|
193
|
+
<option
|
|
194
|
+
svalue="three"
|
|
195
|
+
>
|
|
196
|
+
three
|
|
197
|
+
</option>
|
|
198
|
+
<option
|
|
199
|
+
svalue="four"
|
|
200
|
+
>
|
|
201
|
+
four
|
|
202
|
+
</option>
|
|
203
|
+
<option
|
|
204
|
+
svalue="five"
|
|
205
|
+
>
|
|
206
|
+
five
|
|
207
|
+
</option>
|
|
208
|
+
</select>
|
|
209
|
+
<span
|
|
210
|
+
class="icon icon right"
|
|
211
|
+
>
|
|
212
|
+
<svg
|
|
213
|
+
fill="none"
|
|
214
|
+
height="1em"
|
|
215
|
+
stroke="currentColor"
|
|
216
|
+
stroke-linecap="round"
|
|
217
|
+
stroke-linejoin="round"
|
|
218
|
+
stroke-width="2"
|
|
219
|
+
viewBox="0 0 24 24"
|
|
220
|
+
width="1em"
|
|
221
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
222
|
+
>
|
|
223
|
+
<polyline
|
|
224
|
+
points="6 9 12 15 18 9"
|
|
225
|
+
/>
|
|
226
|
+
</svg>
|
|
227
|
+
</span>
|
|
228
|
+
</div>
|
|
229
|
+
<span
|
|
230
|
+
class="text small text hint"
|
|
231
|
+
>
|
|
232
|
+
hint
|
|
233
|
+
</span>
|
|
234
|
+
</div>
|
|
235
|
+
</DocumentFragment>
|
|
236
|
+
`;
|
|
237
|
+
|
|
238
|
+
exports[`component:<InputSelect> prop:label 1`] = `
|
|
239
|
+
<DocumentFragment>
|
|
240
|
+
<div
|
|
241
|
+
class="view inputContainer"
|
|
242
|
+
>
|
|
243
|
+
<span
|
|
244
|
+
class="text paragraph text label"
|
|
245
|
+
>
|
|
246
|
+
label
|
|
247
|
+
</span>
|
|
248
|
+
<div
|
|
249
|
+
class="view row inputBorder"
|
|
250
|
+
>
|
|
251
|
+
<select
|
|
252
|
+
class="select empty input"
|
|
253
|
+
name="name"
|
|
254
|
+
>
|
|
255
|
+
<option
|
|
256
|
+
svalue="one"
|
|
257
|
+
>
|
|
258
|
+
one
|
|
259
|
+
</option>
|
|
260
|
+
<option
|
|
261
|
+
svalue="two"
|
|
262
|
+
>
|
|
263
|
+
two
|
|
264
|
+
</option>
|
|
265
|
+
<option
|
|
266
|
+
svalue="three"
|
|
267
|
+
>
|
|
268
|
+
three
|
|
269
|
+
</option>
|
|
270
|
+
<option
|
|
271
|
+
svalue="four"
|
|
272
|
+
>
|
|
273
|
+
four
|
|
274
|
+
</option>
|
|
275
|
+
<option
|
|
276
|
+
svalue="five"
|
|
277
|
+
>
|
|
278
|
+
five
|
|
279
|
+
</option>
|
|
280
|
+
</select>
|
|
281
|
+
<span
|
|
282
|
+
class="icon icon right"
|
|
283
|
+
>
|
|
284
|
+
<svg
|
|
285
|
+
fill="none"
|
|
286
|
+
height="1em"
|
|
287
|
+
stroke="currentColor"
|
|
288
|
+
stroke-linecap="round"
|
|
289
|
+
stroke-linejoin="round"
|
|
290
|
+
stroke-width="2"
|
|
291
|
+
viewBox="0 0 24 24"
|
|
292
|
+
width="1em"
|
|
293
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
294
|
+
>
|
|
295
|
+
<polyline
|
|
296
|
+
points="6 9 12 15 18 9"
|
|
297
|
+
/>
|
|
298
|
+
</svg>
|
|
299
|
+
</span>
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
</DocumentFragment>
|
|
303
|
+
`;
|
|
304
|
+
|
|
305
|
+
exports[`component:<InputSelect> prop:label 2`] = `
|
|
306
|
+
<DocumentFragment>
|
|
307
|
+
<div
|
|
308
|
+
class="view inputContainer"
|
|
309
|
+
>
|
|
310
|
+
<div
|
|
311
|
+
class="view row inputBorder"
|
|
312
|
+
>
|
|
313
|
+
<select
|
|
314
|
+
class="select input"
|
|
315
|
+
name="name"
|
|
316
|
+
>
|
|
317
|
+
<option
|
|
318
|
+
svalue="one"
|
|
319
|
+
>
|
|
320
|
+
one
|
|
321
|
+
</option>
|
|
322
|
+
<option
|
|
323
|
+
svalue="two"
|
|
324
|
+
>
|
|
325
|
+
two
|
|
326
|
+
</option>
|
|
327
|
+
<option
|
|
328
|
+
svalue="three"
|
|
329
|
+
>
|
|
330
|
+
three
|
|
331
|
+
</option>
|
|
332
|
+
<option
|
|
333
|
+
svalue="four"
|
|
334
|
+
>
|
|
335
|
+
four
|
|
336
|
+
</option>
|
|
337
|
+
<option
|
|
338
|
+
svalue="five"
|
|
339
|
+
>
|
|
340
|
+
five
|
|
341
|
+
</option>
|
|
342
|
+
</select>
|
|
343
|
+
<span
|
|
344
|
+
class="icon icon right"
|
|
345
|
+
>
|
|
346
|
+
<svg
|
|
347
|
+
fill="none"
|
|
348
|
+
height="1em"
|
|
349
|
+
stroke="currentColor"
|
|
350
|
+
stroke-linecap="round"
|
|
351
|
+
stroke-linejoin="round"
|
|
352
|
+
stroke-width="2"
|
|
353
|
+
viewBox="0 0 24 24"
|
|
354
|
+
width="1em"
|
|
355
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
356
|
+
>
|
|
357
|
+
<polyline
|
|
358
|
+
points="6 9 12 15 18 9"
|
|
359
|
+
/>
|
|
360
|
+
</svg>
|
|
361
|
+
</span>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
</DocumentFragment>
|
|
365
|
+
`;
|
|
366
|
+
|
|
367
|
+
exports[`component:<InputSelect> renders 1`] = `
|
|
368
|
+
<DocumentFragment>
|
|
369
|
+
<div
|
|
370
|
+
class="view inputContainer"
|
|
371
|
+
>
|
|
372
|
+
<div
|
|
373
|
+
class="view row inputBorder"
|
|
374
|
+
>
|
|
375
|
+
<select
|
|
376
|
+
class="select empty input"
|
|
377
|
+
name="name"
|
|
378
|
+
>
|
|
379
|
+
<option
|
|
380
|
+
svalue="one"
|
|
381
|
+
>
|
|
382
|
+
one
|
|
383
|
+
</option>
|
|
384
|
+
<option
|
|
385
|
+
svalue="two"
|
|
386
|
+
>
|
|
387
|
+
two
|
|
388
|
+
</option>
|
|
389
|
+
<option
|
|
390
|
+
svalue="three"
|
|
391
|
+
>
|
|
392
|
+
three
|
|
393
|
+
</option>
|
|
394
|
+
<option
|
|
395
|
+
svalue="four"
|
|
396
|
+
>
|
|
397
|
+
four
|
|
398
|
+
</option>
|
|
399
|
+
<option
|
|
400
|
+
svalue="five"
|
|
401
|
+
>
|
|
402
|
+
five
|
|
403
|
+
</option>
|
|
404
|
+
</select>
|
|
405
|
+
<span
|
|
406
|
+
class="icon icon right"
|
|
407
|
+
>
|
|
408
|
+
<svg
|
|
409
|
+
fill="none"
|
|
410
|
+
height="1em"
|
|
411
|
+
stroke="currentColor"
|
|
412
|
+
stroke-linecap="round"
|
|
413
|
+
stroke-linejoin="round"
|
|
414
|
+
stroke-width="2"
|
|
415
|
+
viewBox="0 0 24 24"
|
|
416
|
+
width="1em"
|
|
417
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
418
|
+
>
|
|
419
|
+
<polyline
|
|
420
|
+
points="6 9 12 15 18 9"
|
|
421
|
+
/>
|
|
422
|
+
</svg>
|
|
423
|
+
</span>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
</DocumentFragment>
|
|
427
|
+
`;
|
|
428
|
+
|
|
429
|
+
exports[`component:<InputSelect> testID 1`] = `
|
|
430
|
+
<DocumentFragment>
|
|
431
|
+
<div
|
|
432
|
+
class="view inputContainer"
|
|
433
|
+
>
|
|
434
|
+
<div
|
|
435
|
+
class="view row inputBorder"
|
|
436
|
+
>
|
|
437
|
+
<select
|
|
438
|
+
class="select empty input"
|
|
439
|
+
data-testid="mirai"
|
|
440
|
+
name="name"
|
|
441
|
+
>
|
|
442
|
+
<option
|
|
443
|
+
svalue="one"
|
|
444
|
+
>
|
|
445
|
+
one
|
|
446
|
+
</option>
|
|
447
|
+
<option
|
|
448
|
+
svalue="two"
|
|
449
|
+
>
|
|
450
|
+
two
|
|
451
|
+
</option>
|
|
452
|
+
<option
|
|
453
|
+
svalue="three"
|
|
454
|
+
>
|
|
455
|
+
three
|
|
456
|
+
</option>
|
|
457
|
+
<option
|
|
458
|
+
svalue="four"
|
|
459
|
+
>
|
|
460
|
+
four
|
|
461
|
+
</option>
|
|
462
|
+
<option
|
|
463
|
+
svalue="five"
|
|
464
|
+
>
|
|
465
|
+
five
|
|
466
|
+
</option>
|
|
467
|
+
</select>
|
|
468
|
+
<span
|
|
469
|
+
class="icon icon right"
|
|
470
|
+
>
|
|
471
|
+
<svg
|
|
472
|
+
fill="none"
|
|
473
|
+
height="1em"
|
|
474
|
+
stroke="currentColor"
|
|
475
|
+
stroke-linecap="round"
|
|
476
|
+
stroke-linejoin="round"
|
|
477
|
+
stroke-width="2"
|
|
478
|
+
viewBox="0 0 24 24"
|
|
479
|
+
width="1em"
|
|
480
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
481
|
+
>
|
|
482
|
+
<polyline
|
|
483
|
+
points="6 9 12 15 18 9"
|
|
484
|
+
/>
|
|
485
|
+
</svg>
|
|
486
|
+
</span>
|
|
487
|
+
</div>
|
|
488
|
+
</div>
|
|
489
|
+
</DocumentFragment>
|
|
490
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _InputSelect = require("./InputSelect");
|
|
8
|
+
|
|
9
|
+
Object.keys(_InputSelect).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _InputSelect[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _InputSelect[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InputSelect/index.js"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './InputSelect';\n"],"file":"index.js"}
|
|
@@ -21,7 +21,7 @@ var _primitives = require("../../primitives");
|
|
|
21
21
|
|
|
22
22
|
var _InputTextModule = _interopRequireDefault(require("./InputText.module.css"));
|
|
23
23
|
|
|
24
|
-
var _excluded = ["disabled", "error", "hint", "label", "type", "onChange", "onEnter", "onLeave"];
|
|
24
|
+
var _excluded = ["disabled", "error", "hint", "icon", "label", "type", "onChange", "onEnter", "onLeave"];
|
|
25
25
|
|
|
26
26
|
var InputText = function InputText(_ref) {
|
|
27
27
|
var _others$value;
|
|
@@ -29,6 +29,7 @@ var InputText = function InputText(_ref) {
|
|
|
29
29
|
var disabled = _ref.disabled,
|
|
30
30
|
error = _ref.error,
|
|
31
31
|
hint = _ref.hint,
|
|
32
|
+
icon = _ref.icon,
|
|
32
33
|
label = _ref.label,
|
|
33
34
|
type = _ref.type,
|
|
34
35
|
_ref$onChange = _ref.onChange,
|
|
@@ -70,16 +71,22 @@ var InputText = function InputText(_ref) {
|
|
|
70
71
|
password: type === 'password'
|
|
71
72
|
};
|
|
72
73
|
return /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
73
|
-
className: (0, _helpers.styles)(_InputTextModule.default.
|
|
74
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputContainer, others.className),
|
|
75
|
+
style: others.style
|
|
74
76
|
}, label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
75
77
|
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label, focus && _InputTextModule.default.focus, error && _InputTextModule.default.error, (focus || error || has.value) && _InputTextModule.default.value)
|
|
76
78
|
}, label), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
row: true,
|
|
80
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, focus && !error && _InputTextModule.default.focus, error && _InputTextModule.default.error)
|
|
81
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
82
|
+
name: icon,
|
|
83
|
+
className: [_InputTextModule.default.icon, _InputTextModule.default.left]
|
|
84
|
+
}), /*#__PURE__*/_react.default.createElement(_primitives.Input, Object.assign({}, others, {
|
|
79
85
|
disabled: disabled,
|
|
80
86
|
type: !is.password || password ? type : 'text',
|
|
81
87
|
value: others.value || '',
|
|
82
|
-
className: (0, _helpers.styles)(_InputTextModule.default.input,
|
|
88
|
+
className: (0, _helpers.styles)(_InputTextModule.default.input, icon && _InputTextModule.default.iconLeft),
|
|
89
|
+
style: undefined,
|
|
83
90
|
onChange: handleChange,
|
|
84
91
|
onEnter: handleEnter,
|
|
85
92
|
onLeave: handleLeave
|
|
@@ -97,4 +104,5 @@ var InputText = function InputText(_ref) {
|
|
|
97
104
|
};
|
|
98
105
|
|
|
99
106
|
exports.InputText = InputText;
|
|
107
|
+
InputText.displayName = 'Component:InputText';
|
|
100
108
|
//# sourceMappingURL=InputText.js.map
|