@geckou/ui-react 0.6.0 → 0.7.0
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/README.md +22 -0
- package/dist/components/CheckBox.d.ts +7 -1
- package/dist/components/CheckBox.js +28 -19
- package/dist/components/CheckBoxes.js +26 -25
- package/dist/components/DatePicker.js +86 -80
- package/dist/components/DateRangePicker.js +47 -47
- package/dist/components/ErrorMessage.js +10 -10
- package/dist/components/LabeledCheckbox.d.ts +3 -1
- package/dist/components/LabeledCheckbox.js +18 -16
- package/dist/components/SearchableSelectBox.d.ts +2 -1
- package/dist/components/SearchableSelectBox.js +52 -45
- package/dist/components/SelectBox.js +54 -53
- package/dist/components/SlideDownUi.js +9 -9
- package/dist/components/TextArea.js +51 -43
- package/dist/components/TextBox.d.ts +3 -1
- package/dist/components/TextBox.js +62 -60
- package/package.json +2 -2
|
@@ -1,99 +1,101 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { isEmptyValue as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { InputBox as
|
|
6
|
-
import { ErrorMessage as
|
|
7
|
-
function
|
|
8
|
-
name:
|
|
9
|
-
value:
|
|
10
|
-
onChange:
|
|
2
|
+
import { jsxs as G, jsx as x } from "react/jsx-runtime";
|
|
3
|
+
import { isEmptyValue as J, convertFullWidthToHalfWidth as v, validateInputValue as K } from "@geckou/ui-core";
|
|
4
|
+
import { useState as O, useRef as n, useEffect as P } from "react";
|
|
5
|
+
import { InputBox as Q } from "./InputBox.js";
|
|
6
|
+
import { ErrorMessage as R } from "./ErrorMessage.js";
|
|
7
|
+
function $({
|
|
8
|
+
name: E,
|
|
9
|
+
value: V,
|
|
10
|
+
onChange: e,
|
|
11
11
|
cssStyle: r,
|
|
12
|
-
inputType:
|
|
13
|
-
placeholder:
|
|
12
|
+
inputType: b = "text",
|
|
13
|
+
placeholder: g = "入力してください",
|
|
14
14
|
isDisabled: l,
|
|
15
15
|
isRequired: f,
|
|
16
|
-
maxLength:
|
|
17
|
-
autocomplete:
|
|
18
|
-
validates:
|
|
19
|
-
before:
|
|
20
|
-
after:
|
|
21
|
-
id:
|
|
22
|
-
role:
|
|
23
|
-
ariaLabel:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
maxLength: M = 30,
|
|
17
|
+
autocomplete: T = "off",
|
|
18
|
+
validates: j = [],
|
|
19
|
+
before: k,
|
|
20
|
+
after: B,
|
|
21
|
+
id: I,
|
|
22
|
+
role: W,
|
|
23
|
+
ariaLabel: w,
|
|
24
|
+
ariaLabelledBy: d,
|
|
25
|
+
ariaExpanded: C,
|
|
26
|
+
ariaControls: F,
|
|
27
|
+
ariaActivedescendant: H,
|
|
28
|
+
ariaAutocomplete: N,
|
|
29
|
+
onKeyDown: q
|
|
29
30
|
}) {
|
|
30
|
-
var
|
|
31
|
-
const [o,
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
31
|
+
var c, m;
|
|
32
|
+
const [o, z] = O([]), t = V ?? "", a = () => {
|
|
33
|
+
z(K(t, { isRequired: f, validates: j }));
|
|
34
|
+
}, A = n(t), p = n(!1);
|
|
35
|
+
P(() => {
|
|
35
36
|
if (!p.current) {
|
|
36
|
-
if (
|
|
37
|
-
|
|
37
|
+
if (t === A.current) {
|
|
38
|
+
J(t) || a();
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
p.current = !0;
|
|
41
42
|
}
|
|
42
43
|
a();
|
|
43
|
-
}, [
|
|
44
|
+
}, [t]);
|
|
44
45
|
const i = n(!1);
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
46
|
+
return /* @__PURE__ */ G(
|
|
47
|
+
Q,
|
|
47
48
|
{
|
|
48
49
|
cssStyle: r,
|
|
49
50
|
className: "inline-flex [&>input]:flex-auto",
|
|
50
51
|
isErrored: !!o.length,
|
|
51
52
|
isDisabled: l,
|
|
52
53
|
children: [
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
54
|
+
k,
|
|
55
|
+
/* @__PURE__ */ x(
|
|
55
56
|
"input",
|
|
56
57
|
{
|
|
57
|
-
type:
|
|
58
|
-
id:
|
|
59
|
-
name:
|
|
60
|
-
role:
|
|
61
|
-
"aria-label":
|
|
62
|
-
"aria-
|
|
63
|
-
"aria-
|
|
64
|
-
"aria-
|
|
65
|
-
"aria-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
type: b,
|
|
59
|
+
id: I,
|
|
60
|
+
name: E,
|
|
61
|
+
role: W,
|
|
62
|
+
"aria-label": d ? void 0 : w,
|
|
63
|
+
"aria-labelledby": d,
|
|
64
|
+
"aria-expanded": C,
|
|
65
|
+
"aria-controls": F,
|
|
66
|
+
"aria-activedescendant": H,
|
|
67
|
+
"aria-autocomplete": N,
|
|
68
|
+
onKeyDown: q,
|
|
69
|
+
value: t,
|
|
68
70
|
required: f,
|
|
69
|
-
placeholder:
|
|
71
|
+
placeholder: g,
|
|
70
72
|
disabled: l,
|
|
71
|
-
autoComplete:
|
|
72
|
-
maxLength:
|
|
73
|
+
autoComplete: T,
|
|
74
|
+
maxLength: M,
|
|
73
75
|
"aria-invalid": o.length ? "true" : void 0,
|
|
74
76
|
onChange: (u) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
i.current ?
|
|
77
|
+
const s = u.target.value;
|
|
78
|
+
e == null || e(
|
|
79
|
+
i.current ? s : v(s)
|
|
78
80
|
);
|
|
79
81
|
},
|
|
80
82
|
onCompositionStart: () => {
|
|
81
83
|
i.current = !0;
|
|
82
84
|
},
|
|
83
85
|
onCompositionEnd: (u) => {
|
|
84
|
-
i.current = !1,
|
|
86
|
+
i.current = !1, e == null || e(v(u.currentTarget.value));
|
|
85
87
|
},
|
|
86
88
|
onBlur: () => a()
|
|
87
89
|
}
|
|
88
90
|
),
|
|
89
|
-
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
91
|
+
B,
|
|
92
|
+
/* @__PURE__ */ x(
|
|
93
|
+
R,
|
|
92
94
|
{
|
|
93
95
|
errorMessages: o,
|
|
94
96
|
cssStyle: {
|
|
95
|
-
textColor: (
|
|
96
|
-
backgroundColor: (
|
|
97
|
+
textColor: (c = r == null ? void 0 : r.error) == null ? void 0 : c.backgroundColor,
|
|
98
|
+
backgroundColor: (m = r == null ? void 0 : r.error) == null ? void 0 : m.textColor
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
)
|
|
@@ -102,5 +104,5 @@ function Z({
|
|
|
102
104
|
);
|
|
103
105
|
}
|
|
104
106
|
export {
|
|
105
|
-
|
|
107
|
+
$ as TextBox
|
|
106
108
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geckou/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A set of reusable React UI components (forms) by Geckou",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": "^19.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@geckou/ui-core": "^0.
|
|
43
|
+
"@geckou/ui-core": "^0.7.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "vite build && node scripts/copy-assets.mjs",
|