amotify 0.2.27 → 0.2.28
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/demo/esbuild/app.tsx +14 -30
- package/demo/esbuild/public/index.css +1 -1
- package/demo/esbuild/public/index.js +95 -93
- package/dist/@declares/index.d.ts +2 -2
- package/dist/@declares/property.d.ts +4 -3
- package/dist/@styles/componentClasses/index.css +1 -1
- package/dist/@styles/componentClasses/index.d.ts +1 -2
- package/dist/@styles/componentClasses/index.js +1 -1
- package/dist/@styles/index.css +1 -1
- package/dist/@styles/index.js +1 -1
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +1 -1
- package/dist/@styles/style.js +1 -1
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.d.ts +4 -4
- package/dist/@utils/GenerateClassName.js +1 -1
- package/dist/@utils/LaunchReactApp.d.ts +1 -2
- package/dist/@utils/LaunchReactApp.js +1 -1
- package/dist/@utils/collectForm.js +1 -1
- package/dist/@utils/useRouterEffect.js +1 -1
- package/dist/atoms/Box.d.ts +8 -6
- package/dist/atoms/Box.js +1 -1
- package/dist/atoms/FAI.d.ts +3 -5
- package/dist/atoms/FAI.js +1 -1
- package/dist/atoms/Img.d.ts +3 -3
- package/dist/atoms/Img.js +1 -1
- package/dist/atoms/Logo.d.ts +3 -3
- package/dist/atoms/Logo.js +2 -2
- package/dist/atoms/Placeholder.d.ts +1 -1
- package/dist/atoms/Placeholder.js +1 -1
- package/dist/atoms/index.d.ts +40 -4
- package/dist/atoms/index.js +1 -1
- package/dist/fn/Button.d.ts +3 -3
- package/dist/fn/Button.js +1 -1
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Effect/Fade.d.ts +3 -3
- package/dist/fn/Effect/Fade.js +1 -1
- package/dist/fn/Effect/Pudding.js +1 -1
- package/dist/fn/Effect/Ripple.js +2 -2
- package/dist/fn/Input/Autocomplete.d.ts +86 -0
- package/dist/fn/Input/Autocomplete.js +1 -0
- package/dist/fn/Input/Checker.d.ts +3 -3
- package/dist/fn/Input/Checker.js +1 -1
- package/dist/fn/Input/Contenteditable.js +1 -1
- package/dist/fn/Input/DigitCharacters.d.ts +2 -2
- package/dist/fn/Input/DigitCharacters.js +1 -1
- package/dist/fn/Input/Filer.d.ts +2 -2
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/Hidden.js +1 -1
- package/dist/fn/Input/Label.d.ts +8 -0
- package/dist/fn/Input/Label.js +1 -0
- package/dist/fn/Input/List.d.ts +34 -22
- package/dist/fn/Input/List.js +1 -1
- package/dist/fn/Input/Parts.d.ts +18 -15
- package/dist/fn/Input/Parts.js +1 -1
- package/dist/fn/Input/Plain.d.ts +2 -2
- package/dist/fn/Input/Plain.js +1 -1
- package/dist/fn/Input/Search.d.ts +2 -2
- package/dist/fn/Input/Search.js +1 -1
- package/dist/fn/Input/Segmented.d.ts +17 -13
- package/dist/fn/Input/Segmented.js +1 -1
- package/dist/fn/Input/Select.d.ts +29 -9
- package/dist/fn/Input/Select.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Input/Switch.js +1 -1
- package/dist/fn/Input/TextField.d.ts +70 -0
- package/dist/fn/Input/TextField.js +3 -0
- package/dist/fn/Input/Time/Picker.js +1 -1
- package/dist/fn/Input/Time/index.d.ts +14 -0
- package/dist/fn/Input/Time/index.js +1 -1
- package/dist/fn/Input/core.d.ts +16 -18
- package/dist/fn/Input/core.js +1 -1
- package/dist/fn/Input/index.d.ts +36 -64
- package/dist/fn/Input/index.js +1 -1
- package/dist/fn/Loader/corner.js +1 -1
- package/dist/fn/Loader/index.d.ts +2 -2
- package/dist/fn/Loader/index.js +1 -1
- package/dist/fn/Loader/mini.js +1 -1
- package/dist/fn/PageNotFound.js +1 -1
- package/dist/fn/Plate.d.ts +2 -2
- package/dist/fn/Plate.js +1 -1
- package/dist/fn/RootViewController.d.ts +6 -7
- package/dist/fn/RootViewController.js +1 -1
- package/dist/fn/Sheet.d.ts +9 -9
- package/dist/fn/Sheet.js +1 -1
- package/dist/fn/Snackbar.d.ts +2 -2
- package/dist/fn/Snackbar.js +1 -1
- package/dist/fn/SwipeView.d.ts +2 -2
- package/dist/fn/SwipeView.js +1 -1
- package/dist/fn/TabBar.d.ts +2 -2
- package/dist/fn/TabBar.js +1 -1
- package/dist/fn/Table/Data.d.ts +3 -3
- package/dist/fn/Table/Data.js +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/dist/fn/Table/Normal.js +1 -1
- package/dist/fn/Table/Parts.d.ts +7 -7
- package/dist/fn/Table/Parts.js +1 -1
- package/dist/fn/Table/cellStyling.d.ts +3 -3
- package/dist/fn/Table/cellStyling.js +1 -1
- package/dist/fn/Table/index.d.ts +5 -5
- package/dist/fn/Table/index.js +1 -1
- package/dist/fn/Tooltips.d.ts +4 -6
- package/dist/fn/Tooltips.js +1 -1
- package/dist/index.d.ts +28 -20
- package/dist/mols/Accordion.d.ts +2 -2
- package/dist/mols/Accordion.js +1 -1
- package/dist/mols/LinkifyText.d.ts +1 -1
- package/dist/mols/LinkifyText.js +1 -1
- package/dist/mols/List.d.ts +30 -7
- package/dist/mols/List.js +1 -1
- package/dist/mols/Row.d.ts +3 -3
- package/dist/mols/Row.js +1 -1
- package/dist/mols/Text.d.ts +18 -14
- package/dist/mols/Text.js +1 -1
- package/dist/mols/index.d.ts +0 -1
- package/dist/mols/index.js +1 -1
- package/dist/temps/designBook.js +20 -20
- package/package.json +2 -2
- package/dist/atoms/Flex.d.ts +0 -11
- package/dist/atoms/Flex.js +0 -1
- package/dist/atoms/Grid.d.ts +0 -4
- package/dist/atoms/Grid.js +0 -1
- package/dist/atoms/P.d.ts +0 -9
- package/dist/atoms/P.js +0 -1
- package/dist/atoms/Span.d.ts +0 -9
- package/dist/atoms/Span.js +0 -1
- package/dist/fn/Input/AutoHeightText.d.ts +0 -6
- package/dist/fn/Input/AutoHeightText.js +0 -1
- package/dist/fn/Input/Chips/Selector.d.ts +0 -44
- package/dist/fn/Input/Chips/Selector.js +0 -1
- package/dist/fn/Input/Chips/index.d.ts +0 -60
- package/dist/fn/Input/Chips/index.js +0 -1
- package/dist/fn/Input/RichSelect.d.ts +0 -33
- package/dist/fn/Input/RichSelect.js +0 -1
- package/dist/fn/Input/Text.d.ts +0 -51
- package/dist/fn/Input/Text.js +0 -1
- package/dist/fn/Input/TextArea.d.ts +0 -19
- package/dist/fn/Input/TextArea.js +0 -1
- package/dist/mols/Column.d.ts +0 -7
- package/dist/mols/Column.js +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from '../../../@declares';
|
|
2
|
-
import $$ from '@mingoo/jsmin';
|
|
3
|
-
import { Types } from '.';
|
|
4
|
-
declare namespace Selector {
|
|
5
|
-
type Input = {
|
|
6
|
-
selectorID: string;
|
|
7
|
-
bottomContent: ReactElement;
|
|
8
|
-
options: Types.ChipsOptions[];
|
|
9
|
-
limit?: number;
|
|
10
|
-
selected: Types.ChipsOptions[];
|
|
11
|
-
SelectorCellComponent: Types.SelectorCellComponentInput;
|
|
12
|
-
onUpdated(p: {
|
|
13
|
-
values: any[];
|
|
14
|
-
}): void;
|
|
15
|
-
onDynamicSearch?: Types.onDynamicSearch;
|
|
16
|
-
};
|
|
17
|
-
type OpenSelectorInput = {
|
|
18
|
-
parent: $$.Args;
|
|
19
|
-
selectorID: string;
|
|
20
|
-
options: Types.ChipsOptions[];
|
|
21
|
-
selected: Types.ChipsOptions[];
|
|
22
|
-
bottomContent?: ReactElement;
|
|
23
|
-
gravityPoint?: number;
|
|
24
|
-
limit?: number;
|
|
25
|
-
onDynamicSearch?: {
|
|
26
|
-
(k: string): Promise<{
|
|
27
|
-
options: Types.ChipsOptions[];
|
|
28
|
-
}>;
|
|
29
|
-
};
|
|
30
|
-
onUpdated(p: {
|
|
31
|
-
values: any[];
|
|
32
|
-
}): void;
|
|
33
|
-
onClosed(): void;
|
|
34
|
-
SelectorCellComponent?: Types.SelectorCellComponentInput;
|
|
35
|
-
};
|
|
36
|
-
type Methods = {
|
|
37
|
-
openSelector(p: OpenSelectorInput): void;
|
|
38
|
-
closeSelector(selectorID: string): void;
|
|
39
|
-
updateOptions(selectorID: string, options: Types.ChipsOptions[]): void;
|
|
40
|
-
updateSelected(selectorID: string, selected: Types.ChipsOptions[]): void;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
declare const Selector: Selector.Methods;
|
|
44
|
-
export { Selector, Selector as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as A}from"../../../chunk-C5N2D3ZX.js";import{Fragment as X,jsx as n,jsxs as O}from"react/jsx-runtime";import{useState as I,useEffect as T,useRef as E}from"react";import w from"@mingoo/jsmin";import{$$fromRoot as J,useStore as U}from"../../../@utils";import K from"../../../atoms/Box";import F from"../../../atoms/FAI";import L from"../../../atoms/Span";import M from"../../../mols/Column";import b from"../../../mols/Row";import W from"../../Button";import B from"../../Sheet";import H from"../../Loader";import V from"../Text";import q from"../Parts";import{InputChipsClasses as G}from"../../../@styles/componentClasses";const Q=e=>{let[y,i]=I("show"),[h,k]=I(""),[u]=I(w.uuid.gen()),[l,g]=I(e.options),[o,C]=I(l[0]||null),[f,x]=I(e.selected),[D,R]=I("init");T(()=>{U.set({[e.selectorID]:{updateOptions:t=>{g(t)},updateSelected:t=>{x(t)}}})},[]);const P=E(!1);T(()=>{P.current?B.reposition(e.selectorID):P.current=!0},[l]);const $=E(!1);T(()=>{$.current?(i("interlude"),C(l[0]||null),e.onDynamicSearch?(w.interval.clear(u+"-dynamicSearch"),w.interval.standBy(u+"-dynamicSearch",400,()=>A(void 0,null,function*(){let{options:t}=yield e.onDynamicSearch(h);g(t),i("show")}))):(w.interval.clear(u+"-staticSearch"),w.interval.standBy(u+"-staticSearch",400,()=>A(void 0,null,function*(){let t=new RegExp(h,"ig"),p=[];[...e.options].forEach(s=>{var c;!!(!h||((c=String(s.label))!=null?c:String(s.value)).match(t))&&p.push(s)}),g(p),i("show")})))):$.current=!0},[h]);const z=E(!1);T(()=>{z.current?e.onUpdated({values:f}):z.current=!0},[f]),T(()=>{w.scope(()=>{if(w.is.nullish(o)||D=="MouseEvent")return;let t=J("#"+u+"-Selector-Cell-Wrap");if(!t[0])return;let p=J('[data-chips-selector-cell="'+u+"-"+JSON.stringify((o==null?void 0:o.value)||"").replace(/\"/ig,"")+'"]');if(!p[0])return;let{top:s,height:v}=t.position(),{top:c,height:d}=p.position();if(s<=c&&c+d<=s+v)return;let r=t[0].scrollTop+(c-s);D=="ArrowDown"?r-=v-d-20:D=="ArrowUp"&&(r-=20),t[0].scrollTop=r})},[o]);let N=[];return y=="interlude"?N=[O(b.Center,{padding:2,gap:0,children:[n(H.Theme.R,{showInitial:!0}),n(K,{padding:[0,1],fontSize:"1.mini",fontColor:"4.thin",children:"\u691C\u7D22\u4E2D..."})]},"interlude")]:N=[l.map((t,p)=>{let{value:s,label:v}=t,c=String(JSON.stringify(s)),d=f.findIndex(m=>JSON.stringify(m.value)==c),r=d!=-1,a=JSON.stringify((o==null?void 0:o.value)||"")==c,S={};return(r||a)&&(S={fontColor:"theme",isSemiBoldFont:!0}),a&&(S.backgroundColor="cloud"),r&&(S.backgroundColor="theme.opa.few"),n(W.Button.Clear.R,{color:"cloud",tabIndex:-1,"data-chips-selector-cell":u+"-"+c.replace(/\"/ig,""),isActive:r||a,isActiveStyles:S,padding:"1/3",textAlign:"left",onMouseOver:()=>{R("MouseEvent"),C(t)},onClick:()=>{let m=[...f];r?m.splice(d,1):(m=[...m,t],e.limit&&m.length>e.limit&&m.shift()),x(m)},children:n(e.SelectorCellComponent,{isSelected:r,isFocused:a,value:s,label:v})},s+"-"+p)})],O(X,{children:[O(M,{padding:"2/3",gap:"2/3",borderBottom:!0,children:[O(b.Separate,{children:[n(V.Normal,{value:h,onUpdateValidValue:({value:t})=>{k(t)},id:e.selectorID+"-KeywordInput",padding:"2/3",placeholder:"\u691C\u7D22...",leftIcon:n(q.LeftIcon,{right:"2/3",fontSize:"1.mini",fontColor:"3.blur",children:n(F.Search,{})}),onKeyDown:t=>{let{key:p,metaKey:s,ctrlKey:v}=t,c=s||v;if(["ArrowDown","ArrowUp"].includes(p)){let d=+(p=="ArrowDown")*2-1;if(c){let r=l[d==1?l.length-1:0];C(r)}else{let r=l.findIndex(a=>JSON.stringify(a.value)==JSON.stringify((o==null?void 0:o.value)||""))+d;l[r]?C(l[r]):C(l[d==1?0:l.length-1]||null)}}else if(p=="Enter"){let d=f.findIndex(S=>JSON.stringify(S.value)==JSON.stringify((o==null?void 0:o.value)||"")),r=d!=-1,a=[...f];if(r)a.splice(d,1);else{let S=l.findIndex(m=>JSON.stringify(m.value)==JSON.stringify((o==null?void 0:o.value)||""));if(S==-1)return;a=[...a,l[S]],e.limit&&a.length>e.limit&&a.shift()}x(a)}R(p)}}),n(W.Button.Border.S,{marginRight:"1/3",ssSphere:2,backgroundColor:"cloud",borderRadius:"2.tone.secondary",onClick:()=>{B.close(e.selectorID)},children:n(F.Times,{})})]}),O(b.Separate,{children:[O(b.Left,{verticalAlign:"baseline",gap:"1/2",children:[n(L,{fontColor:"theme",children:l.length}),n(K,{fontSize:"1.mini",fontColor:"3.blur",children:"\u4EF6\u306E\u30D2\u30C3\u30C8"})]}),n(b.Right,{children:!!e.limit&&O(L,{fontSize:"1.mini",fontColor:"3.blur",children:[n(L,{fontSize:"3.paragraph",fontColor:"theme",isSemiBoldFont:!0,children:f.length})," / ",e.limit," \u4EF6"]})})]})]}),n(M,{gap:"1/4",padding:"1/2",overflow:"auto",freeCSS:{maxHeight:12*26,maxWidth:12*26},id:u+"-Selector-Cell-Wrap",className:G("SelectorWrapper"),children:N}),e.bottomContent]})},_={openSelector:e=>{let{selectorID:y,options:i,selected:h,limit:k,bottomContent:u,onDynamicSearch:l,SelectorCellComponent:g,onUpdated:o,onClosed:C,parent:f,gravityPoint:x}=e,D=y;g=g||(R=>n(b.Left,{children:R.label})),B.open({parent:f,sheetID:D,type:"custom",gravityPoint:x||22,hold_state:!0,close_option:{aroundClick:!0,escapeKeyDown:!0},padding:[1,0],content:n(K,{borderRadius:"2.tone.secondary",backgroundColor:"layer.1",border:!0,boxShadow:"1.normal",overflow:"hidden",children:n(Q,{selectorID:y,options:i,limit:k,selected:h,onUpdated:o,SelectorCellComponent:g,bottomContent:u,onDynamicSearch:l},JSON.stringify(h))}),openAfter:()=>{J("#"+e.selectorID+"-KeywordInput").focus()},closeAfter:()=>{C()}})},closeSelector:e=>{B.close(e)},updateOptions:(e,y)=>{let i=U.get(e);i&&i.updateOptions&&i.updateOptions(y)},updateSelected:(e,y)=>{let i=U.get(e);i&&i.updateSelected&&i.updateSelected(y)}};export{_ as Selector,_ as default};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ReactElement } from '../../../@declares';
|
|
3
|
-
import { InputTypes } from '..';
|
|
4
|
-
export declare namespace Types {
|
|
5
|
-
type ChipsOptions = {
|
|
6
|
-
value: any;
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
type SelectedCellComponentInput = React.FC<{
|
|
10
|
-
removeCallback: Function;
|
|
11
|
-
defaultRemoveButton: ReactElement;
|
|
12
|
-
openCallback(): void;
|
|
13
|
-
value: any;
|
|
14
|
-
label: string;
|
|
15
|
-
}>;
|
|
16
|
-
type SelectorCellComponentInput = React.FC<{
|
|
17
|
-
isSelected: boolean;
|
|
18
|
-
isFocused: boolean;
|
|
19
|
-
value: any;
|
|
20
|
-
label: string;
|
|
21
|
-
}>;
|
|
22
|
-
type onDynamicSearch = {
|
|
23
|
-
(k: string): Promise<{
|
|
24
|
-
options: ChipsOptions[];
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
import Selector from './Selector';
|
|
29
|
-
declare namespace Chips {
|
|
30
|
-
type Methods = React.FC<Input> & {
|
|
31
|
-
fn: Selector.Methods;
|
|
32
|
-
};
|
|
33
|
-
type Input = InputTypes.CoreInput & {
|
|
34
|
-
tabIndex?: number;
|
|
35
|
-
id?: string;
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
value?: Options[];
|
|
38
|
-
limit?: number;
|
|
39
|
-
selectorGravityPoint?: number;
|
|
40
|
-
defaultOptions?: Options[];
|
|
41
|
-
onDynamicSearch?: Types.onDynamicSearch;
|
|
42
|
-
leftIndicator?: ReactElement | false;
|
|
43
|
-
rightIndicator?: ReactElement | false;
|
|
44
|
-
rightIcon?: ReactElement | false;
|
|
45
|
-
leftIcon?: ReactElement | false;
|
|
46
|
-
SelectedCellComponent?: SelectedCellComponentInput;
|
|
47
|
-
SelectorCellComponent?: SelectorCellComponentInput;
|
|
48
|
-
AddButtonComponent?: AddButtonComponentInput;
|
|
49
|
-
};
|
|
50
|
-
type Options = Types.ChipsOptions;
|
|
51
|
-
type onDynamicSearch = Types.onDynamicSearch;
|
|
52
|
-
type AddButtonComponentInput = React.FC<{
|
|
53
|
-
selected: Options[];
|
|
54
|
-
openCallback(): void;
|
|
55
|
-
}>;
|
|
56
|
-
type SelectedCellComponentInput = Types.SelectedCellComponentInput;
|
|
57
|
-
type SelectorCellComponentInput = Types.SelectorCellComponentInput;
|
|
58
|
-
}
|
|
59
|
-
declare const Chips: Chips.Methods;
|
|
60
|
-
export { Chips, Chips as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as p,c as v,d as K}from"../../../chunk-C5N2D3ZX.js";import{jsx as a,jsxs as g}from"react/jsx-runtime";import{useState as b,useEffect as L,useRef as H}from"react";import B from"@mingoo/jsmin";import{$$fromRoot as T}from"../../../@utils";import Q from"../../../atoms/Box";import N from"../../../atoms/FAI";import X from"../../../mols/Row";import U from"../../Button";import Y from"../../Sheet";import{Wrapper as Z,BoxWrapper as j,CommonEffects as ee,DefaultStyles as te}from"../core";import ne from"../Hidden";import W from"./Selector";function oe(e){let{value:s,states:u}=e,{required:l}=u,c=[];return l&&!s.length&&c.push({type:"invalid",label:"\u4E00\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),{ok:!c.filter(({type:f})=>f=="invalid").length,notice:c}}const le=e=>{let _=e,{required:s,form:u,name:l,checkValidationAtFirst:c,onValidate:f,onUpdateValue:O,onUpdateValidValue:G,value:F=[],limit:w,leftIndicator:ie,rightIndicator:re,leftIcon:pe,rightIcon:se,SelectedCellComponent:x,AddButtonComponent:R,SelectorCellComponent:ue,componentID:ce,defaultOptions:de,enableFormSubmit:me,onDynamicSearch:fe,freeCSS:Ce,wrapStyles:ye,selectorGravityPoint:Se}=_,M=K(_,["required","form","name","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","limit","leftIndicator","rightIndicator","leftIcon","rightIcon","SelectedCellComponent","AddButtonComponent","SelectorCellComponent","componentID","defaultOptions","enableFormSubmit","onDynamicSearch","freeCSS","wrapStyles","selectorGravityPoint"]);R=R;let[r]=b(B.uuid.gen()),[C,D]=b({componentID:e.componentID||"",dataValue:F.map(t=>t),eventID:B.uuid.gen(),eventType:"init"}),[k,q]=b({ok:!1,notice:[]}),[o,z]=b([...F]);ee({states:e,val_status:C,set_status:D,val_validate:k,set_validate:q,DefaultValidation:oe,onUpdateValue:O,onUpdateValidValue:G,ExtraOverrideStates:{formatValue:o,dataValue:o.map(t=>t)},ExtraStoreStates:{searchTimer:null}});const y=t=>{z(t),D(i=>v(p({},i),{dataValue:t.map(d=>d),eventID:B.uuid.gen(),eventType:"update"}))};let A=`[data-chips-input-wrapper="${r}"]`;const S=()=>{W.openSelector({parent:A,gravityPoint:e.selectorGravityPoint,SelectorCellComponent:e.SelectorCellComponent,selectorID:r,options:e.defaultOptions||[],selected:o,limit:e.limit,onDynamicSearch:e.onDynamicSearch,onUpdated:t=>{y(t.values)},onClosed:()=>{T(A).focus()}})};let I=w&&w<=o.length;const E=H(!1);L(()=>{E.current?I&&(Y.close(r),T(`[data-chips-input-wrapper="${r}"]`).focus()):E.current=!0},[o]);let J=o.map(t=>{let{value:i,label:d}=t;x=x;const h=()=>{let n=o.findIndex(P=>P.value==i);if(n==-1)return;let m=[...o];m.splice(n,1),y(m),m.length||setTimeout(()=>{T(`[data-chips-input-wrapper="${r}"]`).focus()},200)};return a(x,{value:i,label:d,removeCallback:h,defaultRemoveButton:a(U.Button.Sub.S,{color:"cloud",flexSizing:"none",backgroundColor:"cloud",flexCenter:!0,isRounded:!0,freeCSS:{aspectRatio:"1/1"},onClick:n=>{n.stopPropagation(),n.preventDefault(),h()},children:a(N.Times,{})}),openCallback:()=>{S()}},JSON.stringify(i))});return g(j,{val_status:C,set_status:D,val_validate:k,states:e,children:[a(ne,{"data-value":JSON.stringify(C.dataValue.map(t=>t.value)),name:l,form:u,"data-input-type":"chips-"+["single","multi"][+(e.limit!=1)],"data-validation":k.ok,componentID:C.componentID,"data-focusor":r}),g("label",v(p({tabIndex:0,"data-chips-input-wrapper":r,onKeyDown:t=>{let{key:i,ctrlKey:d,metaKey:h,keyCode:n}=t,m=d||h;if(n>=48&&n<=57||n>=65&&n<=90||n>=96&&n<=105){if(I)return;S()}else if(i!="Tab"){if(i=="Backspace"){if(!o.length)return;if(m)y([]);else{let $=[...o];$.pop(),y($)}}}},onClick:()=>{I||S()}},M),{children:[!I&&a(R,{selected:o,openCallback:S}),J]}))]})},ae=e=>{let u=[...e.value||[]].splice(0,e.limit||65535);return a(le,v(p({SelectedCellComponent:l=>{let{value:c,label:f,removeCallback:O}=l;return g(X.Left,{ssCardBox:!0,padding:"1/3",gap:0,isRounded:!0,textAlign:"left",children:[a(Q,{padding:[0,"1/2"],children:f}),l.defaultRemoveButton]})},AddButtonComponent:l=>e.limit&&e.limit<=l.selected.length?null:g(U.Button.Sub.R,{color:"cloud",padding:"1/2",onClick:()=>{l.openCallback()},children:[a(N.Plus,{}),"\u8FFD\u52A0\u3059\u308B"]})},e),{value:u}))},V=e=>{e=p({},e),e=p({gap:1,display:"flex",horizontalAlign:"left",verticalAlign:"center",flexWrap:!0},e);let s=te.Boxish(e);return a(Z,{componentID:e.componentID,children:ae,states:s})};V.fn=W;export{V as Chips,V as default};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { TagProperty, ReactElement } from '../../@declares';
|
|
3
|
-
import { KeyValueDict } from '@mingoo/jsmin';
|
|
4
|
-
import { InputTypes } from '.';
|
|
5
|
-
declare namespace RichSelect {
|
|
6
|
-
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
|
|
7
|
-
tone?: InputTypes.BoxTone;
|
|
8
|
-
tabIndex?: number;
|
|
9
|
-
id?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
value?: Value;
|
|
12
|
-
options: Option[];
|
|
13
|
-
placeholder?: string;
|
|
14
|
-
leftIndicator?: ReactElement | false;
|
|
15
|
-
rightIndicator?: ReactElement | false;
|
|
16
|
-
leftIcon?: ReactElement | false;
|
|
17
|
-
rightIcon?: ReactElement | false;
|
|
18
|
-
enableUnSelected?: boolean;
|
|
19
|
-
rightIconStyles?: TagProperty.PropsNFreeCSS;
|
|
20
|
-
cellStyles?: TagProperty.PropsNFreeCSS;
|
|
21
|
-
sheetStyles?: TagProperty.PropsNFreeCSS;
|
|
22
|
-
gravityPoint?: number;
|
|
23
|
-
};
|
|
24
|
-
type Value = string | number | boolean | KeyValueDict | void | null;
|
|
25
|
-
type Option = {
|
|
26
|
-
type?: 'button' | 'label';
|
|
27
|
-
value: Value;
|
|
28
|
-
label: ReactElement;
|
|
29
|
-
selectedLabel?: ReactElement;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
declare const RichSelect: React.FC<RichSelect.Input>;
|
|
33
|
-
export { RichSelect, RichSelect as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as t,c as n,d as N}from"../../chunk-C5N2D3ZX.js";import{jsx as a}from"react/jsx-runtime";import{useState as R}from"react";import c from"@mingoo/jsmin";import K from"../../atoms/Box";import q from"../../atoms/FAI";import M from"../../mols/Column";import $ from"../Button";import _ from"../Tooltips";import{Wrapper as j,BoxWrapper as z,CommonEffects as G,DefaultStyles as Q}from"./core";import X from"./Parts";import{InputRichSelectClasses as Y,InputClasses as Z}from"../../@styles/componentClasses";function ee(e){let{value:l,states:I}=e,{required:u,options:o}=I,i=[];return u&&(!o.length||o.length&&c.is.nullish(JSON.parse(l)))&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:p})=>p=="invalid").length,notice:i}}const te=e=>{let E=e,{tone:l,required:I,form:u,className:o,enableFormSubmit:i,enableUnSelected:p,checkValidationAtFirst:b,onChange:g,onKeyDown:C,onValidate:V,onUpdateValue:d,onUpdateValidValue:S,value:y="",options:D,placeholder:F,leftIndicator:ae,rightIndicator:ne,leftIcon:oe,rightIcon:ie,componentID:re,status_id:ue,wrapStyles:se,cellStyles:k,sheetStyles:m,rightIconStyles:ce,gravityPoint:A}=E,w=N(E,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","wrapStyles","cellStyles","sheetStyles","rightIconStyles","gravityPoint"]),L={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:c.uuid.gen()},[T]=R(c.uuid.gen()),[r,h]=R(L),[v,H]=R({ok:!1,notice:[]});G({type:"richSelect",states:e,val_status:r,set_status:h,ExtraOverrideStates:{dataValue:y,formatValue:y},val_validate:v,set_validate:H,DefaultValidation:ee,onUpdateValue:d,onUpdateValidValue:S});let x=a(K,{fontColor:"4.thin",textAlign:"left",children:F||"\u9078\u629E"});if(r.dataValue){let s=D.find(f=>f.type=="button"&&f.value==r.dataValue);s&&(x=s.selectedLabel||s.label)}return a(z,{val_status:r,set_status:h,val_validate:v,states:e,children:a("button",n(t({},w),{"data-form":u,"data-validation":v.ok,"data-component-id":r.componentID,"data-value":r.dataValue,"data-input-type":"richSelect",className:[o,Y("SelectLegend"),Z("InputCover")].join(" "),onClick:s=>{_.open({tipsID:T,parent:s.currentTarget,gravityPoint:A||13,close_option:{parentBlur:!1},content:()=>{let f=D.map(J=>{let{type:U,value:P,label:B}=J;return U=="button"?a($.Button.Clear.R,n(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0},k),{onClick:()=>{h(W=>n(t({},W),{dataValue:P,eventType:"update",eventID:c.uuid.gen()})),_.close(T)},children:B}),String(P)):B});return a(M,n(t({ssCardBox:!0,padding:[1,0],gap:0,overflow:"auto"},m),{freeCSS:t({minWidth:12*20,maxHeight:"90vh"},m==null?void 0:m.freeCSS),children:f}))}})},children:x}))})},le=e=>{let{value:l=null,placeholder:I,options:u=[]}=e,o=0,i=JSON.stringify(l),p=u.map(g=>{let{type:C,value:V}=g,d=JSON.stringify(V),S=d==i;return o|=Number(S),n(t({},g),{type:C||"button",value:d})});o||(l=null);let b=JSON.stringify(l);return a(te,n(t({},e),{value:b,options:p}))},O=e=>{e=t({},e),c.is.nullish(e.rightIcon)&&(e.rightIcon=a(X.RightIcon,n(t({flexType:"col"},e.rightIconStyles),{children:a(q.AngleDown,{})}))),e.rightIcon&&(e=t({paddingRight:3},e)),e.leftIcon&&(e=t({paddingLeft:3},e));let l=Q.Boxish(e);return delete l.rightIconStyles,a(j,{componentID:e.componentID,children:le,states:l})};export{O as RichSelect,O as default};
|
package/dist/fn/Input/Text.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ReactElement } from '../../@declares';
|
|
3
|
-
import { InputTypes } from '.';
|
|
4
|
-
declare namespace Text {
|
|
5
|
-
type Restrict = 'text' | 'katakana' | 'hankaku.katakana' | 'number' | 'number.zeroStart' | 'digitNumber' | 'tel' | 'email' | 'url' | 'fileName' | 'password' | 'postal' | 'creditCard' | 'concealed';
|
|
6
|
-
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
|
|
7
|
-
tone?: InputTypes.BoxTone;
|
|
8
|
-
tabIndex?: number;
|
|
9
|
-
id?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
min?: number | null;
|
|
12
|
-
max?: number | null;
|
|
13
|
-
maxLength?: number | null;
|
|
14
|
-
autoComplete?: 'off' | 'none' | string;
|
|
15
|
-
autoCapitalize?: 'off' | 'none' | string;
|
|
16
|
-
clearButton?: boolean;
|
|
17
|
-
value?: string | number;
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
leftIndicator?: ReactElement | false;
|
|
20
|
-
rightIndicator?: ReactElement | false;
|
|
21
|
-
leftIcon?: ReactElement | false;
|
|
22
|
-
rightIcon?: ReactElement | false;
|
|
23
|
-
};
|
|
24
|
-
type Origin = Input & {
|
|
25
|
-
restrict?: Restrict;
|
|
26
|
-
};
|
|
27
|
-
type Methods = {
|
|
28
|
-
Validate(value: any, restrict: Restrict): {
|
|
29
|
-
ok: boolean;
|
|
30
|
-
body: ReactElement;
|
|
31
|
-
};
|
|
32
|
-
Normal: (props: Origin) => JSX.Element;
|
|
33
|
-
Katakana: (props: Origin) => JSX.Element;
|
|
34
|
-
HankakuKatakana: (props: Origin) => JSX.Element;
|
|
35
|
-
Number: (props: Input) => JSX.Element;
|
|
36
|
-
DigitNumber: (props: Input) => JSX.Element;
|
|
37
|
-
Tel: (props: Input) => JSX.Element;
|
|
38
|
-
CreditCard: (props: Input) => JSX.Element;
|
|
39
|
-
Email: (props: Input) => JSX.Element;
|
|
40
|
-
Url: (props: Input) => JSX.Element;
|
|
41
|
-
Postal: (props: Input) => JSX.Element;
|
|
42
|
-
Password: (props: Input) => JSX.Element;
|
|
43
|
-
Concealed: (props: Input) => JSX.Element;
|
|
44
|
-
Money: {
|
|
45
|
-
JPY: (props: Input) => JSX.Element;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export declare const TextInput: React.FC<Text.Origin>;
|
|
50
|
-
declare const Text: Text.Methods;
|
|
51
|
-
export { Text, Text as default };
|
package/dist/fn/Input/Text.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as o,c as y,d as P}from"../../chunk-C5N2D3ZX.js";import{Fragment as W,jsx as i,jsxs as q}from"react/jsx-runtime";import{useState as R,useEffect as F}from"react";import x from"@mingoo/jsmin";import{$$fromRoot as ae,useStore as re}from"../../@utils";import T from"../../atoms/Box";import U from"../../atoms/FAI";import Z from"../Button";import D from"../Tooltips";import{faEye as K}from"@fortawesome/free-solid-svg-icons/faEye";import{Wrapper as ne,BoxWrapper as ie,SubmitForm as oe,CommonEffects as le,DefaultStyles as ue}from"./core";import B from"./Parts";const se={number:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},katakana:{reg:/^[ァ-ヶー ヲ-゚ ]*$/g,exist:!0,reason:"\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},"hankaku.katakana":{reg:/^[ヲ-゚ ]*$/g,exist:!0,reason:"\u534A\u89D2\u30AB\u30BF\u30AB\u30CA\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},digitNumber:{reg:/^-?[0-9\.]+$/g,exist:!0,reason:"\u534A\u89D2\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},fileName:{reg:/[¥\/:*\?\"\'\|\.\s\n\r\<\>]/g,exist:!1,reason:"\u7A7A\u767D\u307E\u305F\u306F\u4E00\u90E8\u306E\u7279\u6B8A\u6587\u5B57\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093"},creditCard:{reg:/^\d{14,16}$/g,exist:!0,reason:"14~16\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},email:{reg:/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]+\.[A-Za-z0-9]+$/,exist:!0,reason:q(W,{children:[i(T,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),i(T,{children:"\u6700\u5F8C\u306E\u6587\u5B57\u306B.(\u30C9\u30C3\u30C8)\u3092\u5165\u308C\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093"})]})},password:{reg:/^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9]).{8,}$/,exist:!0,reason:"8\u6587\u5B57\u4EE5\u4E0A\u3001\u534A\u89D2\u82F1\u6570\u5927\u5C0F\u6587\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"},tel:{reg:/.*$/g,exist:!0,reason:q(W,{children:[i(T,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),i(T,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),i(T,{children:"\u6570\u5B57\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"})]})},url:{reg:/^https?:\/\/[^\n\s]+(\.|\:)[^\n\s\.\:]+$/,exist:!0,reason:"URL\u5F62\u5F0F : http(s)://\u25EF\u25EF\u25EF\u25EF"},postal:{reg:/^\d{7}$/g,exist:!0,reason:"7\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}},V=t=>{let{restrict:r,value:s=""}=t,e=String(s),a=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(r)&&(e=e.zen2hanNumber()),r=="katakana"&&(e=e.replace(/[^ァ-ヶー ヲ-゚ ]/ig,"")),r=="hankaku.katakana"&&(e=e.replace(/[^ヲ-゚ ]/ig,"")),["postal","creditCard"].includes(r)&&(e=e.removeLetters()),["number","number.zeroStart","digitNumber"].includes(r)){let u=e[0]=="0";if(e){if(e!="-")if(e=="0-")e="-";else{e[0]=="-"&&(a=!0),e=e.replace(/[^0-9\.]/ig,"");let n=Number(e);n===0&&(a=!1),a&&(n=-1*n),x.is.exist(t.min)&&(n=Math.max(n,Number(t.min))),x.is.exist(t.max)&&(n=Math.min(n,Number(t.max))),e=String(Math.abs(n))}u&&e!="0"&&r=="number.zeroStart"&&(e="0"+e)}}let l=e;if(r=="digitNumber"){if(e&&e!="-"){let u=[];for(let n=e.length-1;n>=0;n--){u.unshift(e[n]);let g=e.length-1-n+1;n!=0&&g%3==0&&u.unshift(",")}l=u.join("")}}else r=="postal"?e.length>=4&&(l=e.clip(0,3)+"-"+e.clip(3)):r=="creditCard"&&(l=e.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(r)&&a&&(e="-"+e,l="-"+l),{formatValue:l,dataValue:e}},me=t=>{let{id:r,restrict:s,val_status:e}=t,a=ae("#"+r)[0];if(a&&e.prevValue&&e.formatValue){let{formatValue:l,prevValue:u,caretFrom:n,caretTo:g}=e;if(s=="creditCard")l.length>=u.length&&n%5==0&&(n++,g++),a.setSelectionRange(n,g);else if(s=="postal")l.length==5&&u.length==3&&(n++,g++),a.setSelectionRange(n,g);else if(s=="digitNumber"){let w=l.length-u.length;w==2&&(n++,g++),w==-2&&(n--,g--),a.setSelectionRange(n,g)}}},H=(t,r)=>{let s={ok:!0,body:""};return(()=>{let e=se[r];if(!e)return;let a=e.reason;if(e){let l=!!(+!!t.match(e.reg)^+!e.exist);s={ok:l,body:l?"":a}}})(),s};function pe(t){let{value:r,states:s}=t,{restrict:e="text",maxLength:a=255,required:l}=s,u=[];if(x.is.exist(a)&&r.length>=Number(a)&&u.push({type:"invalid",label:a+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),r){let n=H(r,e);n.ok||u.push({type:"invalid",label:n.body})}else l&&u.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!u.filter(({type:n})=>n=="invalid").length,notice:u}}const de=t=>{let O=t,{componentID:r,tone:s,required:e,restrict:a="text",form:l,autoComplete:u="off",autoCapitalize:n="off",enableFormSubmit:g,clearButton:w=!1,checkValidationAtFirst:ce,onChange:M,onKeyDown:$,onValidate:fe,onUpdateValue:Y,onUpdateValidValue:j,value:z="",leftIndicator:ge,rightIndicator:xe,leftIcon:be,rightIcon:he,maxLength:Ie,min:k,max:v,freeCSS:ye,wrapStyles:Ne}=O,p=P(O,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max","freeCSS","wrapStyles"]),G=a=="password"||a=="concealed"?"password":"text",Q=["number","digitNumber","creditCard"].includes(a)?"numeric":a=="email"?"email":"text",ee=y(o({componentID:r},V({min:k,max:v,restrict:a,value:z})),{prevValue:"",eventType:"init",eventID:x.uuid.gen(),caretFrom:null,caretTo:null}),[te,X]=R(!1),[d,N]=R(ee),[C,_]=R({ok:!1,notice:[]});return le({states:t,val_status:d,set_status:N,val_validate:C,set_validate:_,DefaultValidation:pe,onUpdateValue:Y,onUpdateValidValue:j,ExtraOverrideStates:o({},V({min:k,max:v,restrict:a,value:z}))}),F(()=>{me({id:t.id,restrict:a,val_status:d})},[d]),i(ie,{val_status:d,set_status:N,val_validate:C,states:t,children:i("input",y(o({type:G,inputMode:Q,"data-form":l,"data-input-type":"text","data-validation":C.ok,"data-value":d.dataValue,"data-component-id":d.componentID,value:d.formatValue,autoComplete:u,autoCapitalize:n,onKeyDown:c=>{let{key:f,target:h}=c;{let b=h,{selectionStart:I,selectionEnd:S}=b,E=Number(I),L=Number(S),A=d.formatValue[Number(E)],J=d.formatValue[Number(E)-1];f=="Delete"&&(a=="creditCard"&&A==" "||a=="postal"&&A=="-"||a=="digitNumber"&&A==",")&&(b.setSelectionRange(E+1,L+1),c.preventDefault()),f=="Backspace"&&(a=="creditCard"&&J==" "||a=="postal"&&J=="-"||a=="digitNumber"&&J==",")&&(b.setSelectionRange(E-1,L-1),c.preventDefault()),f=="Enter"||f=="Tab"}if(["number","digitNumber","creditCard"].includes(a)&&f=="Clear"&&N(b=>y(o({},b),{dataValue:"",formatValue:"",eventType:"update",eventID:x.uuid.gen()})),["number","digitNumber"].includes(a)&&["ArrowUp","ArrowDown"].includes(f)){let b=+(f=="ArrowUp")*2-1,I=String(Number(d.dataValue)+b);C.ok&&_({ok:!1,notice:[]}),N(S=>y(o(o({},S),V({min:k,max:v,restrict:a,value:I})),{eventType:"update",eventID:x.uuid.gen()})),c.preventDefault()}$&&$(c),g&&oe(c)},onChange:c=>{let{value:f,selectionStart:h,selectionEnd:b}=c.target,I=V({min:k,max:v,restrict:a,value:f});te&&(I.formatValue=f),I.formatValue!=d.formatValue&&(C.ok&&_({ok:!1,notice:[]}),N(S=>y(o(o({},S),I),{prevValue:d.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(h),caretTo:Number(b)})),M&&M(c))}},p),{onCompositionStart:c=>{p!=null&&p.onCompositionStart&&(p==null||p.onCompositionStart(c)),X(!0)},onCompositionEnd:c=>{if(p!=null&&p.onCompositionEnd&&(p==null||p.onCompositionEnd(c)),a=="text")return;let f=V({min:k,max:v,restrict:a,value:d.formatValue});N(h=>y(o(o({},h),f),{prevValue:h.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(h.formatValue.length+1),caretTo:Number(h.formatValue.length+1)})),X(!1)}}))})},m={Validate:H,Normal:t=>(t=o({},t),t.rightIcon&&(t=o({paddingRight:3},t)),t.leftIcon&&(t=o({paddingLeft:3},t)),i(ne,{componentID:t.componentID,children:de,states:ue.Boxish(t)})),Katakana:t=>i(m.Normal,o({restrict:"katakana"},t)),HankakuKatakana:t=>i(m.Normal,o({restrict:"hankaku.katakana"},t)),CreditCard:t=>i(m.Normal,o({restrict:"creditCard"},t)),Tel:t=>i(m.Normal,o({restrict:"tel",placeholder:"xxx-xxxx-xxxx"},t)),Number:t=>i(m.Normal,o({restrict:"number"},t)),DigitNumber:t=>i(m.Normal,o({restrict:"digitNumber"},t)),Email:t=>i(m.Normal,o({restrict:"email"},t)),Url:t=>i(m.Normal,o({restrict:"url"},t)),Postal:t=>{let[r]=R(x.uuid.gen());return F(()=>()=>{re.delete(r)},[]),i(m.Normal,o({restrict:"postal",placeholder:"\u90F5\u4FBF\u756A\u53F7",leftIndicator:i(B.LeftIndicator,{children:"\u3012"})},t))},Password:t=>i(m.Normal,o({restrict:"password",placeholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",rightIndicator:i(B.RightIndicator,{padding:0,children:i(Z.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{D.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:i(D.Comps.Body,{children:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().find("input").callback(s=>{let e=s[0];e.type=e.type==="password"?"text":"password"})},children:i(U,{icon:K})})})},t)),Concealed:t=>i(m.Normal,o({restrict:"concealed",placeholder:"\u79D8\u5BC6\u9375\u3092\u5165\u529B",rightIndicator:i(B.RightIndicator,{padding:0,children:i(Z.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{D.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:i(D.Comps.Body,{children:"\u5024\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().parent().find("input").callback(s=>{let e=s[0];e.type=e.type==="password"?"text":"password"})},children:i(U,{icon:K})})})},t)),Money:{JPY:t=>i(m.DigitNumber,o({placeholder:"\u91D1\u984D\u3092\u5165\u529B",rightIndicator:i(B.RightIndicator,{children:"\u5186"})},t))}};export{m as Text,de as TextInput,m as default};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ReactElement } from '../../@declares';
|
|
3
|
-
import { InputTypes } from '.';
|
|
4
|
-
declare namespace TextArea {
|
|
5
|
-
type Input = InputTypes.CoreInput & React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
6
|
-
tone?: InputTypes.BoxTone;
|
|
7
|
-
tabIndex?: number;
|
|
8
|
-
id?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
value?: string | number;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
leftIndicator?: ReactElement | false;
|
|
13
|
-
rightIndicator?: ReactElement | false;
|
|
14
|
-
leftIcon?: ReactElement | false;
|
|
15
|
-
rightIcon?: ReactElement | false;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
declare const TextArea: React.FC<TextArea.Input>;
|
|
19
|
-
export { TextArea, TextArea as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as T,d as v}from"../../chunk-C5N2D3ZX.js";import{jsx as u}from"react/jsx-runtime";import{useState as y}from"react";import g from"@mingoo/jsmin";import{Wrapper as E,BoxWrapper as _,SubmitForm as C,CommonEffects as k,DefaultStyles as w}from"./core";function F(t){let{value:e,states:d}=t,{required:p}=d,n=[];return p&&!e&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:r})=>r=="invalid").length,notice:n}}const B=t=>{let I=t,{componentID:e,tone:d,required:p,form:n,enableFormSubmit:r,checkValidationAtFirst:L,onChange:c,onKeyDown:f,onValidate:W,onUpdateValue:h,onUpdateValidValue:V,value:D="",leftIndicator:q,rightIndicator:H,leftIcon:K,rightIcon:M,freeCSS:U,wrapStyles:$}=I,R=v(I,["componentID","tone","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","freeCSS","wrapStyles"]),b={componentID:e,dataValue:D,eventType:"init",eventID:g.uuid.gen()},[o,s]=y(b),[i,m]=y({ok:!1,notice:[]});return k({states:t,val_status:o,set_status:s,val_validate:i,set_validate:m,onUpdateValue:h,onUpdateValidValue:V,DefaultValidation:F}),u(_,{val_status:o,set_status:s,val_validate:i,states:t,children:u("textarea",a({"data-form":n,"data-input-type":"textarea","data-validation":i.ok,"data-value":o.dataValue,"data-component-id":o.componentID,value:o.dataValue,onKeyDown:l=>{f&&f(l),r&&C(l)},onChange:l=>{let{value:A}=l.target;i.ok&&m({ok:!1,notice:[]}),s(S=>T(a({},S),{dataValue:A,eventType:"update",eventID:g.uuid.gen()})),c&&c(l)}},R))})},x=t=>{t=a({},t),t.rightIcon&&(t=a({paddingRight:3},t)),t.leftIcon&&(t=a({paddingLeft:3},t));let e=w.Boxish(t);return e.rows=e.rows||5,u(E,{componentID:t.componentID,children:B,states:e})};export{x as TextArea,x as default};
|
package/dist/mols/Column.d.ts
DELETED
package/dist/mols/Column.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as p}from"../chunk-C5N2D3ZX.js";import{jsx as t}from"react/jsx-runtime";import{Flex as l}from"../atoms/Flex";const e=o=>t(l,p({flexType:"col",gap:1},o));export{e as Column,e as default};
|