@stylable/runtime
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -59,11 +59,13 @@ "use strict"; | ||
var item = arguments[i]; | ||
if (typeof item === 'string') { | ||
classNames.push(item); | ||
} | ||
else if (i >= 1) { | ||
for (var stateName in item) { | ||
var stateValue = item[stateName]; | ||
var stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames.push(stateClass); | ||
if (item) { | ||
if (typeof item === 'string') { | ||
classNames[classNames.length] = item; | ||
} | ||
else if (i === 1) { | ||
for (var stateName in item) { | ||
var stateValue = item[stateName]; | ||
var stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames[classNames.length] = stateClass; | ||
} | ||
} | ||
@@ -70,0 +72,0 @@ } |
@@ -22,3 +22,3 @@ export declare type StateValue = boolean | number | string; | ||
cssStates: (stateMap: StateMap) => string; | ||
style: (context: string, stateOrClass: string | StateMap, ...classes: string[]) => string; | ||
style: (context: string, stateOrClass: string | StateMap | undefined, ...classes: Array<string | undefined>) => string; | ||
} | ||
@@ -25,0 +25,0 @@ export interface NodeRenderer<I, O extends Element> { |
{ | ||
"name": "@stylable/runtime", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Stylable runtime DOM integration", | ||
@@ -34,3 +34,3 @@ "main": "cjs/index.js", | ||
"license": "BSD-3-Clause", | ||
"gitHead": "feb73fcd4e1045b44b095f589638892859d3ffd7" | ||
"gitHead": "29404c70e6801fedf67b9982ef1632750a798b57" | ||
} |
@@ -1,2 +0,2 @@ | ||
/* runtime version: 2.0.0 */ | ||
/* runtime version: 2.0.1 */ | ||
function StylableRuntime(exports){ | ||
@@ -226,11 +226,13 @@ exports = exports || {}; | ||
var item = arguments[i]; | ||
if (typeof item === 'string') { | ||
classNames.push(item); | ||
} | ||
else if (i >= 1) { | ||
for (var stateName in item) { | ||
var stateValue = item[stateName]; | ||
var stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames.push(stateClass); | ||
if (item) { | ||
if (typeof item === 'string') { | ||
classNames[classNames.length] = item; | ||
} | ||
else if (i === 1) { | ||
for (var stateName in item) { | ||
var stateValue = item[stateName]; | ||
var stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames[classNames.length] = stateClass; | ||
} | ||
} | ||
@@ -237,0 +239,0 @@ } |
@@ -86,10 +86,12 @@ import { RuntimeRenderer } from './css-runtime-renderer'; | ||
if (typeof item === 'string') { | ||
classNames.push(item); | ||
} else if (i >= 1) { | ||
for (const stateName in item) { | ||
const stateValue = item[stateName]; | ||
const stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames.push(stateClass); | ||
if (item) { | ||
if (typeof item === 'string') { | ||
classNames[classNames.length] = item; | ||
} else if (i === 1) { | ||
for (const stateName in item) { | ||
const stateValue = item[stateName]; | ||
const stateClass = createStateClass(stateName, stateValue); | ||
if (stateClass) { | ||
classNames[classNames.length] = stateClass; | ||
} | ||
} | ||
@@ -96,0 +98,0 @@ } |
@@ -27,3 +27,7 @@ export type StateValue = boolean | number | string; | ||
cssStates: (stateMap: StateMap) => string; | ||
style: (context: string, stateOrClass: string | StateMap, ...classes: string[]) => string; | ||
style: ( | ||
context: string, | ||
stateOrClass: string | StateMap | undefined, | ||
...classes: Array<string | undefined> | ||
) => string; | ||
} | ||
@@ -30,0 +34,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51295
887