@openremote/or-attribute-history 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 +103 -49
- package/dist/umd/index.bundle.js +4 -3
- package/dist/umd/index.js +8 -7
- package/dist/umd/index.orbundle.js +27 -26
- package/package.json +8 -8
package/custom-elements.json
CHANGED
|
@@ -43,19 +43,14 @@
|
|
|
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": "assetType",
|
|
55
49
|
"type": {
|
|
56
50
|
"text": "string | undefined"
|
|
57
51
|
},
|
|
58
|
-
"privacy": "public"
|
|
52
|
+
"privacy": "public",
|
|
53
|
+
"attribute": "assetType"
|
|
59
54
|
},
|
|
60
55
|
{
|
|
61
56
|
"kind": "field",
|
|
@@ -63,7 +58,8 @@
|
|
|
63
58
|
"type": {
|
|
64
59
|
"text": "string | undefined"
|
|
65
60
|
},
|
|
66
|
-
"privacy": "public"
|
|
61
|
+
"privacy": "public",
|
|
62
|
+
"attribute": "assetId"
|
|
67
63
|
},
|
|
68
64
|
{
|
|
69
65
|
"kind": "field",
|
|
@@ -71,7 +67,8 @@
|
|
|
71
67
|
"type": {
|
|
72
68
|
"text": "Attribute<any> | undefined"
|
|
73
69
|
},
|
|
74
|
-
"privacy": "public"
|
|
70
|
+
"privacy": "public",
|
|
71
|
+
"attribute": "attribute"
|
|
75
72
|
},
|
|
76
73
|
{
|
|
77
74
|
"kind": "field",
|
|
@@ -79,7 +76,8 @@
|
|
|
79
76
|
"type": {
|
|
80
77
|
"text": "AttributeRef | undefined"
|
|
81
78
|
},
|
|
82
|
-
"privacy": "public"
|
|
79
|
+
"privacy": "public",
|
|
80
|
+
"attribute": "attributeRef"
|
|
83
81
|
},
|
|
84
82
|
{
|
|
85
83
|
"kind": "field",
|
|
@@ -88,7 +86,8 @@
|
|
|
88
86
|
"text": "moment.unitOfTime.Base"
|
|
89
87
|
},
|
|
90
88
|
"privacy": "public",
|
|
91
|
-
"default": "\"day\""
|
|
89
|
+
"default": "\"day\"",
|
|
90
|
+
"attribute": "period"
|
|
92
91
|
},
|
|
93
92
|
{
|
|
94
93
|
"kind": "field",
|
|
@@ -96,7 +95,8 @@
|
|
|
96
95
|
"type": {
|
|
97
96
|
"text": "Date | undefined"
|
|
98
97
|
},
|
|
99
|
-
"privacy": "public"
|
|
98
|
+
"privacy": "public",
|
|
99
|
+
"attribute": "toTimestamp"
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"kind": "field",
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
"type": {
|
|
105
105
|
"text": "HistoryConfig | undefined"
|
|
106
106
|
},
|
|
107
|
-
"privacy": "public"
|
|
107
|
+
"privacy": "public",
|
|
108
|
+
"attribute": "config"
|
|
108
109
|
},
|
|
109
110
|
{
|
|
110
111
|
"kind": "field",
|
|
@@ -113,7 +114,8 @@
|
|
|
113
114
|
"text": "boolean"
|
|
114
115
|
},
|
|
115
116
|
"privacy": "protected",
|
|
116
|
-
"default": "false"
|
|
117
|
+
"default": "false",
|
|
118
|
+
"attribute": "_loading"
|
|
117
119
|
},
|
|
118
120
|
{
|
|
119
121
|
"kind": "field",
|
|
@@ -121,7 +123,8 @@
|
|
|
121
123
|
"type": {
|
|
122
124
|
"text": "ValueDatapoint<any>[] | undefined"
|
|
123
125
|
},
|
|
124
|
-
"privacy": "protected"
|
|
126
|
+
"privacy": "protected",
|
|
127
|
+
"attribute": "_data"
|
|
125
128
|
},
|
|
126
129
|
{
|
|
127
130
|
"kind": "field",
|
|
@@ -129,7 +132,8 @@
|
|
|
129
132
|
"type": {
|
|
130
133
|
"text": "TemplateResult | undefined"
|
|
131
134
|
},
|
|
132
|
-
"privacy": "protected"
|
|
135
|
+
"privacy": "protected",
|
|
136
|
+
"attribute": "_tableTemplate"
|
|
133
137
|
},
|
|
134
138
|
{
|
|
135
139
|
"kind": "field",
|
|
@@ -244,39 +248,6 @@
|
|
|
244
248
|
"privacy": "protected",
|
|
245
249
|
"default": "false"
|
|
246
250
|
},
|
|
247
|
-
{
|
|
248
|
-
"kind": "method",
|
|
249
|
-
"name": "shouldUpdate",
|
|
250
|
-
"return": {
|
|
251
|
-
"type": {
|
|
252
|
-
"text": "boolean"
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
"parameters": [
|
|
256
|
-
{
|
|
257
|
-
"name": "_changedProperties",
|
|
258
|
-
"type": {
|
|
259
|
-
"text": "PropertyValues"
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
]
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
"kind": "method",
|
|
266
|
-
"name": "render"
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"kind": "method",
|
|
270
|
-
"name": "willUpdate",
|
|
271
|
-
"parameters": [
|
|
272
|
-
{
|
|
273
|
-
"name": "changedProperties",
|
|
274
|
-
"type": {
|
|
275
|
-
"text": "PropertyValues"
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
]
|
|
279
|
-
},
|
|
280
251
|
{
|
|
281
252
|
"kind": "method",
|
|
282
253
|
"name": "onCompleted"
|
|
@@ -385,6 +356,80 @@
|
|
|
385
356
|
}
|
|
386
357
|
}
|
|
387
358
|
],
|
|
359
|
+
"attributes": [
|
|
360
|
+
{
|
|
361
|
+
"name": "assetType",
|
|
362
|
+
"type": {
|
|
363
|
+
"text": "string | undefined"
|
|
364
|
+
},
|
|
365
|
+
"fieldName": "assetType"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "assetId",
|
|
369
|
+
"type": {
|
|
370
|
+
"text": "string | undefined"
|
|
371
|
+
},
|
|
372
|
+
"fieldName": "assetId"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "attribute",
|
|
376
|
+
"type": {
|
|
377
|
+
"text": "Attribute<any> | undefined"
|
|
378
|
+
},
|
|
379
|
+
"fieldName": "attribute"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "attributeRef",
|
|
383
|
+
"type": {
|
|
384
|
+
"text": "AttributeRef | undefined"
|
|
385
|
+
},
|
|
386
|
+
"fieldName": "attributeRef"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "period",
|
|
390
|
+
"type": {
|
|
391
|
+
"text": "moment.unitOfTime.Base"
|
|
392
|
+
},
|
|
393
|
+
"default": "\"day\"",
|
|
394
|
+
"fieldName": "period"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "toTimestamp",
|
|
398
|
+
"type": {
|
|
399
|
+
"text": "Date | undefined"
|
|
400
|
+
},
|
|
401
|
+
"fieldName": "toTimestamp"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"name": "config",
|
|
405
|
+
"type": {
|
|
406
|
+
"text": "HistoryConfig | undefined"
|
|
407
|
+
},
|
|
408
|
+
"fieldName": "config"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"name": "_loading",
|
|
412
|
+
"type": {
|
|
413
|
+
"text": "boolean"
|
|
414
|
+
},
|
|
415
|
+
"default": "false",
|
|
416
|
+
"fieldName": "_loading"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "_data",
|
|
420
|
+
"type": {
|
|
421
|
+
"text": "ValueDatapoint<any>[] | undefined"
|
|
422
|
+
},
|
|
423
|
+
"fieldName": "_data"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"name": "_tableTemplate",
|
|
427
|
+
"type": {
|
|
428
|
+
"text": "TemplateResult | undefined"
|
|
429
|
+
},
|
|
430
|
+
"fieldName": "_tableTemplate"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
388
433
|
"mixins": [
|
|
389
434
|
{
|
|
390
435
|
"name": "translate(i18next)",
|
|
@@ -395,6 +440,7 @@
|
|
|
395
440
|
"name": "LitElement",
|
|
396
441
|
"package": "lit"
|
|
397
442
|
},
|
|
443
|
+
"tagName": "or-attribute-history",
|
|
398
444
|
"customElement": true
|
|
399
445
|
}
|
|
400
446
|
],
|
|
@@ -414,6 +460,14 @@
|
|
|
414
460
|
"name": "OrAttributeHistory",
|
|
415
461
|
"module": "src/index.ts"
|
|
416
462
|
}
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"kind": "custom-element-definition",
|
|
466
|
+
"name": "or-attribute-history",
|
|
467
|
+
"declaration": {
|
|
468
|
+
"name": "OrAttributeHistory",
|
|
469
|
+
"module": "src/index.ts"
|
|
470
|
+
}
|
|
417
471
|
}
|
|
418
472
|
]
|
|
419
473
|
}
|
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 kr=class extends Lt{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`${ct(ar)}`,mt`${ct(nr)}`,mt`${ct(ir)}`,mt`${ct(rr)}`,mt`${ct(or)}`,mt`${ct(sr)}`,mt`${ct(lr)}`,mt`${ct(dr)}`,mt`${ct(cr)}`,mt`${ct(mr)}`,mt`${ct(ur)}`,mt`${ct(hr)}`,mt`${ct(pr)}`,mt`${ct(_r)}`,mt`${ct(fr)}`,mt`${ct(gr)}`,xr]}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===yr.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===yr.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===yr.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=yr.DATETIME:"boolean"==typeof this.value?this.type=yr.CHECKBOX:"number"==typeof this.value?this.type=yr.NUMBER:"string"==typeof this.value?this.type=yr.TEXT:this.type=yr.JSON),!0}focus(){this.type===yr.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 a=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!a&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":a},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 yr.RADIO:const e=this.resolveOptions(this.options);return this._selectedIndex=-1,N`
|
|
263
|
+
`;let kr=class extends Lt{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`${ct(ar)}`,mt`${ct(nr)}`,mt`${ct(ir)}`,mt`${ct(rr)}`,mt`${ct(or)}`,mt`${ct(sr)}`,mt`${ct(lr)}`,mt`${ct(dr)}`,mt`${ct(cr)}`,mt`${ct(mr)}`,mt`${ct(ur)}`,mt`${ct(hr)}`,mt`${ct(pr)}`,mt`${ct(_r)}`,mt`${ct(fr)}`,mt`${ct(gr)}`,xr]}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===yr.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===yr.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===yr.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=yr.DATETIME:"boolean"==typeof this.value?this.type=yr.CHECKBOX:"number"==typeof this.value?this.type=yr.NUMBER:"string"==typeof this.value?this.type=yr.TEXT:this.type=yr.JSON),!0}focus(){this.type===yr.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 a=!(this.isUiValid||!this.errorMessage&&!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!a&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":a},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 yr.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 yr.NUMBER:case yr.RANGE:case yr.DATE:case yr.DATETIME:case yr.TIME:case yr.MONTH:case yr.WEEK:case yr.EMAIL:case yr.PASSWORD:case yr.TELEPHONE:case yr.URL:case yr.TEXT:case yr.TEXTAREA:case yr.JSON:case yr.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===yr.JSON||this.type===yr.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 yr.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case yr.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case yr.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case yr.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case yr.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case yr.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,m="component";if(this.type===yr.RANGE&&(d=void 0,n=!1,i=!1,c=yr.NUMBER,m="number"),this.type!==yr.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===yr.TEXTAREA||c===yr.JSON||c===yr.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===yr.TEXTAREA||c===yr.JSON||c===yr.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===yr.TEXTAREA||c===yr.JSON||c===yr.JSON_OBJECT?N`
|
|
432
|
+
`;case yr.NUMBER:case yr.RANGE:case yr.DATE:case yr.DATETIME:case yr.TIME:case yr.MONTH:case yr.WEEK:case yr.EMAIL:case yr.PASSWORD:case yr.TELEPHONE:case yr.URL:case yr.TEXT:case yr.TEXTAREA:case yr.JSON:case yr.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===yr.JSON||this.type===yr.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 yr.TIME:e.asDate=!0,e.hour12=!1,e.timeStyle=this.step&&this.step<60?"medium":"short";break;case yr.DATE:e.asDate=!0,e.momentJsFormat="YYYY-MM-DD";break;case yr.WEEK:e.asDate=!0,e.momentJsFormat="YYYY-[W]WW";break;case yr.MONTH:e.asDate=!0,e.momentJsFormat="YYYY-MM";break;case yr.DATETIME:e.asDate=!0,e.momentJsFormat="YYYY-MM-DDTHH:mm";break;case yr.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,m="component";if(this.type===yr.RANGE&&(d=void 0,n=!1,i=!1,c=yr.NUMBER,m="number"),this.type!==yr.RANGE||!this.disableSliderNumberInput){this.censored&&(c=yr.PASSWORD),this.type===yr.PASSWORD&&this.advertised&&(c=yr.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===yr.TEXTAREA||c===yr.JSON||c===yr.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!n,"dense-comfortable":this.comfortable&&!(c===yr.TEXTAREA||c===yr.JSON||c===yr.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===yr.TEXTAREA||c===yr.JSON||c===yr.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="${rn(this.minLength)}"
|
|
435
435
|
maxlength="${rn(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!==yr.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||a?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!==yr.JSON&&this.type!==yr.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,a;let r,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 yr.CHECKBOX:case yr.SWITCH:e="on"===e;break;case yr.JSON:case yr.JSON_OBJECT:case yr.NUMBER:case yr.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==yr.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,r=We.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,r=this.type===yr.JSON||this.type==yr.JSON_OBJECT?We.i18next.t("validation.invalidJSON"):We.i18next.t("validation.invalidNumber")}break;case yr.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,r=We.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(r),this.reportValidity(),this.type!==yr.CHECKBOX_LIST&&e!==o&&(this.type===yr.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new br(this.value,o,n))),null!=this.searchProvider&&this.type===yr.SELECT){const t=null===(a=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===a?void 0:a.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==yr.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new br(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,We.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(", "):""}};tr([Et({type:Boolean})],kr.prototype,"focused",void 0),tr([Et()],kr.prototype,"value",void 0),tr([Et({type:String})],kr.prototype,"type",void 0),tr([Et({type:String})],kr.prototype,"name",void 0),tr([Et({type:Boolean})],kr.prototype,"readonly",void 0),tr([Et({type:Boolean})],kr.prototype,"required",void 0),tr([Et()],kr.prototype,"max",void 0),tr([Et()],kr.prototype,"min",void 0),tr([Et({type:Number})],kr.prototype,"step",void 0),tr([Et({type:Boolean})],kr.prototype,"checked",void 0),tr([Et({type:Boolean})],kr.prototype,"indeterminate",void 0),tr([Et({type:Number})],kr.prototype,"maxLength",void 0),tr([Et({type:Number})],kr.prototype,"minLength",void 0),tr([Et({type:Number})],kr.prototype,"rows",void 0),tr([Et({type:Number})],kr.prototype,"cols",void 0),tr([Et({type:Boolean})],kr.prototype,"multiple",void 0),tr([Et({type:String,attribute:!0,reflect:!1})],kr.prototype,"pattern",void 0),tr([Et({type:String})],kr.prototype,"placeHolder",void 0),tr([Et({type:Array})],kr.prototype,"options",void 0),tr([Et({type:Boolean})],kr.prototype,"autoSelect",void 0),tr([Et({type:Object})],kr.prototype,"searchProvider",void 0),tr([Et({type:String})],kr.prototype,"searchLabel",void 0),tr([Et({type:String})],kr.prototype,"icon",void 0),tr([Et({type:String})],kr.prototype,"iconColor",void 0),tr([Et({type:String})],kr.prototype,"iconOn",void 0),tr([Et({type:String})],kr.prototype,"iconTrailing",void 0),tr([Et({type:Boolean})],kr.prototype,"compact",void 0),tr([Et({type:Boolean})],kr.prototype,"comfortable",void 0),tr([Et({type:Boolean})],kr.prototype,"raised",void 0),tr([Et({type:Boolean})],kr.prototype,"action",void 0),tr([Et({type:Boolean})],kr.prototype,"unElevated",void 0),tr([Et({type:Boolean})],kr.prototype,"outlined",void 0),tr([Et({type:Boolean})],kr.prototype,"rounded",void 0),tr([Et({type:Object})],kr.prototype,"format",void 0),tr([Et({type:Boolean})],kr.prototype,"disableSliderNumberInput",void 0),tr([Et({type:Boolean})],kr.prototype,"fullWidth",void 0),tr([Et({type:String})],kr.prototype,"helperText",void 0),tr([Et({type:Boolean})],kr.prototype,"helperPersistent",void 0),tr([Et({type:String,attribute:!0})],kr.prototype,"validationMessage",void 0),tr([Et({type:Boolean})],kr.prototype,"autoValidate",void 0),tr([Et({type:Boolean})],kr.prototype,"charCounter",void 0),tr([Et({type:String})],kr.prototype,"label",void 0),tr([Et({type:Boolean})],kr.prototype,"disabled",void 0),tr([Et({type:Boolean})],kr.prototype,"continuous",void 0),tr([Et({type:Boolean})],kr.prototype,"resizeVertical",void 0),tr([At()],kr.prototype,"isUiValid",void 0),tr([At()],kr.prototype,"searchableValue",void 0),tr([At()],kr.prototype,"errorMessage",void 0),kr=tr([Yt("or-mwc-input")],kr);var wr=function(t,e,n,i){var a,r=arguments.length,o=r<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--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};const Mr=l(420),Lr=l(6568),Tr=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!==yr.JSON&&this.type!==yr.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,a;let r,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 yr.CHECKBOX:case yr.SWITCH:e="on"===e;break;case yr.JSON:case yr.JSON_OBJECT:case yr.NUMBER:case yr.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type!==yr.JSON_OBJECT||"object"==typeof e&&!Array.isArray(e)||(e=this.value,r=We.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,r=this.type===yr.JSON||this.type==yr.JSON_OBJECT?We.i18next.t("validation.invalidJSON"):We.i18next.t("validation.invalidNumber")}break;case yr.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,r=We.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(r),this.reportValidity(),this.type!==yr.CHECKBOX_LIST&&e!==o&&(this.type===yr.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new br(this.value,o,n))),null!=this.searchProvider&&this.type===yr.SELECT){const t=null===(a=null===(i=this.shadowRoot)||void 0===i?void 0:i.getElementById("select-searchable"))||void 0===a?void 0:a.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==yr.CHECKBOX_LIST||Ve.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new br(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,We.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(", "):""}};tr([Et({type:Boolean})],kr.prototype,"focused",void 0),tr([Et()],kr.prototype,"value",void 0),tr([Et({type:String})],kr.prototype,"type",void 0),tr([Et({type:String})],kr.prototype,"name",void 0),tr([Et({type:Boolean})],kr.prototype,"readonly",void 0),tr([Et({type:Boolean})],kr.prototype,"required",void 0),tr([Et()],kr.prototype,"max",void 0),tr([Et()],kr.prototype,"min",void 0),tr([Et({type:Number})],kr.prototype,"step",void 0),tr([Et({type:Boolean})],kr.prototype,"checked",void 0),tr([Et({type:Boolean})],kr.prototype,"indeterminate",void 0),tr([Et({type:Number})],kr.prototype,"maxLength",void 0),tr([Et({type:Number})],kr.prototype,"minLength",void 0),tr([Et({type:Number})],kr.prototype,"rows",void 0),tr([Et({type:Number})],kr.prototype,"cols",void 0),tr([Et({type:Boolean})],kr.prototype,"multiple",void 0),tr([Et({type:String,attribute:!0,reflect:!1})],kr.prototype,"pattern",void 0),tr([Et({type:String})],kr.prototype,"placeHolder",void 0),tr([Et({type:Array})],kr.prototype,"options",void 0),tr([Et({type:Boolean})],kr.prototype,"autoSelect",void 0),tr([Et({type:Object})],kr.prototype,"searchProvider",void 0),tr([Et({type:String})],kr.prototype,"searchLabel",void 0),tr([Et({type:String})],kr.prototype,"icon",void 0),tr([Et({type:String})],kr.prototype,"iconColor",void 0),tr([Et({type:String})],kr.prototype,"iconOn",void 0),tr([Et({type:String})],kr.prototype,"iconTrailing",void 0),tr([Et({type:Boolean})],kr.prototype,"compact",void 0),tr([Et({type:Boolean})],kr.prototype,"comfortable",void 0),tr([Et({type:Boolean})],kr.prototype,"raised",void 0),tr([Et({type:Boolean})],kr.prototype,"action",void 0),tr([Et({type:Boolean})],kr.prototype,"unElevated",void 0),tr([Et({type:Boolean})],kr.prototype,"outlined",void 0),tr([Et({type:Boolean})],kr.prototype,"rounded",void 0),tr([Et({type:Object})],kr.prototype,"format",void 0),tr([Et({type:Boolean})],kr.prototype,"disableSliderNumberInput",void 0),tr([Et({type:Boolean})],kr.prototype,"fullWidth",void 0),tr([Et({type:String})],kr.prototype,"helperText",void 0),tr([Et({type:Boolean})],kr.prototype,"helperPersistent",void 0),tr([Et({type:String,attribute:!0})],kr.prototype,"validationMessage",void 0),tr([Et({type:Boolean})],kr.prototype,"autoValidate",void 0),tr([Et({type:Boolean})],kr.prototype,"charCounter",void 0),tr([Et({type:String})],kr.prototype,"label",void 0),tr([Et({type:Boolean})],kr.prototype,"disabled",void 0),tr([Et({type:Boolean})],kr.prototype,"continuous",void 0),tr([Et({type:Boolean})],kr.prototype,"resizeVertical",void 0),tr([Et({type:Boolean})],kr.prototype,"censored",void 0),tr([Et({type:Boolean,reflect:!0})],kr.prototype,"advertised",void 0),tr([At()],kr.prototype,"isUiValid",void 0),tr([At()],kr.prototype,"searchableValue",void 0),tr([At()],kr.prototype,"errorMessage",void 0),kr=tr([Yt("or-mwc-input")],kr);var wr=function(t,e,n,i){var a,r=arguments.length,o=r<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--)(a=t[s])&&(o=(r<3?a(o):r>3?a(e,n,o):a(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};const Mr=l(420),Lr=l(6568),Tr=mt`
|
|
497
498
|
|
|
498
499
|
:host {
|
|
499
500
|
--internal-or-panel-background-color: var(--or-panel-background-color, var(--or-app-color2, ${ct(Ve.DefaultColor2)}));
|