poi-plugin-kai-planner 1.0.7 → 1.0.9
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/package.json +1 -1
- package/src/app/components/EquipTypeIconFilter.js +63 -0
- package/src/app/components/SlotitemTypeIcon.js +49 -30
- package/src/app/tabs/daily/DailyTab.js +3929 -475
- package/src/app/tabs/wishlist/WishlistTab.js +75 -21
- package/src/app/tabs/wishlist/components/WishlistTable.js +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/* src/app/components/EquipTypeIconFilter.js */
|
|
2
|
+
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const { SlotitemTypeIcon } = require("./SlotitemTypeIcon");
|
|
5
|
+
|
|
6
|
+
function EquipTypeIconFilter({ options, selectedKeys, onToggle, onClear, iconSize }) {
|
|
7
|
+
if (!Array.isArray(options) || options.length === 0) return null;
|
|
8
|
+
|
|
9
|
+
const selectedSet = new Set((selectedKeys || []).map(String));
|
|
10
|
+
const size = Number.isFinite(iconSize) ? iconSize : 12;
|
|
11
|
+
const baseButtonStyle = {
|
|
12
|
+
display: "inline-flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
minWidth: 28,
|
|
16
|
+
height: 28,
|
|
17
|
+
padding: 0,
|
|
18
|
+
borderRadius: 8,
|
|
19
|
+
border: "1px solid rgba(255,255,255,0.12)",
|
|
20
|
+
background: "rgba(255,255,255,0.04)",
|
|
21
|
+
color: "#e5e7eb",
|
|
22
|
+
cursor: "pointer",
|
|
23
|
+
flexShrink: 0,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return React.createElement(
|
|
27
|
+
"div",
|
|
28
|
+
{ style: { display: "flex", gap: 8, flexWrap: "wrap", alignItems: "center" } },
|
|
29
|
+
React.createElement(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
type: "button",
|
|
33
|
+
onClick: onClear,
|
|
34
|
+
style: {
|
|
35
|
+
...baseButtonStyle,
|
|
36
|
+
padding: "0 10px",
|
|
37
|
+
background: selectedSet.size === 0 ? "rgba(255,255,255,0.14)" : "rgba(255,255,255,0.04)",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
"全部"
|
|
41
|
+
),
|
|
42
|
+
...options.map((option) => {
|
|
43
|
+
const key = String(option.key);
|
|
44
|
+
const active = selectedSet.has(key);
|
|
45
|
+
return React.createElement(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
key,
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: () => onToggle(key),
|
|
51
|
+
'aria-label': option.name || key,
|
|
52
|
+
style: {
|
|
53
|
+
...baseButtonStyle,
|
|
54
|
+
background: active ? "rgba(255,255,255,0.14)" : "rgba(255,255,255,0.04)",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
React.createElement(SlotitemTypeIcon, { iconType: option.iconType, style: { width: size, height: size } })
|
|
58
|
+
);
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
module.exports = { EquipTypeIconFilter };
|
|
@@ -1,30 +1,49 @@
|
|
|
1
|
-
/* src/app/components/SlotitemTypeIcon.js */
|
|
2
|
-
|
|
3
|
-
const React = require("react");
|
|
4
|
-
|
|
5
|
-
let SlotitemIcon = null;
|
|
6
|
-
try {
|
|
7
|
-
({ SlotitemIcon } = require("views/components/etc/icon"));
|
|
8
|
-
} catch {}
|
|
9
|
-
|
|
10
|
-
function SlotitemTypeIcon({ iconType, title, style }) {
|
|
11
|
-
if (!iconType || !SlotitemIcon) return null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
/* src/app/components/SlotitemTypeIcon.js */
|
|
2
|
+
|
|
3
|
+
const React = require("react");
|
|
4
|
+
|
|
5
|
+
let SlotitemIcon = null;
|
|
6
|
+
try {
|
|
7
|
+
({ SlotitemIcon } = require("views/components/etc/icon"));
|
|
8
|
+
} catch {}
|
|
9
|
+
|
|
10
|
+
function SlotitemTypeIcon({ iconType, title, style }) {
|
|
11
|
+
if (!iconType || !SlotitemIcon) return null;
|
|
12
|
+
const baseSize = 20;
|
|
13
|
+
const width = style && Number.isFinite(style.width) ? style.width : baseSize;
|
|
14
|
+
const height = style && Number.isFinite(style.height) ? style.height : baseSize;
|
|
15
|
+
const scale = Math.min(width / baseSize, height / baseSize);
|
|
16
|
+
|
|
17
|
+
return React.createElement(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
title: title || "",
|
|
21
|
+
style: {
|
|
22
|
+
display: "inline-flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "center",
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
flexShrink: 0,
|
|
28
|
+
lineHeight: 0,
|
|
29
|
+
...(style || {}),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
React.createElement(
|
|
33
|
+
"span",
|
|
34
|
+
{
|
|
35
|
+
style: {
|
|
36
|
+
display: "inline-flex",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
width: baseSize,
|
|
40
|
+
height: baseSize,
|
|
41
|
+
zoom: scale,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
React.createElement(SlotitemIcon, { slotitemId: iconType })
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
module.exports = { SlotitemTypeIcon };
|