@oicl/openbridge-webcomponents 2.0.0-next.153 → 2.0.0-next.155
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/bundle/openbridge-webcomponents.bundle.js +438 -238
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +260 -50
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js +3 -7
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.css.js.map +1 -1
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts +133 -14
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map +1 -1
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js +330 -233
- package/dist/components/alert-list-details-experimental/alert-list-details-experimental.js.map +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/table/table.js +10 -2
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/user-button/user-button.css.js +68 -1
- package/dist/components/user-button/user-button.css.js.map +1 -1
- package/dist/components/user-button/user-button.d.ts +12 -1
- package/dist/components/user-button/user-button.d.ts.map +1 -1
- package/dist/components/user-button/user-button.js +12 -3
- package/dist/components/user-button/user-button.js.map +1 -1
- package/dist/components/user-menu/user-menu.css.js +15 -0
- package/dist/components/user-menu/user-menu.css.js.map +1 -1
- package/dist/components/user-menu/user-menu.d.ts +30 -2
- package/dist/components/user-menu/user-menu.d.ts.map +1 -1
- package/dist/components/user-menu/user-menu.js +34 -2
- package/dist/components/user-menu/user-menu.js.map +1 -1
- package/dist/generated/locales/es-419.d.ts +1 -0
- package/dist/generated/locales/es-419.d.ts.map +1 -1
- package/dist/generated/locales/es-419.js +1 -0
- package/dist/generated/locales/es-419.js.map +1 -1
- package/dist/generated/locales/fi-FI.d.ts +1 -0
- package/dist/generated/locales/fi-FI.d.ts.map +1 -1
- package/dist/generated/locales/fi-FI.js +1 -0
- package/dist/generated/locales/fi-FI.js.map +1 -1
- package/package.json +2 -2
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
import { Alert } from '../../types.js';
|
|
3
|
+
import { ObcTableCellData } from '../table/table.js';
|
|
3
4
|
import '../icon-button/icon-button.js';
|
|
4
5
|
import '../button/button.js';
|
|
5
6
|
import '../../icons/icon-silence-iec.js';
|
|
@@ -12,56 +13,174 @@ import '../../icons/icon-alarm-noack-iec.js';
|
|
|
12
13
|
import '../../icons/icon-warning-noack-iec.js';
|
|
13
14
|
import '../alert-icon/alert-icon.js';
|
|
14
15
|
import '../scrollbar/scrollbar.js';
|
|
15
|
-
export declare enum
|
|
16
|
+
export declare enum FilterModes {
|
|
16
17
|
UNACKED = "unacked",
|
|
17
18
|
ALL = "all",
|
|
18
19
|
SHELVED = "shelved",
|
|
19
20
|
BLOCKED = "blocked",
|
|
20
21
|
RECTIFIED = "rectified"
|
|
21
22
|
}
|
|
22
|
-
export type
|
|
23
|
+
export type ObcAlertListCellClickEvent = CustomEvent<{
|
|
23
24
|
alert: Alert;
|
|
25
|
+
columnKey: string;
|
|
26
|
+
rowId: string;
|
|
24
27
|
}>;
|
|
25
28
|
export type ObcRowClickEvent = CustomEvent<{
|
|
26
29
|
alert: Alert;
|
|
30
|
+
rowId: string;
|
|
27
31
|
}>;
|
|
28
|
-
export
|
|
29
|
-
name
|
|
32
|
+
export interface AlertListColumnBase {
|
|
33
|
+
/** Unique within the list; part of the cell slot name. */
|
|
34
|
+
key: string;
|
|
35
|
+
label: string;
|
|
36
|
+
/** CSS grid track size. Defaults to `1fr` for the first column, `min-content` for the rest. */
|
|
37
|
+
width?: string;
|
|
38
|
+
dividerRight?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** A column whose cells the list renders from `cell(alert)`. */
|
|
41
|
+
export interface AlertListDataColumn extends AlertListColumnBase {
|
|
42
|
+
cell: (alert: Alert) => ObcTableCellData | undefined;
|
|
43
|
+
/** Makes the column sortable. */
|
|
44
|
+
compare?: (a: Alert, b: Alert) => number;
|
|
45
|
+
sortDirection?: 'asc' | 'desc';
|
|
46
|
+
}
|
|
47
|
+
/** A column whose cells the consumer supplies through `cell-<key>:<rowId>` slots. */
|
|
48
|
+
export interface AlertListSlotColumn extends AlertListColumnBase {
|
|
49
|
+
slot: true;
|
|
50
|
+
}
|
|
51
|
+
export type AlertListColumn = AlertListDataColumn | AlertListSlotColumn;
|
|
52
|
+
export type AlertListColumnOptions = Partial<AlertListColumnBase>;
|
|
53
|
+
/** One cell of a slot column, for every row including rows in collapsed groups. */
|
|
54
|
+
export interface AlertListCellSlot {
|
|
55
|
+
name: string;
|
|
56
|
+
alert: Alert;
|
|
57
|
+
rowId: string;
|
|
58
|
+
columnKey: string;
|
|
59
|
+
}
|
|
60
|
+
export type ObcAlertListCellSlotsChangeEvent = CustomEvent<AlertListCellSlot[]>;
|
|
61
|
+
export interface AlertListRow {
|
|
62
|
+
rowId: string;
|
|
63
|
+
parentRowId?: string;
|
|
64
|
+
alert: Alert;
|
|
65
|
+
level: number;
|
|
66
|
+
expandable: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare function getFilterModeData(filterMode: FilterModes): {
|
|
69
|
+
name: FilterModes;
|
|
30
70
|
title: string;
|
|
31
71
|
emptyTitle: string;
|
|
32
72
|
emptyIcon: import('lit-html').TemplateResult<1>;
|
|
33
73
|
filter: (alert: Alert) => boolean;
|
|
34
74
|
};
|
|
35
75
|
export declare function canAckFilter(filter: (alert: Alert) => boolean): (alert: Alert) => boolean;
|
|
76
|
+
/** Name of the slot that fills the cell of a slot column in one row. */
|
|
77
|
+
export declare function alertListCellSlotName(columnKey: string, rowId: string): string;
|
|
78
|
+
/** Alert icon, text and source; sorted by priority. */
|
|
79
|
+
export declare function statusColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
80
|
+
/** ACK button, or the no-ack icon, for alerts that await acknowledgement. The button fires `cell-click`. */
|
|
81
|
+
export declare function ackColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
82
|
+
/** Activation time; sorted by time. */
|
|
83
|
+
export declare function timeColumn({ formatter, ...options }?: AlertListColumnOptions & {
|
|
84
|
+
formatter?: (time: Date) => string;
|
|
85
|
+
}): AlertListDataColumn;
|
|
86
|
+
/** Tag ID prefixed with `#`; sorted alphabetically. */
|
|
87
|
+
export declare function tagIdColumn(options?: AlertListColumnOptions): AlertListDataColumn;
|
|
88
|
+
/**
|
|
89
|
+
* Every row `obc-alert-list-details-experimental` can show for these alerts
|
|
90
|
+
* and filter mode, rows inside collapsed groups included. An alert that is a member
|
|
91
|
+
* of several groups gets one row, and one `rowId`, under each.
|
|
92
|
+
*/
|
|
93
|
+
export declare function getAlertRows(alerts: Alert[], filterMode: FilterModes): AlertListRow[];
|
|
36
94
|
/**
|
|
37
|
-
*
|
|
95
|
+
* `<obc-alert-list-details-experimental>` lists alerts in a table with
|
|
96
|
+
* consumer-defined columns, grouping alerts through `memberOf`.
|
|
97
|
+
*
|
|
98
|
+
* ## Features
|
|
99
|
+
* - **Columns:** `columns` sets which columns show and in what order. A data
|
|
100
|
+
* column renders each cell from `cell(alert)`; a slot column renders
|
|
101
|
+
* whatever the consumer places in the cell's slot.
|
|
102
|
+
* - **Column factories:** `statusColumn()`, `ackColumn()`, `timeColumn()` and
|
|
103
|
+
* `tagIdColumn()` build the standard data columns; each takes overrides
|
|
104
|
+
* such as `label`, `width` or `dividerRight`.
|
|
105
|
+
* - **Filter modes:** `filterMode` lists unacknowledged, all, shelved,
|
|
106
|
+
* blocked or rectified alerts, with an empty state per filter mode.
|
|
107
|
+
* - **Grouping:** an alert listing group ids in `memberOf` renders under each
|
|
108
|
+
* of those groups; groups nest and can be collapsed.
|
|
109
|
+
* - **Selection:** `selectedRowId` highlights one row. When a collapsed group
|
|
110
|
+
* hides it, the nearest visible group row is highlighted instead.
|
|
111
|
+
*
|
|
112
|
+
* ## Usage Guidelines
|
|
113
|
+
* - Use a slot column when the cell content must be owned by the consumer,
|
|
114
|
+
* for example a button the application disables or removes later. Slotted
|
|
115
|
+
* content stays in the light DOM, so it can be looked up by id.
|
|
116
|
+
* - Slot names are `cell-<key>:<rowId>`. `cellSlots` lists every one, with its
|
|
117
|
+
* alert, row id and column key, and `cell-slots-change` fires when the list
|
|
118
|
+
* changes. The Svelte wrapper renders its `cell` snippet once per entry. An
|
|
119
|
+
* alert in two groups has two rows, so it gets two entries.
|
|
120
|
+
* - Without a wrapper, build the names from `getAlertRows(alerts, filterMode)`
|
|
121
|
+
* and `alertListCellSlotName(key, rowId)`, or read `cellSlots`.
|
|
122
|
+
* - Clicks on buttons, links and inputs in a cell do not fire `row-click`.
|
|
123
|
+
* - The consumer owns the selection: set `selectedRowId` from `row-click`, and
|
|
124
|
+
* set it to `undefined` on a second click to unselect. The list never changes
|
|
125
|
+
* it; clear it when the row is no longer in `getAlertRows(alerts, filterMode)`.
|
|
126
|
+
*
|
|
127
|
+
* ## Example
|
|
128
|
+
* ```html
|
|
129
|
+
* <obc-alert-list-details-experimental>
|
|
130
|
+
* <obc-button slot="cell-ack:radar" id="ack-radar">ACK</obc-button>
|
|
131
|
+
* </obc-alert-list-details-experimental>
|
|
132
|
+
* ```
|
|
133
|
+
* with `columns` set to `[statusColumn(), {key: 'ack', label: 'ACK-status', slot: true}]`.
|
|
134
|
+
*
|
|
135
|
+
* @property filterMode - Which alerts to list.
|
|
136
|
+
* @property alerts - Alerts to list.
|
|
137
|
+
* @property columns - Columns in display order.
|
|
138
|
+
* @property showHeader - Whether to show the column header row.
|
|
38
139
|
* @property defaultExpanded - Whether groups start expanded. Set false to open the list collapsed.
|
|
39
|
-
* @
|
|
140
|
+
* @property selectedRowId - Row id to highlight, as given by `row-click` or `getAlertRows()`. Nothing is highlighted when no row has this id.
|
|
141
|
+
* @slot cell-<key>:<rowId> - Content of the cell in slot column `<key>` for row `<rowId>`.
|
|
142
|
+
* @fires {ObcAlertListCellClickEvent} cell-click - Fired when the user clicks a button rendered by a data column, such as the one from `ackColumn()`.
|
|
40
143
|
* @fires {ObcRowClickEvent} row-click - Fired when the user clicks a row.
|
|
144
|
+
* @fires {ObcAlertListCellSlotsChangeEvent} cell-slots-change - Fired when `cellSlots` changes; the detail is the new list.
|
|
41
145
|
* @experimental
|
|
42
146
|
*/
|
|
43
147
|
export declare class ObcAlertListDetailsExperimental extends LitElement {
|
|
44
|
-
|
|
148
|
+
/** Which alerts to list. */
|
|
149
|
+
filterMode: FilterModes;
|
|
150
|
+
/** Alerts to list. */
|
|
45
151
|
alerts: Alert[];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
152
|
+
/** Columns in display order. */
|
|
153
|
+
columns: AlertListColumn[];
|
|
154
|
+
/** Whether to show the column header row. */
|
|
155
|
+
showHeader: boolean;
|
|
50
156
|
/** Whether groups start expanded. Set false to open the list collapsed. */
|
|
51
157
|
defaultExpanded: boolean;
|
|
158
|
+
/** Row id to highlight, as given by `row-click` or `getAlertRows()`. Nothing is highlighted when no row has this id. */
|
|
159
|
+
selectedRowId?: string;
|
|
52
160
|
private alertList;
|
|
53
161
|
private expansionOverrides;
|
|
54
162
|
private alertByRowId;
|
|
163
|
+
private allRowIds;
|
|
164
|
+
private _cellSlots;
|
|
165
|
+
private cellSlotsChanged;
|
|
166
|
+
/** Slot of every cell in a slot column, rows in collapsed groups included. */
|
|
167
|
+
get cellSlots(): AlertListCellSlot[];
|
|
168
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
169
|
+
updated(): void;
|
|
55
170
|
getVisibleAlerts(): Alert[];
|
|
56
171
|
private onRowClick;
|
|
57
172
|
private onCellButtonClick;
|
|
58
173
|
private onExpandToggle;
|
|
59
174
|
private isExpanded;
|
|
60
|
-
private
|
|
175
|
+
private compareRows;
|
|
176
|
+
private get tableColumns();
|
|
177
|
+
private get gridColumns();
|
|
61
178
|
private get metadata();
|
|
62
|
-
private get filteredAlerts();
|
|
63
179
|
private buildVisibleRows;
|
|
180
|
+
/** The selected row, or the nearest visible group row when a collapsed group hides it. */
|
|
181
|
+
private highlightedRowId;
|
|
64
182
|
private buildRowCells;
|
|
183
|
+
private slotNames;
|
|
65
184
|
render(): import('lit-html').TemplateResult<1>;
|
|
66
185
|
static styles: import('lit').CSSResult;
|
|
67
186
|
}
|
package/dist/components/alert-list-details-experimental/alert-list-details-experimental.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-list-details-experimental.d.ts","sourceRoot":"","sources":["../../../src/components/alert-list-details-experimental/alert-list-details-experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"alert-list-details-experimental.d.ts","sourceRoot":"","sources":["../../../src/components/alert-list-details-experimental/alert-list-details-experimental.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAkB,MAAM,KAAK,CAAC;AAMhE,OAAO,+BAA+B,CAAC;AACvC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,yCAAyC,CAAC;AACjD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uCAAuC,CAAC;AAC/C,OAAO,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,EAMN,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EAGL,gBAAgB,EAMjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,2BAA2B,CAAC;AAEnC,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;IACnD,K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