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,275 @@
1
- import{b as t,c as s,d as S}from"../../chunk-VY3566IV.js";import{jsx as I,jsxs as Z}from"react/jsx-runtime";import{useState as V}from"react";import{$$ as y,$$fromRoot as O}from"../../@utils/_";import{Wrapper as q,BoxWrapper as w,SubmitForm as U,CommonEffects as j,DefaultStyles as z}from"./core";import G from"../../atoms/Flex";import J from"./Hidden";import{InputClasses as R}from"../../@styles/componentClasses/_";function Q(e){let{value:n,params:u}=e,{required:p,numericOnly:l=!1,digits:m}=u,r=[];return p&&!n&&r.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),n&&(l&&n.match(/\D/)&&r.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n.length!=m&&r.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!r.filter(({type:d})=>d=="invalid"||d=="warn").length,notice:r}}const X=(e,n="")=>{let u=String(n),p=[];for(let l=0;l<e;l++)p[l]=u[l]||"";return{formatValue:p,dataValue:u}},F=(e="")=>{let n=e,u=n.join("");return{formatValue:n,dataValue:u}},Y=e=>{let b=e,{tone:n,required:u,form:p,name:l,className:m="",digits:r,numericOnly:d=!1,enableFormSubmit:_,checkValidationAtFirst:P,onChange:ee,onKeyDown:te,onValidate:ne,onUpdateValue:k,onUpdateValidValue:A,value:N="",override:ie,componentID:ae,listStyles:B}=b,E=S(b,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","override","componentID","listStyles"]);d&&(e.inputMode=e.inputMode||"numeric");let H=s(t({componentID:e.componentID||""},X(r,N)),{eventType:"init",eventID:y.uuid.gen()}),[i,f]=V(H),[h,L]=V({ok:!1,notice:[]});j({params:e,val_status:i,set_status:f,val_validate:h,set_validate:L,onUpdateValue:k,onUpdateValidValue:A,DefaultValidation:Q});let v=[];for(let a=0;a<r;a++){let W=i.formatValue[a],$={},x=m;e.combineInput&&(x=[m,R("DigitCharacterCell"),R("Combined")].join(" ")),v.push(I("input",{type:"text",inputMode:e.inputMode||"text",value:W,"data-form-name":p,id:"Digit-"+a+"-"+i.componentID,className:x,style:t(t({},e.style),$),onKeyDown:D=>{let{key:g,code:K}=D;if(g=="Tab")return;D.preventDefault();let c=null;if(g=="Backspace"){let o=i.formatValue;o[a]="",f(s(t(t({},i),F(o)),{eventType:"update",eventID:y.uuid.gen()})),c=a-1}else if(["ArrowLeft","ArrowRight"].includes(g)){let o=+(g=="ArrowRight")*2-1;c=a+o}else _&&U(D),(()=>{let o=K.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!o)return;let C=o[2]||o[3]||o[4];if(d&&!C.match(/\d/)||!C)return;let T=i.formatValue;T[a]=C,f(s(t(t({},i),F(T)),{eventType:"update",eventID:y.uuid.gen()})),c=a+1})();y.is.exist(c)&&O("#Digit-"+c+"-"+i.componentID).focus()},onChange:()=>{}},a))}return Z(w,{val_status:i,set_status:f,val_validate:h,params:e,children:[I(J,t({name:l,"data-input-type":"digitCharacters","data-form":p,"data-validation":h.ok,componentID:i.componentID,"data-value":i.dataValue},E)),I(G,s(t({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},B),{children:v}))]})},M=e=>{e=t({},e),e=t({textAlign:"center",width:0},e),e.combineInput&&(e=s(t({textAlign:"center",width:0},e),{freeCSS:t({minWidth:12*2,marginRight:-1},e.freeCSS),listStyles:t({borderRadius:"2.tone.secondary",border:"unset",gap:0},e.listStyles)}));let n=z.Boxish(e);return I(q,{componentID:e.componentID,children:Y,params:n})};export{M as DigitCharacters,M as default};
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import {
8
+ useState
9
+ } from "react";
10
+ import {
11
+ $$,
12
+ $$fromRoot
13
+ } from "../../@utils/_";
14
+ import {
15
+ Wrapper,
16
+ BoxWrapper,
17
+ SubmitForm,
18
+ CommonEffects,
19
+ DefaultStyles
20
+ } from "./core";
21
+ import Flex from "../../atoms/Flex";
22
+ import Hidden from "./Hidden";
23
+ import { InputClasses } from "../../@styles/componentClasses/_";
24
+ function DefaultValidation(props) {
25
+ let { value, params } = props;
26
+ let {
27
+ required,
28
+ numericOnly = false,
29
+ digits
30
+ } = params;
31
+ let notice = [];
32
+ if (required && !value) {
33
+ notice.push({ type: "invalid", label: "\u5FC5\u9808\u9805\u76EE\u3067\u3059" });
34
+ }
35
+ if (value) {
36
+ if (numericOnly && value.match(/\D/)) {
37
+ notice.push({ type: "invalid", label: "\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044" });
38
+ }
39
+ if (value.length != digits) {
40
+ notice.push({ type: "warn", label: "\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044" });
41
+ }
42
+ }
43
+ return {
44
+ ok: !notice.filter(({ type }) => type == "invalid" || type == "warn").length,
45
+ notice
46
+ };
47
+ }
48
+ const dataToFormat = (digits, value = "") => {
49
+ let dataValue = String(value);
50
+ let formatValue = [];
51
+ for (let index = 0; index < digits; index++) {
52
+ formatValue[index] = dataValue[index] || "";
53
+ }
54
+ return {
55
+ formatValue,
56
+ dataValue
57
+ };
58
+ };
59
+ const formatToData = (value = "") => {
60
+ let formatValue = value;
61
+ let dataValue = formatValue.join("");
62
+ return {
63
+ formatValue,
64
+ dataValue
65
+ };
66
+ };
67
+ const DigitCharactersInput = (params) => {
68
+ let _a = params, {
69
+ tone,
70
+ required,
71
+ form,
72
+ name,
73
+ className = "",
74
+ digits,
75
+ numericOnly = false,
76
+ enableFormSubmit,
77
+ checkValidationAtFirst,
78
+ onChange,
79
+ onKeyDown,
80
+ onValidate,
81
+ onUpdateValue,
82
+ onUpdateValidValue,
83
+ value = "",
84
+ override,
85
+ componentID,
86
+ listStyles
87
+ } = _a, others = __objRest(_a, [
88
+ "tone",
89
+ "required",
90
+ "form",
91
+ "name",
92
+ "className",
93
+ "digits",
94
+ "numericOnly",
95
+ "enableFormSubmit",
96
+ "checkValidationAtFirst",
97
+ "onChange",
98
+ "onKeyDown",
99
+ "onValidate",
100
+ "onUpdateValue",
101
+ "onUpdateValidValue",
102
+ "value",
103
+ "override",
104
+ "componentID",
105
+ "listStyles"
106
+ ]);
107
+ if (numericOnly) {
108
+ params.inputMode = params.inputMode || "numeric";
109
+ }
110
+ let Default_Status = __spreadProps(__spreadValues({
111
+ componentID: params.componentID || ""
112
+ }, dataToFormat(digits, value)), {
113
+ eventType: "init",
114
+ eventID: $$.uuid.gen()
115
+ });
116
+ let [val_status, set_status] = useState(Default_Status);
117
+ let [val_validate, set_validate] = useState({
118
+ ok: false,
119
+ notice: []
120
+ });
121
+ CommonEffects({
122
+ params,
123
+ val_status,
124
+ set_status,
125
+ val_validate,
126
+ set_validate,
127
+ onUpdateValue,
128
+ onUpdateValidValue,
129
+ DefaultValidation
130
+ });
131
+ let Digits = [];
132
+ for (let index = 0; index < digits; index++) {
133
+ let Character = val_status.formatValue[index];
134
+ let Styles = {};
135
+ let ClassName = className;
136
+ if (params.combineInput) {
137
+ ClassName = [
138
+ className,
139
+ InputClasses("DigitCharacterCell"),
140
+ InputClasses("Combined")
141
+ ].join(" ");
142
+ }
143
+ Digits.push(/* @__PURE__ */ jsx(
144
+ "input",
145
+ {
146
+ type: "text",
147
+ inputMode: params.inputMode || "text",
148
+ value: Character,
149
+ "data-form-name": form,
150
+ id: "Digit-" + index + "-" + val_status.componentID,
151
+ className: ClassName,
152
+ style: __spreadValues(__spreadValues({}, params.style), Styles),
153
+ onKeyDown: (event) => {
154
+ let {
155
+ key,
156
+ code
157
+ } = event;
158
+ if (key == "Tab")
159
+ return;
160
+ event.preventDefault();
161
+ let nextFocusIndex = null;
162
+ if (key == "Backspace") {
163
+ let newFormatValue = val_status.formatValue;
164
+ newFormatValue[index] = "";
165
+ set_status(__spreadProps(__spreadValues(__spreadValues({}, val_status), formatToData(newFormatValue)), {
166
+ eventType: "update",
167
+ eventID: $$.uuid.gen()
168
+ }));
169
+ nextFocusIndex = index - 1;
170
+ } else if (["ArrowLeft", "ArrowRight"].includes(key)) {
171
+ let dir = Number(key == "ArrowRight") * 2 - 1;
172
+ nextFocusIndex = index + dir;
173
+ } else {
174
+ if (enableFormSubmit)
175
+ SubmitForm(event);
176
+ (() => {
177
+ let regExp = code.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);
178
+ if (!regExp)
179
+ return;
180
+ let newCharacter = regExp[2] || regExp[3] || regExp[4];
181
+ if (numericOnly) {
182
+ if (!newCharacter.match(/\d/))
183
+ return;
184
+ }
185
+ if (!newCharacter)
186
+ return;
187
+ let newFormatValue = val_status.formatValue;
188
+ newFormatValue[index] = newCharacter;
189
+ set_status(__spreadProps(__spreadValues(__spreadValues({}, val_status), formatToData(newFormatValue)), {
190
+ eventType: "update",
191
+ eventID: $$.uuid.gen()
192
+ }));
193
+ nextFocusIndex = index + 1;
194
+ })();
195
+ }
196
+ if ($$.is.exist(nextFocusIndex)) {
197
+ $$fromRoot("#Digit-" + nextFocusIndex + "-" + val_status.componentID).focus();
198
+ }
199
+ },
200
+ onChange: () => {
201
+ }
202
+ },
203
+ index
204
+ ));
205
+ }
206
+ return /* @__PURE__ */ jsxs(
207
+ BoxWrapper,
208
+ {
209
+ val_status,
210
+ set_status,
211
+ val_validate,
212
+ params,
213
+ children: [
214
+ /* @__PURE__ */ jsx(
215
+ Hidden,
216
+ __spreadValues({
217
+ name,
218
+ "data-input-type": "digitCharacters",
219
+ "data-form": form,
220
+ "data-validation": val_validate.ok,
221
+ componentID: val_status.componentID,
222
+ "data-value": val_status.dataValue
223
+ }, others)
224
+ ),
225
+ /* @__PURE__ */ jsx(
226
+ Flex,
227
+ __spreadProps(__spreadValues({
228
+ gap: "1/2",
229
+ flexChilds: "even",
230
+ flexWrap: false,
231
+ flexSizing: "auto"
232
+ }, listStyles), {
233
+ children: Digits
234
+ })
235
+ )
236
+ ]
237
+ }
238
+ );
239
+ };
240
+ const DigitCharacters = (rawParams) => {
241
+ rawParams = __spreadValues({}, rawParams);
242
+ rawParams = __spreadValues({
243
+ textAlign: "center",
244
+ width: 0
245
+ }, rawParams);
246
+ if (rawParams.combineInput) {
247
+ rawParams = __spreadProps(__spreadValues({
248
+ textAlign: "center",
249
+ width: 0
250
+ }, rawParams), {
251
+ freeCSS: __spreadValues({
252
+ minWidth: 12 * 2,
253
+ marginRight: -1
254
+ }, rawParams.freeCSS),
255
+ listStyles: __spreadValues({
256
+ borderRadius: "2.tone.secondary",
257
+ border: "unset",
258
+ gap: 0
259
+ }, rawParams.listStyles)
260
+ });
261
+ }
262
+ let params = DefaultStyles.Boxish(rawParams);
263
+ return /* @__PURE__ */ jsx(
264
+ Wrapper,
265
+ {
266
+ componentID: rawParams.componentID,
267
+ children: DigitCharactersInput,
268
+ params
269
+ }
270
+ );
271
+ };
272
+ export {
273
+ DigitCharacters,
274
+ DigitCharacters as default
275
+ };