Skip to content

Releases: fzdwx/infinite

v0.12.1

20 Jun 13:14
Compare
Choose a tag to compare

Full Changelog: v0.12.0...v0.12.1

fix: confirm(selection) view error #44

v0.12.0

07 Jun 04:35
Compare
Choose a tag to compare

Full Changelog: v0.11.2...v0.12.0

Selection

break changes :

  1. remove PageSize field, add SetPageSize func on 132864d
  2. Change the logic of page turning, previously it was scrolling, now it is forced paging on ed0facb
func main() {
	options := []string{
		"1 Buy carrots",
		"2 Buy celery",
		"3 Buy kohlrabi",
		"4 Buy computer",
		"5 Buy something",
		"6 Buy car",
		"7 Buy subway",
	}

	selectKeymap := singleselect.DefaultSingleKeyMap()
	selectKeymap.Confirm = key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "finish select"),
	)
	selectKeymap.Choice = key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "finish select"),
	)
	selectKeymap.NextPage = key.NewBinding(
		key.WithKeys("right"),
		key.WithHelp("->", "next page"),
	)
	selectKeymap.PrevPage = key.NewBinding(
		key.WithKeys("left"),
		key.WithHelp("<-", "prev page"),
	)
	selected, err := inf.NewSingleSelect(
		options,
		singleselect.WithDisableFilter(),
		singleselect.WithKeyBinding(selectKeymap),
		singleselect.WithPageSize(5),
	).Display("Hello world")

	if err == nil {
		fmt.Printf("you selection %s\n", options[selected])
	}

}

Input confirm

break changes: split style on 69b0123

Input

break changes: remove BackgroundStyle field on ef56197

Others

update deps

v0.11.2

08 May 02:07
Compare
Choose a tag to compare
  1. feat: add select help key filter 3d77305

only show choice

selectKeymap := singleselect.DefaultSingleKeyMap()
	selectKeymap.Confirm = key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "finish select"),
	)
	selectKeymap.Choice = key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("enter", "finish select"),
	)
	selected, err := inf.NewSingleSelect(
		options,
		singleselect.WithDisableFilter(),
		singleselect.WithKeyBinding(selectKeymap),
	).Display("Hello world")

v0.11.1

18 Apr 10:38
674bc37
Compare
Choose a tag to compare
  1. faet: unselected before quit #41 by @wangzhiy

release 0.10.1

03 Feb 12:07
Compare
Choose a tag to compare

no new component

change

  1. add selection Validator(by @wangzhiy #39)
  2. upgrade dependence version and fire code

release 0.8.8

02 Nov 03:18
Compare
Choose a tag to compare

release 0.8.5

18 Aug 10:05
Compare
Choose a tag to compare

changelog:

  1. feat #28
    image
    image
  2. fix confirm(input) OutputResult and DisplayHelp are not handled correctly
  3. autocomplete adapt to the new features of input

release 0.8.4

17 Aug 13:31
Compare
Choose a tag to compare
  1. add confirm(selection) help view
  2. fix #29

release 0.8.2

16 Aug 14:30
Compare
Choose a tag to compare

Changelog

  1. add FocusSymbol UnFocusSymbol FocusInterval UnFocusInterval to selection , confirm(input)
  2. unify quit key so that it can be modified uniformly at runtime.
components.InterruptKey = key.NewBinding(
		xxx
)

release 0.7.5

16 Aug 08:01
Compare
Choose a tag to compare

Allows you to exit the program at any time while the program is running,the key of the main response in the component is quit, you can replace with the key you want, default is:

InterruptKey = key.NewBinding(
	key.WithKeys("ctrl+c"),
	key.WithHelp("^C", "kill program"),
)

default handle is :

OnUserInterrupt = func(p *tea.Program) {
	p.Kill()
	os.Exit(0)
}

You can modify it like this:

components.OnUserInterrupt = func(p *tea.Program) {
		...
}

thanks @whatwewant .