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.
- package/dist/@declaration/_.js +1 -1
- package/dist/@styles/componentClasses/_.css +68 -65
- package/dist/@styles/componentClasses/_.js +39 -39
- package/dist/@styles/index.css +68 -65
- package/dist/@styles/index.js +39 -39
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +68 -65
- package/dist/@styles/style.js +39 -39
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.js +470 -1
- package/dist/@utils/LaunchReactApp.js +78 -1
- package/dist/@utils/_.js +12 -1
- package/dist/@utils/collectForm.js +96 -1
- package/dist/@utils/color.js +103 -1
- package/dist/@utils/config.js +101 -1
- package/dist/@utils/fin.js +39 -1
- package/dist/@utils/getElement.js +13 -1
- package/dist/@utils/jsminEx.js +172 -1
- package/dist/@utils/pageTransit.js +33 -1
- package/dist/@utils/useRecycle.js +44 -1
- package/dist/@utils/useStore.js +54 -1
- package/dist/atoms/Box.js +20 -1
- package/dist/atoms/FAI.js +148 -1
- package/dist/atoms/Flex.js +34 -1
- package/dist/atoms/Grid.js +17 -1
- package/dist/atoms/Img.js +65 -1
- package/dist/atoms/Logo.js +359 -51
- package/dist/atoms/P.js +20 -1
- package/dist/atoms/Placeholder.js +44 -1
- package/dist/atoms/Span.js +20 -1
- package/dist/atoms/_.js +9 -1
- package/dist/chunk-JJ3PEWPN.js +60 -0
- package/dist/fn/Button.js +316 -1
- package/dist/fn/Cropper.js +1009 -1
- package/dist/fn/Effect/Fade.js +88 -1
- package/dist/fn/Effect/Pudding.js +22 -1
- package/dist/fn/Effect/Ripple.js +117 -3
- package/dist/fn/Effect/_.js +14 -1
- package/dist/fn/Input/AutoHeightText.js +112 -1
- package/dist/fn/Input/Checker.js +36 -1
- package/dist/fn/Input/Chips/Selector.js +472 -1
- package/dist/fn/Input/Chips/_.js +349 -1
- package/dist/fn/Input/Contenteditable.js +160 -1
- package/dist/fn/Input/DigitCharacters.js +275 -1
- package/dist/fn/Input/Filer.js +619 -1
- package/dist/fn/Input/Hidden.js +48 -1
- package/dist/fn/Input/List.js +450 -1
- package/dist/fn/Input/Parts.js +121 -1
- package/dist/fn/Input/Plain.js +12 -1
- package/dist/fn/Input/RichSelect.js +279 -1
- package/dist/fn/Input/Search.js +53 -1
- package/dist/fn/Input/Segmented.js +245 -1
- package/dist/fn/Input/Select.js +278 -1
- package/dist/fn/Input/Slider.js +538 -1
- package/dist/fn/Input/Switch.js +221 -1
- package/dist/fn/Input/Text.js +626 -1
- package/dist/fn/Input/TextArea.js +151 -1
- package/dist/fn/Input/Time/Picker.js +1457 -1
- package/dist/fn/Input/Time/_.js +867 -1
- package/dist/fn/Input/_.js +48 -1
- package/dist/fn/Input/core.js +626 -1
- package/dist/fn/Layout/PageNotFound.js +90 -1
- package/dist/fn/Layout/PageRouter.js +87 -1
- package/dist/fn/Layout/PageViewController.js +29 -1
- package/dist/fn/Layout/Plate.js +37 -1
- package/dist/fn/Layout/RootViewController.js +315 -1
- package/dist/fn/Layout/SwipeView.js +348 -1
- package/dist/fn/Layout/TabBar.js +72 -1
- package/dist/fn/Layout/_.js +22 -1
- package/dist/fn/Loader/_.js +104 -1
- package/dist/fn/Loader/corner.js +85 -1
- package/dist/fn/Loader/mini.js +125 -1
- package/dist/fn/Loader/top.js +73 -1
- package/dist/fn/Sheet.js +1101 -1
- package/dist/fn/Snackbar.js +216 -1
- package/dist/fn/Table/Data.js +974 -1
- package/dist/fn/Table/Drag.js +435 -1
- package/dist/fn/Table/Normal.js +136 -1
- package/dist/fn/Table/Parts.js +41 -1
- package/dist/fn/Table/Wrapper.js +60 -1
- package/dist/fn/Table/_.js +16 -1
- package/dist/fn/Table/cellStyling.js +51 -1
- package/dist/fn/Tooltips.js +58 -1
- package/dist/fn/_.js +10 -1
- package/dist/index.js +20 -1
- package/dist/mols/Accordion.js +152 -1
- package/dist/mols/Column.js +16 -1
- package/dist/mols/LinkifyText.js +42 -1
- package/dist/mols/List.js +42 -1
- package/dist/mols/Row.js +47 -1
- package/dist/mols/Text.js +67 -1
- package/dist/mols/_.js +6 -1
- package/dist/temps/_.js +1 -1
- package/dist/temps/designBook.js +3639 -20
- package/package.json +1 -1
package/dist/fn/Input/_.js
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
import"../../chunk-
|
|
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
|
+
};
|
package/dist/fn/Input/core.js
CHANGED
|
@@ -1 +1,626 @@
|
|
|
1
|
-
import
|
|
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
|
+
};
|