0.3.3 • Published 4 years ago

@buckneri/js-lib-slicer v0.3.3

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

js-lib-slicer

Simple slicer behaviour

Install

npm i @buckneri/js-lib-slicer

Reference · Source

  const s = new Slicer(["A", "B", "C"]);

  // select a single item
  s.toggleSingle("A");
  
  // toggle() is the shorthand for toggleSingle()
  // selecting the same value de-selects it
  s.toggle("A");

  // SlicerModifier.CTRL_KEY defines the Control key selection process on a slicer
  s.toggle("C", SlicerModifier.CTRL_KEY); // selection = "C"
  // equivalent to s.toggleCumulative("C");

  // SlicerModifier.SHIFT_KEY defines the Shift key selection process on a slicer
  s.toggle("B", SlicerModifier.SHIFT_KEY); // selection = "B", "C"
  // equivalent to s.toggleRange("B");

  // Add a new member to the collection
  a.add("D"); // ["A", "B", "C", "D"]

  // Remove a member from the collection
  a.remove("A"); // ["B", "C", "D"]
0.3.3

4 years ago

0.3.1

4 years ago

0.2.10

4 years ago

0.2.1

4 years ago

0.1.2

4 years ago

0.1.7

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago