Comparing version 0.8.6 to 0.8.7
@@ -82,3 +82,4 @@ function _define_property(obj, key, value) { | ||
const runeDataset = 'data-rune="'.concat(this, '" data-rune-parent="').concat(this.parentView, '"'); | ||
html = startTag.includes('class="') ? html.replace('class="', "".concat(runeDataset, ' class="').concat(this, " ")) : startTag.includes("class='") ? html.replace("class='", "".concat(runeDataset, " class='").concat(this, " ")) : html.replace("<".concat(startTagName), "<".concat(startTagName, " ").concat(runeDataset, ' class="').concat(this, '"')); | ||
const className = this.className ? "".concat(this, " ").concat(this.className) : "".concat(this); | ||
html = startTag.includes('class="') ? html.replace('class="', "".concat(runeDataset, ' class="').concat(className, " ")) : startTag.includes("class='") ? html.replace("class='", "".concat(runeDataset, " class='").concat(className, " ")) : html.replace("<".concat(startTagName), "<".concat(startTagName, " ").concat(runeDataset, ' class="').concat(className, '"')); | ||
return isSSR ? html.replace(html, "".concat(html, '<script class="__RUNE_DATA__ ').concat(this, '" type="application/json">').concat(_htmlEscapeJsonString(JSON.stringify({ | ||
@@ -136,2 +137,3 @@ data: this.data, | ||
_define_property(this, "_currentHtml", null); | ||
_define_property(this, "className", ""); | ||
this._data = data; | ||
@@ -138,0 +140,0 @@ this._args = args; |
@@ -11,2 +11,3 @@ import { Base } from './Base'; | ||
protected _currentHtml: string | null; | ||
className: string; | ||
get data(): T; | ||
@@ -13,0 +14,0 @@ set data(data: T); |
@@ -112,3 +112,4 @@ "use strict"; | ||
const runeDataset = 'data-rune="'.concat(this, '" data-rune-parent="').concat(this.parentView, '"'); | ||
html = startTag.includes('class="') ? html.replace('class="', "".concat(runeDataset, ' class="').concat(this, " ")) : startTag.includes("class='") ? html.replace("class='", "".concat(runeDataset, " class='").concat(this, " ")) : html.replace("<".concat(startTagName), "<".concat(startTagName, " ").concat(runeDataset, ' class="').concat(this, '"')); | ||
const className = this.className ? "".concat(this, " ").concat(this.className) : "".concat(this); | ||
html = startTag.includes('class="') ? html.replace('class="', "".concat(runeDataset, ' class="').concat(className, " ")) : startTag.includes("class='") ? html.replace("class='", "".concat(runeDataset, " class='").concat(className, " ")) : html.replace("<".concat(startTagName), "<".concat(startTagName, " ").concat(runeDataset, ' class="').concat(className, '"')); | ||
return isSSR ? html.replace(html, "".concat(html, '<script class="__RUNE_DATA__ ').concat(this, '" type="application/json">').concat((0, _htmlEscapeJsonString._htmlEscapeJsonString)(JSON.stringify({ | ||
@@ -166,2 +167,3 @@ data: this.data, | ||
_define_property(this, "_currentHtml", null); | ||
_define_property(this, "className", ""); | ||
this._data = data; | ||
@@ -168,0 +170,0 @@ this._args = args; |
{ | ||
"name": "rune-ts", | ||
"version": "0.8.6", | ||
"version": "0.8.7", | ||
"description": "Rune Core Library", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -18,2 +18,3 @@ import { _escape } from './lib/_escape'; | ||
protected _currentHtml: string | null = null; | ||
className = ''; | ||
@@ -58,7 +59,9 @@ get data(): T { | ||
const runeDataset = `data-rune="${this}" data-rune-parent="${this.parentView}"`; | ||
const className = this.className ? `${this} ${this.className}` : `${this}`; | ||
html = startTag.includes('class="') | ||
? html.replace('class="', `${runeDataset} class="${this} `) | ||
? html.replace('class="', `${runeDataset} class="${className} `) | ||
: startTag.includes("class='") | ||
? html.replace("class='", `${runeDataset} class='${this} `) | ||
: html.replace(`<${startTagName}`, `<${startTagName} ${runeDataset} class="${this}"`); | ||
? html.replace("class='", `${runeDataset} class='${className} `) | ||
: html.replace(`<${startTagName}`, `<${startTagName} ${runeDataset} class="${className}"`); | ||
@@ -65,0 +68,0 @@ return isSSR |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
291167
5282