How to use the @pluginjs/template.render function in @pluginjs/template

To help you get started, we’ve selected a few @pluginjs/template examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pluginjs / pluginjs / modules / modal / src / main.js View on Github external
if (this.options.title !== '') {
      title = templateEngine.render(this.options.templates.title.call(this), {
        classes: this.classes
      })
    }

    if (this.options.content !== '') {
      content = templateEngine.render(
        this.options.templates.content.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.buttons) {
      buttons = templateEngine.render(
        this.options.templates.buttons.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.icon) {
      icon = templateEngine.render(this.options.templates.icon.call(this), {
        classes: this.classes,
        iconClass: this.getIconClass()
      })
      this.$icon = parseHTML(icon)
    }

    const html = templateEngine.render(this.options.template.call(this), {
      classes: this.classes,
      overlay,
github pluginjs / pluginjs / modules / modal / src / main.js View on Github external
if (this.options.overlay) {
      overlay = templateEngine.render(
        this.options.templates.overlay.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.title !== '') {
      title = templateEngine.render(this.options.templates.title.call(this), {
        classes: this.classes
      })
    }

    if (this.options.content !== '') {
      content = templateEngine.render(
        this.options.templates.content.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.buttons) {
      buttons = templateEngine.render(
        this.options.templates.buttons.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.icon) {
      icon = templateEngine.render(this.options.templates.icon.call(this), {
        classes: this.classes,
        iconClass: this.getIconClass()
github pluginjs / pluginjs / modules / paginator / src / components / list.js View on Github external
generatePrev() {
    return templateEngine.render(this.options.templates.prev.call(this), {
      classes: this.instance.classes,
      label: this.instance.translate('listPrev', { count: this.visibleSize })
    })
  }
github pluginjs / pluginjs / modules / sticky / src / main.js View on Github external
initWrap() {
    this.$wrap = closest(this.options.wrapSelector, this.element)
    if (!this.$wrap || this.$wrap !== parent(this.element)) {
      this.$wrap = wrap(
        template.render(this.options.templates.wrap.call(this), {
          classes: this.classes
        }),
        this.element
      )
    }
  }
github pluginjs / pluginjs / modules / time-table / src / components / month / monthly.js View on Github external
getElement(type) {
    const template = this.options.templates[type]
    let html = ''
    if (template) {
      html = templateEngine.render(template.call(this), { class: this.classes })
    }
    return parseHTML(html)
  }
github pluginjs / pluginjs / modules / modal / src / main.js View on Github external
if (this.options.content !== '') {
      content = templateEngine.render(
        this.options.templates.content.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.buttons) {
      buttons = templateEngine.render(
        this.options.templates.buttons.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.icon) {
      icon = templateEngine.render(this.options.templates.icon.call(this), {
        classes: this.classes,
        iconClass: this.getIconClass()
      })
      this.$icon = parseHTML(icon)
    }

    const html = templateEngine.render(this.options.template.call(this), {
      classes: this.classes,
      overlay,
      close,
      title,
      content,
      buttons
    })
    return html
  }
github pluginjs / pluginjs / modules / notice / src / main.js View on Github external
this.options.templates.content.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.buttons) {
      buttons = templateEngine.render(
        this.options.templates.buttons.call(this),
        {
          classes: this.classes,
          buttons: this.createBtns()
        }
      )
    }

    const html = templateEngine.render(this.options.template.call(this), {
      classes: this.classes,
      close,
      content,
      buttons
    })
    return html
  }
github pluginjs / pluginjs / modules / grids / src / components / toolbar.js View on Github external
classes: this.classes
        }
      )
    }

    if (this.opts.sort) {
      this.sort = templateEngine.render(
        this.api.options.templates.sort.call(this),
        {
          classes: this.classes
        }
      )
    }

    if (this.opts.reverse) {
      this.reverse = templateEngine.render(
        this.api.options.templates.reverse.call(this),
        {
          classes: this.classes
        }
      )
    }

    this.toolbar = templateEngine.render(
      this.api.options.templates.toolbar.call(this),
      {
        classes: this.classes,
        filters: this.filters,
        sort: this.sort,
        reverse: this.reverse
      }
    )
github pluginjs / pluginjs / modules / breadcrumb / src / main.js View on Github external
createDropdown() {
    this.$dropdown = addClass(
      this.classes.HIDDEN,
      parseHTML(
        templateEngine.render(this.options.templates.dropdown.call(this), {
          classes: this.classes,
          text: this.options.responsiveText
        })
      )
    )

    if (this.options.overflow === 'right') {
      addClass(this.classes.DROPDOWNRIGHT, this.$dropdown)
      append(this.$dropdown, this.element)
    } else {
      prepend(this.$dropdown, this.element)
    }
  }
github pluginjs / pluginjs / modules / modal / src / main.js View on Github external
if (this.options.buttons) {
      buttons = templateEngine.render(
        this.options.templates.buttons.call(this),
        { classes: this.classes }
      )
    }

    if (this.options.icon) {
      icon = templateEngine.render(this.options.templates.icon.call(this), {
        classes: this.classes,
        iconClass: this.getIconClass()
      })
      this.$icon = parseHTML(icon)
    }

    const html = templateEngine.render(this.options.template.call(this), {
      classes: this.classes,
      overlay,
      close,
      title,
      content,
      buttons
    })
    return html
  }

@pluginjs/template

A workflow for modern frontend development.

GPL-3.0
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Similar packages