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.
- package/dist/@declaration/_.js +1 -1
- package/dist/@declaration/property.d.ts +2 -2
- package/dist/@styles/componentClasses/_.css +66 -65
- package/dist/@styles/componentClasses/_.js +39 -39
- package/dist/@styles/index.css +66 -65
- package/dist/@styles/index.js +39 -39
- package/dist/@styles/init.css +1 -1
- package/dist/@styles/style.css +96 -65
- package/dist/@styles/style.js +39 -39
- package/dist/@styles/var.css +1 -1
- package/dist/@utils/GenerateClassName.js +1 -470
- package/dist/@utils/LaunchReactApp.d.ts +1 -1
- package/dist/@utils/LaunchReactApp.js +1 -78
- package/dist/@utils/_.js +1 -12
- package/dist/@utils/collectForm.js +1 -96
- package/dist/@utils/color.js +1 -103
- package/dist/@utils/config.js +1 -101
- package/dist/@utils/fin.js +1 -39
- package/dist/@utils/getElement.js +1 -13
- package/dist/@utils/jsminEx.js +1 -172
- package/dist/@utils/pageTransit.js +1 -33
- package/dist/@utils/useRecycle.js +1 -44
- package/dist/@utils/useStore.js +1 -54
- package/dist/atoms/Box.js +1 -20
- package/dist/atoms/FAI.js +1 -148
- package/dist/atoms/Flex.js +1 -34
- package/dist/atoms/Grid.js +1 -17
- package/dist/atoms/Img.js +1 -65
- package/dist/atoms/Logo.js +51 -359
- package/dist/atoms/P.js +1 -20
- package/dist/atoms/Placeholder.js +1 -44
- package/dist/atoms/Span.js +1 -20
- package/dist/atoms/_.js +1 -9
- package/dist/fn/Button.js +1 -316
- package/dist/fn/Cropper.js +1 -1009
- package/dist/fn/Effect/Fade.js +1 -88
- package/dist/fn/Effect/Pudding.js +1 -22
- package/dist/fn/Effect/Ripple.js +3 -117
- package/dist/fn/Effect/_.js +1 -14
- package/dist/fn/Input/AutoHeightText.js +1 -112
- package/dist/fn/Input/Checker.js +1 -36
- package/dist/fn/Input/Chips/Selector.js +1 -472
- package/dist/fn/Input/Chips/_.js +1 -349
- package/dist/fn/Input/Contenteditable.js +1 -160
- package/dist/fn/Input/DigitCharacters.js +1 -275
- package/dist/fn/Input/Filer.js +1 -619
- package/dist/fn/Input/Hidden.js +1 -48
- package/dist/fn/Input/List.js +1 -450
- package/dist/fn/Input/Parts.js +1 -121
- package/dist/fn/Input/Plain.js +1 -12
- package/dist/fn/Input/RichSelect.js +1 -279
- package/dist/fn/Input/Search.js +1 -53
- package/dist/fn/Input/Segmented.js +1 -245
- package/dist/fn/Input/Select.js +1 -278
- package/dist/fn/Input/Slider.js +1 -538
- package/dist/fn/Input/Switch.js +1 -221
- package/dist/fn/Input/Text.js +1 -626
- package/dist/fn/Input/TextArea.js +1 -151
- package/dist/fn/Input/Time/Picker.js +1 -1457
- package/dist/fn/Input/Time/_.js +1 -867
- package/dist/fn/Input/_.js +1 -48
- package/dist/fn/Input/core.js +1 -626
- package/dist/fn/Layout/PageNotFound.js +1 -90
- package/dist/fn/Layout/PageRouter.js +1 -87
- package/dist/fn/Layout/PageViewController.js +1 -29
- package/dist/fn/Layout/Plate.js +1 -37
- package/dist/fn/Layout/RootViewController.js +1 -315
- package/dist/fn/Layout/SwipeView.js +1 -348
- package/dist/fn/Layout/TabBar.js +1 -72
- package/dist/fn/Layout/_.js +1 -22
- package/dist/fn/Loader/_.js +1 -104
- package/dist/fn/Loader/corner.js +1 -85
- package/dist/fn/Loader/mini.js +1 -125
- package/dist/fn/Loader/top.js +1 -73
- package/dist/fn/Sheet.d.ts +1 -0
- package/dist/fn/Sheet.js +1 -1101
- package/dist/fn/Snackbar.js +1 -216
- package/dist/fn/Table/Data.js +1 -974
- package/dist/fn/Table/Drag.js +1 -435
- package/dist/fn/Table/Normal.js +1 -136
- package/dist/fn/Table/Parts.js +1 -41
- package/dist/fn/Table/Wrapper.js +1 -60
- package/dist/fn/Table/_.js +1 -16
- package/dist/fn/Table/cellStyling.js +1 -51
- package/dist/fn/Tooltips.js +1 -58
- package/dist/fn/_.js +1 -10
- package/dist/index.js +1 -20
- package/dist/mols/Accordion.js +1 -152
- package/dist/mols/Column.js +1 -16
- package/dist/mols/LinkifyText.js +1 -42
- package/dist/mols/List.js +1 -42
- package/dist/mols/Row.js +1 -47
- package/dist/mols/Text.js +1 -67
- package/dist/mols/_.js +1 -6
- package/dist/temps/_.js +1 -1
- package/dist/temps/designBook.js +20 -3639
- package/package.json +1 -1
- package/dist/chunk-JJ3PEWPN.js +0 -60
package/dist/fn/Sheet.js
CHANGED
|
@@ -1,1101 +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
|
-
useEffect,
|
|
10
|
-
useRef
|
|
11
|
-
} from "react";
|
|
12
|
-
import {
|
|
13
|
-
$$,
|
|
14
|
-
$$fromRoot,
|
|
15
|
-
Config,
|
|
16
|
-
useStore
|
|
17
|
-
} from "../@utils/_";
|
|
18
|
-
import Box from "../atoms/Box";
|
|
19
|
-
import Img from "../atoms/Img";
|
|
20
|
-
import FAI from "../atoms/FAI";
|
|
21
|
-
import Flex from "../atoms/Flex";
|
|
22
|
-
import Column from "../mols/Column";
|
|
23
|
-
import Row from "../mols/Row";
|
|
24
|
-
import Button from "./Button";
|
|
25
|
-
import Layout from "./Layout/_";
|
|
26
|
-
import Input from "./Input/_";
|
|
27
|
-
import { SheetClasses } from "../@styles/componentClasses/_";
|
|
28
|
-
const Comps = {
|
|
29
|
-
mainSheetScrolls: 0,
|
|
30
|
-
subSheetLength: 0,
|
|
31
|
-
currentIndex: 0,
|
|
32
|
-
contents: {},
|
|
33
|
-
addNewSheet: function(params) {
|
|
34
|
-
params = __spreadProps(__spreadValues({
|
|
35
|
-
sheetGroups: params.sheetGroups || [],
|
|
36
|
-
backgroundEffect: true,
|
|
37
|
-
overwrap: params.type == "custom" ? true : false,
|
|
38
|
-
hold_state: false,
|
|
39
|
-
isOpen: true
|
|
40
|
-
}, params), {
|
|
41
|
-
sheetID: params.sheetID || $$.uuid.gen(),
|
|
42
|
-
close_option: __spreadValues({
|
|
43
|
-
pageTransit: true,
|
|
44
|
-
escapeKeyDown: true,
|
|
45
|
-
aroundClick: params.type == "custom"
|
|
46
|
-
}, params.close_option)
|
|
47
|
-
});
|
|
48
|
-
if (this.contents[params.sheetID]) {
|
|
49
|
-
let comp = useStore.get(params.sheetID);
|
|
50
|
-
comp && comp.refresh && comp.refresh(params, true);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.contents[params.sheetID] = {
|
|
54
|
-
isOpen: true,
|
|
55
|
-
hold_state: !!params.hold_state,
|
|
56
|
-
params,
|
|
57
|
-
created_at: $$.Time()
|
|
58
|
-
};
|
|
59
|
-
let wrapper = useStore.get("Sheet-" + Config.get().sessionUID);
|
|
60
|
-
wrapper && wrapper.refresh();
|
|
61
|
-
},
|
|
62
|
-
Wrapper: () => {
|
|
63
|
-
let [val_refresh, set_refresh] = useState($$.uuid.gen());
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
useStore.set({
|
|
66
|
-
key: "Sheet-" + Config.get().sessionUID,
|
|
67
|
-
value: {
|
|
68
|
-
refresh: () => {
|
|
69
|
-
set_refresh($$.uuid.gen());
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
$$(Config.get().appRoot).addEvent({
|
|
74
|
-
eventType: "keyup",
|
|
75
|
-
callback: function(event) {
|
|
76
|
-
let { key, metaKey } = event;
|
|
77
|
-
if (key == "Escape" || key == "," && metaKey) {
|
|
78
|
-
let OpenSheets = Object.values(Comps.contents).filter((elm) => elm.isOpen);
|
|
79
|
-
if (!OpenSheets.length)
|
|
80
|
-
return;
|
|
81
|
-
let latestSheet = OpenSheets.reduce((a, b) => {
|
|
82
|
-
return a.created_at.value > b.created_at.value ? a : b;
|
|
83
|
-
});
|
|
84
|
-
Sheet.close(latestSheet.params.sheetID, key);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}).addEvent({
|
|
88
|
-
eventType: "click",
|
|
89
|
-
callback: function(event) {
|
|
90
|
-
var _a;
|
|
91
|
-
let customSheets = Object.values(Comps.contents).filter((elm) => elm.params.type == "custom");
|
|
92
|
-
if (!customSheets.length)
|
|
93
|
-
return;
|
|
94
|
-
let isParent = !!customSheets.find((customSheet) => {
|
|
95
|
-
let { params } = customSheet;
|
|
96
|
-
let parent = params.parent;
|
|
97
|
-
let target = event.target;
|
|
98
|
-
let Parent = $$fromRoot(parent)[0];
|
|
99
|
-
if (parent == target)
|
|
100
|
-
return true;
|
|
101
|
-
if (Parent === target)
|
|
102
|
-
return true;
|
|
103
|
-
if ($$(Parent).find(target).length)
|
|
104
|
-
return true;
|
|
105
|
-
return false;
|
|
106
|
-
});
|
|
107
|
-
if (isParent)
|
|
108
|
-
return;
|
|
109
|
-
if ((_a = event.target) == null ? void 0 : _a.closest("." + SheetClasses("CustomSheet")))
|
|
110
|
-
return;
|
|
111
|
-
customSheets.forEach((customSheets2) => {
|
|
112
|
-
var _a2;
|
|
113
|
-
if (!!((_a2 = customSheets2.params.close_option) == null ? void 0 : _a2.aroundClick)) {
|
|
114
|
-
Sheet.close(customSheets2.params.sheetID);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}, []);
|
|
120
|
-
let Sheets = Object.entries(Comps.contents).map(([sheetID, Sheet2]) => {
|
|
121
|
-
return /* @__PURE__ */ jsx(
|
|
122
|
-
Box,
|
|
123
|
-
{
|
|
124
|
-
id: "Sheet-" + sheetID,
|
|
125
|
-
children: /* @__PURE__ */ jsx(
|
|
126
|
-
Comps.Core,
|
|
127
|
-
__spreadValues({
|
|
128
|
-
isOpen: Sheet2.isOpen
|
|
129
|
-
}, Sheet2.params),
|
|
130
|
-
sheetID
|
|
131
|
-
)
|
|
132
|
-
},
|
|
133
|
-
sheetID
|
|
134
|
-
);
|
|
135
|
-
});
|
|
136
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
-
Box,
|
|
138
|
-
{
|
|
139
|
-
className: [
|
|
140
|
-
"AMOTIFY_be",
|
|
141
|
-
SheetClasses("Wrapper")
|
|
142
|
-
].join(" "),
|
|
143
|
-
children: Sheets
|
|
144
|
-
}
|
|
145
|
-
);
|
|
146
|
-
},
|
|
147
|
-
Core: (params) => {
|
|
148
|
-
var _a;
|
|
149
|
-
let [val_compUID] = useState($$.uuid.gen());
|
|
150
|
-
let [val_params, set_params] = useState(params);
|
|
151
|
-
let [val_open, set_open] = useState(params.isOpen);
|
|
152
|
-
let {
|
|
153
|
-
type,
|
|
154
|
-
sheetID,
|
|
155
|
-
openAfter,
|
|
156
|
-
closeAfter
|
|
157
|
-
} = val_params;
|
|
158
|
-
let isNewSheet = !val_params.overwrap;
|
|
159
|
-
let ContentFC = Comps.Types[{
|
|
160
|
-
"normal.topLeft": "Normal",
|
|
161
|
-
"normal.topCenter": "Normal",
|
|
162
|
-
"normal.topRight": "Normal",
|
|
163
|
-
"normal.middleLeft": "Normal",
|
|
164
|
-
"normal.middleCenter": "Normal",
|
|
165
|
-
"normal.middleRight": "Normal",
|
|
166
|
-
"normal.bottomLeft": "Normal",
|
|
167
|
-
"normal.bottomCenter": "Normal",
|
|
168
|
-
"normal.bottomRight": "Normal",
|
|
169
|
-
"image": "Normal",
|
|
170
|
-
"drawer.left": "Edge",
|
|
171
|
-
"drawer.right": "Edge",
|
|
172
|
-
"drawer.bottom": "Bottom",
|
|
173
|
-
"custom": "Custom"
|
|
174
|
-
}[type]];
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
useStore.set({
|
|
177
|
-
key: sheetID,
|
|
178
|
-
value: {
|
|
179
|
-
refresh: (params2, open) => {
|
|
180
|
-
set_params(params2);
|
|
181
|
-
set_open(open != null ? open : false);
|
|
182
|
-
},
|
|
183
|
-
resize: (size) => {
|
|
184
|
-
if (type == "drawer.bottom") {
|
|
185
|
-
let comp = useStore.get(val_compUID);
|
|
186
|
-
comp && comp.resize && comp.resize(size);
|
|
187
|
-
} else if (val_params.type.includes("normal") || val_params.type.includes("drawer")) {
|
|
188
|
-
set_params(__spreadProps(__spreadValues({}, val_params), {
|
|
189
|
-
size
|
|
190
|
-
}));
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
close: (force) => {
|
|
194
|
-
Comps.contents[sheetID].isOpen = false;
|
|
195
|
-
set_open(false);
|
|
196
|
-
},
|
|
197
|
-
open: () => {
|
|
198
|
-
Comps.contents[sheetID].isOpen = true;
|
|
199
|
-
set_open(true);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
useEffect(() => {
|
|
205
|
-
$$.scope(() => {
|
|
206
|
-
if (!isNewSheet)
|
|
207
|
-
return;
|
|
208
|
-
if (!val_params.backgroundEffect)
|
|
209
|
-
return;
|
|
210
|
-
Comps.subSheetLength = Comps.subSheetLength + (val_open ? 1 : -1);
|
|
211
|
-
if (val_open) {
|
|
212
|
-
let html = $$("html");
|
|
213
|
-
if (Comps.subSheetLength == 1) {
|
|
214
|
-
let scroll = html[0].scrollTop;
|
|
215
|
-
Comps.mainSheetScrolls = scroll;
|
|
216
|
-
}
|
|
217
|
-
if (!Config.get().isPhone) {
|
|
218
|
-
html.callback(() => {
|
|
219
|
-
$$fromRoot(".AMOTIFY_be_root").addClass(SheetClasses("FixScroll")).callback((appRoot) => {
|
|
220
|
-
appRoot[0].scrollTop = Comps.mainSheetScrolls;
|
|
221
|
-
}).await(40).addClass(SheetClasses("Float"));
|
|
222
|
-
})[0].scrollTop = 0;
|
|
223
|
-
}
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (Comps.subSheetLength != 0)
|
|
227
|
-
return;
|
|
228
|
-
if (Config.get().isPhone)
|
|
229
|
-
return;
|
|
230
|
-
$$fromRoot(".AMOTIFY_be_root").removeClass(SheetClasses("Float")).await(251).removeClass(SheetClasses("FixScroll")).callback(() => {
|
|
231
|
-
$$("html")[0].scrollTop = Comps.mainSheetScrolls | 0;
|
|
232
|
-
$$fromRoot(".AMOTIFY_be_root")[0].scrollTop = 0;
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
$$.scope(() => {
|
|
236
|
-
let Core = $$fromRoot("#" + val_compUID);
|
|
237
|
-
if (val_open) {
|
|
238
|
-
Core.await(10).removeClass(SheetClasses("Hide")).await(10).addClass(SheetClasses("Open")).callback(() => {
|
|
239
|
-
Comps.contents[sheetID].isOpen = true;
|
|
240
|
-
if (openAfter)
|
|
241
|
-
openAfter();
|
|
242
|
-
});
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
Core.await(10).removeClass(SheetClasses("Open")).await(251).addClass(SheetClasses("Hide")).callback(() => {
|
|
246
|
-
!closeAfter || closeAfter();
|
|
247
|
-
Comps.contents[sheetID].isOpen = false;
|
|
248
|
-
if (val_params.hold_state)
|
|
249
|
-
return;
|
|
250
|
-
delete Comps.contents[sheetID];
|
|
251
|
-
let wrapper = useStore.get("Sheet-" + Config.get().sessionUID);
|
|
252
|
-
wrapper && wrapper.refresh();
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
}, [val_open]);
|
|
256
|
-
useEffect(() => {
|
|
257
|
-
Comps.currentIndex++;
|
|
258
|
-
let {
|
|
259
|
-
close_option
|
|
260
|
-
} = val_params;
|
|
261
|
-
$$.scope(() => {
|
|
262
|
-
if (!(close_option == null ? void 0 : close_option.parentBlur))
|
|
263
|
-
return;
|
|
264
|
-
let element = $$(val_params.parent);
|
|
265
|
-
if (!element[0])
|
|
266
|
-
return;
|
|
267
|
-
element.addEvent({
|
|
268
|
-
eventID: "SheetClosation-" + sheetID,
|
|
269
|
-
eventType: "mouseout",
|
|
270
|
-
callback: () => {
|
|
271
|
-
element.removeEvent("SheetClosation-" + sheetID);
|
|
272
|
-
set_open(false);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
}, []);
|
|
277
|
-
let [Tcate, Tpos] = type.split(".");
|
|
278
|
-
return /* @__PURE__ */ jsx(
|
|
279
|
-
Box,
|
|
280
|
-
{
|
|
281
|
-
className: [
|
|
282
|
-
SheetClasses("Wrap"),
|
|
283
|
-
SheetClasses("Tcate_" + Tcate),
|
|
284
|
-
SheetClasses("Tpos_" + Tpos),
|
|
285
|
-
SheetClasses("isNewSheet_" + isNewSheet)
|
|
286
|
-
].join(" "),
|
|
287
|
-
width: 1,
|
|
288
|
-
height: 0,
|
|
289
|
-
ssAbsoluteCovered: true,
|
|
290
|
-
freeCSS: {
|
|
291
|
-
zIndex: Comps.currentIndex + 1
|
|
292
|
-
},
|
|
293
|
-
id: val_compUID,
|
|
294
|
-
children: /* @__PURE__ */ jsxs(
|
|
295
|
-
Column,
|
|
296
|
-
{
|
|
297
|
-
className: SheetClasses("Content"),
|
|
298
|
-
gap: 0,
|
|
299
|
-
height: "viewHeight",
|
|
300
|
-
overflow: "auto",
|
|
301
|
-
transition: "middle",
|
|
302
|
-
children: [
|
|
303
|
-
!!isNewSheet && /* @__PURE__ */ jsx(
|
|
304
|
-
Comps.TapSensor,
|
|
305
|
-
{
|
|
306
|
-
sheetID,
|
|
307
|
-
delegateAroundClick: (_a = val_params.close_option) == null ? void 0 : _a.aroundClick
|
|
308
|
-
}
|
|
309
|
-
),
|
|
310
|
-
/* @__PURE__ */ jsx(
|
|
311
|
-
ContentFC,
|
|
312
|
-
__spreadValues({
|
|
313
|
-
componentID: val_compUID
|
|
314
|
-
}, val_params)
|
|
315
|
-
)
|
|
316
|
-
]
|
|
317
|
-
}
|
|
318
|
-
)
|
|
319
|
-
},
|
|
320
|
-
val_compUID
|
|
321
|
-
);
|
|
322
|
-
},
|
|
323
|
-
Types: {
|
|
324
|
-
Normal: (params) => {
|
|
325
|
-
let _a = params, {
|
|
326
|
-
sheetID,
|
|
327
|
-
sheetGroups,
|
|
328
|
-
content: Content,
|
|
329
|
-
className = "",
|
|
330
|
-
type,
|
|
331
|
-
size = "R",
|
|
332
|
-
freeCSS,
|
|
333
|
-
openAfter,
|
|
334
|
-
closeAfter,
|
|
335
|
-
close_option,
|
|
336
|
-
hold_state,
|
|
337
|
-
overwrap,
|
|
338
|
-
isOpen,
|
|
339
|
-
backgroundEffect
|
|
340
|
-
} = _a, styles = __objRest(_a, [
|
|
341
|
-
"sheetID",
|
|
342
|
-
"sheetGroups",
|
|
343
|
-
"content",
|
|
344
|
-
"className",
|
|
345
|
-
"type",
|
|
346
|
-
"size",
|
|
347
|
-
"freeCSS",
|
|
348
|
-
"openAfter",
|
|
349
|
-
"closeAfter",
|
|
350
|
-
"close_option",
|
|
351
|
-
"hold_state",
|
|
352
|
-
"overwrap",
|
|
353
|
-
"isOpen",
|
|
354
|
-
"backgroundEffect"
|
|
355
|
-
]);
|
|
356
|
-
let [Tcate, Tpos] = type.split(".");
|
|
357
|
-
let SysStyles = {};
|
|
358
|
-
let transformOrigins = [];
|
|
359
|
-
if (Tpos.match(/top/)) {
|
|
360
|
-
transformOrigins.push("top");
|
|
361
|
-
SysStyles.marginBottom = "auto";
|
|
362
|
-
} else if (Tpos.match(/middle/)) {
|
|
363
|
-
transformOrigins.push("center");
|
|
364
|
-
SysStyles.marginTop = "auto";
|
|
365
|
-
SysStyles.marginBottom = "auto";
|
|
366
|
-
} else if (Tpos.match(/bottom/)) {
|
|
367
|
-
transformOrigins.push("bottom");
|
|
368
|
-
SysStyles.marginTop = "auto";
|
|
369
|
-
}
|
|
370
|
-
if (Tpos.match(/left/i)) {
|
|
371
|
-
transformOrigins.push("left");
|
|
372
|
-
SysStyles.marginRight = "auto";
|
|
373
|
-
} else if (Tpos.match(/center/i)) {
|
|
374
|
-
transformOrigins.push("center");
|
|
375
|
-
SysStyles.marginLeft = "auto";
|
|
376
|
-
SysStyles.marginRight = "auto";
|
|
377
|
-
} else if (Tpos.match(/right/i)) {
|
|
378
|
-
transformOrigins.push("right");
|
|
379
|
-
SysStyles.marginLeft = "auto";
|
|
380
|
-
}
|
|
381
|
-
return /* @__PURE__ */ jsx(
|
|
382
|
-
Box,
|
|
383
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
384
|
-
className: [
|
|
385
|
-
SheetClasses("BB"),
|
|
386
|
-
className
|
|
387
|
-
].join(" "),
|
|
388
|
-
padding: 1,
|
|
389
|
-
transition: "long",
|
|
390
|
-
opacity: "trans"
|
|
391
|
-
}, SysStyles), styles), {
|
|
392
|
-
freeCSS: __spreadValues({
|
|
393
|
-
width: {
|
|
394
|
-
"S": "26rem",
|
|
395
|
-
"R": "36rem",
|
|
396
|
-
"L": "44rem",
|
|
397
|
-
"2L": "60rem",
|
|
398
|
-
"3L": "72rem",
|
|
399
|
-
"MAX": "100vw"
|
|
400
|
-
}[size],
|
|
401
|
-
maxWidth: "96vw",
|
|
402
|
-
transformOrigin: transformOrigins.join(" ")
|
|
403
|
-
}, freeCSS),
|
|
404
|
-
children: $$.is.function(Content) ? /* @__PURE__ */ jsx(Content, {}) : Content
|
|
405
|
-
})
|
|
406
|
-
);
|
|
407
|
-
},
|
|
408
|
-
Edge: (params) => {
|
|
409
|
-
let _a = params, {
|
|
410
|
-
sheetID,
|
|
411
|
-
sheetGroups,
|
|
412
|
-
type,
|
|
413
|
-
content: Content,
|
|
414
|
-
className = "",
|
|
415
|
-
size = "R",
|
|
416
|
-
freeCSS,
|
|
417
|
-
openAfter,
|
|
418
|
-
closeAfter,
|
|
419
|
-
close_option,
|
|
420
|
-
hold_state,
|
|
421
|
-
overwrap,
|
|
422
|
-
isOpen,
|
|
423
|
-
backgroundEffect
|
|
424
|
-
} = _a, styles = __objRest(_a, [
|
|
425
|
-
"sheetID",
|
|
426
|
-
"sheetGroups",
|
|
427
|
-
"type",
|
|
428
|
-
"content",
|
|
429
|
-
"className",
|
|
430
|
-
"size",
|
|
431
|
-
"freeCSS",
|
|
432
|
-
"openAfter",
|
|
433
|
-
"closeAfter",
|
|
434
|
-
"close_option",
|
|
435
|
-
"hold_state",
|
|
436
|
-
"overwrap",
|
|
437
|
-
"isOpen",
|
|
438
|
-
"backgroundEffect"
|
|
439
|
-
]);
|
|
440
|
-
return /* @__PURE__ */ jsx(
|
|
441
|
-
Box,
|
|
442
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
443
|
-
opacity: "trans",
|
|
444
|
-
transition: "long",
|
|
445
|
-
position: "relative",
|
|
446
|
-
backgroundColor: "1.layer.base",
|
|
447
|
-
flexSizing: "none",
|
|
448
|
-
minHeight: "viewHeight",
|
|
449
|
-
boxShadow: "3.remark",
|
|
450
|
-
className: [
|
|
451
|
-
SheetClasses("BB"),
|
|
452
|
-
className
|
|
453
|
-
].join(" ")
|
|
454
|
-
}, type == "drawer.right" ? {
|
|
455
|
-
marginLeft: "auto"
|
|
456
|
-
} : type == "drawer.left" ? {
|
|
457
|
-
marginRight: "auto"
|
|
458
|
-
} : {}), styles), {
|
|
459
|
-
freeCSS: __spreadValues({
|
|
460
|
-
width: {
|
|
461
|
-
"S": "20rem",
|
|
462
|
-
"R": "27rem",
|
|
463
|
-
"L": "32rem",
|
|
464
|
-
"2L": "40rem",
|
|
465
|
-
"3L": "58rem",
|
|
466
|
-
"MAX": "100vw"
|
|
467
|
-
}[size],
|
|
468
|
-
maxWidth: "96vw"
|
|
469
|
-
}, freeCSS),
|
|
470
|
-
children: $$.is.function(Content) ? /* @__PURE__ */ jsx(Content, {}) : Content
|
|
471
|
-
})
|
|
472
|
-
);
|
|
473
|
-
},
|
|
474
|
-
Bottom: (params) => {
|
|
475
|
-
let _a = params, {
|
|
476
|
-
componentID,
|
|
477
|
-
sheetID,
|
|
478
|
-
sheetGroups,
|
|
479
|
-
content: Content,
|
|
480
|
-
size = "R",
|
|
481
|
-
sizeChanged,
|
|
482
|
-
baseStyles,
|
|
483
|
-
openAfter,
|
|
484
|
-
closeAfter,
|
|
485
|
-
close_option: {
|
|
486
|
-
swipeDown = true
|
|
487
|
-
} = {},
|
|
488
|
-
hold_state,
|
|
489
|
-
overwrap,
|
|
490
|
-
isOpen,
|
|
491
|
-
backgroundEffect
|
|
492
|
-
} = _a, styles = __objRest(_a, [
|
|
493
|
-
"componentID",
|
|
494
|
-
"sheetID",
|
|
495
|
-
"sheetGroups",
|
|
496
|
-
"content",
|
|
497
|
-
"size",
|
|
498
|
-
"sizeChanged",
|
|
499
|
-
"baseStyles",
|
|
500
|
-
"openAfter",
|
|
501
|
-
"closeAfter",
|
|
502
|
-
"close_option",
|
|
503
|
-
"hold_state",
|
|
504
|
-
"overwrap",
|
|
505
|
-
"isOpen",
|
|
506
|
-
"backgroundEffect"
|
|
507
|
-
]);
|
|
508
|
-
let screen = $$.getScreenSize();
|
|
509
|
-
let sizeArray = [0, 0.2, 0.6, 0.95];
|
|
510
|
-
let SizeSets = {
|
|
511
|
-
"ZERO": 0,
|
|
512
|
-
"S": 1,
|
|
513
|
-
"R": 2,
|
|
514
|
-
"L": 3
|
|
515
|
-
};
|
|
516
|
-
let [val_stableSize, set_stableSize] = useState(size);
|
|
517
|
-
let [val_edit, set_edit] = useState({
|
|
518
|
-
process: false,
|
|
519
|
-
processStart: 0,
|
|
520
|
-
originY: 0,
|
|
521
|
-
originValue: 0,
|
|
522
|
-
viewHeight: 0,
|
|
523
|
-
value: sizeArray[SizeSets[size]]
|
|
524
|
-
});
|
|
525
|
-
useStore.update({
|
|
526
|
-
key: componentID,
|
|
527
|
-
value: {
|
|
528
|
-
val_edit,
|
|
529
|
-
resize: (size2) => {
|
|
530
|
-
let Size = sizeArray[SizeSets[size2]];
|
|
531
|
-
set_edit(__spreadProps(__spreadValues({}, val_edit), {
|
|
532
|
-
value: Size
|
|
533
|
-
}));
|
|
534
|
-
set_stableSize(size2);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
const Effects = {
|
|
539
|
-
Start: (event) => {
|
|
540
|
-
$$(document).addEvent({
|
|
541
|
-
eventID: "BottomSheetMouseMove",
|
|
542
|
-
eventType: "mousemove",
|
|
543
|
-
callback: Effects.Move
|
|
544
|
-
}).addEvent({
|
|
545
|
-
eventID: "BottomSheetTouchMove",
|
|
546
|
-
eventType: "touchmove",
|
|
547
|
-
callback: Effects.Move
|
|
548
|
-
}).addEvent({
|
|
549
|
-
eventID: "BottomSheetMouseUp",
|
|
550
|
-
eventType: "mouseup",
|
|
551
|
-
callback: Effects.End
|
|
552
|
-
}).addEvent({
|
|
553
|
-
eventID: "BottomSheetTouchEnd",
|
|
554
|
-
eventType: "touchend",
|
|
555
|
-
callback: Effects.End
|
|
556
|
-
});
|
|
557
|
-
let cursor = $$.getCursor(event);
|
|
558
|
-
let newEditInfo = __spreadProps(__spreadValues({}, val_edit), {
|
|
559
|
-
process: true,
|
|
560
|
-
processStart: (/* @__PURE__ */ new Date()).getTime(),
|
|
561
|
-
originY: cursor.y,
|
|
562
|
-
originValue: val_edit.value,
|
|
563
|
-
viewHeight: $$.getScreenSize().height
|
|
564
|
-
});
|
|
565
|
-
useStore.update({
|
|
566
|
-
key: componentID,
|
|
567
|
-
value: {
|
|
568
|
-
val_edit: newEditInfo
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
set_edit(newEditInfo);
|
|
572
|
-
},
|
|
573
|
-
Move: (event) => {
|
|
574
|
-
var _a2;
|
|
575
|
-
let editInfo = (_a2 = useStore.get(componentID)) == null ? void 0 : _a2.val_edit;
|
|
576
|
-
if (!editInfo.process)
|
|
577
|
-
return;
|
|
578
|
-
let margin = $$.getCursor(event).y - editInfo.originY;
|
|
579
|
-
let marginRate = margin / editInfo.viewHeight;
|
|
580
|
-
let newRate = editInfo.originValue - marginRate;
|
|
581
|
-
if (newRate > 0.95) {
|
|
582
|
-
let margin2 = newRate - 0.95;
|
|
583
|
-
newRate = 0.95 + margin2 * 0.5;
|
|
584
|
-
} else if (newRate < 0.2) {
|
|
585
|
-
let margin2 = 0.2 - newRate;
|
|
586
|
-
margin2 -= 0.1;
|
|
587
|
-
newRate = 0.1 + (0.1 - margin2) * 0.5;
|
|
588
|
-
}
|
|
589
|
-
set_edit(__spreadProps(__spreadValues({}, editInfo), {
|
|
590
|
-
value: newRate
|
|
591
|
-
}));
|
|
592
|
-
},
|
|
593
|
-
End: (event) => {
|
|
594
|
-
var _a2;
|
|
595
|
-
let editInfo = (_a2 = useStore.get(componentID)) == null ? void 0 : _a2.val_edit;
|
|
596
|
-
if (!editInfo.process)
|
|
597
|
-
return;
|
|
598
|
-
$$(document).removeEvent([
|
|
599
|
-
"BottomSheetMouseMove",
|
|
600
|
-
"BottomSheetTouchMove",
|
|
601
|
-
"BottomSheetMouseUp",
|
|
602
|
-
"BottomSheetTouchEnd"
|
|
603
|
-
]);
|
|
604
|
-
let sizeIndex = 0;
|
|
605
|
-
if (editInfo.value < 0.1) {
|
|
606
|
-
} else if (editInfo.value < 0.5) {
|
|
607
|
-
sizeIndex = 1;
|
|
608
|
-
} else if (editInfo.value > 0.75) {
|
|
609
|
-
sizeIndex = 3;
|
|
610
|
-
} else {
|
|
611
|
-
sizeIndex = 2;
|
|
612
|
-
}
|
|
613
|
-
let ms = (/* @__PURE__ */ new Date()).getTime() - editInfo.processStart;
|
|
614
|
-
if (ms < 300) {
|
|
615
|
-
let margin = $$.getCursor(event).y - editInfo.originY;
|
|
616
|
-
if (Math.abs(margin) >= 20) {
|
|
617
|
-
let dir = Number(margin < 0) * 2 - 1;
|
|
618
|
-
sizeIndex += dir;
|
|
619
|
-
sizeIndex = Math.min(Math.max(sizeIndex, 0), sizeArray.length - 1);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
if (sizeIndex == 0) {
|
|
623
|
-
if (!swipeDown)
|
|
624
|
-
sizeIndex = 1;
|
|
625
|
-
}
|
|
626
|
-
set_stableSize(["ZERO", "S", "R", "L"][sizeIndex]);
|
|
627
|
-
set_edit(__spreadProps(__spreadValues({}, editInfo), {
|
|
628
|
-
value: sizeArray[sizeIndex],
|
|
629
|
-
process: false
|
|
630
|
-
}));
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
const mounted = useRef(false);
|
|
634
|
-
useEffect(() => {
|
|
635
|
-
if (mounted.current) {
|
|
636
|
-
if (val_stableSize == "ZERO") {
|
|
637
|
-
if (swipeDown)
|
|
638
|
-
Sheet.close(sheetID);
|
|
639
|
-
} else {
|
|
640
|
-
setTimeout(() => {
|
|
641
|
-
if (params.sizeChanged)
|
|
642
|
-
params.sizeChanged(val_stableSize);
|
|
643
|
-
}, 250);
|
|
644
|
-
}
|
|
645
|
-
} else {
|
|
646
|
-
mounted.current = true;
|
|
647
|
-
}
|
|
648
|
-
}, [val_stableSize]);
|
|
649
|
-
return /* @__PURE__ */ jsx(
|
|
650
|
-
Box,
|
|
651
|
-
{
|
|
652
|
-
className: SheetClasses("BB"),
|
|
653
|
-
margin: [0, "auto"],
|
|
654
|
-
marginTop: "auto",
|
|
655
|
-
opacity: "trans",
|
|
656
|
-
width: 1,
|
|
657
|
-
transition: "long",
|
|
658
|
-
freeCSS: __spreadValues({
|
|
659
|
-
maxWidth: 12 * 60,
|
|
660
|
-
height: screen.height * val_edit.value
|
|
661
|
-
}, val_edit.process ? {
|
|
662
|
-
transition: "0s"
|
|
663
|
-
} : {}),
|
|
664
|
-
children: /* @__PURE__ */ jsxs(
|
|
665
|
-
Column,
|
|
666
|
-
__spreadProps(__spreadValues({
|
|
667
|
-
gap: 0,
|
|
668
|
-
flexSizing: "none",
|
|
669
|
-
borderTopLeftRadius: "1.tone.primary",
|
|
670
|
-
borderTopRightRadius: "1.tone.primary",
|
|
671
|
-
border: true,
|
|
672
|
-
borderBottom: "unset",
|
|
673
|
-
boxShadow: "3.remark",
|
|
674
|
-
position: "relative",
|
|
675
|
-
overflow: "hidden",
|
|
676
|
-
height: 1
|
|
677
|
-
}, baseStyles), {
|
|
678
|
-
children: [
|
|
679
|
-
/* @__PURE__ */ jsxs(
|
|
680
|
-
Row.Separate,
|
|
681
|
-
{
|
|
682
|
-
padding: "1/2",
|
|
683
|
-
backgroundColor: "1.layer.base",
|
|
684
|
-
position: "relative",
|
|
685
|
-
freeCSS: {
|
|
686
|
-
userSelect: "none"
|
|
687
|
-
},
|
|
688
|
-
children: [
|
|
689
|
-
/* @__PURE__ */ jsx(
|
|
690
|
-
Row.Center,
|
|
691
|
-
{
|
|
692
|
-
flexSizing: 0,
|
|
693
|
-
padding: "2/3",
|
|
694
|
-
onMouseDown: Effects.Start,
|
|
695
|
-
onTouchStart: Effects.Start,
|
|
696
|
-
ssPushable: true,
|
|
697
|
-
isRounded: true,
|
|
698
|
-
freeCSS: {
|
|
699
|
-
cursor: "grab",
|
|
700
|
-
userSelect: "none"
|
|
701
|
-
},
|
|
702
|
-
children: /* @__PURE__ */ jsx(
|
|
703
|
-
Box,
|
|
704
|
-
{
|
|
705
|
-
unitWidth: 6,
|
|
706
|
-
unitHeight: "1/2",
|
|
707
|
-
backgroundColor: "5.layer.darker",
|
|
708
|
-
isRounded: true,
|
|
709
|
-
className: SheetClasses("DragBar")
|
|
710
|
-
}
|
|
711
|
-
)
|
|
712
|
-
}
|
|
713
|
-
),
|
|
714
|
-
/* @__PURE__ */ jsx(
|
|
715
|
-
Button.Button.Sub.R,
|
|
716
|
-
{
|
|
717
|
-
color: "cloud",
|
|
718
|
-
ssSphere: 2,
|
|
719
|
-
onClick: () => {
|
|
720
|
-
Sheet.close(sheetID);
|
|
721
|
-
},
|
|
722
|
-
children: /* @__PURE__ */ jsx(FAI.Times, {})
|
|
723
|
-
}
|
|
724
|
-
)
|
|
725
|
-
]
|
|
726
|
-
}
|
|
727
|
-
),
|
|
728
|
-
/* @__PURE__ */ jsx(
|
|
729
|
-
Box,
|
|
730
|
-
__spreadProps(__spreadValues({
|
|
731
|
-
backgroundColor: "1.layer.base",
|
|
732
|
-
flexSizing: 0,
|
|
733
|
-
overflow: "auto"
|
|
734
|
-
}, styles), {
|
|
735
|
-
children: $$.is.function(Content) ? /* @__PURE__ */ jsx(Content, {}) : Content
|
|
736
|
-
})
|
|
737
|
-
)
|
|
738
|
-
]
|
|
739
|
-
})
|
|
740
|
-
)
|
|
741
|
-
}
|
|
742
|
-
);
|
|
743
|
-
},
|
|
744
|
-
Custom: (params) => {
|
|
745
|
-
let _a = params, {
|
|
746
|
-
sheetID,
|
|
747
|
-
sheetGroups,
|
|
748
|
-
parent,
|
|
749
|
-
gravityPoint: GPT = 22,
|
|
750
|
-
content: Content,
|
|
751
|
-
close_option,
|
|
752
|
-
hold_state,
|
|
753
|
-
openAfter,
|
|
754
|
-
closeAfter,
|
|
755
|
-
overwrap,
|
|
756
|
-
isOpen,
|
|
757
|
-
backgroundEffect
|
|
758
|
-
} = _a, others = __objRest(_a, [
|
|
759
|
-
"sheetID",
|
|
760
|
-
"sheetGroups",
|
|
761
|
-
"parent",
|
|
762
|
-
"gravityPoint",
|
|
763
|
-
"content",
|
|
764
|
-
"close_option",
|
|
765
|
-
"hold_state",
|
|
766
|
-
"openAfter",
|
|
767
|
-
"closeAfter",
|
|
768
|
-
"overwrap",
|
|
769
|
-
"isOpen",
|
|
770
|
-
"backgroundEffect"
|
|
771
|
-
]);
|
|
772
|
-
let [val_compUID] = useState($$.uuid.gen());
|
|
773
|
-
let Parent = $$.is.element(parent) ? $$(parent) : $$.is.jsmin(parent) ? parent : $$fromRoot(parent);
|
|
774
|
-
let Query = '[data-sheet-id="' + val_compUID + '"]';
|
|
775
|
-
let ContentQuery = '[data-sheet-content="' + val_compUID + '"]';
|
|
776
|
-
GPT = GPT;
|
|
777
|
-
let column = GPT % 5 || 5;
|
|
778
|
-
let row = Math.ceil(GPT / 5);
|
|
779
|
-
const getWrapperCSS = () => {
|
|
780
|
-
let WrapperCSS = {};
|
|
781
|
-
let { top, right, bottom, left, height, width } = Parent.position();
|
|
782
|
-
if ([1, 2].includes(column)) {
|
|
783
|
-
WrapperCSS.left = left;
|
|
784
|
-
} else if (column == 3) {
|
|
785
|
-
WrapperCSS.left = left + width / 2;
|
|
786
|
-
} else if ([4, 5].includes(column)) {
|
|
787
|
-
WrapperCSS.left = right;
|
|
788
|
-
}
|
|
789
|
-
if (GPT <= 10) {
|
|
790
|
-
WrapperCSS.top = top;
|
|
791
|
-
} else if (GPT <= 15) {
|
|
792
|
-
WrapperCSS.top = top + height / 2;
|
|
793
|
-
} else if (GPT <= 25) {
|
|
794
|
-
WrapperCSS.top = bottom;
|
|
795
|
-
}
|
|
796
|
-
return WrapperCSS;
|
|
797
|
-
};
|
|
798
|
-
let [val_Styles, set_Styles] = useState(getWrapperCSS());
|
|
799
|
-
const AdjustExtrusion = () => {
|
|
800
|
-
let BaseRect = $$fromRoot(Query).position();
|
|
801
|
-
let ContentRect = $$fromRoot(ContentQuery).position();
|
|
802
|
-
let screen = $$.getScreenSize();
|
|
803
|
-
let newStyles = __spreadValues({}, val_Styles);
|
|
804
|
-
if (ContentRect.top < 0) {
|
|
805
|
-
newStyles.top = BaseRect.top - ContentRect.top;
|
|
806
|
-
}
|
|
807
|
-
if (ContentRect.left < 0) {
|
|
808
|
-
newStyles.left = BaseRect.left - ContentRect.left;
|
|
809
|
-
}
|
|
810
|
-
if (ContentRect.right > screen.width) {
|
|
811
|
-
newStyles.left = BaseRect.left - (ContentRect.right - screen.width);
|
|
812
|
-
}
|
|
813
|
-
if (ContentRect.bottom > screen.height) {
|
|
814
|
-
newStyles.top = BaseRect.top - (ContentRect.bottom - screen.height);
|
|
815
|
-
}
|
|
816
|
-
return newStyles;
|
|
817
|
-
};
|
|
818
|
-
useEffect(() => {
|
|
819
|
-
$$fromRoot(Query).await(10).addClass(SheetClasses("Open")).await(250).callback(() => {
|
|
820
|
-
set_Styles(AdjustExtrusion());
|
|
821
|
-
});
|
|
822
|
-
useStore.update({
|
|
823
|
-
key: "customSheet-" + params.sheetID,
|
|
824
|
-
value: {
|
|
825
|
-
reposition: () => {
|
|
826
|
-
setTimeout(() => {
|
|
827
|
-
set_Styles(AdjustExtrusion());
|
|
828
|
-
}, 200);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
}, []);
|
|
833
|
-
if (!Parent[0])
|
|
834
|
-
return null;
|
|
835
|
-
return /* @__PURE__ */ jsx(
|
|
836
|
-
Box,
|
|
837
|
-
{
|
|
838
|
-
className: [
|
|
839
|
-
SheetClasses("BB"),
|
|
840
|
-
SheetClasses("CustomSheet")
|
|
841
|
-
].join(" "),
|
|
842
|
-
"data-sheet-id": val_compUID,
|
|
843
|
-
transition: "long",
|
|
844
|
-
opacity: "trans",
|
|
845
|
-
position: "absolute",
|
|
846
|
-
width: 0,
|
|
847
|
-
height: 0,
|
|
848
|
-
flexCenter: true,
|
|
849
|
-
freeCSS: val_Styles,
|
|
850
|
-
children: /* @__PURE__ */ jsx(
|
|
851
|
-
Flex,
|
|
852
|
-
{
|
|
853
|
-
className: [
|
|
854
|
-
SheetClasses("GPT"),
|
|
855
|
-
SheetClasses("GPT_" + GPT),
|
|
856
|
-
SheetClasses("Col_" + column),
|
|
857
|
-
SheetClasses("Row_" + row)
|
|
858
|
-
].join(" "),
|
|
859
|
-
position: "absolute",
|
|
860
|
-
children: /* @__PURE__ */ jsx(
|
|
861
|
-
Box,
|
|
862
|
-
__spreadProps(__spreadValues({
|
|
863
|
-
flexSizing: "none",
|
|
864
|
-
"data-sheet-content": val_compUID,
|
|
865
|
-
maxHeight: "viewHeight",
|
|
866
|
-
overflow: "auto",
|
|
867
|
-
padding: 1
|
|
868
|
-
}, others), {
|
|
869
|
-
freeCSS: __spreadValues({
|
|
870
|
-
maxWidth: "98vw"
|
|
871
|
-
}, others.freeCSS),
|
|
872
|
-
children: $$.is.function(Content) ? /* @__PURE__ */ jsx(Content, {}) : Content
|
|
873
|
-
})
|
|
874
|
-
)
|
|
875
|
-
}
|
|
876
|
-
)
|
|
877
|
-
}
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
},
|
|
881
|
-
TapSensor: (params) => {
|
|
882
|
-
return /* @__PURE__ */ jsx(
|
|
883
|
-
Box,
|
|
884
|
-
{
|
|
885
|
-
className: SheetClasses("TapSensor"),
|
|
886
|
-
children: /* @__PURE__ */ jsx(
|
|
887
|
-
Button.Button.Plain,
|
|
888
|
-
{
|
|
889
|
-
className: SheetClasses("TapContent"),
|
|
890
|
-
onClick: () => {
|
|
891
|
-
var _a;
|
|
892
|
-
console.log("gyilbh;unojikpol");
|
|
893
|
-
if ((_a = params.delegateAroundClick) != null ? _a : false)
|
|
894
|
-
Sheet.close(params.sheetID);
|
|
895
|
-
},
|
|
896
|
-
freeCSS: {
|
|
897
|
-
cursor: "default",
|
|
898
|
-
pointerEvents: "all"
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
)
|
|
902
|
-
}
|
|
903
|
-
);
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
const Sheet = {
|
|
907
|
-
Wrapper: () => /* @__PURE__ */ jsx(Comps.Wrapper, {}),
|
|
908
|
-
open: (params) => {
|
|
909
|
-
params.sheetID = (params.sheetID || "").replace(/\./g, "-");
|
|
910
|
-
if (params.type == "image") {
|
|
911
|
-
let sheetID = params.sheetID || $$.uuid.gen();
|
|
912
|
-
let _a = params, {
|
|
913
|
-
type,
|
|
914
|
-
src
|
|
915
|
-
} = _a, others = __objRest(_a, [
|
|
916
|
-
"type",
|
|
917
|
-
"src"
|
|
918
|
-
]);
|
|
919
|
-
Sheet.open(__spreadProps(__spreadValues({
|
|
920
|
-
type: "normal.topCenter",
|
|
921
|
-
backgroundColor: "trans"
|
|
922
|
-
}, others), {
|
|
923
|
-
sheetID,
|
|
924
|
-
freeCSS: {
|
|
925
|
-
maxWidth: "96vw",
|
|
926
|
-
transformOrigin: "top"
|
|
927
|
-
},
|
|
928
|
-
content: () => {
|
|
929
|
-
let [val_image] = useState($$.flatArray(src));
|
|
930
|
-
let [val_viewIndex, set_viewIndex] = useState(0);
|
|
931
|
-
let Radio = [];
|
|
932
|
-
let Slides = [];
|
|
933
|
-
val_image.forEach((src2, index) => {
|
|
934
|
-
Radio.push({
|
|
935
|
-
value: index,
|
|
936
|
-
label: /* @__PURE__ */ jsx(
|
|
937
|
-
Img,
|
|
938
|
-
{
|
|
939
|
-
src: $$.flatArray(src2)[0],
|
|
940
|
-
width: "auto",
|
|
941
|
-
height: 1,
|
|
942
|
-
freeCSS: {
|
|
943
|
-
maxWidth: 12 * 6,
|
|
944
|
-
maxHeight: 12 * 3
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
)
|
|
948
|
-
});
|
|
949
|
-
Slides.push(/* @__PURE__ */ jsx(
|
|
950
|
-
Img,
|
|
951
|
-
{
|
|
952
|
-
width: 1,
|
|
953
|
-
height: "auto",
|
|
954
|
-
src: $$.flatArray(src2)[0]
|
|
955
|
-
}
|
|
956
|
-
));
|
|
957
|
-
});
|
|
958
|
-
return /* @__PURE__ */ jsxs(
|
|
959
|
-
Column,
|
|
960
|
-
{
|
|
961
|
-
gap: 0,
|
|
962
|
-
children: [
|
|
963
|
-
/* @__PURE__ */ jsxs(
|
|
964
|
-
Row.Separate,
|
|
965
|
-
{
|
|
966
|
-
gap: 2,
|
|
967
|
-
padding: 1,
|
|
968
|
-
backgroundColor: "1.layer.base",
|
|
969
|
-
borderTopLeftRadius: "1.tone.primary",
|
|
970
|
-
borderTopRightRadius: "1.tone.primary",
|
|
971
|
-
children: [
|
|
972
|
-
/* @__PURE__ */ jsx(
|
|
973
|
-
Input.Radio,
|
|
974
|
-
{
|
|
975
|
-
tone: "border",
|
|
976
|
-
icon: false,
|
|
977
|
-
value: val_viewIndex,
|
|
978
|
-
override: "force",
|
|
979
|
-
horizontalAlign: "center",
|
|
980
|
-
onUpdateValidValue: ({ value }) => {
|
|
981
|
-
set_viewIndex(value[0]);
|
|
982
|
-
},
|
|
983
|
-
cellStyles: {
|
|
984
|
-
borderWidth: 2,
|
|
985
|
-
padding: "1/3"
|
|
986
|
-
},
|
|
987
|
-
options: Radio
|
|
988
|
-
}
|
|
989
|
-
),
|
|
990
|
-
/* @__PURE__ */ jsxs(
|
|
991
|
-
Button.Button.Border.R,
|
|
992
|
-
{
|
|
993
|
-
color: "cloud",
|
|
994
|
-
isRounded: true,
|
|
995
|
-
onClick: () => {
|
|
996
|
-
Sheet.close(sheetID);
|
|
997
|
-
},
|
|
998
|
-
children: [
|
|
999
|
-
"\u9589\u3058\u308B ",
|
|
1000
|
-
/* @__PURE__ */ jsx(FAI.Times, {})
|
|
1001
|
-
]
|
|
1002
|
-
}
|
|
1003
|
-
)
|
|
1004
|
-
]
|
|
1005
|
-
}
|
|
1006
|
-
),
|
|
1007
|
-
/* @__PURE__ */ jsx(
|
|
1008
|
-
Layout.SwipeView,
|
|
1009
|
-
{
|
|
1010
|
-
slideIndex: val_viewIndex,
|
|
1011
|
-
options: {
|
|
1012
|
-
loop: val_image.length > 1,
|
|
1013
|
-
onSlideCallback: (index) => {
|
|
1014
|
-
set_viewIndex(index);
|
|
1015
|
-
}
|
|
1016
|
-
},
|
|
1017
|
-
slides: Slides,
|
|
1018
|
-
wrapper: (View) => /* @__PURE__ */ jsx(
|
|
1019
|
-
Box,
|
|
1020
|
-
{
|
|
1021
|
-
borderBottomLeftRadius: "1.tone.primary",
|
|
1022
|
-
borderBottomRightRadius: "1.tone.primary",
|
|
1023
|
-
children: View
|
|
1024
|
-
}
|
|
1025
|
-
)
|
|
1026
|
-
}
|
|
1027
|
-
)
|
|
1028
|
-
]
|
|
1029
|
-
}
|
|
1030
|
-
);
|
|
1031
|
-
}
|
|
1032
|
-
}));
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
Comps.addNewSheet(params);
|
|
1036
|
-
},
|
|
1037
|
-
refresh: (params, open) => {
|
|
1038
|
-
params.sheetID = (params.sheetID || "").replace(/\./g, "-");
|
|
1039
|
-
let comps = useStore.get(params.sheetID);
|
|
1040
|
-
comps && comps.refresh && comps.refresh(params, open);
|
|
1041
|
-
},
|
|
1042
|
-
resize: (params) => {
|
|
1043
|
-
params.sheetID = (params.sheetID || "").replace(/\./g, "-");
|
|
1044
|
-
let comps = useStore.get(params.sheetID);
|
|
1045
|
-
comps && comps.resize && comps.resize(params.size);
|
|
1046
|
-
},
|
|
1047
|
-
reposition: (sheetID) => {
|
|
1048
|
-
let Comps2 = useStore.get("customSheet-" + sheetID);
|
|
1049
|
-
Comps2 && Comps2.reposition && Comps2.reposition();
|
|
1050
|
-
},
|
|
1051
|
-
close: function(sheetID, et, force) {
|
|
1052
|
-
var _a;
|
|
1053
|
-
sheetID = sheetID == null ? void 0 : sheetID.replace(/\./g, "-");
|
|
1054
|
-
let Content = Comps.contents[sheetID];
|
|
1055
|
-
if (!Content)
|
|
1056
|
-
return;
|
|
1057
|
-
if (et == "Escape" && !((_a = Content.params.close_option) == null ? void 0 : _a.escapeKeyDown))
|
|
1058
|
-
return;
|
|
1059
|
-
{
|
|
1060
|
-
let { params } = Content;
|
|
1061
|
-
let { sheetID: sheetID2 } = params;
|
|
1062
|
-
let comp = useStore.get(sheetID2);
|
|
1063
|
-
comp && comp.close && comp.close(force);
|
|
1064
|
-
}
|
|
1065
|
-
},
|
|
1066
|
-
closeGroup: (sheetGroup) => {
|
|
1067
|
-
var _a;
|
|
1068
|
-
sheetGroup = (sheetGroup || "").replace(/\./g, "-");
|
|
1069
|
-
for (let [key, value] of Object.entries(Comps.contents)) {
|
|
1070
|
-
if ((_a = value.params.sheetGroups) == null ? void 0 : _a.includes(sheetGroup))
|
|
1071
|
-
Sheet.close(key);
|
|
1072
|
-
}
|
|
1073
|
-
},
|
|
1074
|
-
closeAll: (pageTransit) => {
|
|
1075
|
-
var _a;
|
|
1076
|
-
for (let [key, value] of Object.entries(Comps.contents)) {
|
|
1077
|
-
if (pageTransit) {
|
|
1078
|
-
if (((_a = value.params.close_option) == null ? void 0 : _a.pageTransit) == false)
|
|
1079
|
-
continue;
|
|
1080
|
-
}
|
|
1081
|
-
Sheet.close(key, "pageTransit", true);
|
|
1082
|
-
}
|
|
1083
|
-
},
|
|
1084
|
-
Comps: {
|
|
1085
|
-
Body: (params) => /* @__PURE__ */ jsx(
|
|
1086
|
-
Box,
|
|
1087
|
-
__spreadValues({
|
|
1088
|
-
className: SheetClasses("BaseBody"),
|
|
1089
|
-
backgroundColor: "1.layer.base",
|
|
1090
|
-
borderRadius: "1.tone.primary",
|
|
1091
|
-
position: "relative",
|
|
1092
|
-
boxShadow: "3.remark",
|
|
1093
|
-
transition: "long"
|
|
1094
|
-
}, params)
|
|
1095
|
-
)
|
|
1096
|
-
}
|
|
1097
|
-
};
|
|
1098
|
-
export {
|
|
1099
|
-
Sheet,
|
|
1100
|
-
Sheet as default
|
|
1101
|
-
};
|
|
1
|
+
import{b as d,c as R,d as j}from"../chunk-VY3566IV.js";import{jsx as i,jsxs as G}from"react/jsx-runtime";import{useState as D,useEffect as F,useRef as q}from"react";import{$$ as n,$$fromRoot as N,Config as H,useStore as _}from"../@utils/_";import B from"../atoms/Box";import J from"../atoms/Img";import Q from"../atoms/FAI";import ee from"../atoms/Flex";import X from"../mols/Column";import K from"../mols/Row";import Z from"./Button";import te from"./Layout/_";import oe from"./Input/_";import{SheetClasses as l}from"../@styles/componentClasses/_";const c={mainSheetScrolls:0,subSheetLength:0,currentIndex:0,contents:{},addNewSheet:function(e){if(e=R(d({sheetGroups:e.sheetGroups||[],backgroundEffect:!0,overwrap:e.type=="custom",hold_state:!1,isOpen:!0},e),{sheetID:e.sheetID||n.uuid.gen(),close_option:d({pageTransit:!0,escapeKeyDown:!0,aroundClick:e.type=="custom"},e.close_option)}),this.contents[e.sheetID]){let r=_.get(e.sheetID);r&&r.refresh&&r.refresh(e,!0);return}this.contents[e.sheetID]={isOpen:!0,hold_state:!!e.hold_state,params:e,created_at:n.Time()};let t=_.get("Sheet-"+H.get().sessionUID);t&&t.refresh()},Wrapper:()=>{let[e,t]=D(n.uuid.gen());F(()=>{_.set({key:"Sheet-"+H.get().sessionUID,value:{refresh:()=>{t(n.uuid.gen())}}}),n(H.get().appRoot).addEvent({eventType:"keyup",callback:function(a){let{key:o,metaKey:h}=a;if(o=="Escape"||o==","&&h){let g=Object.values(c.contents).filter(v=>v.isOpen);if(!g.length)return;let s=g.reduce((v,w)=>v.created_at.value>w.created_at.value?v:w);E.close(s.params.sheetID,o)}}}).addEvent({eventType:"click",callback:function(a){var g;let o=Object.values(c.contents).filter(s=>s.params.type=="custom");!o.length||o.find(s=>{let{params:v}=s,w=v.parent,C=a.target,y=N(w)[0];return!!(w==C||y===C||n(y).find(C).length)})||(g=a.target)!=null&&g.closest("."+l("CustomSheet"))||o.forEach(s=>{var v;(v=s.params.close_option)!=null&&v.aroundClick&&E.close(s.params.sheetID)})}})},[]);let r=Object.entries(c.contents).map(([a,o])=>i(B,{id:"Sheet-"+a,children:i(c.Core,d({isOpen:o.isOpen},o.params),a)},a));return i(B,{className:["AMOTIFY_be",l("Wrapper")].join(" "),children:r})},Core:e=>{var z;let[t]=D(n.uuid.gen()),[r,a]=D(e),[o,h]=D(e.isOpen),{type:g,sheetID:s,openAfter:v,closeAfter:w}=r,C=!r.overwrap,y=c.Types[{"normal.topLeft":"Normal","normal.topCenter":"Normal","normal.topRight":"Normal","normal.middleLeft":"Normal","normal.middleCenter":"Normal","normal.middleRight":"Normal","normal.bottomLeft":"Normal","normal.bottomCenter":"Normal","normal.bottomRight":"Normal",image:"Normal","drawer.left":"Edge","drawer.right":"Edge","drawer.bottom":"Bottom",custom:"Custom"}[g]];F(()=>{_.set({key:s,value:{refresh:(m,p)=>{a(m),h(p!=null?p:!1)},resize:m=>{if(g=="drawer.bottom"){let p=_.get(t);p&&p.resize&&p.resize(m)}else(r.type.includes("normal")||r.type.includes("drawer"))&&a(R(d({},r),{size:m}))},close:m=>{c.contents[s].isOpen=!1,h(!1)},open:()=>{c.contents[s].isOpen=!0,h(!0)}}})}),F(()=>{n.scope(()=>{if(C&&r.backgroundEffect){if(c.subSheetLength=c.subSheetLength+(o?1:-1),o){let m=n("html");if(c.subSheetLength==1){let p=m[0].scrollTop;c.mainSheetScrolls=p}H.get().isPhone||(m.callback(()=>{N(".AMOTIFY_be_root").addClass(l("FixScroll")).callback(p=>{p[0].scrollTop=c.mainSheetScrolls}).await(40).addClass(l("Float"))})[0].scrollTop=0);return}c.subSheetLength==0&&(H.get().isPhone||N(".AMOTIFY_be_root").removeClass(l("Float")).await(251).removeClass(l("FixScroll")).callback(()=>{n("html")[0].scrollTop=c.mainSheetScrolls|0,N(".AMOTIFY_be_root")[0].scrollTop=0}))}}),n.scope(()=>{let m=N("#"+t);if(o){m.await(10).removeClass(l("Hide")).await(10).addClass(l("Open")).callback(()=>{c.contents[s].isOpen=!0,v&&v()});return}m.await(10).removeClass(l("Open")).await(251).addClass(l("Hide")).callback(()=>{if(!w||w(),c.contents[s].isOpen=!1,r.hold_state)return;delete c.contents[s];let p=_.get("Sheet-"+H.get().sessionUID);p&&p.refresh()})})},[o]),F(()=>{c.currentIndex++;let{close_option:m}=r;n.scope(()=>{if(!(m!=null&&m.parentBlur))return;let p=n(r.parent);p[0]&&p.addEvent({eventID:"SheetClosation-"+s,eventType:"mouseout",callback:()=>{p.removeEvent("SheetClosation-"+s),h(!1)}})})},[]);let[A,L]=g.split(".");return i(B,{className:[l("Wrap"),l("Tcate_"+A),l("Tpos_"+L),l("isNewSheet_"+C)].join(" "),width:1,height:0,ssAbsoluteCovered:!0,freeCSS:{zIndex:c.currentIndex+1},id:t,children:G(X,{className:l("Content"),gap:0,height:"viewHeight",overflow:"auto",transition:"middle",children:[!!C&&i(c.TapSensor,{sheetID:s,delegateAroundClick:(z=r.close_option)==null?void 0:z.aroundClick}),i(y,d({componentID:t},r))]})},t)},Types:{Normal:e=>{let M=e,{sheetID:t,sheetGroups:r,content:a,className:o="",type:h,size:g="R",freeCSS:s,openAfter:v,closeAfter:w,close_option:C,hold_state:y,overwrap:A,isOpen:L,backgroundEffect:z}=M,m=j(M,["sheetID","sheetGroups","content","className","type","size","freeCSS","openAfter","closeAfter","close_option","hold_state","overwrap","isOpen","backgroundEffect"]),[p,k]=h.split("."),b={},I=[];return k.match(/top/)?(I.push("top"),b.marginBottom="auto"):k.match(/middle/)?(I.push("center"),b.marginTop="auto",b.marginBottom="auto"):k.match(/bottom/)&&(I.push("bottom"),b.marginTop="auto"),k.match(/left/i)?(I.push("left"),b.marginRight="auto"):k.match(/center/i)?(I.push("center"),b.marginLeft="auto",b.marginRight="auto"):k.match(/right/i)&&(I.push("right"),b.marginLeft="auto"),i(B,R(d(d({className:[l("BB"),o].join(" "),padding:1,transition:"long",opacity:"trans"},b),m),{freeCSS:d({width:{S:"26rem",R:"36rem",L:"44rem","2L":"60rem","3L":"72rem",MAX:"100vw"}[g],maxWidth:"96vw",transformOrigin:I.join(" ")},s),children:n.is.function(a)?i(a,{}):a}))},Edge:e=>{let p=e,{sheetID:t,sheetGroups:r,type:a,content:o,className:h="",size:g="R",freeCSS:s,openAfter:v,closeAfter:w,close_option:C,hold_state:y,overwrap:A,isOpen:L,backgroundEffect:z}=p,m=j(p,["sheetID","sheetGroups","type","content","className","size","freeCSS","openAfter","closeAfter","close_option","hold_state","overwrap","isOpen","backgroundEffect"]);return i(B,R(d(d({opacity:"trans",transition:"long",position:"relative",backgroundColor:"1.layer.base",flexSizing:"none",minHeight:"viewHeight",boxShadow:"3.remark",className:[l("BB"),h].join(" ")},a=="drawer.right"?{marginLeft:"auto"}:a=="drawer.left"?{marginRight:"auto"}:{}),m),{freeCSS:d({width:{S:"20rem",R:"27rem",L:"32rem","2L":"40rem","3L":"58rem",MAX:"100vw"}[g],maxWidth:"96vw"},s),children:n.is.function(o)?i(o,{}):o}))},Bottom:e=>{let T=e,{componentID:t,sheetID:r,sheetGroups:a,content:o,size:h="R",sizeChanged:g,baseStyles:s,openAfter:v,closeAfter:w,close_option:{swipeDown:C=!0}={},hold_state:y,overwrap:A,isOpen:L,backgroundEffect:z}=T,m=j(T,["componentID","sheetID","sheetGroups","content","size","sizeChanged","baseStyles","openAfter","closeAfter","close_option","hold_state","overwrap","isOpen","backgroundEffect"]),p=n.getScreenSize(),k=[0,.2,.6,.95],b={ZERO:0,S:1,R:2,L:3},[I,M]=D(h),[O,W]=D({process:!1,processStart:0,originY:0,originValue:0,viewHeight:0,value:k[b[h]]});_.update({key:t,value:{val_edit:O,resize:S=>{let u=k[b[S]];W(R(d({},O),{value:u})),M(S)}}});const P={Start:S=>{n(document).addEvent({eventID:"BottomSheetMouseMove",eventType:"mousemove",callback:P.Move}).addEvent({eventID:"BottomSheetTouchMove",eventType:"touchmove",callback:P.Move}).addEvent({eventID:"BottomSheetMouseUp",eventType:"mouseup",callback:P.End}).addEvent({eventID:"BottomSheetTouchEnd",eventType:"touchend",callback:P.End});let u=n.getCursor(S),f=R(d({},O),{process:!0,processStart:new Date().getTime(),originY:u.y,originValue:O.value,viewHeight:n.getScreenSize().height});_.update({key:t,value:{val_edit:f}}),W(f)},Move:S=>{var U;let u=(U=_.get(t))==null?void 0:U.val_edit;if(!u.process)return;let V=(n.getCursor(S).y-u.originY)/u.viewHeight,x=u.originValue-V;if(x>.95)x=.95+(x-.95)*.5;else if(x<.2){let $=.2-x;$-=.1,x=.1+(.1-$)*.5}W(R(d({},u),{value:x}))},End:S=>{var x;let u=(x=_.get(t))==null?void 0:x.val_edit;if(!u.process)return;n(document).removeEvent(["BottomSheetMouseMove","BottomSheetTouchMove","BottomSheetMouseUp","BottomSheetTouchEnd"]);let f=0;if(u.value<.1||(u.value<.5?f=1:u.value>.75?f=3:f=2),new Date().getTime()-u.processStart<300){let U=n.getCursor(S).y-u.originY;if(Math.abs(U)>=20){let $=+(U<0)*2-1;f+=$,f=Math.min(Math.max(f,0),k.length-1)}}f==0&&(C||(f=1)),M(["ZERO","S","R","L"][f]),W(R(d({},u),{value:k[f],process:!1}))}},Y=q(!1);return F(()=>{Y.current?I=="ZERO"?C&&E.close(r):setTimeout(()=>{e.sizeChanged&&e.sizeChanged(I)},250):Y.current=!0},[I]),i(B,{className:l("BB"),margin:[0,"auto"],marginTop:"auto",opacity:"trans",width:1,transition:"long",freeCSS:d({maxWidth:12*60,height:p.height*O.value},O.process?{transition:"0s"}:{}),children:G(X,R(d({gap:0,flexSizing:"none",borderTopLeftRadius:"1.tone.primary",borderTopRightRadius:"1.tone.primary",border:!0,borderBottom:"unset",boxShadow:"3.remark",position:"relative",overflow:"hidden",height:1},s),{children:[G(K.Separate,{padding:"1/2",backgroundColor:"1.layer.base",position:"relative",freeCSS:{userSelect:"none"},children:[i(K.Center,{flexSizing:0,padding:"2/3",onMouseDown:P.Start,onTouchStart:P.Start,ssPushable:!0,isRounded:!0,freeCSS:{cursor:"grab",userSelect:"none"},children:i(B,{unitWidth:6,unitHeight:"1/2",backgroundColor:"5.layer.darker",isRounded:!0,className:l("DragBar")})}),i(Z.Button.Sub.R,{color:"cloud",ssSphere:2,onClick:()=>{E.close(r)},children:i(Q.Times,{})})]}),i(B,R(d({backgroundColor:"1.layer.base",flexSizing:0,overflow:"auto"},m),{children:n.is.function(o)?i(o,{}):o}))]}))})},Custom:e=>{let Y=e,{sheetID:t,sheetGroups:r,parent:a,gravityPoint:o=22,content:h,close_option:g,hold_state:s,openAfter:v,closeAfter:w,overwrap:C,isOpen:y,backgroundEffect:A}=Y,L=j(Y,["sheetID","sheetGroups","parent","gravityPoint","content","close_option","hold_state","openAfter","closeAfter","overwrap","isOpen","backgroundEffect"]),[z]=D(n.uuid.gen()),m=n.is.element(a)?n(a):n.is.jsmin(a)?a:N(a),p='[data-sheet-id="'+z+'"]',k='[data-sheet-content="'+z+'"]';o=o;let b=o%5||5,I=Math.ceil(o/5);const M=()=>{let T={},{top:S,right:u,bottom:f,left:V,height:x,width:U}=m.position();return[1,2].includes(b)?T.left=V:b==3?T.left=V+U/2:[4,5].includes(b)&&(T.left=u),o<=10?T.top=S:o<=15?T.top=S+x/2:o<=25&&(T.top=f),T};let[O,W]=D(M());const P=()=>{let T=N(p).position(),S=N(k).position(),u=n.getScreenSize(),f=d({},O);return S.top<0&&(f.top=T.top-S.top),S.left<0&&(f.left=T.left-S.left),S.right>u.width&&(f.left=T.left-(S.right-u.width)),S.bottom>u.height&&(f.top=T.top-(S.bottom-u.height)),f};return F(()=>{N(p).await(10).addClass(l("Open")).await(250).callback(()=>{W(P())}),_.update({key:"customSheet-"+e.sheetID,value:{reposition:()=>{setTimeout(()=>{W(P())},200)}}})},[]),m[0]?i(B,{className:[l("BB"),l("CustomSheet")].join(" "),"data-sheet-id":z,transition:"long",opacity:"trans",position:"absolute",width:0,height:0,flexCenter:!0,freeCSS:O,children:i(ee,{className:[l("GPT"),l("GPT_"+o),l("Col_"+b),l("Row_"+I)].join(" "),position:"absolute",children:i(B,R(d({flexSizing:"none","data-sheet-content":z,maxHeight:"viewHeight",overflow:"auto",padding:1},L),{freeCSS:d({maxWidth:"98vw"},L.freeCSS),children:n.is.function(h)?i(h,{}):h}))})}):null}},TapSensor:e=>i(B,{className:l("TapSensor"),children:i(Z.Button.Plain,{className:l("TapContent"),onClick:()=>{var t;(t=e.delegateAroundClick)!=null&&t&&E.close(e.sheetID)},freeCSS:{cursor:"default",pointerEvents:"all"}})})},E={Wrapper:()=>i(c.Wrapper,{}),open:e=>{if(e.sheetID=(e.sheetID||"").replace(/\./g,"-"),e.type=="image"){let r=e.sheetID||n.uuid.gen(),t=e,{type:a,src:o}=t,h=j(t,["type","src"]);E.open(R(d({type:"normal.topCenter",backgroundColor:"trans"},h),{sheetID:r,freeCSS:{maxWidth:"96vw",transformOrigin:"top"},content:()=>{let[g]=D(n.flatArray(o)),[s,v]=D(0),w=[],C=[];return g.forEach((y,A)=>{w.push({value:A,label:i(J,{src:n.flatArray(y)[0],width:"auto",height:1,freeCSS:{maxWidth:12*6,maxHeight:12*3}})}),C.push(i(J,{width:1,height:"auto",src:n.flatArray(y)[0]}))}),G(X,{gap:0,children:[G(K.Separate,{gap:2,padding:1,backgroundColor:"1.layer.base",borderTopLeftRadius:"1.tone.primary",borderTopRightRadius:"1.tone.primary",children:[i(oe.Radio,{tone:"border",icon:!1,value:s,override:"force",horizontalAlign:"center",onUpdateValidValue:({value:y})=>{v(y[0])},cellStyles:{borderWidth:2,padding:"1/3"},options:w}),G(Z.Button.Border.R,{color:"cloud",isRounded:!0,onClick:()=>{E.close(r)},children:["\u9589\u3058\u308B ",i(Q.Times,{})]})]}),i(te.SwipeView,{slideIndex:s,options:{loop:g.length>1,onSlideCallback:y=>{v(y)}},slides:C,wrapper:y=>i(B,{borderBottomLeftRadius:"1.tone.primary",borderBottomRightRadius:"1.tone.primary",children:y})})]})}}));return}c.addNewSheet(e)},refresh:(e,t)=>{e.sheetID=(e.sheetID||"").replace(/\./g,"-");let r=_.get(e.sheetID);r&&r.refresh&&r.refresh(e,t)},resize:e=>{e.sheetID=(e.sheetID||"").replace(/\./g,"-");let t=_.get(e.sheetID);t&&t.resize&&t.resize(e.size)},reposition:e=>{let t=_.get("customSheet-"+e);t&&t.reposition&&t.reposition()},close:function(e,t,r){var o;e=e==null?void 0:e.replace(/\./g,"-");let a=c.contents[e];if(a&&!(t=="Escape"&&!((o=a.params.close_option)!=null&&o.escapeKeyDown))){let{params:h}=a,{sheetID:g}=h,s=_.get(g);s&&s.close&&s.close(r)}},closeGroup:e=>{var t;e=(e||"").replace(/\./g,"-");for(let[r,a]of Object.entries(c.contents))(t=a.params.sheetGroups)!=null&&t.includes(e)&&E.close(r)},closeAll:e=>{var t;for(let[r,a]of Object.entries(c.contents))e&&((t=a.params.close_option)==null?void 0:t.pageTransit)==!1||E.close(r,"pageTransit",!0)},Comps:{Body:e=>i(B,d({className:l("BaseBody"),backgroundColor:"1.layer.base",borderRadius:"1.tone.primary",position:"relative",boxShadow:"3.remark",transition:"long"},e))}};export{E as Sheet,E as default};
|