@operato/board 0.4.7 → 0.4.10
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 +28 -0
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +49 -16
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +1 -1
- package/dist/src/modeller/property-sidebar/styles/styles.js +1 -1
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -1
- package/dist/src/ox-board-viewer.d.ts +1 -1
- package/dist/src/ox-board-viewer.js +5 -2
- package/dist/src/ox-board-viewer.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/modeller/property-sidebar/effects/property-event-tap.ts +49 -14
- package/src/modeller/property-sidebar/styles/styles.ts +1 -1
- package/src/ox-board-viewer.ts +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [0.4.10](https://github.com/hatiolab/operato/compare/v0.4.9...v0.4.10) (2022-08-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* avoid null destructuring property ([903f3ee](https://github.com/hatiolab/operato/commit/903f3ee28f299b6c2dc8b223f23e20af5dc8c9ca))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [0.4.9](https://github.com/hatiolab/operato/compare/v0.4.8...v0.4.9) (2022-08-13)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :bug: Bug Fix
|
|
19
|
+
|
|
20
|
+
* specifies input data of pop-up function and allows to specify whether to receive results or not ([b1a0e5b](https://github.com/hatiolab/operato/commit/b1a0e5b27040418268e30ffb4363ce667c966417))
|
|
21
|
+
* upgrade @hatiolab/things-scene@2.8.6 ([838f20f](https://github.com/hatiolab/operato/commit/838f20f3ffe795712da89a214c552e45afef79c8))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### [0.4.8](https://github.com/hatiolab/operato/compare/v0.4.7...v0.4.8) (2022-08-12)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### :bug: Bug Fix
|
|
29
|
+
|
|
30
|
+
* add close-scene-quietly ([decc701](https://github.com/hatiolab/operato/commit/decc701b55cc348dd17da7713c6d865b090645d6))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
### [0.4.7](https://github.com/hatiolab/operato/compare/v0.4.6...v0.4.7) (2022-08-12)
|
|
7
35
|
|
|
8
36
|
|
|
@@ -13,7 +13,8 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
13
13
|
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
|
-
var { action, value = '', target = '', pressed } = this.value || {};
|
|
16
|
+
var { action, value = '', target = '', pressed, options } = this.value || {};
|
|
17
|
+
var { input = '(self)', output = true } = options || {};
|
|
17
18
|
return html `
|
|
18
19
|
<input id="checkbox-pressed" type="checkbox" value-key="pressed" .checked=${pressed} />
|
|
19
20
|
<label for="checkbox-pressed" class="checkbox-label"> <ox-i18n msgid="label.pressed">pressed</ox-i18n> </label>
|
|
@@ -25,12 +26,9 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
25
26
|
<option value="link-open">open new window for target link</option>
|
|
26
27
|
<option value="link-move">move to target link</option>
|
|
27
28
|
<option value="route-page">route to page</option>
|
|
28
|
-
<option value="popup">popup target board
|
|
29
|
-
<option value="popup
|
|
30
|
-
<option value="modal-popup">modal popup target board with data</option>
|
|
31
|
-
<option value="modal-popup-with-value">modal popup target board with value</option>
|
|
29
|
+
<option value="popup">popup target board</option>
|
|
30
|
+
<option value="modal-popup">modal popup target board</option>
|
|
32
31
|
<option value="close-scene">close current board</option>
|
|
33
|
-
<option value="close-scene-silently">close current board silently</option>
|
|
34
32
|
<option value="infoWindow">open infowindow</option>
|
|
35
33
|
<option value="toggle-info-window">toggle infowindow</option>
|
|
36
34
|
<option value="data-toggle">toggle(true/false) target component data</option>
|
|
@@ -41,7 +39,7 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
41
39
|
|
|
42
40
|
<label> <ox-i18n msgid="label.target">target</ox-i18n> </label>
|
|
43
41
|
|
|
44
|
-
${action === 'goto' || action.includes('popup')
|
|
42
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
45
43
|
? html `
|
|
46
44
|
<things-editor-board-selector
|
|
47
45
|
value-key="target"
|
|
@@ -56,19 +54,35 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
56
54
|
${this._getTargetList(action).map(item => html ` <option .value=${item}></option> `)}
|
|
57
55
|
</datalist>
|
|
58
56
|
`}
|
|
59
|
-
${action
|
|
57
|
+
${action === 'goto' || (action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
60
58
|
? html `
|
|
59
|
+
<label for="input"> <ox-i18n msgid="label.input-data">input</ox-i18n> </label>
|
|
60
|
+
|
|
61
|
+
<input id="input" value-key="input" .value=${input} list="input-list" />
|
|
62
|
+
|
|
63
|
+
<datalist id="input-list">
|
|
64
|
+
${this._getTargetList(action).map(item => html ` <option .value=${item}></option> `)}
|
|
65
|
+
</datalist>
|
|
66
|
+
|
|
67
|
+
${
|
|
68
|
+
/* currently 'goto' does not support returning result */
|
|
69
|
+
(action === null || action === void 0 ? void 0 : action.includes('popup'))
|
|
70
|
+
? html ` <input id="checkbox-output" type="checkbox" value-key="output" .checked=${output} />
|
|
71
|
+
<label for="checkbox-output" class="checkbox-label">
|
|
72
|
+
<ox-i18n msgid="label.will-get-return">will-get-return</ox-i18n>
|
|
73
|
+
</label>`
|
|
74
|
+
: html ``}
|
|
75
|
+
`
|
|
76
|
+
: action == 'data-set' || action == 'value-set'
|
|
77
|
+
? html `
|
|
61
78
|
<label> <ox-i18n msgid="label.value">value</ox-i18n> </label>
|
|
62
79
|
<ox-input-data value-key="value" .value=${value} custom-editor fullwidth></ox-input-data>
|
|
63
80
|
`
|
|
64
|
-
|
|
81
|
+
: html ``}
|
|
65
82
|
`;
|
|
66
83
|
}
|
|
67
84
|
_getPlaceHoder(action) {
|
|
68
85
|
switch (action) {
|
|
69
|
-
case 'popup':
|
|
70
|
-
case 'goto':
|
|
71
|
-
return 'SCENE-100';
|
|
72
86
|
case 'link-open':
|
|
73
87
|
case 'link-move':
|
|
74
88
|
return 'http://www.hatiolab.com/';
|
|
@@ -82,6 +96,8 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
82
96
|
case 'data-tristate':
|
|
83
97
|
case 'data-set':
|
|
84
98
|
case 'value-set':
|
|
99
|
+
case 'popup':
|
|
100
|
+
case 'modal-popup':
|
|
85
101
|
let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || [];
|
|
86
102
|
ids.unshift('(self)');
|
|
87
103
|
return ids;
|
|
@@ -104,10 +120,27 @@ let PropertyEventTap = class PropertyEventTap extends LitElement {
|
|
|
104
120
|
if (!key) {
|
|
105
121
|
return;
|
|
106
122
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
if (key === 'input' || key === 'output') {
|
|
124
|
+
var { options = {} } = this.value || {};
|
|
125
|
+
this.value = {
|
|
126
|
+
...this.value,
|
|
127
|
+
options: {
|
|
128
|
+
...options,
|
|
129
|
+
[key]: convert(element)
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this.value = {
|
|
135
|
+
...this.value,
|
|
136
|
+
[key]: convert(element)
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
var { action } = this.value;
|
|
140
|
+
if (action !== 'goto' && !(action === null || action === void 0 ? void 0 : action.includes('popup'))) {
|
|
141
|
+
/* clear unused options */
|
|
142
|
+
delete this.value.options;
|
|
143
|
+
}
|
|
111
144
|
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
112
145
|
}
|
|
113
146
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-event-tap.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-tap.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAG3C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAMvC,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"property-event-tap.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/effects/property-event-tap.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,iCAAiC,CAAA;AACxC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAI3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CA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AAC,CAAC,CAAA;IAClF,CAAC;CACF,CAAA;AAvJQ,uBAAM,GAAG,CAAC,kBAAkB,CAAC,CAAA;AAER;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AAJrC,gBAAgB;IADrB,aAAa,CAAC,oBAAoB,CAAC;GAC9B,gBAAgB,CAwJrB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-data.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Properties, Scene } from '@hatiolab/things-scene'\n\nimport { EffectsSharedStyle } from './effects-shared-style'\nimport { convert } from './value-converter'\n\n@customElement('property-event-tap')\nclass PropertyEventTap extends LitElement {\n static styles = [EffectsSharedStyle]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) scene?: Scene\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var { action, value = '', target = '', pressed, options } = this.value || {}\n var { input = '(self)', output = true } = options || {}\n\n return html`\n <input id=\"checkbox-pressed\" type=\"checkbox\" value-key=\"pressed\" .checked=${pressed} />\n <label for=\"checkbox-pressed\" class=\"checkbox-label\"> <ox-i18n msgid=\"label.pressed\">pressed</ox-i18n> </label>\n\n <label> <ox-i18n msgid=\"label.action\">action</ox-i18n> </label>\n <select id=\"tap-select\" value-key=\"action\" .value=${action || ''}>\n <option value=\"\"></option>\n <option value=\"goto\">go to target board</option>\n <option value=\"link-open\">open new window for target link</option>\n <option value=\"link-move\">move to target link</option>\n <option value=\"route-page\">route to page</option>\n <option value=\"popup\">popup target board</option>\n <option value=\"modal-popup\">modal popup target board</option>\n <option value=\"close-scene\">close current board</option>\n <option value=\"infoWindow\">open infowindow</option>\n <option value=\"toggle-info-window\">toggle infowindow</option>\n <option value=\"data-toggle\">toggle(true/false) target component data</option>\n <option value=\"data-tristate\">tristate(0/1/2) target component data</option>\n <option value=\"data-set\">set value to target component data</option>\n <option value=\"value-set\">set value to target component value</option>\n </select>\n\n <label> <ox-i18n msgid=\"label.target\">target</ox-i18n> </label>\n\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <things-editor-board-selector\n value-key=\"target\"\n .value=${target}\n custom-editor\n ></things-editor-board-selector>\n `\n : html`\n <input value-key=\"target\" .value=${target} list=\"target-list\" .placeholder=${this._getPlaceHoder(action)} />\n\n <datalist id=\"target-list\">\n ${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}\n </datalist>\n `}\n ${action === 'goto' || action?.includes('popup')\n ? html`\n <label for=\"input\"> <ox-i18n msgid=\"label.input-data\">input</ox-i18n> </label>\n\n <input id=\"input\" value-key=\"input\" .value=${input} list=\"input-list\" />\n\n <datalist id=\"input-list\">\n ${this._getTargetList(action).map(item => html` <option .value=${item}></option> `)}\n </datalist>\n\n ${\n /* currently 'goto' does not support returning result */\n action?.includes('popup')\n ? html` <input id=\"checkbox-output\" type=\"checkbox\" value-key=\"output\" .checked=${output} />\n <label for=\"checkbox-output\" class=\"checkbox-label\">\n <ox-i18n msgid=\"label.will-get-return\">will-get-return</ox-i18n>\n </label>`\n : html``\n }\n `\n : action == 'data-set' || action == 'value-set'\n ? html`\n <label> <ox-i18n msgid=\"label.value\">value</ox-i18n> </label>\n <ox-input-data value-key=\"value\" .value=${value} custom-editor fullwidth></ox-input-data>\n `\n : html``}\n `\n }\n\n _getPlaceHoder(action: string) {\n switch (action) {\n case 'link-open':\n case 'link-move':\n return 'http://www.hatiolab.com/'\n default:\n return ''\n }\n }\n\n _getTargetList(action: string) {\n switch (action) {\n case 'data-toggle':\n case 'data-tristate':\n case 'data-set':\n case 'value-set':\n case 'popup':\n case 'modal-popup':\n let ids = (this.scene && this.scene.ids.map(i => `#${i.key}`)) || []\n ids.unshift('(self)')\n return ids\n case 'infoWindow':\n case 'toggle-info-window':\n return (\n (this.scene &&\n this.scene.ids\n .filter(i => {\n return this.scene!.findById(i.key).get('type') == 'info-window'\n })\n .map(i => `${i.key}`)) ||\n []\n )\n default:\n return []\n }\n }\n\n _onValueChange(e: Event) {\n var element = e.target as HTMLElement\n var key = element.getAttribute('value-key')\n\n if (!key) {\n return\n }\n\n if (key === 'input' || key === 'output') {\n var { options = {} } = this.value || {}\n\n this.value = {\n ...this.value,\n options: {\n ...options,\n [key]: convert(element)\n }\n }\n } else {\n this.value = {\n ...this.value,\n [key]: convert(element)\n }\n }\n\n var { action } = this.value\n if (action !== 'goto' && !action?.includes('popup')) {\n /* clear unused options */\n delete this.value.options\n }\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -23,7 +23,7 @@ let PropertyStyles = class PropertyStyles extends AbstractProperty {
|
|
|
23
23
|
this.renderRoot.addEventListener('change', this._onValueChange.bind(this));
|
|
24
24
|
}
|
|
25
25
|
render() {
|
|
26
|
-
var { alpha, fontFamily, fontSize, lineHeight, fontColor, bold, italic, fillStyle, lineWidth, strokeStyle, lineDash, lineCap, lineJoin, begin, beginSize, end, endSize } = this.value;
|
|
26
|
+
var { alpha, fontFamily, fontSize, lineHeight, fontColor, bold, italic, fillStyle, lineWidth, strokeStyle, lineDash, lineCap, lineJoin, begin, beginSize, end, endSize } = this.value || {};
|
|
27
27
|
return html `
|
|
28
28
|
<fieldset>
|
|
29
29
|
<legend>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/styles/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kDAAkD,CAAA;AACzD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,gEAAgE,CAAA;AACvE,OAAO,sEAAsE,CAAA;AAC7E,OAAO,wEAAwE,CAAA;AAC/E,OAAO,0BAA0B,CAAA;AAEjC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8SF;CACF,CAAA;AAC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAgB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAkB;AArTxC,cAAc;IADnB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,cAAc,CA8iBnB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@polymer/paper-dropdown-menu/paper-dropdown-menu'\nimport '@operato/help/ox-title-with-help.js'\nimport '@things-factory/modeller-ui/client/editors/things-editor-color'\nimport '@things-factory/modeller-ui/client/editors/things-editor-color-style'\nimport '@things-factory/modeller-ui/client/editors/things-editor-font-selector'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Component } from '@hatiolab/things-scene'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { PropertySharedStyle } from '../property-shared-style'\n\n@customElement('property-style')\nclass PropertyStyles extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n css`\n paper-slider {\n width: 100%;\n }\n\n .btn-group {\n height: 24px;\n }\n\n .btn-group paper-button {\n width: 30px;\n height: 24px;\n min-width: initial;\n margin: 0 4px 0 0;\n padding: 0;\n border-radius: 0;\n display: inline-block;\n border-bottom: 2px solid #fff;\n\n background: var(--url-icon-properties) no-repeat;\n background-size: 70%;\n }\n\n .btn-group paper-button.tbold {\n background-position: 50% -170px;\n }\n\n .btn-group paper-button.titalic {\n background-position: 50% -205px;\n }\n\n .btn-group paper-button.tunderline {\n background-position: 50% -240px;\n }\n\n .btn-group paper-button.tstrikethrough {\n background-position: 50% -415px;\n }\n\n .btn-group paper-button[active] {\n border-color: #f2471c;\n }\n\n .line-type paper-listbox {\n overflow: hidden;\n max-width: 100px;\n }\n .line-type paper-item {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat;\n min-height: 25px;\n padding: 3px 9px;\n width: 80px;\n }\n\n .line-type paper-item.solid {\n background-position: 50% 10px;\n }\n .line-type paper-item.round-dot {\n background-position: 50% -40px;\n }\n .line-type paper-item.square-dot {\n background-position: 50% -90px;\n }\n .line-type paper-item.dash {\n background-position: 50% -140px;\n }\n .line-type paper-item.dash-dot {\n background-position: 50% -190px;\n }\n .line-type paper-item.long-dash {\n background-position: 50% -240px;\n }\n .line-type paper-item.long-dash-dot {\n background-position: 50% -290px;\n }\n .line-type paper-item.long-dash-dot-dot {\n background-position: 50% -340px;\n }\n\n .line-type .paper-input-container input {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat !important;\n }\n .line-type.solid .paper-input-container input {\n background-position: 50% 5px !important;\n }\n .line-type.round-dot .paper-input-container input {\n background-position: 50% -45px !important;\n }\n .line-type.square-dot .paper-input-container input {\n background-position: 50% -85px !important;\n }\n .line-type.dash .paper-input-container input {\n background-position: 50% -145px !important;\n }\n .line-type.dash-dot .paper-input-container input {\n background-position: 50% -185px !important;\n }\n .line-type.long-dash .paper-input-container input {\n background-position: 50% -245px !important;\n }\n .line-type.long-dash-dot .paper-input-container input {\n background-position: 50% -285px !important;\n }\n .line-type.long-dash-dot-dot .paper-input-container input {\n background-position: 50% -345px !important;\n }\n\n .arrow-type paper-menu {\n overflow: hidden;\n max-width: 140px;\n }\n .arrow-type paper-item {\n background: var(--url-icon-properties-arrow-type) 50% 0 no-repeat;\n min-height: 30px;\n padding: 3px 7px;\n width: 30px;\n float: left;\n }\n .arrow-type paper-item.begin-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.begin-arrow {\n background-position: 50% -39px;\n }\n .arrow-type paper-item.begin-open-arrow {\n background-position: 50% -89px;\n }\n .arrow-type paper-item.begin-stealth-arrow {\n background-position: 50% -139px;\n }\n .arrow-type paper-item.begin-diamond-arrow {\n background-position: 50% -190px;\n }\n .arrow-type paper-item.begin-oval-arrow {\n background-position: 50% -238px;\n }\n .arrow-type paper-item.begin-size1 {\n background-position: 50% -286px;\n }\n .arrow-type paper-item.begin-size2 {\n background-position: 50% -336px;\n }\n .arrow-type paper-item.begin-size3 {\n background-position: 50% -386px;\n }\n .arrow-type paper-item.begin-size4 {\n background-position: 50% -436px;\n }\n .arrow-type paper-item.begin-size5 {\n background-position: 50% -486px;\n }\n .arrow-type paper-item.begin-size6 {\n background-position: 50% -536px;\n }\n .arrow-type paper-item.begin-size7 {\n background-position: 50% -589px;\n }\n .arrow-type paper-item.begin-size8 {\n background-position: 50% -639px;\n }\n .arrow-type paper-item.begin-size9 {\n background-position: 50% -689px;\n }\n .arrow-type paper-item.end-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.end-arrow {\n background-position: 50% -739px;\n }\n .arrow-type paper-item.end-open-arrow {\n background-position: 50% -789px;\n }\n .arrow-type paper-item.end-stealth-arrow {\n background-position: 50% -839px;\n }\n .arrow-type paper-item.end-diamond-arrow {\n background-position: 50% -890px;\n }\n .arrow-type paper-item.end-oval-arrow {\n background-position: 50% -938px;\n }\n .arrow-type paper-item.end-size1 {\n background-position: 50% -986px;\n }\n .arrow-type paper-item.end-size2 {\n background-position: 50% -1036px;\n }\n .arrow-type paper-item.end-size3 {\n background-position: 50% -1086px;\n }\n .arrow-type paper-item.end-size4 {\n background-position: 50% -1136px;\n }\n .arrow-type paper-item.end-size5 {\n background-position: 50% -1186px;\n }\n .arrow-type paper-item.end-size6 {\n background-position: 50% -1236px;\n }\n .arrow-type paper-item.end-size7 {\n background-position: 50% -1289px;\n }\n .arrow-type paper-item.end-size8 {\n background-position: 50% -1339px;\n }\n .arrow-type paper-item.end-size9 {\n background-position: 50% -1389px;\n }\n\n .arrow-type .paper-input-container input {\n background: var(--url-icon-properties-arrow-type) 110% 0 no-repeat !important;\n }\n .arrow-type.begin-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.begin-arrow .paper-input-container input {\n background-position: 110% -50px !important;\n }\n .arrow-type.begin-open-arrow .paper-input-container input {\n background-position: 110% -100px !important;\n }\n .arrow-type.begin-stealth-arrow .paper-input-container input {\n background-position: 110% -150px !important;\n }\n .arrow-type.begin-diamond-arrow .paper-input-container input {\n background-position: 110% -200px !important;\n }\n .arrow-type.begin-oval-arrow .paper-input-container input {\n background-position: 110% -250px !important;\n }\n .arrow-type.begin-size1 .paper-input-container input {\n background-position: 110% -298px !important;\n }\n .arrow-type.begin-size2 .paper-input-container input {\n background-position: 110% -348px !important;\n }\n .arrow-type.begin-size3 .paper-input-container input {\n background-position: 110% -398px !important;\n }\n .arrow-type.begin-size4 .paper-input-container input {\n background-position: 110% -448px !important;\n }\n .arrow-type.begin-size5 .paper-input-container input {\n background-position: 110% -498px !important;\n }\n .arrow-type.begin-size6 .paper-input-container input {\n background-position: 110% -548px !important;\n }\n .arrow-type.begin-size7 .paper-input-container input {\n background-position: 110% -600px !important;\n }\n .arrow-type.begin-size8 .paper-input-container input {\n background-position: 110% -650px !important;\n }\n .arrow-type.begin-size9 .paper-input-container input {\n background-position: 110% -700px !important;\n }\n .arrow-type.end-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.end-arrow .paper-input-container input {\n background-position: 110% -750px !important;\n }\n .arrow-type.end-open-arrow .paper-input-container input {\n background-position: 110% -800px !important;\n }\n .arrow-type.end-stealth-arrow .paper-input-container input {\n background-position: 110% -850px !important;\n }\n .arrow-type.end-diamond-arrow .paper-input-container input {\n background-position: 110% -900px !important;\n }\n .arrow-type.end-oval-arrow .paper-input-container input {\n background-position: 110% -950px !important;\n }\n .arrow-type.end-size1 .paper-input-container input {\n background-position: 110% -998px !important;\n }\n .arrow-type.end-size2 .paper-input-container input {\n background-position: 110% -1048px !important;\n }\n .arrow-type.end-size3 .paper-input-container input {\n background-position: 110% -1098px !important;\n }\n .arrow-type.end-size4 .paper-input-container input {\n background-position: 110% -1148px !important;\n }\n .arrow-type.end-size5 .paper-input-container input {\n background-position: 110% -1198px !important;\n }\n .arrow-type.end-size6 .paper-input-container input {\n background-position: 110% -1248px !important;\n }\n .arrow-type.end-size7 .paper-input-container input {\n background-position: 110% -1300px !important;\n }\n .arrow-type.end-size8 .paper-input-container input {\n background-position: 110% -1350px !important;\n }\n .arrow-type.end-size9 .paper-input-container input {\n background-position: 110% -1400px !important;\n }\n `\n ]\n @property({ type: Object }) value: any = {}\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) fonts: any[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var {\n alpha,\n fontFamily,\n fontSize,\n lineHeight,\n fontColor,\n bold,\n italic,\n fillStyle,\n lineWidth,\n strokeStyle,\n lineDash,\n lineCap,\n lineJoin,\n begin,\n beginSize,\n end,\n endSize\n } = this.value\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/opacity\" msgid=\"label.opacity\">opacity</ox-title-with-help>\n </legend>\n <paper-slider min=\"0\" max=\"1\" step=\"0.1\" value-key=\"alpha\" .value=${alpha || 1} editable> </paper-slider>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/text-style\" msgid=\"label.text-style\"\n >text style</ox-title-with-help\n >\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.font-family\">Font Family</ox-i18n>\n </label>\n\n <things-editor-font-selector\n value-key=\"fontFamily\"\n .value=${fontFamily}\n class=\"property-full-input\"\n custom-editor\n ></things-editor-font-selector>\n\n <label class=\"property-half-label icon-only-label font-size\"></label>\n <input type=\"number\" value-key=\"fontSize\" .value=${fontSize} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label lineHeight\"></label>\n <input type=\"number\" value-key=\"lineHeight\" .value=${lineHeight} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <things-editor-color value-key=\"fontColor\" .value=${fontColor} class=\"property-half-input\">\n </things-editor-color>\n\n <label class=\"property-half-label\"></label>\n <div class=\"property-half-input btn-group\">\n <paper-button toggles value-key=\"bold\" ?active=${bold} class=\"tbold\"> </paper-button>\n <paper-button toggles value-key=\"italic\" ?active=${italic} class=\"titalic\"> </paper-button>\n </div>\n </div>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/fill-style\" msgid=\"label.fill-style\"\n >fill style</ox-title-with-help\n >\n </legend>\n\n <things-editor-color-style value-key=\"fillStyle\" .value=${fillStyle}> </things-editor-color-style>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.line-style\" topic=\"board-modeller/styles/line-style\"></ox-title-with-help>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-half-label icon-only-label linewidth\"></label>\n <input type=\"number\" value-key=\"lineWidth\" .value=${lineWidth} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <things-editor-color value-key=\"strokeStyle\" .value=${strokeStyle} class=\"property-half-input\">\n </things-editor-color>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.line-type\">line type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input line-type solid\">\n <!-- solid는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"lineDash\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${lineDash}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"solid\" name=\"solid\"></paper-item>\n <paper-item class=\"round-dot\" name=\"round-dot\"></paper-item>\n <paper-item class=\"square-dot\" name=\"square-dot\"></paper-item>\n <paper-item class=\"dash\" name=\"dash\"></paper-item>\n <paper-item class=\"dash-dot\" name=\"dash-dot\"></paper-item>\n <paper-item class=\"long-dash\" name=\"long-dash\"></paper-item>\n <paper-item class=\"long-dash-dot\" name=\"long-dash-dot\"></paper-item>\n <paper-item class=\"long-dash-dot-dot\" name=\"long-dash-dot-dot\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.cap-type\">cap type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineCap\" .value=${lineCap}>\n <option value=\"butt\"><ox-i18n msgid=\"label.square\">square</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n </select>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.join-type\">join type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineJoin\" .value=${lineJoin}>\n <option value=\"miter\"><ox-i18n msgid=\"label.miter\">miter</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n <option value=\"bevel\"><ox-i18n msgid=\"label.bevel\">bevel</ox-i18n></option>\n </select>\n\n ${this._isLine(this.selected)\n ? html`\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-type\">begin type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-no\">\n <!-- begin-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"begin\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${begin}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-no\" name=\"none\"></paper-item>\n <paper-item class=\"begin-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"begin-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"begin-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"begin-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"begin-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-size\">begin size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-size1\">\n <!-- begin-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"beginSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${beginSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"begin-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"begin-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"begin-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"begin-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"begin-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"begin-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"begin-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"begin-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-type\">end type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-no\">\n <!-- end-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"end\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${end}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-no\" name=\"none\"></paper-item>\n <paper-item class=\"end-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"end-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"end-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"end-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"end-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-size\">end size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-size1\">\n <!-- end-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"endSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${endSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"end-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"end-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"end-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"end-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"end-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"end-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"end-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"end-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n `\n : html``}\n </div>\n </fieldset>\n `\n }\n\n _isLine(selected: Component[]) {\n var isLine = false\n\n for (var i = 0; i < selected.length; i++) {\n var comp = selected[i]\n\n if (!comp.isLine || !comp.isLine()) {\n isLine = false\n return isLine\n }\n\n isLine = true\n }\n\n return isLine\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/styles/styles.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kDAAkD,CAAA;AACzD,OAAO,qCAAqC,CAAA;AAC5C,OAAO,gEAAgE,CAAA;AACvE,OAAO,sEAAsE,CAAA;AAC7E,OAAO,wEAAwE,CAAA;AAC/E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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8SF;CACF,CAAA;AAC2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAgB;AAChB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6CAAkB;AArTxC,cAAc;IADnB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,cAAc,CA8iBnB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@polymer/paper-dropdown-menu/paper-dropdown-menu'\nimport '@operato/help/ox-title-with-help.js'\nimport '@things-factory/modeller-ui/client/editors/things-editor-color'\nimport '@things-factory/modeller-ui/client/editors/things-editor-color-style'\nimport '@things-factory/modeller-ui/client/editors/things-editor-font-selector'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Component } from '@hatiolab/things-scene'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { PropertySharedStyle } from '../property-shared-style'\n\n@customElement('property-style')\nclass PropertyStyles extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n css`\n paper-slider {\n width: 100%;\n }\n\n .btn-group {\n height: 24px;\n }\n\n .btn-group paper-button {\n width: 30px;\n height: 24px;\n min-width: initial;\n margin: 0 4px 0 0;\n padding: 0;\n border-radius: 0;\n display: inline-block;\n border-bottom: 2px solid #fff;\n\n background: var(--url-icon-properties) no-repeat;\n background-size: 70%;\n }\n\n .btn-group paper-button.tbold {\n background-position: 50% -170px;\n }\n\n .btn-group paper-button.titalic {\n background-position: 50% -205px;\n }\n\n .btn-group paper-button.tunderline {\n background-position: 50% -240px;\n }\n\n .btn-group paper-button.tstrikethrough {\n background-position: 50% -415px;\n }\n\n .btn-group paper-button[active] {\n border-color: #f2471c;\n }\n\n .line-type paper-listbox {\n overflow: hidden;\n max-width: 100px;\n }\n .line-type paper-item {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat;\n min-height: 25px;\n padding: 3px 9px;\n width: 80px;\n }\n\n .line-type paper-item.solid {\n background-position: 50% 10px;\n }\n .line-type paper-item.round-dot {\n background-position: 50% -40px;\n }\n .line-type paper-item.square-dot {\n background-position: 50% -90px;\n }\n .line-type paper-item.dash {\n background-position: 50% -140px;\n }\n .line-type paper-item.dash-dot {\n background-position: 50% -190px;\n }\n .line-type paper-item.long-dash {\n background-position: 50% -240px;\n }\n .line-type paper-item.long-dash-dot {\n background-position: 50% -290px;\n }\n .line-type paper-item.long-dash-dot-dot {\n background-position: 50% -340px;\n }\n\n .line-type .paper-input-container input {\n background: var(--url-icon-properties-line-type) 50% 0 no-repeat !important;\n }\n .line-type.solid .paper-input-container input {\n background-position: 50% 5px !important;\n }\n .line-type.round-dot .paper-input-container input {\n background-position: 50% -45px !important;\n }\n .line-type.square-dot .paper-input-container input {\n background-position: 50% -85px !important;\n }\n .line-type.dash .paper-input-container input {\n background-position: 50% -145px !important;\n }\n .line-type.dash-dot .paper-input-container input {\n background-position: 50% -185px !important;\n }\n .line-type.long-dash .paper-input-container input {\n background-position: 50% -245px !important;\n }\n .line-type.long-dash-dot .paper-input-container input {\n background-position: 50% -285px !important;\n }\n .line-type.long-dash-dot-dot .paper-input-container input {\n background-position: 50% -345px !important;\n }\n\n .arrow-type paper-menu {\n overflow: hidden;\n max-width: 140px;\n }\n .arrow-type paper-item {\n background: var(--url-icon-properties-arrow-type) 50% 0 no-repeat;\n min-height: 30px;\n padding: 3px 7px;\n width: 30px;\n float: left;\n }\n .arrow-type paper-item.begin-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.begin-arrow {\n background-position: 50% -39px;\n }\n .arrow-type paper-item.begin-open-arrow {\n background-position: 50% -89px;\n }\n .arrow-type paper-item.begin-stealth-arrow {\n background-position: 50% -139px;\n }\n .arrow-type paper-item.begin-diamond-arrow {\n background-position: 50% -190px;\n }\n .arrow-type paper-item.begin-oval-arrow {\n background-position: 50% -238px;\n }\n .arrow-type paper-item.begin-size1 {\n background-position: 50% -286px;\n }\n .arrow-type paper-item.begin-size2 {\n background-position: 50% -336px;\n }\n .arrow-type paper-item.begin-size3 {\n background-position: 50% -386px;\n }\n .arrow-type paper-item.begin-size4 {\n background-position: 50% -436px;\n }\n .arrow-type paper-item.begin-size5 {\n background-position: 50% -486px;\n }\n .arrow-type paper-item.begin-size6 {\n background-position: 50% -536px;\n }\n .arrow-type paper-item.begin-size7 {\n background-position: 50% -589px;\n }\n .arrow-type paper-item.begin-size8 {\n background-position: 50% -639px;\n }\n .arrow-type paper-item.begin-size9 {\n background-position: 50% -689px;\n }\n .arrow-type paper-item.end-no {\n background-position: 50% 16px;\n }\n .arrow-type paper-item.end-arrow {\n background-position: 50% -739px;\n }\n .arrow-type paper-item.end-open-arrow {\n background-position: 50% -789px;\n }\n .arrow-type paper-item.end-stealth-arrow {\n background-position: 50% -839px;\n }\n .arrow-type paper-item.end-diamond-arrow {\n background-position: 50% -890px;\n }\n .arrow-type paper-item.end-oval-arrow {\n background-position: 50% -938px;\n }\n .arrow-type paper-item.end-size1 {\n background-position: 50% -986px;\n }\n .arrow-type paper-item.end-size2 {\n background-position: 50% -1036px;\n }\n .arrow-type paper-item.end-size3 {\n background-position: 50% -1086px;\n }\n .arrow-type paper-item.end-size4 {\n background-position: 50% -1136px;\n }\n .arrow-type paper-item.end-size5 {\n background-position: 50% -1186px;\n }\n .arrow-type paper-item.end-size6 {\n background-position: 50% -1236px;\n }\n .arrow-type paper-item.end-size7 {\n background-position: 50% -1289px;\n }\n .arrow-type paper-item.end-size8 {\n background-position: 50% -1339px;\n }\n .arrow-type paper-item.end-size9 {\n background-position: 50% -1389px;\n }\n\n .arrow-type .paper-input-container input {\n background: var(--url-icon-properties-arrow-type) 110% 0 no-repeat !important;\n }\n .arrow-type.begin-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.begin-arrow .paper-input-container input {\n background-position: 110% -50px !important;\n }\n .arrow-type.begin-open-arrow .paper-input-container input {\n background-position: 110% -100px !important;\n }\n .arrow-type.begin-stealth-arrow .paper-input-container input {\n background-position: 110% -150px !important;\n }\n .arrow-type.begin-diamond-arrow .paper-input-container input {\n background-position: 110% -200px !important;\n }\n .arrow-type.begin-oval-arrow .paper-input-container input {\n background-position: 110% -250px !important;\n }\n .arrow-type.begin-size1 .paper-input-container input {\n background-position: 110% -298px !important;\n }\n .arrow-type.begin-size2 .paper-input-container input {\n background-position: 110% -348px !important;\n }\n .arrow-type.begin-size3 .paper-input-container input {\n background-position: 110% -398px !important;\n }\n .arrow-type.begin-size4 .paper-input-container input {\n background-position: 110% -448px !important;\n }\n .arrow-type.begin-size5 .paper-input-container input {\n background-position: 110% -498px !important;\n }\n .arrow-type.begin-size6 .paper-input-container input {\n background-position: 110% -548px !important;\n }\n .arrow-type.begin-size7 .paper-input-container input {\n background-position: 110% -600px !important;\n }\n .arrow-type.begin-size8 .paper-input-container input {\n background-position: 110% -650px !important;\n }\n .arrow-type.begin-size9 .paper-input-container input {\n background-position: 110% -700px !important;\n }\n .arrow-type.end-no .paper-input-container input {\n background-position: 110% 5px !important;\n }\n .arrow-type.end-arrow .paper-input-container input {\n background-position: 110% -750px !important;\n }\n .arrow-type.end-open-arrow .paper-input-container input {\n background-position: 110% -800px !important;\n }\n .arrow-type.end-stealth-arrow .paper-input-container input {\n background-position: 110% -850px !important;\n }\n .arrow-type.end-diamond-arrow .paper-input-container input {\n background-position: 110% -900px !important;\n }\n .arrow-type.end-oval-arrow .paper-input-container input {\n background-position: 110% -950px !important;\n }\n .arrow-type.end-size1 .paper-input-container input {\n background-position: 110% -998px !important;\n }\n .arrow-type.end-size2 .paper-input-container input {\n background-position: 110% -1048px !important;\n }\n .arrow-type.end-size3 .paper-input-container input {\n background-position: 110% -1098px !important;\n }\n .arrow-type.end-size4 .paper-input-container input {\n background-position: 110% -1148px !important;\n }\n .arrow-type.end-size5 .paper-input-container input {\n background-position: 110% -1198px !important;\n }\n .arrow-type.end-size6 .paper-input-container input {\n background-position: 110% -1248px !important;\n }\n .arrow-type.end-size7 .paper-input-container input {\n background-position: 110% -1300px !important;\n }\n .arrow-type.end-size8 .paper-input-container input {\n background-position: 110% -1350px !important;\n }\n .arrow-type.end-size9 .paper-input-container input {\n background-position: 110% -1400px !important;\n }\n `\n ]\n @property({ type: Object }) value: any = {}\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) fonts: any[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n var {\n alpha,\n fontFamily,\n fontSize,\n lineHeight,\n fontColor,\n bold,\n italic,\n fillStyle,\n lineWidth,\n strokeStyle,\n lineDash,\n lineCap,\n lineJoin,\n begin,\n beginSize,\n end,\n endSize\n } = this.value || {}\n\n return html`\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/opacity\" msgid=\"label.opacity\">opacity</ox-title-with-help>\n </legend>\n <paper-slider min=\"0\" max=\"1\" step=\"0.1\" value-key=\"alpha\" .value=${alpha || 1} editable> </paper-slider>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/text-style\" msgid=\"label.text-style\"\n >text style</ox-title-with-help\n >\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.font-family\">Font Family</ox-i18n>\n </label>\n\n <things-editor-font-selector\n value-key=\"fontFamily\"\n .value=${fontFamily}\n class=\"property-full-input\"\n custom-editor\n ></things-editor-font-selector>\n\n <label class=\"property-half-label icon-only-label font-size\"></label>\n <input type=\"number\" value-key=\"fontSize\" .value=${fontSize} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label lineHeight\"></label>\n <input type=\"number\" value-key=\"lineHeight\" .value=${lineHeight} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <things-editor-color value-key=\"fontColor\" .value=${fontColor} class=\"property-half-input\">\n </things-editor-color>\n\n <label class=\"property-half-label\"></label>\n <div class=\"property-half-input btn-group\">\n <paper-button toggles value-key=\"bold\" ?active=${bold} class=\"tbold\"> </paper-button>\n <paper-button toggles value-key=\"italic\" ?active=${italic} class=\"titalic\"> </paper-button>\n </div>\n </div>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help topic=\"board-modeller/styles/fill-style\" msgid=\"label.fill-style\"\n >fill style</ox-title-with-help\n >\n </legend>\n\n <things-editor-color-style value-key=\"fillStyle\" .value=${fillStyle}> </things-editor-color-style>\n </fieldset>\n\n <fieldset>\n <legend>\n <ox-title-with-help msgid=\"label.line-style\" topic=\"board-modeller/styles/line-style\"></ox-title-with-help>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"property-half-label icon-only-label linewidth\"></label>\n <input type=\"number\" value-key=\"lineWidth\" .value=${lineWidth} class=\"property-half-input\" />\n\n <label class=\"property-half-label icon-only-label color\"></label>\n <things-editor-color value-key=\"strokeStyle\" .value=${strokeStyle} class=\"property-half-input\">\n </things-editor-color>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.line-type\">line type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input line-type solid\">\n <!-- solid는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"lineDash\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${lineDash}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"solid\" name=\"solid\"></paper-item>\n <paper-item class=\"round-dot\" name=\"round-dot\"></paper-item>\n <paper-item class=\"square-dot\" name=\"square-dot\"></paper-item>\n <paper-item class=\"dash\" name=\"dash\"></paper-item>\n <paper-item class=\"dash-dot\" name=\"dash-dot\"></paper-item>\n <paper-item class=\"long-dash\" name=\"long-dash\"></paper-item>\n <paper-item class=\"long-dash-dot\" name=\"long-dash-dot\"></paper-item>\n <paper-item class=\"long-dash-dot-dot\" name=\"long-dash-dot-dot\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.cap-type\">cap type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineCap\" .value=${lineCap}>\n <option value=\"butt\"><ox-i18n msgid=\"label.square\">square</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n </select>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.join-type\">join type</ox-i18n>\n </label>\n <select class=\"property-full-input select-content\" value-key=\"lineJoin\" .value=${lineJoin}>\n <option value=\"miter\"><ox-i18n msgid=\"label.miter\">miter</ox-i18n></option>\n <option value=\"round\"><ox-i18n msgid=\"label.round\">round</ox-i18n></option>\n <option value=\"bevel\"><ox-i18n msgid=\"label.bevel\">bevel</ox-i18n></option>\n </select>\n\n ${this._isLine(this.selected)\n ? html`\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-type\">begin type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-no\">\n <!-- begin-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"begin\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${begin}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-no\" name=\"none\"></paper-item>\n <paper-item class=\"begin-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"begin-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"begin-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"begin-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"begin-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.begin-size\">begin size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type begin-size1\">\n <!-- begin-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"beginSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${beginSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"begin-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"begin-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"begin-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"begin-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"begin-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"begin-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"begin-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"begin-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"begin-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-type\">end type</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-no\">\n <!-- end-no는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"end\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${end}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-no\" name=\"none\"></paper-item>\n <paper-item class=\"end-arrow\" name=\"arrow\"></paper-item>\n <paper-item class=\"end-open-arrow\" name=\"open-arrow\"></paper-item>\n <paper-item class=\"end-stealth-arrow\" name=\"sharp-arrow\"></paper-item>\n <paper-item class=\"end-diamond-arrow\" name=\"diamond\"></paper-item>\n <paper-item class=\"end-oval-arrow\" name=\"oval\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n\n <label class=\"property-full-label\">\n <ox-i18n msgid=\"label.end-size\">end size</ox-i18n>\n </label>\n <paper-dropdown-menu no-label-float=\"true\" class=\"property-full-input arrow-type end-size1\">\n <!-- end-size1는 선택된 항목 보여주기위한 class로 하위 paper-item의 class와 동일하게 -->\n <paper-listbox\n value-key=\"endSize\"\n @selected-changed=${(e: CustomEvent) => this._onValueChange(e)}\n slot=\"dropdown-content\"\n .selected=${endSize}\n attr-for-selected=\"name\"\n >\n <paper-item class=\"end-size1\" name=\"size1\"></paper-item>\n <paper-item class=\"end-size2\" name=\"size2\"></paper-item>\n <paper-item class=\"end-size3\" name=\"size3\"></paper-item>\n <paper-item class=\"end-size4\" name=\"size4\"></paper-item>\n <paper-item class=\"end-size5\" name=\"size5\"></paper-item>\n <paper-item class=\"end-size6\" name=\"size6\"></paper-item>\n <paper-item class=\"end-size7\" name=\"size7\"></paper-item>\n <paper-item class=\"end-size8\" name=\"size8\"></paper-item>\n <paper-item class=\"end-size9\" name=\"size9\"></paper-item>\n </paper-listbox>\n </paper-dropdown-menu>\n `\n : html``}\n </div>\n </fieldset>\n `\n }\n\n _isLine(selected: Component[]) {\n var isLine = false\n\n for (var i = 0; i < selected.length; i++) {\n var comp = selected[i]\n\n if (!comp.isLine || !comp.isLine()) {\n isLine = false\n return isLine\n }\n\n isLine = true\n }\n\n return isLine\n }\n}\n"]}
|
|
@@ -33,7 +33,7 @@ export declare class BoardViewer extends LitElement {
|
|
|
33
33
|
onTapNext(): void;
|
|
34
34
|
onTapPrev(): void;
|
|
35
35
|
onTapFullscreen(): void;
|
|
36
|
-
onLinkGoto(targetBoardId: string,
|
|
36
|
+
onLinkGoto(targetBoardId: string, options: any, fromComponent: any): void;
|
|
37
37
|
onLinkOpen(url: string, value: any, fromComponent: any): void;
|
|
38
38
|
onLinkMove(url: string, value: any, fromComponent: any): void;
|
|
39
39
|
onRoutePage(page: string): void;
|
|
@@ -241,8 +241,11 @@ let BoardViewer = class BoardViewer extends LitElement {
|
|
|
241
241
|
onTapFullscreen() {
|
|
242
242
|
togglefullscreen(this, () => this.requestUpdate(), () => this.requestUpdate());
|
|
243
243
|
}
|
|
244
|
-
onLinkGoto(targetBoardId,
|
|
245
|
-
|
|
244
|
+
onLinkGoto(targetBoardId, options, fromComponent) {
|
|
245
|
+
var _a;
|
|
246
|
+
const { input, output } = options || { input: '(self)' };
|
|
247
|
+
const data = input && ((_a = fromComponent.root.findFirst(input, fromComponent)) === null || _a === void 0 ? void 0 : _a.data);
|
|
248
|
+
this.showScene(targetBoardId, data);
|
|
246
249
|
}
|
|
247
250
|
onLinkOpen(url, value, fromComponent) {
|
|
248
251
|
if (!url)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-board-viewer.js","sourceRoot":"","sources":["../../src/ox-board-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGxD,IAAa,WAAW,GAAxB,MAAa,WAAY,SAAQ,UAAU;IAA3C;;QAuF8B,YAAO,GAAW,EAAE,CAAA;QACpB,UAAK,GAAQ,EAAE,CAAA;QACf,aAAQ,GAAQ,IAAI,CAAA;QAG0B,mBAAc,GAAG,KAAK,CAAA;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AA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAU;AAEqC;IAAzE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAAuB;AACtB;IAAzE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;mDAAuB;AAEvF;IAAR,KAAK,EAAE;2CAAmB;AAClB;IAAR,KAAK,EAAE;6CAA0B;AACzB;IAAR,KAAK,EAAE;8CAA2B;AAE1B;IAAR,KAAK,EAAE;+CAAyB;AACxB;IAAR,KAAK,EAAE;qDAAoC;AAE1B;IAAjB,KAAK,CAAC,SAAS,CAAC;4CAAsB;AACvB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAoB;AACnB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAoB;AACb;IAArB,KAAK,CAAC,aAAa,CAAC;gDAA0B;AAzGpC,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAqfvB;SArfY,WAAW","sourcesContent":["import '@material/mwc-fab'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { create, SCENE_MODE } from '@hatiolab/things-scene'\nimport { isIOS, togglefullscreen } from '@operato/utils'\n\n@customElement('ox-board-viewer')\nexport class BoardViewer extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n\n position: relative;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n overflow: hidden;\n }\n\n #target {\n flex: 1;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n height: 100%;\n\n outline: 0;\n }\n\n /* navigation buttons */\n mwc-icon {\n z-index: 10;\n position: absolute;\n top: 45%;\n min-width: 50px;\n width: 50px;\n height: 50px;\n margin: 0;\n padding: 0;\n color: #fff;\n user-select: none;\n\n --mdc-icon-size: 3em;\n }\n\n mwc-icon[hidden] {\n display: none;\n }\n\n mwc-icon:hover {\n background-color: rgba(0, 0, 0, 0.2);\n border-radius: 50%;\n }\n\n #prev {\n left: 5px;\n }\n\n #next {\n right: 5px;\n }\n\n #fullscreen {\n position: absolute;\n bottom: 15px;\n right: 16px;\n }\n\n /* for scroller */\n ::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n ::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: #aa866a;\n }\n\n [hidden] {\n display: none;\n }\n\n @media print {\n mwc-fab,\n mwc-icon {\n display: none;\n }\n }\n `\n\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) board: any = {}\n @property({ type: Object }) provider: any = null\n @property({ type: Object }) data: any\n\n @property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' }) hideFullscreen = false\n @property({ type: Boolean, reflect: true, attribute: 'hide-navigation' }) hideNavigation = false\n\n @state() _scene: any = null\n @state() _forward: Array<any> = []\n @state() _backward: Array<any> = []\n\n @state() _oldtarget?: HTMLElement\n @state() _fade_animations?: Array<Animation>\n\n @query('#target') _target!: HTMLElement\n @query('#prev') _prev!: HTMLElement\n @query('#next') _next!: HTMLElement\n @query('#fullscreen') _fullscreen!: HTMLElement\n\n render() {\n var fullscreen =\n !isIOS() && !this.hideFullscreen\n ? html`\n <mwc-fab\n id=\"fullscreen\"\n .icon=${document.fullscreenElement ? 'fullscreen_exit' : 'fullscreen'}\n @click=${(e: Event) => this.onTapFullscreen()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n title=\"fullscreen\"\n ></mwc-fab>\n `\n : html``\n\n var prev = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"prev\"\n @click=${(e: Event) => this.onTapPrev()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_left</mwc-icon\n >\n `\n : html``\n\n var next = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"next\"\n @click=${(e: Event) => this.onTapNext()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_right</mwc-icon\n >\n `\n : html``\n\n return html`\n ${prev}\n\n <div\n id=\"target\"\n @touchstart=${(e: Event) => this.transientShowButtons()}\n @mousemove=${(e: Event) => this.transientShowButtons()}\n ></div>\n\n ${next} ${fullscreen}\n `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n window.addEventListener('resize', () => {\n this._scene && this._scene.fit()\n })\n\n this.renderRoot.addEventListener(\n 'close-scene',\n e => {\n e.preventDefault()\n this.onTapPrev()\n },\n false\n )\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.closeScene()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('board')) {\n this.closeScene()\n\n if (this.board && this.board.id) {\n this.initScene()\n }\n }\n\n if (changes.has('data') && this._scene && this.data) {\n this._scene.data = this.data\n }\n }\n\n initScene() {\n if (!this.board || !this.board.id) return\n\n this._scene = create({\n model: {\n ...this.board.model\n },\n mode: SCENE_MODE.VIEW,\n refProvider: this.provider\n })\n\n if (this.baseUrl) {\n this._scene.baseUrl = this.baseUrl\n }\n\n this.provider.add(this.board.id, this._scene)\n\n this.setupScene(this._scene)\n }\n\n closeScene() {\n if (this._scene) {\n this.unbindSceneEvents(this._scene)\n\n this._scene.target = null\n this._scene.release()\n\n this._scene = null\n }\n\n // delete queued scenes\n this._forward.forEach(scene => scene.release())\n this._forward = []\n\n this._backward.forEach(scene => scene.release())\n this._backward = []\n }\n\n releaseScene() {\n this.closeScene()\n this.transientShowButtons()\n }\n\n setupScene(scene: any) {\n this._scene = scene\n\n /* scene의 기존 target을 보관한다. */\n this._oldtarget = this._scene.target\n\n this._scene.fit(this.board.model.fitMode)\n this._scene.target = this._target\n\n if (this.data) {\n this._scene.data = this.data\n }\n\n this.bindSceneEvents()\n\n this.transientShowButtons()\n }\n\n async showScene(boardId: string, bindingData?: any) {\n if (!boardId) return\n\n try {\n var scene = await this.provider.get(boardId, true)\n\n if (scene === this._scene) {\n scene.release()\n return\n }\n\n if (this._scene) {\n /* old scene을 _backward에 보관한다. */\n this.unbindSceneEvents(this._scene)\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this._backward.push(this._scene)\n }\n\n this._scene = scene\n\n this._forward.forEach(scene => scene.release())\n\n /* forward를 비운다. */\n this._forward = []\n\n this.setupScene(scene)\n\n if (bindingData) {\n scene.data = bindingData\n }\n } catch (e) {\n console.error(e)\n }\n }\n\n bindSceneEvents() {\n this._scene.on('goto', this.onLinkGoto, this)\n this._scene.on('link-open', this.onLinkOpen, this)\n this._scene.on('link-move', this.onLinkMove, this)\n this._scene.on('route-page', this.onRoutePage, this)\n }\n\n unbindSceneEvents(scene: any) {\n scene.off('goto', this.onLinkGoto, this)\n scene.off('link-open', this.onLinkOpen, this)\n scene.off('link-move', this.onLinkMove, this)\n scene.off('route-page', this.onRoutePage, this)\n }\n\n transientShowButtons(stop?: boolean) {\n var buttons = []\n !this.hideNavigation && buttons.push(this._next, this._prev)\n !this.hideFullscreen && buttons.push(this._fullscreen)\n\n if (buttons.length == 0) {\n return\n }\n\n if (!this._fade_animations) {\n this._fade_animations = buttons\n .filter(button => button)\n .map(button => {\n let animation = button.animate(\n [\n {\n opacity: 1,\n easing: 'ease-in'\n },\n { opacity: 0 }\n ],\n { delay: 1000, duration: 2000 }\n )\n\n animation.onfinish = () => {\n button.setAttribute('hidden', '')\n }\n\n return animation\n })\n }\n\n this._forward.length <= 0 ? this._next.setAttribute('hidden', '') : this._next.removeAttribute('hidden')\n this._backward.length <= 0 ? this._prev.setAttribute('hidden', '') : this._prev.removeAttribute('hidden')\n this._fullscreen && this._fullscreen.removeAttribute('hidden')\n\n this._fade_animations.forEach(animation => {\n animation.cancel()\n if (stop) return\n\n animation.play()\n })\n }\n\n /* event handlers */\n\n onTapNext() {\n var scene = this._forward.pop()\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._backward.push(this._scene)\n }\n\n this.setupScene(scene)\n }\n\n onTapPrev() {\n var scene = this._backward.pop()\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._forward.push(this._scene)\n }\n\n this.setupScene(scene)\n }\n\n onTapFullscreen() {\n togglefullscreen(\n this,\n () => this.requestUpdate(),\n () => this.requestUpdate()\n )\n }\n\n onLinkGoto(targetBoardId: string, value: any, fromComponent: any) {\n this.showScene(targetBoardId, fromComponent.data)\n }\n\n onLinkOpen(url: string, value: any, fromComponent: any) {\n if (!url) return\n\n try {\n window.open(url)\n } catch (ex) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: ex,\n ex\n }\n })\n )\n }\n }\n\n onLinkMove(url: string, value: any, fromComponent: any) {\n if (!url) return\n\n location.href = url\n }\n\n onRoutePage(page: string) {\n if (!page) {\n return\n }\n\n history.pushState({}, '', page)\n window.dispatchEvent(new Event('popstate'))\n }\n\n async getSceneImageData(base64 = false) {\n if (!this._scene) {\n return\n }\n\n var { width, height } = this._scene.model\n var pixelRatio = window.devicePixelRatio\n\n // 1. Scene의 바운드에 근거하여, 오프스크린 캔바스를 만든다.\n var canvas = document.createElement('canvas')\n canvas.width = Number(width)\n canvas.height = Number(height)\n\n var root = this._scene.root\n // 2. 모델레이어의 원래 위치와 스케일을 저장한다.\n var translate = root.get('translate')\n var scale = root.get('scale')\n\n // 3. 위치와 스케일 기본 설정.\n root.set('translate', { x: 0, y: 0 })\n root.set('scale', { x: 1 / pixelRatio, y: 1 / pixelRatio })\n\n // 4. 오프스크린 캔바스의 Context2D를 구한뒤, 모델레이어를 그 위에 그린다.\n var context = canvas.getContext('2d')\n\n root.draw(context)\n\n root.set('translate', translate)\n root.set('scale', scale)\n\n var data = base64 ? canvas.toDataURL() : context!.getImageData(0, 0, width, height).data\n\n return {\n width,\n height,\n data\n }\n }\n\n async printTrick(image: string) {\n var viewTarget: HTMLElement | null = null\n var printTarget: HTMLImageElement | null = null\n\n if (!image) {\n image = (await this.getSceneImageData(true))?.data as string\n }\n\n printTarget = document.createElement('img')\n printTarget.id = 'target'\n printTarget.src = image\n printTarget.style.width = '100%'\n printTarget.style.height = '100%'\n\n const x = (mql: MediaQueryListEvent) => {\n if (mql.matches) {\n if (!viewTarget) {\n viewTarget = this.shadowRoot!.getElementById('target')\n this.renderRoot.replaceChild(printTarget!, viewTarget!)\n }\n } else {\n this.renderRoot.replaceChild(viewTarget!, printTarget!)\n printTarget!.remove()\n mediaQueryList.removeEventListener('change', x)\n }\n }\n\n if (window.matchMedia) {\n var mediaQueryList = window.matchMedia('print')\n mediaQueryList.addEventListener('change', x)\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-board-viewer.js","sourceRoot":"","sources":["../../src/ox-board-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,m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E1B;IAAjB,KAAK,CAAC,SAAS,CAAC;4CAAsB;AACvB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAoB;AACnB;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAoB;AACb;IAArB,KAAK,CAAC,aAAa,CAAC;gDAA0B;AAzGpC,WAAW;IADvB,aAAa,CAAC,iBAAiB,CAAC;GACpB,WAAW,CAufvB;SAvfY,WAAW","sourcesContent":["import '@material/mwc-fab'\nimport '@material/mwc-icon'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { create, SCENE_MODE } from '@hatiolab/things-scene'\nimport { isIOS, togglefullscreen } from '@operato/utils'\n\n@customElement('ox-board-viewer')\nexport class BoardViewer extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n\n position: relative;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n overflow: hidden;\n }\n\n #target {\n flex: 1;\n\n width: 100%; /* 전체화면보기를 위해서 필요함. */\n height: 100%;\n\n outline: 0;\n }\n\n /* navigation buttons */\n mwc-icon {\n z-index: 10;\n position: absolute;\n top: 45%;\n min-width: 50px;\n width: 50px;\n height: 50px;\n margin: 0;\n padding: 0;\n color: #fff;\n user-select: none;\n\n --mdc-icon-size: 3em;\n }\n\n mwc-icon[hidden] {\n display: none;\n }\n\n mwc-icon:hover {\n background-color: rgba(0, 0, 0, 0.2);\n border-radius: 50%;\n }\n\n #prev {\n left: 5px;\n }\n\n #next {\n right: 5px;\n }\n\n #fullscreen {\n position: absolute;\n bottom: 15px;\n right: 16px;\n }\n\n /* for scroller */\n ::-webkit-scrollbar {\n width: 5px;\n height: 5px;\n }\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n ::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.2);\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: #aa866a;\n }\n\n [hidden] {\n display: none;\n }\n\n @media print {\n mwc-fab,\n mwc-icon {\n display: none;\n }\n }\n `\n\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) board: any = {}\n @property({ type: Object }) provider: any = null\n @property({ type: Object }) data: any\n\n @property({ type: Boolean, reflect: true, attribute: 'hide-fullscreen' }) hideFullscreen = false\n @property({ type: Boolean, reflect: true, attribute: 'hide-navigation' }) hideNavigation = false\n\n @state() _scene: any = null\n @state() _forward: Array<any> = []\n @state() _backward: Array<any> = []\n\n @state() _oldtarget?: HTMLElement\n @state() _fade_animations?: Array<Animation>\n\n @query('#target') _target!: HTMLElement\n @query('#prev') _prev!: HTMLElement\n @query('#next') _next!: HTMLElement\n @query('#fullscreen') _fullscreen!: HTMLElement\n\n render() {\n var fullscreen =\n !isIOS() && !this.hideFullscreen\n ? html`\n <mwc-fab\n id=\"fullscreen\"\n .icon=${document.fullscreenElement ? 'fullscreen_exit' : 'fullscreen'}\n @click=${(e: Event) => this.onTapFullscreen()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n title=\"fullscreen\"\n ></mwc-fab>\n `\n : html``\n\n var prev = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"prev\"\n @click=${(e: Event) => this.onTapPrev()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_left</mwc-icon\n >\n `\n : html``\n\n var next = !this.hideNavigation\n ? html`\n <mwc-icon\n id=\"next\"\n @click=${(e: Event) => this.onTapNext()}\n @mouseover=${(e: Event) => this.transientShowButtons(true)}\n @mouseout=${(e: Event) => this.transientShowButtons()}\n hidden\n >keyboard_arrow_right</mwc-icon\n >\n `\n : html``\n\n return html`\n ${prev}\n\n <div\n id=\"target\"\n @touchstart=${(e: Event) => this.transientShowButtons()}\n @mousemove=${(e: Event) => this.transientShowButtons()}\n ></div>\n\n ${next} ${fullscreen}\n `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n window.addEventListener('resize', () => {\n this._scene && this._scene.fit()\n })\n\n this.renderRoot.addEventListener(\n 'close-scene',\n e => {\n e.preventDefault()\n this.onTapPrev()\n },\n false\n )\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.closeScene()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('board')) {\n this.closeScene()\n\n if (this.board && this.board.id) {\n this.initScene()\n }\n }\n\n if (changes.has('data') && this._scene && this.data) {\n this._scene.data = this.data\n }\n }\n\n initScene() {\n if (!this.board || !this.board.id) return\n\n this._scene = create({\n model: {\n ...this.board.model\n },\n mode: SCENE_MODE.VIEW,\n refProvider: this.provider\n })\n\n if (this.baseUrl) {\n this._scene.baseUrl = this.baseUrl\n }\n\n this.provider.add(this.board.id, this._scene)\n\n this.setupScene(this._scene)\n }\n\n closeScene() {\n if (this._scene) {\n this.unbindSceneEvents(this._scene)\n\n this._scene.target = null\n this._scene.release()\n\n this._scene = null\n }\n\n // delete queued scenes\n this._forward.forEach(scene => scene.release())\n this._forward = []\n\n this._backward.forEach(scene => scene.release())\n this._backward = []\n }\n\n releaseScene() {\n this.closeScene()\n this.transientShowButtons()\n }\n\n setupScene(scene: any) {\n this._scene = scene\n\n /* scene의 기존 target을 보관한다. */\n this._oldtarget = this._scene.target\n\n this._scene.fit(this.board.model.fitMode)\n this._scene.target = this._target\n\n if (this.data) {\n this._scene.data = this.data\n }\n\n this.bindSceneEvents()\n\n this.transientShowButtons()\n }\n\n async showScene(boardId: string, bindingData?: any) {\n if (!boardId) return\n\n try {\n var scene = await this.provider.get(boardId, true)\n\n if (scene === this._scene) {\n scene.release()\n return\n }\n\n if (this._scene) {\n /* old scene을 _backward에 보관한다. */\n this.unbindSceneEvents(this._scene)\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this._backward.push(this._scene)\n }\n\n this._scene = scene\n\n this._forward.forEach(scene => scene.release())\n\n /* forward를 비운다. */\n this._forward = []\n\n this.setupScene(scene)\n\n if (bindingData) {\n scene.data = bindingData\n }\n } catch (e) {\n console.error(e)\n }\n }\n\n bindSceneEvents() {\n this._scene.on('goto', this.onLinkGoto, this)\n this._scene.on('link-open', this.onLinkOpen, this)\n this._scene.on('link-move', this.onLinkMove, this)\n this._scene.on('route-page', this.onRoutePage, this)\n }\n\n unbindSceneEvents(scene: any) {\n scene.off('goto', this.onLinkGoto, this)\n scene.off('link-open', this.onLinkOpen, this)\n scene.off('link-move', this.onLinkMove, this)\n scene.off('route-page', this.onRoutePage, this)\n }\n\n transientShowButtons(stop?: boolean) {\n var buttons = []\n !this.hideNavigation && buttons.push(this._next, this._prev)\n !this.hideFullscreen && buttons.push(this._fullscreen)\n\n if (buttons.length == 0) {\n return\n }\n\n if (!this._fade_animations) {\n this._fade_animations = buttons\n .filter(button => button)\n .map(button => {\n let animation = button.animate(\n [\n {\n opacity: 1,\n easing: 'ease-in'\n },\n { opacity: 0 }\n ],\n { delay: 1000, duration: 2000 }\n )\n\n animation.onfinish = () => {\n button.setAttribute('hidden', '')\n }\n\n return animation\n })\n }\n\n this._forward.length <= 0 ? this._next.setAttribute('hidden', '') : this._next.removeAttribute('hidden')\n this._backward.length <= 0 ? this._prev.setAttribute('hidden', '') : this._prev.removeAttribute('hidden')\n this._fullscreen && this._fullscreen.removeAttribute('hidden')\n\n this._fade_animations.forEach(animation => {\n animation.cancel()\n if (stop) return\n\n animation.play()\n })\n }\n\n /* event handlers */\n\n onTapNext() {\n var scene = this._forward.pop()\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._backward.push(this._scene)\n }\n\n this.setupScene(scene)\n }\n\n onTapPrev() {\n var scene = this._backward.pop()\n if (!scene) return\n\n if (this._scene) {\n this._scene.target = null\n /* 원래의 target에 되돌린다. */\n this._scene.target = this._oldtarget\n this.unbindSceneEvents(this._scene)\n this._forward.push(this._scene)\n }\n\n this.setupScene(scene)\n }\n\n onTapFullscreen() {\n togglefullscreen(\n this,\n () => this.requestUpdate(),\n () => this.requestUpdate()\n )\n }\n\n onLinkGoto(targetBoardId: string, options: any, fromComponent: any) {\n const { input, output } = options || { input: '(self)' }\n const data = input && fromComponent.root.findFirst(input, fromComponent)?.data\n this.showScene(targetBoardId, data)\n }\n\n onLinkOpen(url: string, value: any, fromComponent: any) {\n if (!url) return\n\n try {\n window.open(url)\n } catch (ex) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level: 'error',\n message: ex,\n ex\n }\n })\n )\n }\n }\n\n onLinkMove(url: string, value: any, fromComponent: any) {\n if (!url) return\n\n location.href = url\n }\n\n onRoutePage(page: string) {\n if (!page) {\n return\n }\n\n history.pushState({}, '', page)\n window.dispatchEvent(new Event('popstate'))\n }\n\n async getSceneImageData(base64 = false) {\n if (!this._scene) {\n return\n }\n\n var { width, height } = this._scene.model\n var pixelRatio = window.devicePixelRatio\n\n // 1. Scene의 바운드에 근거하여, 오프스크린 캔바스를 만든다.\n var canvas = document.createElement('canvas')\n canvas.width = Number(width)\n canvas.height = Number(height)\n\n var root = this._scene.root\n // 2. 모델레이어의 원래 위치와 스케일을 저장한다.\n var translate = root.get('translate')\n var scale = root.get('scale')\n\n // 3. 위치와 스케일 기본 설정.\n root.set('translate', { x: 0, y: 0 })\n root.set('scale', { x: 1 / pixelRatio, y: 1 / pixelRatio })\n\n // 4. 오프스크린 캔바스의 Context2D를 구한뒤, 모델레이어를 그 위에 그린다.\n var context = canvas.getContext('2d')\n\n root.draw(context)\n\n root.set('translate', translate)\n root.set('scale', scale)\n\n var data = base64 ? canvas.toDataURL() : context!.getImageData(0, 0, width, height).data\n\n return {\n width,\n height,\n data\n }\n }\n\n async printTrick(image: string) {\n var viewTarget: HTMLElement | null = null\n var printTarget: HTMLImageElement | null = null\n\n if (!image) {\n image = (await this.getSceneImageData(true))?.data as string\n }\n\n printTarget = document.createElement('img')\n printTarget.id = 'target'\n printTarget.src = image\n printTarget.style.width = '100%'\n printTarget.style.height = '100%'\n\n const x = (mql: MediaQueryListEvent) => {\n if (mql.matches) {\n if (!viewTarget) {\n viewTarget = this.shadowRoot!.getElementById('target')\n this.renderRoot.replaceChild(printTarget!, viewTarget!)\n }\n } else {\n this.renderRoot.replaceChild(viewTarget!, printTarget!)\n printTarget!.remove()\n mediaQueryList.removeEventListener('change', x)\n }\n }\n\n if (window.matchMedia) {\n var mediaQueryList = window.matchMedia('print')\n mediaQueryList.addEventListener('change', x)\n }\n }\n}\n"]}
|