@iankibetsh/shframework 0.0.9 → 0.1.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/dist/library.mjs.css +28 -28
- package/dist/library.js +78 -0
- package/dist/library.mjs +75 -1
- package/package.json +1 -1
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
.nav.nav-tabs .nav-item .nav-link{
|
|
3
|
-
color: unset;
|
|
4
|
-
border: none!important;
|
|
5
|
-
padding: .75rem 1rem;
|
|
6
|
-
margin: 0;
|
|
7
|
-
font-size: 1.25rem;
|
|
8
|
-
}
|
|
9
|
-
.active.nav-link {
|
|
10
|
-
/*color: #8b8f9a !important;*/
|
|
11
|
-
color: var(--s-primary) !important;
|
|
12
|
-
background-color: transparent !important;
|
|
13
|
-
border-color: #dee2e6 #dee2e6 #fff;
|
|
14
|
-
}
|
|
15
|
-
.active.nav-link{
|
|
16
|
-
position: relative;
|
|
17
|
-
}
|
|
18
|
-
.nav.nav-tabs .nav-item .active.nav-link:before {
|
|
19
|
-
content: "";
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 2px;
|
|
22
|
-
/*background-color: #ffc107;*/
|
|
23
|
-
background-color: var(--s-primary);
|
|
24
|
-
position: absolute;
|
|
25
|
-
bottom: 0;
|
|
26
|
-
left: 50%;
|
|
27
|
-
transform: translateX(-50%);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
2
|
.sh-phone{
|
|
31
3
|
display: flex;
|
|
32
4
|
width: 100%;
|
|
@@ -59,6 +31,34 @@
|
|
|
59
31
|
opacity: 0.5;
|
|
60
32
|
}
|
|
61
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
62
|
.single-mobile-req{
|
|
63
63
|
border: 1px solid #eeeeee;
|
|
64
64
|
border-radius: 0.25rem;
|
package/dist/library.js
CHANGED
|
@@ -7,6 +7,7 @@ var NProgress = require('nprogress');
|
|
|
7
7
|
var vue = require('vue');
|
|
8
8
|
var moment = require('moment');
|
|
9
9
|
var Swal = require('sweetalert2');
|
|
10
|
+
var pinia = require('pinia');
|
|
10
11
|
|
|
11
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
13
|
|
|
@@ -3373,9 +3374,86 @@ script.render = render;
|
|
|
3373
3374
|
script.__scopeId = "data-v-3628b6a6";
|
|
3374
3375
|
script.__file = "src/views/ShTabs.vue";
|
|
3375
3376
|
|
|
3377
|
+
const useUserStore = pinia.defineStore('user-store', {
|
|
3378
|
+
state: () => ({
|
|
3379
|
+
user: null,
|
|
3380
|
+
role: null,
|
|
3381
|
+
permissions: null,
|
|
3382
|
+
menus: [],
|
|
3383
|
+
loggedOut: false
|
|
3384
|
+
}),
|
|
3385
|
+
actions: {
|
|
3386
|
+
setUser (){
|
|
3387
|
+
const user = shstorage.getItem('user') ? JSON.parse(shstorage.getItem('user')) : null;
|
|
3388
|
+
if (user) {
|
|
3389
|
+
user.isAllowedTo = function (slug) {
|
|
3390
|
+
if (this.permissions) {
|
|
3391
|
+
let permissions = [];
|
|
3392
|
+
if (typeof this.permissions === 'string') {
|
|
3393
|
+
permissions = JSON.parse(this.permissions);
|
|
3394
|
+
} else {
|
|
3395
|
+
permissions = this.permissions;
|
|
3396
|
+
}
|
|
3397
|
+
return permissions.includes(slug)
|
|
3398
|
+
}
|
|
3399
|
+
return false
|
|
3400
|
+
};
|
|
3401
|
+
}
|
|
3402
|
+
this.user = user;
|
|
3403
|
+
apis.doGet('auth/user').then(res => {
|
|
3404
|
+
shstorage.setItem('user',res.data);
|
|
3405
|
+
const user = res.data;
|
|
3406
|
+
user.isAllowedTo = function (slug) {
|
|
3407
|
+
if (this.permissions) {
|
|
3408
|
+
let permissions = [];
|
|
3409
|
+
if (typeof this.permissions === 'string') {
|
|
3410
|
+
permissions = JSON.parse(this.permissions);
|
|
3411
|
+
} else {
|
|
3412
|
+
permissions = this.permissions;
|
|
3413
|
+
}
|
|
3414
|
+
return permissions.includes(slug)
|
|
3415
|
+
}
|
|
3416
|
+
return false
|
|
3417
|
+
};
|
|
3418
|
+
this.user = user;
|
|
3419
|
+
}).catch((reason) => {
|
|
3420
|
+
if (reason.response && reason.response.status) {
|
|
3421
|
+
this.loggedOut = true;
|
|
3422
|
+
}
|
|
3423
|
+
});
|
|
3424
|
+
if (this.user) {
|
|
3425
|
+
if (typeof this.user.permissions === 'string') {
|
|
3426
|
+
this.permissions = JSON.parse(this.user.permissions);
|
|
3427
|
+
} else {
|
|
3428
|
+
this.permissions = this.user.permissions;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
},
|
|
3432
|
+
signOut () {
|
|
3433
|
+
shstorage.setItem('user',null);
|
|
3434
|
+
shstorage.setItem('access_token',null);
|
|
3435
|
+
this.user = null;
|
|
3436
|
+
},
|
|
3437
|
+
logOut () {
|
|
3438
|
+
shstorage.setItem('user',null);
|
|
3439
|
+
shstorage.setItem('access_token',null);
|
|
3440
|
+
this.user = null;
|
|
3441
|
+
}
|
|
3442
|
+
},
|
|
3443
|
+
getters: {
|
|
3444
|
+
userId (state) {
|
|
3445
|
+
return state.user === null ? null:state.user.id
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
});
|
|
3449
|
+
|
|
3376
3450
|
exports.ShCanvas = script$4;
|
|
3377
3451
|
exports.ShForm = script$5;
|
|
3378
3452
|
exports.ShModal = script$3;
|
|
3379
3453
|
exports.ShPhone = script$6;
|
|
3380
3454
|
exports.ShTable = script$1;
|
|
3381
3455
|
exports.ShTabs = script;
|
|
3456
|
+
exports.apis = apis;
|
|
3457
|
+
exports.helpers = helpers;
|
|
3458
|
+
exports.shstorage = shstorage;
|
|
3459
|
+
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;
|
|
@@ -3362,4 +3363,77 @@ script.render = render;
|
|
|
3362
3363
|
script.__scopeId = "data-v-3628b6a6";
|
|
3363
3364
|
script.__file = "src/views/ShTabs.vue";
|
|
3364
3365
|
|
|
3365
|
-
|
|
3366
|
+
const useUserStore = defineStore('user-store', {
|
|
3367
|
+
state: () => ({
|
|
3368
|
+
user: null,
|
|
3369
|
+
role: null,
|
|
3370
|
+
permissions: null,
|
|
3371
|
+
menus: [],
|
|
3372
|
+
loggedOut: false
|
|
3373
|
+
}),
|
|
3374
|
+
actions: {
|
|
3375
|
+
setUser (){
|
|
3376
|
+
const user = shstorage.getItem('user') ? JSON.parse(shstorage.getItem('user')) : null;
|
|
3377
|
+
if (user) {
|
|
3378
|
+
user.isAllowedTo = function (slug) {
|
|
3379
|
+
if (this.permissions) {
|
|
3380
|
+
let permissions = [];
|
|
3381
|
+
if (typeof this.permissions === 'string') {
|
|
3382
|
+
permissions = JSON.parse(this.permissions);
|
|
3383
|
+
} else {
|
|
3384
|
+
permissions = this.permissions;
|
|
3385
|
+
}
|
|
3386
|
+
return permissions.includes(slug)
|
|
3387
|
+
}
|
|
3388
|
+
return false
|
|
3389
|
+
};
|
|
3390
|
+
}
|
|
3391
|
+
this.user = user;
|
|
3392
|
+
apis.doGet('auth/user').then(res => {
|
|
3393
|
+
shstorage.setItem('user',res.data);
|
|
3394
|
+
const user = res.data;
|
|
3395
|
+
user.isAllowedTo = function (slug) {
|
|
3396
|
+
if (this.permissions) {
|
|
3397
|
+
let permissions = [];
|
|
3398
|
+
if (typeof this.permissions === 'string') {
|
|
3399
|
+
permissions = JSON.parse(this.permissions);
|
|
3400
|
+
} else {
|
|
3401
|
+
permissions = this.permissions;
|
|
3402
|
+
}
|
|
3403
|
+
return permissions.includes(slug)
|
|
3404
|
+
}
|
|
3405
|
+
return false
|
|
3406
|
+
};
|
|
3407
|
+
this.user = user;
|
|
3408
|
+
}).catch((reason) => {
|
|
3409
|
+
if (reason.response && reason.response.status) {
|
|
3410
|
+
this.loggedOut = true;
|
|
3411
|
+
}
|
|
3412
|
+
});
|
|
3413
|
+
if (this.user) {
|
|
3414
|
+
if (typeof this.user.permissions === 'string') {
|
|
3415
|
+
this.permissions = JSON.parse(this.user.permissions);
|
|
3416
|
+
} else {
|
|
3417
|
+
this.permissions = this.user.permissions;
|
|
3418
|
+
}
|
|
3419
|
+
}
|
|
3420
|
+
},
|
|
3421
|
+
signOut () {
|
|
3422
|
+
shstorage.setItem('user',null);
|
|
3423
|
+
shstorage.setItem('access_token',null);
|
|
3424
|
+
this.user = null;
|
|
3425
|
+
},
|
|
3426
|
+
logOut () {
|
|
3427
|
+
shstorage.setItem('user',null);
|
|
3428
|
+
shstorage.setItem('access_token',null);
|
|
3429
|
+
this.user = null;
|
|
3430
|
+
}
|
|
3431
|
+
},
|
|
3432
|
+
getters: {
|
|
3433
|
+
userId (state) {
|
|
3434
|
+
return state.user === null ? null:state.user.id
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
});
|
|
3438
|
+
|
|
3439
|
+
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, helpers, shstorage, useUserStore };
|