@itfin/components 2.0.49 → 2.0.50
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/package.json +1 -1
- package/src/components/app/App.vue +0 -1
- package/src/components/icon/new-icons/arrow-right-alt.svg +3 -0
- package/src/components/icon/new-icons/chevron-down.svg +3 -0
- package/src/components/icon/new-icons/chevron-left.svg +3 -0
- package/src/components/icon/new-icons/chevron-right.svg +2 -2
- package/src/components/panels/PanelList.vue +2 -1
- package/src/components/panels/index.ts +19 -0
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9 8.41421L9 15.5858C9 16.4767 10.0771 16.9229 10.7071 16.2929L14.2929 12.7071C14.6834 12.3166 14.6834 11.6834 14.2929 11.2929L10.7071 7.70711C10.0771 7.07714 9 7.52331 9 8.41421Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path d="
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8.33337 13.3333L11.6667 9.99996L8.33337 6.66663" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
3
|
</svg>
|
|
@@ -167,7 +167,7 @@ import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
|
167
167
|
import itfIcon from '../icon/Icon.vue';
|
|
168
168
|
import Panel from './Panel.vue';
|
|
169
169
|
import {hashToStack, stackToHash} from "@itfin/components/src/components/panels/helpers";
|
|
170
|
-
import {setRootPanelList} from "@itfin/components/src/components/panels";
|
|
170
|
+
import {emitGlobalEvent, setRootPanelList} from "@itfin/components/src/components/panels";
|
|
171
171
|
|
|
172
172
|
interface VisualOptions {
|
|
173
173
|
title: string;
|
|
@@ -393,6 +393,7 @@ export default class PanelList extends Vue {
|
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
emitEvent(event: string, ...args: any[]) {
|
|
396
|
+
emitGlobalEvent(event, ...args);
|
|
396
397
|
for (const panel of this.panelsStack) {
|
|
397
398
|
if (panel.__events[event]) {
|
|
398
399
|
for (const func of panel.__events[event]) {
|
|
@@ -22,3 +22,22 @@ export function setPanelsPathType(settings: any) {
|
|
|
22
22
|
export function setRootPanelList(rootPanelList: any) {
|
|
23
23
|
PanelsSettings.rootPanelList = rootPanelList;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
export function emitGlobalEvent(eventName: string, data: any) {
|
|
27
|
+
const event = new CustomEvent(`panel:${eventName}`, { detail: data });
|
|
28
|
+
window.dispatchEvent(event);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function onGlobalEvent(eventName: string|string[], callback: (event: CustomEvent) => void) {
|
|
32
|
+
const eventNames = Array.isArray(eventName) ? eventName : [eventName];
|
|
33
|
+
for (const name of eventNames) {
|
|
34
|
+
window.addEventListener(`panel:${name}`, callback);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function offGlobalEvent(eventName: string|string[], callback: (event: CustomEvent) => void) {
|
|
39
|
+
const eventNames = Array.isArray(eventName) ? eventName : [eventName];
|
|
40
|
+
for (const name of eventNames) {
|
|
41
|
+
window.removeEventListener(`panel:${name}`, callback);
|
|
42
|
+
}
|
|
43
|
+
}
|