@fmsim/board 2.0.0-beta.8 → 2.0.0-beta.81

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.
Files changed (85) hide show
  1. package/custom-elements.json +5568 -3044
  2. package/demo/index-modeller.html +1 -1
  3. package/demo/index-player.html +2 -2
  4. package/demo/index-viewer.html +2 -2
  5. package/demo/index.html +2 -2
  6. package/dist/src/component/etc.js +35 -0
  7. package/dist/src/component/etc.js.map +1 -1
  8. package/dist/src/component/index.d.ts +1 -0
  9. package/dist/src/component/index.js +1 -0
  10. package/dist/src/component/index.js.map +1 -1
  11. package/dist/src/component/restful-property-editor-backdrop-faces.d.ts +50 -0
  12. package/dist/src/component/restful-property-editor-backdrop-faces.js +524 -0
  13. package/dist/src/component/restful-property-editor-backdrop-faces.js.map +1 -0
  14. package/dist/src/data-storage/board-model-cache.d.ts +13 -0
  15. package/dist/src/data-storage/board-model-cache.js +66 -0
  16. package/dist/src/data-storage/board-model-cache.js.map +1 -0
  17. package/dist/src/index.d.ts +3 -0
  18. package/dist/src/index.js +2 -0
  19. package/dist/src/index.js.map +1 -1
  20. package/dist/src/layers/movement-layer.d.ts +4 -4
  21. package/dist/src/layers/movement-layer.js +16 -8
  22. package/dist/src/layers/movement-layer.js.map +1 -1
  23. package/dist/src/modeller/bulk-create-dialog.d.ts +51 -0
  24. package/dist/src/modeller/bulk-create-dialog.js +531 -0
  25. package/dist/src/modeller/bulk-create-dialog.js.map +1 -0
  26. package/dist/src/modeller/bulk-create.d.ts +101 -0
  27. package/dist/src/modeller/bulk-create.js +199 -0
  28. package/dist/src/modeller/bulk-create.js.map +1 -0
  29. package/dist/src/modeller/component-toolbar/component-menu.d.ts +1 -1
  30. package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +1 -1
  31. package/dist/src/modeller/edit-toolbar-style.js +43 -3
  32. package/dist/src/modeller/edit-toolbar-style.js.map +1 -1
  33. package/dist/src/modeller/edit-toolbar.d.ts +13 -0
  34. package/dist/src/modeller/edit-toolbar.js +168 -7
  35. package/dist/src/modeller/edit-toolbar.js.map +1 -1
  36. package/dist/src/modeller/property-sidebar/abstract-property.js +10 -2
  37. package/dist/src/modeller/property-sidebar/abstract-property.js.map +1 -1
  38. package/dist/src/modeller/property-sidebar/data-binding/data-binding.d.ts +1 -1
  39. package/dist/src/modeller/property-sidebar/effects/effects.d.ts +1 -1
  40. package/dist/src/modeller/property-sidebar/effects/property-event.d.ts +1 -1
  41. package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +1 -1
  42. package/dist/src/modeller/property-sidebar/shapes/shapes.js +31 -0
  43. package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -1
  44. package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +2 -1
  45. package/dist/src/modeller/property-sidebar/specifics/specifics.js +10 -0
  46. package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -1
  47. package/dist/src/modeller/property-sidebar/styles/styles.d.ts +1 -1
  48. package/dist/src/modeller/scene-viewer/ox-scene-layer.d.ts +4 -3
  49. package/dist/src/modeller/scene-viewer/ox-scene-layer.js +2 -1
  50. package/dist/src/modeller/scene-viewer/ox-scene-layer.js.map +1 -1
  51. package/dist/src/modeller/scene-viewer/ox-scene-viewer.d.ts +2 -1
  52. package/dist/src/modeller/scene-viewer/ox-scene-viewer.js +5 -1
  53. package/dist/src/modeller/scene-viewer/ox-scene-viewer.js.map +1 -1
  54. package/dist/src/ox-board-component-info.d.ts +1 -0
  55. package/dist/src/ox-board-component-info.js +5 -1
  56. package/dist/src/ox-board-component-info.js.map +1 -1
  57. package/dist/src/ox-board-list.js +2 -2
  58. package/dist/src/ox-board-list.js.map +1 -1
  59. package/dist/src/ox-board-modeller.d.ts +6 -3
  60. package/dist/src/ox-board-modeller.js +13 -1
  61. package/dist/src/ox-board-modeller.js.map +1 -1
  62. package/dist/src/ox-board-viewer.d.ts +65 -13
  63. package/dist/src/ox-board-viewer.js +610 -98
  64. package/dist/src/ox-board-viewer.js.map +1 -1
  65. package/dist/src/ox-editor-board-selector.d.ts +3 -0
  66. package/dist/src/ox-editor-board-selector.js +38 -9
  67. package/dist/src/ox-editor-board-selector.js.map +1 -1
  68. package/dist/src/ox-playback-controls.d.ts +157 -0
  69. package/dist/src/ox-playback-controls.js +1089 -0
  70. package/dist/src/ox-playback-controls.js.map +1 -0
  71. package/dist/src/playback/playback-engine.d.ts +106 -0
  72. package/dist/src/playback/playback-engine.js +395 -0
  73. package/dist/src/playback/playback-engine.js.map +1 -0
  74. package/dist/src/selector/board-creation-popup.js +2 -2
  75. package/dist/src/selector/board-creation-popup.js.map +1 -1
  76. package/dist/src/selector/board-thumbnail-card.js +6 -6
  77. package/dist/src/selector/board-thumbnail-card.js.map +1 -1
  78. package/dist/src/selector/ox-board-creation-card.js +2 -2
  79. package/dist/src/selector/ox-board-creation-card.js.map +1 -1
  80. package/dist/src/selector/ox-board-selector.js +21 -10
  81. package/dist/src/selector/ox-board-selector.js.map +1 -1
  82. package/dist/tsconfig.tsbuildinfo +1 -1
  83. package/icons/components/text.png +0 -0
  84. package/icons/icon-htoolbar.png +0 -0
  85. package/package.json +8 -4
@@ -1 +1 @@
1
- {"version":3,"file":"shapes.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/shapes/shapes.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kCAAkC,CAAA;AACzC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,4BAA4B,CAAA;AACnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAI/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,E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6CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA6B;AAC7B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-angle.js'\nimport '@operato/input/ox-buttons-radio.js'\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { PropertySharedStyle } from '../property-shared-style'\nimport { BoxPaddingEditorStyles } from './box-padding-editor-styles'\n\nexport class PropertyShapes extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n BoxPaddingEditorStyles,\n css`\n fieldset[collapsable] legend {\n box-sizing: border-box;\n width: 100%;\n }\n\n fieldset[collapsable] legend md-icon {\n float: right;\n font-size: medium;\n margin: 0;\n cursor: pointer;\n }\n\n fieldset[collapsable][collapsed] > :not(legend) {\n display: none;\n }\n `,\n css`\n .icon-label label {\n background: var(--url-icon-properties-label) 7px -900px no-repeat;\n }\n\n .icon-label label.width {\n background-position: 7px -96px;\n }\n\n .icon-label label.height {\n background-position: 7px 4px;\n }\n\n .icon-label label.rotate {\n background-position: 7px -198px;\n }\n\n .icon-label label.twidth {\n background-position: 7px -296px;\n }\n\n .icon-label label.theight {\n background-position: 7px -396px;\n }\n\n .icon-label label.zPos {\n background-position: 5px -1098px;\n }\n\n .icon-label label.depth {\n background-position: 5px -1198px;\n }\n\n .icon-label label.rotationX {\n background-position: 5px -1296px;\n }\n\n .icon-label label.rotationY {\n background-position: 5px -1396px;\n }\n\n .icon-label label.rotationZ {\n background-position: 5px -1496px;\n }\n\n ox-buttons-radio > * {\n width: 30px;\n height: 25px;\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\n ox-buttons-radio div {\n background: var(--url-icon-properties) no-repeat;\n }\n\n ox-buttons-radio div[data-value='left'] {\n background-position: 50% 3px;\n }\n\n ox-buttons-radio div[data-value='center'] {\n background-position: 50% -47px;\n }\n\n ox-buttons-radio div[data-value='right'] {\n background-position: 50% -97px;\n }\n\n ox-buttons-radio div[data-value='justify'] {\n background-position: 50% -147px;\n }\n\n ox-buttons-radio div[data-value='top'] {\n background-position: 50% -197px;\n }\n\n ox-buttons-radio div[data-value='middle'] {\n background-position: 50% -193px;\n }\n\n ox-buttons-radio div[data-value='bottom'] {\n background-position: 50% -188px;\n }\n\n ox-buttons-radio div[active] {\n border-color: #f2471c;\n }\n `\n ]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) bounds: BOUNDS | null = null\n @property({ type: Array }) selected: Component[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n const value = this.value || {}\n const { width, height } = this.bounds || {}\n\n return html`\n <fieldset>\n <div class=\"property-grid\">\n ${this._isIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.id\">ID</ox-i18n> </label>\n <input value-key=\"id\" .value=${value.id || ''} />\n `\n : html``}\n ${this._isClassIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.class\">Class</ox-i18n> </label>\n <input value-key=\"class\" .value=${value.class || ''} />\n `\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.text\">Text</ox-i18n> </label>\n <input value-key=\"text\" .value=${value.text || ''} />\n <label> <ox-i18n msgid=\"label.text-format\">Text Format</ox-i18n> </label>\n <input value-key=\"textFormat\" .value=${value.textFormat || ''} list=\"format-list\" />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n `\n : html``}\n ${this._hasProperties(this.selected)\n ? html`\n <div class=\"checkbox-row\">\n <input id=\"checkbox-hidden\" value-key=\"hidden\" type=\"checkbox\" .checked=${value.hidden} />\n <label for=\"checkbox-hidden\"> <ox-i18n msgid=\"label.item-hidden\">Item Hidden</ox-i18n> </label>\n\n <input id=\"checkbox-locked\" value-key=\"locked\" type=\"checkbox\" .checked=${value.locked} />\n <label for=\"checkbox-locked\"> <ox-i18n msgid=\"label.locked\">Locked</ox-i18n> </label>\n </div>\n `\n : html``}\n </div>\n </fieldset>\n\n ${!this._isLine(this.selected)\n ? keyed(\n this.selected,\n html`\n <fieldset class=\"icon-label unit ratio\">\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/size\" msgid=\"label.size\">size</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"width\"> <ox-i18n msgid=\"label.width\">width</ox-i18n> </label>\n <input type=\"number\" value-key=\"bounds.width\" .value=${String(width)} />\n <label class=\"height\"> <ox-i18n msgid=\"label.height\">height</ox-i18n> </label>\n <input type=\"number\" value-key=\"bounds.height\" .value=${String(height)} />\n\n ${this.selected.length && this.selected[0].isRootModel()\n ? html``\n : html`\n <label class=\"rotate\"> <ox-i18n msgid=\"label.rotate\">rotate</ox-i18n> </label>\n <ox-input-angle value-key=\"rotation\" .value=${value.rotation}> </ox-input-angle>\n `}\n </div>\n </fieldset>\n `\n )\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <fieldset>\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/text-box\" msgid=\"label.text-box\">text box</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.horizontal\">horizontal</ox-i18n> </label>\n <ox-buttons-radio value-key=\"textAlign\" .value=${value.textAlign}>\n <div data-value=\"left\"></div>\n <div data-value=\"center\"></div>\n <div data-value=\"right\"></div>\n <div data-value=\"justify\"></div>\n </ox-buttons-radio>\n\n <label> <ox-i18n msgid=\"label.vertical\">vertical</ox-i18n> </label>\n <ox-buttons-radio value-key=\"textBaseline\" .value=${value.textBaseline}>\n <div data-value=\"top\"></div>\n <div data-value=\"middle\"></div>\n <div data-value=\"bottom\"></div>\n </ox-buttons-radio>\n\n <div class=\"checkbox-row\">\n <input id=\"checkbox-textwrap\" type=\"checkbox\" value-key=\"textWrap\" .checked=${value.textWrap} />\n <label for=\"checkbox-textwrap\"> <ox-i18n msgid=\"label.text-wrap\">Text Wrap</ox-i18n> </label>\n </div>\n\n <div class=\"checkbox-row\">\n <input\n id=\"checkbox-keep-text-angle\"\n type=\"checkbox\"\n value-key=\"keepTextAngle\"\n .checked=${value.keepTextAngle}\n />\n <label for=\"checkbox-keep-text-angle\">\n <ox-i18n msgid=\"label.keep-text-angle\">Keep Text Angle</ox-i18n>\n </label>\n </div>\n\n <label> <ox-i18n msgid=\"label.padding\">padding</ox-i18n> </label>\n <table class=\"box-padding\">\n <tr>\n <td class=\"slide1\"></td>\n <td class=\"slide2\"></td>\n <td class=\"slide3\"></td>\n </tr>\n <tr>\n <td class=\"slide4\"></td>\n <td class=\"slide5\">\n <input type=\"number\" value-key=\"paddingTop\" .value=${value.paddingTop || 0} />\n <input type=\"number\" value-key=\"paddingLeft\" .value=${value.paddingLeft || 0} />\n <input type=\"number\" value-key=\"paddingRight\" .value=${value.paddingRight || 0} />\n <input type=\"number\" value-key=\"paddingBottom\" .value=${value.paddingBottom || 0} />\n </td>\n <td class=\"slide6\"></td>\n </tr>\n <tr>\n <td class=\"slide7\"></td>\n <td class=\"slide8\"></td>\n <td class=\"slide9\"></td>\n </tr>\n </table>\n </div>\n </fieldset>\n `\n : html``}\n ${this.selected.length && this.selected[0].isRootModel()\n ? html`\n <fieldset class=\"icon-label\">\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/viewer-option\" msgid=\"label.viewer-option\">Viewer Option</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label><ox-i18n msgid=\"label.fit\">Fit</ox-i18n></label>\n <select value-key=\"fitMode\" .value=${value.fitMode || 'ratio'}>\n <option value=\"none\">none</option>\n <option value=\"center\">center</option>\n <option value=\"ratio\" selected>ratio</option>\n <option value=\"both\">both</option>\n <option value=\"width\">width</option>\n <option value=\"height\">height</option>\n </select>\n </div>\n </fieldset>\n `\n : html``}\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 var value = this._getValueFromEventTarget(element)\n\n if (key.indexOf('bounds.') == 0) {\n if (isNaN(value)) return\n this.dispatchEvent(\n new CustomEvent('bounds-change', {\n bubbles: true,\n composed: true,\n detail: {\n [key.substring(7)]: value\n }\n })\n )\n } else {\n this._onAfterValueChange(key, value)\n }\n }\n\n _hasTextProperty(selected: Component[]) {\n for (let i = 0; i < selected.length; i++) {\n if (!selected[i].hasTextProperty) return false\n }\n\n return true\n }\n\n _hasProperties(selected: Component[]) {\n if (!selected || selected.length == 0 || (selected[0] && selected[0].isLayer && selected[0].isLayer())) return false\n\n return true\n }\n\n _isIdentifiable(selected: Component[]) {\n if (\n !selected ||\n selected.length == 0 ||\n selected.length > 1 ||\n !selected[0].isIdentifiable() ||\n (selected[0].isLayer && selected[0].isLayer())\n )\n return false\n\n return true\n }\n\n _isClassIdentifiable(selected: Component[]) {\n if (!selected || (selected[0] && selected[0].isLayer())) return false\n\n return true\n }\n\n _isLine(selected: Component[]) {\n if (!selected || !(selected[0] && selected[0].isLine())) return false\n\n return true\n }\n\n _is3dish(selected: Component[]) {\n if (!selected || !(selected[0] && selected[0].is3dish())) return false\n\n return true\n }\n}\n"]}
1
+ {"version":3,"file":"shapes.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/shapes/shapes.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kCAAkC,CAAA;AACzC,OAAO,oCAAoC,CAAA;AAC3C,O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KAAK,CAAA;QAErE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,QAAQ,CAAC,QAAqB;QAC5B,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAAE,OAAO,KAAK,CAAA;QAEtE,OAAO,IAAI,CAAA;IACb,CAAC;;AAnYM,qBAAM,GAAG;IACd,mBAAmB;IACnB,sBAAsB;IACtB,GAAG,CAAA;;;;;;;;;;;;;;;;KAgBF;IACD,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+FF;CACF,AApHY,CAoHZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA6B;AAC7B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gDAA2B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@operato/input/ox-input-angle.js'\nimport '@operato/input/ox-buttons-radio.js'\nimport '@material/web/icon/icon.js'\nimport '@operato/i18n/ox-i18n.js'\n\nimport { css, html } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { BOUNDS, Component, Properties } from '@hatiolab/things-scene'\n\nimport { AbstractProperty } from '../abstract-property'\nimport { PropertySharedStyle } from '../property-shared-style'\nimport { BoxPaddingEditorStyles } from './box-padding-editor-styles'\n\nexport class PropertyShapes extends AbstractProperty {\n static styles = [\n PropertySharedStyle,\n BoxPaddingEditorStyles,\n css`\n fieldset[collapsable] legend {\n box-sizing: border-box;\n width: 100%;\n }\n\n fieldset[collapsable] legend md-icon {\n float: right;\n font-size: medium;\n margin: 0;\n cursor: pointer;\n }\n\n fieldset[collapsable][collapsed] > :not(legend) {\n display: none;\n }\n `,\n css`\n .icon-label label {\n background: var(--url-icon-properties-label) 7px -900px no-repeat;\n }\n\n .icon-label .checkbox-row label {\n background: none;\n }\n\n .icon-label label.width {\n background-position: 7px -96px;\n }\n\n .icon-label label.height {\n background-position: 7px 4px;\n }\n\n .icon-label label.rotate {\n background-position: 7px -198px;\n }\n\n .icon-label label.twidth {\n background-position: 7px -296px;\n }\n\n .icon-label label.theight {\n background-position: 7px -396px;\n }\n\n .icon-label label.zPos {\n background-position: 5px -1098px;\n }\n\n .icon-label label.depth {\n background-position: 5px -1198px;\n }\n\n .icon-label label.rotationX {\n background-position: 5px -1296px;\n }\n\n .icon-label label.rotationY {\n background-position: 5px -1396px;\n }\n\n .icon-label label.rotationZ {\n background-position: 5px -1496px;\n }\n\n ox-buttons-radio > * {\n width: 30px;\n height: 25px;\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\n ox-buttons-radio div {\n background: var(--url-icon-properties) no-repeat;\n }\n\n ox-buttons-radio div[data-value='left'] {\n background-position: 50% 3px;\n }\n\n ox-buttons-radio div[data-value='center'] {\n background-position: 50% -47px;\n }\n\n ox-buttons-radio div[data-value='right'] {\n background-position: 50% -97px;\n }\n\n ox-buttons-radio div[data-value='justify'] {\n background-position: 50% -147px;\n }\n\n ox-buttons-radio div[data-value='top'] {\n background-position: 50% -197px;\n }\n\n ox-buttons-radio div[data-value='middle'] {\n background-position: 50% -193px;\n }\n\n ox-buttons-radio div[data-value='bottom'] {\n background-position: 50% -188px;\n }\n\n ox-buttons-radio div[active] {\n border-color: #f2471c;\n }\n `\n ]\n\n @property({ type: Object }) value?: Properties\n @property({ type: Object }) bounds: BOUNDS | null = null\n @property({ type: Array }) selected: Component[] = []\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onValueChange.bind(this))\n }\n\n render() {\n const value = this.value || {}\n const { width, height } = this.bounds || {}\n\n return html`\n <fieldset>\n <div class=\"property-grid\">\n ${this._isIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.id\">ID</ox-i18n> </label>\n <input value-key=\"id\" .value=${value.id || ''} />\n `\n : html``}\n ${this._isClassIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.class\">Class</ox-i18n> </label>\n <input value-key=\"class\" .value=${value.class || ''} />\n `\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.text\">Text</ox-i18n> </label>\n <input value-key=\"text\" .value=${value.text || ''} />\n <label> <ox-i18n msgid=\"label.text-format\">Text Format</ox-i18n> </label>\n <input value-key=\"textFormat\" .value=${value.textFormat || ''} list=\"format-list\" />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n `\n : html``}\n ${this._hasProperties(this.selected)\n ? html`\n <div class=\"checkbox-row\">\n <input id=\"checkbox-hidden\" value-key=\"hidden\" type=\"checkbox\" .checked=${value.hidden} />\n <label for=\"checkbox-hidden\"> <ox-i18n msgid=\"label.item-hidden\">Item Hidden</ox-i18n> </label>\n\n <input id=\"checkbox-locked\" value-key=\"locked\" type=\"checkbox\" .checked=${value.locked} />\n <label for=\"checkbox-locked\"> <ox-i18n msgid=\"label.locked\">Locked</ox-i18n> </label>\n </div>\n `\n : html``}\n </div>\n </fieldset>\n\n ${!this._isLine(this.selected)\n ? keyed(\n this.selected,\n html`\n <fieldset class=\"icon-label unit ratio\">\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/size\" msgid=\"label.size\">size</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label class=\"width\"> <ox-i18n msgid=\"label.width\">width</ox-i18n> </label>\n <input type=\"number\" value-key=\"bounds.width\" .value=${String(width)} />\n <label class=\"height\"> <ox-i18n msgid=\"label.height\">height</ox-i18n> </label>\n <input type=\"number\" value-key=\"bounds.height\" .value=${String(height)} />\n\n ${this.selected.length && this.selected[0].isRootModel()\n ? html``\n : html`\n <label class=\"depth\"> <ox-i18n msgid=\"label.depth\">depth</ox-i18n> </label>\n <input type=\"number\" value-key=\"depth\" .value=${String(value.depth ?? '')} placeholder=\"auto\" />\n\n <label class=\"zPos\"> <ox-i18n msgid=\"label.zPos\">zPos</ox-i18n> </label>\n <input type=\"number\" value-key=\"zPos\" .value=${String(value.zPos ?? '')} placeholder=\"auto\" />\n\n <label class=\"rotate\"> <ox-i18n msgid=\"label.rotate\">rotate</ox-i18n> </label>\n <ox-input-angle value-key=\"rotation\" .value=${value.rotation}> </ox-input-angle>\n `}\n </div>\n </fieldset>\n `\n )\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <fieldset>\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/text-box\" msgid=\"label.text-box\">text box</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label> <ox-i18n msgid=\"label.horizontal\">horizontal</ox-i18n> </label>\n <ox-buttons-radio value-key=\"textAlign\" .value=${value.textAlign}>\n <div data-value=\"left\"></div>\n <div data-value=\"center\"></div>\n <div data-value=\"right\"></div>\n <div data-value=\"justify\"></div>\n </ox-buttons-radio>\n\n <label> <ox-i18n msgid=\"label.vertical\">vertical</ox-i18n> </label>\n <ox-buttons-radio value-key=\"textBaseline\" .value=${value.textBaseline}>\n <div data-value=\"top\"></div>\n <div data-value=\"middle\"></div>\n <div data-value=\"bottom\"></div>\n </ox-buttons-radio>\n\n <div class=\"checkbox-row\">\n <input id=\"checkbox-textwrap\" type=\"checkbox\" value-key=\"textWrap\" .checked=${value.textWrap} />\n <label for=\"checkbox-textwrap\"> <ox-i18n msgid=\"label.text-wrap\">Text Wrap</ox-i18n> </label>\n </div>\n\n <div class=\"checkbox-row\">\n <input\n id=\"checkbox-keep-text-angle\"\n type=\"checkbox\"\n value-key=\"keepTextAngle\"\n .checked=${value.keepTextAngle}\n />\n <label for=\"checkbox-keep-text-angle\">\n <ox-i18n msgid=\"label.keep-text-angle\">Keep Text Angle</ox-i18n>\n </label>\n </div>\n\n <label> <ox-i18n msgid=\"label.padding\">padding</ox-i18n> </label>\n <table class=\"box-padding\">\n <tr>\n <td class=\"slide1\"></td>\n <td class=\"slide2\"></td>\n <td class=\"slide3\"></td>\n </tr>\n <tr>\n <td class=\"slide4\"></td>\n <td class=\"slide5\">\n <input type=\"number\" value-key=\"paddingTop\" .value=${value.paddingTop || 0} />\n <input type=\"number\" value-key=\"paddingLeft\" .value=${value.paddingLeft || 0} />\n <input type=\"number\" value-key=\"paddingRight\" .value=${value.paddingRight || 0} />\n <input type=\"number\" value-key=\"paddingBottom\" .value=${value.paddingBottom || 0} />\n </td>\n <td class=\"slide6\"></td>\n </tr>\n <tr>\n <td class=\"slide7\"></td>\n <td class=\"slide8\"></td>\n <td class=\"slide9\"></td>\n </tr>\n </table>\n </div>\n </fieldset>\n `\n : html``}\n ${this.selected.length && this.selected[0].isRootModel()\n ? html`\n <fieldset class=\"icon-label\">\n <legend>\n <ox-i18n topic=\"board-modeller/shapes/viewer-option\" msgid=\"label.viewer-option\">Viewer Option</ox-i18n>\n </legend>\n\n <div class=\"property-grid\">\n <label><ox-i18n msgid=\"label.fit\">Fit</ox-i18n></label>\n <select value-key=\"fitMode\" .value=${value.fitMode || 'ratio'}>\n <option value=\"none\">none</option>\n <option value=\"center\">center</option>\n <option value=\"ratio\" selected>ratio</option>\n <option value=\"both\">both</option>\n <option value=\"width\">width</option>\n <option value=\"height\">height</option>\n </select>\n\n <div class=\"checkbox-row\">\n <input\n id=\"cb-threed\"\n type=\"checkbox\"\n value-key=\"threed\"\n .checked=${!!value.threed}\n />\n <label for=\"cb-threed\"><ox-i18n msgid=\"label.start-in-3d\">Start in 3D</ox-i18n></label>\n </div>\n\n <div class=\"checkbox-row\">\n <input\n id=\"cb-floor-constraint\"\n type=\"checkbox\"\n value-key=\"cameraFloorConstraint\"\n .checked=${!!value.cameraFloorConstraint}\n />\n <label for=\"cb-floor-constraint\"><ox-i18n msgid=\"label.keep-above-ground\">Keep Above Ground</ox-i18n></label>\n </div>\n </div>\n </fieldset>\n `\n : html``}\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 var value = this._getValueFromEventTarget(element)\n\n if (key.indexOf('bounds.') == 0) {\n if (isNaN(value)) return\n this.dispatchEvent(\n new CustomEvent('bounds-change', {\n bubbles: true,\n composed: true,\n detail: {\n [key.substring(7)]: value\n }\n })\n )\n } else {\n this._onAfterValueChange(key, value)\n }\n }\n\n _hasTextProperty(selected: Component[]) {\n for (let i = 0; i < selected.length; i++) {\n if (!selected[i].hasTextProperty) return false\n }\n\n return true\n }\n\n _hasProperties(selected: Component[]) {\n if (!selected || selected.length == 0 || (selected[0] && selected[0].isLayer && selected[0].isLayer())) return false\n\n return true\n }\n\n _isIdentifiable(selected: Component[]) {\n if (\n !selected ||\n selected.length == 0 ||\n selected.length > 1 ||\n !selected[0].isIdentifiable() ||\n (selected[0].isLayer && selected[0].isLayer())\n )\n return false\n\n return true\n }\n\n _isClassIdentifiable(selected: Component[]) {\n if (!selected || (selected[0] && selected[0].isLayer())) return false\n\n return true\n }\n\n _isLine(selected: Component[]) {\n if (!selected || !(selected[0] && selected[0].isLine())) return false\n\n return true\n }\n\n _is3dish(selected: Component[]) {\n if (!selected || !(selected[0] && selected[0].is3dish())) return false\n\n return true\n }\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  import { Component, Scene } from '@hatiolab/things-scene';
5
5
  import { SpecificPropertiesBuilder } from './specific-properties-builder.js';
6
6
  import { AbstractProperty } from '../abstract-property';
7
- declare const PropertySpecific_base: typeof AbstractProperty & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
7
+ declare const PropertySpecific_base: typeof AbstractProperty & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types.js").ScopedElementsHost>;
8
8
  export declare class PropertySpecific extends PropertySpecific_base {
9
9
  static styles: import("lit").CSSResult[];
10
10
  value: any;
@@ -18,6 +18,7 @@ export declare class PropertySpecific extends PropertySpecific_base {
18
18
  static get scopedElements(): {
19
19
  'specific-properties-builder': typeof SpecificPropertiesBuilder;
20
20
  };
21
+ private _isGroupSelected;
21
22
  render(): import("lit-html").TemplateResult<1>;
22
23
  _onValueChange(e: Event): void;
23
24
  _isIdentifiable(selected: Component[]): boolean;
@@ -30,9 +30,16 @@ export class PropertySpecific extends ScopedElementsMixin(AbstractProperty) {
30
30
  'specific-properties-builder': SpecificPropertiesBuilder
31
31
  };
32
32
  }
33
+ _isGroupSelected() {
34
+ var _a, _b, _c;
35
+ return ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_c = (_b = this.selected[0]).isGroup) === null || _c === void 0 ? void 0 : _c.call(_b));
36
+ }
33
37
  render() {
34
38
  const selected = this.selected && this.selected[0];
35
39
  const value = this.value || {};
40
+ if (this._isGroupSelected()) {
41
+ return html `<label component-type>${value.type}</label>`;
42
+ }
36
43
  return html `
37
44
  <label component-type>${value.type}</label>
38
45
  <fieldset>
@@ -76,8 +83,11 @@ export class PropertySpecific extends ScopedElementsMixin(AbstractProperty) {
76
83
  this._onAfterValueChange(key, value);
77
84
  }
78
85
  _isIdentifiable(selected) {
86
+ var _a, _b;
79
87
  if (!selected || selected.length == 0 || selected.length > 1 || (selected[0].isLayer && selected[0].isLayer()))
80
88
  return false;
89
+ if ((_b = (_a = selected[0]).isGroup) === null || _b === void 0 ? void 0 : _b.call(_a))
90
+ return false;
81
91
  return true;
82
92
  }
83
93
  _hasTextProperty(selected) {
@@ -1 +1 @@
1
- {"version":3,"file":"specifics.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/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M,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe;gBAAE,OAAO,KAAK,CAAA;QAChD,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,gBAAgB,CAAC,CAAc;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,MAAM,CAAA;QAE3B,IAAI,CAAC,KAAM,CAAC,cAAc,CAAC,GAAG,EAAE;YAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACpC,CAAC,CAAC,CAAA;IACJ,CAAC;;AAnHM,uBAAM,GAAG;IACd,mBAAmB;IACnB,GAAG,CAAA;;;;;;;;;;KAUF;CACF,AAbY,CAaZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA2B;AAC3B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wDAA2B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Component, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PropertySharedStyle } from '../property-shared-style'\nimport { SpecificPropertiesBuilder } from './specific-properties-builder.js'\nimport { AbstractProperty } from '../abstract-property'\n\nexport class PropertySpecific extends ScopedElementsMixin(AbstractProperty) {\n static styles = [\n PropertySharedStyle,\n css`\n label[component-type] {\n display: block;\n margin: 10px;\n\n text-align: right;\n font: bold 14px var(--theme-font);\n color: var(--primary-color);\n text-transform: capitalize;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) props: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n private boundINeedSelected: any = this._onINeedSelected.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n\n this.addEventListener('i-need-selected', this.boundINeedSelected)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.removeEventListener('i-need-selected', this.boundINeedSelected)\n }\n\n static get scopedElements() {\n return {\n 'specific-properties-builder': SpecificPropertiesBuilder\n }\n }\n\n render() {\n const selected = this.selected && this.selected[0]\n const value = this.value || {}\n\n return html`\n <label component-type>${value.type}</label>\n <fieldset>\n <div class=\"property-grid\">\n ${this._isIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.id\">ID</ox-i18n> </label>\n <input value-key=\"id\" .value=${value.id || ''} />\n `\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.text\">Text</ox-i18n> </label>\n <input value-key=\"text\" .value=${value.text || ''} />\n <label> <ox-i18n msgid=\"label.text-format\">Text Format</ox-i18n> </label>\n <input value-key=\"textFormat\" .value=${value.textFormat || ''} list=\"format-list\" />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n `\n : html``}\n </div>\n </fieldset>\n\n <specific-properties-builder .value=${value} .props=${this.props} .propertyEditor=${this.propertyEditor}>\n </specific-properties-builder>\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 var value = this._getValueFromEventTarget(element)\n\n this._onAfterValueChange(key, value)\n }\n\n _isIdentifiable(selected: Component[]) {\n if (!selected || selected.length == 0 || selected.length > 1 || (selected[0].isLayer && selected[0].isLayer()))\n return false\n\n return true\n }\n\n _hasTextProperty(selected: Component[]) {\n for (let i = 0; i < selected.length; i++) {\n if (!selected[i].hasTextProperty) return false\n }\n\n return true\n }\n\n _onINeedSelected(e: CustomEvent) {\n e.stopPropagation()\n\n var { callback } = e.detail\n\n this.scene!.undoableChange(() => {\n callback.call(null, this.selected)\n })\n }\n}\n"]}
1
+ {"version":3,"file":"specifics.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/specifics/specifics.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAc,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAEvD,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IAA3E;;QAiB8B,UAAK,GAAiB,IAAI,CAAA;QAC3B,aAAQ,GAAgB,EAAE,CAAA;QAC1B,UAAK,GAAU,EAAE,CAAA;QACjB,mBAAc,GAAU,EAAE,CAAA;QAE7C,uBAAkB,GAAQ,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAyGpE,CAAC;IAvGC,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAEzB,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAA;IACnE,CAAC;IAED,oBAAoB;QA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,CAAC,CAAA;IACJ,CAAC;;AA7HM,uBAAM,GAAG;IACd,mBAAmB;IACnB,GAAG,CAAA;;;;;;;;;;KAUF;CACF,AAbY,CAaZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAA2B;AAC3B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wDAA2B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { Component, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\n\nimport { PropertySharedStyle } from '../property-shared-style'\nimport { SpecificPropertiesBuilder } from './specific-properties-builder.js'\nimport { AbstractProperty } from '../abstract-property'\n\nexport class PropertySpecific extends ScopedElementsMixin(AbstractProperty) {\n static styles = [\n PropertySharedStyle,\n css`\n label[component-type] {\n display: block;\n margin: 10px;\n\n text-align: right;\n font: bold 14px var(--theme-font);\n color: var(--primary-color);\n text-transform: capitalize;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) props: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n private boundINeedSelected: any = this._onINeedSelected.bind(this)\n\n connectedCallback() {\n super.connectedCallback()\n\n this.addEventListener('i-need-selected', this.boundINeedSelected)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.removeEventListener('i-need-selected', this.boundINeedSelected)\n }\n\n static get scopedElements() {\n return {\n 'specific-properties-builder': SpecificPropertiesBuilder\n }\n }\n\n private _isGroupSelected(): boolean {\n return this.selected?.length > 0 && (this.selected[0] as any).isGroup?.()\n }\n\n render() {\n const selected = this.selected && this.selected[0]\n const value = this.value || {}\n\n if (this._isGroupSelected()) {\n return html`<label component-type>${value.type}</label>`\n }\n\n return html`\n <label component-type>${value.type}</label>\n <fieldset>\n <div class=\"property-grid\">\n ${this._isIdentifiable(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.id\">ID</ox-i18n> </label>\n <input value-key=\"id\" .value=${value.id || ''} />\n `\n : html``}\n ${this._hasTextProperty(this.selected)\n ? html`\n <label> <ox-i18n msgid=\"label.text\">Text</ox-i18n> </label>\n <input value-key=\"text\" .value=${value.text || ''} />\n <label> <ox-i18n msgid=\"label.text-format\">Text Format</ox-i18n> </label>\n <input value-key=\"textFormat\" .value=${value.textFormat || ''} list=\"format-list\" />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n `\n : html``}\n </div>\n </fieldset>\n\n <specific-properties-builder .value=${value} .props=${this.props} .propertyEditor=${this.propertyEditor}>\n </specific-properties-builder>\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 var value = this._getValueFromEventTarget(element)\n\n this._onAfterValueChange(key, value)\n }\n\n _isIdentifiable(selected: Component[]) {\n if (!selected || selected.length == 0 || selected.length > 1 || (selected[0].isLayer && selected[0].isLayer()))\n return false\n if ((selected[0] as any).isGroup?.())\n return false\n\n return true\n }\n\n _hasTextProperty(selected: Component[]) {\n for (let i = 0; i < selected.length; i++) {\n if (!selected[i].hasTextProperty) return false\n }\n\n return true\n }\n\n _onINeedSelected(e: CustomEvent) {\n e.stopPropagation()\n\n var { callback } = e.detail\n\n this.scene!.undoableChange(() => {\n callback.call(null, this.selected)\n })\n }\n}\n"]}
@@ -12,7 +12,7 @@ import '../../../component/restful-input-fill-style.js';
12
12
  import { Component } from '@hatiolab/things-scene';
13
13
  import { AbstractProperty } from '../abstract-property.js';
14
14
  export declare class PropertyStyles extends AbstractProperty {
15
- static styles: any[];
15
+ static styles: import("lit").CSSResult[];
16
16
  value: any;
17
17
  selected: Component[];
18
18
  fonts: any[];
@@ -1,10 +1,11 @@
1
1
  import './ox-scene-property';
2
2
  import { LitElement } from 'lit';
3
3
  export default class OxSceneLayer extends LitElement {
4
- type?: String;
5
- text?: String;
4
+ type?: string;
5
+ text?: string;
6
6
  render(): import("lit-html").TemplateResult<1>;
7
7
  getModel(): {
8
- type: String | undefined;
8
+ [key: string]: any;
9
+ type: string;
9
10
  };
10
11
  }
@@ -7,8 +7,9 @@ let OxSceneLayer = class OxSceneLayer extends LitElement {
7
7
  return html ` <slot select="ox-scene-property"></slot> `;
8
8
  }
9
9
  getModel() {
10
+ var _a;
10
11
  let model = {
11
- type: this.type
12
+ type: (_a = this.type) !== null && _a !== void 0 ? _a : ''
12
13
  };
13
14
  model = Array.from(this.querySelectorAll('ox-scene-property')).reduce((model, property) => {
14
15
  let value = property.value;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-scene-layer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-layer.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAIlD,MAAM;QACJ,OAAO,IAAI,CAAA,4CAA4C,CAAA;IACzD,CAAC;IAED,QAAQ;QACN,IAAI,KAAK,GAAG;YACV,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAA;QAED,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,QAAa,EAAE,EAAE;YAClG,IAAI,KAAK,GAAQ,QAAQ,CAAC,KAAK,CAAA;YAE/B,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAClB,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;oBACtB,KAAK,QAAQ;wBACX,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;wBACrB,MAAK;oBACP,KAAK,SAAS;wBACZ,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;wBACtB,MAAK;oBACP,QAAQ;gBACV,CAAC;gBAED,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;YAC9B,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC,EAAE,KAAK,CAAC,CAAA;QAET,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAA;AAlC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AAFtB,YAAY;IADhC,aAAa,CAAC,gBAAgB,CAAC;GACX,YAAY,CAmChC;eAnCoB,YAAY","sourcesContent":["import './ox-scene-property'\n\nimport { LitElement, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-scene-layer')\nexport default class OxSceneLayer extends LitElement {\n @property({ type: String }) type?: String\n @property({ type: String }) text?: String\n\n render() {\n return html` <slot select=\"ox-scene-property\"></slot> `\n }\n\n getModel() {\n let model = {\n type: this.type\n }\n\n model = Array.from(this.querySelectorAll('ox-scene-property')).reduce((model: any, property: any) => {\n let value: any = property.value\n\n if (property.name) {\n switch (property.type) {\n case 'number':\n value = Number(value)\n break\n case 'boolean':\n value = Boolean(value)\n break\n default:\n }\n\n model[property.name] = value\n }\n\n return model\n }, model)\n\n return model\n }\n}\n"]}
1
+ {"version":3,"file":"ox-scene-layer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-layer.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU;IAIlD,MAAM;QACJ,OAAO,IAAI,CAAA,4CAA4C,CAAA;IACzD,CAAC;IAED,QAAQ;;QACN,IAAI,KAAK,GAAyC;YAChD,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE;SACtB,CAAA;QAED,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,QAAa,EAAE,EAAE;YAClG,IAAI,KAAK,GAAQ,QAAQ,CAAC,KAAK,CAAA;YAE/B,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAClB,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;oBACtB,KAAK,QAAQ;wBACX,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;wBACrB,MAAK;oBACP,KAAK,SAAS;wBACZ,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;wBACtB,MAAK;oBACP,QAAQ;gBACV,CAAC;gBAED,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;YAC9B,CAAC;YAED,OAAO,KAAK,CAAA;QACd,CAAC,EAAE,KAAK,CAAC,CAAA;QAET,OAAO,KAAK,CAAA;IACd,CAAC;CACF,CAAA;AAlC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAc;AAFtB,YAAY;IADhC,aAAa,CAAC,gBAAgB,CAAC;GACX,YAAY,CAmChC;eAnCoB,YAAY","sourcesContent":["import './ox-scene-property'\n\nimport { LitElement, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('ox-scene-layer')\nexport default class OxSceneLayer extends LitElement {\n @property({ type: String }) type?: string\n @property({ type: String }) text?: string\n\n render() {\n return html` <slot select=\"ox-scene-property\"></slot> `\n }\n\n getModel() {\n let model: { [key: string]: any; type: string } = {\n type: this.type ?? ''\n }\n\n model = Array.from(this.querySelectorAll('ox-scene-property')).reduce((model: any, property: any) => {\n let value: any = property.value\n\n if (property.name) {\n switch (property.type) {\n case 'number':\n value = Number(value)\n break\n case 'boolean':\n value = Boolean(value)\n break\n default:\n }\n\n model[property.name] = value\n }\n\n return model\n }, model)\n\n return model\n }\n}\n"]}
@@ -2,7 +2,7 @@ import './confidential-overlay';
2
2
  import './ox-scene-layer';
3
3
  import './ox-scene-handler';
4
4
  import { LitElement, PropertyValues } from 'lit';
5
- import { Component, FITMODE, Model, Properties, Scene, SceneMode } from '@hatiolab/things-scene';
5
+ import { Component, FITMODE, LoadTracker, Model, Properties, Scene, SceneMode } from '@hatiolab/things-scene';
6
6
  export default class OxSceneViewer extends LitElement {
7
7
  static styles: import("lit").CSSResult;
8
8
  scene: Scene | null;
@@ -17,6 +17,7 @@ export default class OxSceneViewer extends LitElement {
17
17
  disposeWhenDetached: boolean;
18
18
  baseUrl: string;
19
19
  provider: any;
20
+ loadTracker?: LoadTracker;
20
21
  name: string;
21
22
  enableInspector: boolean;
22
23
  showInspector: boolean;
@@ -120,7 +120,8 @@ let OxSceneViewer = class OxSceneViewer extends LitElement {
120
120
  layers,
121
121
  handlers,
122
122
  mode: this.mode,
123
- refProvider: this.provider
123
+ refProvider: this.provider,
124
+ loading: this.loadTracker ? { tracker: this.loadTracker } : undefined
124
125
  }));
125
126
  if (this.provider) {
126
127
  this.provider.add(this.name, this.scene);
@@ -237,6 +238,9 @@ __decorate([
237
238
  __decorate([
238
239
  property({ type: Object })
239
240
  ], OxSceneViewer.prototype, "provider", void 0);
241
+ __decorate([
242
+ property({ type: Object })
243
+ ], OxSceneViewer.prototype, "loadTracker", void 0);
240
244
  __decorate([
241
245
  property({ type: String })
242
246
  ], OxSceneViewer.prototype, "name", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-scene-viewer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AACzB,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAa,MAAM,IAAI,WAAW,EAAqC,UAAU,EAAa,MAAM,wBAAwB,CAAA;AAKpH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAOe,UAAK,GAAiB,IAAI,CAAA;QAEtD,8EAA8E;QAClD,SAAI,GAAc,UAAU,CAAC,IAAI,CAAA;QACjC,eAAU,GAAW,IAAI,CAAA;QACzB,cAAS,GAAe,EAAE,CAAA;QAGtD;;;;;;;;;WASG;QACyB,QAAG,GAAY,MAAM,CAAA;QACtB,aAAQ,GAAgB,EAAE,CAAA;QACxB,wBAAmB,GAAY,KAAK,CAAA;QACrC,YAAO,GAAW,EAAE,CAAA;QAEpB,SAAI,GAAW,QAAQ,CAAA;QACtB,oBAAe,GAAY,IAAI,CAAA;QAC/B,kBAAa,GAAY,KAAK,CAAA;IAkN7D,CAAC;IA9MC,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAA;QAE5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B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAc;AAEb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAkC;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AAWZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAA2B;AACxB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAqC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAwB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDAAgC;AAC/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAA+B;AAhCxC,aAAa;IADjC,aAAa,CAAC,iBAAiB,CAAC;GACZ,aAAa,CAkPjC;eAlPoB,aAAa","sourcesContent":["import './confidential-overlay'\nimport './ox-scene-layer'\nimport './ox-scene-handler'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Component, create as createScene, FITMODE, Model, Properties, Scene, SCENE_MODE, SceneMode } from '@hatiolab/things-scene'\n\nimport OxSceneLayer from './ox-scene-layer'\n\n@customElement('ox-scene-viewer')\nexport default class OxSceneViewer extends LitElement {\n static styles = css`\n :host {\n outline: none;\n }\n `\n\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Object }) model?: Model\n /* Scene Mode - mode 0 : view mode, mode 1 : edit mode, mode 2 : shift mode */\n @property({ type: Number }) mode: SceneMode = SCENE_MODE.VIEW\n @property({ type: Number }) screenSize: number = 13.3\n @property({ type: Object }) variables: Properties = {}\n @property({ type: Object }) data: any\n @property({ type: Object }) themes?: any\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n */\n @property({ type: String }) fit: FITMODE = 'none'\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Boolean }) disposeWhenDetached: boolean = false\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) provider: any\n @property({ type: String }) name: string = 'noname'\n @property({ type: Boolean }) enableInspector: boolean = true\n @property({ type: Boolean }) showInspector: boolean = false\n\n private lastOffsetWidth?: number\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n if (this.scene && this.disposeWhenDetached) {\n this._disposeScene()\n }\n }\n\n render() {\n return html` <slot></slot> `\n }\n\n updated(change: PropertyValues<this>) {\n change.has('model') && this._onModelChanged(this.model)\n change.has('mode') && this._onModeChanged(this.mode)\n change.has('screenSize') && this._onDisplayChanged(this.screenSize)\n change.has('data') && this._onDataChanged(this.data)\n change.has('baseUrl') && this._onBaseUrlChanged(this.baseUrl)\n }\n\n _setScene(scene: Scene | null) {\n this.scene = scene\n this.dispatchEvent(\n new CustomEvent('scene-changed', {\n bubbles: true,\n composed: true,\n detail: { value: scene }\n })\n )\n }\n\n _setMode(mode: SceneMode) {\n this.mode = mode\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n bubbles: true,\n composed: true,\n detail: { value: mode }\n })\n )\n }\n\n _setVariables(variables: Properties) {\n this.variables = variables\n this.dispatchEvent(\n new CustomEvent('variables-changed', {\n bubbles: true,\n composed: true,\n detail: { value: variables }\n })\n )\n }\n\n _setSelected(selected: Component[]) {\n this.selected = selected\n this.dispatchEvent(\n new CustomEvent('selected-changed', {\n bubbles: true,\n composed: true,\n detail: { value: selected }\n })\n )\n }\n\n _disposeScene() {\n if (this.scene) {\n this.scene.off('selected', this._onSelectedChanged, this)\n this.scene.off('mode', this._onSceneModeChanged, this)\n\n if (this.provider) {\n this.scene.release && this.scene.release()\n } else {\n this.scene.dispose()\n }\n\n this._setScene(null)\n this._setSelected([])\n }\n }\n\n resize(force: boolean) {\n if (typeof this.scene == 'object') {\n if (force || this.fit === 'both' || Math.abs(this.offsetWidth - (this.lastOffsetWidth || 0)) >= 1) {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit(this.fit)\n }\n })\n }\n\n this.lastOffsetWidth = this.offsetWidth\n }\n }\n\n _onModelChanged(model?: Model) {\n this._disposeScene()\n\n if (!model) {\n return\n }\n\n const layers = Array.from(this.querySelectorAll('ox-scene-layer')).map(layer => (layer as OxSceneLayer).getModel())\n\n const handlers = Array.from(this.querySelectorAll('ox-scene-handler')).map(handler => handler.getAttribute('type')).filter((t): t is string => t !== null)\n\n this._setScene(\n createScene({\n target: this,\n model: JSON.parse(JSON.stringify(model)),\n style: this.themes,\n layers,\n handlers,\n mode: this.mode,\n refProvider: this.provider\n })\n )\n\n if (this.provider) {\n this.provider.add(this.name, this.scene)\n }\n\n this.scene!.screen = this.screenSize\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n this.resize(true)\n\n this._setVariables(model.variables || {})\n\n this.scene!.on('selected', this._onSelectedChanged, this)\n this.scene!.on('mode', this._onSceneModeChanged, this)\n\n this._onModeChanged(this.mode)\n this._onDisplayChanged(this.screenSize)\n this._onBaseUrlChanged(this.baseUrl)\n\n this.focus()\n }\n\n _onDisplayChanged(screenSize: string | number) {\n if (!this.scene) {\n return\n }\n\n if (screenSize) {\n this.scene.screen = parseFloat(String(screenSize))\n }\n }\n\n _onModeChanged(mode: SceneMode) {\n if (!this.scene) {\n return\n }\n this.scene.mode = Number(mode)\n }\n\n _onDataChanged(data: any) {\n if (!this.scene || !data) {\n return\n }\n\n this.scene.data = data\n }\n\n _onSelectedChanged(after: Component[]) {\n /*\n scene 컴포넌트의 속성을 속성 에디터(input box등)에서 변경하다가,\n scene의 다른 컴포넌트를 클릭해서 포커스(선택) 컴포넌트를 변경하게되면,\n 속성 에디터(input box등)의 value change 이벤트의 처리와 충돌(레이스)하게된다.\n \n 기대하는 순서는 먼저 속성 에디터의 value change 이벤트를 처리한 후에,\n selected 이벤트를 처리할 수 있도록 requestAnimationFrame으로 한 프레임을 지연하도록 하였다.\n */\n requestAnimationFrame(() => {\n this._setSelected(after)\n })\n }\n\n _onSceneModeChanged(after: SceneMode) {\n if (!this.scene) {\n return\n }\n\n if (this.mode !== after) {\n this._setMode(after)\n }\n\n if (after === 2) {\n this.style.cursor = 'all-scroll'\n } else if (after === 3) {\n this.style.cursor = 'crosshair'\n } else {\n this.style.cursor = 'default'\n }\n }\n\n _onBaseUrlChanged(after: string) {\n if (!this.scene) {\n return\n }\n\n this.scene.baseUrl = after\n }\n}\n"]}
1
+ {"version":3,"file":"ox-scene-viewer.js","sourceRoot":"","sources":["../../../../src/modeller/scene-viewer/ox-scene-viewer.ts"],"names":[],"mappings":";AAAA,OAAO,wBAAwB,CAAA;AAC/B,OAAO,kBAAkB,CAAA;AACzB,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAa,MAAM,IAAI,WAAW,EAAkD,UAAU,EAAa,MAAM,wBAAwB,CAAA;AAKjI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAOe,UAAK,GAAiB,IAAI,CAAA;QAEtD,8EAA8E;QAClD,SAAI,GAAc,UAAU,CAAC,IAAI,CAAA;QACjC,eAAU,GAAW,IAAI,CAAA;QACzB,cAAS,GAAe,EAAE,CAAA;QAGtD;;;;;;;;;WASG;QACyB,QAAG,GAAY,MAAM,CAAA;QACtB,aAAQ,GAAgB,EAAE,CAAA;QACxB,wBAAmB,GAAY,KAAK,CAAA;QACrC,YAAO,GAAW,EAAE,CAAA;QAGpB,SAAI,GAAW,QAAQ,CAAA;QACtB,oBAAe,GAAY,IAAI,CAAA;QAC/B,kBAAa,GAAY,KAAK,CAAA;IAmN7D,CAAC;IA/MC,oBAAoB;QAClB,KAAK,CAAC,oBAAoB,EAAE,CAAA;QAE5B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3C,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,iBAAiB,CAAA;IAC9B,CAAC;IAED,OAAO,CAAC,MAA4B;QAClC,MAA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AAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAkC;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAa;AAWZ;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAA2B;AACxB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;0DAAqC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAc;AACb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA0B;AACzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAwB;AACtB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sDAAgC;AAC/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAA+B;AAjCxC,aAAa;IADjC,aAAa,CAAC,iBAAiB,CAAC;GACZ,aAAa,CAoPjC;eApPoB,aAAa","sourcesContent":["import './confidential-overlay'\nimport './ox-scene-layer'\nimport './ox-scene-handler'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { Component, create as createScene, FITMODE, LoadTracker, Model, Properties, Scene, SCENE_MODE, SceneMode } from '@hatiolab/things-scene'\n\nimport OxSceneLayer from './ox-scene-layer'\n\n@customElement('ox-scene-viewer')\nexport default class OxSceneViewer extends LitElement {\n static styles = css`\n :host {\n outline: none;\n }\n `\n\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Object }) model?: Model\n /* Scene Mode - mode 0 : view mode, mode 1 : edit mode, mode 2 : shift mode */\n @property({ type: Number }) mode: SceneMode = SCENE_MODE.VIEW\n @property({ type: Number }) screenSize: number = 13.3\n @property({ type: Object }) variables: Properties = {}\n @property({ type: Object }) data: any\n @property({ type: Object }) themes?: any\n /*\n * 캔바스에 모델을 어떻게 적절하게 보여줄 것인지를 설정한다.\n *\n * @none 가로, 세로 스케일을 1로 고정하고, {0, 0}좌표로 translate시킨다.\n * @both 캔바스에 모델을 꼭 채우도록 가로, 세로 스케일을 조정하고, {0, 0}좌표로 translate시킨다.\n * @width 캔바스의 폭에 모델의 폭을 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @height 캔바스의 높이에 모델의 높이를 일치하도록 가로, 세로 스케일을 동일하게 조정하고, {0, 0}좌표로 translate시킨다.\n * @center 가로, 세로 스케일을 1로 고정하고 모델이 화면의 중앙에 위치하도록 translate시킨다.\n * @ratio 모델의 모든 부분이 캔바스에 최대 크기로 표현될 수 있도록 가로, 세로 동일한 스케일로 조정하고, {0, 0}좌표로 translate시킨다.\n */\n @property({ type: String }) fit: FITMODE = 'none'\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Boolean }) disposeWhenDetached: boolean = false\n @property({ type: String }) baseUrl: string = ''\n @property({ type: Object }) provider: any\n @property({ type: Object }) loadTracker?: LoadTracker\n @property({ type: String }) name: string = 'noname'\n @property({ type: Boolean }) enableInspector: boolean = true\n @property({ type: Boolean }) showInspector: boolean = false\n\n private lastOffsetWidth?: number\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n if (this.scene && this.disposeWhenDetached) {\n this._disposeScene()\n }\n }\n\n render() {\n return html` <slot></slot> `\n }\n\n updated(change: PropertyValues<this>) {\n change.has('model') && this._onModelChanged(this.model)\n change.has('mode') && this._onModeChanged(this.mode)\n change.has('screenSize') && this._onDisplayChanged(this.screenSize)\n change.has('data') && this._onDataChanged(this.data)\n change.has('baseUrl') && this._onBaseUrlChanged(this.baseUrl)\n }\n\n _setScene(scene: Scene | null) {\n this.scene = scene\n this.dispatchEvent(\n new CustomEvent('scene-changed', {\n bubbles: true,\n composed: true,\n detail: { value: scene }\n })\n )\n }\n\n _setMode(mode: SceneMode) {\n this.mode = mode\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n bubbles: true,\n composed: true,\n detail: { value: mode }\n })\n )\n }\n\n _setVariables(variables: Properties) {\n this.variables = variables\n this.dispatchEvent(\n new CustomEvent('variables-changed', {\n bubbles: true,\n composed: true,\n detail: { value: variables }\n })\n )\n }\n\n _setSelected(selected: Component[]) {\n this.selected = selected\n this.dispatchEvent(\n new CustomEvent('selected-changed', {\n bubbles: true,\n composed: true,\n detail: { value: selected }\n })\n )\n }\n\n _disposeScene() {\n if (this.scene) {\n this.scene.off('selected', this._onSelectedChanged, this)\n this.scene.off('mode', this._onSceneModeChanged, this)\n\n if (this.provider) {\n this.scene.release && this.scene.release()\n } else {\n this.scene.dispose()\n }\n\n this._setScene(null)\n this._setSelected([])\n }\n }\n\n resize(force: boolean) {\n if (typeof this.scene == 'object') {\n if (force || this.fit === 'both' || Math.abs(this.offsetWidth - (this.lastOffsetWidth || 0)) >= 1) {\n requestAnimationFrame(() => {\n if (this.scene) {\n this.scene.resize()\n this.scene.fit(this.fit)\n }\n })\n }\n\n this.lastOffsetWidth = this.offsetWidth\n }\n }\n\n _onModelChanged(model?: Model) {\n this._disposeScene()\n\n if (!model) {\n return\n }\n\n const layers = Array.from(this.querySelectorAll('ox-scene-layer')).map(layer => (layer as OxSceneLayer).getModel())\n\n const handlers = Array.from(this.querySelectorAll('ox-scene-handler')).map(handler => handler.getAttribute('type')).filter((t): t is string => t !== null)\n\n this._setScene(\n createScene({\n target: this,\n model: JSON.parse(JSON.stringify(model)),\n style: this.themes,\n layers,\n handlers,\n mode: this.mode,\n refProvider: this.provider,\n loading: this.loadTracker ? { tracker: this.loadTracker } : undefined\n })\n )\n\n if (this.provider) {\n this.provider.add(this.name, this.scene)\n }\n\n this.scene!.screen = this.screenSize\n\n /* 이 컴포넌트의 폭이 값을 가지고 있으면 - 화면상에 자리를 잡고 보여지고 있음을 의미한다.\n * 이 때는 정상적으로 그려주고,\n * 그렇지 않으면, 다음 Resize Handling시에 처리하도록 한다.\n */\n this.resize(true)\n\n this._setVariables(model.variables || {})\n\n this.scene!.on('selected', this._onSelectedChanged, this)\n this.scene!.on('mode', this._onSceneModeChanged, this)\n\n this._onModeChanged(this.mode)\n this._onDisplayChanged(this.screenSize)\n this._onBaseUrlChanged(this.baseUrl)\n\n this.focus()\n }\n\n _onDisplayChanged(screenSize: string | number) {\n if (!this.scene) {\n return\n }\n\n if (screenSize) {\n this.scene.screen = parseFloat(String(screenSize))\n }\n }\n\n _onModeChanged(mode: SceneMode) {\n if (!this.scene) {\n return\n }\n this.scene.mode = Number(mode)\n }\n\n _onDataChanged(data: any) {\n if (!this.scene || !data) {\n return\n }\n\n this.scene.data = data\n }\n\n _onSelectedChanged(after: Component[]) {\n /*\n scene 컴포넌트의 속성을 속성 에디터(input box등)에서 변경하다가,\n scene의 다른 컴포넌트를 클릭해서 포커스(선택) 컴포넌트를 변경하게되면,\n 속성 에디터(input box등)의 value change 이벤트의 처리와 충돌(레이스)하게된다.\n \n 기대하는 순서는 먼저 속성 에디터의 value change 이벤트를 처리한 후에,\n selected 이벤트를 처리할 수 있도록 requestAnimationFrame으로 한 프레임을 지연하도록 하였다.\n */\n requestAnimationFrame(() => {\n this._setSelected(after)\n })\n }\n\n _onSceneModeChanged(after: SceneMode) {\n if (!this.scene) {\n return\n }\n\n if (this.mode !== after) {\n this._setMode(after)\n }\n\n if (after === 2) {\n this.style.cursor = 'all-scroll'\n } else if (after === 3) {\n this.style.cursor = 'crosshair'\n } else {\n this.style.cursor = 'default'\n }\n }\n\n _onBaseUrlChanged(after: string) {\n if (!this.scene) {\n return\n }\n\n this.scene.baseUrl = after\n }\n}\n"]}
@@ -6,6 +6,7 @@ import { LitElement, PropertyValues } from 'lit';
6
6
  export declare class BoardComponentInfo extends LitElement {
7
7
  static styles: import("lit").CSSResult[];
8
8
  component?: any;
9
+ playbackMode: boolean;
9
10
  detailInfo?: any;
10
11
  collapsed: boolean;
11
12
  loading: boolean;
@@ -10,6 +10,7 @@ import { i18next } from '@operato/i18n';
10
10
  let BoardComponentInfo = class BoardComponentInfo extends LitElement {
11
11
  constructor() {
12
12
  super(...arguments);
13
+ this.playbackMode = false;
13
14
  this.collapsed = false;
14
15
  this.loading = false;
15
16
  this.dragEndHandler = this.onDragEnd.bind(this);
@@ -115,7 +116,7 @@ let BoardComponentInfo = class BoardComponentInfo extends LitElement {
115
116
  async updated(changes) {
116
117
  if (changes.has('component')) {
117
118
  this.detailInfo = null;
118
- if ('detailInfo' in this.component) {
119
+ if (!this.playbackMode && 'detailInfo' in this.component) {
119
120
  try {
120
121
  this.loading = true;
121
122
  this.detailInfo = await this.component.detailInfo();
@@ -271,6 +272,9 @@ BoardComponentInfo.styles = [
271
272
  __decorate([
272
273
  property({ type: Object })
273
274
  ], BoardComponentInfo.prototype, "component", void 0);
275
+ __decorate([
276
+ property({ type: Boolean })
277
+ ], BoardComponentInfo.prototype, "playbackMode", void 0);
274
278
  __decorate([
275
279
  state()
276
280
  ], BoardComponentInfo.prototype, "detailInfo", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ox-board-component-info.js","sourceRoot":"","sources":["../../src/ox-board-component-info.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,2CAA2C,CAAA;AAClD,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB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;;;;;;;;;;;;;;KAoFF;CACF,AAvFY,CAuFZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAgB;AAElC;IAAR,KAAK,EAAE;sDAAiB;AAChB;IAAR,KAAK,EAAE;qDAA2B;AAC1B;IAAR,KAAK,EAAE;mDAAyB;AA9FtB,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CAiS9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/progress/linear-progress.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/markdown'\n\nimport { css, html, LitElement, PropertyValues, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-board-component-info')\nexport class BoardComponentInfo extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n background-color: white;\n font-size: 12px;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border: 2px solid var(--primary-color);\n border-radius: 3px;\n\n --md-icon-size: 12px;\n }\n\n [header] {\n background-color: var(--primary-color);\n user-select: none;\n align-items: center;\n color: #eee;\n padding: 0 2px;\n\n display: flex;\n }\n\n md-icon {\n --md-icon-size: 14px;\n\n color: #555;\n align-self: center;\n padding: 0 2px;\n }\n\n [header] md-icon[close] {\n margin-left: auto;\n }\n\n [content] {\n overflow: auto;\n }\n\n table {\n border-collapse: collapse;\n background-color: #fff;\n width: 100%;\n margin: auto;\n }\n\n tr {\n border-bottom: var(--border-dark-color);\n }\n\n td {\n padding: var(--padding-narrow);\n border-right: var(--border-dark-color);\n font-size: 0.8em;\n }\n\n [subTh] {\n text-align: center !important;\n font-weight: bold;\n width: 60px;\n text-transform: capitalize;\n background-color: rgba(0, 0, 0, 0.05);\n }\n\n [split] {\n height: 10px;\n color: #eee;\n background-color: var(--primary-color);\n font-size: 0.8em;\n padding: 0;\n text-align: center;\n }\n\n [location] {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n }\n\n md-linear-progress {\n --md-linear-progress-active-indicator-color: red;\n --md-linear-progress-track-color: #ed788d;\n }\n `\n ]\n\n @property({ type: Object }) component?: any\n\n @state() detailInfo?: any\n @state() collapsed: boolean = false\n @state() loading: boolean = false\n\n private dragStart?: { x: number; y: number }\n\n private dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private dragMoveHandler = this.onDragMove.bind(this) as EventListener\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.collapsed = sessionStorage.getItem('ox-board-component-info-collapsed') == 'true'\n\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n document.removeEventListener('mouseup', this.dragEndHandler)\n document.removeEventListener('mousemove', this.dragMoveHandler)\n }\n\n render() {\n const { state, data } = this.component || {}\n const { id, type } = state || {}\n const details = this.detailInfo || data\n const infos: [key: string, value: string][] =\n details && Object.entries(details).filter(([key, value]) => key != 'ID')\n const identifiable = this.component?.isIdentifiable() || false\n\n return html`\n <div header @mousedown=${this.onDragStart.bind(this)} draggable=\"false\">\n <md-icon @click=${() => (this.collapsed = !this.collapsed)} collapsed\n >${this.collapsed ? 'expand_more' : 'expand_less'}</md-icon\n >\n &nbsp;Object Information\n <md-icon @click=${(e: MouseEvent) => this.dispatchEvent(new CustomEvent('close'))} close>close</md-icon>\n </div>\n ${this.loading\n ? html`<div>\n <md-linear-progress indeterminate></md-linear-progress>\n </div>`\n : nothing}\n\n <div content @wheel=${(e: WheelEvent) => this.onWheel(e)}>\n <table>\n ${identifiable\n ? html`\n <tr>\n <td subTh>\n <div\n location\n @click=${(e: MouseEvent) => {\n this.component.trigger('deco-border', { distance: 8, lineWidth: 4, color: '#f007' })\n this.component.rootModel?.centerTo(this.component, true /* animated */)\n\n return false\n }}\n >\n ${i18next.t('label.id')}&nbsp;<md-icon style=\"color:red;\">location_on</md-icon>\n </div>\n </td>\n <td>${id}</td>\n </tr>\n <tr>\n <td subTh>\n ${i18next.t('label.type')}${!identifiable\n ? html`&nbsp;<md-icon style=\"color:red;\">location_on</md-icon>`\n : html``}\n </td>\n <td>${type}</td>\n </tr>\n `\n : html`\n <tr>\n <td subTh>\n <div\n location\n @click=${(e: MouseEvent) => {\n this.component.trigger('deco-border', { distance: 8, lineWidth: 4, color: '#f007' })\n this.component.rootModel?.centerTo(this.component, true /* animated */)\n\n return false\n }}\n >\n ${i18next.t('label.type')}${!identifiable ? html`&nbsp;<md-icon>location_on</md-icon>` : html``}\n </div>\n </td>\n <td>${type}</td>\n </tr>\n `}\n ${!this.collapsed && infos && !this.loading\n ? html`\n <tr>\n <td split colspan=\"2\">Details</td>\n </tr>\n\n ${infos.map(\n ([key, value]) => html`\n <tr>\n <td subTh>${key}</td>\n <td>${value}</td>\n </tr>\n `\n )}\n `\n : nothing}\n </table>\n </div>\n `\n }\n\n async updated(changes: PropertyValues<this>) {\n if (changes.has('component')) {\n this.detailInfo = null\n\n if ('detailInfo' in this.component) {\n try {\n this.loading = true\n this.detailInfo = await this.component.detailInfo()\n } catch (e) {\n console.error('failed to get detail information')\n } finally {\n this.loading = false\n }\n }\n }\n\n if (changes.has('collapsed')) {\n sessionStorage.setItem('ox-board-component-info-collapsed', this.collapsed ? 'true' : 'false')\n }\n }\n\n onWheel(e: WheelEvent) {\n const scrollableDiv = e.currentTarget! as HTMLElement\n const contentDiv = scrollableDiv.querySelector('table')!\n\n // 컨텐츠의 높이와 div의 높이를 비교하여 수평 스크롤을 동작시키거나 수직 스크롤을 동작시킴\n if (contentDiv.offsetHeight > scrollableDiv.offsetHeight) {\n // 수직 스크롤 가능한 경우\n scrollableDiv.scrollTop += e.deltaY\n } else {\n // 수직 스크롤이 없는 경우\n scrollableDiv.scrollLeft += e.deltaY\n }\n }\n\n onDragStart(e: MouseEvent) {\n e.stopPropagation()\n\n if (e.button == 0) {\n this.dragStart = {\n x: e.clientX,\n y: e.clientY\n }\n }\n\n return false\n }\n\n onDragMove(e: Event) {\n if (!this.dragStart) {\n return false\n }\n\n e.stopPropagation()\n e.preventDefault()\n\n var x = (e as MouseEvent).clientX,\n y = (e as MouseEvent).clientY\n\n const dragStart = { x, y }\n\n x -= this.dragStart.x\n y -= this.dragStart.y\n\n this.dragStart = dragStart\n\n this.style.left =\n Math.min(this.parentElement!.offsetWidth - this.offsetWidth, Math.max(0, this.offsetLeft + x)) + 'px'\n this.style.top =\n Math.min(this.parentElement!.offsetHeight - this.offsetHeight, Math.max(0, this.offsetTop + y)) + 'px'\n\n return false\n }\n\n onDragEnd(e: Event) {\n if (this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n\n delete this.dragStart\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ox-board-component-info.js","sourceRoot":"","sources":["../../src/ox-board-component-info.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,2CAA2C,CAAA;AAClD,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,OAAO,EAAE,MAAM,KAAK,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGhC,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,UAAU;IAA3C;;QA2FwB,iBAAY,GAAY,KAAK,CAAA;QAGjD,cAAS,GAAY,KAAK,CAAA;QAC1B,YAAO,GAAY,KAAK,CAAA;QAIzB,mBAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAkB,CAAA;QAC3D,oBAAe,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAA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C,KAAK,CAAC,IAAI;YACb,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAc,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;QACvG,IAAI,CAAC,KAAK,CAAC,GAAG;YACZ,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,aAAc,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;QAExG,OAAO,KAAK,CAAA;IACd,CAAC;IAED,SAAS,CAAC,CAAQ;QAChB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAA;YACnB,CAAC,CAAC,cAAc,EAAE,CAAA;YAElB,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;IACH,CAAC;;AAhSM,yBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoFF;CACF,AAvFY,CAuFZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAgB;AACd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wDAA8B;AAEjD;IAAR,KAAK,EAAE;sDAAiB;AAChB;IAAR,KAAK,EAAE;qDAA2B;AAC1B;IAAR,KAAK,EAAE;mDAAyB;AA/FtB,kBAAkB;IAD9B,aAAa,CAAC,yBAAyB,CAAC;GAC5B,kBAAkB,CAkS9B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/progress/linear-progress.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/markdown'\n\nimport { css, html, LitElement, PropertyValues, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-board-component-info')\nexport class BoardComponentInfo extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n background-color: white;\n font-size: 12px;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border: 2px solid var(--primary-color);\n border-radius: 3px;\n\n --md-icon-size: 12px;\n }\n\n [header] {\n background-color: var(--primary-color);\n user-select: none;\n align-items: center;\n color: #eee;\n padding: 0 2px;\n\n display: flex;\n }\n\n md-icon {\n --md-icon-size: 14px;\n\n color: #555;\n align-self: center;\n padding: 0 2px;\n }\n\n [header] md-icon[close] {\n margin-left: auto;\n }\n\n [content] {\n overflow: auto;\n }\n\n table {\n border-collapse: collapse;\n background-color: #fff;\n width: 100%;\n margin: auto;\n }\n\n tr {\n border-bottom: var(--border-dark-color);\n }\n\n td {\n padding: var(--padding-narrow);\n border-right: var(--border-dark-color);\n font-size: 0.8em;\n }\n\n [subTh] {\n text-align: center !important;\n font-weight: bold;\n width: 60px;\n text-transform: capitalize;\n background-color: rgba(0, 0, 0, 0.05);\n }\n\n [split] {\n height: 10px;\n color: #eee;\n background-color: var(--primary-color);\n font-size: 0.8em;\n padding: 0;\n text-align: center;\n }\n\n [location] {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n }\n\n md-linear-progress {\n --md-linear-progress-active-indicator-color: red;\n --md-linear-progress-track-color: #ed788d;\n }\n `\n ]\n\n @property({ type: Object }) component?: any\n @property({ type: Boolean }) playbackMode: boolean = false\n\n @state() detailInfo?: any\n @state() collapsed: boolean = false\n @state() loading: boolean = false\n\n private dragStart?: { x: number; y: number }\n\n private dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private dragMoveHandler = this.onDragMove.bind(this) as EventListener\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.collapsed = sessionStorage.getItem('ox-board-component-info-collapsed') == 'true'\n\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n document.removeEventListener('mouseup', this.dragEndHandler)\n document.removeEventListener('mousemove', this.dragMoveHandler)\n }\n\n render() {\n const { state, data } = this.component || {}\n const { id, type } = state || {}\n const details = this.detailInfo || data\n const infos: [key: string, value: string][] =\n details && Object.entries(details).filter(([key, value]) => key != 'ID')\n const identifiable = this.component?.isIdentifiable() || false\n\n return html`\n <div header @mousedown=${this.onDragStart.bind(this)} draggable=\"false\">\n <md-icon @click=${() => (this.collapsed = !this.collapsed)} collapsed\n >${this.collapsed ? 'expand_more' : 'expand_less'}</md-icon\n >\n &nbsp;Object Information\n <md-icon @click=${(e: MouseEvent) => this.dispatchEvent(new CustomEvent('close'))} close>close</md-icon>\n </div>\n ${this.loading\n ? html`<div>\n <md-linear-progress indeterminate></md-linear-progress>\n </div>`\n : nothing}\n\n <div content @wheel=${(e: WheelEvent) => this.onWheel(e)}>\n <table>\n ${identifiable\n ? html`\n <tr>\n <td subTh>\n <div\n location\n @click=${(e: MouseEvent) => {\n this.component.trigger('deco-border', { distance: 8, lineWidth: 4, color: '#f007' })\n this.component.rootModel?.centerTo(this.component, true /* animated */)\n\n return false\n }}\n >\n ${i18next.t('label.id')}&nbsp;<md-icon style=\"color:red;\">location_on</md-icon>\n </div>\n </td>\n <td>${id}</td>\n </tr>\n <tr>\n <td subTh>\n ${i18next.t('label.type')}${!identifiable\n ? html`&nbsp;<md-icon style=\"color:red;\">location_on</md-icon>`\n : html``}\n </td>\n <td>${type}</td>\n </tr>\n `\n : html`\n <tr>\n <td subTh>\n <div\n location\n @click=${(e: MouseEvent) => {\n this.component.trigger('deco-border', { distance: 8, lineWidth: 4, color: '#f007' })\n this.component.rootModel?.centerTo(this.component, true /* animated */)\n\n return false\n }}\n >\n ${i18next.t('label.type')}${!identifiable ? html`&nbsp;<md-icon>location_on</md-icon>` : html``}\n </div>\n </td>\n <td>${type}</td>\n </tr>\n `}\n ${!this.collapsed && infos && !this.loading\n ? html`\n <tr>\n <td split colspan=\"2\">Details</td>\n </tr>\n\n ${infos.map(\n ([key, value]) => html`\n <tr>\n <td subTh>${key}</td>\n <td>${value}</td>\n </tr>\n `\n )}\n `\n : nothing}\n </table>\n </div>\n `\n }\n\n async updated(changes: PropertyValues<this>) {\n if (changes.has('component')) {\n this.detailInfo = null\n\n if (!this.playbackMode && 'detailInfo' in this.component) {\n try {\n this.loading = true\n this.detailInfo = await this.component.detailInfo()\n } catch (e) {\n console.error('failed to get detail information')\n } finally {\n this.loading = false\n }\n }\n }\n\n if (changes.has('collapsed')) {\n sessionStorage.setItem('ox-board-component-info-collapsed', this.collapsed ? 'true' : 'false')\n }\n }\n\n onWheel(e: WheelEvent) {\n const scrollableDiv = e.currentTarget! as HTMLElement\n const contentDiv = scrollableDiv.querySelector('table')!\n\n // 컨텐츠의 높이와 div의 높이를 비교하여 수평 스크롤을 동작시키거나 수직 스크롤을 동작시킴\n if (contentDiv.offsetHeight > scrollableDiv.offsetHeight) {\n // 수직 스크롤 가능한 경우\n scrollableDiv.scrollTop += e.deltaY\n } else {\n // 수직 스크롤이 없는 경우\n scrollableDiv.scrollLeft += e.deltaY\n }\n }\n\n onDragStart(e: MouseEvent) {\n e.stopPropagation()\n\n if (e.button == 0) {\n this.dragStart = {\n x: e.clientX,\n y: e.clientY\n }\n }\n\n return false\n }\n\n onDragMove(e: Event) {\n if (!this.dragStart) {\n return false\n }\n\n e.stopPropagation()\n e.preventDefault()\n\n var x = (e as MouseEvent).clientX,\n y = (e as MouseEvent).clientY\n\n const dragStart = { x, y }\n\n x -= this.dragStart.x\n y -= this.dragStart.y\n\n this.dragStart = dragStart\n\n this.style.left =\n Math.min(this.parentElement!.offsetWidth - this.offsetWidth, Math.max(0, this.offsetLeft + x)) + 'px'\n this.style.top =\n Math.min(this.parentElement!.offsetHeight - this.offsetHeight, Math.max(0, this.offsetTop + y)) + 'px'\n\n return false\n }\n\n onDragEnd(e: Event) {\n if (this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n\n delete this.dragStart\n }\n }\n}\n"]}
@@ -188,7 +188,7 @@ let BoardList = class BoardList extends LitElement {
188
188
  page,
189
189
  limit
190
190
  });
191
- var listParam = {
191
+ const listParam = {
192
192
  filters: this.groupId
193
193
  ? [
194
194
  {
@@ -207,7 +207,7 @@ let BoardList = class BoardList extends LitElement {
207
207
  return (await fetchBoardList(listParam)).boards;
208
208
  }
209
209
  async getFavoriteBoards({ page = 1, limit = 30 } = {}) {
210
- var listParam = {
210
+ const listParam = {
211
211
  pagination: {
212
212
  page,
213
213
  limit
@@ -1 +1 @@
1
- {"version":3,"file":"ox-board-list.js","sourceRoot":"","sources":["../../src/ox-board-list.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAIhG,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAwH+B,cAAS,GAAY,KAAK,CAAA;QAG3B,SAAI,GAA6B,MAAM,CAAA;QAExC,WAAM,GAAU,EAAE,CAAA;QAClB,cAAS,GAAU,EAAE,CAAA;QAEvC,iBAAY,GAAY,KAAK,CAAA;IA2TxC,CAAC;IAvTC,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAA;QAEhC,OAAO,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AAgC,EAAE,OAAY,EAAE,EAAU;QAC/D,QAAQ,CAAC,aAAa,CACpB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK;gBACL,OAAO;gBACP,EAAE;aACH;SACF,CAAC,CACH,CAAA;IACH,CAAC;;AAzbM,gBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHlB,AArHY,CAqHZ;AAE4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAA2B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAwC;AACvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAiB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAmB;AAClB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAsB;AAEvC;IAAR,KAAK,EAAE;+CAA8B;AAEnB;IAAlB,KAAK,CAAC,UAAU,CAAC;wCAAkB;AAlIhC,SAAS;IADd,aAAa,CAAC,eAAe,CAAC;GACzB,SAAS,CA2bd","sourcesContent":["import '@operato/popup/ox-popup.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createBoard, fetchBoardList, fetchFavoriteBoardList, fetchGroupList } from '@fmsim/api'\nimport { Board } from './types'\n\n@customElement('ox-board-list')\nclass BoardList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --md-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n font-size: 1em;\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > md-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n #modes > md-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n #add button md-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-narrow) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters md-icon {\n position: absolute;\n top: 3px;\n color: var(--secondary-color);\n }\n #filters * {\n margin-right: var(--margin-default);\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @state() _showSpinner: boolean = false\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <md-icon>search</md-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group =>\n html` <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option> `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><md-icon @click=${() => this.onCreateBoard()}>add</md-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n\n <oops-spinner ?show=${this._showSpinner}></oops-spinner>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n this._showSpinner = true\n\n const { items: records, total } = await this.getBoards({ page, limit, sorters })\n\n this._showSpinner = false\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'star_border',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'drive_file_rename_outline',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {},\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchGroupList()).groups.items\n\n if (this.groups) {\n await this.refreshBoards()\n }\n }\n\n async getBoards({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteBoards({\n page,\n limit\n })\n\n var listParam = {\n filters: this.groupId\n ? [\n {\n name: 'groupId',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchBoardList(listParam)).boards\n }\n\n async getFavoriteBoards({ page = 1, limit = 30 } = {}) {\n var listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteBoardList(listParam)).favoriteBoards\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateBoard() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <board-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-board=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId } = e.detail\n var board: Board = {\n name,\n description,\n groupId,\n model: {\n width: 1200,\n height: 800\n }\n }\n\n const { createBoard: created } = await createBoard(board)\n\n // this.popup && this.popup.close()\n\n // await sleep(100)\n\n this.notify('info', 'new board created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></board-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}
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AE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAwC;AACvC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAiB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;yCAAmB;AAClB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;4CAAsB;AAEvC;IAAR,KAAK,EAAE;+CAA8B;AAEnB;IAAlB,KAAK,CAAC,UAAU,CAAC;wCAAkB;AAlIhC,SAAS;IADd,aAAa,CAAC,eAAe,CAAC;GACzB,SAAS,CA2bd","sourcesContent":["import '@operato/popup/ox-popup.js'\nimport '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ColumnConfig, DataGrist, GristData, GristRecord, SortersConfig } from '@operato/data-grist'\nimport { OxPopup } from '@operato/popup'\n\nimport { createBoard, fetchBoardList, fetchFavoriteBoardList, fetchGroupList } from '@fmsim/api'\nimport { Board } from './types'\n\n@customElement('ox-board-list')\nclass BoardList extends LitElement {\n static styles = css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n flex: 1;\n --md-icon-size: 20px;\n }\n #mode {\n width: 100px;\n }\n #add {\n width: 50px;\n text-align: right;\n }\n\n #modes > * {\n padding: var(--padding-narrow);\n font-size: 1em;\n opacity: 0.5;\n color: var(--primary-text-color);\n cursor: pointer;\n }\n\n #modes > md-icon[active] {\n border-radius: 9px;\n background-color: rgba(var(--primary-color-rgb), 0.05);\n opacity: 1;\n color: var(--secondary-text-color);\n cursor: default;\n }\n #modes > md-icon:hover {\n opacity: 1;\n color: var(--secondary-text-color);\n }\n\n #add button {\n background-color: var(--status-success-color);\n border: 0;\n border-radius: 50%;\n padding: 5px;\n width: 36px;\n height: 36px;\n cursor: pointer;\n }\n #add button:hover {\n background-color: var(--focus-background-color);\n box-shadow: var(--box-shadow);\n }\n #add button md-icon {\n font-size: 2em;\n color: var(--theme-white-color);\n }\n\n #filters {\n position: relative;\n }\n #filters [type='text'] {\n background-color: transparent;\n border: 0;\n border-bottom: var(--border-dark-color);\n padding: var(--padding-narrow) var(--padding-narrow) 7px 25px;\n font-size: var(--fontsize-large);\n }\n #filters [type='text']:focus {\n outline: none;\n }\n #filters md-icon {\n position: absolute;\n top: 3px;\n color: var(--secondary-color);\n }\n #filters * {\n margin-right: var(--margin-default);\n }\n\n oops-spinner {\n display: none;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n }\n\n oops-spinner[show] {\n display: block;\n }\n\n @media only screen and (max-width: 460px) {\n #modes {\n display: none;\n }\n }\n `\n\n @property({ type: Boolean }) creatable: boolean = false\n @property({ type: Object }) config: any\n @property({ type: Object }) data: any\n @property({ type: String }) mode: 'GRID' | 'LIST' | 'CARD' = 'CARD'\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) favorites: any[] = []\n\n @state() _showSpinner: boolean = false\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n const mode = this.mode || 'CARD'\n\n return html`\n <ox-grist .config=${this.config} .mode=${mode} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n <div id=\"filters\">\n <md-icon>search</md-icon>\n <input type=\"text\" />\n\n <select\n @change=${(e: Event) => {\n this.groupId = (e.currentTarget as HTMLInputElement).value\n this.requestUpdate()\n }}\n >\n <option value=\"\">*</option>\n ${this.groups.map(\n group =>\n html` <option value=${group.id} ?selected=${group.id === this.groupId}>${group.description}</option> `\n )}\n </select>\n </div>\n\n <div id=\"modes\">\n <md-icon @click=${() => (this.mode = 'GRID')} ?active=${mode == 'GRID'}>grid_on</md-icon>\n <md-icon @click=${() => (this.mode = 'LIST')} ?active=${mode == 'LIST'}>format_list_bulleted</md-icon>\n <md-icon @click=${() => (this.mode = 'CARD')} ?active=${mode == 'CARD'}>apps</md-icon>\n </div>\n\n ${this.creatable\n ? html`\n <div id=\"add\">\n <button><md-icon @click=${() => this.onCreateBoard()}>add</md-icon></button>\n </div>\n `\n : undefined}\n </div>\n </ox-grist>\n\n <oops-spinner ?show=${this._showSpinner}></oops-spinner>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n this._showSpinner = true\n\n const { items: records, total } = await this.getBoards({ page, limit, sorters })\n\n this._showSpinner = false\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: function (record: GristRecord, rowIndex: number) {\n return html` <img src=${record.thumbnail} style=\"width: 100%; height: 100%;\" /> `\n },\n fields: ['name', 'description'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'star_border',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'drive_file_rename_outline',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {}\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'boolean',\n name: 'active',\n header: 'active',\n record: {\n editable: true\n },\n sortable: true,\n width: 60\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {},\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async refresh() {\n this.groups = (await fetchGroupList()).groups.items\n\n if (this.groups) {\n await this.refreshBoards()\n }\n }\n\n async getBoards({\n page = 1,\n limit = 30,\n sorters = []\n }: { page?: number; limit?: number; sorters?: SortersConfig } = {}) {\n if (this.groupId && this.groupId == 'favor')\n return await this.getFavoriteBoards({\n page,\n limit\n })\n\n const listParam = {\n filters: this.groupId\n ? [\n {\n name: 'groupId',\n operator: 'eq',\n value: this.groupId\n }\n ]\n : [],\n sortings: sorters,\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchBoardList(listParam)).boards\n }\n\n async getFavoriteBoards({ page = 1, limit = 30 } = {}) {\n const listParam = {\n pagination: {\n page,\n limit\n }\n }\n\n return (await fetchFavoriteBoardList(listParam)).favoriteBoards\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n this.grist.fetch()\n }\n\n async onCreateBoard() {\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var template = html`\n <board-creation-popup\n .defaultGroup=${this.groupId}\n .groups=${this.groups}\n @create-board=${async (e: CustomEvent) => {\n try {\n var { name, description, groupId } = e.detail\n var board: Board = {\n name,\n description,\n groupId,\n model: {\n width: 1200,\n height: 800\n }\n }\n\n const { createBoard: created } = await createBoard(board)\n\n // this.popup && this.popup.close()\n\n // await sleep(100)\n\n this.notify('info', 'new board created')\n } catch (ex: Error | any) {\n console.error(ex)\n this.notify('error', ex, ex)\n }\n }}\n ></board-creation-popup>\n `\n\n OxPopup.open({\n template,\n parent: this.renderRoot as Element\n })\n\n requestAnimationFrame(() => {\n dispatchEvent(new Event('resize'))\n })\n }\n\n notify(level: 'warn' | 'error' | 'info', message: any, ex?: Error) {\n document.dispatchEvent(\n new CustomEvent('notify', {\n detail: {\n level,\n message,\n ex\n }\n })\n )\n }\n}\n"]}