token.js 1.1 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.prepareComponentToken = void 0;
  6. var _fastColor = require("@ant-design/fast-color");
  7. var _token = require("../../input/style/token");
  8. const prepareComponentToken = token => {
  9. var _a;
  10. const handleVisible = (_a = token.handleVisible) !== null && _a !== void 0 ? _a : 'auto';
  11. const handleWidth = token.controlHeightSM - token.lineWidth * 2;
  12. return Object.assign(Object.assign({}, (0, _token.initComponentToken)(token)), {
  13. controlWidth: 90,
  14. handleWidth,
  15. handleFontSize: token.fontSize / 2,
  16. handleVisible,
  17. handleActiveBg: token.colorFillAlter,
  18. handleBg: token.colorBgContainer,
  19. filledHandleBg: new _fastColor.FastColor(token.colorFillSecondary).onBackground(token.colorBgContainer).toHexString(),
  20. handleHoverColor: token.colorPrimary,
  21. handleBorderColor: token.colorBorder,
  22. handleOpacity: handleVisible === true ? 1 : 0,
  23. handleVisibleWidth: handleVisible === true ? handleWidth : 0
  24. });
  25. };
  26. exports.prepareComponentToken = prepareComponentToken;