@ni/nimble-components 30.3.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,8 +31,16 @@ If you have an existing application that incorporates a module bundler like [Web
31
31
  If you have a static webpage without a bundler, you can use `@ni/nimble-components` by including one of the bundled distribution files. For example:
32
32
 
33
33
  ```html
34
- <html>
34
+ <!doctype html>
35
+ <html lang="en">
35
36
  <head>
37
+ <meta charset="utf-8" />
38
+ <meta name="viewport" content="width=device-width" />
39
+ <title>Nimble Example</title>
40
+ <link
41
+ rel="stylesheet"
42
+ href="https://unpkg.com/@ni/nimble-tokens/dist/fonts/css/fonts.css"
43
+ />
36
44
  <script src="https://unpkg.com/@ni/nimble-components/dist/all-components-bundle.js"></script>
37
45
  </head>
38
46
  <body>
@@ -16032,7 +16032,7 @@
16032
16032
 
16033
16033
  /**
16034
16034
  * Do not edit directly
16035
- * Generated on Thu, 01 Aug 2024 08:35:14 GMT
16035
+ * Generated on Fri, 02 Aug 2024 22:00:00 GMT
16036
16036
  */
16037
16037
 
16038
16038
  const Information100DarkUi = "#a46eff";
@@ -18916,16 +18916,12 @@
18916
18916
  };
18917
18917
  const check16X16 = {
18918
18918
  name: 'check_16_x_16',
18919
- data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M13 5.287 6.182 12 3 8.867l1.363-1.343L6.24 9.37 11.693 4Z" class="cls-1"/></svg>`,
18919
+ data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="m14 4.693-8.182 8.182L2 9.057 3.636 7.42l2.25 2.25 6.546-6.545z" class="cls-1"/></svg>`,
18920
18920
  };
18921
18921
  const checkDot16X16 = {
18922
18922
  name: 'check_dot_16_x_16',
18923
18923
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><circle cx="12.5" cy="11.5" r="1.5" class="cls-1"/><path d="m14 4.693-8.182 8.182L2 9.057 3.636 7.42l2.25 2.25 6.546-6.545Z" class="cls-2"/></svg>`,
18924
18924
  };
18925
- const checkLarge16X16 = {
18926
- name: 'check_large_16_x_16',
18927
- data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="m14 4.693-8.182 8.182L2 9.057 3.636 7.42l2.25 2.25 6.546-6.545z" class="cls-1"/></svg>`,
18928
- };
18929
18925
  const circle16X16 = {
18930
18926
  name: 'circle_16_x_16',
18931
18927
  data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M8 2a6 6 0 1 0 6 6 6 6 0 0 0-6-6m0 9.429A3.429 3.429 0 1 1 11.429 8 3.43 3.43 0 0 1 8 11.429" class="cls-1"/></svg>`,
@@ -20335,7 +20331,7 @@ so this becomes the fallback color for the slot */ ''}
20335
20331
  baseClass: Checkbox$1,
20336
20332
  template: template$A,
20337
20333
  styles: styles$M,
20338
- checkedIndicator: checkLarge16X16.data,
20334
+ checkedIndicator: check16X16.data,
20339
20335
  indeterminateIndicator: minus16X16.data
20340
20336
  });
20341
20337
  DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
@@ -22883,18 +22879,6 @@ so this becomes the fallback color for the slot */ ''}
22883
22879
  }
22884
22880
  registerIcon('icon-check-dot', IconCheckDot);
22885
22881
 
22886
- // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22887
- // See generation source in nimble-components/build/generate-icons
22888
- /**
22889
- * The icon component for the 'checkLarge' icon
22890
- */
22891
- class IconCheckLarge extends Icon {
22892
- constructor() {
22893
- super(checkLarge16X16);
22894
- }
22895
- }
22896
- registerIcon('icon-check-large', IconCheckLarge);
22897
-
22898
22882
  // AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
22899
22883
  // See generation source in nimble-components/build/generate-icons
22900
22884
  /**
@@ -39416,21 +39400,26 @@ so this becomes the fallback color for the slot */ ''}
39416
39400
  }
39417
39401
  let before = $cut.nodeBefore;
39418
39402
  // Apply the joining algorithm
39419
- if (!before.type.spec.isolating && deleteBarrier(state, $cut, dispatch))
39403
+ if (deleteBarrier(state, $cut, dispatch, -1))
39420
39404
  return true;
39421
39405
  // If the node below has no content and the node above is
39422
39406
  // selectable, delete the node below and select the one above.
39423
39407
  if ($cursor.parent.content.size == 0 &&
39424
39408
  (textblockAt(before, "end") || NodeSelection.isSelectable(before))) {
39425
- let delStep = replaceStep(state.doc, $cursor.before(), $cursor.after(), Slice.empty);
39426
- if (delStep && delStep.slice.size < delStep.to - delStep.from) {
39427
- if (dispatch) {
39428
- let tr = state.tr.step(delStep);
39429
- tr.setSelection(textblockAt(before, "end") ? Selection$2.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)
39430
- : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));
39431
- dispatch(tr.scrollIntoView());
39409
+ for (let depth = $cursor.depth;; depth--) {
39410
+ let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);
39411
+ if (delStep && delStep.slice.size < delStep.to - delStep.from) {
39412
+ if (dispatch) {
39413
+ let tr = state.tr.step(delStep);
39414
+ tr.setSelection(textblockAt(before, "end")
39415
+ ? Selection$2.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)
39416
+ : NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));
39417
+ dispatch(tr.scrollIntoView());
39418
+ }
39419
+ return true;
39432
39420
  }
39433
- return true;
39421
+ if (depth == 1 || $cursor.node(depth - 1).childCount > 1)
39422
+ break;
39434
39423
  }
39435
39424
  }
39436
39425
  // If the node before is an atom, delete it
@@ -39562,7 +39551,7 @@ so this becomes the fallback color for the slot */ ''}
39562
39551
  return false;
39563
39552
  let after = $cut.nodeAfter;
39564
39553
  // Try the joining algorithm
39565
- if (deleteBarrier(state, $cut, dispatch))
39554
+ if (deleteBarrier(state, $cut, dispatch, 1))
39566
39555
  return true;
39567
39556
  // If the node above has no content and the node below is
39568
39557
  // selectable, delete the node above and select the one below.
@@ -39794,13 +39783,12 @@ so this becomes the fallback color for the slot */ ''}
39794
39783
  .scrollIntoView());
39795
39784
  return true;
39796
39785
  }
39797
- function deleteBarrier(state, $cut, dispatch) {
39786
+ function deleteBarrier(state, $cut, dispatch, dir) {
39798
39787
  let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;
39799
- if (before.type.spec.isolating || after.type.spec.isolating)
39800
- return false;
39801
- if (joinMaybeClear(state, $cut, dispatch))
39788
+ let isolated = before.type.spec.isolating || after.type.spec.isolating;
39789
+ if (!isolated && joinMaybeClear(state, $cut, dispatch))
39802
39790
  return true;
39803
- let canDelAfter = $cut.parent.canReplace($cut.index(), $cut.index() + 1);
39791
+ let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
39804
39792
  if (canDelAfter &&
39805
39793
  (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&
39806
39794
  match.matchType(conn[0] || after.type).validEnd) {
@@ -39817,7 +39805,7 @@ so this becomes the fallback color for the slot */ ''}
39817
39805
  }
39818
39806
  return true;
39819
39807
  }
39820
- let selAfter = Selection$2.findFrom($cut, 1);
39808
+ let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection$2.findFrom($cut, 1);
39821
39809
  let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);
39822
39810
  if (target != null && target >= $cut.depth) {
39823
39811
  if (dispatch)
@@ -60871,14 +60859,54 @@ img.ProseMirror-separator {
60871
60859
  */
60872
60860
  keydownHandler(e) {
60873
60861
  const initialSelectedIndex = this.selectedIndex;
60874
- super.keydownHandler(e);
60875
60862
  const key = e.key;
60876
60863
  if (e.ctrlKey || e.shiftKey) {
60877
60864
  return true;
60878
60865
  }
60866
+ if (key !== keyArrowDown && key !== keyArrowUp) {
60867
+ super.keydownHandler(e);
60868
+ }
60879
60869
  let currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;
60880
60870
  let commitValueThenClose = false;
60881
60871
  switch (key) {
60872
+ case keyArrowDown: {
60873
+ const selectedOption = this.options[this.selectedIndex];
60874
+ if (this.open
60875
+ && isListOption(selectedOption)
60876
+ && !isOptionOrGroupVisible(selectedOption)) {
60877
+ if (this.openActiveIndex === this.selectedIndex) {
60878
+ this.selectFirstOption();
60879
+ }
60880
+ else {
60881
+ this.selectNextOption();
60882
+ }
60883
+ }
60884
+ else {
60885
+ super.keydownHandler(e);
60886
+ }
60887
+ // update currentActiveIndex again as dependent state may have changed
60888
+ currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;
60889
+ break;
60890
+ }
60891
+ case keyArrowUp: {
60892
+ const selectedOption = this.options[this.selectedIndex];
60893
+ if (this.open
60894
+ && isListOption(selectedOption)
60895
+ && !isOptionOrGroupVisible(selectedOption)) {
60896
+ if (this.openActiveIndex === this.selectedIndex) {
60897
+ this.selectLastOption();
60898
+ }
60899
+ else {
60900
+ this.selectPreviousOption();
60901
+ }
60902
+ }
60903
+ else {
60904
+ super.keydownHandler(e);
60905
+ }
60906
+ // update currentActiveIndex again as dependent state may have changed
60907
+ currentActiveIndex = this.openActiveIndex ?? this.selectedIndex;
60908
+ break;
60909
+ }
60882
60910
  case keySpace: {
60883
60911
  // when dropdown is open allow user to enter a space for filter text
60884
60912
  if (this.open && this.filterMode !== FilterMode.none) {