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/Table/Drag.js
CHANGED
|
@@ -1 +1,435 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__async,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-JJ3PEWPN.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import {
|
|
8
|
+
useState,
|
|
9
|
+
useEffect
|
|
10
|
+
} from "react";
|
|
11
|
+
import {
|
|
12
|
+
$$,
|
|
13
|
+
$$fromRoot,
|
|
14
|
+
useStore
|
|
15
|
+
} from "../../@utils/_";
|
|
16
|
+
import FAI from "../../atoms/FAI";
|
|
17
|
+
import Button from "../Button";
|
|
18
|
+
import Tooltips from "../Tooltips";
|
|
19
|
+
import TableParts from "./Parts";
|
|
20
|
+
import Wrapper from "./Wrapper";
|
|
21
|
+
import { faGripVertical } from "@fortawesome/free-solid-svg-icons/faGripVertical";
|
|
22
|
+
import { DefaultCellSystemStyles } from "./cellStyling";
|
|
23
|
+
import { TableClasses } from "../../@styles/componentClasses/_";
|
|
24
|
+
const Comps = {
|
|
25
|
+
HeadRow: (props) => {
|
|
26
|
+
let {
|
|
27
|
+
cellStyles = {},
|
|
28
|
+
cellClassName = "",
|
|
29
|
+
cellStylesCallback,
|
|
30
|
+
colLength,
|
|
31
|
+
head,
|
|
32
|
+
rows
|
|
33
|
+
} = props;
|
|
34
|
+
if (!head)
|
|
35
|
+
return null;
|
|
36
|
+
let Cols = [];
|
|
37
|
+
for (let colIndex = 0; colIndex < colLength; colIndex++) {
|
|
38
|
+
let col = head[colIndex];
|
|
39
|
+
let Cell = TableParts[col.type == "th" ? "TH" : "TD"];
|
|
40
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
41
|
+
Cell,
|
|
42
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, cellStyles), DefaultCellSystemStyles({
|
|
43
|
+
top: true,
|
|
44
|
+
bottom: !rows.length,
|
|
45
|
+
left: colIndex == 0,
|
|
46
|
+
right: colIndex == colLength - 1
|
|
47
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
48
|
+
top: true,
|
|
49
|
+
bottom: !rows.length,
|
|
50
|
+
left: colIndex == 0,
|
|
51
|
+
right: colIndex == colLength - 1,
|
|
52
|
+
rowIndex: 0,
|
|
53
|
+
colIndex,
|
|
54
|
+
isBody: false,
|
|
55
|
+
isHeader: true
|
|
56
|
+
}) : {}), {
|
|
57
|
+
className: [
|
|
58
|
+
TableClasses("Cell"),
|
|
59
|
+
cellClassName,
|
|
60
|
+
col.className
|
|
61
|
+
].join(" ")
|
|
62
|
+
}), col)
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
TableParts.Row,
|
|
67
|
+
{
|
|
68
|
+
className: [TableClasses("Row"), TableClasses("HeadRow")].join(" "),
|
|
69
|
+
children: Cols
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
BodyRows: (props) => {
|
|
74
|
+
let {
|
|
75
|
+
cellStyles = {},
|
|
76
|
+
cellClassName = "",
|
|
77
|
+
cellStylesCallback,
|
|
78
|
+
head,
|
|
79
|
+
rows,
|
|
80
|
+
colLength,
|
|
81
|
+
onOrderChanged
|
|
82
|
+
} = props;
|
|
83
|
+
let [val_componentID] = useState($$.uuid.gen());
|
|
84
|
+
let [val_info, set_info] = useState({
|
|
85
|
+
rows,
|
|
86
|
+
origin: 0,
|
|
87
|
+
to: NaN
|
|
88
|
+
});
|
|
89
|
+
let BodyRows = [];
|
|
90
|
+
val_info.rows.forEach((cols, rowIndex) => {
|
|
91
|
+
let Cols = [];
|
|
92
|
+
{
|
|
93
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
94
|
+
TableParts.TH,
|
|
95
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
96
|
+
padding: 0,
|
|
97
|
+
borderRight: true
|
|
98
|
+
}, cellStyles), DefaultCellSystemStyles({
|
|
99
|
+
top: rowIndex == 0 && !head,
|
|
100
|
+
bottom: rowIndex == rows.length - 1,
|
|
101
|
+
left: true,
|
|
102
|
+
right: false
|
|
103
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
104
|
+
top: rowIndex == 0 && !head,
|
|
105
|
+
bottom: rowIndex == rows.length - 1,
|
|
106
|
+
left: true,
|
|
107
|
+
right: false,
|
|
108
|
+
rowIndex,
|
|
109
|
+
colIndex: 0,
|
|
110
|
+
isBody: true,
|
|
111
|
+
isHeader: false
|
|
112
|
+
}) : {}), {
|
|
113
|
+
className: [
|
|
114
|
+
TableClasses("Cell"),
|
|
115
|
+
TableClasses("Draggable"),
|
|
116
|
+
cellClassName
|
|
117
|
+
].join(" "),
|
|
118
|
+
children: /* @__PURE__ */ jsx(
|
|
119
|
+
Button.Button.Clear.R,
|
|
120
|
+
{
|
|
121
|
+
className: TableClasses("DragableButton"),
|
|
122
|
+
fontColor: "4.thin",
|
|
123
|
+
fontSize: "3.paragraph",
|
|
124
|
+
margin: "auto",
|
|
125
|
+
tabIndex: -1,
|
|
126
|
+
ssSphere: 3,
|
|
127
|
+
onMouseDown: (event) => {
|
|
128
|
+
Effects.Start(event, {
|
|
129
|
+
id: val_componentID,
|
|
130
|
+
index: rowIndex,
|
|
131
|
+
rows: val_info.rows,
|
|
132
|
+
maxLength: rows.length
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
onTouchStart: (event) => {
|
|
136
|
+
Effects.Start(event, {
|
|
137
|
+
id: val_componentID,
|
|
138
|
+
index: rowIndex,
|
|
139
|
+
rows: val_info.rows,
|
|
140
|
+
maxLength: rows.length
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
children: /* @__PURE__ */ jsx(FAI, { icon: faGripVertical })
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
}),
|
|
147
|
+
"DragOrigin"
|
|
148
|
+
));
|
|
149
|
+
}
|
|
150
|
+
cols.forEach((col, colIndex) => {
|
|
151
|
+
col = __spreadValues({}, col);
|
|
152
|
+
let Cell = TableParts[col.type == "th" ? "TH" : "TD"];
|
|
153
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
154
|
+
Cell,
|
|
155
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, cellStyles), DefaultCellSystemStyles({
|
|
156
|
+
top: !!head && !head.length,
|
|
157
|
+
bottom: rowIndex == rows.length - 1,
|
|
158
|
+
left: false,
|
|
159
|
+
right: colIndex == colLength - 2
|
|
160
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
161
|
+
top: !!head && !head.length,
|
|
162
|
+
bottom: rowIndex == rows.length - 1,
|
|
163
|
+
left: false,
|
|
164
|
+
right: colIndex == colLength - 2,
|
|
165
|
+
rowIndex,
|
|
166
|
+
colIndex,
|
|
167
|
+
isBody: true,
|
|
168
|
+
isHeader: false
|
|
169
|
+
}) : {}), {
|
|
170
|
+
className: [
|
|
171
|
+
TableClasses("Cell"),
|
|
172
|
+
cellClassName,
|
|
173
|
+
col.className
|
|
174
|
+
].join(" ")
|
|
175
|
+
}), col)
|
|
176
|
+
));
|
|
177
|
+
});
|
|
178
|
+
BodyRows.push(/* @__PURE__ */ jsx(
|
|
179
|
+
TableParts.Row,
|
|
180
|
+
{
|
|
181
|
+
id: "TableRow-" + val_componentID + "-" + rowIndex,
|
|
182
|
+
"data-rowId": rowIndex,
|
|
183
|
+
className: [TableClasses("Row"), TableClasses("BodyRow")].join(" "),
|
|
184
|
+
children: Cols
|
|
185
|
+
},
|
|
186
|
+
rowIndex
|
|
187
|
+
));
|
|
188
|
+
});
|
|
189
|
+
if (!isNaN(val_info.to)) {
|
|
190
|
+
let {
|
|
191
|
+
origin,
|
|
192
|
+
to
|
|
193
|
+
} = val_info;
|
|
194
|
+
let Cols = [];
|
|
195
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
196
|
+
TableParts.TH,
|
|
197
|
+
{
|
|
198
|
+
backgroundColor: "tcOpLow",
|
|
199
|
+
padding: 0,
|
|
200
|
+
borderRight: "2.normal",
|
|
201
|
+
className: [
|
|
202
|
+
TableClasses("Cell"),
|
|
203
|
+
TableClasses("Draggable"),
|
|
204
|
+
cellClassName
|
|
205
|
+
].join(" "),
|
|
206
|
+
children: /* @__PURE__ */ jsx(
|
|
207
|
+
FAI.ArrowRight,
|
|
208
|
+
{
|
|
209
|
+
fontColor: "theme"
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
},
|
|
213
|
+
"dragButton"
|
|
214
|
+
));
|
|
215
|
+
let cols = val_info.rows[origin];
|
|
216
|
+
cols.forEach((col, colIndex) => {
|
|
217
|
+
col = __spreadValues({}, col);
|
|
218
|
+
let Cell = TableParts[col.type == "th" ? "TH" : "TD"];
|
|
219
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
220
|
+
Cell,
|
|
221
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, cellStyles), DefaultCellSystemStyles({
|
|
222
|
+
top: false,
|
|
223
|
+
bottom: false,
|
|
224
|
+
left: false,
|
|
225
|
+
right: false
|
|
226
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
227
|
+
top: false,
|
|
228
|
+
bottom: false,
|
|
229
|
+
left: false,
|
|
230
|
+
right: false,
|
|
231
|
+
rowIndex: -1,
|
|
232
|
+
colIndex: -1,
|
|
233
|
+
isBody: true,
|
|
234
|
+
isHeader: false
|
|
235
|
+
}) : {}), {
|
|
236
|
+
className: [
|
|
237
|
+
TableClasses("Cell"),
|
|
238
|
+
cellClassName,
|
|
239
|
+
col.className
|
|
240
|
+
].join(" "),
|
|
241
|
+
backgroundColor: "tcOpLow"
|
|
242
|
+
}), col)
|
|
243
|
+
));
|
|
244
|
+
});
|
|
245
|
+
BodyRows.splice(to, 0, /* @__PURE__ */ jsx(
|
|
246
|
+
TableParts.Row,
|
|
247
|
+
{
|
|
248
|
+
className: [TableClasses("Row"), TableClasses("Pre")].join(" "),
|
|
249
|
+
children: Cols
|
|
250
|
+
},
|
|
251
|
+
"preSet"
|
|
252
|
+
));
|
|
253
|
+
}
|
|
254
|
+
useEffect(() => {
|
|
255
|
+
useStore.set({
|
|
256
|
+
key: val_componentID,
|
|
257
|
+
value: {
|
|
258
|
+
swap: (rowIndex, insertIndex) => {
|
|
259
|
+
if (insertIndex || insertIndex == 0) {
|
|
260
|
+
let targetRow = val_info.rows[rowIndex];
|
|
261
|
+
let newRows = [...val_info.rows];
|
|
262
|
+
newRows.splice(rowIndex, 1);
|
|
263
|
+
newRows.splice(insertIndex - (rowIndex < insertIndex ? 1 : 0), 0, targetRow);
|
|
264
|
+
set_info({
|
|
265
|
+
rows: newRows,
|
|
266
|
+
origin: 0,
|
|
267
|
+
to: NaN
|
|
268
|
+
});
|
|
269
|
+
onOrderChanged(newRows.map((row) => JSON.parse(row.rowID)));
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
preSet: (props2) => {
|
|
273
|
+
let {
|
|
274
|
+
origin,
|
|
275
|
+
index
|
|
276
|
+
} = props2;
|
|
277
|
+
set_info({
|
|
278
|
+
rows: val_info.rows,
|
|
279
|
+
origin,
|
|
280
|
+
to: index
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
return () => {
|
|
288
|
+
useStore.delete(val_componentID);
|
|
289
|
+
};
|
|
290
|
+
}, []);
|
|
291
|
+
return /* @__PURE__ */ jsx(Fragment, { children: BodyRows });
|
|
292
|
+
},
|
|
293
|
+
Drag: (params) => {
|
|
294
|
+
params = __spreadValues({}, params);
|
|
295
|
+
params.colLength = params.colLength + 1;
|
|
296
|
+
if (params.head) {
|
|
297
|
+
params.head = [
|
|
298
|
+
{
|
|
299
|
+
children: /* @__PURE__ */ jsx(
|
|
300
|
+
Button.Button.Clear.R,
|
|
301
|
+
{
|
|
302
|
+
ssSphere: 3,
|
|
303
|
+
fontSize: "3.paragraph",
|
|
304
|
+
fontColor: "theme",
|
|
305
|
+
onMouseOver: (event) => {
|
|
306
|
+
Tooltips.open({
|
|
307
|
+
parent: event.currentTarget,
|
|
308
|
+
content: /* @__PURE__ */ jsxs(Tooltips.Comps.Body, { children: [
|
|
309
|
+
/* @__PURE__ */ jsx(FAI, { icon: faGripVertical }),
|
|
310
|
+
"\u30DC\u30BF\u30F3\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u9806\u5E8F\u3092\u5909\u66F4"
|
|
311
|
+
] })
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
children: /* @__PURE__ */ jsx(FAI.QuestionCircle, {})
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
padding: [0, 1],
|
|
318
|
+
unitWidth: 4
|
|
319
|
+
},
|
|
320
|
+
...params.head
|
|
321
|
+
];
|
|
322
|
+
}
|
|
323
|
+
params.rows = params.rows.map((row, rowIndex) => {
|
|
324
|
+
row.rowID = JSON.stringify(row.rowID || rowIndex);
|
|
325
|
+
return row;
|
|
326
|
+
});
|
|
327
|
+
return /* @__PURE__ */ jsxs(TableParts.Table, { className: TableClasses("Table"), children: [
|
|
328
|
+
/* @__PURE__ */ jsx(Comps.HeadRow, __spreadValues({}, params)),
|
|
329
|
+
/* @__PURE__ */ jsx(Comps.BodyRows, __spreadValues({}, params))
|
|
330
|
+
] });
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
const Drag = (params) => /* @__PURE__ */ jsx(
|
|
334
|
+
Wrapper,
|
|
335
|
+
__spreadProps(__spreadValues({
|
|
336
|
+
type: "drag"
|
|
337
|
+
}, params), {
|
|
338
|
+
JSXChildren: Comps.Drag
|
|
339
|
+
})
|
|
340
|
+
);
|
|
341
|
+
const Effects = {
|
|
342
|
+
Start: function(event, info) {
|
|
343
|
+
return __async(this, null, function* () {
|
|
344
|
+
event.stopPropagation();
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
let {
|
|
347
|
+
id,
|
|
348
|
+
index,
|
|
349
|
+
rows,
|
|
350
|
+
maxLength
|
|
351
|
+
} = info;
|
|
352
|
+
$$fromRoot("#TableRow-" + id + "-" + index).addClass(TableClasses("DraggerOrigin"));
|
|
353
|
+
$$(document).addEvent({
|
|
354
|
+
eventID: "DragMouseMove",
|
|
355
|
+
eventType: "mousemove",
|
|
356
|
+
callback: (event2) => {
|
|
357
|
+
Effects.Move(event2, info);
|
|
358
|
+
},
|
|
359
|
+
options: { passive: false }
|
|
360
|
+
}).addEvent({
|
|
361
|
+
eventID: "DragTouchMove",
|
|
362
|
+
eventType: "touchmove",
|
|
363
|
+
callback: (event2) => {
|
|
364
|
+
Effects.Move(event2, info);
|
|
365
|
+
},
|
|
366
|
+
options: { passive: false }
|
|
367
|
+
}).addEvent({
|
|
368
|
+
eventID: "DragMouseUp",
|
|
369
|
+
eventType: "mouseup",
|
|
370
|
+
callback: (event2) => {
|
|
371
|
+
Effects.End(event2, info);
|
|
372
|
+
}
|
|
373
|
+
}).addEvent({
|
|
374
|
+
eventID: "DragTouchEnd",
|
|
375
|
+
eventType: "touchend",
|
|
376
|
+
callback: (event2) => {
|
|
377
|
+
Effects.End(event2, info);
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
},
|
|
382
|
+
Move: function(event, info) {
|
|
383
|
+
let {
|
|
384
|
+
id,
|
|
385
|
+
maxLength
|
|
386
|
+
} = info;
|
|
387
|
+
let Y = $$.getCursor(event).y - $$.getScreenSize().scrollY;
|
|
388
|
+
for (let rowIndex = 0; rowIndex < maxLength; rowIndex++) {
|
|
389
|
+
let Row = $$fromRoot("#TableRow-" + id + "-" + rowIndex);
|
|
390
|
+
let {
|
|
391
|
+
top: rT,
|
|
392
|
+
bottom: rB,
|
|
393
|
+
height: rH
|
|
394
|
+
} = Row.position();
|
|
395
|
+
if (rowIndex == 0 && Y < rT) {
|
|
396
|
+
info.insertIndex = 0;
|
|
397
|
+
} else if (rowIndex === maxLength - 1 && rB <= Y) {
|
|
398
|
+
info.insertIndex = maxLength;
|
|
399
|
+
} else if (Y >= rT && Y < rB) {
|
|
400
|
+
info.insertIndex = rowIndex + 1;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
{
|
|
404
|
+
let {
|
|
405
|
+
index,
|
|
406
|
+
insertIndex
|
|
407
|
+
} = info;
|
|
408
|
+
let component = useStore.get(id);
|
|
409
|
+
if (component && component.preSet)
|
|
410
|
+
component.preSet({
|
|
411
|
+
origin: index,
|
|
412
|
+
index: insertIndex
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
event.stopPropagation();
|
|
416
|
+
event.preventDefault();
|
|
417
|
+
return false;
|
|
418
|
+
},
|
|
419
|
+
End: function(event, info) {
|
|
420
|
+
let {
|
|
421
|
+
id,
|
|
422
|
+
index,
|
|
423
|
+
insertIndex
|
|
424
|
+
} = info;
|
|
425
|
+
let component = useStore.get(id);
|
|
426
|
+
if (component && component.swap)
|
|
427
|
+
component.swap(index, insertIndex);
|
|
428
|
+
$$fromRoot("#TableRow-" + id + "-" + index).removeClass(TableClasses("DraggerOrigin"));
|
|
429
|
+
$$(document).removeEvent(["DragMouseMove", "DragTouchMove", "DragMouseUp", "DragTouchEnd"]);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
export {
|
|
433
|
+
Drag,
|
|
434
|
+
Drag as default
|
|
435
|
+
};
|
package/dist/fn/Table/Normal.js
CHANGED
|
@@ -1 +1,136 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-JJ3PEWPN.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import TableParts from "./Parts";
|
|
7
|
+
import Wrapper from "./Wrapper";
|
|
8
|
+
import { DefaultCellSystemStyles } from "./cellStyling";
|
|
9
|
+
import { TableClasses } from "../../@styles/componentClasses/_";
|
|
10
|
+
const Comps = {
|
|
11
|
+
HeadRow: (params) => {
|
|
12
|
+
let {
|
|
13
|
+
cellStyles = {},
|
|
14
|
+
cellClassName = "",
|
|
15
|
+
cellStylesCallback,
|
|
16
|
+
colLength,
|
|
17
|
+
head,
|
|
18
|
+
rows
|
|
19
|
+
} = params;
|
|
20
|
+
if (!head)
|
|
21
|
+
return null;
|
|
22
|
+
let Cols = [];
|
|
23
|
+
head.forEach((col, colIndex) => {
|
|
24
|
+
let Cell = TableParts[col.type == "th" ? "TH" : "TD"];
|
|
25
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
26
|
+
Cell,
|
|
27
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, cellStyles), DefaultCellSystemStyles({
|
|
28
|
+
top: true,
|
|
29
|
+
bottom: !rows.length,
|
|
30
|
+
left: colIndex == 0,
|
|
31
|
+
right: colIndex == colLength - 1
|
|
32
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
33
|
+
top: true,
|
|
34
|
+
bottom: !rows.length,
|
|
35
|
+
left: colIndex == 0,
|
|
36
|
+
right: colIndex == colLength - 1,
|
|
37
|
+
rowIndex: 0,
|
|
38
|
+
colIndex,
|
|
39
|
+
isBody: false,
|
|
40
|
+
isHeader: true
|
|
41
|
+
}) : {}), {
|
|
42
|
+
className: [
|
|
43
|
+
TableClasses("Cell"),
|
|
44
|
+
cellClassName,
|
|
45
|
+
col.className
|
|
46
|
+
].join(" ")
|
|
47
|
+
}), col)
|
|
48
|
+
));
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
TableParts.Row,
|
|
52
|
+
{
|
|
53
|
+
className: [TableClasses("Row"), TableClasses("HeadRow")].join(" "),
|
|
54
|
+
children: Cols
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
BodyRows: (params) => {
|
|
59
|
+
let {
|
|
60
|
+
cellStyles = {},
|
|
61
|
+
cellClassName = "",
|
|
62
|
+
cellStylesCallback,
|
|
63
|
+
head,
|
|
64
|
+
rows,
|
|
65
|
+
colLength,
|
|
66
|
+
onRowClick
|
|
67
|
+
} = params;
|
|
68
|
+
let BodyRows = [];
|
|
69
|
+
rows.forEach((cols, rowIndex) => {
|
|
70
|
+
let Cols = [];
|
|
71
|
+
cols.forEach((col, colIndex) => {
|
|
72
|
+
let Cell = TableParts[col.type == "th" ? "TH" : "TD"];
|
|
73
|
+
Cols.push(/* @__PURE__ */ jsx(
|
|
74
|
+
Cell,
|
|
75
|
+
__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, cellStyles), DefaultCellSystemStyles({
|
|
76
|
+
top: rowIndex == 0 && !head,
|
|
77
|
+
bottom: rowIndex == rows.length - 1,
|
|
78
|
+
left: colIndex == 0,
|
|
79
|
+
right: colIndex == colLength - 1
|
|
80
|
+
})), cellStylesCallback ? cellStylesCallback({
|
|
81
|
+
top: rowIndex == 0 && !head,
|
|
82
|
+
bottom: rowIndex == rows.length - 1,
|
|
83
|
+
left: colIndex == 0,
|
|
84
|
+
right: colIndex == colLength - 1,
|
|
85
|
+
rowIndex,
|
|
86
|
+
colIndex,
|
|
87
|
+
isBody: true,
|
|
88
|
+
isHeader: false
|
|
89
|
+
}) : {}), {
|
|
90
|
+
className: [
|
|
91
|
+
TableClasses("Cell"),
|
|
92
|
+
cellClassName,
|
|
93
|
+
col.className
|
|
94
|
+
].join(" ")
|
|
95
|
+
}), col)
|
|
96
|
+
));
|
|
97
|
+
});
|
|
98
|
+
BodyRows.push(/* @__PURE__ */ jsx(
|
|
99
|
+
TableParts.Row,
|
|
100
|
+
{
|
|
101
|
+
className: [TableClasses("Row"), TableClasses("BodyRow")].join(" "),
|
|
102
|
+
children: Cols,
|
|
103
|
+
onClick: (event) => {
|
|
104
|
+
if (onRowClick)
|
|
105
|
+
onRowClick(cols.rowID, event);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
rowIndex
|
|
109
|
+
));
|
|
110
|
+
});
|
|
111
|
+
return /* @__PURE__ */ jsx(Fragment, { children: BodyRows });
|
|
112
|
+
},
|
|
113
|
+
Normal: (params) => {
|
|
114
|
+
params = __spreadValues({}, params);
|
|
115
|
+
params.rows = params.rows.map((row, rowIndex) => {
|
|
116
|
+
row.rowID = row.rowID || rowIndex;
|
|
117
|
+
return row;
|
|
118
|
+
});
|
|
119
|
+
return /* @__PURE__ */ jsxs(TableParts.Table, { className: TableClasses("Table"), children: [
|
|
120
|
+
/* @__PURE__ */ jsx(Comps.HeadRow, __spreadValues({}, params)),
|
|
121
|
+
/* @__PURE__ */ jsx(Comps.BodyRows, __spreadValues({}, params))
|
|
122
|
+
] });
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const Normal = (params) => /* @__PURE__ */ jsx(
|
|
126
|
+
Wrapper,
|
|
127
|
+
__spreadProps(__spreadValues({
|
|
128
|
+
type: "normal"
|
|
129
|
+
}, params), {
|
|
130
|
+
JSXChildren: Comps.Normal
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
export {
|
|
134
|
+
Normal,
|
|
135
|
+
Normal as default
|
|
136
|
+
};
|
package/dist/fn/Table/Parts.js
CHANGED
|
@@ -1 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__spreadProps,
|
|
3
|
+
__spreadValues
|
|
4
|
+
} from "../../chunk-JJ3PEWPN.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import {
|
|
7
|
+
GenerateClassName
|
|
8
|
+
} from "../../@utils/_";
|
|
9
|
+
import FAI from "../../atoms/FAI";
|
|
10
|
+
const TableParts = {
|
|
11
|
+
Table: (params) => {
|
|
12
|
+
let Params = GenerateClassName(params);
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
"table",
|
|
15
|
+
__spreadProps(__spreadValues({}, Params), {
|
|
16
|
+
border: Params.border
|
|
17
|
+
})
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
Head: (params) => /* @__PURE__ */ jsx("thead", __spreadValues({}, GenerateClassName(params))),
|
|
21
|
+
Body: (params) => /* @__PURE__ */ jsx("tbody", __spreadValues({}, GenerateClassName(params))),
|
|
22
|
+
Row: (params) => /* @__PURE__ */ jsx("tr", __spreadValues({}, GenerateClassName(params))),
|
|
23
|
+
TH: (params) => /* @__PURE__ */ jsx("th", __spreadValues({}, GenerateClassName(params))),
|
|
24
|
+
TD: (params) => /* @__PURE__ */ jsx("td", __spreadValues({}, GenerateClassName(params))),
|
|
25
|
+
RightIndicator: {
|
|
26
|
+
type: "td",
|
|
27
|
+
unitWidth: 4,
|
|
28
|
+
// data: '',
|
|
29
|
+
children: /* @__PURE__ */ jsx(
|
|
30
|
+
FAI.AngleRight,
|
|
31
|
+
{
|
|
32
|
+
fontColor: "theme",
|
|
33
|
+
fontSize: "4.thirdTitle"
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
TableParts,
|
|
40
|
+
TableParts as default
|
|
41
|
+
};
|
package/dist/fn/Table/Wrapper.js
CHANGED
|
@@ -1 +1,60 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues
|
|
5
|
+
} from "../../chunk-JJ3PEWPN.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import {
|
|
8
|
+
$$,
|
|
9
|
+
GenerateClassName
|
|
10
|
+
} from "../../@utils/_";
|
|
11
|
+
import Box from "../../atoms/Box";
|
|
12
|
+
import {
|
|
13
|
+
DefaultCellStyles
|
|
14
|
+
} from "./cellStyling";
|
|
15
|
+
import { TableClasses } from "../../@styles/componentClasses/_";
|
|
16
|
+
const Wrapper = (params) => {
|
|
17
|
+
let {
|
|
18
|
+
JSXChildren
|
|
19
|
+
} = params;
|
|
20
|
+
if (!params.tone || params.tone == "auto") {
|
|
21
|
+
params.tone = "border";
|
|
22
|
+
if (params.type == "drag")
|
|
23
|
+
params.tone = "rowBorder";
|
|
24
|
+
}
|
|
25
|
+
let Params = __spreadProps(__spreadValues({
|
|
26
|
+
tableID: params.tableID || $$.uuid.gen(),
|
|
27
|
+
tone: params.tone
|
|
28
|
+
}, params), {
|
|
29
|
+
cellStyles: __spreadValues(__spreadValues({}, DefaultCellStyles(params.type, params.tone)), params.cellStyles)
|
|
30
|
+
});
|
|
31
|
+
if (params.tone != "plain") {
|
|
32
|
+
Params.backgroundColor = Params.backgroundColor || "1.layer.base";
|
|
33
|
+
Params.borderRadius = Params.borderRadius || "1.tone.primary";
|
|
34
|
+
}
|
|
35
|
+
let _a = GenerateClassName(Params), {
|
|
36
|
+
className,
|
|
37
|
+
style: freeCSS
|
|
38
|
+
} = _a, others = __objRest(_a, [
|
|
39
|
+
"className",
|
|
40
|
+
"style"
|
|
41
|
+
]);
|
|
42
|
+
let ClassName = [
|
|
43
|
+
className,
|
|
44
|
+
TableClasses("Wrap"),
|
|
45
|
+
TableClasses("TableType_" + params.type),
|
|
46
|
+
TableClasses("RowClickable_" + !!Params.onRowClick)
|
|
47
|
+
].join(" ");
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
Box,
|
|
50
|
+
{
|
|
51
|
+
className: ClassName,
|
|
52
|
+
style: freeCSS,
|
|
53
|
+
children: /* @__PURE__ */ jsx(JSXChildren, __spreadValues({}, others))
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
Wrapper,
|
|
59
|
+
Wrapper as default
|
|
60
|
+
};
|