@ni/nimble-components 30.3.1 → 31.1.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 +9 -1
- package/dist/all-components-bundle.js +60 -42
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3476 -3461
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/checkbox/index.js +2 -2
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/combobox/index.js +1 -2
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/combobox/template.js +3 -0
- package/dist/esm/combobox/template.js.map +1 -1
- package/dist/esm/icons/all-icons.d.ts +0 -1
- package/dist/esm/icons/all-icons.js +0 -1
- package/dist/esm/icons/all-icons.js.map +1 -1
- package/dist/esm/patterns/dropdown/styles.js +16 -6
- package/dist/esm/patterns/dropdown/styles.js.map +1 -1
- package/dist/esm/select/index.d.ts +4 -0
- package/dist/esm/select/index.js +14 -0
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/select/template.js +4 -0
- package/dist/esm/select/template.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/icons/check-large.d.ts +0 -13
- package/dist/esm/icons/check-large.js +0 -15
- package/dist/esm/icons/check-large.js.map +0 -1
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
|
-
|
|
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
|
|
16035
|
+
* Generated on Fri, 02 Aug 2024 22:39:40 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="
|
|
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:
|
|
20334
|
+
checkedIndicator: check16X16.data,
|
|
20339
20335
|
indeterminateIndicator: minus16X16.data
|
|
20340
20336
|
});
|
|
20341
20337
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleCheckbox());
|
|
@@ -20532,9 +20528,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20532
20528
|
:host {
|
|
20533
20529
|
color: ${bodyFontColor};
|
|
20534
20530
|
font: ${bodyFont};
|
|
20535
|
-
height: ${controlHeight};
|
|
20536
20531
|
position: relative;
|
|
20537
|
-
|
|
20532
|
+
flex-direction: column;
|
|
20533
|
+
justify-content: flex-start;
|
|
20538
20534
|
${userSelectNone}
|
|
20539
20535
|
min-width: ${menuMinWidth};
|
|
20540
20536
|
outline: none;
|
|
@@ -20550,7 +20546,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20550
20546
|
bottom: calc(${borderWidth} + var(--ni-private-indicator-lines-gap));
|
|
20551
20547
|
width: 0px;
|
|
20552
20548
|
height: 0px;
|
|
20553
|
-
|
|
20549
|
+
align-self: center;
|
|
20554
20550
|
border-bottom: ${borderHoverColor}
|
|
20555
20551
|
var(--ni-private-focus-indicator-width) solid;
|
|
20556
20552
|
transition: width ${smallDelay} ease-in;
|
|
@@ -20576,7 +20572,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20576
20572
|
bottom: calc(-1 * ${borderWidth});
|
|
20577
20573
|
width: 0px;
|
|
20578
20574
|
height: 0px;
|
|
20579
|
-
|
|
20575
|
+
align-self: center;
|
|
20580
20576
|
border-bottom: ${borderHoverColor}
|
|
20581
20577
|
var(--ni-private-hover-indicator-width) solid;
|
|
20582
20578
|
transition: width ${smallDelay} ease-in;
|
|
@@ -20601,12 +20597,22 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20601
20597
|
width: 0px;
|
|
20602
20598
|
}
|
|
20603
20599
|
|
|
20600
|
+
.label {
|
|
20601
|
+
display: flex;
|
|
20602
|
+
color: ${controlLabelFontColor};
|
|
20603
|
+
font: ${controlLabelFont};
|
|
20604
|
+
}
|
|
20605
|
+
|
|
20606
|
+
:host([disabled]) .label {
|
|
20607
|
+
color: ${controlLabelDisabledFontColor};
|
|
20608
|
+
}
|
|
20609
|
+
|
|
20604
20610
|
.control {
|
|
20605
20611
|
align-items: center;
|
|
20606
20612
|
cursor: pointer;
|
|
20607
20613
|
display: flex;
|
|
20608
|
-
min-height: 100%;
|
|
20609
20614
|
width: 100%;
|
|
20615
|
+
height: ${controlHeight};
|
|
20610
20616
|
border: 0px solid rgba(${borderRgbPartialColor}, 0.3);
|
|
20611
20617
|
background-color: transparent;
|
|
20612
20618
|
padding: ${borderWidth};
|
|
@@ -20979,6 +20985,9 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
20979
20985
|
@focusout="${(x, c) => x.focusoutHandler(c.event)}"
|
|
20980
20986
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
20981
20987
|
>
|
|
20988
|
+
<label part="label" class="label">
|
|
20989
|
+
<slot></slot>
|
|
20990
|
+
</label>
|
|
20982
20991
|
<div class="control" part="control" ${ref('controlWrapper')}>
|
|
20983
20992
|
${startSlotTemplate(context, definition)}
|
|
20984
20993
|
<slot name="control">
|
|
@@ -21743,8 +21752,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
21743
21752
|
@keydown="${(x, c) => x.toggleButtonKeyDownHandler(c.event)}"
|
|
21744
21753
|
class="dropdown-button"
|
|
21745
21754
|
part="button"
|
|
21746
|
-
aria-
|
|
21747
|
-
aria-expanded="${x => x.open}"
|
|
21755
|
+
aria-hidden="true"
|
|
21748
21756
|
tabindex="-1"
|
|
21749
21757
|
>
|
|
21750
21758
|
<${iconArrowExpanderDownTag}
|
|
@@ -22883,18 +22891,6 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
22883
22891
|
}
|
|
22884
22892
|
registerIcon('icon-check-dot', IconCheckDot);
|
|
22885
22893
|
|
|
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
22894
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22899
22895
|
// See generation source in nimble-components/build/generate-icons
|
|
22900
22896
|
/**
|
|
@@ -39416,21 +39412,26 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
39416
39412
|
}
|
|
39417
39413
|
let before = $cut.nodeBefore;
|
|
39418
39414
|
// Apply the joining algorithm
|
|
39419
|
-
if (
|
|
39415
|
+
if (deleteBarrier(state, $cut, dispatch, -1))
|
|
39420
39416
|
return true;
|
|
39421
39417
|
// If the node below has no content and the node above is
|
|
39422
39418
|
// selectable, delete the node below and select the one above.
|
|
39423
39419
|
if ($cursor.parent.content.size == 0 &&
|
|
39424
39420
|
(textblockAt(before, "end") || NodeSelection.isSelectable(before))) {
|
|
39425
|
-
let
|
|
39426
|
-
|
|
39427
|
-
if (
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
|
|
39421
|
+
for (let depth = $cursor.depth;; depth--) {
|
|
39422
|
+
let delStep = replaceStep(state.doc, $cursor.before(depth), $cursor.after(depth), Slice.empty);
|
|
39423
|
+
if (delStep && delStep.slice.size < delStep.to - delStep.from) {
|
|
39424
|
+
if (dispatch) {
|
|
39425
|
+
let tr = state.tr.step(delStep);
|
|
39426
|
+
tr.setSelection(textblockAt(before, "end")
|
|
39427
|
+
? Selection$2.findFrom(tr.doc.resolve(tr.mapping.map($cut.pos, -1)), -1)
|
|
39428
|
+
: NodeSelection.create(tr.doc, $cut.pos - before.nodeSize));
|
|
39429
|
+
dispatch(tr.scrollIntoView());
|
|
39430
|
+
}
|
|
39431
|
+
return true;
|
|
39432
39432
|
}
|
|
39433
|
-
|
|
39433
|
+
if (depth == 1 || $cursor.node(depth - 1).childCount > 1)
|
|
39434
|
+
break;
|
|
39434
39435
|
}
|
|
39435
39436
|
}
|
|
39436
39437
|
// If the node before is an atom, delete it
|
|
@@ -39562,7 +39563,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
39562
39563
|
return false;
|
|
39563
39564
|
let after = $cut.nodeAfter;
|
|
39564
39565
|
// Try the joining algorithm
|
|
39565
|
-
if (deleteBarrier(state, $cut, dispatch))
|
|
39566
|
+
if (deleteBarrier(state, $cut, dispatch, 1))
|
|
39566
39567
|
return true;
|
|
39567
39568
|
// If the node above has no content and the node below is
|
|
39568
39569
|
// selectable, delete the node above and select the one below.
|
|
@@ -39794,13 +39795,12 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
39794
39795
|
.scrollIntoView());
|
|
39795
39796
|
return true;
|
|
39796
39797
|
}
|
|
39797
|
-
function deleteBarrier(state, $cut, dispatch) {
|
|
39798
|
+
function deleteBarrier(state, $cut, dispatch, dir) {
|
|
39798
39799
|
let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match;
|
|
39799
|
-
|
|
39800
|
-
|
|
39801
|
-
if (joinMaybeClear(state, $cut, dispatch))
|
|
39800
|
+
let isolated = before.type.spec.isolating || after.type.spec.isolating;
|
|
39801
|
+
if (!isolated && joinMaybeClear(state, $cut, dispatch))
|
|
39802
39802
|
return true;
|
|
39803
|
-
let canDelAfter = $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
39803
|
+
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
39804
39804
|
if (canDelAfter &&
|
|
39805
39805
|
(conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) &&
|
|
39806
39806
|
match.matchType(conn[0] || after.type).validEnd) {
|
|
@@ -39817,7 +39817,7 @@ so this becomes the fallback color for the slot */ ''}
|
|
|
39817
39817
|
}
|
|
39818
39818
|
return true;
|
|
39819
39819
|
}
|
|
39820
|
-
let selAfter = Selection$2.findFrom($cut, 1);
|
|
39820
|
+
let selAfter = after.type.spec.isolating || (dir > 0 && isolated) ? null : Selection$2.findFrom($cut, 1);
|
|
39821
39821
|
let range = selAfter && selAfter.$from.blockRange(selAfter.$to), target = range && liftTarget(range);
|
|
39822
39822
|
if (target != null && target >= $cut.depth) {
|
|
39823
39823
|
if (dispatch)
|
|
@@ -60378,6 +60378,7 @@ img.ProseMirror-separator {
|
|
|
60378
60378
|
aria-disabled="${x => x.ariaDisabled}"
|
|
60379
60379
|
aria-expanded="${x => x.ariaExpanded}"
|
|
60380
60380
|
aria-haspopup="${x => (x.collapsible ? 'listbox' : null)}"
|
|
60381
|
+
aria-label="${x => x.labelContent}"
|
|
60381
60382
|
aria-multiselectable="${x => x.ariaMultiSelectable}"
|
|
60382
60383
|
?open="${x => x.open}"
|
|
60383
60384
|
role="combobox"
|
|
@@ -60389,6 +60390,9 @@ img.ProseMirror-separator {
|
|
|
60389
60390
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
60390
60391
|
@mousedown="${(x, c) => x.mousedownHandler(c.event)}"
|
|
60391
60392
|
>
|
|
60393
|
+
<label part="label" class="label" aria-hidden="true">
|
|
60394
|
+
<slot ${ref('labelSlot')}></slot>
|
|
60395
|
+
</label>
|
|
60392
60396
|
${when(x => x.collapsible, html `
|
|
60393
60397
|
<div
|
|
60394
60398
|
class="control"
|
|
@@ -60574,6 +60578,17 @@ img.ProseMirror-separator {
|
|
|
60574
60578
|
get collapsible() {
|
|
60575
60579
|
return !(this.multiple || typeof this.size === 'number');
|
|
60576
60580
|
}
|
|
60581
|
+
/** @internal */
|
|
60582
|
+
get labelContent() {
|
|
60583
|
+
if (!this.$fastController.isConnected) {
|
|
60584
|
+
return '';
|
|
60585
|
+
}
|
|
60586
|
+
const nodes = this.labelSlot.assignedNodes();
|
|
60587
|
+
return nodes
|
|
60588
|
+
.filter(node => node.textContent?.trim() !== '')
|
|
60589
|
+
.map(node => node.textContent?.trim())
|
|
60590
|
+
.join(' ');
|
|
60591
|
+
}
|
|
60577
60592
|
/**
|
|
60578
60593
|
* @internal
|
|
60579
60594
|
*/
|
|
@@ -61539,6 +61554,9 @@ img.ProseMirror-separator {
|
|
|
61539
61554
|
__decorate$1([
|
|
61540
61555
|
volatile
|
|
61541
61556
|
], Select.prototype, "collapsible", null);
|
|
61557
|
+
__decorate$1([
|
|
61558
|
+
volatile
|
|
61559
|
+
], Select.prototype, "labelContent", null);
|
|
61542
61560
|
__decorate$1([
|
|
61543
61561
|
volatile
|
|
61544
61562
|
], Select.prototype, "displayValue", null);
|