Polygon.js 1.2 KB

1234567891011121314151617181920212223242526
  1. var __assign = (this && this.__assign) || function () {
  2. __assign = Object.assign || function(t) {
  3. for (var s, i = 1, n = arguments.length; i < n; i++) {
  4. s = arguments[i];
  5. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  6. t[p] = s[p];
  7. }
  8. return t;
  9. };
  10. return __assign.apply(this, arguments);
  11. };
  12. import { h } from '@logicflow/core';
  13. export default function Polygon(_a) {
  14. var _b = _a.fillOpacity, fillOpacity = _b === void 0 ? 1 : _b, _c = _a.strokeWidth, strokeWidth = _c === void 0 ? 1 : _c, _d = _a.strokeOpacity, strokeOpacity = _d === void 0 ? 1 : _d, _e = _a.fill, fill = _e === void 0 ? 'transparent' : _e, _f = _a.stroke, stroke = _f === void 0 ? '#000' : _f, points = _a.points, _g = _a.className, className = _g === void 0 ? 'lf-basic-shape' : _g;
  15. var attrs = {
  16. fill: fill,
  17. fillOpacity: fillOpacity,
  18. strokeWidth: strokeWidth,
  19. stroke: stroke,
  20. strokeOpacity: strokeOpacity,
  21. points: '',
  22. className: className,
  23. };
  24. attrs.points = points.map(function (point) { return point.join(','); }).join(' ');
  25. return (h("polygon", __assign({}, attrs)));
  26. }