@omegagrid/core 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.
- package/dist/common/actions.d.ts +16 -0
- package/dist/common/actions.d.ts.map +1 -0
- package/dist/common/actions.js +19 -0
- package/dist/common/actions.js.map +1 -0
- package/dist/common/colors.d.ts +25 -0
- package/dist/common/colors.d.ts.map +1 -0
- package/dist/common/colors.js +54 -0
- package/dist/common/colors.js.map +1 -0
- package/dist/common/csv.d.ts +23 -0
- package/dist/common/csv.d.ts.map +1 -0
- package/dist/common/csv.js +99 -0
- package/dist/common/csv.js.map +1 -0
- package/dist/common/dates.d.ts +13 -0
- package/dist/common/dates.d.ts.map +1 -0
- package/dist/common/dates.js +118 -0
- package/dist/common/dates.js.map +1 -0
- package/dist/common/dom.d.ts +79 -0
- package/dist/common/dom.d.ts.map +1 -0
- package/dist/common/dom.js +242 -0
- package/dist/common/dom.js.map +1 -0
- package/dist/common/html.d.ts +3 -0
- package/dist/common/html.d.ts.map +1 -0
- package/dist/common/html.js +33 -0
- package/dist/common/html.js.map +1 -0
- package/dist/common/index.d.ts +14 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +43 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/linkedList.d.ts +24 -0
- package/dist/common/linkedList.d.ts.map +1 -0
- package/dist/common/linkedList.js +70 -0
- package/dist/common/linkedList.js.map +1 -0
- package/dist/common/logger.d.ts +23 -0
- package/dist/common/logger.d.ts.map +1 -0
- package/dist/common/logger.js +58 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/matrix.d.ts +6 -0
- package/dist/common/matrix.d.ts.map +1 -0
- package/dist/common/matrix.js +24 -0
- package/dist/common/matrix.js.map +1 -0
- package/dist/common/mixin.d.ts +4 -0
- package/dist/common/mixin.d.ts.map +1 -0
- package/dist/common/mixin.js +3 -0
- package/dist/common/mixin.js.map +1 -0
- package/dist/common/numbers.d.ts +18 -0
- package/dist/common/numbers.d.ts.map +1 -0
- package/dist/common/numbers.js +209 -0
- package/dist/common/numbers.js.map +1 -0
- package/dist/common/options.d.ts +10 -0
- package/dist/common/options.d.ts.map +1 -0
- package/dist/common/options.js +22 -0
- package/dist/common/options.js.map +1 -0
- package/dist/common/tree.d.ts +68 -0
- package/dist/common/tree.d.ts.map +1 -0
- package/dist/common/tree.js +190 -0
- package/dist/common/tree.js.map +1 -0
- package/dist/common/utils.d.ts +15 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/utils.js +92 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/constants.d.ts +45 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +29 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/model/adapter.d.ts +8 -0
- package/dist/model/adapter.d.ts.map +1 -0
- package/dist/model/adapter.js +17 -0
- package/dist/model/adapter.js.map +1 -0
- package/dist/model/componentStore.d.ts +11 -0
- package/dist/model/componentStore.d.ts.map +1 -0
- package/dist/model/componentStore.js +26 -0
- package/dist/model/componentStore.js.map +1 -0
- package/dist/model/index.d.ts +5 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +21 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/plugins.d.ts +13 -0
- package/dist/model/plugins.d.ts.map +1 -0
- package/dist/model/plugins.js +29 -0
- package/dist/model/plugins.js.map +1 -0
- package/dist/model/ui.d.ts +19 -0
- package/dist/model/ui.d.ts.map +1 -0
- package/dist/model/ui.js +16 -0
- package/dist/model/ui.js.map +1 -0
- package/dist/styling/index.d.ts +3 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +10 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/stylable.d.ts +10 -0
- package/dist/styling/stylable.d.ts.map +1 -0
- package/dist/styling/stylable.js +43 -0
- package/dist/styling/stylable.js.map +1 -0
- package/dist/styling/styleManager.d.ts +20 -0
- package/dist/styling/styleManager.d.ts.map +1 -0
- package/dist/styling/styleManager.js +126 -0
- package/dist/styling/styleManager.js.map +1 -0
- package/dist/themes.d.ts +7 -0
- package/dist/themes.d.ts.map +1 -0
- package/dist/themes.js +163 -0
- package/dist/themes.js.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +14 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/accordion.d.ts +12 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +94 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert.d.ts +15 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +106 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/attributeTable.d.ts +8 -0
- package/dist/ui/attributeTable.d.ts.map +1 -0
- package/dist/ui/attributeTable.js +39 -0
- package/dist/ui/attributeTable.js.map +1 -0
- package/dist/ui/baseElement.d.ts +7 -0
- package/dist/ui/baseElement.d.ts.map +1 -0
- package/dist/ui/baseElement.js +15 -0
- package/dist/ui/baseElement.js.map +1 -0
- package/dist/ui/button.d.ts +20 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +98 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/button.style.d.ts +2 -0
- package/dist/ui/button.style.d.ts.map +1 -0
- package/dist/ui/button.style.js +72 -0
- package/dist/ui/button.style.js.map +1 -0
- package/dist/ui/checkbox.d.ts +14 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +59 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/colorpicker.d.ts +15 -0
- package/dist/ui/colorpicker.d.ts.map +1 -0
- package/dist/ui/colorpicker.js +160 -0
- package/dist/ui/colorpicker.js.map +1 -0
- package/dist/ui/container.d.ts +26 -0
- package/dist/ui/container.d.ts.map +1 -0
- package/dist/ui/container.js +240 -0
- package/dist/ui/container.js.map +1 -0
- package/dist/ui/dropdown.d.ts +32 -0
- package/dist/ui/dropdown.d.ts.map +1 -0
- package/dist/ui/dropdown.js +197 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/dropdownMenu.d.ts +12 -0
- package/dist/ui/dropdownMenu.d.ts.map +1 -0
- package/dist/ui/dropdownMenu.js +58 -0
- package/dist/ui/dropdownMenu.js.map +1 -0
- package/dist/ui/expander.d.ts +28 -0
- package/dist/ui/expander.d.ts.map +1 -0
- package/dist/ui/expander.js +151 -0
- package/dist/ui/expander.js.map +1 -0
- package/dist/ui/icon.d.ts +24 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +77 -0
- package/dist/ui/icon.js.map +1 -0
- package/dist/ui/images.d.ts +2 -0
- package/dist/ui/images.d.ts.map +1 -0
- package/dist/ui/images.js +17 -0
- package/dist/ui/images.js.map +1 -0
- package/dist/ui/index.d.ts +25 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +41 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input.d.ts +11 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +67 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/list.d.ts +67 -0
- package/dist/ui/list.d.ts.map +1 -0
- package/dist/ui/list.js +362 -0
- package/dist/ui/list.js.map +1 -0
- package/dist/ui/loader.d.ts +9 -0
- package/dist/ui/loader.d.ts.map +1 -0
- package/dist/ui/loader.js +40 -0
- package/dist/ui/loader.js.map +1 -0
- package/dist/ui/menu.d.ts +36 -0
- package/dist/ui/menu.d.ts.map +1 -0
- package/dist/ui/menu.js +154 -0
- package/dist/ui/menu.js.map +1 -0
- package/dist/ui/menu.style.d.ts +3 -0
- package/dist/ui/menu.style.d.ts.map +1 -0
- package/dist/ui/menu.style.js +45 -0
- package/dist/ui/menu.style.js.map +1 -0
- package/dist/ui/overlay.d.ts +17 -0
- package/dist/ui/overlay.d.ts.map +1 -0
- package/dist/ui/overlay.js +95 -0
- package/dist/ui/overlay.js.map +1 -0
- package/dist/ui/overlay.style.d.ts +2 -0
- package/dist/ui/overlay.style.d.ts.map +1 -0
- package/dist/ui/overlay.style.js +49 -0
- package/dist/ui/overlay.style.js.map +1 -0
- package/dist/ui/panel.d.ts +24 -0
- package/dist/ui/panel.d.ts.map +1 -0
- package/dist/ui/panel.js +131 -0
- package/dist/ui/panel.js.map +1 -0
- package/dist/ui/panel.style.d.ts +2 -0
- package/dist/ui/panel.style.d.ts.map +1 -0
- package/dist/ui/panel.style.js +66 -0
- package/dist/ui/panel.style.js.map +1 -0
- package/dist/ui/sizer.d.ts +44 -0
- package/dist/ui/sizer.d.ts.map +1 -0
- package/dist/ui/sizer.js +216 -0
- package/dist/ui/sizer.js.map +1 -0
- package/dist/ui/slider.d.ts +41 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +228 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sortableList.d.ts +33 -0
- package/dist/ui/sortableList.d.ts.map +1 -0
- package/dist/ui/sortableList.js +159 -0
- package/dist/ui/sortableList.js.map +1 -0
- package/dist/ui/splitContainer.d.ts +37 -0
- package/dist/ui/splitContainer.d.ts.map +1 -0
- package/dist/ui/splitContainer.js +201 -0
- package/dist/ui/splitContainer.js.map +1 -0
- package/dist/ui/splitContainer.style.d.ts +2 -0
- package/dist/ui/splitContainer.style.d.ts.map +1 -0
- package/dist/ui/splitContainer.style.js +46 -0
- package/dist/ui/splitContainer.style.js.map +1 -0
- package/dist/ui/tooltip.d.ts +23 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +163 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/tooltip.style.d.ts +2 -0
- package/dist/ui/tooltip.style.d.ts.map +1 -0
- package/dist/ui/tooltip.style.js +114 -0
- package/dist/ui/tooltip.style.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributeTable.d.ts","sourceRoot":"","sources":["../../src/ui/attributeTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAEa,cAAe,SAAQ,UAAU;IAE7C,MAAM,CAAC,MAAM,4BAAW;IAGxB,KAAK,EAAE,WAAW,EAAE,CAAC;IAErB,MAAM,6CASJ;CAEF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.AttributeTable = void 0;
|
|
10
|
+
const lit_1 = require("lit");
|
|
11
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
12
|
+
const map_js_1 = require("lit/directives/map.js");
|
|
13
|
+
const styling_1 = require("../styling");
|
|
14
|
+
const button_style_1 = require("./button.style");
|
|
15
|
+
let AttributeTable = class AttributeTable extends lit_1.LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.render = () => (0, lit_1.html) `
|
|
19
|
+
<table>
|
|
20
|
+
${(0, map_js_1.map)(this.items, item => (0, lit_1.html) `
|
|
21
|
+
<tr>
|
|
22
|
+
<th>${item.k}</th>
|
|
23
|
+
<td>${item.v}</td>
|
|
24
|
+
</tr>
|
|
25
|
+
`)}
|
|
26
|
+
</table>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.AttributeTable = AttributeTable;
|
|
31
|
+
AttributeTable.styles = [button_style_1.style];
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, decorators_js_1.property)({ type: Array })
|
|
34
|
+
], AttributeTable.prototype, "items", void 0);
|
|
35
|
+
exports.AttributeTable = AttributeTable = __decorate([
|
|
36
|
+
(0, decorators_js_1.customElement)(`og-attributetable`),
|
|
37
|
+
(0, styling_1.stylable)({ vars: ['font-size', 'background-color'] })
|
|
38
|
+
], AttributeTable);
|
|
39
|
+
//# sourceMappingURL=attributeTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributeTable.js","sourceRoot":"","sources":["../../src/ui/attributeTable.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6BAAuC;AACvC,qDAA4D;AAC5D,kDAA4C;AAC5C,wCAAsC;AACtC,iDAAuC;AAKhC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,gBAAU;IAAvC;;QAON,WAAM,GAAG,GAAG,EAAE,CAAC,IAAA,UAAI,EAAA;;KAEf,IAAA,YAAG,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAA,UAAI,EAAA;;WAEtB,IAAI,CAAC,CAAC;WACN,IAAI,CAAC,CAAC;;IAEb,CAAC;;EAEH,CAAC;IAEH,CAAC;;AAlBY,wCAAc;AAEnB,qBAAM,GAAG,CAAC,oBAAK,CAAC,AAAV,CAAW;AAGxB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;6CACH;yBALT,cAAc;IAF1B,IAAA,6BAAa,EAAC,mBAAmB,CAAC;IAClC,IAAA,kBAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAC,EAAC,CAAC;GACvC,cAAc,CAkB1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseElement.d.ts","sourceRoot":"","sources":["../../src/ui/baseElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,qBAAa,cAAe,SAAQ,KAAK;CAAI;AAE7C,qBAAa,WAAY,SAAQ,UAAU;IAE1C,SAAgB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;CAE/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseElement = exports.ComponentEvent = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
class ComponentEvent extends Event {
|
|
6
|
+
}
|
|
7
|
+
exports.ComponentEvent = ComponentEvent;
|
|
8
|
+
class BaseElement extends lit_1.LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.customProperties = {};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.BaseElement = BaseElement;
|
|
15
|
+
//# sourceMappingURL=baseElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseElement.js","sourceRoot":"","sources":["../../src/ui/baseElement.ts"],"names":[],"mappings":";;;AAAA,6BAAiC;AAEjC,MAAa,cAAe,SAAQ,KAAK;CAAI;AAA7C,wCAA6C;AAE7C,MAAa,WAAY,SAAQ,gBAAU;IAA3C;;QAEiB,qBAAgB,GAA4B,EAAE,CAAC;IAEhE,CAAC;CAAA;AAJD,kCAIC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ColorTypes } from '../types';
|
|
3
|
+
import { IconSpec } from './icon';
|
|
4
|
+
export declare class Button extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
icon: string | IconSpec;
|
|
7
|
+
text: string;
|
|
8
|
+
color: ColorTypes;
|
|
9
|
+
caret: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
default: boolean;
|
|
12
|
+
state: 'checked' | 'unchecked';
|
|
13
|
+
type: 'normal' | 'toggle';
|
|
14
|
+
buttonIcon: IconSpec;
|
|
15
|
+
constructor();
|
|
16
|
+
willUpdate(props: Map<PropertyKey, undefined>): void;
|
|
17
|
+
get hasContent(): string | boolean;
|
|
18
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,qBAEa,MAAO,SAAQ,UAAU;IAErC,MAAM,CAAC,MAAM,4BAAW;IAGxB,IAAI,EAAE,MAAM,GAAC,QAAQ,CAAC;IAGtB,IAAI,EAAE,MAAM,CAAQ;IAGpB,KAAK,EAAE,UAAU,CAAqB;IAGtC,KAAK,UAAS;IAGd,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAGhB,KAAK,EAAE,SAAS,GAAC,WAAW,CAAQ;IAGpC,IAAI,EAAE,QAAQ,GAAC,QAAQ,CAAY;IAGnC,UAAU,EAAE,QAAQ,CAAC;;IAYrB,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC;IAgB7C,IAAI,UAAU,qBAA2F;IAEzG,MAAM,6CAWJ;CAEF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
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.Button = void 0;
|
|
10
|
+
const lit_1 = require("lit");
|
|
11
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
12
|
+
const types_1 = require("../types");
|
|
13
|
+
const styling_1 = require("../styling");
|
|
14
|
+
const button_style_1 = require("./button.style");
|
|
15
|
+
const class_map_js_1 = require("lit-html/directives/class-map.js");
|
|
16
|
+
const common_1 = require("../common");
|
|
17
|
+
let Button = class Button extends lit_1.LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.text = null;
|
|
21
|
+
this.color = types_1.ColorTypes.Accent;
|
|
22
|
+
this.caret = false;
|
|
23
|
+
this.disabled = false;
|
|
24
|
+
this.default = false;
|
|
25
|
+
this.state = null;
|
|
26
|
+
this.type = 'normal';
|
|
27
|
+
this.render = () => (0, lit_1.html) `
|
|
28
|
+
<div class="${(0, class_map_js_1.classMap)({ inner: true, 'has-content': this.hasContent })}">
|
|
29
|
+
${this.buttonIcon ? (0, lit_1.html) `<og-icon .icon="${this.buttonIcon}"></og-icon>` : (0, lit_1.html) ``}
|
|
30
|
+
${this.hasContent ? (0, lit_1.html) `
|
|
31
|
+
<div class="content">${this.text == null || this.text === ''
|
|
32
|
+
? (0, lit_1.html) `<slot name="content"></slot>`
|
|
33
|
+
: (0, lit_1.html) `${this.text}`}
|
|
34
|
+
</div>
|
|
35
|
+
` : (0, lit_1.html) ``}
|
|
36
|
+
${this.caret ? (0, lit_1.html) `<og-fa-icon icon="caret-down" style="margin: 0 2px 0 4px">` : ''}
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
39
|
+
this.addEventListener('click', (e) => {
|
|
40
|
+
if (this.disabled)
|
|
41
|
+
e.stopImmediatePropagation();
|
|
42
|
+
else if (this.type == 'toggle') {
|
|
43
|
+
this.state = this.state == 'checked' ? 'unchecked' : 'checked';
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
willUpdate(props) {
|
|
48
|
+
if (this.type == 'toggle' && this.state == null) {
|
|
49
|
+
this.state = 'unchecked';
|
|
50
|
+
}
|
|
51
|
+
if (props.has('icon')) {
|
|
52
|
+
if (common_1.utils.isObject(this.icon)) {
|
|
53
|
+
this.buttonIcon = this.icon;
|
|
54
|
+
}
|
|
55
|
+
else if (this.icon) {
|
|
56
|
+
this.buttonIcon = { icon: this.icon };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.buttonIcon = null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
get hasContent() { return this.text || (this.children.length > 0 && this.children[0].slot == 'content'); }
|
|
64
|
+
};
|
|
65
|
+
exports.Button = Button;
|
|
66
|
+
Button.styles = [button_style_1.style];
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, decorators_js_1.property)()
|
|
69
|
+
], Button.prototype, "icon", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, decorators_js_1.property)({ type: String })
|
|
72
|
+
], Button.prototype, "text", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
75
|
+
], Button.prototype, "color", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
78
|
+
], Button.prototype, "caret", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
81
|
+
], Button.prototype, "disabled", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, decorators_js_1.property)({ type: Boolean, reflect: true })
|
|
84
|
+
], Button.prototype, "default", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
87
|
+
], Button.prototype, "state", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
90
|
+
], Button.prototype, "type", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, decorators_js_1.state)()
|
|
93
|
+
], Button.prototype, "buttonIcon", void 0);
|
|
94
|
+
exports.Button = Button = __decorate([
|
|
95
|
+
(0, decorators_js_1.customElement)(`og-button`),
|
|
96
|
+
(0, styling_1.stylable)({ vars: ['font-size', 'background-color'], colorType: ['color', 'border', 'background'] })
|
|
97
|
+
], Button);
|
|
98
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6BAAuC;AACvC,qDAAmE;AACnE,oCAAsC;AACtC,wCAAsC;AACtC,iDAAuC;AACvC,mEAA4D;AAE5D,sCAAkC;AAI3B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,gBAAU;IA+BrC;QACC,KAAK,EAAE,CAAC;QAxBT,SAAI,GAAW,IAAI,CAAC;QAGpB,UAAK,GAAe,kBAAU,CAAC,MAAM,CAAC;QAGtC,UAAK,GAAG,KAAK,CAAC;QAGd,aAAQ,GAAG,KAAK,CAAC;QAGjB,YAAO,GAAG,KAAK,CAAC;QAGhB,UAAK,GAA0B,IAAI,CAAC;QAGpC,SAAI,GAAsB,QAAQ,CAAC;QAiCnC,WAAM,GAAG,GAAG,EAAE,CAAC,IAAA,UAAI,EAAA;gBACJ,IAAA,uBAAQ,EAAC,EAAC,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EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oCACL;AAGnC;IADC,IAAA,qBAAK,GAAE;0CACa;iBA7BT,MAAM;IAFlB,IAAA,6BAAa,EAAC,WAAW,CAAC;IAC1B,IAAA,kBAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAC,CAAC;GACrF,MAAM,CAwElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.style.d.ts","sourceRoot":"","sources":["../../src/ui/button.style.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,yBAkEjB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.style = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
exports.style = (0, lit_1.css) `
|
|
6
|
+
* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
font-size: var(--font-size);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
padding: 2px;
|
|
17
|
+
outline: none;
|
|
18
|
+
//border-radius: 2px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([default]) {
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([state=unchecked]) {
|
|
27
|
+
border-color: var(--background-color);
|
|
28
|
+
background-color: var(--background-color);
|
|
29
|
+
color: var(--text-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([disabled]), :host([disabled]:hover) {
|
|
33
|
+
background-color: gray;
|
|
34
|
+
border-color: var(--border-color);
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
opacity: 0.5;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host(:hover) {
|
|
40
|
+
opacity: 0.8;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
og-icon {
|
|
44
|
+
flex: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
div.inner {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: row;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
height: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
div.content {
|
|
56
|
+
flex: 1 0;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.has-content og-icon {
|
|
63
|
+
margin: 0 4px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
og-icon+.content {
|
|
67
|
+
margin-left: 4px;
|
|
68
|
+
margin-right: 4px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
`;
|
|
72
|
+
//# sourceMappingURL=button.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.style.js","sourceRoot":"","sources":["../../src/ui/button.style.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AACb,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEvB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export type CheckboxState = 'none' | 'checked' | 'indeterminable' | 'unchecked';
|
|
3
|
+
export declare class Checkbox extends LitElement {
|
|
4
|
+
static defaultIconSet: string;
|
|
5
|
+
static defaultAlternateIconSet: string;
|
|
6
|
+
get iconSet(): string;
|
|
7
|
+
get alternateIconSet(): string;
|
|
8
|
+
static styles: import("lit").CSSResult;
|
|
9
|
+
value: CheckboxState;
|
|
10
|
+
color: string;
|
|
11
|
+
get icon(): string;
|
|
12
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/ui/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAK5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAShF,qBACa,QAAS,SAAQ,UAAU;IAEvC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC;IAC9B,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC;IAEvC,IAAI,OAAO,IAAI,MAAM,CAA0D;IAC/E,IAAI,gBAAgB,IAAI,MAAM,CAAmE;IAEjG,MAAM,CAAC,MAAM,0BAYX;IAGF,KAAK,EAAE,aAAa,CAAU;IAG9B,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,IAAI,WAAgE;IAExE,MAAM,6CAKJ;CAEF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
var Checkbox_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Checkbox = void 0;
|
|
11
|
+
const lit_1 = require("lit");
|
|
12
|
+
const style_map_js_1 = require("lit-html/directives/style-map.js");
|
|
13
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
14
|
+
const fontawesome_svg_core_1 = require("@fortawesome/fontawesome-svg-core");
|
|
15
|
+
const iconMap = {
|
|
16
|
+
'none': '',
|
|
17
|
+
'checked': '-check',
|
|
18
|
+
'indeterminable': '-minus',
|
|
19
|
+
'unchecked': '-xmark',
|
|
20
|
+
};
|
|
21
|
+
let Checkbox = Checkbox_1 = class Checkbox extends lit_1.LitElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.value = 'none';
|
|
25
|
+
this.render = () => (0, lit_1.html) `
|
|
26
|
+
<og-fa-icon
|
|
27
|
+
.icon="${[this.value == 'checked' || this.value == 'unchecked' ? this.iconSet : this.alternateIconSet, this.icon]}"
|
|
28
|
+
style="${(0, style_map_js_1.styleMap)({ color: this.color })}">
|
|
29
|
+
</og-fa-icon>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
get iconSet() { return Checkbox_1.defaultIconSet || fontawesome_svg_core_1.config.styleDefault; }
|
|
33
|
+
get alternateIconSet() { return Checkbox_1.defaultAlternateIconSet || fontawesome_svg_core_1.config.styleDefault; }
|
|
34
|
+
get icon() { return 'square' + (this.value ? iconMap[this.value] : ''); }
|
|
35
|
+
};
|
|
36
|
+
exports.Checkbox = Checkbox;
|
|
37
|
+
Checkbox.styles = (0, lit_1.css) `
|
|
38
|
+
:host([value="checked"]) {
|
|
39
|
+
color: var(--accent-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
:host([value="unchecked"]) {
|
|
43
|
+
color: '#ff0000';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([value="none"]) {
|
|
47
|
+
color: '#666666';
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, decorators_js_1.property)({ type: String, reflect: true })
|
|
52
|
+
], Checkbox.prototype, "value", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, decorators_js_1.property)({ type: String })
|
|
55
|
+
], Checkbox.prototype, "color", void 0);
|
|
56
|
+
exports.Checkbox = Checkbox = Checkbox_1 = __decorate([
|
|
57
|
+
(0, decorators_js_1.customElement)('og-checkbox')
|
|
58
|
+
], Checkbox);
|
|
59
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/ui/checkbox.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6BAA4C;AAC5C,mEAA4D;AAC5D,qDAA4D;AAC5D,4EAA2D;AAI3D,MAAM,OAAO,GAAkC;IAC9C,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,QAAQ;IACnB,gBAAgB,EAAE,QAAQ;IAC1B,WAAW,EAAE,QAAQ;CACrB,CAAC;AAGK,IAAM,QAAQ,gBAAd,MAAM,QAAS,SAAQ,gBAAU;IAAjC;;QAuBN,UAAK,GAAkB,MAAM,CAAC;QAO9B,WAAM,GAAG,GAAG,EAAE,CAAC,IAAA,UAAI,EAAA;;YAER,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC;YACxG,IAAA,uBAAQ,EAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC;;EAEvC,CAAC;IAEH,CAAC;IAhCA,IAAI,OAAO,KAAa,OAAO,UAAQ,CAAC,cAAc,IAAI,6BAAM,CAAC,YAAY,CAAA,CAAC,CAAC;IAC/E,IAAI,gBAAgB,KAAa,OAAO,UAAQ,CAAC,uBAAuB,IAAI,6BAAM,CAAC,YAAY,CAAA,CAAC,CAAC;IAsBjG,IAAI,IAAI,KAAK,OAAO,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC;;AA5B5D,4BAAQ;AAQb,eAAM,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;EAYlB,AAZY,CAYX;AAGF;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACV;AAG9B;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;uCACX;mBA1BF,QAAQ;IADpB,IAAA,6BAAa,EAAC,aAAa,CAAC;GAChB,QAAQ,CAqCpB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ColorpickerEvent extends Event {
|
|
3
|
+
readonly color: string;
|
|
4
|
+
constructor(type: string, color: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class Colorpicker extends LitElement {
|
|
7
|
+
static styles: import("lit").CSSResult;
|
|
8
|
+
colors: string[][];
|
|
9
|
+
color: string;
|
|
10
|
+
input: HTMLInputElement;
|
|
11
|
+
firstUpdated(): void;
|
|
12
|
+
willUpdate(): void;
|
|
13
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=colorpicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorpicker.d.ts","sourceRoot":"","sources":["../../src/ui/colorpicker.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AA6C5C,qBAAa,gBAAiB,SAAQ,KAAK;aAEA,KAAK,EAAE,MAAM;gBAA3C,IAAI,EAAE,MAAM,EAAkB,KAAK,EAAE,MAAM;CAGvD;AAED,qBAEa,WAAY,SAAQ,UAAU;IAE1C,MAAM,CAAC,MAAM,0BAiCX;IAGF,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IAGnB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,gBAAgB,CAAC;IAExB,YAAY;IAwBZ,UAAU;IAOV,MAAM,6CAcJ;CAEF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Colorpicker = exports.ColorpickerEvent = void 0;
|
|
13
|
+
const constants_1 = __importDefault(require("../constants"));
|
|
14
|
+
const lit_1 = require("lit");
|
|
15
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
16
|
+
const map_js_1 = require("lit/directives/map.js");
|
|
17
|
+
const class_map_js_1 = require("lit/directives/class-map.js");
|
|
18
|
+
const color_1 = __importDefault(require("color"));
|
|
19
|
+
const common_1 = require("../common");
|
|
20
|
+
const styling_1 = require("../styling");
|
|
21
|
+
const colors_1 = require("../common/colors");
|
|
22
|
+
const baseColors = [
|
|
23
|
+
'#808080',
|
|
24
|
+
'#961e1d',
|
|
25
|
+
'#ba2f2a',
|
|
26
|
+
'#ed1b24',
|
|
27
|
+
'#F1631B',
|
|
28
|
+
'#F7941D',
|
|
29
|
+
'#FFC210',
|
|
30
|
+
'#FEF200',
|
|
31
|
+
'#CADB2A',
|
|
32
|
+
'#87BE2F',
|
|
33
|
+
'#66B032',
|
|
34
|
+
'#2E913E',
|
|
35
|
+
'#006F3C',
|
|
36
|
+
'#007071',
|
|
37
|
+
'#008DB1',
|
|
38
|
+
'#00ADF1',
|
|
39
|
+
'#008FD5',
|
|
40
|
+
'#0274BB',
|
|
41
|
+
'#0054AE',
|
|
42
|
+
'#2F3397',
|
|
43
|
+
'#573498',
|
|
44
|
+
'#6B3499',
|
|
45
|
+
'#92278F',
|
|
46
|
+
'#B91B8A',
|
|
47
|
+
'#EA028C',
|
|
48
|
+
];
|
|
49
|
+
const createColors = (rows) => {
|
|
50
|
+
const colors = [];
|
|
51
|
+
for (let l = 0; l <= 100; l += 100 / rows) {
|
|
52
|
+
colors.push(baseColors.map(c => (0, color_1.default)(c).hsl().l(l).hex().toString()));
|
|
53
|
+
}
|
|
54
|
+
return colors;
|
|
55
|
+
};
|
|
56
|
+
class ColorpickerEvent extends Event {
|
|
57
|
+
constructor(type, color) {
|
|
58
|
+
super(`${type}`);
|
|
59
|
+
this.color = color;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.ColorpickerEvent = ColorpickerEvent;
|
|
63
|
+
let Colorpicker = class Colorpicker extends lit_1.LitElement {
|
|
64
|
+
constructor() {
|
|
65
|
+
super(...arguments);
|
|
66
|
+
this.render = () => (0, lit_1.html) `
|
|
67
|
+
<table>
|
|
68
|
+
${(0, map_js_1.map)(this.colors, row => (0, lit_1.html) `<tr>
|
|
69
|
+
${(0, map_js_1.map)(row, color => (0, lit_1.html) `<td>
|
|
70
|
+
<div
|
|
71
|
+
class="${(0, class_map_js_1.classMap)({ color: true, selected: this.color == color })}"
|
|
72
|
+
data-color="${color}"
|
|
73
|
+
style="background: ${color}">
|
|
74
|
+
</div>
|
|
75
|
+
</td>`)}
|
|
76
|
+
</tr>`)}
|
|
77
|
+
</table>
|
|
78
|
+
|
|
79
|
+
<input type="text">
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
firstUpdated() {
|
|
83
|
+
common_1.dom.on(this, 'click', '.color', (_e, elm) => {
|
|
84
|
+
this.color = elm.dataset.color;
|
|
85
|
+
this.dispatchEvent(new ColorpickerEvent('select', this.color));
|
|
86
|
+
});
|
|
87
|
+
common_1.dom.on(this, 'mousemove', '.color', (_e, elm) => {
|
|
88
|
+
if (this.input.value != elm.dataset.color) {
|
|
89
|
+
const color = elm.dataset.color;
|
|
90
|
+
this.input.value = color;
|
|
91
|
+
this.input.style.color = (0, colors_1.getComplmentaryColor)(color);
|
|
92
|
+
this.input.style.backgroundColor = color;
|
|
93
|
+
this.dispatchEvent(new ColorpickerEvent('preview', color));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
this.addEventListener('mouseout', () => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
this.input.value = (_a = this.color) !== null && _a !== void 0 ? _a : '';
|
|
99
|
+
this.input.style.color = this.color ? (0, colors_1.getComplmentaryColor)(this.color) : '';
|
|
100
|
+
this.input.style.backgroundColor = (_b = this.color) !== null && _b !== void 0 ? _b : '';
|
|
101
|
+
this.dispatchEvent(new ColorpickerEvent('previewEnd', this.color));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
willUpdate() {
|
|
105
|
+
if (this.color && this.color[0] != '#')
|
|
106
|
+
this.color = `#${this.color}`;
|
|
107
|
+
if (!this.colors || this.colors.length == 0) {
|
|
108
|
+
this.colors = createColors(5);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
exports.Colorpicker = Colorpicker;
|
|
113
|
+
Colorpicker.styles = (0, lit_1.css) `
|
|
114
|
+
* { box-sizing: border-box }
|
|
115
|
+
|
|
116
|
+
:host {
|
|
117
|
+
display: inline-block;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.color {
|
|
121
|
+
width: ${constants_1.default.COLORPICKER_COLOR_SIZE}px;
|
|
122
|
+
height: ${constants_1.default.COLORPICKER_COLOR_SIZE}px;
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
border: 2px solid transparent;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.color:hover, .color.selected {
|
|
128
|
+
border-color: var(--accent-color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
table {
|
|
132
|
+
border: 1px solid var(--accent-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
input {
|
|
136
|
+
border-width: 0;
|
|
137
|
+
outline: none;
|
|
138
|
+
height: 100%;
|
|
139
|
+
flex: 1;
|
|
140
|
+
width: 100%;
|
|
141
|
+
background-color: var(--background-color);
|
|
142
|
+
color: var(--text-color);
|
|
143
|
+
border: 1px solid var(--accent-color);
|
|
144
|
+
text-align: center;
|
|
145
|
+
}
|
|
146
|
+
`;
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, decorators_js_1.property)({ type: Array })
|
|
149
|
+
], Colorpicker.prototype, "colors", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, decorators_js_1.property)({ type: String })
|
|
152
|
+
], Colorpicker.prototype, "color", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, decorators_js_1.query)('input')
|
|
155
|
+
], Colorpicker.prototype, "input", void 0);
|
|
156
|
+
exports.Colorpicker = Colorpicker = __decorate([
|
|
157
|
+
(0, decorators_js_1.customElement)('og-colorpicker'),
|
|
158
|
+
(0, styling_1.stylable)({ vars: ['accent-color', 'background-color', 'text-color'] })
|
|
159
|
+
], Colorpicker);
|
|
160
|
+
//# sourceMappingURL=colorpicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorpicker.js","sourceRoot":"","sources":["../../src/ui/colorpicker.ts"],"names":[],"mappings":";;;;;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AAO,CAAC;0CACS;sBA5CZ,WAAW;IAFvB,IAAA,6BAAa,EAAC,gBAAgB,CAAC;IAC/B,IAAA,kBAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,cAAc,EAAG,kBAAkB,EAAE,YAAY,CAAC,EAAC,CAAC;GACzD,WAAW,CA6FvB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class Container extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
content: string;
|
|
5
|
+
overscroll: boolean;
|
|
6
|
+
inner: HTMLDivElement;
|
|
7
|
+
private verticalSliderRef;
|
|
8
|
+
private horizontalSliderRef;
|
|
9
|
+
private resizeObserver;
|
|
10
|
+
private touchStart;
|
|
11
|
+
private _mouseIn;
|
|
12
|
+
get isScrolling(): boolean;
|
|
13
|
+
fixScrollPosition(): void;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
scrollVerticalByPixels(deltaY: number): boolean;
|
|
17
|
+
scrollVerticalTo(top: number): void;
|
|
18
|
+
scrollHorizontalByPixels(deltaX: number): boolean;
|
|
19
|
+
scrollHorizontalTo(left: number): void;
|
|
20
|
+
firstUpdated(): void;
|
|
21
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
22
|
+
get scrollHeight(): number;
|
|
23
|
+
get scrollWidth(): number;
|
|
24
|
+
updateSliders(): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/ui/container.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAK5C,qBACa,SAAU,SAAQ,UAAU;IAExC,MAAM,CAAC,MAAM,0BAsBX;IAGF,OAAO,EAAE,MAAM,CAAC;IAGhB,UAAU,UAAS;IAGnB,KAAK,EAAE,cAAc,CAAC;IAEtB,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,mBAAmB,CAA4B;IACvD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,QAAQ,CAAS;IAEzB,IAAI,WAAW,YAA6F;IAE5G,iBAAiB;IAQjB,iBAAiB;IAQjB,oBAAoB;IAOpB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAc/C,gBAAgB,CAAC,GAAG,EAAE,MAAM;IAQ5B,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAQjD,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAO/B,YAAY;IA4DZ,MAAM,6CAIJ;IAEF,IAAI,YAAY,WAEf;IAED,IAAI,WAAW,WAEd;IAED,aAAa;CAoCb"}
|