Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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