@iankibetsh/shframework 1.5.6 → 1.5.8

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.
@@ -95,6 +95,21 @@
95
95
  flex-grow: 1;
96
96
  }
97
97
 
98
+ .sh-selected-item{
99
+ line-height: unset!important;
100
+ }
101
+ .sh-suggestion-input{
102
+ padding: 0.375rem 0.75rem;
103
+ }
104
+ .sh-suggest{
105
+ margin-bottom: 1rem;
106
+ }
107
+ .sh-suggest-control::after{
108
+ margin-top: auto;
109
+ margin-bottom: auto;
110
+ margin-right: 0.255em;
111
+ }
112
+
98
113
  :root {
99
114
  --ck-z-default: 10555 !important;
100
115
  --ck-z-modal: calc(var(--ck-z-default) + 999) !important;
@@ -116,21 +131,6 @@
116
131
  }
117
132
  }
118
133
 
119
- .sh-selected-item{
120
- line-height: unset!important;
121
- }
122
- .sh-suggestion-input{
123
- padding: 0.375rem 0.75rem;
124
- }
125
- .sh-suggest{
126
- margin-bottom: 1rem;
127
- }
128
- .sh-suggest-control::after{
129
- margin-top: auto;
130
- margin-bottom: auto;
131
- margin-right: 0.255em;
132
- }
133
-
134
134
  .sh-forgot-link, .sh-register-link{
135
135
  cursor: pointer;
136
136
  }
package/dist/library.js CHANGED
@@ -2238,6 +2238,7 @@ var script$l = {
2238
2238
  'hasTerms',
2239
2239
  'country_code',
2240
2240
  'submitBtnClass',
2241
+ 'retainModal',
2241
2242
  'fields',
2242
2243
  'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
2243
2244
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
@@ -2443,7 +2444,7 @@ var script$l = {
2443
2444
  }
2444
2445
  }
2445
2446
  NProgress__default["default"].done();
2446
- if (!this.retain_modal_after_submission) {
2447
+ if (!this.retainModal) {
2447
2448
  this.closeModal();
2448
2449
  }
2449
2450
  }).catch((reason, data) => {
@@ -2563,9 +2564,9 @@ const _hoisted_12$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:mo
2563
2564
  const _hoisted_13$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2564
2565
  const _hoisted_14$3 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2565
2566
  const _hoisted_15$3 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2566
- const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
2567
- const _hoisted_17$2 = ["name", "onFocus", "onUpdate:modelValue"];
2568
- const _hoisted_18$2 = ["value"];
2567
+ const _hoisted_16$3 = ["name", "onFocus", "onUpdate:modelValue"];
2568
+ const _hoisted_17$3 = ["name", "onFocus", "onUpdate:modelValue"];
2569
+ const _hoisted_18$3 = ["value"];
2569
2570
  const _hoisted_19$2 = {
2570
2571
  key: 12,
2571
2572
  class: "invalid-feedback"
@@ -2767,7 +2768,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2767
2768
  onFocus: $event => ($options.removeErrors(field)),
2768
2769
  class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2769
2770
  "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2770
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2771
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$3)), [
2771
2772
  [vue.vModelText, _ctx.form_elements[field]]
2772
2773
  ])
2773
2774
  : vue.createCommentVNode("v-if", true),
@@ -2783,9 +2784,9 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2783
2784
  return (vue.openBlock(), vue.createElementBlock("option", {
2784
2785
  key: item.id,
2785
2786
  value: item.id
2786
- }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2787
+ }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$3))
2787
2788
  }), 128 /* KEYED_FRAGMENT */))
2788
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2789
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$3)), [
2789
2790
  [vue.vModelSelect, _ctx.form_elements[field]]
2790
2791
  ])
2791
2792
  : vue.createCommentVNode("v-if", true),
@@ -3658,17 +3659,17 @@ const _hoisted_14$2 = {
3658
3659
  class: "page-link"
3659
3660
  };
3660
3661
  const _hoisted_15$2 = ["onClick"];
3661
- const _hoisted_16$1 = { key: 1 };
3662
- const _hoisted_17$1 = {
3662
+ const _hoisted_16$2 = { key: 1 };
3663
+ const _hoisted_17$2 = {
3663
3664
  key: 0,
3664
3665
  class: "text-center"
3665
3666
  };
3666
- const _hoisted_18$1 = /*#__PURE__*/vue.createElementVNode("div", {
3667
+ const _hoisted_18$2 = /*#__PURE__*/vue.createElementVNode("div", {
3667
3668
  class: "spinner-border",
3668
3669
  role: "status"
3669
3670
  }, null, -1 /* HOISTED */);
3670
3671
  const _hoisted_19$1 = [
3671
- _hoisted_18$1
3672
+ _hoisted_18$2
3672
3673
  ];
3673
3674
  const _hoisted_20$1 = {
3674
3675
  key: 1,
@@ -3734,9 +3735,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3734
3735
  ]))
3735
3736
  : vue.createCommentVNode("v-if", true)
3736
3737
  ]))
3737
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, [
3738
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$2, [
3738
3739
  (this.pagination_data.loading === 1 && $props.loadMore && $props.hideLoadMore)
3739
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, _hoisted_19$1))
3740
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$2, _hoisted_19$1))
3740
3741
  : vue.createCommentVNode("v-if", true),
3741
3742
  (!$props.hideCount)
3742
3743
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20$1, [
@@ -4251,18 +4252,18 @@ const _hoisted_14$1 = {
4251
4252
  class: "alert alert-danger"
4252
4253
  };
4253
4254
  const _hoisted_15$1 = { colspan: 2 };
4254
- const _hoisted_16 = {
4255
+ const _hoisted_16$1 = {
4255
4256
  key: 0,
4256
4257
  class: "text-center"
4257
4258
  };
4258
- const _hoisted_17 = /*#__PURE__*/vue.createElementVNode("div", {
4259
+ const _hoisted_17$1 = /*#__PURE__*/vue.createElementVNode("div", {
4259
4260
  class: "spinner-border",
4260
4261
  role: "status"
4261
4262
  }, [
4262
4263
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4263
4264
  ], -1 /* HOISTED */);
4264
- const _hoisted_18 = [
4265
- _hoisted_17
4265
+ const _hoisted_18$1 = [
4266
+ _hoisted_17$1
4266
4267
  ];
4267
4268
  const _hoisted_19 = {
4268
4269
  key: 1,
@@ -4436,7 +4437,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4436
4437
  : ($options.hasRecordsSlot)
4437
4438
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
4438
4439
  ($data.loading === 'loading')
4439
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, _hoisted_18))
4440
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, _hoisted_18$1))
4440
4441
  : ($data.loading === 'error')
4441
4442
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
4442
4443
  vue.createElementVNode("span", _hoisted_20, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
@@ -5128,28 +5129,39 @@ const _hoisted_2$3 = {
5128
5129
  id: "permissions-nav",
5129
5130
  class: "col-md-3 d-flex align-items-center py-4"
5130
5131
  };
5131
- const _hoisted_3$3 = { class: "d-flex flex-column w-100 px-2" };
5132
- const _hoisted_4$3 = ["checked", "disabled"];
5133
- const _hoisted_5$3 = ["onClick"];
5132
+ const _hoisted_3$3 = {
5133
+ key: 0,
5134
+ class: "mx-auto"
5135
+ };
5136
+ const _hoisted_4$3 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* HOISTED */));
5137
+ const _hoisted_5$3 = [
5138
+ _hoisted_4$3
5139
+ ];
5134
5140
  const _hoisted_6$2 = {
5141
+ key: 1,
5142
+ class: "d-flex flex-column w-100 px-2"
5143
+ };
5144
+ const _hoisted_7$1 = ["checked", "disabled"];
5145
+ const _hoisted_8$1 = ["onClick"];
5146
+ const _hoisted_9$1 = {
5135
5147
  id: "permissions-content",
5136
5148
  class: "col-md-9 py-4 px-4"
5137
5149
  };
5138
- const _hoisted_7$1 = { class: "p-2 rounded-2 bg-white h-100" };
5139
- const _hoisted_8$1 = {
5150
+ const _hoisted_10 = { class: "p-2 rounded-2 bg-white h-100" };
5151
+ const _hoisted_11 = {
5140
5152
  key: 0,
5141
5153
  class: "alert alert-info"
5142
5154
  };
5143
- const _hoisted_9$1 = { key: 1 };
5144
- const _hoisted_10 = { class: "row row-cols-3" };
5145
- const _hoisted_11 = { class: "col" };
5146
- const _hoisted_12 = ["value"];
5147
- const _hoisted_13 = {
5155
+ const _hoisted_12 = { key: 1 };
5156
+ const _hoisted_13 = { class: "row row-cols-3" };
5157
+ const _hoisted_14 = { class: "col" };
5158
+ const _hoisted_15 = ["value"];
5159
+ const _hoisted_16 = {
5148
5160
  key: 0,
5149
5161
  class: "w-100 row"
5150
5162
  };
5151
- const _hoisted_14 = { class: "col-md-3" };
5152
- const _hoisted_15 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5163
+ const _hoisted_17 = { class: "col-md-3" };
5164
+ const _hoisted_18 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5153
5165
 
5154
5166
 
5155
5167
  var script$3 = {
@@ -5177,24 +5189,35 @@ const setModule = module=>{
5177
5189
  vue.onMounted(() => {
5178
5190
  getDepartmentModules();
5179
5191
  });
5192
+ const loadingModules = vue.ref(false);
5180
5193
  const getDepartmentModules = ()=>{
5181
- shApis.doGet(`admin/departments/department/list-all-modules/admin/${departmentId}`).then(res=>{
5194
+ loadingModules.value = true;
5195
+ shApis.doGet(`sh-departments/department/list-all-modules/sh-departments/${departmentId}`).then(res=>{
5196
+ loadingModules.value = false;
5182
5197
  modules.value = res.data.modules;
5183
5198
  department.value = res.data.department;
5184
5199
  departmentModules.value = res.data.departmentModules;
5185
5200
  selectedModule.value = res.data.modules[0];
5186
5201
  getModulePermissions();
5202
+ }).catch(ex=>{
5203
+ loadingModules.value = false;
5204
+ // console.log(ex)
5205
+ shRepo.showToast(ex.message, 'error');
5187
5206
  });
5188
5207
  };
5189
5208
  const loading = vue.ref(false);
5190
5209
  const getModulePermissions = () => {
5191
5210
  loading.value = true;
5192
5211
  modulePermissions.value = null;
5193
- shApis.doGet(`admin/departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5212
+ shApis.doGet(`sh-departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5194
5213
  loading.value = false;
5195
5214
  modulePermissions.value = reformatModulePermissions(res.data.permissions);
5196
5215
  selectedPermissions.value = res.data.selectedPermissions ?? [];
5197
5216
  permissionsChanged.value = false;
5217
+ }).catch(ex=>{
5218
+ console.log(ex);
5219
+ loading.value = false;
5220
+ shRepo.showToast(ex.message, 'error');
5198
5221
  });
5199
5222
  };
5200
5223
  const permissionsUpdated = (res)=>{
@@ -5246,34 +5269,36 @@ const getPermissionStyle = permission => {
5246
5269
  return (_ctx, _cache) => {
5247
5270
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
5248
5271
  vue.createElementVNode("div", _hoisted_2$3, [
5249
- vue.createElementVNode("ul", _hoisted_3$3, [
5250
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modules.value, (module) => {
5251
- return (vue.openBlock(), vue.createElementBlock("li", {
5252
- class: vue.normalizeClass(selectedModule.value === module && 'active'),
5253
- key: selectedModule.value
5254
- }, [
5255
- vue.createElementVNode("input", {
5256
- checked: departmentModules.value.includes(module),
5257
- onClick: checkAllPermissions,
5258
- disabled: selectedModule.value !== module,
5259
- type: "checkbox"
5260
- }, null, 8 /* PROPS */, _hoisted_4$3),
5261
- vue.createElementVNode("label", {
5262
- class: "text-capitalize",
5263
- onClick: $event => (setModule(module))
5264
- }, vue.toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_5$3)
5265
- ], 2 /* CLASS */))
5266
- }), 128 /* KEYED_FRAGMENT */))
5267
- ])
5272
+ (loadingModules.value)
5273
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, _hoisted_5$3))
5274
+ : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_6$2, [
5275
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modules.value, (module) => {
5276
+ return (vue.openBlock(), vue.createElementBlock("li", {
5277
+ class: vue.normalizeClass(selectedModule.value === module && 'active'),
5278
+ key: selectedModule.value
5279
+ }, [
5280
+ vue.createElementVNode("input", {
5281
+ checked: departmentModules.value.includes(module),
5282
+ onClick: checkAllPermissions,
5283
+ disabled: selectedModule.value !== module,
5284
+ type: "checkbox"
5285
+ }, null, 8 /* PROPS */, _hoisted_7$1),
5286
+ vue.createElementVNode("label", {
5287
+ class: "text-capitalize",
5288
+ onClick: $event => (setModule(module))
5289
+ }, vue.toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_8$1)
5290
+ ], 2 /* CLASS */))
5291
+ }), 128 /* KEYED_FRAGMENT */))
5292
+ ]))
5268
5293
  ]),
5269
- vue.createElementVNode("div", _hoisted_6$2, [
5270
- vue.createElementVNode("div", _hoisted_7$1, [
5294
+ vue.createElementVNode("div", _hoisted_9$1, [
5295
+ vue.createElementVNode("div", _hoisted_10, [
5271
5296
  (loading.value)
5272
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$1, " loading ... "))
5273
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$1, [
5274
- vue.createElementVNode("div", _hoisted_10, [
5297
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, " loading ... "))
5298
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
5299
+ vue.createElementVNode("div", _hoisted_13, [
5275
5300
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modulePermissions.value, (permissions) => {
5276
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
5301
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
5277
5302
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(permissions, (permission) => {
5278
5303
  return (vue.openBlock(), vue.createElementBlock("label", {
5279
5304
  onClick: setPermissionsChanged,
@@ -5284,7 +5309,7 @@ return (_ctx, _cache) => {
5284
5309
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((selectedPermissions).value = $event)),
5285
5310
  value: permission,
5286
5311
  type: "checkbox"
5287
- }, null, 8 /* PROPS */, _hoisted_12), [
5312
+ }, null, 8 /* PROPS */, _hoisted_15), [
5288
5313
  [vue.vModelCheckbox, selectedPermissions.value]
5289
5314
  ]),
5290
5315
  vue.createTextVNode(" " + vue.toDisplayString(getLabel(permission)), 1 /* TEXT */)
@@ -5294,16 +5319,16 @@ return (_ctx, _cache) => {
5294
5319
  }), 256 /* UNKEYED_FRAGMENT */))
5295
5320
  ]),
5296
5321
  (permissionsChanged.value)
5297
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
5298
- vue.createElementVNode("div", _hoisted_14, [
5322
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
5323
+ vue.createElementVNode("div", _hoisted_17, [
5299
5324
  vue.createVNode(script$7, {
5300
5325
  onSuccess: permissionsUpdated,
5301
- url: `admin/departments/department/permissions/${vue.unref(departmentId)}/${selectedModule.value}`,
5326
+ url: `sh-departments/department/permissions/${vue.unref(departmentId)}/${selectedModule.value}`,
5302
5327
  data: {permissions: selectedPermissions.value},
5303
5328
  class: "btn btn-primary d-block"
5304
5329
  }, {
5305
5330
  default: vue.withCtx(() => [
5306
- _hoisted_15,
5331
+ _hoisted_18,
5307
5332
  vue.createTextVNode(" Save")
5308
5333
  ]),
5309
5334
  _: 1 /* STABLE */
@@ -5367,7 +5392,7 @@ return (_ctx, _cache) => {
5367
5392
  ], 512 /* NEED_PATCH */),
5368
5393
  vue.createVNode(script$6, {
5369
5394
  headers: ['id','name','description', 'created_at'],
5370
- "end-point": "admin/departments/list",
5395
+ "end-point": "sh-departments/list",
5371
5396
  actions: {
5372
5397
  label: 'Action',
5373
5398
  actions: [
package/dist/library.mjs CHANGED
@@ -2225,6 +2225,7 @@ var script$l = {
2225
2225
  'hasTerms',
2226
2226
  'country_code',
2227
2227
  'submitBtnClass',
2228
+ 'retainModal',
2228
2229
  'fields',
2229
2230
  'columns', 'placeholders', 'field_permissions', 'retainDataAfterSubmission',
2230
2231
  'currentData', 'actionLabel', 'fillSelects', 'phones', 'successCallback',
@@ -2430,7 +2431,7 @@ var script$l = {
2430
2431
  }
2431
2432
  }
2432
2433
  NProgress.done();
2433
- if (!this.retain_modal_after_submission) {
2434
+ if (!this.retainModal) {
2434
2435
  this.closeModal();
2435
2436
  }
2436
2437
  }).catch((reason, data) => {
@@ -2550,9 +2551,9 @@ const _hoisted_12$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:mo
2550
2551
  const _hoisted_13$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2551
2552
  const _hoisted_14$3 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2552
2553
  const _hoisted_15$3 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2553
- const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
2554
- const _hoisted_17$2 = ["name", "onFocus", "onUpdate:modelValue"];
2555
- const _hoisted_18$2 = ["value"];
2554
+ const _hoisted_16$3 = ["name", "onFocus", "onUpdate:modelValue"];
2555
+ const _hoisted_17$3 = ["name", "onFocus", "onUpdate:modelValue"];
2556
+ const _hoisted_18$3 = ["value"];
2556
2557
  const _hoisted_19$2 = {
2557
2558
  key: 12,
2558
2559
  class: "invalid-feedback"
@@ -2754,7 +2755,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2754
2755
  onFocus: $event => ($options.removeErrors(field)),
2755
2756
  class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2756
2757
  "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2757
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2758
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$3)), [
2758
2759
  [vModelText, _ctx.form_elements[field]]
2759
2760
  ])
2760
2761
  : createCommentVNode("v-if", true),
@@ -2770,9 +2771,9 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2770
2771
  return (openBlock(), createElementBlock("option", {
2771
2772
  key: item.id,
2772
2773
  value: item.id
2773
- }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2774
+ }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$3))
2774
2775
  }), 128 /* KEYED_FRAGMENT */))
2775
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2776
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$3)), [
2776
2777
  [vModelSelect, _ctx.form_elements[field]]
2777
2778
  ])
2778
2779
  : createCommentVNode("v-if", true),
@@ -3645,17 +3646,17 @@ const _hoisted_14$2 = {
3645
3646
  class: "page-link"
3646
3647
  };
3647
3648
  const _hoisted_15$2 = ["onClick"];
3648
- const _hoisted_16$1 = { key: 1 };
3649
- const _hoisted_17$1 = {
3649
+ const _hoisted_16$2 = { key: 1 };
3650
+ const _hoisted_17$2 = {
3650
3651
  key: 0,
3651
3652
  class: "text-center"
3652
3653
  };
3653
- const _hoisted_18$1 = /*#__PURE__*/createElementVNode("div", {
3654
+ const _hoisted_18$2 = /*#__PURE__*/createElementVNode("div", {
3654
3655
  class: "spinner-border",
3655
3656
  role: "status"
3656
3657
  }, null, -1 /* HOISTED */);
3657
3658
  const _hoisted_19$1 = [
3658
- _hoisted_18$1
3659
+ _hoisted_18$2
3659
3660
  ];
3660
3661
  const _hoisted_20$1 = {
3661
3662
  key: 1,
@@ -3721,9 +3722,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3721
3722
  ]))
3722
3723
  : createCommentVNode("v-if", true)
3723
3724
  ]))
3724
- : (openBlock(), createElementBlock("div", _hoisted_16$1, [
3725
+ : (openBlock(), createElementBlock("div", _hoisted_16$2, [
3725
3726
  (this.pagination_data.loading === 1 && $props.loadMore && $props.hideLoadMore)
3726
- ? (openBlock(), createElementBlock("div", _hoisted_17$1, _hoisted_19$1))
3727
+ ? (openBlock(), createElementBlock("div", _hoisted_17$2, _hoisted_19$1))
3727
3728
  : createCommentVNode("v-if", true),
3728
3729
  (!$props.hideCount)
3729
3730
  ? (openBlock(), createElementBlock("div", _hoisted_20$1, [
@@ -4238,18 +4239,18 @@ const _hoisted_14$1 = {
4238
4239
  class: "alert alert-danger"
4239
4240
  };
4240
4241
  const _hoisted_15$1 = { colspan: 2 };
4241
- const _hoisted_16 = {
4242
+ const _hoisted_16$1 = {
4242
4243
  key: 0,
4243
4244
  class: "text-center"
4244
4245
  };
4245
- const _hoisted_17 = /*#__PURE__*/createElementVNode("div", {
4246
+ const _hoisted_17$1 = /*#__PURE__*/createElementVNode("div", {
4246
4247
  class: "spinner-border",
4247
4248
  role: "status"
4248
4249
  }, [
4249
4250
  /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4250
4251
  ], -1 /* HOISTED */);
4251
- const _hoisted_18 = [
4252
- _hoisted_17
4252
+ const _hoisted_18$1 = [
4253
+ _hoisted_17$1
4253
4254
  ];
4254
4255
  const _hoisted_19 = {
4255
4256
  key: 1,
@@ -4423,7 +4424,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4423
4424
  : ($options.hasRecordsSlot)
4424
4425
  ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
4425
4426
  ($data.loading === 'loading')
4426
- ? (openBlock(), createElementBlock("div", _hoisted_16, _hoisted_18))
4427
+ ? (openBlock(), createElementBlock("div", _hoisted_16$1, _hoisted_18$1))
4427
4428
  : ($data.loading === 'error')
4428
4429
  ? (openBlock(), createElementBlock("div", _hoisted_19, [
4429
4430
  createElementVNode("span", _hoisted_20, toDisplayString($data.loading_error), 1 /* TEXT */)
@@ -5115,28 +5116,39 @@ const _hoisted_2$3 = {
5115
5116
  id: "permissions-nav",
5116
5117
  class: "col-md-3 d-flex align-items-center py-4"
5117
5118
  };
5118
- const _hoisted_3$3 = { class: "d-flex flex-column w-100 px-2" };
5119
- const _hoisted_4$3 = ["checked", "disabled"];
5120
- const _hoisted_5$3 = ["onClick"];
5119
+ const _hoisted_3$3 = {
5120
+ key: 0,
5121
+ class: "mx-auto"
5122
+ };
5123
+ const _hoisted_4$3 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* HOISTED */));
5124
+ const _hoisted_5$3 = [
5125
+ _hoisted_4$3
5126
+ ];
5121
5127
  const _hoisted_6$2 = {
5128
+ key: 1,
5129
+ class: "d-flex flex-column w-100 px-2"
5130
+ };
5131
+ const _hoisted_7$1 = ["checked", "disabled"];
5132
+ const _hoisted_8$1 = ["onClick"];
5133
+ const _hoisted_9$1 = {
5122
5134
  id: "permissions-content",
5123
5135
  class: "col-md-9 py-4 px-4"
5124
5136
  };
5125
- const _hoisted_7$1 = { class: "p-2 rounded-2 bg-white h-100" };
5126
- const _hoisted_8$1 = {
5137
+ const _hoisted_10 = { class: "p-2 rounded-2 bg-white h-100" };
5138
+ const _hoisted_11 = {
5127
5139
  key: 0,
5128
5140
  class: "alert alert-info"
5129
5141
  };
5130
- const _hoisted_9$1 = { key: 1 };
5131
- const _hoisted_10 = { class: "row row-cols-3" };
5132
- const _hoisted_11 = { class: "col" };
5133
- const _hoisted_12 = ["value"];
5134
- const _hoisted_13 = {
5142
+ const _hoisted_12 = { key: 1 };
5143
+ const _hoisted_13 = { class: "row row-cols-3" };
5144
+ const _hoisted_14 = { class: "col" };
5145
+ const _hoisted_15 = ["value"];
5146
+ const _hoisted_16 = {
5135
5147
  key: 0,
5136
5148
  class: "w-100 row"
5137
5149
  };
5138
- const _hoisted_14 = { class: "col-md-3" };
5139
- const _hoisted_15 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5150
+ const _hoisted_17 = { class: "col-md-3" };
5151
+ const _hoisted_18 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5140
5152
 
5141
5153
 
5142
5154
  var script$3 = {
@@ -5164,24 +5176,35 @@ const setModule = module=>{
5164
5176
  onMounted(() => {
5165
5177
  getDepartmentModules();
5166
5178
  });
5179
+ const loadingModules = ref(false);
5167
5180
  const getDepartmentModules = ()=>{
5168
- shApis.doGet(`admin/departments/department/list-all-modules/admin/${departmentId}`).then(res=>{
5181
+ loadingModules.value = true;
5182
+ shApis.doGet(`sh-departments/department/list-all-modules/sh-departments/${departmentId}`).then(res=>{
5183
+ loadingModules.value = false;
5169
5184
  modules.value = res.data.modules;
5170
5185
  department.value = res.data.department;
5171
5186
  departmentModules.value = res.data.departmentModules;
5172
5187
  selectedModule.value = res.data.modules[0];
5173
5188
  getModulePermissions();
5189
+ }).catch(ex=>{
5190
+ loadingModules.value = false;
5191
+ // console.log(ex)
5192
+ shRepo.showToast(ex.message, 'error');
5174
5193
  });
5175
5194
  };
5176
5195
  const loading = ref(false);
5177
5196
  const getModulePermissions = () => {
5178
5197
  loading.value = true;
5179
5198
  modulePermissions.value = null;
5180
- shApis.doGet(`admin/departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5199
+ shApis.doGet(`sh-departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5181
5200
  loading.value = false;
5182
5201
  modulePermissions.value = reformatModulePermissions(res.data.permissions);
5183
5202
  selectedPermissions.value = res.data.selectedPermissions ?? [];
5184
5203
  permissionsChanged.value = false;
5204
+ }).catch(ex=>{
5205
+ console.log(ex);
5206
+ loading.value = false;
5207
+ shRepo.showToast(ex.message, 'error');
5185
5208
  });
5186
5209
  };
5187
5210
  const permissionsUpdated = (res)=>{
@@ -5233,34 +5256,36 @@ const getPermissionStyle = permission => {
5233
5256
  return (_ctx, _cache) => {
5234
5257
  return (openBlock(), createElementBlock("div", _hoisted_1$3, [
5235
5258
  createElementVNode("div", _hoisted_2$3, [
5236
- createElementVNode("ul", _hoisted_3$3, [
5237
- (openBlock(true), createElementBlock(Fragment, null, renderList(modules.value, (module) => {
5238
- return (openBlock(), createElementBlock("li", {
5239
- class: normalizeClass(selectedModule.value === module && 'active'),
5240
- key: selectedModule.value
5241
- }, [
5242
- createElementVNode("input", {
5243
- checked: departmentModules.value.includes(module),
5244
- onClick: checkAllPermissions,
5245
- disabled: selectedModule.value !== module,
5246
- type: "checkbox"
5247
- }, null, 8 /* PROPS */, _hoisted_4$3),
5248
- createElementVNode("label", {
5249
- class: "text-capitalize",
5250
- onClick: $event => (setModule(module))
5251
- }, toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_5$3)
5252
- ], 2 /* CLASS */))
5253
- }), 128 /* KEYED_FRAGMENT */))
5254
- ])
5259
+ (loadingModules.value)
5260
+ ? (openBlock(), createElementBlock("div", _hoisted_3$3, _hoisted_5$3))
5261
+ : (openBlock(), createElementBlock("ul", _hoisted_6$2, [
5262
+ (openBlock(true), createElementBlock(Fragment, null, renderList(modules.value, (module) => {
5263
+ return (openBlock(), createElementBlock("li", {
5264
+ class: normalizeClass(selectedModule.value === module && 'active'),
5265
+ key: selectedModule.value
5266
+ }, [
5267
+ createElementVNode("input", {
5268
+ checked: departmentModules.value.includes(module),
5269
+ onClick: checkAllPermissions,
5270
+ disabled: selectedModule.value !== module,
5271
+ type: "checkbox"
5272
+ }, null, 8 /* PROPS */, _hoisted_7$1),
5273
+ createElementVNode("label", {
5274
+ class: "text-capitalize",
5275
+ onClick: $event => (setModule(module))
5276
+ }, toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_8$1)
5277
+ ], 2 /* CLASS */))
5278
+ }), 128 /* KEYED_FRAGMENT */))
5279
+ ]))
5255
5280
  ]),
5256
- createElementVNode("div", _hoisted_6$2, [
5257
- createElementVNode("div", _hoisted_7$1, [
5281
+ createElementVNode("div", _hoisted_9$1, [
5282
+ createElementVNode("div", _hoisted_10, [
5258
5283
  (loading.value)
5259
- ? (openBlock(), createElementBlock("div", _hoisted_8$1, " loading ... "))
5260
- : (openBlock(), createElementBlock("div", _hoisted_9$1, [
5261
- createElementVNode("div", _hoisted_10, [
5284
+ ? (openBlock(), createElementBlock("div", _hoisted_11, " loading ... "))
5285
+ : (openBlock(), createElementBlock("div", _hoisted_12, [
5286
+ createElementVNode("div", _hoisted_13, [
5262
5287
  (openBlock(true), createElementBlock(Fragment, null, renderList(modulePermissions.value, (permissions) => {
5263
- return (openBlock(), createElementBlock("div", _hoisted_11, [
5288
+ return (openBlock(), createElementBlock("div", _hoisted_14, [
5264
5289
  (openBlock(true), createElementBlock(Fragment, null, renderList(permissions, (permission) => {
5265
5290
  return (openBlock(), createElementBlock("label", {
5266
5291
  onClick: setPermissionsChanged,
@@ -5271,7 +5296,7 @@ return (_ctx, _cache) => {
5271
5296
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((selectedPermissions).value = $event)),
5272
5297
  value: permission,
5273
5298
  type: "checkbox"
5274
- }, null, 8 /* PROPS */, _hoisted_12), [
5299
+ }, null, 8 /* PROPS */, _hoisted_15), [
5275
5300
  [vModelCheckbox, selectedPermissions.value]
5276
5301
  ]),
5277
5302
  createTextVNode(" " + toDisplayString(getLabel(permission)), 1 /* TEXT */)
@@ -5281,16 +5306,16 @@ return (_ctx, _cache) => {
5281
5306
  }), 256 /* UNKEYED_FRAGMENT */))
5282
5307
  ]),
5283
5308
  (permissionsChanged.value)
5284
- ? (openBlock(), createElementBlock("div", _hoisted_13, [
5285
- createElementVNode("div", _hoisted_14, [
5309
+ ? (openBlock(), createElementBlock("div", _hoisted_16, [
5310
+ createElementVNode("div", _hoisted_17, [
5286
5311
  createVNode(script$7, {
5287
5312
  onSuccess: permissionsUpdated,
5288
- url: `admin/departments/department/permissions/${unref(departmentId)}/${selectedModule.value}`,
5313
+ url: `sh-departments/department/permissions/${unref(departmentId)}/${selectedModule.value}`,
5289
5314
  data: {permissions: selectedPermissions.value},
5290
5315
  class: "btn btn-primary d-block"
5291
5316
  }, {
5292
5317
  default: withCtx(() => [
5293
- _hoisted_15,
5318
+ _hoisted_18,
5294
5319
  createTextVNode(" Save")
5295
5320
  ]),
5296
5321
  _: 1 /* STABLE */
@@ -5354,7 +5379,7 @@ return (_ctx, _cache) => {
5354
5379
  ], 512 /* NEED_PATCH */),
5355
5380
  createVNode(script$6, {
5356
5381
  headers: ['id','name','description', 'created_at'],
5357
- "end-point": "admin/departments/list",
5382
+ "end-point": "sh-departments/list",
5358
5383
  actions: {
5359
5384
  label: 'Action',
5360
5385
  actions: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",