@openremote/or-attribute-picker 1.2.0-snapshot.20240819114736 → 1.2.0-snapshot.20240913085022

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,47 @@
1
+ import { AttributePicker, AttributePickerPickedEvent } from "./attribute-picker";
2
+ import { Asset, Attribute, AttributeRef } from "@openremote/model";
3
+ import { OrAssetTreeSelectionEvent } from "@openremote/or-asset-tree";
4
+ /**
5
+ * Custom Event that is dispatched upon closing the dialog.
6
+ * Contains a list of {@link AttributeRef} of the selected attributes.
7
+ */
8
+ export declare class OrAssetAttributePickerPickedEvent extends AttributePickerPickedEvent {
9
+ static readonly NAME = "or-asset-attribute-picker-picked";
10
+ constructor(attrRefs: AttributeRef[]);
11
+ }
12
+ declare global {
13
+ export interface HTMLElementEventMap {
14
+ [OrAssetAttributePickerPickedEvent.NAME]: OrAssetAttributePickerPickedEvent;
15
+ }
16
+ }
17
+ /**
18
+ * The "Attribute Picker" component using the {@link OrAssetTree} component for selecting assets and its attributes.
19
+ *
20
+ * @attribute {object} attributeFilter - Callback method for consumers to filter the attribute list shown. Returning true will make the attribute visible, returning false hides it.
21
+ */
22
+ export declare class OrAssetAttributePicker extends AttributePicker {
23
+ attributeFilter?: (attribute: Attribute<any>) => boolean;
24
+ protected _assetAttributes?: (Attribute<any>)[];
25
+ selectedAssets: string[];
26
+ selectedAttributes: AttributeRef[];
27
+ protected _asset?: Asset;
28
+ setAttributeFilter(attributeFilter: ((attribute: Attribute<any>) => boolean) | undefined): this;
29
+ setSelectedAssets(selectedAssets: string[]): this;
30
+ setSelectedAttributes(selectedAttributes: AttributeRef[]): this;
31
+ protected _setDialogActions(): void;
32
+ protected _setDialogContent(): void;
33
+ /**
34
+ * Event callback function that is triggered once a user selects an asset.
35
+ * It fetches the attributes of that specific asset, and caches these to be displayed later.
36
+ * Also applies the filtering such as {@link showOnlyDatapointAttrs}, {@link showOnlyRuleStateAttrs} and {@link attributeFilter} if set.
37
+ */
38
+ protected _onAssetSelectionChanged(event: OrAssetTreeSelectionEvent): Promise<void>;
39
+ /**
40
+ * HTML Callback function when the selected attributes have been updated.
41
+ *
42
+ * @remarks
43
+ * The {@link attrNames} parameter contains a list of attribute names VISIBLE in the list.
44
+ * So, selected attributes of other assets, will merge together with the new {@link attrNames}.
45
+ */
46
+ protected _onAttributesSelect(attrNames: string[]): void;
47
+ }
@@ -0,0 +1,24 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,s,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(o=(a<3?r(o):a>3?r(e,s,o):r(e,s))||o);return a>3&&o&&Object.defineProperty(e,s,o),o},__awaiter=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function n(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,n)}l((i=i.apply(t,e||[])).next())}))};import{customElement,property,state}from"lit/decorators.js";import{AttributePicker,AttributePickerPickedEvent}from"./attribute-picker";import manager,{DefaultColor5,Util}from"@openremote/core";import{html,unsafeCSS}from"lit";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{when}from"lit/directives/when.js";import{until}from"lit/directives/until.js";export class OrAssetAttributePickerPickedEvent extends AttributePickerPickedEvent{constructor(t){super(OrAssetAttributePickerPickedEvent.NAME,{bubbles:!0,composed:!0,detail:t})}}OrAssetAttributePickerPickedEvent.NAME="or-asset-attribute-picker-picked";let OrAssetAttributePicker=class extends AttributePicker{constructor(){super(...arguments),this.selectedAssets=[],this.selectedAttributes=[]}setAttributeFilter(t){return this.attributeFilter=t,this}setSelectedAssets(t){return this.selectedAssets=t,this._updateDialogContent(),this}setSelectedAttributes(t){return this.selectedAttributes=t,this.addBtn&&(this.addBtn.disabled=0===this.selectedAttributes.length),this}_setDialogActions(){this.actions=[{actionName:"cancel",content:"cancel"},{actionName:"add",content:html`
2
+ <or-mwc-input id="add-btn" class="button" label="add" .type="${InputType.BUTTON}"></or-mwc-input>`,action:()=>{this.addBtn.disabled||this.dispatchEvent(new OrAssetAttributePickerPickedEvent(this.selectedAttributes))}}]}_setDialogContent(){this.content=()=>html`
3
+ <div class="row" style="display: flex;height: 600px;width: 800px;border-top: 1px solid ${unsafeCSS(DefaultColor5)};">
4
+ <div class="col" style="width: 260px;overflow: auto;border-right: 1px solid ${unsafeCSS(DefaultColor5)};">
5
+ <or-asset-tree id="chart-asset-tree" readonly .selectedIds="${this.selectedAssets.length>0?this.selectedAssets:null}"
6
+ @or-asset-tree-selection="${t=>this._onAssetSelectionChanged(t)}">
7
+ </or-asset-tree>
8
+ </div>
9
+ <div class="col" style="flex: 1 1 auto;width: 260px;overflow: auto;">
10
+ ${when(this._assetAttributes&&this._assetAttributes.length>0,(()=>{const t=this.selectedAttributes.filter((t=>{var e;return t.id===(null===(e=this._asset)||void 0===e?void 0:e.id)})).map((t=>t.name));return html`
11
+ <div class="attributes-header">
12
+ <or-translate value="attribute_plural"></or-translate>
13
+ </div>
14
+ ${until(this._getAttributesTemplate(this._assetAttributes,void 0,t,this.multiSelect,(t=>this._onAttributesSelect(t))),html`<or-loading></or-loading>`)}
15
+ `}),(()=>html`
16
+ <div style="display: flex;align-items: center;text-align: center;height: 100%;padding: 0 20px;">
17
+ <span style="width:100%">
18
+ <or-translate value="${this._assetAttributes&&0===this._assetAttributes.length?this.showOnlyDatapointAttrs&&this.showOnlyRuleStateAttrs?"noDatapointsOrRuleStateAttributes":this.showOnlyDatapointAttrs?"noDatapointsAttributes":this.showOnlyRuleStateAttrs?"noRuleStateAttributes":"noAttributesToShow":"selectAssetOnTheLeft"}">
19
+ </or-translate>
20
+ </span>
21
+ </div>
22
+ `))}
23
+ </div>
24
+ `}_onAssetSelectionChanged(t){return __awaiter(this,void 0,void 0,(function*(){this._assetAttributes=void 0,this.multiSelect||(this.selectedAttributes=[]),this.addBtn.disabled=0===this.selectedAttributes.length;const e=t.target;e.disabled=!0;let s=0===t.detail.newNodes.length?void 0:t.detail.newNodes[0].asset;if(this._asset=s,s){const t=yield manager.rest.api.AssetResource.get(s.id);s=t.data,s&&(this._assetAttributes=Object.values(s.attributes).map((t=>Object.assign(Object.assign({},t),{id:s.id}))).sort(Util.sortByString((t=>t.name))),this.attributeFilter&&(this._assetAttributes=this._assetAttributes.filter((t=>this.attributeFilter(t)))),this.showOnlyDatapointAttrs&&this.showOnlyRuleStateAttrs?this._assetAttributes=this._assetAttributes.filter((t=>t.meta&&(t.meta.storeDataPoints||t.meta.ruleState||t.meta.agentLink))):this.showOnlyDatapointAttrs?this._assetAttributes=this._assetAttributes.filter((t=>t.meta&&(t.meta.storeDataPoints||t.meta.agentLink))):this.showOnlyRuleStateAttrs&&(this._assetAttributes=this._assetAttributes.filter((t=>t.meta&&(t.meta.ruleState||t.meta.agentLink)))))}e.disabled=!1}))}_onAttributesSelect(t){this.setSelectedAttributes([...this.selectedAttributes.filter((t=>t.id!==this._asset.id)),...t.map((t=>{var e;return{id:null===(e=this._asset)||void 0===e?void 0:e.id,name:t}}))])}};__decorate([property()],OrAssetAttributePicker.prototype,"attributeFilter",void 0),__decorate([state()],OrAssetAttributePicker.prototype,"_assetAttributes",void 0),OrAssetAttributePicker=__decorate([customElement("or-asset-attribute-picker")],OrAssetAttributePicker);export{OrAssetAttributePicker};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-attribute-picker.js","sourceRoot":"","sources":["../src/asset-attribute-picker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,eAAe,EAAE,0BAA0B,EAAC,MAAM,oBAAoB,CAA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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,4DAAoC,IAAI,CAAC,CAAC,IAAI,gDAA8B,CAAC,CAAC,CAAC;oBACrH,CAAC;yBAAM,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;wBACrC,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB;6BACxC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,gDAA8B,IAAI,CAAC,CAAC,IAAI,gDAA8B,CAAC,CAAC,CAAC;oBAC/G,CAAC;gBACL,CAAC;YACL,CAAC;YACD,+CAA+C;YAC/C,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC/B,CAAC;KAAA;IAGD;;;;;;OAMG;IACO,mBAAmB,CAAC,SAAmB;QAC7C,IAAI,CAAC,qBAAqB,CAAC;YACvB,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,IAAI,CAAC,MAAO,CAAC,EAAE,CAAC;YACtF,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,CAAC,EAAC,EAAE,EAAE,MAAA,IAAI,CAAC,MAAM,0CAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA,EAAA,CAAC;SAC1D,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAvJU;IADN,QAAQ,EAAE;+DACqD;AAGtD;IADT,KAAK,EAAE;gEACwC;AANvC,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA0JlC"}
@@ -0,0 +1,66 @@
1
+ import { AttributePicker, AttributePickerPickedEvent } from "./attribute-picker";
2
+ import { PropertyValues } from "lit";
3
+ import { ListItem } from "@openremote/or-mwc-components/or-mwc-list";
4
+ import { AssetDescriptor, AttributeDescriptor } from "@openremote/model";
5
+ import "./assettype-list";
6
+ /**
7
+ * Custom Event that is dispatched upon closing the dialog.
8
+ * Contains a map that is keyed by {@link AssetDescriptor.name}, with an array of {@link AttributeDescriptor}s of the selected attributes.
9
+ */
10
+ export declare class AssetTypeAttributePickerPickedEvent extends AttributePickerPickedEvent {
11
+ static readonly NAME = "or-asset-type-attribute-picker-picked";
12
+ constructor(attrDescriptors: Map<string, AttributeDescriptor[]>);
13
+ }
14
+ declare global {
15
+ export interface HTMLElementEventMap {
16
+ [AssetTypeAttributePickerPickedEvent.NAME]: AssetTypeAttributePickerPickedEvent;
17
+ }
18
+ }
19
+ /**
20
+ * The "Attribute Picker" component using the {@link OrAssetTree} component for selecting assets and its attributes.
21
+ *
22
+ * @attribute {object} assetTypeFilter -Callback method for consumers to filter the asset type list shown. Returning true will make the asset type visible, returning false hides it.
23
+ * @attribute {object} attributeFilter - Callback method for consumers to filter the attribute list shown. Returning true will make the attribute visible, returning false hides it.
24
+ *
25
+ * @remarks TODO: In the future this should be a separate component named "or-assettype-attribute-picker"
26
+ */
27
+ export declare class AssetTypeAttributePicker extends AttributePicker {
28
+ assetTypeFilter?: (descriptor: AssetDescriptor) => boolean;
29
+ attributeFilter?: (descriptor: AttributeDescriptor) => boolean;
30
+ selectedAttributes: Map<string, AttributeDescriptor[]>;
31
+ protected _selectedAssetType?: string;
32
+ protected _loadedAttributeTypes?: AttributeDescriptor[];
33
+ protected _loadedAssetTypes?: AssetDescriptor[];
34
+ setSelectedAttributes(selectedAttributes: Map<string, AttributeDescriptor[]>): this;
35
+ protected willUpdate(changedProps: PropertyValues): void;
36
+ /**
37
+ * Function that will load and update the available asset types up for selection.
38
+ * Also applies the filtering such as {@link assetTypeFilter} if set.
39
+ */
40
+ protected _loadAssetTypes(): AssetDescriptor[];
41
+ /**
42
+ * Function that will load and update the available attributes up for selection.
43
+ * The {@link descriptor} parameter is usually the selected asset type.
44
+ * Also applies the filtering such as {@link showOnlyDatapointAttrs}, {@link showOnlyRuleStateAttrs} and {@link attributeFilter} if set.
45
+ */
46
+ protected _loadAttributeTypes(descriptor: AssetDescriptor): AttributeDescriptor[];
47
+ protected _setDialogContent(): void;
48
+ protected _setDialogActions(): void;
49
+ /**
50
+ * HTML Callback function when the selected asset type has been updated.
51
+ */
52
+ protected _onAssetTypeItemClick(listItem: ListItem): void;
53
+ /**
54
+ * HTML callback function when the selected attributes have been updated.
55
+ */
56
+ protected _onAttributesSelect(attrNames: string[]): void;
57
+ /**
58
+ * Function that maps the {@link AssetDescriptor}s to the formatted {@link ListItem}s.
59
+ * Uses helpers like {@link Util.getAssetTypeLabel} and sorts by {@link descriptorType} so that agents show up first.
60
+ */
61
+ protected _getAssetTypeDescriptors(descriptors: AssetDescriptor[], selected?: AssetDescriptor[], withNoneValue?: ListItem): ListItem[];
62
+ /**
63
+ * Utility method to get the cached {@link AssetDescriptor} by its name
64
+ */
65
+ protected _getAssetDescriptorByName(name?: string): AssetDescriptor | undefined;
66
+ }
@@ -0,0 +1,24 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,s,i){var r,o=arguments.length,l=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(l=(o<3?r(l):o>3?r(e,s,l):r(e,s))||l);return o>3&&l&&Object.defineProperty(e,s,l),l};import{property,state}from"lit/decorators.js";import{AttributePicker,AttributePickerPickedEvent}from"./attribute-picker";import{html,unsafeCSS}from"lit";import{DefaultColor5,Util}from"@openremote/core";import{when}from"lit/directives/when.js";import{until}from"lit/directives/until.js";import{AssetModelUtil}from"@openremote/model";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import"./assettype-list";export class AssetTypeAttributePickerPickedEvent extends AttributePickerPickedEvent{constructor(t){super(AssetTypeAttributePickerPickedEvent.NAME,{bubbles:!0,composed:!0,detail:t})}}AssetTypeAttributePickerPickedEvent.NAME="or-asset-type-attribute-picker-picked";export class AssetTypeAttributePicker extends AttributePicker{constructor(){super(...arguments),this.selectedAttributes=new Map}setSelectedAttributes(t){return this.selectedAttributes=t,this}willUpdate(t){if(this._loadedAssetTypes||(this._loadedAssetTypes=this._loadAssetTypes()),t.has("_selectedAssetType")){const t=this._getAssetDescriptorByName(this._selectedAssetType);t&&(this._loadedAttributeTypes=this._loadAttributeTypes(t))}return this._updateDialogContent(),this._updateDialogActions(),super.willUpdate(t)}_loadAssetTypes(){let t=AssetModelUtil.getAssetDescriptors();return void 0!==this.assetTypeFilter&&(t=t.filter(this.assetTypeFilter)),this._loadedAssetTypes=t,t||[]}_loadAttributeTypes(t){let e=AssetModelUtil.getAssetTypeInfo(t).attributeDescriptors;return void 0!==this.attributeFilter&&(e=null==e?void 0:e.filter(this.attributeFilter)),this.showOnlyDatapointAttrs&&(e=null==e?void 0:e.filter((t=>{var e;return null===(e=t.meta)||void 0===e?void 0:e.storeDataPoints}))),this.showOnlyRuleStateAttrs&&(e=null==e?void 0:e.filter((t=>{var e;return null===(e=t.meta)||void 0===e?void 0:e.ruleState}))),this._loadedAttributeTypes=e||[],e||[]}_setDialogContent(){var t;const e=this._loadedAssetTypes||this._loadAssetTypes(),s=this.selectedAttributes?Array.from(this.selectedAttributes.keys()):void 0,i=this._getAssetTypeDescriptors(e,e.filter((t=>!s||s.includes(t.name)))),r=this._getAssetDescriptorByName(this._selectedAssetType),o=null===(t=this._loadedAttributeTypes||(r?this._loadAttributeTypes(r):void 0))||void 0===t?void 0:t.sort(Util.sortByString((t=>t.name)));this.content=()=>html`
2
+ <div class="row" style="display: flex;height: 600px;width: 800px;border-top: 1px solid ${unsafeCSS(DefaultColor5)};">
3
+ <div class="col" style="width: 320px;overflow: auto;border-right: 1px solid ${unsafeCSS(DefaultColor5)};">
4
+ <asset-type-list .listItems="${i}" style="--or-icon-fill: #000000;" @or-mwc-list-changed="${t=>{1===t.detail.length&&this._onAssetTypeItemClick(t.detail[0])}}"
5
+ ></asset-type-list>
6
+ </div>
7
+ <div class="col" style="flex: 1 1 auto;width: 320px;overflow: auto;">
8
+ ${when(o&&o.length>0,(()=>{var t;const e=this._selectedAssetType?null===(t=this.selectedAttributes.get(this._selectedAssetType))||void 0===t?void 0:t.map((t=>t.name)):void 0;return html`
9
+ <div class="attributes-header">
10
+ <or-translate value="attribute_plural"></or-translate>
11
+ </div>
12
+ ${until(this._getAttributesTemplate(void 0,o,e,this.multiSelect,(t=>this._onAttributesSelect(t))),html`<or-loading></or-loading>`)}
13
+ `}),(()=>html`
14
+ <div style="display: flex;align-items: center;text-align: center;height: 100%;padding: 0 20px;">
15
+ <span style="width:100%">
16
+ <or-translate value="${o&&0===o.length?this.showOnlyDatapointAttrs&&this.showOnlyRuleStateAttrs?"noDatapointsOrRuleStateAttributes":this.showOnlyDatapointAttrs?"noDatapointsAttributes":this.showOnlyRuleStateAttrs?"noRuleStateAttributes":"noAttributesToShow":"selectAssetTypeOnTheLeft"}">
17
+ </or-translate>
18
+ </span>
19
+ </div>
20
+ `))}
21
+ </div>
22
+ </div>
23
+ `}_setDialogActions(){this.actions=[{actionName:"cancel",content:"cancel"},{actionName:"add",content:html`
24
+ <or-mwc-input id="add-btn" class="button" label="add" .type="${InputType.BUTTON}"></or-mwc-input>`,action:()=>{this.addBtn.disabled||this.dispatchEvent(new AssetTypeAttributePickerPickedEvent(this.selectedAttributes))}}]}_onAssetTypeItemClick(t){this._selectedAssetType=t.data.name}_onAttributesSelect(t){var e;this._selectedAssetType?this._loadedAttributeTypes?this.selectedAttributes.set(this._selectedAssetType,null===(e=this._loadedAttributeTypes)||void 0===e?void 0:e.filter((e=>t.includes(e.name)))):console.warn("Could not select attribute, since the attribute list seems to be empty?"):console.warn("Could not select attribute, since no asset type seemed to be selected.")}_getAssetTypeDescriptors(t,e,s){const i=null==t?void 0:t.map((t=>({styleMap:{"--or-icon-fill":t.colour?"#"+t.colour:"unset"},icon:t.icon,trailingIcon:(null==e?void 0:e.includes(t))?"cloud-upload-outline":void 0,text:Util.getAssetTypeLabel(t),value:t.name,data:t}))).sort(((t,e)=>("agent"===t.data.descriptorType?0:1)-("agent"===e.data.descriptorType?0:1)||t.text.localeCompare(e.text)));return s&&(null==i||i.splice(0,0,s)),i}_getAssetDescriptorByName(t){var e;return t?null===(e=this._loadedAssetTypes)||void 0===e?void 0:e.find((e=>e.name===t)):void 0}}__decorate([property()],AssetTypeAttributePicker.prototype,"assetTypeFilter",void 0),__decorate([property()],AssetTypeAttributePicker.prototype,"attributeFilter",void 0),__decorate([state()],AssetTypeAttributePicker.prototype,"_selectedAssetType",void 0),__decorate([state()],AssetTypeAttributePicker.prototype,"_loadedAttributeTypes",void 0),__decorate([state()],AssetTypeAttributePicker.prototype,"_loadedAssetTypes",void 0);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assettype-attribute-picker.js","sourceRoot":"","sources":["../src/assettype-attribute-picker.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAE,0BAA0B,EAAC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAiB,IAAI,EAAE,SAAS,EAAC,MAAM,KAAK,CAAC;AACpD,OAAO,EAAC,aAAa,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAE9C,OAAO,EAAkB,cAAc,EAAyD,MAAM,mBAAmB,CAAC;AAC1H,OAAO,EAAC,SAAS,EAAC,MAAM,4CAA4C,CAAC;AACrE,OAAO,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,MAAM,OAAO,mCAAoC,SAAQ,0BAA0B;IAI/E,YAAY,eAAmD;QAC3D,KAAK,CAAC,mCAAmC,CAAC,IAAI,EAAE;YAC5C,OAAO,EAAE,I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C,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC;QAE/I,IAAI,aAAa,EAAE,CAAC;YAChB,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAGD;;OAEG;IACO,yBAAyB,CAAC,IAAa;;QAC7C,OAAO,IAAI,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,0CAAE,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnF,CAAC;CACJ;AA7MU;IADN,QAAQ,EAAE;iEACuD;AAG3D;IADN,QAAQ,EAAE;iEAC2D;AAK5D;IADT,KAAK,EAAE;oEAC8B;AAG5B;IADT,KAAK,EAAE;uEACgD;AAG9C;IADT,KAAK,EAAE;mEACwC"}
@@ -0,0 +1,4 @@
1
+ import { OrMwcList } from "@openremote/or-mwc-components/or-mwc-list";
2
+ export declare class AssettypeList extends OrMwcList {
3
+ static get styles(): import("lit").CSSResult[];
4
+ }
@@ -0,0 +1,5 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,s,r){var o,c=arguments.length,i=c<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,s,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(c<3?o(i):c>3?o(e,s,i):o(e,s))||i);return c>3&&i&&Object.defineProperty(e,s,i),i};import{OrMwcList}from"@openremote/or-mwc-components/or-mwc-list";import{css}from"lit";import{customElement}from"lit/decorators.js";let AssettypeList=class extends OrMwcList{static get styles(){return[...super.styles,css`
2
+ .mdc-list-item__meta or-icon {
3
+ --or-icon-fill: gray;
4
+ }
5
+ `]}};AssettypeList=__decorate([customElement("asset-type-list")],AssettypeList);export{AssettypeList};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assettype-list.js","sourceRoot":"","sources":["../src/assettype-list.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG3C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,SAAS;IAExC,MAAM,KAAK,MAAM;QACb,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,CAAA;;;;SAI3B,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AATY,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CASzB"}
@@ -0,0 +1,59 @@
1
+ import { TemplateResult } from "lit";
2
+ import "@openremote/or-asset-tree";
3
+ import "@openremote/or-translate";
4
+ import "@openremote/or-mwc-components/or-mwc-input";
5
+ import "@openremote/or-mwc-components/or-mwc-list";
6
+ import { OrMwcInput } from "@openremote/or-mwc-components/or-mwc-input";
7
+ import { Attribute, AttributeDescriptor } from "@openremote/model";
8
+ import { DialogAction, DialogActionBase, OrMwcDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
9
+ export declare abstract class AttributePickerPickedEvent extends CustomEvent<any> {
10
+ }
11
+ /**
12
+ * @summary Abstract implementation of the Attribute Picker UI. Wraps around OrMwcDialog and provides some utility properties and functions to inherit.
13
+ *
14
+ * @attribute {boolean} multiSelect - Whether selecting multiple attributes is allowed or not.
15
+ * @attribute {boolean} showOnlyDatapointAttrs - Whether only attributes with the 'STORE_DATAPOINT' meta item should be shown.
16
+ * @attribute {boolean} showOnlyRuleStateAttrs - Whether only attributes with the 'RULE_STATE' meta item should be shown.
17
+ *
18
+ * @remarks This class is abstract
19
+ */
20
+ export declare abstract class AttributePicker extends OrMwcDialog {
21
+ protected abstract _setDialogContent(): void;
22
+ protected abstract _setDialogActions(): void;
23
+ multiSelect?: boolean;
24
+ showOnlyDatapointAttrs?: boolean;
25
+ showOnlyRuleStateAttrs?: boolean;
26
+ protected addBtn: OrMwcInput;
27
+ connectedCallback(): void;
28
+ setShowOnlyDatapointAttrs(showOnlyDatapointAttrs: boolean | undefined): this;
29
+ setShowOnlyRuleStateAttrs(showOnlyRuleStateAttrs: boolean | undefined): this;
30
+ setMultiSelect(multiSelect: boolean | undefined): this;
31
+ setOpen(isOpen: boolean): this;
32
+ setHeading(heading: TemplateResult | string | undefined): this;
33
+ setContent(_content: TemplateResult | (() => TemplateResult) | undefined): this;
34
+ setActions(_actions: DialogAction[] | undefined): this;
35
+ setDismissAction(_action: DialogActionBase | null | undefined): this;
36
+ setStyles(_styles: string | TemplateResult | undefined): this;
37
+ setAvatar(_avatar: boolean | undefined): this;
38
+ /**
39
+ * Convenient function to update the dialog content manually,
40
+ * since updating the UI is handled different for {@link OrMwcDialog}.
41
+ */
42
+ protected _updateDialogContent(): void;
43
+ /**
44
+ * Convenient function to update the dialog actions manually,
45
+ * since updating the UI is handled different for {@link OrMwcDialog}.
46
+ */
47
+ protected _updateDialogActions(): void;
48
+ /**
49
+ * Function that creates the HTML template for selecting attributes.
50
+ * Currently uses {@link OrMwcList} with or without checkboxes, and uses {@link Util.getAttributeLabel} to formulate the text.
51
+ *
52
+ * @remarks TODO: Move this template into a separate component, such as an "or-attribute-list"
53
+ */
54
+ protected _getAttributesTemplate(attributes?: Attribute<any>[], descriptors?: AttributeDescriptor[], selectedNames?: string[], multi?: boolean, onSelect?: (attrNames: string[]) => void): Promise<TemplateResult>;
55
+ /**
56
+ * Simple function that creates the CSS styles for this component
57
+ */
58
+ protected _getStyles(): string;
59
+ }
@@ -0,0 +1,12 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},__awaiter=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function l(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(s,l)}a((r=r.apply(t,e||[])).next())}))};import{html,unsafeCSS}from"lit";import{property,query}from"lit/decorators.js";import"@openremote/or-asset-tree";import"@openremote/or-translate";import"@openremote/or-mwc-components/or-mwc-input";import"@openremote/or-mwc-components/or-mwc-list";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{i18next}from"@openremote/or-translate";import{DefaultColor2,DefaultColor4,DefaultColor5,Util}from"@openremote/core";import{OrMwcDialog}from"@openremote/or-mwc-components/or-mwc-dialog";import{when}from"lit/directives/when.js";import{ListType}from"@openremote/or-mwc-components/or-mwc-list";export class AttributePickerPickedEvent extends CustomEvent{}export class AttributePicker extends OrMwcDialog{constructor(){super(...arguments),this.multiSelect=!1,this.showOnlyDatapointAttrs=!1,this.showOnlyRuleStateAttrs=!1}connectedCallback(){super.connectedCallback(),this.heading=i18next.t("selectAttributes"),this._setDialogContent(),this._setDialogActions(),this.dismissAction=null,this.styles=this._getStyles()}setShowOnlyDatapointAttrs(t){return this.showOnlyDatapointAttrs=t,this}setShowOnlyRuleStateAttrs(t){return this.showOnlyRuleStateAttrs=t,this}setMultiSelect(t){return this.multiSelect=t,this}setOpen(t){return super.setOpen(t),this}setHeading(t){return super.setHeading(t),this}setContent(t){throw new Error("Cannot modify attribute picker content")}setActions(t){throw new Error("Cannot modify attribute picker actions")}setDismissAction(t){throw new Error("Cannot modify attribute picker dismiss action")}setStyles(t){throw new Error("Cannot modify attribute picker styles")}setAvatar(t){throw new Error("Cannot modify attribute picker avatar setting")}_updateDialogContent(){this._setDialogContent()}_updateDialogActions(){this._setDialogActions()}_getAttributesTemplate(t,e,o,r=!1,n){return __awaiter(this,void 0,void 0,(function*(){const i=Math.max((null==t?void 0:t.length)||0,(null==e?void 0:e.length)||0),s=[];for(let o=0;o<i;o++)s.push({text:Util.getAttributeLabel(null==t?void 0:t[o],null==e?void 0:e[o],void 0,!0),value:(null==t?void 0:t[o].name)||(null==e?void 0:e[o].name)});return html`
2
+ ${when(r,(()=>html`
3
+ <or-mwc-list id="attribute-selector" .type="${ListType.MULTI_CHECKBOX}" .listItems="${s}" .values="${o}"
4
+ @or-mwc-list-changed="${t=>null==n?void 0:n(t.detail.map((t=>t.value)))}"
5
+ </or-mwc-list>
6
+ `),(()=>html`
7
+ <or-mwc-input id="attribute-selector" .type="${InputType.LIST}" .options="${null==s?void 0:s.map((t=>[t,t.text]))}"
8
+ style="display:flex;" .label="${i18next.t("attribute")}"
9
+ @or-mwc-input-changed="${t=>null==n?void 0:n([t.detail.value.value])}"
10
+ ></or-mwc-input>
11
+ `))}
12
+ `}))}_getStyles(){return`\n .attributes-header {\n line-height: 48px;\n padding: 0 15px;\n background-color: ${unsafeCSS(DefaultColor2)};\n font-weight: bold;\n border-bottom: 1px solid ${unsafeCSS(DefaultColor2)};\n }\n footer.mdc-dialog__actions {\n border-top: 1px solid ${unsafeCSS(DefaultColor5)};\n }\n #header {\n background-color: ${unsafeCSS(DefaultColor4)} !important;\n }\n #dialog-content {\n padding: 0;\n }\n `}}__decorate([property({type:Boolean})],AttributePicker.prototype,"multiSelect",void 0),__decorate([property({type:Boolean})],AttributePicker.prototype,"showOnlyDatapointAttrs",void 0),__decorate([property({type:Boolean})],AttributePicker.prototype,"showOnlyRuleStateAttrs",void 0),__decorate([query("#add-btn")],AttributePicker.prototype,"addBtn",void 0);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribute-picker.js","sourceRoot":"","sources":["../src/attribute-picker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,IAAI,EAAkB,SAAS,EAAC,MAAM,KAAK,CAAC;AACpD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4CAA4C,CAAC;AACpD,OAAO,2CAA2C,CAAC;AACnD,OAAO,EAAC,SAAS,EAAkC,MAAM,4CAA4C,CAAC;AACtG,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAiC,WAAW,EAAC,MAAM,6CAA6C,CAAC;AACxG,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAW,QAAQ,EAAwB,MAAM,2CAA2C,CAAC;AAEpG,MAAM,OAAgB,0BAA2B,SAAQ,WAAgB;CAExE;AAED;;;;;;;;GAQG;AACH,MAAM,OAAgB,eAAgB,SAAQ,WAAW;IAAzD;;QAQW,gBAAW,GAAa,KAAK,CAAC;QAG9B,2BAAsB,GAAa,KAAK,CAAC;QAGzC,2BAAsB,GAAa,KAAK,CAAC;IAsIpD,CAAC;IAjIG,iBAAiB;QACb,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAC7C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAA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uBAAT,SAAS,CAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;8DACzE,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;uDAC7B,CAAC,EAAuB,EAAE,EAAE,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAE,EAAE,CAAC,MAAM,CAAC,KAAkB,CAAC,KAAK,CAAC,CAAC;;aAExH,CAAC;SACL,CAAC;QACN,CAAC;KAAA;IAED;;OAEG;IACO,UAAU;QAEhB,eAAe;QACf,OAAO;;;;oCAIqB,SAAS,CAAC,aAAa,CAAC;;2CAEjB,SAAS,CAAC,aAAa,CAAC;;;wCAG3B,SAAS,CAAC,aAAa,CAAC;;;oCAG5B,SAAS,CAAC,aAAa,CAAC;;;;;SAKnD,CAAA;IAEL,CAAC;CACJ;AA5IU;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oDACW;AAG9B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+DACsB;AAGzC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+DACsB;AAGtC;IADT,KAAK,CAAC,UAAU,CAAC;+CACY"}
package/lib/index.d.ts CHANGED
@@ -1,47 +1,24 @@
1
- import { TemplateResult } from "lit";
2
- import "@openremote/or-asset-tree";
3
- import "@openremote/or-translate";
4
- import "@openremote/or-mwc-components/or-mwc-input";
5
- import "@openremote/or-mwc-components/or-mwc-list";
6
- import { OrAssetTreeSelectionEvent } from "@openremote/or-asset-tree";
7
- import { OrMwcInput } from "@openremote/or-mwc-components/or-mwc-input";
8
- import { Asset, Attribute, AttributeRef } from "@openremote/model";
9
- import { DialogAction, DialogActionBase, OrMwcDialog } from "@openremote/or-mwc-components/or-mwc-dialog";
10
- export declare class OrAttributePickerPickedEvent extends CustomEvent<AttributeRef[]> {
11
- static readonly NAME = "or-attribute-picker-picked";
12
- constructor(detail: AttributeRef[]);
1
+ import { OrAssetAttributePicker, OrAssetAttributePickerPickedEvent } from "./asset-attribute-picker";
2
+ import { AssetTypeAttributePickerPickedEvent, AssetTypeAttributePicker } from "./assettype-attribute-picker";
3
+ /**
4
+ * {@link CustomEvent} that triggers once attributes have been selected, and the user closes the dialog.
5
+ * @deprecated Replaced this class with an abstract {@link OrAssetAttributePickerPickedEvent}, that is inherited by other classes like {@link OrAssetAttributePicker} and {@link AssetTypeAttributePicker}.
6
+ */
7
+ export declare class OrAttributePickerPickedEvent extends OrAssetAttributePickerPickedEvent {
13
8
  }
14
- declare global {
15
- export interface HTMLElementEventMap {
16
- [OrAttributePickerPickedEvent.NAME]: OrAttributePickerPickedEvent;
17
- }
9
+ /**
10
+ * Dialog to pick attributes of supplied asset(s).
11
+ * @deprecated Replaced this class with {@link OrAssetAttributePicker}.
12
+ */
13
+ export declare class OrAttributePicker extends OrAssetAttributePicker {
18
14
  }
19
- export declare class OrAttributePicker extends OrMwcDialog {
20
- showOnlyDatapointAttrs?: boolean;
21
- showOnlyRuleStateAttrs?: boolean;
22
- attributeFilter?: (attribute: Attribute<any>) => boolean;
23
- multiSelect?: boolean;
24
- selectedAttributes: AttributeRef[];
25
- selectedAssets: string[];
26
- protected assetAttributes?: (Attribute<any>)[];
27
- protected asset?: Asset;
28
- protected addBtn: OrMwcInput;
29
- constructor();
30
- setShowOnlyDatapointAttrs(showOnlyDatapointAttrs: boolean | undefined): OrAttributePicker;
31
- setShowOnlyRuleStateAttrs(showOnlyRuleStateAttrs: boolean | undefined): OrAttributePicker;
32
- setAttributeFilter(attributeFilter: ((attribute: Attribute<any>) => boolean) | undefined): OrAttributePicker;
33
- setMultiSelect(multiSelect: boolean | undefined): OrAttributePicker;
34
- setSelectedAttributes(selectedAttributes: AttributeRef[]): OrAttributePicker;
35
- setSelectedAssets(selectedAssets: string[]): OrAttributePicker;
36
- setOpen(isOpen: boolean): OrAttributePicker;
37
- setHeading(heading: TemplateResult | string | undefined): OrAttributePicker;
38
- setContent(content: TemplateResult | (() => TemplateResult) | undefined): OrAttributePicker;
39
- setActions(actions: DialogAction[] | undefined): OrAttributePicker;
40
- setDismissAction(action: DialogActionBase | null | undefined): OrAttributePicker;
41
- setStyles(styles: string | TemplateResult | undefined): OrAttributePicker;
42
- setAvatar(avatar: boolean | undefined): OrAttributePicker;
43
- protected setDialogActions(): void;
44
- protected setDialogContent(): void;
45
- protected _onAssetSelectionChanged(event: OrAssetTreeSelectionEvent): Promise<void>;
46
- protected _onAttributeSelectionChanged(attributeRefs: AttributeRef[]): void;
15
+ /**
16
+ * TODO: Remove this, and export the ./assettype-attribute-picker file
17
+ */
18
+ export declare class OrAssetTypeAttributePickerPickedEvent extends AssetTypeAttributePickerPickedEvent {
19
+ }
20
+ /**
21
+ * TODO: Remove this, and export the ./assettype-attribute-picker file
22
+ */
23
+ export declare class OrAssetTypeAttributePicker extends AssetTypeAttributePicker {
47
24
  }
package/lib/index.js CHANGED
@@ -1,31 +1 @@
1
- var __decorate=this&&this.__decorate||function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n},__awaiter=this&&this.__awaiter||function(t,e,s,i){return new(s||(s=Promise))((function(r,o){function n(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}l((i=i.apply(t,e||[])).next())}))};import{html,unsafeCSS}from"lit";import{customElement,property,query,state}from"lit/decorators.js";import"@openremote/or-asset-tree";import"@openremote/or-translate";import"@openremote/or-mwc-components/or-mwc-input";import"@openremote/or-mwc-components/or-mwc-list";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{i18next}from"@openremote/or-translate";import manager,{DefaultColor2,DefaultColor4,DefaultColor5,Util}from"@openremote/core";import{ListType}from"@openremote/or-mwc-components/or-mwc-list";import{OrMwcDialog}from"@openremote/or-mwc-components/or-mwc-dialog";export class OrAttributePickerPickedEvent extends CustomEvent{constructor(t){super(OrAttributePickerPickedEvent.NAME,{bubbles:!0,composed:!0,detail:t})}}OrAttributePickerPickedEvent.NAME="or-attribute-picker-picked";let OrAttributePicker=class extends OrMwcDialog{constructor(){super(),this.showOnlyDatapointAttrs=!1,this.showOnlyRuleStateAttrs=!1,this.multiSelect=!1,this.selectedAttributes=[],this.selectedAssets=[],this.heading=i18next.t("selectAttributes"),this.setDialogContent(),this.setDialogActions(),this.dismissAction=null,this.styles=`\n .attributes-header {\n line-height: 48px;\n padding: 0 15px;\n background-color: ${unsafeCSS(DefaultColor2)};\n font-weight: bold;\n border-bottom: 1px solid ${unsafeCSS(DefaultColor2)};\n }\n footer.mdc-dialog__actions {\n border-top: 1px solid ${unsafeCSS(DefaultColor5)};\n }\n #header {\n background-color: ${unsafeCSS(DefaultColor4)} !important;\n }\n #dialog-content {\n padding: 0;\n }\n `}setShowOnlyDatapointAttrs(t){return this.showOnlyDatapointAttrs=t,this}setShowOnlyRuleStateAttrs(t){return this.showOnlyRuleStateAttrs=t,this}setAttributeFilter(t){return this.attributeFilter=t,this}setMultiSelect(t){return this.multiSelect=t,this}setSelectedAttributes(t){return this.selectedAttributes=t,this}setSelectedAssets(t){return this.selectedAssets=t,this.setDialogContent(),this}setOpen(t){return super.setOpen(t),this}setHeading(t){return super.setHeading(t),this}setContent(t){throw new Error("Cannot modify attribute picker content")}setActions(t){throw new Error("Cannot modify attribute picker actions")}setDismissAction(t){throw new Error("Cannot modify attribute picker dismiss action")}setStyles(t){throw new Error("Cannot modify attribute picker styles")}setAvatar(t){throw new Error("Cannot modify attribute picker avatar setting")}setDialogActions(){this.actions=[{actionName:"cancel",content:"cancel"},{actionName:"add",content:html`<or-mwc-input id="add-btn" class="button" label="add"
2
- .type="${InputType.BUTTON}" ?disabled="${!this.selectedAttributes.length}"
3
- @or-mwc-input-changed="${t=>{if(!this.selectedAttributes.length)return t.stopPropagation(),!1}}"></or-mwc-input>`,action:()=>{this.selectedAttributes.length&&this.dispatchEvent(new OrAttributePickerPickedEvent(this.selectedAttributes))}}]}setDialogContent(){const t=()=>this.assetAttributes?this.assetAttributes.map((t=>({text:Util.getAttributeLabel(void 0,t,void 0,!0),value:t.name}))):[];let e;!this.multiSelect&&1===this.selectedAttributes.length&&this.selectedAttributes[0].name&&(e={text:Util.getAttributeLabel(void 0,this.selectedAttributes[0],void 0,!0),value:this.selectedAttributes[0].name}),this.content=()=>html`
4
- <div class="row" style="display: flex;height: 600px;width: 800px;border-top: 1px solid ${unsafeCSS(DefaultColor5)};">
5
- <div class="col" style="width: 260px;overflow: auto;border-right: 1px solid ${unsafeCSS(DefaultColor5)};">
6
- <or-asset-tree id="chart-asset-tree" readonly
7
- .selectedIds="${this.selectedAssets.length>0?this.selectedAssets:null}"
8
- @or-asset-tree-selection="${t=>this._onAssetSelectionChanged(t)}">
9
- </or-asset-tree>
10
- </div>
11
- <div class="col" style="flex: 1 1 auto;width: 260px;overflow: auto;">
12
- ${this.assetAttributes&&this.assetAttributes.length>0?html`
13
- <div class="attributes-header">
14
- <or-translate value="attribute_plural"></or-translate>
15
- </div>
16
- ${this.multiSelect?html`<div style="display: grid">
17
- <or-mwc-list
18
- id="attribute-selector" .type="${ListType.MULTI_CHECKBOX}" .listItems="${t()}"
19
- .values="${this.selectedAttributes.filter((t=>t.id===this.asset.id)).map((t=>t.name))}"
20
- @or-mwc-list-changed="${t=>this._onAttributeSelectionChanged([...this.selectedAttributes.filter((t=>t.id!==this.asset.id)),...t.detail.map((t=>({id:this.asset.id,name:t.value})))])}"></or-mwc-list>
21
- </div>`:html`<or-mwc-input id="attribute-selector"
22
- style="display:flex;"
23
- .label="${i18next.t("attribute")}"
24
- .type="${InputType.LIST}"
25
- .options="${t().map((t=>[t,t.text]))}"
26
- @or-mwc-input-changed="${t=>{this._onAttributeSelectionChanged([{id:this.asset.id,name:t.detail.value.value}])}}"></or-mwc-input>`}
27
- `:html`<div style="display: flex;align-items: center;text-align: center;height: 100%;padding: 0 20px;"><span style="width:100%">
28
- <or-translate value="${this.assetAttributes&&0===this.assetAttributes.length?this.showOnlyDatapointAttrs&&this.showOnlyRuleStateAttrs?"noDatapointsOrRuleStateAttributes":this.showOnlyDatapointAttrs?"noDatapointsAttributes":this.showOnlyRuleStateAttrs?"noRuleStateAttributes":"noAttributesToShow":"selectAssetOnTheLeft"}">
29
- </or-translate></span></div>`}
30
- </div>
31
- `}_onAssetSelectionChanged(t){return __awaiter(this,void 0,void 0,(function*(){this.assetAttributes=void 0,this.multiSelect||(this.selectedAttributes=[]),this.addBtn.disabled=0===this.selectedAttributes.length;const e=t.target;e.disabled=!0;let s=0===t.detail.newNodes.length?void 0:t.detail.newNodes[0].asset;if(this.asset=s,s){const t=yield manager.rest.api.AssetResource.get(s.id);s=t.data,s&&(this.assetAttributes=Object.values(s.attributes).map((t=>Object.assign(Object.assign({},t),{id:s.id}))).sort(Util.sortByString((t=>t.name))),this.attributeFilter&&(this.assetAttributes=this.assetAttributes.filter((t=>this.attributeFilter(t)))),this.showOnlyDatapointAttrs&&this.showOnlyRuleStateAttrs?this.assetAttributes=this.assetAttributes.filter((t=>t.meta&&(t.meta.storeDataPoints||t.meta.ruleState||t.meta.agentLink))):this.showOnlyDatapointAttrs?this.assetAttributes=this.assetAttributes.filter((t=>t.meta&&(t.meta.storeDataPoints||t.meta.agentLink))):this.showOnlyRuleStateAttrs&&(this.assetAttributes=this.assetAttributes.filter((t=>t.meta&&(t.meta.ruleState||t.meta.agentLink)))))}e.disabled=!1}))}_onAttributeSelectionChanged(t){this.selectedAttributes=t,this.addBtn.disabled=0===this.selectedAttributes.length}};__decorate([property({type:Boolean})],OrAttributePicker.prototype,"showOnlyDatapointAttrs",void 0),__decorate([property({type:Boolean})],OrAttributePicker.prototype,"showOnlyRuleStateAttrs",void 0),__decorate([property()],OrAttributePicker.prototype,"attributeFilter",void 0),__decorate([property({type:Boolean})],OrAttributePicker.prototype,"multiSelect",void 0),__decorate([state()],OrAttributePicker.prototype,"assetAttributes",void 0),__decorate([query("#add-btn")],OrAttributePicker.prototype,"addBtn",void 0),OrAttributePicker=__decorate([customElement("or-attribute-picker")],OrAttributePicker);export{OrAttributePicker};
1
+ var __decorate=this&&this.__decorate||function(e,t,r,i){var s,c=arguments.length,o=c<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var A=e.length-1;A>=0;A--)(s=e[A])&&(o=(c<3?s(o):c>3?s(t,r,o):s(t,r))||o);return c>3&&o&&Object.defineProperty(t,r,o),o};import{customElement}from"lit/decorators.js";import{OrAssetAttributePicker,OrAssetAttributePickerPickedEvent}from"./asset-attribute-picker";import{AssetTypeAttributePickerPickedEvent,AssetTypeAttributePicker}from"./assettype-attribute-picker";export class OrAttributePickerPickedEvent extends OrAssetAttributePickerPickedEvent{}let OrAttributePicker=class extends OrAssetAttributePicker{};OrAttributePicker=__decorate([customElement("or-attribute-picker")],OrAttributePicker);export{OrAttributePicker};export class OrAssetTypeAttributePickerPickedEvent extends AssetTypeAttributePickerPickedEvent{}let OrAssetTypeAttributePicker=class extends AssetTypeAttributePicker{};OrAssetTypeAttributePicker=__decorate([customElement("or-assettype-attribute-picker")],OrAssetTypeAttributePicker);export{OrAssetTypeAttributePicker};
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAC,IAAI,EAAkB,SAAS,EAAC,MAAM,KAAK,CAAC;AACpD,OAAO,EAAC,aAAa,EAAE,QAA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
1
1
  {
2
2
  "name": "@openremote/or-attribute-picker",
3
- "version": "1.2.0-snapshot.20240819114736",
3
+ "version": "1.2.0-snapshot.20240913085022",
4
4
  "description": "OpenRemote attribute picker dialog",
5
5
  "main": "dist/umd/index.bundle.js",
6
6
  "module": "lib/index.js",
@@ -16,14 +16,14 @@
16
16
  "author": "OpenRemote",
17
17
  "license": "AGPL-3.0-or-later",
18
18
  "dependencies": {
19
- "@openremote/core": "1.2.0-snapshot.20240819114736",
20
- "@openremote/or-asset-tree": "1.2.0-snapshot.20240819114736",
21
- "@openremote/or-mwc-components": "1.2.0-snapshot.20240819114736",
22
- "@openremote/or-translate": "1.2.0-snapshot.20240819114736",
19
+ "@openremote/core": "1.2.0-snapshot.20240913085022",
20
+ "@openremote/or-asset-tree": "1.2.0-snapshot.20240913085022",
21
+ "@openremote/or-mwc-components": "1.2.0-snapshot.20240913085022",
22
+ "@openremote/or-translate": "1.2.0-snapshot.20240913085022",
23
23
  "lit": "^2.0.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@openremote/util": "1.2.0-snapshot.20240819114736"
26
+ "@openremote/util": "1.2.0-snapshot.20240913085022"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"