@octostar/platform-api 0.0.6-alpha.0 → 0.1.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/platform-api.d.ts +124 -9
- package/lib/apis.d.ts +4 -3
- package/lib/apis.d.ts.map +1 -1
- package/lib/apis.js +12 -8
- package/lib/apis.js.map +1 -1
- package/lib/components/AbstractContextMenu.d.ts +16 -0
- package/lib/components/AbstractContextMenu.d.ts.map +1 -0
- package/lib/components/AbstractContextMenu.js +70 -0
- package/lib/components/AbstractContextMenu.js.map +1 -0
- package/lib/components/OsContextMenu.d.ts +8 -0
- package/lib/components/OsContextMenu.d.ts.map +1 -0
- package/lib/components/OsContextMenu.js +17 -0
- package/lib/components/OsContextMenu.js.map +1 -0
- package/lib/components/OsIcon.d.ts +15 -0
- package/lib/components/OsIcon.d.ts.map +1 -0
- package/lib/components/OsIcon.js +79 -0
- package/lib/components/OsIcon.js.map +1 -0
- package/lib/components/OsRecordTitle.d.ts +18 -0
- package/lib/components/OsRecordTitle.d.ts.map +1 -0
- package/lib/components/OsRecordTitle.js +97 -0
- package/lib/components/OsRecordTitle.js.map +1 -0
- package/lib/components/OsSpinner.d.ts +10 -0
- package/lib/components/OsSpinner.d.ts.map +1 -0
- package/lib/components/OsSpinner.js +59 -0
- package/lib/components/OsSpinner.js.map +1 -0
- package/lib/components/OsTag.d.ts +12 -0
- package/lib/components/OsTag.d.ts.map +1 -0
- package/lib/components/OsTag.js +60 -0
- package/lib/components/OsTag.js.map +1 -0
- package/lib/components/OsTags.d.ts +18 -0
- package/lib/components/OsTags.d.ts.map +1 -0
- package/lib/components/OsTags.js +95 -0
- package/lib/components/OsTags.js.map +1 -0
- package/lib/components/OsTagsContextMenu.d.ts +13 -0
- package/lib/components/OsTagsContextMenu.d.ts.map +1 -0
- package/lib/components/OsTagsContextMenu.js +57 -0
- package/lib/components/OsTagsContextMenu.js.map +1 -0
- package/lib/components/TagsDots.d.ts +10 -0
- package/lib/components/TagsDots.d.ts.map +1 -0
- package/lib/components/TagsDots.js +81 -0
- package/lib/components/TagsDots.js.map +1 -0
- package/lib/components/index.d.ts +13 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +13 -0
- package/lib/components/index.js.map +1 -0
- package/lib/constants.d.ts +1 -1
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +0 -2
- package/lib/constants.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +4 -3
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +7 -4
package/dist/platform-api.d.ts
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
|
+
import { Concept } from '@octostar/platform-types';
|
|
2
|
+
import { ContextMenuRequest } from '@octostar/platform-types';
|
|
1
3
|
import { Desktop } from '@octostar/platform-types';
|
|
2
|
-
import {
|
|
4
|
+
import { Entity } from '@octostar/platform-types';
|
|
3
5
|
import { Ontology } from '@octostar/platform-types';
|
|
4
|
-
import {
|
|
6
|
+
import { TagWithRelationship } from '@octostar/platform-types';
|
|
7
|
+
import { WorkspaceItem } from '@octostar/platform-types';
|
|
8
|
+
|
|
9
|
+
export declare abstract class AbstractContextMenu extends HTMLElement {
|
|
10
|
+
trigger: string[];
|
|
11
|
+
private desktop;
|
|
12
|
+
constructor();
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private updateProperties;
|
|
16
|
+
private handleRightClick;
|
|
17
|
+
private onMouseEnter;
|
|
18
|
+
private handleClick;
|
|
19
|
+
protected abstract getContext(): Partial<ContextMenuRequest>;
|
|
20
|
+
private publishMouseEvent;
|
|
21
|
+
private publishRequest;
|
|
22
|
+
}
|
|
5
23
|
|
|
6
24
|
export declare const ALL_PERMISSIONS = "all";
|
|
7
25
|
|
|
8
|
-
export declare const apiNames: Record<"desktop", "octostar:api-names:desktop"> & Record<"ontology", "octostar:api-names:ontology"> & Record<"context", "octostar:api-names:context"
|
|
26
|
+
export declare const apiNames: Record<"desktop", "octostar:api-names:desktop"> & Record<"ontology", "octostar:api-names:ontology"> & Record<"context", "octostar:api-names:context">;
|
|
9
27
|
|
|
10
28
|
declare type BasePostResponsePayload<D, E> = {
|
|
11
29
|
data: D;
|
|
@@ -13,13 +31,15 @@ declare type BasePostResponsePayload<D, E> = {
|
|
|
13
31
|
};
|
|
14
32
|
|
|
15
33
|
export declare type ContextApi<T> = {
|
|
16
|
-
getContext: () => T
|
|
17
|
-
subscribeToChanges: (id: string
|
|
18
|
-
unsubscribeFromChanges: (id: string) => void
|
|
34
|
+
getContext: () => Promise<T>;
|
|
35
|
+
subscribeToChanges: (id: string | ContextListener<T>, callback?: ContextListener<T>) => Promise<void>;
|
|
36
|
+
unsubscribeFromChanges: (id: string) => Promise<void>;
|
|
19
37
|
};
|
|
20
38
|
|
|
21
39
|
export declare const contextApi: () => EnsureMethodsReturnPromise<ContextApi<unknown>>;
|
|
22
40
|
|
|
41
|
+
export declare type ContextListener<T> = (context: T) => void;
|
|
42
|
+
|
|
23
43
|
declare type CreateMessageNamesResult<N, M> = M extends readonly [infer F, ...infer R] ? Record<F & string, MessageValue<N, F>> & CreateMessageNamesResult<N, R> : {};
|
|
24
44
|
|
|
25
45
|
export declare const createPrefixesConstants: <N extends string, M extends readonly [string, ...string[]]>(namespace: N, messages: M) => CreateMessageNamesResult<N, M>;
|
|
@@ -37,7 +57,11 @@ export declare type ErrorPostResponsePayload = BasePostResponsePayload<null, {
|
|
|
37
57
|
message: string;
|
|
38
58
|
}>;
|
|
39
59
|
|
|
40
|
-
export declare const
|
|
60
|
+
export declare const getContextApi: () => Promise<EnsureMethodsReturnPromise<ContextApi<unknown>>>;
|
|
61
|
+
|
|
62
|
+
export declare const getDesktopApi: () => Promise<EnsureMethodsReturnPromise<Desktop>>;
|
|
63
|
+
|
|
64
|
+
export declare const getOntologyApi: () => Promise<EnsureMethodsReturnPromise<Ontology>>;
|
|
41
65
|
|
|
42
66
|
export declare type GetRemoteApiParams = {
|
|
43
67
|
name: string;
|
|
@@ -49,6 +73,90 @@ export declare const ONTOLOGY_PERMISSION_GROUP = "octostar:ontology:";
|
|
|
49
73
|
|
|
50
74
|
export declare const ontologyApi: () => EnsureMethodsReturnPromise<Ontology>;
|
|
51
75
|
|
|
76
|
+
export declare class OsContextMenu extends AbstractContextMenu {
|
|
77
|
+
private innerContext;
|
|
78
|
+
set context(value: Partial<ContextMenuRequest>);
|
|
79
|
+
protected getContext(): Partial<ContextMenuRequest>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare class OsIcon extends HTMLElement {
|
|
83
|
+
private root;
|
|
84
|
+
private whatFor;
|
|
85
|
+
private desktop;
|
|
86
|
+
private loadedFontAwesome;
|
|
87
|
+
constructor();
|
|
88
|
+
static get observedAttributes(): string[];
|
|
89
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
90
|
+
connectedCallback(): void;
|
|
91
|
+
loadFontAwesomeIfNeeded(): void;
|
|
92
|
+
set for(value: Entity | Concept | string);
|
|
93
|
+
render(): Promise<void>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare class OsRecordTitle extends HTMLElement {
|
|
97
|
+
private root;
|
|
98
|
+
record: Entity | WorkspaceItem;
|
|
99
|
+
iconComponent: OsIcon;
|
|
100
|
+
labelElement: any;
|
|
101
|
+
tagsComponent: OsTags;
|
|
102
|
+
elipsisButton: any;
|
|
103
|
+
constructor();
|
|
104
|
+
connectedCallback(): void;
|
|
105
|
+
set recordData(value: any);
|
|
106
|
+
get recordData(): any;
|
|
107
|
+
static get observedAttributes(): string[];
|
|
108
|
+
render(): Promise<void>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare class OsSpinner extends HTMLElement {
|
|
112
|
+
root: ShadowRoot;
|
|
113
|
+
position: string;
|
|
114
|
+
image: string;
|
|
115
|
+
constructor();
|
|
116
|
+
static get observedAttributes(): string[];
|
|
117
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
118
|
+
render(): void;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export declare class OsTag extends HTMLElement {
|
|
122
|
+
root: ShadowRoot;
|
|
123
|
+
tag: TagWithRelationship | undefined;
|
|
124
|
+
constructor();
|
|
125
|
+
static get observedAttributes(): string[];
|
|
126
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
127
|
+
connectedCallback(): void;
|
|
128
|
+
set OsTag(value: TagWithRelationship);
|
|
129
|
+
render(): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export declare class OsTags extends HTMLElement {
|
|
133
|
+
private root;
|
|
134
|
+
private record;
|
|
135
|
+
private desktop;
|
|
136
|
+
private mode;
|
|
137
|
+
constructor();
|
|
138
|
+
static get observedAttributes(): string[];
|
|
139
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
140
|
+
loadTags(): Promise<TagWithRelationship[]>;
|
|
141
|
+
connectedCallback(): void;
|
|
142
|
+
set recordData(value: Entity);
|
|
143
|
+
get recordData(): Entity | undefined;
|
|
144
|
+
set dotsMode(visible: string);
|
|
145
|
+
get dotsMode(): string;
|
|
146
|
+
render(): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export declare class OsTagsContextMenu extends AbstractContextMenu {
|
|
150
|
+
private entity;
|
|
151
|
+
static get observedAttributes(): string[];
|
|
152
|
+
connectedCallback(): void;
|
|
153
|
+
attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
|
|
154
|
+
set record(entity: Entity);
|
|
155
|
+
protected getContext(): Partial<ContextMenuRequest>;
|
|
156
|
+
private render;
|
|
157
|
+
private update;
|
|
158
|
+
}
|
|
159
|
+
|
|
52
160
|
export declare const postMessageNames: Record<"get_api", "octostar:post-messages:get_api">;
|
|
53
161
|
|
|
54
162
|
export declare type PostRequest<T extends object> = {
|
|
@@ -71,8 +179,6 @@ export declare type RemoteApiError = Error & {
|
|
|
71
179
|
originalError: Error;
|
|
72
180
|
};
|
|
73
181
|
|
|
74
|
-
export declare const remoteAppApi: () => EnsureMethodsReturnPromise<RemoteAppApi>;
|
|
75
|
-
|
|
76
182
|
export declare const retry: <T>(fn: (...args: any) => T | Promise<T>, options?: RetryOptions) => Promise<T>;
|
|
77
183
|
|
|
78
184
|
declare type RetryOptions = {
|
|
@@ -82,4 +188,13 @@ declare type RetryOptions = {
|
|
|
82
188
|
|
|
83
189
|
export declare type SuccessPostResponsePayload<T> = BasePostResponsePayload<T, null>;
|
|
84
190
|
|
|
191
|
+
export declare class TagDots extends HTMLElement {
|
|
192
|
+
tags: TagWithRelationship[] | undefined;
|
|
193
|
+
private root;
|
|
194
|
+
constructor();
|
|
195
|
+
set tagsData(value: TagWithRelationship[]);
|
|
196
|
+
get tagsData(): TagWithRelationship[];
|
|
197
|
+
render(): Promise<void>;
|
|
198
|
+
}
|
|
199
|
+
|
|
85
200
|
export { }
|
package/lib/apis.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Desktop, Ontology
|
|
1
|
+
import { Desktop, Ontology } from '@octostar/platform-types';
|
|
2
2
|
import { ContextApi, EnsureMethodsReturnPromise } from './types';
|
|
3
3
|
export declare const desktopApi: () => EnsureMethodsReturnPromise<Desktop>;
|
|
4
4
|
export declare const ontologyApi: () => EnsureMethodsReturnPromise<Ontology>;
|
|
5
5
|
export declare const contextApi: () => EnsureMethodsReturnPromise<ContextApi<unknown>>;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const getDesktopApi: () => Promise<EnsureMethodsReturnPromise<Desktop>>;
|
|
7
|
+
export declare const getOntologyApi: () => Promise<EnsureMethodsReturnPromise<Ontology>>;
|
|
8
|
+
export declare const getContextApi: () => Promise<EnsureMethodsReturnPromise<ContextApi<unknown>>>;
|
|
8
9
|
//# sourceMappingURL=apis.d.ts.map
|
package/lib/apis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAuBjE,eAAO,MAAM,UAAU,2CACwC,CAAC;AAEhE,eAAO,MAAM,WAAW,4CACwC,CAAC;AAEjE,eAAO,MAAM,UAAU,uDACwC,CAAC;AAEhE,eAAO,MAAM,aAAa,oDACoB,CAAC;AAE/C,eAAO,MAAM,cAAc,qDACqB,CAAC;AAEjD,eAAO,MAAM,aAAa,gEACoB,CAAC"}
|
package/lib/apis.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { AsyncServiceLocator } from './lib/AsyncServiceLocator';
|
|
2
11
|
import { forwardCallsToFutureObject, createRemoteApiHandle } from './factory';
|
|
3
12
|
import { apiNames } from './constants';
|
|
@@ -14,16 +23,11 @@ const apisLocator = AsyncServiceLocator.getInstance('platform-api', {
|
|
|
14
23
|
// TODO: clarify about the context type
|
|
15
24
|
createRemoteApiHandle({
|
|
16
25
|
name: apiNames.context,
|
|
17
|
-
}))
|
|
18
|
-
.registerService('extras', () => createRemoteApiHandle({
|
|
19
|
-
name: apiNames.extras,
|
|
20
|
-
}))
|
|
21
|
-
.registerService('remoteApp', () => createRemoteApiHandle({
|
|
22
|
-
name: apiNames.remoteApp,
|
|
23
26
|
}));
|
|
24
27
|
export const desktopApi = () => forwardCallsToFutureObject(apisLocator.getService('desktop'));
|
|
25
28
|
export const ontologyApi = () => forwardCallsToFutureObject(apisLocator.getService('ontology'));
|
|
26
29
|
export const contextApi = () => forwardCallsToFutureObject(apisLocator.getService('context'));
|
|
27
|
-
export const
|
|
28
|
-
export const
|
|
30
|
+
export const getDesktopApi = () => __awaiter(void 0, void 0, void 0, function* () { return apisLocator.getService('desktop'); });
|
|
31
|
+
export const getOntologyApi = () => __awaiter(void 0, void 0, void 0, function* () { return apisLocator.getService('ontology'); });
|
|
32
|
+
export const getContextApi = () => __awaiter(void 0, void 0, void 0, function* () { return apisLocator.getService('context'); });
|
|
29
33
|
//# sourceMappingURL=apis.js.map
|
package/lib/apis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apis.js","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,GAAG,mBAAmB,CAAC,WAAW,CAAC,cAAc,EAAE;IAClE,KAAK,EAAE,KAAK;CACb,CAAC;KACC,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE,CAC/B,qBAAqB,CAAsC;IACzD,IAAI,EAAE,QAAQ,CAAC,OAAO;CACvB,CAAC,CACH;KACA,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,CAChC,qBAAqB,CAAuC;IAC1D,IAAI,EAAE,QAAQ,CAAC,QAAQ;CACxB,CAAC,CACH;KACA,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE;AAC/B,uCAAuC;AACvC,qBAAqB,CAAkD;IACrE,IAAI,EAAE,QAAQ,CAAC,OAAO;CACvB,CAAC,CACH,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,0BAA0B,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAC9B,0BAA0B,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;AAEjE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAC7B,0BAA0B,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAS,EAAE,kDACtC,OAAA,WAAW,CAAC,UAAU,CAAY,SAAS,CAAC,CAAA,GAAA,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,GAAS,EAAE,kDACvC,OAAA,WAAW,CAAC,UAAU,CAAa,UAAU,CAAC,CAAA,GAAA,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAS,EAAE,kDACtC,OAAA,WAAW,CAAC,UAAU,CAAY,SAAS,CAAC,CAAA,GAAA,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContextMenuRequest } from '@octostar/platform-types';
|
|
2
|
+
export declare abstract class AbstractContextMenu extends HTMLElement {
|
|
3
|
+
trigger: string[];
|
|
4
|
+
private desktop;
|
|
5
|
+
constructor();
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
private updateProperties;
|
|
9
|
+
private handleRightClick;
|
|
10
|
+
private onMouseEnter;
|
|
11
|
+
private handleClick;
|
|
12
|
+
protected abstract getContext(): Partial<ContextMenuRequest>;
|
|
13
|
+
private publishMouseEvent;
|
|
14
|
+
private publishRequest;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AbstractContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/AbstractContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAW,MAAM,0BAA0B,CAAC;AAGvE,8BAAsB,mBAAoB,SAAQ,WAAW;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAmB;IAEpC,OAAO,CAAC,OAAO,CAAsB;;IAuBrC,iBAAiB,IAAI,IAAI;IAIzB,oBAAoB,IAAI,IAAI;IAM5B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,WAAW;IAQnB,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAE5D,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,cAAc;CAGvB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { desktopApi } from '../apis';
|
|
2
|
+
export class AbstractContextMenu extends HTMLElement {
|
|
3
|
+
constructor() {
|
|
4
|
+
super();
|
|
5
|
+
this.trigger = ['contextMenu'];
|
|
6
|
+
this.attachShadow({ mode: 'open' });
|
|
7
|
+
this.shadowRoot.innerHTML = `
|
|
8
|
+
<style>
|
|
9
|
+
:host {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
width: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
<slot name='menu-slot'></slot>
|
|
18
|
+
`;
|
|
19
|
+
this.addEventListener('contextmenu', this.handleRightClick.bind(this));
|
|
20
|
+
this.addEventListener('mouseenter', this.onMouseEnter.bind(this));
|
|
21
|
+
this.addEventListener('click', this.handleClick.bind(this));
|
|
22
|
+
}
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
this.updateProperties();
|
|
25
|
+
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
this.removeEventListener('contextmenu', this.handleRightClick);
|
|
28
|
+
this.removeEventListener('mouseenter', this.onMouseEnter);
|
|
29
|
+
this.removeEventListener('click', this.handleClick);
|
|
30
|
+
}
|
|
31
|
+
updateProperties() {
|
|
32
|
+
if (this.hasAttribute('trigger')) {
|
|
33
|
+
this.trigger = this.getAttribute('trigger').split(',');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
handleRightClick(event) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
event.stopPropagation();
|
|
39
|
+
if (this.trigger.includes('contextMenu')) {
|
|
40
|
+
this.publishMouseEvent(event);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
onMouseEnter(event) {
|
|
44
|
+
if (this.trigger.includes('hover')) {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
this.publishMouseEvent(event);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
handleClick(event) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
if (this.trigger.includes('click')) {
|
|
53
|
+
this.publishMouseEvent(event);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
publishMouseEvent(event) {
|
|
57
|
+
const x = event.clientX;
|
|
58
|
+
const { y } = this.getBoundingClientRect();
|
|
59
|
+
const context = this.getContext();
|
|
60
|
+
if (context === null || context === void 0 ? void 0 : context.item) {
|
|
61
|
+
context.items = context.items || [context.item];
|
|
62
|
+
}
|
|
63
|
+
this.publishRequest(Object.assign(Object.assign({}, context), { x,
|
|
64
|
+
y }));
|
|
65
|
+
}
|
|
66
|
+
publishRequest(request) {
|
|
67
|
+
(this.desktop || desktopApi()).showContextMenu(request);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=AbstractContextMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractContextMenu.js","sourceRoot":"","sources":["../../src/components/AbstractContextMenu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,OAAgB,mBAAoB,SAAQ,WAAW;IAK3D;QACE,KAAK,EAAE,CAAC;QALV,YAAO,GAAa,CAAC,aAAa,CAAC,CAAC;QAMlC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,UAAW,CAAC,SAAS,GAAG;;;;;;;;;;;OAW1B,CAAC;QAEJ,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1D,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC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CAAC,cAAc,iCACd,OAAO,KACV,CAAC;YACD,CAAC,IACD,CAAC;IACL,CAAC;IAEO,cAAc,CAAC,OAA2B;QAChD,CAAC,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContextMenuRequest } from '@octostar/platform-types';
|
|
2
|
+
import { AbstractContextMenu } from './AbstractContextMenu';
|
|
3
|
+
export declare class OsContextMenu extends AbstractContextMenu {
|
|
4
|
+
private innerContext;
|
|
5
|
+
set context(value: Partial<ContextMenuRequest>);
|
|
6
|
+
protected getContext(): Partial<ContextMenuRequest>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=OsContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/OsContextMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,aAAc,SAAQ,mBAAmB;IACpD,OAAO,CAAC,YAAY,CAAmC;IAEvD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAE7C;IAED,SAAS,CAAC,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC;CAGpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AbstractContextMenu } from './AbstractContextMenu';
|
|
2
|
+
export class OsContextMenu extends AbstractContextMenu {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments);
|
|
5
|
+
this.innerContext = {};
|
|
6
|
+
}
|
|
7
|
+
set context(value) {
|
|
8
|
+
this.innerContext = value;
|
|
9
|
+
}
|
|
10
|
+
getContext() {
|
|
11
|
+
return this.innerContext;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (!customElements.get('os-context-menu')) {
|
|
15
|
+
customElements.define('os-context-menu', OsContextMenu);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=OsContextMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsContextMenu.js","sourceRoot":"","sources":["../../src/components/OsContextMenu.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,OAAO,aAAc,SAAQ,mBAAmB;IAAtD;;QACU,iBAAY,GAAgC,EAAE,CAAC;IASzD,CAAC;IAPC,IAAI,OAAO,CAAC,KAAkC;QAC5C,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;IAES,UAAU;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF;AACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;IAC1C,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Concept, Entity } from '@octostar/platform-types';
|
|
2
|
+
export declare class OsIcon extends HTMLElement {
|
|
3
|
+
private root;
|
|
4
|
+
private whatFor;
|
|
5
|
+
private desktop;
|
|
6
|
+
private loadedFontAwesome;
|
|
7
|
+
constructor();
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
loadFontAwesomeIfNeeded(): void;
|
|
12
|
+
set for(value: Entity | Concept | string);
|
|
13
|
+
render(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=OsIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsIcon.d.ts","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAW,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAKpE,qBAAa,MAAO,SAAQ,WAAW;IACrC,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO,CAAC,OAAO,CAAwC;IAEvD,OAAO,CAAC,OAAO,CAAsB;IAErC,OAAO,CAAC,iBAAiB,CAAS;;IAiBlC,MAAM,KAAK,kBAAkB,aAE5B;IAED,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAWnE,iBAAiB;IAMjB,uBAAuB;IAevB,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAEvC;IAEK,MAAM;CAab"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { desktopApi } from '../apis';
|
|
11
|
+
let fontAwesomeStylesLoaded = false;
|
|
12
|
+
export class OsIcon extends HTMLElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.loadedFontAwesome = false;
|
|
16
|
+
this.root = this.attachShadow({ mode: 'open' });
|
|
17
|
+
// Check if Font Awesome CSS is already loaded
|
|
18
|
+
if (!fontAwesomeStylesLoaded) {
|
|
19
|
+
fontAwesomeStylesLoaded = true;
|
|
20
|
+
['fontawesome', 'brands', 'solid'].forEach(style => {
|
|
21
|
+
const link = document.createElement('link');
|
|
22
|
+
link.href = `/static/assets/fontawesome/css/${style}.css`;
|
|
23
|
+
link.rel = 'stylesheet';
|
|
24
|
+
document.head.appendChild(link);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
static get observedAttributes() {
|
|
29
|
+
return ['for'];
|
|
30
|
+
}
|
|
31
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
32
|
+
if (name === 'for' && newValue !== oldValue) {
|
|
33
|
+
try {
|
|
34
|
+
this.whatFor = JSON.parse(newValue);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
this.whatFor = newValue;
|
|
38
|
+
}
|
|
39
|
+
this.render();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
connectedCallback() {
|
|
43
|
+
if (this.whatFor) {
|
|
44
|
+
this.render();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
loadFontAwesomeIfNeeded() {
|
|
48
|
+
// Check if Font Awesome is already loaded
|
|
49
|
+
if (this.loadedFontAwesome) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.loadedFontAwesome = true;
|
|
53
|
+
['fontawesome', 'brands', 'solid'].forEach(style => {
|
|
54
|
+
const link = document.createElement('link');
|
|
55
|
+
link.href = `/static/assets/fontawesome/css/${style}.css`;
|
|
56
|
+
link.rel = 'stylesheet';
|
|
57
|
+
this.root.appendChild(link);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
set for(value) {
|
|
61
|
+
this.whatFor = value;
|
|
62
|
+
}
|
|
63
|
+
render() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
if (!this.whatFor) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const html = yield (this.desktop || desktopApi()).internalGetIconCode(this.whatFor);
|
|
69
|
+
this.root.innerHTML = html;
|
|
70
|
+
if (/class="fa[srb]? /.test(html)) {
|
|
71
|
+
this.loadFontAwesomeIfNeeded();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (!customElements.get('os-icon')) {
|
|
77
|
+
customElements.define('os-icon', OsIcon);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=OsIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsIcon.js","sourceRoot":"","sources":["../../src/components/OsIcon.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,IAAI,uBAAuB,GAAG,KAAK,CAAC;AACpC,MAAM,OAAO,MAAO,SAAQ,WAAW;IASrC;QACE,KAAK,EAAE,CAAC;QAHF,sBAAiB,GAAG,KAAK,CAAC;QAIhC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,8CAA8C;QAC9C,IAAI,CAAC,uBAAuB,EAAE;YAC5B,uBAAuB,GAAG,IAAI,CAAC;YAC/B,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;gBAC5C,IAAI,CAAC,IAAI,GAAG,kCAAkC,KAAK,MAAM,CAAC;gBAC1D,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,wBAAwB,CAAC,IAAY,EAAE,QAAa,EAAE,QAAa;QACjE,IAAI,IAAI,KAAK,K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C,IAAI,CAAC,uBAAuB,EAAE,CAAC;aAChC;QACH,CAAC;KAAA;CACF;AAED,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;IAClC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAC1C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Entity, WorkspaceItem } from '@octostar/platform-types';
|
|
2
|
+
import { OsTags } from './OsTags';
|
|
3
|
+
import { OsIcon } from './OsIcon';
|
|
4
|
+
export declare class OsRecordTitle extends HTMLElement {
|
|
5
|
+
private root;
|
|
6
|
+
record: Entity | WorkspaceItem;
|
|
7
|
+
iconComponent: OsIcon;
|
|
8
|
+
labelElement: any;
|
|
9
|
+
tagsComponent: OsTags;
|
|
10
|
+
elipsisButton: any;
|
|
11
|
+
constructor();
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
set recordData(value: any);
|
|
14
|
+
get recordData(): any;
|
|
15
|
+
static get observedAttributes(): string[];
|
|
16
|
+
render(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=OsRecordTitle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsRecordTitle.d.ts","sourceRoot":"","sources":["../../src/components/OsRecordTitle.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EACN,aAAa,EACd,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,qBAAa,aAAc,SAAQ,WAAW;IAC5C,OAAO,CAAC,IAAI,CAAa;IAEzB,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAE/B,aAAa,EAAE,MAAM,CAAC;IAEtB,YAAY,EAAE,GAAG,CAAC;IAElB,aAAa,EAAE,MAAM,CAAC;IAEtB,aAAa,EAAE,GAAG,CAAC;;IAOnB,iBAAiB;IAMjB,IAAI,UAAU,CAAC,KAAK,EAAE,GAAG,EAGxB;IAED,IAAI,UAAU,IAAI,GAAG,CAEpB;IAED,MAAM,KAAK,kBAAkB,aAE5B;IAEK,MAAM;CA2Eb"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export class OsRecordTitle extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.root = this.attachShadow({ mode: 'open' });
|
|
14
|
+
}
|
|
15
|
+
connectedCallback() {
|
|
16
|
+
if (this.record) {
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
set recordData(value) {
|
|
21
|
+
this.record = value;
|
|
22
|
+
this.setAttribute('record', JSON.stringify(value));
|
|
23
|
+
}
|
|
24
|
+
get recordData() {
|
|
25
|
+
return this.record;
|
|
26
|
+
}
|
|
27
|
+
static get observedAttributes() {
|
|
28
|
+
return ['record', 'tags', 'contextmenu'];
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
console.log('oi', this.record);
|
|
33
|
+
if (!this.record) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.root.innerHTML = `<style>
|
|
37
|
+
:host {
|
|
38
|
+
width: 100%;
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 10px;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
}
|
|
44
|
+
:host(:hover) {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
background-color: #f7f7f7;
|
|
47
|
+
}
|
|
48
|
+
.group {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 5px;
|
|
52
|
+
}
|
|
53
|
+
.svg-hover:hover {
|
|
54
|
+
border-radius: 6px;
|
|
55
|
+
background-color: #e0e0e0;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
`;
|
|
59
|
+
const contextMenuTitle = document.createElement('os-context-menu');
|
|
60
|
+
contextMenuTitle.context = {
|
|
61
|
+
item: this.record,
|
|
62
|
+
};
|
|
63
|
+
const contextMenuSvg = document.createElement('os-context-menu');
|
|
64
|
+
contextMenuSvg.setAttribute('trigger', 'click');
|
|
65
|
+
contextMenuSvg.context = {
|
|
66
|
+
item: this.record,
|
|
67
|
+
};
|
|
68
|
+
const leftGroup = document.createElement('div');
|
|
69
|
+
leftGroup.className = 'group';
|
|
70
|
+
const rightGroup = document.createElement('div');
|
|
71
|
+
rightGroup.className = 'group';
|
|
72
|
+
const ellipsisSVG = document.createElement('span');
|
|
73
|
+
ellipsisSVG.className = 'svg-hover';
|
|
74
|
+
ellipsisSVG.innerHTML =
|
|
75
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-ellipsis"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>';
|
|
76
|
+
contextMenuSvg.appendChild(ellipsisSVG);
|
|
77
|
+
const icon = document.createElement('os-icon');
|
|
78
|
+
const label = document.createElement('p');
|
|
79
|
+
const tags = document.createElement('os-tags');
|
|
80
|
+
label.innerText = this.record.entity_label;
|
|
81
|
+
icon.for = this.record;
|
|
82
|
+
tags.recordData = this.record;
|
|
83
|
+
tags.setAttribute('mode', 'dots');
|
|
84
|
+
leftGroup.appendChild(icon);
|
|
85
|
+
leftGroup.appendChild(label);
|
|
86
|
+
rightGroup.appendChild(tags);
|
|
87
|
+
rightGroup.appendChild(contextMenuSvg);
|
|
88
|
+
contextMenuTitle.appendChild(leftGroup);
|
|
89
|
+
contextMenuTitle.appendChild(rightGroup);
|
|
90
|
+
this.root.appendChild(contextMenuTitle);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!customElements.get('os-record-title')) {
|
|
95
|
+
customElements.define('os-record-title', OsRecordTitle);
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=OsRecordTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsRecordTitle.js","sourceRoot":"","sources":["../../src/components/OsRecordTitle.ts"],"names":[],"mappings":";;;;;;;;;AAaA,MAAM,OAAO,aAAc,SAAQ,WAAW;IAa5C;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,EAAE,CAAC;SACf;IACH,CAAC;IAED,IAAI,UAAU,CAAC,KAAU;QACvB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,KAAK,kBAAkB;QAC3B,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;IAC3C,CAAC;I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C,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YAE3C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;YACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAgB,CAAC;YACxC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAElC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC5B,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAE7B,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC7B,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;YACvC,gBAAgB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YACxC,gBAAgB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAEzC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QAC1C,CAAC;KAAA;CACF;AACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;IAC1C,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;CACzD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class OsSpinner extends HTMLElement {
|
|
2
|
+
root: ShadowRoot;
|
|
3
|
+
position: string;
|
|
4
|
+
image: string;
|
|
5
|
+
constructor();
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: any, newValue: any): void;
|
|
8
|
+
render(): void;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=OsSpinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsSpinner.d.ts","sourceRoot":"","sources":["../../src/components/OsSpinner.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAU,SAAQ,WAAW;IACxC,IAAI,EAAE,UAAU,CAAC;IAEjB,QAAQ,SAAc;IAEtB,KAAK,SAAuC;;IAc5C,MAAM,KAAK,kBAAkB,aAE5B;IAED,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG;IAQnE,MAAM;CAqCP"}
|