maybeFunctionAttribute.js 790 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.MaybeFunctionAttribute = void 0;
  4. const util_1 = require("@antv/util");
  5. /**
  6. * Mark functional attribute constant.
  7. */
  8. const MaybeFunctionAttribute = () => {
  9. return (I, mark) => {
  10. const { style = {} } = mark;
  11. return [
  12. I,
  13. (0, util_1.deepMix)({}, mark, {
  14. style: Object.assign(Object.assign({}, style), Object.fromEntries(Object.entries(style)
  15. .filter(([, v]) => typeof v === 'function')
  16. .map(([k, v]) => [k, () => v]))),
  17. }),
  18. ];
  19. };
  20. };
  21. exports.MaybeFunctionAttribute = MaybeFunctionAttribute;
  22. exports.MaybeFunctionAttribute.props = {};
  23. //# sourceMappingURL=maybeFunctionAttribute.js.map