This repository was archived by the owner on Mar 9, 2025. It is now read-only.
File tree 9 files changed +37
-19
lines changed
obsidian/modal/welcome-modal
9 files changed +37
-19
lines changed Original file line number Diff line number Diff line change 9
9
"fundingUrl" : {
10
10
"Buymeacoffee" : " https://www.buymeacoffee.com/treywallis"
11
11
},
12
- "version" : " 8.15.4 "
12
+ "version" : " 8.15.5 "
13
13
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " obsidian-dataloom" ,
3
- "version" : " 8.15.4 " ,
3
+ "version" : " 8.15.5 " ,
4
4
"description" : " Weave together data from diverse sources into different views. Inspired by Excel Spreadsheets and Notion.so." ,
5
5
"main" : " main.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export default class WelcomeModal extends Modal {
32
32
cardContainerEl ,
33
33
"Quick start" ,
34
34
"Learn the basics of creating a loom" ,
35
- "https://dataloom.xyz/basics/ quick-start" ,
35
+ "https://dataloom.xyz/quick-start" ,
36
36
"table"
37
37
) ;
38
38
@@ -48,7 +48,7 @@ export default class WelcomeModal extends Modal {
48
48
cardContainerEl ,
49
49
"Embedded looms" ,
50
50
"Learn how to embed a loom into a markdown note" ,
51
- "https://dataloom.xyz/basics/embed-loom " ,
51
+ "https://dataloom.xyz/basics/embed-looms " ,
52
52
"sticky-note"
53
53
) ;
54
54
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ interface Props {
26
26
conditionOptions : FilterCondition [ ] ;
27
27
selectedCondition : FilterCondition ;
28
28
inputNode ?: React . ReactNode ;
29
+ useSpacer ?: boolean ;
29
30
onToggle : ( id : string ) => void ;
30
31
onColumnChange : ( id : string , columnId : string ) => void ;
31
32
onConditionChange : ( id : string , value : FilterCondition ) => void ;
@@ -38,6 +39,7 @@ export default function FilterRow({
38
39
index,
39
40
id,
40
41
columns,
42
+ useSpacer,
41
43
isEnabled,
42
44
selectedColumnId,
43
45
selectedOperator,
@@ -53,15 +55,17 @@ export default function FilterRow({
53
55
return (
54
56
< div className = "dataloom-filter-row" >
55
57
< Wrap >
56
- { index !== 0 ? (
58
+ { index !== 0 && (
57
59
< FilterOperator
58
60
id = { id }
59
61
value = { selectedOperator }
60
62
onChange = { onOperatorChange }
61
63
/>
62
- ) : (
64
+ ) }
65
+ { useSpacer && (
63
66
< div className = "dataloom-filter-row__spacer" > </ div >
64
67
) }
68
+
65
69
< FilterColumnSelect
66
70
id = { id }
67
71
columns = { columns }
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import Padding from "src/react/shared/padding";
3
3
import Stack from "src/react/shared/stack" ;
4
4
import Icon from "src/react/shared/icon" ;
5
5
import FilterRow from "./filter-row" ;
6
- import Text from "src/react/shared/text" ;
7
6
import Button from "src/react/shared/button" ;
8
7
9
8
import ColumnNotFoundError from "src/shared/error/column-not-found-error" ;
@@ -613,6 +612,7 @@ export default function FilterMenu({
613
612
index = { i }
614
613
key = { id }
615
614
id = { id }
615
+ useSpacer = { filters . length > 1 && i === 0 }
616
616
columns = { columns }
617
617
selectedColumnId = { columnId }
618
618
selectedCondition = { condition }
@@ -628,16 +628,11 @@ export default function FilterMenu({
628
628
/>
629
629
) ;
630
630
} ) }
631
- < Stack isHorizontal >
632
- < Button
633
- icon = { < Icon lucideId = "plus" /> }
634
- ariaLabel = "Add filter"
635
- onClick = { ( ) => onAddClick ( ) }
636
- />
637
- { filters . length === 0 && (
638
- < Text value = "No filters to display" />
639
- ) }
640
- </ Stack >
631
+ < Button
632
+ icon = { < Icon lucideId = "plus" /> }
633
+ ariaLabel = "Add filter"
634
+ onClick = { ( ) => onAddClick ( ) }
635
+ />
641
636
</ Stack >
642
637
</ Padding >
643
638
</ div >
Original file line number Diff line number Diff line change @@ -110,12 +110,24 @@ export default function OptionBar({
110
110
111
111
function handleFilterMenuOpen ( ) {
112
112
filterMenu . onOpen ( LoomMenuLevel . ONE ) ;
113
+ if ( filters . length === 0 ) {
114
+ onFilterAddClick ( ) ;
115
+ }
113
116
}
114
117
115
118
function handleMoreMenuOpen ( ) {
116
119
moreMenu . onOpen ( LoomMenuLevel . ONE ) ;
117
120
}
118
121
122
+ function handleFilterDelete ( id : string ) {
123
+ onFilterDeleteClick ( id ) ;
124
+
125
+ //Close the menu when the last filter is deleted
126
+ if ( filters . length === 1 ) {
127
+ filterMenu . onClose ( ) ;
128
+ }
129
+ }
130
+
119
131
const activeFilters = filters . filter ( ( filter ) => filter . isEnabled ) ;
120
132
121
133
const sortedColumns = columns . filter (
@@ -228,7 +240,7 @@ export default function OptionBar({
228
240
columns = { columns }
229
241
filters = { filters }
230
242
onUpdate = { onFilterUpdate }
231
- onDeleteClick = { onFilterDeleteClick }
243
+ onDeleteClick = { handleFilterDelete }
232
244
onAddClick = { onFilterAddClick }
233
245
/>
234
246
</ >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ interface Props {
18
18
width ?: number ;
19
19
height ?: number ;
20
20
maxWidth ?: number ;
21
+ minWidth ?: number ;
21
22
maxHeight ?: number ;
22
23
children : React . ReactNode ;
23
24
}
@@ -31,6 +32,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
31
32
position,
32
33
width = 0 ,
33
34
height = 0 ,
35
+ minWidth = 0 ,
34
36
maxHeight = 0 ,
35
37
maxWidth = 0 ,
36
38
children,
@@ -79,6 +81,7 @@ const BaseMenu = React.forwardRef<HTMLDivElement, Props>(
79
81
left : numToPx ( position . left ) ,
80
82
width : width !== 0 ? numToPx ( width ) : "max-content" ,
81
83
height : height !== 0 ? numToPx ( height ) : "max-content" ,
84
+ minWidth : minWidth !== 0 ? numToPx ( minWidth ) : undefined ,
82
85
maxWidth : maxWidth !== 0 ? numToPx ( maxWidth ) : undefined ,
83
86
maxHeight : maxHeight !== 0 ? numToPx ( maxHeight ) : undefined ,
84
87
overflowY : maxHeight !== 0 ? "scroll" : undefined ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ interface Props {
14
14
openDirection ?: LoomMenuOpenDirection ;
15
15
topOffset ?: number ;
16
16
leftOffset ?: number ;
17
+ minWidth ?: number ;
17
18
width ?: number ;
18
19
height ?: number ;
19
20
maxWidth ?: number ;
@@ -27,6 +28,7 @@ export default function Menu({
27
28
hideBorder = false ,
28
29
openDirection,
29
30
position,
31
+ minWidth = 0 ,
30
32
width = 0 ,
31
33
height = 0 ,
32
34
leftOffset = 0 ,
@@ -53,6 +55,7 @@ export default function Menu({
53
55
position = { position }
54
56
width = { width }
55
57
height = { height }
58
+ minWidth = { minWidth }
56
59
maxHeight = { maxHeight }
57
60
maxWidth = { maxWidth }
58
61
>
Original file line number Diff line number Diff line change 153
153
"8.15.1" : " 1.4.0" ,
154
154
"8.15.2" : " 1.4.0" ,
155
155
"8.15.3" : " 1.4.0" ,
156
- "8.15.4" : " 1.4.0"
156
+ "8.15.4" : " 1.4.0" ,
157
+ "8.15.5" : " 1.4.0"
157
158
}
You can’t perform that action at this time.
0 commit comments