From a7f2e9b881680ae08556438d19053f77f01ba329 Mon Sep 17 00:00:00 2001 From: Shaun Lawrie Date: Wed, 3 Jan 2024 15:35:02 +1300 Subject: [PATCH 1/4] Merge pull request #19 from fmotion1/prerelease Update Read-SpectreMultiSelection.ps1 --- .gitignore | 3 +++ .../public/prompts/Read-SpectreMultiSelection.ps1 | 5 ++++- .../public/prompts/Read-SpectreMultiSelectionGrouped.ps1 | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9ccb3e31..d19a6b65 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ pnpm-debug.log* # Exclude packages folder PwshSpectreConsole/packages + +# Exclude working folder +Working/ diff --git a/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelection.ps1 b/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelection.ps1 index 9b0852ee..434b3c36 100644 --- a/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelection.ps1 +++ b/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelection.ps1 @@ -23,6 +23,9 @@ function Read-SpectreMultiSelection { .PARAMETER PageSize The number of choices to display per page. Defaults to 5. + .PARAMETER AllowEmpty + Allow the multi-selection to be submitted without any options chosen. + .EXAMPLE # Displays a multi-selection prompt with the title "Select your favourite fruits", the list of fruits, the "Name" property as the label for each fruit, the color green for highlighting the selected fruits, and 3 fruits per page. Read-SpectreMultiSelection -Title "Select your favourite fruits" -Choices @("apple", "banana", "orange", "pear", "strawberry") -Color "Green" -PageSize 3 @@ -55,7 +58,7 @@ function Read-SpectreMultiSelection { $spectrePrompt.Title = $Title $spectrePrompt.PageSize = $PageSize $spectrePrompt.WrapAround = $true - $spectrePrompt.AllowEmpty = $AllowEmpty + $spectrePrompt.Required = !$AllowEmpty $spectrePrompt.HighlightStyle = [Spectre.Console.Style]::new(($Color | Convert-ToSpectreColor)) $spectrePrompt.InstructionsText = "[$($script:DefaultValueColor.ToMarkup())](Press [$($script:AccentColor.ToMarkup())]space[/] to toggle a choice and press [$($script:AccentColor.ToMarkup())][/] to submit your answer)[/]" $spectrePrompt.MoreChoicesText = "[$($script:DefaultValueColor.ToMarkup())](Move up and down to reveal more choices)[/]" diff --git a/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelectionGrouped.ps1 b/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelectionGrouped.ps1 index 28907ad3..e4fa8511 100644 --- a/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelectionGrouped.ps1 +++ b/PwshSpectreConsole/public/prompts/Read-SpectreMultiSelectionGrouped.ps1 @@ -23,6 +23,9 @@ function Read-SpectreMultiSelectionGrouped { .PARAMETER PageSize The number of choices to display per page. The default value is 10. + .PARAMETER AllowEmpty + Allow the multi-selection to be submitted without any options chosen. + .EXAMPLE # This example displays a multi-selection prompt with two groups of choices: "Primary Colors" and "Secondary Colors". The prompt uses the "Name" property of each choice as the label. The user can select one or more choices from each group. Read-SpectreMultiSelectionGrouped -Title "Select your favorite colors" -Choices @( From 5e1726862f221acd5a60e255c7ba38ef93ee6d95 Mon Sep 17 00:00:00 2001 From: "Shaun Lawrie (via GitHub Actions)" Date: Wed, 3 Jan 2024 02:44:16 +0000 Subject: [PATCH 2/4] [skip ci] Bump version to 1.3.0 --- PwshSpectreConsole/PwshSpectreConsole.psd1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PwshSpectreConsole/PwshSpectreConsole.psd1 b/PwshSpectreConsole/PwshSpectreConsole.psd1 index 467049d5..593749d9 100644 --- a/PwshSpectreConsole/PwshSpectreConsole.psd1 +++ b/PwshSpectreConsole/PwshSpectreConsole.psd1 @@ -3,7 +3,7 @@ # # Generated by: Shaun Lawrie # -# Generated on: 12/08/2023 +# Generated on: 01/03/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'PwshSpectreConsole' # Version number of this module. -ModuleVersion = '1.2.0' +ModuleVersion = '1.3.0' # Supported PSEditions # CompatiblePSEditions = @() From 60ac1c2f18c76867f3109a0a4fb8475fb37e4880 Mon Sep 17 00:00:00 2001 From: Shaun Lawrie Date: Wed, 3 Jan 2024 15:48:37 +1300 Subject: [PATCH 3/4] Make deploy work --- PwshSpectreConsole/PwshSpectreConsole.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PwshSpectreConsole/PwshSpectreConsole.psd1 b/PwshSpectreConsole/PwshSpectreConsole.psd1 index 467049d5..f6def64c 100644 --- a/PwshSpectreConsole/PwshSpectreConsole.psd1 +++ b/PwshSpectreConsole/PwshSpectreConsole.psd1 @@ -12,7 +12,7 @@ RootModule = 'PwshSpectreConsole' # Version number of this module. -ModuleVersion = '1.2.0' +ModuleVersion = '1.4.3' # Supported PSEditions # CompatiblePSEditions = @() From 074ed53c930c9fb1fa5864980bf9da38d4c44ba8 Mon Sep 17 00:00:00 2001 From: "Shaun Lawrie (via GitHub Actions)" Date: Wed, 3 Jan 2024 02:49:44 +0000 Subject: [PATCH 4/4] [skip ci] Bump version to 1.5.0 --- PwshSpectreConsole/PwshSpectreConsole.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PwshSpectreConsole/PwshSpectreConsole.psd1 b/PwshSpectreConsole/PwshSpectreConsole.psd1 index 48e53cf0..3dac5c37 100644 --- a/PwshSpectreConsole/PwshSpectreConsole.psd1 +++ b/PwshSpectreConsole/PwshSpectreConsole.psd1 @@ -12,7 +12,7 @@ RootModule = 'PwshSpectreConsole' # Version number of this module. -ModuleVersion = '1.4.3' +ModuleVersion = '1.5.0' # Supported PSEditions # CompatiblePSEditions = @()