@redvars/peacock 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseButton-DuASuVth.js → BaseButton-BNFAYn-S.js} +2 -2
- package/dist/{BaseButton-DuASuVth.js.map → BaseButton-BNFAYn-S.js.map} +1 -1
- package/dist/BaseInput-14YmcfK7.js +27 -0
- package/dist/BaseInput-14YmcfK7.js.map +1 -0
- package/dist/banner.js +2 -3
- package/dist/banner.js.map +1 -1
- package/dist/{button-DouvOfEU.js → button-colors-Ccys3hvS.js} +5 -294
- package/dist/button-colors-Ccys3hvS.js.map +1 -0
- package/dist/button-group.js +226 -6
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +294 -8
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +634 -0
- package/dist/calendar-column-view.js.map +1 -0
- package/dist/calendar-event-BrQ_SEKD.js +199 -0
- package/dist/calendar-event-BrQ_SEKD.js.map +1 -0
- package/dist/calendar-month-view.js +376 -0
- package/dist/calendar-month-view.js.map +1 -0
- package/dist/calendar.js +339 -0
- package/dist/calendar.js.map +1 -0
- package/dist/canvas.js +361 -0
- package/dist/canvas.js.map +1 -0
- package/dist/cb-compound-expression.js +125 -0
- package/dist/cb-compound-expression.js.map +1 -0
- package/dist/cb-divider.js +150 -0
- package/dist/cb-divider.js.map +1 -0
- package/dist/cb-expression.js +75 -0
- package/dist/cb-expression.js.map +1 -0
- package/dist/cb-predicate.js +137 -0
- package/dist/cb-predicate.js.map +1 -0
- package/dist/code-editor.js +2 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/condition-builder.js +58 -0
- package/dist/condition-builder.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +7976 -4294
- package/dist/custom-elements.json +14358 -7589
- package/dist/dropdown-button.js +216 -0
- package/dist/dropdown-button.js.map +1 -0
- package/dist/event-manager-D-QCmUgR.js +113 -0
- package/dist/event-manager-D-QCmUgR.js.map +1 -0
- package/dist/fab.js +1 -1
- package/dist/flow-designer-dZnLJOQT.js +1656 -0
- package/dist/flow-designer-dZnLJOQT.js.map +1 -0
- package/dist/flow-designer-node-XMe-jlKg.js +548 -0
- package/dist/flow-designer-node-XMe-jlKg.js.map +1 -0
- package/dist/flow-designer-node.js +4 -0
- package/dist/flow-designer-node.js.map +1 -0
- package/dist/flow-designer.js +16 -0
- package/dist/flow-designer.js.map +1 -0
- package/dist/html-editor.js +358 -0
- package/dist/html-editor.js.map +1 -0
- package/dist/icon-button-CK1ZuE-2.js +247 -0
- package/dist/icon-button-CK1ZuE-2.js.map +1 -0
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/dist/{is-dark-mode-DicqGkCJ.js → is-dark-mode-DOcaw4Yq.js} +2 -27
- package/dist/is-dark-mode-DOcaw4Yq.js.map +1 -0
- package/dist/modal.js +418 -0
- package/dist/modal.js.map +1 -0
- package/dist/{navigation-rail-Lxetd5-Z.js → navigation-rail-DyO0oAZU.js} +306 -2197
- package/dist/navigation-rail-DyO0oAZU.js.map +1 -0
- package/dist/notification-manager.js +268 -0
- package/dist/notification-manager.js.map +1 -0
- package/dist/peacock-loader.js +84 -8
- package/dist/peacock-loader.js.map +1 -1
- package/dist/popover-NC7b1lTq.js +1971 -0
- package/dist/popover-NC7b1lTq.js.map +1 -0
- package/dist/popover-content.js +125 -0
- package/dist/popover-content.js.map +1 -0
- package/dist/popover.js +4 -0
- package/dist/popover.js.map +1 -0
- package/dist/split-button.js +388 -0
- package/dist/split-button.js.map +1 -0
- package/dist/src/__controllers/floating-controller.d.ts +35 -0
- package/dist/src/calendar/base-event.d.ts +10 -0
- package/dist/src/calendar/calendar-column-view.d.ts +41 -0
- package/dist/src/calendar/calendar-event.d.ts +7 -0
- package/dist/src/calendar/calendar-month-view.d.ts +31 -0
- package/dist/src/calendar/calendar.d.ts +65 -0
- package/dist/src/calendar/event-manager.d.ts +17 -0
- package/dist/src/calendar/index.d.ts +4 -0
- package/dist/src/calendar/types.d.ts +13 -0
- package/dist/src/calendar/utils.d.ts +31 -0
- package/dist/src/canvas/canvas.d.ts +92 -0
- package/dist/src/canvas/index.d.ts +2 -0
- package/dist/src/condition-builder/cb-compound-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-divider.d.ts +26 -0
- package/dist/src/condition-builder/cb-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-predicate.d.ts +30 -0
- package/dist/src/condition-builder/condition-builder.d.ts +27 -0
- package/dist/src/condition-builder/index.d.ts +5 -0
- package/dist/src/dropdown-button/dropdown-button.d.ts +68 -0
- package/dist/src/dropdown-button/index.d.ts +1 -0
- package/dist/src/flow-designer/commands.d.ts +66 -0
- package/dist/src/flow-designer/flow-designer-node.d.ts +46 -0
- package/dist/src/flow-designer/flow-designer.d.ts +133 -0
- package/dist/src/flow-designer/index.d.ts +7 -0
- package/dist/src/flow-designer/layout.d.ts +30 -0
- package/dist/src/flow-designer/types.d.ts +142 -0
- package/dist/src/flow-designer/validation.d.ts +43 -0
- package/dist/src/flow-designer/workflow-utils.d.ts +40 -0
- package/dist/src/html-editor/html-editor.d.ts +56 -0
- package/dist/src/html-editor/index.d.ts +2 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/menu/menu/menu.d.ts +5 -7
- package/dist/src/menu/menu-item/menu-item.d.ts +14 -13
- package/dist/src/modal/index.d.ts +1 -0
- package/dist/src/modal/modal.d.ts +63 -0
- package/dist/src/notification-manager/index.d.ts +1 -0
- package/dist/src/notification-manager/notification-manager.d.ts +44 -0
- package/dist/src/popover/index.d.ts +2 -0
- package/dist/src/popover/popover-content.d.ts +29 -0
- package/dist/src/popover/popover.d.ts +62 -0
- package/dist/src/split-button/index.d.ts +1 -0
- package/dist/src/split-button/split-button.d.ts +72 -0
- package/dist/src/tooltip/tooltip.d.ts +2 -15
- package/dist/test/flow-designer.test.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/readme.md +2 -2
- package/src/__controllers/floating-controller.ts +237 -0
- package/src/banner/banner.scss +2 -3
- package/src/button/button/button.ts +1 -0
- package/src/calendar/base-event.ts +49 -0
- package/src/calendar/calendar-column-view.scss +326 -0
- package/src/calendar/calendar-column-view.ts +392 -0
- package/src/calendar/calendar-event.ts +20 -0
- package/src/calendar/calendar-month-view.scss +192 -0
- package/src/calendar/calendar-month-view.ts +244 -0
- package/src/calendar/calendar.scss +71 -0
- package/src/calendar/calendar.ts +298 -0
- package/src/calendar/event-manager.ts +117 -0
- package/src/calendar/index.ts +4 -0
- package/src/calendar/types.ts +14 -0
- package/src/calendar/utils.ts +180 -0
- package/src/canvas/canvas.scss +60 -0
- package/src/canvas/canvas.ts +391 -0
- package/src/canvas/index.ts +2 -0
- package/src/condition-builder/cb-compound-expression.scss +37 -0
- package/src/condition-builder/cb-compound-expression.ts +80 -0
- package/src/condition-builder/cb-divider.scss +93 -0
- package/src/condition-builder/cb-divider.ts +56 -0
- package/src/condition-builder/cb-expression.scss +14 -0
- package/src/condition-builder/cb-expression.ts +49 -0
- package/src/condition-builder/cb-predicate.scss +35 -0
- package/src/condition-builder/cb-predicate.ts +102 -0
- package/src/condition-builder/condition-builder.scss +13 -0
- package/src/condition-builder/condition-builder.ts +38 -0
- package/src/condition-builder/index.ts +5 -0
- package/src/dropdown-button/demo/index.html +110 -0
- package/src/dropdown-button/dropdown-button.scss +22 -0
- package/src/dropdown-button/dropdown-button.ts +206 -0
- package/src/dropdown-button/index.ts +1 -0
- package/src/flow-designer/DEMO.md +239 -0
- package/src/flow-designer/commands.ts +278 -0
- package/src/flow-designer/flow-designer-node.ts +172 -0
- package/src/flow-designer/flow-designer.scss +457 -0
- package/src/flow-designer/flow-designer.ts +611 -0
- package/src/flow-designer/index.ts +41 -0
- package/src/flow-designer/layout.ts +357 -0
- package/src/flow-designer/types.ts +166 -0
- package/src/flow-designer/validation.ts +284 -0
- package/src/flow-designer/workflow-utils.ts +282 -0
- package/src/html-editor/html-editor.scss +146 -0
- package/src/html-editor/html-editor.ts +276 -0
- package/src/html-editor/index.ts +3 -0
- package/src/index.ts +25 -0
- package/src/menu/menu/menu.scss +2 -2
- package/src/menu/menu/menu.ts +91 -101
- package/src/menu/menu-item/menu-item.scss +4 -0
- package/src/menu/menu-item/menu-item.ts +82 -78
- package/src/modal/index.ts +1 -0
- package/src/modal/modal.scss +206 -0
- package/src/modal/modal.ts +201 -0
- package/src/notification-manager/index.ts +1 -0
- package/src/notification-manager/notification-manager.scss +113 -0
- package/src/notification-manager/notification-manager.ts +199 -0
- package/src/peacock-loader.ts +71 -0
- package/src/popover/index.ts +2 -0
- package/src/popover/popover-content.scss +69 -0
- package/src/popover/popover-content.ts +51 -0
- package/src/popover/popover.scss +7 -0
- package/src/popover/popover.ts +170 -0
- package/src/split-button/index.ts +1 -0
- package/src/split-button/split-button-colors.scss +56 -0
- package/src/split-button/split-button-sizes.scss +28 -0
- package/src/split-button/split-button.scss +79 -0
- package/src/split-button/split-button.ts +236 -0
- package/src/table/table.ts +2 -2
- package/src/tooltip/tooltip.scss +4 -3
- package/src/tooltip/tooltip.ts +46 -104
- package/dist/button-DouvOfEU.js.map +0 -1
- package/dist/button-group-CEdMwvJJ.js +0 -464
- package/dist/button-group-CEdMwvJJ.js.map +0 -1
- package/dist/is-dark-mode-DicqGkCJ.js.map +0 -1
- package/dist/navigation-rail-Lxetd5-Z.js.map +0 -1
- package/dist/src/menu/menu/MenuSurfaceController.d.ts +0 -18
- package/src/menu/menu/MenuSurfaceController.ts +0 -61
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
@use '../../scss/mixin';
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
@keyframes reveal-top {
|
|
6
|
+
0% {
|
|
7
|
+
opacity: 0;
|
|
8
|
+
transform: translateY(-1rem);
|
|
9
|
+
max-height: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
100% {
|
|
13
|
+
max-height: 500px;
|
|
14
|
+
opacity: 1;
|
|
15
|
+
transform: translateY(0);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes reveal-bottom {
|
|
20
|
+
0% {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: translateY(1rem);
|
|
23
|
+
max-height: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
100% {
|
|
27
|
+
max-height: 500px;
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: translateY(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
position: var(--notification-manager-position, absolute);
|
|
36
|
+
width: 20rem;
|
|
37
|
+
z-index: var(--z-index-notification-manager, 9000);
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.notification-manager {
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: var(--spacing-100);
|
|
46
|
+
margin: var(--spacing-150);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.notification {
|
|
50
|
+
pointer-events: auto;
|
|
51
|
+
max-height: 500px;
|
|
52
|
+
transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.notification.hidden {
|
|
57
|
+
max-height: 0;
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Position variants */
|
|
62
|
+
|
|
63
|
+
:host([position='bottom-right']) {
|
|
64
|
+
bottom: 0;
|
|
65
|
+
right: 0;
|
|
66
|
+
|
|
67
|
+
.notification-manager {
|
|
68
|
+
align-items: flex-end;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.notification {
|
|
72
|
+
animation: reveal-bottom 0.5s ease-in;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([position='bottom-left']) {
|
|
77
|
+
bottom: 0;
|
|
78
|
+
left: 0;
|
|
79
|
+
|
|
80
|
+
.notification-manager {
|
|
81
|
+
align-items: flex-start;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.notification {
|
|
85
|
+
animation: reveal-bottom 0.5s ease-in;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([position='top-right']) {
|
|
90
|
+
top: 0;
|
|
91
|
+
right: 0;
|
|
92
|
+
|
|
93
|
+
.notification-manager {
|
|
94
|
+
align-items: flex-end;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.notification {
|
|
98
|
+
animation: reveal-top 0.5s ease-in;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
:host([position='top-left']) {
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
|
|
106
|
+
.notification-manager {
|
|
107
|
+
align-items: flex-start;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.notification {
|
|
111
|
+
animation: reveal-top 0.5s ease-in;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { LitElement, html, nothing } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
|
|
5
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
6
|
+
import styles from './notification-manager.scss';
|
|
7
|
+
|
|
8
|
+
type NotificationVariant = 'success' | 'error' | 'info' | 'warning';
|
|
9
|
+
|
|
10
|
+
type NotificationEntry = {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
action?: string;
|
|
15
|
+
variant: NotificationVariant;
|
|
16
|
+
dismissible: boolean;
|
|
17
|
+
timeout: number;
|
|
18
|
+
hide: boolean;
|
|
19
|
+
width?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let notificationCounter = 0;
|
|
23
|
+
function nextId(): string {
|
|
24
|
+
return `wc-notification-${++notificationCounter}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @label Notification Manager
|
|
29
|
+
* @tag wc-notification-manager
|
|
30
|
+
* @rawTag notification-manager
|
|
31
|
+
* @summary The Notification Manager handles the organization and display of notifications within the application.
|
|
32
|
+
*
|
|
33
|
+
* @fires {CustomEvent} notification-manager-action - Fired when the action button of a managed notification is clicked. Detail: `{ id: string }`.
|
|
34
|
+
* @fires {CustomEvent} notification-manager-dismiss - Fired when a managed notification is dismissed. Detail: `{ id: string }`.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```html
|
|
38
|
+
* <wc-notification-manager position="bottom-right"></wc-notification-manager>
|
|
39
|
+
* <script>
|
|
40
|
+
* window.dispatchEvent(new CustomEvent('notification', {
|
|
41
|
+
* detail: { title: 'Record saved', variant: 'success', dismissible: true }
|
|
42
|
+
* }));
|
|
43
|
+
* </script>
|
|
44
|
+
* ```
|
|
45
|
+
* @tags display, feedback
|
|
46
|
+
*/
|
|
47
|
+
@IndividualComponent
|
|
48
|
+
export class NotificationManager extends LitElement {
|
|
49
|
+
static styles = [styles];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Name of this manager instance. Only notifications whose `target` matches
|
|
53
|
+
* this name (or whose `target` is absent and this manager's `name` is
|
|
54
|
+
* `'global'`) will be handled.
|
|
55
|
+
*/
|
|
56
|
+
@property({ type: String, reflect: true }) name = 'global';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Screen position where notifications are stacked.
|
|
60
|
+
*/
|
|
61
|
+
@property({ type: String, reflect: true })
|
|
62
|
+
position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' =
|
|
63
|
+
'bottom-right';
|
|
64
|
+
|
|
65
|
+
@state() private notifications: NotificationEntry[] = [];
|
|
66
|
+
|
|
67
|
+
private readonly handleWindowNotification = (event: Event) => {
|
|
68
|
+
const evt = event as CustomEvent;
|
|
69
|
+
const detail = evt.detail ?? {};
|
|
70
|
+
|
|
71
|
+
// Route by target: accept if target matches our name, or if we are global
|
|
72
|
+
// and no specific target is set.
|
|
73
|
+
const target: string | undefined = detail.target;
|
|
74
|
+
const isForUs =
|
|
75
|
+
target === this.name || (!target && this.name === 'global');
|
|
76
|
+
|
|
77
|
+
if (!isForUs || detail.processed) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
evt.stopPropagation();
|
|
82
|
+
detail.processed = true;
|
|
83
|
+
|
|
84
|
+
const entry: NotificationEntry = {
|
|
85
|
+
id: nextId(),
|
|
86
|
+
title: detail.title ?? '',
|
|
87
|
+
subtitle: detail.subtitle,
|
|
88
|
+
action: detail.action,
|
|
89
|
+
variant: detail.variant ?? 'info',
|
|
90
|
+
dismissible: detail.dismissible ?? false,
|
|
91
|
+
timeout: detail.timeout ?? 5000,
|
|
92
|
+
hide: false,
|
|
93
|
+
width: detail.width,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
this.notifications = [...this.notifications, entry];
|
|
97
|
+
|
|
98
|
+
if (typeof detail.callback === 'function') {
|
|
99
|
+
detail.callback(entry.id);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!entry.dismissible) {
|
|
103
|
+
setTimeout(() => {
|
|
104
|
+
this._hideNotification(entry.id);
|
|
105
|
+
}, entry.timeout);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
private readonly handleWindowDismiss = (event: Event) => {
|
|
110
|
+
const evt = event as CustomEvent;
|
|
111
|
+
const ids: string[] = evt.detail?.notifications ?? [];
|
|
112
|
+
ids.forEach(id => this._hideNotification(id));
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
connectedCallback() {
|
|
116
|
+
super.connectedCallback();
|
|
117
|
+
window.addEventListener('notification', this.handleWindowNotification);
|
|
118
|
+
window.addEventListener(
|
|
119
|
+
'notification-dismiss',
|
|
120
|
+
this.handleWindowDismiss,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
window.removeEventListener(
|
|
126
|
+
'notification',
|
|
127
|
+
this.handleWindowNotification,
|
|
128
|
+
);
|
|
129
|
+
window.removeEventListener(
|
|
130
|
+
'notification-dismiss',
|
|
131
|
+
this.handleWindowDismiss,
|
|
132
|
+
);
|
|
133
|
+
super.disconnectedCallback();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private _hideNotification(id: string) {
|
|
137
|
+
this.notifications = this.notifications.map(n =>
|
|
138
|
+
n.id === id ? { ...n, hide: true } : n,
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private _handleDismiss(id: string) {
|
|
143
|
+
this._hideNotification(id);
|
|
144
|
+
this.dispatchEvent(
|
|
145
|
+
new CustomEvent('notification-manager-dismiss', {
|
|
146
|
+
detail: { id },
|
|
147
|
+
bubbles: true,
|
|
148
|
+
composed: true,
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private _handleAction(id: string) {
|
|
154
|
+
this.dispatchEvent(
|
|
155
|
+
new CustomEvent('notification-manager-action', {
|
|
156
|
+
detail: { id },
|
|
157
|
+
bubbles: true,
|
|
158
|
+
composed: true,
|
|
159
|
+
}),
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private renderNotification(n: NotificationEntry) {
|
|
164
|
+
return html`
|
|
165
|
+
<div
|
|
166
|
+
id=${n.id}
|
|
167
|
+
class=${classMap({ notification: true, hidden: n.hide })}
|
|
168
|
+
style=${n.width ? `width: ${n.width}` : nothing}
|
|
169
|
+
>
|
|
170
|
+
<wc-notification
|
|
171
|
+
variant=${n.variant}
|
|
172
|
+
?dismissible=${n.dismissible}
|
|
173
|
+
managed
|
|
174
|
+
action=${n.action ?? nothing}
|
|
175
|
+
@notification-dismiss=${() => this._handleDismiss(n.id)}
|
|
176
|
+
@notification-action-click=${() => this._handleAction(n.id)}
|
|
177
|
+
>
|
|
178
|
+
<span slot="title">${n.title}</span>
|
|
179
|
+
${n.subtitle
|
|
180
|
+
? html`<span slot="subtitle">${n.subtitle}</span>`
|
|
181
|
+
: nothing}
|
|
182
|
+
</wc-notification>
|
|
183
|
+
</div>
|
|
184
|
+
`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
render() {
|
|
188
|
+
return html`
|
|
189
|
+
<div
|
|
190
|
+
class=${classMap({
|
|
191
|
+
'notification-manager': true,
|
|
192
|
+
[`position-${this.position}`]: true,
|
|
193
|
+
})}
|
|
194
|
+
>
|
|
195
|
+
${this.notifications.map(n => this.renderNotification(n))}
|
|
196
|
+
</div>
|
|
197
|
+
`;
|
|
198
|
+
}
|
|
199
|
+
}
|
package/src/peacock-loader.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { IconButton } from './button/icon-button/icon-button.js';
|
|
|
14
14
|
import { Fab } from './fab/fab.js';
|
|
15
15
|
import { SegmentedButton } from './segmented-button/segmented-button.js';
|
|
16
16
|
import { SegmentedButtonGroup } from './segmented-button/segmented-button-group.js';
|
|
17
|
+
import { SplitButton } from './split-button/split-button.js';
|
|
18
|
+
import { DropdownButton } from './dropdown-button/dropdown-button.js';
|
|
17
19
|
import { Input } from './input/input.js';
|
|
18
20
|
import { UrlField } from './url-field/url-field.js';
|
|
19
21
|
import { Field } from './field/field.js';
|
|
@@ -37,6 +39,8 @@ import { LinearProgress } from './progress/linear-progress/linear-progress.js';
|
|
|
37
39
|
import { CircularProgress } from './progress/circular-progress/circular-progress.js';
|
|
38
40
|
|
|
39
41
|
import { Tooltip } from './tooltip/tooltip.js';
|
|
42
|
+
import { Popover } from './popover/popover.js';
|
|
43
|
+
import { PopoverContent } from './popover/popover-content.js';
|
|
40
44
|
import { Breadcrumb, BreadcrumbItem } from './breadcrumb/index.js';
|
|
41
45
|
|
|
42
46
|
import { Skeleton } from './skeleton/skeleton.js';
|
|
@@ -62,15 +66,28 @@ import { Card } from './card/card.js';
|
|
|
62
66
|
import { CardContent } from './card/card-content.js';
|
|
63
67
|
import { Banner } from './banner/banner.js';
|
|
64
68
|
import { Notification } from './notification/notification.js';
|
|
69
|
+
import { NotificationManager } from './notification-manager/notification-manager.js';
|
|
65
70
|
import { Snackbar } from './snackbar/snackbar.js';
|
|
66
71
|
import { BottomSheet } from './bottom-sheet/bottom-sheet.js';
|
|
67
72
|
import { SideSheet } from './side-sheet/side-sheet.js';
|
|
73
|
+
import { Modal } from './modal/modal.js';
|
|
68
74
|
import { Select } from './select/select.js';
|
|
69
75
|
import { SelectOptionElement } from './select/option.js';
|
|
70
76
|
import { Search } from './search/search.js';
|
|
71
77
|
import { Toolbar } from './toolbar/toolbar.js';
|
|
72
78
|
import { NavigationRail } from './navigation-rail/navigation-rail.js';
|
|
73
79
|
import { NavigationRailItem } from './navigation-rail/navigation-rail-item.js';
|
|
80
|
+
import { Calendar } from './calendar/calendar.js';
|
|
81
|
+
import { CalendarColumnView } from './calendar/calendar-column-view.js';
|
|
82
|
+
import { CalendarMonthView } from './calendar/calendar-month-view.js';
|
|
83
|
+
import { Canvas } from './canvas/canvas.js';
|
|
84
|
+
import { FlowDesigner } from './flow-designer/flow-designer.js';
|
|
85
|
+
import { FlowDesignerNode } from './flow-designer/flow-designer-node.js';
|
|
86
|
+
import { ConditionBuilder } from './condition-builder/condition-builder.js';
|
|
87
|
+
import { CbPredicate } from './condition-builder/cb-predicate.js';
|
|
88
|
+
import { CbCompoundExpression } from './condition-builder/cb-compound-expression.js';
|
|
89
|
+
import { CbExpression } from './condition-builder/cb-expression.js';
|
|
90
|
+
import { CbDivider } from './condition-builder/cb-divider.js';
|
|
74
91
|
|
|
75
92
|
const distDirectory = `${import.meta.url}/..`;
|
|
76
93
|
await loadCSS(`${distDirectory}/assets/styles.css`);
|
|
@@ -128,6 +145,12 @@ const loaderConfig: LoaderConfig = {
|
|
|
128
145
|
'wc-segmented-button-group': {
|
|
129
146
|
CustomElementClass: SegmentedButtonGroup,
|
|
130
147
|
},
|
|
148
|
+
'wc-split-button': {
|
|
149
|
+
CustomElementClass: SplitButton,
|
|
150
|
+
},
|
|
151
|
+
'wc-dropdown-button': {
|
|
152
|
+
CustomElementClass: DropdownButton,
|
|
153
|
+
},
|
|
131
154
|
'wc-divider': {
|
|
132
155
|
CustomElementClass: Divider,
|
|
133
156
|
},
|
|
@@ -176,6 +199,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
176
199
|
'wc-notification': {
|
|
177
200
|
CustomElementClass: Notification,
|
|
178
201
|
},
|
|
202
|
+
'wc-notification-manager': {
|
|
203
|
+
CustomElementClass: NotificationManager,
|
|
204
|
+
},
|
|
179
205
|
'wc-tag': {
|
|
180
206
|
CustomElementClass: Tag,
|
|
181
207
|
},
|
|
@@ -213,12 +239,21 @@ const loaderConfig: LoaderConfig = {
|
|
|
213
239
|
'wc-tooltip': {
|
|
214
240
|
CustomElementClass: Tooltip,
|
|
215
241
|
},
|
|
242
|
+
'wc-popover': {
|
|
243
|
+
CustomElementClass: Popover,
|
|
244
|
+
},
|
|
245
|
+
'wc-popover-content': {
|
|
246
|
+
CustomElementClass: PopoverContent,
|
|
247
|
+
},
|
|
216
248
|
'wc-number-counter': {
|
|
217
249
|
importPath: `${distDirectory}/number-counter.js`,
|
|
218
250
|
},
|
|
219
251
|
'wc-code-editor': {
|
|
220
252
|
importPath: `${distDirectory}/code-editor.js`,
|
|
221
253
|
},
|
|
254
|
+
'wc-html-editor': {
|
|
255
|
+
importPath: `${distDirectory}/html-editor.js`,
|
|
256
|
+
},
|
|
222
257
|
'wc-code-highlighter': {
|
|
223
258
|
importPath: `${distDirectory}/code-highlighter.js`,
|
|
224
259
|
},
|
|
@@ -285,6 +320,9 @@ const loaderConfig: LoaderConfig = {
|
|
|
285
320
|
'wc-side-sheet': {
|
|
286
321
|
CustomElementClass: SideSheet,
|
|
287
322
|
},
|
|
323
|
+
'wc-modal': {
|
|
324
|
+
CustomElementClass: Modal,
|
|
325
|
+
},
|
|
288
326
|
'wc-select': {
|
|
289
327
|
CustomElementClass: Select,
|
|
290
328
|
},
|
|
@@ -303,6 +341,24 @@ const loaderConfig: LoaderConfig = {
|
|
|
303
341
|
'wc-navigation-rail-item': {
|
|
304
342
|
CustomElementClass: NavigationRailItem,
|
|
305
343
|
},
|
|
344
|
+
'wc-calendar': {
|
|
345
|
+
CustomElementClass: Calendar,
|
|
346
|
+
},
|
|
347
|
+
'wc-calendar-column-view': {
|
|
348
|
+
CustomElementClass: CalendarColumnView,
|
|
349
|
+
},
|
|
350
|
+
'wc-calendar-month-view': {
|
|
351
|
+
CustomElementClass: CalendarMonthView,
|
|
352
|
+
},
|
|
353
|
+
'wc-canvas': {
|
|
354
|
+
CustomElementClass: Canvas,
|
|
355
|
+
},
|
|
356
|
+
'wc-flow-designer': {
|
|
357
|
+
CustomElementClass: FlowDesigner,
|
|
358
|
+
},
|
|
359
|
+
'wc-flow-designer-node': {
|
|
360
|
+
CustomElementClass: FlowDesignerNode,
|
|
361
|
+
},
|
|
306
362
|
'wc-chart-doughnut': {
|
|
307
363
|
importPath: `${distDirectory}/chart-doughnut.js`,
|
|
308
364
|
},
|
|
@@ -315,6 +371,21 @@ const loaderConfig: LoaderConfig = {
|
|
|
315
371
|
'wc-chart-stacked-bar': {
|
|
316
372
|
importPath: `${distDirectory}/chart-stacked-bar.js`,
|
|
317
373
|
},
|
|
374
|
+
'wc-condition-builder': {
|
|
375
|
+
CustomElementClass: ConditionBuilder,
|
|
376
|
+
},
|
|
377
|
+
'wc-cb-predicate': {
|
|
378
|
+
CustomElementClass: CbPredicate,
|
|
379
|
+
},
|
|
380
|
+
'wc-cb-compound-expression': {
|
|
381
|
+
CustomElementClass: CbCompoundExpression,
|
|
382
|
+
},
|
|
383
|
+
'wc-cb-expression': {
|
|
384
|
+
CustomElementClass: CbExpression,
|
|
385
|
+
},
|
|
386
|
+
'wc-cb-divider': {
|
|
387
|
+
CustomElementClass: CbDivider,
|
|
388
|
+
},
|
|
318
389
|
},
|
|
319
390
|
};
|
|
320
391
|
|
package/src/popover/index.ts
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@use "../../scss/mixin";
|
|
2
|
+
|
|
3
|
+
@include mixin.base-styles;
|
|
4
|
+
|
|
5
|
+
:host {
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
z-index: var(--z-index-popover, 1000);
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @prop --popover-content-background: Background color of the popover content
|
|
14
|
+
*/
|
|
15
|
+
--popover-content-background: var(--color-surface-container);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @prop --popover-content-padding: Padding of the popover content
|
|
19
|
+
*/
|
|
20
|
+
--popover-content-padding: var(--spacing-200);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @prop --popover-content-border-radius: Border radius of the popover content
|
|
24
|
+
*/
|
|
25
|
+
--popover-content-border-radius: var(--shape-corner-small);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @prop --popover-content-min-width: Minimum width of the popover content
|
|
29
|
+
*/
|
|
30
|
+
--popover-content-min-width: 10rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([open]) {
|
|
34
|
+
pointer-events: auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.popover-content {
|
|
38
|
+
position: relative;
|
|
39
|
+
background: var(--popover-content-background);
|
|
40
|
+
padding: var(--popover-content-padding);
|
|
41
|
+
border-radius: var(--popover-content-border-radius);
|
|
42
|
+
min-width: var(--popover-content-min-width);
|
|
43
|
+
color: var(--color-on-surface);
|
|
44
|
+
|
|
45
|
+
transform: scale(0.9);
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition:
|
|
48
|
+
transform var(--duration-short2, 0.1s) var(--easing-standard, ease-in-out),
|
|
49
|
+
opacity var(--duration-short2, 0.1s) var(--easing-standard, ease-in-out);
|
|
50
|
+
|
|
51
|
+
&.open {
|
|
52
|
+
transform: scale(1);
|
|
53
|
+
opacity: 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.elevation {
|
|
58
|
+
--elevation-level: 2;
|
|
59
|
+
--elevation-container-shape: var(--popover-content-border-radius, var(--shape-corner-small));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.arrow {
|
|
63
|
+
width: 0.75rem;
|
|
64
|
+
height: 0.75rem;
|
|
65
|
+
background: var(--popover-content-background);
|
|
66
|
+
position: absolute;
|
|
67
|
+
z-index: -1;
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import IndividualComponent from '@/IndividualComponent.js';
|
|
5
|
+
import styles from './popover-content.scss';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @label Popover Content
|
|
9
|
+
* @tag wc-popover-content
|
|
10
|
+
* @rawTag popover-content
|
|
11
|
+
* @summary Content container for the wc-popover component.
|
|
12
|
+
* @childComponent true
|
|
13
|
+
* @tags display
|
|
14
|
+
*
|
|
15
|
+
* @cssprop --popover-content-background - Background color of the popover content. Defaults to `var(--color-surface-container)`.
|
|
16
|
+
* @cssprop --popover-content-padding - Padding of the popover content. Defaults to `var(--spacing-200)`.
|
|
17
|
+
* @cssprop --popover-content-border-radius - Border radius of the popover content. Defaults to `var(--shape-corner-small)`.
|
|
18
|
+
* @cssprop --popover-content-min-width - Minimum width of the popover content. Defaults to `10rem`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <wc-popover-content>
|
|
23
|
+
* <p>Popover body text</p>
|
|
24
|
+
* </wc-popover-content>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
@IndividualComponent
|
|
28
|
+
export class PopoverContent extends LitElement {
|
|
29
|
+
static styles = [styles];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether the popover content is visible.
|
|
33
|
+
*/
|
|
34
|
+
@property({ type: Boolean, reflect: true }) open = false;
|
|
35
|
+
|
|
36
|
+
render() {
|
|
37
|
+
return html`
|
|
38
|
+
<div
|
|
39
|
+
class=${classMap({
|
|
40
|
+
'popover-content': true,
|
|
41
|
+
open: this.open,
|
|
42
|
+
})}
|
|
43
|
+
part="container"
|
|
44
|
+
>
|
|
45
|
+
<slot></slot>
|
|
46
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
47
|
+
<div class="arrow" part="arrow"></div>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|