@iankibetsh/shframework 1.5.6 → 1.5.7

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
@@ -2563,9 +2563,9 @@ const _hoisted_12$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:mo
2563
2563
  const _hoisted_13$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2564
2564
  const _hoisted_14$3 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2565
2565
  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"];
2566
+ const _hoisted_16$3 = ["name", "onFocus", "onUpdate:modelValue"];
2567
+ const _hoisted_17$3 = ["name", "onFocus", "onUpdate:modelValue"];
2568
+ const _hoisted_18$3 = ["value"];
2569
2569
  const _hoisted_19$2 = {
2570
2570
  key: 12,
2571
2571
  class: "invalid-feedback"
@@ -2767,7 +2767,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2767
2767
  onFocus: $event => ($options.removeErrors(field)),
2768
2768
  class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2769
2769
  "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2770
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2770
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$3)), [
2771
2771
  [vue.vModelText, _ctx.form_elements[field]]
2772
2772
  ])
2773
2773
  : vue.createCommentVNode("v-if", true),
@@ -2783,9 +2783,9 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2783
2783
  return (vue.openBlock(), vue.createElementBlock("option", {
2784
2784
  key: item.id,
2785
2785
  value: item.id
2786
- }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2786
+ }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$3))
2787
2787
  }), 128 /* KEYED_FRAGMENT */))
2788
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2788
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$3)), [
2789
2789
  [vue.vModelSelect, _ctx.form_elements[field]]
2790
2790
  ])
2791
2791
  : vue.createCommentVNode("v-if", true),
@@ -3658,17 +3658,17 @@ const _hoisted_14$2 = {
3658
3658
  class: "page-link"
3659
3659
  };
3660
3660
  const _hoisted_15$2 = ["onClick"];
3661
- const _hoisted_16$1 = { key: 1 };
3662
- const _hoisted_17$1 = {
3661
+ const _hoisted_16$2 = { key: 1 };
3662
+ const _hoisted_17$2 = {
3663
3663
  key: 0,
3664
3664
  class: "text-center"
3665
3665
  };
3666
- const _hoisted_18$1 = /*#__PURE__*/vue.createElementVNode("div", {
3666
+ const _hoisted_18$2 = /*#__PURE__*/vue.createElementVNode("div", {
3667
3667
  class: "spinner-border",
3668
3668
  role: "status"
3669
3669
  }, null, -1 /* HOISTED */);
3670
3670
  const _hoisted_19$1 = [
3671
- _hoisted_18$1
3671
+ _hoisted_18$2
3672
3672
  ];
3673
3673
  const _hoisted_20$1 = {
3674
3674
  key: 1,
@@ -3734,9 +3734,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3734
3734
  ]))
3735
3735
  : vue.createCommentVNode("v-if", true)
3736
3736
  ]))
3737
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, [
3737
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$2, [
3738
3738
  (this.pagination_data.loading === 1 && $props.loadMore && $props.hideLoadMore)
3739
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$1, _hoisted_19$1))
3739
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_17$2, _hoisted_19$1))
3740
3740
  : vue.createCommentVNode("v-if", true),
3741
3741
  (!$props.hideCount)
3742
3742
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20$1, [
@@ -4251,18 +4251,18 @@ const _hoisted_14$1 = {
4251
4251
  class: "alert alert-danger"
4252
4252
  };
4253
4253
  const _hoisted_15$1 = { colspan: 2 };
4254
- const _hoisted_16 = {
4254
+ const _hoisted_16$1 = {
4255
4255
  key: 0,
4256
4256
  class: "text-center"
4257
4257
  };
4258
- const _hoisted_17 = /*#__PURE__*/vue.createElementVNode("div", {
4258
+ const _hoisted_17$1 = /*#__PURE__*/vue.createElementVNode("div", {
4259
4259
  class: "spinner-border",
4260
4260
  role: "status"
4261
4261
  }, [
4262
4262
  /*#__PURE__*/vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4263
4263
  ], -1 /* HOISTED */);
4264
- const _hoisted_18 = [
4265
- _hoisted_17
4264
+ const _hoisted_18$1 = [
4265
+ _hoisted_17$1
4266
4266
  ];
4267
4267
  const _hoisted_19 = {
4268
4268
  key: 1,
@@ -4436,7 +4436,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4436
4436
  : ($options.hasRecordsSlot)
4437
4437
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
4438
4438
  ($data.loading === 'loading')
4439
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, _hoisted_18))
4439
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16$1, _hoisted_18$1))
4440
4440
  : ($data.loading === 'error')
4441
4441
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19, [
4442
4442
  vue.createElementVNode("span", _hoisted_20, vue.toDisplayString($data.loading_error), 1 /* TEXT */)
@@ -5128,28 +5128,39 @@ const _hoisted_2$3 = {
5128
5128
  id: "permissions-nav",
5129
5129
  class: "col-md-3 d-flex align-items-center py-4"
5130
5130
  };
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"];
5131
+ const _hoisted_3$3 = {
5132
+ key: 0,
5133
+ class: "mx-auto"
5134
+ };
5135
+ const _hoisted_4$3 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* HOISTED */));
5136
+ const _hoisted_5$3 = [
5137
+ _hoisted_4$3
5138
+ ];
5134
5139
  const _hoisted_6$2 = {
5140
+ key: 1,
5141
+ class: "d-flex flex-column w-100 px-2"
5142
+ };
5143
+ const _hoisted_7$1 = ["checked", "disabled"];
5144
+ const _hoisted_8$1 = ["onClick"];
5145
+ const _hoisted_9$1 = {
5135
5146
  id: "permissions-content",
5136
5147
  class: "col-md-9 py-4 px-4"
5137
5148
  };
5138
- const _hoisted_7$1 = { class: "p-2 rounded-2 bg-white h-100" };
5139
- const _hoisted_8$1 = {
5149
+ const _hoisted_10 = { class: "p-2 rounded-2 bg-white h-100" };
5150
+ const _hoisted_11 = {
5140
5151
  key: 0,
5141
5152
  class: "alert alert-info"
5142
5153
  };
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 = {
5154
+ const _hoisted_12 = { key: 1 };
5155
+ const _hoisted_13 = { class: "row row-cols-3" };
5156
+ const _hoisted_14 = { class: "col" };
5157
+ const _hoisted_15 = ["value"];
5158
+ const _hoisted_16 = {
5148
5159
  key: 0,
5149
5160
  class: "w-100 row"
5150
5161
  };
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 */));
5162
+ const _hoisted_17 = { class: "col-md-3" };
5163
+ const _hoisted_18 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/vue.createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5153
5164
 
5154
5165
 
5155
5166
  var script$3 = {
@@ -5177,24 +5188,35 @@ const setModule = module=>{
5177
5188
  vue.onMounted(() => {
5178
5189
  getDepartmentModules();
5179
5190
  });
5191
+ const loadingModules = vue.ref(false);
5180
5192
  const getDepartmentModules = ()=>{
5181
- shApis.doGet(`admin/departments/department/list-all-modules/admin/${departmentId}`).then(res=>{
5193
+ loadingModules.value = true;
5194
+ shApis.doGet(`sh-departments/department/list-all-modules/sh-departments/${departmentId}`).then(res=>{
5195
+ loadingModules.value = false;
5182
5196
  modules.value = res.data.modules;
5183
5197
  department.value = res.data.department;
5184
5198
  departmentModules.value = res.data.departmentModules;
5185
5199
  selectedModule.value = res.data.modules[0];
5186
5200
  getModulePermissions();
5201
+ }).catch(ex=>{
5202
+ loadingModules.value = false;
5203
+ // console.log(ex)
5204
+ shRepo.showToast(ex.message, 'error');
5187
5205
  });
5188
5206
  };
5189
5207
  const loading = vue.ref(false);
5190
5208
  const getModulePermissions = () => {
5191
5209
  loading.value = true;
5192
5210
  modulePermissions.value = null;
5193
- shApis.doGet(`admin/departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5211
+ shApis.doGet(`sh-departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5194
5212
  loading.value = false;
5195
5213
  modulePermissions.value = reformatModulePermissions(res.data.permissions);
5196
5214
  selectedPermissions.value = res.data.selectedPermissions ?? [];
5197
5215
  permissionsChanged.value = false;
5216
+ }).catch(ex=>{
5217
+ console.log(ex);
5218
+ loading.value = false;
5219
+ shRepo.showToast(ex.message, 'error');
5198
5220
  });
5199
5221
  };
5200
5222
  const permissionsUpdated = (res)=>{
@@ -5246,34 +5268,36 @@ const getPermissionStyle = permission => {
5246
5268
  return (_ctx, _cache) => {
5247
5269
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
5248
5270
  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
- ])
5271
+ (loadingModules.value)
5272
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, _hoisted_5$3))
5273
+ : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_6$2, [
5274
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modules.value, (module) => {
5275
+ return (vue.openBlock(), vue.createElementBlock("li", {
5276
+ class: vue.normalizeClass(selectedModule.value === module && 'active'),
5277
+ key: selectedModule.value
5278
+ }, [
5279
+ vue.createElementVNode("input", {
5280
+ checked: departmentModules.value.includes(module),
5281
+ onClick: checkAllPermissions,
5282
+ disabled: selectedModule.value !== module,
5283
+ type: "checkbox"
5284
+ }, null, 8 /* PROPS */, _hoisted_7$1),
5285
+ vue.createElementVNode("label", {
5286
+ class: "text-capitalize",
5287
+ onClick: $event => (setModule(module))
5288
+ }, vue.toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_8$1)
5289
+ ], 2 /* CLASS */))
5290
+ }), 128 /* KEYED_FRAGMENT */))
5291
+ ]))
5268
5292
  ]),
5269
- vue.createElementVNode("div", _hoisted_6$2, [
5270
- vue.createElementVNode("div", _hoisted_7$1, [
5293
+ vue.createElementVNode("div", _hoisted_9$1, [
5294
+ vue.createElementVNode("div", _hoisted_10, [
5271
5295
  (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, [
5296
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, " loading ... "))
5297
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, [
5298
+ vue.createElementVNode("div", _hoisted_13, [
5275
5299
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modulePermissions.value, (permissions) => {
5276
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, [
5300
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [
5277
5301
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(permissions, (permission) => {
5278
5302
  return (vue.openBlock(), vue.createElementBlock("label", {
5279
5303
  onClick: setPermissionsChanged,
@@ -5284,7 +5308,7 @@ return (_ctx, _cache) => {
5284
5308
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((selectedPermissions).value = $event)),
5285
5309
  value: permission,
5286
5310
  type: "checkbox"
5287
- }, null, 8 /* PROPS */, _hoisted_12), [
5311
+ }, null, 8 /* PROPS */, _hoisted_15), [
5288
5312
  [vue.vModelCheckbox, selectedPermissions.value]
5289
5313
  ]),
5290
5314
  vue.createTextVNode(" " + vue.toDisplayString(getLabel(permission)), 1 /* TEXT */)
@@ -5294,16 +5318,16 @@ return (_ctx, _cache) => {
5294
5318
  }), 256 /* UNKEYED_FRAGMENT */))
5295
5319
  ]),
5296
5320
  (permissionsChanged.value)
5297
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
5298
- vue.createElementVNode("div", _hoisted_14, [
5321
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_16, [
5322
+ vue.createElementVNode("div", _hoisted_17, [
5299
5323
  vue.createVNode(script$7, {
5300
5324
  onSuccess: permissionsUpdated,
5301
- url: `admin/departments/department/permissions/${vue.unref(departmentId)}/${selectedModule.value}`,
5325
+ url: `sh-departments/department/permissions/${vue.unref(departmentId)}/${selectedModule.value}`,
5302
5326
  data: {permissions: selectedPermissions.value},
5303
5327
  class: "btn btn-primary d-block"
5304
5328
  }, {
5305
5329
  default: vue.withCtx(() => [
5306
- _hoisted_15,
5330
+ _hoisted_18,
5307
5331
  vue.createTextVNode(" Save")
5308
5332
  ]),
5309
5333
  _: 1 /* STABLE */
@@ -5367,7 +5391,7 @@ return (_ctx, _cache) => {
5367
5391
  ], 512 /* NEED_PATCH */),
5368
5392
  vue.createVNode(script$6, {
5369
5393
  headers: ['id','name','description', 'created_at'],
5370
- "end-point": "admin/departments/list",
5394
+ "end-point": "sh-departments/list",
5371
5395
  actions: {
5372
5396
  label: 'Action',
5373
5397
  actions: [
package/dist/library.mjs CHANGED
@@ -2550,9 +2550,9 @@ const _hoisted_12$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:mo
2550
2550
  const _hoisted_13$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2551
2551
  const _hoisted_14$3 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2552
2552
  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"];
2553
+ const _hoisted_16$3 = ["name", "onFocus", "onUpdate:modelValue"];
2554
+ const _hoisted_17$3 = ["name", "onFocus", "onUpdate:modelValue"];
2555
+ const _hoisted_18$3 = ["value"];
2556
2556
  const _hoisted_19$2 = {
2557
2557
  key: 12,
2558
2558
  class: "invalid-feedback"
@@ -2754,7 +2754,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2754
2754
  onFocus: $event => ($options.removeErrors(field)),
2755
2755
  class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2756
2756
  "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2757
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2757
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$3)), [
2758
2758
  [vModelText, _ctx.form_elements[field]]
2759
2759
  ])
2760
2760
  : createCommentVNode("v-if", true),
@@ -2770,9 +2770,9 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2770
2770
  return (openBlock(), createElementBlock("option", {
2771
2771
  key: item.id,
2772
2772
  value: item.id
2773
- }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2773
+ }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$3))
2774
2774
  }), 128 /* KEYED_FRAGMENT */))
2775
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2775
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$3)), [
2776
2776
  [vModelSelect, _ctx.form_elements[field]]
2777
2777
  ])
2778
2778
  : createCommentVNode("v-if", true),
@@ -3645,17 +3645,17 @@ const _hoisted_14$2 = {
3645
3645
  class: "page-link"
3646
3646
  };
3647
3647
  const _hoisted_15$2 = ["onClick"];
3648
- const _hoisted_16$1 = { key: 1 };
3649
- const _hoisted_17$1 = {
3648
+ const _hoisted_16$2 = { key: 1 };
3649
+ const _hoisted_17$2 = {
3650
3650
  key: 0,
3651
3651
  class: "text-center"
3652
3652
  };
3653
- const _hoisted_18$1 = /*#__PURE__*/createElementVNode("div", {
3653
+ const _hoisted_18$2 = /*#__PURE__*/createElementVNode("div", {
3654
3654
  class: "spinner-border",
3655
3655
  role: "status"
3656
3656
  }, null, -1 /* HOISTED */);
3657
3657
  const _hoisted_19$1 = [
3658
- _hoisted_18$1
3658
+ _hoisted_18$2
3659
3659
  ];
3660
3660
  const _hoisted_20$1 = {
3661
3661
  key: 1,
@@ -3721,9 +3721,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
3721
3721
  ]))
3722
3722
  : createCommentVNode("v-if", true)
3723
3723
  ]))
3724
- : (openBlock(), createElementBlock("div", _hoisted_16$1, [
3724
+ : (openBlock(), createElementBlock("div", _hoisted_16$2, [
3725
3725
  (this.pagination_data.loading === 1 && $props.loadMore && $props.hideLoadMore)
3726
- ? (openBlock(), createElementBlock("div", _hoisted_17$1, _hoisted_19$1))
3726
+ ? (openBlock(), createElementBlock("div", _hoisted_17$2, _hoisted_19$1))
3727
3727
  : createCommentVNode("v-if", true),
3728
3728
  (!$props.hideCount)
3729
3729
  ? (openBlock(), createElementBlock("div", _hoisted_20$1, [
@@ -4238,18 +4238,18 @@ const _hoisted_14$1 = {
4238
4238
  class: "alert alert-danger"
4239
4239
  };
4240
4240
  const _hoisted_15$1 = { colspan: 2 };
4241
- const _hoisted_16 = {
4241
+ const _hoisted_16$1 = {
4242
4242
  key: 0,
4243
4243
  class: "text-center"
4244
4244
  };
4245
- const _hoisted_17 = /*#__PURE__*/createElementVNode("div", {
4245
+ const _hoisted_17$1 = /*#__PURE__*/createElementVNode("div", {
4246
4246
  class: "spinner-border",
4247
4247
  role: "status"
4248
4248
  }, [
4249
4249
  /*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
4250
4250
  ], -1 /* HOISTED */);
4251
- const _hoisted_18 = [
4252
- _hoisted_17
4251
+ const _hoisted_18$1 = [
4252
+ _hoisted_17$1
4253
4253
  ];
4254
4254
  const _hoisted_19 = {
4255
4255
  key: 1,
@@ -4423,7 +4423,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4423
4423
  : ($options.hasRecordsSlot)
4424
4424
  ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
4425
4425
  ($data.loading === 'loading')
4426
- ? (openBlock(), createElementBlock("div", _hoisted_16, _hoisted_18))
4426
+ ? (openBlock(), createElementBlock("div", _hoisted_16$1, _hoisted_18$1))
4427
4427
  : ($data.loading === 'error')
4428
4428
  ? (openBlock(), createElementBlock("div", _hoisted_19, [
4429
4429
  createElementVNode("span", _hoisted_20, toDisplayString($data.loading_error), 1 /* TEXT */)
@@ -5115,28 +5115,39 @@ const _hoisted_2$3 = {
5115
5115
  id: "permissions-nav",
5116
5116
  class: "col-md-3 d-flex align-items-center py-4"
5117
5117
  };
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"];
5118
+ const _hoisted_3$3 = {
5119
+ key: 0,
5120
+ class: "mx-auto"
5121
+ };
5122
+ const _hoisted_4$3 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* HOISTED */));
5123
+ const _hoisted_5$3 = [
5124
+ _hoisted_4$3
5125
+ ];
5121
5126
  const _hoisted_6$2 = {
5127
+ key: 1,
5128
+ class: "d-flex flex-column w-100 px-2"
5129
+ };
5130
+ const _hoisted_7$1 = ["checked", "disabled"];
5131
+ const _hoisted_8$1 = ["onClick"];
5132
+ const _hoisted_9$1 = {
5122
5133
  id: "permissions-content",
5123
5134
  class: "col-md-9 py-4 px-4"
5124
5135
  };
5125
- const _hoisted_7$1 = { class: "p-2 rounded-2 bg-white h-100" };
5126
- const _hoisted_8$1 = {
5136
+ const _hoisted_10 = { class: "p-2 rounded-2 bg-white h-100" };
5137
+ const _hoisted_11 = {
5127
5138
  key: 0,
5128
5139
  class: "alert alert-info"
5129
5140
  };
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 = {
5141
+ const _hoisted_12 = { key: 1 };
5142
+ const _hoisted_13 = { class: "row row-cols-3" };
5143
+ const _hoisted_14 = { class: "col" };
5144
+ const _hoisted_15 = ["value"];
5145
+ const _hoisted_16 = {
5135
5146
  key: 0,
5136
5147
  class: "w-100 row"
5137
5148
  };
5138
- const _hoisted_14 = { class: "col-md-3" };
5139
- const _hoisted_15 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5149
+ const _hoisted_17 = { class: "col-md-3" };
5150
+ const _hoisted_18 = /*#__PURE__*/ _withScopeId$1(() => /*#__PURE__*/createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */));
5140
5151
 
5141
5152
 
5142
5153
  var script$3 = {
@@ -5164,24 +5175,35 @@ const setModule = module=>{
5164
5175
  onMounted(() => {
5165
5176
  getDepartmentModules();
5166
5177
  });
5178
+ const loadingModules = ref(false);
5167
5179
  const getDepartmentModules = ()=>{
5168
- shApis.doGet(`admin/departments/department/list-all-modules/admin/${departmentId}`).then(res=>{
5180
+ loadingModules.value = true;
5181
+ shApis.doGet(`sh-departments/department/list-all-modules/sh-departments/${departmentId}`).then(res=>{
5182
+ loadingModules.value = false;
5169
5183
  modules.value = res.data.modules;
5170
5184
  department.value = res.data.department;
5171
5185
  departmentModules.value = res.data.departmentModules;
5172
5186
  selectedModule.value = res.data.modules[0];
5173
5187
  getModulePermissions();
5188
+ }).catch(ex=>{
5189
+ loadingModules.value = false;
5190
+ // console.log(ex)
5191
+ shRepo.showToast(ex.message, 'error');
5174
5192
  });
5175
5193
  };
5176
5194
  const loading = ref(false);
5177
5195
  const getModulePermissions = () => {
5178
5196
  loading.value = true;
5179
5197
  modulePermissions.value = null;
5180
- shApis.doGet(`admin/departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5198
+ shApis.doGet(`sh-departments/department/get-module-permissions/${selectedModule.value}?department_id=${departmentId}`).then(res=>{
5181
5199
  loading.value = false;
5182
5200
  modulePermissions.value = reformatModulePermissions(res.data.permissions);
5183
5201
  selectedPermissions.value = res.data.selectedPermissions ?? [];
5184
5202
  permissionsChanged.value = false;
5203
+ }).catch(ex=>{
5204
+ console.log(ex);
5205
+ loading.value = false;
5206
+ shRepo.showToast(ex.message, 'error');
5185
5207
  });
5186
5208
  };
5187
5209
  const permissionsUpdated = (res)=>{
@@ -5233,34 +5255,36 @@ const getPermissionStyle = permission => {
5233
5255
  return (_ctx, _cache) => {
5234
5256
  return (openBlock(), createElementBlock("div", _hoisted_1$3, [
5235
5257
  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
- ])
5258
+ (loadingModules.value)
5259
+ ? (openBlock(), createElementBlock("div", _hoisted_3$3, _hoisted_5$3))
5260
+ : (openBlock(), createElementBlock("ul", _hoisted_6$2, [
5261
+ (openBlock(true), createElementBlock(Fragment, null, renderList(modules.value, (module) => {
5262
+ return (openBlock(), createElementBlock("li", {
5263
+ class: normalizeClass(selectedModule.value === module && 'active'),
5264
+ key: selectedModule.value
5265
+ }, [
5266
+ createElementVNode("input", {
5267
+ checked: departmentModules.value.includes(module),
5268
+ onClick: checkAllPermissions,
5269
+ disabled: selectedModule.value !== module,
5270
+ type: "checkbox"
5271
+ }, null, 8 /* PROPS */, _hoisted_7$1),
5272
+ createElementVNode("label", {
5273
+ class: "text-capitalize",
5274
+ onClick: $event => (setModule(module))
5275
+ }, toDisplayString(module.replaceAll('_',' ')), 9 /* TEXT, PROPS */, _hoisted_8$1)
5276
+ ], 2 /* CLASS */))
5277
+ }), 128 /* KEYED_FRAGMENT */))
5278
+ ]))
5255
5279
  ]),
5256
- createElementVNode("div", _hoisted_6$2, [
5257
- createElementVNode("div", _hoisted_7$1, [
5280
+ createElementVNode("div", _hoisted_9$1, [
5281
+ createElementVNode("div", _hoisted_10, [
5258
5282
  (loading.value)
5259
- ? (openBlock(), createElementBlock("div", _hoisted_8$1, " loading ... "))
5260
- : (openBlock(), createElementBlock("div", _hoisted_9$1, [
5261
- createElementVNode("div", _hoisted_10, [
5283
+ ? (openBlock(), createElementBlock("div", _hoisted_11, " loading ... "))
5284
+ : (openBlock(), createElementBlock("div", _hoisted_12, [
5285
+ createElementVNode("div", _hoisted_13, [
5262
5286
  (openBlock(true), createElementBlock(Fragment, null, renderList(modulePermissions.value, (permissions) => {
5263
- return (openBlock(), createElementBlock("div", _hoisted_11, [
5287
+ return (openBlock(), createElementBlock("div", _hoisted_14, [
5264
5288
  (openBlock(true), createElementBlock(Fragment, null, renderList(permissions, (permission) => {
5265
5289
  return (openBlock(), createElementBlock("label", {
5266
5290
  onClick: setPermissionsChanged,
@@ -5271,7 +5295,7 @@ return (_ctx, _cache) => {
5271
5295
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((selectedPermissions).value = $event)),
5272
5296
  value: permission,
5273
5297
  type: "checkbox"
5274
- }, null, 8 /* PROPS */, _hoisted_12), [
5298
+ }, null, 8 /* PROPS */, _hoisted_15), [
5275
5299
  [vModelCheckbox, selectedPermissions.value]
5276
5300
  ]),
5277
5301
  createTextVNode(" " + toDisplayString(getLabel(permission)), 1 /* TEXT */)
@@ -5281,16 +5305,16 @@ return (_ctx, _cache) => {
5281
5305
  }), 256 /* UNKEYED_FRAGMENT */))
5282
5306
  ]),
5283
5307
  (permissionsChanged.value)
5284
- ? (openBlock(), createElementBlock("div", _hoisted_13, [
5285
- createElementVNode("div", _hoisted_14, [
5308
+ ? (openBlock(), createElementBlock("div", _hoisted_16, [
5309
+ createElementVNode("div", _hoisted_17, [
5286
5310
  createVNode(script$7, {
5287
5311
  onSuccess: permissionsUpdated,
5288
- url: `admin/departments/department/permissions/${unref(departmentId)}/${selectedModule.value}`,
5312
+ url: `sh-departments/department/permissions/${unref(departmentId)}/${selectedModule.value}`,
5289
5313
  data: {permissions: selectedPermissions.value},
5290
5314
  class: "btn btn-primary d-block"
5291
5315
  }, {
5292
5316
  default: withCtx(() => [
5293
- _hoisted_15,
5317
+ _hoisted_18,
5294
5318
  createTextVNode(" Save")
5295
5319
  ]),
5296
5320
  _: 1 /* STABLE */
@@ -5354,7 +5378,7 @@ return (_ctx, _cache) => {
5354
5378
  ], 512 /* NEED_PATCH */),
5355
5379
  createVNode(script$6, {
5356
5380
  headers: ['id','name','description', 'created_at'],
5357
- "end-point": "admin/departments/list",
5381
+ "end-point": "sh-departments/list",
5358
5382
  actions: {
5359
5383
  label: 'Action',
5360
5384
  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.7",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",