node_modules

This commit is contained in:
saeid
2019-07-15 13:07:31 +04:30
parent d3735c6d30
commit ce1a3ebf9c
35713 changed files with 3639219 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"html.format.wrapAttributes": "force-expand-multiline"
}
+10
View File
@@ -0,0 +1,10 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
+110
View File
@@ -0,0 +1,110 @@
vue-chartist
==============
Plugin [Vuejs](http://vuejs.org/) for [Chartist.js](https://gionkunz.github.io/chartist-js)
## Install
```
npm install vue-chartist
```
## Setup
__This package include Chartist's javascript but not the stylesheet__
```javascript
Vue.use(require('vue-chartist'))
```
## Usage
In your HTML, add `<chartist>` tag. This tag take the following attributes :
- __ratio__ - `String`
class ratio of Chartist, see values on [Chartist web site](https://gionkunz.github.io/chartist-js/getting-started.html#as-simple-as-it-can-get)
- __type__ - `String` (required)
chart type, possible values :
- `Line`
- `Bar`
- `Pie`
- __data__ - `Object`
data object like this
```javascript
const data = {
labels: ["A", "B", "C"],
series:[[1, 3, 2], [4, 6, 5]]
}
```
- __options__ - `Object`
options object, see defaultOptions on [API Documentation](https://gionkunz.github.io/chartist-js/api-documentation.html)
- __event-handlers__ - `Array`
a special array to use `chart.on(event, function)`
```javascript
const eventHandlers = [{
event: 'draw',
fn() {
//animation
}
}, {
//an other event hander
}]
```
- __responsive-options__ - `Array`
object for responsive options
## Example
```html
<chartist
ratio="ct-major-second"
type="Line"
:data="chartData"
:options="chartOptions" >
</chartist>
```
>*Note: think about using the [dynamic props](http://vuejs.org/guide/components.html#Dynamic_Props) of Vuejs to bind easliy your data or other.*
```javascript
new Vue({
el:'#app',
data: {
chartData: {
labels: ["A", "B", "C"],
series:[[1, 3, 2], [4, 6, 5]]
},
chartOptions: {
lineSmooth: false
}
}
})
```
## Customize chart with no data
If chart data are empty or not definied the plugin add `ct-nodata` (or a custom class, see options plugin) class and write a message on the element.
That way, you can customize your element with CSS when you have no data to display. To choose your message use the options plugin.
## Options Plugin
```javascript
Vue.use(require('vue-chartist'), {
messageNoData: "You have not enough data",
classNoData: "empty"
})
```
## Chartist instance
There is two way to access this Chartist's instance :
By `Vue` instance
```javascript
Vue.chartist
```
or in component
```javascript
this.$chartist
```
+204
View File
@@ -0,0 +1,204 @@
'use strict';
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
exports.install = function (Vue) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var defaultOptions = { messageNoData: '', classNoData: 'ct-nodata' };
options = Object.assign({}, defaultOptions, options);
Vue.chartist = require('chartist');
Vue.prototype.$chartist = require('chartist');
Vue.component('Chartist', {
props: {
ratio: {
type: String,
default: 'ct-square'
},
data: {
type: Object,
default: function _default() {
return {
series: [],
labels: []
};
}
},
options: {
type: Object,
default: function _default() {
return {};
}
},
type: {
type: String,
required: true,
validator: function validator(val) {
return val === 'Pie' || val === 'Line' || val === 'Bar';
}
},
eventHandlers: {
type: Array,
default: function _default() {
return [];
}
},
responsiveOptions: {
type: Array,
default: function _default() {
return [];
}
}
},
data: function data() {
return {
chart: null,
error: { onError: false, message: '' },
noData: false,
message: '',
classNoData: options.classNoData
};
},
watch: {
ratio: 'redraw',
options: 'redraw',
data: { handler: 'redraw', deep: true },
type: 'draw',
eventHandlers: 'resetEventHandlers'
},
mounted: function mounted() {
this.draw();
},
methods: {
clear: function clear() {
this.noData = false;
this.message = '';
if (this.error.onError) {
this.error = { onError: false, message: '' };
}
},
draw: function draw() {
if (this.haveNoData()) {
return this.setNoData();
}
this.clear();
this.chart = new this.$chartist[this.type](this.$refs.chart, this.data, this.options, this.responsiveOptions);
this.setEventHandlers();
},
haveNoData: function haveNoData() {
return !this.data || !this.data.series || this.data.series.length < 1 || this.type !== 'Pie' && !this.options.distributeSeries && this.data.series.every(function (series) {
if (Array.isArray(series)) {
return !series.length;
}
return !series.data.length;
});
},
redraw: function redraw() {
if (this.error.onError) {
return this.draw();
} else if (this.haveNoData()) {
return this.setNoData();
}
this.clear();
this.chart.update(this.data, this.options);
},
resetEventHandlers: function resetEventHandlers(eventHandlers, oldEventHandler) {
if (!this.chart) {
return;
}
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = oldEventHandler[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var item = _step.value;
this.chart.off(item.event, item.fn);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator2 = eventHandlers[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var _item = _step2.value;
this.chart.on(_item.event, _item.fn);
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
},
setEventHandlers: function setEventHandlers() {
if (this.eventHandlers) {
var _iteratorNormalCompletion3 = true;
var _didIteratorError3 = false;
var _iteratorError3 = undefined;
try {
for (var _iterator3 = this.eventHandlers[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
var item = _step3.value;
this.chart.on(item.event, item.fn);
}
} catch (err) {
_didIteratorError3 = true;
_iteratorError3 = err;
} finally {
try {
if (!_iteratorNormalCompletion3 && _iterator3.return) {
_iterator3.return();
}
} finally {
if (_didIteratorError3) {
throw _iteratorError3;
}
}
}
}
},
setNoData: function setNoData() {
this.error = { onError: true, message: options.messageNoData };
this.noData = true;
this.message = this.error.message;
}
},
render: function render(h) {
return h('div', {
ref: 'chart',
'class': [this.ratio, _defineProperty({}, this.classNoData, this.noData)]
}, this.message);
}
});
};
+72
View File
@@ -0,0 +1,72 @@
{
"_from": "vue-chartist@^2.1.2",
"_id": "vue-chartist@2.2.0",
"_inBundle": false,
"_integrity": "sha512-LlTL4BvBqFe7yX0fD+PY12bblgVm7ZZHsVtWssmHXi6YVh/D2pfnV7Sm9+HFOVr3vqRvKpl6F048K2BWpGC4qw==",
"_location": "/vue-chartist",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "vue-chartist@^2.1.2",
"name": "vue-chartist",
"escapedName": "vue-chartist",
"rawSpec": "^2.1.2",
"saveSpec": null,
"fetchSpec": "^2.1.2"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/vue-chartist/-/vue-chartist-2.2.0.tgz",
"_shasum": "08a05cb0bc1fc629befe3ca503a9af2d6def1ce7",
"_spec": "vue-chartist@^2.1.2",
"_where": "D:\\Atom\\Git\\Laravel_CSSd",
"author": {
"name": "Yopadd"
},
"browser": {
"vue": "./node_modules/vue/dist/vue.js"
},
"bugs": {
"url": "https://github.com/Yopadd/vue-chartist/issues"
},
"bundleDependencies": false,
"dependencies": {
"chartist": "^0.11.0"
},
"deprecated": false,
"description": "Plugin chartist for vuejs",
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babelify": "^7.3.0",
"browserify": "^16.2.3",
"http-server": "^0.10.0",
"vue": "^2.5.17"
},
"homepage": "https://github.com/Yopadd/vue-chartist#readme",
"keywords": [
"plugin",
"chartist",
"charts",
"vuejs",
"vue"
],
"license": {
"type": "WTFPL",
"url": "http://spdx.org/licenses/WTFPL.html#licenseText"
},
"main": "index.js",
"name": "vue-chartist",
"repository": {
"type": "git",
"url": "git+https://github.com/Yopadd/vue-chartist.git"
},
"scripts": {
"build": "babel --presets es2015 ./src/index.js -o index.js",
"example": "npm run build && browserify -t [babelify] -e ./example/src/main.js -o ./example/public/build.js && http-server -c0 ./example/public",
"prepare": "npm run build"
},
"version": "2.2.0"
}