amotify 0.1.31 → 0.1.32
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/@styles/componentClasses/_.css +68 -65
- package/dist/@styles/componentClasses/_.js +39 -39
- package/dist/@styles/index.css +68 -65
- package/dist/@styles/index.js +39 -39
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +68 -65
- package/dist/@styles/style.js +39 -39
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.js +470 -1
- package/dist/@utils/LaunchReactApp.js +78 -1
- package/dist/@utils/_.js +12 -1
- package/dist/@utils/collectForm.js +96 -1
- package/dist/@utils/color.js +103 -1
- package/dist/@utils/config.js +101 -1
- package/dist/@utils/fin.js +39 -1
- package/dist/@utils/getElement.js +13 -1
- package/dist/@utils/jsminEx.js +172 -1
- package/dist/@utils/pageTransit.js +33 -1
- package/dist/@utils/useRecycle.js +44 -1
- package/dist/@utils/useStore.js +54 -1
- package/dist/atoms/Box.js +20 -1
- package/dist/atoms/FAI.js +148 -1
- package/dist/atoms/Flex.js +34 -1
- package/dist/atoms/Grid.js +17 -1
- package/dist/atoms/Img.js +65 -1
- package/dist/atoms/Logo.js +359 -51
- package/dist/atoms/P.js +20 -1
- package/dist/atoms/Placeholder.js +44 -1
- package/dist/atoms/Span.js +20 -1
- package/dist/atoms/_.js +9 -1
- package/dist/chunk-JJ3PEWPN.js +60 -0
- package/dist/fn/Button.js +316 -1
- package/dist/fn/Cropper.js +1009 -1
- package/dist/fn/Effect/Fade.js +88 -1
- package/dist/fn/Effect/Pudding.js +22 -1
- package/dist/fn/Effect/Ripple.js +117 -3
- package/dist/fn/Effect/_.js +14 -1
- package/dist/fn/Input/AutoHeightText.js +112 -1
- package/dist/fn/Input/Checker.js +36 -1
- package/dist/fn/Input/Chips/Selector.js +472 -1
- package/dist/fn/Input/Chips/_.js +349 -1
- package/dist/fn/Input/Contenteditable.js +160 -1
- package/dist/fn/Input/DigitCharacters.js +275 -1
- package/dist/fn/Input/Filer.js +619 -1
- package/dist/fn/Input/Hidden.js +48 -1
- package/dist/fn/Input/List.js +450 -1
- package/dist/fn/Input/Parts.js +121 -1
- package/dist/fn/Input/Plain.js +12 -1
- package/dist/fn/Input/RichSelect.js +279 -1
- package/dist/fn/Input/Search.js +53 -1
- package/dist/fn/Input/Segmented.js +245 -1
- package/dist/fn/Input/Select.js +278 -1
- package/dist/fn/Input/Slider.js +538 -1
- package/dist/fn/Input/Switch.js +221 -1
- package/dist/fn/Input/Text.js +626 -1
- package/dist/fn/Input/TextArea.js +151 -1
- package/dist/fn/Input/Time/Picker.js +1457 -1
- package/dist/fn/Input/Time/_.js +867 -1
- package/dist/fn/Input/_.js +48 -1
- package/dist/fn/Input/core.js +626 -1
- package/dist/fn/Layout/PageNotFound.js +90 -1
- package/dist/fn/Layout/PageRouter.js +87 -1
- package/dist/fn/Layout/PageViewController.js +29 -1
- package/dist/fn/Layout/Plate.js +37 -1
- package/dist/fn/Layout/RootViewController.js +315 -1
- package/dist/fn/Layout/SwipeView.js +348 -1
- package/dist/fn/Layout/TabBar.js +72 -1
- package/dist/fn/Layout/_.js +22 -1
- package/dist/fn/Loader/_.js +104 -1
- package/dist/fn/Loader/corner.js +85 -1
- package/dist/fn/Loader/mini.js +125 -1
- package/dist/fn/Loader/top.js +73 -1
- package/dist/fn/Sheet.js +1101 -1
- package/dist/fn/Snackbar.js +216 -1
- package/dist/fn/Table/Data.js +974 -1
- package/dist/fn/Table/Drag.js +435 -1
- package/dist/fn/Table/Normal.js +136 -1
- package/dist/fn/Table/Parts.js +41 -1
- package/dist/fn/Table/Wrapper.js +60 -1
- package/dist/fn/Table/_.js +16 -1
- package/dist/fn/Table/cellStyling.js +51 -1
- package/dist/fn/Tooltips.js +58 -1
- package/dist/fn/_.js +10 -1
- package/dist/index.js +20 -1
- package/dist/mols/Accordion.js +152 -1
- package/dist/mols/Column.js +16 -1
- package/dist/mols/LinkifyText.js +42 -1
- package/dist/mols/List.js +42 -1
- package/dist/mols/Row.js +47 -1
- package/dist/mols/Text.js +67 -1
- package/dist/mols/_.js +6 -1
- package/dist/temps/_.js +1 -1
- package/dist/temps/designBook.js +3639 -20
- package/package.json +1 -1
package/dist/fn/Input/Switch.js
CHANGED
|
@@ -1 +1,221 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-JJ3PEWPN.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import {
|
|
8
|
+
useState
|
|
9
|
+
} from "react";
|
|
10
|
+
import {
|
|
11
|
+
$$
|
|
12
|
+
} from "../../@utils/_";
|
|
13
|
+
import Box from "../../atoms/Box";
|
|
14
|
+
import Row from "../../mols/Row";
|
|
15
|
+
import Button from "../Button";
|
|
16
|
+
import {
|
|
17
|
+
Wrapper,
|
|
18
|
+
BoxWrapper,
|
|
19
|
+
SubmitForm,
|
|
20
|
+
CommonEffects
|
|
21
|
+
} from "./core";
|
|
22
|
+
import { InputSwitchClasses } from "../../@styles/componentClasses/_";
|
|
23
|
+
function DefaultValidation(props) {
|
|
24
|
+
let { value, params } = props;
|
|
25
|
+
let { required } = params;
|
|
26
|
+
let notice = [];
|
|
27
|
+
if (required && !value) {
|
|
28
|
+
notice.push({ type: "invalid", label: "ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093" });
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
ok: !notice.filter(({ type }) => type == "invalid").length,
|
|
32
|
+
notice
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const SwitchInput = (params) => {
|
|
36
|
+
let _a = params, {
|
|
37
|
+
componentID,
|
|
38
|
+
color = "posi",
|
|
39
|
+
required,
|
|
40
|
+
form,
|
|
41
|
+
id,
|
|
42
|
+
enableFormSubmit,
|
|
43
|
+
checkValidationAtFirst,
|
|
44
|
+
onChange,
|
|
45
|
+
onKeyDown,
|
|
46
|
+
onValidate,
|
|
47
|
+
onUpdateValue,
|
|
48
|
+
onUpdateValidValue,
|
|
49
|
+
value = "",
|
|
50
|
+
icon = "",
|
|
51
|
+
appearance = "material"
|
|
52
|
+
} = _a, others = __objRest(_a, [
|
|
53
|
+
"componentID",
|
|
54
|
+
"color",
|
|
55
|
+
"required",
|
|
56
|
+
"form",
|
|
57
|
+
"id",
|
|
58
|
+
"enableFormSubmit",
|
|
59
|
+
"checkValidationAtFirst",
|
|
60
|
+
"onChange",
|
|
61
|
+
"onKeyDown",
|
|
62
|
+
"onValidate",
|
|
63
|
+
"onUpdateValue",
|
|
64
|
+
"onUpdateValidValue",
|
|
65
|
+
"value",
|
|
66
|
+
"icon",
|
|
67
|
+
"appearance"
|
|
68
|
+
]);
|
|
69
|
+
let Default_Status = {
|
|
70
|
+
componentID: params.componentID || "",
|
|
71
|
+
dataValue: value,
|
|
72
|
+
eventType: "init",
|
|
73
|
+
eventID: $$.uuid.gen()
|
|
74
|
+
};
|
|
75
|
+
let [val_status, set_status] = useState(Default_Status);
|
|
76
|
+
let [val_validate, set_validate] = useState({
|
|
77
|
+
ok: false,
|
|
78
|
+
notice: []
|
|
79
|
+
});
|
|
80
|
+
let isChecked = !!val_status.dataValue;
|
|
81
|
+
CommonEffects({
|
|
82
|
+
params,
|
|
83
|
+
val_status,
|
|
84
|
+
set_status,
|
|
85
|
+
val_validate,
|
|
86
|
+
set_validate,
|
|
87
|
+
DefaultValidation,
|
|
88
|
+
onUpdateValue,
|
|
89
|
+
onUpdateValidValue,
|
|
90
|
+
ExtraOverrideParams: {
|
|
91
|
+
dataValue: value,
|
|
92
|
+
formatValue: value
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return /* @__PURE__ */ jsxs(
|
|
96
|
+
BoxWrapper,
|
|
97
|
+
{
|
|
98
|
+
val_status,
|
|
99
|
+
set_status,
|
|
100
|
+
val_validate,
|
|
101
|
+
params,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"input",
|
|
105
|
+
__spreadValues({
|
|
106
|
+
type: "checkbox",
|
|
107
|
+
"data-form": form,
|
|
108
|
+
"data-input-type": "switch",
|
|
109
|
+
"data-validation": val_validate.ok,
|
|
110
|
+
"data-component-id": val_status.componentID,
|
|
111
|
+
"data-value": val_status.dataValue,
|
|
112
|
+
checked: val_status.dataValue,
|
|
113
|
+
className: InputSwitchClasses("Input"),
|
|
114
|
+
id,
|
|
115
|
+
onKeyDown: (event) => {
|
|
116
|
+
if (onKeyDown)
|
|
117
|
+
onKeyDown(event);
|
|
118
|
+
if (enableFormSubmit)
|
|
119
|
+
SubmitForm(event);
|
|
120
|
+
},
|
|
121
|
+
onChange: (event) => {
|
|
122
|
+
if (val_validate.ok)
|
|
123
|
+
set_validate({ ok: false, notice: [] });
|
|
124
|
+
set_status(__spreadProps(__spreadValues({}, val_status), {
|
|
125
|
+
dataValue: event.target.checked,
|
|
126
|
+
eventType: "update",
|
|
127
|
+
eventID: $$.uuid.gen()
|
|
128
|
+
}));
|
|
129
|
+
if (onChange)
|
|
130
|
+
onChange(event);
|
|
131
|
+
}
|
|
132
|
+
}, others)
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
135
|
+
Button.Label.Plain,
|
|
136
|
+
{
|
|
137
|
+
tabIndex: -1,
|
|
138
|
+
htmlFor: id,
|
|
139
|
+
padding: "1/3",
|
|
140
|
+
transition: "middle",
|
|
141
|
+
borderRadius: "1.tone.primary",
|
|
142
|
+
className: InputSwitchClasses("Label"),
|
|
143
|
+
children: /* @__PURE__ */ jsx(
|
|
144
|
+
Box,
|
|
145
|
+
__spreadProps(__spreadValues({}, appearance == "applely" ? {
|
|
146
|
+
padding: "1/4",
|
|
147
|
+
isRounded: true,
|
|
148
|
+
backgroundColor: isChecked ? color : "5.layer.darker"
|
|
149
|
+
} : {}), {
|
|
150
|
+
children: /* @__PURE__ */ jsxs(
|
|
151
|
+
Row.Center,
|
|
152
|
+
{
|
|
153
|
+
unitHeight: 2.5,
|
|
154
|
+
position: "relative",
|
|
155
|
+
freeCSS: {
|
|
156
|
+
width: 12 * 4.5
|
|
157
|
+
},
|
|
158
|
+
children: [
|
|
159
|
+
appearance == "material" && /* @__PURE__ */ jsx(
|
|
160
|
+
Box,
|
|
161
|
+
{
|
|
162
|
+
position: "absolute",
|
|
163
|
+
backgroundColor: isChecked ? color : "5.layer.darker",
|
|
164
|
+
borderRadius: "sphere",
|
|
165
|
+
unitHeight: 1,
|
|
166
|
+
transition: "middle",
|
|
167
|
+
width: 1,
|
|
168
|
+
className: InputSwitchClasses("Bar"),
|
|
169
|
+
opacity: "middle"
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
Box,
|
|
174
|
+
{
|
|
175
|
+
position: "absolute",
|
|
176
|
+
top: 0,
|
|
177
|
+
left: 0,
|
|
178
|
+
backgroundColor: appearance == "material" && isChecked ? color : "white",
|
|
179
|
+
transition: "middle",
|
|
180
|
+
ssSphere: 2.5,
|
|
181
|
+
boxShadow: "1.remark",
|
|
182
|
+
className: InputSwitchClasses("Dot"),
|
|
183
|
+
children: icon && /* @__PURE__ */ jsx(
|
|
184
|
+
Box,
|
|
185
|
+
{
|
|
186
|
+
transition: "middle",
|
|
187
|
+
ssSquare: 2,
|
|
188
|
+
flexCenter: true,
|
|
189
|
+
fontColor: appearance == "applely" && isChecked ? color : "white",
|
|
190
|
+
children: icon
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
})
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
const Switch = (rawParams) => {
|
|
207
|
+
rawParams = __spreadValues({}, rawParams);
|
|
208
|
+
rawParams.color = rawParams.color || "theme";
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
Wrapper,
|
|
211
|
+
{
|
|
212
|
+
componentID: rawParams.componentID,
|
|
213
|
+
children: SwitchInput,
|
|
214
|
+
params: rawParams
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
export {
|
|
219
|
+
Switch,
|
|
220
|
+
Switch as default
|
|
221
|
+
};
|