@openremote/or-chart 1.6.0 → 1.6.3
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/custom-elements.json +211 -47
- package/dist/umd/index.bundle.js +8 -7
- package/dist/umd/index.js +8 -7
- package/dist/umd/index.orbundle.js +21 -20
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/package.json +10 -10
package/custom-elements.json
CHANGED
|
@@ -43,12 +43,6 @@
|
|
|
43
43
|
"static": true,
|
|
44
44
|
"default": "\"L HH:mm:ss\""
|
|
45
45
|
},
|
|
46
|
-
{
|
|
47
|
-
"kind": "field",
|
|
48
|
-
"name": "styles",
|
|
49
|
-
"static": true,
|
|
50
|
-
"readonly": true
|
|
51
|
-
},
|
|
52
46
|
{
|
|
53
47
|
"kind": "field",
|
|
54
48
|
"name": "assets",
|
|
@@ -56,7 +50,8 @@
|
|
|
56
50
|
"text": "Asset[]"
|
|
57
51
|
},
|
|
58
52
|
"privacy": "public",
|
|
59
|
-
"default": "[]"
|
|
53
|
+
"default": "[]",
|
|
54
|
+
"attribute": "assets"
|
|
60
55
|
},
|
|
61
56
|
{
|
|
62
57
|
"kind": "field",
|
|
@@ -64,7 +59,8 @@
|
|
|
64
59
|
"type": {
|
|
65
60
|
"text": "Asset | undefined"
|
|
66
61
|
},
|
|
67
|
-
"privacy": "private"
|
|
62
|
+
"privacy": "private",
|
|
63
|
+
"attribute": "activeAsset"
|
|
68
64
|
},
|
|
69
65
|
{
|
|
70
66
|
"kind": "field",
|
|
@@ -73,7 +69,8 @@
|
|
|
73
69
|
"text": "[number, Attribute<any>][]"
|
|
74
70
|
},
|
|
75
71
|
"privacy": "public",
|
|
76
|
-
"default": "[]"
|
|
72
|
+
"default": "[]",
|
|
73
|
+
"attribute": "assetAttributes"
|
|
77
74
|
},
|
|
78
75
|
{
|
|
79
76
|
"kind": "field",
|
|
@@ -82,7 +79,8 @@
|
|
|
82
79
|
"text": "AttributeRef[]"
|
|
83
80
|
},
|
|
84
81
|
"privacy": "public",
|
|
85
|
-
"default": "[]"
|
|
82
|
+
"default": "[]",
|
|
83
|
+
"attribute": "rightAxisAttributes"
|
|
86
84
|
},
|
|
87
85
|
{
|
|
88
86
|
"kind": "field",
|
|
@@ -90,7 +88,8 @@
|
|
|
90
88
|
"type": {
|
|
91
89
|
"text": "(startOfPeriod: number, endOfPeriod: number, timeUnits: TimeUnit, stepSize: number) => Promise<ChartDataset<\"line\", ScatterDataPoint[]>[]> | undefined"
|
|
92
90
|
},
|
|
93
|
-
"privacy": "public"
|
|
91
|
+
"privacy": "public",
|
|
92
|
+
"attribute": "dataProvider"
|
|
94
93
|
},
|
|
95
94
|
{
|
|
96
95
|
"kind": "field",
|
|
@@ -99,7 +98,8 @@
|
|
|
99
98
|
"text": "string[]"
|
|
100
99
|
},
|
|
101
100
|
"privacy": "public",
|
|
102
|
-
"default": "[\"#3869B1\", \"#DA7E30\", \"#3F9852\", \"#CC2428\", \"#6B4C9A\", \"#922427\", \"#958C3D\", \"#535055\"]"
|
|
101
|
+
"default": "[\"#3869B1\", \"#DA7E30\", \"#3F9852\", \"#CC2428\", \"#6B4C9A\", \"#922427\", \"#958C3D\", \"#535055\"]",
|
|
102
|
+
"attribute": "colors"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
"kind": "field",
|
|
@@ -108,7 +108,8 @@
|
|
|
108
108
|
"text": "AssetDatapointQueryUnion"
|
|
109
109
|
},
|
|
110
110
|
"privacy": "public",
|
|
111
|
-
"readonly": true
|
|
111
|
+
"readonly": true,
|
|
112
|
+
"attribute": "datapointQuery"
|
|
112
113
|
},
|
|
113
114
|
{
|
|
114
115
|
"kind": "field",
|
|
@@ -116,7 +117,8 @@
|
|
|
116
117
|
"type": {
|
|
117
118
|
"text": "OrChartConfig | undefined"
|
|
118
119
|
},
|
|
119
|
-
"privacy": "public"
|
|
120
|
+
"privacy": "public",
|
|
121
|
+
"attribute": "config"
|
|
120
122
|
},
|
|
121
123
|
{
|
|
122
124
|
"kind": "field",
|
|
@@ -124,7 +126,8 @@
|
|
|
124
126
|
"type": {
|
|
125
127
|
"text": "any | undefined"
|
|
126
128
|
},
|
|
127
|
-
"privacy": "public"
|
|
129
|
+
"privacy": "public",
|
|
130
|
+
"attribute": "chartOptions"
|
|
128
131
|
},
|
|
129
132
|
{
|
|
130
133
|
"kind": "field",
|
|
@@ -132,7 +135,8 @@
|
|
|
132
135
|
"type": {
|
|
133
136
|
"text": "string | undefined"
|
|
134
137
|
},
|
|
135
|
-
"privacy": "public"
|
|
138
|
+
"privacy": "public",
|
|
139
|
+
"attribute": "realm"
|
|
136
140
|
},
|
|
137
141
|
{
|
|
138
142
|
"kind": "field",
|
|
@@ -140,7 +144,8 @@
|
|
|
140
144
|
"type": {
|
|
141
145
|
"text": "string | undefined"
|
|
142
146
|
},
|
|
143
|
-
"privacy": "public"
|
|
147
|
+
"privacy": "public",
|
|
148
|
+
"attribute": "panelName"
|
|
144
149
|
},
|
|
145
150
|
{
|
|
146
151
|
"kind": "field",
|
|
@@ -149,7 +154,8 @@
|
|
|
149
154
|
"text": "boolean"
|
|
150
155
|
},
|
|
151
156
|
"privacy": "public",
|
|
152
|
-
"default": "true"
|
|
157
|
+
"default": "true",
|
|
158
|
+
"attribute": "attributeControls"
|
|
153
159
|
},
|
|
154
160
|
{
|
|
155
161
|
"kind": "field",
|
|
@@ -157,7 +163,8 @@
|
|
|
157
163
|
"type": {
|
|
158
164
|
"text": "[Date, Date] | undefined"
|
|
159
165
|
},
|
|
160
|
-
"privacy": "public"
|
|
166
|
+
"privacy": "public",
|
|
167
|
+
"attribute": "timeframe"
|
|
161
168
|
},
|
|
162
169
|
{
|
|
163
170
|
"kind": "field",
|
|
@@ -166,7 +173,8 @@
|
|
|
166
173
|
"text": "boolean"
|
|
167
174
|
},
|
|
168
175
|
"privacy": "public",
|
|
169
|
-
"default": "true"
|
|
176
|
+
"default": "true",
|
|
177
|
+
"attribute": "timestampControls"
|
|
170
178
|
},
|
|
171
179
|
{
|
|
172
180
|
"kind": "field",
|
|
@@ -174,7 +182,8 @@
|
|
|
174
182
|
"type": {
|
|
175
183
|
"text": "Map<string, TimePresetCallback> | undefined"
|
|
176
184
|
},
|
|
177
|
-
"privacy": "public"
|
|
185
|
+
"privacy": "public",
|
|
186
|
+
"attribute": "timePresetOptions"
|
|
178
187
|
},
|
|
179
188
|
{
|
|
180
189
|
"kind": "field",
|
|
@@ -182,7 +191,8 @@
|
|
|
182
191
|
"type": {
|
|
183
192
|
"text": "string | undefined"
|
|
184
193
|
},
|
|
185
|
-
"privacy": "public"
|
|
194
|
+
"privacy": "public",
|
|
195
|
+
"attribute": "timePresetKey"
|
|
186
196
|
},
|
|
187
197
|
{
|
|
188
198
|
"kind": "field",
|
|
@@ -191,7 +201,8 @@
|
|
|
191
201
|
"text": "boolean"
|
|
192
202
|
},
|
|
193
203
|
"privacy": "public",
|
|
194
|
-
"default": "true"
|
|
204
|
+
"default": "true",
|
|
205
|
+
"attribute": "showLegend"
|
|
195
206
|
},
|
|
196
207
|
{
|
|
197
208
|
"kind": "field",
|
|
@@ -200,7 +211,8 @@
|
|
|
200
211
|
"text": "boolean"
|
|
201
212
|
},
|
|
202
213
|
"privacy": "public",
|
|
203
|
-
"default": "false"
|
|
214
|
+
"default": "false",
|
|
215
|
+
"attribute": "denseLegend"
|
|
204
216
|
},
|
|
205
217
|
{
|
|
206
218
|
"kind": "field",
|
|
@@ -209,7 +221,8 @@
|
|
|
209
221
|
"text": "boolean"
|
|
210
222
|
},
|
|
211
223
|
"privacy": "protected",
|
|
212
|
-
"default": "false"
|
|
224
|
+
"default": "false",
|
|
225
|
+
"attribute": "_loading"
|
|
213
226
|
},
|
|
214
227
|
{
|
|
215
228
|
"kind": "field",
|
|
@@ -218,7 +231,8 @@
|
|
|
218
231
|
"text": "ChartDataset<\"line\", ScatterDataPoint[]>[] | undefined"
|
|
219
232
|
},
|
|
220
233
|
"privacy": "protected",
|
|
221
|
-
"default": "undefined"
|
|
234
|
+
"default": "undefined",
|
|
235
|
+
"attribute": "_data"
|
|
222
236
|
},
|
|
223
237
|
{
|
|
224
238
|
"kind": "field",
|
|
@@ -226,7 +240,8 @@
|
|
|
226
240
|
"type": {
|
|
227
241
|
"text": "TemplateResult | undefined"
|
|
228
242
|
},
|
|
229
|
-
"privacy": "protected"
|
|
243
|
+
"privacy": "protected",
|
|
244
|
+
"attribute": "_tableTemplate"
|
|
230
245
|
},
|
|
231
246
|
{
|
|
232
247
|
"kind": "field",
|
|
@@ -300,22 +315,6 @@
|
|
|
300
315
|
},
|
|
301
316
|
"privacy": "protected"
|
|
302
317
|
},
|
|
303
|
-
{
|
|
304
|
-
"kind": "method",
|
|
305
|
-
"name": "firstUpdated"
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
"kind": "method",
|
|
309
|
-
"name": "updated",
|
|
310
|
-
"parameters": [
|
|
311
|
-
{
|
|
312
|
-
"name": "changedProperties",
|
|
313
|
-
"type": {
|
|
314
|
-
"text": "PropertyValues"
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
]
|
|
318
|
-
},
|
|
319
318
|
{
|
|
320
319
|
"kind": "method",
|
|
321
320
|
"name": "applyChartResponsiveness",
|
|
@@ -325,10 +324,6 @@
|
|
|
325
324
|
}
|
|
326
325
|
}
|
|
327
326
|
},
|
|
328
|
-
{
|
|
329
|
-
"kind": "method",
|
|
330
|
-
"name": "render"
|
|
331
|
-
},
|
|
332
327
|
{
|
|
333
328
|
"kind": "method",
|
|
334
329
|
"name": "_onTreeSelectionChanged",
|
|
@@ -587,6 +582,166 @@
|
|
|
587
582
|
}
|
|
588
583
|
}
|
|
589
584
|
],
|
|
585
|
+
"attributes": [
|
|
586
|
+
{
|
|
587
|
+
"name": "assets",
|
|
588
|
+
"type": {
|
|
589
|
+
"text": "Asset[]"
|
|
590
|
+
},
|
|
591
|
+
"default": "[]",
|
|
592
|
+
"fieldName": "assets"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"name": "activeAsset",
|
|
596
|
+
"type": {
|
|
597
|
+
"text": "Asset | undefined"
|
|
598
|
+
},
|
|
599
|
+
"fieldName": "activeAsset"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"name": "assetAttributes",
|
|
603
|
+
"type": {
|
|
604
|
+
"text": "[number, Attribute<any>][]"
|
|
605
|
+
},
|
|
606
|
+
"default": "[]",
|
|
607
|
+
"fieldName": "assetAttributes"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"name": "rightAxisAttributes",
|
|
611
|
+
"type": {
|
|
612
|
+
"text": "AttributeRef[]"
|
|
613
|
+
},
|
|
614
|
+
"default": "[]",
|
|
615
|
+
"fieldName": "rightAxisAttributes"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"name": "dataProvider",
|
|
619
|
+
"type": {
|
|
620
|
+
"text": "(startOfPeriod: number, endOfPeriod: number, timeUnits: TimeUnit, stepSize: number) => Promise<ChartDataset<\"line\", ScatterDataPoint[]>[]> | undefined"
|
|
621
|
+
},
|
|
622
|
+
"fieldName": "dataProvider"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
"name": "colors",
|
|
626
|
+
"type": {
|
|
627
|
+
"text": "string[]"
|
|
628
|
+
},
|
|
629
|
+
"default": "[\"#3869B1\", \"#DA7E30\", \"#3F9852\", \"#CC2428\", \"#6B4C9A\", \"#922427\", \"#958C3D\", \"#535055\"]",
|
|
630
|
+
"fieldName": "colors"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "datapointQuery",
|
|
634
|
+
"type": {
|
|
635
|
+
"text": "AssetDatapointQueryUnion"
|
|
636
|
+
},
|
|
637
|
+
"readonly": true,
|
|
638
|
+
"fieldName": "datapointQuery"
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"name": "config",
|
|
642
|
+
"type": {
|
|
643
|
+
"text": "OrChartConfig | undefined"
|
|
644
|
+
},
|
|
645
|
+
"fieldName": "config"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
"name": "chartOptions",
|
|
649
|
+
"type": {
|
|
650
|
+
"text": "any | undefined"
|
|
651
|
+
},
|
|
652
|
+
"fieldName": "chartOptions"
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"name": "realm",
|
|
656
|
+
"type": {
|
|
657
|
+
"text": "string | undefined"
|
|
658
|
+
},
|
|
659
|
+
"fieldName": "realm"
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"name": "panelName",
|
|
663
|
+
"type": {
|
|
664
|
+
"text": "string | undefined"
|
|
665
|
+
},
|
|
666
|
+
"fieldName": "panelName"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"name": "attributeControls",
|
|
670
|
+
"type": {
|
|
671
|
+
"text": "boolean"
|
|
672
|
+
},
|
|
673
|
+
"default": "true",
|
|
674
|
+
"fieldName": "attributeControls"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "timeframe",
|
|
678
|
+
"type": {
|
|
679
|
+
"text": "[Date, Date] | undefined"
|
|
680
|
+
},
|
|
681
|
+
"fieldName": "timeframe"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "timestampControls",
|
|
685
|
+
"type": {
|
|
686
|
+
"text": "boolean"
|
|
687
|
+
},
|
|
688
|
+
"default": "true",
|
|
689
|
+
"fieldName": "timestampControls"
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"name": "timePresetOptions",
|
|
693
|
+
"type": {
|
|
694
|
+
"text": "Map<string, TimePresetCallback> | undefined"
|
|
695
|
+
},
|
|
696
|
+
"fieldName": "timePresetOptions"
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
"name": "timePresetKey",
|
|
700
|
+
"type": {
|
|
701
|
+
"text": "string | undefined"
|
|
702
|
+
},
|
|
703
|
+
"fieldName": "timePresetKey"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
"name": "showLegend",
|
|
707
|
+
"type": {
|
|
708
|
+
"text": "boolean"
|
|
709
|
+
},
|
|
710
|
+
"default": "true",
|
|
711
|
+
"fieldName": "showLegend"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
"name": "denseLegend",
|
|
715
|
+
"type": {
|
|
716
|
+
"text": "boolean"
|
|
717
|
+
},
|
|
718
|
+
"default": "false",
|
|
719
|
+
"fieldName": "denseLegend"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"name": "_loading",
|
|
723
|
+
"type": {
|
|
724
|
+
"text": "boolean"
|
|
725
|
+
},
|
|
726
|
+
"default": "false",
|
|
727
|
+
"fieldName": "_loading"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "_data",
|
|
731
|
+
"type": {
|
|
732
|
+
"text": "ChartDataset<\"line\", ScatterDataPoint[]>[] | undefined"
|
|
733
|
+
},
|
|
734
|
+
"default": "undefined",
|
|
735
|
+
"fieldName": "_data"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"name": "_tableTemplate",
|
|
739
|
+
"type": {
|
|
740
|
+
"text": "TemplateResult | undefined"
|
|
741
|
+
},
|
|
742
|
+
"fieldName": "_tableTemplate"
|
|
743
|
+
}
|
|
744
|
+
],
|
|
590
745
|
"mixins": [
|
|
591
746
|
{
|
|
592
747
|
"name": "translate(i18next)",
|
|
@@ -597,6 +752,7 @@
|
|
|
597
752
|
"name": "LitElement",
|
|
598
753
|
"package": "lit"
|
|
599
754
|
},
|
|
755
|
+
"tagName": "or-chart",
|
|
600
756
|
"customElement": true
|
|
601
757
|
}
|
|
602
758
|
],
|
|
@@ -616,6 +772,14 @@
|
|
|
616
772
|
"name": "OrChart",
|
|
617
773
|
"module": "src/index.ts"
|
|
618
774
|
}
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"kind": "custom-element-definition",
|
|
778
|
+
"name": "or-chart",
|
|
779
|
+
"declaration": {
|
|
780
|
+
"name": "OrChart",
|
|
781
|
+
"module": "src/index.ts"
|
|
782
|
+
}
|
|
619
783
|
}
|
|
620
784
|
]
|
|
621
785
|
}
|
package/dist/umd/index.bundle.js
CHANGED
|
@@ -260,7 +260,7 @@
|
|
|
260
260
|
.mdc-list-item__graphic > or-icon {
|
|
261
261
|
pointer-events: none;
|
|
262
262
|
}
|
|
263
|
-
`;let Pa=class extends Tt{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[mt`${ut(ga)}`,mt`${ut(fa)}`,mt`${ut(_a)}`,mt`${ut(ba)}`,mt`${ut(ya)}`,mt`${ut(va)}`,mt`${ut(xa)}`,mt`${ut(ka)}`,mt`${ut(wa)}`,mt`${ut(Ma)}`,mt`${ut(La)}`,mt`${ut(Ta)}`,mt`${ut(Da)}`,mt`${ut(Ya)}`,mt`${ut(Sa)}`,mt`${ut(Ea)}`,Ia]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===Ca.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ca.DATETIME:"boolean"==typeof this.value?this.type=Ca.CHECKBOX:"number"==typeof this.value?this.type=Ca.NUMBER:"string"==typeof this.value?this.type=Ca.TEXT:this.type=Ca.JSON),!0}focus(){this.type===Ca.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},o=null!==this.value&&void 0!==this.value||!1===this.value;let s=e?N`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ca.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,N`
|
|
263
|
+
`;let Pa=class extends Tt{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[mt`${ut(ga)}`,mt`${ut(fa)}`,mt`${ut(_a)}`,mt`${ut(ba)}`,mt`${ut(ya)}`,mt`${ut(va)}`,mt`${ut(xa)}`,mt`${ut(ka)}`,mt`${ut(wa)}`,mt`${ut(Ma)}`,mt`${ut(La)}`,mt`${ut(Ta)}`,mt`${ut(Da)}`,mt`${ut(Ya)}`,mt`${ut(Sa)}`,mt`${ut(Ea)}`,Ia]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null===(t=this._menuObserver)||void 0===t||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null===(e=this._menuObserver)||void 0===e||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===Ca.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===Ca.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=Ca.DATETIME:"boolean"==typeof this.value?this.type=Ca.CHECKBOX:"number"==typeof this.value?this.type=Ca.NUMBER:"string"==typeof this.value?this.type=Ca.TEXT:this.type=Ca.JSON),!0}focus(){this.type===Ca.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){var t;if(this.type){const e=!this.fullWidth&&this.label;let n=!this.fullWidth&&this.outlined,i=!!this.helperText;const r=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),a={"mdc-text-field-helper-text--persistent":!r&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":r},o=null!==this.value&&void 0!==this.value||!1===this.value;let s=e?N`<span class="mdc-floating-label ${o?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case Ca.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,N`
|
|
264
264
|
<div class="mdc-radio-container">
|
|
265
265
|
${e?e.map((([t,e],n)=>(this.value===t&&(this._selectedIndex=n),N`
|
|
266
266
|
<div id="field" class="mdc-form-field">
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
/>
|
|
430
430
|
<label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
|
|
431
431
|
</div>
|
|
432
|
-
`;case Ca.NUMBER:case Ca.RANGE:case Ca.DATE:case Ca.DATETIME:case Ca.TIME:case Ca.MONTH:case Ca.WEEK:case Ca.EMAIL:case Ca.PASSWORD:case Ca.TELEPHONE:case Ca.URL:case Ca.TEXT:case Ca.TEXTAREA:case Ca.JSON:case Ca.JSON_OBJECT:{let e,l=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(l.some((t=>"string"!=typeof t)))if(this.type===Ca.JSON||this.type===Ca.JSON_OBJECT)if(void 0!==l[0]){if("string"!=typeof l[0]||null===l[0])try{l[0]=JSON.stringify(l[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),l[0]=""}}else l[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Ca.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Ca.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Ca.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Ca.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Ca.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Ca.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,l=l.map((t=>void 0!==t?Ve.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let d=this.label,c=this.type,u="component";if(this.type===Ca.RANGE&&(d=void 0,n=!1,i=!1,c=Ca.NUMBER,u="number"),this.type!==Ca.RANGE||!this.disableSliderNumberInput){const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":o,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT?N`
|
|
432
|
+
`;case Ca.NUMBER:case Ca.RANGE:case Ca.DATE:case Ca.DATETIME:case Ca.TIME:case Ca.MONTH:case Ca.WEEK:case Ca.EMAIL:case Ca.PASSWORD:case Ca.TELEPHONE:case Ca.URL:case Ca.TEXT:case Ca.TEXTAREA:case Ca.JSON:case Ca.JSON_OBJECT:{let e,l=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(l.some((t=>"string"!=typeof t)))if(this.type===Ca.JSON||this.type===Ca.JSON_OBJECT)if(void 0!==l[0]){if("string"!=typeof l[0]||null===l[0])try{l[0]=JSON.stringify(l[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),l[0]=""}}else l[0]="";else{const e=this.format?Object.assign({},this.format):{};switch(this.type){case Ca.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case Ca.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case Ca.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case Ca.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case Ca.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case Ca.NUMBER:null!==(t=e.maximumFractionDigits)&&void 0!==t||(e.maximumFractionDigits=20)}e.useGrouping=!1,l=l.map((t=>void 0!==t?Ve.Util.getValueAsString(t,(()=>e),"en-GB"):void 0))}let d=this.label,c=this.type,u="component";if(this.type===Ca.RANGE&&(d=void 0,n=!1,i=!1,c=Ca.NUMBER,u="number"),this.type!==Ca.RANGE||!this.disableSliderNumberInput){this.censored&&(c=Ca.PASSWORD),this.type===Ca.PASSWORD&&this.advertised&&(c=Ca.TEXT);const t={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!n,"mdc-text-field--outlined":n,"mdc-text-field--textarea":c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT),"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":o,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};e=c===Ca.TEXTAREA||c===Ca.JSON||c===Ca.JSON_OBJECT?N`
|
|
433
433
|
<textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
|
|
434
434
|
?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${_n(this.minLength)}"
|
|
435
435
|
maxlength="${_n(this.maxLength)}" rows="${this.rows?this.rows:5}"
|
|
@@ -451,6 +451,7 @@
|
|
|
451
451
|
${e}
|
|
452
452
|
${n?this.renderOutlined(s):s}
|
|
453
453
|
${n?"":N`<span class="mdc-line-ripple"></span>`}
|
|
454
|
+
${this.type!==Ca.PASSWORD||this.censored?"":N`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`}
|
|
454
455
|
${this.iconTrailing?N`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
|
|
455
456
|
</label>
|
|
456
457
|
${i||r?N`
|
|
@@ -493,7 +494,7 @@
|
|
|
493
494
|
`:""}
|
|
494
495
|
<span class="mdc-notched-outline__trailing"></span>
|
|
495
496
|
</span>
|
|
496
|
-
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==Ca.JSON&&this.type!==Ca.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case Ca.CHECKBOX:case Ca.SWITCH:e="on"===e;break;case Ca.JSON:case Ca.JSON_OBJECT:case Ca.NUMBER:case Ca.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ca.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=$e.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===Ca.JSON||this.type==Ca.JSON_OBJECT?$e.i18next.t("validation.invalidJSON"):$e.i18next.t("validation.invalidNumber")}break;case Ca.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=$e.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==Ca.CHECKBOX_LIST&&e!==o&&(this.type===Ca.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Aa(this.value,o,n))),null!=this.searchProvider&&this.type===Ca.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==Ca.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new Aa(e,o,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,$e.i18next.t(e,{defaultValue:Ve.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};ha([At({type:Boolean})],Pa.prototype,"focused",void 0),ha([At()],Pa.prototype,"value",void 0),ha([At({type:String})],Pa.prototype,"type",void 0),ha([At({type:String})],Pa.prototype,"name",void 0),ha([At({type:Boolean})],Pa.prototype,"readonly",void 0),ha([At({type:Boolean})],Pa.prototype,"required",void 0),ha([At()],Pa.prototype,"max",void 0),ha([At()],Pa.prototype,"min",void 0),ha([At({type:Number})],Pa.prototype,"step",void 0),ha([At({type:Boolean})],Pa.prototype,"checked",void 0),ha([At({type:Boolean})],Pa.prototype,"indeterminate",void 0),ha([At({type:Number})],Pa.prototype,"maxLength",void 0),ha([At({type:Number})],Pa.prototype,"minLength",void 0),ha([At({type:Number})],Pa.prototype,"rows",void 0),ha([At({type:Number})],Pa.prototype,"cols",void 0),ha([At({type:Boolean})],Pa.prototype,"multiple",void 0),ha([At({type:String,attribute:!0,reflect:!1})],Pa.prototype,"pattern",void 0),ha([At({type:String})],Pa.prototype,"placeHolder",void 0),ha([At({type:Array})],Pa.prototype,"options",void 0),ha([At({type:Boolean})],Pa.prototype,"autoSelect",void 0),ha([At({type:Object})],Pa.prototype,"searchProvider",void 0),ha([At({type:String})],Pa.prototype,"searchLabel",void 0),ha([At({type:String})],Pa.prototype,"icon",void 0),ha([At({type:String})],Pa.prototype,"iconColor",void 0),ha([At({type:String})],Pa.prototype,"iconOn",void 0),ha([At({type:String})],Pa.prototype,"iconTrailing",void 0),ha([At({type:Boolean})],Pa.prototype,"compact",void 0),ha([At({type:Boolean})],Pa.prototype,"comfortable",void 0),ha([At({type:Boolean})],Pa.prototype,"raised",void 0),ha([At({type:Boolean})],Pa.prototype,"action",void 0),ha([At({type:Boolean})],Pa.prototype,"unElevated",void 0),ha([At({type:Boolean})],Pa.prototype,"outlined",void 0),ha([At({type:Boolean})],Pa.prototype,"rounded",void 0),ha([At({type:Object})],Pa.prototype,"format",void 0),ha([At({type:Boolean})],Pa.prototype,"disableSliderNumberInput",void 0),ha([At({type:Boolean})],Pa.prototype,"fullWidth",void 0),ha([At({type:String})],Pa.prototype,"helperText",void 0),ha([At({type:Boolean})],Pa.prototype,"helperPersistent",void 0),ha([At({type:String,attribute:!0})],Pa.prototype,"validationMessage",void 0),ha([At({type:Boolean})],Pa.prototype,"autoValidate",void 0),ha([At({type:Boolean})],Pa.prototype,"charCounter",void 0),ha([At({type:String})],Pa.prototype,"label",void 0),ha([At({type:Boolean})],Pa.prototype,"disabled",void 0),ha([At({type:Boolean})],Pa.prototype,"continuous",void 0),ha([At({type:Boolean})],Pa.prototype,"resizeVertical",void 0),ha([Ct()],Pa.prototype,"isUiValid",void 0),ha([Ct()],Pa.prototype,"searchableValue",void 0),ha([Ct()],Pa.prototype,"errorMessage",void 0),Pa=ha([St("or-mwc-input")],Pa);var Ra=function(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};const Ha=d(420),ja=d(6568),za=mt`
|
|
497
|
+
`}setCustomValidity(t){this.errorMessage=t;const e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){const t=this.shadowRoot.getElementById("elem");let e=!0;return t&&t.validity&&(e=t.validity.valid),!e||this.type!==Ca.JSON&&this.type!==Ca.JSON_OBJECT||void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,n){var i,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case Ca.CHECKBOX:case Ca.SWITCH:e="on"===e;break;case Ca.JSON:case Ca.JSON_OBJECT:case Ca.NUMBER:case Ca.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==Ca.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,a=$e.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===Ca.JSON||this.type==Ca.JSON_OBJECT?$e.i18next.t("validation.invalidJSON"):$e.i18next.t("validation.invalidNumber")}break;case Ca.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=$e.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==Ca.CHECKBOX_LIST&&e!==o&&(this.type===Ca.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new Aa(this.value,o,n))),null!=this.searchProvider&&this.type===Ca.SELECT){const t=null===(r=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===r?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==Ca.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new Aa(e,o,n))}get valid(){const t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){const t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map((t=>{if(Array.isArray(t))return t;{const e=""+t;return[t,$e.i18next.t(e,{defaultValue:Ve.Util.camelCaseToSentenceCase(e)})]}}))),e}getSelectedTextValue(t){const e=this.value,n=Array.isArray(e)?e:null!=e?[e]:void 0;if(!n)return"";const i=t||this.resolveOptions(this.options);return i&&n?n.map((t=>i.find((([e,n],i)=>t===e)))).map((t=>t?t[1]:"")).join(", "):""}};ha([At({type:Boolean})],Pa.prototype,"focused",void 0),ha([At()],Pa.prototype,"value",void 0),ha([At({type:String})],Pa.prototype,"type",void 0),ha([At({type:String})],Pa.prototype,"name",void 0),ha([At({type:Boolean})],Pa.prototype,"readonly",void 0),ha([At({type:Boolean})],Pa.prototype,"required",void 0),ha([At()],Pa.prototype,"max",void 0),ha([At()],Pa.prototype,"min",void 0),ha([At({type:Number})],Pa.prototype,"step",void 0),ha([At({type:Boolean})],Pa.prototype,"checked",void 0),ha([At({type:Boolean})],Pa.prototype,"indeterminate",void 0),ha([At({type:Number})],Pa.prototype,"maxLength",void 0),ha([At({type:Number})],Pa.prototype,"minLength",void 0),ha([At({type:Number})],Pa.prototype,"rows",void 0),ha([At({type:Number})],Pa.prototype,"cols",void 0),ha([At({type:Boolean})],Pa.prototype,"multiple",void 0),ha([At({type:String,attribute:!0,reflect:!1})],Pa.prototype,"pattern",void 0),ha([At({type:String})],Pa.prototype,"placeHolder",void 0),ha([At({type:Array})],Pa.prototype,"options",void 0),ha([At({type:Boolean})],Pa.prototype,"autoSelect",void 0),ha([At({type:Object})],Pa.prototype,"searchProvider",void 0),ha([At({type:String})],Pa.prototype,"searchLabel",void 0),ha([At({type:String})],Pa.prototype,"icon",void 0),ha([At({type:String})],Pa.prototype,"iconColor",void 0),ha([At({type:String})],Pa.prototype,"iconOn",void 0),ha([At({type:String})],Pa.prototype,"iconTrailing",void 0),ha([At({type:Boolean})],Pa.prototype,"compact",void 0),ha([At({type:Boolean})],Pa.prototype,"comfortable",void 0),ha([At({type:Boolean})],Pa.prototype,"raised",void 0),ha([At({type:Boolean})],Pa.prototype,"action",void 0),ha([At({type:Boolean})],Pa.prototype,"unElevated",void 0),ha([At({type:Boolean})],Pa.prototype,"outlined",void 0),ha([At({type:Boolean})],Pa.prototype,"rounded",void 0),ha([At({type:Object})],Pa.prototype,"format",void 0),ha([At({type:Boolean})],Pa.prototype,"disableSliderNumberInput",void 0),ha([At({type:Boolean})],Pa.prototype,"fullWidth",void 0),ha([At({type:String})],Pa.prototype,"helperText",void 0),ha([At({type:Boolean})],Pa.prototype,"helperPersistent",void 0),ha([At({type:String,attribute:!0})],Pa.prototype,"validationMessage",void 0),ha([At({type:Boolean})],Pa.prototype,"autoValidate",void 0),ha([At({type:Boolean})],Pa.prototype,"charCounter",void 0),ha([At({type:String})],Pa.prototype,"label",void 0),ha([At({type:Boolean})],Pa.prototype,"disabled",void 0),ha([At({type:Boolean})],Pa.prototype,"continuous",void 0),ha([At({type:Boolean})],Pa.prototype,"resizeVertical",void 0),ha([At({type:Boolean})],Pa.prototype,"censored",void 0),ha([At({type:Boolean,reflect:!0})],Pa.prototype,"advertised",void 0),ha([Ct()],Pa.prototype,"isUiValid",void 0),ha([Ct()],Pa.prototype,"searchableValue",void 0),ha([Ct()],Pa.prototype,"errorMessage",void 0),Pa=ha([St("or-mwc-input")],Pa);var Ra=function(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o};const Ha=d(420),ja=d(6568),za=mt`
|
|
497
498
|
|
|
498
499
|
:host {
|
|
499
500
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${ut(Ve.DefaultColor2)}));
|
|
@@ -974,10 +975,10 @@
|
|
|
974
975
|
<div class="period-controls">
|
|
975
976
|
${this.timePresetOptions&&this.timePresetKey?N`
|
|
976
977
|
${this.timestampControls?N`
|
|
977
|
-
${function(t,e,n,i,r,a=!1,o=!0,s=!1,l=!1){return N`
|
|
978
|
+
${function(t,e,n,i,r,a=!1,o=!0,s=!1,l=!1,d="menu",c=!1){let u=null;return N`
|
|
978
979
|
<span>
|
|
979
|
-
<span @click="${t=>{e&&t.currentTarget.parentElement.lastElementChild.open()}}">${t}</span>
|
|
980
|
-
${e?N`<or-mwc-menu ?multiselect="${a}" @or-mwc-menu-closed="${()=>{r&&r()}}" @or-mwc-menu-changed="${t=>{i&&i(t.detail)}}" .translateValues="${o}" .values="${n}" .menuItems="${e}" .midHeight="${s}" .fullWidth="${l}" id="
|
|
980
|
+
<span @click="${t=>{if(e){if(c&&u){const e=t.currentTarget;!function(t,e){e||(e=document.body);const n=e.getBoundingClientRect();Object.assign(t.style,{position:"fixed",top:`${n.bottom}px`,left:`${n.left}px`,zIndex:"1000",display:"block"})}(u,e)}t.currentTarget.parentElement.lastElementChild.open()}}}">${t}</span>
|
|
981
|
+
${e?N`<or-mwc-menu ?multiselect="${a}" @or-mwc-menu-closed="${()=>{r&&r()}}" @or-mwc-menu-changed="${t=>{i&&i(t.detail)}}" .translateValues="${o}" .values="${n}" .menuItems="${e}" .midHeight="${s}" .fullWidth="${l}" id="${d}" ${pn((t=>u=t))}></or-mwc-menu>`:""}
|
|
981
982
|
</span>
|
|
982
983
|
`}(N`<or-mwc-input .type="${Ca.BUTTON}" label="${this.timeframe?"dashboard.customTimeSpan":this.timePresetKey}"></or-mwc-input>`,Array.from(this.timePresetOptions.keys()).map((t=>({value:t}))),this.timePresetKey,(t=>{this.timeframe=void 0,this.timePresetKey=t.toString()}),void 0,void 0,void 0,!0)}
|
|
983
984
|
<!-- Button that opens custom time selection -->
|
|
@@ -1033,7 +1034,7 @@
|
|
|
1033
1034
|
</div>
|
|
1034
1035
|
`:void 0}
|
|
1035
1036
|
</div>
|
|
1036
|
-
`}_onTreeSelectionChanged(t){return Tp(this,void 0,void 0,(function*(){if(!Ue().events)return;const e=t.detail&&t.detail.newNodes.length>0?t.detail.newNodes[0]:void 0;if(e){const t=yield Ue().events.sendEventWithReply({eventType:"read-asset",assetId:e.asset.id});this.activeAsset=t.asset}else this.activeAsset=void 0}))}removeDatasetHighlight(t){this._chart&&this._chart.data&&this._chart.data.datasets&&(this._chart.data.datasets.map(((t,e)=>{t.borderColor&&"string"==typeof t.borderColor&&9===t.borderColor.length&&(t.borderColor=t.borderColor.slice(0,-2),t.backgroundColor=t.borderColor)})),this._chart.update())}addDatasetHighlight(t,e){t&&e&&this._chart&&this._chart.data&&this._chart.data.datasets&&(this._chart.data.datasets.map(((n,i)=>{n.assetId===t&&n.attrName===e||(n.borderColor=n.borderColor+"36",n.backgroundColor=n.borderColor)})),this._chart.update())}loadSettings(t){var e;return Tp(this,void 0,void 0,(function*(){if((null==this.assetAttributes||t)&&(this.assetAttributes=[]),this.realm||(this.realm=Ue().getRealm()),this.timePresetOptions||(this.timePresetOptions=this._getDefaultTimestampOptions()),this.timePresetKey||(this.timePresetKey=null===(e=this.timePresetOptions.keys().next().value)||void 0===e?void 0:e.toString()),!this.panelName)return;const n=window.location.hash,i=(yield Ue().console.retrieveData("OrChartConfig"))||[];Array.isArray(i)||Ue().console.storeData("OrChartConfig",[i]);let r=i.find((t=>t.realm===this.realm));if(!r)return;const a=r.views&&r.views[n]?r.views[n][this.panelName]:void 0;if(!a)return;if(!a.attributeRefs){delete r.views[n][this.panelName];const t=[...i.filter((t=>t.realm!==this.realm)),r];return void Ue().console.storeData("OrChartConfig",t)}const o=a.attributeRefs.map((t=>t.id));if(0!==o.length&&(this._loading=!0,!o.every((t=>!!this.assets.find((e=>e.id===t)))))){const t={ids:o};try{const e=(yield Ue().rest.api.AssetResource.queryAssets(t)).data||[];a.attributeRefs=a.attributeRefs.filter((t=>!!e.find((e=>e.id===t.id&&e.attributes&&e.attributes.hasOwnProperty(t.name))))),Ue().console.storeData("OrChartConfig",[...i.filter((t=>t.realm!==this.realm)),r]),this.assets=e.filter((t=>a.attributeRefs.find((e=>e.id===t.id))))}catch(t){console.error("Failed to get assets requested in settings",t)}this._loading=!1,this.assets&&this.assets.length>0&&(this.assetAttributes=a.attributeRefs.map((t=>{const e=this.assets.findIndex((e=>e.id===t.id)),n=e>=0?this.assets[e]:void 0;return n&&n.attributes?[e,n.attributes[t.name]]:void 0})).filter((t=>!!t)))}}))}saveSettings(){return Tp(this,void 0,void 0,(function*(){if(!this.panelName)return;const t=window.location.hash,e=(yield Ue().console.retrieveData("OrChartConfig"))||[];let n=e.find((t=>t.realm===this.realm));n||(n={realm:this.realm,views:{}}),n.views[t]||(n.views[t]={}),this.assets&&this.assetAttributes&&0!==this.assets.length&&0!==this.assetAttributes.length?(n.realm=this.realm,n.views[t][this.panelName]={attributeRefs:this.assetAttributes.map((([t,e])=>{const n=this.assets[t];return n?{id:n.id,name:e.name}:void 0})).filter((t=>!!t))}):delete n.views[t][this.panelName],Ue().console.storeData("OrChartConfig",[...e.filter((t=>t.realm!==this.realm)),n])}))}_openDialog(){up((new Jh.
|
|
1037
|
+
`}_onTreeSelectionChanged(t){return Tp(this,void 0,void 0,(function*(){if(!Ue().events)return;const e=t.detail&&t.detail.newNodes.length>0?t.detail.newNodes[0]:void 0;if(e){const t=yield Ue().events.sendEventWithReply({eventType:"read-asset",assetId:e.asset.id});this.activeAsset=t.asset}else this.activeAsset=void 0}))}removeDatasetHighlight(t){this._chart&&this._chart.data&&this._chart.data.datasets&&(this._chart.data.datasets.map(((t,e)=>{t.borderColor&&"string"==typeof t.borderColor&&9===t.borderColor.length&&(t.borderColor=t.borderColor.slice(0,-2),t.backgroundColor=t.borderColor)})),this._chart.update())}addDatasetHighlight(t,e){t&&e&&this._chart&&this._chart.data&&this._chart.data.datasets&&(this._chart.data.datasets.map(((n,i)=>{n.assetId===t&&n.attrName===e||(n.borderColor=n.borderColor+"36",n.backgroundColor=n.borderColor)})),this._chart.update())}loadSettings(t){var e;return Tp(this,void 0,void 0,(function*(){if((null==this.assetAttributes||t)&&(this.assetAttributes=[]),this.realm||(this.realm=Ue().getRealm()),this.timePresetOptions||(this.timePresetOptions=this._getDefaultTimestampOptions()),this.timePresetKey||(this.timePresetKey=null===(e=this.timePresetOptions.keys().next().value)||void 0===e?void 0:e.toString()),!this.panelName)return;const n=window.location.hash,i=(yield Ue().console.retrieveData("OrChartConfig"))||[];Array.isArray(i)||Ue().console.storeData("OrChartConfig",[i]);let r=i.find((t=>t.realm===this.realm));if(!r)return;const a=r.views&&r.views[n]?r.views[n][this.panelName]:void 0;if(!a)return;if(!a.attributeRefs){delete r.views[n][this.panelName];const t=[...i.filter((t=>t.realm!==this.realm)),r];return void Ue().console.storeData("OrChartConfig",t)}const o=a.attributeRefs.map((t=>t.id));if(0!==o.length&&(this._loading=!0,!o.every((t=>!!this.assets.find((e=>e.id===t)))))){const t={ids:o};try{const e=(yield Ue().rest.api.AssetResource.queryAssets(t)).data||[];a.attributeRefs=a.attributeRefs.filter((t=>!!e.find((e=>e.id===t.id&&e.attributes&&e.attributes.hasOwnProperty(t.name))))),Ue().console.storeData("OrChartConfig",[...i.filter((t=>t.realm!==this.realm)),r]),this.assets=e.filter((t=>a.attributeRefs.find((e=>e.id===t.id))))}catch(t){console.error("Failed to get assets requested in settings",t)}this._loading=!1,this.assets&&this.assets.length>0&&(this.assetAttributes=a.attributeRefs.map((t=>{const e=this.assets.findIndex((e=>e.id===t.id)),n=e>=0?this.assets[e]:void 0;return n&&n.attributes?[e,n.attributes[t.name]]:void 0})).filter((t=>!!t)))}}))}saveSettings(){return Tp(this,void 0,void 0,(function*(){if(!this.panelName)return;const t=window.location.hash,e=(yield Ue().console.retrieveData("OrChartConfig"))||[];let n=e.find((t=>t.realm===this.realm));n||(n={realm:this.realm,views:{}}),n.views[t]||(n.views[t]={}),this.assets&&this.assetAttributes&&0!==this.assets.length&&0!==this.assetAttributes.length?(n.realm=this.realm,n.views[t][this.panelName]={attributeRefs:this.assetAttributes.map((([t,e])=>{const n=this.assets[t];return n?{id:n.id,name:e.name}:void 0})).filter((t=>!!t))}):delete n.views[t][this.panelName],Ue().console.storeData("OrChartConfig",[...e.filter((t=>t.realm!==this.realm)),n])}))}_openDialog(){up((new Jh.OrAssetAttributePicker).setShowOnlyDatapointAttrs(!0).setMultiSelect(!0).setSelectedAttributes(this._getSelectedAttributes())).addEventListener(Jh.OrAssetAttributePickerPickedEvent.NAME,(t=>this._addAttribute(t.detail)))}_openTimeDialog(t,e){const n=un(),i=un();up((new hp).setHeading(We.t("timeframe")).setContent((()=>N`
|
|
1037
1038
|
<div>
|
|
1038
1039
|
<or-mwc-input ${pn(n)} type="${Ca.DATETIME}" required label="${We.t("start")}" .value="${t}"></or-mwc-input>
|
|
1039
1040
|
<or-mwc-input ${pn(i)} type="${Ca.DATETIME}" required label="${We.t("ending")}" .value="${e}"></or-mwc-input>
|