@sysvale/show 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@sysvale/show.esm.js +204 -186
- package/dist/@sysvale/show.min.js +1 -1
- package/dist/@sysvale/show.ssr.js +206 -188
- package/package.json +155 -134
@@ -60,192 +60,193 @@ function getFirstErrorMessage(response, fallbackMsg) {
|
|
60
60
|
return errors[firstKey][0] || fallbackMsg;
|
61
61
|
}
|
62
62
|
|
63
|
-
var SUCCESS_SWAL_DEFAULT_CONFIG = {
|
64
|
-
title: 'Informações salvas com sucesso!',
|
65
|
-
icon: 'success',
|
66
|
-
text: '',
|
67
|
-
showCloseButton: true,
|
68
|
-
confirmButtonText: 'Ok',
|
69
|
-
};
|
70
|
-
|
71
|
-
var ERROR_SWAL_DEFAULT_CONFIG = {
|
72
|
-
icon: 'error',
|
73
|
-
title: 'Erro',
|
74
|
-
text: 'mensagem de error',
|
75
|
-
showCancelButton: true,
|
76
|
-
showConfirmButton: false,
|
77
|
-
cancelButtonText: 'Fechar',
|
78
|
-
};
|
79
|
-
|
80
|
-
var script = {
|
81
|
-
props: {
|
82
|
-
service: {
|
83
|
-
type: Function,
|
84
|
-
required: true,
|
85
|
-
},
|
86
|
-
payload: {
|
87
|
-
type: Object,
|
88
|
-
default: function () { return ({}); },
|
89
|
-
},
|
90
|
-
payloadResolver: {
|
91
|
-
type: Function,
|
92
|
-
default: function (data) { return convertKeysToSnakeCase(data); },
|
93
|
-
},
|
94
|
-
dataResolver: {
|
95
|
-
type: Function,
|
96
|
-
default: function (data) { return convertKeysToCamelCase(data); },
|
97
|
-
},
|
98
|
-
successSwalConfig: {
|
99
|
-
type: Object,
|
100
|
-
default: function () { return SUCCESS_SWAL_DEFAULT_CONFIG; },
|
101
|
-
},
|
102
|
-
errorSwalConfig: {
|
103
|
-
type: Object,
|
104
|
-
default: function () { return ERROR_SWAL_DEFAULT_CONFIG; },
|
105
|
-
},
|
106
|
-
errorFeedbackResolver: {
|
107
|
-
type: Function,
|
108
|
-
default: null,
|
109
|
-
},
|
110
|
-
successFeedbackResolver: {
|
111
|
-
type: Function,
|
112
|
-
default: null,
|
113
|
-
},
|
114
|
-
showSuccessFeedback: {
|
115
|
-
type: Boolean,
|
116
|
-
default: false,
|
117
|
-
},
|
118
|
-
hideErrorFeedback: {
|
119
|
-
type: Boolean,
|
120
|
-
default: false,
|
121
|
-
},
|
122
|
-
immediate: {
|
123
|
-
type: Boolean,
|
124
|
-
default: false,
|
125
|
-
},
|
126
|
-
forceResetError: {
|
127
|
-
type: Boolean,
|
128
|
-
default: false,
|
129
|
-
},
|
130
|
-
initialData: {
|
131
|
-
default: null,
|
132
|
-
},
|
133
|
-
},
|
134
|
-
|
135
|
-
data: function data() {
|
136
|
-
return {
|
137
|
-
loading: false,
|
138
|
-
failed: false,
|
139
|
-
error: null,
|
140
|
-
data: this.initialData,
|
141
|
-
};
|
142
|
-
},
|
143
|
-
|
144
|
-
watch: {
|
145
|
-
forceResetError: function forceResetError(newValue) {
|
146
|
-
if (newValue) {
|
147
|
-
this.error = null;
|
148
|
-
}
|
149
|
-
},
|
150
|
-
},
|
151
|
-
|
152
|
-
mounted: function mounted() {
|
153
|
-
if (this.immediate) {
|
154
|
-
this.action();
|
155
|
-
}
|
156
|
-
},
|
157
|
-
|
158
|
-
methods: {
|
63
|
+
var SUCCESS_SWAL_DEFAULT_CONFIG = {
|
64
|
+
title: 'Informações salvas com sucesso!',
|
65
|
+
icon: 'success',
|
66
|
+
text: '',
|
67
|
+
showCloseButton: true,
|
68
|
+
confirmButtonText: 'Ok',
|
69
|
+
};
|
70
|
+
|
71
|
+
var ERROR_SWAL_DEFAULT_CONFIG = {
|
72
|
+
icon: 'error',
|
73
|
+
title: 'Erro',
|
74
|
+
text: 'mensagem de error',
|
75
|
+
showCancelButton: true,
|
76
|
+
showConfirmButton: false,
|
77
|
+
cancelButtonText: 'Fechar',
|
78
|
+
};
|
79
|
+
|
80
|
+
var script = {
|
81
|
+
props: {
|
82
|
+
service: {
|
83
|
+
type: Function,
|
84
|
+
required: true,
|
85
|
+
},
|
86
|
+
payload: {
|
87
|
+
type: Object,
|
88
|
+
default: function () { return ({}); },
|
89
|
+
},
|
90
|
+
payloadResolver: {
|
91
|
+
type: Function,
|
92
|
+
default: function (data) { return convertKeysToSnakeCase(data); },
|
93
|
+
},
|
94
|
+
dataResolver: {
|
95
|
+
type: Function,
|
96
|
+
default: function (data) { return convertKeysToCamelCase(data); },
|
97
|
+
},
|
98
|
+
successSwalConfig: {
|
99
|
+
type: Object,
|
100
|
+
default: function () { return SUCCESS_SWAL_DEFAULT_CONFIG; },
|
101
|
+
},
|
102
|
+
errorSwalConfig: {
|
103
|
+
type: Object,
|
104
|
+
default: function () { return ERROR_SWAL_DEFAULT_CONFIG; },
|
105
|
+
},
|
106
|
+
errorFeedbackResolver: {
|
107
|
+
type: Function,
|
108
|
+
default: null,
|
109
|
+
},
|
110
|
+
successFeedbackResolver: {
|
111
|
+
type: Function,
|
112
|
+
default: null,
|
113
|
+
},
|
114
|
+
showSuccessFeedback: {
|
115
|
+
type: Boolean,
|
116
|
+
default: false,
|
117
|
+
},
|
118
|
+
hideErrorFeedback: {
|
119
|
+
type: Boolean,
|
120
|
+
default: false,
|
121
|
+
},
|
122
|
+
immediate: {
|
123
|
+
type: Boolean,
|
124
|
+
default: false,
|
125
|
+
},
|
126
|
+
forceResetError: {
|
127
|
+
type: Boolean,
|
128
|
+
default: false,
|
129
|
+
},
|
130
|
+
initialData: {
|
131
|
+
default: null,
|
132
|
+
},
|
133
|
+
},
|
134
|
+
|
135
|
+
data: function data() {
|
136
|
+
return {
|
137
|
+
loading: false,
|
138
|
+
failed: false,
|
139
|
+
error: null,
|
140
|
+
data: this.initialData,
|
141
|
+
};
|
142
|
+
},
|
143
|
+
|
144
|
+
watch: {
|
145
|
+
forceResetError: function forceResetError(newValue) {
|
146
|
+
if (newValue) {
|
147
|
+
this.error = null;
|
148
|
+
}
|
149
|
+
},
|
150
|
+
},
|
151
|
+
|
152
|
+
mounted: function mounted() {
|
153
|
+
if (this.immediate) {
|
154
|
+
this.action();
|
155
|
+
}
|
156
|
+
},
|
157
|
+
|
158
|
+
methods: {
|
159
159
|
action: function action(payloadFromArgs) {
|
160
160
|
var this$1 = this;
|
161
|
-
|
162
|
-
this.startRequest();
|
163
|
-
var payload = payloadFromArgs || this.payload;
|
164
|
-
this.service(this.payloadResolver(payload))
|
165
|
-
.then(
|
161
|
+
|
162
|
+
this.startRequest();
|
163
|
+
var payload = payloadFromArgs || this.payload;
|
164
|
+
this.service(this.payloadResolver(payload))
|
165
|
+
.then(
|
166
166
|
function (ref) {
|
167
167
|
var data = ref.data;
|
168
|
-
|
169
|
-
this$1.data = this$1.dataResolver(data);
|
170
|
-
this$1.$emit('success', this$1.data);
|
171
|
-
|
172
|
-
if (this$1.showSuccessFeedback) {
|
173
|
-
if (this$1.successFeedbackResolver) {
|
174
|
-
this$1.successFeedbackResolver({ vm: this$1, data: this$1.data });
|
175
|
-
return;
|
176
|
-
}
|
177
|
-
swal.fire(Object.assign({}, SUCCESS_SWAL_DEFAULT_CONFIG,
|
178
|
-
this$1.successSwalConfig)).then(function () {
|
179
|
-
this$1.$emit('success-feedback-ok', this$1.data);
|
180
|
-
});
|
181
|
-
}
|
182
|
-
}
|
183
|
-
).catch(
|
184
|
-
function (error) {
|
185
|
-
this$1.failed = true;
|
186
|
-
this$1.error = error;
|
187
|
-
this$1.$emit('error', error);
|
188
|
-
|
189
|
-
if (!this$1.hideErrorFeedback) {
|
190
|
-
var errorMessage = getFirstErrorMessage(
|
191
|
-
get(error, 'response.data', null),
|
192
|
-
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
193
|
-
);
|
194
|
-
|
195
|
-
if (this$1.errorFeedbackResolver) {
|
196
|
-
this$1.errorFeedbackResolver({ vm: this$1, error: error, errorMessage: errorMessage });
|
197
|
-
return;
|
198
|
-
}
|
199
|
-
|
200
|
-
swal.fire(Object.assign({}, ERROR_SWAL_DEFAULT_CONFIG,
|
201
|
-
this$1.errorSwalConfig,
|
202
|
-
{text: errorMessage})).then(function (result) {
|
203
|
-
if (result.isDismissed) {
|
204
|
-
this$1.$emit('error-feedback-cancel', error);
|
205
|
-
}
|
206
|
-
if (result.isConfirmed) {
|
207
|
-
this$1.$emit('error-feedback-ok', error);
|
208
|
-
}
|
209
|
-
});
|
210
|
-
}
|
211
|
-
}
|
212
|
-
).finally(function () {
|
213
|
-
this$1.loading = false;
|
214
|
-
});
|
215
|
-
},
|
216
|
-
|
168
|
+
|
169
|
+
this$1.data = this$1.dataResolver(data);
|
170
|
+
this$1.$emit('success', this$1.data);
|
171
|
+
|
172
|
+
if (this$1.showSuccessFeedback) {
|
173
|
+
if (this$1.successFeedbackResolver) {
|
174
|
+
this$1.successFeedbackResolver({ vm: this$1, data: this$1.data });
|
175
|
+
return;
|
176
|
+
}
|
177
|
+
swal.fire(Object.assign({}, SUCCESS_SWAL_DEFAULT_CONFIG,
|
178
|
+
this$1.successSwalConfig)).then(function () {
|
179
|
+
this$1.$emit('success-feedback-ok', this$1.data);
|
180
|
+
});
|
181
|
+
}
|
182
|
+
}
|
183
|
+
).catch(
|
184
|
+
function (error) {
|
185
|
+
this$1.failed = true;
|
186
|
+
this$1.error = error;
|
187
|
+
this$1.$emit('error', error);
|
188
|
+
|
189
|
+
if (!this$1.hideErrorFeedback) {
|
190
|
+
var errorMessage = getFirstErrorMessage(
|
191
|
+
get(error, 'response.data', null),
|
192
|
+
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
193
|
+
);
|
194
|
+
|
195
|
+
if (this$1.errorFeedbackResolver) {
|
196
|
+
this$1.errorFeedbackResolver({ vm: this$1, error: error, errorMessage: errorMessage });
|
197
|
+
return;
|
198
|
+
}
|
199
|
+
|
200
|
+
swal.fire(Object.assign({}, ERROR_SWAL_DEFAULT_CONFIG,
|
201
|
+
this$1.errorSwalConfig,
|
202
|
+
{text: errorMessage})).then(function (result) {
|
203
|
+
if (result.isDismissed) {
|
204
|
+
this$1.$emit('error-feedback-cancel', error);
|
205
|
+
}
|
206
|
+
if (result.isConfirmed) {
|
207
|
+
this$1.$emit('error-feedback-ok', error);
|
208
|
+
}
|
209
|
+
});
|
210
|
+
}
|
211
|
+
}
|
212
|
+
).finally(function () {
|
213
|
+
this$1.loading = false;
|
214
|
+
});
|
215
|
+
},
|
216
|
+
|
217
217
|
labelHelper: function labelHelper(label, loadingLabel) {
|
218
218
|
if ( loadingLabel === void 0 ) loadingLabel = 'Carregando...';
|
219
|
-
|
220
|
-
if (this.loading) {
|
221
|
-
return loadingLabel;
|
222
|
-
}
|
223
|
-
return label;
|
224
|
-
},
|
225
|
-
|
226
|
-
startRequest: function startRequest() {
|
227
|
-
this.loading = true;
|
228
|
-
this.failed = false;
|
229
|
-
this.error = null;
|
230
|
-
},
|
231
|
-
},
|
232
|
-
|
233
|
-
render: function render() {
|
234
|
-
var
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
219
|
+
|
220
|
+
if (this.loading) {
|
221
|
+
return loadingLabel;
|
222
|
+
}
|
223
|
+
return label;
|
224
|
+
},
|
225
|
+
|
226
|
+
startRequest: function startRequest() {
|
227
|
+
this.loading = true;
|
228
|
+
this.failed = false;
|
229
|
+
this.error = null;
|
230
|
+
},
|
231
|
+
},
|
232
|
+
|
233
|
+
render: function render() {
|
234
|
+
var slotProvider = this.$slots || this.$scopedSlots;
|
235
|
+
var slot = slotProvider.default({
|
236
|
+
loading: this.loading,
|
237
|
+
failed: this.failed,
|
238
|
+
error: this.error,
|
239
|
+
data: this.data,
|
240
|
+
action: this.action,
|
241
|
+
labelHelper: this.labelHelper,
|
242
|
+
errorMessage: getFirstErrorMessage(
|
243
|
+
get(this.error, 'response.data', null),
|
244
|
+
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
245
|
+
),
|
246
|
+
});
|
247
|
+
|
248
|
+
return Array.isArray(slot) ? slot[0] : slot;
|
249
|
+
},
|
249
250
|
};
|
250
251
|
|
251
252
|
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
@@ -400,19 +401,36 @@ function generateKey(length) {
|
|
400
401
|
return result;
|
401
402
|
}
|
402
403
|
|
404
|
+
var utils = {
|
405
|
+
$showConvertKeysToCamelCase: convertKeysToCamelCase,
|
406
|
+
$showConvertKeysToSnakeCase: convertKeysToSnakeCase,
|
407
|
+
$showRemoveAccents: removeAccents,
|
408
|
+
$showGenerateKey: generateKey,
|
409
|
+
};
|
410
|
+
|
403
411
|
// install function executed by Vue.use()
|
404
|
-
function install(
|
412
|
+
function install(app) {
|
405
413
|
if (install.installed) { return; }
|
406
414
|
|
407
415
|
install.installed = true;
|
408
416
|
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
417
|
+
var version = Number(app.version.split('.')[0]);
|
418
|
+
|
419
|
+
if (version <= 2) {
|
420
|
+
Object.keys(utils).forEach(function (key) {
|
421
|
+
app.prototype[key] = utils[key];
|
422
|
+
});
|
423
|
+
}
|
424
|
+
|
425
|
+
if (version > 2) {
|
426
|
+
// ficará disponível apenas com o uso do Options API
|
427
|
+
Object.keys(utils).forEach(function (key) {
|
428
|
+
app.config.globalProperties[key] = utils[key];
|
429
|
+
});
|
430
|
+
}
|
413
431
|
|
414
432
|
Object.keys(components).forEach(function (componentName) {
|
415
|
-
|
433
|
+
app.component(
|
416
434
|
("Show" + componentName),
|
417
435
|
components[componentName]
|
418
436
|
);
|
@@ -1 +1 @@
|
|
1
|
-
var SHOW=function(e,t,r,o,n,a){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a;var i=function(e){return Array.isArray(e)},s=function(e){if(i(e))return e.map((function(e){return n(e)||i(e)?s(e):e}));var t={};return Object.keys(e).forEach((function(r){n(e[r])||i(e[r])?t[o(r)]=s(e[r]):t[o(r)]=e[r]})),t},c=function(e){return Array.isArray(e)},
|
1
|
+
var SHOW=function(e,t,r,o,n,a){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r,o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n,a=a&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a;var i=function(e){return Array.isArray(e)},s=function(e){if(i(e))return e.map((function(e){return n(e)||i(e)?s(e):e}));var t={};return Object.keys(e).forEach((function(r){n(e[r])||i(e[r])?t[o(r)]=s(e[r]):t[o(r)]=e[r]})),t},c=function(e){return Array.isArray(e)},l=function(e){if(c(e))return e.map((function(e){return n(e)||c(e)?l(e):e}));var t={};return Object.keys(e).forEach((function(r){n(e[r])||c(e[r])?t[a(r)]=l(e[r]):t[a(r)]=e[r]})),t};function u(e,t){void 0===t&&(t="Não conseguimos processar sua requisição. Tente novamente.");var o=r(e,"errors",!1);return o&&o[Object.keys(o)[0]][0]||t}var d={title:"Informações salvas com sucesso!",icon:"success",text:"",showCloseButton:!0,confirmButtonText:"Ok"},f={icon:"error",title:"Erro",text:"mensagem de error",showCancelButton:!0,showConfirmButton:!1,cancelButtonText:"Fechar"};function p(e,t,r,o,n,a,i,s,c,l){"boolean"!=typeof i&&(c=s,s=i,i=!1);var u,d="function"==typeof r?r.options:r;if(e&&e.render&&(d.render=e.render,d.staticRenderFns=e.staticRenderFns,d._compiled=!0,n&&(d.functional=!0)),o&&(d._scopeId=o),a?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=u):t&&(u=i?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),u)if(d.functional){var f=d.render;d.render=function(e,t){return u.call(t),f(e,t)}}else{var p=d.beforeCreate;d.beforeCreate=p?[].concat(p,u):[u]}return r}var h=p({},void 0,{props:{service:{type:Function,required:!0},payload:{type:Object,default:function(){return{}}},payloadResolver:{type:Function,default:function(e){return l(e)}},dataResolver:{type:Function,default:function(e){return s(e)}},successSwalConfig:{type:Object,default:function(){return d}},errorSwalConfig:{type:Object,default:function(){return f}},errorFeedbackResolver:{type:Function,default:null},successFeedbackResolver:{type:Function,default:null},showSuccessFeedback:{type:Boolean,default:!1},hideErrorFeedback:{type:Boolean,default:!1},immediate:{type:Boolean,default:!1},forceResetError:{type:Boolean,default:!1},initialData:{default:null}},data:function(){return{loading:!1,failed:!1,error:null,data:this.initialData}},watch:{forceResetError:function(e){e&&(this.error=null)}},mounted:function(){this.immediate&&this.action()},methods:{action:function(e){var o=this;this.startRequest();var n=e||this.payload;this.service(this.payloadResolver(n)).then((function(e){var r=e.data;if(o.data=o.dataResolver(r),o.$emit("success",o.data),o.showSuccessFeedback){if(o.successFeedbackResolver)return void o.successFeedbackResolver({vm:o,data:o.data});t.fire(Object.assign({},d,o.successSwalConfig)).then((function(){o.$emit("success-feedback-ok",o.data)}))}})).catch((function(e){if(o.failed=!0,o.error=e,o.$emit("error",e),!o.hideErrorFeedback){var n=u(r(e,"response.data",null),"Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.");if(o.errorFeedbackResolver)return void o.errorFeedbackResolver({vm:o,error:e,errorMessage:n});t.fire(Object.assign({},f,o.errorSwalConfig,{text:n})).then((function(t){t.isDismissed&&o.$emit("error-feedback-cancel",e),t.isConfirmed&&o.$emit("error-feedback-ok",e)}))}})).finally((function(){o.loading=!1}))},labelHelper:function(e,t){return void 0===t&&(t="Carregando..."),this.loading?t:e},startRequest:function(){this.loading=!0,this.failed=!1,this.error=null}},render:function(){var e=(this.$slots||this.$scopedSlots).default({loading:this.loading,failed:this.failed,error:this.error,data:this.data,action:this.action,labelHelper:this.labelHelper,errorMessage:u(r(this.error,"response.data",null),"Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.")});return Array.isArray(e)?e[0]:e}},void 0,void 0,void 0,!1,void 0,void 0,void 0),v=Object.freeze({__proto__:null,RequestProvider:h});var y={$showConvertKeysToCamelCase:s,$showConvertKeysToSnakeCase:l,$showRemoveAccents:function(e){void 0===e&&(e="");for(var t,r=e.length,o=e.split(""),n=0;n<r;n+=1)-1!==(t="ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž".indexOf(e[n]))&&(o[n]="AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz"[t]);return o=(o=(o=(o=o.join("")).split(".").join("")).split("-").join("")).split("/").join("")},$showGenerateKey:function(e){void 0===e&&(e=8);for(var t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=r.length,n=0;n<e;n+=1)t+=r.charAt(Math.floor(Math.random()*o));return t}};var b={install:function e(t){if(!e.installed){e.installed=!0;var r=Number(t.version.split(".")[0]);r<=2&&Object.keys(y).forEach((function(e){t.prototype[e]=y[e]})),r>2&&Object.keys(y).forEach((function(e){t.config.globalProperties[e]=y[e]})),Object.keys(v).forEach((function(e){t.component("Show"+e,v[e])}))}}},m=null;return"undefined"!=typeof window?m=window.Vue:"undefined"!=typeof global&&(m=global.Vue),m&&m.use(b),e.RequestProvider=h,e.default=b,e}({},swal,get,camelCase,isObject,snakeCase);
|
@@ -48,192 +48,193 @@ var convertKeysToSnakeCase = function (data) {
|
|
48
48
|
var ref = Object.keys(errors);
|
49
49
|
var firstKey = ref[0];
|
50
50
|
return errors[firstKey][0] || fallbackMsg;
|
51
|
-
}var SUCCESS_SWAL_DEFAULT_CONFIG = {
|
52
|
-
title: 'Informações salvas com sucesso!',
|
53
|
-
icon: 'success',
|
54
|
-
text: '',
|
55
|
-
showCloseButton: true,
|
56
|
-
confirmButtonText: 'Ok',
|
57
|
-
};
|
58
|
-
|
59
|
-
var ERROR_SWAL_DEFAULT_CONFIG = {
|
60
|
-
icon: 'error',
|
61
|
-
title: 'Erro',
|
62
|
-
text: 'mensagem de error',
|
63
|
-
showCancelButton: true,
|
64
|
-
showConfirmButton: false,
|
65
|
-
cancelButtonText: 'Fechar',
|
66
|
-
};
|
67
|
-
|
68
|
-
var script = {
|
69
|
-
props: {
|
70
|
-
service: {
|
71
|
-
type: Function,
|
72
|
-
required: true,
|
73
|
-
},
|
74
|
-
payload: {
|
75
|
-
type: Object,
|
76
|
-
default: function () { return ({}); },
|
77
|
-
},
|
78
|
-
payloadResolver: {
|
79
|
-
type: Function,
|
80
|
-
default: function (data) { return convertKeysToSnakeCase(data); },
|
81
|
-
},
|
82
|
-
dataResolver: {
|
83
|
-
type: Function,
|
84
|
-
default: function (data) { return convertKeysToCamelCase(data); },
|
85
|
-
},
|
86
|
-
successSwalConfig: {
|
87
|
-
type: Object,
|
88
|
-
default: function () { return SUCCESS_SWAL_DEFAULT_CONFIG; },
|
89
|
-
},
|
90
|
-
errorSwalConfig: {
|
91
|
-
type: Object,
|
92
|
-
default: function () { return ERROR_SWAL_DEFAULT_CONFIG; },
|
93
|
-
},
|
94
|
-
errorFeedbackResolver: {
|
95
|
-
type: Function,
|
96
|
-
default: null,
|
97
|
-
},
|
98
|
-
successFeedbackResolver: {
|
99
|
-
type: Function,
|
100
|
-
default: null,
|
101
|
-
},
|
102
|
-
showSuccessFeedback: {
|
103
|
-
type: Boolean,
|
104
|
-
default: false,
|
105
|
-
},
|
106
|
-
hideErrorFeedback: {
|
107
|
-
type: Boolean,
|
108
|
-
default: false,
|
109
|
-
},
|
110
|
-
immediate: {
|
111
|
-
type: Boolean,
|
112
|
-
default: false,
|
113
|
-
},
|
114
|
-
forceResetError: {
|
115
|
-
type: Boolean,
|
116
|
-
default: false,
|
117
|
-
},
|
118
|
-
initialData: {
|
119
|
-
default: null,
|
120
|
-
},
|
121
|
-
},
|
122
|
-
|
123
|
-
data: function data() {
|
124
|
-
return {
|
125
|
-
loading: false,
|
126
|
-
failed: false,
|
127
|
-
error: null,
|
128
|
-
data: this.initialData,
|
129
|
-
};
|
130
|
-
},
|
131
|
-
|
132
|
-
watch: {
|
133
|
-
forceResetError: function forceResetError(newValue) {
|
134
|
-
if (newValue) {
|
135
|
-
this.error = null;
|
136
|
-
}
|
137
|
-
},
|
138
|
-
},
|
139
|
-
|
140
|
-
mounted: function mounted() {
|
141
|
-
if (this.immediate) {
|
142
|
-
this.action();
|
143
|
-
}
|
144
|
-
},
|
145
|
-
|
146
|
-
methods: {
|
51
|
+
}var SUCCESS_SWAL_DEFAULT_CONFIG = {
|
52
|
+
title: 'Informações salvas com sucesso!',
|
53
|
+
icon: 'success',
|
54
|
+
text: '',
|
55
|
+
showCloseButton: true,
|
56
|
+
confirmButtonText: 'Ok',
|
57
|
+
};
|
58
|
+
|
59
|
+
var ERROR_SWAL_DEFAULT_CONFIG = {
|
60
|
+
icon: 'error',
|
61
|
+
title: 'Erro',
|
62
|
+
text: 'mensagem de error',
|
63
|
+
showCancelButton: true,
|
64
|
+
showConfirmButton: false,
|
65
|
+
cancelButtonText: 'Fechar',
|
66
|
+
};
|
67
|
+
|
68
|
+
var script = {
|
69
|
+
props: {
|
70
|
+
service: {
|
71
|
+
type: Function,
|
72
|
+
required: true,
|
73
|
+
},
|
74
|
+
payload: {
|
75
|
+
type: Object,
|
76
|
+
default: function () { return ({}); },
|
77
|
+
},
|
78
|
+
payloadResolver: {
|
79
|
+
type: Function,
|
80
|
+
default: function (data) { return convertKeysToSnakeCase(data); },
|
81
|
+
},
|
82
|
+
dataResolver: {
|
83
|
+
type: Function,
|
84
|
+
default: function (data) { return convertKeysToCamelCase(data); },
|
85
|
+
},
|
86
|
+
successSwalConfig: {
|
87
|
+
type: Object,
|
88
|
+
default: function () { return SUCCESS_SWAL_DEFAULT_CONFIG; },
|
89
|
+
},
|
90
|
+
errorSwalConfig: {
|
91
|
+
type: Object,
|
92
|
+
default: function () { return ERROR_SWAL_DEFAULT_CONFIG; },
|
93
|
+
},
|
94
|
+
errorFeedbackResolver: {
|
95
|
+
type: Function,
|
96
|
+
default: null,
|
97
|
+
},
|
98
|
+
successFeedbackResolver: {
|
99
|
+
type: Function,
|
100
|
+
default: null,
|
101
|
+
},
|
102
|
+
showSuccessFeedback: {
|
103
|
+
type: Boolean,
|
104
|
+
default: false,
|
105
|
+
},
|
106
|
+
hideErrorFeedback: {
|
107
|
+
type: Boolean,
|
108
|
+
default: false,
|
109
|
+
},
|
110
|
+
immediate: {
|
111
|
+
type: Boolean,
|
112
|
+
default: false,
|
113
|
+
},
|
114
|
+
forceResetError: {
|
115
|
+
type: Boolean,
|
116
|
+
default: false,
|
117
|
+
},
|
118
|
+
initialData: {
|
119
|
+
default: null,
|
120
|
+
},
|
121
|
+
},
|
122
|
+
|
123
|
+
data: function data() {
|
124
|
+
return {
|
125
|
+
loading: false,
|
126
|
+
failed: false,
|
127
|
+
error: null,
|
128
|
+
data: this.initialData,
|
129
|
+
};
|
130
|
+
},
|
131
|
+
|
132
|
+
watch: {
|
133
|
+
forceResetError: function forceResetError(newValue) {
|
134
|
+
if (newValue) {
|
135
|
+
this.error = null;
|
136
|
+
}
|
137
|
+
},
|
138
|
+
},
|
139
|
+
|
140
|
+
mounted: function mounted() {
|
141
|
+
if (this.immediate) {
|
142
|
+
this.action();
|
143
|
+
}
|
144
|
+
},
|
145
|
+
|
146
|
+
methods: {
|
147
147
|
action: function action(payloadFromArgs) {
|
148
148
|
var this$1 = this;
|
149
|
-
|
150
|
-
this.startRequest();
|
151
|
-
var payload = payloadFromArgs || this.payload;
|
152
|
-
this.service(this.payloadResolver(payload))
|
153
|
-
.then(
|
149
|
+
|
150
|
+
this.startRequest();
|
151
|
+
var payload = payloadFromArgs || this.payload;
|
152
|
+
this.service(this.payloadResolver(payload))
|
153
|
+
.then(
|
154
154
|
function (ref) {
|
155
155
|
var data = ref.data;
|
156
|
-
|
157
|
-
this$1.data = this$1.dataResolver(data);
|
158
|
-
this$1.$emit('success', this$1.data);
|
159
|
-
|
160
|
-
if (this$1.showSuccessFeedback) {
|
161
|
-
if (this$1.successFeedbackResolver) {
|
162
|
-
this$1.successFeedbackResolver({ vm: this$1, data: this$1.data });
|
163
|
-
return;
|
164
|
-
}
|
165
|
-
swal.fire(Object.assign({}, SUCCESS_SWAL_DEFAULT_CONFIG,
|
166
|
-
this$1.successSwalConfig)).then(function () {
|
167
|
-
this$1.$emit('success-feedback-ok', this$1.data);
|
168
|
-
});
|
169
|
-
}
|
170
|
-
}
|
171
|
-
).catch(
|
172
|
-
function (error) {
|
173
|
-
this$1.failed = true;
|
174
|
-
this$1.error = error;
|
175
|
-
this$1.$emit('error', error);
|
176
|
-
|
177
|
-
if (!this$1.hideErrorFeedback) {
|
178
|
-
var errorMessage = getFirstErrorMessage(
|
179
|
-
get(error, 'response.data', null),
|
180
|
-
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
181
|
-
);
|
182
|
-
|
183
|
-
if (this$1.errorFeedbackResolver) {
|
184
|
-
this$1.errorFeedbackResolver({ vm: this$1, error: error, errorMessage: errorMessage });
|
185
|
-
return;
|
186
|
-
}
|
187
|
-
|
188
|
-
swal.fire(Object.assign({}, ERROR_SWAL_DEFAULT_CONFIG,
|
189
|
-
this$1.errorSwalConfig,
|
190
|
-
{text: errorMessage})).then(function (result) {
|
191
|
-
if (result.isDismissed) {
|
192
|
-
this$1.$emit('error-feedback-cancel', error);
|
193
|
-
}
|
194
|
-
if (result.isConfirmed) {
|
195
|
-
this$1.$emit('error-feedback-ok', error);
|
196
|
-
}
|
197
|
-
});
|
198
|
-
}
|
199
|
-
}
|
200
|
-
).finally(function () {
|
201
|
-
this$1.loading = false;
|
202
|
-
});
|
203
|
-
},
|
204
|
-
|
156
|
+
|
157
|
+
this$1.data = this$1.dataResolver(data);
|
158
|
+
this$1.$emit('success', this$1.data);
|
159
|
+
|
160
|
+
if (this$1.showSuccessFeedback) {
|
161
|
+
if (this$1.successFeedbackResolver) {
|
162
|
+
this$1.successFeedbackResolver({ vm: this$1, data: this$1.data });
|
163
|
+
return;
|
164
|
+
}
|
165
|
+
swal.fire(Object.assign({}, SUCCESS_SWAL_DEFAULT_CONFIG,
|
166
|
+
this$1.successSwalConfig)).then(function () {
|
167
|
+
this$1.$emit('success-feedback-ok', this$1.data);
|
168
|
+
});
|
169
|
+
}
|
170
|
+
}
|
171
|
+
).catch(
|
172
|
+
function (error) {
|
173
|
+
this$1.failed = true;
|
174
|
+
this$1.error = error;
|
175
|
+
this$1.$emit('error', error);
|
176
|
+
|
177
|
+
if (!this$1.hideErrorFeedback) {
|
178
|
+
var errorMessage = getFirstErrorMessage(
|
179
|
+
get(error, 'response.data', null),
|
180
|
+
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
181
|
+
);
|
182
|
+
|
183
|
+
if (this$1.errorFeedbackResolver) {
|
184
|
+
this$1.errorFeedbackResolver({ vm: this$1, error: error, errorMessage: errorMessage });
|
185
|
+
return;
|
186
|
+
}
|
187
|
+
|
188
|
+
swal.fire(Object.assign({}, ERROR_SWAL_DEFAULT_CONFIG,
|
189
|
+
this$1.errorSwalConfig,
|
190
|
+
{text: errorMessage})).then(function (result) {
|
191
|
+
if (result.isDismissed) {
|
192
|
+
this$1.$emit('error-feedback-cancel', error);
|
193
|
+
}
|
194
|
+
if (result.isConfirmed) {
|
195
|
+
this$1.$emit('error-feedback-ok', error);
|
196
|
+
}
|
197
|
+
});
|
198
|
+
}
|
199
|
+
}
|
200
|
+
).finally(function () {
|
201
|
+
this$1.loading = false;
|
202
|
+
});
|
203
|
+
},
|
204
|
+
|
205
205
|
labelHelper: function labelHelper(label, loadingLabel) {
|
206
206
|
if ( loadingLabel === void 0 ) loadingLabel = 'Carregando...';
|
207
|
-
|
208
|
-
if (this.loading) {
|
209
|
-
return loadingLabel;
|
210
|
-
}
|
211
|
-
return label;
|
212
|
-
},
|
213
|
-
|
214
|
-
startRequest: function startRequest() {
|
215
|
-
this.loading = true;
|
216
|
-
this.failed = false;
|
217
|
-
this.error = null;
|
218
|
-
},
|
219
|
-
},
|
220
|
-
|
221
|
-
render: function render() {
|
222
|
-
var
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
207
|
+
|
208
|
+
if (this.loading) {
|
209
|
+
return loadingLabel;
|
210
|
+
}
|
211
|
+
return label;
|
212
|
+
},
|
213
|
+
|
214
|
+
startRequest: function startRequest() {
|
215
|
+
this.loading = true;
|
216
|
+
this.failed = false;
|
217
|
+
this.error = null;
|
218
|
+
},
|
219
|
+
},
|
220
|
+
|
221
|
+
render: function render() {
|
222
|
+
var slotProvider = this.$slots || this.$scopedSlots;
|
223
|
+
var slot = slotProvider.default({
|
224
|
+
loading: this.loading,
|
225
|
+
failed: this.failed,
|
226
|
+
error: this.error,
|
227
|
+
data: this.data,
|
228
|
+
action: this.action,
|
229
|
+
labelHelper: this.labelHelper,
|
230
|
+
errorMessage: getFirstErrorMessage(
|
231
|
+
get(this.error, 'response.data', null),
|
232
|
+
'Um erro aconteceu... por favor, tente novamente. Se o erro persistir, contate o suporte.'
|
233
|
+
),
|
234
|
+
});
|
235
|
+
|
236
|
+
return Array.isArray(slot) ? slot[0] : slot;
|
237
|
+
},
|
237
238
|
};function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
|
238
239
|
if (typeof shadowMode !== 'boolean') {
|
239
240
|
createInjectorSSR = createInjector;
|
@@ -317,7 +318,7 @@ var __vue_script__ = script;
|
|
317
318
|
/* scoped */
|
318
319
|
var __vue_scope_id__ = undefined;
|
319
320
|
/* module identifier */
|
320
|
-
var __vue_module_identifier__ = "data-v-
|
321
|
+
var __vue_module_identifier__ = "data-v-4282f00e";
|
321
322
|
/* functional template */
|
322
323
|
var __vue_is_functional_template__ = undefined;
|
323
324
|
/* style inject */
|
@@ -371,19 +372,36 @@ var __vue_script__ = script;
|
|
371
372
|
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
372
373
|
}
|
373
374
|
return result;
|
374
|
-
}
|
375
|
-
|
375
|
+
}var utils = {
|
376
|
+
$showConvertKeysToCamelCase: convertKeysToCamelCase,
|
377
|
+
$showConvertKeysToSnakeCase: convertKeysToSnakeCase,
|
378
|
+
$showRemoveAccents: removeAccents,
|
379
|
+
$showGenerateKey: generateKey,
|
380
|
+
};
|
381
|
+
|
382
|
+
// install function executed by Vue.use()
|
383
|
+
function install(app) {
|
376
384
|
if (install.installed) { return; }
|
377
385
|
|
378
386
|
install.installed = true;
|
379
387
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
388
|
+
var version = Number(app.version.split('.')[0]);
|
389
|
+
|
390
|
+
if (version <= 2) {
|
391
|
+
Object.keys(utils).forEach(function (key) {
|
392
|
+
app.prototype[key] = utils[key];
|
393
|
+
});
|
394
|
+
}
|
395
|
+
|
396
|
+
if (version > 2) {
|
397
|
+
// ficará disponível apenas com o uso do Options API
|
398
|
+
Object.keys(utils).forEach(function (key) {
|
399
|
+
app.config.globalProperties[key] = utils[key];
|
400
|
+
});
|
401
|
+
}
|
384
402
|
|
385
403
|
Object.keys(components).forEach(function (componentName) {
|
386
|
-
|
404
|
+
app.component(
|
387
405
|
("Show" + componentName),
|
388
406
|
components[componentName]
|
389
407
|
);
|
package/package.json
CHANGED
@@ -1,134 +1,155 @@
|
|
1
|
-
{
|
2
|
-
"name": "@sysvale/show",
|
3
|
-
"version": "0.0
|
4
|
-
"description": "A set of components used at Sysvale",
|
5
|
-
"repository": {
|
6
|
-
"type": "git",
|
7
|
-
"url": "git+https://github.com/Sysvale/show.git"
|
8
|
-
},
|
9
|
-
"main": "dist/@sysvale/show.ssr.js",
|
10
|
-
"module": "dist/@sysvale/show.esm.js",
|
11
|
-
"unpkg": "dist/@sysvale/show.min.js",
|
12
|
-
"files": [
|
13
|
-
"dist/*"
|
14
|
-
],
|
15
|
-
"scripts": {
|
16
|
-
"serve": "vue-cli-service serve",
|
17
|
-
"test:unit": "vue-cli-service test:unit",
|
18
|
-
"test": "jest",
|
19
|
-
"lint": "vue-cli-service lint",
|
20
|
-
"storybook": "start-storybook -p 6006 --docs",
|
21
|
-
"build-storybook": "build-storybook -s public --docs",
|
22
|
-
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
|
23
|
-
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
|
24
|
-
"build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
|
25
|
-
"build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife",
|
26
|
-
"chromatic": "npx chromatic --project-token=a0f13ffc7d61"
|
27
|
-
},
|
28
|
-
"dependencies": {
|
29
|
-
"lodash.camelcase": "^4.3.0",
|
30
|
-
"lodash.get": "^4.4.2",
|
31
|
-
"lodash.isobject": "^3.0.2",
|
32
|
-
"lodash.snakecase": "^4.1.1",
|
33
|
-
"sweetalert2": "^11.3.5",
|
34
|
-
"vue": "^2.6.12"
|
35
|
-
},
|
36
|
-
"devDependencies": {
|
37
|
-
"@babel/core": "^7.11.6",
|
38
|
-
"@rollup/plugin-alias": "^2.2.0",
|
39
|
-
"@rollup/plugin-buble": "^0.20.0",
|
40
|
-
"@rollup/plugin-replace": "^2.3.0",
|
41
|
-
"@storybook/addon-actions": "^6.1.0-alpha.10",
|
42
|
-
"@storybook/addon-essentials": "^6.1.0-alpha.10",
|
43
|
-
"@storybook/addon-links": "^6.1.0-alpha.10",
|
44
|
-
"@storybook/preset-scss": "^1.0.2",
|
45
|
-
"@storybook/vue": "^6.1.0-alpha.10",
|
46
|
-
"@vue/cli-plugin-babel": "~4.5.0",
|
47
|
-
"@vue/cli-plugin-eslint": "~4.5.0",
|
48
|
-
"@vue/cli-plugin-unit-jest": "~4.5.0",
|
49
|
-
"@vue/cli-service": "~4.5.0",
|
50
|
-
"@vue/eslint-config-airbnb": "^5.0.2",
|
51
|
-
"@vue/test-utils": "^1.1.0",
|
52
|
-
"babel-eslint": "^10.1.0",
|
53
|
-
"babel-loader": "^8.1.0",
|
54
|
-
"chromatic": "^6.0.4",
|
55
|
-
"cross-env": "^6.0.3",
|
56
|
-
"css-loader": "^4.3.0",
|
57
|
-
"eslint": "^6.7.2",
|
58
|
-
"eslint-plugin-import": "^2.20.2",
|
59
|
-
"eslint-plugin-vue": "^6.2.2",
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"rollup
|
65
|
-
"rollup-plugin-
|
66
|
-
"
|
67
|
-
"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
"
|
89
|
-
"
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
"
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
"
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
1
|
+
{
|
2
|
+
"name": "@sysvale/show",
|
3
|
+
"version": "0.2.0",
|
4
|
+
"description": "A set of components used at Sysvale",
|
5
|
+
"repository": {
|
6
|
+
"type": "git",
|
7
|
+
"url": "git+https://github.com/Sysvale/show.git"
|
8
|
+
},
|
9
|
+
"main": "dist/@sysvale/show.ssr.js",
|
10
|
+
"module": "dist/@sysvale/show.esm.js",
|
11
|
+
"unpkg": "dist/@sysvale/show.min.js",
|
12
|
+
"files": [
|
13
|
+
"dist/*"
|
14
|
+
],
|
15
|
+
"scripts": {
|
16
|
+
"serve": "vue-cli-service serve",
|
17
|
+
"test:unit": "vue-cli-service test:unit",
|
18
|
+
"test": "jest",
|
19
|
+
"lint": "vue-cli-service lint",
|
20
|
+
"storybook": "start-storybook -p 6006 --docs",
|
21
|
+
"build-storybook": "build-storybook -s public --docs",
|
22
|
+
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
|
23
|
+
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
|
24
|
+
"build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
|
25
|
+
"build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife",
|
26
|
+
"chromatic": "npx chromatic --project-token=a0f13ffc7d61"
|
27
|
+
},
|
28
|
+
"dependencies": {
|
29
|
+
"lodash.camelcase": "^4.3.0",
|
30
|
+
"lodash.get": "^4.4.2",
|
31
|
+
"lodash.isobject": "^3.0.2",
|
32
|
+
"lodash.snakecase": "^4.1.1",
|
33
|
+
"sweetalert2": "^11.3.5",
|
34
|
+
"vue": "^2.6.12"
|
35
|
+
},
|
36
|
+
"devDependencies": {
|
37
|
+
"@babel/core": "^7.11.6",
|
38
|
+
"@rollup/plugin-alias": "^2.2.0",
|
39
|
+
"@rollup/plugin-buble": "^0.20.0",
|
40
|
+
"@rollup/plugin-replace": "^2.3.0",
|
41
|
+
"@storybook/addon-actions": "^6.1.0-alpha.10",
|
42
|
+
"@storybook/addon-essentials": "^6.1.0-alpha.10",
|
43
|
+
"@storybook/addon-links": "^6.1.0-alpha.10",
|
44
|
+
"@storybook/preset-scss": "^1.0.2",
|
45
|
+
"@storybook/vue": "^6.1.0-alpha.10",
|
46
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
47
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
48
|
+
"@vue/cli-plugin-unit-jest": "~4.5.0",
|
49
|
+
"@vue/cli-service": "~4.5.0",
|
50
|
+
"@vue/eslint-config-airbnb": "^5.0.2",
|
51
|
+
"@vue/test-utils": "^1.1.0",
|
52
|
+
"babel-eslint": "^10.1.0",
|
53
|
+
"babel-loader": "^8.1.0",
|
54
|
+
"chromatic": "^6.0.4",
|
55
|
+
"cross-env": "^6.0.3",
|
56
|
+
"css-loader": "^4.3.0",
|
57
|
+
"eslint": "^6.7.2",
|
58
|
+
"eslint-plugin-import": "^2.20.2",
|
59
|
+
"eslint-plugin-vue": "^6.2.2",
|
60
|
+
"flush-promises": "^1.0.2",
|
61
|
+
"highlight.js": "^10.6.0",
|
62
|
+
"react-is": "^16.13.1",
|
63
|
+
"regenerator-runtime": "^0.13.9",
|
64
|
+
"rollup": "^1.29.0",
|
65
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
66
|
+
"rollup-plugin-terser": "^5.2.0",
|
67
|
+
"rollup-plugin-vue": "5.1.1",
|
68
|
+
"vue-hljs": "^2.0.0",
|
69
|
+
"vue-template-compiler": "^2.6.11"
|
70
|
+
},
|
71
|
+
"eslintConfig": {
|
72
|
+
"root": true,
|
73
|
+
"env": {
|
74
|
+
"node": true
|
75
|
+
},
|
76
|
+
"extends": [
|
77
|
+
"plugin:vue/essential",
|
78
|
+
"@vue/airbnb"
|
79
|
+
],
|
80
|
+
"parserOptions": {
|
81
|
+
"parser": "babel-eslint"
|
82
|
+
},
|
83
|
+
"rules": {
|
84
|
+
"vue/html-indent": [
|
85
|
+
"error",
|
86
|
+
"tab",
|
87
|
+
{
|
88
|
+
"attribute": 1,
|
89
|
+
"closeBracket": 0,
|
90
|
+
"alignAttributesVertically": true,
|
91
|
+
"ignores": []
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"no-tabs": "off",
|
95
|
+
"indent": [
|
96
|
+
"error",
|
97
|
+
"tab",
|
98
|
+
{
|
99
|
+
"SwitchCase": 1
|
100
|
+
}
|
101
|
+
],
|
102
|
+
"quotes": [
|
103
|
+
"error",
|
104
|
+
"single",
|
105
|
+
{
|
106
|
+
"allowTemplateLiterals": true
|
107
|
+
}
|
108
|
+
]
|
109
|
+
},
|
110
|
+
"overrides": [
|
111
|
+
{
|
112
|
+
"files": [
|
113
|
+
"**/__tests__/*.{j,t}s?(x)",
|
114
|
+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
|
115
|
+
],
|
116
|
+
"env": {
|
117
|
+
"jest": true
|
118
|
+
}
|
119
|
+
}
|
120
|
+
]
|
121
|
+
},
|
122
|
+
"browserslist": [
|
123
|
+
"> 1%",
|
124
|
+
"last 2 versions",
|
125
|
+
"not dead"
|
126
|
+
],
|
127
|
+
"jest": {
|
128
|
+
"preset": "@vue/cli-plugin-unit-jest",
|
129
|
+
"transform": {
|
130
|
+
".*\\.(js)$": "babel-jest"
|
131
|
+
},
|
132
|
+
"setupFilesAfterEnv": [
|
133
|
+
"./src/utils/setupTests.js"
|
134
|
+
],
|
135
|
+
"collectCoverage": true,
|
136
|
+
"collectCoverageFrom": [
|
137
|
+
"src/**/*.vue"
|
138
|
+
],
|
139
|
+
"coverageReporters": [
|
140
|
+
"lcov",
|
141
|
+
"text"
|
142
|
+
]
|
143
|
+
},
|
144
|
+
"babel": {
|
145
|
+
"presets": [
|
146
|
+
"@babel/preset-env"
|
147
|
+
]
|
148
|
+
},
|
149
|
+
"bugs": {
|
150
|
+
"url": "https://github.com/Sysvale/show/issues"
|
151
|
+
},
|
152
|
+
"homepage": "https://github.com/Sysvale/show#readme",
|
153
|
+
"author": "Sysvale",
|
154
|
+
"license": "MIT"
|
155
|
+
}
|