primitive.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. export var PRIMILTIVE_ATTRIBUTES = [
  2. '$el',
  3. 'anchor',
  4. 'cx',
  5. 'cy',
  6. 'd',
  7. 'defX',
  8. 'defY',
  9. 'dx',
  10. 'dy',
  11. 'fill',
  12. 'fillOpacity',
  13. 'filter',
  14. 'fontFamily',
  15. 'fontSize',
  16. 'fontStyle',
  17. 'fontVariant',
  18. 'fontWeight',
  19. 'height',
  20. 'img',
  21. 'increasedLineWidthForHitTesting',
  22. 'innerHTML',
  23. 'isBillboard',
  24. 'isClosed',
  25. 'isOverflowing',
  26. 'leading',
  27. 'letterSpacing',
  28. 'lineDash',
  29. 'lineHeight',
  30. 'lineWidth',
  31. 'markerEnd',
  32. 'markerEndOffset',
  33. 'markerMid',
  34. 'markerStart',
  35. 'markerStartOffset',
  36. 'maxLines',
  37. 'metrics',
  38. 'miterLimit',
  39. 'offsetX',
  40. 'offsetY',
  41. 'opacity',
  42. 'path',
  43. 'points',
  44. 'r',
  45. 'radius',
  46. 'rx',
  47. 'ry',
  48. 'shadowColor',
  49. 'src',
  50. 'stroke',
  51. 'strokeOpacity',
  52. 'text',
  53. 'textAlign',
  54. 'textBaseline',
  55. 'textDecorationColor',
  56. 'textDecorationLine',
  57. 'textDecorationStyle',
  58. 'textOverflow',
  59. 'textPath',
  60. 'textPathSide',
  61. 'textPathStartOffset',
  62. 'transform',
  63. 'transformOrigin',
  64. 'visibility',
  65. 'width',
  66. 'wordWrap',
  67. 'wordWrapWidth',
  68. 'x',
  69. 'x1',
  70. 'x2',
  71. 'y',
  72. 'y1',
  73. 'y2',
  74. 'z1',
  75. 'z2',
  76. 'zIndex',
  77. ];
  78. export function isPrimitiveAttribute(key) {
  79. return PRIMILTIVE_ATTRIBUTES.includes(key);
  80. }
  81. export function getPrimitiveAttributes(attributes) {
  82. var object = {};
  83. for (var key in attributes) {
  84. if (isPrimitiveAttribute(key))
  85. object[key] = attributes[key];
  86. }
  87. return object;
  88. }
  89. //# sourceMappingURL=primitive.js.map