@ni/ok-components 1.2.1 → 1.3.1
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/dist/all-components-bundle.js +3058 -531
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +6791 -5231
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +1421 -61
- package/dist/custom-elements.md +246 -13
- package/dist/esm/fv/accordion-item/index.d.ts +1 -0
- package/dist/esm/fv/accordion-item/index.js +1 -0
- package/dist/esm/fv/accordion-item/index.js.map +1 -1
- package/dist/esm/fv/accordion-item/testing/fv-accordion-item.pageobject.js +5 -0
- package/dist/esm/fv/accordion-item/testing/fv-accordion-item.pageobject.js.map +1 -1
- package/dist/esm/fv/all-fv.d.ts +7 -0
- package/dist/esm/fv/all-fv.js +7 -0
- package/dist/esm/fv/all-fv.js.map +1 -1
- package/dist/esm/fv/card/index.d.ts +59 -0
- package/dist/esm/fv/card/index.js +144 -0
- package/dist/esm/fv/card/index.js.map +1 -0
- package/dist/esm/fv/card/styles.d.ts +1 -0
- package/dist/esm/fv/card/styles.js +231 -0
- package/dist/esm/fv/card/styles.js.map +1 -0
- package/dist/esm/fv/card/template.d.ts +2 -0
- package/dist/esm/fv/card/template.js +126 -0
- package/dist/esm/fv/card/template.js.map +1 -0
- package/dist/esm/fv/card/types.d.ts +10 -0
- package/dist/esm/fv/card/types.js +9 -0
- package/dist/esm/fv/card/types.js.map +1 -0
- package/dist/esm/fv/chip-selector/index.d.ts +104 -0
- package/dist/esm/fv/chip-selector/index.js +367 -0
- package/dist/esm/fv/chip-selector/index.js.map +1 -0
- package/dist/esm/fv/chip-selector/styles.d.ts +1 -0
- package/dist/esm/fv/chip-selector/styles.js +251 -0
- package/dist/esm/fv/chip-selector/styles.js.map +1 -0
- package/dist/esm/fv/chip-selector/template.d.ts +2 -0
- package/dist/esm/fv/chip-selector/template.js +147 -0
- package/dist/esm/fv/chip-selector/template.js.map +1 -0
- package/dist/esm/fv/context-help/index.d.ts +22 -0
- package/dist/esm/fv/context-help/index.js +41 -0
- package/dist/esm/fv/context-help/index.js.map +1 -0
- package/dist/esm/fv/context-help/styles.d.ts +1 -0
- package/dist/esm/fv/context-help/styles.js +55 -0
- package/dist/esm/fv/context-help/styles.js.map +1 -0
- package/dist/esm/fv/context-help/template.d.ts +2 -0
- package/dist/esm/fv/context-help/template.js +24 -0
- package/dist/esm/fv/context-help/template.js.map +1 -0
- package/dist/esm/fv/context-help/types.d.ts +1 -0
- package/dist/esm/fv/context-help/types.js +2 -0
- package/dist/esm/fv/context-help/types.js.map +1 -0
- package/dist/esm/fv/search-input/index.d.ts +2 -0
- package/dist/esm/fv/search-input/index.js +2 -0
- package/dist/esm/fv/search-input/index.js.map +1 -1
- package/dist/esm/fv/search-input/styles.js +14 -14
- package/dist/esm/fv/search-input/styles.js.map +1 -1
- package/dist/esm/fv/split-button/index.d.ts +43 -0
- package/dist/esm/fv/split-button/index.js +130 -0
- package/dist/esm/fv/split-button/index.js.map +1 -0
- package/dist/esm/fv/split-button/styles.d.ts +1 -0
- package/dist/esm/fv/split-button/styles.js +220 -0
- package/dist/esm/fv/split-button/styles.js.map +1 -0
- package/dist/esm/fv/split-button/template.d.ts +2 -0
- package/dist/esm/fv/split-button/template.js +52 -0
- package/dist/esm/fv/split-button/template.js.map +1 -0
- package/dist/esm/fv/split-button/types.d.ts +12 -0
- package/dist/esm/fv/split-button/types.js +11 -0
- package/dist/esm/fv/split-button/types.js.map +1 -0
- package/dist/esm/fv/split-button-anchor/index.d.ts +47 -0
- package/dist/esm/fv/split-button-anchor/index.js +146 -0
- package/dist/esm/fv/split-button-anchor/index.js.map +1 -0
- package/dist/esm/fv/split-button-anchor/styles.d.ts +1 -0
- package/dist/esm/fv/split-button-anchor/styles.js +228 -0
- package/dist/esm/fv/split-button-anchor/styles.js.map +1 -0
- package/dist/esm/fv/split-button-anchor/template.d.ts +2 -0
- package/dist/esm/fv/split-button-anchor/template.js +64 -0
- package/dist/esm/fv/split-button-anchor/template.js.map +1 -0
- package/dist/esm/fv/split-button-anchor/types.d.ts +12 -0
- package/dist/esm/fv/split-button-anchor/types.js +11 -0
- package/dist/esm/fv/split-button-anchor/types.js.map +1 -0
- package/dist/esm/fv/summary-panel/index.d.ts +26 -0
- package/dist/esm/fv/summary-panel/index.js +70 -0
- package/dist/esm/fv/summary-panel/index.js.map +1 -0
- package/dist/esm/fv/summary-panel/styles.d.ts +1 -0
- package/dist/esm/fv/summary-panel/styles.js +49 -0
- package/dist/esm/fv/summary-panel/styles.js.map +1 -0
- package/dist/esm/fv/summary-panel/template.d.ts +2 -0
- package/dist/esm/fv/summary-panel/template.js +29 -0
- package/dist/esm/fv/summary-panel/template.js.map +1 -0
- package/dist/esm/fv/summary-panel-tile/index.d.ts +23 -0
- package/dist/esm/fv/summary-panel-tile/index.js +59 -0
- package/dist/esm/fv/summary-panel-tile/index.js.map +1 -0
- package/dist/esm/fv/summary-panel-tile/styles.d.ts +1 -0
- package/dist/esm/fv/summary-panel-tile/styles.js +138 -0
- package/dist/esm/fv/summary-panel-tile/styles.js.map +1 -0
- package/dist/esm/fv/summary-panel-tile/template.d.ts +2 -0
- package/dist/esm/fv/summary-panel-tile/template.js +14 -0
- package/dist/esm/fv/summary-panel-tile/template.js.map +1 -0
- package/dist/esm/fv/summary-panel-tile/types.d.ts +5 -0
- package/dist/esm/fv/summary-panel-tile/types.js +5 -0
- package/dist/esm/fv/summary-panel-tile/types.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr, observable } from '@ni/fast-element';
|
|
3
|
+
import { DesignSystem, FoundationElement } from '@ni/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
import { FvSplitButtonAnchorAppearance, FvSplitButtonAnchorAppearanceVariant } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* A split button with an anchor-backed primary action and a secondary expandable menu surface.
|
|
9
|
+
*/
|
|
10
|
+
export class FvSplitButtonAnchor extends FoundationElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.label = 'Primary function';
|
|
14
|
+
this.href = '';
|
|
15
|
+
this.target = '';
|
|
16
|
+
this.rel = '';
|
|
17
|
+
this.download = '';
|
|
18
|
+
this.disabled = false;
|
|
19
|
+
this.open = false;
|
|
20
|
+
this.appearance = FvSplitButtonAnchorAppearance.outline;
|
|
21
|
+
this.appearanceVariant = FvSplitButtonAnchorAppearanceVariant.default;
|
|
22
|
+
this.documentClickHandler = (event) => {
|
|
23
|
+
if (!this.open) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!event.composedPath().includes(this)) {
|
|
27
|
+
this.setOpen(false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.keydownHandler = (event) => {
|
|
31
|
+
if (event.key === 'Escape') {
|
|
32
|
+
this.setOpen(false);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
this.menuChangeHandler = () => {
|
|
36
|
+
this.handleMenuChange();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
disabledChanged() {
|
|
41
|
+
if (this.disabled) {
|
|
42
|
+
this.setOpen(false);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** @internal */
|
|
46
|
+
connectedCallback() {
|
|
47
|
+
super.connectedCallback();
|
|
48
|
+
document.addEventListener('click', this.documentClickHandler);
|
|
49
|
+
document.addEventListener('keydown', this.keydownHandler);
|
|
50
|
+
}
|
|
51
|
+
/** @internal */
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
document.removeEventListener('click', this.documentClickHandler);
|
|
54
|
+
document.removeEventListener('keydown', this.keydownHandler);
|
|
55
|
+
super.disconnectedCallback();
|
|
56
|
+
}
|
|
57
|
+
/** @internal */
|
|
58
|
+
handlePrimaryClick() {
|
|
59
|
+
if (this.disabled) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.dispatchEvent(new CustomEvent('trigger', {
|
|
63
|
+
bubbles: true,
|
|
64
|
+
composed: true
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/** @internal */
|
|
68
|
+
handleToggleClick() {
|
|
69
|
+
if (this.disabled) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.setOpen(!this.open);
|
|
73
|
+
}
|
|
74
|
+
/** @internal */
|
|
75
|
+
handleMenuChange() {
|
|
76
|
+
this.setOpen(false);
|
|
77
|
+
}
|
|
78
|
+
/** @internal */
|
|
79
|
+
regionChanged(prev, _next) {
|
|
80
|
+
if (prev) {
|
|
81
|
+
prev.removeEventListener('change', this.menuChangeHandler);
|
|
82
|
+
}
|
|
83
|
+
if (this.region) {
|
|
84
|
+
this.region.anchorElement = this.splitButtonContainer ?? this;
|
|
85
|
+
this.region.addEventListener('change', this.menuChangeHandler, { capture: true });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** @internal */
|
|
89
|
+
splitButtonContainerChanged() {
|
|
90
|
+
if (this.region) {
|
|
91
|
+
this.region.anchorElement = this.splitButtonContainer ?? this;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
setOpen(nextOpen) {
|
|
95
|
+
if (this.open === nextOpen) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.open = nextOpen;
|
|
99
|
+
this.dispatchEvent(new CustomEvent('toggle', {
|
|
100
|
+
bubbles: true,
|
|
101
|
+
composed: true,
|
|
102
|
+
detail: { open: this.open }
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
__decorate([
|
|
107
|
+
attr
|
|
108
|
+
], FvSplitButtonAnchor.prototype, "label", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
attr
|
|
111
|
+
], FvSplitButtonAnchor.prototype, "href", void 0);
|
|
112
|
+
__decorate([
|
|
113
|
+
attr
|
|
114
|
+
], FvSplitButtonAnchor.prototype, "target", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
attr
|
|
117
|
+
], FvSplitButtonAnchor.prototype, "rel", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
attr
|
|
120
|
+
], FvSplitButtonAnchor.prototype, "download", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
attr({ mode: 'boolean' })
|
|
123
|
+
], FvSplitButtonAnchor.prototype, "disabled", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
attr({ mode: 'boolean' })
|
|
126
|
+
], FvSplitButtonAnchor.prototype, "open", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
attr()
|
|
129
|
+
], FvSplitButtonAnchor.prototype, "appearance", void 0);
|
|
130
|
+
__decorate([
|
|
131
|
+
attr({ attribute: 'appearance-variant' })
|
|
132
|
+
], FvSplitButtonAnchor.prototype, "appearanceVariant", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
observable
|
|
135
|
+
], FvSplitButtonAnchor.prototype, "splitButtonContainer", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
observable
|
|
138
|
+
], FvSplitButtonAnchor.prototype, "region", void 0);
|
|
139
|
+
const okFvSplitButtonAnchor = FvSplitButtonAnchor.compose({
|
|
140
|
+
baseName: 'fv-split-button-anchor',
|
|
141
|
+
template,
|
|
142
|
+
styles
|
|
143
|
+
});
|
|
144
|
+
DesignSystem.getOrCreate().withPrefix('ok').register(okFvSplitButtonAnchor());
|
|
145
|
+
export const fvSplitButtonAnchorTag = 'ok-fv-split-button-anchor';
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/index.ts"],"names":[],"mappings":"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","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';"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@ni/fast-element").ElementStyles;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { css } from '@ni/fast-element';
|
|
2
|
+
import { actionRgbPartialColor, borderHoverColor, borderRgbPartialColor, borderWidth, buttonAccentBlockFontColor, buttonAccentOutlineFontColor, buttonBorderAccentOutlineColor, buttonFillAccentColor, buttonFillPrimaryColor, buttonLabelDisabledFontColor, buttonLabelFont, buttonLabelFontColor, buttonPrimaryFontColor, controlHeight, fillSelectedColor, iconColor, smallDelay, standardPadding } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
|
|
3
|
+
import { display } from '../../utilities/style/display';
|
|
4
|
+
export const styles = css `
|
|
5
|
+
@layer base, hover, focusVisible, active, disabled, top;
|
|
6
|
+
|
|
7
|
+
@layer base {
|
|
8
|
+
${display('inline-block')}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
--ni-private-ok-fv-split-button-anchor-background-image: none;
|
|
12
|
+
--ni-private-ok-fv-split-button-anchor-background-size: 100% 100%;
|
|
13
|
+
--ni-private-ok-fv-split-button-anchor-background-size-emphasis: 100% 100%;
|
|
14
|
+
--ni-private-ok-fv-split-button-anchor-border: rgba(${actionRgbPartialColor}, 0.3);
|
|
15
|
+
--ni-private-ok-fv-split-button-anchor-color: ${buttonLabelFontColor};
|
|
16
|
+
position: relative;
|
|
17
|
+
height: ${controlHeight};
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([appearance='ghost']) {
|
|
22
|
+
--ni-private-ok-fv-split-button-anchor-border: transparent;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([appearance='block']) {
|
|
26
|
+
--ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(
|
|
27
|
+
rgba(${borderRgbPartialColor}, 0.1),
|
|
28
|
+
rgba(${borderRgbPartialColor}, 0.1)
|
|
29
|
+
);
|
|
30
|
+
--ni-private-ok-fv-split-button-anchor-border: rgba(${borderRgbPartialColor}, 0.1);
|
|
31
|
+
--ni-private-ok-fv-split-button-anchor-background-size-emphasis: calc(100% - 4px) calc(100% - 4px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([appearance='outline'][appearance-variant='primary']) {
|
|
35
|
+
--ni-private-ok-fv-split-button-anchor-border: rgb(${actionRgbPartialColor});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([appearance='outline'][appearance-variant='accent']) {
|
|
39
|
+
--ni-private-ok-fv-split-button-anchor-border: ${buttonBorderAccentOutlineColor};
|
|
40
|
+
--ni-private-ok-fv-split-button-anchor-color: ${buttonAccentOutlineFontColor};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([appearance='block'][appearance-variant='primary']) {
|
|
44
|
+
--ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(
|
|
45
|
+
${buttonFillPrimaryColor},
|
|
46
|
+
${buttonFillPrimaryColor}
|
|
47
|
+
);
|
|
48
|
+
--ni-private-ok-fv-split-button-anchor-border: ${buttonFillPrimaryColor};
|
|
49
|
+
--ni-private-ok-fv-split-button-anchor-color: ${buttonPrimaryFontColor};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([appearance='block'][appearance-variant='accent']) {
|
|
53
|
+
--ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(
|
|
54
|
+
${buttonFillAccentColor},
|
|
55
|
+
${buttonFillAccentColor}
|
|
56
|
+
);
|
|
57
|
+
--ni-private-ok-fv-split-button-anchor-border: ${buttonFillAccentColor};
|
|
58
|
+
--ni-private-ok-fv-split-button-anchor-color: ${buttonAccentBlockFontColor};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.split-button-container {
|
|
62
|
+
position: relative;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: stretch;
|
|
65
|
+
height: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.split-button-primary,
|
|
69
|
+
.split-button-toggle {
|
|
70
|
+
appearance: none;
|
|
71
|
+
position: relative;
|
|
72
|
+
z-index: 0;
|
|
73
|
+
height: 100%;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
margin: 0;
|
|
76
|
+
border: ${borderWidth} solid var(--ni-private-ok-fv-split-button-anchor-border);
|
|
77
|
+
background-color: transparent;
|
|
78
|
+
background-image: var(--ni-private-ok-fv-split-button-anchor-background-image);
|
|
79
|
+
background-position: center;
|
|
80
|
+
background-repeat: no-repeat;
|
|
81
|
+
background-size: var(--ni-private-ok-fv-split-button-anchor-background-size);
|
|
82
|
+
color: var(--ni-private-ok-fv-split-button-anchor-color);
|
|
83
|
+
fill: currentcolor;
|
|
84
|
+
font: ${buttonLabelFont};
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
outline: none;
|
|
87
|
+
transition:
|
|
88
|
+
box-shadow ${smallDelay} ease-in-out,
|
|
89
|
+
border-color ${smallDelay} ease-in-out,
|
|
90
|
+
background-size ${smallDelay} ease-in-out;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.split-button-primary {
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
padding: 0 ${standardPadding};
|
|
98
|
+
border-inline-end-color: transparent;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
text-decoration: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.split-button-primary::before,
|
|
104
|
+
.split-button-toggle::before {
|
|
105
|
+
content: '';
|
|
106
|
+
position: absolute;
|
|
107
|
+
inset: 0;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
outline: 0px solid transparent;
|
|
110
|
+
outline-offset: -3px;
|
|
111
|
+
transition: outline ${smallDelay} ease-in-out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.split-button-toggle {
|
|
115
|
+
width: ${controlHeight};
|
|
116
|
+
min-width: ${controlHeight};
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
border-inline-start-color: var(--ni-private-ok-fv-split-button-anchor-border);
|
|
121
|
+
margin-inline-start: calc(-1 * ${borderWidth});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.split-button-toggle > * {
|
|
125
|
+
color: currentColor;
|
|
126
|
+
${iconColor.cssCustomProperty}: currentColor;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.split-button-primary-disabled {
|
|
130
|
+
cursor: default;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([appearance='ghost']) .split-button-primary,
|
|
134
|
+
:host([appearance='ghost']) .split-button-toggle {
|
|
135
|
+
border-color: transparent;
|
|
136
|
+
box-shadow: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
slot[name='menu']::slotted(*) {
|
|
140
|
+
min-width: 100%;
|
|
141
|
+
margin: 4px 0 0;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@layer hover {
|
|
146
|
+
.split-button-primary:hover,
|
|
147
|
+
.split-button-toggle:hover {
|
|
148
|
+
border-color: ${borderHoverColor};
|
|
149
|
+
box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
|
|
150
|
+
background-size: var(--ni-private-ok-fv-split-button-anchor-background-size-emphasis);
|
|
151
|
+
z-index: 1;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
:host([appearance='ghost']) .split-button-primary:hover,
|
|
155
|
+
:host([appearance='ghost']) .split-button-toggle:hover {
|
|
156
|
+
border-color: ${borderHoverColor};
|
|
157
|
+
box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@layer focusVisible {
|
|
162
|
+
.split-button-primary:focus-visible,
|
|
163
|
+
.split-button-toggle:focus-visible {
|
|
164
|
+
border-color: ${borderHoverColor};
|
|
165
|
+
box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
|
|
166
|
+
background-size: var(--ni-private-ok-fv-split-button-anchor-background-size-emphasis);
|
|
167
|
+
z-index: 1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.split-button-primary:focus-visible::before,
|
|
171
|
+
.split-button-toggle:focus-visible::before {
|
|
172
|
+
outline: ${borderWidth} solid ${borderHoverColor};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
:host([appearance='ghost']) .split-button-primary:focus-visible,
|
|
176
|
+
:host([appearance='ghost']) .split-button-toggle:focus-visible {
|
|
177
|
+
border-color: ${borderHoverColor};
|
|
178
|
+
box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@layer active {
|
|
183
|
+
.split-button-primary:active,
|
|
184
|
+
.split-button-toggle:active,
|
|
185
|
+
:host([open]) .split-button-toggle {
|
|
186
|
+
border-color: ${borderHoverColor};
|
|
187
|
+
box-shadow: none;
|
|
188
|
+
background-image: linear-gradient(${fillSelectedColor}, ${fillSelectedColor});
|
|
189
|
+
background-size: calc(100% - 2px) calc(100% - 2px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host([appearance='block']) .split-button-primary:active,
|
|
193
|
+
:host([appearance='block']) .split-button-toggle:active,
|
|
194
|
+
:host([appearance='block'][open]) .split-button-toggle {
|
|
195
|
+
background-size: calc(100% - 4px) calc(100% - 4px);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
:host([appearance='outline'][appearance-variant='accent']) .split-button-primary:active,
|
|
199
|
+
:host([appearance='outline'][appearance-variant='accent']) .split-button-toggle:active,
|
|
200
|
+
:host([appearance='outline'][appearance-variant='accent'][open]) .split-button-toggle {
|
|
201
|
+
color: ${buttonAccentOutlineFontColor};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@layer disabled {
|
|
206
|
+
:host([disabled]) {
|
|
207
|
+
--ni-private-ok-fv-split-button-anchor-color: ${buttonLabelDisabledFontColor};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([disabled][appearance='outline']) {
|
|
211
|
+
--ni-private-ok-fv-split-button-anchor-border: rgba(${borderRgbPartialColor}, 0.3);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:host([disabled]) .split-button-primary,
|
|
215
|
+
:host([disabled]) .split-button-toggle {
|
|
216
|
+
cursor: default;
|
|
217
|
+
box-shadow: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([disabled][appearance='ghost']) .split-button-primary,
|
|
221
|
+
:host([disabled][appearance='ghost']) .split-button-toggle {
|
|
222
|
+
border-color: transparent;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@layer top {}
|
|
227
|
+
`;
|
|
228
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,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,SAAS,EACT,UAAU,EACV,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;;;;;;kEAMiC,qBAAqB;4DAC3B,oBAAoB;;sBAE1D,aAAa;;;;;;;;;;uBAUZ,qBAAqB;uBACrB,qBAAqB;;kEAEsB,qBAAqB;;;;;iEAKtB,qBAAqB;;;;6DAIzB,8BAA8B;4DAC/B,4BAA4B;;;;;kBAKtE,sBAAsB;kBACtB,sBAAsB;;6DAEqB,sBAAsB;4DACvB,sBAAsB;;;;;kBAKhE,qBAAqB;kBACrB,qBAAqB;;6DAEsB,qBAAqB;4DACtB,0BAA0B;;;;;;;;;;;;;;;;;;sBAkBhE,WAAW;;;;;;;;oBAQb,eAAe;;;;6BAIN,UAAU;+BACR,UAAU;kCACP,UAAU;;;;;;;yBAOnB,eAAe;;;;;;;;;;;;;;kCAcN,UAAU;;;;qBAIvB,aAAa;yBACT,aAAa;;;;;6CAKO,WAAW;;;;;cAK1C,SAAS,CAAC,iBAAiB;;;;;;;;;;;;;;;;;;;;;;4BAsBb,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;4BAOnC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;4BAOnC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;uBAOxC,WAAW,UAAU,gBAAgB;;;;;4BAKhC,gBAAgB;gCACZ,WAAW,IAAI,gBAAgB;;;;;;;;4BAQnC,gBAAgB;;gDAEI,iBAAiB,KAAK,iBAAiB;;;;;;;;;;;;;qBAalE,4BAA4B;;;;;;4DAMW,4BAA4B;;;;kEAItB,qBAAqB;;;;;;;;;;;;;;;;CAgBtF,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n actionRgbPartialColor,\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 iconColor,\n smallDelay,\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-anchor-background-image: none;\n --ni-private-ok-fv-split-button-anchor-background-size: 100% 100%;\n --ni-private-ok-fv-split-button-anchor-background-size-emphasis: 100% 100%;\n --ni-private-ok-fv-split-button-anchor-border: rgba(${actionRgbPartialColor}, 0.3);\n --ni-private-ok-fv-split-button-anchor-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-anchor-border: transparent;\n }\n\n :host([appearance='block']) {\n --ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(\n rgba(${borderRgbPartialColor}, 0.1),\n rgba(${borderRgbPartialColor}, 0.1)\n );\n --ni-private-ok-fv-split-button-anchor-border: rgba(${borderRgbPartialColor}, 0.1);\n --ni-private-ok-fv-split-button-anchor-background-size-emphasis: calc(100% - 4px) calc(100% - 4px);\n }\n\n :host([appearance='outline'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-anchor-border: rgb(${actionRgbPartialColor});\n }\n\n :host([appearance='outline'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-anchor-border: ${buttonBorderAccentOutlineColor};\n --ni-private-ok-fv-split-button-anchor-color: ${buttonAccentOutlineFontColor};\n }\n\n :host([appearance='block'][appearance-variant='primary']) {\n --ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(\n ${buttonFillPrimaryColor},\n ${buttonFillPrimaryColor}\n );\n --ni-private-ok-fv-split-button-anchor-border: ${buttonFillPrimaryColor};\n --ni-private-ok-fv-split-button-anchor-color: ${buttonPrimaryFontColor};\n }\n\n :host([appearance='block'][appearance-variant='accent']) {\n --ni-private-ok-fv-split-button-anchor-background-image: linear-gradient(\n ${buttonFillAccentColor},\n ${buttonFillAccentColor}\n );\n --ni-private-ok-fv-split-button-anchor-border: ${buttonFillAccentColor};\n --ni-private-ok-fv-split-button-anchor-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-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 var(--ni-private-ok-fv-split-button-anchor-border);\n background-color: transparent;\n background-image: var(--ni-private-ok-fv-split-button-anchor-background-image);\n background-position: center;\n background-repeat: no-repeat;\n background-size: var(--ni-private-ok-fv-split-button-anchor-background-size);\n color: var(--ni-private-ok-fv-split-button-anchor-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 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0 ${standardPadding};\n border-inline-end-color: transparent;\n white-space: nowrap;\n text-decoration: none;\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-toggle {\n width: ${controlHeight};\n min-width: ${controlHeight};\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-inline-start-color: var(--ni-private-ok-fv-split-button-anchor-border);\n margin-inline-start: calc(-1 * ${borderWidth});\n }\n\n .split-button-toggle > * {\n color: currentColor;\n ${iconColor.cssCustomProperty}: currentColor;\n }\n\n .split-button-primary-disabled {\n cursor: default;\n }\n\n :host([appearance='ghost']) .split-button-primary,\n :host([appearance='ghost']) .split-button-toggle {\n border-color: transparent;\n box-shadow: none;\n }\n\n slot[name='menu']::slotted(*) {\n min-width: 100%;\n margin: 4px 0 0;\n }\n }\n\n @layer hover {\n .split-button-primary:hover,\n .split-button-toggle:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n background-size: var(--ni-private-ok-fv-split-button-anchor-background-size-emphasis);\n z-index: 1;\n }\n\n :host([appearance='ghost']) .split-button-primary:hover,\n :host([appearance='ghost']) .split-button-toggle:hover {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n }\n }\n\n @layer focusVisible {\n .split-button-primary:focus-visible,\n .split-button-toggle:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n background-size: var(--ni-private-ok-fv-split-button-anchor-background-size-emphasis);\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 :host([appearance='ghost']) .split-button-primary:focus-visible,\n :host([appearance='ghost']) .split-button-toggle:focus-visible {\n border-color: ${borderHoverColor};\n box-shadow: 0 0 0 ${borderWidth} ${borderHoverColor} inset;\n }\n }\n\n @layer active {\n .split-button-primary:active,\n .split-button-toggle: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([appearance='block']) .split-button-primary:active,\n :host([appearance='block']) .split-button-toggle:active,\n :host([appearance='block'][open]) .split-button-toggle {\n background-size: calc(100% - 4px) calc(100% - 4px);\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-anchor-color: ${buttonLabelDisabledFontColor};\n }\n\n :host([disabled][appearance='outline']) {\n --ni-private-ok-fv-split-button-anchor-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`;"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { html, ref, when } from '@ni/fast-element';
|
|
2
|
+
import { iconArrowExpanderDownTag } from '@ni/nimble-components/dist/esm/icons/arrow-expander-down';
|
|
3
|
+
import { anchoredRegionTag } from '@ni/nimble-components/dist/esm/anchored-region';
|
|
4
|
+
export const template = html `
|
|
5
|
+
<div
|
|
6
|
+
class="split-button-container"
|
|
7
|
+
${ref('splitButtonContainer')}
|
|
8
|
+
>
|
|
9
|
+
${when(x => !x.disabled && x.href.length > 0, html `
|
|
10
|
+
<a
|
|
11
|
+
class="split-button-primary"
|
|
12
|
+
href="${x => x.href}"
|
|
13
|
+
target="${x => x.target || undefined}"
|
|
14
|
+
rel="${x => x.rel || undefined}"
|
|
15
|
+
download="${x => x.download || undefined}"
|
|
16
|
+
@click="${x => {
|
|
17
|
+
x.handlePrimaryClick();
|
|
18
|
+
return true;
|
|
19
|
+
}}"
|
|
20
|
+
>
|
|
21
|
+
${x => x.label}
|
|
22
|
+
</a>
|
|
23
|
+
`)}
|
|
24
|
+
${when(x => x.disabled || x.href.length === 0, html `
|
|
25
|
+
<span
|
|
26
|
+
class="split-button-primary split-button-primary-disabled"
|
|
27
|
+
aria-disabled="${x => x.disabled}"
|
|
28
|
+
>
|
|
29
|
+
${x => x.label}
|
|
30
|
+
</span>
|
|
31
|
+
`)}
|
|
32
|
+
<button
|
|
33
|
+
class="split-button-toggle"
|
|
34
|
+
type="button"
|
|
35
|
+
?disabled="${x => x.disabled}"
|
|
36
|
+
aria-label="${x => `More actions for ${x.label}`}"
|
|
37
|
+
aria-expanded="${x => x.open}"
|
|
38
|
+
aria-haspopup="menu"
|
|
39
|
+
@click="${x => {
|
|
40
|
+
x.handleToggleClick();
|
|
41
|
+
return true;
|
|
42
|
+
}}"
|
|
43
|
+
>
|
|
44
|
+
<${iconArrowExpanderDownTag}></${iconArrowExpanderDownTag}>
|
|
45
|
+
</button>
|
|
46
|
+
</div>
|
|
47
|
+
${when(x => x.open, html `
|
|
48
|
+
<${anchoredRegionTag}
|
|
49
|
+
fixed-placement
|
|
50
|
+
auto-update-mode="auto"
|
|
51
|
+
horizontal-inset
|
|
52
|
+
horizontal-positioning-mode="dynamic"
|
|
53
|
+
vertical-positioning-mode="locktodefault"
|
|
54
|
+
vertical-default-position="bottom"
|
|
55
|
+
horizontal-scaling="anchor"
|
|
56
|
+
${ref('region')}
|
|
57
|
+
>
|
|
58
|
+
<span part="menu">
|
|
59
|
+
<slot name="menu"></slot>
|
|
60
|
+
</span>
|
|
61
|
+
</${anchoredRegionTag}>
|
|
62
|
+
`)}
|
|
63
|
+
`;
|
|
64
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/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,CAAqB;;;UAGvC,GAAG,CAAC,sBAAsB,CAAC;;UAE3B,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EACrC,IAAI,CAAqB;;;4BAGT,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;8BACT,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,SAAS;2BAC7B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,SAAS;gCAClB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,SAAS;8BAC9B,CAAC,CAAC,EAAE;IACV,CAAC,CAAC,kBAAkB,EAAE,CAAC;IACvB,OAAO,IAAI,CAAC;AAChB,CAAC;;sBAEC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;aAErB,CACJ;UACC,IAAI,CACF,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EACtC,IAAI,CAAqB;;;qCAGA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;;sBAE9B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK;;aAErB,CACJ;;;;yBAIgB,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,CAAqB;eAClB,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 { FvSplitButtonAnchor } from '.';\n\nexport const template = html<FvSplitButtonAnchor>`\n <div\n class=\"split-button-container\"\n ${ref('splitButtonContainer')}\n >\n ${when(\n x => !x.disabled && x.href.length > 0,\n html<FvSplitButtonAnchor>`\n <a\n class=\"split-button-primary\"\n href=\"${x => x.href}\"\n target=\"${x => x.target || undefined}\"\n rel=\"${x => x.rel || undefined}\"\n download=\"${x => x.download || undefined}\"\n @click=\"${x => {\n x.handlePrimaryClick();\n return true;\n }}\"\n >\n ${x => x.label}\n </a>\n `\n )}\n ${when(\n x => x.disabled || x.href.length === 0,\n html<FvSplitButtonAnchor>`\n <span\n class=\"split-button-primary split-button-primary-disabled\"\n aria-disabled=\"${x => x.disabled}\"\n >\n ${x => x.label}\n </span>\n `\n )}\n <button\n class=\"split-button-toggle\"\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<FvSplitButtonAnchor>`\n <${anchoredRegionTag}\n fixed-placement\n auto-update-mode=\"auto\"\n horizontal-inset\n horizontal-positioning-mode=\"dynamic\"\n vertical-positioning-mode=\"locktodefault\"\n vertical-default-position=\"bottom\"\n horizontal-scaling=\"anchor\"\n ${ref('region')}\n >\n <span part=\"menu\">\n <slot name=\"menu\"></slot>\n </span>\n </${anchoredRegionTag}>\n `\n )}\n`;"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const FvSplitButtonAnchorAppearance: {
|
|
2
|
+
readonly outline: "outline";
|
|
3
|
+
readonly ghost: "ghost";
|
|
4
|
+
readonly block: "block";
|
|
5
|
+
};
|
|
6
|
+
export type FvSplitButtonAnchorAppearance = (typeof FvSplitButtonAnchorAppearance)[keyof typeof FvSplitButtonAnchorAppearance];
|
|
7
|
+
export declare const FvSplitButtonAnchorAppearanceVariant: {
|
|
8
|
+
readonly default: "default";
|
|
9
|
+
readonly primary: "primary";
|
|
10
|
+
readonly accent: "accent";
|
|
11
|
+
};
|
|
12
|
+
export type FvSplitButtonAnchorAppearanceVariant = (typeof FvSplitButtonAnchorAppearanceVariant)[keyof typeof FvSplitButtonAnchorAppearanceVariant];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const FvSplitButtonAnchorAppearance = {
|
|
2
|
+
outline: 'outline',
|
|
3
|
+
ghost: 'ghost',
|
|
4
|
+
block: 'block'
|
|
5
|
+
};
|
|
6
|
+
export const FvSplitButtonAnchorAppearanceVariant = {
|
|
7
|
+
default: 'default',
|
|
8
|
+
primary: 'primary',
|
|
9
|
+
accent: 'accent'
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/fv/split-button-anchor/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACR,CAAC;AAIX,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAChD,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACV,CAAC","sourcesContent":["export const FvSplitButtonAnchorAppearance = {\n outline: 'outline',\n ghost: 'ghost',\n block: 'block'\n} as const;\n\nexport type FvSplitButtonAnchorAppearance = (typeof FvSplitButtonAnchorAppearance)[keyof typeof FvSplitButtonAnchorAppearance];\n\nexport const FvSplitButtonAnchorAppearanceVariant = {\n default: 'default',\n primary: 'primary',\n accent: 'accent'\n} as const;\n\nexport type FvSplitButtonAnchorAppearanceVariant = (typeof FvSplitButtonAnchorAppearanceVariant)[keyof typeof FvSplitButtonAnchorAppearanceVariant];"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FoundationElement } from '@ni/fast-foundation';
|
|
2
|
+
import '@ni/nimble-components/dist/esm/button';
|
|
3
|
+
import '@ni/nimble-components/dist/esm/icons/cog';
|
|
4
|
+
declare global {
|
|
5
|
+
interface HTMLElementTagNameMap {
|
|
6
|
+
'ok-fv-summary-panel': FvSummaryPanel;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A layout container for summary tiles with an optional edit-items affordance.
|
|
11
|
+
*/
|
|
12
|
+
export declare class FvSummaryPanel extends FoundationElement {
|
|
13
|
+
showEditItemsButton: boolean;
|
|
14
|
+
legacyStyle: boolean;
|
|
15
|
+
editItemsButtonLabel: string;
|
|
16
|
+
/** @internal */
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
/** @internal */
|
|
19
|
+
legacyStyleChanged(): void;
|
|
20
|
+
/** @internal */
|
|
21
|
+
handleEditItemsClick(): void;
|
|
22
|
+
/** @internal */
|
|
23
|
+
handleItemsSlotChange(): void;
|
|
24
|
+
private syncTileLegacyStyle;
|
|
25
|
+
}
|
|
26
|
+
export declare const fvSummaryPanelTag = "ok-fv-summary-panel";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@ni/fast-element';
|
|
3
|
+
import { DesignSystem, FoundationElement } from '@ni/fast-foundation';
|
|
4
|
+
import '@ni/nimble-components/dist/esm/button';
|
|
5
|
+
import '@ni/nimble-components/dist/esm/icons/cog';
|
|
6
|
+
import { styles } from './styles';
|
|
7
|
+
import { template } from './template';
|
|
8
|
+
/**
|
|
9
|
+
* A layout container for summary tiles with an optional edit-items affordance.
|
|
10
|
+
*/
|
|
11
|
+
export class FvSummaryPanel extends FoundationElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.showEditItemsButton = false;
|
|
15
|
+
this.legacyStyle = false;
|
|
16
|
+
this.editItemsButtonLabel = 'Configure';
|
|
17
|
+
}
|
|
18
|
+
/** @internal */
|
|
19
|
+
connectedCallback() {
|
|
20
|
+
super.connectedCallback();
|
|
21
|
+
this.syncTileLegacyStyle();
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
24
|
+
legacyStyleChanged() {
|
|
25
|
+
if (this.$fastController.isConnected) {
|
|
26
|
+
this.syncTileLegacyStyle();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
handleEditItemsClick() {
|
|
31
|
+
this.dispatchEvent(new CustomEvent('edit-items', {
|
|
32
|
+
bubbles: true,
|
|
33
|
+
composed: true
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
handleItemsSlotChange() {
|
|
38
|
+
this.syncTileLegacyStyle();
|
|
39
|
+
}
|
|
40
|
+
syncTileLegacyStyle() {
|
|
41
|
+
for (const element of this.shadowRoot?.querySelector('slot')?.assignedElements({ flatten: true }) ?? []) {
|
|
42
|
+
if (element.localName !== 'ok-fv-summary-panel-tile') {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (this.legacyStyle) {
|
|
46
|
+
element.setAttribute('legacy-style', '');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
element.removeAttribute('legacy-style');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
__decorate([
|
|
55
|
+
attr({ attribute: 'show-edit-items-button', mode: 'boolean' })
|
|
56
|
+
], FvSummaryPanel.prototype, "showEditItemsButton", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
attr({ attribute: 'legacy-style', mode: 'boolean' })
|
|
59
|
+
], FvSummaryPanel.prototype, "legacyStyle", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
attr({ attribute: 'edit-items-button-label' })
|
|
62
|
+
], FvSummaryPanel.prototype, "editItemsButtonLabel", void 0);
|
|
63
|
+
const okFvSummaryPanel = FvSummaryPanel.compose({
|
|
64
|
+
baseName: 'fv-summary-panel',
|
|
65
|
+
template,
|
|
66
|
+
styles
|
|
67
|
+
});
|
|
68
|
+
DesignSystem.getOrCreate().withPrefix('ok').register(okFvSummaryPanel());
|
|
69
|
+
export const fvSummaryPanelTag = 'ok-fv-summary-panel';
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fv/summary-panel/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IAArD;;QAEW,wBAAmB,GAAG,KAAK,CAAC;QAG5B,gBAAW,GAAG,KAAK,CAAC;QAGpB,yBAAoB,GAAG,WAAW,CAAC;IAyC9C,CAAC;IAvCG,gBAAgB;IACA,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAED,gBAAgB;IACT,kBAAkB;QACrB,IAAI,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;YACnC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,gBAAgB;IACT,oBAAoB;QACvB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,YAAY,EAAE;YAC7C,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC,CAAC;IACR,CAAC;IAED,gBAAgB;IACT,qBAAqB;QACxB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC/B,CAAC;IAEO,mBAAmB;QACvB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACtG,IAAI,OAAO,CAAC,SAAS,KAAK,0BAA0B,EAAE,CAAC;gBACnD,SAAS;YACb,CAAC;YAED,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACnB,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA/CU;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,wBAAwB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2DAC5B;AAG5B;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;mDAC1B;AAGpB;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,CAAC;4DACL;AA2C9C,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC;IAC5C,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC","sourcesContent":["import { attr } from '@ni/fast-element';\nimport { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport '@ni/nimble-components/dist/esm/button';\nimport '@ni/nimble-components/dist/esm/icons/cog';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ok-fv-summary-panel': FvSummaryPanel;\n }\n}\n\n/**\n * A layout container for summary tiles with an optional edit-items affordance.\n */\nexport class FvSummaryPanel extends FoundationElement {\n @attr({ attribute: 'show-edit-items-button', mode: 'boolean' })\n public showEditItemsButton = false;\n\n @attr({ attribute: 'legacy-style', mode: 'boolean' })\n public legacyStyle = false;\n\n @attr({ attribute: 'edit-items-button-label' })\n public editItemsButtonLabel = 'Configure';\n\n /** @internal */\n public override connectedCallback(): void {\n super.connectedCallback();\n this.syncTileLegacyStyle();\n }\n\n /** @internal */\n public legacyStyleChanged(): void {\n if (this.$fastController.isConnected) {\n this.syncTileLegacyStyle();\n }\n }\n\n /** @internal */\n public handleEditItemsClick(): void {\n this.dispatchEvent(new CustomEvent('edit-items', {\n bubbles: true,\n composed: true\n }));\n }\n\n /** @internal */\n public handleItemsSlotChange(): void {\n this.syncTileLegacyStyle();\n }\n\n private syncTileLegacyStyle(): void {\n for (const element of this.shadowRoot?.querySelector('slot')?.assignedElements({ flatten: true }) ?? []) {\n if (element.localName !== 'ok-fv-summary-panel-tile') {\n continue;\n }\n\n if (this.legacyStyle) {\n element.setAttribute('legacy-style', '');\n } else {\n element.removeAttribute('legacy-style');\n }\n }\n }\n}\n\nconst okFvSummaryPanel = FvSummaryPanel.compose({\n baseName: 'fv-summary-panel',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('ok').register(okFvSummaryPanel());\nexport const fvSummaryPanelTag = 'ok-fv-summary-panel';"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@ni/fast-element").ElementStyles;
|