@iankibetsh/shframework 0.0.8 → 0.1.2
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/dist/library.mjs.css +0 -28
- package/dist/library.js +84 -14
- package/dist/library.mjs +73 -14
- package/package.json +1 -1
|
@@ -31,34 +31,6 @@
|
|
|
31
31
|
opacity: 0.5;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.nav.nav-tabs .nav-item .nav-link{
|
|
35
|
-
color: unset;
|
|
36
|
-
border: none!important;
|
|
37
|
-
padding: .75rem 1rem;
|
|
38
|
-
margin: 0;
|
|
39
|
-
font-size: 1.25rem;
|
|
40
|
-
}
|
|
41
|
-
.active.nav-link {
|
|
42
|
-
/*color: #8b8f9a !important;*/
|
|
43
|
-
color: var(--s-primary) !important;
|
|
44
|
-
background-color: transparent !important;
|
|
45
|
-
border-color: #dee2e6 #dee2e6 #fff;
|
|
46
|
-
}
|
|
47
|
-
.active.nav-link{
|
|
48
|
-
position: relative;
|
|
49
|
-
}
|
|
50
|
-
.nav.nav-tabs .nav-item .active.nav-link:before {
|
|
51
|
-
content: "";
|
|
52
|
-
width: 100%;
|
|
53
|
-
height: 2px;
|
|
54
|
-
/*background-color: #ffc107;*/
|
|
55
|
-
background-color: var(--s-primary);
|
|
56
|
-
position: absolute;
|
|
57
|
-
bottom: 0;
|
|
58
|
-
left: 50%;
|
|
59
|
-
transform: translateX(-50%);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
34
|
.single-mobile-req{
|
|
63
35
|
border: 1px solid #eeeeee;
|
|
64
36
|
border-radius: 0.25rem;
|
package/dist/library.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var Axios = require('axios');
|
|
4
6
|
var NProgress = require('nprogress');
|
|
5
7
|
var vue = require('vue');
|
|
6
8
|
var moment = require('moment');
|
|
7
9
|
var Swal = require('sweetalert2');
|
|
10
|
+
var pinia = require('pinia');
|
|
8
11
|
|
|
9
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
13
|
|
|
@@ -3368,21 +3371,88 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3368
3371
|
}
|
|
3369
3372
|
|
|
3370
3373
|
script.render = render;
|
|
3371
|
-
script.__scopeId = "data-v-3628b6a6";
|
|
3372
3374
|
script.__file = "src/views/ShTabs.vue";
|
|
3373
3375
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3376
|
+
const useUserStore = pinia.defineStore('user-store', {
|
|
3377
|
+
state: () => ({
|
|
3378
|
+
user: null,
|
|
3379
|
+
role: null,
|
|
3380
|
+
permissions: null,
|
|
3381
|
+
menus: [],
|
|
3382
|
+
loggedOut: false
|
|
3383
|
+
}),
|
|
3384
|
+
actions: {
|
|
3385
|
+
setUser (){
|
|
3386
|
+
const user = shstorage.getItem('user') ? JSON.parse(shstorage.getItem('user')) : null;
|
|
3387
|
+
if (user) {
|
|
3388
|
+
user.isAllowedTo = function (slug) {
|
|
3389
|
+
if (this.permissions) {
|
|
3390
|
+
let permissions = [];
|
|
3391
|
+
if (typeof this.permissions === 'string') {
|
|
3392
|
+
permissions = JSON.parse(this.permissions);
|
|
3393
|
+
} else {
|
|
3394
|
+
permissions = this.permissions;
|
|
3395
|
+
}
|
|
3396
|
+
return permissions.includes(slug)
|
|
3397
|
+
}
|
|
3398
|
+
return false
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3401
|
+
this.user = user;
|
|
3402
|
+
apis.doGet('auth/user').then(res => {
|
|
3403
|
+
shstorage.setItem('user',res.data);
|
|
3404
|
+
const user = res.data;
|
|
3405
|
+
user.isAllowedTo = function (slug) {
|
|
3406
|
+
if (this.permissions) {
|
|
3407
|
+
let permissions = [];
|
|
3408
|
+
if (typeof this.permissions === 'string') {
|
|
3409
|
+
permissions = JSON.parse(this.permissions);
|
|
3410
|
+
} else {
|
|
3411
|
+
permissions = this.permissions;
|
|
3412
|
+
}
|
|
3413
|
+
return permissions.includes(slug)
|
|
3414
|
+
}
|
|
3415
|
+
return false
|
|
3416
|
+
};
|
|
3417
|
+
this.user = user;
|
|
3418
|
+
}).catch((reason) => {
|
|
3419
|
+
if (reason.response && reason.response.status) {
|
|
3420
|
+
this.loggedOut = true;
|
|
3421
|
+
}
|
|
3422
|
+
});
|
|
3423
|
+
if (this.user) {
|
|
3424
|
+
if (typeof this.user.permissions === 'string') {
|
|
3425
|
+
this.permissions = JSON.parse(this.user.permissions);
|
|
3426
|
+
} else {
|
|
3427
|
+
this.permissions = this.user.permissions;
|
|
3428
|
+
}
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3431
|
+
signOut () {
|
|
3432
|
+
shstorage.setItem('user',null);
|
|
3433
|
+
shstorage.setItem('access_token',null);
|
|
3434
|
+
this.user = null;
|
|
3435
|
+
},
|
|
3436
|
+
logOut () {
|
|
3437
|
+
shstorage.setItem('user',null);
|
|
3438
|
+
shstorage.setItem('access_token',null);
|
|
3439
|
+
this.user = null;
|
|
3440
|
+
}
|
|
3441
|
+
},
|
|
3442
|
+
getters: {
|
|
3443
|
+
userId (state) {
|
|
3444
|
+
return state.user === null ? null:state.user.id
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3382
3447
|
});
|
|
3383
3448
|
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3449
|
+
exports.ShCanvas = script$4;
|
|
3450
|
+
exports.ShForm = script$5;
|
|
3451
|
+
exports.ShModal = script$3;
|
|
3452
|
+
exports.ShPhone = script$6;
|
|
3453
|
+
exports.ShTable = script$1;
|
|
3454
|
+
exports.ShTabs = script;
|
|
3455
|
+
exports.shApis = apis;
|
|
3456
|
+
exports.shRepo = helpers;
|
|
3457
|
+
exports.shStorage = shstorage;
|
|
3458
|
+
exports.useUserStore = useUserStore;
|
package/dist/library.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import NProgress from 'nprogress';
|
|
|
3
3
|
import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, normalizeClass, createBlock, renderSlot, createStaticVNode, withCtx, pushScopeId, popScopeId, createVNode } from 'vue';
|
|
4
4
|
import moment from 'moment';
|
|
5
5
|
import Swal from 'sweetalert2';
|
|
6
|
+
import { defineStore } from 'pinia';
|
|
6
7
|
|
|
7
8
|
function setItem (key, value) {
|
|
8
9
|
let toStore = value;
|
|
@@ -3359,21 +3360,79 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3359
3360
|
}
|
|
3360
3361
|
|
|
3361
3362
|
script.render = render;
|
|
3362
|
-
script.__scopeId = "data-v-3628b6a6";
|
|
3363
3363
|
script.__file = "src/views/ShTabs.vue";
|
|
3364
3364
|
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3365
|
+
const useUserStore = defineStore('user-store', {
|
|
3366
|
+
state: () => ({
|
|
3367
|
+
user: null,
|
|
3368
|
+
role: null,
|
|
3369
|
+
permissions: null,
|
|
3370
|
+
menus: [],
|
|
3371
|
+
loggedOut: false
|
|
3372
|
+
}),
|
|
3373
|
+
actions: {
|
|
3374
|
+
setUser (){
|
|
3375
|
+
const user = shstorage.getItem('user') ? JSON.parse(shstorage.getItem('user')) : null;
|
|
3376
|
+
if (user) {
|
|
3377
|
+
user.isAllowedTo = function (slug) {
|
|
3378
|
+
if (this.permissions) {
|
|
3379
|
+
let permissions = [];
|
|
3380
|
+
if (typeof this.permissions === 'string') {
|
|
3381
|
+
permissions = JSON.parse(this.permissions);
|
|
3382
|
+
} else {
|
|
3383
|
+
permissions = this.permissions;
|
|
3384
|
+
}
|
|
3385
|
+
return permissions.includes(slug)
|
|
3386
|
+
}
|
|
3387
|
+
return false
|
|
3388
|
+
};
|
|
3389
|
+
}
|
|
3390
|
+
this.user = user;
|
|
3391
|
+
apis.doGet('auth/user').then(res => {
|
|
3392
|
+
shstorage.setItem('user',res.data);
|
|
3393
|
+
const user = res.data;
|
|
3394
|
+
user.isAllowedTo = function (slug) {
|
|
3395
|
+
if (this.permissions) {
|
|
3396
|
+
let permissions = [];
|
|
3397
|
+
if (typeof this.permissions === 'string') {
|
|
3398
|
+
permissions = JSON.parse(this.permissions);
|
|
3399
|
+
} else {
|
|
3400
|
+
permissions = this.permissions;
|
|
3401
|
+
}
|
|
3402
|
+
return permissions.includes(slug)
|
|
3403
|
+
}
|
|
3404
|
+
return false
|
|
3405
|
+
};
|
|
3406
|
+
this.user = user;
|
|
3407
|
+
}).catch((reason) => {
|
|
3408
|
+
if (reason.response && reason.response.status) {
|
|
3409
|
+
this.loggedOut = true;
|
|
3410
|
+
}
|
|
3411
|
+
});
|
|
3412
|
+
if (this.user) {
|
|
3413
|
+
if (typeof this.user.permissions === 'string') {
|
|
3414
|
+
this.permissions = JSON.parse(this.user.permissions);
|
|
3415
|
+
} else {
|
|
3416
|
+
this.permissions = this.user.permissions;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
},
|
|
3420
|
+
signOut () {
|
|
3421
|
+
shstorage.setItem('user',null);
|
|
3422
|
+
shstorage.setItem('access_token',null);
|
|
3423
|
+
this.user = null;
|
|
3424
|
+
},
|
|
3425
|
+
logOut () {
|
|
3426
|
+
shstorage.setItem('user',null);
|
|
3427
|
+
shstorage.setItem('access_token',null);
|
|
3428
|
+
this.user = null;
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3431
|
+
getters: {
|
|
3432
|
+
userId (state) {
|
|
3433
|
+
return state.user === null ? null:state.user.id
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3373
3436
|
});
|
|
3374
3437
|
|
|
3375
|
-
|
|
3376
|
-
for (const name in components) {
|
|
3377
|
-
Vue.component(name, components[name]);
|
|
3378
|
-
}
|
|
3379
|
-
}
|
|
3438
|
+
export { script$4 as ShCanvas, script$5 as ShForm, script$3 as ShModal, script$6 as ShPhone, script$1 as ShTable, script as ShTabs, apis as shApis, helpers as shRepo, shstorage as shStorage, useUserStore };
|