amotify 0.2.205 → 0.2.206
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/fn/Input/Switch.js +1 -1
- package/package.json +2 -2
package/dist/fn/Input/Switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as a,c as i,d as V}from"../../chunk-C5N2D3ZX.js";import{jsx as t,jsxs as U}from"react/jsx-runtime";import{UUID as k}from"jmini";import{useState as D}from"react";import c from"../../atoms/Box";import{Row as L}from"../../mols";import{Label as A}from"../Button";import{OptionalInputWrapper as W,BoxWrapper as P,CoreEffects as B}from"./core";import{InputSwitchClasses as f}from"../../@styles/componentClasses";function H(e){let{value:o,states:n}=e,{required:b}=n,s=[];return b&&!o&&s.push({type:"invalid",label:"ON\u306B\u306A\u3063\u3066\u3044\u307E\u305B\u3093"}),{ok:!s.filter(({type:m})=>m=="invalid").length,notice:s}}const O=e=>{let T=e,{componentId:o,color:n="posi",required:b,form:s,id:m,enableFormSubmit:M,checkValidationAtFirst:q,onChange:R,onKeyDown:w,onValidate:K,onValidateDelay:$,onUpdateValue:G,onUpdateValidValue:J,onUserAction:Q,size:C="regular",value:_="",icon:x="",isApply:l=!1}=T,N=V(T,["componentId","color","required","form","id","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onValidateDelay","onUpdateValue","onUpdateValidValue","onUserAction","size","value","icon","isApply"]),[r,S]=D({componentId:e.componentId||"",dataValue:_,eventType:"init",eventID:k()}),[v,F]=D({ok:!1,notice:[]}),p=!!r.dataValue;B.CommonEffects({type:"switch",states:e,val_status:r,set_status:S,val_validate:v,set_validate:F,SystemValidation:H});let h="middle",g=5,I=3;return l&&(I=4),U(P,{val_status:r,set_status:S,val_validate:v,states:e,children:[t(c,a({htmlTag:"input",type:"checkbox","data-component-id":r.componentId,checked:r.dataValue,className:f("Input"),id:m,onKeyDown:u=>{w&&w(u),M&&B.SubmitForm(u,s)},onChange:u=>{let{checked:z}=u.target;v.ok&&F({ok:!1,notice:[]}),S(E=>i(a({},E),{dataValue:z,eventType:"update",eventID:k()})),R&&R(u)}},N)),t(A.Plain,{tabIndex:-1,htmlFor:m,padding:"1/4",transition:h,borderRadius:"1.tone.primary",className:f("Label"),children:t(c,i(a({},l?{padding:"1/4",isRounded:!0,backgroundColor:p?n:"layer.3"}:{}),{children:U(L.Center,{unitHeight:C=="small"?2:C=="regular"?2.5:C=="large"?3:0,position:"relative",freeCSS:{aspectRatio:(g+I)/g},children:[!l&&t(c,{position:"absolute",backgroundColor:p?n:"layer.5",isRounded:!0,transition:h,width:1,opacity:"middle",className:f("Bar"),freeCSS:{height:"40%"}}),t(c,{position:"absolute",top:0,backgroundColor:!l&&p?n:"white",transition:h,isRounded:!0,flexCenter:!0,boxShadow:"1.remark",className:f("Dot"),freeCSS:{height:"100%",aspectRatio:"1",left:p?`calc(${I.ratio(g+I)}%)`:0},children:x&&t(c,{transition:h,flexCenter:!0,fontColor:p?l?n:"white":"6.clear",children:x})})]})}))})]})},y=e=>{let o=a({},e);return o.value=!!o.value,o.color=o.color||"theme",t(W,{componentId:o.componentId,children:O,states:o})},d=y;d.S=e=>t(y,i(a({},e),{size:"small"})),d.R=e=>t(y,i(a({},e),{size:"regular"})),d.L=e=>t(y,i(a({},e),{size:"large"}));export{d as Switch,d as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amotify",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.206",
|
|
4
4
|
"description": "UI Component for React,NextJS,esbuild",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "run-p clean build:*",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
91
91
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
92
92
|
"dotenv": "^17.0.1",
|
|
93
|
-
"jmini": "^0.0.
|
|
93
|
+
"jmini": "^0.0.95",
|
|
94
94
|
"react": "^18.3.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|