@kumori/aurora-wui-components 0.0.0 → 0.0.2
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/components/cards/aurora-base-card.d.ts +51 -0
- package/dist/components/cards/aurora-base-card.d.ts.map +1 -0
- package/dist/components/cards/aurora-base-card.js +299 -0
- package/dist/components/cards/aurora-base-card.js.map +1 -0
- package/dist/components/cards/aurora-more-actions.d.ts +23 -0
- package/dist/components/cards/aurora-more-actions.d.ts.map +1 -0
- package/dist/components/cards/aurora-more-actions.js +194 -0
- package/dist/components/cards/aurora-more-actions.js.map +1 -0
- package/dist/components/cards/aurora-runtime-card.d.ts +44 -0
- package/dist/components/cards/aurora-runtime-card.d.ts.map +1 -0
- package/dist/components/cards/aurora-runtime-card.js +427 -0
- package/dist/components/cards/aurora-runtime-card.js.map +1 -0
- package/dist/components/cards/card.types.d.ts +39 -0
- package/dist/components/cards/card.types.d.ts.map +1 -0
- package/dist/components/cards/card.types.js +2 -0
- package/dist/components/cards/card.types.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-action-banner.d.ts +8 -0
- package/dist/components/cards/parts/aurora-card-action-banner.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-action-banner.js +61 -0
- package/dist/components/cards/parts/aurora-card-action-banner.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-attention-banner.d.ts +20 -0
- package/dist/components/cards/parts/aurora-card-attention-banner.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-attention-banner.js +111 -0
- package/dist/components/cards/parts/aurora-card-attention-banner.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-filter-item.d.ts +9 -0
- package/dist/components/cards/parts/aurora-card-filter-item.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-filter-item.js +53 -0
- package/dist/components/cards/parts/aurora-card-filter-item.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-filter.d.ts +20 -0
- package/dist/components/cards/parts/aurora-card-filter.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-filter.js +168 -0
- package/dist/components/cards/parts/aurora-card-filter.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-header.d.ts +19 -0
- package/dist/components/cards/parts/aurora-card-header.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-header.js +161 -0
- package/dist/components/cards/parts/aurora-card-header.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-resource-table.d.ts +22 -0
- package/dist/components/cards/parts/aurora-card-resource-table.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-resource-table.js +210 -0
- package/dist/components/cards/parts/aurora-card-resource-table.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-stat-item.d.ts +12 -0
- package/dist/components/cards/parts/aurora-card-stat-item.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-stat-item.js +69 -0
- package/dist/components/cards/parts/aurora-card-stat-item.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-stats-row.d.ts +11 -0
- package/dist/components/cards/parts/aurora-card-stats-row.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-stats-row.js +56 -0
- package/dist/components/cards/parts/aurora-card-stats-row.js.map +1 -0
- package/dist/components/cards/parts/aurora-card-status-bar.d.ts +15 -0
- package/dist/components/cards/parts/aurora-card-status-bar.d.ts.map +1 -0
- package/dist/components/cards/parts/aurora-card-status-bar.js +87 -0
- package/dist/components/cards/parts/aurora-card-status-bar.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/aurora-theme.d.ts +8 -0
- package/dist/styles/aurora-theme.d.ts.map +1 -0
- package/dist/styles/aurora-theme.js +43 -0
- package/dist/styles/aurora-theme.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ActionMenuItem, CardBadge, CardFilterItem, MainStatsType, TableStatsType } from './card.types.js';
|
|
3
|
+
import './aurora-more-actions.js';
|
|
4
|
+
import './parts/aurora-card-header.js';
|
|
5
|
+
import './parts/aurora-card-stats-row.js';
|
|
6
|
+
import './parts/aurora-card-filter.js';
|
|
7
|
+
import './parts/aurora-card-resource-table.js';
|
|
8
|
+
import './parts/aurora-card-status-bar.js';
|
|
9
|
+
export declare class AuroraBaseCard extends LitElement {
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
cardType: 'account' | 'environment' | 'tenant';
|
|
12
|
+
name: string;
|
|
13
|
+
logoSrc: string | null;
|
|
14
|
+
tenantOrAccount: string;
|
|
15
|
+
badge: CardBadge;
|
|
16
|
+
subtitle: string;
|
|
17
|
+
mainStats: MainStatsType[];
|
|
18
|
+
compact: boolean;
|
|
19
|
+
tableStats: TableStatsType[];
|
|
20
|
+
attentionThreshold: number;
|
|
21
|
+
filterItems: CardFilterItem[];
|
|
22
|
+
selected: string | null;
|
|
23
|
+
filterOpened: boolean;
|
|
24
|
+
emptyLabel: string;
|
|
25
|
+
emptyActionLabel: string;
|
|
26
|
+
attentionLabel: string;
|
|
27
|
+
showAttention: boolean;
|
|
28
|
+
isPlainRole: boolean;
|
|
29
|
+
isDeleting: boolean;
|
|
30
|
+
isDisabled: boolean;
|
|
31
|
+
showActionBanner: boolean;
|
|
32
|
+
showWarningBanner: boolean;
|
|
33
|
+
manageLabel: string;
|
|
34
|
+
askOwnerLabel: string;
|
|
35
|
+
invalidCredsLabel: string;
|
|
36
|
+
limitReachedLabel: string;
|
|
37
|
+
andLabel: string;
|
|
38
|
+
actionBannerLabel: string;
|
|
39
|
+
moreActionsOpen: boolean;
|
|
40
|
+
moreActionsOptions: ActionMenuItem[];
|
|
41
|
+
isFreeIaaS: boolean;
|
|
42
|
+
closeLabel: string;
|
|
43
|
+
moreActionsLabel: string;
|
|
44
|
+
freeIaasLabel: string;
|
|
45
|
+
freeIaasTitle: string;
|
|
46
|
+
freeIaasDesc: string;
|
|
47
|
+
haLabel: string;
|
|
48
|
+
haTitle: string;
|
|
49
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=aurora-base-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aurora-base-card.d.ts","sourceRoot":"","sources":["../../../src/components/cards/aurora-base-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AACvC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,mCAAmC,CAAC;AAE3C,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,0BAwCX;IAE0B,QAAQ,EAAE,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAa;IAC3D,IAAI,SAAM;IACV,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,eAAe,SAAM;IACrB,KAAK,EAAE,SAAS,CAAU;IAC1B,QAAQ,SAAM;IAEf,SAAS,EAAE,aAAa,EAAE,CAAM;IAC9B,OAAO,UAAS;IAElB,UAAU,EAAE,cAAc,EAAE,CAAM;IACjC,kBAAkB,SAAM;IAEzB,WAAW,EAAE,cAAc,EAAE,CAAM;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,YAAY,UAAS;IACtB,UAAU,SAAM;IAChB,gBAAgB,SAAM;IACtB,cAAc,SAAsB;IACnC,aAAa,UAAS;IACtB,WAAW,UAAS;IACpB,UAAU,UAAS;IACnB,UAAU,UAAS;IAEnB,gBAAgB,UAAS;IACzB,iBAAiB,UAAS;IAC3B,WAAW,SAAY;IACvB,aAAa,SAAoB;IACjC,iBAAiB,SAA0B;IAC3C,iBAAiB,SAAoB;IACrC,QAAQ,SAAS;IACjB,iBAAiB,SAAM;IAEtB,eAAe,UAAS;IAC1B,kBAAkB,EAAE,cAAc,EAAE,CAAM;IACxC,UAAU,UAAS;IACpB,UAAU,SAAW;IACrB,gBAAgB,SAAU;IAE1B,aAAa,SAAe;IAC5B,aAAa,SAAyB;IACtC,YAAY,SAAgD;IAC5D,OAAO,SAAsB;IAC7B,OAAO,SAA+B;IAElE,MAAM;CAyFP"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import './aurora-more-actions.js';
|
|
10
|
+
import './parts/aurora-card-header.js';
|
|
11
|
+
import './parts/aurora-card-stats-row.js';
|
|
12
|
+
import './parts/aurora-card-filter.js';
|
|
13
|
+
import './parts/aurora-card-resource-table.js';
|
|
14
|
+
import './parts/aurora-card-status-bar.js';
|
|
15
|
+
let AuroraBaseCard = class AuroraBaseCard extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.cardType = 'account';
|
|
19
|
+
this.name = '';
|
|
20
|
+
this.logoSrc = null;
|
|
21
|
+
this.tenantOrAccount = '';
|
|
22
|
+
this.badge = 'none';
|
|
23
|
+
this.subtitle = '';
|
|
24
|
+
this.mainStats = [];
|
|
25
|
+
this.compact = false;
|
|
26
|
+
this.tableStats = [];
|
|
27
|
+
this.attentionThreshold = 90;
|
|
28
|
+
this.filterItems = [];
|
|
29
|
+
this.selected = null;
|
|
30
|
+
this.filterOpened = false;
|
|
31
|
+
this.emptyLabel = '';
|
|
32
|
+
this.emptyActionLabel = '';
|
|
33
|
+
this.attentionLabel = 'Attention needed';
|
|
34
|
+
this.showAttention = false;
|
|
35
|
+
this.isPlainRole = false;
|
|
36
|
+
this.isDeleting = false;
|
|
37
|
+
this.isDisabled = false;
|
|
38
|
+
this.showActionBanner = false;
|
|
39
|
+
this.showWarningBanner = false;
|
|
40
|
+
this.manageLabel = 'Manage';
|
|
41
|
+
this.askOwnerLabel = 'Ask your owner';
|
|
42
|
+
this.invalidCredsLabel = 'Invalid credentials.';
|
|
43
|
+
this.limitReachedLabel = 'Limit reached.';
|
|
44
|
+
this.andLabel = 'and';
|
|
45
|
+
this.actionBannerLabel = '';
|
|
46
|
+
this.moreActionsOpen = false;
|
|
47
|
+
this.moreActionsOptions = [];
|
|
48
|
+
this.isFreeIaaS = false;
|
|
49
|
+
this.closeLabel = 'Close';
|
|
50
|
+
this.moreActionsLabel = 'More';
|
|
51
|
+
this.freeIaasLabel = 'Free IaaS';
|
|
52
|
+
this.freeIaasTitle = 'Free Infrastructure';
|
|
53
|
+
this.freeIaasDesc = 'This environment uses free infrastructure.';
|
|
54
|
+
this.haLabel = 'Highly Available';
|
|
55
|
+
this.haTitle = 'High Availability enabled';
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return html `
|
|
59
|
+
<div class="card">
|
|
60
|
+
<div class="body">
|
|
61
|
+
<aurora-card-header
|
|
62
|
+
.cardType=${this.cardType}
|
|
63
|
+
.logoSrc=${this.logoSrc}
|
|
64
|
+
.tenantOrAccount=${this.tenantOrAccount}
|
|
65
|
+
.name=${this.name}
|
|
66
|
+
.badge=${this.badge}
|
|
67
|
+
.subtitle=${this.subtitle}
|
|
68
|
+
.freeIaasLabel=${this.freeIaasLabel}
|
|
69
|
+
.freeIaasTitle=${this.freeIaasTitle}
|
|
70
|
+
.freeIaasDesc=${this.freeIaasDesc}
|
|
71
|
+
.haLabel=${this.haLabel}
|
|
72
|
+
.haTitle=${this.haTitle}
|
|
73
|
+
>
|
|
74
|
+
<slot slot="subtitle-tooltip" name="subtitle-tooltip"></slot>
|
|
75
|
+
</aurora-card-header>
|
|
76
|
+
|
|
77
|
+
<div class="inner">
|
|
78
|
+
<aurora-card-stats-row
|
|
79
|
+
.stats=${this.mainStats}
|
|
80
|
+
.compact=${this.compact}
|
|
81
|
+
@stat-label-click=${(e) => !this.isDeleting && this.dispatchEvent(new CustomEvent('stat-label-click', { detail: e.detail, bubbles: true, composed: true }))}
|
|
82
|
+
></aurora-card-stats-row>
|
|
83
|
+
|
|
84
|
+
<div class="table-wrap">
|
|
85
|
+
<aurora-card-filter
|
|
86
|
+
.items=${this.filterItems}
|
|
87
|
+
.selected=${this.selected}
|
|
88
|
+
.emptyLabel=${this.emptyLabel}
|
|
89
|
+
.emptyActionLabel=${this.emptyActionLabel}
|
|
90
|
+
.attentionLabel=${this.attentionLabel}
|
|
91
|
+
.showAttention=${this.showAttention}
|
|
92
|
+
.opened=${this.filterOpened}
|
|
93
|
+
.isPlainRole=${this.isPlainRole}
|
|
94
|
+
.isDisabled=${this.isDeleting || this.isDisabled}
|
|
95
|
+
@filter-select=${(e) => !this.isDeleting && this.dispatchEvent(new CustomEvent('filter-select', { detail: e.detail, bubbles: true, composed: true }))}
|
|
96
|
+
@toggle-open=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent('toggle-filter', { bubbles: true, composed: true }))}
|
|
97
|
+
@empty-action-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent('empty-action-click', { bubbles: true, composed: true }))}
|
|
98
|
+
></aurora-card-filter>
|
|
99
|
+
|
|
100
|
+
<aurora-card-resource-table
|
|
101
|
+
.rows=${this.tableStats}
|
|
102
|
+
.attentionThreshold=${this.attentionThreshold}
|
|
103
|
+
.cardType=${this.cardType}
|
|
104
|
+
.isPlainRole=${this.isPlainRole}
|
|
105
|
+
.showActionBanner=${this.showActionBanner}
|
|
106
|
+
.showWarningBanner=${this.showWarningBanner}
|
|
107
|
+
.manageLabel=${this.manageLabel}
|
|
108
|
+
.askOwnerLabel=${this.askOwnerLabel}
|
|
109
|
+
.invalidCredsLabel=${this.invalidCredsLabel}
|
|
110
|
+
.limitReachedLabel=${this.limitReachedLabel}
|
|
111
|
+
.andLabel=${this.andLabel}
|
|
112
|
+
.actionBannerLabel=${this.actionBannerLabel}
|
|
113
|
+
@manage-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent('manage-click', { bubbles: true, composed: true }))}
|
|
114
|
+
@action-click=${() => !this.isDeleting && this.dispatchEvent(new CustomEvent('action-click', { bubbles: true, composed: true }))}
|
|
115
|
+
></aurora-card-resource-table>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<slot name="extra-features"></slot>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<aurora-card-status-bar
|
|
123
|
+
class="status-bar"
|
|
124
|
+
.isFreeIaaS=${this.isFreeIaaS}
|
|
125
|
+
.isPlainRole=${this.isPlainRole}
|
|
126
|
+
.moreActionsOpen=${this.moreActionsOpen}
|
|
127
|
+
.moreActionsOptions=${this.moreActionsOptions}
|
|
128
|
+
.closeLabel=${this.closeLabel}
|
|
129
|
+
.moreActionsLabel=${this.moreActionsLabel}
|
|
130
|
+
@more-actions-toggled=${(e) => this.dispatchEvent(new CustomEvent('more-actions-toggled', { detail: e.detail, bubbles: true, composed: true }))}
|
|
131
|
+
>
|
|
132
|
+
<slot name="status-footer"></slot>
|
|
133
|
+
</aurora-card-status-bar>
|
|
134
|
+
|
|
135
|
+
<slot name="dialogs"></slot>
|
|
136
|
+
</div>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
AuroraBaseCard.styles = css `
|
|
141
|
+
:host { display: block; width: 450px; max-width: 100%; }
|
|
142
|
+
|
|
143
|
+
.card {
|
|
144
|
+
width: 100%;
|
|
145
|
+
background-color: var(--axebow-white);
|
|
146
|
+
border-radius: 0.5rem;
|
|
147
|
+
padding: 0.5rem 0.5rem 1rem;
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
justify-content: space-between;
|
|
151
|
+
gap: 0.5rem;
|
|
152
|
+
height: 100%;
|
|
153
|
+
transition: box-shadow 200ms ease-in-out;
|
|
154
|
+
}
|
|
155
|
+
.card:hover { box-shadow: 0 4px 12px 0 rgba(13,24,33,0.08); }
|
|
156
|
+
|
|
157
|
+
.body { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
158
|
+
|
|
159
|
+
.inner { width: 100%; padding-inline: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
|
|
160
|
+
|
|
161
|
+
.table-wrap {
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 100%;
|
|
164
|
+
border: 1px solid var(--axebow-light-gray);
|
|
165
|
+
border-radius: 0.375rem;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.status-bar { margin-bottom: 0.25rem; padding-left: 0.5rem; }
|
|
169
|
+
|
|
170
|
+
sl-badge::part(base) { background-color: var(--axebow-secondary); color: white; }
|
|
171
|
+
|
|
172
|
+
sl-dialog::part(panel) { width: 35vw; }
|
|
173
|
+
sl-dialog::part(body) { padding-top: 0; }
|
|
174
|
+
sl-alert::part(base) { border-top: 2px solid var(--axebow-error); }
|
|
175
|
+
|
|
176
|
+
sl-range, sl-range:hover {
|
|
177
|
+
--sl-color-primary-600: var(--axebow-tertiary);
|
|
178
|
+
--sl-color-primary-500: var(--axebow-tertiary);
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
__decorate([
|
|
182
|
+
property({ type: String })
|
|
183
|
+
], AuroraBaseCard.prototype, "cardType", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ type: String })
|
|
186
|
+
], AuroraBaseCard.prototype, "name", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: String })
|
|
189
|
+
], AuroraBaseCard.prototype, "logoSrc", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
property({ type: String })
|
|
192
|
+
], AuroraBaseCard.prototype, "tenantOrAccount", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
property({ type: String })
|
|
195
|
+
], AuroraBaseCard.prototype, "badge", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
property({ type: String })
|
|
198
|
+
], AuroraBaseCard.prototype, "subtitle", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
property({ type: Array })
|
|
201
|
+
], AuroraBaseCard.prototype, "mainStats", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
property({ type: Boolean })
|
|
204
|
+
], AuroraBaseCard.prototype, "compact", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
property({ type: Array })
|
|
207
|
+
], AuroraBaseCard.prototype, "tableStats", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
property({ type: Number })
|
|
210
|
+
], AuroraBaseCard.prototype, "attentionThreshold", void 0);
|
|
211
|
+
__decorate([
|
|
212
|
+
property({ type: Array })
|
|
213
|
+
], AuroraBaseCard.prototype, "filterItems", void 0);
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ type: String })
|
|
216
|
+
], AuroraBaseCard.prototype, "selected", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ type: Boolean })
|
|
219
|
+
], AuroraBaseCard.prototype, "filterOpened", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: String })
|
|
222
|
+
], AuroraBaseCard.prototype, "emptyLabel", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: String })
|
|
225
|
+
], AuroraBaseCard.prototype, "emptyActionLabel", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: String })
|
|
228
|
+
], AuroraBaseCard.prototype, "attentionLabel", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean })
|
|
231
|
+
], AuroraBaseCard.prototype, "showAttention", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ type: Boolean })
|
|
234
|
+
], AuroraBaseCard.prototype, "isPlainRole", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
property({ type: Boolean })
|
|
237
|
+
], AuroraBaseCard.prototype, "isDeleting", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
property({ type: Boolean })
|
|
240
|
+
], AuroraBaseCard.prototype, "isDisabled", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
property({ type: Boolean })
|
|
243
|
+
], AuroraBaseCard.prototype, "showActionBanner", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
property({ type: Boolean })
|
|
246
|
+
], AuroraBaseCard.prototype, "showWarningBanner", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
property({ type: String })
|
|
249
|
+
], AuroraBaseCard.prototype, "manageLabel", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
property({ type: String })
|
|
252
|
+
], AuroraBaseCard.prototype, "askOwnerLabel", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
property({ type: String })
|
|
255
|
+
], AuroraBaseCard.prototype, "invalidCredsLabel", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
property({ type: String })
|
|
258
|
+
], AuroraBaseCard.prototype, "limitReachedLabel", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ type: String })
|
|
261
|
+
], AuroraBaseCard.prototype, "andLabel", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ type: String })
|
|
264
|
+
], AuroraBaseCard.prototype, "actionBannerLabel", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
property({ type: Boolean })
|
|
267
|
+
], AuroraBaseCard.prototype, "moreActionsOpen", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
property({ type: Array })
|
|
270
|
+
], AuroraBaseCard.prototype, "moreActionsOptions", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
property({ type: Boolean })
|
|
273
|
+
], AuroraBaseCard.prototype, "isFreeIaaS", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
property({ type: String })
|
|
276
|
+
], AuroraBaseCard.prototype, "closeLabel", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
property({ type: String })
|
|
279
|
+
], AuroraBaseCard.prototype, "moreActionsLabel", void 0);
|
|
280
|
+
__decorate([
|
|
281
|
+
property({ type: String })
|
|
282
|
+
], AuroraBaseCard.prototype, "freeIaasLabel", void 0);
|
|
283
|
+
__decorate([
|
|
284
|
+
property({ type: String })
|
|
285
|
+
], AuroraBaseCard.prototype, "freeIaasTitle", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
property({ type: String })
|
|
288
|
+
], AuroraBaseCard.prototype, "freeIaasDesc", void 0);
|
|
289
|
+
__decorate([
|
|
290
|
+
property({ type: String })
|
|
291
|
+
], AuroraBaseCard.prototype, "haLabel", void 0);
|
|
292
|
+
__decorate([
|
|
293
|
+
property({ type: String })
|
|
294
|
+
], AuroraBaseCard.prototype, "haTitle", void 0);
|
|
295
|
+
AuroraBaseCard = __decorate([
|
|
296
|
+
customElement('aurora-base-card')
|
|
297
|
+
], AuroraBaseCard);
|
|
298
|
+
export { AuroraBaseCard };
|
|
299
|
+
//# sourceMappingURL=aurora-base-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aurora-base-card.js","sourceRoot":"","sources":["../../../src/components/cards/aurora-base-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,0BAA0B,CAAC;AAClC,OAAO,+BAA+B,CAAC;AACvC,OAAO,kC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ACxC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAAoB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAA2B;AAE1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAuC;AACtC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAA6D;AAC5D;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA8B;AAC7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAuC;AAtFvD,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAiL1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ActionMenuItem } from './card.types.js';
|
|
3
|
+
export declare class AuroraMoreActions extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult;
|
|
5
|
+
open: boolean;
|
|
6
|
+
placement: 'top' | 'bottom';
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
options: ActionMenuItem[];
|
|
9
|
+
title: string;
|
|
10
|
+
iconName: string;
|
|
11
|
+
openToRight: boolean;
|
|
12
|
+
closeLabel: string;
|
|
13
|
+
moreActionsLabel: string;
|
|
14
|
+
private _fixedPos;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private _handleOutsideClick;
|
|
18
|
+
private _handleScroll;
|
|
19
|
+
private _toggle;
|
|
20
|
+
private _handleSlotClick;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=aurora-more-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aurora-more-actions.d.ts","sourceRoot":"","sources":["../../../src/components/cards/aurora-more-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,0BAwDX;IAE2B,IAAI,UAAS;IACd,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAY;IACtC,QAAQ,UAAS;IACnB,OAAO,EAAE,cAAc,EAAE,CAAM;IAC9B,KAAK,SAAM;IACX,QAAQ,SAAM;IACb,WAAW,UAAS;IACrB,UAAU,SAAW;IACrB,gBAAgB,SAAU;IAE7C,OAAO,CAAC,SAAS,CAAwB;IAElD,iBAAiB;IAMjB,oBAAoB;IAMpB,OAAO,CAAC,mBAAmB,CAKzB;IAEF,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,gBAAgB;IAKxB,MAAM;CA0CP"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html, css } from 'lit';
|
|
8
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
9
|
+
let AuroraMoreActions = class AuroraMoreActions extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.open = false;
|
|
13
|
+
this.placement = 'bottom';
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.options = [];
|
|
16
|
+
this.title = '';
|
|
17
|
+
this.iconName = '';
|
|
18
|
+
this.openToRight = false;
|
|
19
|
+
this.closeLabel = 'Close';
|
|
20
|
+
this.moreActionsLabel = 'More';
|
|
21
|
+
this._fixedPos = { top: 0, right: 0 };
|
|
22
|
+
this._handleOutsideClick = (e) => {
|
|
23
|
+
if (this.open && !this.contains(e.target)) {
|
|
24
|
+
this.open = false;
|
|
25
|
+
this.dispatchEvent(new CustomEvent('toggled', { detail: { open: false } }));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this._handleScroll = () => {
|
|
29
|
+
if (this.open && this.openToRight) {
|
|
30
|
+
this.open = false;
|
|
31
|
+
this.dispatchEvent(new CustomEvent('toggled', { detail: { open: false } }));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
super.connectedCallback();
|
|
37
|
+
document.addEventListener('click', this._handleOutsideClick);
|
|
38
|
+
window.addEventListener('scroll', this._handleScroll, true);
|
|
39
|
+
}
|
|
40
|
+
disconnectedCallback() {
|
|
41
|
+
super.disconnectedCallback();
|
|
42
|
+
document.removeEventListener('click', this._handleOutsideClick);
|
|
43
|
+
window.removeEventListener('scroll', this._handleScroll, true);
|
|
44
|
+
}
|
|
45
|
+
_toggle(e) {
|
|
46
|
+
if (this.disabled)
|
|
47
|
+
return;
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
if (!this.open && this.openToRight) {
|
|
50
|
+
const btn = this.shadowRoot?.querySelector('.trigger');
|
|
51
|
+
if (btn) {
|
|
52
|
+
const rect = btn.getBoundingClientRect();
|
|
53
|
+
this._fixedPos = { top: rect.bottom + 8, right: window.innerWidth - rect.right };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
this.open = !this.open;
|
|
57
|
+
this.dispatchEvent(new CustomEvent('toggled', { detail: { open: this.open } }));
|
|
58
|
+
}
|
|
59
|
+
_handleSlotClick() {
|
|
60
|
+
this.open = false;
|
|
61
|
+
this.dispatchEvent(new CustomEvent('toggled', { detail: { open: false } }));
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
const placementClass = this.placement === 'top' ? 'dropdown--top' : 'dropdown--bottom';
|
|
65
|
+
const dropdownStyle = this.openToRight
|
|
66
|
+
? `position:fixed;top:${this._fixedPos.top}px;right:${this._fixedPos.right}px;z-index:1000;`
|
|
67
|
+
: '';
|
|
68
|
+
return html `
|
|
69
|
+
<div class="wrapper">
|
|
70
|
+
<button class="trigger" ?disabled=${this.disabled} @click=${this._toggle}>
|
|
71
|
+
${this.iconName
|
|
72
|
+
? html `<axebow-icon iconName=${this.iconName} size="small" iconColor="var(--axebow-tertiary)"></axebow-icon>`
|
|
73
|
+
: this.open ? this.closeLabel : (this.title || this.moreActionsLabel)}
|
|
74
|
+
</button>
|
|
75
|
+
${this.open
|
|
76
|
+
? html `
|
|
77
|
+
<div class="dropdown ${placementClass}" style=${dropdownStyle} @click=${this._handleSlotClick}>
|
|
78
|
+
${this.options?.length
|
|
79
|
+
? this.options.map((opt) => html `
|
|
80
|
+
<button
|
|
81
|
+
class="option-btn"
|
|
82
|
+
@click=${(e) => {
|
|
83
|
+
e.stopPropagation();
|
|
84
|
+
opt.onTap(e);
|
|
85
|
+
this.open = false;
|
|
86
|
+
this.dispatchEvent(new CustomEvent('toggled', { detail: { open: false } }));
|
|
87
|
+
}}
|
|
88
|
+
@mouseenter=${(e) => (e.currentTarget.style.borderColor = `var(--axebow-${opt.type})`)}
|
|
89
|
+
@mouseleave=${(e) => (e.currentTarget.style.borderColor = 'transparent')}
|
|
90
|
+
>
|
|
91
|
+
<axebow-icon iconName=${opt.icon} iconColor="var(--axebow-${opt.type})" size="small"></axebow-icon>
|
|
92
|
+
<p style="color:var(--axebow-${opt.type});">${opt.label}</p>
|
|
93
|
+
</button>
|
|
94
|
+
`)
|
|
95
|
+
: html `<slot></slot>`}
|
|
96
|
+
</div>
|
|
97
|
+
`
|
|
98
|
+
: ''}
|
|
99
|
+
</div>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
AuroraMoreActions.styles = css `
|
|
104
|
+
:host { display: inline-block; }
|
|
105
|
+
|
|
106
|
+
.wrapper { position: relative; width: 100%; height: 100%; display: flex; justify-content: flex-end; }
|
|
107
|
+
|
|
108
|
+
.trigger {
|
|
109
|
+
position: relative;
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
font-size: 0.75rem;
|
|
112
|
+
color: var(--axebow-tertiary);
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
padding: 0.25rem 0.5rem;
|
|
115
|
+
height: 100%;
|
|
116
|
+
background: transparent;
|
|
117
|
+
border: none;
|
|
118
|
+
transition: all 0.2s ease;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
}
|
|
122
|
+
.trigger:hover {
|
|
123
|
+
color: var(--axebow-gray);
|
|
124
|
+
background-color: var(--axebow-anti-flash-white);
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
}
|
|
127
|
+
.trigger:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
|
|
128
|
+
|
|
129
|
+
.dropdown {
|
|
130
|
+
position: absolute;
|
|
131
|
+
right: 0;
|
|
132
|
+
z-index: 10;
|
|
133
|
+
background: white;
|
|
134
|
+
border: 1px solid var(--axebow-gray);
|
|
135
|
+
border-radius: 0.5rem;
|
|
136
|
+
box-shadow: 2px 2px 25px 0px rgba(0,0,0,0.1);
|
|
137
|
+
padding: 0.5rem;
|
|
138
|
+
min-width: 11rem;
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
}
|
|
142
|
+
.dropdown--bottom { top: 100%; margin-top: 0.5rem; }
|
|
143
|
+
.dropdown--top { bottom: 100%; margin-bottom: 0.5rem; }
|
|
144
|
+
|
|
145
|
+
.option-btn {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
gap: 0.5rem;
|
|
149
|
+
text-align: left;
|
|
150
|
+
padding: 0.25rem 0.5rem;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
border-radius: 2px;
|
|
153
|
+
border: 1px solid transparent;
|
|
154
|
+
background: transparent;
|
|
155
|
+
width: 100%;
|
|
156
|
+
}
|
|
157
|
+
.option-btn:hover { background-color: #f3f4f6; }
|
|
158
|
+
.option-btn p { margin: 0; white-space: nowrap; }
|
|
159
|
+
`;
|
|
160
|
+
__decorate([
|
|
161
|
+
property({ type: Boolean })
|
|
162
|
+
], AuroraMoreActions.prototype, "open", void 0);
|
|
163
|
+
__decorate([
|
|
164
|
+
property({ type: String })
|
|
165
|
+
], AuroraMoreActions.prototype, "placement", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
property({ type: Boolean })
|
|
168
|
+
], AuroraMoreActions.prototype, "disabled", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: Array })
|
|
171
|
+
], AuroraMoreActions.prototype, "options", void 0);
|
|
172
|
+
__decorate([
|
|
173
|
+
property({ type: String })
|
|
174
|
+
], AuroraMoreActions.prototype, "title", void 0);
|
|
175
|
+
__decorate([
|
|
176
|
+
property({ type: String })
|
|
177
|
+
], AuroraMoreActions.prototype, "iconName", void 0);
|
|
178
|
+
__decorate([
|
|
179
|
+
property({ type: Boolean })
|
|
180
|
+
], AuroraMoreActions.prototype, "openToRight", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
property({ type: String })
|
|
183
|
+
], AuroraMoreActions.prototype, "closeLabel", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ type: String })
|
|
186
|
+
], AuroraMoreActions.prototype, "moreActionsLabel", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
state()
|
|
189
|
+
], AuroraMoreActions.prototype, "_fixedPos", void 0);
|
|
190
|
+
AuroraMoreActions = __decorate([
|
|
191
|
+
customElement('aurora-more-actions')
|
|
192
|
+
], AuroraMoreActions);
|
|
193
|
+
export { AuroraMoreActions };
|
|
194
|
+
//# sourceMappingURL=aurora-more-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aurora-more-actions.js","sourceRoot":"","sources":["../../../src/components/cards/aurora-more-actions.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI5D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QA2DwB,SAAI,GAAG,KAAK,CAAC;QACd,cAAS,GAAqB,QAAQ,CAAC;QACtC,aAAQ,GAAG,KAAK,CAAC;QACnB,YAAO,GAAqB,EAAE,CAAC;QAC9B,UAAK,GAAG,EAAE,CAAC;QACX,aAAQ,GAAG,EAAE,CAAC;QACb,gBAAW,GAAG,KAAK,CAAC;QACrB,eAAU,GAAG,OAAO,CAAC;QACrB,qBAAgB,GAAG,MAAM,CAAC;QAErC,cAAS,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAc1C,wBAAmB,GAAG,CAAC,CAAa,EAAE,EAAE;YAC9C,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAc,CAAC,EAAE,CAAC;gBAClD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;gBAClB,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;YAC9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IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAgC;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAe;AACb;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDAAqB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAA2B;AAErC;IAAhB,KAAK,EAAE;oDAA0C;AArEvC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8J7B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { TableStatsType, RuntimeFilterRole } from './card.types.js';
|
|
3
|
+
import './parts/aurora-card-resource-table.js';
|
|
4
|
+
export declare class AuroraRuntimeCard extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult;
|
|
6
|
+
name: string;
|
|
7
|
+
logo: string;
|
|
8
|
+
revisions: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
}>;
|
|
11
|
+
displayedRevision: string;
|
|
12
|
+
lastDeployed: string;
|
|
13
|
+
isDeployed: boolean;
|
|
14
|
+
tableStats: TableStatsType[];
|
|
15
|
+
attentionThreshold: number;
|
|
16
|
+
filterOpened: boolean;
|
|
17
|
+
filterDisplayText: string;
|
|
18
|
+
filterRoles: RuntimeFilterRole[];
|
|
19
|
+
showAttention: boolean;
|
|
20
|
+
borderColor: string;
|
|
21
|
+
statusCode: string;
|
|
22
|
+
statusMessage: string;
|
|
23
|
+
isRemoving: boolean;
|
|
24
|
+
deployedLabel: string;
|
|
25
|
+
allLabel: string;
|
|
26
|
+
attentionLabel: string;
|
|
27
|
+
serviceDetailLabel: string;
|
|
28
|
+
manageLabel: string;
|
|
29
|
+
askOwnerLabel: string;
|
|
30
|
+
invalidCredsLabel: string;
|
|
31
|
+
limitReachedLabel: string;
|
|
32
|
+
andLabel: string;
|
|
33
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
+
private _renderHeader;
|
|
35
|
+
private _renderDeployInfo;
|
|
36
|
+
private _renderTable;
|
|
37
|
+
private _renderFooter;
|
|
38
|
+
private _formatRevision;
|
|
39
|
+
private _onRevisionChange;
|
|
40
|
+
private _onToggleFilter;
|
|
41
|
+
private _onFilterChange;
|
|
42
|
+
private _onServiceDetail;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=aurora-runtime-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aurora-runtime-card.d.ts","sourceRoot":"","sources":["../../../src/components/cards/aurora-runtime-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,uCAAuC,CAAC;AAE/C,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,0BAiLX;IAE0B,IAAI,SAAM;IACV,IAAI,SAAM;IACX,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAM;IACrC,iBAAiB,SAAM;IACvB,YAAY,SAAM;IACjB,UAAU,UAAS;IACrB,UAAU,EAAE,cAAc,EAAE,CAAM;IACjC,kBAAkB,SAAM;IACvB,YAAY,UAAS;IACtB,iBAAiB,SAAM;IACxB,WAAW,EAAE,iBAAiB,EAAE,CAAM;IACpC,aAAa,UAAS;IACvB,WAAW,SAAM;IACjB,UAAU,SAAM;IAChB,aAAa,SAAM;IAClB,UAAU,UAAS;IAGpB,aAAa,SAAc;IAC3B,QAAQ,SAA2B;IACnC,cAAc,SAAsB;IACpC,kBAAkB,SAAoB;IACtC,WAAW,SAAY;IACvB,aAAa,SAAoB;IACjC,iBAAiB,SAA0B;IAC3C,iBAAiB,SAAoB;IACrC,QAAQ,SAAS;IAE7C,MAAM;IAgBN,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,YAAY;IAqDpB,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,gBAAgB;CAGzB"}
|