Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
efc0dc9a
Commit
efc0dc9a
authored
Jun 11, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update trim in Autocomplete
parent
acb71dfb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
33 deletions
+23
-33
AddMemoRelationPopover.tsx
...onents/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
+2
-2
LocationSelector.tsx
...c/components/MemoEditor/ActionButton/LocationSelector.tsx
+1
-1
TagSelector.tsx
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
+20
-30
No files found.
web/src/components/MemoEditor/ActionButton/AddMemoRelationPopover.tsx
View file @
efc0dc9a
...
@@ -135,7 +135,7 @@ const AddMemoRelationPopover = (props: Props) => {
...
@@ -135,7 +135,7 @@ const AddMemoRelationPopover = (props: Props) => {
</
Button
>
</
Button
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
align=
"center"
>
<
PopoverContent
align=
"center"
>
<
div
className=
"w-[16rem] flex flex-col justify-start items-start"
>
<
div
className=
"w-[16rem]
p-1
flex flex-col justify-start items-start"
>
<
Autocomplete
<
Autocomplete
className=
"w-full"
className=
"w-full"
size=
"md"
size=
"md"
...
@@ -148,7 +148,7 @@ const AddMemoRelationPopover = (props: Props) => {
...
@@ -148,7 +148,7 @@ const AddMemoRelationPopover = (props: Props) => {
inputValue=
{
searchText
}
inputValue=
{
searchText
}
value=
{
selectedMemos
}
value=
{
selectedMemos
}
multiple
multiple
onInputChange=
{
(
_
,
value
)
=>
setSearchText
(
value
.
trim
())
}
onInputChange=
{
(
_
,
value
)
=>
setSearchText
(
value
.
trim
Start
())
}
getOptionKey=
{
(
memo
)
=>
memo
.
name
}
getOptionKey=
{
(
memo
)
=>
memo
.
name
}
getOptionLabel=
{
(
memo
)
=>
memo
.
content
}
getOptionLabel=
{
(
memo
)
=>
memo
.
content
}
isOptionEqualToValue=
{
(
memo
,
value
)
=>
memo
.
name
===
value
.
name
}
isOptionEqualToValue=
{
(
memo
,
value
)
=>
memo
.
name
===
value
.
name
}
...
...
web/src/components/MemoEditor/ActionButton/LocationSelector.tsx
View file @
efc0dc9a
...
@@ -105,7 +105,7 @@ const LocationSelector = (props: Props) => {
...
@@ -105,7 +105,7 @@ const LocationSelector = (props: Props) => {
</
Button
>
</
Button
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
align=
"center"
>
<
PopoverContent
align=
"center"
>
<
div
className=
"min-w-80 sm:w-lg flex flex-col justify-start items-start"
>
<
div
className=
"min-w-80 sm:w-lg
p-1
flex flex-col justify-start items-start"
>
<
LeafletMap
key=
{
JSON
.
stringify
(
state
.
initilized
)
}
latlng=
{
state
.
position
}
onChange=
{
onPositionChanged
}
/>
<
LeafletMap
key=
{
JSON
.
stringify
(
state
.
initilized
)
}
latlng=
{
state
.
position
}
onChange=
{
onPositionChanged
}
/>
<
div
className=
"mt-2 w-full flex flex-row justify-between items-center gap-2"
>
<
div
className=
"mt-2 w-full flex flex-row justify-between items-center gap-2"
>
<
div
className=
"flex flex-row items-center justify-start gap-2"
>
<
div
className=
"flex flex-row items-center justify-start gap-2"
>
...
...
web/src/components/MemoEditor/ActionButton/TagSelector.tsx
View file @
efc0dc9a
import
{
Button
}
from
"@usememos/mui"
;
import
{
Button
}
from
"@usememos/mui"
;
import
{
HashIcon
}
from
"lucide-react"
;
import
{
HashIcon
}
from
"lucide-react"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
observer
}
from
"mobx-react-lite"
;
import
{
useRef
,
useState
}
from
"react"
;
import
useClickAway
from
"react-use/lib/useClickAway"
;
import
OverflowTip
from
"@/components/kit/OverflowTip"
;
import
OverflowTip
from
"@/components/kit/OverflowTip"
;
import
{
userStore
}
from
"@/store/v2"
;
import
{
userStore
}
from
"@/store/v2"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
import
{
useTranslate
}
from
"@/utils/i18n"
;
...
@@ -16,17 +14,11 @@ interface Props {
...
@@ -16,17 +14,11 @@ interface Props {
const
TagSelector
=
observer
((
props
:
Props
)
=>
{
const
TagSelector
=
observer
((
props
:
Props
)
=>
{
const
t
=
useTranslate
();
const
t
=
useTranslate
();
const
{
editorRef
}
=
props
;
const
{
editorRef
}
=
props
;
const
[
open
,
setOpen
]
=
useState
(
false
);
const
containerRef
=
useRef
<
HTMLDivElement
>
(
null
);
const
tags
=
Object
.
entries
(
userStore
.
state
.
tagCount
)
const
tags
=
Object
.
entries
(
userStore
.
state
.
tagCount
)
.
sort
((
a
,
b
)
=>
a
[
0
].
localeCompare
(
b
[
0
]))
.
sort
((
a
,
b
)
=>
a
[
0
].
localeCompare
(
b
[
0
]))
.
sort
((
a
,
b
)
=>
b
[
1
]
-
a
[
1
])
.
sort
((
a
,
b
)
=>
b
[
1
]
-
a
[
1
])
.
map
(([
tag
])
=>
tag
);
.
map
(([
tag
])
=>
tag
);
useClickAway
(
containerRef
,
()
=>
{
setOpen
(
false
);
});
const
handleTagClick
=
(
tag
:
string
)
=>
{
const
handleTagClick
=
(
tag
:
string
)
=>
{
const
current
=
editorRef
.
current
;
const
current
=
editorRef
.
current
;
if
(
current
===
null
)
return
;
if
(
current
===
null
)
return
;
...
@@ -41,34 +33,32 @@ const TagSelector = observer((props: Props) => {
...
@@ -41,34 +33,32 @@ const TagSelector = observer((props: Props) => {
};
};
return
(
return
(
<
Popover
open=
{
open
}
onOpenChange=
{
setOpen
}
>
<
Popover
>
<
PopoverTrigger
asChild
>
<
PopoverTrigger
asChild
>
<
Button
variant=
"plain"
className=
"p-0"
>
<
Button
variant=
"plain"
className=
"p-0"
>
<
HashIcon
className=
"w-5 h-5"
/>
<
HashIcon
className=
"w-5 h-5"
/>
</
Button
>
</
Button
>
</
PopoverTrigger
>
</
PopoverTrigger
>
<
PopoverContent
align=
"start"
sideOffset=
{
2
}
>
<
PopoverContent
align=
"start"
sideOffset=
{
2
}
>
<
div
ref=
{
containerRef
}
>
{
tags
.
length
>
0
?
(
{
tags
.
length
>
0
?
(
<
div
className=
"flex flex-row justify-start items-start flex-wrap px-2 max-w-48 h-auto max-h-48 overflow-y-auto gap-x-2"
>
<
div
className=
"flex flex-row justify-start items-start flex-wrap px-3 py-1 max-w-48 h-auto max-h-48 overflow-y-auto gap-x-2 gap-y-1"
>
{
tags
.
map
((
tag
)
=>
{
{
tags
.
map
((
tag
)
=>
{
return
(
return
(
<
div
<
div
key=
{
tag
}
key=
{
tag
}
className=
"inline-flex w-auto max-w-full cursor-pointer text-base leading-6 text-gray-500 dark:text-gray-400 hover:opacity-80"
className=
"inline-flex w-auto max-w-full cursor-pointer text-base leading-6 text-gray-500 dark:text-gray-400 hover:text-primary dark:hover:text-primary-dark"
onClick=
{
()
=>
handleTagClick
(
tag
)
}
onClick=
{
()
=>
handleTagClick
(
tag
)
}
>
>
<
OverflowTip
>
#
{
tag
}
</
OverflowTip
>
<
OverflowTip
>
#
{
tag
}
</
OverflowTip
>
</
div
>
</
div
>
);
);
})
}
})
}
</
div
>
</
div
>
)
:
(
)
:
(
<
p
className=
"italic mx-2"
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
<
p
className=
"italic mx-2"
onClick=
{
(
e
)
=>
e
.
stopPropagation
()
}
>
{
t
(
"tag.no-tag-found"
)
}
{
t
(
"tag.no-tag-found"
)
}
</
p
>
</
p
>
)
}
)
}
</
div
>
</
PopoverContent
>
</
PopoverContent
>
</
Popover
>
</
Popover
>
);
);
...
...
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