iobroker.mywebui 1.37.65 → 1.37.66
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/io-package.json
CHANGED
package/package.json
CHANGED
|
@@ -874,22 +874,6 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
874
874
|
headText.textContent = label;
|
|
875
875
|
head.appendChild(headText);
|
|
876
876
|
wrap.appendChild(head);
|
|
877
|
-
const oidInp = document.createElement('input');
|
|
878
|
-
oidInp.type = 'text'; oidInp.value = ctrlCfg.oid || '';
|
|
879
|
-
oidInp.placeholder = 'OID…';
|
|
880
|
-
oidInp.style.cssText = 'width:100%;box-sizing:border-box;padding:3px 5px;font-size:11px;border:1px solid #ccc;border-radius:3px;margin-bottom:3px;';
|
|
881
|
-
oidInp.onchange = save;
|
|
882
|
-
const pickBtn = document.createElement('button');
|
|
883
|
-
pickBtn.textContent = '…';
|
|
884
|
-
pickBtn.style.cssText = 'padding:2px 6px;font-size:11px;cursor:pointer;border:1px solid #aaa;border-radius:3px;margin-left:3px;';
|
|
885
|
-
pickBtn.onclick = async () => {
|
|
886
|
-
const picked = await openSelectIdDialog(document.body, { id: oidInp.value });
|
|
887
|
-
if (picked) { oidInp.value = picked; save(); }
|
|
888
|
-
};
|
|
889
|
-
const oidRow2 = document.createElement('div');
|
|
890
|
-
oidRow2.style.cssText = 'display:flex;margin-bottom:3px;';
|
|
891
|
-
oidRow2.appendChild(oidInp); oidRow2.appendChild(pickBtn);
|
|
892
|
-
wrap.appendChild(oidRow2);
|
|
893
877
|
const condSel = sel([
|
|
894
878
|
['equal','='],['not_equal','≠'],['less_than','<'],['less_equal','≤'],
|
|
895
879
|
['greater_than','>'],['greater_equal','≥'],['exists','exists']
|
|
@@ -904,7 +888,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
904
888
|
condRow.appendChild(condSel); condRow.appendChild(valInp);
|
|
905
889
|
wrap.appendChild(condRow);
|
|
906
890
|
wrap._getCtrl = () => {
|
|
907
|
-
const v = {
|
|
891
|
+
const v = { condition: condSel.value, value: valInp.value };
|
|
908
892
|
if (ctrlCfg.oid_bind) v.oid_bind = ctrlCfg.oid_bind;
|
|
909
893
|
return v;
|
|
910
894
|
};
|
|
@@ -1071,8 +1055,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
1071
1055
|
if (parseFloat(delayInp.value)) out.delay = parseFloat(delayInp.value);
|
|
1072
1056
|
if (parseInt(repeatInp.value)) out.repeat = parseInt(repeatInp.value);
|
|
1073
1057
|
out.ease = easeSel.value || 'power2.out';
|
|
1074
|
-
if (triggerSel.value === 'oid'
|
|
1075
|
-
if (oidInp.value) out.oid = oidInp.value;
|
|
1058
|
+
if (triggerSel.value === 'oid') {
|
|
1076
1059
|
out.condition = condSel.value;
|
|
1077
1060
|
out.conditionValue = condValInp.value;
|
|
1078
1061
|
}
|
|
@@ -1153,21 +1136,12 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
1153
1136
|
['elastic.out(1,0.3)','elastic.out'],['back.inOut(1.7)','back.inOut'],['none','none']
|
|
1154
1137
|
], cfg.ease || 'power2.out');
|
|
1155
1138
|
|
|
1156
|
-
const oidInp = inp(cfg.oid || '');
|
|
1157
1139
|
const condSel = sel([['equal','='],['not_equal','≠'],['less_than','<'],['greater_than','>'],['exists','exists']], cfg.condition || 'equal');
|
|
1158
1140
|
const condValInp = inp(cfg.conditionValue ?? 'true');
|
|
1159
1141
|
const glowColorInp = inp(cfg.glowColor || 'yellow', 'color');
|
|
1160
1142
|
const glowSizeInp = inp(cfg.glowSize || 10, 'number');
|
|
1161
1143
|
const blurInp = inp(cfg.blurAmount || 5, 'number');
|
|
1162
1144
|
|
|
1163
|
-
const oidPickBtn = document.createElement('button');
|
|
1164
|
-
oidPickBtn.textContent = '…';
|
|
1165
|
-
oidPickBtn.style.cssText = 'padding:2px 6px;font-size:11px;cursor:pointer;border:1px solid #aaa;border-radius:3px;flex-shrink:0;';
|
|
1166
|
-
oidPickBtn.onclick = async () => {
|
|
1167
|
-
const picked = await openSelectIdDialog(document.body, { id: oidInp.value });
|
|
1168
|
-
if (picked) { oidInp.value = picked; save(); }
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
1145
|
// ── Build UI ──────────────────────────────────────────────────────────
|
|
1172
1146
|
content.innerHTML = '';
|
|
1173
1147
|
|
|
@@ -1192,14 +1166,10 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
1192
1166
|
const oidLabelText = document.createElement('span');
|
|
1193
1167
|
oidLabelText.textContent = 'OID';
|
|
1194
1168
|
oidLabel.appendChild(oidLabelText);
|
|
1195
|
-
const oidRowDiv = document.createElement('div');
|
|
1196
|
-
oidRowDiv.style.cssText = 'display:flex;gap:3px;margin-bottom:4px;padding-left:15px;';
|
|
1197
|
-
oidRowDiv.appendChild(oidInp); oidRowDiv.appendChild(oidPickBtn);
|
|
1198
1169
|
const condRowDiv = document.createElement('div');
|
|
1199
1170
|
condRowDiv.style.cssText = 'display:flex;gap:3px;margin-bottom:6px;padding-left:15px;';
|
|
1200
1171
|
condRowDiv.appendChild(condSel); condRowDiv.appendChild(condValInp);
|
|
1201
1172
|
oidSection.appendChild(oidLabel);
|
|
1202
|
-
oidSection.appendChild(oidRowDiv);
|
|
1203
1173
|
oidSection.appendChild(condRowDiv);
|
|
1204
1174
|
content.appendChild(oidSection);
|
|
1205
1175
|
triggerSel.addEventListener('change', () => { oidSection.style.display = triggerSel.value === 'oid' ? '' : 'none'; });
|
|
@@ -200,16 +200,27 @@ class AnimationInstance {
|
|
|
200
200
|
'fillColorFrom', 'fillColorTo', 'transformOriginX', 'transformOriginY',
|
|
201
201
|
'svgAttr', 'pathId', 'alignToPath', 'orientToPath'
|
|
202
202
|
];
|
|
203
|
+
let _restartTimer = null;
|
|
203
204
|
for (const prop of dynamicProps) {
|
|
204
205
|
const bindCfg = this.cfg[prop + '_bind'];
|
|
205
206
|
if (!bindCfg?.signal) continue;
|
|
206
207
|
const propCapture = prop;
|
|
207
208
|
const handler = (id, state) => {
|
|
208
|
-
if (state?.val
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
if (state?.val == null) return;
|
|
210
|
+
this.cfg[propCapture] = state.val;
|
|
211
|
+
if (!this.tween) return;
|
|
212
|
+
// Duration: adjust timeScale without restarting (smooth for repeat:-1)
|
|
213
|
+
if (propCapture === 'duration' && this.tween.vars) {
|
|
214
|
+
const origDur = parseFloat(this.tween.vars.duration) || 1;
|
|
215
|
+
const newDur = parseFloat(state.val) || 1;
|
|
216
|
+
this.tween.timeScale(origDur / newDur);
|
|
217
|
+
return;
|
|
212
218
|
}
|
|
219
|
+
// Other props: debounced restart so rapid changes don't freeze
|
|
220
|
+
clearTimeout(_restartTimer);
|
|
221
|
+
_restartTimer = setTimeout(() => {
|
|
222
|
+
if (this.tween && !this.tween.paused()) this._play();
|
|
223
|
+
}, 60);
|
|
213
224
|
};
|
|
214
225
|
try {
|
|
215
226
|
iobrokerHandler.connection.subscribeState(bindCfg.signal, handler);
|