Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
7d3d3960
Commit
7d3d3960
authored
Jun 24, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: simple select cards modal
parent
37fdc115
Pipeline
#22386
failed with stages
in 23 minutes and 20 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
7 deletions
+59
-7
src/ui/Duel/Message/NeosModal/index.tsx
src/ui/Duel/Message/NeosModal/index.tsx
+1
-0
src/ui/Duel/Message/SelectCardsModal/index.tsx
src/ui/Duel/Message/SelectCardsModal/index.tsx
+11
-7
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
+47
-0
No files found.
src/ui/Duel/Message/NeosModal/index.tsx
View file @
7d3d3960
...
...
@@ -21,6 +21,7 @@ export const NeosModal: FC<Props> = (props) => {
closeIcon=
{
mini
?
<
UpOutlined
/>
:
<
MinusOutlined
/>
}
bodyStyle=
{
{
padding
:
"
10px 0
"
}
}
mask=
{
!
mini
}
closable=
{
canBeMinimized
}
{
...
props
}
/>
);
...
...
src/ui/Duel/Message/SelectCardsModal/index.tsx
View file @
7d3d3960
...
...
@@ -106,12 +106,16 @@ export const SelectCardsModal: FC<{
open=
{
isOpen
}
footer=
{
<>
<
Button
danger
disabled=
{
!
cancelable
}
onClick=
{
onCancel
}
>
{
cancelable
&&
(
<
Button
danger
onClick=
{
onCancel
}
>
{
cancelText
}
</
Button
>
<
Button
type=
"dashed"
disabled=
{
!
finishable
}
onClick=
{
onFinish
}
>
)
}
{
finishable
&&
(
<
Button
type=
"dashed"
onClick=
{
onFinish
}
>
{
finishText
}
</
Button
>
)
}
<
Button
type=
"primary"
disabled=
{
!
submitable
}
...
...
@@ -139,7 +143,7 @@ export const SelectCardsModal: FC<{
<
CheckCard
.
Group
onChange=
{
setResult
as
any
}
// TODO 考虑如何设置默认值,比如只有一个的,就直接选中
multiple
multiple
=
{
!
single
}
style=
{
{
display
:
"
grid
"
,
gridTemplateColumns
:
"
repeat(6, 1fr)
"
,
...
...
src/ui/Duel/Message/SimpleSelectCardsModal/index.tsx
0 → 100644
View file @
7d3d3960
// import "./index.scss";
import
{
type
FC
}
from
"
react
"
;
import
{
proxy
,
useSnapshot
,
INTERNAL_Snapshot
as
Snapshot
}
from
"
valtio
"
;
import
{
SelectCardsModal
,
type
Option
}
from
"
../SelectCardsModal
"
;
const
defaultProps
=
{
isOpen
:
false
,
selectables
:
[]
as
Option
[],
};
const
localStore
=
proxy
(
defaultProps
);
export
const
SimpleSelectCardsModal
:
FC
=
()
=>
{
const
{
isOpen
,
selectables
}
=
useSnapshot
(
localStore
);
return
(
<
SelectCardsModal
isOpen=
{
isOpen
}
isChain=
{
false
}
min=
{
1
}
max=
{
1
}
single
selecteds=
{
[]
}
mustSelects=
{
[]
}
selectables=
{
selectables
}
cancelable
finishable=
{
false
}
totalLevels=
{
1
}
overflow
onSubmit=
{
(
options
)
=>
rs
(
options
)
}
onFinish=
{
()
=>
rs
([])
}
onCancel=
{
()
=>
rs
([])
}
/>
);
};
let
rs
:
(
options
:
Snapshot
<
Option
[]
>
)
=>
void
=
()
=>
{};
export
const
displaySimpleSelectActionsModal
=
async
(
args
:
Omit
<
typeof
defaultProps
,
"
isOpen
"
>
)
=>
{
localStore
.
isOpen
=
true
;
localStore
.
selectables
=
args
.
selectables
;
await
new
Promise
<
Snapshot
<
Option
[]
>>
((
resolve
)
=>
(
rs
=
resolve
));
// 等待在组件内resolve
localStore
.
isOpen
=
false
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment