diff --git a/packages/core/examples/test/api.html b/packages/core/examples/test/api.html index 68561a6..cb58688 100644 --- a/packages/core/examples/test/api.html +++ b/packages/core/examples/test/api.html @@ -22,7 +22,7 @@ } .box { width: 300; - min-height: 220; + min-height: 242; float: left; border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; @@ -58,6 +58,39 @@
idraw.resetSize
+
+
idraw.selectElement
+
+
+
idraw.selectElementByIndex
+
+
+
idraw.updateElement
+
+
+
idraw.addElement
+
+
+
idraw.deleteElement
+
+
+
idraw.moveUpElement
+
+
+
idraw.moveDownElement
+
+
+
idraw.scale
+
+
+
idraw.scrollLeft
+
+
+
idraw.scrollTop
+
+ @@ -145,8 +178,8 @@ const mount = document.querySelector('#idraw-config'); const core = new Core(mount, Object.assign({}, opts, { - contextWidth: 700, - contextHeight: 500, + contextWidth: 500, + contextHeight: 400, }), { scrollWrapper: { @@ -179,8 +212,8 @@ const core = new Core( mount, Object.assign({}, opts, { - contextWidth: 700, - contextHeight: 500, + contextWidth: 500, + contextHeight: 400, }), { scrollWrapper: { @@ -205,8 +238,8 @@ const core = new Core( mount, Object.assign({}, opts, { - contextWidth: 700, - contextHeight: 500, + contextWidth: 500, + contextHeight: 400, }), { scrollWrapper: { @@ -220,7 +253,7 @@ width: 280, height: 160, contextWidth: 600, - contextHeight: 500, + contextHeight: 400, }) }, 20) })(); @@ -231,13 +264,13 @@ import { getData } from './data.js'; import event from './../../../../scripts/browser/event.js'; (function() { - const mount = document.querySelector('#idraw-api-resetSize'); + const mount = document.querySelector('#idraw-api-selectElement'); const data = getData(); const core = new Core( mount, Object.assign({}, opts, { - contextWidth: 700, - contextHeight: 500, + contextWidth: 500, + contextHeight: 400, }), { scrollWrapper: { @@ -246,16 +279,239 @@ } ); core.setData(data); - setTimeout(() => { - core.resetSize({ - width: 280, - height: 160, - contextWidth: 600, - contextHeight: 500, - }) - }, 20) + core.selectElement(core.getData().elements[2].uuid); })(); + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/core/examples/test/data.js b/packages/core/examples/test/data.js index 532f829..9cff158 100644 --- a/packages/core/examples/test/data.js +++ b/packages/core/examples/test/data.js @@ -9,10 +9,10 @@ const data = { h: 50, type: "rect", desc: { - color: "#f0f0f0", + color: "#ffeb3b", borderRadius: 10, borderWidth: 5, - borderColor: "#bd0b64", + borderColor: "#ffc107", }, }, { @@ -24,20 +24,21 @@ const data = { // angle: 30, type: "text", desc: { - fontSize: 14, + fontSize: 16, text: "Hello Text", + fontWeight: 'bold', color: "#666666", borderRadius: 30, - borderWidth: 2, - borderColor: "#bd0b64", + borderWidth: 4, + borderColor: "#ff5722", }, }, { name: "image-003", x: 80, y: 80, - w: 100, - h: 50, + w: 160, + h: 80, type: "image", desc: { src: './../images/computer.png',