amotify 0.2.42 → 0.2.43
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.
|
@@ -55,7 +55,6 @@ declare namespace Autocomplete {
|
|
|
55
55
|
addCallback(): void;
|
|
56
56
|
};
|
|
57
57
|
type SelectedComponentProps = {
|
|
58
|
-
children: ReactElement;
|
|
59
58
|
value: Value;
|
|
60
59
|
label: ReactElement;
|
|
61
60
|
removeCallback(event: any): void;
|
|
@@ -70,6 +69,8 @@ declare namespace Autocomplete {
|
|
|
70
69
|
set_optionFocused: React.Dispatch<React.SetStateAction<Value>>;
|
|
71
70
|
val_optionsDict: OptionsDict;
|
|
72
71
|
set_optionsDict: React.Dispatch<React.SetStateAction<OptionsDict>>;
|
|
72
|
+
val_preventDynamicSearchOnKeywordChange: boolean;
|
|
73
|
+
set_preventDynamicSearchOnKeywordChange: React.Dispatch<React.SetStateAction<boolean>>;
|
|
73
74
|
val_preventOpenSelectorOnFocus: boolean;
|
|
74
75
|
set_preventOpenSelectorOnFocus: React.Dispatch<React.SetStateAction<boolean>>;
|
|
75
76
|
val_selectorOpen: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as v,c as V,d as j,e as Q}from"../../chunk-C5N2D3ZX.js";import{Fragment as H,jsx as l,jsxs as U}from"react/jsx-runtime";import{useState as O,useEffect as k,useRef as ae}from"react";import r from"@mingoo/jsmin";import{ExtractStyles as ne,useStore as Y}from"../../@utils";import{Box as R,Span as re,FAI as q,Column as ie}from"../../atoms";import{Text as B,Row as G}from"../../mols";import Z from"../Button";import{Loader as se}from"../Loader";import{Sheet as K}from"../Sheet";import{OptionalInputWrapper as ue,BoxWrapper as ce,CoreEffects as N,DefaultBoxishStyles as pe}from"./core";import{InputAutocompleteClasses as L}from"../../@styles/componentClasses";import{InputLabel as de}from"./Label";import{RightIcon as ee}from".";function me(t){let{value:e,states:a}=t,{required:o,options:c,min:u,max:S}=a;u=u||0,S=S||65535;let n=[],i=e.filter(m=>m!=="null").length;return o&&(i||n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),i<u&&n.push({type:"invalid",label:u+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),i>S&&n.push({type:"invalid",label:S+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!n.filter(({type:m})=>m=="invalid").length,notice:n}}const A={InitOptions:t=>{let e=[];return t.forEach(a=>{let{type:o,label:c,value:u,searchValue:S}=a,n=S||(r.is.string(c)?c:"")||(r.is.string(u)?u:"");e.push(V(v({},a),{searchValue:n,type:o||"selector",value:r.JsonTo(u)}))}),e},FilterSelectableOptions:(t,e)=>{let a=t.val_options;if(e||(a=t.val_options.filter(o=>o.type!="label")),t.val_keyword){let o=t.val_keyword.toLower().replace(/ /g,"");a=a.filter(c=>(c.searchValue||"").toLower().replace(/ /g,"").includes(o))}return a}},F={Shallow:t=>{let{rootStates:e,val_status:a}=t,o=ne(e);return l(R,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:l(B.Description,V(v({className:e.className},o),{position:"absolute",width:1,freeCSS:V(v({},o.freeCSS),{color:"orange"}),"data-id":"shallow_"+a.componentID,children:l(R,{"data-input-value-shallow":a.componentID,children:"A"})}))})},Button:t=>{let{rootStates:e,val_keyword:a,set_keyword:o,val_optionFocused:c,set_optionFocused:u,val_options:S,set_options:n,val_optionsDict:i,set_optionsDict:m,val_preventOpenSelectorOnFocus:s,set_preventOpenSelectorOnFocus:p,val_selectorOpen:f,set_selectorOpen:y,val_status:d,set_status:I,val_validate:g,set_validate:C}=t,X=e,{tone:w,required:b,form:T,className:x,multiSelect:P,enableFormSubmit:E,checkValidationAtFirst:z,onValidate:J,onUpdateValue:W,onUpdateValidValue:fe,value:Se="",options:ve,leftIndicator:he,rightIndicator:ye,leftIcon:_e,rightIcon:Ie,componentID:ge,status_id:be,wrapStyles:Oe,emptySelect:De,SearchInput:Ve,SearchInputPlaceholder:Ce,SelectedComponent:we,SelectorComponent:ke,SelectorGravityPoint:xe,DynamicOptionsOnSearch:Re}=X,_=j(X,["tone","required","form","className","multiSelect","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","wrapStyles","emptySelect","SearchInput","SearchInputPlaceholder","SelectedComponent","SelectorComponent","SelectorGravityPoint","DynamicOptionsOnSearch"]);k(()=>{var D;if(e.disabled||!f)return;let h=A.FilterSelectableOptions(t);u(((D=h[0])==null?void 0:D.value)||null)},[a]),k(()=>{d.eventType!="init"&&(e.max==d.dataValue.length?(y(!1),p(!0),setTimeout(()=>{let h=r('[data-input-origin="'+e.componentID+'"]');h&&h.focus()},10)):r("#SearchInput_"+e.componentID).focus())},[d.dataValue]);let M="autocomplete-sheet-"+e.componentID;return k(()=>{let h="autocomplete-click-"+e.componentID;if(f){let D=r('[data-input-origin="'+e.componentID+'"]');if(!D)return;r("#SearchInput_"+e.componentID).focus(),K.open({sheetID:M,type:"custom",parent:D[0],padding:["1/4",0],gravityPoint:e.SelectorGravityPoint||22,close_option:{aroundClick:!1},content:l(F.Selector,v({},t))}),r(document).addEvent({eventID:h,eventType:"click",callback:oe=>{let $=r(oe.target),le=!!r($).parent("."+L("Core")).length;r($).parent("."+L("Selector")).length||le||y(!1)}})}else r(document).removeEvent([h]),o(""),K.close(M)},[f]),k(()=>{if(e.disabled||!f)return;K.customSheet.reposition(M);let h=Y.get("refresh-autocomplete-selector-"+e.componentID);h&&h(t)},[S,d.dataValue,a,c]),l(H,{children:l(R,V(v({tabIndex:0},_),{"data-disabled":e.disabled,"data-name":e.name,"data-value":r.JsonTo(d.dataValue),"data-form":T,"data-show-validation":N.isShowValidation(g,d,!!z),"data-validation":g.ok,"data-component-id":d.componentID,"data-input-origin":d.componentID,"data-focus":!!f,"data-input-type":"autocomplete-"+(P?"multi":"single"),className:[x,L("Core")].join(" "),onFocus:h=>{if(_!=null&&_.onFocus&&(_==null||_.onFocus(h)),!e.disabled){if(s)return p(!1);y(!0),h.preventDefault()}},onClick:h=>{_!=null&&_.onClick&&(_==null||_.onClick(h)),!e.disabled&&y(!0)},onKeyDown:h=>{let{key:D}=h;E&&N.SubmitForm(h),!f&&(D==" "||D=="ArrowDown"||D=="ArrowUp"||D=="Enter")&&y(!0)},children:U(G.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[l(F.Selected,v({},t)),l(re,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),l(F.SearchInput,v({},t))]})}))})},SearchInput:t=>{let{rootStates:e}=t;return e.disabled||!t.val_selectorOpen?null:l(R,{id:"SearchInput_"+e.componentID,placeholder:e.SearchInputPlaceholder||"\u691C\u7D22...",opacity:t.val_selectorOpen?"max":"trans","data-form":e.form,transition:"middle",flexSizing:0,htmlTag:"input",border:"unset",backgroundColor:"trans",value:t.val_keyword,freeCSS:{outline:"none"},onKeyDown:a=>{let{key:o,metaKey:c,ctrlKey:u}=a,S=c||u;o=="Escape"?(t.set_selectorOpen(!1),t.set_preventOpenSelectorOnFocus(!0),setTimeout(()=>{let n=r('[data-input-origin="'+e.componentID+'"]');n&&n.focus()},10)):o=="Tab"?t.set_selectorOpen(!1):o==" "?r.scope(()=>{t.val_selectorOpen||t.val_keyword||(a.preventDefault(),t.set_selectorOpen(!0))}):o=="Backspace"?r.scope(()=>{if(t.val_keyword)return;let n=[...t.val_status.dataValue];n.pop(),t.set_status(i=>V(v({},i),{dataValue:n,eventType:"update",eventID:r.uuid.gen()}))}):o=="Enter"&&r.scope(()=>{if(!t.val_selectorOpen)return t.set_selectorOpen(!0);if(!t.val_optionFocused)return;let n=t.val_options.find(m=>m.value==t.val_optionFocused);if(!n)return;let{value:i}=n;t.set_status(m=>{let s=[...m.dataValue];return r.scope(()=>{if(i==="null")return s=[];m.dataValue.includes(i)?s=s.filter(f=>f!==i):e.multiSelect?s.push(i):s=[i]}),V(v({},m),{dataValue:s,eventType:"update",eventID:r.uuid.gen()})}),t.set_keyword("")}),r.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(o))return;if(a.preventDefault(),!t.val_selectorOpen)return t.set_selectorOpen(!0);let n=o=="ArrowDown"?1:-1,i=A.FilterSelectableOptions(t),m=i.length-1,s=null;r.scope(()=>{var p,f,y,d;if(n==1){if(s=((p=i[0])==null?void 0:p.value)||null,t.val_optionFocused==null)return;if(S){s=i[m].value||s||null;return}let I=i.findIndex(g=>g.value==t.val_optionFocused);if(I==-1)return;s=((f=i[I+1])==null?void 0:f.value)||s||null}else{if(s=i[m].value||null,t.val_optionFocused==null)return;if(S){s=((y=i[0])==null?void 0:y.value)||s||null;return}let I=i.findIndex(g=>g.value==t.val_optionFocused);if(I==-1)return;s=((d=i[I-1])==null?void 0:d.value)||s||null}}),t.set_optionFocused(s)}),e.enableFormSubmit&&N.SubmitForm(a)},onChange:a=>{let c=a.target.value;t.set_keyword(c)}},"searchInput")},Selector:t=>{let[e,a]=O(t),{rootStates:o}=e,[c,u]=O("idle"),[S,n]=O("idle");k(()=>{Y.set({["refresh-autocomplete-selector-"+o.componentID]:p=>{a(p)}})},[]),k(()=>{if(!e.val_selectorOpen||!o.DynamicOptionsOnSearch)return;if(c=="idle")return u("ok");n("fetch");let p="autocomplete-search-"+o.componentID;r.interval.clear(p),r.interval.standBy(p,300,()=>Q(void 0,null,function*(){let f=yield o.DynamicOptionsOnSearch(e.val_keyword);n("idle");let y=A.InitOptions(f||[]);e.set_options(y)}))},[e.val_keyword]);let i=[],m=A.FilterSelectableOptions(e,!0),s=A.FilterSelectableOptions(e);return m.forEach((p,f)=>{let{type:y,value:d}=p,I=e.val_optionFocused==d,g=e.val_status.dataValue.includes(d),C=o.SelectorComponent;i.push(l(C,{option:p,isFocused:I,isSelected:g,addCallback:()=>{e.set_status(w=>{let b=[...w.dataValue];return r.scope(()=>{if(d==="null")return b=[];w.dataValue.includes(d)?b=b.filter(x=>x!==d):o.multiSelect?b.push(d):b=[d]}),V(v({},w),{dataValue:b,eventType:"update",eventID:r.uuid.gen()})})}},String(d)||r.uuid.gen()))}),s.length||(i=[l(B.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]),S=="fetch"&&(i=[U(G.Left,{padding:1,fontColor:"3.blur",children:[l(se.Theme.R,{showInitial:!0}),l(B.Supplement,{children:"Loading..."})]},"loader")]),l(K.Body,{className:L("Selector"),ssCardBox:!0,borderRadius:"3.tone.tertiary",boxShadow:"1.normal",freeCSS:{minWidth:12*18},children:l(ie,{gap:0,padding:[1,0],children:i})})},Selected:t=>{let{rootStates:e,val_status:a,set_status:o,val_optionsDict:c}=t,u=[];return a.dataValue.forEach(S=>{let n=c[String(S)];if(!n)return;let i=e.SelectedComponent,m=n.label;n.value==="null"&&(m=""),u.push(l(R,{className:L("SelectedCell"),children:l(i,{value:n.value,label:m,children:m,removeCallback:s=>{if(s.stopPropagation(),s.preventDefault(),e.disabled)return;let p=[...a.dataValue];p=p.filter(f=>f!==S),o(f=>V(v({},f),{dataValue:p,eventType:"update",eventID:r.uuid.gen()}))}})},String(n.value)))}),l(H,{children:u})},Core:t=>{let{onUpdateValue:e,onUpdateValidValue:a,value:o}=t,c={componentID:t.componentID||"",dataValue:o,eventType:"init",eventID:r.uuid.gen()},[u,S]=O(!1),[n,i]=O(!1),[m,s]=O(""),[p,f]=O(t.options),[y,d]=O(t.value[0]||null),[I,g]=O({}),[C,w]=O(c),[b,T]=O({ok:!1,notice:[]}),x=ae(!1);k(()=>{x.current?f(t.options):x.current=!0},[t.options]),k(()=>{if(!p.length)return;let z=[...p],J=v({},I);z.forEach(W=>{W.type!="label"&&(J[String(W.value)]=W)}),g(J)},[p]);let P={rootStates:t,val_options:p,set_options:f,val_optionFocused:y,set_optionFocused:d,val_optionsDict:I,set_optionsDict:g,val_preventOpenSelectorOnFocus:u,set_preventOpenSelectorOnFocus:S,val_selectorOpen:n,set_selectorOpen:i,val_keyword:m,set_keyword:s,val_status:C,set_status:w,val_validate:b,set_validate:T};N.CommonEffects({type:"autocomplete",states:t,val_status:C,set_status:w,val_validate:b,set_validate:T,onUpdateValue:e,onUpdateValidValue:a,DefaultValidation:me,ExtraOverrideStates:{dataValue:o,formatValue:o}});let E=C.dataValue.length&&C.dataValue[0]!=="null";return E=E||n,U(ce,{val_status:C,set_status:w,val_validate:b,states:t,children:[l(de,{componentID:t.componentID,fontSize:t.fontSize,required:t.required,label:t.label,isActive:E}),l(F.Shallow,v({},P)),l(F.Button,v({},P))]})}},te=t=>{let e=v({},t);e=V(v({value:[],min:0,max:65535,multiSelect:!0,SearchInput:!0,emptySelect:!0,SelectorComponent:({option:o,isSelected:c,isFocused:u,addCallback:S})=>o.type=="selector"?l(Z.Button.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:c||u,isActiveStyles:u?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"},onClick:n=>{S()},children:l(B.Supplement,{paddingLeft:c?"1/2":0,transition:"short",children:o.label})}):l(H,{children:o.label}),SelectedComponent:({value:o,label:c,removeCallback:u})=>U(G.Left,{ssCardBox:"cloud",backgroundColor:"layer.3",borderRadius:"2.tone.secondary",fontSize:"1.mini",padding:"1/2",gap:0,children:[l(R,{padding:[0,"1/4"],children:c}),l(Z.Button.Sub.R,{color:"cloud",fontColor:"white",backgroundColor:"layer.6",isRounded:!0,padding:"1/4",onClick:u,children:l(q.Times,{ssSphere:1})})]},"test")},e),{freeCSS:v({cursor:"pointer"},e.freeCSS)}),e.multiSelect||(e.min=1,e.max=1),e.options=e.options||[],e.emptySelect&&(e.options=[{value:null,label:l(B.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...e.options]);let a=[];return e.value=r.flatArray(e.value||null),e.value.forEach((o,c)=>{a.push(r.JsonTo(o))}),e.value=a,e.options=A.InitOptions(e.options),r.is.nullish(e.rightIcon)&&(e.rightIcon=l(ee,{ssSphere:2,children:l(q.Search,{})}),e.disabled&&(e.rightIcon=l(ee,{ssSphere:2,fontColor:"5.translucent",children:l(q.Ban,{})}))),e.rightIcon&&(e=v({paddingRight:3},e)),e.leftIcon&&(e=v({paddingLeft:3},e)),l(ue,{componentID:e.componentID,children:F.Core,states:pe(e)})};export{te as Autocomplete,te as default};
|
|
1
|
+
import{b as v,c as C,d as Y,e as Z}from"../../chunk-C5N2D3ZX.js";import{Fragment as X,jsx as a,jsxs as J}from"react/jsx-runtime";import{useState as I,useEffect as V,useRef as re}from"react";import n from"@mingoo/jsmin";import{ExtractStyles as ie,useStore as ee}from"../../@utils";import{Box as R,Span as se,FAI as G,Column as ue}from"../../atoms";import{Text as E,Row as H}from"../../mols";import te from"../Button";import{Loader as ce}from"../Loader";import{Sheet as U}from"../Sheet";import{OptionalInputWrapper as pe,BoxWrapper as de,CoreEffects as z,DefaultBoxishStyles as me}from"./core";import{InputAutocompleteClasses as B}from"../../@styles/componentClasses";import{InputLabel as Se}from"./Label";import{RightIcon as oe}from".";function fe(t){let{value:e,states:l}=t,{required:o,options:c,min:u,max:m}=l;u=u||0,m=m||65535;let r=[],i=e.filter(d=>d!=="null").length;return o&&(i||r.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"})),i<u&&r.push({type:"invalid",label:u+"\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),i>m&&r.push({type:"invalid",label:m+"\u500B\u307E\u3067\u9078\u629E\u3067\u304D\u307E\u3059"}),{ok:!r.filter(({type:d})=>d=="invalid").length,notice:r}}const A={InitOptions:t=>{let e=[];return t.forEach(l=>{let{type:o,label:c,value:u,searchValue:m}=l,r=m||(n.is.string(c)?c:"")||(n.is.string(u)?u:"");e.push(C(v({},l),{searchValue:r,type:o||"selector",value:n.JsonTo(u)}))}),e},FilterSelectableOptions:(t,e)=>{let l=t.val_options;if(e||(l=t.val_options.filter(o=>o.type!="label")),t.val_keyword){let o=t.val_keyword.toLower().replace(/ /g,"");l=l.filter(c=>(c.searchValue||"").toLower().replace(/ /g,"").includes(o))}return l}},F={Shallow:t=>{let{rootStates:e,val_status:l}=t,o=ie(e);return a(R,{position:"absolute",top:0,left:0,right:0,height:0,overflow:"hidden",opacity:"trans",freeCSS:{zIndex:3,pointerEvents:"none"},children:a(E.Description,C(v({className:e.className},o),{position:"absolute",width:1,freeCSS:C(v({},o.freeCSS),{color:"orange"}),"data-id":"shallow_"+l.componentID,children:a(R,{"data-input-value-shallow":l.componentID,children:"A"})}))})},Button:t=>{let{rootStates:e,val_keyword:l,set_keyword:o,val_optionFocused:c,set_optionFocused:u,val_options:m,set_options:r,val_optionsDict:i,set_optionsDict:d,val_preventOpenSelectorOnFocus:s,set_preventOpenSelectorOnFocus:S,val_selectorOpen:f,set_selectorOpen:h,val_status:p,set_status:b,val_validate:O,set_validate:T}=t,j=e,{tone:w,required:_,form:x,className:k,multiSelect:L,enableFormSubmit:P,checkValidationAtFirst:W,onValidate:K,onUpdateValue:$,onUpdateValidValue:M,value:N="",options:ve,leftIndicator:he,rightIndicator:ye,leftIcon:_e,rightIcon:ge,componentID:Ie,status_id:be,wrapStyles:Oe,emptySelect:De,SearchInput:Ce,SearchInputPlaceholder:Ve,SelectedComponent:we,SelectorComponent:ke,SelectorGravityPoint:xe,DynamicOptionsOnSearch:Re}=j,g=Y(j,["tone","required","form","className","multiSelect","enableFormSubmit","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","wrapStyles","emptySelect","SearchInput","SearchInputPlaceholder","SelectedComponent","SelectorComponent","SelectorGravityPoint","DynamicOptionsOnSearch"]);V(()=>{var D;if(e.disabled||!f)return;let y=A.FilterSelectableOptions(t);u(((D=y[0])==null?void 0:D.value)||null)},[l]),V(()=>{p.eventType!="init"&&(e.max==p.dataValue.length?(h(!1),S(!0),setTimeout(()=>{let y=n('[data-input-origin="'+e.componentID+'"]');y&&y.focus()},10)):n("#SearchInput_"+e.componentID).focus())},[p.dataValue]);let q="autocomplete-sheet-"+e.componentID;return V(()=>{let y="autocomplete-click-"+e.componentID;if(f){let D=n('[data-input-origin="'+e.componentID+'"]');if(!D)return;n("#SearchInput_"+e.componentID).focus(),U.open({sheetID:q,type:"custom",parent:D[0],padding:["1/4",0],gravityPoint:e.SelectorGravityPoint||22,close_option:{aroundClick:!1},content:a(F.Selector,v({},t))}),n(document).addEvent({eventID:y,eventType:"click",callback:le=>{let Q=n(le.target),ne=!!n(Q).parent("."+B("Core")).length;n(Q).parent("."+B("Selector")).length||ne||h(!1)}})}else n(document).removeEvent([y]),o(""),U.close(q)},[f]),V(()=>{if(e.disabled||!f)return;U.customSheet.reposition(q);let y=ee.get("refresh-autocomplete-selector-"+e.componentID);y&&y(t)},[m,p.dataValue,l,c]),a(X,{children:a(R,C(v({tabIndex:0},g),{"data-disabled":e.disabled,"data-name":e.name,"data-value":n.JsonTo(p.dataValue),"data-form":x,"data-show-validation":z.isShowValidation(O,p,!!W),"data-validation":O.ok,"data-component-id":p.componentID,"data-input-origin":p.componentID,"data-focus":!!f,"data-input-type":"autocomplete-"+(L?"multi":"single"),className:[k,B("Core")].join(" "),onFocus:y=>{if(g!=null&&g.onFocus&&(g==null||g.onFocus(y)),!e.disabled){if(s)return S(!1);h(!0),y.preventDefault()}},onClick:y=>{g!=null&&g.onClick&&(g==null||g.onClick(y)),!e.disabled&&h(!0)},onKeyDown:y=>{let{key:D}=y;P&&z.SubmitForm(y),!f&&(D==" "||D=="ArrowDown"||D=="ArrowUp"||D=="Enter")&&h(!0)},children:J(H.Left,{flexWrap:!0,gap:"1/3",freeCSS:{letterSpacing:".5px"},children:[a(F.Selected,v({},t)),a(se,{width:0,overflow:"hidden",opacity:"trans",children:"A"}),a(F.SearchInput,v({},t))]})}))})},SearchInput:t=>{let{rootStates:e}=t;return e.disabled||!t.val_selectorOpen?null:a(R,{id:"SearchInput_"+e.componentID,placeholder:e.SearchInputPlaceholder||"\u691C\u7D22...",opacity:t.val_selectorOpen?"max":"trans","data-form":e.form,transition:"middle",flexSizing:0,htmlTag:"input",border:"unset",backgroundColor:"trans",value:t.val_keyword,freeCSS:{outline:"none"},onKeyDown:l=>{let{key:o,metaKey:c,ctrlKey:u}=l,m=c||u;o=="Escape"?(t.set_selectorOpen(!1),t.set_preventOpenSelectorOnFocus(!0),setTimeout(()=>{let r=n('[data-input-origin="'+e.componentID+'"]');r&&r.focus()},10)):o=="Tab"?t.set_selectorOpen(!1):o==" "?n.scope(()=>{t.val_selectorOpen||t.val_keyword||(l.preventDefault(),t.set_selectorOpen(!0))}):o=="Backspace"?n.scope(()=>{if(t.val_keyword)return;let r=[...t.val_status.dataValue];r.pop(),t.set_status(i=>C(v({},i),{dataValue:r,eventType:"update",eventID:n.uuid.gen()}))}):o=="Enter"&&n.scope(()=>{if(!t.val_selectorOpen)return t.set_selectorOpen(!0);if(!t.val_optionFocused)return;let r=t.val_options.find(d=>d.value==t.val_optionFocused);if(!r)return;let{value:i}=r;t.set_status(d=>{let s=[...d.dataValue];return n.scope(()=>{if(i==="null")return s=[];d.dataValue.includes(i)?s=s.filter(f=>f!==i):e.multiSelect?s.push(i):s=[i]}),C(v({},d),{dataValue:s,eventType:"update",eventID:n.uuid.gen()})}),t.set_keyword(""),t.set_preventDynamicSearchOnKeywordChange(!0)}),n.scope(()=>{if(!["ArrowDown","ArrowUp"].includes(o))return;if(l.preventDefault(),!t.val_selectorOpen)return t.set_selectorOpen(!0);let r=o=="ArrowDown"?1:-1,i=A.FilterSelectableOptions(t),d=i.length-1,s=null;n.scope(()=>{var S,f,h,p;if(r==1){if(s=((S=i[0])==null?void 0:S.value)||null,t.val_optionFocused==null)return;if(m){s=i[d].value||s||null;return}let b=i.findIndex(O=>O.value==t.val_optionFocused);if(b==-1)return;s=((f=i[b+1])==null?void 0:f.value)||s||null}else{if(s=i[d].value||null,t.val_optionFocused==null)return;if(m){s=((h=i[0])==null?void 0:h.value)||s||null;return}let b=i.findIndex(O=>O.value==t.val_optionFocused);if(b==-1)return;s=((p=i[b-1])==null?void 0:p.value)||s||null}}),t.set_optionFocused(s)}),e.enableFormSubmit&&z.SubmitForm(l)},onChange:l=>{let c=l.target.value;t.set_keyword(c)}},"searchInput")},Selector:t=>{let[e,l]=I(t),{rootStates:o}=e,[c,u]=I("idle"),[m,r]=I("idle");V(()=>{ee.set({["refresh-autocomplete-selector-"+o.componentID]:S=>{l(S)}})},[]),V(()=>{if(!e.val_selectorOpen||!o.DynamicOptionsOnSearch)return;if(e.val_preventDynamicSearchOnKeywordChange)return e.set_preventDynamicSearchOnKeywordChange(!1);if(c=="idle")return u("ok");r("fetch");let S="autocomplete-search-"+o.componentID;n.interval.clear(S),n.interval.standBy(S,300,()=>Z(void 0,null,function*(){let f=yield o.DynamicOptionsOnSearch(e.val_keyword);r("idle");let h=A.InitOptions(f||[]);e.set_options(h)}))},[e.val_keyword]);let i=[],d=A.FilterSelectableOptions(e,!0),s=A.FilterSelectableOptions(e);return d.forEach((S,f)=>{let{type:h,value:p}=S,b=e.val_optionFocused==p,O=e.val_status.dataValue.includes(p),T=o.SelectorComponent;i.push(a(T,{option:S,isFocused:b,isSelected:O,addCallback:()=>{e.set_status(w=>{let _=[...w.dataValue];return n.scope(()=>{if(p==="null")return _=[];w.dataValue.includes(p)?_=_.filter(k=>k!==p):o.multiSelect?_.push(p):_=[p]}),C(v({},w),{dataValue:_,eventType:"update",eventID:n.uuid.gen()})})}},String(p)||n.uuid.gen()))}),s.length||(i=[a(E.Supplement,{padding:[0,1],fontColor:"4.thin",children:"\u5019\u88DC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"},"no-selector-notice")]),m=="fetch"&&(i=[J(H.Left,{padding:1,fontColor:"3.blur",children:[a(ce.Theme.R,{showInitial:!0}),a(E.Supplement,{children:"Loading..."})]},"loader")]),a(U.Body,{className:B("Selector"),ssCardBox:!0,borderRadius:"3.tone.tertiary",boxShadow:"1.normal",freeCSS:{minWidth:12*18},children:a(ue,{gap:0,padding:[1,0],children:i})})},Selected:t=>{let{rootStates:e,val_status:l,set_status:o,val_optionsDict:c}=t,u=[];return l.dataValue.forEach(m=>{let r=c[String(m)];if(!r)return;let i=e.SelectedComponent,d=r.label;r.value==="null"&&(d=""),u.push(a(R,{className:B("SelectedCell"),children:a(i,{value:r.value,label:d,removeCallback:s=>{if(s.stopPropagation(),s.preventDefault(),e.disabled)return;let S=[...l.dataValue];S=S.filter(f=>f!==m),o(f=>C(v({},f),{dataValue:S,eventType:"update",eventID:n.uuid.gen()}))}})},String(r.value)))}),a(X,{children:u})},Core:t=>{let{onUpdateValue:e,onUpdateValidValue:l,value:o}=t,c={componentID:t.componentID||"",dataValue:o,eventType:"init",eventID:n.uuid.gen()},[u,m]=I(!1),[r,i]=I(!1),[d,s]=I(!1),[S,f]=I(""),[h,p]=I(t.options),[b,O]=I(t.value[0]||null),[T,w]=I({}),[_,x]=I(c),[k,L]=I({ok:!1,notice:[]}),P=re(!1);V(()=>{P.current?p(t.options):P.current=!0},[t.options]),V(()=>{if(!h.length)return;let $=[...h],M=v({},T);$.forEach(N=>{N.type!="label"&&(M[String(N.value)]=N)}),w(M)},[h]);let W={rootStates:t,val_options:h,set_options:p,val_optionFocused:b,set_optionFocused:O,val_optionsDict:T,set_optionsDict:w,val_preventDynamicSearchOnKeywordChange:r,set_preventDynamicSearchOnKeywordChange:i,val_preventOpenSelectorOnFocus:u,set_preventOpenSelectorOnFocus:m,val_selectorOpen:d,set_selectorOpen:s,val_keyword:S,set_keyword:f,val_status:_,set_status:x,val_validate:k,set_validate:L};z.CommonEffects({type:"autocomplete",states:t,val_status:_,set_status:x,val_validate:k,set_validate:L,onUpdateValue:e,onUpdateValidValue:l,DefaultValidation:fe,ExtraOverrideStates:{dataValue:o,formatValue:o}});let K=_.dataValue.length&&_.dataValue[0]!=="null";return K=K||d,J(de,{val_status:_,set_status:x,val_validate:k,states:t,children:[a(Se,{componentID:t.componentID,fontSize:t.fontSize,required:t.required,label:t.label,isActive:K}),a(F.Shallow,v({},W)),a(F.Button,v({},W))]})}},ae=t=>{let e=v({},t);e=C(v({value:[],min:0,max:65535,multiSelect:!0,SearchInput:!0,emptySelect:!0,SelectorComponent:({option:o,isSelected:c,isFocused:u,addCallback:m})=>o.type=="selector"?a(te.Button.Sub.S,{color:"cloud",backgroundColor:"trans",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:["1/2",1.5],isActive:c||u,isActiveStyles:u?{backgroundColor:"cloud"}:{backgroundColor:"theme.opa.few",fontColor:"theme"},onClick:r=>{m()},children:a(E.Supplement,{paddingLeft:c?"1/2":0,transition:"short",children:o.label})}):a(X,{children:o.label}),SelectedComponent:({value:o,label:c,removeCallback:u})=>J(H.Left,{ssCardBox:"cloud",backgroundColor:"layer.3",borderRadius:"2.tone.secondary",fontSize:"1.mini",padding:"1/2",gap:0,children:[a(R,{padding:[0,"1/4"],children:c}),a(te.Button.Sub.R,{color:"cloud",fontColor:"white",backgroundColor:"layer.6",isRounded:!0,padding:"1/4",onClick:u,children:a(G.Times,{ssSphere:1})})]})},e),{freeCSS:v({cursor:"pointer"},e.freeCSS)}),e.multiSelect||(e.min=1,e.max=1),e.options=e.options||[],e.emptySelect&&(e.options=[{value:null,label:a(E.Supplement,{fontColor:"4.thin",children:"\u9078\u629E\u3092\u89E3\u9664"})},...e.options]);let l=[];return e.value=n.flatArray(e.value||null),e.value.forEach((o,c)=>{l.push(n.JsonTo(o))}),e.value=l,e.options=A.InitOptions(e.options),n.is.nullish(e.rightIcon)&&(e.rightIcon=a(oe,{ssSphere:2,children:a(G.Search,{})}),e.disabled&&(e.rightIcon=a(oe,{ssSphere:2,fontColor:"5.translucent",children:a(G.Ban,{})}))),e.rightIcon&&(e=v({paddingRight:3},e)),e.leftIcon&&(e=v({paddingLeft:3},e)),a(pe,{componentID:e.componentID,children:F.Core,states:me(e)})};export{ae as Autocomplete,ae as default};
|
package/dist/temps/designBook.js
CHANGED
|
@@ -73,7 +73,7 @@ Some Text`})]}),o(s.Separate,{children:[e(r.Button.Sub.S,{color:"white",onClick:
|
|
|
73
73
|
text2
|
|
74
74
|
text3
|
|
75
75
|
text4
|
|
76
|
-
text5`,minRows:5}),e(a.TextField,{label:"Input.TextField",isLabelActive:!0,placeholder:"(autoHeight) (multiline)",multiline:!0,autoHeight:!0,value:"",freeCSS:{minHeight:72},onUpdateValidValue:l=>{console.log(l)}}),e(a.TextField,{label:"Input.LeftIndicator",leftIndicator:e(a.LeftIndicator,{children:"Left Indicator"})}),e(a.TextField,{label:"Input.LeftIcon",paddingLeft:6,leftIcon:e(a.LeftIcon,{ssSquare:void 0,freeCSS:{pointerEvents:"all"},children:e(r.Button.Sub.S,{padding:["1/3","1/2"],children:"Left Icon"})})}),e(a.TextField,{label:"Input.RightIcon",paddingRight:6,rightIcon:e(a.RightIcon,{ssSquare:void 0,freeCSS:{pointerEvents:"all"},children:e(r.Button.Sub.S,{padding:["1/3","1/2"],children:"Right Icon"})})}),e(a.TextField,{label:"Input.RightIndicator",rightIndicator:e(a.RightIndicator,{children:"Right Indicator"})})]})]}),Time:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Time Input"}),e(t,{padding:1,children:o(p,{gap:1.5,children:[e(a.Time.Clock,{label:"Input.Time.Clock"}),e(a.Time.Date,{label:"Input.Time.Date"}),e(a.Time.Week,{label:"Input.Time.Week"}),e(a.Time.Month,{label:"Input.Time.Month"}),e(a.Time.Year,{label:"Input.Time.Year"}),e(a.Time.Periods.Date,{label:"Input.Time.Periods.Date"}),e(a.Time.Periods.Month,{label:"Input.Time.Periods.Month"}),e(a.Time.DateWareki,{label:"Input.Time.DateWareki"}),e(t,{children:e(a.Select,{label:"Input.TimePicker",id:"timePicker",options:[{value:"clock",label:"clock"},{value:"date",label:"date"},{value:"week",label:"week"},{value:"month",label:"month"},{value:"year",label:"year"},{value:"dates",label:"dates"},{value:"months",label:"months"},{value:"dateWareki",label:"dateWareki"}],onUpdateValidValue:({value:l})=>{a.Time.fn.picker.launch({parent:"#timePicker",restrict:l,defaultValue:"",onValueUpdate:u=>{console.log(u)}})}})})]})})]})}),List:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Radio & Checkbox Input"}),e(t,{padding:1,children:o(p,{children:[o(h,{gap:2,flexChilds:"auto",children:[o(t,{children:["Input.Checkbox",e(a.Checkbox,{value:[2,"3"],minSelect:2,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Input.Radio",e(a.Radio,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"},{value:4,label:"Option4"},{value:5,label:"Option5"}]})]}),o(t,{children:["CustomIcon",e(a.Radio,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}],CustomIcon:l=>o(r.Button.Normal.S,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",isRounded:!0,fontSize:"3.paragraph",fontColor:l.isChecked?"theme":"5.translucent",onClick:u=>{u.preventDefault(),u.stopPropagation(),l.toggle()},children:[e(g.Heart,{})," 3"]})})]})]}),o(p,{children:[e(i.Paragraph,{children:"Tones"}),o(p,{children:[o(t,{children:["Plain",e(a.Radio,{value:[1],gap:1,options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]}),o(t,{children:["Plain icon={ false }",e(a.Checkbox,{icon:!1,cellStyles:{padding:["1/3","2/3"],isRounded:!0},cellCheckedStyles:{fontColor:"theme"},value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Simple",e(a.Checkbox.Simple,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Normal",e(a.Checkbox.Normal,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Vivid",e(a.Checkbox.Vivid,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Cloud",e(a.Checkbox.Cloud,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]}),o(t,{children:["Border",e(a.Radio.Border,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]})]})]})]})})]})}),Select:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Select,Autocomplete Input"}),o(p,{padding:2,gap:1.5,children:[e(a.Select,{label:"Input.Select",isLabelActive:!0,placeholder:"Select",required:!0,options:[{value:1,label:"option1"},{value:2,label:"option2"},{value:3,label:"option3a"},{value:4,label:"option4"}]}),e(a.Search,{label:"Input.Search",required:!0,options:[{value:1,label:"1"},{value:{value1:2,value2:3},label:"Object"},{value:3,label:"3"},{value:101,label:"101"},{value:102,label:"102"}],onUpdateValidValue:({value:l})=>{console.log(l)},DynamicOptionsOnSearch:
|
|
76
|
+
text5`,minRows:5}),e(a.TextField,{label:"Input.TextField",isLabelActive:!0,placeholder:"(autoHeight) (multiline)",multiline:!0,autoHeight:!0,value:"",freeCSS:{minHeight:72},onUpdateValidValue:l=>{console.log(l)}}),e(a.TextField,{label:"Input.LeftIndicator",leftIndicator:e(a.LeftIndicator,{children:"Left Indicator"})}),e(a.TextField,{label:"Input.LeftIcon",paddingLeft:6,leftIcon:e(a.LeftIcon,{ssSquare:void 0,freeCSS:{pointerEvents:"all"},children:e(r.Button.Sub.S,{padding:["1/3","1/2"],children:"Left Icon"})})}),e(a.TextField,{label:"Input.RightIcon",paddingRight:6,rightIcon:e(a.RightIcon,{ssSquare:void 0,freeCSS:{pointerEvents:"all"},children:e(r.Button.Sub.S,{padding:["1/3","1/2"],children:"Right Icon"})})}),e(a.TextField,{label:"Input.RightIndicator",rightIndicator:e(a.RightIndicator,{children:"Right Indicator"})})]})]}),Time:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Time Input"}),e(t,{padding:1,children:o(p,{gap:1.5,children:[e(a.Time.Clock,{label:"Input.Time.Clock"}),e(a.Time.Date,{label:"Input.Time.Date"}),e(a.Time.Week,{label:"Input.Time.Week"}),e(a.Time.Month,{label:"Input.Time.Month"}),e(a.Time.Year,{label:"Input.Time.Year"}),e(a.Time.Periods.Date,{label:"Input.Time.Periods.Date"}),e(a.Time.Periods.Month,{label:"Input.Time.Periods.Month"}),e(a.Time.DateWareki,{label:"Input.Time.DateWareki"}),e(t,{children:e(a.Select,{label:"Input.TimePicker",id:"timePicker",options:[{value:"clock",label:"clock"},{value:"date",label:"date"},{value:"week",label:"week"},{value:"month",label:"month"},{value:"year",label:"year"},{value:"dates",label:"dates"},{value:"months",label:"months"},{value:"dateWareki",label:"dateWareki"}],onUpdateValidValue:({value:l})=>{a.Time.fn.picker.launch({parent:"#timePicker",restrict:l,defaultValue:"",onValueUpdate:u=>{console.log(u)}})}})})]})})]})}),List:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Radio & Checkbox Input"}),e(t,{padding:1,children:o(p,{children:[o(h,{gap:2,flexChilds:"auto",children:[o(t,{children:["Input.Checkbox",e(a.Checkbox,{value:[2,"3"],minSelect:2,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Input.Radio",e(a.Radio,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"},{value:4,label:"Option4"},{value:5,label:"Option5"}]})]}),o(t,{children:["CustomIcon",e(a.Radio,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}],CustomIcon:l=>o(r.Button.Normal.S,{ssPushable:!0,color:"cloud",tabIndex:-1,ssEffectsOnActive:"ripple.cloud",isRounded:!0,fontSize:"3.paragraph",fontColor:l.isChecked?"theme":"5.translucent",onClick:u=>{u.preventDefault(),u.stopPropagation(),l.toggle()},children:[e(g.Heart,{})," 3"]})})]})]}),o(p,{children:[e(i.Paragraph,{children:"Tones"}),o(p,{children:[o(t,{children:["Plain",e(a.Radio,{value:[1],gap:1,options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]}),o(t,{children:["Plain icon={ false }",e(a.Checkbox,{icon:!1,cellStyles:{padding:["1/3","2/3"],isRounded:!0},cellCheckedStyles:{fontColor:"theme"},value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Simple",e(a.Checkbox.Simple,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Normal",e(a.Checkbox.Normal,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Vivid",e(a.Checkbox.Vivid,{value:[2,"3"],minSelect:2,hideInput:!0,options:[{value:"1",label:"Option1"},{value:"2",label:"Option2"},{value:"3",label:"Option3"}]})]}),o(t,{children:["Cloud",e(a.Checkbox.Cloud,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]}),o(t,{children:["Border",e(a.Radio.Border,{value:[1],options:[{value:1,label:"Option1"},{value:2,label:"Option2"},{value:3,label:"Option3"}]})]})]})]})]})})]})}),Select:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Select,Autocomplete Input"}),o(p,{padding:2,gap:1.5,children:[e(a.Select,{label:"Input.Select",isLabelActive:!0,placeholder:"Select",required:!0,options:[{value:1,label:"option1"},{value:2,label:"option2"},{value:3,label:"option3a"},{value:4,label:"option4"}]}),e(a.Search,{label:"Input.Search",required:!0,options:[{value:1,label:"1"},{value:{value1:2,value2:3},label:"Object"},{value:3,label:"3"},{value:101,label:"101"},{value:102,label:"102"}],onUpdateValidValue:({value:l})=>{console.log(l)},DynamicOptionsOnSearch:l=>y(void 0,null,function*(){console.log("keyword",l);let u=[];for(let x=0;x<100;x++)u.push({value:x,label:String(x),searchValue:l});return u})}),e(a.Autocomplete,{label:"Input.Autocomplete",SelectorGravityPoint:6,max:2,value:[4],options:[{value:1,label:"X-men"},{value:2,label:"\u30B7\u30E7\u30FC\u30B7\u30E3\u30F3\u30AF\u306E\u7A7A"},{value:3,label:"\u30B9\u30BF\u30FC\u30A6\u30A9\u30FC\u30BA"},{value:4,label:"\u30B4\u30C3\u30C9\u30D5\u30A1\u30FC\u30B6\u30FC: Part II"},{value:5,label:"\u30B4\u30C3\u30C9\u30D5\u30A1\u30FC\u30B6\u30FC: Part III"},{value:6,label:"\u30A4\u30F3\u30BB\u30D7\u30B7\u30E7\u30F3"}],onUpdateValidValue:({value:l})=>{console.log(l)}})]})]})}),Segmented:()=>o(t,{ssCardBox:!0,children:[e(i.ThirdTitle,{borderBottom:!0,padding:1,children:"Segmented"}),o(p,{padding:2,gap:2,children:[e(s.Left,{children:e(a.Segmented,{value:1,options:[{value:0,label:"Home"},{value:1,label:"Notice"},{value:2,label:"Posts"},{value:3,label:"Settings"}]})}),e(s.Left,{children:e(a.Segmented.Cloud,{value:1,options:[{value:0,label:e(g.AngleLeft,{})},{value:1,label:e(g.AngleRight,{})},{value:2,label:e(g.AngleUp,{})},{value:3,label:e(g.AngleDown,{})}]})}),e(s.Left,{children:e(a.Segmented.CloudTheme,{value:1,options:[{value:0,label:e(g.AngleLeft,{})},{value:1,label:e(g.AngleRight,{})},{value:2,label:e(g.AngleUp,{})},{value:3,label:e(g.AngleDown,{})}]})}),e(s.Left,{children:e(a.Segmented.CloudMono,{value:1,options:[{value:0,label:e(g.AngleLeft,{})},{value:1,label:e(g.AngleRight,{})},{value:2,label:e(g.AngleUp,{})},{value:3,label:e(g.AngleDown,{})}]})}),e(s.Left,{children:e(a.Segmented.Border,{value:1,options:[{value:0,label:"On"},{value:1,label:"Off"}]})}),e(s.Left,{children:e(a.Segmented.BorderVivid,{value:1,options:[{value:0,label:"On"},{value:1,label:"Off"}]})}),e(s.Left,{borderBottom:!0,children:e(a.Segmented.Bottomline,{value:1,options:[{value:0,label:"Takana"},{value:1,label:"Mentai"},{value:2,label:"Mayo"},{value:3,label:"Gyudon"}]})})]})]}),Variables:()=>e(B,{children:o(t,{ssCardBox:!0,children:[e(i.Paragraph,{borderBottom:!0,padding:1,children:"Variables"}),e(t,{padding:1,children:e(p,{children:o(h,{gap:2,flexChilds:"auto",children:[o(t,{children:["Input.File",e(a.Filer,{limit:3,onUpdateValidValue:({value:l})=>{console.log(l[0])}})]}),o(t,{children:["Input.Switch",o(h,{gap:2,children:[e(a.Switch,{}),e(a.Switch,{appearance:"applely",color:"icicles",value:!0}),e(a.Switch,{appearance:"applely",icon:e(g.Check,{}),color:"warn",value:!0})]})]}),o(t,{flexNewLine:!0,children:["Input.Slider",e(a.Slider,{color:"battery",name:"sliderInput",value:40,step:10,min:0,max:100})]})]})})})]})})};return e(B,{children:e(H,{size:"L",children:o(c,{gridCols:2,gap:2,children:[e(n.Basic,{}),e(n.Select,{}),e(n.Time,{}),e(n.List,{}),e(n.Segmented,{}),e(n.Variables,{})]})})})},ie=()=>{const n=l=>{let u="testModal2";b.open({type:l,sheetID:u,size:"S",padding:2,content:o(b.Body,{padding:1,children:[e(t,{padding:2,children:"Content"}),e(s.Right,{children:e(r.Button.Prime.R,{onClick:()=>{b.close(u)},children:"\u9589\u3058\u308B"})})]})})};return o(B,{children:[o(t,{ssCardBox:!0,children:[e(i.SubTitle,{borderBottom:!0,padding:1,children:"CardBox"}),e(t,{padding:1,overflow:"auto",children:e(i.Description,{children:`<Box styles={{ssCardBox:true}}>
|
|
77
77
|
<Box>
|
|
78
78
|
Header
|
|
79
79
|
</Box>
|
package/package.json
CHANGED
package/dist/fn/Tooltips copy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e,c as r,d as p}from"../chunk-C5N2D3ZX.js";import{jsx as c}from"react/jsx-runtime";import i from"@mingoo/jsmin";import{Box as d}from"../atoms";import t from"./Sheet";const l={__memoryID:i.uuid.gen(),open:o=>{let n=o,{tipsID:a=i.uuid.gen(24),tipsGroups:u=[]}=n,s=p(n,["tipsID","tipsGroups"]);t.open(r(e({sheetID:a,sheetGroups:["tooltips",...u]},s),{type:"custom",close_option:e({aroundClick:!0,parentBlur:!0,escapeKeyDown:!0,pageTransit:!0},s.close_option)}))},close:o=>{o&&t.close(o)},closeALL:()=>{t.closeGroup("tooltips")},Body:o=>c(d,e({padding:"1/2",backgroundColor:"dark",borderRadius:"2.tone.secondary",fontColor:"white",boxShadow:"0.normal"},o))};export{l as Tooltips,l as default};
|