q-colorize-mixin
Advanced tools
Comparing version 1.0.10 to 2.0.0-alpha.1
/*! | ||
* q-colorize-mixin v1.0.10 | ||
* (c) 2020 Jeff Galbraith <jeff@quasar.dev> | ||
* q-colorize-mixin v2.0.0-alpha.1 | ||
* (c) 2021 Jeff Galbraith <jeff@quasar.dev> | ||
* Released under the MIT License. | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var version="1.0.10",CSS_COLOR_NAMES=["transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],QColorizeMixin={name:"QColorizeMixin",props:{color:String},methods:{isNamedCssColor:function(e){return!!e&&CSS_COLOR_NAMES.includes(e.toLowerCase())},isCssColor:function(e){return!!e&&(!!e.match(/^(#|(rgb|hsl)a?\()/)||this.isNamedCssColor(e))},isCssVar:function(e){return!!e&&e.startsWith("--")},calculateColor:function(e,r){return void 0===r&&(r="black"),void 0===e&&void 0!==r?this.calculateColor(r):this.isCssColor(e)?e:this.makeQuasarColorVar(e,r)},makeQuasarColorVar:function(e,r){return"var("+(this.isCssVar(e)?e:"--q-color-"+e)+", '"+r+"')"},isValidCssColor:function(e){return this.isCssColor(e)||this.isCssVar(e)},setBothColors:function(e,r,o){return void 0===o&&(o={}),this.setTextColor(e,this.setBackgroundColor(r,o))},setBackgroundColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"background-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["bg-"+l]=!0,o))}return r},setTextColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{color:""+i,"caret-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["text-"+l]=!0,o))}return r},setBorderColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"border-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["border-color-"+l]=!0,o))}return r}}};QColorizeMixin.version=version;var index={QColorizeMixin:QColorizeMixin,version:version,install:function(e){e.component(QColorizeMixin.name,QColorizeMixin)}};exports.QColorizeMixin=QColorizeMixin,exports.default=index,exports.version=version; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var version="2.0.0-alpha.1",CSS_COLOR_NAMES=["transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"];function QColorizeMixin(){function e(e){return!!e&&CSS_COLOR_NAMES.includes(e.toLowerCase())}function r(r){return!!r&&(!!r.match(/^(#|(rgb|hsl)a?\()/)||e(r))}function o(e){return!!e&&e.startsWith("--")}function i(e,o){return void 0===o&&(o="black"),void 0===e&&void 0!==o?i(o):r(e)?e:l(e,o)}function l(e,r){return"var("+(o(e)?e:"--q-color-"+e)+", '"+r+"')"}function a(e){return r(e)||o(e)}function n(e,r){var o;if(void 0===r&&(r={}),a(e)){var l=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"background-color":""+l})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["bg-"+n]=!0,o))}return r}function s(e,r){var o;if(void 0===r&&(r={}),a(e)){var l=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{color:""+l,"caret-color":""+l})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["text-"+n]=!0,o))}return r}return{isNamedCssColor:e,isCssColor:r,isCssVar:o,calculateColor:i,makeQuasarColorVar:l,isValidCssColor:a,setBothColors:function(e,r,o){return void 0===o&&(o={}),s(e,n(r,o))},setBackgroundColor:n,setTextColor:s,setBorderColor:function(e,r){var o;if(void 0===r&&(r={}),a(e)){var l=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"border-color":""+l})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["border-color-"+n]=!0,o))}return r}}}QColorizeMixin.version=version;var index={QColorizeMixin:QColorizeMixin,version:version,install:function(e){e.component(QColorizeMixin.name,QColorizeMixin)}};exports.QColorizeMixin=QColorizeMixin,exports.default=index,exports.version=version; |
/*! | ||
* q-colorize-mixin v1.0.10 | ||
* (c) 2020 Jeff Galbraith <jeff@quasar.dev> | ||
* q-colorize-mixin v2.0.0-alpha.1 | ||
* (c) 2021 Jeff Galbraith <jeff@quasar.dev> | ||
* Released under the MIT License. | ||
*/ | ||
var version="1.0.10",CSS_COLOR_NAMES=["transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],QColorizeMixin={name:"QColorizeMixin",props:{color:String},methods:{isNamedCssColor:function(e){return!!e&&CSS_COLOR_NAMES.includes(e.toLowerCase())},isCssColor:function(e){return!!e&&(!!e.match(/^(#|(rgb|hsl)a?\()/)||this.isNamedCssColor(e))},isCssVar:function(e){return!!e&&e.startsWith("--")},calculateColor:function(e,r){return void 0===r&&(r="black"),void 0===e&&void 0!==r?this.calculateColor(r):this.isCssColor(e)?e:this.makeQuasarColorVar(e,r)},makeQuasarColorVar:function(e,r){return"var("+(this.isCssVar(e)?e:"--q-color-"+e)+", '"+r+"')"},isValidCssColor:function(e){return this.isCssColor(e)||this.isCssVar(e)},setBothColors:function(e,r,o){return void 0===o&&(o={}),this.setTextColor(e,this.setBackgroundColor(r,o))},setBackgroundColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"background-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["bg-"+l]=!0,o))}return r},setTextColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{color:""+i,"caret-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["text-"+l]=!0,o))}return r},setBorderColor:function(e,r){var o;if(void 0===r&&(r={}),this.isValidCssColor(e)){var i=this.calculateColor(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"border-color":""+i})}else if(e){var l=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((o={})["border-color-"+l]=!0,o))}return r}}};QColorizeMixin.version=version;var index={QColorizeMixin:QColorizeMixin,version:version,install:function(e){e.component(QColorizeMixin.name,QColorizeMixin)}};export default index;export{QColorizeMixin,version}; | ||
var version="2.0.0-alpha.1",CSS_COLOR_NAMES=["transparent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"];function QColorizeMixin(){function e(e){return!!e&&CSS_COLOR_NAMES.includes(e.toLowerCase())}function r(r){return!!r&&(!!r.match(/^(#|(rgb|hsl)a?\()/)||e(r))}function l(e){return!!e&&e.startsWith("--")}function i(e,l){return void 0===l&&(l="black"),void 0===e&&void 0!==l?i(l):r(e)?e:o(e,l)}function o(e,r){return"var("+(l(e)?e:"--q-color-"+e)+", '"+r+"')"}function a(e){return r(e)||l(e)}function n(e,r){var l;if(void 0===r&&(r={}),a(e)){var o=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"background-color":""+o})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((l={})["bg-"+n]=!0,l))}return r}function t(e,r){var l;if(void 0===r&&(r={}),a(e)){var o=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{color:""+o,"caret-color":""+o})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((l={})["text-"+n]=!0,l))}return r}return{isNamedCssColor:e,isCssColor:r,isCssVar:l,calculateColor:i,makeQuasarColorVar:o,isValidCssColor:a,setBothColors:function(e,r,l){return void 0===l&&(l={}),t(e,n(r,l))},setBackgroundColor:n,setTextColor:t,setBorderColor:function(e,r){var l;if(void 0===r&&(r={}),a(e)){var o=i(e);void 0===r.style&&(r.style={}),r.style=Object.assign({},r.style,{"border-color":""+o})}else if(e){var n=e.toString().trim();void 0===r.class&&(r.class={}),r.class=Object.assign({},r.class,((l={})["border-color-"+n]=!0,l))}return r}}}QColorizeMixin.version=version;var index={QColorizeMixin:QColorizeMixin,version:version,install:function(e){e.component(QColorizeMixin.name,QColorizeMixin)}};export default index;export{QColorizeMixin,version}; |
{ | ||
"name": "q-colorize-mixin", | ||
"version": "1.0.10", | ||
"version": "2.0.0-alpha.1", | ||
"author": "Jeff Galbraith <jeff@quasar.dev>", | ||
@@ -35,9 +35,9 @@ "description": "Quasar color mixin", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^10.0.0", | ||
"@vue/eslint-config-standard": "^5.1.2", | ||
"@rollup/plugin-node-resolve": "^11.1.1", | ||
"@vue/eslint-config-standard": "^6.0.0", | ||
"autoprefixer": "^10.2.4", | ||
"babel-eslint": "^10.1.0", | ||
"autoprefixer": "^9.8.6", | ||
"chalk": "^4.1.0", | ||
"cssnano": "^4.1.10", | ||
"eslint": "^7.12.1", | ||
"eslint": "^7.19.0", | ||
"eslint-loader": "^4.0.2", | ||
@@ -48,12 +48,12 @@ "eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-quasar": "^1.0.0", | ||
"eslint-plugin-standard": "^4.0.2", | ||
"eslint-plugin-vue": "^7.1.0", | ||
"open": "^7.3.0", | ||
"postcss": "^7.0.32", | ||
"postcss-rtl": "^1.7.3", | ||
"quasar": "^1.14.3", | ||
"quasar-json-api": "^1.0.1", | ||
"eslint-plugin-standard": "^4.1.0", | ||
"eslint-plugin-vue": "^7.5.0", | ||
"open": "^7.4.0", | ||
"postcss": "^8.2.5", | ||
"quasar": "^1.15.2", | ||
"quasar-json-api": "^1.2.5", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.33.0", | ||
"sass": "^1.28.0", | ||
"rollup": "^2.38.5", | ||
"rtlcss": "^3.1.2", | ||
"sass": "^1.32.6", | ||
"uglify-es": "^3.3.9", | ||
@@ -60,0 +60,0 @@ "zlib": "^1.0.5" |
@@ -30,109 +30,118 @@ // 'transparent' at beginning of array as it's not really a color, | ||
export default { | ||
name: 'QColorizeMixin', | ||
export const useColorizeProps = { | ||
color: String | ||
} | ||
props: { | ||
color: String | ||
}, | ||
export default function () { | ||
function isNamedCssColor (color) { | ||
return !!color && CSS_COLOR_NAMES.includes(color.toLowerCase()) | ||
} | ||
methods: { | ||
isNamedCssColor (color) { | ||
return !!color && CSS_COLOR_NAMES.includes(color.toLowerCase()) | ||
}, | ||
function isCssColor (color) { | ||
return !!color && (!!color.match(/^(#|(rgb|hsl)a?\()/) || isNamedCssColor(color)) | ||
} | ||
isCssColor (color) { | ||
return !!color && (!!color.match(/^(#|(rgb|hsl)a?\()/) || this.isNamedCssColor(color)) | ||
}, | ||
function isCssVar (color) { | ||
return !!color && color.startsWith('--') | ||
} | ||
isCssVar (color) { | ||
return !!color && color.startsWith('--') | ||
}, | ||
function calculateColor (color, defaultColor = 'black') { | ||
return color === void 0 && defaultColor !== void 0 // safety net | ||
? calculateColor(defaultColor) | ||
: isCssColor(color) | ||
? color | ||
: makeQuasarColorVar(color, defaultColor) | ||
} | ||
calculateColor (color, defaultColor = 'black') { | ||
return color === void 0 && defaultColor !== void 0 // safety net | ||
? this.calculateColor(defaultColor) | ||
: this.isCssColor(color) | ||
? color | ||
: this.makeQuasarColorVar(color, defaultColor) | ||
}, | ||
function makeQuasarColorVar (color, defaultColor) { | ||
const varStr = isCssVar(color) | ||
? color | ||
: `--q-color-${color}` | ||
makeQuasarColorVar (color, defaultColor) { | ||
const varStr = this.isCssVar(color) | ||
? color | ||
: `--q-color-${color}` | ||
// return as a css string, ex: "var(--my-color, 'defaultColor')" | ||
return `var(${varStr}, '${defaultColor}')` | ||
} | ||
// return as a css string, ex: "var(--my-color, 'defaultColor')" | ||
return `var(${varStr}, '${defaultColor}')` | ||
}, | ||
function isValidCssColor (color) { | ||
return isCssColor(color) || isCssVar(color) | ||
} | ||
isValidCssColor (color) { | ||
return this.isCssColor(color) || this.isCssVar(color) | ||
}, | ||
function setBothColors (color, bgColor, data = {}) { | ||
return setTextColor(color, setBackgroundColor(bgColor, data)) | ||
} | ||
setBothColors (color, bgColor, data = {}) { | ||
return this.setTextColor(color, this.setBackgroundColor(bgColor, data)) | ||
}, | ||
setBackgroundColor (color, data = {}) { | ||
if (this.isValidCssColor(color)) { | ||
const calcColor = this.calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
'background-color': `${calcColor}` | ||
} | ||
function setBackgroundColor (color, data = {}) { | ||
if (isValidCssColor(color)) { | ||
const calcColor = calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
'background-color': `${calcColor}` | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['bg-' + colorName]: true | ||
} | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['bg-' + colorName]: true | ||
} | ||
} | ||
return data | ||
}, | ||
return data | ||
} | ||
setTextColor (color, data = {}) { | ||
if (this.isValidCssColor(color)) { | ||
const calcColor = this.calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
color: `${calcColor}`, | ||
'caret-color': `${calcColor}` | ||
} | ||
function setTextColor (color, data = {}) { | ||
if (isValidCssColor(color)) { | ||
const calcColor = calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
color: `${calcColor}`, | ||
'caret-color': `${calcColor}` | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['text-' + colorName]: true | ||
} | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['text-' + colorName]: true | ||
} | ||
return data | ||
}, | ||
} | ||
return data | ||
} | ||
setBorderColor (color, data = {}) { | ||
if (this.isValidCssColor(color)) { | ||
const calcColor = this.calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
'border-color': `${calcColor}` | ||
} | ||
function setBorderColor (color, data = {}) { | ||
if (isValidCssColor(color)) { | ||
const calcColor = calculateColor(color) | ||
if (data.style === void 0) data.style = {} | ||
data.style = { | ||
...data.style, | ||
'border-color': `${calcColor}` | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['border-color-' + colorName]: true | ||
} | ||
} | ||
else if (color) { | ||
const colorName = color.toString().trim() | ||
if (data.class === void 0) data.class = {} | ||
data.class = { | ||
...data.class, | ||
['border-color-' + colorName]: true | ||
} | ||
return data | ||
} | ||
return data | ||
} | ||
return { | ||
isNamedCssColor, | ||
isCssColor, | ||
isCssVar, | ||
calculateColor, | ||
makeQuasarColorVar, | ||
isValidCssColor, | ||
setBothColors, | ||
setBackgroundColor, | ||
setTextColor, | ||
setBorderColor | ||
} | ||
} |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
2767
149809
2