@ni/ok-components 1.13.0 → 1.15.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.
Files changed (31) hide show
  1. package/dist/all-components-bundle.js +587 -449
  2. package/dist/all-components-bundle.js.map +1 -1
  3. package/dist/all-components-bundle.min.js +2814 -2902
  4. package/dist/all-components-bundle.min.js.map +1 -1
  5. package/dist/custom-elements.json +433 -243
  6. package/dist/custom-elements.md +67 -44
  7. package/dist/esm/fv/all-fv.d.ts +1 -0
  8. package/dist/esm/fv/all-fv.js +1 -0
  9. package/dist/esm/fv/all-fv.js.map +1 -1
  10. package/dist/esm/fv/split-button/styles.js +45 -5
  11. package/dist/esm/fv/split-button/styles.js.map +1 -1
  12. package/dist/esm/fv/split-button/template.js +3 -1
  13. package/dist/esm/fv/split-button/template.js.map +1 -1
  14. package/dist/esm/fv/split-button-anchor/index.d.ts +2 -2
  15. package/dist/esm/fv/split-button-anchor/index.js +4 -4
  16. package/dist/esm/fv/split-button-anchor/index.js.map +1 -1
  17. package/dist/esm/fv/split-button-anchor/styles.d.ts +1 -1
  18. package/dist/esm/fv/split-button-anchor/styles.js +1 -227
  19. package/dist/esm/fv/split-button-anchor/styles.js.map +1 -1
  20. package/dist/esm/fv/split-button-anchor/template.js +9 -4
  21. package/dist/esm/fv/split-button-anchor/template.js.map +1 -1
  22. package/dist/esm/fv/toolbar/index.d.ts +36 -0
  23. package/dist/esm/fv/toolbar/index.js +253 -0
  24. package/dist/esm/fv/toolbar/index.js.map +1 -0
  25. package/dist/esm/fv/toolbar/styles.d.ts +1 -0
  26. package/dist/esm/fv/toolbar/styles.js +39 -0
  27. package/dist/esm/fv/toolbar/styles.js.map +1 -0
  28. package/dist/esm/fv/toolbar/template.d.ts +4 -0
  29. package/dist/esm/fv/toolbar/template.js +40 -0
  30. package/dist/esm/fv/toolbar/template.js.map +1 -0
  31. package/package.json +1 -1
@@ -8,32 +8,6 @@
8
8
 
9
9
  <hr/>
10
10
 
11
- ## class: `FvAccordionItem`
12
-
13
- ### Superclass
14
-
15
- | Name | Module | Package |
16
- | ------------------- | ------ | ------------------- |
17
- | `FoundationElement` | | @ni/fast-foundation |
18
-
19
- ### Fields
20
-
21
- | Name | Privacy | Type | Default | Description | Inherited From |
22
- | ------------ | ------- | --------------------------- | ------- | ----------- | -------------- |
23
- | `header` | public | `string` | `''` | | |
24
- | `expanded` | public | `boolean` | `false` | | |
25
- | `appearance` | public | `FvAccordionItemAppearance` | | | |
26
-
27
- ### Attributes
28
-
29
- | Name | Field | Inherited From |
30
- | ------------ | ---------- | -------------- |
31
- | `header` | header | |
32
- | `expanded` | expanded | |
33
- | `appearance` | appearance | |
34
-
35
- <hr/>
36
-
37
11
  ## class: `FvBulkEditField`
38
12
 
39
13
  ### Superclass
@@ -91,6 +65,32 @@
91
65
 
92
66
  <hr/>
93
67
 
68
+ ## class: `FvAccordionItem`
69
+
70
+ ### Superclass
71
+
72
+ | Name | Module | Package |
73
+ | ------------------- | ------ | ------------------- |
74
+ | `FoundationElement` | | @ni/fast-foundation |
75
+
76
+ ### Fields
77
+
78
+ | Name | Privacy | Type | Default | Description | Inherited From |
79
+ | ------------ | ------- | --------------------------- | ------- | ----------- | -------------- |
80
+ | `header` | public | `string` | `''` | | |
81
+ | `expanded` | public | `boolean` | `false` | | |
82
+ | `appearance` | public | `FvAccordionItemAppearance` | | | |
83
+
84
+ ### Attributes
85
+
86
+ | Name | Field | Inherited From |
87
+ | ------------ | ---------- | -------------- |
88
+ | `header` | header | |
89
+ | `expanded` | expanded | |
90
+ | `appearance` | appearance | |
91
+
92
+ <hr/>
93
+
94
94
  ## class: `FvCard`
95
95
 
96
96
  ### Superclass
@@ -532,7 +532,7 @@
532
532
 
533
533
  <hr/>
534
534
 
535
- ## class: `FvStickyHeader`
535
+ ## class: `FvSummaryPanelTile`
536
536
 
537
537
  ### Superclass
538
538
 
@@ -540,6 +540,28 @@
540
540
  | ------------------- | ------ | ------------------- |
541
541
  | `FoundationElement` | | @ni/fast-foundation |
542
542
 
543
+ ### Fields
544
+
545
+ | Name | Privacy | Type | Default | Description | Inherited From |
546
+ | -------------- | ------- | ------------------------------------ | ------- | ----------- | -------------- |
547
+ | `count` | public | `string` | `''` | | |
548
+ | `label` | public | `string` | `''` | | |
549
+ | `legacyStyle` | public | `boolean` | `false` | | |
550
+ | `size` | public | `FvSummaryPanelSizeType` | | | |
551
+ | `selected` | public | `boolean` | `false` | | |
552
+ | `textPosition` | public | `FvSummaryPanelTileTextPositionType` | | | |
553
+
554
+ ### Attributes
555
+
556
+ | Name | Field | Inherited From |
557
+ | --------------- | ------------ | -------------- |
558
+ | `count` | count | |
559
+ | `label` | label | |
560
+ | `legacy-style` | legacyStyle | |
561
+ | `size` | size | |
562
+ | `selected` | selected | |
563
+ | `text-position` | textPosition | |
564
+
543
565
  <hr/>
544
566
 
545
567
  ## class: `FvSummaryPanel`
@@ -576,7 +598,7 @@
576
598
 
577
599
  <hr/>
578
600
 
579
- ## class: `FvSummaryPanelTile`
601
+ ## class: `FvStickyHeader`
580
602
 
581
603
  ### Superclass
582
604
 
@@ -584,27 +606,28 @@
584
606
  | ------------------- | ------ | ------------------- |
585
607
  | `FoundationElement` | | @ni/fast-foundation |
586
608
 
609
+ <hr/>
610
+
611
+ ## class: `FvToolbar`
612
+
613
+ ### Superclass
614
+
615
+ | Name | Module | Package |
616
+ | --------- | ------ | -------------------------------------- |
617
+ | `Toolbar` | | @ni/nimble-components/dist/esm/toolbar |
618
+
587
619
  ### Fields
588
620
 
589
- | Name | Privacy | Type | Default | Description | Inherited From |
590
- | -------------- | ------- | ------------------------------------ | ------- | ----------- | -------------- |
591
- | `count` | public | `string` | `''` | | |
592
- | `label` | public | `string` | `''` | | |
593
- | `legacyStyle` | public | `boolean` | `false` | | |
594
- | `size` | public | `FvSummaryPanelSizeType` | | | |
595
- | `selected` | public | `boolean` | `false` | | |
596
- | `textPosition` | public | `FvSummaryPanelTileTextPositionType` | | | |
621
+ | Name | Privacy | Type | Default | Description | Inherited From |
622
+ | ----------------- | --------- | ------------------------- | ---------------- | ----------- | -------------- |
623
+ | `overflowLabel` | public | `string` | `'More actions'` | | |
624
+ | `allSlottedItems` | protected | `(HTMLElement \| Node)[]` | | | |
597
625
 
598
626
  ### Attributes
599
627
 
600
- | Name | Field | Inherited From |
601
- | --------------- | ------------ | -------------- |
602
- | `count` | count | |
603
- | `label` | label | |
604
- | `legacy-style` | legacyStyle | |
605
- | `size` | size | |
606
- | `selected` | selected | |
607
- | `text-position` | textPosition | |
628
+ | Name | Field | Inherited From |
629
+ | ---------------- | ------------- | -------------- |
630
+ | `overflow-label` | overflowLabel | |
608
631
 
609
632
  <hr/>
610
633
 
@@ -15,3 +15,4 @@ import './summary-panel-tile';
15
15
  import './search-input';
16
16
  import './splitter';
17
17
  import './split-layout';
18
+ import './toolbar';
@@ -15,4 +15,5 @@ import './summary-panel-tile';
15
15
  import './search-input';
16
16
  import './splitter';
17
17
  import './split-layout';
18
+ import './toolbar';
18
19
  //# sourceMappingURL=all-fv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './bulk-edit-field';\nimport './chip-selector';\nimport './context-help';\nimport './edit-commit-bar';\nimport './filter-bar';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './sticky-header';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\nimport './splitter';\nimport './split-layout';\n"]}
1
+ {"version":3,"file":"all-fv.js","sourceRoot":"","sources":["../../../src/fv/all-fv.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,QAAQ,CAAC;AAChB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AACpB,OAAO,gBAAgB,CAAC;AACxB,OAAO,WAAW,CAAC","sourcesContent":["import './accordion-item';\nimport './card';\nimport './bulk-edit-field';\nimport './chip-selector';\nimport './context-help';\nimport './edit-commit-bar';\nimport './filter-bar';\nimport './master-detail-list-item';\nimport './master-detail-list';\nimport './split-button';\nimport './split-button-anchor';\nimport './sticky-header';\nimport './summary-panel';\nimport './summary-panel-tile';\nimport './search-input';\nimport './splitter';\nimport './split-layout';\nimport './toolbar';\n"]}
@@ -109,9 +109,32 @@ export const styles = css `
109
109
  }
110
110
 
111
111
  .split-button-primary {
112
+ display: inline-flex;
113
+ align-items: center;
114
+ justify-content: center;
112
115
  padding: 0 ${standardPadding};
113
116
  padding-inline-end: ${mediumPadding};
114
117
  white-space: nowrap;
118
+ text-decoration: none;
119
+ }
120
+
121
+ slot[name='start']::slotted(*),
122
+ slot[name='end']::slotted(*) {
123
+ flex-shrink: 0;
124
+ color: currentColor;
125
+ ${iconColor.cssCustomProperty}: currentColor;
126
+ }
127
+
128
+ slot[name='start']::slotted(*) {
129
+ margin-inline-end: ${smallPadding};
130
+ }
131
+
132
+ slot[name='end']::slotted(*) {
133
+ margin-inline-start: ${smallPadding};
134
+ }
135
+
136
+ .split-button-primary-disabled {
137
+ cursor: default;
115
138
  }
116
139
 
117
140
  .split-button-toggle {
@@ -145,21 +168,21 @@ export const styles = css `
145
168
  }
146
169
 
147
170
  @layer hover {
148
- .split-button-primary:enabled:hover,
171
+ .split-button-primary:is(:enabled, [href]):hover,
149
172
  .split-button-toggle:enabled:hover {
150
173
  border-color: ${borderHoverColor};
151
174
  box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
152
175
  z-index: 1;
153
176
  }
154
177
 
155
- .split-button-primary:enabled:hover + .split-button-toggle::after,
178
+ .split-button-primary:is(:enabled, [href]):hover + .split-button-toggle::after,
156
179
  .split-button-toggle:enabled:hover::after {
157
180
  visibility: hidden;
158
181
  }
159
182
  }
160
183
 
161
184
  @layer focusVisible {
162
- .split-button-primary:enabled:focus-visible,
185
+ .split-button-primary:is(:enabled, [href]):focus-visible,
163
186
  .split-button-toggle:enabled:focus-visible {
164
187
  border-color: ${borderHoverColor};
165
188
  box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
@@ -178,7 +201,7 @@ export const styles = css `
178
201
  }
179
202
 
180
203
  @layer active {
181
- .split-button-primary:enabled:active,
204
+ .split-button-primary:is(:enabled, [href]):active,
182
205
  .split-button-toggle:enabled:active,
183
206
  :host([open]) .split-button-toggle {
184
207
  border-color: ${borderHoverColor};
@@ -196,7 +219,7 @@ export const styles = css `
196
219
  visibility: hidden;
197
220
  }
198
221
 
199
- :host([appearance='block']) .split-button-primary:enabled:active,
222
+ :host([appearance='block']) .split-button-primary:is(:enabled, [href]):active,
200
223
  :host([appearance='block']) .split-button-toggle:enabled:active,
201
224
  :host([appearance='block'][open]) .split-button-toggle {
202
225
  background-color: ${applicationBackgroundColor};
@@ -214,6 +237,14 @@ export const styles = css `
214
237
  --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};
215
238
  }
216
239
 
240
+ :host([disabled][appearance='block']) {
241
+ --ni-private-ok-fv-split-button-background-image: linear-gradient(
242
+ rgba(${borderRgbPartialColor}, 0.1),
243
+ rgba(${borderRgbPartialColor}, 0.1)
244
+ );
245
+ --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);
246
+ }
247
+
217
248
  :host([disabled][appearance='outline']) {
218
249
  --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);
219
250
  }
@@ -222,6 +253,15 @@ export const styles = css `
222
253
  :host([disabled]) .split-button-toggle {
223
254
  cursor: default;
224
255
  box-shadow: none;
256
+ background-image: none;
257
+ background-size: 100% 100%;
258
+ }
259
+
260
+ :host([disabled]) slot[name='start']::slotted(*),
261
+ :host([disabled]) slot[name='end']::slotted(*),
262
+ :host([disabled]) .split-button-toggle > * {
263
+ opacity: 0.3;
264
+ ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};
225
265
  }
226
266
 
227
267
  :host([disabled][appearance='ghost']) .split-button-primary,
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/split-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,cAAc,CAAC;;;;2DAI0B,qBAAqB;qDAC3B,oBAAoB;;sBAEnD,aAAa;;;;;;;;;;uBAUZ,qBAAqB;uBACrB,qBAAqB;;2DAEe,qBAAqB;;;;0DAItB,qBAAqB;;;;sDAIzB,8BAA8B;qDAC/B,4BAA4B;;;;;kBAK/D,sBAAsB;kBACtB,sBAAsB;;sDAEc,sBAAsB;qDACvB,sBAAsB;;;;;kBAKzD,qBAAqB;kBACrB,qBAAqB;;sDAEe,qBAAqB;qDACtB,0BAA0B;;;;;;;;;;;;;;sBAczD,WAAW;;;;;;;;;;;;;;sBAcX,WAAW;;;;;;;;oBAQb,eAAe;;;;6BAIN,UAAU;+BACR,UAAU;kCACP,UAAU;;;;;;;;;;;kCAWV,UAAU;;;;yBAInB,eAAe;kCACN,aAAa;;;;;qBAK1B,aAAa;yBACT,aAAa;;;;;;;;;;2BAUX,YAAY;4CACK,WAAW;8BACzB,WAAW;+BACV,qBAAqB;;;;;;cAMtC,SAAS,CAAC,iBAAiB;;;;;sBAKnB,YAAY;;;;;;;4BAON,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;;;;;;;4BAanC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;uBAMxC,WAAW,UAAU,gBAAgB;;;;;;;;;;;;;4BAahC,gBAAgB;;gDAEI,iBAAiB,KAAK,iBAAiB;;;;;iCAKtD,2BAA2B;;;;;;;;;;;gCAW5B,0BAA0B;;;;;;qBAMrC,4BAA4B;;;;;;qDAMI,4BAA4B;;;;2DAItB,qBAAqB;;;;;;;;;;;;;;;;CAgB/E,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n actionRgbPartialColor,\n applicationBackgroundColor,\n borderHoverColor,\n borderRgbPartialColor,\n borderWidth,\n buttonAccentBlockFontColor,\n buttonAccentOutlineFontColor,\n buttonBorderAccentOutlineColor,\n buttonFillAccentColor,\n buttonFillPrimaryColor,\n buttonLabelDisabledFontColor,\n buttonLabelFont,\n buttonLabelFontColor,\n buttonPrimaryFontColor,\n controlHeight,\n fillSelectedColor,\n fillSelectedRgbPartialColor,\n iconColor,\n mediumPadding,\n smallDelay,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n --ni-private-ok-fv-split-button-background-image: none;\n --ni-private-ok-fv-split-button-border: rgba(${actionRgbPartialColor}, 0.3);\n --ni-private-ok-fv-split-button-color: ${buttonLabelFontColor};\n position: relative;\n height: ${controlHeight};\n vertical-align: middle;\n }\n\n :host([appearance='ghost']) {\n --ni-private-ok-fv-split-button-border: transparent;\n }\n\n :host([appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([appearance='outline'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-border: rgb(${actionRgbPartialColor});\n }\n\n :host([appearance='outline'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-border: ${buttonBorderAccentOutlineColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentOutlineFontColor};\n }\n\n :host([appearance='block'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillPrimaryColor},\n ${buttonFillPrimaryColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillPrimaryColor};\n --ni-private-ok-fv-split-button-color: ${buttonPrimaryFontColor};\n }\n\n :host([appearance='block'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillAccentColor},\n ${buttonFillAccentColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillAccentColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentBlockFontColor};\n }\n\n .split-button-container {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n height: 100%;\n }\n\n .split-button-container::before {\n content: '';\n position: absolute;\n inset: 0;\n border: ${borderWidth} solid var(--ni-private-ok-fv-split-button-border);\n background-image: var(--ni-private-ok-fv-split-button-background-image);\n background-repeat: no-repeat;\n pointer-events: none;\n }\n\n .split-button-primary,\n .split-button-toggle {\n appearance: none;\n position: relative;\n z-index: 0;\n height: 100%;\n box-sizing: border-box;\n margin: 0;\n border: ${borderWidth} solid transparent;\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n background-origin: border-box;\n background-size: 100% 100%;\n color: var(--ni-private-ok-fv-split-button-color);\n fill: currentcolor;\n font: ${buttonLabelFont};\n cursor: pointer;\n outline: none;\n transition:\n box-shadow ${smallDelay} ease-in-out,\n border-color ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-in-out;\n }\n\n .split-button-primary::before,\n .split-button-toggle::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n outline: 0px solid transparent;\n outline-offset: -3px;\n transition: outline ${smallDelay} ease-in-out;\n }\n\n .split-button-primary {\n padding: 0 ${standardPadding};\n padding-inline-end: ${mediumPadding};\n white-space: nowrap;\n }\n\n .split-button-toggle {\n width: ${controlHeight};\n min-width: ${controlHeight};\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n\n .split-button-toggle::after {\n content: '';\n position: absolute;\n inset-block: ${smallPadding};\n inset-inline-start: calc(-1 * ${borderWidth});\n width: calc(2 * ${borderWidth});\n background: rgba(${borderRgbPartialColor}, 0.1);\n pointer-events: none;\n }\n\n .split-button-toggle > * {\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='menu']::slotted(*) {\n min-width: 100%;\n margin: ${smallPadding} 0 0;\n }\n }\n\n @layer hover {\n .split-button-primary:enabled:hover,\n .split-button-toggle:enabled:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:enabled:hover + .split-button-toggle::after,\n .split-button-toggle:enabled:hover::after {\n visibility: hidden;\n }\n }\n\n @layer focusVisible {\n .split-button-primary:enabled:focus-visible,\n .split-button-toggle:enabled:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:focus-visible::before,\n .split-button-toggle:focus-visible::before {\n outline: ${borderWidth} solid ${borderHoverColor};\n }\n\n .split-button-primary:focus-visible + .split-button-toggle::after,\n .split-button-toggle:focus-visible::after {\n visibility: hidden;\n }\n }\n\n @layer active {\n .split-button-primary:enabled:active,\n .split-button-toggle:enabled:active,\n :host([open]) .split-button-toggle {\n border-color: ${borderHoverColor};\n box-shadow: none;\n background-image: linear-gradient(${fillSelectedColor}, ${fillSelectedColor});\n background-size: calc(100% - 2px) calc(100% - 2px);\n }\n\n :host([open]) .split-button-toggle {\n border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);\n background-size: 100% 100%;\n }\n\n :host([open]) .split-button-toggle::after {\n visibility: hidden;\n }\n\n :host([appearance='block']) .split-button-primary:enabled:active,\n :host([appearance='block']) .split-button-toggle:enabled:active,\n :host([appearance='block'][open]) .split-button-toggle {\n background-color: ${applicationBackgroundColor};\n }\n\n :host([appearance='outline'][appearance-variant='accent']) .split-button-primary:active,\n :host([appearance='outline'][appearance-variant='accent']) .split-button-toggle:active,\n :host([appearance='outline'][appearance-variant='accent'][open]) .split-button-toggle {\n color: ${buttonAccentOutlineFontColor};\n }\n }\n\n @layer disabled {\n :host([disabled]) {\n --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};\n }\n\n :host([disabled][appearance='outline']) {\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n :host([disabled]) .split-button-primary,\n :host([disabled]) .split-button-toggle {\n cursor: default;\n box-shadow: none;\n }\n\n :host([disabled][appearance='ghost']) .split-button-primary,\n :host([disabled][appearance='ghost']) .split-button-toggle {\n border-color: transparent;\n }\n }\n\n @layer top {}\n`;"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/split-button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,EACX,0BAA0B,EAC1B,4BAA4B,EAC5B,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,2BAA2B,EAC3B,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,eAAe,EAClB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;UAIf,OAAO,CAAC,cAAc,CAAC;;;;2DAI0B,qBAAqB;qDAC3B,oBAAoB;;sBAEnD,aAAa;;;;;;;;;;uBAUZ,qBAAqB;uBACrB,qBAAqB;;2DAEe,qBAAqB;;;;0DAItB,qBAAqB;;;;sDAIzB,8BAA8B;qDAC/B,4BAA4B;;;;;kBAK/D,sBAAsB;kBACtB,sBAAsB;;sDAEc,sBAAsB;qDACvB,sBAAsB;;;;;kBAKzD,qBAAqB;kBACrB,qBAAqB;;sDAEe,qBAAqB;qDACtB,0BAA0B;;;;;;;;;;;;;;sBAczD,WAAW;;;;;;;;;;;;;;sBAcX,WAAW;;;;;;;;oBAQb,eAAe;;;;6BAIN,UAAU;+BACR,UAAU;kCACP,UAAU;;;;;;;;;;;kCAWV,UAAU;;;;;;;yBAOnB,eAAe;kCACN,aAAa;;;;;;;;;cASjC,SAAS,CAAC,iBAAiB;;;;iCAIR,YAAY;;;;mCAIV,YAAY;;;;;;;;qBAQ1B,aAAa;yBACT,aAAa;;;;;;;;;;2BAUX,YAAY;4CACK,WAAW;8BACzB,WAAW;+BACV,qBAAqB;;;;;;cAMtC,SAAS,CAAC,iBAAiB;;;;;sBAKnB,YAAY;;;;;;;4BAON,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;;;;;;;4BAanC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;uBAMxC,WAAW,UAAU,gBAAgB;;;;;;;;;;;;;4BAahC,gBAAgB;;gDAEI,iBAAiB,KAAK,iBAAiB;;;;;iCAKtD,2BAA2B;;;;;;;;;;;gCAW5B,0BAA0B;;;;;;qBAMrC,4BAA4B;;;;;;qDAMI,4BAA4B;;;;;uBAK1D,qBAAqB;uBACrB,qBAAqB;;2DAEe,qBAAqB;;;;2DAIrB,qBAAqB;;;;;;;;;;;;;;;cAelE,SAAS,CAAC,iBAAiB,KAAK,oBAAoB;;;;;;;;;;CAUjE,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n actionRgbPartialColor,\n applicationBackgroundColor,\n borderHoverColor,\n borderRgbPartialColor,\n borderWidth,\n buttonAccentBlockFontColor,\n buttonAccentOutlineFontColor,\n buttonBorderAccentOutlineColor,\n buttonFillAccentColor,\n buttonFillPrimaryColor,\n buttonLabelDisabledFontColor,\n buttonLabelFont,\n buttonLabelFontColor,\n buttonPrimaryFontColor,\n controlHeight,\n fillSelectedColor,\n fillSelectedRgbPartialColor,\n iconColor,\n mediumPadding,\n smallDelay,\n smallPadding,\n standardPadding\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../../utilities/style/display';\n\nexport const styles = css`\n @layer base, hover, focusVisible, active, disabled, top;\n\n @layer base {\n ${display('inline-block')}\n\n :host {\n --ni-private-ok-fv-split-button-background-image: none;\n --ni-private-ok-fv-split-button-border: rgba(${actionRgbPartialColor}, 0.3);\n --ni-private-ok-fv-split-button-color: ${buttonLabelFontColor};\n position: relative;\n height: ${controlHeight};\n vertical-align: middle;\n }\n\n :host([appearance='ghost']) {\n --ni-private-ok-fv-split-button-border: transparent;\n }\n\n :host([appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([appearance='outline'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-border: rgb(${actionRgbPartialColor});\n }\n\n :host([appearance='outline'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-border: ${buttonBorderAccentOutlineColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentOutlineFontColor};\n }\n\n :host([appearance='block'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillPrimaryColor},\n ${buttonFillPrimaryColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillPrimaryColor};\n --ni-private-ok-fv-split-button-color: ${buttonPrimaryFontColor};\n }\n\n :host([appearance='block'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n ${buttonFillAccentColor},\n ${buttonFillAccentColor}\n );\n --ni-private-ok-fv-split-button-border: ${buttonFillAccentColor};\n --ni-private-ok-fv-split-button-color: ${buttonAccentBlockFontColor};\n }\n\n .split-button-container {\n position: relative;\n display: inline-flex;\n align-items: stretch;\n height: 100%;\n }\n\n .split-button-container::before {\n content: '';\n position: absolute;\n inset: 0;\n border: ${borderWidth} solid var(--ni-private-ok-fv-split-button-border);\n background-image: var(--ni-private-ok-fv-split-button-background-image);\n background-repeat: no-repeat;\n pointer-events: none;\n }\n\n .split-button-primary,\n .split-button-toggle {\n appearance: none;\n position: relative;\n z-index: 0;\n height: 100%;\n box-sizing: border-box;\n margin: 0;\n border: ${borderWidth} solid transparent;\n background-color: transparent;\n background-position: center;\n background-repeat: no-repeat;\n background-origin: border-box;\n background-size: 100% 100%;\n color: var(--ni-private-ok-fv-split-button-color);\n fill: currentcolor;\n font: ${buttonLabelFont};\n cursor: pointer;\n outline: none;\n transition:\n box-shadow ${smallDelay} ease-in-out,\n border-color ${smallDelay} ease-in-out,\n background-size ${smallDelay} ease-in-out;\n }\n\n .split-button-primary::before,\n .split-button-toggle::before {\n content: '';\n position: absolute;\n inset: 0;\n pointer-events: none;\n outline: 0px solid transparent;\n outline-offset: -3px;\n transition: outline ${smallDelay} ease-in-out;\n }\n\n .split-button-primary {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0 ${standardPadding};\n padding-inline-end: ${mediumPadding};\n white-space: nowrap;\n text-decoration: none;\n }\n\n slot[name='start']::slotted(*),\n slot[name='end']::slotted(*) {\n flex-shrink: 0;\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='start']::slotted(*) {\n margin-inline-end: ${smallPadding};\n }\n\n slot[name='end']::slotted(*) {\n margin-inline-start: ${smallPadding};\n }\n\n .split-button-primary-disabled {\n cursor: default;\n }\n\n .split-button-toggle {\n width: ${controlHeight};\n min-width: ${controlHeight};\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n }\n\n .split-button-toggle::after {\n content: '';\n position: absolute;\n inset-block: ${smallPadding};\n inset-inline-start: calc(-1 * ${borderWidth});\n width: calc(2 * ${borderWidth});\n background: rgba(${borderRgbPartialColor}, 0.1);\n pointer-events: none;\n }\n\n .split-button-toggle > * {\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n slot[name='menu']::slotted(*) {\n min-width: 100%;\n margin: ${smallPadding} 0 0;\n }\n }\n\n @layer hover {\n .split-button-primary:is(:enabled, [href]):hover,\n .split-button-toggle:enabled:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:is(:enabled, [href]):hover + .split-button-toggle::after,\n .split-button-toggle:enabled:hover::after {\n visibility: hidden;\n }\n }\n\n @layer focusVisible {\n .split-button-primary:is(:enabled, [href]):focus-visible,\n .split-button-toggle:enabled:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n z-index: 1;\n }\n\n .split-button-primary:focus-visible::before,\n .split-button-toggle:focus-visible::before {\n outline: ${borderWidth} solid ${borderHoverColor};\n }\n\n .split-button-primary:focus-visible + .split-button-toggle::after,\n .split-button-toggle:focus-visible::after {\n visibility: hidden;\n }\n }\n\n @layer active {\n .split-button-primary:is(:enabled, [href]):active,\n .split-button-toggle:enabled:active,\n :host([open]) .split-button-toggle {\n border-color: ${borderHoverColor};\n box-shadow: none;\n background-image: linear-gradient(${fillSelectedColor}, ${fillSelectedColor});\n background-size: calc(100% - 2px) calc(100% - 2px);\n }\n\n :host([open]) .split-button-toggle {\n border-color: rgba(${fillSelectedRgbPartialColor}, 0.3);\n background-size: 100% 100%;\n }\n\n :host([open]) .split-button-toggle::after {\n visibility: hidden;\n }\n\n :host([appearance='block']) .split-button-primary:is(:enabled, [href]):active,\n :host([appearance='block']) .split-button-toggle:enabled:active,\n :host([appearance='block'][open]) .split-button-toggle {\n background-color: ${applicationBackgroundColor};\n }\n\n :host([appearance='outline'][appearance-variant='accent']) .split-button-primary:active,\n :host([appearance='outline'][appearance-variant='accent']) .split-button-toggle:active,\n :host([appearance='outline'][appearance-variant='accent'][open]) .split-button-toggle {\n color: ${buttonAccentOutlineFontColor};\n }\n }\n\n @layer disabled {\n :host([disabled]) {\n --ni-private-ok-fv-split-button-color: ${buttonLabelDisabledFontColor};\n }\n\n :host([disabled][appearance='block']) {\n --ni-private-ok-fv-split-button-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.1);\n }\n\n :host([disabled][appearance='outline']) {\n --ni-private-ok-fv-split-button-border: rgba(${borderRgbPartialColor}, 0.3);\n }\n\n :host([disabled]) .split-button-primary,\n :host([disabled]) .split-button-toggle {\n cursor: default;\n box-shadow: none;\n background-image: none;\n background-size: 100% 100%;\n }\n\n :host([disabled]) slot[name='start']::slotted(*),\n :host([disabled]) slot[name='end']::slotted(*),\n :host([disabled]) .split-button-toggle > * {\n opacity: 0.3;\n ${iconColor.cssCustomProperty}: ${buttonLabelFontColor};\n }\n\n :host([disabled][appearance='ghost']) .split-button-primary,\n :host([disabled][appearance='ghost']) .split-button-toggle {\n border-color: transparent;\n }\n }\n\n @layer top {}\n`;"]}
@@ -14,7 +14,9 @@ export const template = html `
14
14
  return true;
15
15
  }}"
16
16
  >
17
- ${x => x.label}
17
+ <slot name="start"></slot>
18
+ <span>${x => x.label}</span>
19
+ <slot name="end"></slot>
18
20
  </button>
19
21
  <button
20
22
  class="split-button-toggle"
@@ -1 +1 @@
1
- {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/fv/split-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAGnF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAe;;;;;;;yBAOlB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;sBAClB,CAAC,CAAC,EAAE;IACV,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC;AAChB,CAAC;;cAEC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;;;cAIZ,GAAG,CAAC,cAAc,CAAC;;yBAER,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;0BACd,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,KAAK,EAAE;6BAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;sBAElB,CAAC,CAAC,EAAE;IACV,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACtB,OAAO,IAAI,CAAC;AAChB,CAAC;;eAEE,wBAAwB,MAAM,wBAAwB;;;MAG/D,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACX,IAAI,CAAe;eACZ,iBAAiB;;;;;;;;kBAQd,GAAG,CAAC,QAAQ,CAAC;;;;;gBAKf,iBAAiB;SACxB,CACJ;CACJ,CAAC","sourcesContent":["import { html, ref, when } from '@ni/fast-element';\nimport { iconArrowExpanderDownTag } from '@ni/nimble-components/dist/esm/icons/arrow-expander-down';\nimport { anchoredRegionTag } from '@ni/nimble-components/dist/esm/anchored-region';\nimport type { FvSplitButton } from '.';\n\nexport const template = html<FvSplitButton>`\n <div\n class=\"split-button-container\"\n >\n <button\n class=\"split-button-primary\"\n type=\"button\"\n ?disabled=\"${x => x.disabled}\"\n @click=\"${x => {\n x.handlePrimaryClick();\n return true;\n }}\"\n >\n ${x => x.label}\n </button>\n <button\n class=\"split-button-toggle\"\n ${ref('toggleButton')}\n type=\"button\"\n ?disabled=\"${x => x.disabled}\"\n aria-label=\"${x => `More actions for ${x.label}`}\"\n aria-expanded=\"${x => x.open}\"\n aria-haspopup=\"menu\"\n @click=\"${x => {\n x.handleToggleClick();\n return true;\n }}\"\n >\n <${iconArrowExpanderDownTag}></${iconArrowExpanderDownTag}>\n </button>\n </div>\n ${when(\n x => x.open,\n html<FvSplitButton>`\n <${anchoredRegionTag}\n fixed-placement\n auto-update-mode=\"auto\"\n horizontal-inset\n horizontal-positioning-mode=\"dynamic\"\n horizontal-default-position=\"end\"\n vertical-positioning-mode=\"locktodefault\"\n vertical-default-position=\"bottom\"\n ${ref('region')}\n >\n <span part=\"menu\">\n <slot name=\"menu\"></slot>\n </span>\n </${anchoredRegionTag}>\n `\n )}\n`;"]}
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/fv/split-button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAGnF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAe;;;;;;;yBAOlB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;sBAClB,CAAC,CAAC,EAAE;IACV,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC;AAChB,CAAC;;;oBAGO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;;;;cAKlB,GAAG,CAAC,cAAc,CAAC;;yBAER,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;0BACd,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,KAAK,EAAE;6BAC/B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;;sBAElB,CAAC,CAAC,EAAE;IACV,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACtB,OAAO,IAAI,CAAC;AAChB,CAAC;;eAEE,wBAAwB,MAAM,wBAAwB;;;MAG/D,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EACX,IAAI,CAAe;eACZ,iBAAiB;;;;;;;;kBAQd,GAAG,CAAC,QAAQ,CAAC;;;;;gBAKf,iBAAiB;SACxB,CACJ;CACJ,CAAC","sourcesContent":["import { html, ref, when } from '@ni/fast-element';\nimport { iconArrowExpanderDownTag } from '@ni/nimble-components/dist/esm/icons/arrow-expander-down';\nimport { anchoredRegionTag } from '@ni/nimble-components/dist/esm/anchored-region';\nimport type { FvSplitButton } from '.';\n\nexport const template = html<FvSplitButton>`\n <div\n class=\"split-button-container\"\n >\n <button\n class=\"split-button-primary\"\n type=\"button\"\n ?disabled=\"${x => x.disabled}\"\n @click=\"${x => {\n x.handlePrimaryClick();\n return true;\n }}\"\n >\n <slot name=\"start\"></slot>\n <span>${x => x.label}</span>\n <slot name=\"end\"></slot>\n </button>\n <button\n class=\"split-button-toggle\"\n ${ref('toggleButton')}\n type=\"button\"\n ?disabled=\"${x => x.disabled}\"\n aria-label=\"${x => `More actions for ${x.label}`}\"\n aria-expanded=\"${x => x.open}\"\n aria-haspopup=\"menu\"\n @click=\"${x => {\n x.handleToggleClick();\n return true;\n }}\"\n >\n <${iconArrowExpanderDownTag}></${iconArrowExpanderDownTag}>\n </button>\n </div>\n ${when(\n x => x.open,\n html<FvSplitButton>`\n <${anchoredRegionTag}\n fixed-placement\n auto-update-mode=\"auto\"\n horizontal-inset\n horizontal-positioning-mode=\"dynamic\"\n horizontal-default-position=\"end\"\n vertical-positioning-mode=\"locktodefault\"\n vertical-default-position=\"bottom\"\n ${ref('region')}\n >\n <span part=\"menu\">\n <slot name=\"menu\"></slot>\n </span>\n </${anchoredRegionTag}>\n `\n )}\n`;"]}
@@ -20,7 +20,7 @@ export declare class FvSplitButtonAnchor extends FoundationElement {
20
20
  appearance: FvSplitButtonAnchorAppearanceType;
21
21
  appearanceVariant: FvSplitButtonAnchorAppearanceVariantType;
22
22
  /** @internal */
23
- splitButtonContainer?: HTMLDivElement;
23
+ toggleButton?: HTMLButtonElement;
24
24
  /** @internal */
25
25
  region?: AnchoredRegion;
26
26
  /** @internal */
@@ -38,7 +38,7 @@ export declare class FvSplitButtonAnchor extends FoundationElement {
38
38
  /** @internal */
39
39
  regionChanged(prev: AnchoredRegion | undefined, _next: AnchoredRegion | undefined): void;
40
40
  /** @internal */
41
- splitButtonContainerChanged(): void;
41
+ toggleButtonChanged(): void;
42
42
  private readonly documentClickHandler;
43
43
  private readonly keydownHandler;
44
44
  private readonly menuChangeHandler;
@@ -81,14 +81,14 @@ export class FvSplitButtonAnchor extends FoundationElement {
81
81
  prev.removeEventListener('change', this.menuChangeHandler);
82
82
  }
83
83
  if (this.region) {
84
- this.region.anchorElement = this.splitButtonContainer ?? this;
84
+ this.region.anchorElement = this.toggleButton ?? this;
85
85
  this.region.addEventListener('change', this.menuChangeHandler, { capture: true });
86
86
  }
87
87
  }
88
88
  /** @internal */
89
- splitButtonContainerChanged() {
89
+ toggleButtonChanged() {
90
90
  if (this.region) {
91
- this.region.anchorElement = this.splitButtonContainer ?? this;
91
+ this.region.anchorElement = this.toggleButton ?? this;
92
92
  }
93
93
  }
94
94
  setOpen(nextOpen) {
@@ -132,7 +132,7 @@ __decorate([
132
132
  ], FvSplitButtonAnchor.prototype, "appearanceVariant", void 0);
133
133
  __decorate([
134
134
  observable
135
- ], FvSplitButtonAnchor.prototype, "splitButtonContainer", void 0);
135
+ ], FvSplitButtonAnchor.prototype, "toggleButton", void 0);
136
136
  __decorate([
137
137
  observable
138
138
  ], FvSplitButtonAnchor.prototype, "region", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACH,6BAA6B,EAE7B,oCAAoC,EAEvC,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IAA1D;;QAEW,UAAK,GAAG,kBAAkB,CAAC;QAG3B,SAAI,GAAG,EAAE,CAAC;QAGV,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,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC;QAClE,CAAC;IACL,CAAC;IAsBO,OAAO,CAAC,QAAiB;QAC7B,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzB,OAAO;QACX,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE;YACzC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;SAC9B,CAAC,CAAC,CAAC;IACR,CAAC;CACJ;AAnIU;IADN,IAAI;kDAC6B;AAG3B;IADN,IAAI;iDACY;AAGV;IADN,IAAI;mDACc;AAGZ;IADN,IAAI;gDACW;AAGT;IADN,IAAI;qDACgB;AAGd;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;qDACF;AAGjB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;iDACN;AAGb;IADN,IAAI,EAAE;uDACsF;AAGtF;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;8DACwE;AAI3G;IADN,UAAU;iEACkC;AAItC;IADN,UAAU;mDACoB;AAqGnC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,OAAO,CAAC;IACtD,QAAQ,EAAE,wBAAwB;IAClC,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC,CAAC;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,CAAC","sourcesContent":["import { attr, observable } from '@ni/fast-element';\nimport { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport type { AnchoredRegion } from '@ni/nimble-components/dist/esm/anchored-region';\nimport { styles } from './styles';\nimport { template } from './template';\nimport {\n FvSplitButtonAnchorAppearance,\n type FvSplitButtonAnchorAppearance as FvSplitButtonAnchorAppearanceType,\n FvSplitButtonAnchorAppearanceVariant,\n type FvSplitButtonAnchorAppearanceVariant as FvSplitButtonAnchorAppearanceVariantType\n} from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ok-fv-split-button-anchor': FvSplitButtonAnchor;\n }\n}\n\n/**\n * A split button with an anchor-backed primary action and a secondary expandable menu surface.\n */\nexport class FvSplitButtonAnchor extends FoundationElement {\n @attr\n public label = 'Primary function';\n\n @attr\n public href = '';\n\n @attr\n public target = '';\n\n @attr\n public rel = '';\n\n @attr\n public download = '';\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr({ mode: 'boolean' })\n public open = false;\n\n @attr()\n public appearance: FvSplitButtonAnchorAppearanceType = FvSplitButtonAnchorAppearance.outline;\n\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: FvSplitButtonAnchorAppearanceVariantType = FvSplitButtonAnchorAppearanceVariant.default;\n\n /** @internal */\n @observable\n public splitButtonContainer?: HTMLDivElement;\n\n /** @internal */\n @observable\n public region?: AnchoredRegion;\n\n /** @internal */\n public disabledChanged(): void {\n if (this.disabled) {\n this.setOpen(false);\n }\n }\n\n /** @internal */\n public override connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('click', this.documentClickHandler);\n document.addEventListener('keydown', this.keydownHandler);\n }\n\n /** @internal */\n public override disconnectedCallback(): void {\n document.removeEventListener('click', this.documentClickHandler);\n document.removeEventListener('keydown', this.keydownHandler);\n super.disconnectedCallback();\n }\n\n /** @internal */\n public handlePrimaryClick(): void {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(new CustomEvent('trigger', {\n bubbles: true,\n composed: true\n }));\n }\n\n /** @internal */\n public handleToggleClick(): void {\n if (this.disabled) {\n return;\n }\n\n this.setOpen(!this.open);\n }\n\n /** @internal */\n public handleMenuChange(): void {\n this.setOpen(false);\n }\n\n /** @internal */\n public regionChanged(prev: AnchoredRegion | undefined, _next: AnchoredRegion | undefined): void {\n if (prev) {\n prev.removeEventListener('change', this.menuChangeHandler);\n }\n if (this.region) {\n this.region.anchorElement = this.splitButtonContainer ?? this;\n this.region.addEventListener('change', this.menuChangeHandler, { capture: true });\n }\n }\n\n /** @internal */\n public splitButtonContainerChanged(): void {\n if (this.region) {\n this.region.anchorElement = this.splitButtonContainer ?? this;\n }\n }\n\n private readonly documentClickHandler = (event: Event): void => {\n if (!this.open) {\n return;\n }\n\n if (!event.composedPath().includes(this)) {\n this.setOpen(false);\n }\n };\n\n private readonly keydownHandler = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.setOpen(false);\n }\n };\n\n private readonly menuChangeHandler = (): void => {\n this.handleMenuChange();\n };\n\n private setOpen(nextOpen: boolean): void {\n if (this.open === nextOpen) {\n return;\n }\n\n this.open = nextOpen;\n this.dispatchEvent(new CustomEvent('toggle', {\n bubbles: true,\n composed: true,\n detail: { open: this.open }\n }));\n }\n}\n\nconst okFvSplitButtonAnchor = FvSplitButtonAnchor.compose({\n baseName: 'fv-split-button-anchor',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('ok').register(okFvSplitButtonAnchor());\nexport const fvSplitButtonAnchorTag = 'ok-fv-split-button-anchor';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACH,6BAA6B,EAE7B,oCAAoC,EAEvC,MAAM,SAAS,CAAC;AAQjB;;GAEG;AACH,MAAM,OAAO,mBAAo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\nimport { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport type { AnchoredRegion } from '@ni/nimble-components/dist/esm/anchored-region';\nimport { styles } from './styles';\nimport { template } from './template';\nimport {\n FvSplitButtonAnchorAppearance,\n type FvSplitButtonAnchorAppearance as FvSplitButtonAnchorAppearanceType,\n FvSplitButtonAnchorAppearanceVariant,\n type FvSplitButtonAnchorAppearanceVariant as FvSplitButtonAnchorAppearanceVariantType\n} from './types';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ok-fv-split-button-anchor': FvSplitButtonAnchor;\n }\n}\n\n/**\n * A split button with an anchor-backed primary action and a secondary expandable menu surface.\n */\nexport class FvSplitButtonAnchor extends FoundationElement {\n @attr\n public label = 'Primary function';\n\n @attr\n public href = '';\n\n @attr\n public target = '';\n\n @attr\n public rel = '';\n\n @attr\n public download = '';\n\n @attr({ mode: 'boolean' })\n public disabled = false;\n\n @attr({ mode: 'boolean' })\n public open = false;\n\n @attr()\n public appearance: FvSplitButtonAnchorAppearanceType = FvSplitButtonAnchorAppearance.outline;\n\n @attr({ attribute: 'appearance-variant' })\n public appearanceVariant: FvSplitButtonAnchorAppearanceVariantType = FvSplitButtonAnchorAppearanceVariant.default;\n\n /** @internal */\n @observable\n public toggleButton?: HTMLButtonElement;\n\n /** @internal */\n @observable\n public region?: AnchoredRegion;\n\n /** @internal */\n public disabledChanged(): void {\n if (this.disabled) {\n this.setOpen(false);\n }\n }\n\n /** @internal */\n public override connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('click', this.documentClickHandler);\n document.addEventListener('keydown', this.keydownHandler);\n }\n\n /** @internal */\n public override disconnectedCallback(): void {\n document.removeEventListener('click', this.documentClickHandler);\n document.removeEventListener('keydown', this.keydownHandler);\n super.disconnectedCallback();\n }\n\n /** @internal */\n public handlePrimaryClick(): void {\n if (this.disabled) {\n return;\n }\n\n this.dispatchEvent(new CustomEvent('trigger', {\n bubbles: true,\n composed: true\n }));\n }\n\n /** @internal */\n public handleToggleClick(): void {\n if (this.disabled) {\n return;\n }\n\n this.setOpen(!this.open);\n }\n\n /** @internal */\n public handleMenuChange(): void {\n this.setOpen(false);\n }\n\n /** @internal */\n public regionChanged(prev: AnchoredRegion | undefined, _next: AnchoredRegion | undefined): void {\n if (prev) {\n prev.removeEventListener('change', this.menuChangeHandler);\n }\n if (this.region) {\n this.region.anchorElement = this.toggleButton ?? this;\n this.region.addEventListener('change', this.menuChangeHandler, { capture: true });\n }\n }\n\n /** @internal */\n public toggleButtonChanged(): void {\n if (this.region) {\n this.region.anchorElement = this.toggleButton ?? this;\n }\n }\n\n private readonly documentClickHandler = (event: Event): void => {\n if (!this.open) {\n return;\n }\n\n if (!event.composedPath().includes(this)) {\n this.setOpen(false);\n }\n };\n\n private readonly keydownHandler = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') {\n this.setOpen(false);\n }\n };\n\n private readonly menuChangeHandler = (): void => {\n this.handleMenuChange();\n };\n\n private setOpen(nextOpen: boolean): void {\n if (this.open === nextOpen) {\n return;\n }\n\n this.open = nextOpen;\n this.dispatchEvent(new CustomEvent('toggle', {\n bubbles: true,\n composed: true,\n detail: { open: this.open }\n }));\n }\n}\n\nconst okFvSplitButtonAnchor = FvSplitButtonAnchor.compose({\n baseName: 'fv-split-button-anchor',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('ok').register(okFvSplitButtonAnchor());\nexport const fvSplitButtonAnchorTag = 'ok-fv-split-button-anchor';"]}
@@ -1 +1 @@
1
- export declare const styles: import("@ni/fast-element").ElementStyles;
1
+ export { styles } from '../split-button/styles';