amotify 0.1.31 → 0.1.32

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 (95) hide show
  1. package/dist/@declaration/_.js +1 -1
  2. package/dist/@styles/componentClasses/_.css +68 -65
  3. package/dist/@styles/componentClasses/_.js +39 -39
  4. package/dist/@styles/index.css +68 -65
  5. package/dist/@styles/index.js +39 -39
  6. package/dist/@styles/init.css +1 -1
  7. package/dist/@styles/style.css +68 -65
  8. package/dist/@styles/style.js +39 -39
  9. package/dist/@styles/var.css +1 -1
  10. package/dist/@utils/GenerateClassName.js +470 -1
  11. package/dist/@utils/LaunchReactApp.js +78 -1
  12. package/dist/@utils/_.js +12 -1
  13. package/dist/@utils/collectForm.js +96 -1
  14. package/dist/@utils/color.js +103 -1
  15. package/dist/@utils/config.js +101 -1
  16. package/dist/@utils/fin.js +39 -1
  17. package/dist/@utils/getElement.js +13 -1
  18. package/dist/@utils/jsminEx.js +172 -1
  19. package/dist/@utils/pageTransit.js +33 -1
  20. package/dist/@utils/useRecycle.js +44 -1
  21. package/dist/@utils/useStore.js +54 -1
  22. package/dist/atoms/Box.js +20 -1
  23. package/dist/atoms/FAI.js +148 -1
  24. package/dist/atoms/Flex.js +34 -1
  25. package/dist/atoms/Grid.js +17 -1
  26. package/dist/atoms/Img.js +65 -1
  27. package/dist/atoms/Logo.js +359 -51
  28. package/dist/atoms/P.js +20 -1
  29. package/dist/atoms/Placeholder.js +44 -1
  30. package/dist/atoms/Span.js +20 -1
  31. package/dist/atoms/_.js +9 -1
  32. package/dist/chunk-JJ3PEWPN.js +60 -0
  33. package/dist/fn/Button.js +316 -1
  34. package/dist/fn/Cropper.js +1009 -1
  35. package/dist/fn/Effect/Fade.js +88 -1
  36. package/dist/fn/Effect/Pudding.js +22 -1
  37. package/dist/fn/Effect/Ripple.js +117 -3
  38. package/dist/fn/Effect/_.js +14 -1
  39. package/dist/fn/Input/AutoHeightText.js +112 -1
  40. package/dist/fn/Input/Checker.js +36 -1
  41. package/dist/fn/Input/Chips/Selector.js +472 -1
  42. package/dist/fn/Input/Chips/_.js +349 -1
  43. package/dist/fn/Input/Contenteditable.js +160 -1
  44. package/dist/fn/Input/DigitCharacters.js +275 -1
  45. package/dist/fn/Input/Filer.js +619 -1
  46. package/dist/fn/Input/Hidden.js +48 -1
  47. package/dist/fn/Input/List.js +450 -1
  48. package/dist/fn/Input/Parts.js +121 -1
  49. package/dist/fn/Input/Plain.js +12 -1
  50. package/dist/fn/Input/RichSelect.js +279 -1
  51. package/dist/fn/Input/Search.js +53 -1
  52. package/dist/fn/Input/Segmented.js +245 -1
  53. package/dist/fn/Input/Select.js +278 -1
  54. package/dist/fn/Input/Slider.js +538 -1
  55. package/dist/fn/Input/Switch.js +221 -1
  56. package/dist/fn/Input/Text.js +626 -1
  57. package/dist/fn/Input/TextArea.js +151 -1
  58. package/dist/fn/Input/Time/Picker.js +1457 -1
  59. package/dist/fn/Input/Time/_.js +867 -1
  60. package/dist/fn/Input/_.js +48 -1
  61. package/dist/fn/Input/core.js +626 -1
  62. package/dist/fn/Layout/PageNotFound.js +90 -1
  63. package/dist/fn/Layout/PageRouter.js +87 -1
  64. package/dist/fn/Layout/PageViewController.js +29 -1
  65. package/dist/fn/Layout/Plate.js +37 -1
  66. package/dist/fn/Layout/RootViewController.js +315 -1
  67. package/dist/fn/Layout/SwipeView.js +348 -1
  68. package/dist/fn/Layout/TabBar.js +72 -1
  69. package/dist/fn/Layout/_.js +22 -1
  70. package/dist/fn/Loader/_.js +104 -1
  71. package/dist/fn/Loader/corner.js +85 -1
  72. package/dist/fn/Loader/mini.js +125 -1
  73. package/dist/fn/Loader/top.js +73 -1
  74. package/dist/fn/Sheet.js +1101 -1
  75. package/dist/fn/Snackbar.js +216 -1
  76. package/dist/fn/Table/Data.js +974 -1
  77. package/dist/fn/Table/Drag.js +435 -1
  78. package/dist/fn/Table/Normal.js +136 -1
  79. package/dist/fn/Table/Parts.js +41 -1
  80. package/dist/fn/Table/Wrapper.js +60 -1
  81. package/dist/fn/Table/_.js +16 -1
  82. package/dist/fn/Table/cellStyling.js +51 -1
  83. package/dist/fn/Tooltips.js +58 -1
  84. package/dist/fn/_.js +10 -1
  85. package/dist/index.js +20 -1
  86. package/dist/mols/Accordion.js +152 -1
  87. package/dist/mols/Column.js +16 -1
  88. package/dist/mols/LinkifyText.js +42 -1
  89. package/dist/mols/List.js +42 -1
  90. package/dist/mols/Row.js +47 -1
  91. package/dist/mols/Text.js +67 -1
  92. package/dist/mols/_.js +6 -1
  93. package/dist/temps/_.js +1 -1
  94. package/dist/temps/designBook.js +3639 -20
  95. package/package.json +1 -1
@@ -1 +1,48 @@
1
- import"../../chunk-VY3566IV.js";import o from"./Plain";import i from"./Hidden";import a from"./Text";import p from"./TextArea";import m from"./AutoHeightText";import n from"./Contenteditable";import l from"./DigitCharacters";import c from"./Time/_";import s from"./Select";import d from"./RichSelect";import*as r from"./List";import x from"./Chips/_";import h from"./Search";import _ from"./Filer";import y from"./Slider";import C from"./Switch";import T from"./Checker";import u from"./Segmented";import f from"./Parts";var t;(e=>(e.Plain=o,e.Hidden=i,e.Text=a,e.TextArea=p,e.AutoHeightText=m,e.Contenteditable=n,e.DigitCharacters=l,e.Time=c,e.Select=s,e.RichSelect=d,e.List=r.List,e.Radio=r.Radio,e.Checkbox=r.Checkbox,e.Checker=T,e.Chips=x,e.Search=h,e.Filer=_,e.Slider=y,e.Switch=C,e.Segmented=u,e.Comps=f))(t||(t={}));export{t as Input,t as default};
1
+ import "../../chunk-JJ3PEWPN.js";
2
+ import _Plain from "./Plain";
3
+ import _Hidden from "./Hidden";
4
+ import _Text from "./Text";
5
+ import _TextArea from "./TextArea";
6
+ import _AutoHeightText from "./AutoHeightText";
7
+ import _Contenteditable from "./Contenteditable";
8
+ import _DigitCharacters from "./DigitCharacters";
9
+ import _Time from "./Time/_";
10
+ import _Select from "./Select";
11
+ import _RichSelect from "./RichSelect";
12
+ import * as _List from "./List";
13
+ import _Chips from "./Chips/_";
14
+ import _Search from "./Search";
15
+ import _Filer from "./Filer";
16
+ import _Slider from "./Slider";
17
+ import _Switch from "./Switch";
18
+ import _Checker from "./Checker";
19
+ import _Segmented from "./Segmented";
20
+ import _Parts from "./Parts";
21
+ var Input;
22
+ ((Input2) => {
23
+ Input2.Plain = _Plain;
24
+ Input2.Hidden = _Hidden;
25
+ Input2.Text = _Text;
26
+ Input2.TextArea = _TextArea;
27
+ Input2.AutoHeightText = _AutoHeightText;
28
+ Input2.Contenteditable = _Contenteditable;
29
+ Input2.DigitCharacters = _DigitCharacters;
30
+ Input2.Time = _Time;
31
+ Input2.Select = _Select;
32
+ Input2.RichSelect = _RichSelect;
33
+ Input2.List = _List.List;
34
+ Input2.Radio = _List.Radio;
35
+ Input2.Checkbox = _List.Checkbox;
36
+ Input2.Checker = _Checker;
37
+ Input2.Chips = _Chips;
38
+ Input2.Search = _Search;
39
+ Input2.Filer = _Filer;
40
+ Input2.Slider = _Slider;
41
+ Input2.Switch = _Switch;
42
+ Input2.Segmented = _Segmented;
43
+ Input2.Comps = _Parts;
44
+ })(Input || (Input = {}));
45
+ export {
46
+ Input,
47
+ Input as default
48
+ };
@@ -1 +1,626 @@
1
- import{b as o,c as a,e as B}from"../../chunk-VY3566IV.js";import{jsx as m,jsxs as C}from"react/jsx-runtime";import{useState as N,useEffect as T,useRef as O}from"react";import{$$ as i,$$fromRoot as W,Config as z,useStore as v,GenerateClassName as P}from"../../@utils/_";import{InputClasses as k}from"../../@styles/componentClasses/_";import x from"../../atoms/Box";import E from"../../atoms/Flex";import V from"../../atoms/FAI";import L from"../../mols/Row";import A from"../../mols/Column";import U from"../Button";import D from"../Tooltips";const se=e=>{let[t]=N(e.componentID||i.uuid.gen());e=o({},e),e.params=a(o({enableFormSubmit:!0,status_id:i.uuid.gen(),override:"never",name:i.uuid.gen(),id:i.uuid.gen(),"aria-label":"Input-"+t},e.params),{componentID:t});let{children:n}=e;return m(n,o({},e.params))},ue=e=>{let{children:t,val_status:n,set_status:r,val_validate:c,params:l}=e,{clearButton:s,rightIcon:u,leftIcon:p,wrapStyles:y}=l;return n.eventType=="init"&&!l.checkValidationAtFirst&&(c.notice=[]),C(x,a(o({position:"relative"},y),{id:"BoxWrapper-"+n.componentID,children:[C(E,{flexWrap:!1,flexSizing:0,className:k("Wrapper"),children:[l.leftIndicator,C(E,{position:"relative",flexSizing:"auto",children:[p,t,s&&n.dataValue?m(U.Button.Normal.R,{ssSphere:2,flexCenter:!0,fontColor:"5.translucent",ssEffectsOnActive:["ripple.theme"],position:"absolute",right:1,top:"50%",freeCSS:{zIndex:3},className:k("IndicatorIcon"),onClick:()=>{r(a(o({},n),{dataValue:"",formatValue:"",eventType:"update",eventID:i.uuid.gen()}))},children:m(V.Times,{})}):u]}),l.rightIndicator]}),m($,{notice:c.notice,val_status:n})]}))},$=e=>{let{notice:t,val_status:n}=e,{componentID:r,eventType:c}=n;i.interval.clear("NoticeTimer-"+r),i.interval.clear("NoticeTimerClose-"+r);let l="notice-"+e.val_status.componentID,s="notice-tips-"+e.val_status.componentID;if(!t.length)return D.close(s),null;let u=t.map(p=>{let{type:y,label:I}=p,S=y=="invalid"?V.Times:y=="warn"?V.Exclamation:V.Check;return C(L.Left,{gap:0,borderRadius:"2.tone.secondary",children:[m(S,{flexCenter:!0,fontSize:"3.paragraph",fontColor:{invalid:"nega",warn:"warn",valid:"posi"}[y]}),m(x,{fontColor:"white",children:I})]})});return i.interval.standBy("NoticeTimer-"+r,350,()=>{D.open({tipsID:s,parent:"#"+l,padding:["1/2",0],content:C(D.Comps.Body,{padding:["1/2","2/3"],fontSize:"1.mini",position:"relative",children:[m(x,{position:"absolute",unitHeight:1,unitWidth:1,left:1,backgroundColor:"dark",freeCSS:{zIndex:1,transform:"rotate(45deg)",top:-6}}),m(A,{gap:"1/3",position:"relative",freeCSS:{zIndex:2},backgroundColor:"inherit",children:u})]})}),i.interval.standBy("NoticeTimerClose-"+r,7500,()=>{D.close(s)})}),m(x,{className:k("Notices"),id:l})},de=e=>{let{type:t,params:n,val_status:r,set_status:c,ExtraOverrideParams:l,ExtraStoreParams:s,val_validate:u,set_validate:p,DefaultValidation:y,onUpdateValue:I,onUpdateValidValue:S}=e;n=o({},n);let{componentID:R}=r,[F,w]=N(i.uuid.gen());T(()=>(v.update({key:R,value:o({ResolveRefresh:null,Refresh:()=>new Promise((d,f)=>{v.get(R).ResolveRefresh=d,w(i.uuid.gen())}),GenNotice:d=>{let{ok:f,notice:g}=d;p({ok:f,notice:g})}},s)}),()=>{v.delete(R)}),[]);const _=O(!1);T(()=>{_.current?c(a(o({},r),{eventType:"refresh",eventID:i.uuid.gen()})):_.current=!0},[F]),T(()=>{n.value=r.dataValue,i.interval.clear("ValidationTimer-"+R),j({val_status:r,set_validate:p,DefaultValidation:y,params:n})},[r.eventID]),(()=>{let{override:d}=n;if(d=="never"||d=="beforeModified"&&!["init","override"].includes(r.eventType))return;let f=v.get(r.componentID);f&&(n.value!=r.dataValue&&n.status_id!=f.status_id&&c(a(o(a(o({},r),{dataValue:n.value}),l),{eventType:"override",eventID:i.uuid.gen()})),f.status_id=n.status_id)})(),T(()=>{let{componentID:d,eventType:f,dataValue:g}=r,h=g;if(t=="list"?h=g.map(b=>JSON.parse(b)):t=="select"||t=="richSelect"?h=JSON.parse(g):t=="file"&&v.update({key:d,value:{Files:r.dataValue}}),f=="refresh"){let b=v.get(d);b&&b.ResolveRefresh&&b.ResolveRefresh(null)}f=="update"&&(I&&I({componentID:d,value:h,storeData:v.get(d),eventType:f}),i.scope(()=>{u.ok&&S&&S({componentID:d,value:h,storeData:v.get(d),eventType:f})}))},[u])},j=e=>{let{val_status:t,params:n,set_validate:r,DefaultValidation:c}=e,l=c({value:t.dataValue,params:n});if(!l.ok){r(l);return}let s=l.notice;const u=()=>B(void 0,null,function*(){if(!n.onValidate)return;let p=yield n.onValidate({value:t.dataValue,eventType:t.eventType,props:e});if(!p.ok){r({ok:!1,notice:[...s,...p.notice]});return}r({ok:!0,notice:[...s,...p.notice]})});n.onValidate?t.eventType=="refresh"?u():i.interval.standBy("ValidationTimer-"+t.componentID,450,u):r({ok:!0,notice:s})},ce=e=>{let t=e.target,{form:n,formName:r}=t.dataset;n=r||n;let c=!1,l=W(`[data-form-submit-button="${n}"]`)[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||z.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:"1.layer.base"}):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:"2.layer.cloud"},e.cellStyles)),t=="border"?(e.cellStyles=o({border:!0,backgroundColor:"1.layer.base"},e.cellStyles),e.cellCheckedStyles=o({borderColor:"theme",fontColor:"theme"},e.cellCheckedStyles)):t=="cloud"?e.cellCheckedStyles=o({backgroundColor:"tcOpFew",fontColor:"theme",borderColor:"theme"},e.cellCheckedStyles):t=="vivid"&&(e.cellCheckedStyles=o({backgroundColor:"theme",fontColor:"white",borderColor:"theme"},e.cellCheckedStyles)))),P(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"}:null),e.rightIndicator?{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3",marginRight:"1/4"}:null),{className:[k("Input"),e.className].join(" ")});return P(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",unitWidth:2,unitHeight:2,top:"50%",flexCenter:!0,fontColor:"theme",fontSize:"1.mini",backgroundColor:"inherit"}};export{ue as BoxWrapper,de as CommonEffects,K as DefaultStyles,ce as SubmitForm,j as ValidationCheck,se as Wrapper};
1
+ import {
2
+ __async,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import {
8
+ useState,
9
+ useEffect,
10
+ useRef
11
+ } from "react";
12
+ import {
13
+ $$,
14
+ $$fromRoot,
15
+ Config,
16
+ useStore,
17
+ GenerateClassName
18
+ } from "../../@utils/_";
19
+ import { InputClasses } from "../../@styles/componentClasses/_";
20
+ import Box from "../../atoms/Box";
21
+ import Flex from "../../atoms/Flex";
22
+ import FAI from "../../atoms/FAI";
23
+ import Row from "../../mols/Row";
24
+ import Column from "../../mols/Column";
25
+ import Button from "../Button";
26
+ import Tooltips from "../Tooltips";
27
+ const Wrapper = (props) => {
28
+ let [val_componentID] = useState(props.componentID || $$.uuid.gen());
29
+ props = __spreadValues({}, props);
30
+ props.params = __spreadProps(__spreadValues({
31
+ enableFormSubmit: true,
32
+ // override: 'beforeModified',
33
+ status_id: $$.uuid.gen(),
34
+ override: "never",
35
+ name: $$.uuid.gen(),
36
+ id: $$.uuid.gen(),
37
+ "aria-label": "Input-" + val_componentID
38
+ }, props.params), {
39
+ componentID: val_componentID
40
+ });
41
+ let {
42
+ children: Children
43
+ } = props;
44
+ return /* @__PURE__ */ jsx(Children, __spreadValues({}, props.params));
45
+ };
46
+ const BoxWrapper = (props) => {
47
+ let {
48
+ children,
49
+ val_status,
50
+ set_status,
51
+ val_validate,
52
+ params
53
+ } = props;
54
+ let {
55
+ clearButton,
56
+ rightIcon,
57
+ leftIcon,
58
+ wrapStyles
59
+ } = params;
60
+ if (val_status.eventType == "init" && !params.checkValidationAtFirst)
61
+ val_validate.notice = [];
62
+ return /* @__PURE__ */ jsxs(
63
+ Box,
64
+ __spreadProps(__spreadValues({
65
+ position: "relative"
66
+ }, wrapStyles), {
67
+ id: "BoxWrapper-" + val_status.componentID,
68
+ children: [
69
+ /* @__PURE__ */ jsxs(
70
+ Flex,
71
+ {
72
+ flexWrap: false,
73
+ flexSizing: 0,
74
+ className: InputClasses("Wrapper"),
75
+ children: [
76
+ params.leftIndicator,
77
+ /* @__PURE__ */ jsxs(
78
+ Flex,
79
+ {
80
+ position: "relative",
81
+ flexSizing: "auto",
82
+ children: [
83
+ leftIcon,
84
+ children,
85
+ clearButton && !!val_status.dataValue ? /* @__PURE__ */ jsx(
86
+ Button.Button.Normal.R,
87
+ {
88
+ ssSphere: 2,
89
+ flexCenter: true,
90
+ fontColor: "5.translucent",
91
+ ssEffectsOnActive: ["ripple.theme"],
92
+ position: "absolute",
93
+ right: 1,
94
+ top: "50%",
95
+ freeCSS: {
96
+ zIndex: 3
97
+ },
98
+ className: InputClasses("IndicatorIcon"),
99
+ onClick: () => {
100
+ set_status(__spreadProps(__spreadValues({}, val_status), {
101
+ dataValue: "",
102
+ formatValue: "",
103
+ eventType: "update",
104
+ eventID: $$.uuid.gen()
105
+ }));
106
+ },
107
+ children: /* @__PURE__ */ jsx(FAI.Times, {})
108
+ }
109
+ ) : rightIcon
110
+ ]
111
+ }
112
+ ),
113
+ params.rightIndicator
114
+ ]
115
+ }
116
+ ),
117
+ /* @__PURE__ */ jsx(
118
+ GenNotices,
119
+ {
120
+ notice: val_validate.notice,
121
+ val_status
122
+ }
123
+ )
124
+ ]
125
+ })
126
+ );
127
+ };
128
+ const GenNotices = (params) => {
129
+ let { notice, val_status } = params;
130
+ let {
131
+ componentID,
132
+ eventType
133
+ } = val_status;
134
+ $$.interval.clear("NoticeTimer-" + componentID);
135
+ $$.interval.clear("NoticeTimerClose-" + componentID);
136
+ let parentID = "notice-" + params.val_status.componentID;
137
+ let tipsID = "notice-tips-" + params.val_status.componentID;
138
+ if (!notice.length) {
139
+ Tooltips.close(tipsID);
140
+ return null;
141
+ }
142
+ let Notices = notice.map((cell) => {
143
+ let { type, label } = cell;
144
+ let ICON = type == "invalid" ? FAI.Times : type == "warn" ? FAI.Exclamation : FAI.Check;
145
+ return /* @__PURE__ */ jsxs(
146
+ Row.Left,
147
+ {
148
+ gap: 0,
149
+ borderRadius: "2.tone.secondary",
150
+ children: [
151
+ /* @__PURE__ */ jsx(
152
+ ICON,
153
+ {
154
+ flexCenter: true,
155
+ fontSize: "3.paragraph",
156
+ fontColor: {
157
+ "invalid": "nega",
158
+ "warn": "warn",
159
+ "valid": "posi"
160
+ }[type]
161
+ }
162
+ ),
163
+ /* @__PURE__ */ jsx(
164
+ Box,
165
+ {
166
+ fontColor: "white",
167
+ children: label
168
+ }
169
+ )
170
+ ]
171
+ }
172
+ );
173
+ });
174
+ $$.interval.standBy(
175
+ "NoticeTimer-" + componentID,
176
+ 350,
177
+ () => {
178
+ Tooltips.open({
179
+ tipsID,
180
+ parent: "#" + parentID,
181
+ padding: ["1/2", 0],
182
+ content: /* @__PURE__ */ jsxs(
183
+ Tooltips.Comps.Body,
184
+ {
185
+ padding: ["1/2", "2/3"],
186
+ fontSize: "1.mini",
187
+ position: "relative",
188
+ children: [
189
+ /* @__PURE__ */ jsx(
190
+ Box,
191
+ {
192
+ position: "absolute",
193
+ unitHeight: 1,
194
+ unitWidth: 1,
195
+ left: 1,
196
+ backgroundColor: "dark",
197
+ freeCSS: {
198
+ zIndex: 1,
199
+ transform: "rotate(45deg)",
200
+ top: -6
201
+ }
202
+ }
203
+ ),
204
+ /* @__PURE__ */ jsx(
205
+ Column,
206
+ {
207
+ gap: "1/3",
208
+ position: "relative",
209
+ freeCSS: {
210
+ zIndex: 2
211
+ },
212
+ backgroundColor: "inherit",
213
+ children: Notices
214
+ }
215
+ )
216
+ ]
217
+ }
218
+ )
219
+ });
220
+ $$.interval.standBy(
221
+ "NoticeTimerClose-" + componentID,
222
+ 7500,
223
+ () => {
224
+ Tooltips.close(tipsID);
225
+ }
226
+ );
227
+ }
228
+ );
229
+ return /* @__PURE__ */ jsx(
230
+ Box,
231
+ {
232
+ className: InputClasses("Notices"),
233
+ id: parentID
234
+ }
235
+ );
236
+ };
237
+ const CommonEffects = (props) => {
238
+ let {
239
+ type,
240
+ params,
241
+ val_status,
242
+ set_status,
243
+ ExtraOverrideParams,
244
+ ExtraStoreParams,
245
+ val_validate,
246
+ set_validate,
247
+ DefaultValidation,
248
+ onUpdateValue,
249
+ onUpdateValidValue
250
+ } = props;
251
+ params = __spreadValues({}, params);
252
+ let {
253
+ componentID
254
+ } = val_status;
255
+ let [val_refresh, set_refresh] = useState($$.uuid.gen());
256
+ useEffect(() => {
257
+ useStore.update({
258
+ key: componentID,
259
+ value: __spreadValues({
260
+ ResolveRefresh: null,
261
+ Refresh: () => {
262
+ return new Promise((res, rej) => {
263
+ useStore.get(componentID).ResolveRefresh = res;
264
+ set_refresh($$.uuid.gen());
265
+ });
266
+ },
267
+ GenNotice: (props2) => {
268
+ let { ok, notice } = props2;
269
+ set_validate({ ok, notice });
270
+ }
271
+ }, ExtraStoreParams)
272
+ });
273
+ return () => {
274
+ useStore.delete(componentID);
275
+ };
276
+ }, []);
277
+ const mounted = useRef(false);
278
+ useEffect(() => {
279
+ if (mounted.current) {
280
+ set_status(__spreadProps(__spreadValues({}, val_status), {
281
+ eventType: "refresh",
282
+ eventID: $$.uuid.gen()
283
+ }));
284
+ } else {
285
+ mounted.current = true;
286
+ }
287
+ }, [val_refresh]);
288
+ useEffect(() => {
289
+ params.value = val_status.dataValue;
290
+ $$.interval.clear("ValidationTimer-" + componentID);
291
+ ValidationCheck({
292
+ val_status,
293
+ set_validate,
294
+ DefaultValidation,
295
+ params
296
+ });
297
+ }, [val_status.eventID]);
298
+ (() => {
299
+ let {
300
+ override
301
+ } = params;
302
+ if (override == "never")
303
+ return;
304
+ if (override == "beforeModified") {
305
+ if (!["init", "override"].includes(val_status.eventType))
306
+ return;
307
+ }
308
+ let component = useStore.get(val_status.componentID);
309
+ if (!component)
310
+ return;
311
+ if (params.value != val_status.dataValue && params.status_id != component.status_id) {
312
+ set_status(__spreadProps(__spreadValues(__spreadProps(__spreadValues({}, val_status), {
313
+ dataValue: params.value
314
+ }), ExtraOverrideParams), {
315
+ eventType: "override",
316
+ eventID: $$.uuid.gen()
317
+ }));
318
+ }
319
+ component.status_id = params.status_id;
320
+ })();
321
+ useEffect(() => {
322
+ let {
323
+ componentID: componentID2,
324
+ eventType,
325
+ dataValue
326
+ } = val_status;
327
+ let Value = dataValue;
328
+ if (type == "list") {
329
+ Value = dataValue.map((value) => JSON.parse(value));
330
+ } else if (type == "select") {
331
+ Value = JSON.parse(dataValue);
332
+ } else if (type == "richSelect") {
333
+ Value = JSON.parse(dataValue);
334
+ } else if (type == "file") {
335
+ useStore.update({
336
+ key: componentID2,
337
+ value: {
338
+ Files: val_status.dataValue
339
+ }
340
+ });
341
+ }
342
+ if (eventType == "refresh") {
343
+ let comp = useStore.get(componentID2);
344
+ if (comp && comp.ResolveRefresh)
345
+ comp.ResolveRefresh(null);
346
+ }
347
+ if (eventType == "update") {
348
+ if (onUpdateValue)
349
+ onUpdateValue({
350
+ componentID: componentID2,
351
+ value: Value,
352
+ storeData: useStore.get(componentID2),
353
+ eventType
354
+ });
355
+ $$.scope(() => {
356
+ if (!val_validate.ok)
357
+ return;
358
+ if (!onUpdateValidValue)
359
+ return;
360
+ onUpdateValidValue({
361
+ componentID: componentID2,
362
+ value: Value,
363
+ storeData: useStore.get(componentID2),
364
+ eventType
365
+ });
366
+ });
367
+ }
368
+ }, [val_validate]);
369
+ };
370
+ const ValidationCheck = (props) => {
371
+ let {
372
+ val_status,
373
+ params,
374
+ set_validate,
375
+ DefaultValidation
376
+ } = props;
377
+ let result = DefaultValidation({
378
+ value: val_status.dataValue,
379
+ params
380
+ });
381
+ if (!result.ok) {
382
+ set_validate(result);
383
+ return;
384
+ }
385
+ let sysDefaultNotice = result.notice;
386
+ const FN = () => __async(void 0, null, function* () {
387
+ if (!params.onValidate)
388
+ return;
389
+ let result2 = yield params.onValidate({
390
+ value: val_status.dataValue,
391
+ eventType: val_status.eventType,
392
+ props
393
+ });
394
+ if (!result2.ok) {
395
+ set_validate({
396
+ ok: false,
397
+ notice: [
398
+ ...sysDefaultNotice,
399
+ ...result2.notice
400
+ ]
401
+ });
402
+ return;
403
+ }
404
+ set_validate({
405
+ ok: true,
406
+ notice: [
407
+ ...sysDefaultNotice,
408
+ ...result2.notice
409
+ ]
410
+ });
411
+ });
412
+ if (params.onValidate) {
413
+ if (val_status.eventType == "refresh") {
414
+ FN();
415
+ } else {
416
+ $$.interval.standBy(
417
+ "ValidationTimer-" + val_status.componentID,
418
+ 450,
419
+ FN
420
+ );
421
+ }
422
+ } else {
423
+ set_validate({
424
+ ok: true,
425
+ notice: sysDefaultNotice
426
+ });
427
+ }
428
+ };
429
+ const SubmitForm = (event) => {
430
+ let input = event.target;
431
+ let { form, formName } = input.dataset;
432
+ form = formName || form;
433
+ let complete = false;
434
+ let Button2 = $$fromRoot(`[data-form-submit-button="${form}"]`)[0];
435
+ if (!Button2)
436
+ return complete;
437
+ let gestures = Button2.dataset.sdfike || "";
438
+ let key = event.key;
439
+ let auxKey = event.ctrlKey || event.metaKey;
440
+ $$.scope(() => {
441
+ if (gestures.includes("enter")) {
442
+ if (key != "Enter")
443
+ return;
444
+ let isComposing = event.nativeEvent.isComposing;
445
+ if (isComposing)
446
+ return;
447
+ if (Config.get().browserIs == "safari") {
448
+ if (event.keyCode == 229)
449
+ return;
450
+ }
451
+ }
452
+ if (key == "Enter" && (gestures.includes("enter") || gestures.includes("auxEnter") && auxKey) || key == " " && gestures.includes("space")) {
453
+ Button2.click();
454
+ event.preventDefault();
455
+ }
456
+ complete = true;
457
+ });
458
+ return complete;
459
+ };
460
+ const DefaultStyles = {
461
+ Input: (type) => {
462
+ if (type == "plain")
463
+ return {};
464
+ let Styles = {
465
+ padding: "3/4",
466
+ transition: "middle",
467
+ flexSizing: "auto",
468
+ boxShadow: "0.thin"
469
+ };
470
+ if (type == "border") {
471
+ Styles = __spreadProps(__spreadValues({}, Styles), {
472
+ border: true,
473
+ borderRadius: "2.tone.secondary",
474
+ backgroundColor: "1.layer.base"
475
+ });
476
+ } else if (type == "cloud") {
477
+ Styles = __spreadProps(__spreadValues({}, Styles), {
478
+ border: "1.thin",
479
+ borderRadius: "2.tone.secondary",
480
+ backgroundColor: "cloud"
481
+ });
482
+ } else if (type == "bottomBorder") {
483
+ Styles = __spreadProps(__spreadValues({}, Styles), {
484
+ borderRadius: 0,
485
+ border: "unset",
486
+ borderBottom: true,
487
+ backgroundColor: "cloud"
488
+ });
489
+ }
490
+ return Styles;
491
+ },
492
+ ListCell: (params) => {
493
+ params = __spreadValues({}, params);
494
+ if (!params.tone)
495
+ params.tone = "border";
496
+ let { tone } = params;
497
+ if (tone == "plain") {
498
+ } else {
499
+ params = __spreadProps(__spreadValues({}, params), {
500
+ cellStyles: __spreadValues({
501
+ position: "relative",
502
+ padding: ["3/4", 1],
503
+ borderRadius: "2.tone.secondary",
504
+ transition: "middle"
505
+ }, params.cellStyles)
506
+ });
507
+ if (tone == "normal") {
508
+ params = __spreadProps(__spreadValues({
509
+ gap: "1/2"
510
+ }, params), {
511
+ cellStyles: __spreadValues({
512
+ isSemiBoldFont: true
513
+ }, params.cellStyles),
514
+ cellCheckedStyles: {
515
+ backgroundColor: "cloud"
516
+ }
517
+ });
518
+ } else {
519
+ params = __spreadProps(__spreadValues({
520
+ gap: "3/4"
521
+ }, params), {
522
+ cellStyles: __spreadValues({
523
+ boxShadow: "0.thin"
524
+ }, params.cellStyles)
525
+ });
526
+ if (tone == "cloud" || tone == "vivid") {
527
+ params.cellStyles = __spreadValues({
528
+ border: "1.thin",
529
+ backgroundColor: "2.layer.cloud"
530
+ }, params.cellStyles);
531
+ }
532
+ if (tone == "border") {
533
+ params.cellStyles = __spreadValues({
534
+ border: true,
535
+ backgroundColor: "1.layer.base"
536
+ }, params.cellStyles);
537
+ params.cellCheckedStyles = __spreadValues({
538
+ borderColor: "theme",
539
+ fontColor: "theme"
540
+ }, params.cellCheckedStyles);
541
+ } else if (tone == "cloud") {
542
+ params.cellCheckedStyles = __spreadValues({
543
+ backgroundColor: "tcOpFew",
544
+ fontColor: "theme",
545
+ borderColor: "theme"
546
+ }, params.cellCheckedStyles);
547
+ } else if (tone == "vivid") {
548
+ params.cellCheckedStyles = __spreadValues({
549
+ backgroundColor: "theme",
550
+ fontColor: "white",
551
+ borderColor: "theme"
552
+ }, params.cellCheckedStyles);
553
+ }
554
+ }
555
+ }
556
+ return GenerateClassName(params);
557
+ },
558
+ Boxish: (params) => {
559
+ params = __spreadValues({}, params);
560
+ if (!params.tone)
561
+ params.tone = "border";
562
+ let Styles = __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, DefaultStyles.Input(params.tone)), {
563
+ fontColor: "2.normal"
564
+ }), params), !!params.leftIndicator && {
565
+ borderTopLeftRadius: "2/3",
566
+ borderBottomLeftRadius: "2/3",
567
+ marginLeft: "1/4"
568
+ }), !!params.rightIndicator && {
569
+ borderTopRightRadius: "2/3",
570
+ borderBottomRightRadius: "2/3",
571
+ marginRight: "1/4"
572
+ }), {
573
+ className: [
574
+ InputClasses("Input"),
575
+ params.className
576
+ ].join(" ")
577
+ });
578
+ return GenerateClassName(Styles);
579
+ },
580
+ Indicator: (type) => {
581
+ if (!type)
582
+ type = "border";
583
+ if (type == "plain")
584
+ return {};
585
+ let styles = {
586
+ flexSizing: "none",
587
+ flexCenter: true,
588
+ padding: [0, 1],
589
+ borderRadius: "2.tone.secondary",
590
+ backgroundColor: "cloud"
591
+ };
592
+ if (type == "border") {
593
+ styles = __spreadProps(__spreadValues({}, styles), {
594
+ border: true
595
+ });
596
+ } else if (type == "cloud") {
597
+ styles = __spreadProps(__spreadValues({}, styles), {
598
+ border: "1.thin"
599
+ });
600
+ } else if (type == "bottomBorder") {
601
+ styles = __spreadProps(__spreadValues({}, styles), {
602
+ borderRadius: 0,
603
+ borderBottom: true
604
+ });
605
+ }
606
+ return styles;
607
+ },
608
+ IndicatorIcon: {
609
+ position: "absolute",
610
+ unitWidth: 2,
611
+ unitHeight: 2,
612
+ top: "50%",
613
+ flexCenter: true,
614
+ fontColor: "theme",
615
+ fontSize: "1.mini",
616
+ backgroundColor: "inherit"
617
+ }
618
+ };
619
+ export {
620
+ BoxWrapper,
621
+ CommonEffects,
622
+ DefaultStyles,
623
+ SubmitForm,
624
+ ValidationCheck,
625
+ Wrapper
626
+ };