amotify 0.1.32 → 0.1.34

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 (98) hide show
  1. package/dist/@declaration/_.js +1 -1
  2. package/dist/@declaration/property.d.ts +2 -2
  3. package/dist/@styles/componentClasses/_.css +66 -65
  4. package/dist/@styles/componentClasses/_.js +39 -39
  5. package/dist/@styles/index.css +66 -65
  6. package/dist/@styles/index.js +39 -39
  7. package/dist/@styles/init.css +1 -1
  8. package/dist/@styles/style.css +96 -65
  9. package/dist/@styles/style.js +39 -39
  10. package/dist/@styles/var.css +1 -1
  11. package/dist/@utils/GenerateClassName.js +1 -470
  12. package/dist/@utils/LaunchReactApp.d.ts +1 -1
  13. package/dist/@utils/LaunchReactApp.js +1 -78
  14. package/dist/@utils/_.js +1 -12
  15. package/dist/@utils/collectForm.js +1 -96
  16. package/dist/@utils/color.js +1 -103
  17. package/dist/@utils/config.js +1 -101
  18. package/dist/@utils/fin.js +1 -39
  19. package/dist/@utils/getElement.js +1 -13
  20. package/dist/@utils/jsminEx.js +1 -172
  21. package/dist/@utils/pageTransit.js +1 -33
  22. package/dist/@utils/useRecycle.js +1 -44
  23. package/dist/@utils/useStore.js +1 -54
  24. package/dist/atoms/Box.js +1 -20
  25. package/dist/atoms/FAI.js +1 -148
  26. package/dist/atoms/Flex.js +1 -34
  27. package/dist/atoms/Grid.js +1 -17
  28. package/dist/atoms/Img.js +1 -65
  29. package/dist/atoms/Logo.js +51 -359
  30. package/dist/atoms/P.js +1 -20
  31. package/dist/atoms/Placeholder.js +1 -44
  32. package/dist/atoms/Span.js +1 -20
  33. package/dist/atoms/_.js +1 -9
  34. package/dist/fn/Button.js +1 -316
  35. package/dist/fn/Cropper.js +1 -1009
  36. package/dist/fn/Effect/Fade.js +1 -88
  37. package/dist/fn/Effect/Pudding.js +1 -22
  38. package/dist/fn/Effect/Ripple.js +3 -117
  39. package/dist/fn/Effect/_.js +1 -14
  40. package/dist/fn/Input/AutoHeightText.js +1 -112
  41. package/dist/fn/Input/Checker.js +1 -36
  42. package/dist/fn/Input/Chips/Selector.js +1 -472
  43. package/dist/fn/Input/Chips/_.js +1 -349
  44. package/dist/fn/Input/Contenteditable.js +1 -160
  45. package/dist/fn/Input/DigitCharacters.js +1 -275
  46. package/dist/fn/Input/Filer.js +1 -619
  47. package/dist/fn/Input/Hidden.js +1 -48
  48. package/dist/fn/Input/List.js +1 -450
  49. package/dist/fn/Input/Parts.js +1 -121
  50. package/dist/fn/Input/Plain.js +1 -12
  51. package/dist/fn/Input/RichSelect.js +1 -279
  52. package/dist/fn/Input/Search.js +1 -53
  53. package/dist/fn/Input/Segmented.js +1 -245
  54. package/dist/fn/Input/Select.js +1 -278
  55. package/dist/fn/Input/Slider.js +1 -538
  56. package/dist/fn/Input/Switch.js +1 -221
  57. package/dist/fn/Input/Text.js +1 -626
  58. package/dist/fn/Input/TextArea.js +1 -151
  59. package/dist/fn/Input/Time/Picker.js +1 -1457
  60. package/dist/fn/Input/Time/_.js +1 -867
  61. package/dist/fn/Input/_.js +1 -48
  62. package/dist/fn/Input/core.js +1 -626
  63. package/dist/fn/Layout/PageNotFound.js +1 -90
  64. package/dist/fn/Layout/PageRouter.js +1 -87
  65. package/dist/fn/Layout/PageViewController.js +1 -29
  66. package/dist/fn/Layout/Plate.js +1 -37
  67. package/dist/fn/Layout/RootViewController.js +1 -315
  68. package/dist/fn/Layout/SwipeView.js +1 -348
  69. package/dist/fn/Layout/TabBar.js +1 -72
  70. package/dist/fn/Layout/_.js +1 -22
  71. package/dist/fn/Loader/_.js +1 -104
  72. package/dist/fn/Loader/corner.js +1 -85
  73. package/dist/fn/Loader/mini.js +1 -125
  74. package/dist/fn/Loader/top.js +1 -73
  75. package/dist/fn/Sheet.d.ts +1 -0
  76. package/dist/fn/Sheet.js +1 -1101
  77. package/dist/fn/Snackbar.js +1 -216
  78. package/dist/fn/Table/Data.js +1 -974
  79. package/dist/fn/Table/Drag.js +1 -435
  80. package/dist/fn/Table/Normal.js +1 -136
  81. package/dist/fn/Table/Parts.js +1 -41
  82. package/dist/fn/Table/Wrapper.js +1 -60
  83. package/dist/fn/Table/_.js +1 -16
  84. package/dist/fn/Table/cellStyling.js +1 -51
  85. package/dist/fn/Tooltips.js +1 -58
  86. package/dist/fn/_.js +1 -10
  87. package/dist/index.js +1 -20
  88. package/dist/mols/Accordion.js +1 -152
  89. package/dist/mols/Column.js +1 -16
  90. package/dist/mols/LinkifyText.js +1 -42
  91. package/dist/mols/List.js +1 -42
  92. package/dist/mols/Row.js +1 -47
  93. package/dist/mols/Text.js +1 -67
  94. package/dist/mols/_.js +1 -6
  95. package/dist/temps/_.js +1 -1
  96. package/dist/temps/designBook.js +20 -3639
  97. package/package.json +1 -1
  98. package/dist/chunk-JJ3PEWPN.js +0 -60
@@ -1,275 +1 @@
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
- };
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};