Skip to content

Releases: fzdwx/infinite

v0.12.1

Choose a tag to compare

@fzdwx fzdwx released this 20 Jun 13:14

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

fix: confirm(selection) view error #44

v0.12.0

Choose a tag to compare

@fzdwx fzdwx released this 07 Jun 04:35

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

Choose a tag to compare

@fzdwx fzdwx released this 08 May 02:07
  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

Choose a tag to compare

@fzdwx fzdwx released this 18 Apr 10:38
674bc37
  1. faet: unselected before quit #41 by @wangzhiy

release 0.10.1

Choose a tag to compare

@fzdwx fzdwx released this 03 Feb 12:07

no new component

change

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

release 0.8.8

Choose a tag to compare

@fzdwx fzdwx released this 02 Nov 03:18

Full Changelog: v0.8.7.2...v0.8.8

release 0.8.5

Choose a tag to compare

@fzdwx fzdwx released this 18 Aug 10:05

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

Choose a tag to compare

@fzdwx fzdwx released this 17 Aug 13:31
  1. add confirm(selection) help view
  2. fix #29

release 0.8.2

Choose a tag to compare

@fzdwx fzdwx released this 16 Aug 14:30

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

Choose a tag to compare

@fzdwx fzdwx released this 16 Aug 08:01

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 .