@omegagrid/statusbar 0.2.5

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.
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ LOCALE: string;
3
+ PREFIX: string;
4
+ DEFAULT_ACCENT_COLOR: string;
5
+ DEFAULT_ACCENT_COLOR_2: import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<any> | {
6
+ [key: string]: any;
7
+ }> | {
8
+ [key: string]: any;
9
+ }> | {
10
+ [key: string]: any;
11
+ }> | {
12
+ [key: string]: any;
13
+ }> | {
14
+ [key: string]: any;
15
+ }> | {
16
+ [key: string]: any;
17
+ }> | {
18
+ [key: string]: any;
19
+ }> | {
20
+ [key: string]: any;
21
+ }> | {
22
+ [key: string]: any;
23
+ }> | {
24
+ [key: string]: any;
25
+ }> | {
26
+ [key: string]: any;
27
+ }>;
28
+ SIZER_SIZE: number;
29
+ SLIDER_SIZE: number;
30
+ SLIDER_MIN_LENGTH: number;
31
+ EXPANDER_SIZE: number;
32
+ LIST_ITEM_HEIGHT: number;
33
+ LIST_RENDERING_TRESHOLD: number;
34
+ LIST_AUTOSCROLL_TRESHOLD: number;
35
+ LIST_AUTOSCROLL_DELAY: number;
36
+ DEFAULT_TEXT_HIGHLIGHT_COLOR: string;
37
+ TOOLTIP_MARGIN: number;
38
+ MENU_ITEM_HEIGHT: number;
39
+ COLORPICKER_COLOR_SIZE: number;
40
+ STATUSBAR_HEIGHT: number;
41
+ };
42
+ export default _default;
43
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAGC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@omegagrid/core");
4
+ exports.default = {
5
+ STATUSBAR_HEIGHT: 22,
6
+ ...core_1.constants
7
+ };
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;AAAA,0CAA6D;AAE7D,kBAAe;IACd,gBAAgB,EAAE,EAAE;IACpB,GAAG,gBAAa;CAChB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './ui';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ui"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB;AACrB,0CAAwB"}
@@ -0,0 +1,9 @@
1
+ import { ComponentId } from "@omegagrid/core";
2
+ export type StatusbarItemType = 'button' | 'custom';
3
+ export type StatusbarItem = {
4
+ id?: ComponentId;
5
+ type: StatusbarItemType;
6
+ icon?: string;
7
+ text?: string;
8
+ };
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAC,QAAQ,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG;IAC3B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './statusbar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./statusbar"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1,14 @@
1
+ import { ComponentFactory, Layout } from '@omegagrid/core';
2
+ import { LitElement } from 'lit';
3
+ import { StatusbarItem } from '../types';
4
+ export declare class Statusbar extends LitElement implements Layout {
5
+ static styles: import("lit").CSSResult[];
6
+ leftItems: StatusbarItem[];
7
+ rightItems: StatusbarItem[];
8
+ createComponent: ComponentFactory;
9
+ customComponents: HTMLDivElement;
10
+ private components;
11
+ layout(): void;
12
+ render: () => import("lit-html").TemplateResult<1>;
13
+ }
14
+ //# sourceMappingURL=statusbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusbar.d.ts","sourceRoot":"","sources":["../../src/ui/statusbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAY,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,qBAEa,SAAU,SAAQ,UAAW,YAAW,MAAM;IAE1D,MAAM,CAAC,MAAM,4BAAW;IAGxB,SAAS,EAAE,aAAa,EAAE,CAAC;IAG3B,UAAU,EAAE,aAAa,EAAE,CAAC;IAG5B,eAAe,EAAE,gBAAgB,CAAC;IAGlC,gBAAgB,EAAE,cAAc,CAAC;IAEjC,OAAO,CAAC,UAAU,CAAkC;IAEpD,MAAM;IAIN,MAAM,6CAgBJ;CAEF"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Statusbar = void 0;
10
+ const core_1 = require("@omegagrid/core");
11
+ const lit_1 = require("lit");
12
+ const decorators_js_1 = require("lit/decorators.js");
13
+ const map_js_1 = require("lit/directives/map.js");
14
+ const statusbar_style_1 = require("./statusbar.style");
15
+ let Statusbar = class Statusbar extends lit_1.LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.components = new Map();
19
+ this.render = () => (0, lit_1.html) `
20
+ <div id="left">
21
+ ${(0, map_js_1.map)(this.leftItems, item => item.type == 'button'
22
+ ? (0, lit_1.html) `<div class="item"><og-button icon="${item.icon}" text="${item.text}" color="transparent"></og-button></div>`
23
+ : (0, lit_1.html) `<div class="item custom">${this.createComponent(item.id)}</div>`)}
24
+ </div>
25
+
26
+ <div id="center"></div>
27
+
28
+ <div id="right">
29
+ ${(0, map_js_1.map)(this.rightItems, item => item.type == 'button'
30
+ ? (0, lit_1.html) `<div class="item"><og-button icon="${item.icon}" text="${item.text}" color="transparent"></og-button></div>`
31
+ : (0, lit_1.html) `<div class="item custom">${this.createComponent(item.id)}</div>`)}
32
+ </div>
33
+ `;
34
+ }
35
+ layout() {
36
+ //empty
37
+ }
38
+ };
39
+ exports.Statusbar = Statusbar;
40
+ Statusbar.styles = [statusbar_style_1.style];
41
+ __decorate([
42
+ (0, decorators_js_1.property)({ type: Array })
43
+ ], Statusbar.prototype, "leftItems", void 0);
44
+ __decorate([
45
+ (0, decorators_js_1.property)({ type: Array })
46
+ ], Statusbar.prototype, "rightItems", void 0);
47
+ __decorate([
48
+ (0, decorators_js_1.property)({ type: Object })
49
+ ], Statusbar.prototype, "createComponent", void 0);
50
+ __decorate([
51
+ (0, decorators_js_1.queryAll)('.itemcustom')
52
+ ], Statusbar.prototype, "customComponents", void 0);
53
+ exports.Statusbar = Statusbar = __decorate([
54
+ (0, decorators_js_1.customElement)('og-statusbar'),
55
+ (0, core_1.stylable)({ vars: ['accent-*', 'colortype-'] })
56
+ ], Statusbar);
57
+ //# sourceMappingURL=statusbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusbar.js","sourceRoot":"","sources":["../../src/ui/statusbar.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAAqE;AACrE,6BAAuC;AACvC,qDAAsE;AACtE,kDAA4C;AAE5C,uDAA0C;AAInC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,gBAAU;IAAlC;;QAgBE,eAAU,GAAG,IAAI,GAAG,EAAuB,CAAC;QAMpD,WAAM,GAAG,GAAG,EAAE,CAAC,IAAA,UAAI,EAAA;;KAEf,IAAA,YAAG,EAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ;YAClD,CAAC,CAAC,IAAA,UAAI,EAAA,sCAAsC,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,0CAA0C;YACnH,CAAC,CAAC,IAAA,UAAI,EAAA,4BAA4B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CACvE;;;;;;KAMC,IAAA,YAAG,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,QAAQ;YACnD,CAAC,CAAC,IAAA,UAAI,EAAA,sCAAsC,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,IAAI,0CAA0C;YACnH,CAAC,CAAC,IAAA,UAAI,EAAA,4BAA4B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CACvE;;EAEF,CAAC;IAEH,CAAC;IAtBA,MAAM;QACL,OAAO;IACR,CAAC;;AApBW,8BAAS;AAEd,gBAAM,GAAG,CAAC,uBAAK,CAAC,AAAV,CAAW;AAGxB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;4CACG;AAG3B;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;6CACI;AAG5B;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;kDACS;AAGlC;IADC,IAAA,wBAAQ,EAAC,aAAa,CAAC;mDACS;oBAdrB,SAAS;IAFrB,IAAA,6BAAa,EAAC,cAAc,CAAC;IAC7B,IAAA,eAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC,EAAC,CAAC;GAChC,SAAS,CAwCrB"}
@@ -0,0 +1,2 @@
1
+ export declare const style: import("lit").CSSResult;
2
+ //# sourceMappingURL=statusbar.style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusbar.style.d.ts","sourceRoot":"","sources":["../../src/ui/statusbar.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBA4CjB,CAAC"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.style = void 0;
7
+ const lit_1 = require("lit");
8
+ const constants_1 = __importDefault(require("../constants"));
9
+ exports.style = (0, lit_1.css) `
10
+ * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ :host {
15
+ display: block;
16
+ height: ${constants_1.default.STATUSBAR_HEIGHT}px;
17
+ line-height: ${constants_1.default.STATUSBAR_HEIGHT}px;
18
+ background-color: var(--accent-color-alpha-70);
19
+ display: flex;
20
+ flex-direction: row;
21
+ }
22
+
23
+ #right, #left {
24
+ display: flex;
25
+ flex-direction: row;
26
+ }
27
+
28
+ #left {
29
+ justify-content: flex-start;
30
+ flex: 0;
31
+ }
32
+
33
+ #center {
34
+ flex: 1;
35
+ }
36
+
37
+ #right {
38
+ flex: 0;
39
+ justify-content: flex-end;
40
+ }
41
+
42
+ .item {
43
+ height: 100%;
44
+ }
45
+
46
+ .item > * {
47
+ box-sizing: border-box;
48
+ height: 100%;
49
+ color: #ffffff;
50
+ padding: 0 4px;
51
+ }
52
+
53
+ `;
54
+ //# sourceMappingURL=statusbar.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statusbar.style.js","sourceRoot":"","sources":["../../src/ui/statusbar.style.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA0B;AAC1B,6DAAqC;AAExB,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;YAOZ,mBAAS,CAAC,gBAAgB;iBACrB,mBAAS,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoC1C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@omegagrid/statusbar",
3
+ "version": "0.2.5",
4
+ "license": "UNLICENSED",
5
+ "description": "Statusbar component",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "./dist/**/*"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/cechi/omegagrid.git"
14
+ },
15
+ "bugs": "https://github.com/cechi/omegagrid/issues",
16
+ "author": {
17
+ "name": "Petr Čechura",
18
+ "email": "p.cechura@gmail.com",
19
+ "url": "https://cechura.eu"
20
+ },
21
+ "scripts": {
22
+ "watch": "tsc --watch",
23
+ "build": "tsc --project tsconfig.json",
24
+ "test": "jest --passWithNoTests",
25
+ "lint": "eslint **/src/**/*.ts",
26
+ "_prepack": "yarn build",
27
+ "_prepublish": "yarn test && yarn lint"
28
+ },
29
+ "dependencies": {
30
+ "@lit/localize": "^0.12.1",
31
+ "@omegagrid/core": "^0.2.5",
32
+ "@omegagrid/tree": "^0.2.5",
33
+ "lit": "^3.1.1",
34
+ "lit-html": "^3.1.1",
35
+ "ts-debounce": "^4.0.0"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/core": "^7.18.13",
39
+ "@types/jest": "^29.5.11",
40
+ "@types/node": "^20.11.5",
41
+ "@types/webpack": "^5.28.0",
42
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
43
+ "@typescript-eslint/parser": "^6.19.0",
44
+ "astroturf": "^1.2.0",
45
+ "babel-jest": "^29.7.0",
46
+ "babel-loader": "^9.1.3",
47
+ "eslint": "^8.56.0",
48
+ "jest": "^29.7.0",
49
+ "jest-environment-jsdom": "^29.7.0",
50
+ "ts-jest": "^29.1.1",
51
+ "ts-loader": "^9.5.1",
52
+ "ts-node": "^10.9.2",
53
+ "typescript": "5.3.2",
54
+ "webpack": "^5.89.0",
55
+ "webpack-cli": "^5.1.4",
56
+ "webpack-dev-server": "^4.15.1",
57
+ "webpack-merge": "^5.10.0"
58
+ }
59
+ }