File tree Expand file tree Collapse file tree
Rock.JavaScript.Obsidian/Framework Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 const slots = useSlots();
3030
3131 /** True if the compare column should be displayed. */
32- const hasCompareColumn = computed((): boolean => (!!slots.compare || !!props.compareLabel) && props.filterMode !== FilterMode.SimpleFilter);
32+ const hasCompareColumn = computed((): boolean => {
33+ if (slots.compare) {
34+ return true;
35+ }
36+
37+ if (props.compareLabel) {
38+ return props.filterMode !== FilterMode.SimpleFilter;
39+ }
40+
41+ return false;
42+ });
3343
3444 /** True if we have a plain text label to display in the compare column. */
3545 const hasCompareLabel = computed((): boolean => !!props.compareLabel);
5363 return "col-xs-12 col-md-8";
5464 }
5565 else if (props.compareLabel) {
56- return "col-xs-12 col-md-10";
66+ return props.filterMode !== FilterMode.SimpleFilter
67+ ? "col-xs-12 col-md-10"
68+ : "col-xs-12 col-md-12";
5769 }
5870 else {
5971 return "col-xs-12 col-md-12";
Original file line number Diff line number Diff line change @@ -249,7 +249,6 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
249249 /** True if the compare component should be visible. */
250250 const hasCompareComponent = computed ( ( ) => {
251251 return comparisonTypes !== null
252- && props . filterMode !== FilterMode . SimpleFilter
253252 && ! isSingleComparisonType ( comparisonTypes )
254253 && isCompareVisibleForComparisonFilter ( comparisonTypes , props . filterMode ) ;
255254 } ) ;
@@ -280,9 +279,8 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
280279 type = comparisonTypes ;
281280 }
282281 else {
283- // If the filter mode is simple, then the comparison type is
284- // not shown so we come up with a sane default.
285- if ( props . filterMode === FilterMode . SimpleFilter ) {
282+ // If the compare component is not visible, then come up with a sane default.
283+ if ( ! hasCompareComponent . value ) {
286284 if ( comparisonTypes === binaryComparisonTypes ) {
287285 type = ComparisonType . EqualTo ;
288286 }
@@ -294,8 +292,7 @@ export function getStandardFilterComponent(comparisonLabelOrTypes: ComparisonTyp
294292 }
295293 }
296294 else {
297- // Get the comparison type selected by the user if we are
298- // in advanced mode.
295+ // When the compare component is visible, get the comparison type selected by the user.
299296 type = toNumberOrNull ( internalComparisonType . value ) ;
300297 }
301298 }
You can’t perform that action at this time.
0 commit comments