@omegagrid/bucket 0.11.24 → 0.11.26
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/options.d.ts +12 -2
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +10 -4
- package/dist/options.js.map +1 -1
- package/dist/types.d.ts +19 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui/bucket.alerts.d.ts +29 -1
- package/dist/ui/bucket.alerts.d.ts.map +1 -1
- package/dist/ui/bucket.alerts.js +108 -7
- package/dist/ui/bucket.alerts.js.map +1 -1
- package/dist/ui/bucket.d.ts.map +1 -1
- package/dist/ui/bucket.js +1 -0
- package/dist/ui/bucket.js.map +1 -1
- package/dist/ui/bucketAlert.d.ts +6 -1
- package/dist/ui/bucketAlert.d.ts.map +1 -1
- package/dist/ui/bucketAlert.js +29 -0
- package/dist/ui/bucketAlert.js.map +1 -1
- package/dist/ui/bucketAlert.style.d.ts.map +1 -1
- package/dist/ui/bucketAlert.style.js +26 -2
- package/dist/ui/bucketAlert.style.js.map +1 -1
- package/dist/ui/sidemenu.d.ts +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC","sourcesContent":["export * from './ui';\nexport * from './types'
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC","sourcesContent":["export * from './ui';\nexport * from './types';\nexport * from './options';\n"]}
|
package/dist/options.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { CommonOptions } from "@omegagrid/core";
|
|
2
|
-
import { PathResolver } from "./types";
|
|
2
|
+
import { BucketAlertType, PathResolver } from "./types";
|
|
3
|
+
/** corner (or edge center) of the main content area where the alerts stack */
|
|
4
|
+
export type AlertsPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
5
|
export type AlertsOptions = {
|
|
6
|
+
/** maximum number of alerts shown at once, the oldest one is removed when exceeded, default `5` */
|
|
4
7
|
maxItems: number;
|
|
8
|
+
/** time (ms) after which an alert without an own `timeout` closes, `0` keeps it open, default `5000` */
|
|
5
9
|
timeout: number;
|
|
10
|
+
/** where the alerts stack, default `bottom-right` (see `AlertsPosition`) */
|
|
11
|
+
position?: AlertsPosition;
|
|
12
|
+
/** types of the alerts that never close by themselves (unless they set an own `timeout`), default `['danger']` */
|
|
13
|
+
persistentTypes?: BucketAlertType[];
|
|
14
|
+
/** number of the latest alerts kept in `bucket.alerts.history` (also the closed and expired ones), default `50` */
|
|
15
|
+
historySize?: number;
|
|
6
16
|
};
|
|
7
17
|
export type BucketOptions = {
|
|
8
|
-
alerts?: AlertsOptions
|
|
18
|
+
alerts?: Partial<AlertsOptions>;
|
|
9
19
|
componentMode?: 'tabbed' | 'single';
|
|
10
20
|
modalSidebarWidth?: number;
|
|
11
21
|
pathResolver?: PathResolver;
|
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,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
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,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGxD,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,CAAC;AAExH,MAAM,MAAM,aAAa,GAAG;IAC3B,mGAAmG;IACnG,QAAQ,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,kHAAkH;IAClH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IACpC,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,YAAY,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,iJAAiJ;IACjJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kKAAkK;IAClK,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,GAAG,aAAa,CAAA;AAsBjB,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,EAAE,WAAW,GAAE,aAAoB,GAAG,aAAa,CAS9G"}
|
package/dist/options.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { initCommonOptions } from "@omegagrid/core";
|
|
2
2
|
import constants from "./constants";
|
|
3
|
+
const DEFAULT_ALERTS_OPTIONS = {
|
|
4
|
+
maxItems: 5,
|
|
5
|
+
timeout: 5000,
|
|
6
|
+
position: 'bottom-right',
|
|
7
|
+
persistentTypes: ['danger'],
|
|
8
|
+
historySize: 50,
|
|
9
|
+
};
|
|
3
10
|
const DEFAULT_OPTIONS = {
|
|
4
|
-
alerts:
|
|
5
|
-
maxItems: 5,
|
|
6
|
-
timeout: 5000,
|
|
7
|
-
},
|
|
11
|
+
alerts: DEFAULT_ALERTS_OPTIONS,
|
|
8
12
|
pathPosition: 'top',
|
|
9
13
|
componentMode: 'tabbed',
|
|
10
14
|
sidebarPosition: 'left',
|
|
@@ -19,6 +23,8 @@ export function initOptions(options, origOptions = null) {
|
|
|
19
23
|
...DEFAULT_OPTIONS,
|
|
20
24
|
...origOptions,
|
|
21
25
|
...options,
|
|
26
|
+
// the alerts are a nested object: a partial override keeps the defaults of the other keys
|
|
27
|
+
alerts: { ...DEFAULT_ALERTS_OPTIONS, ...origOptions?.alerts, ...options?.alerts },
|
|
22
28
|
};
|
|
23
29
|
}
|
|
24
30
|
//# sourceMappingURL=options.js.map
|
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,EAAiB,MAAM,iBAAiB,CAAC;AAEnE,OAAO,SAAS,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAEnE,OAAO,SAAS,MAAM,aAAa,CAAC;AAiCpC,MAAM,sBAAsB,GAAkB;IAC7C,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,cAAc;IACxB,eAAe,EAAE,CAAC,QAAQ,CAAC;IAC3B,WAAW,EAAE,EAAE;CACf,CAAA;AAED,MAAM,eAAe,GAAkB;IACtC,MAAM,EAAE,sBAAsB;IAC9B,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,QAAQ;IACvB,eAAe,EAAE,MAAM;IACvB,iBAAiB,EAAE,SAAS,CAAC,aAAa;IAC1C,kBAAkB,EAAE,KAAK;IACzB,iBAAiB,EAAE,SAAS,CAAC,mBAAmB;IAChD,cAAc,EAAE,IAAI;CACpB,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;QACV,0FAA0F;QAC1F,MAAM,EAAE,EAAC,GAAG,sBAAsB,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAC;KAC/E,CAAC;AACH,CAAC","sourcesContent":["import { initCommonOptions, CommonOptions } from \"@omegagrid/core\";\nimport { BucketAlertType, PathResolver } from \"./types\";\nimport constants from \"./constants\";\n\n/** corner (or edge center) of the main content area where the alerts stack */\nexport type AlertsPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';\n\nexport type AlertsOptions = {\n\t/** maximum number of alerts shown at once, the oldest one is removed when exceeded, default `5` */\n\tmaxItems: number,\n\t/** time (ms) after which an alert without an own `timeout` closes, `0` keeps it open, default `5000` */\n\ttimeout: number,\n\t/** where the alerts stack, default `bottom-right` (see `AlertsPosition`) */\n\tposition?: AlertsPosition,\n\t/** types of the alerts that never close by themselves (unless they set an own `timeout`), default `['danger']` */\n\tpersistentTypes?: BucketAlertType[],\n\t/** number of the latest alerts kept in `bucket.alerts.history` (also the closed and expired ones), default `50` */\n\thistorySize?: number,\n}\n\nexport type BucketOptions = {\n\talerts?: Partial<AlertsOptions>,\n\tcomponentMode?: 'tabbed' | 'single',\n\tmodalSidebarWidth?: number,\n\tpathResolver?: PathResolver,\n\tpathPosition?: 'top' | 'bottom',\n\tsidebarPosition?: 'left' | 'right',\n\t/** allows the user to toggle the sidemenu between normal and wide mode (shows a toggle button at the bottom of the sidemenu), default `false` */\n\tsidemenuExpandable?: boolean,\n\t/** width of the sidemenu in wide mode (px), default `160` */\n\tsidemenuWideWidth?: number,\n\t/** shows a browser confirmation before the page is unloaded while the bucket contains unsaved components, default `true` (set `false` to suppress the warning) */\n\tunsavedWarning?: boolean,\n} & CommonOptions\n\nconst DEFAULT_ALERTS_OPTIONS: AlertsOptions = {\n\tmaxItems: 5,\n\ttimeout: 5000,\n\tposition: 'bottom-right',\n\tpersistentTypes: ['danger'],\n\thistorySize: 50,\n}\n\nconst DEFAULT_OPTIONS: BucketOptions = {\n\talerts: DEFAULT_ALERTS_OPTIONS,\n\tpathPosition: 'top',\n\tcomponentMode: 'tabbed',\n\tsidebarPosition: 'left',\n\tmodalSidebarWidth: constants.SIDEBAR_WIDTH,\n\tsidemenuExpandable: false,\n\tsidemenuWideWidth: constants.SIDEMENU_WIDE_WIDTH,\n\tunsavedWarning: true\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\t// the alerts are a nested object: a partial override keeps the defaults of the other keys\n\t\talerts: {...DEFAULT_ALERTS_OPTIONS, ...origOptions?.alerts, ...options?.alerts},\n\t};\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ComponentId, ComponentState, HorizontalPosition, IconSpec } from "@omegagrid/core";
|
|
1
|
+
import { ColorTypes, ComponentId, ComponentState, HorizontalPosition, IconSpec } from "@omegagrid/core";
|
|
2
2
|
import { Dialog } from "@omegagrid/dialog";
|
|
3
3
|
import { ContainerTabItem, TabSplitContainerSource } from "@omegagrid/tabs";
|
|
4
4
|
import { DialogOptions } from "@omegagrid/dialog";
|
|
5
5
|
import { TemplateResult } from "lit";
|
|
6
6
|
import { BucketOptions } from "./options";
|
|
7
|
+
import type { BucketAlert } from "./ui/bucketAlert";
|
|
7
8
|
/**
|
|
8
9
|
* layout of a bucket button
|
|
9
10
|
* - `vertical`: text below the icon (default)
|
|
@@ -95,11 +96,28 @@ export type OpenTabOptions = ContainerTabItem & {
|
|
|
95
96
|
component?: HTMLElement;
|
|
96
97
|
};
|
|
97
98
|
export type BucketAlertType = 'danger' | 'warning' | 'info' | 'success';
|
|
99
|
+
/** a button shown at the bottom of an alert: the user acts on the message right there (e.g. refresh, open, undo) */
|
|
100
|
+
export type BucketAlertAction = {
|
|
101
|
+
text: string;
|
|
102
|
+
icon?: string | IconSpec;
|
|
103
|
+
color?: ColorTypes;
|
|
104
|
+
exec: (alert: BucketAlert) => void | Promise<void>;
|
|
105
|
+
/** closes the alert after `exec`, default `true` */
|
|
106
|
+
close?: boolean;
|
|
107
|
+
};
|
|
98
108
|
export type BucketAlertOptions = {
|
|
99
109
|
title?: string | TemplateResult<1>;
|
|
100
110
|
icon?: string | IconSpec;
|
|
101
111
|
type?: BucketAlertType;
|
|
102
112
|
content?: string | TemplateResult<1>;
|
|
113
|
+
/** time (ms) after which the alert closes; `0` keeps it open; default by `AlertsOptions.timeout` and `persistentTypes` */
|
|
103
114
|
timeout?: number;
|
|
115
|
+
actions?: BucketAlertAction[];
|
|
116
|
+
};
|
|
117
|
+
/** an alert kept in `bucket.alerts.history` after it was shown */
|
|
118
|
+
export type BucketAlertHistoryItem = {
|
|
119
|
+
options: BucketAlertOptions;
|
|
120
|
+
/** when the alert was shown */
|
|
121
|
+
time: Date;
|
|
104
122
|
};
|
|
105
123
|
//# sourceMappingURL=types.d.ts.map
|
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,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAEzE,iCAAiC;AACjC,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7C,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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,GAAC,SAAS,GAAC,MAAM,GAAC,SAAS,CAAC;AAElE,oHAAoH;AACpH,MAAM,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAC,QAAQ,CAAC;IACvB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,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,0HAA0H;IAC1H,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC9B,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,sBAAsB,GAAG;IACpC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,+BAA+B;IAC/B,IAAI,EAAE,IAAI,CAAC;CACX,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentId, ComponentState, HorizontalPosition, IconSpec } from \"@omegagrid/core\";\nimport { Dialog } from \"@omegagrid/dialog\";\nimport { ContainerTabItem, TabSplitContainerSource } from \"@omegagrid/tabs\";\nimport { DialogOptions } from \"@omegagrid/dialog\";\nimport { TemplateResult } from \"lit\";\nimport { BucketOptions } from \"./options\";\n\n/**\n * layout of a bucket button\n * - `vertical`: text below the icon (default)\n * - `horizontal`: text next to the icon\n * - `auto`: horizontal when the button is wider than `SIDEMENU_BUTTON_HORIZONTAL_TRESHOLD`, vertical otherwise\n */\nexport type BucketButtonOrientation = 'horizontal' | 'vertical' | 'auto';\n\n/** width mode of the sidemenu */\nexport type SidemenuMode = 'normal' | 'wide';\n\nexport type SidemenuItem = {\n\tid: string,\n\ticon: string,\n\tstatusIcon?: string,\n\tstatusColor?: string,\n\ttext?: string,\n\t/** text used in the horizontal layout (falls back to `text`) */\n\tlongText?: string,\n\t/** layout of the button, default `vertical` */\n\torientation?: BucketButtonOrientation,\n\ttooltip?: string,\n\tcolor?: string\n}\n\nexport type SidemenuSettings = {\n\titems: SidemenuItem[];\n\tactiveIndex?: number;\n\thidden?: boolean;\n}\n\nexport type SidebarSettings = {\n\twidth?: number,\n\tcollapsed?: boolean\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\tsidebar?: SidebarSettings,\n\teditorLayout?: TabSplitContainerSource,\n\tcomponentId?: ComponentId,\n\toptions?: BucketOptions,\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\tsidemenu?: {\n\t\tmode?: SidemenuMode\n\t},\n\tlayout?: TabSplitContainerSource,\n\tdialogs?: OpenDialogOptions[],\n\tcomponents?: Record<ComponentId, ComponentState>\n}\n\nexport type OpenDialogOptions = DialogOptions & {\n\tid?: ComponentId,\n\tcomponent?: HTMLElement,\n\tmaximizable?: boolean\n}\n\nexport type OpenTabOptions = ContainerTabItem & {\n\tcomponent?: HTMLElement,\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 { ColorTypes, ComponentId, ComponentState, HorizontalPosition, IconSpec } from \"@omegagrid/core\";\nimport { Dialog } from \"@omegagrid/dialog\";\nimport { ContainerTabItem, TabSplitContainerSource } from \"@omegagrid/tabs\";\nimport { DialogOptions } from \"@omegagrid/dialog\";\nimport { TemplateResult } from \"lit\";\nimport { BucketOptions } from \"./options\";\nimport type { BucketAlert } from \"./ui/bucketAlert\";\n\n/**\n * layout of a bucket button\n * - `vertical`: text below the icon (default)\n * - `horizontal`: text next to the icon\n * - `auto`: horizontal when the button is wider than `SIDEMENU_BUTTON_HORIZONTAL_TRESHOLD`, vertical otherwise\n */\nexport type BucketButtonOrientation = 'horizontal' | 'vertical' | 'auto';\n\n/** width mode of the sidemenu */\nexport type SidemenuMode = 'normal' | 'wide';\n\nexport type SidemenuItem = {\n\tid: string,\n\ticon: string,\n\tstatusIcon?: string,\n\tstatusColor?: string,\n\ttext?: string,\n\t/** text used in the horizontal layout (falls back to `text`) */\n\tlongText?: string,\n\t/** layout of the button, default `vertical` */\n\torientation?: BucketButtonOrientation,\n\ttooltip?: string,\n\tcolor?: string\n}\n\nexport type SidemenuSettings = {\n\titems: SidemenuItem[];\n\tactiveIndex?: number;\n\thidden?: boolean;\n}\n\nexport type SidebarSettings = {\n\twidth?: number,\n\tcollapsed?: boolean\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\tsidebar?: SidebarSettings,\n\teditorLayout?: TabSplitContainerSource,\n\tcomponentId?: ComponentId,\n\toptions?: BucketOptions,\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\tsidemenu?: {\n\t\tmode?: SidemenuMode\n\t},\n\tlayout?: TabSplitContainerSource,\n\tdialogs?: OpenDialogOptions[],\n\tcomponents?: Record<ComponentId, ComponentState>\n}\n\nexport type OpenDialogOptions = DialogOptions & {\n\tid?: ComponentId,\n\tcomponent?: HTMLElement,\n\tmaximizable?: boolean\n}\n\nexport type OpenTabOptions = ContainerTabItem & {\n\tcomponent?: HTMLElement,\n\t// path?: PathSegments,\n}\n\nexport type BucketAlertType = 'danger'|'warning'|'info'|'success';\n\n/** a button shown at the bottom of an alert: the user acts on the message right there (e.g. refresh, open, undo) */\nexport type BucketAlertAction = {\n\ttext: string,\n\ticon?: string|IconSpec,\n\tcolor?: ColorTypes,\n\texec: (alert: BucketAlert) => void|Promise<void>,\n\t/** closes the alert after `exec`, default `true` */\n\tclose?: boolean,\n};\n\nexport type BucketAlertOptions = {\n\ttitle?: string|TemplateResult<1>,\n\ticon?: string|IconSpec,\n\ttype?: BucketAlertType,\n\tcontent?: string|TemplateResult<1>,\n\t/** time (ms) after which the alert closes; `0` keeps it open; default by `AlertsOptions.timeout` and `persistentTypes` */\n\ttimeout?: number,\n\tactions?: BucketAlertAction[],\n};\n\n/** an alert kept in `bucket.alerts.history` after it was shown */\nexport type BucketAlertHistoryItem = {\n\toptions: BucketAlertOptions,\n\t/** when the alert was shown */\n\ttime: Date,\n};\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentSlice } from "@omegagrid/core";
|
|
2
|
-
import {
|
|
2
|
+
import { AlertsOptions, AlertsPosition } from "../options";
|
|
3
|
+
import { BucketAlertHistoryItem, BucketAlertOptions } from "../types";
|
|
3
4
|
import { Bucket } from "./bucket";
|
|
4
5
|
import { BucketAlert } from "./bucketAlert";
|
|
5
6
|
type AlertItem = {
|
|
@@ -7,9 +8,36 @@ type AlertItem = {
|
|
|
7
8
|
component: BucketAlert;
|
|
8
9
|
timer?: number;
|
|
9
10
|
};
|
|
11
|
+
export declare class AlertsChangeEvent extends Event {
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The alerts of a bucket: `addAlert()` shows one in the stack anchored to the main content area (see
|
|
16
|
+
* `AlertsOptions.position`), `history` keeps the latest ones after they close so the user can get back to a
|
|
17
|
+
* message they missed. The bucket dispatches `alerts.change` whenever the history changes.
|
|
18
|
+
*/
|
|
10
19
|
export declare class BucketAlerts extends ComponentSlice<Bucket> {
|
|
11
20
|
private items;
|
|
21
|
+
/** the latest alerts shown (newest first), including the closed and expired ones, see `AlertsOptions.historySize` */
|
|
22
|
+
readonly history: BucketAlertHistoryItem[];
|
|
23
|
+
/**
|
|
24
|
+
* An alert grows after it is added (its body renders asynchronously and a long content gets a scrollable height),
|
|
25
|
+
* so the stack is laid out again whenever any alert changes its size - otherwise the alerts overlap.
|
|
26
|
+
*/
|
|
27
|
+
private readonly resizeObserver;
|
|
28
|
+
/** the bucket's alert options (initOptions fills every key, the input type is partial) */
|
|
29
|
+
get options(): AlertsOptions;
|
|
30
|
+
get position(): AlertsPosition;
|
|
12
31
|
addAlert(options: BucketAlertOptions): Promise<void>;
|
|
32
|
+
/** the alert's own timeout, else the bucket's one; the persistent types (danger by default) stay until closed */
|
|
33
|
+
getTimeout(options: BucketAlertOptions): number;
|
|
34
|
+
private addToHistory;
|
|
35
|
+
clearHistory(): void;
|
|
36
|
+
/** the area the alerts anchor to: the content area (the tabs next to the sidebar) when it shows, else the whole main area */
|
|
37
|
+
private getAnchorRect;
|
|
38
|
+
/** a new alert starts outside the anchored edge and slides into the stack (see the transition in the style) */
|
|
39
|
+
private setOffscreen;
|
|
40
|
+
private setHorizontal;
|
|
13
41
|
updatePositions(): void;
|
|
14
42
|
removeAlert(item: AlertItem): void;
|
|
15
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.alerts.d.ts","sourceRoot":"","sources":["../../src/ui/bucket.alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAO,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"bucket.alerts.d.ts","sourceRoot":"","sources":["../../src/ui/bucket.alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAO,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,KAAK,SAAS,GAAG;IAChB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AAUF,qBAAa,iBAAkB,SAAQ,KAAK;;CAI3C;AAED;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,cAAc,CAAC,MAAM,CAAC;IAEvD,OAAO,CAAC,KAAK,CAAmB;IAEhC,qHAAqH;IACrH,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,CAAM;IAEhD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAEvB;IAER,0FAA0F;IAC1F,IAAI,OAAO,IAA6C,aAAa,CAAE;IAEvE,IAAI,QAAQ,IAAI,cAAc,CAAmD;IAE3E,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IA2B1C,iHAAiH;IACjH,UAAU,CAAC,OAAO,EAAE,kBAAkB;IAMtC,OAAO,CAAC,YAAY;IAQpB,YAAY;IAMZ,6HAA6H;IAC7H,OAAO,CAAC,aAAa;IASrB,+GAA+G;IAC/G,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;IAerB,eAAe;IAsBf,WAAW,CAAC,IAAI,EAAE,SAAS;CAW3B"}
|
package/dist/ui/bucket.alerts.js
CHANGED
|
@@ -1,20 +1,49 @@
|
|
|
1
1
|
import { ComponentSlice, dom } from "@omegagrid/core";
|
|
2
|
+
/** gap between the alerts and from the edge of the anchor area */
|
|
3
|
+
const GAP = 10;
|
|
4
|
+
/** where a new alert starts before it slides into the stack */
|
|
5
|
+
const OFFSCREEN = -100;
|
|
6
|
+
export class AlertsChangeEvent extends Event {
|
|
7
|
+
constructor() {
|
|
8
|
+
super('alerts.change', { bubbles: true, composed: true });
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The alerts of a bucket: `addAlert()` shows one in the stack anchored to the main content area (see
|
|
13
|
+
* `AlertsOptions.position`), `history` keeps the latest ones after they close so the user can get back to a
|
|
14
|
+
* message they missed. The bucket dispatches `alerts.change` whenever the history changes.
|
|
15
|
+
*/
|
|
2
16
|
export class BucketAlerts extends ComponentSlice {
|
|
3
17
|
constructor() {
|
|
4
18
|
super(...arguments);
|
|
5
19
|
this.items = [];
|
|
20
|
+
/** the latest alerts shown (newest first), including the closed and expired ones, see `AlertsOptions.historySize` */
|
|
21
|
+
this.history = [];
|
|
22
|
+
/**
|
|
23
|
+
* An alert grows after it is added (its body renders asynchronously and a long content gets a scrollable height),
|
|
24
|
+
* so the stack is laid out again whenever any alert changes its size - otherwise the alerts overlap.
|
|
25
|
+
*/
|
|
26
|
+
this.resizeObserver = typeof ResizeObserver !== 'undefined'
|
|
27
|
+
? new ResizeObserver(() => this.updatePositions())
|
|
28
|
+
: null;
|
|
6
29
|
}
|
|
30
|
+
/** the bucket's alert options (initOptions fills every key, the input type is partial) */
|
|
31
|
+
get options() { return this.component.options.alerts; }
|
|
32
|
+
get position() { return this.options.position ?? 'bottom-right'; }
|
|
7
33
|
async addAlert(options) {
|
|
8
34
|
const alert = dom.createElement('og-bucket-alert');
|
|
9
35
|
const item = { options, component: alert };
|
|
10
36
|
alert.options = options;
|
|
11
37
|
alert.addEventListener('close', () => this.removeAlert(item));
|
|
12
38
|
this.component.shadowRoot.appendChild(alert);
|
|
39
|
+
this.setOffscreen(alert);
|
|
13
40
|
this.items.push(item);
|
|
14
|
-
|
|
41
|
+
this.resizeObserver?.observe(alert);
|
|
42
|
+
this.addToHistory(options);
|
|
43
|
+
if (this.items.length > this.options.maxItems) {
|
|
15
44
|
this.removeAlert(this.items[0]);
|
|
16
45
|
}
|
|
17
|
-
const timeout =
|
|
46
|
+
const timeout = this.getTimeout(options);
|
|
18
47
|
if (timeout > 0) {
|
|
19
48
|
item.timer = window.setTimeout(() => {
|
|
20
49
|
item.timer = undefined;
|
|
@@ -24,18 +53,90 @@ export class BucketAlerts extends ComponentSlice {
|
|
|
24
53
|
await this.component.updateComplete;
|
|
25
54
|
this.updatePositions();
|
|
26
55
|
}
|
|
56
|
+
/** the alert's own timeout, else the bucket's one; the persistent types (danger by default) stay until closed */
|
|
57
|
+
getTimeout(options) {
|
|
58
|
+
if (options.timeout != null)
|
|
59
|
+
return options.timeout;
|
|
60
|
+
if (options.type && this.options.persistentTypes?.includes(options.type))
|
|
61
|
+
return 0;
|
|
62
|
+
return this.options.timeout;
|
|
63
|
+
}
|
|
64
|
+
addToHistory(options) {
|
|
65
|
+
const size = this.options.historySize ?? 0;
|
|
66
|
+
if (size <= 0)
|
|
67
|
+
return;
|
|
68
|
+
this.history.unshift({ options, time: new Date() });
|
|
69
|
+
if (this.history.length > size)
|
|
70
|
+
this.history.length = size;
|
|
71
|
+
this.component.dispatchEvent(new AlertsChangeEvent());
|
|
72
|
+
}
|
|
73
|
+
clearHistory() {
|
|
74
|
+
if (!this.history.length)
|
|
75
|
+
return;
|
|
76
|
+
this.history.length = 0;
|
|
77
|
+
this.component.dispatchEvent(new AlertsChangeEvent());
|
|
78
|
+
}
|
|
79
|
+
/** the area the alerts anchor to: the content area (the tabs next to the sidebar) when it shows, else the whole main area */
|
|
80
|
+
getAnchorRect() {
|
|
81
|
+
const host = this.component.getBoundingClientRect();
|
|
82
|
+
const main = this.component.main; // null until the bucket renders
|
|
83
|
+
if (!main)
|
|
84
|
+
return { l: 0, t: 0, r: 0, b: 0, w: host.width, h: host.height };
|
|
85
|
+
const content = this.component.mainContentContainer.getBoundingClientRect();
|
|
86
|
+
const r = content.width > 0 && content.height > 0 ? content : main.getBoundingClientRect();
|
|
87
|
+
return { l: r.left - host.left, t: r.top - host.top, r: host.right - r.right, b: host.bottom - r.bottom, w: r.width, h: r.height };
|
|
88
|
+
}
|
|
89
|
+
/** a new alert starts outside the anchored edge and slides into the stack (see the transition in the style) */
|
|
90
|
+
setOffscreen(alert) {
|
|
91
|
+
const [vertical, horizontal] = this.position.split('-');
|
|
92
|
+
alert.style.top = vertical == 'top' ? dom.px(OFFSCREEN) : 'auto';
|
|
93
|
+
alert.style.bottom = vertical == 'top' ? 'auto' : dom.px(OFFSCREEN);
|
|
94
|
+
this.setHorizontal(alert, horizontal, this.getAnchorRect());
|
|
95
|
+
}
|
|
96
|
+
setHorizontal(alert, horizontal, rect) {
|
|
97
|
+
alert.style.transform = '';
|
|
98
|
+
if (horizontal == 'left') {
|
|
99
|
+
alert.style.left = dom.px(rect.l + GAP);
|
|
100
|
+
alert.style.right = 'auto';
|
|
101
|
+
}
|
|
102
|
+
else if (horizontal == 'center') {
|
|
103
|
+
alert.style.left = dom.px(rect.l + rect.w / 2);
|
|
104
|
+
alert.style.right = 'auto';
|
|
105
|
+
alert.style.transform = 'translateX(-50%)';
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
alert.style.left = 'auto';
|
|
109
|
+
alert.style.right = dom.px(rect.r + GAP);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
27
112
|
updatePositions() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
113
|
+
if (!this.items.length)
|
|
114
|
+
return;
|
|
115
|
+
const rect = this.getAnchorRect();
|
|
116
|
+
const [vertical, horizontal] = this.position.split('-');
|
|
117
|
+
let offset = (vertical == 'top' ? rect.t : rect.b) + GAP;
|
|
118
|
+
// the newest alert takes the corner, the older ones move away from it
|
|
119
|
+
[...this.items].reverse().forEach(item => {
|
|
120
|
+
const alert = item.component;
|
|
121
|
+
// read the height before the move: a new alert gets its offscreen style computed first, so the move animates
|
|
122
|
+
const height = alert.offsetHeight;
|
|
123
|
+
this.setHorizontal(alert, horizontal, rect);
|
|
124
|
+
if (vertical == 'top') {
|
|
125
|
+
alert.style.top = dom.px(offset);
|
|
126
|
+
alert.style.bottom = 'auto';
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
alert.style.bottom = dom.px(offset);
|
|
130
|
+
alert.style.top = 'auto';
|
|
131
|
+
}
|
|
132
|
+
offset += height + GAP;
|
|
33
133
|
});
|
|
34
134
|
}
|
|
35
135
|
removeAlert(item) {
|
|
36
136
|
const index = this.items.indexOf(item);
|
|
37
137
|
if (index == -1)
|
|
38
138
|
return;
|
|
139
|
+
this.resizeObserver?.unobserve(item.component);
|
|
39
140
|
this.items[index].component.remove();
|
|
40
141
|
this.items.splice(index, 1);
|
|
41
142
|
if (item.timer != null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.alerts.js","sourceRoot":"","sources":["../../src/ui/bucket.alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAWtD,MAAM,OAAO,YAAa,SAAQ,cAAsB;IAAxD;;QAES,UAAK,GAAgB,EAAE,CAAC;IA6CjC,CAAC;IA3CA,KAAK,CAAC,QAAQ,CAAC,OAA2B;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAc,iBAAiB,CAAC,CAAC;QAChE,MAAM,IAAI,GAAc,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QACtD,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;QACxB,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtB,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI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EAAE,CAAC;IACxB,CAAC;CAED","sourcesContent":["import { ComponentSlice, dom } from \"@omegagrid/core\";\nimport { BucketAlertOptions } from \"../types\";\nimport { Bucket } from \"./bucket\";\nimport { BucketAlert } from \"./bucketAlert\";\n\ntype AlertItem = {\n\toptions: BucketAlertOptions,\n\tcomponent: BucketAlert,\n\ttimer?: number\n};\n\nexport class BucketAlerts extends ComponentSlice<Bucket> {\n\n\tprivate items: AlertItem[] = [];\n\n\tasync addAlert(options: BucketAlertOptions) {\n\t\tconst alert = dom.createElement<BucketAlert>('og-bucket-alert');\n\t\tconst item: AlertItem = { options, component: alert };\n\t\talert.options = options;\n\t\talert.addEventListener('close', () => this.removeAlert(item));\n\t\tthis.component.shadowRoot.appendChild(alert);\n\t\tthis.items.push(item);\n\n\t\tif (this.items.length > this.component.options.alerts.maxItems) {\n\t\t\tthis.removeAlert(this.items[0]);\n\t\t}\n\t\t\n\t\tconst timeout = options.timeout ?? this.component.options.alerts.timeout;\n\t\tif (timeout > 0) {\n\t\t\titem.timer = window.setTimeout(() => {\n\t\t\t\titem.timer = undefined;\n\t\t\t\tthis.removeAlert(item);\n\t\t\t}, timeout);\n\t\t}\n\n\t\tawait this.component.updateComplete;\n\t\tthis.updatePositions();\n\t}\n\n\tupdatePositions() {\n\t\t[...this.items].reverse().forEach((item, i) => {\n\t\t\tdom.setPosition(item.component, {\n\t\t\t\tr: 10,\n\t\t\t\tb: 10 + i * (item.component.offsetHeight + 10),\n\t\t\t});\n\t\t});\n\t}\n\n\tremoveAlert(item: AlertItem) {\n\t\tconst index = this.items.indexOf(item);\n\t\tif (index == -1) return;\n\t\tthis.items[index].component.remove();\n\t\tthis.items.splice(index, 1);\n\t\tif (item.timer != null) window.clearTimeout(item.timer);\n\t\titem.timer = undefined;\n\t\tthis.updatePositions();\n\t}\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bucket.alerts.js","sourceRoot":"","sources":["../../src/ui/bucket.alerts.ts"],"names":[],"mappings":"AAAA,OAA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,CAAC,MAAM,CAAC,CAAC;gBACjC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACP,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBACpC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC;YAC1B,CAAC;YACD,MAAM,IAAI,MAAM,GAAG,GAAG,CAAC;QACxB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,IAAe;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,KAAK,IAAI,CAAC,CAAC;YAAE,OAAO;QACxB,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QACrC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC5B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI;YAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,eAAe,EAAE,CAAC;IACxB,CAAC;CAED","sourcesContent":["import { ComponentSlice, dom } from \"@omegagrid/core\";\nimport { AlertsOptions, AlertsPosition } from \"../options\";\nimport { BucketAlertHistoryItem, BucketAlertOptions } from \"../types\";\nimport { Bucket } from \"./bucket\";\nimport { BucketAlert } from \"./bucketAlert\";\n\ntype AlertItem = {\n\toptions: BucketAlertOptions,\n\tcomponent: BucketAlert,\n\ttimer?: number\n};\n\n/** distances of the anchor area from the edges of the bucket (`l`, `t`, `r`, `b`) and its size */\ntype AnchorRect = { l: number, t: number, r: number, b: number, w: number, h: number };\n\n/** gap between the alerts and from the edge of the anchor area */\nconst GAP = 10;\n/** where a new alert starts before it slides into the stack */\nconst OFFSCREEN = -100;\n\nexport class AlertsChangeEvent extends Event {\n\tconstructor() {\n\t\tsuper('alerts.change', {bubbles: true, composed: true});\n\t}\n}\n\n/**\n * The alerts of a bucket: `addAlert()` shows one in the stack anchored to the main content area (see\n * `AlertsOptions.position`), `history` keeps the latest ones after they close so the user can get back to a\n * message they missed. The bucket dispatches `alerts.change` whenever the history changes.\n */\nexport class BucketAlerts extends ComponentSlice<Bucket> {\n\n\tprivate items: AlertItem[] = [];\n\n\t/** the latest alerts shown (newest first), including the closed and expired ones, see `AlertsOptions.historySize` */\n\treadonly history: BucketAlertHistoryItem[] = [];\n\n\t/**\n\t * An alert grows after it is added (its body renders asynchronously and a long content gets a scrollable height),\n\t * so the stack is laid out again whenever any alert changes its size - otherwise the alerts overlap.\n\t */\n\tprivate readonly resizeObserver = typeof ResizeObserver !== 'undefined'\n\t\t? new ResizeObserver(() => this.updatePositions())\n\t\t: null;\n\n\t/** the bucket's alert options (initOptions fills every key, the input type is partial) */\n\tget options() { return this.component.options.alerts as AlertsOptions }\n\n\tget position(): AlertsPosition { return this.options.position ?? 'bottom-right' }\n\n\tasync addAlert(options: BucketAlertOptions) {\n\t\tconst alert = dom.createElement<BucketAlert>('og-bucket-alert');\n\t\tconst item: AlertItem = { options, component: alert };\n\t\talert.options = options;\n\t\talert.addEventListener('close', () => this.removeAlert(item));\n\t\tthis.component.shadowRoot.appendChild(alert);\n\t\tthis.setOffscreen(alert);\n\t\tthis.items.push(item);\n\t\tthis.resizeObserver?.observe(alert);\n\t\tthis.addToHistory(options);\n\n\t\tif (this.items.length > this.options.maxItems) {\n\t\t\tthis.removeAlert(this.items[0]);\n\t\t}\n\n\t\tconst timeout = this.getTimeout(options);\n\t\tif (timeout > 0) {\n\t\t\titem.timer = window.setTimeout(() => {\n\t\t\t\titem.timer = undefined;\n\t\t\t\tthis.removeAlert(item);\n\t\t\t}, timeout);\n\t\t}\n\n\t\tawait this.component.updateComplete;\n\t\tthis.updatePositions();\n\t}\n\n\t/** the alert's own timeout, else the bucket's one; the persistent types (danger by default) stay until closed */\n\tgetTimeout(options: BucketAlertOptions) {\n\t\tif (options.timeout != null) return options.timeout;\n\t\tif (options.type && this.options.persistentTypes?.includes(options.type)) return 0;\n\t\treturn this.options.timeout;\n\t}\n\n\tprivate addToHistory(options: BucketAlertOptions) {\n\t\tconst size = this.options.historySize ?? 0;\n\t\tif (size <= 0) return;\n\t\tthis.history.unshift({ options, time: new Date() });\n\t\tif (this.history.length > size) this.history.length = size;\n\t\tthis.component.dispatchEvent(new AlertsChangeEvent());\n\t}\n\n\tclearHistory() {\n\t\tif (!this.history.length) return;\n\t\tthis.history.length = 0;\n\t\tthis.component.dispatchEvent(new AlertsChangeEvent());\n\t}\n\n\t/** the area the alerts anchor to: the content area (the tabs next to the sidebar) when it shows, else the whole main area */\n\tprivate getAnchorRect(): AnchorRect {\n\t\tconst host = this.component.getBoundingClientRect();\n\t\tconst main = this.component.main; // null until the bucket renders\n\t\tif (!main) return { l: 0, t: 0, r: 0, b: 0, w: host.width, h: host.height };\n\t\tconst content = this.component.mainContentContainer.getBoundingClientRect();\n\t\tconst r = content.width > 0 && content.height > 0 ? content : main.getBoundingClientRect();\n\t\treturn { l: r.left - host.left, t: r.top - host.top, r: host.right - r.right, b: host.bottom - r.bottom, w: r.width, h: r.height };\n\t}\n\n\t/** a new alert starts outside the anchored edge and slides into the stack (see the transition in the style) */\n\tprivate setOffscreen(alert: BucketAlert) {\n\t\tconst [vertical, horizontal] = this.position.split('-');\n\t\talert.style.top = vertical == 'top' ? dom.px(OFFSCREEN) : 'auto';\n\t\talert.style.bottom = vertical == 'top' ? 'auto' : dom.px(OFFSCREEN);\n\t\tthis.setHorizontal(alert, horizontal, this.getAnchorRect());\n\t}\n\n\tprivate setHorizontal(alert: BucketAlert, horizontal: string, rect: AnchorRect) {\n\t\talert.style.transform = '';\n\t\tif (horizontal == 'left') {\n\t\t\talert.style.left = dom.px(rect.l + GAP);\n\t\t\talert.style.right = 'auto';\n\t\t} else if (horizontal == 'center') {\n\t\t\talert.style.left = dom.px(rect.l + rect.w / 2);\n\t\t\talert.style.right = 'auto';\n\t\t\talert.style.transform = 'translateX(-50%)';\n\t\t} else {\n\t\t\talert.style.left = 'auto';\n\t\t\talert.style.right = dom.px(rect.r + GAP);\n\t\t}\n\t}\n\n\tupdatePositions() {\n\t\tif (!this.items.length) return;\n\t\tconst rect = this.getAnchorRect();\n\t\tconst [vertical, horizontal] = this.position.split('-');\n\t\tlet offset = (vertical == 'top' ? rect.t : rect.b) + GAP;\n\t\t// the newest alert takes the corner, the older ones move away from it\n\t\t[...this.items].reverse().forEach(item => {\n\t\t\tconst alert = item.component;\n\t\t\t// read the height before the move: a new alert gets its offscreen style computed first, so the move animates\n\t\t\tconst height = alert.offsetHeight;\n\t\t\tthis.setHorizontal(alert, horizontal, rect);\n\t\t\tif (vertical == 'top') {\n\t\t\t\talert.style.top = dom.px(offset);\n\t\t\t\talert.style.bottom = 'auto';\n\t\t\t} else {\n\t\t\t\talert.style.bottom = dom.px(offset);\n\t\t\t\talert.style.top = 'auto';\n\t\t\t}\n\t\t\toffset += height + GAP;\n\t\t});\n\t}\n\n\tremoveAlert(item: AlertItem) {\n\t\tconst index = this.items.indexOf(item);\n\t\tif (index == -1) return;\n\t\tthis.resizeObserver?.unobserve(item.component);\n\t\tthis.items[index].component.remove();\n\t\tthis.items.splice(index, 1);\n\t\tif (item.timer != null) window.clearTimeout(item.timer);\n\t\titem.timer = undefined;\n\t\tthis.updatePositions();\n\t}\n\n}\n"]}
|
package/dist/ui/bucket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.d.ts","sourceRoot":"","sources":["../../src/ui/bucket.ts"],"names":[],"mappings":"AAAA,OAAO,EACD,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EA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AAiB,UAK5C;IAED,iBAAiB;IAOjB,oBAAoB;IAIpB,MAAM;IAON,aAAa,CAAC,UAAU,EAAE,YAAY;IAOhC,OAAO;IAoBb,OAAO,CAAC,cAAc;IAUhB,IAAI,CAAC,IAAI,EAAE,cAAc;IAmBzB,UAAU,CAAC,OAAO,EAAE,iBAAiB;IAI3C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,GAAC,IAAI,CAAC;IAInE,gBAAgB,CAAC,OAAO,EAAE,mBAAmB;IAIvC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO;IAM5B,WAAW;IAaX,WAAW;IAajB;;;OAGG;IACG,cAAc,CAAC,IAAI,CAAC,EAAE,OAAO;IAWnC,SAAS,CAAC,OAAO,EAAE,kBAAkB;IAIrC,qBAAqB,GAAI,IAAI,WAAW,mBAMvC;IAED,8BAA8B,EAAE,gBAAgB,CAkB/C;IAED,QAAQ,IAAI,WAAW;IAyBjB,QAAQ,CAAC,KAAK,EAAE,WAAW;IAuBjC,uBAAuB,aAGtB;IAED,YAAY,GAAI,GAAG,QAAQ,UAI1B;IAED,kBAAkB,GAAI,GAAG,aAAa,UAiCrC;IAED,YAAY,GAAI,GAAG,QAAQ,UAM1B;IAED,iBAAiB,CAAC,CAAC,EAAE,eAAe;IAapC,sBAAsB;IAItB,mBAAmB;IAIb,oBAAoB,CAAC,EAAE,EAAE,WAAW;IAQ1C,iBAAiB,sBAA+B;IAEhD,IAAI,aAAa,WAEhB;IAED,cAAc,6CAUZ;IAEF,MAAM,6CASJ;CAEF"}
|
package/dist/ui/bucket.js
CHANGED
|
@@ -237,6 +237,7 @@ let Bucket = Bucket_1 = class Bucket extends OmegaComponent {
|
|
|
237
237
|
layout() {
|
|
238
238
|
this.container?.layout();
|
|
239
239
|
this.top?.layout();
|
|
240
|
+
this.alerts.updatePositions(); // the alerts anchor to the main area, which moves with the sidemenu/top
|
|
240
241
|
this.dialogs?.items.forEach(dialog => dialog.isOpen && dialog.fixPosition());
|
|
241
242
|
}
|
|
242
243
|
setSourceData(sourceData) {
|
package/dist/ui/bucket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.js","sourceRoot":"","sources":["../../src/ui/bucket.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACN,GAAG,EAA6D,GAAG,EAC7C,cAAc,EAAkB,eAAe,EAErE,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAuD,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAsC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,cAAc,GAAiB;IACpC,GAAG,EAAE,EAAC,UAAU,EAAE,EAAE,EAAC;IACrB,QAAQ,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC;IACvD,OAAO,EAAE,EAAC,KAAK,EAAE,SAAS,CAAC,aAAa,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,MAAM,EAAC,CAAC;sCACsB;AAG/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCACV;AAIhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACa;AAtC1B,MAAM;IADlB,aAAa,CAAC,WAAW,CAAC;GACd,MAAM,CA+dlB","sourcesContent":["import {\n\tdom, Layout, ListSelectEvent, ComponentFactory, SplitContainer, log,\n\tComponentId, Overlay, OmegaComponent, ComponentState, ShortcutManager,\n SplitContainerItem\n} from '@omegagrid/core';\nimport { TabCloseEvent, TabEvent, TabItem, TabSplitContainer, TabSplitContainerModel } from '@omegagrid/tabs';\nimport { CommandManager, CommandResult, OpenCommandsOptions } from '@omegagrid/commands';\nimport { msg } from '@omegagrid/localize';\nimport { html, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport constants from '../constants';\nimport { BucketAlertOptions, BucketSource, BucketState, ModalSidebarOptions, OpenDialogOptions, OpenTabOptions, SidemenuMode } from '../types';\nimport { Sidemenu } from './sidemenu';\nimport style from './bucket.style';\nimport { BucketTop } from './top';\nimport { ComponentHost } from './componentHost';\nimport { BucketAlerts } from './bucket.alerts';\nimport { BucketOptions, initOptions } from '../options';\nimport { Sidebar } from './sidebar';\nimport { BucketComponents } from './bucket.components';\nimport { BucketSidebars } from './bucket.sidebars';\nimport { BucketDialogs } from './bucket.dialogs';\nimport { debounce } from 'ts-debounce';\n\nconst DEFAULT_SOURCE: BucketSource = {\n\ttop: {rightItems: []},\n\tsidemenu: {items: [], activeIndex: null, hidden: false},\n\tsidebar: {width: constants.SIDEBAR_WIDTH, collapsed: false},\n\teditorLayout: {items: []}\n};\n\nexport class BucketEvent extends Event {\n\ttab: TabItem;\n\tcomponentId: ComponentId;\n\n\tconstructor(type: string, args?: Partial<BucketEvent>) {\n\t\tsuper(`bucket.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n\n}\n\n@customElement('og-bucket')\nexport class Bucket extends OmegaComponent<BucketState> implements Layout {\n\n\tstatic styles = [style];\n\tstatic uniqueId = 0;\n\tstatic getUniqueId = () => ++Bucket.uniqueId;\n\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\t@query('og-bucket-top')\n\ttop: BucketTop;\n\n\t@query('og-bucket-sidemenu')\n\tsidemenu: Sidemenu;\n\n\t@query('.body')\n\tbody: HTMLDivElement;\n\n\t@query('.main')\n\tmain: HTMLDivElement;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@property({type: Object})\n\tsourceData: BucketSource = DEFAULT_SOURCE;\n\n\t@property({type: Object})\n\toptions: BucketOptions;\n\n\t@property({type: Object})\n\tlogger: log.Logger = new log.Logger('Ωbucket');\n\n\t@property({type: Boolean})\n\tcompact = false;\n\n\t/** current width mode of the sidemenu, see `toggleSidemenu()` */\n\t@property({type: String})\n\tsidemenuMode: SidemenuMode = 'normal';\n\n\tsidebar1ComponentId: string;\n\n\treadonly components: BucketComponents;\n\treadonly sidebars: BucketSidebars;\n\treadonly alerts: BucketAlerts;\n\treadonly dialogs: BucketDialogs;\n\treadonly commands: CommandManager;\n\treadonly shortcuts: ShortcutManager;\n\n\tprivate _activeComponentId: ComponentId;\n\tget activeComponentId() { return this._activeComponentId }\n\n\tget sidebarIndex() { return this.options.sidebarPosition == 'left' ? 0 : 1 }\n\tget mainIndex() { return this.options.sidebarPosition == 'left' ? 1 : 0 }\n\n\tprivate _container: SplitContainer;\n\tget container(): SplitContainer {\n\t\tif (this._container) return this._container;\n\t\tthis._container = dom.createElement<SplitContainer>('og-splitcontainer');\n\t\tthis._container.orientation = 'horizontal';\n\n\t\tconst sidebarItem: SplitContainerItem = {\n\t\t\tsize: this.sourceData.sidebar?.width || constants.SIDEBAR_WIDTH,\n\t\t\tcollapsed: this.sourceData.sidebar?.collapsed || false\n\t\t};\n\n\t\tthis._container.items = [\n\t\t\tthis.sidebarIndex == 0 ? sidebarItem : {size: null},\n\t\t\tthis.sidebarIndex == 1 ? sidebarItem : {size: null},\n\t\t];\n\n\t\tthis._container.createComponent = this._createSplitContainerComponent;\n\t\tthis._container.addEventListener('splitContainer.resize', this._onSplitContainerResize);\n\t\treturn this._container;\n\t}\n\n\tprivate _editorContainer: TabSplitContainer;\n\tget editorContainer(): TabSplitContainer {\n\t\tif (this._editorContainer) return this._editorContainer;\n\t\tthis._editorContainer = dom.createElement<TabSplitContainer>('og-tabsplitcontainer');\n\t\tthis._editorContainer.style.height = '100%';\n\t\tthis._editorContainer.closable = true;\n\t\tthis._editorContainer.singleActive = true;\n\t\tthis._editorContainer.createComponent = this.createEditorComponent;\n\t\tthis._editorContainer.model = new TabSplitContainerModel(this.sourceData.editorLayout);\n\t\tthis._editorContainer.scrollableTabs = true;\n\t\tthis._editorContainer.addEventListener('tab.beforeRemove', this._onTabBeforeRemove);\n\t\tthis._editorContainer.addEventListener('tab.remove', this._onTabRemove);\n\t\tthis._editorContainer.addEventListener('tab.select', this._onTabSelect);\n\t\treturn this._editorContainer;\n\t}\n\n\tprivate _singleContainer: HTMLDivElement;\n\tget singleContainer() {\n\t\tif (this._singleContainer) return this._singleContainer;\n\t\tthis._singleContainer = dom.createElement('div');\n\t\tthis._singleContainer.style.height = '100%';\n\t\treturn this._singleContainer;\n\t}\n\n\tget mainContentContainer(): HTMLDivElement | TabSplitContainer {\n\t\treturn this.options?.componentMode == 'single' ? this.singleContainer : this.editorContainer;\n\t}\n\n\tprivate _sidebarHost: Sidebar;\n\tget sidebarHost() {\n\t\tif (this._sidebarHost) return this._sidebarHost;\n\t\tthis._sidebarHost = dom.createElement<Sidebar>('og-bucket-sidebar');\n\t\tthis._sidebarHost.bucket = this;\n\t\tthis._sidebarHost.componentId = this.sidebar1ComponentId;\n\t\treturn this._sidebarHost;\n\t}\n\n\tupdateContainerVisibility = debounce(() => {\n\t\tlet hasTabs = false;\n\t\tthis.editorContainer.walk((splitContainer, tabContainer) => {\n\t\t\tif (tabContainer.tabs?.items?.length) {\n\t\t\t\thasTabs = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif (hasTabs) dom.showElement(this.editorContainer);\n\t\telse dom.hideElement(this.editorContainer);\n\t}, 100);\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.components = new BucketComponents(this);\n\t\tthis.sidebars = new BucketSidebars(this);\n\t\tthis.alerts = new BucketAlerts(this);\n\t\tthis.dialogs = new BucketDialogs(this);\n\t\tthis.commands = new CommandManager(this);\n\t\tthis.shortcuts = new ShortcutManager(this);\n\n\t\tthis.options = initOptions();\n\t\tthis.logger.info('init');\n\n\t\tthis.addEventListener('state', (e: Event) => {\n\t\t\tif (e.target == this) return;\n\t\t\te.stopPropagation();\n\t\t\tthis.dispatchStateEvent();\n\t\t});\n\t}\n\n\tshowOverlay = () => this.overlay.show(this.body);\n\thideOverlay = () => this.overlay.hide();\n\n\t_onWindowBeforeUnload = (e: BeforeUnloadEvent) => {\n\t\tif (!this.options.unsavedWarning) return;\n\t\tif (!this.components.hasUnsavedComponents) return;\n\t\te.preventDefault();\n\t\te.returnValue = '';\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t\tthis.logger.info('connected');\n\t\twindow.addEventListener('beforeunload', this._onWindowBeforeUnload);\n\t}\n\n\tdisconnectedCallback() {\n\t\twindow.removeEventListener('beforeunload', this._onWindowBeforeUnload);\n\t}\n\n\tlayout() {\n\t\tthis.container?.layout();\n\t\tthis.top?.layout();\n\t\tthis.dialogs?.items.forEach(dialog => dialog.isOpen && dialog.fixPosition());\n\t}\n\n\tsetSourceData(sourceData: BucketSource) {\n\t\tthis.sourceData = sourceData;\n\t\tif (sourceData.options) {\n\t\t\tthis.options = initOptions(sourceData.options, this.options);\n\t\t}\n\t}\n\n\tasync updated() {\n\t\tconst mainContainer = this.compact ? this.mainContentContainer : this.container;\n\n\t\tif (mainContainer.parentElement != this.main) {\n\t\t\tdom.empty(this.main);\n\t\t\tthis.main.appendChild(mainContainer);\n\t\t\tif (mainContainer instanceof LitElement) (mainContainer as LitElement).requestUpdate();\n\t\t}\n\n\t\tconst sidebarComponentId = (this.sourceData.sidemenu.items ?? [])[this.sourceData.sidemenu.activeIndex]?.id;\n\t\tif (sidebarComponentId) {\n\t\t\tthis.sidebar1ComponentId = sidebarComponentId;\n\t\t}\n\n\t\tawait this.container?.updateComplete;\n\t\tawait this.sidemenu?.updateComplete;\n\n\t\tthis.layout();\n\t}\n\n\tprivate _openComponent(item: OpenTabOptions) {\n\t\tconst singleMode = this.options?.componentMode == 'single';\n\t\tif (singleMode) {\n\t\t\tdom.empty(this.singleContainer);\n\t\t\tthis.singleContainer.appendChild(this.createEditorComponent(item.id));\n\t\t} else {\n\t\t\tthis.editorContainer.open(item);\n\t\t}\n\t}\n\n\tasync open(item: OpenTabOptions) {\n\t\tif (this.compact) this.hideSidebar();\n\n\t\tdom.showElement(this.mainContentContainer);\n\n\t\tconst component = item.component;\n\t\tif (component) {\n\t\t\titem.id = this.components.register(item.id, item.component);\n\t\t\tdelete item.component;\n\t\t\tthis._openComponent(item);\n\t\t\treturn component;\n\t\t}\n\n\t\tconst promise = this.components.waitFor(item.id);\n\t\tthis._openComponent(item);\n\t\tthis.dispatchStateEvent();\n\t\treturn promise;\n\t}\n\n\tasync openDialog(options: OpenDialogOptions) {\n\t\treturn await this.dialogs.open(options);\n\t}\n\n\topenMenu(options: OpenCommandsOptions): Promise<CommandResult|null> {\n\t\treturn this.commands.open(options);\n\t}\n\n\topenModalSidebar(options: ModalSidebarOptions) {\n\t\treturn this.sidebars.openModalSidebar(options);\n\t}\n\n\tasync toggleSidebar(open?: boolean) {\n\t\topen ??= this.compact ? this.sidebarHost.parentElement != this.main : this.container.items[this.sidebarIndex].collapsed;\n\t\tif (open) this.showSidebar();\n\t\telse this.hideSidebar();\n\t}\n\n\tasync hideSidebar() {\n\t\tif (this.compact) {\n\t\t\tif (this.sidebarHost.parentElement == this.main) {\n\t\t\t\tdom.empty(this.main);\n\t\t\t\tthis.main.appendChild(this.editorContainer);\n\t\t\t}\n\t\t} else {\n\t\t\tawait this.container.collapse(this.sidebarIndex, true);\n\t\t}\n\n\t\tthis.layout();\n\t}\n\n\tasync showSidebar() {\n\t\tif (this.compact) {\n\t\t\tif (this.sidebarHost.parentElement != this.main) {\n\t\t\t\tdom.empty(this.main);\n\t\t\t\tthis.main.appendChild(this.sidebarHost);\n\t\t\t}\n\t\t} else {\n\t\t\tawait this.container.collapse(this.sidebarIndex, false);\n\t\t}\n\n\t\tthis.layout();\n\t}\n\n\t/**\n\t * switches the sidemenu between normal and wide mode\n\t * @param wide target mode, toggles the current mode when omitted\n\t */\n\tasync toggleSidemenu(wide?: boolean) {\n\t\twide ??= this.sidemenuMode != 'wide';\n\t\tconst mode: SidemenuMode = wide ? 'wide' : 'normal';\n\t\tif (mode == this.sidemenuMode) return;\n\t\tthis.sidemenuMode = mode;\n\t\tawait this.updateComplete; // the new width is applied by render, updated() runs layout()\n\t\tif (this.sidebars.modalSidebars.length) this.sidebars.updateModalSidebarPositions();\n\t\tthis.dispatchEvent(new BucketEvent('sidemenu.change'));\n\t\tthis.dispatchStateEvent();\n\t}\n\n\tshowAlert(options: BucketAlertOptions) {\n\t\treturn this.alerts.addAlert(options);\n\t}\n\n\tcreateEditorComponent = (id: ComponentId) => {\n\t\treturn dom.createElement<ComponentHost>('og-bucket-component-host', {\n\t\t\tcomponentId: id,\n\t\t\tbucket: this,\n\t\t\tpathPosition: this.options.pathPosition\n\t\t});\n\t}\n\n\t_createSplitContainerComponent: ComponentFactory = (index: ComponentId) => {\n\t\tlet component: HTMLElement;\n\t\tif (index == this.sidebarIndex) {\n\t\t\t// primary sidebar\n\t\t\tthis.logger.info('create primary sidebar');\n\t\t\treturn this.sidebarHost;\n\t\t} else if (index == this.mainIndex) {\n\t\t\t// editor split container\n\t\t\tthis.logger.info('create editor container');\n\t\t\treturn this.mainContentContainer;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tcomponent = dom.createElement<HTMLElement>('div');\n\t\t\tcomponent.innerHTML = 'empty';\n\t\t}\n\n\t\treturn component;\n\t}\n\n\tgetState(): BucketState {\n\t\tconst item = this.container?.items[0];\n\t\treturn {\n\t\t\tsidebar: {\n\t\t\t\tselectedItem: this.sidebar1ComponentId,\n\t\t\t\twidth: item?.size,\n\t\t\t\tcollapsed: !!item?.collapsed\n\t\t\t},\n\t\t\tsidemenu: {\n\t\t\t\tmode: this.sidemenuMode\n\t\t\t},\n\t\t\tlayout: this.editorContainer?.model.getSourceData(),\n\t\t\tdialogs: [...Array.from(this.dialogs.items.entries()).map(\n\t\t\t\t([id, dialog]) => Object.assign({id: id}, dialog.getOptions())\n\t\t\t)],\n\t\t\tcomponents: [...this.components.components].reduce((acc, [id, component]) => {\n\t\t\t\tif ((component as OmegaComponent).getState) {\n\t\t\t\t\tconst componentState = (component as OmegaComponent).getState();\n\t\t\t\t\tif (componentState) acc[id] = componentState;\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, {} as Record<ComponentId, ComponentState>)\n\t\t};\n\t}\n\n\tasync setState(state: BucketState) {\n\t\tthis.state = state;\n\t\tconst selectedIndex = this.sourceData.sidemenu.items.findIndex(item => item.id == state.sidebar.selectedItem);\n\t\tif (selectedIndex >= 0) {\n\t\t\tthis.sourceData.sidemenu.activeIndex = selectedIndex;\n\t\t\tthis.sidebar1ComponentId = state.sidebar.selectedItem as string;\n\t\t}\n\t\tthis.sourceData.editorLayout = state.layout;\n\t\t// wide mode is restored only when the user can switch it back\n\t\tthis.sidemenuMode = this.options.sidemenuExpandable ? (state.sidemenu?.mode ?? 'normal') : 'normal';\n\t\tthis._editorContainer = null;\n\t\tthis.requestUpdate();\n\t\tawait this.updateComplete;\n\t\tthis.sidemenu?.requestUpdate();\n\t\tthis.updateSidebarComponent();\n\t\tthis.updateMainComponent();\n\t\tstate.dialogs?.forEach(opt => this.openDialog(opt));\n\n\t\tfor (const k in state.components) {\n\t\t\tthis.components.setState(k, state.components[k]);\n\t\t}\n\t}\n\n\t_onSplitContainerResize = () => {\n\t\tthis.top?.layout();\n\t\tthis.dispatchStateEvent();\n\t}\n\n\t_onTabRemove = (e: TabEvent) => {\n\t\tthis.components.unregister(e.tab.id);\n\t\tthis.dispatchEvent(new BucketEvent('close', {tab: e.tab, componentId: e.tab.id}));\n\t\tthis.dispatchStateEvent();\n\t}\n\n\t_onTabBeforeRemove = (e: TabCloseEvent) => {\n\t\tconst tabId = e.tab.id;\n\t\tif (this.components.unsavedComponents.has(tabId)) {\n\t\t\te.preventDefault();\n\n\t\t\tconst title = e.tab.title || e.tab.id;\n\t\t\tconst component = this.components.get(tabId) as { save?: () => void };\n\t\t\tconst saveSupported = typeof component?.save === 'function';\n\n\t\t\tconst text = saveSupported ? html`\n\t\t\t\t<div style=\"text-align: center\">\n\t\t\t\t\t<strong>${msg('Do you want to save the changes you made to {title}?', {data: {title}})}</strong>\n\t\t\t\t\t<div>${msg(\"Your changes will be lost if you don't save them.\")}</div>\n\t\t\t\t</div>\n\t\t\t` : null;\n\n\t\t\tthis.openMenu({\n\t\t\t\tmode: 'menu',\n\t\t\t\ttext: text,\n\t\t\t\tcontent: saveSupported ? 'save_discard_cancel' : 'discard_cancel',\n\t\t\t\toptions: {itemHeight: 30}\n\t\t\t}).then(answer => {\n\t\t\t\t// leaving the menu without an answer (click outside, Escape) means cancel -\n\t\t\t\t// unsaved changes must never be discarded by a dismissed prompt\n\t\t\t\tconst command = answer?.command?.id;\n\t\t\t\tif (command == null || command == 'cancel') return;\n\n\t\t\t\tif (command == 'save') component?.save?.();\n\n\t\t\t\tthis.components.unsavedComponents.delete(tabId);\n\t\t\t\te.resolveClose();\n\t\t\t});\n\t\t}\n\t}\n\n\t_onTabSelect = (e: TabEvent) => {\n\t\tif (e.tabs.topLevelComponent == this.editorContainer) {\n\t\t\tthis._activeComponentId = e.tab?.id;\n\t\t\tthis.dispatchEvent(new BucketEvent('activate', {tab: e.tab, componentId: e.tab?.id}));\n\t\t\tthis.dispatchStateEvent();\n\t\t}\n\t}\n\n\t_onSidemenuSelect(e: ListSelectEvent) {\n\t\tconst id = (this.sourceData.sidemenu.items ?? [])[e.index]?.id;\n\t\tif (id == this.sidebar1ComponentId) {\n\t\t\tthis.toggleSidebar();\n\t\t} else {\n\t\t\tthis.toggleSidebar(true);\n\t\t\tthis.sidebar1ComponentId = id;\n\t\t\tthis.updateSidebarComponent();\n\t\t\tthis.dispatchEvent(new BucketEvent('sidebar.change'));\n\t\t}\n\t\tthis.dispatchStateEvent();\n\t}\n\n\tupdateSidebarComponent() {\n\t\tthis.sidebarHost.componentId = this.sidebar1ComponentId;\n\t}\n\n\tupdateMainComponent() {\n\t\tthis.container?.updateComponent(1);\n\t}\n\n\tasync openSidebarComponent(id: ComponentId) {\n\t\tthis.sidebar1ComponentId = id.toString();\n\t\tthis.showSidebar();\n\t\tthis.updateSidebarComponent();\n\t\tthis.sidemenu?.selectItem(id.toString());\n\t\tawait this.sidebarHost.updateComplete;\n\t}\n\n\t_onSidemenuToggle = () => this.toggleSidemenu();\n\n\tget sidemenuWidth() {\n\t\treturn this.sidemenuMode == 'wide' ? this.options.sidemenuWideWidth : constants.SIDEMENU_WIDTH;\n\t}\n\n\trenderSideMenu = () => this.sourceData.sidemenu.hidden ? html`` : html`\n\t\t<og-bucket-sidemenu\n\t\t\tstyle=${styleMap({minWidth: dom.px(this.sidemenuWidth)})}\n\t\t\t.mode=${this.sidemenuMode}\n\t\t\t?expandable=${this.options.sidemenuExpandable && !this.compact}\n\t\t\t.position=${this.options.sidebarPosition}\n\t\t\t@sidemenu.toggle=${this._onSidemenuToggle}\n\t\t\t@select=${this._onSidemenuSelect}\n\t\t\t.settings=${this.sourceData.sidemenu}>\n\t\t</og-bucket-sidemenu>\n\t`;\n\n\trender = () => html`\n\t\t<og-bucket-top></og-bucket-top>\n\n\t\t<div class=\"body\">\n\t\t\t<og-overlay></og-overlay>\n\t\t\t${this.options.sidebarPosition == 'left' ? this.renderSideMenu() : null}\n\t\t\t<div class=\"main\"></div>\n\t\t\t${this.options.sidebarPosition == 'right' ? this.renderSideMenu() : null}\n\t\t</div>\n\t`;\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bucket.js","sourceRoot":"","sources":["../../src/ui/bucket.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACN,GAAG,EAA6D,GAAG,EAC7C,cAAc,EAAkB,eAAe,EAErE,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAuD,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAsC,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,KAAK,MAAM,gBAAgB,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAiB,WAAW,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,cAAc,GAAiB;IACpC,GAAG,EAAE,EAAC,UAAU,EAAE,EAAE,EAAC;IACrB,QAAQ,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC;IACvD,OAAO,EAAE,EAA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AQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACF;AAGvB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sCACsB;AAG/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uCACV;AAIhB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACa;AAtC1B,MAAM;IADlB,aAAa,CAAC,WAAW,CAAC;GACd,MAAM,CAgelB","sourcesContent":["import {\n\tdom, Layout, ListSelectEvent, ComponentFactory, SplitContainer, log,\n\tComponentId, Overlay, OmegaComponent, ComponentState, ShortcutManager,\n SplitContainerItem\n} from '@omegagrid/core';\nimport { TabCloseEvent, TabEvent, TabItem, TabSplitContainer, TabSplitContainerModel } from '@omegagrid/tabs';\nimport { CommandManager, CommandResult, OpenCommandsOptions } from '@omegagrid/commands';\nimport { msg } from '@omegagrid/localize';\nimport { html, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport constants from '../constants';\nimport { BucketAlertOptions, BucketSource, BucketState, ModalSidebarOptions, OpenDialogOptions, OpenTabOptions, SidemenuMode } from '../types';\nimport { Sidemenu } from './sidemenu';\nimport style from './bucket.style';\nimport { BucketTop } from './top';\nimport { ComponentHost } from './componentHost';\nimport { BucketAlerts } from './bucket.alerts';\nimport { BucketOptions, initOptions } from '../options';\nimport { Sidebar } from './sidebar';\nimport { BucketComponents } from './bucket.components';\nimport { BucketSidebars } from './bucket.sidebars';\nimport { BucketDialogs } from './bucket.dialogs';\nimport { debounce } from 'ts-debounce';\n\nconst DEFAULT_SOURCE: BucketSource = {\n\ttop: {rightItems: []},\n\tsidemenu: {items: [], activeIndex: null, hidden: false},\n\tsidebar: {width: constants.SIDEBAR_WIDTH, collapsed: false},\n\teditorLayout: {items: []}\n};\n\nexport class BucketEvent extends Event {\n\ttab: TabItem;\n\tcomponentId: ComponentId;\n\n\tconstructor(type: string, args?: Partial<BucketEvent>) {\n\t\tsuper(`bucket.${type}`, {bubbles: true, composed: true});\n\t\tObject.assign(this, args);\n\t}\n\n}\n\n@customElement('og-bucket')\nexport class Bucket extends OmegaComponent<BucketState> implements Layout {\n\n\tstatic styles = [style];\n\tstatic uniqueId = 0;\n\tstatic getUniqueId = () => ++Bucket.uniqueId;\n\n\t@query('og-overlay')\n\toverlay: Overlay;\n\n\t@query('og-bucket-top')\n\ttop: BucketTop;\n\n\t@query('og-bucket-sidemenu')\n\tsidemenu: Sidemenu;\n\n\t@query('.body')\n\tbody: HTMLDivElement;\n\n\t@query('.main')\n\tmain: HTMLDivElement;\n\n\t@property({type: Object})\n\tcreateComponent: ComponentFactory;\n\n\t@property({type: Object})\n\tsourceData: BucketSource = DEFAULT_SOURCE;\n\n\t@property({type: Object})\n\toptions: BucketOptions;\n\n\t@property({type: Object})\n\tlogger: log.Logger = new log.Logger('Ωbucket');\n\n\t@property({type: Boolean})\n\tcompact = false;\n\n\t/** current width mode of the sidemenu, see `toggleSidemenu()` */\n\t@property({type: String})\n\tsidemenuMode: SidemenuMode = 'normal';\n\n\tsidebar1ComponentId: string;\n\n\treadonly components: BucketComponents;\n\treadonly sidebars: BucketSidebars;\n\treadonly alerts: BucketAlerts;\n\treadonly dialogs: BucketDialogs;\n\treadonly commands: CommandManager;\n\treadonly shortcuts: ShortcutManager;\n\n\tprivate _activeComponentId: ComponentId;\n\tget activeComponentId() { return this._activeComponentId }\n\n\tget sidebarIndex() { return this.options.sidebarPosition == 'left' ? 0 : 1 }\n\tget mainIndex() { return this.options.sidebarPosition == 'left' ? 1 : 0 }\n\n\tprivate _container: SplitContainer;\n\tget container(): SplitContainer {\n\t\tif (this._container) return this._container;\n\t\tthis._container = dom.createElement<SplitContainer>('og-splitcontainer');\n\t\tthis._container.orientation = 'horizontal';\n\n\t\tconst sidebarItem: SplitContainerItem = {\n\t\t\tsize: this.sourceData.sidebar?.width || constants.SIDEBAR_WIDTH,\n\t\t\tcollapsed: this.sourceData.sidebar?.collapsed || false\n\t\t};\n\n\t\tthis._container.items = [\n\t\t\tthis.sidebarIndex == 0 ? sidebarItem : {size: null},\n\t\t\tthis.sidebarIndex == 1 ? sidebarItem : {size: null},\n\t\t];\n\n\t\tthis._container.createComponent = this._createSplitContainerComponent;\n\t\tthis._container.addEventListener('splitContainer.resize', this._onSplitContainerResize);\n\t\treturn this._container;\n\t}\n\n\tprivate _editorContainer: TabSplitContainer;\n\tget editorContainer(): TabSplitContainer {\n\t\tif (this._editorContainer) return this._editorContainer;\n\t\tthis._editorContainer = dom.createElement<TabSplitContainer>('og-tabsplitcontainer');\n\t\tthis._editorContainer.style.height = '100%';\n\t\tthis._editorContainer.closable = true;\n\t\tthis._editorContainer.singleActive = true;\n\t\tthis._editorContainer.createComponent = this.createEditorComponent;\n\t\tthis._editorContainer.model = new TabSplitContainerModel(this.sourceData.editorLayout);\n\t\tthis._editorContainer.scrollableTabs = true;\n\t\tthis._editorContainer.addEventListener('tab.beforeRemove', this._onTabBeforeRemove);\n\t\tthis._editorContainer.addEventListener('tab.remove', this._onTabRemove);\n\t\tthis._editorContainer.addEventListener('tab.select', this._onTabSelect);\n\t\treturn this._editorContainer;\n\t}\n\n\tprivate _singleContainer: HTMLDivElement;\n\tget singleContainer() {\n\t\tif (this._singleContainer) return this._singleContainer;\n\t\tthis._singleContainer = dom.createElement('div');\n\t\tthis._singleContainer.style.height = '100%';\n\t\treturn this._singleContainer;\n\t}\n\n\tget mainContentContainer(): HTMLDivElement | TabSplitContainer {\n\t\treturn this.options?.componentMode == 'single' ? this.singleContainer : this.editorContainer;\n\t}\n\n\tprivate _sidebarHost: Sidebar;\n\tget sidebarHost() {\n\t\tif (this._sidebarHost) return this._sidebarHost;\n\t\tthis._sidebarHost = dom.createElement<Sidebar>('og-bucket-sidebar');\n\t\tthis._sidebarHost.bucket = this;\n\t\tthis._sidebarHost.componentId = this.sidebar1ComponentId;\n\t\treturn this._sidebarHost;\n\t}\n\n\tupdateContainerVisibility = debounce(() => {\n\t\tlet hasTabs = false;\n\t\tthis.editorContainer.walk((splitContainer, tabContainer) => {\n\t\t\tif (tabContainer.tabs?.items?.length) {\n\t\t\t\thasTabs = true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t});\n\t\tif (hasTabs) dom.showElement(this.editorContainer);\n\t\telse dom.hideElement(this.editorContainer);\n\t}, 100);\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis.components = new BucketComponents(this);\n\t\tthis.sidebars = new BucketSidebars(this);\n\t\tthis.alerts = new BucketAlerts(this);\n\t\tthis.dialogs = new BucketDialogs(this);\n\t\tthis.commands = new CommandManager(this);\n\t\tthis.shortcuts = new ShortcutManager(this);\n\n\t\tthis.options = initOptions();\n\t\tthis.logger.info('init');\n\n\t\tthis.addEventListener('state', (e: Event) => {\n\t\t\tif (e.target == this) return;\n\t\t\te.stopPropagation();\n\t\t\tthis.dispatchStateEvent();\n\t\t});\n\t}\n\n\tshowOverlay = () => this.overlay.show(this.body);\n\thideOverlay = () => this.overlay.hide();\n\n\t_onWindowBeforeUnload = (e: BeforeUnloadEvent) => {\n\t\tif (!this.options.unsavedWarning) return;\n\t\tif (!this.components.hasUnsavedComponents) return;\n\t\te.preventDefault();\n\t\te.returnValue = '';\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis.tabIndex = 0;\n\t\tthis.logger.info('connected');\n\t\twindow.addEventListener('beforeunload', this._onWindowBeforeUnload);\n\t}\n\n\tdisconnectedCallback() {\n\t\twindow.removeEventListener('beforeunload', this._onWindowBeforeUnload);\n\t}\n\n\tlayout() {\n\t\tthis.container?.layout();\n\t\tthis.top?.layout();\n\t\tthis.alerts.updatePositions(); // the alerts anchor to the main area, which moves with the sidemenu/top\n\t\tthis.dialogs?.items.forEach(dialog => dialog.isOpen && dialog.fixPosition());\n\t}\n\n\tsetSourceData(sourceData: BucketSource) {\n\t\tthis.sourceData = sourceData;\n\t\tif (sourceData.options) {\n\t\t\tthis.options = initOptions(sourceData.options, this.options);\n\t\t}\n\t}\n\n\tasync updated() {\n\t\tconst mainContainer = this.compact ? this.mainContentContainer : this.container;\n\n\t\tif (mainContainer.parentElement != this.main) {\n\t\t\tdom.empty(this.main);\n\t\t\tthis.main.appendChild(mainContainer);\n\t\t\tif (mainContainer instanceof LitElement) (mainContainer as LitElement).requestUpdate();\n\t\t}\n\n\t\tconst sidebarComponentId = (this.sourceData.sidemenu.items ?? [])[this.sourceData.sidemenu.activeIndex]?.id;\n\t\tif (sidebarComponentId) {\n\t\t\tthis.sidebar1ComponentId = sidebarComponentId;\n\t\t}\n\n\t\tawait this.container?.updateComplete;\n\t\tawait this.sidemenu?.updateComplete;\n\n\t\tthis.layout();\n\t}\n\n\tprivate _openComponent(item: OpenTabOptions) {\n\t\tconst singleMode = this.options?.componentMode == 'single';\n\t\tif (singleMode) {\n\t\t\tdom.empty(this.singleContainer);\n\t\t\tthis.singleContainer.appendChild(this.createEditorComponent(item.id));\n\t\t} else {\n\t\t\tthis.editorContainer.open(item);\n\t\t}\n\t}\n\n\tasync open(item: OpenTabOptions) {\n\t\tif (this.compact) this.hideSidebar();\n\n\t\tdom.showElement(this.mainContentContainer);\n\n\t\tconst component = item.component;\n\t\tif (component) {\n\t\t\titem.id = this.components.register(item.id, item.component);\n\t\t\tdelete item.component;\n\t\t\tthis._openComponent(item);\n\t\t\treturn component;\n\t\t}\n\n\t\tconst promise = this.components.waitFor(item.id);\n\t\tthis._openComponent(item);\n\t\tthis.dispatchStateEvent();\n\t\treturn promise;\n\t}\n\n\tasync openDialog(options: OpenDialogOptions) {\n\t\treturn await this.dialogs.open(options);\n\t}\n\n\topenMenu(options: OpenCommandsOptions): Promise<CommandResult|null> {\n\t\treturn this.commands.open(options);\n\t}\n\n\topenModalSidebar(options: ModalSidebarOptions) {\n\t\treturn this.sidebars.openModalSidebar(options);\n\t}\n\n\tasync toggleSidebar(open?: boolean) {\n\t\topen ??= this.compact ? this.sidebarHost.parentElement != this.main : this.container.items[this.sidebarIndex].collapsed;\n\t\tif (open) this.showSidebar();\n\t\telse this.hideSidebar();\n\t}\n\n\tasync hideSidebar() {\n\t\tif (this.compact) {\n\t\t\tif (this.sidebarHost.parentElement == this.main) {\n\t\t\t\tdom.empty(this.main);\n\t\t\t\tthis.main.appendChild(this.editorContainer);\n\t\t\t}\n\t\t} else {\n\t\t\tawait this.container.collapse(this.sidebarIndex, true);\n\t\t}\n\n\t\tthis.layout();\n\t}\n\n\tasync showSidebar() {\n\t\tif (this.compact) {\n\t\t\tif (this.sidebarHost.parentElement != this.main) {\n\t\t\t\tdom.empty(this.main);\n\t\t\t\tthis.main.appendChild(this.sidebarHost);\n\t\t\t}\n\t\t} else {\n\t\t\tawait this.container.collapse(this.sidebarIndex, false);\n\t\t}\n\n\t\tthis.layout();\n\t}\n\n\t/**\n\t * switches the sidemenu between normal and wide mode\n\t * @param wide target mode, toggles the current mode when omitted\n\t */\n\tasync toggleSidemenu(wide?: boolean) {\n\t\twide ??= this.sidemenuMode != 'wide';\n\t\tconst mode: SidemenuMode = wide ? 'wide' : 'normal';\n\t\tif (mode == this.sidemenuMode) return;\n\t\tthis.sidemenuMode = mode;\n\t\tawait this.updateComplete; // the new width is applied by render, updated() runs layout()\n\t\tif (this.sidebars.modalSidebars.length) this.sidebars.updateModalSidebarPositions();\n\t\tthis.dispatchEvent(new BucketEvent('sidemenu.change'));\n\t\tthis.dispatchStateEvent();\n\t}\n\n\tshowAlert(options: BucketAlertOptions) {\n\t\treturn this.alerts.addAlert(options);\n\t}\n\n\tcreateEditorComponent = (id: ComponentId) => {\n\t\treturn dom.createElement<ComponentHost>('og-bucket-component-host', {\n\t\t\tcomponentId: id,\n\t\t\tbucket: this,\n\t\t\tpathPosition: this.options.pathPosition\n\t\t});\n\t}\n\n\t_createSplitContainerComponent: ComponentFactory = (index: ComponentId) => {\n\t\tlet component: HTMLElement;\n\t\tif (index == this.sidebarIndex) {\n\t\t\t// primary sidebar\n\t\t\tthis.logger.info('create primary sidebar');\n\t\t\treturn this.sidebarHost;\n\t\t} else if (index == this.mainIndex) {\n\t\t\t// editor split container\n\t\t\tthis.logger.info('create editor container');\n\t\t\treturn this.mainContentContainer;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tcomponent = dom.createElement<HTMLElement>('div');\n\t\t\tcomponent.innerHTML = 'empty';\n\t\t}\n\n\t\treturn component;\n\t}\n\n\tgetState(): BucketState {\n\t\tconst item = this.container?.items[0];\n\t\treturn {\n\t\t\tsidebar: {\n\t\t\t\tselectedItem: this.sidebar1ComponentId,\n\t\t\t\twidth: item?.size,\n\t\t\t\tcollapsed: !!item?.collapsed\n\t\t\t},\n\t\t\tsidemenu: {\n\t\t\t\tmode: this.sidemenuMode\n\t\t\t},\n\t\t\tlayout: this.editorContainer?.model.getSourceData(),\n\t\t\tdialogs: [...Array.from(this.dialogs.items.entries()).map(\n\t\t\t\t([id, dialog]) => Object.assign({id: id}, dialog.getOptions())\n\t\t\t)],\n\t\t\tcomponents: [...this.components.components].reduce((acc, [id, component]) => {\n\t\t\t\tif ((component as OmegaComponent).getState) {\n\t\t\t\t\tconst componentState = (component as OmegaComponent).getState();\n\t\t\t\t\tif (componentState) acc[id] = componentState;\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t}, {} as Record<ComponentId, ComponentState>)\n\t\t};\n\t}\n\n\tasync setState(state: BucketState) {\n\t\tthis.state = state;\n\t\tconst selectedIndex = this.sourceData.sidemenu.items.findIndex(item => item.id == state.sidebar.selectedItem);\n\t\tif (selectedIndex >= 0) {\n\t\t\tthis.sourceData.sidemenu.activeIndex = selectedIndex;\n\t\t\tthis.sidebar1ComponentId = state.sidebar.selectedItem as string;\n\t\t}\n\t\tthis.sourceData.editorLayout = state.layout;\n\t\t// wide mode is restored only when the user can switch it back\n\t\tthis.sidemenuMode = this.options.sidemenuExpandable ? (state.sidemenu?.mode ?? 'normal') : 'normal';\n\t\tthis._editorContainer = null;\n\t\tthis.requestUpdate();\n\t\tawait this.updateComplete;\n\t\tthis.sidemenu?.requestUpdate();\n\t\tthis.updateSidebarComponent();\n\t\tthis.updateMainComponent();\n\t\tstate.dialogs?.forEach(opt => this.openDialog(opt));\n\n\t\tfor (const k in state.components) {\n\t\t\tthis.components.setState(k, state.components[k]);\n\t\t}\n\t}\n\n\t_onSplitContainerResize = () => {\n\t\tthis.top?.layout();\n\t\tthis.dispatchStateEvent();\n\t}\n\n\t_onTabRemove = (e: TabEvent) => {\n\t\tthis.components.unregister(e.tab.id);\n\t\tthis.dispatchEvent(new BucketEvent('close', {tab: e.tab, componentId: e.tab.id}));\n\t\tthis.dispatchStateEvent();\n\t}\n\n\t_onTabBeforeRemove = (e: TabCloseEvent) => {\n\t\tconst tabId = e.tab.id;\n\t\tif (this.components.unsavedComponents.has(tabId)) {\n\t\t\te.preventDefault();\n\n\t\t\tconst title = e.tab.title || e.tab.id;\n\t\t\tconst component = this.components.get(tabId) as { save?: () => void };\n\t\t\tconst saveSupported = typeof component?.save === 'function';\n\n\t\t\tconst text = saveSupported ? html`\n\t\t\t\t<div style=\"text-align: center\">\n\t\t\t\t\t<strong>${msg('Do you want to save the changes you made to {title}?', {data: {title}})}</strong>\n\t\t\t\t\t<div>${msg(\"Your changes will be lost if you don't save them.\")}</div>\n\t\t\t\t</div>\n\t\t\t` : null;\n\n\t\t\tthis.openMenu({\n\t\t\t\tmode: 'menu',\n\t\t\t\ttext: text,\n\t\t\t\tcontent: saveSupported ? 'save_discard_cancel' : 'discard_cancel',\n\t\t\t\toptions: {itemHeight: 30}\n\t\t\t}).then(answer => {\n\t\t\t\t// leaving the menu without an answer (click outside, Escape) means cancel -\n\t\t\t\t// unsaved changes must never be discarded by a dismissed prompt\n\t\t\t\tconst command = answer?.command?.id;\n\t\t\t\tif (command == null || command == 'cancel') return;\n\n\t\t\t\tif (command == 'save') component?.save?.();\n\n\t\t\t\tthis.components.unsavedComponents.delete(tabId);\n\t\t\t\te.resolveClose();\n\t\t\t});\n\t\t}\n\t}\n\n\t_onTabSelect = (e: TabEvent) => {\n\t\tif (e.tabs.topLevelComponent == this.editorContainer) {\n\t\t\tthis._activeComponentId = e.tab?.id;\n\t\t\tthis.dispatchEvent(new BucketEvent('activate', {tab: e.tab, componentId: e.tab?.id}));\n\t\t\tthis.dispatchStateEvent();\n\t\t}\n\t}\n\n\t_onSidemenuSelect(e: ListSelectEvent) {\n\t\tconst id = (this.sourceData.sidemenu.items ?? [])[e.index]?.id;\n\t\tif (id == this.sidebar1ComponentId) {\n\t\t\tthis.toggleSidebar();\n\t\t} else {\n\t\t\tthis.toggleSidebar(true);\n\t\t\tthis.sidebar1ComponentId = id;\n\t\t\tthis.updateSidebarComponent();\n\t\t\tthis.dispatchEvent(new BucketEvent('sidebar.change'));\n\t\t}\n\t\tthis.dispatchStateEvent();\n\t}\n\n\tupdateSidebarComponent() {\n\t\tthis.sidebarHost.componentId = this.sidebar1ComponentId;\n\t}\n\n\tupdateMainComponent() {\n\t\tthis.container?.updateComponent(1);\n\t}\n\n\tasync openSidebarComponent(id: ComponentId) {\n\t\tthis.sidebar1ComponentId = id.toString();\n\t\tthis.showSidebar();\n\t\tthis.updateSidebarComponent();\n\t\tthis.sidemenu?.selectItem(id.toString());\n\t\tawait this.sidebarHost.updateComplete;\n\t}\n\n\t_onSidemenuToggle = () => this.toggleSidemenu();\n\n\tget sidemenuWidth() {\n\t\treturn this.sidemenuMode == 'wide' ? this.options.sidemenuWideWidth : constants.SIDEMENU_WIDTH;\n\t}\n\n\trenderSideMenu = () => this.sourceData.sidemenu.hidden ? html`` : html`\n\t\t<og-bucket-sidemenu\n\t\t\tstyle=${styleMap({minWidth: dom.px(this.sidemenuWidth)})}\n\t\t\t.mode=${this.sidemenuMode}\n\t\t\t?expandable=${this.options.sidemenuExpandable && !this.compact}\n\t\t\t.position=${this.options.sidebarPosition}\n\t\t\t@sidemenu.toggle=${this._onSidemenuToggle}\n\t\t\t@select=${this._onSidemenuSelect}\n\t\t\t.settings=${this.sourceData.sidemenu}>\n\t\t</og-bucket-sidemenu>\n\t`;\n\n\trender = () => html`\n\t\t<og-bucket-top></og-bucket-top>\n\n\t\t<div class=\"body\">\n\t\t\t<og-overlay></og-overlay>\n\t\t\t${this.options.sidebarPosition == 'left' ? this.renderSideMenu() : null}\n\t\t\t<div class=\"main\"></div>\n\t\t\t${this.options.sidebarPosition == 'right' ? this.renderSideMenu() : null}\n\t\t</div>\n\t`;\n\n}\n"]}
|
package/dist/ui/bucketAlert.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, ColorTypes, Container, OmegaComponent } from '@omegagrid/core';
|
|
2
|
-
import { BucketAlertOptions } from '../types';
|
|
2
|
+
import { BucketAlertAction, BucketAlertOptions } from '../types';
|
|
3
3
|
export declare class AlertEvent extends Event {
|
|
4
4
|
constructor(type: string);
|
|
5
5
|
}
|
|
@@ -8,6 +8,8 @@ export declare class BucketAlert extends OmegaComponent {
|
|
|
8
8
|
options: BucketAlertOptions;
|
|
9
9
|
color: ColorTypes;
|
|
10
10
|
noCopy: boolean;
|
|
11
|
+
/** laid out by the parent instead of floating in the bucket, without the close button and the actions (e.g. in a history list) */
|
|
12
|
+
inline: boolean;
|
|
11
13
|
container: Container;
|
|
12
14
|
btnCopy: Button;
|
|
13
15
|
willUpdate(props: Map<PropertyKey, unknown>): void;
|
|
@@ -15,6 +17,9 @@ export declare class BucketAlert extends OmegaComponent {
|
|
|
15
17
|
close(dispatchEvent?: boolean): void;
|
|
16
18
|
updated(): Promise<void>;
|
|
17
19
|
copy: () => Promise<void>;
|
|
20
|
+
/** runs the action and closes the alert (unless `close: false`); a failing action leaves the message open */
|
|
21
|
+
runAction: (action: BucketAlertAction) => Promise<void>;
|
|
22
|
+
renderActions(): import("lit-html").TemplateResult<1>;
|
|
18
23
|
render: () => import("lit-html").TemplateResult<1>;
|
|
19
24
|
}
|
|
20
25
|
//# sourceMappingURL=bucketAlert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketAlert.d.ts","sourceRoot":"","sources":["../../src/ui/bucketAlert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAY,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAG1G,OAAO,EAAE,kBAAkB,EAAmB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"bucketAlert.d.ts","sourceRoot":"","sources":["../../src/ui/bucketAlert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAY,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAG1G,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAmB,MAAM,UAAU,CAAC;AAYlF,qBAAa,UAAW,SAAQ,KAAK;gBACxB,IAAI,EAAE,MAAM;CAGxB;AAED,qBAEa,WAAY,SAAQ,cAAc;IAE9C,MAAM,CAAC,MAAM,iCAAkC;IAG/C,OAAO,EAAE,kBAAkB,CAAC;IAG5B,KAAK,EAAE,UAAU,CAAC;IAGlB,MAAM,UAAS;IAEf,kIAAkI;IAElI,MAAM,UAAS;IAGf,SAAS,EAAE,SAAS,CAAC;IAGrB,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAM3C,OAAO,KAAK,QAAQ,GAQnB;IAED,KAAK,CAAC,aAAa,UAAO;IAKpB,OAAO;IASb,IAAI,sBAYH;IAED,6GAA6G;IAC7G,SAAS,GAAU,QAAQ,iBAAiB,mBAG3C;IAED,aAAa;IAgBb,MAAM,6CAqBJ;CAEF"}
|
package/dist/ui/bucketAlert.js
CHANGED
|
@@ -25,6 +25,8 @@ let BucketAlert = class BucketAlert extends OmegaComponent {
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments);
|
|
27
27
|
this.noCopy = false;
|
|
28
|
+
/** laid out by the parent instead of floating in the bucket, without the close button and the actions (e.g. in a history list) */
|
|
29
|
+
this.inline = false;
|
|
28
30
|
this.copy = async () => {
|
|
29
31
|
if (this.options?.content) {
|
|
30
32
|
try {
|
|
@@ -40,6 +42,12 @@ let BucketAlert = class BucketAlert extends OmegaComponent {
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
};
|
|
45
|
+
/** runs the action and closes the alert (unless `close: false`); a failing action leaves the message open */
|
|
46
|
+
this.runAction = async (action) => {
|
|
47
|
+
await action.exec(this);
|
|
48
|
+
if (action.close ?? true)
|
|
49
|
+
this.close();
|
|
50
|
+
};
|
|
43
51
|
this.render = () => html `
|
|
44
52
|
<div class="header">
|
|
45
53
|
<og-icon .icon="${this.iconSpec}"></og-icon>
|
|
@@ -59,6 +67,8 @@ let BucketAlert = class BucketAlert extends OmegaComponent {
|
|
|
59
67
|
<og-container class="body">
|
|
60
68
|
<div class="content" slot="content">${this.options?.content}</div>
|
|
61
69
|
</og-container>
|
|
70
|
+
|
|
71
|
+
${this.renderActions()}
|
|
62
72
|
`;
|
|
63
73
|
}
|
|
64
74
|
willUpdate(props) {
|
|
@@ -89,6 +99,22 @@ let BucketAlert = class BucketAlert extends OmegaComponent {
|
|
|
89
99
|
this.container.updateSliders();
|
|
90
100
|
}
|
|
91
101
|
}
|
|
102
|
+
renderActions() {
|
|
103
|
+
if (!this.options?.actions?.length)
|
|
104
|
+
return null;
|
|
105
|
+
return html `
|
|
106
|
+
<div class="actions">
|
|
107
|
+
${this.options.actions.map(action => html `
|
|
108
|
+
<og-button
|
|
109
|
+
text="${action.text}"
|
|
110
|
+
.icon="${action.icon ?? null}"
|
|
111
|
+
color="${action.color ?? ColorTypes.Accent}"
|
|
112
|
+
@click="${() => this.runAction(action)}">
|
|
113
|
+
</og-button>
|
|
114
|
+
`)}
|
|
115
|
+
</div>
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
92
118
|
};
|
|
93
119
|
BucketAlert.styles = [OmegaComponent.styles, style];
|
|
94
120
|
__decorate([
|
|
@@ -100,6 +126,9 @@ __decorate([
|
|
|
100
126
|
__decorate([
|
|
101
127
|
property({ type: Boolean })
|
|
102
128
|
], BucketAlert.prototype, "noCopy", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
property({ type: Boolean, reflect: true })
|
|
131
|
+
], BucketAlert.prototype, "inline", void 0);
|
|
103
132
|
__decorate([
|
|
104
133
|
query('.body')
|
|
105
134
|
], BucketAlert.prototype, "container", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketAlert.js","sourceRoot":"","sources":["../../src/ui/bucketAlert.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAU,UAAU,EAAuB,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,OAAO,GAAkD;IAC9D,MAAM,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC;IAC1C,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,oBAAoB,CAAC;IAChD,SAAS,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACpD,SAAS,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC;CAC7C,CAAC;AAEF,MAAM,OAAO,UAAW,SAAQ,KAAK;IACpC,YAAY,IAAY;QACvB,KAAK,CAAC,SAAS,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;IACzD,CAAC;CACD;AAIM,IAAM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AC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAA;;cAE/B,MAAM,CAAC,IAAI;eACV,MAAM,CAAC,IAAI,IAAI,IAAI;eACnB,MAAM,CAAC,KAAK,IAAI,UAAU,CAAC,MAAM;gBAChC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;;KAEvC,CAAC;;GAEH,CAAC;IACH,CAAC;;AArFM,kBAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,AAAjC,CAAkC;AAG/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACG;AAG5B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CACtB;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;2CACX;AAIf;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAC1B;AAGf;IADC,KAAK,CAAC,OAAO,CAAC;8CACM;AAGrB;IADC,KAAK,CAAC,OAAO,CAAC;4CACC;AArBJ,WAAW;IAFvB,aAAa,CAAC,iBAAiB,CAAC;IAChC,SAAS,CAAC,EAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAClB,WAAW,CAgHvB","sourcesContent":["import { Button, ColorTypes, Container, IconSpec, OmegaComponent, colorable, dom } from '@omegagrid/core';\nimport { html } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { BucketAlertAction, BucketAlertOptions, BucketAlertType } from '../types';\nimport { msg } from '@omegagrid/localize';\nimport { style } from './bucketAlert.style';\nimport constants from '../constants';\n\nconst typeMap: Record<BucketAlertType, [ColorTypes, string]> = {\n\t'info': [ColorTypes.Accent, 'circle-info'],\n\t'danger': [ColorTypes.Red, 'circle-exclamation'],\n\t'warning': [ColorTypes.Yellow, 'circle-exclamation'],\n\t'success': [ColorTypes.Green, 'circle-check']\n};\n\nexport class AlertEvent extends Event {\n\tconstructor(type: string) {\n\t\tsuper(`alert.${type}`, {bubbles: true, composed: true});\n\t}\n}\n\n@customElement('og-bucket-alert')\n@colorable({props: ['border']})\nexport class BucketAlert extends OmegaComponent {\n\n\tstatic styles = [OmegaComponent.styles, style];\n\t\n\t@property({type: Object})\n\toptions: BucketAlertOptions;\n\n\t@property({type: String, reflect: true})\n\tcolor: ColorTypes;\n\n\t@property({type: Boolean})\n\tnoCopy = false;\n\n\t/** laid out by the parent instead of floating in the bucket, without the close button and the actions (e.g. in a history list) */\n\t@property({type: Boolean, reflect: true})\n\tinline = false;\n\n\t@query('.body')\n\tcontainer: Container;\n\n\t@query('.copy')\n\tbtnCopy: Button;\n\n\twillUpdate(props: Map<PropertyKey, unknown>) {\n\t\tif (props.has('options')) {\n\t\t\tthis.color = this.options?.type ? typeMap[this.options.type][0] : ColorTypes.Accent;\n\t\t}\n\t}\n\n\tprivate get iconSpec() {\n\t\tif (this.options?.icon) return this.options.icon;\n\t\tconst icon: IconSpec = {icon: 'info'};\n\t\tif (this.options?.type) {\n\t\t\ticon.color = typeMap[this.options.type][0];\n\t\t\ticon.icon = typeMap[this.options.type][1];\n\t\t}\n\t\treturn icon;\n\t}\n\n\tclose(dispatchEvent = true) {\n\t\tdom.hideElement(this);\n\t\tif (dispatchEvent) this.dispatchEvent(new Event('close'));\n\t}\n\n\tasync updated() {\n\t\tawait this.container.updateComplete;\n\t\tconst h = this.container.scrollHeight;\n\t\tif (h > constants.ALERT_DEFAULT_HEIGHT) {\n\t\t\tthis.container.style.height = dom.px(Math.min(h, constants.ALERT_MAX_HEIGHT));\n\t\t\tthis.container.updateSliders();\n\t\t}\n\t}\n\n\tcopy = async () => {\n\t\tif (this.options?.content) {\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(this.options.content.toString());\n\t\t\t\tthis.btnCopy.text = msg('copied');\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to copy to clipboard:', error);\n\t\t\t\tthis.btnCopy.text = msg('failed');\n\t\t\t} finally {\n\t\t\t\tsetTimeout(() => this.btnCopy.text = '', 2000);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** runs the action and closes the alert (unless `close: false`); a failing action leaves the message open */\n\trunAction = async (action: BucketAlertAction) => {\n\t\tawait action.exec(this);\n\t\tif (action.close ?? true) this.close();\n\t}\n\n\trenderActions() {\n\t\tif (!this.options?.actions?.length) return null;\n\t\treturn html`\n\t\t\t<div class=\"actions\">\n\t\t\t\t${this.options.actions.map(action => html`\n\t\t\t\t\t<og-button\n\t\t\t\t\t\ttext=\"${action.text}\"\n\t\t\t\t\t\t.icon=\"${action.icon ?? null}\"\n\t\t\t\t\t\tcolor=\"${action.color ?? ColorTypes.Accent}\"\n\t\t\t\t\t\t@click=\"${() => this.runAction(action)}\">\n\t\t\t\t\t</og-button>\n\t\t\t\t`)}\n\t\t\t</div>\n\t\t`;\n\t}\n\n\trender = () => html`\n\t\t<div class=\"header\">\n\t\t\t<og-icon .icon=\"${this.iconSpec}\"></og-icon>\n\t\t\t<div class=\"title\">${this.options?.title}</div>\n\t\t\t${this.noCopy ? null : html`\n\t\t\t\t<og-button\n\t\t\t\t\tclass=\"copy\"\n\t\t\t\t\tcolor=\"transparent\"\n\t\t\t\t\ticon=\"copy\"\n\t\t\t\t\ttitle=\"${msg('Copy to clipboard')}\"\n\t\t\t\t\t@click=\"${this.copy}\">\n\t\t\t\t</og-button>\n\t\t\t`}\n\t\t\t<div class=\"close\" @click=\"${() => this.close()}\">×</div>\n\t\t</div>\n\n\t\t<og-container class=\"body\">\n\t\t\t<div class=\"content\" slot=\"content\">${this.options?.content}</div>\n\t\t</og-container>\n\n\t\t${this.renderActions()}\n\t`;\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketAlert.style.d.ts","sourceRoot":"","sources":["../../src/ui/bucketAlert.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"bucketAlert.style.d.ts","sourceRoot":"","sources":["../../src/ui/bucketAlert.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBA8EjB,CAAC"}
|
|
@@ -10,14 +10,30 @@ export const style = css `
|
|
|
10
10
|
display: block;
|
|
11
11
|
background-color: var(--og-background-color);
|
|
12
12
|
border: 1px solid var(--og-accent-color);
|
|
13
|
+
/* wide screens get a wider box (the alert stays legible at a distance), small ones the old 250-300 px */
|
|
13
14
|
min-width: 250px;
|
|
14
|
-
max-width: 300px;
|
|
15
|
-
transition: bottom 0.5s;
|
|
15
|
+
max-width: clamp(300px, 25vw, 480px);
|
|
16
|
+
transition: top 0.5s, bottom 0.5s;
|
|
16
17
|
position: absolute;
|
|
17
18
|
bottom: -100px;
|
|
18
19
|
box-shadow: 8px 8px 4px -3px var(--og-dialog-shadow);
|
|
19
20
|
z-index: 1000;
|
|
20
21
|
border-radius: var(--og-base-radius);
|
|
22
|
+
padding: 3px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* an inline alert is laid out by its parent (e.g. a history list), without the close button and the actions */
|
|
26
|
+
:host([inline]) {
|
|
27
|
+
position: static;
|
|
28
|
+
transition: none;
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
max-width: none;
|
|
31
|
+
z-index: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([inline]) .close,
|
|
35
|
+
:host([inline]) .actions {
|
|
36
|
+
display: none;
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
.header {
|
|
@@ -54,5 +70,13 @@ export const style = css `
|
|
|
54
70
|
.content {
|
|
55
71
|
padding: 5px;
|
|
56
72
|
}
|
|
73
|
+
|
|
74
|
+
.actions {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
gap: 5px;
|
|
79
|
+
padding: 0 5px 5px 5px;
|
|
80
|
+
}
|
|
57
81
|
`;
|
|
58
82
|
//# sourceMappingURL=bucketAlert.style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketAlert.style.js","sourceRoot":"","sources":["../../src/ui/bucketAlert.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"bucketAlert.style.js","sourceRoot":"","sources":["../../src/ui/bucketAlert.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAgER,SAAS,CAAC,oBAAoB;;;;;;;;;;;;;;CAc7C,CAAC","sourcesContent":["import { css } from 'lit';\nimport constants from '../constants';\n\nexport const style = css`\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\t\n\t:host {\n\t\tfont-size: var(--og-font-size);\n\t\tdisplay: block;\n\t\tbackground-color: var(--og-background-color);\n\t\tborder: 1px solid var(--og-accent-color);\n\t\t/* wide screens get a wider box (the alert stays legible at a distance), small ones the old 250-300 px */\n\t\tmin-width: 250px;\n\t\tmax-width: clamp(300px, 25vw, 480px);\n\t\ttransition: top 0.5s, bottom 0.5s;\n\t\tposition: absolute;\n\t\tbottom: -100px;\n\t\tbox-shadow: 8px 8px 4px -3px var(--og-dialog-shadow);\n\t\tz-index: 1000;\n\t\tborder-radius: var(--og-base-radius);\n\t\tpadding: 3px;\n\t}\n\n\t/* an inline alert is laid out by its parent (e.g. a history list), without the close button and the actions */\n\t:host([inline]) {\n\t\tposition: static;\n\t\ttransition: none;\n\t\tbox-shadow: none;\n\t\tmax-width: none;\n\t\tz-index: auto;\n\t}\n\n\t:host([inline]) .close,\n\t:host([inline]) .actions {\n\t\tdisplay: none;\n\t}\n\n\t.header {\n\t\theight: 20px;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\tgap: 3px;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tpadding-left: 2px;\n\t}\n\n\t.header .title {\n\t\tflex: 1;\n\t}\n\n\t.header .copy {\n\t\tflex: 0 0 auto;\n\t}\n\n\t.header .close {\n\t\theight: 100%;\n\t\tflex: 0 0 20px;\n\t\tline-height: 20px;\n\t\tcursor: pointer;\n\t\ttext-align: center;\n\t}\n\n\t.body {\n\t\tmax-height: 120px;\n\t\tmin-height: ${constants.ALERT_DEFAULT_HEIGHT}px;\n\t}\n\n\t.content {\n\t\tpadding: 5px;\n\t}\n\n\t.actions {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\tjustify-content: flex-end;\n\t\tgap: 5px;\n\t\tpadding: 0 5px 5px 5px;\n\t}\n`;\n"]}
|
package/dist/ui/sidemenu.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Sidemenu extends LitElement {
|
|
|
27
27
|
updateActiveIndex(): void;
|
|
28
28
|
firstUpdated(): void;
|
|
29
29
|
_itemRenderer: (div: HTMLDivElement, index: number) => Promise<void>;
|
|
30
|
-
renderToggle: () => import("lit-html").TemplateResult<1
|
|
30
|
+
renderToggle: () => "" | import("lit-html").TemplateResult<1>;
|
|
31
31
|
render: () => import("lit-html").TemplateResult<1>;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=sidemenu.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/bucket",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.26",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Application layout component",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@fortawesome/fontawesome-svg-core": "^7.0.1",
|
|
31
|
-
"@omegagrid/commands": "^0.11.
|
|
32
|
-
"@omegagrid/core": "^0.11.
|
|
33
|
-
"@omegagrid/dialog": "^0.11.
|
|
34
|
-
"@omegagrid/localize": "^0.11.
|
|
35
|
-
"@omegagrid/tabs": "^0.11.
|
|
31
|
+
"@omegagrid/commands": "^0.11.26",
|
|
32
|
+
"@omegagrid/core": "^0.11.26",
|
|
33
|
+
"@omegagrid/dialog": "^0.11.26",
|
|
34
|
+
"@omegagrid/localize": "^0.11.26",
|
|
35
|
+
"@omegagrid/tabs": "^0.11.26",
|
|
36
36
|
"lit": "^3.1.1",
|
|
37
37
|
"ts-debounce": "^4.0.0"
|
|
38
38
|
},
|