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/Switch.js
CHANGED
|
@@ -1,221 +1 @@
|
|
|
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
|
-
};
|
|
1
|
+
import{b as l,c as f,d as V}from"../../chunk-VY3566IV.js";import{jsx as a,jsxs as w}from"react/jsx-runtime";import{useState as g}from"react";import{$$ as x}from"../../@utils/_";import s from"../../atoms/Box";import F from"../../mols/Row";import N from"../Button";import{Wrapper as L,BoxWrapper as q,SubmitForm as H,CommonEffects as O}from"./core";import{InputSwitchClasses as c}from"../../@styles/componentClasses/_";function U(e){let{value:I,params:o}=e,{required:y}=o,i=[];return y&&!I&&i.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!i.filter(({type:r})=>r=="invalid").length,notice:i}}const W=e=>{let k=e,{componentID:I,color:o="posi",required:y,form:i,id:r,enableFormSubmit:R,checkValidationAtFirst:A,onChange:b,onKeyDown:v,onValidate:K,onUpdateValue:T,onUpdateValidValue:B,value:m="",icon:C="",appearance:p="material"}=k,_=V(k,["componentID","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","icon","appearance"]),E={componentID:e.componentID||"",dataValue:m,eventType:"init",eventID:x.uuid.gen()},[t,h]=g(E),[d,S]=g({ok:!1,notice:[]}),u=!!t.dataValue;return O({params:e,val_status:t,set_status:h,val_validate:d,set_validate:S,DefaultValidation:U,onUpdateValue:T,onUpdateValidValue:B,ExtraOverrideParams:{dataValue:m,formatValue:m}}),w(q,{val_status:t,set_status:h,val_validate:d,params:e,children:[a("input",l({type:"checkbox","data-form":i,"data-input-type":"switch","data-validation":d.ok,"data-component-id":t.componentID,"data-value":t.dataValue,checked:t.dataValue,className:c("Input"),id:r,onKeyDown:n=>{v&&v(n),R&&H(n)},onChange:n=>{d.ok&&S({ok:!1,notice:[]}),h(f(l({},t),{dataValue:n.target.checked,eventType:"update",eventID:x.uuid.gen()})),b&&b(n)}},_)),a(N.Label.Plain,{tabIndex:-1,htmlFor:r,padding:"1/3",transition:"middle",borderRadius:"1.tone.primary",className:c("Label"),children:a(s,f(l({},p=="applely"?{padding:"1/4",isRounded:!0,backgroundColor:u?o:"5.layer.darker"}:{}),{children:w(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[p=="material"&&a(s,{position:"absolute",backgroundColor:u?o:"5.layer.darker",borderRadius:"sphere",unitHeight:1,transition:"middle",width:1,className:c("Bar"),opacity:"middle"}),a(s,{position:"absolute",top:0,left:0,backgroundColor:p=="material"&&u?o:"white",transition:"middle",ssSphere:2.5,boxShadow:"1.remark",className:c("Dot"),children:C&&a(s,{transition:"middle",ssSquare:2,flexCenter:!0,fontColor:p=="applely"&&u?o:"white",children:C})})]})}))})]})},D=e=>(e=l({},e),e.color=e.color||"theme",a(L,{componentID:e.componentID,children:W,params:e}));export{D as Switch,D as default};
|