@ni/nimble-components 18.3.7 → 18.4.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 +748 -329
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +1840 -1574
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/all-components.d.ts +1 -0
- package/dist/esm/all-components.js +1 -0
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/banner/index.d.ts +52 -0
- package/dist/esm/banner/index.js +73 -0
- package/dist/esm/banner/index.js.map +1 -0
- package/dist/esm/banner/styles.d.ts +1 -0
- package/dist/esm/banner/styles.js +165 -0
- package/dist/esm/banner/styles.js.map +1 -0
- package/dist/esm/banner/template.d.ts +2 -0
- package/dist/esm/banner/template.js +62 -0
- package/dist/esm/banner/template.js.map +1 -0
- package/dist/esm/banner/types.d.ts +11 -0
- package/dist/esm/banner/types.js +11 -0
- package/dist/esm/banner/types.js.map +1 -0
- package/dist/esm/table/components/cell/index.d.ts +6 -0
- package/dist/esm/table/components/cell/index.js +19 -1
- package/dist/esm/table/components/cell/index.js.map +1 -1
- package/dist/esm/table/components/cell/styles.js +7 -0
- package/dist/esm/table/components/cell/styles.js.map +1 -1
- package/dist/esm/table/components/cell/template.js +19 -1
- package/dist/esm/table/components/cell/template.js.map +1 -1
- package/dist/esm/table/components/row/index.d.ts +6 -0
- package/dist/esm/table/components/row/index.js +24 -0
- package/dist/esm/table/components/row/index.js.map +1 -1
- package/dist/esm/table/components/row/styles.js +13 -0
- package/dist/esm/table/components/row/styles.js.map +1 -1
- package/dist/esm/table/components/row/template.js +12 -1
- package/dist/esm/table/components/row/template.js.map +1 -1
- package/dist/esm/table/index.d.ts +11 -1
- package/dist/esm/table/index.js +24 -0
- package/dist/esm/table/index.js.map +1 -1
- package/dist/esm/table/models/virtualizer.js +4 -6
- package/dist/esm/table/models/virtualizer.js.map +1 -1
- package/dist/esm/table/styles.js +2 -3
- package/dist/esm/table/styles.js.map +1 -1
- package/dist/esm/table/template.js +11 -1
- package/dist/esm/table/template.js.map +1 -1
- package/dist/esm/table/types.d.ts +6 -0
- package/dist/esm/table-column/base/index.d.ts +3 -1
- package/dist/esm/table-column/base/index.js +6 -0
- package/dist/esm/table-column/base/index.js.map +1 -1
- package/dist/esm/theme-provider/design-token-comments.js +2 -0
- package/dist/esm/theme-provider/design-token-comments.js.map +1 -1
- package/dist/esm/theme-provider/design-token-names.js +2 -0
- package/dist/esm/theme-provider/design-token-names.js.map +1 -1
- package/dist/esm/theme-provider/design-tokens.d.ts +2 -0
- package/dist/esm/theme-provider/design-tokens.js +3 -1
- package/dist/esm/theme-provider/design-tokens.js.map +1 -1
- package/dist/tokens-internal.scss +12 -0
- package/dist/tokens.scss +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,CAAC;AAClB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,UAAU,CAAC;AAClB,OAAO,iBAAiB,CAAC;AACzB,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,UAAU,CAAC;AAClB,OAAO,eAAe,CAAC;AACvB,OAAO,YAAY,CAAC;AACpB,OAAO,YAAY,CAAC;AACpB,OAAO,UAAU,CAAC;AAClB,OAAO,UAAU,CAAC;AAClB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,eAAe,CAAC;AACvB,OAAO,QAAQ,CAAC;AAChB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,gBAAgB,CAAC;AACxB,OAAO,SAAS,CAAC;AACjB,OAAO,eAAe,CAAC;AACvB,OAAO,UAAU,CAAC;AAClB,OAAO,WAAW,CAAC;AACnB,OAAO,UAAU,CAAC;AAClB,OAAO,OAAO,CAAC;AACf,OAAO,aAAa,CAAC;AACrB,OAAO,SAAS,CAAC;AACjB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,CAAC;AAChB,OAAO,gBAAgB,CAAC;AACxB,OAAO,aAAa,CAAC;AACrB,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AACnB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC;AACrB,OAAO,aAAa,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ARIAGlobalStatesAndProperties, FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
+
import { BannerSeverity } from './types';
|
|
3
|
+
declare global {
|
|
4
|
+
interface HTMLElementTagNameMap {
|
|
5
|
+
'nimble-banner': Banner;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A nimble-styled notification banner for persistent messages.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Banner extends FoundationElement {
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
* @description
|
|
15
|
+
* Whether the banner is visible or not
|
|
16
|
+
*/
|
|
17
|
+
open: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
* @description
|
|
21
|
+
* Severity of the banner's message
|
|
22
|
+
*/
|
|
23
|
+
severity: BannerSeverity;
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
* @description
|
|
27
|
+
* Whether the banner title is hidden
|
|
28
|
+
*/
|
|
29
|
+
titleHidden: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @public
|
|
32
|
+
* @description
|
|
33
|
+
* Hides the dismiss button
|
|
34
|
+
*/
|
|
35
|
+
preventDismiss: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @public
|
|
38
|
+
* @description
|
|
39
|
+
* Label (not visible) for the dismiss button
|
|
40
|
+
*/
|
|
41
|
+
dismissButtonLabel?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
openChanged(): void;
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
dismissBanner(): void;
|
|
50
|
+
}
|
|
51
|
+
export interface Banner extends ARIAGlobalStatesAndProperties {
|
|
52
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { attr } from '@microsoft/fast-element';
|
|
3
|
+
import { applyMixins, ARIAGlobalStatesAndProperties, DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
|
|
4
|
+
import { styles } from './styles';
|
|
5
|
+
import { template } from './template';
|
|
6
|
+
import { BannerSeverity } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* A nimble-styled notification banner for persistent messages.
|
|
9
|
+
*/
|
|
10
|
+
export class Banner extends FoundationElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
* @description
|
|
16
|
+
* Whether the banner is visible or not
|
|
17
|
+
*/
|
|
18
|
+
this.open = false;
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
* @description
|
|
22
|
+
* Severity of the banner's message
|
|
23
|
+
*/
|
|
24
|
+
this.severity = BannerSeverity.default;
|
|
25
|
+
/**
|
|
26
|
+
* @public
|
|
27
|
+
* @description
|
|
28
|
+
* Whether the banner title is hidden
|
|
29
|
+
*/
|
|
30
|
+
this.titleHidden = false;
|
|
31
|
+
/**
|
|
32
|
+
* @public
|
|
33
|
+
* @description
|
|
34
|
+
* Hides the dismiss button
|
|
35
|
+
*/
|
|
36
|
+
this.preventDismiss = false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
openChanged() {
|
|
42
|
+
this.$emit('toggle', { oldState: !this.open, newState: this.open });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
dismissBanner() {
|
|
48
|
+
this.open = false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
__decorate([
|
|
52
|
+
attr({ mode: 'boolean' })
|
|
53
|
+
], Banner.prototype, "open", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
attr()
|
|
56
|
+
], Banner.prototype, "severity", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
attr({ attribute: 'title-hidden', mode: 'boolean' })
|
|
59
|
+
], Banner.prototype, "titleHidden", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
attr({ attribute: 'prevent-dismiss', mode: 'boolean' })
|
|
62
|
+
], Banner.prototype, "preventDismiss", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
attr({ attribute: 'dismiss-button-label' })
|
|
65
|
+
], Banner.prototype, "dismissButtonLabel", void 0);
|
|
66
|
+
applyMixins(Banner, ARIAGlobalStatesAndProperties);
|
|
67
|
+
const nimbleBanner = Banner.compose({
|
|
68
|
+
baseName: 'banner',
|
|
69
|
+
template,
|
|
70
|
+
styles
|
|
71
|
+
});
|
|
72
|
+
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleBanner());
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/banner/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACH,WAAW,EACX,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQzC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,iBAAiB;IAA7C;;QACI;;;;WAIG;QAEI,SAAI,GAAG,KAAK,CAAC;QAEpB;;;;WAIG;QAEI,aAAQ,GAAmB,cAAc,CAAC,OAAO,CAAC;QAEzD;;;;WAIG;QAEI,gBAAW,GAAG,KAAK,CAAC;QAE3B;;;;WAIG;QAEI,mBAAc,GAAG,KAAK,CAAC;IAuBlC,CAAC;IAbG;;OAEG;IACI,WAAW;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACI,aAAa;QAChB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACtB,CAAC;CACJ;AA/CG;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;oCACN;AAQpB;IADC,IAAI,EAAE;wCACkD;AAQzD;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;2CAC1B;AAQ3B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CAC1B;AAQ9B;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;kDACT;AAmBvC,WAAW,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;AAEnD,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("@microsoft/fast-element").ElementStyles;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { css } from '@microsoft/fast-element';
|
|
2
|
+
import { display } from '@microsoft/fast-foundation';
|
|
3
|
+
import { BannerFail100DarkUi, Black75, Fail100LightUi, Information100DarkUi, Information100LightUi, Warning100DarkUi, Warning100LightUi, White } from '@ni/nimble-tokens/dist/styledictionary/js/tokens';
|
|
4
|
+
import { actionRgbPartialColor, applicationBackgroundColor, bodyFont, borderHoverColor, buttonLabelFontColor, controlHeight, controlSlimHeight, fillSelectedColor, iconColor, iconSize, linkActiveFontColor, linkDisabledFontColor, linkFontColor, standardPadding } from '../theme-provider/design-tokens';
|
|
5
|
+
import { Theme } from '../theme-provider/types';
|
|
6
|
+
import { hexToRgbaCssColor } from '../utilities/style/colors';
|
|
7
|
+
import { themeBehavior } from '../utilities/style/theme';
|
|
8
|
+
export const styles = css `
|
|
9
|
+
${display('flex')}
|
|
10
|
+
|
|
11
|
+
:host {
|
|
12
|
+
font: ${bodyFont};
|
|
13
|
+
font-size: 12.8px;
|
|
14
|
+
align-items: top;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
color: ${White};
|
|
17
|
+
${iconColor.cssCustomProperty}: ${hexToRgbaCssColor(White, 0.6)};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host(:not([open])) {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.container {
|
|
25
|
+
display: flex;
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.icon {
|
|
30
|
+
width: 48px;
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
margin-top: 8px;
|
|
34
|
+
flex: 0 0 auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.text {
|
|
38
|
+
display: inline;
|
|
39
|
+
margin-top: 7px;
|
|
40
|
+
margin-bottom: 7px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
slot[name='title'] {
|
|
44
|
+
display: inline;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
padding-right: 8px;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([title-hidden]) slot[name='title'] {
|
|
51
|
+
${
|
|
52
|
+
/**
|
|
53
|
+
* Hide content visually while keeping it screen reader-accessible.
|
|
54
|
+
* Source: https://webaim.org/techniques/css/invisiblecontent/#techniques
|
|
55
|
+
* See discussion here: https://github.com/microsoft/fast/issues/5740#issuecomment-1068195035
|
|
56
|
+
*/
|
|
57
|
+
''}
|
|
58
|
+
display: inline-block;
|
|
59
|
+
height: 1px;
|
|
60
|
+
width: 1px;
|
|
61
|
+
position: absolute;
|
|
62
|
+
margin: -1px;
|
|
63
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
64
|
+
clip-path: inset(50%);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.controls {
|
|
70
|
+
height: ${controlHeight};
|
|
71
|
+
margin-left: auto;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-self: flex-start;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
slot[name='action'] {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-content: center;
|
|
81
|
+
margin-left: ${standardPadding};
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
slot[name='action']::slotted(nimble-anchor) {
|
|
86
|
+
${linkFontColor.cssCustomProperty}: ${White};
|
|
87
|
+
${linkDisabledFontColor.cssCustomProperty}: ${White};
|
|
88
|
+
${linkActiveFontColor.cssCustomProperty}: ${hexToRgbaCssColor(White, 0.6)};
|
|
89
|
+
font-size: 12.8px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
slot[name='action']::slotted(nimble-button) {
|
|
93
|
+
${controlHeight.cssCustomProperty}: ${controlSlimHeight};
|
|
94
|
+
${buttonLabelFontColor.cssCustomProperty}: ${White};
|
|
95
|
+
${fillSelectedColor.cssCustomProperty}: ${hexToRgbaCssColor(White, 0.2)};
|
|
96
|
+
${borderHoverColor.cssCustomProperty}: ${White};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
slot[name='action']::slotted(nimble-button[appearance='outline']) {
|
|
100
|
+
${actionRgbPartialColor.cssCustomProperty}: ${White}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dismiss {
|
|
104
|
+
width: 48px;
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.dismiss nimble-button {
|
|
110
|
+
${controlHeight.cssCustomProperty}: 16px;
|
|
111
|
+
${iconSize.cssCustomProperty}: 14px;
|
|
112
|
+
${buttonLabelFontColor.cssCustomProperty}: ${White};
|
|
113
|
+
${borderHoverColor.cssCustomProperty}: transparent;
|
|
114
|
+
${fillSelectedColor.cssCustomProperty}: ${hexToRgbaCssColor(White, 0.2)};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.dismiss nimble-button:focus-within {
|
|
118
|
+
outline: 2px solid ${White};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.dismiss nimble-button:hover {
|
|
122
|
+
background: ${hexToRgbaCssColor(White, 0.2)};
|
|
123
|
+
}
|
|
124
|
+
`.withBehaviors(themeBehavior(Theme.light, css `
|
|
125
|
+
:host {
|
|
126
|
+
background: ${Black75};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([severity='error']) {
|
|
130
|
+
background: ${Fail100LightUi};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([severity='warning']) {
|
|
134
|
+
background: ${Warning100LightUi};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
:host([severity='information']) {
|
|
138
|
+
background: ${Information100LightUi};
|
|
139
|
+
}
|
|
140
|
+
`), themeBehavior(Theme.dark, css `
|
|
141
|
+
:host {
|
|
142
|
+
background: ${Black75};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([severity='error']) {
|
|
146
|
+
background: ${BannerFail100DarkUi};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
:host([severity='warning']) {
|
|
150
|
+
background: ${Warning100DarkUi};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([severity='information']) {
|
|
154
|
+
background: ${Information100DarkUi};
|
|
155
|
+
}
|
|
156
|
+
`), themeBehavior(Theme.color, css `
|
|
157
|
+
:host {
|
|
158
|
+
background: ${applicationBackgroundColor};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.container {
|
|
162
|
+
background: ${hexToRgbaCssColor(White, 0.3)};
|
|
163
|
+
}
|
|
164
|
+
`));
|
|
165
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/banner/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACH,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,EACR,MAAM,kDAAkD,CAAC;AAE1D,OAAO,EACH,qBAAqB,EACrB,0BAA0B,EAC1B,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,eAAe,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;gBAGL,QAAQ;;;;iBAIP,KAAK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BAA0B;;;;8BAI1B,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC;;SAElD,CACJ,CACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { html, when } from '@microsoft/fast-element';
|
|
2
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
3
|
+
import { Button } from '../button';
|
|
4
|
+
import { IconExclamationMark } from '../icons/exclamation-mark';
|
|
5
|
+
import { IconInfo } from '../icons/info';
|
|
6
|
+
import { IconTriangleFilled } from '../icons/triangle-filled';
|
|
7
|
+
import { IconXmark } from '../icons/xmark';
|
|
8
|
+
import { BannerSeverity } from './types';
|
|
9
|
+
// prettier-ignore
|
|
10
|
+
export const template = html `
|
|
11
|
+
<div class="container"
|
|
12
|
+
role="status"
|
|
13
|
+
aria-atomic="${x => x.ariaAtomic}"
|
|
14
|
+
aria-busy="${x => x.ariaBusy}"
|
|
15
|
+
aria-controls="${x => x.ariaControls}"
|
|
16
|
+
aria-current="${x => x.ariaCurrent}"
|
|
17
|
+
aria-describedby="${x => x.ariaDescribedby}"
|
|
18
|
+
aria-details="${x => x.ariaDetails}"
|
|
19
|
+
aria-disabled="${x => x.ariaDisabled}"
|
|
20
|
+
aria-errormessage="${x => x.ariaErrormessage}"
|
|
21
|
+
aria-expanded="${x => x.ariaExpanded}"
|
|
22
|
+
aria-flowto="${x => x.ariaFlowto}"
|
|
23
|
+
aria-haspopup="${x => x.ariaHaspopup}"
|
|
24
|
+
aria-hidden="${x => x.ariaHidden}"
|
|
25
|
+
aria-invalid="${x => x.ariaInvalid}"
|
|
26
|
+
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
27
|
+
aria-label="${x => x.ariaLabel}"
|
|
28
|
+
aria-labelledby="titleSlot"
|
|
29
|
+
aria-live="${x => x.ariaLive}"
|
|
30
|
+
aria-owns="${x => x.ariaOwns}"
|
|
31
|
+
aria-relevant="${x => x.ariaRelevant}"
|
|
32
|
+
aria-roledescription="${x => x.ariaRoledescription}"
|
|
33
|
+
>
|
|
34
|
+
<div class="icon">
|
|
35
|
+
${when(x => x.severity === BannerSeverity.error, html `
|
|
36
|
+
<${DesignSystem.tagFor(IconExclamationMark)}></${DesignSystem.tagFor(IconExclamationMark)}>
|
|
37
|
+
`)}
|
|
38
|
+
${when(x => x.severity === BannerSeverity.warning, html `
|
|
39
|
+
<${DesignSystem.tagFor(IconTriangleFilled)}></${DesignSystem.tagFor(IconTriangleFilled)}>
|
|
40
|
+
`)}
|
|
41
|
+
${when(x => x.severity === BannerSeverity.information, html `
|
|
42
|
+
<${DesignSystem.tagFor(IconInfo)}></${DesignSystem.tagFor(IconInfo)}>
|
|
43
|
+
`)}
|
|
44
|
+
</div>
|
|
45
|
+
<div class="text">
|
|
46
|
+
<slot name="title" id="titleSlot"></slot>
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="controls">
|
|
50
|
+
<slot name="action"></slot>
|
|
51
|
+
<div class="dismiss">
|
|
52
|
+
${when(x => !x.preventDismiss, html `
|
|
53
|
+
<${DesignSystem.tagFor(Button)} appearance="ghost" content-hidden @click="${x => x.dismissBanner()}">
|
|
54
|
+
<${DesignSystem.tagFor(IconXmark)} slot="start"></${DesignSystem.tagFor(IconXmark)}>
|
|
55
|
+
${x => x.dismissButtonLabel ?? 'Close'}
|
|
56
|
+
</${DesignSystem.tagFor(Button)}>
|
|
57
|
+
`)}
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
`;
|
|
62
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/banner/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,C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efined;
|
|
7
|
+
readonly error: "error";
|
|
8
|
+
readonly warning: "warning";
|
|
9
|
+
readonly information: "information";
|
|
10
|
+
};
|
|
11
|
+
export declare type BannerSeverity = (typeof BannerSeverity)[keyof typeof BannerSeverity];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/banner/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CACpB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementStyles, ViewTemplate } from '@microsoft/fast-element';
|
|
2
2
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
+
import type { MenuButtonToggleEventDetail } from '../../../menu-button/types';
|
|
3
4
|
import type { TableCellRecord, TableCellState } from '../../types';
|
|
4
5
|
declare global {
|
|
5
6
|
interface HTMLElementTagNameMap {
|
|
@@ -14,6 +15,9 @@ export declare class TableCell<TCellRecord extends TableCellRecord = TableCellRe
|
|
|
14
15
|
cellState?: TableCellState<TCellRecord>;
|
|
15
16
|
cellTemplate?: ViewTemplate;
|
|
16
17
|
cellStyles?: ElementStyles;
|
|
18
|
+
hasActionMenu: boolean;
|
|
19
|
+
menuOpen: boolean;
|
|
20
|
+
actionMenuLabel?: string;
|
|
17
21
|
/**
|
|
18
22
|
* @internal
|
|
19
23
|
*/
|
|
@@ -21,6 +25,8 @@ export declare class TableCell<TCellRecord extends TableCellRecord = TableCellRe
|
|
|
21
25
|
private customCellView?;
|
|
22
26
|
connectedCallback(): void;
|
|
23
27
|
disconnectedCallback(): void;
|
|
28
|
+
onActionMenuBeforeToggle(event: CustomEvent<MenuButtonToggleEventDetail>): void;
|
|
29
|
+
onActionMenuToggle(event: CustomEvent<MenuButtonToggleEventDetail>): void;
|
|
24
30
|
protected cellStateChanged(): void;
|
|
25
31
|
protected cellTemplateChanged(): void;
|
|
26
32
|
protected cellStylesChanged(prev?: ElementStyles, next?: ElementStyles): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { defaultExecutionContext, observable } from '@microsoft/fast-element';
|
|
2
|
+
import { attr, defaultExecutionContext, observable } from '@microsoft/fast-element';
|
|
3
3
|
import { DesignSystem, FoundationElement } from '@microsoft/fast-foundation';
|
|
4
4
|
import { styles } from './styles';
|
|
5
5
|
import { template } from './template';
|
|
@@ -10,6 +10,8 @@ import { template } from './template';
|
|
|
10
10
|
export class TableCell extends FoundationElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
+
this.hasActionMenu = false;
|
|
14
|
+
this.menuOpen = false;
|
|
13
15
|
this.customCellView = undefined;
|
|
14
16
|
}
|
|
15
17
|
connectedCallback() {
|
|
@@ -23,6 +25,13 @@ export class TableCell extends FoundationElement {
|
|
|
23
25
|
this.customCellView = undefined;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
28
|
+
onActionMenuBeforeToggle(event) {
|
|
29
|
+
this.$emit('cell-action-menu-beforetoggle', event.detail);
|
|
30
|
+
}
|
|
31
|
+
onActionMenuToggle(event) {
|
|
32
|
+
this.menuOpen = event.detail.newState;
|
|
33
|
+
this.$emit('cell-action-menu-toggle', event.detail);
|
|
34
|
+
}
|
|
26
35
|
cellStateChanged() {
|
|
27
36
|
this.customCellView?.bind(this.cellState, defaultExecutionContext);
|
|
28
37
|
}
|
|
@@ -49,6 +58,15 @@ __decorate([
|
|
|
49
58
|
__decorate([
|
|
50
59
|
observable
|
|
51
60
|
], TableCell.prototype, "cellStyles", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
attr({ attribute: 'has-action-menu', mode: 'boolean' })
|
|
63
|
+
], TableCell.prototype, "hasActionMenu", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
attr({ attribute: 'menu-open', mode: 'boolean' })
|
|
66
|
+
], TableCell.prototype, "menuOpen", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
attr({ attribute: 'action-menu-label' })
|
|
69
|
+
], TableCell.prototype, "actionMenuLabel", void 0);
|
|
52
70
|
const nimbleTableCell = TableCell.compose({
|
|
53
71
|
baseName: 'table-cell',
|
|
54
72
|
template,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,uBAAuB,EAGvB,UAAU,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,IAAI,EACJ,uBAAuB,EAGvB,UAAU,EAEb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG7E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;;GAGG;AACH,MAAM,OAAO,SAEX,SAAQ,iBAAiB;IAF3B;;QAaW,kBAAa,GAAG,KAAK,CAAC;QAGtB,aAAQ,GAAG,KAAK,CAAC;QAUhB,mBAAc,GAAc,SAAS,CAAC;IAyDlD,CAAC;IAvDmB,iBAAiB;QAC7B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAC3C,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,oBAAoB,CAC5B,CAAC;IACN,CAAC;IAEe,oBAAoB;QAChC,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAE7B,IAAI,IAAI,CAAC,c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;AAGxB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;kDACT;AAkEpC,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC;IACtC,QAAQ,EAAE,YAAY;IACtB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,CAAC"}
|
|
@@ -8,6 +8,9 @@ export const styles = css `
|
|
|
8
8
|
padding: 0px calc(${standardPadding} / 2);
|
|
9
9
|
align-self: center;
|
|
10
10
|
height: 100%;
|
|
11
|
+
grid-template-columns: 1fr auto;
|
|
12
|
+
/* A default value that will be overridden by the row */
|
|
13
|
+
--ni-private-table-cell-action-menu-display: block;
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
.cell-content-container {
|
|
@@ -15,5 +18,9 @@ export const styles = css `
|
|
|
15
18
|
display: flex;
|
|
16
19
|
align-items: center;
|
|
17
20
|
}
|
|
21
|
+
|
|
22
|
+
.action-menu {
|
|
23
|
+
display: var(--ni-private-table-cell-action-menu-display);
|
|
24
|
+
}
|
|
18
25
|
`;
|
|
19
26
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;4BAGO,eAAe
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,MAAM,CAAC;;;4BAGO,eAAe;;;;;;;;;;;;;;;;;CAiB1C,CAAC"}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
import { html, ref } from '@microsoft/fast-element';
|
|
1
|
+
import { html, ref, when } from '@microsoft/fast-element';
|
|
2
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
3
|
+
import { IconThreeDotsLine } from '../../../icons/three-dots-line';
|
|
4
|
+
import { MenuButton } from '../../../menu-button';
|
|
5
|
+
import { ButtonAppearance } from '../../../menu-button/types';
|
|
2
6
|
// prettier-ignore
|
|
3
7
|
export const template = html `
|
|
4
8
|
<template role="cell">
|
|
5
9
|
<div ${ref('cellContentContainer')} class="cell-content-container"></div>
|
|
10
|
+
|
|
11
|
+
${when(x => x.hasActionMenu, html `
|
|
12
|
+
<${DesignSystem.tagFor(MenuButton)}
|
|
13
|
+
content-hidden
|
|
14
|
+
appearance="${ButtonAppearance.ghost}"
|
|
15
|
+
@beforetoggle="${(x, c) => x.onActionMenuBeforeToggle(c.event)}"
|
|
16
|
+
@toggle="${(x, c) => x.onActionMenuToggle(c.event)}"
|
|
17
|
+
class="action-menu"
|
|
18
|
+
>
|
|
19
|
+
<${DesignSystem.tagFor(IconThreeDotsLine)} slot="start"></${DesignSystem.tagFor(IconThreeDotsLine)}>
|
|
20
|
+
${x => x.actionMenuLabel}
|
|
21
|
+
<slot name="cellActionMenu" slot="menu"></slot>
|
|
22
|
+
</${DesignSystem.tagFor(MenuButton)}>
|
|
23
|
+
`)}
|
|
6
24
|
</template>
|
|
7
25
|
`;
|
|
8
26
|
//# sourceMappingURL=template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/table/components/cell/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACH,gBAAgB,EAEnB,MAAM,4BAA4B,CAAC;AAEpC,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAW;;eAExB,GAAG,CAAC,sBAAsB,CAAC;;UAEhC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE,IAAI,CAAW;eACrC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;;8BAEhB,gBAAgB,CAAC,KAAK;iCACnB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAiD,CAAC;2BAC/F,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAiD,CAAC;;;mBAG3F,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,mBAAmB,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC;kBAChG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe;;gBAExB,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;SACtC,CAAC;;CAET,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import type { TableCellState, TableDataRecord } from '../../types';
|
|
3
3
|
import type { TableColumn } from '../../../table-column/base';
|
|
4
|
+
import type { MenuButtonToggleEventDetail } from '../../../menu-button/types';
|
|
4
5
|
declare global {
|
|
5
6
|
interface HTMLElementTagNameMap {
|
|
6
7
|
'nimble-table-row': TableRow;
|
|
@@ -18,6 +19,11 @@ export declare class TableRow<TDataRecord extends TableDataRecord = TableDataRec
|
|
|
18
19
|
recordId?: string;
|
|
19
20
|
dataRecord?: TDataRecord;
|
|
20
21
|
columns: TableColumn[];
|
|
22
|
+
currentActionMenuColumn?: TableColumn;
|
|
23
|
+
menuOpen: boolean;
|
|
21
24
|
get columnStates(): ColumnState[];
|
|
25
|
+
onCellActionMenuBeforeToggle(event: CustomEvent<MenuButtonToggleEventDetail>, column: TableColumn): void;
|
|
26
|
+
onCellActionMenuToggle(event: CustomEvent<MenuButtonToggleEventDetail>, column: TableColumn): void;
|
|
27
|
+
private emitToggleEvent;
|
|
22
28
|
private hasValidFieldNames;
|
|
23
29
|
}
|
|
@@ -11,6 +11,7 @@ export class TableRow extends FoundationElement {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this.columns = [];
|
|
14
|
+
this.menuOpen = false;
|
|
14
15
|
}
|
|
15
16
|
get columnStates() {
|
|
16
17
|
return this.columns.map(column => {
|
|
@@ -34,6 +35,23 @@ export class TableRow extends FoundationElement {
|
|
|
34
35
|
return { column, cellState };
|
|
35
36
|
});
|
|
36
37
|
}
|
|
38
|
+
onCellActionMenuBeforeToggle(event, column) {
|
|
39
|
+
this.currentActionMenuColumn = column;
|
|
40
|
+
this.emitToggleEvent('row-action-menu-beforetoggle', event.detail, column);
|
|
41
|
+
}
|
|
42
|
+
onCellActionMenuToggle(event, column) {
|
|
43
|
+
this.menuOpen = event.detail.newState;
|
|
44
|
+
this.emitToggleEvent('row-action-menu-toggle', event.detail, column);
|
|
45
|
+
}
|
|
46
|
+
emitToggleEvent(eventType, menuButtonEventDetail, column) {
|
|
47
|
+
const detail = {
|
|
48
|
+
newState: menuButtonEventDetail.newState,
|
|
49
|
+
oldState: menuButtonEventDetail.oldState,
|
|
50
|
+
recordIds: [this.recordId],
|
|
51
|
+
columnId: column.columnId
|
|
52
|
+
};
|
|
53
|
+
this.$emit(eventType, detail);
|
|
54
|
+
}
|
|
37
55
|
hasValidFieldNames(keys) {
|
|
38
56
|
return keys.every(key => key !== undefined);
|
|
39
57
|
}
|
|
@@ -47,6 +65,12 @@ __decorate([
|
|
|
47
65
|
__decorate([
|
|
48
66
|
observable
|
|
49
67
|
], TableRow.prototype, "columns", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
observable
|
|
70
|
+
], TableRow.prototype, "currentActionMenuColumn", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
attr({ attribute: 'menu-open', mode: 'boolean' })
|
|
73
|
+
], TableRow.prototype, "menuOpen", void 0);
|
|
50
74
|
__decorate([
|
|
51
75
|
volatile
|
|
52
76
|
], TableRow.prototype, "columnStates", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table/components/row/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/table/components/row/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC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