@iankibetsh/shframework 1.0.9 → 1.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.
@@ -1,36 +1,4 @@
1
1
 
2
- .sh-phone{
3
- display: flex;
4
- width: 100%;
5
- align-items: center;
6
- padding: 0 0.25rem;
7
- }
8
- .phone-country{
9
- width: 2rem;
10
- border: none;
11
- align-self: center;
12
- outline: none !important;
13
- padding: 0.4rem;
14
- border-right: 1px solid #0003;
15
- }
16
- .phone-number{
17
- width: calc(100% - 2.2rem);
18
- border: none;
19
- align-self: center;
20
- outline: none;
21
- margin-bottom: 0;
22
- padding: 0.4rem;
23
- }
24
- .sh-phone img{
25
- padding: 0.125rem;
26
- width: 2rem;
27
- height: 2rem;
28
- }
29
- .phone-number::placeholder{
30
- font-weight: 300;
31
- opacity: 0.5;
32
- }
33
-
34
2
  .colored-toast.swal2-icon-success {
35
3
  background-color: #a5dc86 !important;
36
4
  }
@@ -63,6 +31,38 @@
63
31
  color: white;
64
32
  }
65
33
 
34
+ .sh-phone{
35
+ display: flex;
36
+ width: 100%;
37
+ align-items: center;
38
+ padding: 0 0.25rem;
39
+ }
40
+ .phone-country{
41
+ width: 2rem;
42
+ border: none;
43
+ align-self: center;
44
+ outline: none !important;
45
+ padding: 0.4rem;
46
+ border-right: 1px solid #0003;
47
+ }
48
+ .phone-number{
49
+ width: calc(100% - 2.2rem);
50
+ border: none;
51
+ align-self: center;
52
+ outline: none;
53
+ margin-bottom: 0;
54
+ padding: 0.4rem;
55
+ }
56
+ .sh-phone img{
57
+ padding: 0.125rem;
58
+ width: 2rem;
59
+ height: 2rem;
60
+ }
61
+ .phone-number::placeholder{
62
+ font-weight: 300;
63
+ opacity: 0.5;
64
+ }
65
+
66
66
  :root {
67
67
  --ck-z-default: 10555 !important;
68
68
  --ck-z-modal: calc(var(--ck-z-default) + 999) !important;
@@ -84,10 +84,6 @@
84
84
  }
85
85
  }
86
86
 
87
- .sh-forgot-link, .sh-register-link{
88
- cursor: pointer;
89
- }
90
-
91
87
  .sh-selected-item{
92
88
  line-height: unset!important;
93
89
  }
@@ -102,3 +98,7 @@
102
98
  margin-bottom: auto;
103
99
  margin-right: 0.255em;
104
100
  }
101
+
102
+ .sh-forgot-link, .sh-register-link{
103
+ cursor: pointer;
104
+ }
package/dist/library.js CHANGED
@@ -8,8 +8,6 @@ var vue = require('vue');
8
8
  var NProgress = require('nprogress');
9
9
  var Editor = require('@tinymce/tinymce-vue');
10
10
  var Swal = require('sweetalert2');
11
- var ShConfirmAction = require('@/lib/components/ShConfirmAction.vue');
12
- var ShSilentAction = require('@/lib/components/ShSilentAction.vue');
13
11
  var pinia = require('pinia');
14
12
  var vueRouter = require('vue-router');
15
13
 
@@ -20,8 +18,6 @@ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
20
18
  var NProgress__default = /*#__PURE__*/_interopDefaultLegacy(NProgress);
21
19
  var Editor__default = /*#__PURE__*/_interopDefaultLegacy(Editor);
22
20
  var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
23
- var ShConfirmAction__default = /*#__PURE__*/_interopDefaultLegacy(ShConfirmAction);
24
- var ShSilentAction__default = /*#__PURE__*/_interopDefaultLegacy(ShSilentAction);
25
21
 
26
22
  function setItem (key, value) {
27
23
  let toStore = value;
@@ -3113,7 +3109,158 @@ var shRepo = {
3113
3109
  formatDate
3114
3110
  };
3115
3111
 
3112
+ const _hoisted_1$6 = /*#__PURE__*/vue.createElementVNode("span", {
3113
+ class: "spinner-border spinner-border-sm me-1",
3114
+ role: "status",
3115
+ "aria-hidden": "true"
3116
+ }, null, -1 /* HOISTED */);
3117
+
3118
+
3116
3119
  var script$7 = {
3120
+ __name: 'ShConfirmAction',
3121
+ props: {
3122
+ data: Object,
3123
+ title: String,
3124
+ message: String,
3125
+ url: {
3126
+ type: String,
3127
+ required: true
3128
+ },
3129
+ loadingMessage: {
3130
+ type: String,
3131
+ default: 'Processing'
3132
+ }
3133
+ },
3134
+ emits: ['actionSuccessful', 'actionFailed','actionCanceled'],
3135
+ setup(__props, { emit }) {
3136
+
3137
+ const props = __props;
3138
+
3139
+
3140
+ const processing = vue.ref(false);
3141
+
3142
+
3143
+ function runAction () {
3144
+ processing.value = true;
3145
+ shRepo.runPlainRequest(props.url, props.message, props.title, props.data).then(res => {
3146
+ if(res.isConfirmed){
3147
+ const value = res.value;
3148
+ if(value.status){
3149
+ emit('actionSuccessful', res);
3150
+ processing.value = false;
3151
+ } else {
3152
+ emit('actionFailed', value);
3153
+ processing.value = false;
3154
+ }
3155
+ } else {
3156
+ emit('actionCanceled');
3157
+ processing.value = false;
3158
+ }
3159
+ }).catch(ex => {
3160
+ emit('actionFailed', ex);
3161
+ processing.value = false;
3162
+ });
3163
+ }
3164
+
3165
+ return (_ctx, _cache) => {
3166
+ return (vue.openBlock(), vue.createElementBlock("a", {
3167
+ class: vue.normalizeClass(processing.value ? 'disabled':''),
3168
+ onClick: runAction
3169
+ }, [
3170
+ (processing.value)
3171
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3172
+ _hoisted_1$6,
3173
+ vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
3174
+ ], 64 /* STABLE_FRAGMENT */))
3175
+ : vue.createCommentVNode("v-if", true),
3176
+ (!processing.value)
3177
+ ? vue.renderSlot(_ctx.$slots, "default", { key: 1 })
3178
+ : vue.createCommentVNode("v-if", true)
3179
+ ], 2 /* CLASS */))
3180
+ }
3181
+ }
3182
+
3183
+ };
3184
+
3185
+ script$7.__file = "src/lib/components/ShConfirmAction.vue";
3186
+
3187
+ const _hoisted_1$5 = /*#__PURE__*/vue.createElementVNode("span", {
3188
+ class: "spinner-border spinner-border-sm me-1",
3189
+ role: "status",
3190
+ "aria-hidden": "true"
3191
+ }, null, -1 /* HOISTED */);
3192
+
3193
+ var script$6 = {
3194
+ __name: 'ShSilentAction',
3195
+ props: {
3196
+ data: Object,
3197
+ loadingMessage: {
3198
+ type: String,
3199
+ default: 'Processing'
3200
+ },
3201
+ method: {
3202
+ type: String,
3203
+ default: 'POST'
3204
+ },
3205
+ url: {
3206
+ type: String,
3207
+ required: true
3208
+ }
3209
+ },
3210
+ emits: ['actionSuccessful','actionFailed'],
3211
+ setup(__props, { emit }) {
3212
+
3213
+ const props = __props;
3214
+
3215
+
3216
+ const processing = vue.ref(false);
3217
+
3218
+
3219
+ function runAction(){
3220
+ processing.value = true;
3221
+ if(props.method === 'POST'){
3222
+ shApis.doPost(props.url,props.data).then(res=>{
3223
+ emit('actionSuccessful',res);
3224
+ processing.value = false;
3225
+ }).catch(reason=>{
3226
+ emit('actionFailed', reason);
3227
+ processing.value = false;
3228
+ });
3229
+ }
3230
+ if(props.method === 'GET'){
3231
+ shApis.doGet(props.url,props.data).then(res=>{
3232
+ emit('actionSuccessful',res);
3233
+ processing.value = false;
3234
+ }).catch(reason=>{
3235
+ emit('actionFailed', reason);
3236
+ processing.value = false;
3237
+ });
3238
+ }
3239
+ }
3240
+
3241
+ return (_ctx, _cache) => {
3242
+ return (vue.openBlock(), vue.createElementBlock("a", {
3243
+ class: vue.normalizeClass(processing.value ? 'disabled':''),
3244
+ onClick: runAction
3245
+ }, [
3246
+ (processing.value)
3247
+ ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
3248
+ _hoisted_1$5,
3249
+ vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
3250
+ ], 64 /* STABLE_FRAGMENT */))
3251
+ : vue.createCommentVNode("v-if", true),
3252
+ (!processing.value)
3253
+ ? vue.renderSlot(_ctx.$slots, "default", { key: 1 })
3254
+ : vue.createCommentVNode("v-if", true)
3255
+ ], 2 /* CLASS */))
3256
+ }
3257
+ }
3258
+
3259
+ };
3260
+
3261
+ script$6.__file = "src/lib/components/ShSilentAction.vue";
3262
+
3263
+ var script$5 = {
3117
3264
  name: 'sh-table',
3118
3265
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds'],
3119
3266
  inject: ['channel'],
@@ -3344,8 +3491,8 @@ var script$7 = {
3344
3491
  this.reloadData();
3345
3492
  },
3346
3493
  components: {
3347
- ShSilentAction: ShSilentAction__default["default"],
3348
- ShConfirmAction: ShConfirmAction__default["default"],
3494
+ ShSilentAction: script$6,
3495
+ ShConfirmAction: script$7,
3349
3496
  ShCanvas: script$9,
3350
3497
  pagination: script$8
3351
3498
  },
@@ -3365,7 +3512,7 @@ var script$7 = {
3365
3512
  }
3366
3513
  };
3367
3514
 
3368
- const _hoisted_1$6 = { class: "auto-table mt-2" };
3515
+ const _hoisted_1$4 = { class: "auto-table mt-2" };
3369
3516
  const _hoisted_2$4 = {
3370
3517
  key: 0,
3371
3518
  class: "col-md-4 mb-2"
@@ -3527,7 +3674,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3527
3674
  const _component_pagination = vue.resolveComponent("pagination");
3528
3675
  const _component_sh_canvas = vue.resolveComponent("sh-canvas");
3529
3676
 
3530
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
3677
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
3531
3678
  ($props.hasDownload)
3532
3679
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$4, [
3533
3680
  vue.createElementVNode("button", {
@@ -3975,10 +4122,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3975
4122
  ]))
3976
4123
  }
3977
4124
 
3978
- script$7.render = render$1;
3979
- script$7.__file = "src/lib/components/ShTable.vue";
4125
+ script$5.render = render$1;
4126
+ script$5.__file = "src/lib/components/ShTable.vue";
3980
4127
 
3981
- var script$6 = {
4128
+ var script$4 = {
3982
4129
  name: 'ShTabs',
3983
4130
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive','classOne','classTwo','classes'],
3984
4131
  data () {
@@ -4099,10 +4246,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4099
4246
  ], 64 /* STABLE_FRAGMENT */))
4100
4247
  }
4101
4248
 
4102
- script$6.render = render;
4103
- script$6.__file = "src/lib/components/ShTabs.vue";
4249
+ script$4.render = render;
4250
+ script$4.__file = "src/lib/components/ShTabs.vue";
4104
4251
 
4105
- const _hoisted_1$5 = {
4252
+ const _hoisted_1$3 = {
4106
4253
  class: "nav nav-tabs",
4107
4254
  role: "tablist"
4108
4255
  };
@@ -4113,7 +4260,7 @@ const _hoisted_2$3 = {
4113
4260
  const _hoisted_3$3 = ["onClick"];
4114
4261
  const _hoisted_4$3 = { class: "tab-content" };
4115
4262
 
4116
- var script$5 = {
4263
+ var script$3 = {
4117
4264
  __name: 'ShDynamicTabs',
4118
4265
  props: ['tabs','data'],
4119
4266
  setup(__props) {
@@ -4138,7 +4285,7 @@ function setTab(tab){
4138
4285
 
4139
4286
  return (_ctx, _cache) => {
4140
4287
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
4141
- vue.createElementVNode("ul", _hoisted_1$5, [
4288
+ vue.createElementVNode("ul", _hoisted_1$3, [
4142
4289
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab) => {
4143
4290
  return (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$3, [
4144
4291
  vue.createElementVNode("button", {
@@ -4159,158 +4306,7 @@ return (_ctx, _cache) => {
4159
4306
 
4160
4307
  };
4161
4308
 
4162
- script$5.__file = "src/lib/components/ShDynamicTabs.vue";
4163
-
4164
- const _hoisted_1$4 = /*#__PURE__*/vue.createElementVNode("span", {
4165
- class: "spinner-border spinner-border-sm me-1",
4166
- role: "status",
4167
- "aria-hidden": "true"
4168
- }, null, -1 /* HOISTED */);
4169
-
4170
- var script$4 = {
4171
- __name: 'ShSilentAction',
4172
- props: {
4173
- data: Object,
4174
- loadingMessage: {
4175
- type: String,
4176
- default: 'Processing'
4177
- },
4178
- method: {
4179
- type: String,
4180
- default: 'POST'
4181
- },
4182
- url: {
4183
- type: String,
4184
- required: true
4185
- }
4186
- },
4187
- emits: ['actionSuccessful','actionFailed'],
4188
- setup(__props, { emit }) {
4189
-
4190
- const props = __props;
4191
-
4192
-
4193
- const processing = vue.ref(false);
4194
-
4195
-
4196
- function runAction(){
4197
- processing.value = true;
4198
- if(props.method === 'POST'){
4199
- shApis.doPost(props.url,props.data).then(res=>{
4200
- emit('actionSuccessful',res);
4201
- processing.value = false;
4202
- }).catch(reason=>{
4203
- emit('actionFailed', reason);
4204
- processing.value = false;
4205
- });
4206
- }
4207
- if(props.method === 'GET'){
4208
- shApis.doGet(props.url,props.data).then(res=>{
4209
- emit('actionSuccessful',res);
4210
- processing.value = false;
4211
- }).catch(reason=>{
4212
- emit('actionFailed', reason);
4213
- processing.value = false;
4214
- });
4215
- }
4216
- }
4217
-
4218
- return (_ctx, _cache) => {
4219
- return (vue.openBlock(), vue.createElementBlock("a", {
4220
- class: vue.normalizeClass(processing.value ? 'disabled':''),
4221
- onClick: runAction
4222
- }, [
4223
- (processing.value)
4224
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4225
- _hoisted_1$4,
4226
- vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4227
- ], 64 /* STABLE_FRAGMENT */))
4228
- : vue.createCommentVNode("v-if", true),
4229
- (!processing.value)
4230
- ? vue.renderSlot(_ctx.$slots, "default", { key: 1 })
4231
- : vue.createCommentVNode("v-if", true)
4232
- ], 2 /* CLASS */))
4233
- }
4234
- }
4235
-
4236
- };
4237
-
4238
- script$4.__file = "src/lib/components/ShSilentAction.vue";
4239
-
4240
- const _hoisted_1$3 = /*#__PURE__*/vue.createElementVNode("span", {
4241
- class: "spinner-border spinner-border-sm me-1",
4242
- role: "status",
4243
- "aria-hidden": "true"
4244
- }, null, -1 /* HOISTED */);
4245
-
4246
-
4247
- var script$3 = {
4248
- __name: 'ShConfirmAction',
4249
- props: {
4250
- data: Object,
4251
- title: String,
4252
- message: String,
4253
- url: {
4254
- type: String,
4255
- required: true
4256
- },
4257
- loadingMessage: {
4258
- type: String,
4259
- default: 'Processing'
4260
- }
4261
- },
4262
- emits: ['actionSuccessful', 'actionFailed','actionCanceled'],
4263
- setup(__props, { emit }) {
4264
-
4265
- const props = __props;
4266
-
4267
-
4268
- const processing = vue.ref(false);
4269
-
4270
-
4271
- function runAction () {
4272
- processing.value = true;
4273
- shRepo.runPlainRequest(props.url, props.message, props.title, props.data).then(res => {
4274
- if(res.isConfirmed){
4275
- const value = res.value;
4276
- if(value.status){
4277
- emit('actionSuccessful', res);
4278
- processing.value = false;
4279
- } else {
4280
- emit('actionFailed', value);
4281
- processing.value = false;
4282
- }
4283
- } else {
4284
- emit('actionCanceled');
4285
- processing.value = false;
4286
- }
4287
- }).catch(ex => {
4288
- emit('actionFailed', ex);
4289
- processing.value = false;
4290
- });
4291
- }
4292
-
4293
- return (_ctx, _cache) => {
4294
- return (vue.openBlock(), vue.createElementBlock("a", {
4295
- class: vue.normalizeClass(processing.value ? 'disabled':''),
4296
- onClick: runAction
4297
- }, [
4298
- (processing.value)
4299
- ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
4300
- _hoisted_1$3,
4301
- vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4302
- ], 64 /* STABLE_FRAGMENT */))
4303
- : vue.createCommentVNode("v-if", true),
4304
- (!processing.value)
4305
- ? vue.renderSlot(_ctx.$slots, "default", { key: 1 })
4306
- : vue.createCommentVNode("v-if", true)
4307
- ], 2 /* CLASS */))
4308
- }
4309
- }
4310
-
4311
- };
4312
-
4313
- script$3.__file = "src/lib/components/ShConfirmAction.vue";
4309
+ script$3.__file = "src/lib/components/ShDynamicTabs.vue";
4314
4310
 
4315
4311
  const useUserStore = pinia.defineStore('user-store', {
4316
4312
  state: () => ({
@@ -4438,7 +4434,7 @@ return (_ctx, _cache) => {
4438
4434
  _hoisted_5$2,
4439
4435
  vue.createTextVNode(" ADD DEPARTMENT")
4440
4436
  ], 512 /* NEED_PATCH */),
4441
- vue.createVNode(script$7, {
4437
+ vue.createVNode(script$5, {
4442
4438
  headers: ['id','name','description', 'created_at'],
4443
4439
  "end-point": "admin/departments/list",
4444
4440
  actions: {
@@ -4589,7 +4585,7 @@ return (_ctx, _cache) => {
4589
4585
  vue.createElementVNode("div", _hoisted_2$1, [
4590
4586
  _hoisted_3$1,
4591
4587
  vue.createElementVNode("h5", null, "Department #" + vue.toDisplayString(vue.unref(department).id) + " - " + vue.toDisplayString(vue.unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4592
- vue.createVNode(script$7, {
4588
+ vue.createVNode(script$5, {
4593
4589
  actions: {
4594
4590
  label: 'Actions',
4595
4591
  actions: [
@@ -4841,17 +4837,17 @@ const ShFrontend = {
4841
4837
  };
4842
4838
 
4843
4839
  exports.ShCanvas = script$9;
4844
- exports.ShConfirmAction = script$3;
4840
+ exports.ShConfirmAction = script$7;
4845
4841
  exports.ShDropDownForm = script$c;
4846
- exports.ShDynamicTabs = script$5;
4842
+ exports.ShDynamicTabs = script$3;
4847
4843
  exports.ShForm = script$d;
4848
4844
  exports.ShFrontend = ShFrontend;
4849
4845
  exports.ShModal = script$b;
4850
4846
  exports.ShModalForm = script$a;
4851
4847
  exports.ShPhone = script$g;
4852
- exports.ShSilentAction = script$4;
4853
- exports.ShTable = script$7;
4854
- exports.ShTabs = script$6;
4848
+ exports.ShSilentAction = script$6;
4849
+ exports.ShTable = script$5;
4850
+ exports.ShTabs = script$4;
4855
4851
  exports.shApis = shApis;
4856
4852
  exports.shRepo = shRepo;
4857
4853
  exports.shStorage = ShStorage;
package/dist/library.mjs CHANGED
@@ -4,8 +4,6 @@ import { inject, openBlock, createElementBlock, createElementVNode, createTextVN
4
4
  import NProgress from 'nprogress';
5
5
  import Editor from '@tinymce/tinymce-vue';
6
6
  import Swal from 'sweetalert2';
7
- import ShConfirmAction from '@/lib/components/ShConfirmAction.vue';
8
- import ShSilentAction from '@/lib/components/ShSilentAction.vue';
9
7
  import { defineStore, storeToRefs } from 'pinia';
10
8
  import { useRoute, useRouter } from 'vue-router';
11
9
 
@@ -3099,7 +3097,158 @@ var shRepo = {
3099
3097
  formatDate
3100
3098
  };
3101
3099
 
3100
+ const _hoisted_1$6 = /*#__PURE__*/createElementVNode("span", {
3101
+ class: "spinner-border spinner-border-sm me-1",
3102
+ role: "status",
3103
+ "aria-hidden": "true"
3104
+ }, null, -1 /* HOISTED */);
3105
+
3106
+
3102
3107
  var script$7 = {
3108
+ __name: 'ShConfirmAction',
3109
+ props: {
3110
+ data: Object,
3111
+ title: String,
3112
+ message: String,
3113
+ url: {
3114
+ type: String,
3115
+ required: true
3116
+ },
3117
+ loadingMessage: {
3118
+ type: String,
3119
+ default: 'Processing'
3120
+ }
3121
+ },
3122
+ emits: ['actionSuccessful', 'actionFailed','actionCanceled'],
3123
+ setup(__props, { emit }) {
3124
+
3125
+ const props = __props;
3126
+
3127
+
3128
+ const processing = ref(false);
3129
+
3130
+
3131
+ function runAction () {
3132
+ processing.value = true;
3133
+ shRepo.runPlainRequest(props.url, props.message, props.title, props.data).then(res => {
3134
+ if(res.isConfirmed){
3135
+ const value = res.value;
3136
+ if(value.status){
3137
+ emit('actionSuccessful', res);
3138
+ processing.value = false;
3139
+ } else {
3140
+ emit('actionFailed', value);
3141
+ processing.value = false;
3142
+ }
3143
+ } else {
3144
+ emit('actionCanceled');
3145
+ processing.value = false;
3146
+ }
3147
+ }).catch(ex => {
3148
+ emit('actionFailed', ex);
3149
+ processing.value = false;
3150
+ });
3151
+ }
3152
+
3153
+ return (_ctx, _cache) => {
3154
+ return (openBlock(), createElementBlock("a", {
3155
+ class: normalizeClass(processing.value ? 'disabled':''),
3156
+ onClick: runAction
3157
+ }, [
3158
+ (processing.value)
3159
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3160
+ _hoisted_1$6,
3161
+ createElementVNode("span", null, toDisplayString(__props.loadingMessage), 1 /* TEXT */)
3162
+ ], 64 /* STABLE_FRAGMENT */))
3163
+ : createCommentVNode("v-if", true),
3164
+ (!processing.value)
3165
+ ? renderSlot(_ctx.$slots, "default", { key: 1 })
3166
+ : createCommentVNode("v-if", true)
3167
+ ], 2 /* CLASS */))
3168
+ }
3169
+ }
3170
+
3171
+ };
3172
+
3173
+ script$7.__file = "src/lib/components/ShConfirmAction.vue";
3174
+
3175
+ const _hoisted_1$5 = /*#__PURE__*/createElementVNode("span", {
3176
+ class: "spinner-border spinner-border-sm me-1",
3177
+ role: "status",
3178
+ "aria-hidden": "true"
3179
+ }, null, -1 /* HOISTED */);
3180
+
3181
+ var script$6 = {
3182
+ __name: 'ShSilentAction',
3183
+ props: {
3184
+ data: Object,
3185
+ loadingMessage: {
3186
+ type: String,
3187
+ default: 'Processing'
3188
+ },
3189
+ method: {
3190
+ type: String,
3191
+ default: 'POST'
3192
+ },
3193
+ url: {
3194
+ type: String,
3195
+ required: true
3196
+ }
3197
+ },
3198
+ emits: ['actionSuccessful','actionFailed'],
3199
+ setup(__props, { emit }) {
3200
+
3201
+ const props = __props;
3202
+
3203
+
3204
+ const processing = ref(false);
3205
+
3206
+
3207
+ function runAction(){
3208
+ processing.value = true;
3209
+ if(props.method === 'POST'){
3210
+ shApis.doPost(props.url,props.data).then(res=>{
3211
+ emit('actionSuccessful',res);
3212
+ processing.value = false;
3213
+ }).catch(reason=>{
3214
+ emit('actionFailed', reason);
3215
+ processing.value = false;
3216
+ });
3217
+ }
3218
+ if(props.method === 'GET'){
3219
+ shApis.doGet(props.url,props.data).then(res=>{
3220
+ emit('actionSuccessful',res);
3221
+ processing.value = false;
3222
+ }).catch(reason=>{
3223
+ emit('actionFailed', reason);
3224
+ processing.value = false;
3225
+ });
3226
+ }
3227
+ }
3228
+
3229
+ return (_ctx, _cache) => {
3230
+ return (openBlock(), createElementBlock("a", {
3231
+ class: normalizeClass(processing.value ? 'disabled':''),
3232
+ onClick: runAction
3233
+ }, [
3234
+ (processing.value)
3235
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
3236
+ _hoisted_1$5,
3237
+ createElementVNode("span", null, toDisplayString(__props.loadingMessage), 1 /* TEXT */)
3238
+ ], 64 /* STABLE_FRAGMENT */))
3239
+ : createCommentVNode("v-if", true),
3240
+ (!processing.value)
3241
+ ? renderSlot(_ctx.$slots, "default", { key: 1 })
3242
+ : createCommentVNode("v-if", true)
3243
+ ], 2 /* CLASS */))
3244
+ }
3245
+ }
3246
+
3247
+ };
3248
+
3249
+ script$6.__file = "src/lib/components/ShSilentAction.vue";
3250
+
3251
+ var script$5 = {
3103
3252
  name: 'sh-table',
3104
3253
  props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds'],
3105
3254
  inject: ['channel'],
@@ -3330,8 +3479,8 @@ var script$7 = {
3330
3479
  this.reloadData();
3331
3480
  },
3332
3481
  components: {
3333
- ShSilentAction,
3334
- ShConfirmAction,
3482
+ ShSilentAction: script$6,
3483
+ ShConfirmAction: script$7,
3335
3484
  ShCanvas: script$9,
3336
3485
  pagination: script$8
3337
3486
  },
@@ -3351,7 +3500,7 @@ var script$7 = {
3351
3500
  }
3352
3501
  };
3353
3502
 
3354
- const _hoisted_1$6 = { class: "auto-table mt-2" };
3503
+ const _hoisted_1$4 = { class: "auto-table mt-2" };
3355
3504
  const _hoisted_2$4 = {
3356
3505
  key: 0,
3357
3506
  class: "col-md-4 mb-2"
@@ -3513,7 +3662,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3513
3662
  const _component_pagination = resolveComponent("pagination");
3514
3663
  const _component_sh_canvas = resolveComponent("sh-canvas");
3515
3664
 
3516
- return (openBlock(), createElementBlock("div", _hoisted_1$6, [
3665
+ return (openBlock(), createElementBlock("div", _hoisted_1$4, [
3517
3666
  ($props.hasDownload)
3518
3667
  ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
3519
3668
  createElementVNode("button", {
@@ -3961,10 +4110,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
3961
4110
  ]))
3962
4111
  }
3963
4112
 
3964
- script$7.render = render$1;
3965
- script$7.__file = "src/lib/components/ShTable.vue";
4113
+ script$5.render = render$1;
4114
+ script$5.__file = "src/lib/components/ShTable.vue";
3966
4115
 
3967
- var script$6 = {
4116
+ var script$4 = {
3968
4117
  name: 'ShTabs',
3969
4118
  props: ['tabs', 'baseUrl', 'sharedData', 'tabCounts', 'responsive','classOne','classTwo','classes'],
3970
4119
  data () {
@@ -4085,10 +4234,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
4085
4234
  ], 64 /* STABLE_FRAGMENT */))
4086
4235
  }
4087
4236
 
4088
- script$6.render = render;
4089
- script$6.__file = "src/lib/components/ShTabs.vue";
4237
+ script$4.render = render;
4238
+ script$4.__file = "src/lib/components/ShTabs.vue";
4090
4239
 
4091
- const _hoisted_1$5 = {
4240
+ const _hoisted_1$3 = {
4092
4241
  class: "nav nav-tabs",
4093
4242
  role: "tablist"
4094
4243
  };
@@ -4099,7 +4248,7 @@ const _hoisted_2$3 = {
4099
4248
  const _hoisted_3$3 = ["onClick"];
4100
4249
  const _hoisted_4$3 = { class: "tab-content" };
4101
4250
 
4102
- var script$5 = {
4251
+ var script$3 = {
4103
4252
  __name: 'ShDynamicTabs',
4104
4253
  props: ['tabs','data'],
4105
4254
  setup(__props) {
@@ -4124,7 +4273,7 @@ function setTab(tab){
4124
4273
 
4125
4274
  return (_ctx, _cache) => {
4126
4275
  return (openBlock(), createElementBlock(Fragment, null, [
4127
- createElementVNode("ul", _hoisted_1$5, [
4276
+ createElementVNode("ul", _hoisted_1$3, [
4128
4277
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab) => {
4129
4278
  return (openBlock(), createElementBlock("li", _hoisted_2$3, [
4130
4279
  createElementVNode("button", {
@@ -4145,158 +4294,7 @@ return (_ctx, _cache) => {
4145
4294
 
4146
4295
  };
4147
4296
 
4148
- script$5.__file = "src/lib/components/ShDynamicTabs.vue";
4149
-
4150
- const _hoisted_1$4 = /*#__PURE__*/createElementVNode("span", {
4151
- class: "spinner-border spinner-border-sm me-1",
4152
- role: "status",
4153
- "aria-hidden": "true"
4154
- }, null, -1 /* HOISTED */);
4155
-
4156
- var script$4 = {
4157
- __name: 'ShSilentAction',
4158
- props: {
4159
- data: Object,
4160
- loadingMessage: {
4161
- type: String,
4162
- default: 'Processing'
4163
- },
4164
- method: {
4165
- type: String,
4166
- default: 'POST'
4167
- },
4168
- url: {
4169
- type: String,
4170
- required: true
4171
- }
4172
- },
4173
- emits: ['actionSuccessful','actionFailed'],
4174
- setup(__props, { emit }) {
4175
-
4176
- const props = __props;
4177
-
4178
-
4179
- const processing = ref(false);
4180
-
4181
-
4182
- function runAction(){
4183
- processing.value = true;
4184
- if(props.method === 'POST'){
4185
- shApis.doPost(props.url,props.data).then(res=>{
4186
- emit('actionSuccessful',res);
4187
- processing.value = false;
4188
- }).catch(reason=>{
4189
- emit('actionFailed', reason);
4190
- processing.value = false;
4191
- });
4192
- }
4193
- if(props.method === 'GET'){
4194
- shApis.doGet(props.url,props.data).then(res=>{
4195
- emit('actionSuccessful',res);
4196
- processing.value = false;
4197
- }).catch(reason=>{
4198
- emit('actionFailed', reason);
4199
- processing.value = false;
4200
- });
4201
- }
4202
- }
4203
-
4204
- return (_ctx, _cache) => {
4205
- return (openBlock(), createElementBlock("a", {
4206
- class: normalizeClass(processing.value ? 'disabled':''),
4207
- onClick: runAction
4208
- }, [
4209
- (processing.value)
4210
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4211
- _hoisted_1$4,
4212
- createElementVNode("span", null, toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4213
- ], 64 /* STABLE_FRAGMENT */))
4214
- : createCommentVNode("v-if", true),
4215
- (!processing.value)
4216
- ? renderSlot(_ctx.$slots, "default", { key: 1 })
4217
- : createCommentVNode("v-if", true)
4218
- ], 2 /* CLASS */))
4219
- }
4220
- }
4221
-
4222
- };
4223
-
4224
- script$4.__file = "src/lib/components/ShSilentAction.vue";
4225
-
4226
- const _hoisted_1$3 = /*#__PURE__*/createElementVNode("span", {
4227
- class: "spinner-border spinner-border-sm me-1",
4228
- role: "status",
4229
- "aria-hidden": "true"
4230
- }, null, -1 /* HOISTED */);
4231
-
4232
-
4233
- var script$3 = {
4234
- __name: 'ShConfirmAction',
4235
- props: {
4236
- data: Object,
4237
- title: String,
4238
- message: String,
4239
- url: {
4240
- type: String,
4241
- required: true
4242
- },
4243
- loadingMessage: {
4244
- type: String,
4245
- default: 'Processing'
4246
- }
4247
- },
4248
- emits: ['actionSuccessful', 'actionFailed','actionCanceled'],
4249
- setup(__props, { emit }) {
4250
-
4251
- const props = __props;
4252
-
4253
-
4254
- const processing = ref(false);
4255
-
4256
-
4257
- function runAction () {
4258
- processing.value = true;
4259
- shRepo.runPlainRequest(props.url, props.message, props.title, props.data).then(res => {
4260
- if(res.isConfirmed){
4261
- const value = res.value;
4262
- if(value.status){
4263
- emit('actionSuccessful', res);
4264
- processing.value = false;
4265
- } else {
4266
- emit('actionFailed', value);
4267
- processing.value = false;
4268
- }
4269
- } else {
4270
- emit('actionCanceled');
4271
- processing.value = false;
4272
- }
4273
- }).catch(ex => {
4274
- emit('actionFailed', ex);
4275
- processing.value = false;
4276
- });
4277
- }
4278
-
4279
- return (_ctx, _cache) => {
4280
- return (openBlock(), createElementBlock("a", {
4281
- class: normalizeClass(processing.value ? 'disabled':''),
4282
- onClick: runAction
4283
- }, [
4284
- (processing.value)
4285
- ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
4286
- _hoisted_1$3,
4287
- createElementVNode("span", null, toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4288
- ], 64 /* STABLE_FRAGMENT */))
4289
- : createCommentVNode("v-if", true),
4290
- (!processing.value)
4291
- ? renderSlot(_ctx.$slots, "default", { key: 1 })
4292
- : createCommentVNode("v-if", true)
4293
- ], 2 /* CLASS */))
4294
- }
4295
- }
4296
-
4297
- };
4298
-
4299
- script$3.__file = "src/lib/components/ShConfirmAction.vue";
4297
+ script$3.__file = "src/lib/components/ShDynamicTabs.vue";
4300
4298
 
4301
4299
  const useUserStore = defineStore('user-store', {
4302
4300
  state: () => ({
@@ -4424,7 +4422,7 @@ return (_ctx, _cache) => {
4424
4422
  _hoisted_5$2,
4425
4423
  createTextVNode(" ADD DEPARTMENT")
4426
4424
  ], 512 /* NEED_PATCH */),
4427
- createVNode(script$7, {
4425
+ createVNode(script$5, {
4428
4426
  headers: ['id','name','description', 'created_at'],
4429
4427
  "end-point": "admin/departments/list",
4430
4428
  actions: {
@@ -4575,7 +4573,7 @@ return (_ctx, _cache) => {
4575
4573
  createElementVNode("div", _hoisted_2$1, [
4576
4574
  _hoisted_3$1,
4577
4575
  createElementVNode("h5", null, "Department #" + toDisplayString(unref(department).id) + " - " + toDisplayString(unref(department).name) + " Allowed Modules", 1 /* TEXT */),
4578
- createVNode(script$7, {
4576
+ createVNode(script$5, {
4579
4577
  actions: {
4580
4578
  label: 'Actions',
4581
4579
  actions: [
@@ -4826,4 +4824,4 @@ const ShFrontend = {
4826
4824
  }
4827
4825
  };
4828
4826
 
4829
- export { script$9 as ShCanvas, script$3 as ShConfirmAction, script$c as ShDropDownForm, script$5 as ShDynamicTabs, script$d as ShForm, ShFrontend, script$b as ShModal, script$a as ShModalForm, script$g as ShPhone, script$4 as ShSilentAction, script$7 as ShTable, script$6 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
4827
+ export { script$9 as ShCanvas, script$7 as ShConfirmAction, script$c as ShDropDownForm, script$3 as ShDynamicTabs, script$d as ShForm, ShFrontend, script$b as ShModal, script$a as ShModalForm, script$g as ShPhone, script$6 as ShSilentAction, script$5 as ShTable, script$4 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",