@operato/property-panel 10.29.110 → 10.29.112
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.
|
@@ -443,6 +443,16 @@ export class PropertyScene3D extends AbstractProperty {
|
|
|
443
443
|
}}
|
|
444
444
|
/>
|
|
445
445
|
<label for="cb-vibe-indoor"><ox-i18n msgid="label.vibe indoor">Indoors: own lighting, no rain or snow</ox-i18n></label>
|
|
446
|
+
<input
|
|
447
|
+
id="cb-vibe-decorations"
|
|
448
|
+
type="checkbox"
|
|
449
|
+
.checked=${vibe.decorations !== false}
|
|
450
|
+
@change=${(e) => {
|
|
451
|
+
e.stopPropagation();
|
|
452
|
+
put('decorations', e.target.checked ? undefined : false);
|
|
453
|
+
}}
|
|
454
|
+
/>
|
|
455
|
+
<label for="cb-vibe-decorations"><ox-i18n msgid="label.vibe decorations">Event decorations in their period</ox-i18n></label>
|
|
446
456
|
<label><ox-i18n msgid="label.vibe mode">Time</ox-i18n></label>
|
|
447
457
|
<select
|
|
448
458
|
@change=${(e) => {
|
|
@@ -509,36 +519,49 @@ export class PropertyScene3D extends AbstractProperty {
|
|
|
509
519
|
</div>
|
|
510
520
|
<label title=${i18next.t('label.vibe north help')}><ox-i18n msgid="label.vibe north">Bearing of the board's top (°)</ox-i18n></label>
|
|
511
521
|
<input type="number" min="0" max="360" step="1" placeholder="0" .value=${String((_e = vibe.north) !== null && _e !== void 0 ? _e : '')} @change=${number('north')} />
|
|
512
|
-
<label><ox-i18n msgid="label.vibe
|
|
513
|
-
<div class="range-with-value">
|
|
514
|
-
<input type="range" min="0" max="1" step="0.05" .value=${String((_f = vibe.cloud) !== null && _f !== void 0 ? _f : 0)} @change=${number('cloud')} />
|
|
515
|
-
<span>${Number((_g = vibe.cloud) !== null && _g !== void 0 ? _g : 0).toFixed(2)}</span>
|
|
516
|
-
</div>
|
|
517
|
-
<label><ox-i18n msgid="label.vibe precipitation">Precipitation</ox-i18n></label>
|
|
522
|
+
<label><ox-i18n msgid="label.vibe weather source">Weather</ox-i18n></label>
|
|
518
523
|
<select
|
|
519
524
|
@change=${(e) => {
|
|
520
525
|
e.stopPropagation();
|
|
521
|
-
|
|
522
|
-
put('precipitation', v === 'none' ? undefined : v);
|
|
526
|
+
put('weatherSource', e.target.value || undefined);
|
|
523
527
|
}}
|
|
524
528
|
>
|
|
525
|
-
${['
|
|
529
|
+
${['', 'open-meteo'].map(k => html `<option value=${k} ?selected=${(vibe.weatherSource || '') === k}>${i18next.t(`label.vibe weather source ${k || 'manual'}`)}</option>`)}
|
|
526
530
|
</select>
|
|
527
|
-
${vibe.
|
|
528
|
-
? html
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
</
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
531
|
+
${vibe.weatherSource
|
|
532
|
+
? html `<div class="vibe-note"><ox-i18n msgid="text.vibe weather source">Cloud, rain and snow, visibility, lying snow and wet ground are the readings at this place and time.</ox-i18n></div>`
|
|
533
|
+
: html `
|
|
534
|
+
<label><ox-i18n msgid="label.vibe cloud">Cloud cover</ox-i18n></label>
|
|
535
|
+
<div class="range-with-value">
|
|
536
|
+
<input type="range" min="0" max="1" step="0.05" .value=${String((_f = vibe.cloud) !== null && _f !== void 0 ? _f : 0)} @change=${number('cloud')} />
|
|
537
|
+
<span>${Number((_g = vibe.cloud) !== null && _g !== void 0 ? _g : 0).toFixed(2)}</span>
|
|
538
|
+
</div>
|
|
539
|
+
<label><ox-i18n msgid="label.vibe precipitation">Precipitation</ox-i18n></label>
|
|
540
|
+
<select
|
|
541
|
+
@change=${(e) => {
|
|
542
|
+
e.stopPropagation();
|
|
543
|
+
const v = e.target.value;
|
|
544
|
+
put('precipitation', v === 'none' ? undefined : v);
|
|
545
|
+
}}
|
|
546
|
+
>
|
|
547
|
+
${['none', 'rain', 'snow'].map(k => html `<option value=${k} ?selected=${(vibe.precipitation || 'none') === k}>${i18next.t(`label.vibe precipitation ${k}`)}</option>`)}
|
|
548
|
+
</select>
|
|
549
|
+
${vibe.precipitation === 'rain' || vibe.precipitation === 'snow'
|
|
550
|
+
? html `
|
|
551
|
+
<label><ox-i18n msgid="label.vibe intensity">Intensity</ox-i18n></label>
|
|
552
|
+
<div class="range-with-value">
|
|
553
|
+
<input type="range" min="0" max="1" step="0.05" .value=${String((_h = vibe.intensity) !== null && _h !== void 0 ? _h : 0.5)} @change=${number('intensity')} />
|
|
554
|
+
<span>${Number((_j = vibe.intensity) !== null && _j !== void 0 ? _j : 0.5).toFixed(2)}</span>
|
|
555
|
+
</div>
|
|
556
|
+
`
|
|
557
|
+
: ''}
|
|
558
|
+
<label class="as-written"><ox-i18n msgid="label.vibe visibility">Visibility (m)</ox-i18n></label>
|
|
559
|
+
<input type="number" min="10" step="10" placeholder=${i18next.t('text.vibe auto')} .value=${String((_k = vibe.visibility) !== null && _k !== void 0 ? _k : '')} @change=${number('visibility')} />
|
|
560
|
+
<label><ox-i18n msgid="label.vibe snow cover">Snow cover (0-1)</ox-i18n></label>
|
|
561
|
+
<input type="number" min="0" max="1" step="0.1" placeholder=${i18next.t('text.vibe auto')} .value=${String((_l = vibe.snowCover) !== null && _l !== void 0 ? _l : '')} @change=${number('snowCover')} />
|
|
562
|
+
<label><ox-i18n msgid="label.vibe wet">Wet ground (0-1)</ox-i18n></label>
|
|
563
|
+
<input type="number" min="0" max="1" step="0.1" placeholder=${i18next.t('text.vibe auto')} .value=${String((_m = vibe.wet) !== null && _m !== void 0 ? _m : '')} @change=${number('wet')} />
|
|
564
|
+
`}
|
|
542
565
|
<label><ox-i18n msgid="label.vibe dust">Yellow dust</ox-i18n></label>
|
|
543
566
|
<div class="range-with-value">
|
|
544
567
|
<input type="range" min="0" max="1" step="0.05" .value=${String((_o = vibe.dust) !== null && _o !== void 0 ? _o : 0)} @change=${number('dust')} />
|
|
@@ -111,7 +111,7 @@ export class Property3D extends AbstractProperty {
|
|
|
111
111
|
</div>
|
|
112
112
|
</fieldset>
|
|
113
113
|
|
|
114
|
-
${this._renderAutoPanel(value)} ${this._renderLamp(value)} ${this._renderIndoor(value)}
|
|
114
|
+
${this._renderAutoPanel(value)} ${this._renderLamp(value)} ${this._renderIndoor(value)} ${this._renderDecoration(value)}
|
|
115
115
|
|
|
116
116
|
<property-material3d .value=${value.material3d}></property-material3d>
|
|
117
117
|
`;
|
|
@@ -278,6 +278,112 @@ export class Property3D extends AbstractProperty {
|
|
|
278
278
|
</fieldset>
|
|
279
279
|
`;
|
|
280
280
|
}
|
|
281
|
+
/*
|
|
282
|
+
* An event decoration (ADR-0263 stage 6): on a board whose light follows the time, in the event's period by its
|
|
283
|
+
* date, bulbs are wound round this component (a tree's crown) or strung along its footprint (eaves, a canopy), and a
|
|
284
|
+
* component that is itself a decoration (a Christmas tree) shows only then. The bulbs' colours and twinkle are the
|
|
285
|
+
* scene's: they stay out of the status colours and blinking.
|
|
286
|
+
*/
|
|
287
|
+
_renderDecoration(value) {
|
|
288
|
+
var _a, _b, _c;
|
|
289
|
+
const own = value.decoration;
|
|
290
|
+
const decoration = own && typeof own === 'object' && !Array.isArray(own) ? own : {};
|
|
291
|
+
const on = !!own && decoration.enabled !== false;
|
|
292
|
+
const event = !on ? '' : decoration.event === 'christmas' ? 'christmas' : 'custom';
|
|
293
|
+
const send = (next) => this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: { decoration: next } }));
|
|
294
|
+
const put = (key, v) => {
|
|
295
|
+
const { [key]: _, ...rest } = decoration;
|
|
296
|
+
send(v === undefined || v === '' ? rest : { ...rest, [key]: v });
|
|
297
|
+
};
|
|
298
|
+
const lights = decoration.lights === 'wrap' || decoration.lights === 'outline' ? decoration.lights : 'none';
|
|
299
|
+
return html `
|
|
300
|
+
<fieldset>
|
|
301
|
+
<legend><ox-i18n msgid="label.decoration">Event decoration</ox-i18n></legend>
|
|
302
|
+
<div class="property-grid">
|
|
303
|
+
<label><ox-i18n msgid="label.decoration event">Event</ox-i18n></label>
|
|
304
|
+
<select
|
|
305
|
+
@change=${(e) => {
|
|
306
|
+
e.stopPropagation();
|
|
307
|
+
const v = e.target.value;
|
|
308
|
+
const { enabled, event: _, from, to, ...rest } = decoration;
|
|
309
|
+
send(v === '' ? undefined : v === 'christmas' ? { ...rest, event: 'christmas' } : { ...rest, from: from !== null && from !== void 0 ? from : '', to: to !== null && to !== void 0 ? to : '' });
|
|
310
|
+
}}
|
|
311
|
+
>
|
|
312
|
+
<option value="" ?selected=${event === ''}>${i18next.t('label.decoration none')}</option>
|
|
313
|
+
<option value="christmas" ?selected=${event === 'christmas'}>${i18next.t('label.decoration christmas')}</option>
|
|
314
|
+
<option value="custom" ?selected=${event === 'custom'}>${i18next.t('label.decoration custom')}</option>
|
|
315
|
+
</select>
|
|
316
|
+
${event === 'custom'
|
|
317
|
+
? html `
|
|
318
|
+
<label><ox-i18n msgid="label.decoration from">From (MM-DD)</ox-i18n></label>
|
|
319
|
+
<input
|
|
320
|
+
type="text"
|
|
321
|
+
placeholder="12-01"
|
|
322
|
+
pattern="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
|
|
323
|
+
.value=${String((_a = decoration.from) !== null && _a !== void 0 ? _a : '')}
|
|
324
|
+
@change=${(e) => {
|
|
325
|
+
e.stopPropagation();
|
|
326
|
+
put('from', e.target.value.trim());
|
|
327
|
+
}}
|
|
328
|
+
/>
|
|
329
|
+
<label><ox-i18n msgid="label.decoration to">To (MM-DD)</ox-i18n></label>
|
|
330
|
+
<input
|
|
331
|
+
type="text"
|
|
332
|
+
placeholder="12-31"
|
|
333
|
+
pattern="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])"
|
|
334
|
+
.value=${String((_b = decoration.to) !== null && _b !== void 0 ? _b : '')}
|
|
335
|
+
@change=${(e) => {
|
|
336
|
+
e.stopPropagation();
|
|
337
|
+
put('to', e.target.value.trim());
|
|
338
|
+
}}
|
|
339
|
+
/>
|
|
340
|
+
`
|
|
341
|
+
: ''}
|
|
342
|
+
${on
|
|
343
|
+
? html `
|
|
344
|
+
<label><ox-i18n msgid="label.decoration lights">Lights</ox-i18n></label>
|
|
345
|
+
<select
|
|
346
|
+
@change=${(e) => {
|
|
347
|
+
e.stopPropagation();
|
|
348
|
+
const v = e.target.value;
|
|
349
|
+
put('lights', v === 'none' ? undefined : v);
|
|
350
|
+
}}
|
|
351
|
+
>
|
|
352
|
+
${['none', 'wrap', 'outline'].map(v => html `<option value=${v} ?selected=${lights === v}>${i18next.t(`label.decoration lights ${v}`)}</option>`)}
|
|
353
|
+
</select>
|
|
354
|
+
${lights === 'outline'
|
|
355
|
+
? html `
|
|
356
|
+
<label style="text-transform: none"><ox-i18n msgid="label.decoration height">Height (mm)</ox-i18n></label>
|
|
357
|
+
<input
|
|
358
|
+
type="number"
|
|
359
|
+
min="0"
|
|
360
|
+
step="100"
|
|
361
|
+
placeholder=${i18next.t('text.decoration height top')}
|
|
362
|
+
.value=${String((_c = decoration.height) !== null && _c !== void 0 ? _c : '')}
|
|
363
|
+
@change=${(e) => {
|
|
364
|
+
e.stopPropagation();
|
|
365
|
+
const raw = e.target.value;
|
|
366
|
+
put('height', raw === '' ? undefined : Number(raw));
|
|
367
|
+
}}
|
|
368
|
+
/>
|
|
369
|
+
`
|
|
370
|
+
: ''}
|
|
371
|
+
<input
|
|
372
|
+
id="cb-decoration-only"
|
|
373
|
+
type="checkbox"
|
|
374
|
+
.checked=${decoration.onlyInEvent === true}
|
|
375
|
+
@change=${(e) => {
|
|
376
|
+
e.stopPropagation();
|
|
377
|
+
put('onlyInEvent', e.target.checked ? true : undefined);
|
|
378
|
+
}}
|
|
379
|
+
/>
|
|
380
|
+
<label for="cb-decoration-only"><ox-i18n msgid="label.decoration only in event">Show this component only in the event</ox-i18n></label>
|
|
381
|
+
`
|
|
382
|
+
: ''}
|
|
383
|
+
</div>
|
|
384
|
+
</fieldset>
|
|
385
|
+
`;
|
|
386
|
+
}
|
|
281
387
|
onValueChange(e) {
|
|
282
388
|
var _a, _b;
|
|
283
389
|
var element = e.target;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/property-panel",
|
|
3
3
|
"description": "Webcomponent property-panel following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.112",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"prettier --write"
|
|
129
129
|
]
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "77b2b9455472659823fe2358442239fce358256c"
|
|
132
132
|
}
|
package/translations/en.json
CHANGED
|
@@ -858,10 +858,29 @@
|
|
|
858
858
|
"text.lamp more": "This component has {{count}} more lamps; change them in the board's source.",
|
|
859
859
|
"label.indoor": "Indoors",
|
|
860
860
|
"label.indoor space": "An indoor space: lit at night, dry",
|
|
861
|
+
"label.vibe decorations": "Event decorations in their period",
|
|
862
|
+
"label.decoration": "Event decoration",
|
|
863
|
+
"label.decoration event": "Event",
|
|
864
|
+
"label.decoration none": "None",
|
|
865
|
+
"label.decoration christmas": "Christmas (12-01 to 12-31)",
|
|
866
|
+
"label.decoration custom": "A set period",
|
|
867
|
+
"label.decoration from": "From (MM-DD)",
|
|
868
|
+
"label.decoration to": "To (MM-DD)",
|
|
869
|
+
"label.decoration lights": "Lights",
|
|
870
|
+
"label.decoration lights none": "None",
|
|
871
|
+
"label.decoration lights wrap": "Wound round the top (a tree's crown)",
|
|
872
|
+
"label.decoration lights outline": "Along the edge (eaves, a canopy)",
|
|
873
|
+
"label.decoration height": "Height (mm)",
|
|
874
|
+
"text.decoration height top": "The top",
|
|
875
|
+
"label.decoration only in event": "Show this component only in the event",
|
|
861
876
|
"button.vibe simulate day": "Simulate a day",
|
|
862
877
|
"button.vibe stop simulation": "Stop",
|
|
863
878
|
"text.vibe location insecure": "The location is given only to a secure (HTTPS) address. Enter the latitude and longitude.",
|
|
864
879
|
"text.vibe location unsupported": "This browser does not give its location. Enter the latitude and longitude.",
|
|
865
880
|
"text.vibe location denied": "Permission to use the location was refused. Allow the location in the site settings by the address bar, and check that the system's location services are on.",
|
|
866
|
-
"text.vibe location timeout": "Reading the location took too long. Try again."
|
|
881
|
+
"text.vibe location timeout": "Reading the location took too long. Try again.",
|
|
882
|
+
"label.vibe weather source": "Weather",
|
|
883
|
+
"label.vibe weather source manual": "Set here",
|
|
884
|
+
"label.vibe weather source open-meteo": "Observed and forecast (Open-Meteo)",
|
|
885
|
+
"text.vibe weather source": "Cloud, rain and snow, visibility, lying snow and wet ground are the readings at this place and time."
|
|
867
886
|
}
|
package/translations/ko.json
CHANGED
|
@@ -882,10 +882,29 @@
|
|
|
882
882
|
"text.lamp more": "이 컴포넌트에는 조명 기구가 {{count}}개 더 있습니다. 보드 원본에서 수정하세요.",
|
|
883
883
|
"label.indoor": "실내",
|
|
884
884
|
"label.indoor space": "실내 공간(밤에도 조명 유지·젖지 않음)",
|
|
885
|
+
"label.vibe decorations": "행사 장식 표시(기간에만)",
|
|
886
|
+
"label.decoration": "행사 장식",
|
|
887
|
+
"label.decoration event": "행사",
|
|
888
|
+
"label.decoration none": "없음",
|
|
889
|
+
"label.decoration christmas": "크리스마스(12-01~12-31)",
|
|
890
|
+
"label.decoration custom": "기간 지정",
|
|
891
|
+
"label.decoration from": "시작일(MM-DD)",
|
|
892
|
+
"label.decoration to": "종료일(MM-DD)",
|
|
893
|
+
"label.decoration lights": "전구",
|
|
894
|
+
"label.decoration lights none": "없음",
|
|
895
|
+
"label.decoration lights wrap": "윗부분 감기(나무 수관)",
|
|
896
|
+
"label.decoration lights outline": "가장자리 따라(처마·캐노피)",
|
|
897
|
+
"label.decoration height": "높이(mm)",
|
|
898
|
+
"text.decoration height top": "맨 위",
|
|
899
|
+
"label.decoration only in event": "행사 기간에만 이 컴포넌트 표시",
|
|
885
900
|
"button.vibe simulate day": "하루 시뮬레이션",
|
|
886
901
|
"button.vibe stop simulation": "중지",
|
|
887
902
|
"text.vibe location insecure": "보안 연결(HTTPS) 주소에서만 위치를 확인할 수 있습니다. 위도·경도를 직접 입력하세요.",
|
|
888
903
|
"text.vibe location unsupported": "이 브라우저는 위치 정보를 지원하지 않습니다. 위도·경도를 직접 입력하세요.",
|
|
889
904
|
"text.vibe location denied": "위치 권한이 거부되었습니다. 주소창의 사이트 설정에서 위치를 허용하고, 운영체제의 위치 서비스가 켜져 있는지 확인하세요.",
|
|
890
|
-
"text.vibe location timeout": "위치 확인 시간이 초과되었습니다. 다시 시도하세요."
|
|
905
|
+
"text.vibe location timeout": "위치 확인 시간이 초과되었습니다. 다시 시도하세요.",
|
|
906
|
+
"label.vibe weather source": "날씨",
|
|
907
|
+
"label.vibe weather source manual": "직접 입력",
|
|
908
|
+
"label.vibe weather source open-meteo": "관측·예보값(Open-Meteo)",
|
|
909
|
+
"text.vibe weather source": "운량, 비·눈, 시정, 적설, 노면 젖음은 이 위치와 시각의 관측·예보값을 씁니다."
|
|
891
910
|
}
|