Giter VIP home page Giter VIP logo

Comments (8)

FRACerqueira avatar FRACerqueira commented on May 30, 2024 1

@ividyon , No problem, change made to 'Separator' . I had already noticed that the item counter was taking into account separators and groupers, I just adjusted that too

            PromptPlus.DoubleDash("Control:Select - basic usage with Separationline");
            PromptPlus.Select<string>("Select")
                 .AddItem("Seattle")
                 .AddItem("New York")
                 .Separator() //Default SeparatorLine : SeparatorLine.SingleLine
                 .AddItem("Tokyo")
                 .AddItem("Singapore")
                 .AddItem("Shanghai")
                 .Separator(SeparatorLine.DoubleLine)
                 .AddItem("London")
                 .Separator(SeparatorLine.Char, '*')
                 .AddItem("Other city")
                 .Run();

output :
Captura de tela 2023-09-19 172255

            PromptPlus.DoubleDash("Control:Select - basic usage with group and AppendGroupOnDescription");
            PromptPlus.Select<string>("Which cities would you like to visit?")
                 .AddItemsGrouped("North America", new[] { "Seattle", "Boston", "New York" })
                 .AddItemsGrouped("Asia", new[] { "Tokyo", "Singapore", "Shanghai" })
                 .AddItem("South America (Any)")
                 .AddItem("Europe (Any)")
                 .AppendGroupOnDescription()
                 .Run();

output :
Captura de tela 2023-09-19 180022

Note: The 'Page Size' setting takes into account all items that are shown

from promptplus.

FRACerqueira avatar FRACerqueira commented on May 30, 2024

@ividyon ,
here is this feature for multiselect. I'll mark it as an improvement and it will be very similar (same commands). An example of what it would look like:

selectnewfeature

from promptplus.

FRACerqueira avatar FRACerqueira commented on May 30, 2024

@ividyon , Fixed scheduled for publication 4.0.6,

live Sample :

            PromptPlus.DoubleDash("Control:Select - basic usage with group and AppendGroupOnDescription");
            var selgrp = PromptPlus.Select<string>("Which cities would you like to visit?")
                 .AddItemsGrouped("North America", new[] { "Seattle", "Boston", "New York" })
                 .AddItemsGrouped("Asia", new[] { "Tokyo", "Singapore", "Shanghai" })
                 .AddItem("South America (Any)")
                 .AddItem("Europe (Any)")
                 .AppendGroupOnDescription()
                 .Run();

selectnewfeature

from promptplus.

ividyon avatar ividyon commented on May 30, 2024

Hm, this is useful, but isn't quite what I was looking for; is it possible to just have a simple separator line (dashes) and no nesting visuals in the list? Just like my example in my post.

The separator lines could be as long as the longest string in the select list, and the character the line is made of could be customizable.

from promptplus.

ividyon avatar ividyon commented on May 30, 2024
  Option 1
> Option 2
  Option 3
  ---------------
  Option 4
  Option 5
  Option 6

Just simple separating lines, no nesting

from promptplus.

FRACerqueira avatar FRACerqueira commented on May 30, 2024

@ividyon done!, was maintaining a new item nesting option and adding the separation line option. Note: When using the sort option in conjunction with separation line, the separation lines will be deleted

live Sample :

           PromptPlus.Select<string>("Select")
                .AddItem("Seattle")
                .AddItem("New York")
                .AddSeparationline() //Default Separationline : SeparationLineType.SingleLine
                .AddItem("Tokyo")
                .AddItem("Singapore")
                .AddItem("Shanghai")
                .AddSeparationline(SeparationLineType.DoubleLine)
                .AddItem("London")
                .AddSeparationline(SeparationLineType.Char, '*')
                .AddItem("Other city")
                .Run();

selectnewfeature1

from promptplus.

ividyon avatar ividyon commented on May 30, 2024

Awesome, thank you!

  • I'd call it Separator since this is a fairly common term in programming for such things, rather than Separationline (it'd at least have to be SeparationLine).
  • The separators/group titles seem to count towards the item count on the page (10 items when there's 8 + 2 separators).

from promptplus.

ividyon avatar ividyon commented on May 30, 2024

Perfect

from promptplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.