amotify 0.1.32 → 0.1.34
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/dist/@declaration/_.js +1 -1
- package/dist/@declaration/property.d.ts +2 -2
- package/dist/@styles/componentClasses/_.css +66 -65
- package/dist/@styles/componentClasses/_.js +39 -39
- package/dist/@styles/index.css +66 -65
- package/dist/@styles/index.js +39 -39
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +96 -65
- package/dist/@styles/style.js +39 -39
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.js +1 -470
- package/dist/@utils/LaunchReactApp.d.ts +1 -1
- package/dist/@utils/LaunchReactApp.js +1 -78
- package/dist/@utils/_.js +1 -12
- package/dist/@utils/collectForm.js +1 -96
- package/dist/@utils/color.js +1 -103
- package/dist/@utils/config.js +1 -101
- package/dist/@utils/fin.js +1 -39
- package/dist/@utils/getElement.js +1 -13
- package/dist/@utils/jsminEx.js +1 -172
- package/dist/@utils/pageTransit.js +1 -33
- package/dist/@utils/useRecycle.js +1 -44
- package/dist/@utils/useStore.js +1 -54
- package/dist/atoms/Box.js +1 -20
- package/dist/atoms/FAI.js +1 -148
- package/dist/atoms/Flex.js +1 -34
- package/dist/atoms/Grid.js +1 -17
- package/dist/atoms/Img.js +1 -65
- package/dist/atoms/Logo.js +51 -359
- package/dist/atoms/P.js +1 -20
- package/dist/atoms/Placeholder.js +1 -44
- package/dist/atoms/Span.js +1 -20
- package/dist/atoms/_.js +1 -9
- package/dist/fn/Button.js +1 -316
- package/dist/fn/Cropper.js +1 -1009
- package/dist/fn/Effect/Fade.js +1 -88
- package/dist/fn/Effect/Pudding.js +1 -22
- package/dist/fn/Effect/Ripple.js +3 -117
- package/dist/fn/Effect/_.js +1 -14
- package/dist/fn/Input/AutoHeightText.js +1 -112
- package/dist/fn/Input/Checker.js +1 -36
- package/dist/fn/Input/Chips/Selector.js +1 -472
- package/dist/fn/Input/Chips/_.js +1 -349
- package/dist/fn/Input/Contenteditable.js +1 -160
- package/dist/fn/Input/DigitCharacters.js +1 -275
- package/dist/fn/Input/Filer.js +1 -619
- package/dist/fn/Input/Hidden.js +1 -48
- package/dist/fn/Input/List.js +1 -450
- package/dist/fn/Input/Parts.js +1 -121
- package/dist/fn/Input/Plain.js +1 -12
- package/dist/fn/Input/RichSelect.js +1 -279
- package/dist/fn/Input/Search.js +1 -53
- package/dist/fn/Input/Segmented.js +1 -245
- package/dist/fn/Input/Select.js +1 -278
- package/dist/fn/Input/Slider.js +1 -538
- package/dist/fn/Input/Switch.js +1 -221
- package/dist/fn/Input/Text.js +1 -626
- package/dist/fn/Input/TextArea.js +1 -151
- package/dist/fn/Input/Time/Picker.js +1 -1457
- package/dist/fn/Input/Time/_.js +1 -867
- package/dist/fn/Input/_.js +1 -48
- package/dist/fn/Input/core.js +1 -626
- package/dist/fn/Layout/PageNotFound.js +1 -90
- package/dist/fn/Layout/PageRouter.js +1 -87
- package/dist/fn/Layout/PageViewController.js +1 -29
- package/dist/fn/Layout/Plate.js +1 -37
- package/dist/fn/Layout/RootViewController.js +1 -315
- package/dist/fn/Layout/SwipeView.js +1 -348
- package/dist/fn/Layout/TabBar.js +1 -72
- package/dist/fn/Layout/_.js +1 -22
- package/dist/fn/Loader/_.js +1 -104
- package/dist/fn/Loader/corner.js +1 -85
- package/dist/fn/Loader/mini.js +1 -125
- package/dist/fn/Loader/top.js +1 -73
- package/dist/fn/Sheet.d.ts +1 -0
- package/dist/fn/Sheet.js +1 -1101
- package/dist/fn/Snackbar.js +1 -216
- package/dist/fn/Table/Data.js +1 -974
- package/dist/fn/Table/Drag.js +1 -435
- package/dist/fn/Table/Normal.js +1 -136
- package/dist/fn/Table/Parts.js +1 -41
- package/dist/fn/Table/Wrapper.js +1 -60
- package/dist/fn/Table/_.js +1 -16
- package/dist/fn/Table/cellStyling.js +1 -51
- package/dist/fn/Tooltips.js +1 -58
- package/dist/fn/_.js +1 -10
- package/dist/index.js +1 -20
- package/dist/mols/Accordion.js +1 -152
- package/dist/mols/Column.js +1 -16
- package/dist/mols/LinkifyText.js +1 -42
- package/dist/mols/List.js +1 -42
- package/dist/mols/Row.js +1 -47
- package/dist/mols/Text.js +1 -67
- package/dist/mols/_.js +1 -6
- package/dist/temps/_.js +1 -1
- package/dist/temps/designBook.js +20 -3639
- package/package.json +1 -1
- package/dist/chunk-JJ3PEWPN.js +0 -60
package/dist/fn/Input/Text.js
CHANGED
|
@@ -1,626 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "../../chunk-JJ3PEWPN.js";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import {
|
|
8
|
-
useState,
|
|
9
|
-
useEffect
|
|
10
|
-
} from "react";
|
|
11
|
-
import {
|
|
12
|
-
$$,
|
|
13
|
-
$$fromRoot,
|
|
14
|
-
useStore
|
|
15
|
-
} from "../../@utils/_";
|
|
16
|
-
import Box from "../../atoms/Box";
|
|
17
|
-
import FAI from "../../atoms/FAI";
|
|
18
|
-
import Button from "../Button";
|
|
19
|
-
import Tooltips from "../Tooltips";
|
|
20
|
-
import { faEye } from "@fortawesome/free-solid-svg-icons/faEye";
|
|
21
|
-
import {
|
|
22
|
-
Wrapper,
|
|
23
|
-
BoxWrapper,
|
|
24
|
-
SubmitForm,
|
|
25
|
-
CommonEffects,
|
|
26
|
-
DefaultStyles
|
|
27
|
-
} from "./core";
|
|
28
|
-
import Parts from "./Parts";
|
|
29
|
-
const ValidateTypes = {
|
|
30
|
-
number: {
|
|
31
|
-
reg: /^-?[0-9\.]+$/g,
|
|
32
|
-
exist: true,
|
|
33
|
-
reason: "\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
34
|
-
},
|
|
35
|
-
katakana: {
|
|
36
|
-
reg: /^[ァ-ヶー ヲ-゚ ]*$/g,
|
|
37
|
-
exist: true,
|
|
38
|
-
reason: "\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
39
|
-
},
|
|
40
|
-
["hankaku.katakana"]: {
|
|
41
|
-
reg: /^[ヲ-゚ ]*$/g,
|
|
42
|
-
exist: true,
|
|
43
|
-
reason: "\u534A\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
44
|
-
},
|
|
45
|
-
digitNumber: {
|
|
46
|
-
reg: /^-?[0-9\.]+$/g,
|
|
47
|
-
exist: true,
|
|
48
|
-
reason: "\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
49
|
-
},
|
|
50
|
-
fileName: {
|
|
51
|
-
reg: /[¥\/:*\?\"\'\|\.\s\n\r\<\>]/g,
|
|
52
|
-
exist: false,
|
|
53
|
-
reason: "\u7A7A\u767D\u307E\u305F\u306F\u4E00\u90E8\u306E\u7279\u6B8A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"
|
|
54
|
-
},
|
|
55
|
-
creditCard: {
|
|
56
|
-
reg: /^\d{14,16}$/g,
|
|
57
|
-
exist: true,
|
|
58
|
-
reason: "14~16\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
59
|
-
},
|
|
60
|
-
email: {
|
|
61
|
-
reg: /^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+\.[A-Za-z0-9]+$/,
|
|
62
|
-
exist: true,
|
|
63
|
-
reason: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
64
|
-
/* @__PURE__ */ jsx(Box, { children: "\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044" }),
|
|
65
|
-
/* @__PURE__ */ jsx(Box, { children: "\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093" })
|
|
66
|
-
] })
|
|
67
|
-
},
|
|
68
|
-
password: {
|
|
69
|
-
reg: /^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,
|
|
70
|
-
exist: true,
|
|
71
|
-
reason: "8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
72
|
-
},
|
|
73
|
-
tel: {
|
|
74
|
-
reg: /.*$/g,
|
|
75
|
-
exist: true,
|
|
76
|
-
reason: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
77
|
-
/* @__PURE__ */ jsx(Box, { children: "0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059" }),
|
|
78
|
-
/* @__PURE__ */ jsx(Box, { children: "9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044" }),
|
|
79
|
-
/* @__PURE__ */ jsx(Box, { children: "\u6570\u5B57\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059" })
|
|
80
|
-
] })
|
|
81
|
-
// reg: /^(0|\(?\+\d{1,3}\)?\s)[-0-9]{9,12}$/g,exist: true,
|
|
82
|
-
// reason: <>
|
|
83
|
-
// <Box>0から始まる番号のみ入力可能です</Box>
|
|
84
|
-
// <Box>9~12桁の数字で入力してください</Box>
|
|
85
|
-
// <Box>数字のみ入力可能です</Box>
|
|
86
|
-
// </>
|
|
87
|
-
},
|
|
88
|
-
url: {
|
|
89
|
-
reg: /^https?:\/\/[^\n\s]+(\.|\:)[^\n\s\.\:]+$/,
|
|
90
|
-
exist: true,
|
|
91
|
-
reason: "URL\u5F62\u5F0F : http(s)://\u25EF\u25EF\u25EF\u25EF"
|
|
92
|
-
},
|
|
93
|
-
postal: {
|
|
94
|
-
reg: /^\d{7}$/g,
|
|
95
|
-
exist: true,
|
|
96
|
-
reason: "7\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
const DataLeveling = (params) => {
|
|
100
|
-
let {
|
|
101
|
-
restrict,
|
|
102
|
-
value = ""
|
|
103
|
-
} = params;
|
|
104
|
-
let dataValue = String(value);
|
|
105
|
-
let minus = false;
|
|
106
|
-
if (["tel", "number", "digitNumber", "test", "postal", "creditCard"].includes(restrict)) {
|
|
107
|
-
dataValue = dataValue.zen2hanNumber();
|
|
108
|
-
}
|
|
109
|
-
if (restrict == "katakana") {
|
|
110
|
-
dataValue = dataValue.replace(/[^ァ-ヶー ヲ-゚ ]/ig, "");
|
|
111
|
-
}
|
|
112
|
-
if (restrict == "hankaku.katakana") {
|
|
113
|
-
dataValue = dataValue.replace(/[^ヲ-゚ ]/ig, "");
|
|
114
|
-
}
|
|
115
|
-
if (["postal", "creditCard"].includes(restrict)) {
|
|
116
|
-
dataValue = dataValue.removeLetters();
|
|
117
|
-
}
|
|
118
|
-
if (["number", "digitNumber"].includes(restrict)) {
|
|
119
|
-
if (dataValue) {
|
|
120
|
-
if (dataValue == "-") {
|
|
121
|
-
} else if (dataValue == "0-") {
|
|
122
|
-
dataValue = "-";
|
|
123
|
-
} else {
|
|
124
|
-
if (dataValue[0] == "-")
|
|
125
|
-
minus = true;
|
|
126
|
-
dataValue = dataValue.replace(/[^0-9\.]/ig, "");
|
|
127
|
-
let Amount = Number(dataValue);
|
|
128
|
-
if (Amount === 0)
|
|
129
|
-
minus = false;
|
|
130
|
-
if (minus)
|
|
131
|
-
Amount = -1 * Amount;
|
|
132
|
-
if ($$.is.exist(params.min)) {
|
|
133
|
-
Amount = Math.max(Amount, Number(params.min));
|
|
134
|
-
}
|
|
135
|
-
if ($$.is.exist(params.max)) {
|
|
136
|
-
Amount = Math.min(Amount, Number(params.max));
|
|
137
|
-
}
|
|
138
|
-
dataValue = String(Math.abs(Amount));
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
let formatValue = dataValue;
|
|
143
|
-
if (restrict == "digitNumber") {
|
|
144
|
-
if (dataValue && dataValue != "-") {
|
|
145
|
-
let arrary = [];
|
|
146
|
-
for (let index = dataValue.length - 1; index >= 0; index--) {
|
|
147
|
-
arrary.unshift(dataValue[index]);
|
|
148
|
-
let Index = dataValue.length - 1 - index + 1;
|
|
149
|
-
if (index != 0 && Index % 3 == 0) {
|
|
150
|
-
arrary.unshift(",");
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
formatValue = arrary.join("");
|
|
154
|
-
}
|
|
155
|
-
} else if (restrict == "postal") {
|
|
156
|
-
if (dataValue.length >= 4) {
|
|
157
|
-
formatValue = dataValue.clip(0, 3) + "-" + dataValue.clip(3);
|
|
158
|
-
}
|
|
159
|
-
} else if (restrict == "creditCard") {
|
|
160
|
-
formatValue = dataValue.replace(/.{4}(?=.)/g, "$& ");
|
|
161
|
-
}
|
|
162
|
-
if (["number", "digitNumber"].includes(restrict)) {
|
|
163
|
-
if (minus) {
|
|
164
|
-
dataValue = "-" + dataValue;
|
|
165
|
-
formatValue = "-" + formatValue;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
formatValue,
|
|
170
|
-
dataValue
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
const setSelection = (props) => {
|
|
174
|
-
let {
|
|
175
|
-
id,
|
|
176
|
-
restrict,
|
|
177
|
-
val_status
|
|
178
|
-
} = props;
|
|
179
|
-
let input = $$fromRoot("#" + id)[0];
|
|
180
|
-
if (input) {
|
|
181
|
-
if (val_status.prevValue && val_status.formatValue) {
|
|
182
|
-
let {
|
|
183
|
-
formatValue: currentValue,
|
|
184
|
-
prevValue,
|
|
185
|
-
caretFrom,
|
|
186
|
-
caretTo
|
|
187
|
-
} = val_status;
|
|
188
|
-
if (restrict == "creditCard") {
|
|
189
|
-
if (currentValue.length >= prevValue.length) {
|
|
190
|
-
if (caretFrom % 5 == 0) {
|
|
191
|
-
caretFrom++;
|
|
192
|
-
caretTo++;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
input.setSelectionRange(caretFrom, caretTo);
|
|
196
|
-
} else if (restrict == "postal") {
|
|
197
|
-
if (currentValue.length == 5 && prevValue.length == 3) {
|
|
198
|
-
caretFrom++;
|
|
199
|
-
caretTo++;
|
|
200
|
-
}
|
|
201
|
-
input.setSelectionRange(caretFrom, caretTo);
|
|
202
|
-
} else if (restrict == "digitNumber") {
|
|
203
|
-
let margin = currentValue.length - prevValue.length;
|
|
204
|
-
if (margin == 2) {
|
|
205
|
-
caretFrom++;
|
|
206
|
-
caretTo++;
|
|
207
|
-
}
|
|
208
|
-
if (margin == -2) {
|
|
209
|
-
caretFrom--;
|
|
210
|
-
caretTo--;
|
|
211
|
-
}
|
|
212
|
-
input.setSelectionRange(caretFrom, caretTo);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
const TextValidate = (value, restrict) => {
|
|
218
|
-
let response = {
|
|
219
|
-
ok: true,
|
|
220
|
-
body: ""
|
|
221
|
-
};
|
|
222
|
-
(() => {
|
|
223
|
-
let kit = ValidateTypes[restrict];
|
|
224
|
-
if (!kit)
|
|
225
|
-
return;
|
|
226
|
-
let reason = kit.reason;
|
|
227
|
-
if (kit) {
|
|
228
|
-
let valid = Boolean(Number(!!value.match(kit.reg)) ^ Number(!kit.exist));
|
|
229
|
-
response = {
|
|
230
|
-
ok: valid,
|
|
231
|
-
body: valid ? "" : reason
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
})();
|
|
235
|
-
return response;
|
|
236
|
-
};
|
|
237
|
-
function DefaultValidation(props) {
|
|
238
|
-
let {
|
|
239
|
-
value,
|
|
240
|
-
params
|
|
241
|
-
} = props;
|
|
242
|
-
let {
|
|
243
|
-
restrict = "text",
|
|
244
|
-
maxLength = 255,
|
|
245
|
-
required
|
|
246
|
-
} = params;
|
|
247
|
-
let notice = [];
|
|
248
|
-
if ($$.is.exist(maxLength)) {
|
|
249
|
-
if (value.length >= Number(maxLength)) {
|
|
250
|
-
notice.push({ type: "invalid", label: maxLength + "\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044" });
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (value) {
|
|
254
|
-
let Valid = TextValidate(value, restrict);
|
|
255
|
-
if (!Valid.ok)
|
|
256
|
-
notice.push({ type: "invalid", label: Valid.body });
|
|
257
|
-
} else if (required) {
|
|
258
|
-
notice.push({ type: "invalid", label: "\u5FC5\u9808\u9805\u76EE\u3067\u3059" });
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
ok: !notice.filter(({ type }) => type == "invalid").length,
|
|
262
|
-
notice
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
const TextInput = (params) => {
|
|
266
|
-
let _a = params, {
|
|
267
|
-
componentID,
|
|
268
|
-
tone,
|
|
269
|
-
required,
|
|
270
|
-
restrict = "text",
|
|
271
|
-
form,
|
|
272
|
-
autoComplete = "off",
|
|
273
|
-
autoCapitalize = "off",
|
|
274
|
-
enableFormSubmit,
|
|
275
|
-
clearButton = false,
|
|
276
|
-
checkValidationAtFirst,
|
|
277
|
-
onChange,
|
|
278
|
-
onKeyDown,
|
|
279
|
-
onValidate,
|
|
280
|
-
onUpdateValue,
|
|
281
|
-
onUpdateValidValue,
|
|
282
|
-
value = "",
|
|
283
|
-
leftIndicator,
|
|
284
|
-
rightIndicator,
|
|
285
|
-
leftIcon,
|
|
286
|
-
rightIcon,
|
|
287
|
-
maxLength,
|
|
288
|
-
min,
|
|
289
|
-
max
|
|
290
|
-
} = _a, others = __objRest(_a, [
|
|
291
|
-
"componentID",
|
|
292
|
-
"tone",
|
|
293
|
-
"required",
|
|
294
|
-
"restrict",
|
|
295
|
-
"form",
|
|
296
|
-
"autoComplete",
|
|
297
|
-
"autoCapitalize",
|
|
298
|
-
"enableFormSubmit",
|
|
299
|
-
"clearButton",
|
|
300
|
-
"checkValidationAtFirst",
|
|
301
|
-
"onChange",
|
|
302
|
-
"onKeyDown",
|
|
303
|
-
"onValidate",
|
|
304
|
-
"onUpdateValue",
|
|
305
|
-
"onUpdateValidValue",
|
|
306
|
-
"value",
|
|
307
|
-
"leftIndicator",
|
|
308
|
-
"rightIndicator",
|
|
309
|
-
"leftIcon",
|
|
310
|
-
"rightIcon",
|
|
311
|
-
"maxLength",
|
|
312
|
-
"min",
|
|
313
|
-
"max"
|
|
314
|
-
]);
|
|
315
|
-
let inputType = restrict == "password" ? "password" : "text";
|
|
316
|
-
let inputMode = ["number", "digitNumber", "creditCard"].includes(restrict) ? "numeric" : restrict == "email" ? "email" : "text";
|
|
317
|
-
let Default_Status = __spreadProps(__spreadValues({
|
|
318
|
-
componentID
|
|
319
|
-
}, DataLeveling({
|
|
320
|
-
min,
|
|
321
|
-
max,
|
|
322
|
-
restrict,
|
|
323
|
-
value
|
|
324
|
-
})), {
|
|
325
|
-
prevValue: "",
|
|
326
|
-
eventType: "init",
|
|
327
|
-
eventID: $$.uuid.gen(),
|
|
328
|
-
caretFrom: null,
|
|
329
|
-
caretTo: null
|
|
330
|
-
});
|
|
331
|
-
let [val_isComposing, set_isComposing] = useState(false);
|
|
332
|
-
let [val_status, set_status] = useState(Default_Status);
|
|
333
|
-
let [val_validate, set_validate] = useState({
|
|
334
|
-
ok: false,
|
|
335
|
-
notice: []
|
|
336
|
-
});
|
|
337
|
-
CommonEffects({
|
|
338
|
-
params,
|
|
339
|
-
val_status,
|
|
340
|
-
set_status,
|
|
341
|
-
val_validate,
|
|
342
|
-
set_validate,
|
|
343
|
-
DefaultValidation,
|
|
344
|
-
onUpdateValue,
|
|
345
|
-
onUpdateValidValue,
|
|
346
|
-
ExtraOverrideParams: __spreadValues({}, DataLeveling({
|
|
347
|
-
min,
|
|
348
|
-
max,
|
|
349
|
-
restrict,
|
|
350
|
-
value
|
|
351
|
-
}))
|
|
352
|
-
});
|
|
353
|
-
useEffect(() => {
|
|
354
|
-
setSelection({ id: params.id, restrict, val_status });
|
|
355
|
-
}, [val_status]);
|
|
356
|
-
return /* @__PURE__ */ jsx(
|
|
357
|
-
BoxWrapper,
|
|
358
|
-
{
|
|
359
|
-
val_status,
|
|
360
|
-
set_status,
|
|
361
|
-
val_validate,
|
|
362
|
-
params,
|
|
363
|
-
children: /* @__PURE__ */ jsx(
|
|
364
|
-
"input",
|
|
365
|
-
__spreadProps(__spreadValues({
|
|
366
|
-
type: inputType,
|
|
367
|
-
inputMode,
|
|
368
|
-
"data-form": form,
|
|
369
|
-
"data-input-type": "text",
|
|
370
|
-
"data-validation": val_validate.ok,
|
|
371
|
-
"data-value": val_status.dataValue,
|
|
372
|
-
"data-component-id": val_status.componentID,
|
|
373
|
-
value: val_status.formatValue,
|
|
374
|
-
autoComplete,
|
|
375
|
-
autoCapitalize,
|
|
376
|
-
onKeyDown: (event) => {
|
|
377
|
-
let { key, target } = event;
|
|
378
|
-
{
|
|
379
|
-
let input = target;
|
|
380
|
-
let { selectionStart, selectionEnd } = input;
|
|
381
|
-
let caretFrom = Number(selectionStart);
|
|
382
|
-
let caretTo = Number(selectionEnd);
|
|
383
|
-
let _v = val_status.formatValue[Number(caretFrom)];
|
|
384
|
-
let v_ = val_status.formatValue[Number(caretFrom) - 1];
|
|
385
|
-
if (key == "Delete" && (restrict == "creditCard" && _v == " " || restrict == "postal" && _v == "-" || restrict == "digitNumber" && _v == ",")) {
|
|
386
|
-
input.setSelectionRange(caretFrom + 1, caretTo + 1);
|
|
387
|
-
event.preventDefault();
|
|
388
|
-
}
|
|
389
|
-
if (key == "Backspace" && (restrict == "creditCard" && v_ == " " || restrict == "postal" && v_ == "-" || restrict == "digitNumber" && v_ == ",")) {
|
|
390
|
-
input.setSelectionRange(caretFrom - 1, caretTo - 1);
|
|
391
|
-
event.preventDefault();
|
|
392
|
-
}
|
|
393
|
-
if (key == "Enter" || key == "Tab") {
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (["number", "digitNumber", "creditCard"].includes(restrict)) {
|
|
397
|
-
if (key == "Clear") {
|
|
398
|
-
set_status(__spreadProps(__spreadValues({}, val_status), {
|
|
399
|
-
dataValue: "",
|
|
400
|
-
formatValue: "",
|
|
401
|
-
eventType: "update",
|
|
402
|
-
eventID: $$.uuid.gen()
|
|
403
|
-
}));
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
if (["number", "digitNumber"].includes(restrict)) {
|
|
407
|
-
if (["ArrowUp", "ArrowDown"].includes(key)) {
|
|
408
|
-
let direction = Number(key == "ArrowUp") * 2 - 1;
|
|
409
|
-
let Value = String(Number(val_status.dataValue) + direction);
|
|
410
|
-
if (val_validate.ok) {
|
|
411
|
-
set_validate({ ok: false, notice: [] });
|
|
412
|
-
}
|
|
413
|
-
set_status(__spreadProps(__spreadValues(__spreadValues({}, val_status), DataLeveling({
|
|
414
|
-
min,
|
|
415
|
-
max,
|
|
416
|
-
restrict,
|
|
417
|
-
value: Value
|
|
418
|
-
})), {
|
|
419
|
-
eventType: "update",
|
|
420
|
-
eventID: $$.uuid.gen()
|
|
421
|
-
}));
|
|
422
|
-
event.preventDefault();
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
if (onKeyDown)
|
|
426
|
-
onKeyDown(event);
|
|
427
|
-
if (enableFormSubmit)
|
|
428
|
-
SubmitForm(event);
|
|
429
|
-
},
|
|
430
|
-
onChange: (event) => {
|
|
431
|
-
let {
|
|
432
|
-
value: rawValue,
|
|
433
|
-
selectionStart,
|
|
434
|
-
selectionEnd
|
|
435
|
-
} = event.target;
|
|
436
|
-
let value2 = DataLeveling({
|
|
437
|
-
min,
|
|
438
|
-
max,
|
|
439
|
-
restrict,
|
|
440
|
-
value: rawValue
|
|
441
|
-
});
|
|
442
|
-
if (val_isComposing)
|
|
443
|
-
value2.formatValue = rawValue;
|
|
444
|
-
if (value2.formatValue == val_status.formatValue)
|
|
445
|
-
return;
|
|
446
|
-
if (val_validate.ok)
|
|
447
|
-
set_validate({ ok: false, notice: [] });
|
|
448
|
-
set_status(__spreadProps(__spreadValues(__spreadValues({}, val_status), value2), {
|
|
449
|
-
prevValue: val_status.formatValue,
|
|
450
|
-
eventType: "update",
|
|
451
|
-
eventID: $$.uuid.gen(),
|
|
452
|
-
caretFrom: Number(selectionStart),
|
|
453
|
-
caretTo: Number(selectionEnd)
|
|
454
|
-
}));
|
|
455
|
-
if (onChange)
|
|
456
|
-
onChange(event);
|
|
457
|
-
}
|
|
458
|
-
}, others), {
|
|
459
|
-
onCompositionStart: (event) => {
|
|
460
|
-
(others == null ? void 0 : others.onCompositionStart) && (others == null ? void 0 : others.onCompositionStart(event));
|
|
461
|
-
set_isComposing(true);
|
|
462
|
-
},
|
|
463
|
-
onCompositionEnd: (event) => {
|
|
464
|
-
(others == null ? void 0 : others.onCompositionEnd) && (others == null ? void 0 : others.onCompositionEnd(event));
|
|
465
|
-
if (restrict == "text") {
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
let value2 = DataLeveling({
|
|
469
|
-
min,
|
|
470
|
-
max,
|
|
471
|
-
restrict,
|
|
472
|
-
value: val_status.formatValue
|
|
473
|
-
});
|
|
474
|
-
set_status(__spreadProps(__spreadValues(__spreadValues({}, val_status), value2), {
|
|
475
|
-
prevValue: val_status.formatValue,
|
|
476
|
-
eventType: "update",
|
|
477
|
-
eventID: $$.uuid.gen(),
|
|
478
|
-
caretFrom: Number(val_status.formatValue.length + 1),
|
|
479
|
-
caretTo: Number(val_status.formatValue.length + 1)
|
|
480
|
-
}));
|
|
481
|
-
set_isComposing(false);
|
|
482
|
-
}
|
|
483
|
-
})
|
|
484
|
-
)
|
|
485
|
-
}
|
|
486
|
-
);
|
|
487
|
-
};
|
|
488
|
-
const Text = {
|
|
489
|
-
Validate: TextValidate,
|
|
490
|
-
Normal: (rawParams) => {
|
|
491
|
-
var _a, _b;
|
|
492
|
-
rawParams = __spreadValues({}, rawParams);
|
|
493
|
-
if (rawParams.rightIcon)
|
|
494
|
-
rawParams.paddingRight = (_a = rawParams.paddingRight) != null ? _a : 3;
|
|
495
|
-
if (rawParams.leftIcon)
|
|
496
|
-
rawParams.paddingLeft = (_b = rawParams.paddingLeft) != null ? _b : 3;
|
|
497
|
-
return /* @__PURE__ */ jsx(
|
|
498
|
-
Wrapper,
|
|
499
|
-
{
|
|
500
|
-
componentID: rawParams.componentID,
|
|
501
|
-
children: TextInput,
|
|
502
|
-
params: DefaultStyles.Boxish(rawParams)
|
|
503
|
-
}
|
|
504
|
-
);
|
|
505
|
-
},
|
|
506
|
-
Katakana: (props) => /* @__PURE__ */ jsx(
|
|
507
|
-
Text.Normal,
|
|
508
|
-
__spreadValues({
|
|
509
|
-
restrict: "katakana"
|
|
510
|
-
}, props)
|
|
511
|
-
),
|
|
512
|
-
HankakuKatakana: (props) => /* @__PURE__ */ jsx(
|
|
513
|
-
Text.Normal,
|
|
514
|
-
__spreadValues({
|
|
515
|
-
restrict: "hankaku.katakana"
|
|
516
|
-
}, props)
|
|
517
|
-
),
|
|
518
|
-
CreditCard: (props) => /* @__PURE__ */ jsx(
|
|
519
|
-
Text.Normal,
|
|
520
|
-
__spreadValues({
|
|
521
|
-
restrict: "creditCard"
|
|
522
|
-
}, props)
|
|
523
|
-
),
|
|
524
|
-
Tel: (props) => /* @__PURE__ */ jsx(
|
|
525
|
-
Text.Normal,
|
|
526
|
-
__spreadValues({
|
|
527
|
-
restrict: "tel",
|
|
528
|
-
placeholder: "xxx-xxxx-xxxx"
|
|
529
|
-
}, props)
|
|
530
|
-
),
|
|
531
|
-
Number: (props) => /* @__PURE__ */ jsx(Text.Normal, __spreadValues({ restrict: "number" }, props)),
|
|
532
|
-
DigitNumber: (props) => /* @__PURE__ */ jsx(Text.Normal, __spreadValues({ restrict: "digitNumber" }, props)),
|
|
533
|
-
Email: (props) => /* @__PURE__ */ jsx(Text.Normal, __spreadValues({ restrict: "email" }, props)),
|
|
534
|
-
Url: (props) => /* @__PURE__ */ jsx(
|
|
535
|
-
Text.Normal,
|
|
536
|
-
__spreadValues({
|
|
537
|
-
restrict: "url",
|
|
538
|
-
placeholder: "https://example.com"
|
|
539
|
-
}, props)
|
|
540
|
-
),
|
|
541
|
-
Postal: (params) => {
|
|
542
|
-
let [val_postalEventID] = useState($$.uuid.gen());
|
|
543
|
-
useEffect(() => {
|
|
544
|
-
return () => {
|
|
545
|
-
useStore.delete(val_postalEventID);
|
|
546
|
-
};
|
|
547
|
-
}, []);
|
|
548
|
-
return /* @__PURE__ */ jsx(
|
|
549
|
-
Text.Normal,
|
|
550
|
-
__spreadValues({
|
|
551
|
-
restrict: "postal",
|
|
552
|
-
placeholder: "\u90F5\u4FBF\u756A\u53F7",
|
|
553
|
-
leftIndicator: /* @__PURE__ */ jsx(Parts.LeftIndicator, { children: "\u3012" })
|
|
554
|
-
}, params)
|
|
555
|
-
);
|
|
556
|
-
},
|
|
557
|
-
Password: (props) => {
|
|
558
|
-
return /* @__PURE__ */ jsx(
|
|
559
|
-
Text.Normal,
|
|
560
|
-
__spreadValues({
|
|
561
|
-
restrict: "password",
|
|
562
|
-
placeholder: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",
|
|
563
|
-
rightIndicator: /* @__PURE__ */ jsx(
|
|
564
|
-
Parts.RightIndicator,
|
|
565
|
-
{
|
|
566
|
-
padding: 0,
|
|
567
|
-
children: /* @__PURE__ */ jsx(
|
|
568
|
-
Button.Button.Normal.R,
|
|
569
|
-
{
|
|
570
|
-
padding: [0, 1],
|
|
571
|
-
fontColor: "theme",
|
|
572
|
-
borderRadius: "inherit",
|
|
573
|
-
backgroundColor: "inherit",
|
|
574
|
-
height: 1,
|
|
575
|
-
ssEffectsOnActive: ["expand"],
|
|
576
|
-
onMouseOver: (event) => {
|
|
577
|
-
Tooltips.open({
|
|
578
|
-
parent: event.currentTarget,
|
|
579
|
-
gravityPoint: 24,
|
|
580
|
-
padding: [1, 0],
|
|
581
|
-
content: /* @__PURE__ */ jsx(Tooltips.Comps.Body, { children: "\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A" })
|
|
582
|
-
});
|
|
583
|
-
},
|
|
584
|
-
tabIndex: -1,
|
|
585
|
-
onClick: (event) => {
|
|
586
|
-
$$(event.target).parent().parent().parent().find("input").callback((input) => {
|
|
587
|
-
let Input = input[0];
|
|
588
|
-
Input.type = Input.type === "password" ? "text" : "password";
|
|
589
|
-
});
|
|
590
|
-
},
|
|
591
|
-
children: /* @__PURE__ */ jsx(
|
|
592
|
-
FAI,
|
|
593
|
-
{
|
|
594
|
-
icon: faEye,
|
|
595
|
-
freeCSS: {
|
|
596
|
-
pointerEvents: "none"
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
)
|
|
600
|
-
}
|
|
601
|
-
)
|
|
602
|
-
}
|
|
603
|
-
)
|
|
604
|
-
}, props)
|
|
605
|
-
);
|
|
606
|
-
},
|
|
607
|
-
Money: {
|
|
608
|
-
JPY: (props) => /* @__PURE__ */ jsx(
|
|
609
|
-
Text.DigitNumber,
|
|
610
|
-
__spreadValues({
|
|
611
|
-
placeholder: "\u91D1\u984D\u3092\u5165\u529B",
|
|
612
|
-
rightIndicator: /* @__PURE__ */ jsx(
|
|
613
|
-
Parts.RightIndicator,
|
|
614
|
-
{
|
|
615
|
-
children: "\u5186"
|
|
616
|
-
}
|
|
617
|
-
)
|
|
618
|
-
}, props)
|
|
619
|
-
)
|
|
620
|
-
}
|
|
621
|
-
};
|
|
622
|
-
export {
|
|
623
|
-
Text,
|
|
624
|
-
TextInput,
|
|
625
|
-
Text as default
|
|
626
|
-
};
|
|
1
|
+
import{b as o,c as I,d as F}from"../../chunk-VY3566IV.js";import{Fragment as K,jsx as i,jsxs as Z}from"react/jsx-runtime";import{useState as E,useEffect as O}from"react";import{$$ as x,$$fromRoot as Q,useStore as ee}from"../../@utils/_";import C from"../../atoms/Box";import te from"../../atoms/FAI";import ae from"../Button";import w from"../Tooltips";import{faEye as re}from"@fortawesome/free-solid-svg-icons/faEye";import{Wrapper as ie,BoxWrapper as ne,SubmitForm as oe,CommonEffects as le,DefaultStyles as ue}from"./core";import $ from"./Parts";const se={number:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},katakana:{reg:/^[ァ-ヶー ヲ-゚ ]*$/g,exist:!0,reason:"\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},"hankaku.katakana":{reg:/^[ヲ-゚ ]*$/g,exist:!0,reason:"\u534A\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},digitNumber:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},fileName:{reg:/[¥\/:*\?\"\'\|\.\s\n\r\<\>]/g,exist:!1,reason:"\u7A7A\u767D\u307E\u305F\u306F\u4E00\u90E8\u306E\u7279\u6B8A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},creditCard:{reg:/^\d{14,16}$/g,exist:!0,reason:"14~16\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},email:{reg:/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+\.[A-Za-z0-9]+$/,exist:!0,reason:Z(K,{children:[i(C,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),i(C,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:Z(K,{children:[i(C,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),i(C,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),i(C,{children:"\u6570\u5B57\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"})]})},url:{reg:/^https?:\/\/[^\n\s]+(\.|\:)[^\n\s\.\:]+$/,exist:!0,reason:"URL\u5F62\u5F0F : http(s)://\u25EF\u25EF\u25EF\u25EF"},postal:{reg:/^\d{7}$/g,exist:!0,reason:"7\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}},V=e=>{let{restrict:r,value:p=""}=e,t=String(p),a=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(r)&&(t=t.zen2hanNumber()),r=="katakana"&&(t=t.replace(/[^ァ-ヶー ヲ-゚ ]/ig,"")),r=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚ ]/ig,"")),["postal","creditCard"].includes(r)&&(t=t.removeLetters()),["number","digitNumber"].includes(r)&&t&&t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(a=!0),t=t.replace(/[^0-9\.]/ig,"");let n=Number(t);n===0&&(a=!1),a&&(n=-1*n),x.is.exist(e.min)&&(n=Math.max(n,Number(e.min))),x.is.exist(e.max)&&(n=Math.min(n,Number(e.max))),t=String(Math.abs(n))}let s=t;if(r=="digitNumber"){if(t&&t!="-"){let n=[];for(let l=t.length-1;l>=0;l--){n.unshift(t[l]);let g=t.length-1-l+1;l!=0&&g%3==0&&n.unshift(",")}s=n.join("")}}else r=="postal"?t.length>=4&&(s=t.clip(0,3)+"-"+t.clip(3)):r=="creditCard"&&(s=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(r)&&a&&(t="-"+t,s="-"+s),{formatValue:s,dataValue:t}},pe=e=>{let{id:r,restrict:p,val_status:t}=e,a=Q("#"+r)[0];if(a&&t.prevValue&&t.formatValue){let{formatValue:s,prevValue:n,caretFrom:l,caretTo:g}=t;if(p=="creditCard")s.length>=n.length&&l%5==0&&(l++,g++),a.setSelectionRange(l,g);else if(p=="postal")s.length==5&&n.length==3&&(l++,g++),a.setSelectionRange(l,g);else if(p=="digitNumber"){let S=s.length-n.length;S==2&&(l++,g++),S==-2&&(l--,g--),a.setSelectionRange(l,g)}}},U=(e,r)=>{let p={ok:!0,body:""};return(()=>{let t=se[r];if(!t)return;let a=t.reason;if(t){let s=!!(+!!e.match(t.reg)^+!t.exist);p={ok:s,body:s?"":a}}})(),p};function me(e){let{value:r,params:p}=e,{restrict:t="text",maxLength:a=255,required:s}=p,n=[];if(x.is.exist(a)&&r.length>=Number(a)&&n.push({type:"invalid",label:a+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),r){let l=U(r,t);l.ok||n.push({type:"invalid",label:l.body})}else s&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!n.filter(({type:l})=>l=="invalid").length,notice:n}}const de=e=>{let X=e,{componentID:r,tone:p,required:t,restrict:a="text",form:s,autoComplete:n="off",autoCapitalize:l="off",enableFormSubmit:g,clearButton:S=!1,checkValidationAtFirst:ce,onChange:A,onKeyDown:J,onValidate:fe,onUpdateValue:H,onUpdateValidValue:W,value:M="",leftIndicator:ge,rightIndicator:xe,leftIcon:be,rightIcon:he,maxLength:Ie,min:N,max:k}=X,m=F(X,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max"]),q=a=="password"?"password":"text",Y=["number","digitNumber","creditCard"].includes(a)?"numeric":a=="email"?"email":"text",P=I(o({componentID:r},V({min:N,max:k,restrict:a,value:M})),{prevValue:"",eventType:"init",eventID:x.uuid.gen(),caretFrom:null,caretTo:null}),[j,L]=E(!1),[u,v]=E(P),[y,R]=E({ok:!1,notice:[]});return le({params:e,val_status:u,set_status:v,val_validate:y,set_validate:R,DefaultValidation:me,onUpdateValue:H,onUpdateValidValue:W,ExtraOverrideParams:o({},V({min:N,max:k,restrict:a,value:M}))}),O(()=>{pe({id:e.id,restrict:a,val_status:u})},[u]),i(ne,{val_status:u,set_status:v,val_validate:y,params:e,children:i("input",I(o({type:q,inputMode:Y,"data-form":s,"data-input-type":"text","data-validation":y.ok,"data-value":u.dataValue,"data-component-id":u.componentID,value:u.formatValue,autoComplete:n,autoCapitalize:l,onKeyDown:d=>{let{key:f,target:D}=d;{let b=D,{selectionStart:h,selectionEnd:G}=b,T=Number(h),z=Number(G),B=u.formatValue[Number(T)],_=u.formatValue[Number(T)-1];f=="Delete"&&(a=="creditCard"&&B==" "||a=="postal"&&B=="-"||a=="digitNumber"&&B==",")&&(b.setSelectionRange(T+1,z+1),d.preventDefault()),f=="Backspace"&&(a=="creditCard"&&_==" "||a=="postal"&&_=="-"||a=="digitNumber"&&_==",")&&(b.setSelectionRange(T-1,z-1),d.preventDefault()),f=="Enter"||f=="Tab"}if(["number","digitNumber","creditCard"].includes(a)&&f=="Clear"&&v(I(o({},u),{dataValue:"",formatValue:"",eventType:"update",eventID:x.uuid.gen()})),["number","digitNumber"].includes(a)&&["ArrowUp","ArrowDown"].includes(f)){let b=+(f=="ArrowUp")*2-1,h=String(Number(u.dataValue)+b);y.ok&&R({ok:!1,notice:[]}),v(I(o(o({},u),V({min:N,max:k,restrict:a,value:h})),{eventType:"update",eventID:x.uuid.gen()})),d.preventDefault()}J&&J(d),g&&oe(d)},onChange:d=>{let{value:f,selectionStart:D,selectionEnd:b}=d.target,h=V({min:N,max:k,restrict:a,value:f});j&&(h.formatValue=f),h.formatValue!=u.formatValue&&(y.ok&&R({ok:!1,notice:[]}),v(I(o(o({},u),h),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(D),caretTo:Number(b)})),A&&A(d))}},m),{onCompositionStart:d=>{m!=null&&m.onCompositionStart&&(m==null||m.onCompositionStart(d)),L(!0)},onCompositionEnd:d=>{if(m!=null&&m.onCompositionEnd&&(m==null||m.onCompositionEnd(d)),a=="text")return;let f=V({min:N,max:k,restrict:a,value:u.formatValue});v(I(o(o({},u),f),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(u.formatValue.length+1),caretTo:Number(u.formatValue.length+1)})),L(!1)}}))})},c={Validate:U,Normal:e=>{var r,p;return e=o({},e),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(p=e.paddingLeft)!=null?p:3),i(ie,{componentID:e.componentID,children:de,params:ue.Boxish(e)})},Katakana:e=>i(c.Normal,o({restrict:"katakana"},e)),HankakuKatakana:e=>i(c.Normal,o({restrict:"hankaku.katakana"},e)),CreditCard:e=>i(c.Normal,o({restrict:"creditCard"},e)),Tel:e=>i(c.Normal,o({restrict:"tel",placeholder:"xxx-xxxx-xxxx"},e)),Number:e=>i(c.Normal,o({restrict:"number"},e)),DigitNumber:e=>i(c.Normal,o({restrict:"digitNumber"},e)),Email:e=>i(c.Normal,o({restrict:"email"},e)),Url:e=>i(c.Normal,o({restrict:"url",placeholder:"https://example.com"},e)),Postal:e=>{let[r]=E(x.uuid.gen());return O(()=>()=>{ee.delete(r)},[]),i(c.Normal,o({restrict:"postal",placeholder:"\u90F5\u4FBF\u756A\u53F7",leftIndicator:i($.LeftIndicator,{children:"\u3012"})},e))},Password:e=>i(c.Normal,o({restrict:"password",placeholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",rightIndicator:i($.RightIndicator,{padding:0,children:i(ae.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{w.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:i(w.Comps.Body,{children:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().parent().find("input").callback(p=>{let t=p[0];t.type=t.type==="password"?"text":"password"})},children:i(te,{icon:re,freeCSS:{pointerEvents:"none"}})})})},e)),Money:{JPY:e=>i(c.DigitNumber,o({placeholder:"\u91D1\u984D\u3092\u5165\u529B",rightIndicator:i($.RightIndicator,{children:"\u5186"})},e))}};export{c as Text,de as TextInput,c as default};
|