amotify 0.1.58 → 0.1.59

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.
Files changed (191) hide show
  1. package/dist/@declaration/index.d.ts +10 -0
  2. package/dist/@declaration/index.js +1 -0
  3. package/dist/@declaration/module.d.ts +5 -0
  4. package/dist/@declaration/module.js +0 -0
  5. package/dist/@declaration/property.d.ts +139 -0
  6. package/dist/@declaration/property.js +0 -0
  7. package/dist/@styles/componentClasses/index.css +1502 -0
  8. package/dist/@styles/componentClasses/index.d.ts +23 -0
  9. package/dist/@styles/componentClasses/index.js +398 -0
  10. package/dist/@styles/index.css +1502 -0
  11. package/dist/@styles/index.d.ts +1 -0
  12. package/dist/@styles/index.js +398 -0
  13. package/dist/@styles/init.css +89 -0
  14. package/dist/@styles/init.d.ts +1 -0
  15. package/dist/@styles/init.js +0 -0
  16. package/dist/@styles/style.css +7407 -0
  17. package/dist/@styles/style.d.ts +4 -0
  18. package/dist/@styles/style.js +398 -0
  19. package/dist/@styles/var.css +1258 -0
  20. package/dist/@styles/var.d.ts +1 -0
  21. package/dist/@styles/var.js +0 -0
  22. package/dist/@utils/GenerateClassName.d.ts +11 -0
  23. package/dist/@utils/GenerateClassName.js +1 -0
  24. package/dist/@utils/LaunchReactApp.d.ts +20 -0
  25. package/dist/@utils/LaunchReactApp.js +1 -0
  26. package/dist/@utils/collectForm.d.ts +11 -0
  27. package/dist/@utils/collectForm.js +1 -0
  28. package/dist/@utils/color.d.ts +21 -0
  29. package/dist/@utils/color.js +1 -0
  30. package/dist/@utils/config.d.ts +43 -0
  31. package/dist/@utils/config.js +1 -0
  32. package/dist/@utils/fin.d.ts +1 -0
  33. package/dist/@utils/fin.js +1 -0
  34. package/dist/@utils/getElement.d.ts +6 -0
  35. package/dist/@utils/getElement.js +1 -0
  36. package/dist/@utils/index.d.ts +11 -0
  37. package/dist/@utils/index.js +1 -0
  38. package/dist/@utils/pageTransit.d.ts +11 -0
  39. package/dist/@utils/pageTransit.js +1 -0
  40. package/dist/@utils/useRecycle.d.ts +8 -0
  41. package/dist/@utils/useRecycle.js +1 -0
  42. package/dist/@utils/useStore.d.ts +18 -0
  43. package/dist/@utils/useStore.js +1 -0
  44. package/dist/atoms/Box.d.ts +9 -0
  45. package/dist/atoms/Box.js +1 -0
  46. package/dist/atoms/FAI.d.ts +18 -0
  47. package/dist/atoms/FAI.js +1 -0
  48. package/dist/atoms/Flex.d.ts +11 -0
  49. package/dist/atoms/Flex.js +1 -0
  50. package/dist/atoms/Grid.d.ts +4 -0
  51. package/dist/atoms/Grid.js +1 -0
  52. package/dist/atoms/Img.d.ts +11 -0
  53. package/dist/atoms/Img.js +1 -0
  54. package/dist/atoms/Logo.d.ts +40 -0
  55. package/dist/atoms/Logo.js +51 -0
  56. package/dist/atoms/P.d.ts +9 -0
  57. package/dist/atoms/P.js +1 -0
  58. package/dist/atoms/Placeholder.d.ts +9 -0
  59. package/dist/atoms/Placeholder.js +1 -0
  60. package/dist/atoms/Span.d.ts +9 -0
  61. package/dist/atoms/Span.js +1 -0
  62. package/dist/atoms/index.d.ts +9 -0
  63. package/dist/atoms/index.js +1 -0
  64. package/dist/chunk-VY3566IV.js +1 -0
  65. package/dist/fn/Button.d.ts +82 -0
  66. package/dist/fn/Button.js +1 -0
  67. package/dist/fn/Cropper.d.ts +26 -0
  68. package/dist/fn/Cropper.js +1 -0
  69. package/dist/fn/Effect/Fade.d.ts +17 -0
  70. package/dist/fn/Effect/Fade.js +1 -0
  71. package/dist/fn/Effect/Pudding.d.ts +8 -0
  72. package/dist/fn/Effect/Pudding.js +1 -0
  73. package/dist/fn/Effect/Ripple.d.ts +8 -0
  74. package/dist/fn/Effect/Ripple.js +3 -0
  75. package/dist/fn/Effect/index.d.ts +11 -0
  76. package/dist/fn/Effect/index.js +1 -0
  77. package/dist/fn/Input/AutoHeightText.d.ts +6 -0
  78. package/dist/fn/Input/AutoHeightText.js +1 -0
  79. package/dist/fn/Input/Checker.d.ts +17 -0
  80. package/dist/fn/Input/Checker.js +1 -0
  81. package/dist/fn/Input/Chips/Selector.d.ts +44 -0
  82. package/dist/fn/Input/Chips/Selector.js +1 -0
  83. package/dist/fn/Input/Chips/index.d.ts +60 -0
  84. package/dist/fn/Input/Chips/index.js +1 -0
  85. package/dist/fn/Input/Contenteditable.d.ts +17 -0
  86. package/dist/fn/Input/Contenteditable.js +1 -0
  87. package/dist/fn/Input/DigitCharacters.d.ts +17 -0
  88. package/dist/fn/Input/DigitCharacters.js +1 -0
  89. package/dist/fn/Input/Filer.d.ts +47 -0
  90. package/dist/fn/Input/Filer.js +1 -0
  91. package/dist/fn/Input/Hidden.d.ts +13 -0
  92. package/dist/fn/Input/Hidden.js +1 -0
  93. package/dist/fn/Input/List.d.ts +50 -0
  94. package/dist/fn/Input/List.js +1 -0
  95. package/dist/fn/Input/Parts.d.ts +22 -0
  96. package/dist/fn/Input/Parts.js +1 -0
  97. package/dist/fn/Input/Plain.d.ts +7 -0
  98. package/dist/fn/Input/Plain.js +1 -0
  99. package/dist/fn/Input/RichSelect.d.ts +32 -0
  100. package/dist/fn/Input/RichSelect.js +1 -0
  101. package/dist/fn/Input/Search.d.ts +6 -0
  102. package/dist/fn/Input/Search.js +1 -0
  103. package/dist/fn/Input/Segmented.d.ts +22 -0
  104. package/dist/fn/Input/Segmented.js +1 -0
  105. package/dist/fn/Input/Select.d.ts +28 -0
  106. package/dist/fn/Input/Select.js +1 -0
  107. package/dist/fn/Input/Slider.d.ts +31 -0
  108. package/dist/fn/Input/Slider.js +1 -0
  109. package/dist/fn/Input/Switch.d.ts +17 -0
  110. package/dist/fn/Input/Switch.js +1 -0
  111. package/dist/fn/Input/Text.d.ts +51 -0
  112. package/dist/fn/Input/Text.js +1 -0
  113. package/dist/fn/Input/TextArea.d.ts +19 -0
  114. package/dist/fn/Input/TextArea.js +1 -0
  115. package/dist/fn/Input/Time/Picker.d.ts +37 -0
  116. package/dist/fn/Input/Time/Picker.js +1 -0
  117. package/dist/fn/Input/Time/index.d.ts +78 -0
  118. package/dist/fn/Input/Time/index.js +1 -0
  119. package/dist/fn/Input/core.d.ts +54 -0
  120. package/dist/fn/Input/core.js +1 -0
  121. package/dist/fn/Input/index.d.ts +145 -0
  122. package/dist/fn/Input/index.js +1 -0
  123. package/dist/fn/Layout/PageNotFound.d.ts +6 -0
  124. package/dist/fn/Layout/PageNotFound.js +1 -0
  125. package/dist/fn/Layout/PageRouter.d.ts +27 -0
  126. package/dist/fn/Layout/PageRouter.js +1 -0
  127. package/dist/fn/Layout/PageViewController.d.ts +13 -0
  128. package/dist/fn/Layout/PageViewController.js +1 -0
  129. package/dist/fn/Layout/Plate.d.ts +9 -0
  130. package/dist/fn/Layout/Plate.js +1 -0
  131. package/dist/fn/Layout/RootViewController.d.ts +41 -0
  132. package/dist/fn/Layout/RootViewController.js +1 -0
  133. package/dist/fn/Layout/SwipeView.d.ts +40 -0
  134. package/dist/fn/Layout/SwipeView.js +1 -0
  135. package/dist/fn/Layout/TabBar.d.ts +16 -0
  136. package/dist/fn/Layout/TabBar.js +1 -0
  137. package/dist/fn/Layout/index.d.ts +27 -0
  138. package/dist/fn/Layout/index.js +1 -0
  139. package/dist/fn/Loader/corner.d.ts +1 -0
  140. package/dist/fn/Loader/corner.js +1 -0
  141. package/dist/fn/Loader/index.d.ts +47 -0
  142. package/dist/fn/Loader/index.js +1 -0
  143. package/dist/fn/Loader/mini.d.ts +6 -0
  144. package/dist/fn/Loader/mini.js +1 -0
  145. package/dist/fn/Loader/top.d.ts +2 -0
  146. package/dist/fn/Loader/top.js +1 -0
  147. package/dist/fn/Sheet.d.ts +76 -0
  148. package/dist/fn/Sheet.js +1 -0
  149. package/dist/fn/Snackbar.d.ts +24 -0
  150. package/dist/fn/Snackbar.js +1 -0
  151. package/dist/fn/Table/Data.d.ts +128 -0
  152. package/dist/fn/Table/Data.js +1 -0
  153. package/dist/fn/Table/Drag.d.ts +18 -0
  154. package/dist/fn/Table/Drag.js +1 -0
  155. package/dist/fn/Table/Normal.d.ts +16 -0
  156. package/dist/fn/Table/Normal.js +1 -0
  157. package/dist/fn/Table/Parts.d.ts +24 -0
  158. package/dist/fn/Table/Parts.js +1 -0
  159. package/dist/fn/Table/Wrapper.d.ts +10 -0
  160. package/dist/fn/Table/Wrapper.js +1 -0
  161. package/dist/fn/Table/cellStyling.d.ts +9 -0
  162. package/dist/fn/Table/cellStyling.js +1 -0
  163. package/dist/fn/Table/index.d.ts +42 -0
  164. package/dist/fn/Table/index.js +1 -0
  165. package/dist/fn/Tooltips.d.ts +31 -0
  166. package/dist/fn/Tooltips.js +1 -0
  167. package/dist/fn/index.d.ts +10 -0
  168. package/dist/fn/index.js +1 -0
  169. package/dist/index.d.ts +400 -0
  170. package/dist/index.js +1 -0
  171. package/dist/mols/Accordion.d.ts +25 -0
  172. package/dist/mols/Accordion.js +1 -0
  173. package/dist/mols/Column.d.ts +7 -0
  174. package/dist/mols/Column.js +1 -0
  175. package/dist/mols/LinkifyText.d.ts +10 -0
  176. package/dist/mols/LinkifyText.js +1 -0
  177. package/dist/mols/List.d.ts +11 -0
  178. package/dist/mols/List.js +1 -0
  179. package/dist/mols/Row.d.ts +16 -0
  180. package/dist/mols/Row.js +1 -0
  181. package/dist/mols/Text.d.ts +21 -0
  182. package/dist/mols/Text.js +1 -0
  183. package/dist/mols/index.d.ts +6 -0
  184. package/dist/mols/index.js +1 -0
  185. package/dist/orgs/index.d.ts +1 -0
  186. package/dist/orgs/index.js +0 -0
  187. package/dist/temps/designBook.d.ts +4 -0
  188. package/dist/temps/designBook.js +99 -0
  189. package/dist/temps/index.d.ts +1 -0
  190. package/dist/temps/index.js +1 -0
  191. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ import{b as e}from"../../chunk-VY3566IV.js";import{jsx as t,jsxs as p}from"react/jsx-runtime";import r from"../../atoms/Box";import n from"../../atoms/FAI";import i from"../../mols/Row";import f from"../../mols/Column";import{faAngleUp as l}from"@fortawesome/free-solid-svg-icons/faAngleUp";import{faAngleDown as u}from"@fortawesome/free-solid-svg-icons/faAngleDown";import c from"./Chips";import d from"./Parts";const m=a=>t(c,e({AddButtonComponent:o=>o.selected.length?null:t(r,{children:"\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),SelectedCellComponent:o=>t(r,{width:1,textAlign:"left",children:p(i.Separate,{children:[o.label,o.defaultRemoveButton]})}),paddingLeft:3,rightIcon:t(d.LeftIcon,{children:p(f,{gap:0,children:[t(n,{icon:l}),t(n,{icon:u,freeCSS:{marginTop:-6}})]})}),limit:1},a));export{m as Search,m as default};
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import List from './List';
3
+ declare namespace Segmented {
4
+ type Tones = 'Border' | 'ThemeBorder' | 'BottomLine' | 'Cloud' | 'ThemeCloud' | 'WhiteCloud';
5
+ type CoreInput = Segmented.Input & {
6
+ appearance: Segmented.Tones;
7
+ };
8
+ type ListInput = List.Options[];
9
+ type Input = List.Input;
10
+ type Methods = {
11
+ Auto: (para: Input) => JSX.Element;
12
+ Normal: (para: Input) => JSX.Element;
13
+ Cloud: (para: Input) => JSX.Element;
14
+ Cloud2: (para: Input) => JSX.Element;
15
+ Cloud3: (para: Input) => JSX.Element;
16
+ Border: (para: Input) => JSX.Element;
17
+ Border2: (para: Input) => JSX.Element;
18
+ BottomLine: (para: Input) => JSX.Element;
19
+ };
20
+ }
21
+ declare const Segmented: Segmented.Methods;
22
+ export { Segmented, Segmented as default };
@@ -0,0 +1 @@
1
+ import{b as o,c as l,d as y}from"../../chunk-VY3566IV.js";import{jsx as t}from"react/jsx-runtime";import R from"@mingoo/jsmin";import{useState as s}from"react";import x from"./List";import{InputSegmentedClasses as u}from"../../@styles/componentClasses";const n=e=>{let m=e,{tone:E,appearance:c,value:r,options:a,onUpdateValue:f,onUpdateValidValue:i,freeCSS:p,cellStyles:b,cellClassName:g,cellCheckedClassName:k,cellCheckedStyles:B}=m,I=y(m,["tone","appearance","value","options","onUpdateValue","onUpdateValidValue","freeCSS","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles"]),[v]=s(R.uuid.gen()),[C,L]=s(r),[w,h]=s(C);return C!=r&&(L(r),h(r)),t(x.Radio,l(o({defaultActiveStyling:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative",options:a,value:w,componentID:v,icon:!1},I),{freeCSS:o({whiteSpace:"nowrap"},p),cellStyles:o({flexCenter:!0,ssPushable:!0,boxShadow:"none"},b),cellClassName:[g,u("Label"),u("Tone_"+c)].join(" "),cellCheckedStyles:o({isSemiBoldFont:!0},B),cellCheckedClassName:[k,u("Checked")].join(" "),tone:"custom",onUpdateValue:f,onUpdateValidValue:S=>{i&&i(S),c=="BottomLine"&&h(S.value[0])}}))},d={Auto:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",ssCardBox:!0},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Auto"},e))),Normal:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),Cloud:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",backgroundColor:"cloud"},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Cloud"},e))),Cloud2:e=>(e=o({},e),e.tone="WhiteCloud",t(d.Cloud,l(o({fontColor:"3.blur"},e),{cellCheckedStyles:o({fontColor:"1.clear"},e.cellCheckedStyles)}))),Cloud3:e=>(e=o({},e),e.tone="ThemeCloud",t(d.Cloud,l(o({backgroundColor:"theme.opa.few",fontColor:"theme"},e),{cellStyles:o({},e.cellStyles)}))),Border:e=>(e=o({},e),e=l(o({backgroundColor:"layer.1",border:"2.normal",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin"},e),{cellStyles:o({borderRadius:0,borderRight:"2.normal"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme.opa.few",fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Border"},e))),Border2:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),BottomLine:e=>(e=o({},e),e=l(o({gap:0,fontColor:"3.blur"},e),{cellStyles:o({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},e.cellStyles),cellCheckedStyles:o({fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:"BottomLine"},e)))};export{d as Segmented,d as default};
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { TagProperty, ReactElement } from '../../@declaration';
3
+ import { InputTypes } from '.';
4
+ declare namespace Select {
5
+ type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLSelectElement> & {
6
+ tone?: InputTypes.BoxTone;
7
+ tabIndex?: number;
8
+ id?: string;
9
+ disabled?: boolean;
10
+ value?: Value;
11
+ options: Options[];
12
+ placeholder?: string;
13
+ leftIndicator?: ReactElement | false;
14
+ rightIndicator?: ReactElement | false;
15
+ leftIcon?: ReactElement | false;
16
+ rightIcon?: ReactElement | false;
17
+ enableUnSelected?: boolean;
18
+ rightIconStyles?: TagProperty.Para;
19
+ };
20
+ type Value = string | number | boolean | plainObject | void | null;
21
+ type Options = {
22
+ value: Value;
23
+ label: string;
24
+ displayLabel?: ReactElement;
25
+ };
26
+ }
27
+ declare const Select: React.FC<Select.Input>;
28
+ export { Select, Select as default };
@@ -0,0 +1 @@
1
+ import{b as c,c as d,d as T}from"../../chunk-VY3566IV.js";import{Fragment as Q,jsx as l,jsxs as G}from"react/jsx-runtime";import{useState as C}from"react";import S from"@mingoo/jsmin";import E from"../../atoms/Box";import J from"../../atoms/FAI";import{Wrapper as U,BoxWrapper as W,SubmitForm as q,CommonEffects as K,DefaultStyles as M}from"./core";import $ from"./Parts";import{InputClasses as j,InputSelectClasses as N}from"../../@styles/componentClasses";function H(e){let{value:t,para:s}=e,{required:n,options:a}=s,o=[];return n&&(!a.length||a.length&&S.is.nullish(JSON.parse(t)))&&o.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!o.filter(({type:r})=>r=="invalid").length,notice:o}}const _={Core:e=>{var O;let x=e,{tone:t,required:s,form:n,className:a,enableFormSubmit:o,enableUnSelected:r,checkValidationAtFirst:f,onChange:u,onKeyDown:m,onValidate:b,onUpdateValue:I,onUpdateValidValue:y,value:h="",options:B,placeholder:F,leftIndicator:X,rightIndicator:Y,leftIcon:Z,rightIcon:P,componentID:w,status_id:ee}=x,L=T(x,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id"]),A={componentID:e.componentID||"",dataValue:h,eventType:"init",eventID:S.uuid.gen()},[p,v]=C(A),[g,D]=C({ok:!1,notice:[]});K({type:"select",para:e,val_status:p,set_status:v,ExtraOverrideParams:{dataValue:h,formatValue:h},val_validate:g,set_validate:D,DefaultValidation:H,onUpdateValue:I,onUpdateValidValue:y});let R=l(E,{fontColor:"4.thin",textAlign:"left",children:F||"\u9078\u629E"});if(p.dataValue){let i=B.find(V=>V.value==p.dataValue);i&&(R=(O=i.displayLabel)!=null?O:i.label)}return l(W,{val_status:p,set_status:v,val_validate:g,para:e,children:G(E,{className:[a,N("SelectLegend"),j("InputCover")].join(" "),children:[R,l("select",d(c({"data-form":n,"data-input-type":"select","data-validation":g.ok,"data-component-id":p.componentID,"data-value":p.dataValue,value:p.dataValue,onKeyDown:i=>{m&&m(i),o&&q(i)},onChange:i=>{let{value:V}=i.target;g.ok&&D({ok:!1,notice:[]}),v(d(c({},p),{dataValue:V,eventType:"update",eventID:S.uuid.gen()})),u&&u(i)}},L),{className:N("Select"),children:l(_.Options,c({},e))}))]})})},Options:e=>{let{options:t=[],placeholder:s="\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",enableUnSelected:n=!0}=e,a=t.map(o=>{let{value:r,label:f}=o,u=String(r);return l("option",{value:u,children:f},u)});return n&&a.unshift(l("option",{value:JSON.stringify(null),children:s},0)),l(Q,{children:a})}},z=e=>{let{value:t=null,placeholder:s,options:n=[]}=e,a=0,o=JSON.stringify(t),r=n.map(u=>{let{value:m,label:b}=u,I=JSON.stringify(m),y=I==o;return a|=Number(y),d(c({},u),{value:I,label:b})});a||(t=null);let f=JSON.stringify(t);return l(_.Core,d(c({},e),{value:f,options:r}))},k=e=>{var s,n;e=c({},e),S.is.nullish(e.rightIcon)&&(e.rightIcon=l($.RightIcon,d(c({flexType:"col"},e.rightIconStyles),{children:l(J.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(s=e.paddingRight)!=null?s:3),e.leftIcon&&(e.paddingLeft=(n=e.paddingLeft)!=null?n:3);let t=M.Boxish(e);return delete t.rightIconStyles,l(U,{componentID:e.componentID,children:z,para:t})};export{k as Select,k as default};
@@ -0,0 +1,31 @@
1
+ /// <reference types="react" />
2
+ import { ReactElement, ThemeColor } from '../../@declaration';
3
+ import { InputTypes } from '.';
4
+ declare namespace Slider {
5
+ type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
6
+ tabIndex?: number;
7
+ id?: string;
8
+ disabled?: boolean;
9
+ value?: number;
10
+ color?: Color;
11
+ min: number;
12
+ max: number;
13
+ step: number;
14
+ legends?: {
15
+ enable?: boolean;
16
+ custom?: LegendsCallback;
17
+ showAlways?: boolean;
18
+ };
19
+ };
20
+ type Color = ThemeColor | 'theme' | 'posi' | 'nega' | 'warn';
21
+ type LegendsCallback = {
22
+ (value: number): ReactElement;
23
+ };
24
+ type DataLevelingResult = {
25
+ stepValue: number;
26
+ stepIndex: number;
27
+ positionLeft: string;
28
+ };
29
+ }
30
+ declare const Slider: React.FC<Slider.Input>;
31
+ export { Slider, Slider as default };
@@ -0,0 +1 @@
1
+ import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import c from"@mingoo/jsmin";import{$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses";function Z(a){let{value:e,para:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"layer.4",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:_}=E.get(i);return D!=_&&(E.update({key:i,value:{prevValue:D}}),s(T(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({key:o.componentID,value:{prevValue:l}}),n(T(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let k=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:_}=k,K=B(k,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,V]=A(W),[w,U]=A({ok:!1,notice:[]});Q({para:a,val_status:h,set_status:V,val_validate:w,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideParams:{dataValue:D},ExtraStoreParams:{prevValue:h.dataValue,setValueByForeign:$=>{V(T(I({},h),{dataValue:$,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:V,val_validate:w,para:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":w.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),_,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:V,DotData:R,form:n,enableFormSubmit:u}),!!s&&d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i})]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,para:q(a)}));export{H as Slider,H as default};
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import { ThemeColor, ReactElement } from '../../@declaration';
3
+ import { InputTypes } from '.';
4
+ declare namespace Switch {
5
+ type Input = InputTypes.UniInput & React.DOMAttributes<HTMLInputElement> & {
6
+ color?: Color;
7
+ id?: string;
8
+ tabIndex?: number;
9
+ appearance?: 'material' | 'applely';
10
+ disabled?: boolean;
11
+ value?: boolean;
12
+ icon?: ReactElement;
13
+ };
14
+ type Color = ThemeColor | 'theme' | 'posi' | 'nega' | 'warn';
15
+ }
16
+ declare const Switch: React.FC<Switch.Input>;
17
+ export { Switch, Switch as default };
@@ -0,0 +1 @@
1
+ import{b as l,c as f,d as g}from"../../chunk-VY3566IV.js";import{jsx as a,jsxs as w}from"react/jsx-runtime";import{useState as k}from"react";import x from"@mingoo/jsmin";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,para: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 V=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"}=V,_=g(V,["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]=k(E),[u,S]=k({ok:!1,notice:[]}),d=!!t.dataValue;return O({para:e,val_status:t,set_status:h,val_validate:u,set_validate:S,DefaultValidation:U,onUpdateValue:T,onUpdateValidValue:B,ExtraOverrideParams:{dataValue:m,formatValue:m}}),w(q,{val_status:t,set_status:h,val_validate:u,para:e,children:[a("input",l({type:"checkbox","data-form":i,"data-input-type":"switch","data-validation":u.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=>{u.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:d?o:"layer.5"}:{}),{children:w(F.Center,{unitHeight:2.5,position:"relative",freeCSS:{width:12*4.5},children:[p=="material"&&a(s,{position:"absolute",backgroundColor:d?o:"layer.5",borderRadius:"sphere",unitHeight:1,transition:"middle",width:1,className:c("Bar"),opacity:"middle"}),a(s,{position:"absolute",top:0,left:0,backgroundColor:p=="material"&&d?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"&&d?o:"white",children:C})})]})}))})]})},D=e=>(e=l({},e),e.color=e.color||"theme",a(L,{componentID:e.componentID,children:W,para:e}));export{D as Switch,D as default};
@@ -0,0 +1,51 @@
1
+ /// <reference types="react" />
2
+ import { ReactElement } from '../../@declaration';
3
+ import { InputTypes } from '.';
4
+ declare namespace Text {
5
+ type Restrict = 'text' | 'katakana' | 'hankaku.katakana' | 'number' | '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 };
@@ -0,0 +1 @@
1
+ import{b as o,c as I,d as F}from"../../chunk-VY3566IV.js";import{Fragment as P,jsx as n,jsxs as W}from"react/jsx-runtime";import{useState as E,useEffect as w}from"react";import x from"@mingoo/jsmin";import{$$fromRoot as ae,useStore as re}from"../../@utils";import C from"../../atoms/Box";import U from"../../atoms/FAI";import K from"../Button";import R from"../Tooltips";import{faEye as Z}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 S 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:W(P,{children:[n(C,{children:"\u25CB\u25CB\u25CB\u25CB@\u25CB\u25CB\u25CB\u25CB.\u25CB\u25CB\u25CB\u306E\u5F62\u5F0F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{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:W(P,{children:[n(C,{children:"0\u304B\u3089\u59CB\u307E\u308B\u756A\u53F7\u306E\u307F\u5165\u529B\u53EF\u80FD\u3067\u3059"}),n(C,{children:"9~12\u6841\u306E\u6570\u5B57\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n(C,{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"}},T=e=>{let{restrict:r,value:s=""}=e,t=String(s),a=!1;if(["tel","number","digitNumber","test","postal","creditCard"].includes(r)&&(t=t.zen2hanNumber()),r=="katakana"&&(t=t.replace(/[^ァ-ヶー  ヲ-゚  ]/ig,"")),r=="hankaku.katakana"&&(t=t.replace(/[^ヲ-゚  ]/ig,"")),["postal","creditCard"].includes(r)&&(t=t.removeLetters()),["number","digitNumber"].includes(r)&&t&&t!="-")if(t=="0-")t="-";else{t[0]=="-"&&(a=!0),t=t.replace(/[^0-9\.]/ig,"");let i=Number(t);i===0&&(a=!1),a&&(i=-1*i),x.is.exist(e.min)&&(i=Math.max(i,Number(e.min))),x.is.exist(e.max)&&(i=Math.min(i,Number(e.max))),t=String(Math.abs(i))}let p=t;if(r=="digitNumber"){if(t&&t!="-"){let i=[];for(let l=t.length-1;l>=0;l--){i.unshift(t[l]);let g=t.length-1-l+1;l!=0&&g%3==0&&i.unshift(",")}p=i.join("")}}else r=="postal"?t.length>=4&&(p=t.clip(0,3)+"-"+t.clip(3)):r=="creditCard"&&(p=t.replace(/.{4}(?=.)/g,"$& "));return["number","digitNumber"].includes(r)&&a&&(t="-"+t,p="-"+p),{formatValue:p,dataValue:t}},pe=e=>{let{id:r,restrict:s,val_status:t}=e,a=ae("#"+r)[0];if(a&&t.prevValue&&t.formatValue){let{formatValue:p,prevValue:i,caretFrom:l,caretTo:g}=t;if(s=="creditCard")p.length>=i.length&&l%5==0&&(l++,g++),a.setSelectionRange(l,g);else if(s=="postal")p.length==5&&i.length==3&&(l++,g++),a.setSelectionRange(l,g);else if(s=="digitNumber"){let D=p.length-i.length;D==2&&(l++,g++),D==-2&&(l--,g--),a.setSelectionRange(l,g)}}},H=(e,r)=>{let s={ok:!0,body:""};return(()=>{let t=se[r];if(!t)return;let a=t.reason;if(t){let p=!!(+!!e.match(t.reg)^+!t.exist);s={ok:p,body:p?"":a}}})(),s};function de(e){let{value:r,para:s}=e,{restrict:t="text",maxLength:a=255,required:p}=s,i=[];if(x.is.exist(a)&&r.length>=Number(a)&&i.push({type:"invalid",label:a+"\u5B57\u4EE5\u5185\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),r){let l=H(r,t);l.ok||i.push({type:"invalid",label:l.body})}else p&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"});return{ok:!i.filter(({type:l})=>l=="invalid").length,notice:i}}const me=e=>{let O=e,{componentID:r,tone:s,required:t,restrict:a="text",form:p,autoComplete:i="off",autoCapitalize:l="off",enableFormSubmit:g,clearButton:D=!1,checkValidationAtFirst:ce,onChange:M,onKeyDown:$,onValidate:fe,onUpdateValue:q,onUpdateValidValue:Y,value:X="",leftIndicator:ge,rightIndicator:xe,leftIcon:be,rightIcon:he,maxLength:Ie,min:y,max:N}=O,m=F(O,["componentID","tone","required","restrict","form","autoComplete","autoCapitalize","enableFormSubmit","clearButton","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon","maxLength","min","max"]),j=a=="password"||a=="concealed"?"password":"text",G=["number","digitNumber","creditCard"].includes(a)?"numeric":a=="email"?"email":"text",Q=I(o({componentID:r},T({min:y,max:N,restrict:a,value:X})),{prevValue:"",eventType:"init",eventID:x.uuid.gen(),caretFrom:null,caretTo:null}),[ee,L]=E(!1),[u,v]=E(Q),[k,B]=E({ok:!1,notice:[]});return le({para:e,val_status:u,set_status:v,val_validate:k,set_validate:B,DefaultValidation:de,onUpdateValue:q,onUpdateValidValue:Y,ExtraOverrideParams:o({},T({min:y,max:N,restrict:a,value:X}))}),w(()=>{pe({id:e.id,restrict:a,val_status:u})},[u]),n(ie,{val_status:u,set_status:v,val_validate:k,para:e,children:n("input",I(o({type:j,inputMode:G,"data-form":p,"data-input-type":"text","data-validation":k.ok,"data-value":u.dataValue,"data-component-id":u.componentID,value:u.formatValue,autoComplete:i,autoCapitalize:l,onKeyDown:c=>{let{key:f,target:_}=c;{let b=_,{selectionStart:h,selectionEnd:te}=b,V=Number(h),z=Number(te),A=u.formatValue[Number(V)],J=u.formatValue[Number(V)-1];f=="Delete"&&(a=="creditCard"&&A==" "||a=="postal"&&A=="-"||a=="digitNumber"&&A==",")&&(b.setSelectionRange(V+1,z+1),c.preventDefault()),f=="Backspace"&&(a=="creditCard"&&J==" "||a=="postal"&&J=="-"||a=="digitNumber"&&J==",")&&(b.setSelectionRange(V-1,z-1),c.preventDefault()),f=="Enter"||f=="Tab"}if(["number","digitNumber","creditCard"].includes(a)&&f=="Clear"&&v(I(o({},u),{dataValue:"",formatValue:"",eventType:"update",eventID:x.uuid.gen()})),["number","digitNumber"].includes(a)&&["ArrowUp","ArrowDown"].includes(f)){let b=+(f=="ArrowUp")*2-1,h=String(Number(u.dataValue)+b);k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},u),T({min:y,max:N,restrict:a,value:h})),{eventType:"update",eventID:x.uuid.gen()})),c.preventDefault()}$&&$(c),g&&oe(c)},onChange:c=>{let{value:f,selectionStart:_,selectionEnd:b}=c.target,h=T({min:y,max:N,restrict:a,value:f});ee&&(h.formatValue=f),h.formatValue!=u.formatValue&&(k.ok&&B({ok:!1,notice:[]}),v(I(o(o({},u),h),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(_),caretTo:Number(b)})),M&&M(c))}},m),{onCompositionStart:c=>{m!=null&&m.onCompositionStart&&(m==null||m.onCompositionStart(c)),L(!0)},onCompositionEnd:c=>{if(m!=null&&m.onCompositionEnd&&(m==null||m.onCompositionEnd(c)),a=="text")return;let f=T({min:y,max:N,restrict:a,value:u.formatValue});v(I(o(o({},u),f),{prevValue:u.formatValue,eventType:"update",eventID:x.uuid.gen(),caretFrom:Number(u.formatValue.length+1),caretTo:Number(u.formatValue.length+1)})),L(!1)}}))})},d={Validate:H,Normal:e=>{var r,s;return e=o({},e),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(s=e.paddingLeft)!=null?s:3),n(ne,{componentID:e.componentID,children:me,para:ue.Boxish(e)})},Katakana:e=>n(d.Normal,o({restrict:"katakana"},e)),HankakuKatakana:e=>n(d.Normal,o({restrict:"hankaku.katakana"},e)),CreditCard:e=>n(d.Normal,o({restrict:"creditCard"},e)),Tel:e=>n(d.Normal,o({restrict:"tel",placeholder:"xxx-xxxx-xxxx"},e)),Number:e=>n(d.Normal,o({restrict:"number"},e)),DigitNumber:e=>n(d.Normal,o({restrict:"digitNumber"},e)),Email:e=>n(d.Normal,o({restrict:"email"},e)),Url:e=>n(d.Normal,o({restrict:"url"},e)),Postal:e=>{let[r]=E(x.uuid.gen());return w(()=>()=>{re.delete(r)},[]),n(d.Normal,o({restrict:"postal",placeholder:"\u90F5\u4FBF\u756A\u53F7",leftIndicator:n(S.LeftIndicator,{children:"\u3012"})},e))},Password:e=>n(d.Normal,o({restrict:"password",placeholder:"\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(K.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.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 t=s[0];t.type=t.type==="password"?"text":"password"})},children:n(U,{icon:Z})})})},e)),Concealed:e=>n(d.Normal,o({restrict:"concealed",placeholder:"\u79D8\u5BC6\u9375\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{padding:0,children:n(K.Button.Normal.R,{padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["expand"],onMouseOver:r=>{R.open({parent:r.currentTarget,gravityPoint:24,padding:[1,0],content:n(R.Comps.Body,{children:"\u5024\u3092\u8868\u793A"})})},tabIndex:-1,onClick:r=>{x(r.target).parent().parent().parent().find("input").callback(s=>{let t=s[0];t.type=t.type==="password"?"text":"password"})},children:n(U,{icon:Z})})})},e)),Money:{JPY:e=>n(d.DigitNumber,o({placeholder:"\u91D1\u984D\u3092\u5165\u529B",rightIndicator:n(S.RightIndicator,{children:"\u5186"})},e))}};export{d as Text,me as TextInput,d as default};
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { ReactElement } from '../../@declaration';
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 };
@@ -0,0 +1 @@
1
+ import{b as u,c as g,d as T}from"../../chunk-VY3566IV.js";import{jsx as s}from"react/jsx-runtime";import{useState as v}from"react";import y from"@mingoo/jsmin";import{Wrapper as E,BoxWrapper as _,SubmitForm as k,CommonEffects as C,DefaultStyles as S}from"./core";function F(e){let{value:t,para:n}=e,{required:o}=n,i=[];return o&&!t&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:d})=>d=="invalid").length,notice:i}}const B=e=>{let m=e,{componentID:t,tone:n,required:o,form:i,enableFormSubmit:d,checkValidationAtFirst:L,onChange:c,onKeyDown:f,onValidate:W,onUpdateValue:x,onUpdateValidValue:V,value:D="",leftIndicator:q,rightIndicator:H,leftIcon:K,rightIcon:M}=m,R=T(m,["componentID","tone","required","form","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator","leftIcon","rightIcon"]),b={componentID:t,dataValue:D,eventType:"init",eventID:y.uuid.gen()},[a,r]=v(b),[p,I]=v({ok:!1,notice:[]});return C({para:e,val_status:a,set_status:r,val_validate:p,set_validate:I,onUpdateValue:x,onUpdateValidValue:V,DefaultValidation:F}),s(_,{val_status:a,set_status:r,val_validate:p,para:e,children:s("textarea",u({"data-form":i,"data-input-type":"textarea","data-validation":p.ok,"data-value":a.dataValue,"data-component-id":a.componentID,value:a.dataValue,onKeyDown:l=>{f&&f(l),d&&k(l)},onChange:l=>{let{value:A}=l.target;p.ok&&I({ok:!1,notice:[]}),r(g(u({},a),{dataValue:A,eventType:"update",eventID:y.uuid.gen()})),c&&c(l)}},R))})},h=e=>{var n,o;e=u({},e),e.rightIcon&&(e.paddingRight=(n=e.paddingRight)!=null?n:3),e.leftIcon&&(e.paddingLeft=(o=e.paddingLeft)!=null?o:3);let t=S.Boxish(e);return t.rows=t.rows||5,s(E,{componentID:e.componentID,children:B,para:t})};export{h as TextArea,h as default};
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ import { TimeTypes } from '.';
3
+ declare namespace Picker {
4
+ type ClockValue = {
5
+ modifiedType: 'init' | 'override' | 'update';
6
+ hour: number;
7
+ minutes: number;
8
+ };
9
+ type DateValue = {
10
+ modifiedType: 'init' | 'override' | 'update';
11
+ year: number;
12
+ month: number;
13
+ date: number;
14
+ };
15
+ type MonthValue = {
16
+ modifiedType: 'init' | 'override' | 'update';
17
+ year: number;
18
+ month: number;
19
+ };
20
+ type YearValue = {
21
+ modifiedType: 'init' | 'override' | 'update';
22
+ year: number;
23
+ };
24
+ type DateWarekiValue = {
25
+ modifiedType: 'init' | 'override' | 'update';
26
+ era: TimeTypes.Era;
27
+ year: number;
28
+ month: number;
29
+ date: number;
30
+ };
31
+ type Input<T> = TimeTypes.Picker & {
32
+ val_value: T;
33
+ set_value: React.Dispatch<React.SetStateAction<T>>;
34
+ };
35
+ }
36
+ declare const Picker: React.FC<TimeTypes.Picker>;
37
+ export { Picker, Picker as default };
@@ -0,0 +1 @@
1
+ import{b as f,c as T}from"../../../chunk-VY3566IV.js";import{Fragment as $,jsx as i,jsxs as y}from"react/jsx-runtime";import{createElement as P}from"react";import{useState as w,useEffect as z,useRef as Y}from"react";import c from"@mingoo/jsmin";import C from"../../../atoms/Box";import N from"../../../atoms/FAI";import B from"../../../atoms/Flex";import _ from"../../../atoms/Grid";import M from"../../../mols/Row";import x from"../../../mols/Column";import O from"../../../mols/Text";import v from"../../Button";import H from"../../Tooltips";import R from"../Select";import{List as F}from"../List";import{InputTimeClasses as g}from"../../../@styles/componentClasses";let A=r=>{var t,a;let e=[],d=Number((t=r==null?void 0:r.min)!=null?t:1900),o=Number((a=r==null?void 0:r.max)!=null?a:c.Time().addYear(10).year);for(let m=d;m<=o;m++)e.unshift({value:m,label:[m,...c.transformer.wareki(m).value].join(" - ")});return e};const L=r=>{let{restrict:e,era:d="year",defaultValue:o=""}=r;r=f({},r),r.tipsID=r.tipsID||c.uuid.gen();const t=Y(!1);let[a,m]=w((()=>{var s,p;if(e=="clock"){let l=String(o).split(/[^\d]/);l[0]||(l=[0,0]);let u=Number(l[0]),h=Number(l[1]);return{modifiedType:"init",hour:u,minutes:h}}else if(e=="date"){let[l,u,h]=(s=String(o))==null?void 0:s.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",year:Number(l),month:Number(u),date:Number(h)}}else if(e!="week"){if(e=="month"){let[l,u]=String(o).split(/\D/);return(c.is.nullish(l)||c.is.nullish(u))&&([l,u]=c.Time().toFormat("%Y-%M").split("-")),{modifiedType:"init",year:Number(l),month:Number(u)}}else if(e=="year"){let[l]=String(o).split(/\D/);return c.is.nullish(l)&&([l]=c.Time().toFormat("%Y").split("-")),{modifiedType:"init",year:Number(l)}}else if(e=="dateWareki"){let[l,u,h]=(p=String(o))==null?void 0:p.split(/\D/);return(c.is.nullish(l)||c.is.nullish(u)||c.is.nullish(h))&&([l,u,h]=c.Time().toFormat("%Y-%M-%D").split("-")),{modifiedType:"init",era:d||"year",year:Number(l),month:Number(u),date:Number(h)}}}return{}})());z(()=>{if(t.current){if(a.modifiedType=="update"){let s="",p=d||"year";if(e=="clock"){let{hour:l,minutes:u}=a;s=[l.zeroEmbed(2),u.zeroEmbed(2)].join("/")}else if(e=="date"){let{year:l,month:u,date:h}=a;s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}else if(e!="week"){if(e=="month"){let{year:l,month:u}=a;s=[l,u.zeroEmbed(2)].join("/")}else if(e=="year"){let{year:l}=a;s=String(l)}else if(e=="dateWareki"){let{year:l,month:u,date:h,era:S}=a;p=S,s=[l,u.zeroEmbed(2),h.zeroEmbed(2)].join("/")}}r.onValueUpdate(s,p)}}else t.current=!0},[a]);let n=T(f({},r),{val_value:a,set_value:m});return i(C,{backgroundColor:"layer.1",borderRadius:"2.tone.secondary",boxShadow:"1.remark",border:!0,overflow:"hidden",children:i(C,{overflow:"auto",className:g(e.toCapital()+"Base"),children:e=="clock"?i(k.Clock._,f({},n)):e=="date"?i(k.Date._,f({},n)):e=="week"?"":e=="month"?i(k.Month._,f({},n)):e=="year"?i(k.Year._,f({},n)):e=="dates"||e=="months"?"":e=="dateWareki"?i(k.DateWareki._,f({},n)):i($,{})})})},k={Clock:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,[n,s]=w(a.hour>12?2:1),[p,l]=w(Number(localStorage.getItem("timePickerUnit")||5));z(()=>{localStorage.setItem("timePickerUnit",String(p))},[p]);let{hour:u,minutes:h}=a;return y(x,{padding:1,children:[y(B,{flexType:"row",flexWrap:!1,gap:1,className:g("Body"),children:[y(x,{className:g("DesignSide"),flexSizing:0,children:[i(C,{className:g("ClockUiBase"),padding:[1,"2/3"],flexCenter:!0,children:y(C,{className:g("ClockUi"),backgroundColor:"theme.opa.low",isRounded:!0,position:"relative",children:[i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("hour")].join(" "),freeCSS:{transform:`rotate(${u*30+h/2}deg)`}}),i(C,{position:"absolute",backgroundColor:"theme",unitWidth:"1/12",className:[g("Needle"),g("minute")].join(" "),freeCSS:{transform:`rotate(${h*6}deg)`}})]})}),i(F.Radio,{tone:"plain",icon:!0,value:[n],options:[{value:1,label:"AM"},{value:2,label:"PM"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{let D=a.hour%12+(S==2?12:0);s(S),m({modifiedType:"update",hour:D,minutes:a.minutes})}}),i(C,{borderTop:!0,margin:[0,1]}),i(F.Radio,{tone:"plain",icon:!0,value:[p],options:[{value:1,label:"/ 1\u5206"},{value:2,label:"/ 2\u5206"},{value:5,label:"/ 5\u5206"}],flexType:"col",gap:0,cellStyles:{padding:"1/2",horizontalAlign:"between",gap:"1/3"},tabIndex:-1,onUpdateValidValue:({value:S})=>{l(S)}})]}),y(x,{children:[y(C,{flexCenter:!0,fontSize:"3.paragraph",isSemiBoldFont:!0,children:[a.hour.zeroEmbed(2)," : ",a.minutes.zeroEmbed(2)]}),y(B,{flexWrap:!1,borderRadius:"1.tone.primary",boxShadow:"0.remark.inset",flexChilds:"even",freeCSS:{minWidth:12*12},padding:["1/3",0],children:[i(x,{gap:0,overflow:"auto",padding:"2/3",borderRight:!0,freeCSS:{maxHeight:12*22},children:k.Clock.Hours({onClick:S=>{let V=S+(n==2?12:0);m({modifiedType:"update",hour:V,minutes:a.minutes})},min:e,max:d,ampm:n})}),i(x,{gap:0,overflow:"auto",padding:"2/3",freeCSS:{maxHeight:12*22},children:k.Clock.Minutes({onClick:S=>{m({modifiedType:"update",hour:a.hour,minutes:S})},min:e,max:d,unit:p})})]})]})]}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Hours:r=>{let e=[];for(let d=0;d<12;d++){let o=r.ampm==2?d+12:d,t=!1;{let a=Number(String(o*100).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>a&&(t=!0),r.max){let m=Number(String(r.max).replace(/\D/ig,""));a>m&&(t=!0)}}e.push(i(v.Button.Normal.R,{isLocked:t,borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(d)},children:o.zeroEmbed(2)},d))}return e},Minutes:r=>{let e=[];for(let d=0;d<60/r.unit;d++){let o=d*r.unit;e.push(i(v.Button.Normal.R,{borderBottom:!0,borderRadius:0,padding:["1/2",1],freeCSS:{whiteSpace:"nowrap"},tabIndex:-1,onClick:()=>{r.onClick(o)},children:o.zeroEmbed(2)},o))}return e}},Date:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s,date:p}=a;return y(x,{padding:1,children:[y(B,{horizontalAlign:"between",verticalAlign:"center",flexWrap:!1,children:[y(B,{verticalAlign:"bottom",horizontalAlign:"left",gap:"2/3",flexWrap:!1,children:[i(R,{override:"force",enableUnSelected:!1,value:n,options:A(),border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:Number(l),month:s,date:p})}}),i(R,{override:"force",enableUnSelected:!1,value:s,options:(()=>{let l=[];for(let u=1;u<=12;u++)l.push({value:u,label:String(u),displayLabel:String(u)+"\u6708"});return l})(),placeholder:"",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:l})=>{m({modifiedType:"update",year:n,month:Number(l),date:p})}})]}),i(k.Variables.ShiftButtons,{callback:l=>{let u=s+l,h=n;l==-1?(u<=0&&h--,u=u||12):s==12&&h++,m({modifiedType:"update",year:h,month:u,date:a.date})}})]}),i(C,{borderTop:!0}),i(C,{children:k.Date.MonthCalendar({min:e,max:d,year:a.year,month:a.month,current:[a.year,a.month,a.date],callback:l=>{let[u,h,S]=l;m({modifiedType:"update",year:u,month:h,date:S})}})}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},MonthCalendar:r=>{let{min:e,max:d,year:o,month:t,current:a,callback:m}=r,n=c.Time(),s=c.Time([o,t.zeroEmbed(2),"01"].join("/")),p=s.getLastDayOfTheMonth(),l=c.Time(s).addMonth(-1).getLastDayOfTheMonth().date,u=[],h=[],S=[],V=[],D={padding:0,unitWidth:3,unitHeight:3,flexCenter:!0,borderRadius:"3.tone.tertiary"};for(var b=0;b<7;b++)u.push(P(C,T(f({className:[g("CalendarDay"),g("Legend")].join(" ")},D),{key:b}),["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][b]));for(var b=0;b<s.weekday;b++)h.unshift(P(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),l-b));for(var b=1;b<=p.date;b++){let U=b,j=o==n.year&&t==n.month&&b==n.date,I=!1;{let E=Number(String([o,t.zeroEmbed(2),b.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>E&&(I=!0),r.max){let W=Number(String(r.max).replace(/\D/ig,""));E>W&&(I=!0)}}S.push(P(v.Button.Clear.R,T(f({className:[g("CalendarDay"),g("isToday_"+j)].join(" ")},D),{onClick:()=>{m([o,t,U])},tabIndex:-1,key:U,isLocked:I,fontColor:"1.clear",ssEffectsOnActive:"shrink",padding:0,flexCenter:!0,borderRadius:"sphere",children:b})))}for(var b=1;b<7-p.weekday;b++)V.push(P(C,T(f({className:[g("CalendarDay"),g("Dummy")].join(" "),fontColor:"4.thin"},D),{key:b}),b));return y(_,{gridCols:7,gap:"1/3",children:[u,h,S,V]})}},Month:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n,month:s}=a;return y(x,{padding:1,children:[y(M.Separate,{gap:0,children:[i(M.Center,{verticalAlign:"bottom",gap:"2/3",children:i(R,{enableUnSelected:!1,value:n,options:A(),override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},onUpdateValidValue:({value:p})=>{m({modifiedType:"update",year:Number(p),month:s})}})}),i(k.Variables.ShiftButtons,{callback:p=>{let l=Math.min(Math.max(n+p,1900),2100);m({modifiedType:"update",year:l,month:s})}})]}),i(C,{borderTop:!0}),k.Month.Months({min:e,max:d,year:a.year,callback:p=>{let[l,u]=p;m({modifiedType:"update",year:l,month:u})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})]})},Months:r=>{let{year:e,callback:d}=r,o=c.Time(),t=[];for(let a=1;a<=12;a++){let m=e==o.year&&a==o.month,n=!1;{let p=Number(String([e,a.zeroEmbed(2)].join("/")).replace(/\D/ig,""));if(r.min&&Number(String(r.min).replace(/\D/ig,""))>p&&(n=!0),r.max){let l=Number(String(r.max).replace(/\D/ig,""));p>l&&(n=!0)}}let s=[g("Cell"),m?g("isThisMonth"):""].join(" ");t.push(y(v.Button.Clear.R,{className:s,isLocked:n,fontColor:"2.normal",padding:["2/3",1],ssEffectsOnActive:"shrink",onClick:()=>{d([e,a])},children:[a," \u6708"]},e+"-"+a))}return i(_,{gridCols:4,gap:"2/3",children:t})}},Year:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{year:n}=a;return y(x,{padding:1,children:[i(R,{enableUnSelected:!1,value:n||c.Time().year,override:"force",options:A({min:e,max:d}),onUpdateValidValue:({value:s})=>{m({modifiedType:"update",year:Number(s)})}}),i(k.Variables.Footer,{tipsID:t,onValueUpdate:o,onSubmit:()=>{m({modifiedType:"update",year:Number(n||c.Time().year)})}})]})}},DateWareki:{_:r=>{let{min:e,max:d,onValueUpdate:o,tipsID:t,val_value:a,set_value:m}=r,{era:n,year:s,month:p,date:l}=a,u={val_value:a,set_value:m};return y(C,{children:[y(M.Left,{verticalAlign:"unset",borderBottom:!0,gap:0,children:[i(k.DateWareki.EraSelect,f({},u)),i(C,{borderRight:!0}),i(k.DateWareki.Calendar,f({},u))]}),i(C,{padding:1,children:i(k.Variables.Footer,{tipsID:t,onValueUpdate:o})})]})},EraSelect:r=>{let{val_value:e,set_value:d}=r,o={padding:["1/2",1.5],fontColor:"3.blur"},t={backgroundColor:"cloud",fontColor:"2.normal",isSemiBoldFont:!0};return y(x,{gap:0,padding:1,children:[i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="year",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"year",year:a.year,month:a.month,date:a.date})},children:"\u897F\u66A6"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="reiwa",onClick:()=>{let a=c.Time();d({modifiedType:"update",era:"reiwa",year:a.year,month:a.month,date:a.date})},children:"\u4EE4\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="heisei",onClick:()=>{d({modifiedType:"update",era:"heisei",year:2019,month:1,date:1})},children:"\u5E73\u6210"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="shouwa",onClick:()=>{d({modifiedType:"update",era:"shouwa",year:1989,month:1,date:1})},children:"\u662D\u548C"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="taisho",onClick:()=>{d({modifiedType:"update",era:"taisho",year:1926,month:1,date:1})},children:"\u5927\u6B63"})),i(v.Button.Clear.R,T(f({color:"cloud"},o),{isActiveStyles:t,isActive:e.era=="meiji",onClick:()=>{d({modifiedType:"update",era:"meiji",year:1912,month:1,date:1})},children:"\u660E\u6CBB"}))]})},Calendar:r=>{let{val_value:e,set_value:d}=r,o=[];if(e.era=="year")for(let t=1900;t<2100;t++)o.unshift({value:t,label:t+"\u5E74"});else if(e.era=="reiwa"){let t=c.Time().year-2018;for(let a=1;a<=t+10;a++)o.unshift({value:2019+a-1,label:"\u4EE4\u548C"+(a==1?"\u5143":a)+"\u5E74"})}else if(e.era=="heisei")for(let t=1;t<=31;t++)o.unshift({value:1989+t-1,label:"\u5E73\u6210"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="shouwa")for(let t=1;t<=64;t++)o.unshift({value:1926+t-1,label:"\u662D\u548C"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="taisho")for(let t=1;t<=15;t++)o.unshift({value:1912+t-1,label:"\u5927\u6B63"+(t==1?"\u5143":t)+"\u5E74"});else if(e.era=="meiji")for(let t=1;t<=45;t++)o.unshift({value:1868+t-1,label:"\u660E\u6CBB"+(t==1?"\u5143":t)+"\u5E74"});return y(x,{padding:1,children:[y(M.Separate,{children:[i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:o,value:e.year,onUpdateValidValue:({value:t})=>{d(T(f({},e),{modifiedType:"update",year:Number(t)}))}}),y(M.Center,{gap:"1/3",children:[i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month-1;d({modifiedType:"update",era:e.era,year:t==0?e.year-1:e.year,month:t==0?12:t,date:1})},children:i(N.ChevronLeft,{})}),i(R,{tone:"cloud",enableUnSelected:!1,override:"force",border:"1.thin",padding:["1/3","2/3"],paddingRight:2,rightIconStyles:{right:"1/3"},options:[{value:1,label:"1\u6708"},{value:2,label:"2\u6708"},{value:3,label:"3\u6708"},{value:4,label:"4\u6708"},{value:5,label:"5\u6708"},{value:6,label:"6\u6708"},{value:7,label:"7\u6708"},{value:8,label:"8\u6708"},{value:9,label:"9\u6708"},{value:10,label:"10\u6708"},{value:11,label:"11\u6708"},{value:12,label:"12\u6708"}],value:e.month,onUpdateValidValue:({value:t})=>{d({modifiedType:"update",era:e.era,year:e.year,month:Number(t),date:1})}}),i(v.Button.Clear.S,{ssSphere:2,onClick:()=>{let t=e.month+1;d({modifiedType:"update",era:e.era,year:t==13?e.year+1:e.year,month:t==13?1:t,date:1})},children:i(N.ChevronRight,{})})]})]}),i(k.DateWareki.MonthCell,f({},r))]},e.era)},MonthCell:r=>{let{val_value:e,set_value:d}=r,o=c.Time([e.year.zeroEmbed(4),e.month.zeroEmbed(2),e.date.zeroEmbed(2)].join("/"));if(!o.validate)return;let t=o.getFirstDayOfTheMonth().weekday,a=o.getLastDayOfTheMonth(),m=[];for(let n=0;n<7;n++)m.push(i(O.Supplement,{flexCenter:!0,fontColor:n==0?"googleRed":n==6?"googleBlue":"3.blur",children:c.transformer.weekday.shortJP(n)}));for(let n=0;n<t;n++){let s=c.Time(o).getFirstDayOfTheMonth().addDate(n-t);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=1;n<=a.date;n++){let s=c.Time(o).setDate(n);m.push(i(v.Button.Border.R,{ssSquare:3,onClick:()=>{d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}for(let n=0;n<7-a.weekday-1;n++){let s=c.Time(o).addMonth(1).setDate(1).addDate(n);m.push(i(v.Button.Sub.R,{color:"cloud",border:"1.thin",ssSquare:3,opacity:"middle",onClick:p=>{p.preventDefault(),p.stopPropagation(),d({modifiedType:"update",era:e.era,year:s.year,month:s.month,date:s.date})},children:s.date}))}return i(_,{gridCols:7,gap:"1/4",children:m})}},Variables:{Footer:r=>y(B,{flexWrap:!1,gap:1,flexChilds:"even",freeCSS:{whiteSpace:"nowrap"},children:[y(v.Button.Border.R,{onClick:()=>{r.onValueUpdate("")},tabIndex:-1,flexSizing:"none",padding:["2/3",1],children:[i(N.Times,{})," \u524A\u9664"]}),i(v.Button.Prime.R,{flexSizing:"auto",onClick:()=>{r.onSubmit&&r.onSubmit(),H.close(r.tipsID)},tabIndex:-1,children:"\u6C7A\u5B9A",padding:["2/3",1]})]}),ShiftButtons:r=>y(B,{flexWrap:!1,gap:"1/3",children:[i(v.Button.Clear.R,T(f({className:g("LeftButton"),tabIndex:-1,right:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(-1)},children:i(N.ChevronLeft,{})})),i(v.Button.Clear.R,T(f({className:g("RightButton"),tabIndex:-1,left:0},k.Variables.ShiftButtonStyles),{onClick:()=>{r.callback(1)},children:i(N.ChevronRight,{})}))]}),ShiftButtonStyles:{flexCenter:!0,padding:0,unitWidth:3,unitHeight:3,borderRadius:"sphere",position:"relative"}}};export{L as Picker,L as default};
@@ -0,0 +1,78 @@
1
+ /// <reference types="react" />
2
+ import { ReactElement } from '../../../@declaration';
3
+ import Tooltips from '../../Tooltips';
4
+ import { InputTypes } from '..';
5
+ export declare namespace TimeTypes {
6
+ type Era = 'clock' | 'year' | 'meiji' | 'taisho' | 'shouwa' | 'heisei' | 'reiwa';
7
+ type Restrict = 'clock' | 'date' | 'week' | 'month' | 'year' | 'dates' | 'months' | 'dateWareki';
8
+ type Range = {
9
+ type: 'hour' | 'minute' | 'date' | 'month' | 'year' | 'week' | 'dateWareki';
10
+ from: number;
11
+ length: number;
12
+ region?: number;
13
+ };
14
+ type Picker = {
15
+ tipsID?: string;
16
+ restrict: Restrict;
17
+ defaultValue: string | string[];
18
+ era?: Era;
19
+ min?: string;
20
+ max?: string;
21
+ onValueUpdate(value: string | [string, string], era: Era): void;
22
+ };
23
+ type Focus = {
24
+ active: boolean;
25
+ index: number;
26
+ prevIndex: number;
27
+ };
28
+ }
29
+ declare namespace Time {
30
+ type Methods = {
31
+ Clock: (props: Input) => JSX.Element;
32
+ Date: (props: Input) => JSX.Element;
33
+ Week: (props: Input) => JSX.Element;
34
+ Month: (props: Input) => JSX.Element;
35
+ Year: (props: Input) => JSX.Element;
36
+ DateWareki: (props: DateWareki) => JSX.Element;
37
+ Periods: {
38
+ Date: (props: Period) => JSX.Element;
39
+ Month: (props: Period) => JSX.Element;
40
+ };
41
+ fn: FNs;
42
+ };
43
+ type FNs = {
44
+ picker: {
45
+ launch(para: TimeTypes.Picker & Omit<Tooltips.Input, 'content'>): void;
46
+ remove(tipsID: string): void;
47
+ };
48
+ };
49
+ type Era = TimeTypes.Era;
50
+ type Restrict = TimeTypes.Restrict;
51
+ type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
52
+ tone?: InputTypes.BoxTone;
53
+ tabIndex?: number;
54
+ id?: string;
55
+ disabled?: boolean;
56
+ value?: string | [string, string];
57
+ min?: string;
58
+ max?: string;
59
+ leftIndicator?: ReactElement | false;
60
+ rightIndicator?: ReactElement | false;
61
+ };
62
+ type Origin = Input & {
63
+ restrict: Restrict;
64
+ era?: Era;
65
+ };
66
+ type DateWareki = Input & {
67
+ value?: string;
68
+ defaultEra?: 'year' | 'wareki';
69
+ };
70
+ type Period = Omit<Input, 'value'> & {
71
+ value?: [string, string];
72
+ };
73
+ type Range = TimeTypes.Range;
74
+ }
75
+ declare const Time: Time.Methods & {
76
+ Origin: (props: Time.Origin) => JSX.Element;
77
+ };
78
+ export { Time, Time as default };
@@ -0,0 +1 @@
1
+ import{a as Y,b as o,c as _,d as H}from"../../../chunk-VY3566IV.js";import{Fragment as ke,jsx as T,jsxs as Z}from"react/jsx-runtime";import{useState as W,useEffect as X,useRef as re}from"react";import b from"@mingoo/jsmin";import{$$fromRoot as ie,Config as z,useStore as O}from"../../../@utils";import ae from"../../../atoms/Box";import ne from"../../../atoms/FAI";import q from"../../Button";import G from"../../Tooltips";import{faClock as le}from"@fortawesome/free-solid-svg-icons/faClock";import{faCalendarAlt as oe}from"@fortawesome/free-solid-svg-icons/faCalendarAlt";import{Wrapper as se,BoxWrapper as me,SubmitForm as ue,CommonEffects as pe,DefaultStyles as ce}from"../core";import de from"../Hidden";import fe from"../Select";import he from"../Parts";import ge from"./Picker";const A=" ~ ",ye={clock:{defaultValue:"--:--",format:/^\d{2}\D\d{2}$/,ranges:[{type:"hour",from:0,length:2},{type:"minute",from:3,length:2}],sets:1},date:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2}],sets:1},week:{defaultValue:"----\u5E74\u7B2C--\u9031",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4,region:6},{type:"week",from:6,length:2,region:3}],sets:1},month:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:3}],sets:1},year:{defaultValue:"----\u5E74",format:/^\d{4}$/,ranges:[{type:"year",from:0,length:4,region:5}],sets:1},dates:{defaultValue:"----/--/--",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2},{type:"date",from:8,length:2,region:5},{type:"year",from:10+A.length,length:4},{type:"month",from:15+A.length,length:2},{type:"date",from:18+A.length,length:2}],sets:2},months:{defaultValue:"----\u5E74--\u6708",format:/^\d{4}\D\d{2}$/,ranges:[{type:"year",from:0,length:4},{type:"month",from:5,length:2,region:6},{type:"year",from:8+A.length,length:4},{type:"month",from:13+A.length,length:2,region:3}],sets:2},dateWareki:{defaultValue:"----\u5E74--\u6708--\u65E5",format:/^\d{4}\D\d{2}\D\d{2}$/,ranges:[{type:"dateWareki",from:0,length:4,region:5},{type:"month",from:5,length:2,region:3},{type:"date",from:8,length:2,region:3}],sets:1}},P=e=>{let{restrict:l,value:v,era:t}=e,D=b.flatArray(v||""),{defaultValue:h,format:d,ranges:p,sets:i}=ye[l],m=[],n=l=="clock"?":":"/";for(let a=0;a<D.length;a++)D[a]=String(D[a]).replace(/\D/ig,n);for(let a=0;a<i;a++){let c=D[a]||"";if(!c.match(d))D[a]="",m.push(h);else{let x=h;c.split(/\D/).forEach((S,R)=>{if(R==0&&l=="dateWareki"){let y=Number(S);t!="year"&&(y>=2019?t=="reiwa"?y-=2018:t=="heisei"&&(y=31):y>=1989?t=="heisei"?y-=1988:t=="shouwa"&&(y=64):y>=1926?t=="shouwa"?y-=1925:t=="taisho"&&(y=15):y>=1912?t=="taisho"?y-=1911:t=="meiji"&&(y=45):y>=1868&&(y-=1867)),S=y.zeroEmbed(4)}x=x.replace(new RegExp("------------------".slice(0,S.length)),S)}),m.push(x)}}return{formatValue:m.join(A),dataValue:["dates","months"].includes(l)?D:D[0],ranges:p}};function ve(e){let{para:l}=e,{restrict:v,min:t,max:D,required:h}=l,d=[],p=b.flatArray(e.value),i={empty:!1,escalated:1,filled:!0,correct:!0,prohibited:!1};(()=>{let m=v=="clock"?":":"/";for(let n=0;n<p.length;n++)p[n]=String(p[n]).replace(/\D/ig,m);for(let n=0;n<p.length;n++){let a=p[n],c=p[n-1];a.removeLetters()||(i.empty=!0),n>0&&(i.escalated&=+(a>=c))}i.escalated&&(i.empty||(v.match(/clock/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);!a||!c?i.filled=!1:(Number(a)>23||Number(c)>59)&&(i.correct=!1)}):v.match(/date/)?p.forEach(n=>{let[a,c,x]=n.split(/\D+/);if(!a||!c||!x)i.filled=!1;else{let S=b.Time(n);(!S.validate||n!=S.toFormatYMD())&&(i.correct=!1)}}):v.match(/week/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);if(!a||!c)i.filled=!1;else{let x=b.Time(a+"/01/01").weekday,R=b.Time(a+"/01/0"+(7-x+1)).addWeek(Number(c)-1);a!=String(R.year)&&(i.correct=!1)}}):v.match(/month/)?p.forEach(n=>{let[a,c]=n.split(/\D+/);!a||!c?i.filled=!1:b.Time([a,c,"01"].join("/")).validate||(i.correct=!1)}):v.match(/year/),i.filled&&i.correct&&p.forEach(n=>{{let a=Number(String(n).replace(/\D/ig,""));if(t&&Number(String(t).replace(/\D/ig,""))>a&&(i.prohibited=!0),D){let c=Number(String(D).replace(/\D/ig,""));a>c&&(i.prohibited=!0)}}})))})();{let{empty:m,escalated:n,filled:a,correct:c,prohibited:x}=i;m&&h&&(d=[{type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}]),n||d.push({type:"invalid",label:"\u6642\u7CFB\u5217\u3092\u6B63\u3057\u304F\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),c||d.push({type:"invalid",label:"\u7121\u52B9\u306A\u5024\u304C\u5165\u529B\u3055\u308C\u3066\u3044\u307E\u3059"}),a||d.push({type:"invalid",label:"\u6700\u5F8C\u307E\u3067\u5024\u3092\u57CB\u3081\u3066\u304F\u3060\u3055\u3044"}),x&&d.push({type:"invalid",label:Z(ke,{children:[T(ae,{children:"\u5165\u529B\u7BC4\u56F2\u304C\u5236\u9650\u3055\u308C\u3066\u3044\u307E\u3059"}),"[",t||"\u4E0B\u9650\u7121\u3057","] ~ [",D||"\u4E0A\u9650\u7121\u3057","]"]})})}return{ok:!d.filter(({type:m})=>m=="invalid").length,notice:d}}const Q={picker:{launch:e=>{let l=e.tipsID||b.uuid.gen();G.open(_(o({gravityPoint:e.gravityPoint||24,padding:"1/2",tipsID:l},e),{close_option:o({aroundClick:!0,parentBlur:!1},e.close_option),content:T(ge,{restrict:e.restrict,min:e.min,max:e.max,era:e.era,defaultValue:e.defaultValue,tipsID:l,onValueUpdate:(v,t)=>{e.onValueUpdate(v,t)}})}))},remove:e=>{G.close(e)}}},De=e=>{let U=e,{tone:l,required:v,restrict:t="clock",componentID:D,era:h,form:d,name:p,min:i,max:m,className:n,enableFormSubmit:a,checkValidationAtFirst:c,onKeyDown:x,onValidate:S,onUpdateValue:R,onUpdateValidValue:y,value:$="",leftIndicator:J,rightIndicator:F}=U,f=H(U,["tone","required","restrict","componentID","era","form","name","min","max","className","enableFormSubmit","checkValidationAtFirst","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","leftIndicator","rightIndicator"]),[r,C]=W(h),[s,V]=W(_(o({componentID:e.componentID||""},P({restrict:t,value:$,era:r})),{eventType:"init",eventID:b.uuid.gen()})),[g,M]=W({ok:!1,notice:[]}),[I,k]=W({active:!1,index:0,prevIndex:-1});pe({type:"time",para:e,val_status:s,set_status:V,val_validate:g,set_validate:M,DefaultValidation:ve,onUpdateValue:R,onUpdateValidValue:y,ExtraOverrideParams:o({},P({restrict:t,value:$,era:r}))});const E=re(!1);return X(()=>{if(E.current){V(o(o({},s),P({restrict:t,value:s.dataValue,era:r})));let u=O.get("refreshEra_"+s.componentID);u&&u.refreshEra(r)}else E.current=!0},[r]),O.update({key:s.componentID,value:{openPicker:()=>{e.disabled||Q.picker.launch({parent:"#Picker-"+s.componentID,tipsID:"PickerTips-"+s.componentID,restrict:t,min:i,max:m,defaultValue:s.dataValue,era:r,onValueUpdate:(u,w)=>{V(_(o(o({},s),P({restrict:t,value:u,era:w})),{eventType:"update",eventID:b.uuid.gen()})),C(w)}})},resetEra:u=>{C(u),V(_(o(o({},s),P({restrict:t,value:"",era:r})),{eventType:"update",eventID:b.uuid.gen()}))}}}),X(()=>{let{index:u,active:w}=I;if(w){u=Math.max(u,0),u=Math.min(u,s.ranges.length-1);let{from:B,length:L}=s.ranges[u],j=ie("#"+e.id)[0];j&&j.setSelectionRange(B,B+L)}},[I]),Z(me,{val_status:s,set_status:V,val_validate:g,para:e,children:[T(de,{name:p,"data-input-type":"time","data-form":d,"data-validation":g.ok,componentID:s.componentID,"data-value":JSON.stringify(["dates","months"].includes(t)?!s.dataValue[0]||!s.dataValue[1]?null:s.dataValue:s.dataValue||null)}),z.get().isTouchDevice?T(q.Button.Plain,{className:n,freeCSS:{textAlign:"left"},children:s.formatValue,onClick:u=>{let w=O.get(s.componentID);w&&w.openPicker(),u.stopPropagation()}}):T("input",o({type:"text",inputMode:"numeric","data-input-type":"time","data-form-name":d,value:s.formatValue,className:n,tabIndex:z.get().isTouchDevice?-1:0,onKeyDown:u=>{Ie({restrict:t,event:u,val_era:r,val_status:s,set_status:V,val_focus:I,set_focus:k}),x&&x(u),a&&ue(u)},onKeyUp:u=>{u.key=="Tab"&&k(_(o({},I),{active:!0}))},onClick:u=>{let w=u.target.selectionEnd,B=0;s.ranges.forEach((L,j)=>{let{from:K,length:ee,region:te}=L;K<=w&&w<=K+(te||ee)&&(B=j)}),k(_(o({},I),{active:!0,index:B})),u.preventDefault()},onChange:()=>{}},f))]})},Ie=e=>{let{val_era:l,restrict:v,event:t,val_status:D,set_status:h,val_focus:d,set_focus:p}=e,{key:i,shiftKey:m,ctrlKey:n,metaKey:a}=t,c=n||a,{selectionStart:x,selectionEnd:S}=t.target,{index:R,prevIndex:y}=d,{ranges:$,formatValue:J}=D,F=$.length-1;if(["Tab","ArrowLeft","ArrowRight"].includes(i)){let f=0;if(i=="Tab"){let r=+!m*2-1;if(f=d.index+r,f<0||f>F)return}else{let r=i=="ArrowLeft"?-1:i=="ArrowRight"?1:0;c||x==0&&S==String(D.formatValue).length?f=r==1?F:0:f=Math.max(0,Math.min(R+r,F))}p(_(o({},d),{index:f,prevIndex:R})),t.preventDefault()}if(["Backspace","ArrowUp","ArrowDown","0","1","2","3","4","5","6","7","8","9"].includes(i)){t.preventDefault();let f=R;f=Math.max(f,0),f=Math.min(f,F);let{type:r,from:C,length:s}=$[f],V=J.slice(C,C+s),g;if(i=="Backspace")g="------".slice(0,s);else if(["ArrowUp","ArrowDown"].includes(i)){let M=i=="ArrowUp"?1:-1;V=V|0,g=V+M;let[I,k,E]=r=="dateWareki"?l=="year"?[0,2999,4]:l=="reiwa"?[1,2999,4]:l=="heisei"?[1,31,4]:l=="shouwa"?[1,64,4]:l=="taisho"?[1,15,4]:l=="meiji"?[1,45,4]:[0,0,0]:r=="minute"?[0,59,2]:r=="hour"?[0,23,2]:r=="date"?[1,31,2]:r=="week"?[1,53,2]:r=="month"?[1,12,2]:r=="year"?[0,2999,4]:[0,0,0];g>k?g=I:g<I&&(g=k),g=Number(g).zeroEmbed(E)}else if(["0","1","2","3","4","5","6","7","8","9"].includes(i)){let M=V|0,I=i,k=`${M}${I}`;if(y!=R&&(M=0,k="0"+I),r=="year"||r=="dateWareki"&&l=="year")Number(k)>1e4?g=I:g=k,(g|0)>1e3&&f++;else if(["hour","minute","date","week","month"].includes(r)||r=="dateWareki"&&l!="year"){let E=r=="dateWareki"?l=="reiwa"?100:l=="heisei"?31:l=="shouwa"?64:l=="taisho"?15:l=="meiji"?45:0:r=="minute"?59:r=="hour"?23:r=="date"?31:r=="week"?53:r=="month"?12:0;g=(k|0)>E?I:k,(Number(I)>Number(String(E)[0])||V=="0000".slice(0,String(E).length)&&(k!="0000".slice(0,String(E).length)||["minute","hour"].includes(r)&&y==R)||(k|0)>=Y(10,String(E).length-1))&&f++}r=="year"||r=="dateWareki"?g=(g|0).zeroEmbed(4):g=(g|0).zeroEmbed(2)}{let M=String(J).partReplace(C,String(g)),I=M.split(A).map(k=>k.replace(/(^\D|\D$)/,"").split(/\D+/).join(v=="clock"?":":"/").replace(/(^\D|\D$)/,""));if(v=="dateWareki"){let k=I[0].split(/\D/),[E,U,u]=k;k.length==3&&E&&(I=[[Number(E)-1+Number({year:1,reiwa:2019,heisei:1989,shouwa:1926,taisho:1912,meiji:1868}[l]),U,u].join("/")])}f=Math.max(f,0),f=Math.min(f,F),h(_(o({},D),{dataValue:["dates","months"].includes(v)?I:I[0],formatValue:M,eventType:"update",eventID:b.uuid.gen()})),p(_(o({},d),{index:f,prevIndex:d.index}))}}},N={Origin:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());if(e.componentID=l,b.is.nullish(e.rightIndicator)){let v=(e.restrict||"").match(/clock/)?le:oe;e.rightIndicator=T(he.RightIndicator,{padding:0,children:T(q.Button.Sub.R,{color:"cloud",border:"unset",padding:[0,1],fontColor:"theme",borderRadius:"inherit",backgroundColor:"inherit",flexCenter:!0,height:1,ssEffectsOnActive:["ripple.cloud"],tabIndex:-1,id:"Picker-"+e.componentID,onClick:()=>{let t=O.get(e.componentID);t&&t.openPicker()},children:T(ne,{icon:v})})})}return T(se,{componentID:e.componentID,children:De,para:ce.Boxish(e)})},Clock:e=>T(N.Origin,o({restrict:"clock",era:"clock"},e)),Date:e=>T(N.Origin,o({restrict:"date"},e)),Week:e=>T(N.Origin,o({restrict:"week"},e)),Month:e=>T(N.Origin,o({restrict:"month"},e)),Year:e=>T(N.Origin,o({restrict:"year"},e)),DateWareki:e=>{e=o({},e);let[l]=W(e.componentID||b.uuid.gen());e.componentID=l;let{defaultEra:v="wareki"}=e,[t,D]=W((()=>{let h="year";if(v=="wareki"&&(h="reiwa",e.value)){let[d,p,i]=e.value.split(/\D/);if(d&&p&&i){let m=Number(d);m>=2019?(m-=2019,h="reiwa"):m>=1989?(m-=1989,h="heisei"):m>=1926?(m-=1926,h="shouwa"):m>=1912?(m-=1912,h="taisho"):m>=1868&&(m-=1868,h="meiji"),m+=1}}return h})());return X(()=>{O.set({key:"refreshEra_"+l,value:{refreshEra:h=>{D(h)}}})},[]),T(N.Origin,_(o({restrict:"dateWareki",leftIndicator:T(fe,{enableUnSelected:!1,value:t,tone:e.tone,override:"force",flexCenter:!0,borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",height:1,freeCSS:{whiteSpace:"nowrap"},options:[{value:"year",label:"\u897F\u66A6"},{value:"reiwa",label:"\u4EE4\u548C"},{value:"heisei",label:"\u5E73\u6210"},{value:"shouwa",label:"\u662D\u548C"},{value:"taisho",label:"\u5927\u6B63"},{value:"meiji",label:"\u660E\u6CBB"}],onUpdateValidValue:({value:h,eventType:d})=>{D(h);let p=O.get(e.componentID);p&&p.resetEra&&p.resetEra(h)}})},e),{era:t}))},Periods:{Date:e=>T(N.Origin,o({restrict:"dates"},e)),Month:e=>T(N.Origin,o({restrict:"months"},e))},fn:Q};export{N as Time,N as default};
@@ -0,0 +1,54 @@
1
+ /// <reference types="react" />
2
+ import { TagProperty, ReactElement } from '../../@declaration';
3
+ import { InputTypes } from '.';
4
+ import List from './List';
5
+ declare namespace Wrapper {
6
+ type Input = {
7
+ componentID?: string;
8
+ children: React.FC<any>;
9
+ para: any;
10
+ };
11
+ }
12
+ export declare const Wrapper: React.FC<Wrapper.Input>;
13
+ declare namespace BoxWrapper {
14
+ type Input = {
15
+ val_status: any;
16
+ set_status: React.Dispatch<React.SetStateAction<any>>;
17
+ val_validate: InputTypes.Validation.Result;
18
+ para: any;
19
+ children: ReactElement;
20
+ };
21
+ }
22
+ export declare const BoxWrapper: React.FC<BoxWrapper.Input>;
23
+ export declare const CommonEffects: {
24
+ (props: {
25
+ type?: string;
26
+ para: plainObject;
27
+ val_status: InputTypes.Status.Plain;
28
+ set_status: React.Dispatch<React.SetStateAction<any>>;
29
+ val_validate: InputTypes.Validation.Result;
30
+ set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
31
+ DefaultValidation: InputTypes.Validation.SystemCheck;
32
+ onUpdateValue?: InputTypes.OnUpdateValue;
33
+ onUpdateValidValue?: InputTypes.OnUpdateValue;
34
+ ExtraOverrideParams?: plainObject;
35
+ ExtraStoreParams?: plainObject;
36
+ }): void;
37
+ };
38
+ export declare const ValidationCheck: {
39
+ (props: {
40
+ val_status: InputTypes.Status.Plain;
41
+ DefaultValidation: InputTypes.Validation.SystemCheck;
42
+ para: any;
43
+ set_validate: React.Dispatch<React.SetStateAction<InputTypes.Validation.Result>>;
44
+ }): void;
45
+ };
46
+ export declare const SubmitForm: (event: React.KeyboardEvent) => boolean;
47
+ export declare const DefaultStyles: {
48
+ Input: (type: InputTypes.BoxTone) => TagProperty.Para;
49
+ ListCell: (para: List.Plain) => List.Plain;
50
+ Boxish: (para: any) => any;
51
+ Indicator: (type: InputTypes.BoxTone) => TagProperty.Para;
52
+ IndicatorIcon: TagProperty.Para;
53
+ };
54
+ export {};
@@ -0,0 +1 @@
1
+ import{b as o,c as a,e as D}from"../../chunk-VY3566IV.js";import{jsx as v,jsxs as V}from"react/jsx-runtime";import{useState as _,useEffect as R,useRef as O}from"react";import i from"@mingoo/jsmin";import{$$fromRoot as z,Config as L,useStore as y,GenerateClassName as B}from"../../@utils";import{InputClasses as N}from"../../@styles/componentClasses";import P from"../../atoms/Box";import A from"../../atoms/Flex";import T from"../../atoms/FAI";import E from"../../mols/Row";import W from"../../mols/Column";import U from"../Button";import k from"../Tooltips";const ue=e=>{let[t]=_(e.componentID||i.uuid.gen());e=o({},e),e.para=a(o({enableFormSubmit:!0,status_id:i.uuid.gen(),override:"never",name:i.uuid.gen(),id:i.uuid.gen(),"aria-label":"Input-"+t},e.para),{componentID:t});let{children:r}=e;return v(r,o({},e.para))},de=e=>{let{children:t,val_status:r,set_status:n,val_validate:c,para:l}=e,{clearButton:s,rightIcon:u,leftIcon:p,wrapStyles:m}=l;return r.eventType=="init"&&!l.checkValidationAtFirst&&(c.notice=[]),V(E.Center,a(o({position:"relative",verticalAlign:"unset",gap:0},m),{className:N("Wrapper"),"data-notice-uid":r.componentID,children:[v($,{notice:c.notice,val_status:r}),l.leftIndicator,V(A,{position:"relative",flexSizing:"auto",children:[p,t,s&&r.dataValue?v(U.Button.Normal.R,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3,transform:"translateY(-50%)"},onClick:()=>{n(a(o({},r),{dataValue:"",formatValue:"",eventType:"update",eventID:i.uuid.gen()}))},children:v(T.Times,{})}):u]}),l.rightIndicator]}))},$=e=>{let{notice:t,val_status:r}=e,{componentID:n,eventType:c}=r,l="NoticeTimer-"+n,s="NoticeTimerClose-"+n,u="notice-tips-"+n;return i.interval.clear(l),i.interval.clear(s),t.length?(i.interval.standBy(l,350,()=>{k.open({tipsID:u,parent:`[data-notice-uid="${n}"]`,gravityPoint:22,padding:[1,0],close_option:{parentBlur:!1},content:V(k.Comps.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[v(P,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),v(W,{gap:"1/3",position:"relative",freeCSS:{zIndex:2},backgroundColor:"inherit",children:t.map(p=>{let{type:m,label:S}=p,b=m=="invalid"?T.Times:m=="warn"?T.Exclamation:T.Check;return V(E.Left,{gap:0,borderRadius:"2.tone.secondary",children:[v(b,{flexCenter:!0,fontSize:"3.paragraph",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[m]}),v(P,{fontColor:"white",children:S})]})})})]})})}),i.interval.standBy(s,6e3,()=>{k.close(u)}),null):(k.close(u),null)},ce=e=>{let{type:t,para:r,val_status:n,set_status:c,ExtraOverrideParams:l,ExtraStoreParams:s,val_validate:u,set_validate:p,DefaultValidation:m,onUpdateValue:S,onUpdateValidValue:b}=e;r=o({},r);let{componentID:I}=n,[w,F]=_(i.uuid.gen());R(()=>(y.update({key:I,value:o({ResolveRefresh:null,Refresh:()=>new Promise((d,f)=>{y.get(I).ResolveRefresh=d,F(i.uuid.gen())}),GenNotice:d=>{let{ok:f,notice:g}=d;p({ok:f,notice:g})}},s)}),()=>{y.delete(I)}),[]);const x=O(!1);R(()=>{x.current?c(a(o({},n),{eventType:"refresh",eventID:i.uuid.gen()})):x.current=!0},[w]),R(()=>{r.value=n.dataValue,i.interval.clear("ValidationTimer-"+I),j({val_status:n,set_validate:p,DefaultValidation:m,para:r})},[n.eventID]),(()=>{let{override:d}=r;if(d=="never"||d=="beforeModified"&&!["init","override"].includes(n.eventType))return;let f=y.get(n.componentID);f&&(r.value!=n.dataValue&&r.status_id!=f.status_id&&c(a(o(a(o({},n),{dataValue:r.value}),l),{eventType:"override",eventID:i.uuid.gen()})),f.status_id=r.status_id)})(),R(()=>{let{componentID:d,eventType:f,dataValue:g}=n,h=g;if(t=="list"?h=g.map(C=>JSON.parse(C)):t=="select"||t=="richSelect"?h=JSON.parse(g):t=="file"&&y.update({key:d,value:{Files:n.dataValue}}),f=="refresh"){let C=y.get(d);C&&C.ResolveRefresh&&C.ResolveRefresh(null)}f=="update"&&(S&&S({componentID:d,value:h,storeData:y.get(d),eventType:f}),i.scope(()=>{u.ok&&b&&b({componentID:d,value:h,storeData:y.get(d),eventType:f})}))},[u])},j=e=>{let{val_status:t,para:r,set_validate:n,DefaultValidation:c}=e,l=c({value:t.dataValue,para:r});if(!l.ok){n(l);return}let s=l.notice;const u=()=>D(void 0,null,function*(){if(!r.onValidate)return;let p=yield r.onValidate({value:t.dataValue,eventType:t.eventType,props:e});if(!p.ok){n({ok:!1,notice:[...s,...p.notice]});return}n({ok:!0,notice:[...s,...p.notice]})});r.onValidate?t.eventType=="refresh"?u():i.interval.standBy("ValidationTimer-"+t.componentID,450,u):n({ok:!0,notice:s})},pe=e=>{let t=e.target,{form:r,formName:n}=t.dataset;r=n||r;let c=!1,l=z(`[data-form-submit-button="${r}"]`)[0];if(!l)return c;let s=l.dataset.sdfike||"",u=e.key,p=e.ctrlKey||e.metaKey;return i.scope(()=>{s.includes("enter")&&(u!="Enter"||e.nativeEvent.isComposing||L.get().browserIs=="safari"&&e.keyCode==229)||((u=="Enter"&&(s.includes("enter")||s.includes("auxEnter")&&p)||u==" "&&s.includes("space"))&&(l.click(),e.preventDefault()),c=!0)}),c},K={Input:e=>{if(e=="plain")return{};let t={padding:"3/4",transition:"middle",flexSizing:"auto",boxShadow:"0.thin"};return e=="border"?t=a(o({},t),{border:!0,borderRadius:"2.tone.secondary",backgroundColor:"layer.1"}):e=="cloud"?t=a(o({},t),{border:"1.thin",borderRadius:"2.tone.secondary",backgroundColor:"cloud"}):e=="bottomBorder"&&(t=a(o({},t),{borderRadius:0,border:"unset",borderBottom:!0,backgroundColor:"cloud"})),t},ListCell:e=>{e=o({},e),e.tone||(e.tone="border");let{tone:t}=e;return t=="plain"||(e=a(o({},e),{cellStyles:o({position:"relative",padding:["3/4",1],borderRadius:"2.tone.secondary",transition:"middle"},e.cellStyles)}),t=="normal"?e=a(o({gap:"1/2"},e),{cellStyles:o({isSemiBoldFont:!0},e.cellStyles),cellCheckedStyles:{backgroundColor:"cloud"}}):(e=a(o({gap:"3/4"},e),{cellStyles:o({boxShadow:"0.thin"},e.cellStyles)}),(t=="cloud"||t=="vivid")&&(e.cellStyles=o({border:"1.thin",backgroundColor:"layer.2"},e.cellStyles)),t=="border"?(e.cellStyles=o({border:!0,backgroundColor:"layer.1"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):t=="cloud"?e.cellCheckedStyles=o({backgroundColor:"theme.opa.few",fontColor:"theme",borderColor:"theme"},e.cellCheckedStyles):t=="vivid"&&(e.cellCheckedStyles=o({backgroundColor:"theme",fontColor:"white",borderColor:"theme"},e.cellCheckedStyles)))),B(e)},Boxish:e=>{e=o({},e),e.tone||(e.tone="border");let t=a(o(o(o(a(o({},K.Input(e.tone)),{fontColor:"2.normal"}),e),!!e.leftIndicator&&{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3",marginLeft:"1/4"}),!!e.rightIndicator&&{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}),{className:[N("Input"),e.className].join(" ")});return B(t)},Indicator:e=>{if(e||(e="border"),e=="plain")return{};let t={flexSizing:"none",flexCenter:!0,padding:[0,1],borderRadius:"2.tone.secondary",backgroundColor:"cloud"};return e=="border"?t=a(o({},t),{border:!0}):e=="cloud"?t=a(o({},t),{border:"1.thin"}):e=="bottomBorder"&&(t=a(o({},t),{borderRadius:0,borderBottom:!0})),t},IndicatorIcon:{position:"absolute",ssSquare:2,top:"50%",flexCenter:!0,fontColor:"theme",fontSize:"1.mini",backgroundColor:"inherit",freeCSS:{transform:"translateY(-50%)"}}};export{de as BoxWrapper,ce as CommonEffects,K as DefaultStyles,pe as SubmitForm,j as ValidationCheck,ue as Wrapper};