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
|
@@ -1 +1,472 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__async,
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "../../../chunk-JJ3PEWPN.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import {
|
|
9
|
+
useState,
|
|
10
|
+
useEffect,
|
|
11
|
+
useRef
|
|
12
|
+
} from "react";
|
|
13
|
+
import {
|
|
14
|
+
$$,
|
|
15
|
+
$$fromRoot,
|
|
16
|
+
useStore
|
|
17
|
+
} from "../../../@utils/_";
|
|
18
|
+
import Box from "../../../atoms/Box";
|
|
19
|
+
import FAI from "../../../atoms/FAI";
|
|
20
|
+
import Span from "../../../atoms/Span";
|
|
21
|
+
import Column from "../../../mols/Column";
|
|
22
|
+
import Row from "../../../mols/Row";
|
|
23
|
+
import Button from "../../Button";
|
|
24
|
+
import Sheet from "../../Sheet";
|
|
25
|
+
import Loader from "../../Loader/_";
|
|
26
|
+
import Text from "../Text";
|
|
27
|
+
import Parts from "../Parts";
|
|
28
|
+
import { InputChipsClasses } from "../../../@styles/componentClasses/_";
|
|
29
|
+
const Component = (params) => {
|
|
30
|
+
let [val_status, set_status] = useState("show");
|
|
31
|
+
let [val_keyword, set_keyword] = useState("");
|
|
32
|
+
let [val_componentID] = useState($$.uuid.gen());
|
|
33
|
+
let [val_options, set_options] = useState(params.options);
|
|
34
|
+
let [val_focus, set_focus] = useState(val_options[0] || null);
|
|
35
|
+
let [val_selected, set_selected] = useState(params.selected);
|
|
36
|
+
let [val_keyEvent, set_keyEvent] = useState("init");
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
useStore.set({
|
|
39
|
+
key: params.selectorID,
|
|
40
|
+
value: {
|
|
41
|
+
updateOptions: (options) => {
|
|
42
|
+
set_options(options);
|
|
43
|
+
},
|
|
44
|
+
updateSelected: (selected) => {
|
|
45
|
+
set_selected(selected);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
const mountedOptions = useRef(false);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (mountedOptions.current) {
|
|
53
|
+
Sheet.reposition(params.selectorID);
|
|
54
|
+
} else {
|
|
55
|
+
mountedOptions.current = true;
|
|
56
|
+
}
|
|
57
|
+
}, [val_options]);
|
|
58
|
+
const mountedKeyword = useRef(false);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (mountedKeyword.current) {
|
|
61
|
+
set_status("interlude");
|
|
62
|
+
set_focus(val_options[0] || null);
|
|
63
|
+
if (params.onDynamicSearch) {
|
|
64
|
+
$$.interval.clear(val_componentID + "-dynamicSearch");
|
|
65
|
+
$$.interval.standBy(
|
|
66
|
+
val_componentID + "-dynamicSearch",
|
|
67
|
+
400,
|
|
68
|
+
() => __async(void 0, null, function* () {
|
|
69
|
+
let {
|
|
70
|
+
options
|
|
71
|
+
} = yield params.onDynamicSearch(val_keyword);
|
|
72
|
+
set_options(options);
|
|
73
|
+
set_status("show");
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
77
|
+
$$.interval.clear(val_componentID + "-staticSearch");
|
|
78
|
+
$$.interval.standBy(
|
|
79
|
+
val_componentID + "-staticSearch",
|
|
80
|
+
400,
|
|
81
|
+
() => __async(void 0, null, function* () {
|
|
82
|
+
let regExp = new RegExp(val_keyword, "ig");
|
|
83
|
+
let newSelection = [];
|
|
84
|
+
[...params.options].forEach((o) => {
|
|
85
|
+
var _a;
|
|
86
|
+
let match = Boolean(!val_keyword || ((_a = String(o.label)) != null ? _a : String(o.value)).match(regExp));
|
|
87
|
+
if (match)
|
|
88
|
+
newSelection.push(o);
|
|
89
|
+
});
|
|
90
|
+
set_options(newSelection);
|
|
91
|
+
set_status("show");
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
mountedKeyword.current = true;
|
|
97
|
+
}
|
|
98
|
+
}, [val_keyword]);
|
|
99
|
+
const mountedSelected = useRef(false);
|
|
100
|
+
useEffect(() => {
|
|
101
|
+
if (mountedSelected.current) {
|
|
102
|
+
params.onUpdated({
|
|
103
|
+
values: val_selected
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
mountedSelected.current = true;
|
|
107
|
+
}
|
|
108
|
+
}, [val_selected]);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
$$.scope(() => {
|
|
111
|
+
if ($$.is.nullish(val_focus))
|
|
112
|
+
return;
|
|
113
|
+
if (val_keyEvent == "MouseEvent")
|
|
114
|
+
return;
|
|
115
|
+
let Wrapper = $$fromRoot("#" + val_componentID + "-Selector-Cell-Wrap");
|
|
116
|
+
if (!Wrapper[0])
|
|
117
|
+
return;
|
|
118
|
+
let focusCell = $$fromRoot('[data-chips-selector-cell="' + val_componentID + "-" + JSON.stringify((val_focus == null ? void 0 : val_focus.value) || "").replace(/\"/ig, "") + '"]');
|
|
119
|
+
if (!focusCell[0])
|
|
120
|
+
return;
|
|
121
|
+
let { top: pTop, height: pHeight } = Wrapper.position();
|
|
122
|
+
let { top: cTop, height: cHeight } = focusCell.position();
|
|
123
|
+
if (pTop <= cTop && cTop + cHeight <= pTop + pHeight)
|
|
124
|
+
return;
|
|
125
|
+
let scroll = Wrapper[0].scrollTop + (cTop - pTop);
|
|
126
|
+
if (val_keyEvent == "ArrowDown") {
|
|
127
|
+
scroll -= pHeight - cHeight - 20;
|
|
128
|
+
} else if (val_keyEvent == "ArrowUp") {
|
|
129
|
+
scroll -= 20;
|
|
130
|
+
}
|
|
131
|
+
Wrapper[0].scrollTop = scroll;
|
|
132
|
+
});
|
|
133
|
+
}, [val_focus]);
|
|
134
|
+
let List = [];
|
|
135
|
+
if (val_status == "interlude") {
|
|
136
|
+
List = [/* @__PURE__ */ jsxs(
|
|
137
|
+
Row.Center,
|
|
138
|
+
{
|
|
139
|
+
padding: 2,
|
|
140
|
+
gap: 0,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
Loader.Theme.R,
|
|
144
|
+
{
|
|
145
|
+
showInitial: true
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
Box,
|
|
150
|
+
{
|
|
151
|
+
padding: [0, 1],
|
|
152
|
+
fontSize: "1.mini",
|
|
153
|
+
fontColor: "4.thin",
|
|
154
|
+
children: "\u691C\u7D22\u4E2D..."
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
)];
|
|
160
|
+
} else {
|
|
161
|
+
List = [
|
|
162
|
+
val_options.map((option, index) => {
|
|
163
|
+
let {
|
|
164
|
+
value,
|
|
165
|
+
label
|
|
166
|
+
} = option;
|
|
167
|
+
let safeValue = String(JSON.stringify(value));
|
|
168
|
+
let findIndex = val_selected.findIndex((v) => JSON.stringify(v.value) == safeValue);
|
|
169
|
+
let isSelected = findIndex != -1;
|
|
170
|
+
let isFocused = JSON.stringify((val_focus == null ? void 0 : val_focus.value) || "") == safeValue;
|
|
171
|
+
let styles = {};
|
|
172
|
+
if (isSelected || isFocused) {
|
|
173
|
+
styles = {
|
|
174
|
+
fontColor: "theme",
|
|
175
|
+
isSemiBoldFont: true
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (isFocused)
|
|
179
|
+
styles.backgroundColor = "cloud";
|
|
180
|
+
if (isSelected)
|
|
181
|
+
styles.backgroundColor = "tcOpFew";
|
|
182
|
+
return /* @__PURE__ */ jsx(
|
|
183
|
+
Button.Button.Clear.R,
|
|
184
|
+
__spreadProps(__spreadValues({
|
|
185
|
+
borderRadius: "3.tone.tertiary",
|
|
186
|
+
color: "cloud",
|
|
187
|
+
padding: "1/3",
|
|
188
|
+
tabIndex: -1,
|
|
189
|
+
textAlign: "left",
|
|
190
|
+
"data-chips-selector-cell": val_componentID + "-" + safeValue.replace(/\"/ig, ""),
|
|
191
|
+
isActive: isSelected || isFocused,
|
|
192
|
+
isActiveStyles: styles
|
|
193
|
+
}, styles), {
|
|
194
|
+
onMouseOver: () => {
|
|
195
|
+
set_keyEvent("MouseEvent");
|
|
196
|
+
set_focus(option);
|
|
197
|
+
},
|
|
198
|
+
onClick: () => {
|
|
199
|
+
let newSelected = [...val_selected];
|
|
200
|
+
if (isSelected) {
|
|
201
|
+
newSelected.splice(findIndex, 1);
|
|
202
|
+
} else {
|
|
203
|
+
newSelected = [
|
|
204
|
+
...newSelected,
|
|
205
|
+
option
|
|
206
|
+
];
|
|
207
|
+
if (params.limit && newSelected.length > params.limit) {
|
|
208
|
+
newSelected.shift();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
set_selected(newSelected);
|
|
212
|
+
},
|
|
213
|
+
children: /* @__PURE__ */ jsx(
|
|
214
|
+
params.SelectorCellComponent,
|
|
215
|
+
{
|
|
216
|
+
isSelected,
|
|
217
|
+
isFocused,
|
|
218
|
+
value,
|
|
219
|
+
label
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
}),
|
|
223
|
+
index
|
|
224
|
+
);
|
|
225
|
+
})
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
229
|
+
/* @__PURE__ */ jsxs(
|
|
230
|
+
Column,
|
|
231
|
+
{
|
|
232
|
+
padding: "2/3",
|
|
233
|
+
gap: "2/3",
|
|
234
|
+
borderBottom: true,
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ jsxs(Row.Separate, { children: [
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
Text.Normal,
|
|
239
|
+
{
|
|
240
|
+
value: val_keyword,
|
|
241
|
+
onUpdateValidValue: ({ value }) => {
|
|
242
|
+
set_keyword(value);
|
|
243
|
+
},
|
|
244
|
+
id: params.selectorID + "-KeywordInput",
|
|
245
|
+
padding: "2/3",
|
|
246
|
+
placeholder: "\u691C\u7D22...",
|
|
247
|
+
leftIcon: /* @__PURE__ */ jsx(
|
|
248
|
+
Parts.LeftIcon,
|
|
249
|
+
{
|
|
250
|
+
right: "2/3",
|
|
251
|
+
fontSize: "1.mini",
|
|
252
|
+
fontColor: "3.blur",
|
|
253
|
+
children: /* @__PURE__ */ jsx(FAI.Search, {})
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
onKeyDown: (event) => {
|
|
257
|
+
let {
|
|
258
|
+
key,
|
|
259
|
+
metaKey,
|
|
260
|
+
ctrlKey
|
|
261
|
+
} = event;
|
|
262
|
+
let auxKey = metaKey || ctrlKey;
|
|
263
|
+
if (["ArrowDown", "ArrowUp"].includes(key)) {
|
|
264
|
+
let dir = Number(key == "ArrowDown") * 2 - 1;
|
|
265
|
+
if (auxKey) {
|
|
266
|
+
let next = val_options[dir == 1 ? val_options.length - 1 : 0];
|
|
267
|
+
set_focus(next);
|
|
268
|
+
} else {
|
|
269
|
+
let nextIndex = val_options.findIndex((v) => JSON.stringify(v.value) == JSON.stringify((val_focus == null ? void 0 : val_focus.value) || "")) + dir;
|
|
270
|
+
if (val_options[nextIndex]) {
|
|
271
|
+
set_focus(val_options[nextIndex]);
|
|
272
|
+
} else {
|
|
273
|
+
set_focus(val_options[dir == 1 ? 0 : val_options.length - 1] || null);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
} else if (key == "Enter") {
|
|
277
|
+
let selectedIndex = val_selected.findIndex((v) => JSON.stringify(v.value) == JSON.stringify((val_focus == null ? void 0 : val_focus.value) || ""));
|
|
278
|
+
let isSelected = selectedIndex != -1;
|
|
279
|
+
let newSelected = [...val_selected];
|
|
280
|
+
if (isSelected) {
|
|
281
|
+
newSelected.splice(selectedIndex, 1);
|
|
282
|
+
} else {
|
|
283
|
+
let optionsIndex = val_options.findIndex((v) => JSON.stringify(v.value) == JSON.stringify((val_focus == null ? void 0 : val_focus.value) || ""));
|
|
284
|
+
if (optionsIndex == -1)
|
|
285
|
+
return;
|
|
286
|
+
newSelected = [
|
|
287
|
+
...newSelected,
|
|
288
|
+
val_options[optionsIndex]
|
|
289
|
+
];
|
|
290
|
+
if (params.limit && newSelected.length > params.limit) {
|
|
291
|
+
newSelected.shift();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
set_selected(newSelected);
|
|
295
|
+
}
|
|
296
|
+
set_keyEvent(key);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
Button.Button.Border.S,
|
|
302
|
+
{
|
|
303
|
+
marginRight: "1/3",
|
|
304
|
+
ssSphere: 2,
|
|
305
|
+
backgroundColor: "cloud",
|
|
306
|
+
borderRadius: "2.tone.secondary",
|
|
307
|
+
onClick: () => {
|
|
308
|
+
Sheet.close(params.selectorID);
|
|
309
|
+
},
|
|
310
|
+
children: /* @__PURE__ */ jsx(FAI.Times, {})
|
|
311
|
+
}
|
|
312
|
+
)
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ jsxs(Row.Separate, { children: [
|
|
315
|
+
/* @__PURE__ */ jsxs(
|
|
316
|
+
Row.Left,
|
|
317
|
+
{
|
|
318
|
+
gap: "1/2",
|
|
319
|
+
verticalAlign: "baseline",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ jsx(
|
|
322
|
+
Span,
|
|
323
|
+
{
|
|
324
|
+
fontColor: "theme",
|
|
325
|
+
children: val_options.length
|
|
326
|
+
}
|
|
327
|
+
),
|
|
328
|
+
/* @__PURE__ */ jsx(
|
|
329
|
+
Box,
|
|
330
|
+
{
|
|
331
|
+
fontSize: "1.mini",
|
|
332
|
+
fontColor: "3.blur",
|
|
333
|
+
children: "\u4EF6\u306E\u30D2\u30C3\u30C8"
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
),
|
|
339
|
+
/* @__PURE__ */ jsx(Row.Right, { children: !!params.limit && /* @__PURE__ */ jsxs(
|
|
340
|
+
Span,
|
|
341
|
+
{
|
|
342
|
+
fontColor: "3.blur",
|
|
343
|
+
fontSize: "1.mini",
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx(
|
|
346
|
+
Span,
|
|
347
|
+
{
|
|
348
|
+
fontSize: "3.paragraph",
|
|
349
|
+
fontColor: "theme",
|
|
350
|
+
isSemiBoldFont: true,
|
|
351
|
+
children: val_selected.length
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
" / ",
|
|
355
|
+
params.limit,
|
|
356
|
+
" \u4EF6"
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
) })
|
|
360
|
+
] })
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
),
|
|
364
|
+
/* @__PURE__ */ jsx(
|
|
365
|
+
Column,
|
|
366
|
+
{
|
|
367
|
+
gap: "1/4",
|
|
368
|
+
padding: "1/2",
|
|
369
|
+
overflow: "auto",
|
|
370
|
+
freeCSS: {
|
|
371
|
+
maxHeight: 12 * 26,
|
|
372
|
+
maxWidth: 12 * 26
|
|
373
|
+
},
|
|
374
|
+
id: val_componentID + "-Selector-Cell-Wrap",
|
|
375
|
+
className: InputChipsClasses("SelectorWrapper"),
|
|
376
|
+
children: List
|
|
377
|
+
}
|
|
378
|
+
),
|
|
379
|
+
params.bottomContent
|
|
380
|
+
] });
|
|
381
|
+
};
|
|
382
|
+
const Selector = {
|
|
383
|
+
openSelector: (params) => {
|
|
384
|
+
let _a = params, {
|
|
385
|
+
selectorID,
|
|
386
|
+
options,
|
|
387
|
+
selected,
|
|
388
|
+
limit,
|
|
389
|
+
bottomContent,
|
|
390
|
+
onDynamicSearch,
|
|
391
|
+
SelectorCellComponent,
|
|
392
|
+
onUpdated,
|
|
393
|
+
onClosed,
|
|
394
|
+
parent
|
|
395
|
+
} = _a, sheetarams = __objRest(_a, [
|
|
396
|
+
"selectorID",
|
|
397
|
+
"options",
|
|
398
|
+
"selected",
|
|
399
|
+
"limit",
|
|
400
|
+
"bottomContent",
|
|
401
|
+
"onDynamicSearch",
|
|
402
|
+
"SelectorCellComponent",
|
|
403
|
+
"onUpdated",
|
|
404
|
+
"onClosed",
|
|
405
|
+
"parent"
|
|
406
|
+
]);
|
|
407
|
+
let sheetID = selectorID;
|
|
408
|
+
SelectorCellComponent = SelectorCellComponent || ((params2) => {
|
|
409
|
+
return /* @__PURE__ */ jsx(Row.Left, { children: params2.label });
|
|
410
|
+
});
|
|
411
|
+
Sheet.open(__spreadProps(__spreadValues({
|
|
412
|
+
parent,
|
|
413
|
+
sheetID,
|
|
414
|
+
type: "custom",
|
|
415
|
+
gravityPoint: 22,
|
|
416
|
+
padding: [1, 0],
|
|
417
|
+
hold_state: true,
|
|
418
|
+
close_option: {
|
|
419
|
+
aroundClick: true,
|
|
420
|
+
escapeKeyDown: true
|
|
421
|
+
}
|
|
422
|
+
}, sheetarams), {
|
|
423
|
+
content: /* @__PURE__ */ jsx(
|
|
424
|
+
Box,
|
|
425
|
+
{
|
|
426
|
+
borderRadius: "2.tone.secondary",
|
|
427
|
+
backgroundColor: "1.layer.base",
|
|
428
|
+
border: true,
|
|
429
|
+
boxShadow: "1.normal",
|
|
430
|
+
overflow: "hidden",
|
|
431
|
+
children: /* @__PURE__ */ jsx(
|
|
432
|
+
Component,
|
|
433
|
+
{
|
|
434
|
+
selectorID,
|
|
435
|
+
options,
|
|
436
|
+
limit,
|
|
437
|
+
selected,
|
|
438
|
+
onUpdated,
|
|
439
|
+
SelectorCellComponent,
|
|
440
|
+
bottomContent,
|
|
441
|
+
onDynamicSearch
|
|
442
|
+
},
|
|
443
|
+
JSON.stringify(selected)
|
|
444
|
+
)
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
openAfter: () => {
|
|
448
|
+
$$fromRoot("#" + params.selectorID + "-KeywordInput").focus();
|
|
449
|
+
},
|
|
450
|
+
closeAfter: () => {
|
|
451
|
+
onClosed();
|
|
452
|
+
}
|
|
453
|
+
}));
|
|
454
|
+
},
|
|
455
|
+
closeSelector: (selectorID) => {
|
|
456
|
+
Sheet.close(selectorID);
|
|
457
|
+
},
|
|
458
|
+
updateOptions: (selectorID, options) => {
|
|
459
|
+
let C = useStore.get(selectorID);
|
|
460
|
+
if (C && C.updateOptions)
|
|
461
|
+
C.updateOptions(options);
|
|
462
|
+
},
|
|
463
|
+
updateSelected: (selectorID, selected) => {
|
|
464
|
+
let C = useStore.get(selectorID);
|
|
465
|
+
if (C && C.updateSelected)
|
|
466
|
+
C.updateSelected(selected);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
export {
|
|
470
|
+
Selector,
|
|
471
|
+
Selector as default
|
|
472
|
+
};
|