UDFullScreen.psm1

$IndexJs = Get-ChildItem "$PSScriptRoot\index.*.bundle.js"
$AssetId = [UniversalDashboard.Services.AssetService]::Instance.RegisterAsset($IndexJs.FullName)

function New-UDFullScreen {
    <#
    .SYNOPSIS
    Creates a new component giving full screen ability
    
    .DESCRIPTION
    Adds a button, to which you then add content, all then content within this function will then display in a full screen mode when the full-screen button is clicked
    
    .PARAMETER Id
    The ID of this editor

    .PARAMETER ButtonFullScreenColor
    Enables you to set the color of the full-screen button, this is a string and defaulted to #7a7aff

    .PARAMETER ButtonFullScreenHeight
    Sets the height for the full-screen button. Defaulted to 3em

    .PARAMETER ButtonFullScreenWidth
    Sets the width for the full-screen button. Defaulted to 3em

    .PARAMETER ButtonNormalScreenColor
    Enables you to set the color of the normal-screen button, this is a string and defaulted to #7a7aff

    .PARAMETER ButtonNormalScreenHeight
    Sets height for the normal screen button, defaulted to 3em

    .PARAMETER ButtonNormalScreenWidth
    Sets width for the normal screen button, defaulted to 3em

    .PARAMETER Content
    Is a mandatory scriptblock parameter, to allow you to nest other dashboard components you want to display in full-screen
    .EXAMPLE
    New-UDFullScreen -Content { "Everything in content block will be full screen when button clicked" }
    #>

    
    param(
        [Parameter()]
        [string]$Id = (New-Guid).ToString(),
        [Parameter()]
        [string]$ButtonFullScreenColor = "#7a7aff",
        [Parameter()]
        [string]$ButtonFullScreenHeight = "3em",
        [Parameter()]
        [string]$ButtonFullScreenWidth = "3em",
        [Parameter()]
        [string]$ButtonNormalScreenColor = "#7a7aff",
        [Parameter()]
        [string]$ButtonNormalScreenHeight = "3em",
        [Parameter()]
        [string]$ButtonNormalScreenWidth = "3em",
        [Parameter(Mandatory)]
        [scriptblock]$Content
    )

    End {
        @{
            assetId      = $AssetId 
            isPlugin     = $true 
            type         = "udfullscreen"
            id           = $Id

            buttonColor  = $ButtonFullScreenColor
            heightFull   = $ButtonFullScreenHeight
            widthFull    = $ButtonFullScreenWidth
            buttonScolor = $ButtonNormalScreenColor
            heightNormal = $ButtonNormalScreenHeight
            widthNormal  = $ButtonNormalScreenWidth
            content      = $Content.Invoke()

        }
    }
}