@operato/property-panel 10.29.45 → 10.29.47
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/CHANGELOG.md +17 -0
- package/dist/src/property-panel/shapes/shapes.d.ts +10 -0
- package/dist/src/property-panel/shapes/shapes.js +117 -0
- package/dist/src/property-panel/shapes/shapes.js.map +1 -1
- package/dist/test/drawing-size.test.d.ts +1 -0
- package/dist/test/drawing-size.test.js +48 -0
- package/dist/test/drawing-size.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/test/drawing-size.test.ts +54 -0
- package/translations/en.json +9 -1
- package/translations/es.json +9 -1
- package/translations/ja.json +9 -1
- package/translations/ko.json +9 -1
- package/translations/ms.json +9 -1
- package/translations/zh.json +9 -1
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.47",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@material/web": "^2.0.0",
|
|
71
|
-
"@operato/app": "^10.29.
|
|
72
|
-
"@operato/attachment": "^10.29.
|
|
71
|
+
"@operato/app": "^10.29.47",
|
|
72
|
+
"@operato/attachment": "^10.29.47",
|
|
73
73
|
"@operato/i18n": "^10.29.27",
|
|
74
74
|
"@operato/input": "^10.29.44",
|
|
75
75
|
"@operato/styles": "^10.29.30",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"prettier --write"
|
|
110
110
|
]
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "e87ad8932190922da8d24fd5cb6f6cd9c8219ab9"
|
|
113
113
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 「도면 크기와 단위」 (ADR-0144 2.4): the drawing's real size shown and typed in its display unit, stored as the scale and
|
|
3
|
+
* coordinates; a drawing whose scale is unknown says so and is fitted to a real length without a coordinate moving.
|
|
4
|
+
*/
|
|
5
|
+
import { html } from 'lit'
|
|
6
|
+
import { fixture, expect, oneEvent } from '@open-wc/testing'
|
|
7
|
+
|
|
8
|
+
import { PropertyShapes } from '../src/property-panel/shapes/shapes.js'
|
|
9
|
+
|
|
10
|
+
customElements.define('drawing-size-under-test', class extends PropertyShapes {})
|
|
11
|
+
|
|
12
|
+
const root = { isRootModel: () => true, isLayer: () => true }
|
|
13
|
+
|
|
14
|
+
async function panel(value: Record<string, unknown>, bounds = { left: 0, top: 0, width: 6000, height: 4000 }) {
|
|
15
|
+
return fixture<PropertyShapes>(html`<drawing-size-under-test .value=${value} .bounds=${bounds} .selected=${[root]}></drawing-size-under-test>`)
|
|
16
|
+
}
|
|
17
|
+
const field = (el: PropertyShapes, attr: string) => el.shadowRoot!.querySelector(`input[${attr}]`) as HTMLInputElement | null
|
|
18
|
+
const type = (input: HTMLInputElement, value: string) => {
|
|
19
|
+
input.value = value
|
|
20
|
+
input.dispatchEvent(new Event('change', { bubbles: true, composed: true }))
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
describe('the drawing size and unit (ADR-0144)', () => {
|
|
24
|
+
it('a drawing with a scale shows its real size and ceiling in its display unit', async () => {
|
|
25
|
+
const el = await panel({ mmPerUnit: 10, displayUnit: 'm', heights: { ceiling: 3000 } })
|
|
26
|
+
expect([field(el, 'drawing-width')!.value, field(el, 'drawing-depth')!.value, field(el, 'drawing-ceiling')!.value]).to.deep.equal(['60', '40', '3'])
|
|
27
|
+
expect(el.shadowRoot!.querySelector('[scale-unknown]')).to.equal(null)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('a real width typed sets the width in coordinates through the scale', async () => {
|
|
31
|
+
const el = await panel({ mmPerUnit: 10, displayUnit: 'm' })
|
|
32
|
+
setTimeout(() => type(field(el, 'drawing-width')!, '70'))
|
|
33
|
+
const { detail } = await oneEvent(el, 'bounds-change')
|
|
34
|
+
expect(detail).to.deep.equal({ width: 7000 })
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('a ceiling typed is kept as a real length, in mm', async () => {
|
|
38
|
+
const el = await panel({ mmPerUnit: 10, displayUnit: 'm', heights: { floor: 0, ceiling: 3000 } })
|
|
39
|
+
setTimeout(() => type(field(el, 'drawing-ceiling')!, '4.5'))
|
|
40
|
+
const { detail } = await oneEvent(el, 'property-change')
|
|
41
|
+
expect(detail).to.deep.equal({ heights: { floor: 0, ceiling: 4500 } })
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('a drawing whose scale is unknown says so, and the real length of its width sets the scale', async () => {
|
|
45
|
+
const el = await panel({ displayUnit: 'm' })
|
|
46
|
+
expect(el.shadowRoot!.querySelector('[scale-unknown]')).to.not.equal(null)
|
|
47
|
+
expect(field(el, 'drawing-width')).to.equal(null)
|
|
48
|
+
;(el.shadowRoot!.querySelector('button[calibrate]') as HTMLButtonElement).click()
|
|
49
|
+
await el.updateComplete
|
|
50
|
+
setTimeout(() => type(field(el, 'calibrate-length')!, '60'))
|
|
51
|
+
const { detail } = await oneEvent(el, 'property-change')
|
|
52
|
+
expect(detail).to.deep.equal({ mmPerUnit: 10 })
|
|
53
|
+
})
|
|
54
|
+
})
|
package/translations/en.json
CHANGED
|
@@ -775,5 +775,13 @@
|
|
|
775
775
|
"label.motion-groups": "motion groups",
|
|
776
776
|
"label.rule-scale": "scale",
|
|
777
777
|
"label.rule-scale-factor": "scale by",
|
|
778
|
-
"label.rule-scale-offset": "plus"
|
|
778
|
+
"label.rule-scale-offset": "plus",
|
|
779
|
+
"label.drawing-size-and-unit": "drawing size and unit",
|
|
780
|
+
"label.display-unit": "unit",
|
|
781
|
+
"label.drawing-width": "width",
|
|
782
|
+
"label.drawing-depth": "depth",
|
|
783
|
+
"label.ceiling-height": "ceiling height",
|
|
784
|
+
"text.scale-unknown": "scale unknown",
|
|
785
|
+
"button.calibrate-scale": "fit to a real length",
|
|
786
|
+
"label.calibrate-width": "the real length of the drawing width {width}"
|
|
779
787
|
}
|
package/translations/es.json
CHANGED
|
@@ -775,5 +775,13 @@
|
|
|
775
775
|
"label.motion-groups": "grupos de movimiento",
|
|
776
776
|
"label.rule-scale": "escala",
|
|
777
777
|
"label.rule-scale-factor": "multiplicar por",
|
|
778
|
-
"label.rule-scale-offset": "sumar"
|
|
778
|
+
"label.rule-scale-offset": "sumar",
|
|
779
|
+
"label.drawing-size-and-unit": "tamaño y unidad del plano",
|
|
780
|
+
"label.display-unit": "unidad",
|
|
781
|
+
"label.drawing-width": "ancho",
|
|
782
|
+
"label.drawing-depth": "fondo",
|
|
783
|
+
"label.ceiling-height": "altura del techo",
|
|
784
|
+
"text.scale-unknown": "escala desconocida",
|
|
785
|
+
"button.calibrate-scale": "ajustar a una longitud real",
|
|
786
|
+
"label.calibrate-width": "longitud real del ancho del plano {width}"
|
|
779
787
|
}
|
package/translations/ja.json
CHANGED
|
@@ -779,5 +779,13 @@
|
|
|
779
779
|
"label.motion-groups": "モーショングループ",
|
|
780
780
|
"label.rule-scale": "倍率",
|
|
781
781
|
"label.rule-scale-factor": "倍率",
|
|
782
|
-
"label.rule-scale-offset": "加算"
|
|
782
|
+
"label.rule-scale-offset": "加算",
|
|
783
|
+
"label.drawing-size-and-unit": "図面のサイズと単位",
|
|
784
|
+
"label.display-unit": "表示単位",
|
|
785
|
+
"label.drawing-width": "幅",
|
|
786
|
+
"label.drawing-depth": "奥行き",
|
|
787
|
+
"label.ceiling-height": "天井の高さ",
|
|
788
|
+
"text.scale-unknown": "縮尺未確認",
|
|
789
|
+
"button.calibrate-scale": "実際の長さに合わせる",
|
|
790
|
+
"label.calibrate-width": "図面の幅 {width} の実際の長さ"
|
|
783
791
|
}
|
package/translations/ko.json
CHANGED
|
@@ -779,5 +779,13 @@
|
|
|
779
779
|
"label.motion-groups": "동작 그룹",
|
|
780
780
|
"label.rule-scale": "배율",
|
|
781
781
|
"label.rule-scale-factor": "배율",
|
|
782
|
-
"label.rule-scale-offset": "더하기"
|
|
782
|
+
"label.rule-scale-offset": "더하기",
|
|
783
|
+
"label.drawing-size-and-unit": "도면 크기와 단위",
|
|
784
|
+
"label.display-unit": "표시 단위",
|
|
785
|
+
"label.drawing-width": "너비",
|
|
786
|
+
"label.drawing-depth": "깊이",
|
|
787
|
+
"label.ceiling-height": "천장 높이",
|
|
788
|
+
"text.scale-unknown": "축척 미확인",
|
|
789
|
+
"button.calibrate-scale": "실제 길이로 맞추기",
|
|
790
|
+
"label.calibrate-width": "도면 너비 {width} 의 실제 길이"
|
|
783
791
|
}
|
package/translations/ms.json
CHANGED
|
@@ -651,5 +651,13 @@
|
|
|
651
651
|
"label.motion-groups": "kumpulan gerakan",
|
|
652
652
|
"label.rule-scale": "skala",
|
|
653
653
|
"label.rule-scale-factor": "darab dengan",
|
|
654
|
-
"label.rule-scale-offset": "tambah"
|
|
654
|
+
"label.rule-scale-offset": "tambah",
|
|
655
|
+
"label.drawing-size-and-unit": "saiz dan unit lukisan",
|
|
656
|
+
"label.display-unit": "unit",
|
|
657
|
+
"label.drawing-width": "lebar",
|
|
658
|
+
"label.drawing-depth": "dalam",
|
|
659
|
+
"label.ceiling-height": "tinggi siling",
|
|
660
|
+
"text.scale-unknown": "skala tidak diketahui",
|
|
661
|
+
"button.calibrate-scale": "padankan dengan panjang sebenar",
|
|
662
|
+
"label.calibrate-width": "panjang sebenar lebar lukisan {width}"
|
|
655
663
|
}
|
package/translations/zh.json
CHANGED
|
@@ -778,5 +778,13 @@
|
|
|
778
778
|
"label.motion-groups": "动作组",
|
|
779
779
|
"label.rule-scale": "倍率",
|
|
780
780
|
"label.rule-scale-factor": "倍率",
|
|
781
|
-
"label.rule-scale-offset": "加"
|
|
781
|
+
"label.rule-scale-offset": "加",
|
|
782
|
+
"label.drawing-size-and-unit": "图纸尺寸和单位",
|
|
783
|
+
"label.display-unit": "显示单位",
|
|
784
|
+
"label.drawing-width": "宽度",
|
|
785
|
+
"label.drawing-depth": "深度",
|
|
786
|
+
"label.ceiling-height": "天花板高度",
|
|
787
|
+
"text.scale-unknown": "比例未确认",
|
|
788
|
+
"button.calibrate-scale": "按实际长度校准",
|
|
789
|
+
"label.calibrate-width": "图纸宽度 {width} 的实际长度"
|
|
782
790
|
}
|