@omegagrid/core 0.9.9 → 0.9.10
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/common/logger.d.ts +5 -3
- package/dist/common/logger.d.ts.map +1 -1
- package/dist/common/logger.js +14 -10
- package/dist/common/logger.js.map +1 -1
- package/dist/ui/dropdownMenu.d.ts +1 -1
- package/dist/ui/dropdownMenu.d.ts.map +1 -1
- package/dist/ui/dropdownMenu.js +26 -32
- package/dist/ui/dropdownMenu.js.map +1 -1
- package/package.json +2 -2
package/dist/common/logger.d.ts
CHANGED
|
@@ -6,11 +6,12 @@ export declare enum LogLevel {
|
|
|
6
6
|
Trace = "t"
|
|
7
7
|
}
|
|
8
8
|
export declare class Logger {
|
|
9
|
-
readonly
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly name?: string;
|
|
10
11
|
styles: string[];
|
|
11
12
|
errorStyles: string[];
|
|
12
13
|
defaultLevel: LogLevel;
|
|
13
|
-
constructor(
|
|
14
|
+
constructor(id: string, name?: string);
|
|
14
15
|
private format;
|
|
15
16
|
log(message: string): void;
|
|
16
17
|
info(message: string): void;
|
|
@@ -19,5 +20,6 @@ export declare class Logger {
|
|
|
19
20
|
debug(message: string): void;
|
|
20
21
|
trace(message: string): void;
|
|
21
22
|
}
|
|
22
|
-
export declare function
|
|
23
|
+
export declare function registerLogger(id: string, name?: string): Logger;
|
|
24
|
+
export declare function getLogger(id?: string): Logger;
|
|
23
25
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IACnB,IAAI,MAAM;IACV,IAAI,MAAM;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;CACX;AAED,qBAAa,MAAM;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IACnB,IAAI,MAAM;IACV,IAAI,MAAM;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;CACX;AAED,qBAAa,MAAM;IAOjB,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IANhB,MAAM,WAA0D;IAChE,WAAW,WAA0D;IACrE,YAAY,WAAiB;gBAG1B,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,MAAM;IAKvB,OAAO,CAAC,MAAM;IAIP,GAAG,CAAC,OAAO,EAAE,MAAM;IAInB,IAAI,CAAC,OAAO,EAAE,MAAM;IAIpB,IAAI,CAAC,OAAO,EAAE,MAAM;IAIpB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK;IAKxC,KAAK,CAAC,OAAO,EAAE,MAAM;IAIrB,KAAK,CAAC,OAAO,EAAE,MAAM;CAI5B;AAID,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED,wBAAgB,SAAS,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAM7C"}
|
package/dist/common/logger.js
CHANGED
|
@@ -7,11 +7,13 @@ export var LogLevel;
|
|
|
7
7
|
LogLevel["Trace"] = "t";
|
|
8
8
|
})(LogLevel || (LogLevel = {}));
|
|
9
9
|
export class Logger {
|
|
10
|
-
constructor(name) {
|
|
10
|
+
constructor(id, name) {
|
|
11
|
+
this.id = id;
|
|
11
12
|
this.name = name;
|
|
12
13
|
this.styles = ['color: #ffff00', 'color: #00955d', 'color: #aaaaaa'];
|
|
13
14
|
this.errorStyles = ['color: #ff0000', 'color: #00955d', 'color: #aaaaaa'];
|
|
14
15
|
this.defaultLevel = LogLevel.Info;
|
|
16
|
+
this.name = name || id;
|
|
15
17
|
}
|
|
16
18
|
format(message, level) {
|
|
17
19
|
return `%c[${level}] %c${this.name.padEnd(20, ' ')} %c${message.padEnd(50, ' ')}`;
|
|
@@ -38,16 +40,18 @@ export class Logger {
|
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
const staticLoggers = new Map();
|
|
41
|
-
export function
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
return staticLoggers.entries().next().value[1];
|
|
45
|
-
else
|
|
46
|
-
name = name || 'Ω';
|
|
43
|
+
export function registerLogger(id, name) {
|
|
44
|
+
if (!staticLoggers.has(id)) {
|
|
45
|
+
staticLoggers.set(id, new Logger(id, name));
|
|
47
46
|
}
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return staticLoggers.get(id);
|
|
48
|
+
}
|
|
49
|
+
export function getLogger(id) {
|
|
50
|
+
if (id == null) {
|
|
51
|
+
id = (staticLoggers.size > 0 ? Array.from(staticLoggers.keys())[0] : null);
|
|
52
|
+
if (id == null)
|
|
53
|
+
return registerLogger('omega', 'Ω');
|
|
50
54
|
}
|
|
51
|
-
return
|
|
55
|
+
return registerLogger(id);
|
|
52
56
|
}
|
|
53
57
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IACnB,sBAAU,CAAA;IACV,sBAAU,CAAA;IACV,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,uBAAW,CAAA;AACZ,CAAC,EANW,QAAQ,KAAR,QAAQ,QAMnB;AAED,MAAM,OAAO,MAAM;IAMlB,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAMX;AAND,WAAY,QAAQ;IACnB,sBAAU,CAAA;IACV,sBAAU,CAAA;IACV,uBAAW,CAAA;IACX,uBAAW,CAA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{\n\tInfo = 'i',\n\tWarn = 'w',\n\tError = 'e',\n\tDebug = 'd',\n\tTrace = 't'\n}\n\nexport class Logger {\n\n\tpublic styles = ['color: #ffff00', 'color: #00955d', 'color: #aaaaaa'];\n\tpublic errorStyles = ['color: #ff0000', 'color: #00955d', 'color: #aaaaaa'];\n\tpublic defaultLevel = LogLevel.Info;\n\n\tconstructor(\n\t\treadonly id: string,\n\t\treadonly name?: string\n\t) {\n\t\tthis.name = name || id;\n\t}\n\n\tprivate format(message: string, level: LogLevel) : string {\n\t\treturn `%c[${level}] %c${this.name.padEnd(20, ' ')} %c${message.padEnd(50, ' ')}`;\n\t}\n\n\tpublic log(message: string) {\n\t\tconsole.log(message, ...this.styles);\n\t}\n\n\tpublic info(message: string) {\n\t\tconsole.info(this.format(message, LogLevel.Info), ...this.styles);\n\t}\n\n\tpublic warn(message: string) {\n\t\tconsole.info(this.format(message, LogLevel.Warn), ...this.styles);\n\t}\n\n\tpublic error(message: string, exception?: Error) {\n\t\tconsole.error(this.format(message, LogLevel.Error), ...this.errorStyles);\n\t\tif (exception) console.error(exception);\n\t}\n\n\tpublic debug(message: string) {\n\t\tconsole.info(this.format(message, LogLevel.Debug), ...this.styles);\n\t}\n\n\tpublic trace(message: string) {\n\t\tconsole.trace(this.format(message, LogLevel.Trace), ...this.styles);\n\t}\n\t\n}\n\nconst staticLoggers = new Map<string, Logger>();\n\nexport function registerLogger(id: string, name?: string): Logger {\n\tif (!staticLoggers.has(id)) {\n\t\tstaticLoggers.set(id, new Logger(id, name));\n\t}\n\treturn staticLoggers.get(id);\n}\n\nexport function getLogger(id?: string): Logger {\n\tif (id == null) {\n\t\tid = (staticLoggers.size > 0 ? Array.from(staticLoggers.keys())[0] : null);\n\t\tif (id == null) return registerLogger('omega', 'Ω');\n\t}\n\treturn registerLogger(id);\n}"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Dropdown } from './dropdown';
|
|
2
2
|
import { Menu, MenuItem } from './menu';
|
|
3
3
|
export declare class DropdownMenu extends Dropdown {
|
|
4
|
-
#private;
|
|
5
4
|
items: MenuItem[];
|
|
6
5
|
dynamicWidth: boolean;
|
|
6
|
+
private _menu;
|
|
7
7
|
get menu(): Menu;
|
|
8
8
|
constructor();
|
|
9
9
|
updated(props: Map<string, unknown>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdownMenu.d.ts","sourceRoot":"","sources":["../../src/ui/dropdownMenu.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAa,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEnD,qBACa,YAAa,SAAQ,QAAQ
|
|
1
|
+
{"version":3,"file":"dropdownMenu.d.ts","sourceRoot":"","sources":["../../src/ui/dropdownMenu.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAa,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEnD,qBACa,YAAa,SAAQ,QAAQ;IAGzC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAGlB,YAAY,UAAS;IAErB,OAAO,CAAC,KAAK,CAAO;IAEpB,IAAI,IAAI,SAoBP;;IAWD,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;CAQnC"}
|
package/dist/ui/dropdownMenu.js
CHANGED
|
@@ -4,56 +4,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
-
};
|
|
18
|
-
var _DropdownMenu_menu;
|
|
19
7
|
import { dom } from '../common';
|
|
20
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
21
9
|
import { Dropdown } from './dropdown';
|
|
22
10
|
import { MenuEvent } from './menu';
|
|
23
11
|
let DropdownMenu = class DropdownMenu extends Dropdown {
|
|
24
12
|
get menu() {
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
13
|
+
if (this._menu)
|
|
14
|
+
return this._menu;
|
|
15
|
+
this._menu = dom.createElement('og-menu', {
|
|
16
|
+
slot: 'inner-content',
|
|
17
|
+
dynamicWidth: this.dynamicWidth,
|
|
18
|
+
items: this.items,
|
|
19
|
+
style: {
|
|
20
|
+
border: 'none',
|
|
21
|
+
minWidth: '100%'
|
|
22
|
+
},
|
|
23
|
+
listeners: [
|
|
24
|
+
['render', () => this.layout()],
|
|
25
|
+
['menu.select', (e) => {
|
|
26
|
+
this.close();
|
|
27
|
+
this.dispatchEvent(new MenuEvent('select', e.item));
|
|
28
|
+
}]
|
|
29
|
+
]
|
|
36
30
|
});
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
return __classPrivateFieldGet(this, _DropdownMenu_menu, "f");
|
|
31
|
+
this.dropdown.appendChild(this._menu);
|
|
32
|
+
return this._menu;
|
|
40
33
|
}
|
|
41
34
|
constructor() {
|
|
42
35
|
super();
|
|
43
36
|
this.dynamicWidth = false;
|
|
44
|
-
_DropdownMenu_menu.set(this, void 0);
|
|
45
37
|
this.addEventListener('dropdown.beforeOpen', () => this.menu);
|
|
46
|
-
this.addEventListener('dropdown.open', () =>
|
|
38
|
+
this.addEventListener('dropdown.open', () => {
|
|
39
|
+
this.menu.focus();
|
|
40
|
+
setTimeout(() => this.layout(), 0);
|
|
41
|
+
});
|
|
47
42
|
}
|
|
48
43
|
updated(props) {
|
|
49
44
|
super.updated(props);
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
if (this._menu) {
|
|
46
|
+
this._menu.dynamicWidth = this.dynamicWidth;
|
|
47
|
+
this._menu.items = this.items;
|
|
53
48
|
}
|
|
54
49
|
}
|
|
55
50
|
};
|
|
56
|
-
_DropdownMenu_menu = new WeakMap();
|
|
57
51
|
__decorate([
|
|
58
52
|
property({ type: Array })
|
|
59
53
|
], DropdownMenu.prototype, "items", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdownMenu.js","sourceRoot":"","sources":["../../src/ui/dropdownMenu.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdownMenu.js","sourceRoot":"","sources":["../../src/ui/dropdownMenu.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAQ,SAAS,EAAY,MAAM,QAAQ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ClC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;YAC5C,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC/B,CAAC;IACF,CAAC;CAED,CAAA;AA9CA;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;2CACN;AAGlB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;kDACL;AANT,YAAY;IADxB,aAAa,CAAC,kBAAkB,CAAC;GACrB,YAAY,CAiDxB","sourcesContent":["import { dom } from '../common';\nimport { customElement, property } from 'lit/decorators.js';\nimport { Dropdown } from './dropdown';\nimport { Menu, MenuEvent, MenuItem } from './menu';\n\n@customElement(`og-dropdown-menu`)\nexport class DropdownMenu extends Dropdown {\n\n\t@property({type: Array})\n\titems: MenuItem[];\n\n\t@property({type: Boolean})\n\tdynamicWidth = false;\n\n\tprivate _menu: Menu;\n\n\tget menu() {\n\t\tif (this._menu) return this._menu;\n\t\tthis._menu = dom.createElement<Menu>('og-menu', {\n\t\t\tslot: 'inner-content',\n\t\t\tdynamicWidth: this.dynamicWidth,\n\t\t\titems: this.items,\n\t\t\tstyle: {\n\t\t\t\tborder: 'none',\n\t\t\t\tminWidth: '100%'\n\t\t\t},\n\t\t\tlisteners: [\n\t\t\t\t['render', () => this.layout()],\n\t\t\t\t['menu.select', (e: MenuEvent) => {\n\t\t\t\t\tthis.close();\n\t\t\t\t\tthis.dispatchEvent(new MenuEvent('select', e.item));\n\t\t\t\t}]\n\t\t\t]\n\t\t});\n\t\tthis.dropdown.appendChild(this._menu);\n\t\treturn this._menu;\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.addEventListener('dropdown.beforeOpen', () => this.menu);\n\t\tthis.addEventListener('dropdown.open', () => {\n\t\t\tthis.menu.focus();\n\t\t\tsetTimeout(() => this.layout(), 0);\n\t\t});\n\t}\n\n\tupdated(props: Map<string, unknown>) {\n\t\tsuper.updated(props);\n\t\tif (this._menu) {\n\t\t\tthis._menu.dynamicWidth = this.dynamicWidth;\n\t\t\tthis._menu.items = this.items;\n\t\t}\n\t}\n\t\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.10",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Core components",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@fortawesome/fontawesome-svg-core": "^7.0.1",
|
|
39
|
-
"@omegagrid/localize": "^0.9.
|
|
39
|
+
"@omegagrid/localize": "^0.9.10",
|
|
40
40
|
"color": "^4.2.3",
|
|
41
41
|
"date-fns": "^3.2.0",
|
|
42
42
|
"lit": "^3.1.1",
|