@omegagrid/bucket 0.6.100 → 0.6.101
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/options.d.ts +3 -3
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/componentHost.d.ts +3 -1
- package/dist/ui/componentHost.d.ts.map +1 -1
- package/dist/ui/componentHost.js +28 -11
- package/dist/ui/componentHost.js.map +1 -1
- package/package.json +5 -5
package/dist/options.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CommonOptions
|
|
2
|
-
import {
|
|
1
|
+
import { CommonOptions } from "@omegagrid/core";
|
|
2
|
+
import { PathResolver } from "./types";
|
|
3
3
|
export type AlertsOptions = {
|
|
4
4
|
maxItems: number;
|
|
5
5
|
timeout: number;
|
|
6
6
|
};
|
|
7
7
|
export type BucketOptions = {
|
|
8
8
|
alerts?: AlertsOptions;
|
|
9
|
-
pathResolver?:
|
|
9
|
+
pathResolver?: PathResolver;
|
|
10
10
|
} & CommonOptions;
|
|
11
11
|
export declare function initOptions(options?: Partial<BucketOptions>, origOptions?: BucketOptions): BucketOptions;
|
|
12
12
|
//# sourceMappingURL=options.d.ts.map
|
package/dist/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC5B,GAAG,aAAa,CAAA;AAUjB,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,WAAW,GAAE,aAAoB,GAAG,aAAa,CAO9G"}
|
package/dist/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAanE,MAAM,eAAe,GAAkB;IACtC,MAAM,EAAE;QACP,QAAQ,EAAE,CAAC;QACX,OAAO,EAAE,IAAI;KACb;CACD,CAAA;AAGD,MAAM,UAAU,WAAW,CAAC,OAAgC,EAAE,cAA6B,IAAI;IAC9F,OAAO;QACN,GAAG,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC;QAC1C,GAAG,eAAe;QAClB,GAAG,WAAW;QACd,GAAG,OAAO;KACV,CAAC;AACH,CAAC","sourcesContent":["import { initCommonOptions, CommonOptions } from \"@omegagrid/core\";\nimport { PathResolver } from \"./types\";\n\nexport type AlertsOptions = {\n\tmaxItems: number,\n\ttimeout: number,\n}\n\nexport type BucketOptions = {\n\talerts?: AlertsOptions,\n\tpathResolver?: PathResolver,\n} & CommonOptions\n\nconst DEFAULT_OPTIONS: BucketOptions = {\n\talerts: {\n\t\tmaxItems: 5,\n\t\ttimeout: 5000,\n\t},\n}\n\n\nexport function initOptions(options?: Partial<BucketOptions>, origOptions: BucketOptions = null): BucketOptions {\n\treturn {\n\t\t...initCommonOptions(options, origOptions),\n\t\t...DEFAULT_OPTIONS,\n\t\t...origOptions,\n\t\t...options,\n\t};\n}"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type PathSegment = {
|
|
|
35
35
|
clickable?: boolean;
|
|
36
36
|
};
|
|
37
37
|
export type PathSegments = (PathSegment | string)[];
|
|
38
|
+
export type PathResolver = (id: ComponentId) => PathSegments | Promise<PathSegments>;
|
|
38
39
|
export type ComponentUpdateOptions = {
|
|
39
40
|
id?: ComponentId;
|
|
40
41
|
title?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAI;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,YAAY,EAAE,CAAC;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AM,MAAM,eAAe,GAAG,QAAQ,GAAC,SAAS,GAAC,MAAM,GAAC,SAAS,CAAC;AAElE,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,CAAC,EAAE,MAAM,GAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,GAAC,QAAQ,CAAC;IACvB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Commands } from \"@omegagrid/commands\";\nimport { ComponentId, ComponentState, HorizontalPosition, IconSpec } from \"@omegagrid/core\";\nimport { Dialog } from \"@omegagrid/dialog\";\nimport { TabItem, TabSplitContainerSource } from \"@omegagrid/tabs\";\nimport { CommonMenu } from \"./ui\";\nimport { DialogOptions } from \"@omegagrid/dialog\";\nimport { TemplateResult } from \"lit\";\nimport { BucketOptions } from \"./options\";\n\nexport type SidemenuItem = {\n\tid: string,\n\ticon: string,\n\tstatusIcon?: string,\n\tstatusColor?: string,\n\ttext?: string,\n\ttooltip?: string,\n\tcolor?: string\n}\n\nexport type SidemenuSettings = {\n\titems: SidemenuItem[];\n\tactiveIndex?: number;\n}\n\nexport type ModalSidebarOptions = {\n\tid?: ComponentId,\n\tcomponent?: HTMLElement,\n\twidth?: number,\n\tcaption?: string,\n\tclosable?: boolean,\n\tposition?: HorizontalPosition\n}\n\nexport type ComponentOptions = Record<string, unknown>;\n\nexport type PathSegment = {\n\tid: string,\n\tlabel?: string,\n\ticon?: string,\n\tclickable?: boolean,\n}\n\nexport type PathSegments = (PathSegment|string)[];\n\nexport type ComponentUpdateOptions = {\n\tid?: ComponentId,\n\ttitle?: string\n}\n\nexport type TopItem = {\n\tid: ComponentId\n}\n\nexport type TopSettings = {\n\trightItems: TopItem[]\n}\n\nexport type BucketSource = {\n\ttop?: TopSettings,\n\tsidemenu?: SidemenuSettings,\n\teditorLayout?: TabSplitContainerSource,\n\toptions?: BucketOptions,\n}\n\nexport type BucketMenuOptions = {\n\ttext?: string,\n\tcontent: CommonMenu|Commands\n}\n\nexport type BucketDialog = Dialog & {componentId: ComponentId};\n\nexport type BucketState = {\n\tsidebar?: {\n\t\tselectedItem?: ComponentId\n\t\twidth?: number,\n\t\tcollapsed?: boolean\n\t},\n\tlayout?: TabSplitContainerSource,\n\tdialogs?: OpenDialogOptions[],\n\tcomponents?: Record<ComponentId, ComponentState>\n}\n\nexport type OpenDialogOptions = DialogOptions & {id?: ComponentId}\n\nexport type OpenTabOptions = TabItem & {\n\t// path?: PathSegments,\n}\n\nexport type BucketAlertType = 'danger'|'warning'|'info'|'success';\n\nexport type BucketAlertOptions = {\n\ttitle?: string|TemplateResult<1>,\n\ticon?: string|IconSpec,\n\ttype?: BucketAlertType,\n\tcontent?: string|TemplateResult<1>,\n\ttimeout?: number\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Commands } from \"@omegagrid/commands\";\nimport { ComponentId, ComponentState, HorizontalPosition, IconSpec } from \"@omegagrid/core\";\nimport { Dialog } from \"@omegagrid/dialog\";\nimport { TabItem, TabSplitContainerSource } from \"@omegagrid/tabs\";\nimport { CommonMenu } from \"./ui\";\nimport { DialogOptions } from \"@omegagrid/dialog\";\nimport { TemplateResult } from \"lit\";\nimport { BucketOptions } from \"./options\";\n\nexport type SidemenuItem = {\n\tid: string,\n\ticon: string,\n\tstatusIcon?: string,\n\tstatusColor?: string,\n\ttext?: string,\n\ttooltip?: string,\n\tcolor?: string\n}\n\nexport type SidemenuSettings = {\n\titems: SidemenuItem[];\n\tactiveIndex?: number;\n}\n\nexport type ModalSidebarOptions = {\n\tid?: ComponentId,\n\tcomponent?: HTMLElement,\n\twidth?: number,\n\tcaption?: string,\n\tclosable?: boolean,\n\tposition?: HorizontalPosition\n}\n\nexport type ComponentOptions = Record<string, unknown>;\n\nexport type PathSegment = {\n\tid: string,\n\tlabel?: string,\n\ticon?: string,\n\tclickable?: boolean,\n}\n\nexport type PathSegments = (PathSegment|string)[];\n\nexport type PathResolver = (id: ComponentId) => PathSegments|Promise<PathSegments>;\n\nexport type ComponentUpdateOptions = {\n\tid?: ComponentId,\n\ttitle?: string\n}\n\nexport type TopItem = {\n\tid: ComponentId\n}\n\nexport type TopSettings = {\n\trightItems: TopItem[]\n}\n\nexport type BucketSource = {\n\ttop?: TopSettings,\n\tsidemenu?: SidemenuSettings,\n\teditorLayout?: TabSplitContainerSource,\n\toptions?: BucketOptions,\n}\n\nexport type BucketMenuOptions = {\n\ttext?: string,\n\tcontent: CommonMenu|Commands\n}\n\nexport type BucketDialog = Dialog & {componentId: ComponentId};\n\nexport type BucketState = {\n\tsidebar?: {\n\t\tselectedItem?: ComponentId\n\t\twidth?: number,\n\t\tcollapsed?: boolean\n\t},\n\tlayout?: TabSplitContainerSource,\n\tdialogs?: OpenDialogOptions[],\n\tcomponents?: Record<ComponentId, ComponentState>\n}\n\nexport type OpenDialogOptions = DialogOptions & {id?: ComponentId}\n\nexport type OpenTabOptions = TabItem & {\n\t// path?: PathSegments,\n}\n\nexport type BucketAlertType = 'danger'|'warning'|'info'|'success';\n\nexport type BucketAlertOptions = {\n\ttitle?: string|TemplateResult<1>,\n\ticon?: string|IconSpec,\n\ttype?: BucketAlertType,\n\tcontent?: string|TemplateResult<1>,\n\ttimeout?: number\n};\n"]}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { ComponentId, Layout, OmegaComponent } from '@omegagrid/core';
|
|
2
2
|
import { Bucket } from './bucket';
|
|
3
|
+
import { BucketPath } from './path';
|
|
3
4
|
export declare class ComponentHost extends OmegaComponent implements Layout {
|
|
4
5
|
static styles: import("lit").CSSResultGroup[];
|
|
5
6
|
bucket: Bucket;
|
|
6
7
|
componentId: ComponentId;
|
|
8
|
+
head: HTMLDivElement;
|
|
7
9
|
body: HTMLDivElement;
|
|
10
|
+
path: BucketPath;
|
|
8
11
|
private component;
|
|
9
12
|
private isEdited;
|
|
10
13
|
layout(): void;
|
|
11
14
|
_onEdit: () => void;
|
|
12
15
|
_onSave: () => void;
|
|
13
16
|
updated(props: Map<PropertyKey, unknown>): Promise<void>;
|
|
14
|
-
get path(): import("..").PathSegments;
|
|
15
17
|
render: () => import("lit-html").TemplateResult<1>;
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=componentHost.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentHost.d.ts","sourceRoot":"","sources":["../../src/ui/componentHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAO,MAAM,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBACa,aAAc,SAAQ,cAAe,YAAW,MAAM;IAElE,MAAM,CAAC,MAAM,iCAgBV;IAGH,MAAM,EAAE,MAAM,CAAC;IAGf,WAAW,EAAE,WAAW,CAAC;IAGzB,IAAI,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"componentHost.d.ts","sourceRoot":"","sources":["../../src/ui/componentHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAO,MAAM,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,qBACa,aAAc,SAAQ,cAAe,YAAW,MAAM;IAElE,MAAM,CAAC,MAAM,iCAgBV;IAGH,MAAM,EAAE,MAAM,CAAC;IAGf,WAAW,EAAE,WAAW,CAAC;IAGzB,IAAI,EAAE,cAAc,CAAC;IAGrB,IAAI,EAAE,cAAc,CAAC;IAGrB,IAAI,EAAE,UAAU,CAAC;IAEjB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,QAAQ,CAAS;IAEzB,MAAM;IAMN,OAAO,aAQN;IAED,OAAO,aAQN;IAEK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAiC9C,MAAM,6CAKJ;CAEF"}
|
package/dist/ui/componentHost.js
CHANGED
|
@@ -34,12 +34,9 @@ let ComponentHost = class ComponentHost extends OmegaComponent {
|
|
|
34
34
|
this.bucket.components.unsavedComponents.delete(this.componentId);
|
|
35
35
|
};
|
|
36
36
|
this.render = () => html `
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
</og-bucket-path>
|
|
41
|
-
</div>
|
|
42
|
-
` : ''}
|
|
37
|
+
<div class="head" style="display: none">
|
|
38
|
+
<og-bucket-path></og-bucket-path>
|
|
39
|
+
</div>
|
|
43
40
|
<div class="body"></div>
|
|
44
41
|
`;
|
|
45
42
|
}
|
|
@@ -51,6 +48,8 @@ let ComponentHost = class ComponentHost extends OmegaComponent {
|
|
|
51
48
|
async updated(props) {
|
|
52
49
|
if (props.has('componentId') && this.componentId) {
|
|
53
50
|
this.component = await this.bucket.components.get(this.componentId);
|
|
51
|
+
}
|
|
52
|
+
if (this.component) {
|
|
54
53
|
dom.empty(this.body);
|
|
55
54
|
this.body.appendChild(this.component);
|
|
56
55
|
this.component.removeEventListener('edit', this._onEdit);
|
|
@@ -58,11 +57,23 @@ let ComponentHost = class ComponentHost extends OmegaComponent {
|
|
|
58
57
|
this.component.removeEventListener('save', this._onSave);
|
|
59
58
|
this.component.addEventListener('save', this._onSave);
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
if (props.has('componentId') && this.componentId) {
|
|
61
|
+
let path = [];
|
|
62
|
+
if (this.bucket.options.pathResolver) {
|
|
63
|
+
path = await this.bucket.options.pathResolver(this.componentId);
|
|
64
|
+
this.path.path = path;
|
|
65
|
+
const show = path.length > 0;
|
|
66
|
+
if (!dom.isHidden(this.head) != show) {
|
|
67
|
+
if (show) {
|
|
68
|
+
dom.showElement(this.head);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
dom.hideElement(this.head);
|
|
72
|
+
}
|
|
73
|
+
this.layout();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
66
77
|
}
|
|
67
78
|
};
|
|
68
79
|
ComponentHost.styles = [OmegaComponent.styles, css `
|
|
@@ -88,9 +99,15 @@ __decorate([
|
|
|
88
99
|
__decorate([
|
|
89
100
|
property({ type: String })
|
|
90
101
|
], ComponentHost.prototype, "componentId", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
query('.head')
|
|
104
|
+
], ComponentHost.prototype, "head", void 0);
|
|
91
105
|
__decorate([
|
|
92
106
|
query('.body')
|
|
93
107
|
], ComponentHost.prototype, "body", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
query('og-bucket-path')
|
|
110
|
+
], ComponentHost.prototype, "path", void 0);
|
|
94
111
|
ComponentHost = __decorate([
|
|
95
112
|
customElement('og-bucket-component-host')
|
|
96
113
|
], ComponentHost);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentHost.js","sourceRoot":"","sources":["../../src/ui/componentHost.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAe,GAAG,EAAU,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"componentHost.js","sourceRoot":"","sources":["../../src/ui/componentHost.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAA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AAE,CAAC;gBACtC,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAEhE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAoB,CAAC;gBACtC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC7B,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;oBACtC,IAAI,IAAI,EAAE,CAAC;wBACV,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC;yBAAM,CAAC;wBACP,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC;oBACD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACf,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;;AA7FM,oBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;;;;;;;;;;;EAgB1C,CAAC,AAhBW,CAgBV;AAGH;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACV;AAGf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACA;AAGzB;IADC,KAAK,CAAC,OAAO,CAAC;2CACM;AAGrB;IADC,KAAK,CAAC,OAAO,CAAC;2CACM;AAGrB;IADC,KAAK,CAAC,gBAAgB,CAAC;2CACP;AAjCL,aAAa;IADzB,aAAa,CAAC,0BAA0B,CAAC;GAC7B,aAAa,CAwGzB","sourcesContent":["import { ComponentId, dom, Layout, OmegaComponent } from '@omegagrid/core';\nimport { css, html } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { Bucket } from './bucket';\nimport { PathSegments } from '../types';\nimport { BucketPath } from './path';\n\n@customElement('og-bucket-component-host')\nexport class ComponentHost extends OmegaComponent implements Layout {\n\n\tstatic styles = [OmegaComponent.styles, css`\n\t\t:host {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\n\t\t.head {\n\t\t\tflex: 0 0 15px;\n\t\t\tline-height: 15px;\n\t\t}\n\n\t\t.body {\n\t\t\theight: 100%;\n\t\t\tflex: 1;\n\t\t}\n\t`];\n\n\t@property({type: Object})\n\tbucket: Bucket;\n\n\t@property({type: String})\n\tcomponentId: ComponentId;\n\n\t@query('.head')\n\thead: HTMLDivElement;\n\t\n\t@query('.body')\n\tbody: HTMLDivElement;\n\n\t@query('og-bucket-path')\n\tpath: BucketPath;\n\t\n\tprivate component: HTMLElement;\n\tprivate isEdited = false;\n\t\n\tlayout() {\n\t\tif ((this.component as Layout)?.layout) {\n\t\t\t(this.component as Layout).layout();\n\t\t}\n\t}\n\n\t_onEdit = () => {\t\n\t\tif (this.isEdited) return;\n\t\tthis.bucket.editorContainer.model.walk(tab => {\n\t\t\tif (tab.id == this.componentId) tab.unsaved = true;\n\t\t});\n\t\tthis.isEdited = true;\n\t\tthis.bucket.editorContainer.updateTabs();\n\t\tthis.bucket.components.unsavedComponents.add(this.componentId);\n\t}\n\n\t_onSave = () => {\n\t\tif (!this.isEdited) return;\n\t\tthis.bucket.editorContainer.model.walk(tab => {\n\t\t\tif (tab.id == this.componentId) tab.unsaved = false;\n\t\t});\n\t\tthis.isEdited = false;\n\t\tthis.bucket.editorContainer.updateTabs();\n\t\tthis.bucket.components.unsavedComponents.delete(this.componentId);\n\t}\n\n\tasync updated(props: Map<PropertyKey, unknown>) {\n\t\tif (props.has('componentId') && this.componentId) {\n\t\t\tthis.component = await this.bucket.components.get(this.componentId);\n\t\t}\n\n\t\tif (this.component) {\n\t\t\tdom.empty(this.body);\n\t\t\tthis.body.appendChild(this.component);\n\t\t\tthis.component.removeEventListener('edit', this._onEdit);\n\t\t\tthis.component.addEventListener('edit', this._onEdit);\n\t\t\tthis.component.removeEventListener('save', this._onSave);\n\t\t\tthis.component.addEventListener('save', this._onSave);\n\t\t}\n\n\t\tif (props.has('componentId') && this.componentId) {\n\t\t\tlet path: PathSegments = [];\n\t\t\tif (this.bucket.options.pathResolver) {\n\t\t\t\tpath = await this.bucket.options.pathResolver(this.componentId);\n\n\t\t\t\tthis.path.path = path as PathSegments;\n\t\t\t\tconst show = path.length > 0;\n\t\t\t\tif (!dom.isHidden(this.head) != show) {\n\t\t\t\t\tif (show) {\n\t\t\t\t\t\tdom.showElement(this.head);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdom.hideElement(this.head);\n\t\t\t\t\t}\n\t\t\t\t\tthis.layout();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t<div class=\"head\" style=\"display: none\">\n\t\t\t<og-bucket-path></og-bucket-path>\n\t\t</div>\n\t\t<div class=\"body\"></div>\n\t`;\n\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/bucket",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.101",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Application layout component",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
|
31
|
-
"@omegagrid/commands": "^0.6.
|
|
32
|
-
"@omegagrid/core": "^0.6.
|
|
33
|
-
"@omegagrid/dialog": "^0.6.
|
|
34
|
-
"@omegagrid/tabs": "^0.6.
|
|
31
|
+
"@omegagrid/commands": "^0.6.101",
|
|
32
|
+
"@omegagrid/core": "^0.6.101",
|
|
33
|
+
"@omegagrid/dialog": "^0.6.101",
|
|
34
|
+
"@omegagrid/tabs": "^0.6.101",
|
|
35
35
|
"@riovir/wc-fontawesome": "^0.1.9",
|
|
36
36
|
"lit": "^3.1.1",
|
|
37
37
|
"ts-debounce": "^4.0.0"
|