@openremote/or-icon 1.0.3 → 1.2.0-snapshot.20240512155407
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/umd/index.bundle.js +50 -463
- package/dist/umd/index.bundle.js.LICENSE.txt +17 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +49 -0
- package/lib/index.js.map +1 -0
- package/lib/or-icon-set.d.ts +9 -0
- package/lib/or-icon-set.js +1 -0
- package/lib/or-icon-set.js.map +1 -0
- package/mdi-font-copy.js +17 -0
- package/mdi-iconset-generator.js +35 -0
- package/package.json +17 -13
- package/.project +0 -17
- package/.settings/org.eclipse.buildship.core.prefs +0 -2
- package/LICENSE.txt +0 -2359
- package/dist/index.d.ts +0 -16
- package/dist/index.js +0 -86
package/dist/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues, TemplateResult } from "lit-element";
|
|
2
|
-
import { AssetDescriptor } from "@openremote/model";
|
|
3
|
-
import { ORIconSets } from "@openremote/core";
|
|
4
|
-
export declare function getAssetDescriptorIconTemplate(descriptor: AssetDescriptor | undefined, fallbackColor?: string | undefined, fallbackIcon?: string | undefined, overrideColor?: string | undefined, overrideIcon?: string | undefined): TemplateResult;
|
|
5
|
-
export declare const IconSets: ORIconSets;
|
|
6
|
-
export declare class OrIcon extends LitElement {
|
|
7
|
-
static get styles(): import("lit-element").CSSResult;
|
|
8
|
-
icon?: string;
|
|
9
|
-
protected _iconElement?: Element;
|
|
10
|
-
protected _handler: (evt: Event) => void;
|
|
11
|
-
protected render(): TemplateResult;
|
|
12
|
-
disconnectedCallback(): void;
|
|
13
|
-
protected shouldUpdate(changedProperties: PropertyValues): boolean;
|
|
14
|
-
protected _updateIcon(requestUpdate: boolean): void;
|
|
15
|
-
protected _onIconsetAdded(evt: Event): void;
|
|
16
|
-
}
|
package/dist/index.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { css, customElement, html, LitElement, property } from "lit-element";
|
|
8
|
-
import { AssetType } from "@openremote/model";
|
|
9
|
-
import { IconSetAddedEvent, ORIconSets, AssetModelUtil } from "@openremote/core";
|
|
10
|
-
export function getAssetDescriptorIconTemplate(descriptor, fallbackColor, fallbackIcon, overrideColor, overrideIcon) {
|
|
11
|
-
const color = overrideColor ? overrideColor : AssetModelUtil.getAssetDescriptorColor(descriptor, fallbackColor);
|
|
12
|
-
const icon = overrideIcon ? overrideIcon : AssetModelUtil.getAssetDescriptorIcon(descriptor, fallbackIcon);
|
|
13
|
-
return html `<or-icon style="--or-icon-fill: ${color ? "#" + color : "unset"}" icon="${icon ? icon : AssetType.THING.icon}"></or-icon>`;
|
|
14
|
-
}
|
|
15
|
-
const _iconSets = new ORIconSets();
|
|
16
|
-
export const IconSets = _iconSets;
|
|
17
|
-
// language=CSS
|
|
18
|
-
const style = css `
|
|
19
|
-
|
|
20
|
-
:host {
|
|
21
|
-
--internal-or-icon-width: var(--or-icon-width, 24px);
|
|
22
|
-
--internal-or-icon-height: var(--or-icon-height, 24px);
|
|
23
|
-
--internal-or-icon-fill: var(--or-icon-fill, currentColor);
|
|
24
|
-
--internal-or-icon-stroke: var(--or-icon-fill, none);
|
|
25
|
-
--internal-or-icon-stroke-width: var(--or-icon-stroke-width, 0);
|
|
26
|
-
|
|
27
|
-
display: inline-block;
|
|
28
|
-
position: relative;
|
|
29
|
-
vertical-align: text-bottom;
|
|
30
|
-
fill: var(--internal-or-icon-fill);
|
|
31
|
-
stroke: var(--internal-or-icon-stroke);
|
|
32
|
-
stroke-width: var(--internal-or-icon-stroke-width);
|
|
33
|
-
width: var(--internal-or-icon-width);
|
|
34
|
-
height: var(--internal-or-icon-height);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([hidden]) {
|
|
38
|
-
display: none;
|
|
39
|
-
}
|
|
40
|
-
`;
|
|
41
|
-
let OrIcon = class OrIcon extends LitElement {
|
|
42
|
-
constructor() {
|
|
43
|
-
super(...arguments);
|
|
44
|
-
this._handler = (evt) => {
|
|
45
|
-
this._onIconsetAdded(evt);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
static get styles() {
|
|
49
|
-
return style;
|
|
50
|
-
}
|
|
51
|
-
render() {
|
|
52
|
-
return html `${this._iconElement}`;
|
|
53
|
-
}
|
|
54
|
-
disconnectedCallback() {
|
|
55
|
-
super.disconnectedCallback();
|
|
56
|
-
window.removeEventListener(IconSetAddedEvent.NAME, this._handler);
|
|
57
|
-
}
|
|
58
|
-
shouldUpdate(changedProperties) {
|
|
59
|
-
if (changedProperties.has("icon")) {
|
|
60
|
-
this._updateIcon(false);
|
|
61
|
-
}
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
_updateIcon(requestUpdate) {
|
|
65
|
-
this._iconElement = undefined;
|
|
66
|
-
window.removeEventListener(IconSetAddedEvent.NAME, this._handler);
|
|
67
|
-
this._iconElement = IconSets.getIcon(this.icon);
|
|
68
|
-
if (this.icon && !this._iconElement) {
|
|
69
|
-
window.addEventListener(IconSetAddedEvent.NAME, this._handler);
|
|
70
|
-
}
|
|
71
|
-
if (requestUpdate) {
|
|
72
|
-
this.requestUpdate();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
_onIconsetAdded(evt) {
|
|
76
|
-
this._updateIcon(true);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
__decorate([
|
|
80
|
-
property({ type: String, reflect: true })
|
|
81
|
-
], OrIcon.prototype, "icon", void 0);
|
|
82
|
-
OrIcon = __decorate([
|
|
83
|
-
customElement("or-icon")
|
|
84
|
-
], OrIcon);
|
|
85
|
-
export { OrIcon };
|
|
86
|
-
//# sourceMappingURL=index.js.map
|