Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ await _js.BitCalloutToggleCallout(
headerId: "",
footerId: "",
setCalloutWidth: true,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ await _js.BitCalloutToggleCallout(
headerId: "",
footerId: "",
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ private async Task<bool> ToggleCallout()
headerId: "",
footerId: "",
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: MAX_WIDTH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ private async Task<bool> ToggleCallout()
headerId: "",
footerId: "",
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: MAX_WIDTH);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ private async Task ToggleCallout()
headerId: CalloutHeaderTemplate is not null ? _headerId : "",
footerId: CalloutFooterTemplate is not null ? _footerId : "",
setCalloutWidth: PreserveCalloutWidth is false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ await _js.BitCalloutToggleCallout(
headerId: string.Empty,
footerId: string.Empty,
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ await _js.BitCalloutToggleCallout(
headerId: string.Empty,
footerId: string.Empty,
setCalloutWidth: true,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ await _js.BitCalloutToggleCallout(
headerId: "",
footerId: "",
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ await _js.BitCalloutToggleCallout(
headerId: "",
footerId: "",
setCalloutWidth: false,
preserveCalloutWidth: false,
fixedCalloutWidth: false,
maxWindowWidth: 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public partial class BitCallout : BitComponentBase
/// </summary>
[Parameter] public BitDropDirection? Direction { get; set; }

/// <summary>
/// Forces the callout to preserve its component's original width.
/// </summary>
[Parameter] public bool FixedCalloutWidth { get; set; }

/// <summary>
/// The id of the footer element that renders at the end of the scrolling container of the callout contnet.
/// </summary>
Expand Down Expand Up @@ -79,12 +84,7 @@ public partial class BitCallout : BitComponentBase
[Parameter] public EventCallback<bool> OnToggle { get; set; }

/// <summary>
/// Forces the callout to preserve its component's original width.
/// </summary>
[Parameter] public bool PreserveCalloutWidth { get; set; }

/// <summary>
/// Forces the callout to set its content container width while openning based on the available space and actual content.
/// Forces the callout to set its content container width while opening based on the available space and actual content.
/// </summary>
[Parameter] public bool SetCalloutWidth { get; set; }

Expand Down Expand Up @@ -205,7 +205,7 @@ await _js.BitCalloutToggleCallout(
headerId: HeaderId ?? "",
footerId: FooterId ?? "",
setCalloutWidth: SetCalloutWidth,
preserveCalloutWidth: PreserveCalloutWidth,
fixedCalloutWidth: FixedCalloutWidth,
maxWindowWidth: MaxWindowWidth ?? 0);

await OnToggle.InvokeAsync(IsOpen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,27 @@ internal static class CalloutsJsRuntimeExtensions
string headerId,
string footerId,
bool setCalloutWidth,
bool preserveCalloutWidth,
bool fixedCalloutWidth,
int maxWindowWidth) where T : class
{
return jsRuntime.Invoke<bool>("BitBlazorUI.Callouts.toggle",
dotnetObj,
componentId,
component,
calloutId,
callout,
isCalloutOpen,
responsiveMode,
dropDirection,
isRtl,
scrollContainerId,
scrollOffset,
headerId,
footerId,
setCalloutWidth,
preserveCalloutWidth,
maxWindowWidth);
return jsRuntime.Invoke<bool>(
"BitBlazorUI.Callouts.toggle",
dotnetObj,
componentId,
component,
calloutId,
callout,
isCalloutOpen,
responsiveMode,
dropDirection,
isRtl,
scrollContainerId,
scrollOffset,
headerId,
footerId,
setCalloutWidth,
fixedCalloutWidth,
maxWindowWidth);
}

internal static ValueTask BitCalloutClearCallout(this IJSRuntime jsRuntime, string calloutId)
Expand Down
4 changes: 2 additions & 2 deletions src/BlazorUI/Bit.BlazorUI/Scripts/Callouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace BitBlazorUI {
headerId: string,
footerId: string,
setCalloutWidth: boolean,
preserveCalloutWidth: boolean,
fixedCalloutWidth: boolean,
maxWindowWidth: number,
) {
component ??= document.getElementById(componentId);
Expand Down Expand Up @@ -95,7 +95,7 @@ namespace BitBlazorUI {
callout.style.width = width + 'px';
calloutWidth = width;
}
if (preserveCalloutWidth) {
if (fixedCalloutWidth) {
let width = Math.min(componentWidth, calloutWidth);
callout.style.width = width + 'px';
calloutWidth = width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ public partial class BitCalloutDemo
Href = "#drop-direction-enum"
},
new()
{
Name = "FixedCalloutWidth",
Type = "bool",
DefaultValue = "false",
Description = "Forces the callout to preserve its component's original width."
},
new()
{
Name = "FooterId",
Type = "string?",
Expand Down Expand Up @@ -93,18 +100,11 @@ public partial class BitCalloutDemo
Description = "The callback that is called when the callout opens or closes."
},
new()
{
Name = "PreserveCalloutWidth",
Type = "bool",
DefaultValue = "false",
Description = "Forces the callout to preserve its component's original width."
},
new()
{
Name = "SetCalloutWidth",
Type = "bool",
DefaultValue = "false",
Description = "Forces the callout to set its content container width while openning based on the available space and actual content."
Description = "Forces the callout to set its content container width while opening based on the available space and actual content."
},
new()
{
Expand Down
Loading