model.js 406 B

12345678910111213141516171819202122232425
  1. import { getElementId, randomCode, deepCopy } from "../../plugins/utils";
  2. const MODEL = {
  3. type: "FILL_FIELD",
  4. x: 0,
  5. y: 0,
  6. w: 200,
  7. h: 100,
  8. sign: "",
  9. fieldCountPerLine: 1,
  10. lineSpacing: 30,
  11. nameIsJustify: false,
  12. fields: [],
  13. fieldInfos: {}
  14. };
  15. const getModel = () => {
  16. return {
  17. id: getElementId(),
  18. key: randomCode(),
  19. ...deepCopy(MODEL)
  20. };
  21. };
  22. export { MODEL, getModel };