Node-Red configuration
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

rendering.js 1.2KB

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.HTML = exports.controlClassTemplate = exports.composeLEDElementIdTemplate = void 0;
  4. const rendering_1 = require("./shared/rendering");
  5. // TODO: switch from _ to - to ensure we don't ever collide with any class and to make more readable as different than a description (led_container vs led-31343, etc)
  6. const composeLEDElementIdTemplate = () => {
  7. return String.raw `led_{{$id}}`;
  8. };
  9. exports.composeLEDElementIdTemplate = composeLEDElementIdTemplate;
  10. exports.controlClassTemplate = String.raw `led_{{$id}}`;
  11. /**
  12. * Generate our dashboard HTML code
  13. * @param {object} config - The node's config instance
  14. * @param {object} ledStyle - Style attribute of our LED span in in-line CSS format
  15. */
  16. const HTML = (config, color, glow, sizeMultiplier) => {
  17. // text-align: ` + config.labelAlignment + `
  18. return rendering_1.control(exports.controlClassTemplate, exports.composeLEDElementIdTemplate(), config.label, config.labelPlacement || 'left', config.labelAlignment || 'left', config.shape || 'circle', color, glow, sizeMultiplier);
  19. };
  20. exports.HTML = HTML;
  21. //# sourceMappingURL=rendering.js.map