@iankibetsh/shframework 0.0.9 → 0.1.4
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 +78 -1
- package/dist/library.mjs +75 -2
- package/package.json +7 -7
|
@@ -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%;
|
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
|
|
|
@@ -3370,12 +3371,88 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3370
3371
|
}
|
|
3371
3372
|
|
|
3372
3373
|
script.render = render;
|
|
3373
|
-
script.__scopeId = "data-v-3628b6a6";
|
|
3374
3374
|
script.__file = "src/views/ShTabs.vue";
|
|
3375
3375
|
|
|
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
|
+
}
|
|
3447
|
+
});
|
|
3448
|
+
|
|
3376
3449
|
exports.ShCanvas = script$4;
|
|
3377
3450
|
exports.ShForm = script$5;
|
|
3378
3451
|
exports.ShModal = script$3;
|
|
3379
3452
|
exports.ShPhone = script$6;
|
|
3380
3453
|
exports.ShTable = script$1;
|
|
3381
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,7 +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
|
-
|
|
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
|
+
}
|
|
3436
|
+
});
|
|
3437
|
+
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iankibetsh/shframework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Vue library for handling laravel backend",
|
|
5
5
|
"main": "dist/library.js",
|
|
6
6
|
"module": "dist/library.mjs",
|
|
@@ -9,25 +9,25 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"build": "rollup -c"
|
|
12
|
+
"build": "rollup -c",
|
|
13
|
+
"docs:dev": "vuepress dev docs",
|
|
14
|
+
"docs:build": "vuepress build docs"
|
|
13
15
|
},
|
|
14
16
|
"keywords": [],
|
|
15
17
|
"author": "",
|
|
16
18
|
"license": "ISC",
|
|
17
19
|
"peerDependencies": {
|
|
18
20
|
"axios": "^0.27.2",
|
|
19
|
-
"bootstrap": "^5.1.3",
|
|
20
21
|
"moment": "^2.29.3",
|
|
21
22
|
"nprogress": "^0.2.0",
|
|
22
23
|
"pinia": "^2.0.13",
|
|
23
|
-
"sweetalert2": "^11.4.14"
|
|
24
|
-
"vue": "^3.2.21",
|
|
25
|
-
"vue-router": "^4.0.14"
|
|
24
|
+
"sweetalert2": "^11.4.14"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"rollup": "^2.75.7",
|
|
29
28
|
"rollup-plugin-css-only": "^3.1.0",
|
|
30
29
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
31
|
-
"rollup-plugin-vue": "^6.0.0"
|
|
30
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
31
|
+
"vuepress": "^2.0.0-beta.48"
|
|
32
32
|
}
|
|
33
33
|
}
|