@iankibetsh/shframework 5.5.3 → 5.5.5

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.
Files changed (3) hide show
  1. package/dist/library.js +1011 -972
  2. package/dist/library.mjs +1012 -972
  3. package/package.json +5 -5
package/dist/library.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var Axios = require('axios');
6
- var moment = require('moment');
6
+ var luxon = require('luxon');
7
7
  var Swal = require('sweetalert2');
8
8
  var bootstrap = require('bootstrap');
9
9
  var NProgress = require('nprogress');
@@ -15,7 +15,6 @@ var vueRouter = require('vue-router');
15
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
16
 
17
17
  var Axios__default = /*#__PURE__*/_interopDefaultLegacy(Axios);
18
- var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
19
18
  var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
20
19
  var NProgress__default = /*#__PURE__*/_interopDefaultLegacy(NProgress);
21
20
  var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
@@ -204,7 +203,6 @@ function showToast(message, toastType, config){
204
203
  Toast.fire({
205
204
  icon: toastType,
206
205
  title: message,
207
- postion: 'bottom'
208
206
  });
209
207
  }
210
208
 
@@ -260,7 +258,39 @@ function formatDate(date, format){
260
258
  if (!format) {
261
259
  format = 'lll';
262
260
  }
263
- return moment__default["default"](date).format(format)
261
+ const formatMap = {
262
+ 'lll': "MMM d, yyyy, h:mm a",
263
+ 'LLL': "MMMM d, yyyy, h:mm a",
264
+ 'LL': "MMMM d, yyyy",
265
+ 'L': "MM/dd/yyyy",
266
+ 'YYYY-MM-DD': 'yyyy-MM-dd',
267
+ 'YYYY/MM/DD': 'yyyy/MM/dd',
268
+ 'YYYY': 'yyyy',
269
+ 'MM': 'MM',
270
+ 'DD': 'dd',
271
+ 'HH:mm': 'HH:mm',
272
+ 'hh:mm A': 'hh:mm a',
273
+ 'MMM D, YYYY': 'MMM d, yyyy',
274
+ 'MMMM D, YYYY': 'MMMM d, yyyy',
275
+ 'MMM D, YYYY h:mm A': 'MMM d, yyyy h:mm a',
276
+ 'MMMM D, YYYY h:mm A': 'MMMM d, yyyy h:mm a',
277
+ // Add more as needed
278
+ };
279
+ const luxonFormat = formatMap[format] || format;
280
+ // Accepts ISO string, JS Date, or Luxon DateTime
281
+ let dt;
282
+ if (typeof date === 'string' || date instanceof String) {
283
+ dt = luxon.DateTime.fromISO(date);
284
+ if (!dt.isValid) dt = luxon.DateTime.fromRFC2822(date);
285
+ if (!dt.isValid) dt = luxon.DateTime.fromFormat(date, 'yyyy-MM-dd');
286
+ } else if (date instanceof Date) {
287
+ dt = luxon.DateTime.fromJSDate(date);
288
+ } else if (date && typeof date === 'object' && date.isValid !== undefined) {
289
+ dt = date;
290
+ } else {
291
+ return ''
292
+ }
293
+ return dt.isValid ? dt.toFormat(luxonFormat) : ''
264
294
  }
265
295
 
266
296
  function formatNumber(amount, decimalPoints = 0){
@@ -342,7 +372,7 @@ function logoutUser(){
342
372
  function sessionRestored(){
343
373
  const timeout = shStorage.getItem('sessionTimeout') * 60;
344
374
  const last_activity = shStorage.getItem('last_activity');
345
- const pastSeconds = moment__default["default"]().diff(last_activity, 'seconds');
375
+ const pastSeconds = luxon.DateTime.now().diff(luxon.DateTime.fromISO(last_activity), 'seconds').seconds;
346
376
  if(!shStorage.getItem('access_token'))
347
377
  return false
348
378
  return pastSeconds < timeout
@@ -351,8 +381,8 @@ const checkSession = function (isCheking) {
351
381
  const timeout = shStorage.getItem('sessionTimeout');
352
382
  const last_activity = shStorage.getItem('last_activity');
353
383
  if (shStorage.getItem('access_token')) {
354
- const pastMinutes = moment__default["default"]().diff(last_activity, 'minutes');
355
- const pastSeconds = moment__default["default"]().diff(last_activity, 'seconds');
384
+ const pastMinutes = luxon.DateTime.now().diff(luxon.DateTime.fromISO(last_activity), 'minutes').minutes;
385
+ const pastSeconds = luxon.DateTime.now().diff(luxon.DateTime.fromISO(last_activity), 'seconds').seconds;
356
386
  if(pastMinutes >= timeout) {
357
387
  const gracePeriod = pastSeconds - (timeout * 60);
358
388
  if (gracePeriod >= 60 ) {
@@ -407,14 +437,14 @@ async function shSwalLogout (seconds = 30) {
407
437
  } else {
408
438
  window.ShConfirmation = null;
409
439
  clearInterval(window.shInterval);
410
- const timeNow = moment__default["default"]().toISOString();
440
+ const timeNow = luxon.DateTime.now().toISO();
411
441
  shStorage.setItem('last_activity', timeNow);
412
442
  startSession();
413
443
  }
414
444
  })
415
445
  }
416
446
  function startSession () {
417
- const timeNow = moment__default["default"]().toISOString();
447
+ const timeNow = luxon.DateTime.now().toISO();
418
448
  const accessToken = shStorage.getItem('access_token');
419
449
  if (accessToken) {
420
450
  shStorage.setItem('last_activity', timeNow);
@@ -429,7 +459,7 @@ const updateSession = () =>{
429
459
  if(!window.shInterval) {
430
460
  startSession();
431
461
  }
432
- const timeNow = moment__default["default"]().toISOString();
462
+ const timeNow = luxon.DateTime.now().toISO();
433
463
  shStorage.setItem('last_activity', timeNow);
434
464
  };
435
465
 
@@ -2114,19 +2144,19 @@ const _hoisted_1$r = {
2114
2144
  class: "sh-phone mb-3",
2115
2145
  style: {"display":"flex"}
2116
2146
  };
2117
- const _hoisted_2$j = {
2147
+ const _hoisted_2$i = {
2118
2148
  key: 0,
2119
2149
  style: {"display":"contents"}
2120
2150
  };
2121
- const _hoisted_3$g = ["src"];
2151
+ const _hoisted_3$f = ["src"];
2122
2152
  const _hoisted_4$f = ["value"];
2123
2153
  const _hoisted_5$c = ["disabled"];
2124
2154
 
2125
2155
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
2126
2156
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$r, [
2127
2157
  ($data.selectedCountry)
2128
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$j, [
2129
- vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$g),
2158
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$i, [
2159
+ vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$f),
2130
2160
  vue.createTextVNode(" " + vue.toDisplayString($data.selectedCountry.dialCode), 1 /* TEXT */)
2131
2161
  ]))
2132
2162
  : vue.createCommentVNode("v-if", true),
@@ -2165,8 +2195,8 @@ const _hoisted_1$q = {
2165
2195
  key: 0,
2166
2196
  class: "dropdown sh-suggest"
2167
2197
  };
2168
- const _hoisted_2$i = ["id"];
2169
- const _hoisted_3$f = { class: "sh-suggestions-holder" };
2198
+ const _hoisted_2$h = ["id"];
2199
+ const _hoisted_3$e = { class: "sh-suggestions-holder" };
2170
2200
  const _hoisted_4$e = { class: "badge bg-secondary m-1 sh-selected-item" };
2171
2201
  const _hoisted_5$b = ["onClick"];
2172
2202
  const _hoisted_6$9 = ["id"];
@@ -2334,7 +2364,7 @@ return (_ctx, _cache) => {
2334
2364
  class: "p-0 d-flex sh-suggest-control dropdown-toggle",
2335
2365
  "aria-expanded": "false"
2336
2366
  }, [
2337
- vue.createElementVNode("div", _hoisted_3$f, [
2367
+ vue.createElementVNode("div", _hoisted_3$e, [
2338
2368
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(selectedSuggestions), (sgt) => {
2339
2369
  return (vue.openBlock(), vue.createElementBlock("h5", _hoisted_4$e, [
2340
2370
  vue.createTextVNode(vue.toDisplayString(sgt.name) + " ", 1 /* TEXT */),
@@ -2354,7 +2384,7 @@ return (_ctx, _cache) => {
2354
2384
  onChange: filterData,
2355
2385
  class: "flex-fill h-100 sh-suggestion-input"
2356
2386
  }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_6$9)
2357
- ], 8 /* PROPS */, _hoisted_2$i),
2387
+ ], 8 /* PROPS */, _hoisted_2$h),
2358
2388
  vue.createElementVNode("ul", {
2359
2389
  class: vue.normalizeClass([(!vue.unref(suggestions) || vue.unref(suggestions).length === 0) ? 'no-sh-suggestions':'sh-found-suggestions', "dropdown-menu w-100"]),
2360
2390
  id: 'dropwdown_section' + vue.unref(id),
@@ -2757,12 +2787,12 @@ const _hoisted_1$p = {
2757
2787
  ref: "ShAutoForm",
2758
2788
  class: "sh-form"
2759
2789
  };
2760
- const _hoisted_2$h = {
2790
+ const _hoisted_2$g = {
2761
2791
  key: 0,
2762
2792
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2763
2793
  role: "alert"
2764
2794
  };
2765
- const _hoisted_3$e = { key: 0 };
2795
+ const _hoisted_3$d = { key: 0 };
2766
2796
  const _hoisted_4$d = { key: 1 };
2767
2797
  const _hoisted_5$a = { class: "row" };
2768
2798
  const _hoisted_6$8 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
@@ -2796,15 +2826,15 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
2796
2826
  const _component_ShSuggest = vue.resolveComponent("ShSuggest");
2797
2827
 
2798
2828
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2799
- _cache[5] || (_cache[5] = vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */)),
2829
+ _cache[5] || (_cache[5] = vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* CACHED */)),
2800
2830
  vue.createElementVNode("form", _hoisted_1$p, [
2801
2831
  vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2802
2832
  vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2803
2833
  (_ctx.form_status == 3)
2804
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$h, [
2805
- _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */)),
2834
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$g, [
2835
+ _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* CACHED */)),
2806
2836
  (_ctx.errorText)
2807
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$e, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2837
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$d, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2808
2838
  : (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$d, "Unexpected Error Occurred")),
2809
2839
  vue.createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2810
2840
  ]))
@@ -3012,8 +3042,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3012
3042
  }), 128 /* KEYED_FRAGMENT */))
3013
3043
  ]),
3014
3044
  ($props.hasTerms)
3015
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24$1, _cache[3] || (_cache[3] = [
3016
- vue.createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */),
3045
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_24$1, [...(_cache[3] || (_cache[3] = [
3046
+ vue.createElementVNode("h5", null, "Confirm and Submit", -1 /* CACHED */),
3017
3047
  vue.createElementVNode("p", null, [
3018
3048
  vue.createTextVNode("By clicking submit, you agree to our "),
3019
3049
  vue.createElementVNode("a", {
@@ -3025,8 +3055,8 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3025
3055
  target: "_blank",
3026
3056
  href: "https://hauzisha.co.ke/privacy-policy"
3027
3057
  }, "privacy policy")
3028
- ], -1 /* HOISTED */)
3029
- ])))
3058
+ ], -1 /* CACHED */)
3059
+ ]))]))
3030
3060
  : vue.createCommentVNode("v-if", true),
3031
3061
  (_ctx.form_status == 1)
3032
3062
  ? (vue.openBlock(), vue.createElementBlock("button", {
@@ -3034,14 +3064,14 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
3034
3064
  class: vue.normalizeClass(["btn btn-primary", $options.getSubmitBtnClass()]),
3035
3065
  type: "button",
3036
3066
  disabled: ""
3037
- }, _cache[4] || (_cache[4] = [
3067
+ }, [...(_cache[4] || (_cache[4] = [
3038
3068
  vue.createElementVNode("span", {
3039
3069
  class: "spinner-border spinner-border-sm",
3040
3070
  role: "status",
3041
3071
  "aria-hidden": "true"
3042
- }, null, -1 /* HOISTED */),
3043
- vue.createTextVNode(" Processing... ")
3044
- ]), 2 /* CLASS */))
3072
+ }, null, -1 /* CACHED */),
3073
+ vue.createTextVNode(" Processing... ", -1 /* CACHED */)
3074
+ ]))], 2 /* CLASS */))
3045
3075
  : (vue.openBlock(), vue.createElementBlock("button", {
3046
3076
  key: 3,
3047
3077
  "data-cy": "sh_form_submit",
@@ -3371,8 +3401,8 @@ return (_ctx, _cache) => {
3371
3401
  script$r.__file = "src/lib/components/form-components/DateInput.vue";
3372
3402
 
3373
3403
  const _hoisted_1$m = ["name", "onUpdate:modelValue"];
3374
- const _hoisted_2$g = ["innerHTML"];
3375
- const _hoisted_3$d = {
3404
+ const _hoisted_2$f = ["innerHTML"];
3405
+ const _hoisted_3$c = {
3376
3406
  key: 0,
3377
3407
  class: "text-danger sh-required"
3378
3408
  };
@@ -3476,7 +3506,7 @@ const getFieldComponent = (fieldObj) => {
3476
3506
  };
3477
3507
  const shFormElementClasses = vue.ref(null);
3478
3508
  shFormElementClasses.value = vue.inject('shFormElementClasses');
3479
- const shAutoForm = vue.ref(null);
3509
+ const shAutoForm = vue.useTemplateRef('shAutoForm');
3480
3510
  const closeModal = e => {
3481
3511
  setTimeout(() => {
3482
3512
  if(!shAutoForm.value){
@@ -3638,101 +3668,98 @@ vue.onMounted((ev) => {
3638
3668
 
3639
3669
 
3640
3670
  return (_ctx, _cache) => {
3641
- return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3642
- _cache[2] || (_cache[2] = vue.createElementVNode("div", null, null, -1 /* HOISTED */)),
3643
- vue.createElementVNode("form", {
3644
- class: vue.normalizeClass([__props.formClass, "sh-auto-form"]),
3645
- ref_key: "shAutoForm",
3646
- ref: shAutoForm,
3647
- onSubmit: _cache[0] || (_cache[0] = e => submitForm(e))
3671
+ return (vue.openBlock(), vue.createElementBlock("form", {
3672
+ class: vue.normalizeClass([__props.formClass, "sh-auto-form"]),
3673
+ ref_key: "shAutoForm",
3674
+ ref: shAutoForm,
3675
+ onSubmit: _cache[0] || (_cache[0] = e => submitForm(e))
3676
+ }, [
3677
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(formFields.value, (field, index) => {
3678
+ return (vue.openBlock(), vue.createElementBlock("div", {
3679
+ key: field,
3680
+ class: vue.normalizeClass(getElementClass('formGroup') + ' sh-field' + field.field)
3681
+ }, [
3682
+ (field.type === 'hidden')
3683
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3684
+ key: 0,
3685
+ type: "hidden",
3686
+ name: field.field,
3687
+ "onUpdate:modelValue": $event => ((formFields.value[index].value) = $event)
3688
+ }, null, 8 /* PROPS */, _hoisted_1$m)), [
3689
+ [vue.vModelText, formFields.value[index].value]
3690
+ ])
3691
+ : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
3692
+ (!vue.unref(isFloating) && field.label)
3693
+ ? (vue.openBlock(), vue.createElementBlock("label", {
3694
+ key: 0,
3695
+ class: vue.normalizeClass(getElementClass('formLabel'))
3696
+ }, [
3697
+ vue.createElementVNode("span", {
3698
+ innerHTML: field.label,
3699
+ class: "sh-label"
3700
+ }, null, 8 /* PROPS */, _hoisted_2$f),
3701
+ (field.required)
3702
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$c, "*"))
3703
+ : vue.createCommentVNode("v-if", true)
3704
+ ], 2 /* CLASS */))
3705
+ : vue.createCommentVNode("v-if", true),
3706
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field)), vue.mergeProps({ ref_for: true }, getComponentProps(field), {
3707
+ isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
3708
+ onClick: $event => (fieldChanged(field.field)),
3709
+ "onUpdate:modelValue": [$event => (fieldChanged(field.field)), $event => ((formFields.value[index].value) = $event)],
3710
+ modelValue: formFields.value[index].value,
3711
+ class: getComponentClass(field.field)
3712
+ }), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
3713
+ (vue.unref(isFloating) && field.label)
3714
+ ? (vue.openBlock(), vue.createElementBlock("label", {
3715
+ key: 1,
3716
+ class: vue.normalizeClass(getElementClass('formLabel')),
3717
+ innerHTML: field.label
3718
+ }, null, 10 /* CLASS, PROPS */, _hoisted_4$c))
3719
+ : vue.createCommentVNode("v-if", true),
3720
+ (vue.unref(isFloating))
3721
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$9, [...(_cache[1] || (_cache[1] = [
3722
+ vue.createElementVNode("div", { class: "form-notch-leading" }, null, -1 /* CACHED */),
3723
+ vue.createElementVNode("div", { class: "form-notch-middle" }, null, -1 /* CACHED */),
3724
+ vue.createElementVNode("div", { class: "form-notch-trailing" }, null, -1 /* CACHED */)
3725
+ ]))]))
3726
+ : vue.createCommentVNode("v-if", true),
3727
+ (field.helper)
3728
+ ? (vue.openBlock(), vue.createElementBlock("div", {
3729
+ key: 3,
3730
+ class: vue.normalizeClass(getElementClass('helperText')),
3731
+ innerHTML: field.helper
3732
+ }, null, 10 /* CLASS, PROPS */, _hoisted_6$7))
3733
+ : vue.createCommentVNode("v-if", true),
3734
+ (validationErrors.value[field.field])
3735
+ ? (vue.openBlock(), vue.createElementBlock("div", {
3736
+ key: 4,
3737
+ class: vue.normalizeClass(getElementClass('invalidFeedback'))
3738
+ }, vue.toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
3739
+ : vue.createCommentVNode("v-if", true)
3740
+ ], 64 /* STABLE_FRAGMENT */))
3741
+ ], 2 /* CLASS */))
3742
+ }), 128 /* KEYED_FRAGMENT */)),
3743
+ vue.renderSlot(_ctx.$slots, "default"),
3744
+ vue.createElementVNode("div", {
3745
+ class: vue.normalizeClass(getElementClass('formGroup'))
3648
3746
  }, [
3649
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(formFields.value, (field, index) => {
3650
- return (vue.openBlock(), vue.createElementBlock("div", {
3651
- key: field,
3652
- class: vue.normalizeClass(getElementClass('formGroup') + ' sh-field' + field.field)
3653
- }, [
3654
- (field.type === 'hidden')
3655
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3656
- key: 0,
3657
- type: "hidden",
3658
- name: field.field,
3659
- "onUpdate:modelValue": $event => ((formFields.value[index].value) = $event)
3660
- }, null, 8 /* PROPS */, _hoisted_1$m)), [
3661
- [vue.vModelText, formFields.value[index].value]
3662
- ])
3663
- : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
3664
- (!vue.unref(isFloating) && field.label)
3665
- ? (vue.openBlock(), vue.createElementBlock("label", {
3666
- key: 0,
3667
- class: vue.normalizeClass(getElementClass('formLabel'))
3668
- }, [
3669
- vue.createElementVNode("span", {
3670
- innerHTML: field.label,
3671
- class: "sh-label"
3672
- }, null, 8 /* PROPS */, _hoisted_2$g),
3673
- (field.required)
3674
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$d, "*"))
3675
- : vue.createCommentVNode("v-if", true)
3676
- ], 2 /* CLASS */))
3677
- : vue.createCommentVNode("v-if", true),
3678
- (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field)), vue.mergeProps({ ref_for: true }, getComponentProps(field), {
3679
- isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
3680
- onClick: $event => (fieldChanged(field.field)),
3681
- "onUpdate:modelValue": [$event => (fieldChanged(field.field)), $event => ((formFields.value[index].value) = $event)],
3682
- modelValue: formFields.value[index].value,
3683
- class: getComponentClass(field.field)
3684
- }), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
3685
- (vue.unref(isFloating) && field.label)
3686
- ? (vue.openBlock(), vue.createElementBlock("label", {
3687
- key: 1,
3688
- class: vue.normalizeClass(getElementClass('formLabel')),
3689
- innerHTML: field.label
3690
- }, null, 10 /* CLASS, PROPS */, _hoisted_4$c))
3691
- : vue.createCommentVNode("v-if", true),
3692
- (vue.unref(isFloating))
3693
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$9, [...(_cache[1] || (_cache[1] = [
3694
- vue.createElementVNode("div", { class: "form-notch-leading" }, null, -1 /* HOISTED */),
3695
- vue.createElementVNode("div", { class: "form-notch-middle" }, null, -1 /* HOISTED */),
3696
- vue.createElementVNode("div", { class: "form-notch-trailing" }, null, -1 /* HOISTED */)
3697
- ]))]))
3698
- : vue.createCommentVNode("v-if", true),
3699
- (field.helper)
3700
- ? (vue.openBlock(), vue.createElementBlock("div", {
3701
- key: 3,
3702
- class: vue.normalizeClass(getElementClass('helperText')),
3703
- innerHTML: field.helper
3704
- }, null, 10 /* CLASS, PROPS */, _hoisted_6$7))
3705
- : vue.createCommentVNode("v-if", true),
3706
- (validationErrors.value[field.field])
3707
- ? (vue.openBlock(), vue.createElementBlock("div", {
3708
- key: 4,
3709
- class: vue.normalizeClass(getElementClass('invalidFeedback'))
3710
- }, vue.toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
3711
- : vue.createCommentVNode("v-if", true)
3712
- ], 64 /* STABLE_FRAGMENT */))
3713
- ], 2 /* CLASS */))
3714
- }), 128 /* KEYED_FRAGMENT */)),
3715
- vue.renderSlot(_ctx.$slots, "default"),
3716
- vue.createElementVNode("div", {
3717
- class: vue.normalizeClass(getElementClass('formGroup'))
3747
+ vue.createElementVNode("button", {
3748
+ style: vue.normalizeStyle({width: submitBtnWidth.value}),
3749
+ ref_key: "submitBtn",
3750
+ ref: submitBtn,
3751
+ disabled: loading.value,
3752
+ class: vue.normalizeClass(getElementClass('actionBtn'))
3718
3753
  }, [
3719
- vue.createElementVNode("button", {
3720
- style: vue.normalizeStyle({width: submitBtnWidth.value}),
3721
- ref_key: "submitBtn",
3722
- ref: submitBtn,
3723
- disabled: loading.value,
3724
- class: vue.normalizeClass(getElementClass('actionBtn'))
3725
- }, [
3726
- (loading.value)
3727
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$5))
3728
- : vue.createCommentVNode("v-if", true),
3729
- (!loading.value)
3730
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$5, "Submit"))
3731
- : vue.createCommentVNode("v-if", true)
3732
- ], 14 /* CLASS, STYLE, PROPS */, _hoisted_7$6)
3733
- ], 2 /* CLASS */)
3734
- ], 34 /* CLASS, NEED_HYDRATION */)
3735
- ], 64 /* STABLE_FRAGMENT */))
3754
+ (loading.value)
3755
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$5))
3756
+ : vue.createCommentVNode("v-if", true),
3757
+ (!loading.value)
3758
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_9$5, "Submit"))
3759
+ : vue.createCommentVNode("v-if", true)
3760
+ ], 14 /* CLASS, STYLE, PROPS */, _hoisted_7$6)
3761
+ ], 2 /* CLASS */)
3762
+ ], 34 /* CLASS, NEED_HYDRATION */))
3736
3763
  }
3737
3764
  }
3738
3765
 
@@ -3741,8 +3768,8 @@ return (_ctx, _cache) => {
3741
3768
  script$q.__file = "src/lib/components/ShAutoForm.vue";
3742
3769
 
3743
3770
  const _hoisted_1$l = ["id", "data-bs-backdrop"];
3744
- const _hoisted_2$f = { class: "modal-content" };
3745
- const _hoisted_3$c = { class: "modal-header" };
3771
+ const _hoisted_2$e = { class: "modal-content" };
3772
+ const _hoisted_3$b = { class: "modal-header" };
3746
3773
  const _hoisted_4$b = { class: "modal-title flex-fill" };
3747
3774
  const _hoisted_5$8 = { class: "modal-body" };
3748
3775
  const _hoisted_6$6 = { class: "section" };
@@ -3806,15 +3833,15 @@ return (_ctx, _cache) => {
3806
3833
  vue.createElementVNode("div", {
3807
3834
  class: vue.normalizeClass(["modal-dialog", modalClasses.value])
3808
3835
  }, [
3809
- vue.createElementVNode("div", _hoisted_2$f, [
3810
- vue.createElementVNode("div", _hoisted_3$c, [
3836
+ vue.createElementVNode("div", _hoisted_2$e, [
3837
+ vue.createElementVNode("div", _hoisted_3$b, [
3811
3838
  vue.createElementVNode("h3", _hoisted_4$b, vue.toDisplayString(__props.modalTitle), 1 /* TEXT */),
3812
3839
  _cache[0] || (_cache[0] = vue.createElementVNode("button", {
3813
3840
  type: "button",
3814
3841
  class: "btn-close sh-modal-close",
3815
3842
  "data-bs-dismiss": "modal",
3816
3843
  "aria-label": "Close"
3817
- }, null, -1 /* HOISTED */))
3844
+ }, null, -1 /* CACHED */))
3818
3845
  ]),
3819
3846
  vue.createElementVNode("div", _hoisted_5$8, [
3820
3847
  vue.createElementVNode("div", _hoisted_6$6, [
@@ -3832,8 +3859,6 @@ return (_ctx, _cache) => {
3832
3859
  script$p.__file = "src/lib/components/ShModal.vue";
3833
3860
 
3834
3861
  const _hoisted_1$k = { class: "dropdown sh-dropdown-form" };
3835
- const _hoisted_2$e = ["id"];
3836
- const _hoisted_3$b = ["aria-labelledby"];
3837
3862
 
3838
3863
  var script$o = {
3839
3864
  __name: 'ShDropDownForm',
@@ -3880,25 +3905,26 @@ const formSubmitted = (res)=>{
3880
3905
  const formError = (res)=>{
3881
3906
  emit('formError',res);
3882
3907
  };
3908
+ const dropdownId = 'dropdown' + (Math.random() + 1).toString(36).substring(2);
3883
3909
 
3884
3910
  return (_ctx, _cache) => {
3885
3911
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3886
- _cache[0] || (_cache[0] = vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */)),
3912
+ _cache[0] || (_cache[0] = vue.createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* CACHED */)),
3887
3913
  vue.createElementVNode("div", _hoisted_1$k, [
3888
3914
  vue.createElementVNode("a", {
3889
3915
  class: vue.normalizeClass(vue.unref(btnClass)),
3890
3916
  href: "#",
3891
3917
  role: "button",
3892
- id: _ctx.dropdownId,
3918
+ id: dropdownId,
3893
3919
  "data-bs-toggle": "dropdown",
3894
3920
  "data-bs-auto-close": "outside",
3895
3921
  "aria-expanded": "false"
3896
3922
  }, [
3897
3923
  vue.renderSlot(_ctx.$slots, "default")
3898
- ], 10 /* CLASS, PROPS */, _hoisted_2$e),
3924
+ ], 2 /* CLASS */),
3899
3925
  vue.createElementVNode("div", {
3900
3926
  class: "dropdown-menu px-2 py-1",
3901
- "aria-labelledby": _ctx.dropdownId
3927
+ "aria-labelledby": dropdownId
3902
3928
  }, [
3903
3929
  (vue.openBlock(), vue.createBlock(script$q, vue.mergeProps({
3904
3930
  onSuccess: success,
@@ -3907,7 +3933,7 @@ return (_ctx, _cache) => {
3907
3933
  onFormError: formError,
3908
3934
  key: JSON.stringify(__props.currentData ?? {})
3909
3935
  }, props), null, 16 /* FULL_PROPS */))
3910
- ], 8 /* PROPS */, _hoisted_3$b)
3936
+ ])
3911
3937
  ])
3912
3938
  ], 64 /* STABLE_FRAGMENT */))
3913
3939
  }
@@ -3970,6 +3996,18 @@ const emitClick = ()=>{
3970
3996
  emit('click');
3971
3997
  };
3972
3998
 
3999
+
4000
+ const allProps = vue.ref({});
4001
+
4002
+ // make cleaned props computed
4003
+
4004
+ const cleanedProp = vue.computed(()=>{
4005
+ const p = {...props};
4006
+ delete p.class;
4007
+ delete p.modalId;
4008
+ return p
4009
+ });
4010
+
3973
4011
  return (_ctx, _cache) => {
3974
4012
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
3975
4013
  vue.createElementVNode("a", {
@@ -3987,13 +4025,15 @@ return (_ctx, _cache) => {
3987
4025
  "modal-title": __props.modalTitle
3988
4026
  }, {
3989
4027
  default: vue.withCtx(() => [
3990
- (vue.openBlock(), vue.createBlock(script$q, vue.mergeProps({
3991
- onSuccess: success,
3992
- onFieldChanged: fieldChanged,
3993
- onFormSubmitted: formSubmitted,
3994
- onFormError: formError,
3995
- key: JSON.stringify(__props.currentData ?? {})
3996
- }, props), null, 16 /* FULL_PROPS */))
4028
+ (allProps.value)
4029
+ ? (vue.openBlock(), vue.createBlock(script$q, vue.mergeProps({
4030
+ onSuccess: success,
4031
+ onFieldChanged: fieldChanged,
4032
+ onFormSubmitted: formSubmitted,
4033
+ onFormError: formError,
4034
+ key: JSON.stringify(__props.currentData ?? {})
4035
+ }, cleanedProp.value), null, 16 /* FULL_PROPS */))
4036
+ : vue.createCommentVNode("v-if", true)
3997
4037
  ]),
3998
4038
  _: 1 /* STABLE */
3999
4039
  }, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
@@ -4147,7 +4187,7 @@ const _hoisted_1$g = { class: "callout callout-info" };
4147
4187
  function render$2(_ctx, _cache) {
4148
4188
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
4149
4189
  vue.renderSlot(_ctx.$slots, "default", {}, () => [
4150
- _cache[0] || (_cache[0] = vue.createTextVNode(" No records found "))
4190
+ _cache[0] || (_cache[0] = vue.createTextVNode(" No records found ", -1 /* CACHED */))
4151
4191
  ])
4152
4192
  ]))
4153
4193
  }
@@ -4158,108 +4198,6 @@ script$k.render = render$2;
4158
4198
  script$k.__scopeId = "data-v-55cf77fb";
4159
4199
  script$k.__file = "src/lib/components/others/NoRecords.vue";
4160
4200
 
4161
- const useUserStore = pinia.defineStore('user-store', {
4162
- state: () => ({
4163
- user: null,
4164
- role: null,
4165
- permissions: null,
4166
- menus: [],
4167
- loggedOut: false
4168
- }),
4169
- actions: {
4170
- setUser (defaultEndpoint) {
4171
- let user = null;
4172
- try {
4173
- user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
4174
- } catch (error) {
4175
- user= null;
4176
- }
4177
- if(typeof user !== 'object'){
4178
- user = null;
4179
- }
4180
- if (user ) {
4181
- user.isAllowedTo = function (slug) {
4182
- if (this.permissions) {
4183
- let permissions = [];
4184
- if (typeof this.permissions === 'string') {
4185
- permissions = this.permissions;
4186
- } else {
4187
- permissions = this.permissions;
4188
- }
4189
- return permissions.includes(slug)
4190
- }
4191
- return false
4192
- };
4193
- }
4194
- this.user = user;
4195
- const userEndpoint = defaultEndpoint ?? vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4196
-
4197
- shApis.doGet(userEndpoint).then(res => {
4198
- let user = res.data.user;
4199
- if (typeof(user) === 'undefined') {
4200
- user = res.data;
4201
- }
4202
- shStorage.setItem('user',user);
4203
- user.signOut = this.signOut;
4204
- user.logout = this.signOut;
4205
- user.logOut = this.signOut;
4206
- user.isAllowedTo = function (slug) {
4207
- if(!slug){
4208
- return true
4209
- }
4210
- if (this.permissions) {
4211
- let permissions = [];
4212
- if (typeof this.permissions === 'string') {
4213
- permissions = this.permissions;
4214
- } else {
4215
- permissions = this.permissions;
4216
- }
4217
- return permissions.includes(slug)
4218
- }
4219
- return false
4220
- };
4221
- user.can = user.isAllowedTo;
4222
- this.user = user;
4223
- }).catch((reason) => {
4224
- if (reason.response && reason.response.status) {
4225
- if(reason.response.status === 401) {
4226
- shStorage.setItem('user',null);
4227
- this.user = null;
4228
- }
4229
- this.loggedOut = true;
4230
- }
4231
- });
4232
- if (this.user) {
4233
- if (typeof this.user.permissions === 'string') {
4234
- this.permissions = this.user.permissions;
4235
- } else {
4236
- this.permissions = this.user.permissions;
4237
- }
4238
- }
4239
- const timeNow = moment__default["default"]().toISOString();
4240
- shStorage.setItem('session_start',timeNow);
4241
- },
4242
- signOut () {
4243
- shRepo.signOutUser();
4244
- },
4245
- logOut () {
4246
- this.signOut();
4247
- },
4248
- getUser () {
4249
- this.setUser();
4250
- },
4251
- setAccessToken (accessToken) {
4252
- shStorage.setItem('access_token', accessToken);
4253
- this.setUser();
4254
- }
4255
- },
4256
- getters: {
4257
- userId (state) {
4258
- return state.user === null ? null:state.user.id
4259
- }
4260
- }
4261
- });
4262
-
4263
4201
  var script$j = {
4264
4202
  __name: 'ShConfirmAction',
4265
4203
  props: {
@@ -4340,7 +4278,7 @@ return (_ctx, _cache) => {
4340
4278
  class: "spinner-border spinner-border-sm me-1",
4341
4279
  role: "status",
4342
4280
  "aria-hidden": "true"
4343
- }, null, -1 /* HOISTED */)),
4281
+ }, null, -1 /* CACHED */)),
4344
4282
  vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4345
4283
  ], 64 /* STABLE_FRAGMENT */))
4346
4284
  : vue.createCommentVNode("v-if", true),
@@ -4437,7 +4375,7 @@ return (_ctx, _cache) => {
4437
4375
  class: "spinner-border spinner-border-sm me-1",
4438
4376
  role: "status",
4439
4377
  "aria-hidden": "true"
4440
- }, null, -1 /* HOISTED */)),
4378
+ }, null, -1 /* CACHED */)),
4441
4379
  vue.createElementVNode("span", null, vue.toDisplayString(__props.loadingMessage), 1 /* TEXT */)
4442
4380
  ], 64 /* STABLE_FRAGMENT */))
4443
4381
  : vue.createCommentVNode("v-if", true),
@@ -4452,6 +4390,108 @@ return (_ctx, _cache) => {
4452
4390
 
4453
4391
  script$i.__file = "src/lib/components/ShSilentAction.vue";
4454
4392
 
4393
+ const useUserStore = pinia.defineStore('user-store', {
4394
+ state: () => ({
4395
+ user: null,
4396
+ role: null,
4397
+ permissions: null,
4398
+ menus: [],
4399
+ loggedOut: false
4400
+ }),
4401
+ actions: {
4402
+ setUser (defaultEndpoint) {
4403
+ let user = null;
4404
+ try {
4405
+ user = shStorage.getItem('user') ? shStorage.getItem('user') : null;
4406
+ } catch (error) {
4407
+ user= null;
4408
+ }
4409
+ if(typeof user !== 'object'){
4410
+ user = null;
4411
+ }
4412
+ if (user ) {
4413
+ user.isAllowedTo = function (slug) {
4414
+ if (this.permissions) {
4415
+ let permissions = [];
4416
+ if (typeof this.permissions === 'string') {
4417
+ permissions = this.permissions;
4418
+ } else {
4419
+ permissions = this.permissions;
4420
+ }
4421
+ return permissions.includes(slug)
4422
+ }
4423
+ return false
4424
+ };
4425
+ }
4426
+ this.user = user;
4427
+ const userEndpoint = defaultEndpoint ?? vue.inject('userEndpoint','auth/user') ?? 'auth/user?defaults=1';
4428
+
4429
+ shApis.doGet(userEndpoint).then(res => {
4430
+ let user = res.data.user;
4431
+ if (typeof(user) === 'undefined') {
4432
+ user = res.data;
4433
+ }
4434
+ shStorage.setItem('user',user);
4435
+ user.signOut = this.signOut;
4436
+ user.logout = this.signOut;
4437
+ user.logOut = this.signOut;
4438
+ user.isAllowedTo = function (slug) {
4439
+ if(!slug){
4440
+ return true
4441
+ }
4442
+ if (this.permissions) {
4443
+ let permissions = [];
4444
+ if (typeof this.permissions === 'string') {
4445
+ permissions = this.permissions;
4446
+ } else {
4447
+ permissions = this.permissions;
4448
+ }
4449
+ return permissions.includes(slug)
4450
+ }
4451
+ return false
4452
+ };
4453
+ user.can = user.isAllowedTo;
4454
+ this.user = user;
4455
+ }).catch((reason) => {
4456
+ if (reason.response && reason.response.status) {
4457
+ if(reason.response.status === 401) {
4458
+ shStorage.setItem('user',null);
4459
+ this.user = null;
4460
+ }
4461
+ this.loggedOut = true;
4462
+ }
4463
+ });
4464
+ if (this.user) {
4465
+ if (typeof this.user.permissions === 'string') {
4466
+ this.permissions = this.user.permissions;
4467
+ } else {
4468
+ this.permissions = this.user.permissions;
4469
+ }
4470
+ }
4471
+ const timeNow = luxon.DateTime.now().toISO();
4472
+ shStorage.setItem('session_start',timeNow);
4473
+ },
4474
+ signOut () {
4475
+ shRepo.signOutUser();
4476
+ },
4477
+ logOut () {
4478
+ this.signOut();
4479
+ },
4480
+ getUser () {
4481
+ this.setUser();
4482
+ },
4483
+ setAccessToken (accessToken) {
4484
+ shStorage.setItem('access_token', accessToken);
4485
+ this.setUser();
4486
+ }
4487
+ },
4488
+ getters: {
4489
+ userId (state) {
4490
+ return state.user === null ? null:state.user.id
4491
+ }
4492
+ }
4493
+ });
4494
+
4455
4495
  const _hoisted_1$f = ["href"];
4456
4496
  const _hoisted_2$c = ["title"];
4457
4497
 
@@ -4690,18 +4730,222 @@ return (_ctx, _cache) => {
4690
4730
 
4691
4731
  script$g.__file = "src/lib/components/table/TableActions.vue";
4692
4732
 
4693
- var script$f = {
4694
- name: 'Pagination',
4695
- props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore', 'paginationStyle','perPage'],
4696
- data () {
4697
- return {
4698
- current_page: this.pagination_data.current,
4699
- per_page: this.pagination_data.per_page,
4700
- loadingMore: 0,
4701
- pageOptions: [10,25,50,100,200,400]
4702
- }
4703
- },
4704
- mounted(){
4733
+ const _hoisted_1$d = { class: "sh-range" };
4734
+ const _hoisted_2$a = { class: "dropdown" };
4735
+ const _hoisted_3$8 = {
4736
+ class: "form-control dropdown-toggle",
4737
+ href: "#",
4738
+ role: "button",
4739
+ id: "dropdownMenuLink",
4740
+ "data-bs-toggle": "dropdown",
4741
+ "aria-expanded": "false"
4742
+ };
4743
+ const _hoisted_4$8 = ["innerHTML"];
4744
+ const _hoisted_5$5 = {
4745
+ class: "dropdown-menu sh-range-dropdown",
4746
+ "aria-labelledby": "dropdownMenuLink"
4747
+ };
4748
+ const _hoisted_6$5 = { class: "sh-range-preset" };
4749
+ const _hoisted_7$5 = ["onClick"];
4750
+ const _hoisted_8$4 = { class: "border-top" };
4751
+ const _hoisted_9$4 = { class: "dropdown-item d-flex flex-column" };
4752
+
4753
+
4754
+
4755
+ var script$f = {
4756
+ __name: 'ShRange',
4757
+ props: {
4758
+ start: {
4759
+ type: Number,
4760
+ default: 2021
4761
+ },
4762
+ selected: {
4763
+ type: String,
4764
+ default: shRepo.getShConfig('defaultRange', 'This Month')
4765
+ }
4766
+ },
4767
+ emits: ['rangeSelected'],
4768
+ setup(__props, { emit: __emit }) {
4769
+
4770
+ const props = __props;
4771
+
4772
+ const emit = __emit;
4773
+
4774
+ const selectedDate = vue.ref(null);
4775
+ const rangeLabel = vue.ref(null);
4776
+ const customFrom = vue.ref(null);
4777
+ const customTo = vue.ref(null);
4778
+
4779
+ const applyCustom = () => {
4780
+ const date = [
4781
+ customFrom.value ? luxon.DateTime.fromISO(customFrom.value) : luxon.DateTime.now(),
4782
+ customTo.value ? luxon.DateTime.fromISO(customTo.value) : luxon.DateTime.now()
4783
+ ];
4784
+ setDate(date, 'Custom');
4785
+ };
4786
+
4787
+ const dates = vue.ref([
4788
+ {
4789
+ label: 'Today',
4790
+ value: [luxon.DateTime.now().startOf('day'), luxon.DateTime.now().endOf('day')]
4791
+ },
4792
+ {
4793
+ label: 'Yesterday',
4794
+ value: [
4795
+ luxon.DateTime.now().minus({ days: 1 }).startOf('day'),
4796
+ luxon.DateTime.now().minus({ days: 1 }).endOf('day')
4797
+ ]
4798
+ },
4799
+ {
4800
+ label: '7 Days',
4801
+ value: [luxon.DateTime.now().minus({ days: 7 }).startOf('day'), luxon.DateTime.now().endOf('day')]
4802
+ },
4803
+ {
4804
+ label: 'This week',
4805
+ value: [
4806
+ luxon.DateTime.now().startOf('week'),
4807
+ luxon.DateTime.now().endOf('week')
4808
+ ]
4809
+ },
4810
+ {
4811
+ label: 'This Month',
4812
+ value: [luxon.DateTime.now().startOf('month'), luxon.DateTime.now().endOf('day')]
4813
+ },
4814
+ {
4815
+ label: 'Last Month',
4816
+ value: [
4817
+ luxon.DateTime.now().minus({ months: 1 }).startOf('month'),
4818
+ luxon.DateTime.now().minus({ months: 1 }).endOf('month')
4819
+ ]
4820
+ },
4821
+ {
4822
+ label: 'Last 30 days',
4823
+ value: [luxon.DateTime.now().minus({ days: 30 }).startOf('day'), luxon.DateTime.now().endOf('day')]
4824
+ },
4825
+ {
4826
+ label: 'Last 60 days',
4827
+ value: [luxon.DateTime.now().minus({ days: 60 }).startOf('day'), luxon.DateTime.now().endOf('day')]
4828
+ },
4829
+ {
4830
+ label: 'Last 90 days',
4831
+ value: [luxon.DateTime.now().minus({ days: 90 }).startOf('day'), luxon.DateTime.now().endOf('day')]
4832
+ },
4833
+ {
4834
+ label: 'This Year',
4835
+ value: [luxon.DateTime.now().startOf('year'), luxon.DateTime.now().endOf('day')]
4836
+ },
4837
+ {
4838
+ label: '1 Year',
4839
+ value: [luxon.DateTime.now().minus({ months: 12 }).startOf('day'), luxon.DateTime.now().endOf('day')]
4840
+ },
4841
+ {
4842
+ label: 'All Time',
4843
+ value: [luxon.DateTime.fromObject({ year: 2021 }).startOf('year'), luxon.DateTime.now().endOf('day')]
4844
+ }
4845
+ ]);
4846
+ const setDate = (date, label) => {
4847
+ selectedDate.value = date;
4848
+ rangeLabel.value = '<strong>' + label + '</strong><small>(' + date[0].toFormat('MMMM d, yyyy') + ' - ' + date[1].toFormat('MMMM d, yyyy') + ')</small>';
4849
+ const from = date[0];
4850
+ const to = date[1];
4851
+ const period = label.toString().toLowerCase().replaceAll(' ','_');
4852
+ emit('rangeSelected', {
4853
+ from: from,
4854
+ to: to,
4855
+ period: period,
4856
+ query: `from=${from.toFormat('MM/dd/yyyy')}&to=${to.toFormat('MM/dd/yyyy')}&period=${period}`
4857
+ });
4858
+ };
4859
+ vue.onMounted(() => {
4860
+ let end = parseInt(luxon.DateTime.now().toFormat('yyyy'));
4861
+ while (end >= props.start) {
4862
+ dates.value.push({
4863
+ label: end,
4864
+ value: [
4865
+ luxon.DateTime.fromObject({ year: end }).startOf('year'),
4866
+ luxon.DateTime.fromObject({ year: end }).endOf('year')
4867
+ ]
4868
+ });
4869
+ end--;
4870
+ }
4871
+
4872
+ dates.value.map(date=>{
4873
+ (`${date.label}`.toLowerCase() === props.selected.toLowerCase()) && setDate(date.value, date.label);
4874
+ });
4875
+ });
4876
+
4877
+ return (_ctx, _cache) => {
4878
+ return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
4879
+ vue.createElementVNode("div", _hoisted_2$a, [
4880
+ vue.createElementVNode("div", _hoisted_3$8, [
4881
+ _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-calendar text-dark" }, null, -1 /* CACHED */)),
4882
+ _cache[3] || (_cache[3] = vue.createTextVNode()),
4883
+ vue.createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$8)
4884
+ ]),
4885
+ vue.createElementVNode("div", _hoisted_5$5, [
4886
+ vue.createElementVNode("ul", _hoisted_6$5, [
4887
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(dates.value, (date) => {
4888
+ return (vue.openBlock(), vue.createElementBlock("li", {
4889
+ key: date.label,
4890
+ onClick: $event => (setDate(date.value, date.label))
4891
+ }, [
4892
+ vue.createElementVNode("a", {
4893
+ class: vue.normalizeClass(["dropdown-item", date.value === selectedDate.value ? 'active' : '']),
4894
+ href: "#"
4895
+ }, vue.toDisplayString(date.label), 3 /* TEXT, CLASS */)
4896
+ ], 8 /* PROPS */, _hoisted_7$5))
4897
+ }), 128 /* KEYED_FRAGMENT */))
4898
+ ]),
4899
+ vue.createElementVNode("ul", null, [
4900
+ vue.createElementVNode("li", _hoisted_8$4, [
4901
+ vue.createElementVNode("div", _hoisted_9$4, [
4902
+ _cache[4] || (_cache[4] = vue.createElementVNode("span", null, "Custom", -1 /* CACHED */)),
4903
+ vue.createElementVNode("div", null, [
4904
+ vue.withDirectives(vue.createElementVNode("input", {
4905
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((customFrom).value = $event)),
4906
+ type: "date"
4907
+ }, null, 512 /* NEED_PATCH */), [
4908
+ [vue.vModelText, customFrom.value]
4909
+ ]),
4910
+ vue.withDirectives(vue.createElementVNode("input", {
4911
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((customTo).value = $event)),
4912
+ type: "date"
4913
+ }, null, 512 /* NEED_PATCH */), [
4914
+ [vue.vModelText, customTo.value]
4915
+ ])
4916
+ ]),
4917
+ (customFrom.value && customTo.value)
4918
+ ? (vue.openBlock(), vue.createElementBlock("button", {
4919
+ key: 0,
4920
+ class: "btn btn-sm btn-info mt-1",
4921
+ onClick: applyCustom
4922
+ }, "Apply"))
4923
+ : vue.createCommentVNode("v-if", true)
4924
+ ])
4925
+ ])
4926
+ ])
4927
+ ])
4928
+ ])
4929
+ ]))
4930
+ }
4931
+ }
4932
+
4933
+ };
4934
+
4935
+ script$f.__file = "src/lib/components/ShRange.vue";
4936
+
4937
+ var script$e = {
4938
+ name: 'Pagination',
4939
+ props: ['pagination_data', 'loadMore', 'hideCount', 'hideLoadMore', 'paginationStyle','perPage'],
4940
+ data () {
4941
+ return {
4942
+ current_page: this.pagination_data.current,
4943
+ per_page: this.pagination_data.per_page,
4944
+ loadingMore: 0,
4945
+ pageOptions: [10,25,50,100,200,400]
4946
+ }
4947
+ },
4948
+ mounted(){
4705
4949
  if(!this.pageOptions.includes(this.perPage)){
4706
4950
  const recordCount = this.pagination_data.record_count;
4707
4951
  recordCount > 0 && recordCount < this.perPage && this.pageOptions.push(recordCount);
@@ -4769,24 +5013,24 @@ var script$f = {
4769
5013
  }
4770
5014
  };
4771
5015
 
4772
- const _hoisted_1$d = { key: 0 };
4773
- const _hoisted_2$a = { class: "record_count_body mb-3" };
4774
- const _hoisted_3$8 = ["value"];
4775
- const _hoisted_4$8 = { class: "record_counts" };
4776
- const _hoisted_5$5 = {
5016
+ const _hoisted_1$c = { key: 0 };
5017
+ const _hoisted_2$9 = { class: "record_count_body mb-3" };
5018
+ const _hoisted_3$7 = ["value"];
5019
+ const _hoisted_4$7 = { class: "record_counts" };
5020
+ const _hoisted_5$4 = {
4777
5021
  key: 0,
4778
5022
  "aria-label": "Page navigation"
4779
5023
  };
4780
- const _hoisted_6$5 = { class: "pagination" };
4781
- const _hoisted_7$5 = {
5024
+ const _hoisted_6$4 = { class: "pagination" };
5025
+ const _hoisted_7$4 = {
4782
5026
  key: 0,
4783
5027
  class: "page-link"
4784
5028
  };
4785
- const _hoisted_8$4 = {
5029
+ const _hoisted_8$3 = {
4786
5030
  key: 1,
4787
5031
  class: "page-link"
4788
5032
  };
4789
- const _hoisted_9$4 = ["onClick"];
5033
+ const _hoisted_9$3 = ["onClick"];
4790
5034
  const _hoisted_10$3 = { key: 1 };
4791
5035
  const _hoisted_11$2 = {
4792
5036
  key: 0,
@@ -4808,26 +5052,26 @@ const _hoisted_15$2 = {
4808
5052
 
4809
5053
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4810
5054
  return ($props.paginationStyle !== 'loadMore')
4811
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$d, [
4812
- vue.createElementVNode("div", _hoisted_2$a, [
4813
- _cache[5] || (_cache[5] = vue.createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* HOISTED */)),
4814
- _cache[6] || (_cache[6] = vue.createTextVNode("  ")),
5055
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
5056
+ vue.createElementVNode("div", _hoisted_2$9, [
5057
+ _cache[5] || (_cache[5] = vue.createElementVNode("span", { class: "per_page_show" }, "Showing", -1 /* CACHED */)),
5058
+ _cache[6] || (_cache[6] = vue.createTextVNode("  ", -1 /* CACHED */)),
4815
5059
  vue.withDirectives(vue.createElementVNode("select", {
4816
5060
  class: "select_per_page",
4817
5061
  onChange: _cache[0] || (_cache[0] = (...args) => ($options.changePerPage && $options.changePerPage(...args))),
4818
5062
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.per_page) = $event))
4819
5063
  }, [
4820
5064
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.pageOptions, (option) => {
4821
- return (vue.openBlock(), vue.createElementBlock("option", { value: option }, vue.toDisplayString(option), 9 /* TEXT, PROPS */, _hoisted_3$8))
5065
+ return (vue.openBlock(), vue.createElementBlock("option", { value: option }, vue.toDisplayString(option), 9 /* TEXT, PROPS */, _hoisted_3$7))
4822
5066
  }), 256 /* UNKEYED_FRAGMENT */))
4823
5067
  ], 544 /* NEED_HYDRATION, NEED_PATCH */), [
4824
5068
  [vue.vModelSelect, $data.per_page]
4825
5069
  ]),
4826
- vue.createElementVNode("span", _hoisted_4$8, " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
5070
+ vue.createElementVNode("span", _hoisted_4$7, " of " + vue.toDisplayString($props.pagination_data.record_count) + " items", 1 /* TEXT */)
4827
5071
  ]),
4828
5072
  ($props.pagination_data != null)
4829
- ? (vue.openBlock(), vue.createElementBlock("nav", _hoisted_5$5, [
4830
- vue.createElementVNode("ul", _hoisted_6$5, [
5073
+ ? (vue.openBlock(), vue.createElementBlock("nav", _hoisted_5$4, [
5074
+ vue.createElementVNode("ul", _hoisted_6$4, [
4831
5075
  vue.createElementVNode("li", {
4832
5076
  class: vue.normalizeClass([$options.getActivePage === 1 ? 'disabled' : '' , "page-item"])
4833
5077
  }, [
@@ -4842,14 +5086,14 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4842
5086
  key: page
4843
5087
  }, [
4844
5088
  ($options.getActivePage === page)
4845
- ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_7$5, vue.toDisplayString(page), 1 /* TEXT */))
5089
+ ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_7$4, vue.toDisplayString(page), 1 /* TEXT */))
4846
5090
  : (['..','...'].includes(page))
4847
- ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_8$4, vue.toDisplayString(page), 1 /* TEXT */))
5091
+ ? (vue.openBlock(), vue.createElementBlock("a", _hoisted_8$3, vue.toDisplayString(page), 1 /* TEXT */))
4848
5092
  : (vue.openBlock(), vue.createElementBlock("a", {
4849
5093
  key: 2,
4850
5094
  onClick: $event => ($options.changeTableKey('page',page)),
4851
5095
  class: "page-link"
4852
- }, vue.toDisplayString(page), 9 /* TEXT, PROPS */, _hoisted_9$4))
5096
+ }, vue.toDisplayString(page), 9 /* TEXT, PROPS */, _hoisted_9$3))
4853
5097
  ], 2 /* CLASS */))
4854
5098
  }), 128 /* KEYED_FRAGMENT */)),
4855
5099
  vue.createElementVNode("li", {
@@ -4866,12 +5110,12 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4866
5110
  ]))
4867
5111
  : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$3, [
4868
5112
  (this.pagination_data.loading === 1 && $props.loadMore && $props.hideLoadMore)
4869
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$2, _cache[7] || (_cache[7] = [
5113
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$2, [...(_cache[7] || (_cache[7] = [
4870
5114
  vue.createElementVNode("div", {
4871
5115
  class: "spinner-border",
4872
5116
  role: "status"
4873
- }, null, -1 /* HOISTED */)
4874
- ])))
5117
+ }, null, -1 /* CACHED */)
5118
+ ]))]))
4875
5119
  : vue.createCommentVNode("v-if", true),
4876
5120
  (!$props.hideCount)
4877
5121
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$2, [
@@ -4892,198 +5136,8 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
4892
5136
  ]))
4893
5137
  }
4894
5138
 
4895
- script$f.render = render$1;
4896
- script$f.__file = "src/lib/components/list_templates/Pagination.vue";
4897
-
4898
- const _hoisted_1$c = { class: "sh-range" };
4899
- const _hoisted_2$9 = { class: "dropdown" };
4900
- const _hoisted_3$7 = {
4901
- class: "form-control dropdown-toggle",
4902
- href: "#",
4903
- role: "button",
4904
- id: "dropdownMenuLink",
4905
- "data-bs-toggle": "dropdown",
4906
- "aria-expanded": "false"
4907
- };
4908
- const _hoisted_4$7 = ["innerHTML"];
4909
- const _hoisted_5$4 = {
4910
- class: "dropdown-menu sh-range-dropdown",
4911
- "aria-labelledby": "dropdownMenuLink"
4912
- };
4913
- const _hoisted_6$4 = { class: "sh-range-preset" };
4914
- const _hoisted_7$4 = ["onClick"];
4915
- const _hoisted_8$3 = { class: "border-top" };
4916
- const _hoisted_9$3 = { class: "dropdown-item d-flex flex-column" };
4917
-
4918
-
4919
-
4920
- var script$e = {
4921
- __name: 'ShRange',
4922
- props: {
4923
- start: {
4924
- type: Number,
4925
- default: 2021
4926
- },
4927
- selected: {
4928
- type: String,
4929
- default: shRepo.getShConfig('defaultRange', 'This Month')
4930
- }
4931
- },
4932
- emits: ['rangeSelected'],
4933
- setup(__props, { emit: __emit }) {
4934
-
4935
- const props = __props;
4936
-
4937
- const emit = __emit;
4938
-
4939
- const selectedDate = vue.ref(null);
4940
- const rangeLabel = vue.ref(null);
4941
- vue.ref(false);
4942
- const customFrom = vue.ref(null);
4943
- const customTo = vue.ref(null);
4944
-
4945
- const applyCustom = ()=>{
4946
- const date = [moment__default["default"](customFrom.value),moment__default["default"](customTo.value)];
4947
- setDate(date,'Custom');
4948
- };
4949
-
4950
- const dates = vue.ref([
4951
- {
4952
- label: 'Today',
4953
- value: [moment__default["default"](), moment__default["default"]()]
4954
- },
4955
- {
4956
- label: 'Yesterday',
4957
- value: [moment__default["default"]().subtract(1, 'days'), moment__default["default"]()]
4958
- },
4959
- {
4960
- label: '7 Days',
4961
- value: [moment__default["default"]().subtract(7, 'days'), moment__default["default"]()]
4962
- },
4963
- {
4964
- label: 'This week',
4965
- value: [moment__default["default"]().subtract(1, 'week').startOf('week'), moment__default["default"]().subtract(1, 'week').endOf('week')]
4966
- },
4967
- {
4968
- label: 'This Month',
4969
- value: [moment__default["default"]().startOf('month'), moment__default["default"]()]
4970
- },
4971
- {
4972
- label: 'Last Month',
4973
- value: [moment__default["default"]().subtract(1, 'month').startOf('month'), moment__default["default"]().subtract(1, 'month').endOf('month')]
4974
- },
4975
- {
4976
- label: 'Last 30 days',
4977
- value: [moment__default["default"]().subtract(30, 'days'), moment__default["default"]()]
4978
- },
4979
- {
4980
- label: 'Last 60 days',
4981
- value: [moment__default["default"]().subtract(60, 'days'), moment__default["default"]()]
4982
- },
4983
- {
4984
- label: 'Last 90 days',
4985
- value: [moment__default["default"]().subtract(90, 'days'), moment__default["default"]()]
4986
- },
4987
- {
4988
- label: 'This Year',
4989
- value: [moment__default["default"]().startOf('year'), moment__default["default"]()]
4990
- },
4991
- {
4992
- label: '1 Year',
4993
- value: [moment__default["default"]().subtract(12, 'months'), moment__default["default"]()]
4994
- },
4995
- {
4996
- label: 'All Time',
4997
- value: [moment__default["default"]('@/2021').startOf('year'), moment__default["default"]()]
4998
- }
4999
- ]);
5000
- const setDate = (date, label) => {
5001
- selectedDate.value = date;
5002
- rangeLabel.value = '<strong>' + label + '</strong><small>(' + date[0].format('MMMM D, YYYY') + ' - ' + date[1].format('MMMM D, YYYY') + ')</small>';
5003
- const from = date[0];
5004
- const to = date[1];
5005
- const period = label.toString().toLowerCase().replaceAll(' ','_');
5006
- emit('rangeSelected', {
5007
- from: from,
5008
- to: to,
5009
- period: period,
5010
- query: `from=${from.format('L')}&to=${to.format('L')}&period=${period}`
5011
- });
5012
- };
5013
- vue.onMounted(() => {
5014
- let end = parseInt(moment__default["default"]().format('Y'));
5015
- while (end >= props.start) {
5016
- dates.value.push({
5017
- label: end,
5018
- value: [moment__default["default"]('@/' + end).startOf('year'), moment__default["default"]('@/' + end).endOf('year')]
5019
- });
5020
- end--;
5021
- }
5022
-
5023
- dates.value.map(date=>{
5024
- (`${date.label}`.toLowerCase() === props.selected.toLowerCase()) && setDate(date.value, date.label);
5025
- });
5026
- });
5027
-
5028
- return (_ctx, _cache) => {
5029
- return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
5030
- vue.createElementVNode("div", _hoisted_2$9, [
5031
- vue.createElementVNode("div", _hoisted_3$7, [
5032
- _cache[2] || (_cache[2] = vue.createElementVNode("i", { class: "bi-calendar text-dark" }, null, -1 /* HOISTED */)),
5033
- _cache[3] || (_cache[3] = vue.createTextVNode()),
5034
- vue.createElementVNode("span", { innerHTML: rangeLabel.value }, null, 8 /* PROPS */, _hoisted_4$7)
5035
- ]),
5036
- vue.createElementVNode("div", _hoisted_5$4, [
5037
- vue.createElementVNode("ul", _hoisted_6$4, [
5038
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(dates.value, (date) => {
5039
- return (vue.openBlock(), vue.createElementBlock("li", {
5040
- key: date.label,
5041
- onClick: $event => (setDate(date.value, date.label))
5042
- }, [
5043
- vue.createElementVNode("a", {
5044
- class: vue.normalizeClass(["dropdown-item", date.value === selectedDate.value ? 'active' : '']),
5045
- href: "#"
5046
- }, vue.toDisplayString(date.label), 3 /* TEXT, CLASS */)
5047
- ], 8 /* PROPS */, _hoisted_7$4))
5048
- }), 128 /* KEYED_FRAGMENT */))
5049
- ]),
5050
- vue.createElementVNode("ul", null, [
5051
- vue.createElementVNode("li", _hoisted_8$3, [
5052
- vue.createElementVNode("div", _hoisted_9$3, [
5053
- _cache[4] || (_cache[4] = vue.createElementVNode("span", null, "Custom", -1 /* HOISTED */)),
5054
- vue.createElementVNode("div", null, [
5055
- vue.withDirectives(vue.createElementVNode("input", {
5056
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((customFrom).value = $event)),
5057
- type: "date"
5058
- }, null, 512 /* NEED_PATCH */), [
5059
- [vue.vModelText, customFrom.value]
5060
- ]),
5061
- vue.withDirectives(vue.createElementVNode("input", {
5062
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => ((customTo).value = $event)),
5063
- type: "date"
5064
- }, null, 512 /* NEED_PATCH */), [
5065
- [vue.vModelText, customTo.value]
5066
- ])
5067
- ]),
5068
- (customFrom.value && customTo.value)
5069
- ? (vue.openBlock(), vue.createElementBlock("button", {
5070
- key: 0,
5071
- class: "btn btn-sm btn-info mt-1",
5072
- onClick: applyCustom
5073
- }, "Apply"))
5074
- : vue.createCommentVNode("v-if", true)
5075
- ])
5076
- ])
5077
- ])
5078
- ])
5079
- ])
5080
- ]))
5081
- }
5082
- }
5083
-
5084
- };
5085
-
5086
- script$e.__file = "src/lib/components/ShRange.vue";
5139
+ script$e.render = render$1;
5140
+ script$e.__file = "src/lib/components/list_templates/Pagination.vue";
5087
5141
 
5088
5142
  const _hoisted_1$b = { class: "auto-table mt-2" };
5089
5143
  const _hoisted_2$8 = {
@@ -5206,364 +5260,352 @@ const _hoisted_55 = ["innerHTML"];
5206
5260
  const _hoisted_56 = ["innerHTML"];
5207
5261
  const _hoisted_57 = { key: 0 };
5208
5262
 
5209
- const __default__ = {
5210
- name: 'sh-table',
5211
- props: ['endPoint','orderBy','orderMethod', 'headers','disableMobileResponsive', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','selectedRange','noRecordsMessage'],
5212
- data(){
5213
- return {
5214
- order_by: this.orderBy,
5215
- order_method: this.orderMethod,
5216
- per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
5217
- page: 1,
5218
- exactMatch: false,
5219
- filter_value: '',
5220
- loading: 'loading',
5221
- loading_error: '',
5222
- records: null,
5223
- total: 0,
5224
- pagination_data: null,
5225
- moreDetailsId: null,
5226
- moreDetailsModel: null,
5227
- downloading: false,
5228
- appUrl: window.VITE_APP_API_URL,
5229
- hasCanvas: 0,
5230
- selectedRecord: null,
5231
- timeOut: null,
5232
- tableHeaders: [],
5233
- pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'),
5234
- range: null,
5235
- from: null,
5236
- to: null,
5237
- period: null,
5238
- lastId: null
5239
- }
5240
- },
5241
- mounted(){
5242
- if (this.headers) {
5243
- this.tableHeaders = this.headers;
5244
- }
5263
+ // --- Props / Emits
5245
5264
 
5246
- if (this.actions && this.actions.actions) {
5247
- this.actions.actions.forEach(action => {
5248
- if (action.canvasComponent) {
5249
- this.hasCanvas = true;
5250
- }
5251
- });
5252
- }
5253
- if (this.cacheKey) {
5254
- this.setCachedData();
5255
- }
5256
- this.reloadData();
5257
- },
5258
- methods: {
5259
- rangeChanged: function (newRange){
5260
- this.range = newRange;
5261
- this.from = newRange.from.format('L');
5262
- this.to = newRange.to.format('L');
5263
- this.period = newRange.period;
5264
- this.reloadData();
5265
- },
5266
- userTyping: function (){
5267
- if (this.timeOut) {
5268
- clearTimeout(this.timeOut);
5269
- }
5270
- const self = this;
5271
- this.timeOut = setTimeout(() => {
5272
- self.reloadData(1);
5273
- }, 800);
5274
- },
5275
- cleanCanvasProps: function (actions){
5276
- let replaced = actions;
5277
- replaced.class = null;
5278
- return replaced
5279
- },
5280
- newRecordAdded: function (ev){
5281
- const record = ev.log;
5282
- if (record.user) {
5283
- record.user = record.user.name;
5284
- }
5285
- this.records.unshift(record);
5286
- },
5287
- canvasClosed: function (){
5288
- this.selectedRecord = null;
5289
- },
5290
- rowSelected: function (row){
5291
- this.selectedRecord = null;
5292
- setTimeout(() => {
5293
- this.selectedRecord = row;
5294
- this.$emit('rowSelected', row);
5295
- }, 100);
5296
- },
5297
- changeKey: function (key, value){
5298
- this[key] = value;
5299
- if (key === 'order_by') {
5300
- this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
5301
- }
5302
- if (key === 'per_page') {
5303
- this.page = 1;
5304
- }
5305
- this.reloadData();
5306
- },
5307
- getLinkClass: function (config){
5308
- if (typeof config === 'object') {
5309
- return config.class
5310
- }
5311
- return ''
5312
- },
5313
- reloadNotifications: function (){
5314
- this.reloadData();
5315
- },
5316
- replaceActionUrl: function (path, obj){
5317
- if (path) {
5318
- var matches = path.match(/\{(.*?)\}/g);
5319
- try {
5320
- matches.forEach(key => {
5321
- key = key.replace('{', '');
5322
- key = key.replace('}', '');
5323
- path = path.replace(`{${key}}`, obj[key]);
5324
- });
5325
- return path
5326
- } catch (e) {
5327
- return path
5328
- }
5329
- }
5330
- return ''
5331
- },
5332
- doEmitAction: function (action, data){
5333
- if (typeof action === 'function') {
5334
- action(data);
5335
- } else {
5336
- this.$emit(action, data);
5337
- }
5338
- },
5339
- getFieldType: function (field){
5340
- const numbers = ['age', 'interest_rate_pa'];
5341
- const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
5342
- const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
5343
- if (numbers.includes(field)) {
5344
- return 'numeric'
5345
- }
5346
- if (moneys.includes(field)) {
5347
- return 'money'
5348
- }
5349
- if (dates.includes(field)) {
5350
- return 'date'
5351
- }
5352
- return 'string'
5353
- },
5354
- replaceLinkUrl: function (path, obj){
5355
- if (typeof path === 'object') {
5356
- // check path,link or url
5357
- if (path.link) {
5358
- path = path.link;
5359
- } else if (path.url) {
5360
- path = path.url;
5361
- } else if(path.path){
5362
- path = path.path;
5363
- } else {
5364
- path = '';
5365
- }
5366
- }
5367
- var matches = path.match(/\{(.*?)\}/g);
5368
- matches && matches.forEach(key => {
5369
- key = key.replace('{', '');
5370
- key = key.replace('}', '');
5371
- path = path.replace(`{${key}}`, obj[key]);
5372
- });
5373
- return path
5374
- },
5375
- formatDate: function (date){
5376
- return moment__default["default"](date).format('lll')
5377
- },
5378
- setMoreDetailsModel: function (row){
5379
- this.moreDetailsModel = null;
5380
- this.moreDetailsModel = row;
5381
- },
5382
- loadMoreRecords: function (){
5383
- this.reloadData(this.page + 1, 1);
5384
- },
5385
- exportData: function (template){
5386
- this.downloading = true;
5387
- const headers = [];
5388
- const fields = this.downloadFields ? this.downloadFields : this.headers;
5389
- fields.forEach(header => {
5390
- if (typeof header === 'string') {
5391
- headers.push(header);
5392
- }
5393
- });
5265
+ var script$d = {
5266
+ __name: 'ShTable',
5267
+ props: {
5268
+ endPoint: [String, null],
5269
+ orderBy: String,
5270
+ orderMethod: {type: String, default: 'desc'},
5271
+ headers: [Array, null],
5272
+ disableMobileResponsive: {type: Boolean, default: false},
5273
+ cacheKey: [String, null],
5274
+ query: [String, null],
5275
+ pageCount: [Number, null],
5276
+ actions: [Object, null],
5277
+ hideCount: {type: Boolean, default: false},
5278
+ hideLoadMore: {type: Boolean, default: false},
5279
+ links: [Object, null],
5280
+ reload: [Number, Boolean, String, null],
5281
+ hideSearch: {type: Boolean, default: false},
5282
+ sharedData: [Object, null],
5283
+ searchPlaceholder: [String, null],
5284
+ event: [String, null],
5285
+ displayMore: [Boolean, null],
5286
+ displayMoreBtnClass: [String, null],
5287
+ moreDetailsColumns: [Array, null],
5288
+ moreDetailsFields: [Array, null],
5289
+ hasDownload: {type: Boolean, default: false},
5290
+ downloadFields: [Array, null],
5291
+ tableHover: {type: Boolean, default: false},
5292
+ hideIds: {type: Array, default: () => []},
5293
+ paginationStyle: [String, null],
5294
+ hasRange: {type: Boolean, default: false},
5295
+ selectedRange: [Object, null],
5296
+ noRecordsMessage: [String, null]
5297
+ },
5298
+ emits: ['rowSelected', 'dataReloaded', 'dataLoaded'],
5299
+ setup(__props, { emit: __emit }) {
5394
5300
 
5395
- const data = {
5396
- titles: headers,
5397
- export: 1,
5398
- order_by: this.order_by,
5399
- order_method: this.order_method,
5400
- filter_value: this.filter_value,
5401
- from: this.from,
5402
- to: this.to,
5403
- period: this.period,
5404
- lastId: this.lastId,
5405
- };
5406
- shApis.doPost(this.endPoint, data).then(res => {
5407
- this.downloading = false;
5408
- if (res.data.file) {
5409
- const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
5410
- window.location.href = url;
5411
- // window.open('https://facebook.com')
5412
- // window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
5413
- }
5414
- }).catch(reason => {
5415
- this.downloading = false;
5416
- const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
5417
- shRepo.swalError('Error', error);
5418
- });
5419
- },
5420
- setCachedData: function (){
5421
- if (this.cacheKey) {
5422
- this.records = shStorage.getItem('sh_table_cache_' + this.cacheKey, null);
5423
- }
5424
- },
5425
- reloadData: function (page, append){
5426
- if (typeof page !== 'undefined') {
5427
- this.page = page;
5428
- }
5429
- if (this.cacheKey && this.records !== null) {
5430
- this.loading = 'done';
5431
- } else if (!append) {
5432
- this.loading = 'loading';
5433
- }
5434
- let data = {
5435
- order_by: this.order_by,
5436
- order_method: this.order_method,
5437
- per_page: this.per_page,
5438
- page: this.page,
5439
- filter_value: this.filter_value,
5440
- paginated: true,
5441
- from: this.from,
5442
- to: this.to,
5443
- period: this.period,
5444
- exact: this.exactMatch,
5445
- lastId: this.lastId
5446
- };
5447
- // remove empty values
5448
- Object.keys(data).forEach(key => {
5449
- if (data[key] === null || data[key] === '') {
5450
- delete data[key];
5451
- }
5452
- });
5453
- if (this.pagination_data) {
5454
- this.pagination_data.loading = 1;
5455
- }
5456
- let endPoint = this.endPoint;
5457
- if (!this.endPoint && this.query) {
5458
- //send ql query
5459
- endPoint = 'sh-ql';
5460
- data.query = this.query;
5461
- }
5462
- shApis.doGet(endPoint, data).then(req => {
5463
- this.$emit('dataReloaded', this.pagination_data);
5464
- this.loading = 'done';
5465
- const response = req.data.data;
5466
- this.$emit('dataLoaded', response);
5467
- if (this.page < 2 && this.cacheKey) {
5468
- shStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
5469
- }
5301
+ const props = __props;
5470
5302
 
5471
- this.pagination_data = {
5472
- current: response.current_page,
5473
- start: response.from,
5474
- end: response.last_page,
5475
- record_count: response.total,
5476
- per_page: response.per_page,
5477
- loading: 0,
5478
- displayCount: response.total > response.per_page ? response.per_page : response.total
5479
- };
5480
- if (!this.headers && response.total > 0) {
5481
- this.tableHeaders = Object.keys(response.data[0]);
5482
- }
5483
- // get id value of the last record
5484
- this.lastId = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5485
- if (append) {
5486
- this.records.push(...response.data);
5487
- let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
5488
- if (totalShown > response.total) {
5489
- totalShown = response.total;
5490
- }
5491
- this.pagination_data.displayCount = totalShown;
5492
- const scrollingElement = (document.scrollingElement || document.body);
5493
- scrollingElement.scrollTop = scrollingElement.scrollHeight;
5494
- } else {
5495
- this.records = response.data;
5496
- }
5497
- }).catch(reason => {
5498
- const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.endPoint})`;
5499
- this.loading_error = error;
5500
- this.loading = 'error';
5501
- });
5502
- }
5503
- },
5504
- watch: {
5505
- hideIds: {
5506
- handler(newValue){
5507
- this.records = this.records.filter(record => !newValue.includes(record.id) && record);
5508
- },
5509
- deep: true
5510
- },
5511
- reload(){
5512
- this.reloadData();
5513
- },
5514
- endPoint(){
5515
- this.reloadData();
5516
- }
5517
- },
5518
- components: {
5519
- ShRange: script$e,
5520
- ShSilentAction: script$i,
5521
- ShConfirmAction: script$j,
5522
- ShCanvas: script$l,
5523
- pagination: script$f
5524
- },
5525
- computed: {
5526
- windowWidth: function (){
5527
- return window.innerWidth
5528
- },
5529
- user(){
5530
- return null
5531
- },
5532
- hasDefaultSlot(){
5533
- return !!this.$slots.default
5534
- },
5535
- hasRecordsSlot(){
5536
- return !!this.$slots.records
5537
- }
5303
+ const emit = __emit;
5304
+
5305
+ // --- Injection
5306
+ const noRecordsComponent = vue.inject('noRecordsComponent', script$k);
5307
+
5308
+ // --- Local State
5309
+ const order_by = vue.ref(props.orderBy);
5310
+ const order_method = vue.ref(props.orderMethod);
5311
+ const per_page = vue.ref(props.pageCount ?? shRepo.getShConfig('tablePerPage', 10));
5312
+ const page = vue.ref(1);
5313
+ const exactMatch = vue.ref(false);
5314
+ const filter_value = vue.ref('');
5315
+ const loading = vue.ref('loading'); // 'loading' | 'done' | 'error'
5316
+ const loading_error = vue.ref('');
5317
+ const records = vue.ref([]);
5318
+ vue.ref(0);
5319
+ const pagination_data = vue.ref(null);
5320
+ vue.ref(null);
5321
+ vue.ref(null);
5322
+ const downloading = vue.ref(false);
5323
+ const appUrl = window?.VITE_APP_API_URL ?? undefined?.VITE_APP_API_URL ?? '';
5324
+ const hasCanvas = vue.ref(0);
5325
+ const selectedRecord = vue.ref(null);
5326
+ const timeOut = vue.ref(null);
5327
+ const tableHeaders = vue.ref([]);
5328
+ const pageStyle = vue.ref(props.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'));
5329
+ const range = vue.ref(null);
5330
+ const from = vue.ref(null);
5331
+ const to = vue.ref(null);
5332
+ const period = vue.ref(null);
5333
+ const lastId = vue.ref(null);
5334
+
5335
+ // Responsive width
5336
+ const windowWidth = vue.ref(typeof window !== 'undefined' ? window.innerWidth : 1024);
5337
+ const handleResize = () => (windowWidth.value = window.innerWidth);
5338
+
5339
+ // --- Slots helpers
5340
+ const slots = vue.useSlots();
5341
+ const hasDefaultSlot = vue.computed(() => !!slots.default);
5342
+ const hasRecordsSlot = vue.computed(() => !!slots.records);
5343
+
5344
+ // --- Lifecycle
5345
+ vue.onMounted(() => {
5346
+ if (props.headers) tableHeaders.value = props.headers;
5347
+
5348
+ if (props.actions?.actions) {
5349
+ props.actions.actions.forEach(a => {
5350
+ if (a.canvasComponent) hasCanvas.value = 1;
5351
+ });
5538
5352
  }
5539
- };
5540
5353
 
5354
+ if (props.cacheKey) setCachedData();
5541
5355
 
5542
- var script$d = /*@__PURE__*/Object.assign(__default__, {
5543
- setup(__props) {
5356
+ reloadData();
5544
5357
 
5545
- const noRecordsComponent = vue.inject('noRecordsComponent', script$k);
5358
+ window.addEventListener('resize', handleResize);
5359
+ });
5546
5360
 
5547
- pinia.storeToRefs(useUserStore());
5361
+ vue.onBeforeUnmount(() => {
5362
+ window.removeEventListener('resize', handleResize);
5363
+ if (timeOut.value) clearTimeout(timeOut.value);
5364
+ });
5548
5365
 
5549
- const cleanColumn = col=>{
5550
- // remove col.component
5366
+ // --- Utils used in template
5367
+ const cleanColumn = (col) => {
5551
5368
  const newCol = {...col};
5552
5369
  delete newCol.component;
5553
5370
  delete newCol.key;
5554
5371
  return newCol
5555
5372
  };
5556
5373
 
5557
- const showColumn = header=>{
5558
- if(typeof header === 'string'){
5559
- return true
5374
+ const showColumn = (header) => {
5375
+ if (typeof header === 'string') return true
5376
+ if (typeof header === 'object' && header.validator) return header.validator()
5377
+ return true
5378
+ };
5379
+
5380
+ const cleanCanvasProps = (actions) => {
5381
+ const replaced = {...actions};
5382
+ replaced.class = null;
5383
+ return replaced
5384
+ };
5385
+
5386
+ const canvasClosed = () => {
5387
+ selectedRecord.value = null;
5388
+ };
5389
+
5390
+ const rowSelected = (row) => {
5391
+ selectedRecord.value = null;
5392
+ setTimeout(() => {
5393
+ selectedRecord.value = row;
5394
+ emit('rowSelected', row);
5395
+ }, 100);
5396
+ };
5397
+
5398
+ const changeKey = (key, value) => {
5399
+ if (key === 'order_by') {
5400
+ order_by.value = value;
5401
+ order_method.value = (order_method.value === 'desc') ? 'asc' : 'desc';
5402
+ } else if (key === 'per_page') {
5403
+ per_page.value = value;
5404
+ page.value = 1;
5405
+ } else {
5406
+ // generic
5407
+ // support pagination component passing keys like 'page'
5408
+ if (key in stateProxy) {
5409
+ stateProxy[key] = value;
5410
+ } else {
5411
+ // fallback direct
5412
+ if (key === 'page') page.value = value;
5413
+ }
5560
5414
  }
5561
- if(typeof header === 'object' && header.validator) {
5562
- return header.validator()
5415
+ reloadData();
5416
+ };
5417
+
5418
+ const getLinkClass = (config) => (typeof config === 'object' ? (config.class || '') : '');
5419
+
5420
+ const doEmitAction = (action, data) => {
5421
+ if (typeof action === 'function') action(data);
5422
+ else emit(action, data);
5423
+ };
5424
+
5425
+ const getFieldType = (field) => {
5426
+ const numbers = ['age', 'interest_rate_pa'];
5427
+ const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
5428
+ const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
5429
+ if (typeof field === 'string' && numbers.includes(field)) return 'numeric'
5430
+ if (typeof field === 'string' && moneys.includes(field)) return 'money'
5431
+ if (typeof field === 'string' && dates.includes(field)) return 'date'
5432
+ return 'string'
5433
+ };
5434
+
5435
+ const replaceLinkUrl = (p, obj) => {
5436
+ let path = p;
5437
+ if (typeof path === 'object') {
5438
+ if (path.link) path = path.link;
5439
+ else if (path.url) path = path.url;
5440
+ else if (path.path) path = path.path;
5441
+ else path = '';
5563
5442
  }
5564
- return true
5443
+ const matches = path.match(/\{(.*?)\}/g);
5444
+ matches?.forEach(k => {
5445
+ const key = k.replace('{', '').replace('}', '');
5446
+ path = path.replace(`{${key}}`, obj[key]);
5447
+ });
5448
+ return path
5449
+ };
5450
+
5451
+ const formatDate = (date) => luxon.DateTime.fromISO(date).toLocaleString(luxon.DateTime.DATETIME_MED);
5452
+
5453
+ const loadMoreRecords = () => reloadData(page.value + 1, 1);
5454
+
5455
+ const rangeChanged = (newRange) => {
5456
+ range.value = newRange;
5457
+ from.value = newRange.from.toFormat('mm/dd/yyyy');
5458
+ to.value = newRange.to.toFormat('mm/dd/yyyy');
5459
+ period.value = newRange.period;
5460
+ reloadData();
5461
+ };
5462
+
5463
+ const userTyping = () => {
5464
+ if (timeOut.value) clearTimeout(timeOut.value);
5465
+ timeOut.value = setTimeout(() => reloadData(1), 800);
5466
+ };
5467
+
5468
+ const exportData = () => {
5469
+ downloading.value = true;
5470
+ const headers = [];
5471
+ const fields = props.downloadFields ? props.downloadFields : props.headers;
5472
+ fields?.forEach(header => {
5473
+ if (typeof header === 'string') headers.push(header);
5474
+ });
5475
+
5476
+ const data = {
5477
+ titles: headers,
5478
+ export: 1,
5479
+ order_by: order_by.value,
5480
+ order_method: order_method.value,
5481
+ filter_value: filter_value.value,
5482
+ from: from.value,
5483
+ to: to.value,
5484
+ period: period.value,
5485
+ lastId: lastId.value
5486
+ };
5487
+
5488
+ shApis.doPost(props.endPoint, data).then(res => {
5489
+ downloading.value = false;
5490
+ if (res.data.file) {
5491
+ const url = appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
5492
+ window.location.href = url;
5493
+ }
5494
+ }).catch(reason => {
5495
+ downloading.value = false;
5496
+ const error = (typeof reason.response === 'undefined')
5497
+ ? 'Error getting data from backend'
5498
+ : `${reason.response.status}:${reason.response.statusText}`;
5499
+ shRepo.swalError('Error', error);
5500
+ });
5501
+ };
5502
+
5503
+ const setCachedData = () => {
5504
+ if (props.cacheKey) {
5505
+ records.value = shStorage.getItem('sh_table_cache_' + props.cacheKey, null);
5506
+ }
5507
+ };
5508
+
5509
+ // Main loader
5510
+ const reloadData = (newPage, append) => {
5511
+ if (typeof newPage !== 'undefined') page.value = newPage;
5512
+
5513
+ if (props.cacheKey && records.value !== null) {
5514
+ loading.value = 'done';
5515
+ } else if (!append) {
5516
+ loading.value = 'loading';
5517
+ }
5518
+
5519
+ let data = {
5520
+ order_by: order_by.value,
5521
+ order_method: order_method.value,
5522
+ per_page: per_page.value,
5523
+ page: page.value,
5524
+ filter_value: filter_value.value,
5525
+ paginated: true,
5526
+ from: from.value,
5527
+ to: to.value,
5528
+ period: period.value,
5529
+ exact: exactMatch.value,
5530
+ lastId: lastId.value
5531
+ };
5532
+
5533
+ // strip empty
5534
+ Object.keys(data).forEach(k => {
5535
+ if (data[k] === null || data[k] === '') delete data[k];
5536
+ });
5537
+
5538
+ if (pagination_data.value) pagination_data.value.loading = 1;
5539
+
5540
+ let endPoint = props.endPoint;
5541
+ if (!props.endPoint && props.query) {
5542
+ endPoint = 'sh-ql';
5543
+ data.query = props.query;
5544
+ }
5545
+
5546
+ shApis.doGet(endPoint, data).then(req => {
5547
+ emit('dataReloaded', pagination_data.value);
5548
+ loading.value = 'done';
5549
+
5550
+ const response = req.data.data;
5551
+ emit('dataLoaded', response);
5552
+
5553
+ if (page.value < 2 && props.cacheKey) {
5554
+ shStorage.setItem('sh_table_cache_' + props.cacheKey, response.data);
5555
+ }
5556
+
5557
+ pagination_data.value = {
5558
+ current: response.current_page,
5559
+ start: response.from,
5560
+ end: response.last_page,
5561
+ record_count: response.total,
5562
+ per_page: response.per_page,
5563
+ loading: 0,
5564
+ displayCount: response.total > response.per_page ? response.per_page : response.total
5565
+ };
5566
+
5567
+ if (!props.headers && response.total > 0) {
5568
+ tableHeaders.value = Object.keys(response.data[0]);
5569
+ }
5570
+
5571
+ lastId.value = response.data.length > 0 ? response.data[response.data.length - 1].id : null;
5572
+
5573
+ if (append) {
5574
+ records.value.push(...response.data);
5575
+ let totalShown = response.total > response.per_page
5576
+ ? response.per_page * response.current_page
5577
+ : response.total;
5578
+ if (totalShown > response.total) totalShown = response.total;
5579
+ pagination_data.value.displayCount = totalShown;
5580
+
5581
+ const scrollingElement = (document.scrollingElement || document.body);
5582
+ scrollingElement.scrollTop = scrollingElement.scrollHeight;
5583
+ } else {
5584
+ records.value = response.data;
5585
+ }
5586
+ }).catch(reason => {
5587
+ const error = (typeof reason.response === 'undefined')
5588
+ ? 'Error getting data from backend'
5589
+ : `${reason.response.status}:${reason.response.statusText} (${props.endPoint})`;
5590
+ loading_error.value = error;
5591
+ loading.value = 'error';
5592
+ });
5565
5593
  };
5566
5594
 
5595
+ // --- Watches
5596
+ vue.watch(() => props.hideIds, (newVal) => {
5597
+ if (Array.isArray(newVal) && Array.isArray(records.value)) {
5598
+ records.value = records.value.filter(r => !newVal.includes(r.id) && r);
5599
+ }
5600
+ }, {deep: true});
5601
+
5602
+ vue.watch(() => props.reload, () => reloadData());
5603
+ vue.watch(() => props.endPoint, () => reloadData());
5604
+
5605
+ // optional proxy (for changeKey generic setter)
5606
+ const stateProxy = vue.reactive({
5607
+ page, per_page, order_by, order_method
5608
+ });
5567
5609
 
5568
5610
  return (_ctx, _cache) => {
5569
5611
  const _component_router_link = vue.resolveComponent("router-link");
@@ -5572,22 +5614,22 @@ return (_ctx, _cache) => {
5572
5614
  (__props.hasDownload)
5573
5615
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$8, [
5574
5616
  vue.createElementVNode("button", {
5575
- disabled: _ctx.downloading,
5617
+ disabled: downloading.value,
5576
5618
  class: "btn btn-warning btn-sm",
5577
- onClick: _cache[0] || (_cache[0] = $event => (_ctx.exportData()))
5619
+ onClick: _cache[0] || (_cache[0] = $event => (exportData()))
5578
5620
  }, [
5579
- (!_ctx.downloading)
5621
+ (!downloading.value)
5580
5622
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
5581
- _cache[7] || (_cache[7] = vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* HOISTED */)),
5582
- _cache[8] || (_cache[8] = vue.createTextVNode(" Export "))
5623
+ _cache[4] || (_cache[4] = vue.createElementVNode("i", { class: "bi-download" }, null, -1 /* CACHED */)),
5624
+ _cache[5] || (_cache[5] = vue.createTextVNode(" Export ", -1 /* CACHED */))
5583
5625
  ], 64 /* STABLE_FRAGMENT */))
5584
5626
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
5585
- _cache[9] || (_cache[9] = vue.createElementVNode("span", {
5627
+ _cache[6] || (_cache[6] = vue.createElementVNode("span", {
5586
5628
  class: "spinner-border spinner-border-sm",
5587
5629
  role: "status",
5588
5630
  "aria-hidden": "true"
5589
- }, null, -1 /* HOISTED */)),
5590
- _cache[10] || (_cache[10] = vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* HOISTED */))
5631
+ }, null, -1 /* CACHED */)),
5632
+ _cache[7] || (_cache[7] = vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...", -1 /* CACHED */))
5591
5633
  ], 64 /* STABLE_FRAGMENT */))
5592
5634
  ], 8 /* PROPS */, _hoisted_3$6)
5593
5635
  ]))
@@ -5599,59 +5641,59 @@ return (_ctx, _cache) => {
5599
5641
  class: vue.normalizeClass(["sh-search-bar input-group", __props.hasRange ? 'me-2':''])
5600
5642
  }, [
5601
5643
  vue.withDirectives(vue.createElementVNode("input", {
5602
- onKeydown: _cache[1] || (_cache[1] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
5603
- onKeyup: _cache[2] || (_cache[2] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
5644
+ onKeydown: userTyping,
5645
+ onKeyup: userTyping,
5604
5646
  type: "search",
5605
- onChange: _cache[3] || (_cache[3] = $event => (_ctx.reloadData(1))),
5606
- "onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((_ctx.filter_value) = $event)),
5647
+ onChange: _cache[1] || (_cache[1] = $event => (reloadData(1))),
5648
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => ((filter_value).value = $event)),
5607
5649
  placeholder: __props.searchPlaceholder ? __props.searchPlaceholder : 'Search',
5608
5650
  class: "form-control sh-search-input"
5609
5651
  }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_6$3), [
5610
- [vue.vModelText, _ctx.filter_value]
5652
+ [vue.vModelText, filter_value.value]
5611
5653
  ]),
5612
- (_ctx.filter_value.length > 1)
5654
+ (filter_value.value.length > 1)
5613
5655
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$3, [
5614
5656
  vue.withDirectives(vue.createElementVNode("input", {
5615
- onChange: _cache[5] || (_cache[5] = (...args) => (_ctx.reloadData && _ctx.reloadData(...args))),
5657
+ onChange: reloadData,
5616
5658
  value: true,
5617
- "onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ((_ctx.exactMatch) = $event)),
5659
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => ((exactMatch).value = $event)),
5618
5660
  type: "checkbox"
5619
5661
  }, null, 544 /* NEED_HYDRATION, NEED_PATCH */), [
5620
- [vue.vModelCheckbox, _ctx.exactMatch]
5662
+ [vue.vModelCheckbox, exactMatch.value]
5621
5663
  ]),
5622
- _cache[11] || (_cache[11] = vue.createElementVNode("span", { class: "ms-1" }, "Exact", -1 /* HOISTED */))
5664
+ _cache[8] || (_cache[8] = vue.createElementVNode("span", { class: "ms-1" }, "Exact", -1 /* CACHED */))
5623
5665
  ]))
5624
5666
  : vue.createCommentVNode("v-if", true)
5625
5667
  ], 2 /* CLASS */),
5626
5668
  (__props.hasRange)
5627
5669
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8$2, [
5628
- vue.createVNode(script$e, {
5629
- onRangeSelected: _ctx.rangeChanged,
5670
+ vue.createVNode(script$f, {
5671
+ onRangeSelected: rangeChanged,
5630
5672
  selected: __props.selectedRange
5631
- }, null, 8 /* PROPS */, ["onRangeSelected", "selected"])
5673
+ }, null, 8 /* PROPS */, ["selected"])
5632
5674
  ]))
5633
5675
  : vue.createCommentVNode("v-if", true)
5634
5676
  ])
5635
5677
  ]))
5636
5678
  : vue.createCommentVNode("v-if", true),
5637
- (_ctx.hasDefaultSlot)
5679
+ (hasDefaultSlot.value)
5638
5680
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
5639
- (_ctx.loading === 'loading')
5640
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, _cache[12] || (_cache[12] = [
5681
+ (loading.value === 'loading')
5682
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$2, [...(_cache[9] || (_cache[9] = [
5641
5683
  vue.createElementVNode("div", {
5642
5684
  class: "spinner-border",
5643
5685
  role: "status"
5644
5686
  }, [
5645
5687
  vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5646
- ], -1 /* HOISTED */)
5647
- ])))
5648
- : (_ctx.loading === 'error')
5688
+ ], -1 /* CACHED */)
5689
+ ]))]))
5690
+ : (loading.value === 'error')
5649
5691
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$2, [
5650
- vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5692
+ vue.createElementVNode("span", null, vue.toDisplayString(loading_error.value), 1 /* TEXT */)
5651
5693
  ]))
5652
5694
  : vue.createCommentVNode("v-if", true),
5653
- (_ctx.loading === 'done')
5654
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(_ctx.records, (record) => {
5695
+ (loading.value === 'done')
5696
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 2 }, vue.renderList(records.value, (record) => {
5655
5697
  return vue.renderSlot(_ctx.$slots, "default", {
5656
5698
  key: record.id,
5657
5699
  record: record
@@ -5659,45 +5701,45 @@ return (_ctx, _cache) => {
5659
5701
  }), 128 /* KEYED_FRAGMENT */))
5660
5702
  : vue.createCommentVNode("v-if", true)
5661
5703
  ], 64 /* STABLE_FRAGMENT */))
5662
- : (_ctx.hasRecordsSlot)
5704
+ : (hasRecordsSlot.value)
5663
5705
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
5664
- (_ctx.loading === 'loading' && !__props.cacheKey)
5665
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, _cache[13] || (_cache[13] = [
5706
+ (loading.value === 'loading' && !__props.cacheKey)
5707
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$1, [...(_cache[10] || (_cache[10] = [
5666
5708
  vue.createElementVNode("div", {
5667
5709
  class: "spinner-border",
5668
5710
  role: "status"
5669
5711
  }, [
5670
5712
  vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5671
- ], -1 /* HOISTED */)
5672
- ])))
5673
- : (_ctx.loading === 'error' && !__props.cacheKey)
5713
+ ], -1 /* CACHED */)
5714
+ ]))]))
5715
+ : (loading.value === 'error' && !__props.cacheKey)
5674
5716
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
5675
- vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5717
+ vue.createElementVNode("span", null, vue.toDisplayString(loading_error.value), 1 /* TEXT */)
5676
5718
  ]))
5677
5719
  : vue.createCommentVNode("v-if", true),
5678
- (_ctx.loading === 'done' || __props.cacheKey)
5720
+ (loading.value === 'done' || __props.cacheKey)
5679
5721
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
5680
- (!_ctx.records || _ctx.records.length === 0)
5722
+ (!records.value || records.value.length === 0)
5681
5723
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(noRecordsComponent)), { key: 0 }, {
5682
5724
  default: vue.withCtx(() => [
5683
- _cache[14] || (_cache[14] = vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */)),
5725
+ _cache[11] || (_cache[11] = vue.createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* CACHED */)),
5684
5726
  vue.createTextVNode(" " + vue.toDisplayString(__props.noRecordsMessage ?? 'No records found'), 1 /* TEXT */)
5685
5727
  ]),
5686
5728
  _: 1 /* STABLE */
5687
5729
  }))
5688
5730
  : vue.createCommentVNode("v-if", true),
5689
- vue.renderSlot(_ctx.$slots, "records", { records: _ctx.records })
5731
+ vue.renderSlot(_ctx.$slots, "records", { records: records.value })
5690
5732
  ], 64 /* STABLE_FRAGMENT */))
5691
5733
  : vue.createCommentVNode("v-if", true)
5692
5734
  ], 64 /* STABLE_FRAGMENT */))
5693
- : (_ctx.windowWidth > 700 || __props.disableMobileResponsive)
5735
+ : (windowWidth.value > 700 || __props.disableMobileResponsive)
5694
5736
  ? (vue.openBlock(), vue.createElementBlock("table", {
5695
5737
  key: 4,
5696
5738
  class: vue.normalizeClass(["table sh-table", __props.tableHover ? 'table-hover':''])
5697
5739
  }, [
5698
5740
  vue.createElementVNode("thead", _hoisted_13$1, [
5699
5741
  vue.createElementVNode("tr", null, [
5700
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (title) => {
5742
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (title) => {
5701
5743
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: title }, [
5702
5744
  (showColumn(title))
5703
5745
  ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_14$1, [
@@ -5705,26 +5747,26 @@ return (_ctx, _cache) => {
5705
5747
  ? (vue.openBlock(), vue.createElementBlock("a", {
5706
5748
  key: 0,
5707
5749
  class: "text-capitalize",
5708
- onClick: $event => (_ctx.changeKey('order_by',title))
5750
+ onClick: $event => (changeKey('order_by', title))
5709
5751
  }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_15$1))
5710
5752
  : (typeof title === 'object')
5711
5753
  ? (vue.openBlock(), vue.createElementBlock("a", {
5712
5754
  key: 1,
5713
5755
  class: "text-capitalize",
5714
- onClick: $event => (_ctx.changeKey('order_by',title.key))
5756
+ onClick: $event => (changeKey('order_by', title.key))
5715
5757
  }, vue.toDisplayString(title.label ?? title.key.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_16))
5716
5758
  : (typeof title === 'function')
5717
5759
  ? (vue.openBlock(), vue.createElementBlock("a", {
5718
5760
  key: 2,
5719
5761
  class: "text-capitalize",
5720
- onClick: $event => (_ctx.changeKey('order_by',title(null)))
5762
+ onClick: $event => (changeKey('order_by', title(null)))
5721
5763
  }, vue.toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_17))
5722
5764
  : (typeof title !== 'undefined')
5723
5765
  ? (vue.openBlock(), vue.createElementBlock("a", {
5724
5766
  key: 3,
5725
5767
  class: "text-capitalize",
5726
- onClick: $event => (_ctx.changeKey('order_by',title))
5727
- }, vue.toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_18))
5768
+ onClick: $event => (changeKey('order_by', title))
5769
+ }, vue.toDisplayString(String(title).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_18))
5728
5770
  : vue.createCommentVNode("v-if", true)
5729
5771
  ]))
5730
5772
  : vue.createCommentVNode("v-if", true)
@@ -5736,11 +5778,11 @@ return (_ctx, _cache) => {
5736
5778
  ])
5737
5779
  ]),
5738
5780
  vue.createElementVNode("tbody", _hoisted_20, [
5739
- (_ctx.loading === 'loading')
5781
+ (loading.value === 'loading')
5740
5782
  ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_21, [
5741
5783
  vue.createElementVNode("td", {
5742
- colspan: _ctx.tableHeaders.length
5743
- }, _cache[15] || (_cache[15] = [
5784
+ colspan: tableHeaders.value.length
5785
+ }, [...(_cache[12] || (_cache[12] = [
5744
5786
  vue.createElementVNode("div", { class: "text-center" }, [
5745
5787
  vue.createElementVNode("div", {
5746
5788
  class: "spinner-border",
@@ -5748,34 +5790,34 @@ return (_ctx, _cache) => {
5748
5790
  }, [
5749
5791
  vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5750
5792
  ])
5751
- ], -1 /* HOISTED */)
5752
- ]), 8 /* PROPS */, _hoisted_22)
5793
+ ], -1 /* CACHED */)
5794
+ ]))], 8 /* PROPS */, _hoisted_22)
5753
5795
  ]))
5754
- : (_ctx.loading === 'error')
5796
+ : (loading.value === 'error')
5755
5797
  ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_23, [
5756
5798
  vue.createElementVNode("td", {
5757
- colspan: _ctx.tableHeaders.length
5758
- }, vue.toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_24)
5799
+ colspan: tableHeaders.value.length
5800
+ }, vue.toDisplayString(loading_error.value), 9 /* TEXT, PROPS */, _hoisted_24)
5759
5801
  ]))
5760
- : (_ctx.records.length === 0)
5802
+ : (records.value.length === 0)
5761
5803
  ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_25, [
5762
5804
  vue.createElementVNode("td", {
5763
- colspan: __props.actions ? _ctx.tableHeaders.length + 1 : _ctx.tableHeaders.length
5764
- }, _cache[16] || (_cache[16] = [
5805
+ colspan: __props.actions ? tableHeaders.value.length + 1 : tableHeaders.value.length
5806
+ }, [...(_cache[13] || (_cache[13] = [
5765
5807
  vue.createElementVNode("div", { class: "text-center bg-primary-light px-2 py-1 rounded no_records_div" }, [
5766
5808
  vue.createElementVNode("i", { class: "bi-info-circle" }),
5767
5809
  vue.createTextVNode(" No records found ")
5768
- ], -1 /* HOISTED */)
5769
- ]), 8 /* PROPS */, _hoisted_26)
5810
+ ], -1 /* CACHED */)
5811
+ ]))], 8 /* PROPS */, _hoisted_26)
5770
5812
  ]))
5771
- : (_ctx.loading === 'done')
5772
- ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(_ctx.records, (record, index) => {
5813
+ : (loading.value === 'done')
5814
+ ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 3 }, vue.renderList(records.value, (record, index) => {
5773
5815
  return (vue.openBlock(), vue.createElementBlock("tr", {
5774
5816
  key: record.id,
5775
5817
  class: vue.normalizeClass(record.class),
5776
- onClick: $event => (_ctx.rowSelected(record))
5818
+ onClick: $event => (rowSelected(record))
5777
5819
  }, [
5778
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (key) => {
5820
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (key) => {
5779
5821
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: key }, [
5780
5822
  (showColumn(key))
5781
5823
  ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_28, [
@@ -5783,16 +5825,16 @@ return (_ctx, _cache) => {
5783
5825
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5784
5826
  key: 0,
5785
5827
  target: __props.links[key].target ? '_blank':'',
5786
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5787
- class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5828
+ to: replaceLinkUrl(__props.links[key], record),
5829
+ class: vue.normalizeClass(getLinkClass(__props.links[key])),
5788
5830
  innerHTML: record[key]
5789
5831
  }, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
5790
- : (_ctx.getFieldType(key) === 'numeric')
5832
+ : (getFieldType(key) === 'numeric')
5791
5833
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_29, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5792
- : (_ctx.getFieldType(key) === 'money')
5834
+ : (getFieldType(key) === 'money')
5793
5835
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_30, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5794
- : (_ctx.getFieldType(key) === 'date')
5795
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5836
+ : (getFieldType(key) === 'date')
5837
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_31, vue.toDisplayString(formatDate(record[key])), 1 /* TEXT */))
5796
5838
  : (typeof key === 'string')
5797
5839
  ? (vue.openBlock(), vue.createElementBlock("span", {
5798
5840
  key: 4,
@@ -5816,9 +5858,8 @@ return (_ctx, _cache) => {
5816
5858
  : (typeof key === 'object' && key.component)
5817
5859
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5818
5860
  key: 8,
5819
- item: record,
5820
- ref_for: true
5821
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5861
+ item: record
5862
+ }, { ref_for: true }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5822
5863
  : (typeof key === 'object')
5823
5864
  ? (vue.openBlock(), vue.createElementBlock("span", {
5824
5865
  key: 9,
@@ -5835,10 +5876,10 @@ return (_ctx, _cache) => {
5835
5876
  (__props.actions)
5836
5877
  ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_38, [
5837
5878
  vue.createVNode(script$g, {
5838
- emitAction: _ctx.doEmitAction,
5879
+ emitAction: doEmitAction,
5839
5880
  actions: __props.actions,
5840
5881
  record: record
5841
- }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5882
+ }, null, 8 /* PROPS */, ["actions", "record"])
5842
5883
  ]))
5843
5884
  : vue.createCommentVNode("v-if", true)
5844
5885
  ], 10 /* CLASS, PROPS */, _hoisted_27))
@@ -5847,8 +5888,8 @@ return (_ctx, _cache) => {
5847
5888
  ])
5848
5889
  ], 2 /* CLASS */))
5849
5890
  : (vue.openBlock(), vue.createElementBlock("div", _hoisted_39, [
5850
- (_ctx.loading === 'loading')
5851
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, _cache[17] || (_cache[17] = [
5891
+ (loading.value === 'loading')
5892
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_40, [...(_cache[14] || (_cache[14] = [
5852
5893
  vue.createElementVNode("div", { class: "text-center" }, [
5853
5894
  vue.createElementVNode("div", {
5854
5895
  class: "spinner-border",
@@ -5856,21 +5897,21 @@ return (_ctx, _cache) => {
5856
5897
  }, [
5857
5898
  vue.createElementVNode("span", { class: "visually-hidden" }, "Loading...")
5858
5899
  ])
5859
- ], -1 /* HOISTED */)
5860
- ])))
5861
- : (_ctx.loading === 'error')
5900
+ ], -1 /* CACHED */)
5901
+ ]))]))
5902
+ : (loading.value === 'error')
5862
5903
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_41, [
5863
- vue.createElementVNode("span", null, vue.toDisplayString(_ctx.loading_error), 1 /* TEXT */)
5904
+ vue.createElementVNode("span", null, vue.toDisplayString(loading_error.value), 1 /* TEXT */)
5864
5905
  ]))
5865
- : (_ctx.loading === 'done')
5906
+ : (loading.value === 'done')
5866
5907
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_42, [
5867
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.records, (record, index) => {
5908
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (record, index) => {
5868
5909
  return (vue.openBlock(), vue.createElementBlock("div", {
5869
5910
  key: record.id,
5870
5911
  class: "single-mobile-req bg-light p-3",
5871
- onClick: $event => (_ctx.rowSelected(record))
5912
+ onClick: $event => (rowSelected(record))
5872
5913
  }, [
5873
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.tableHeaders, (key) => {
5914
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tableHeaders.value, (key) => {
5874
5915
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
5875
5916
  key: key[0]
5876
5917
  }, [
@@ -5887,17 +5928,17 @@ return (_ctx, _cache) => {
5887
5928
  (typeof key === 'string' && __props.links && __props.links[key])
5888
5929
  ? (vue.openBlock(), vue.createBlock(_component_router_link, {
5889
5930
  key: 0,
5890
- to: _ctx.replaceLinkUrl(__props.links[key],record),
5891
- class: vue.normalizeClass(_ctx.getLinkClass(__props.links[key])),
5931
+ to: replaceLinkUrl(__props.links[key],record),
5932
+ class: vue.normalizeClass(getLinkClass(__props.links[key])),
5892
5933
  innerHTML: record[key]
5893
5934
  }, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
5894
- : (_ctx.getFieldType(key) === 'numeric')
5935
+ : (getFieldType(key) === 'numeric')
5895
5936
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_48, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5896
- : (_ctx.getFieldType(key) === 'money')
5937
+ : (getFieldType(key) === 'money')
5897
5938
  ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_49, vue.toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
5898
- : (_ctx.getFieldType(key) === 'date')
5899
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_50, vue.toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
5900
- : (typeof key === 'string')
5939
+ : (getFieldType(key) === 'date')
5940
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_50, vue.toDisplayString(formatDate(record[key])), 1 /* TEXT */))
5941
+ : (typeof key === 'string')
5901
5942
  ? (vue.openBlock(), vue.createElementBlock("span", {
5902
5943
  key: 4,
5903
5944
  innerHTML: record[key]
@@ -5915,10 +5956,9 @@ return (_ctx, _cache) => {
5915
5956
  : (typeof key === 'object' && key.component)
5916
5957
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(key.component), vue.mergeProps({
5917
5958
  key: 7,
5918
- item: record,
5919
- ref_for: true
5920
- }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5921
- : (typeof key === 'object')
5959
+ item: record
5960
+ }, { ref_for: true }, cleanColumn(key)), null, 16 /* FULL_PROPS */, ["item"]))
5961
+ : (typeof key === 'object')
5922
5962
  ? (vue.openBlock(), vue.createElementBlock("span", {
5923
5963
  key: 8,
5924
5964
  innerHTML: record[key.key ?? key.field]
@@ -5926,7 +5966,7 @@ return (_ctx, _cache) => {
5926
5966
  : (typeof key === 'function')
5927
5967
  ? (vue.openBlock(), vue.createElementBlock("span", {
5928
5968
  key: 9,
5929
- innerHTML: key(record, index )
5969
+ innerHTML: key(record, index)
5930
5970
  }, null, 8 /* PROPS */, _hoisted_55))
5931
5971
  : (vue.openBlock(), vue.createElementBlock("span", {
5932
5972
  key: 10,
@@ -5935,16 +5975,16 @@ return (_ctx, _cache) => {
5935
5975
  ])
5936
5976
  ], 64 /* STABLE_FRAGMENT */))
5937
5977
  : vue.createCommentVNode("v-if", true),
5938
- _cache[18] || (_cache[18] = vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */))
5978
+ _cache[15] || (_cache[15] = vue.createElementVNode("hr", { class: "my-2" }, null, -1 /* CACHED */))
5939
5979
  ], 64 /* STABLE_FRAGMENT */))
5940
5980
  }), 128 /* KEYED_FRAGMENT */)),
5941
5981
  (__props.actions)
5942
5982
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_57, [
5943
5983
  vue.createVNode(script$g, {
5944
- emitAction: _ctx.doEmitAction,
5984
+ emitAction: doEmitAction,
5945
5985
  actions: __props.actions,
5946
5986
  record: record
5947
- }, null, 8 /* PROPS */, ["emitAction", "actions", "record"])
5987
+ }, null, 8 /* PROPS */, ["actions", "record"])
5948
5988
  ]))
5949
5989
  : vue.createCommentVNode("v-if", true)
5950
5990
  ], 8 /* PROPS */, _hoisted_43))
@@ -5952,17 +5992,17 @@ return (_ctx, _cache) => {
5952
5992
  ]))
5953
5993
  : vue.createCommentVNode("v-if", true)
5954
5994
  ])),
5955
- (_ctx.pagination_data)
5956
- ? (vue.openBlock(), vue.createBlock(script$f, {
5995
+ (pagination_data.value)
5996
+ ? (vue.openBlock(), vue.createBlock(script$e, {
5957
5997
  key: 6,
5958
- onLoadMoreRecords: _ctx.loadMoreRecords,
5998
+ onLoadMoreRecords: loadMoreRecords,
5959
5999
  "hide-load-more": __props.hideLoadMore,
5960
- "per-page": _ctx.per_page,
6000
+ "per-page": per_page.value,
5961
6001
  "hide-count": __props.hideCount,
5962
- pagination_data: _ctx.pagination_data,
5963
- onChangeKey: _ctx.changeKey,
5964
- "pagination-style": _ctx.pageStyle
5965
- }, null, 8 /* PROPS */, ["onLoadMoreRecords", "hide-load-more", "per-page", "hide-count", "pagination_data", "onChangeKey", "pagination-style"]))
6002
+ pagination_data: pagination_data.value,
6003
+ onChangeKey: changeKey,
6004
+ "pagination-style": pageStyle.value
6005
+ }, null, 8 /* PROPS */, ["hide-load-more", "per-page", "hide-count", "pagination_data", "pagination-style"]))
5966
6006
  : vue.createCommentVNode("v-if", true),
5967
6007
  (__props.actions)
5968
6008
  ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 7 }, vue.renderList(__props.actions.actions, (action) => {
@@ -5972,23 +6012,22 @@ return (_ctx, _cache) => {
5972
6012
  (action.canvasId)
5973
6013
  ? (vue.openBlock(), vue.createBlock(script$l, {
5974
6014
  key: 0,
5975
- onOffcanvasClosed: _ctx.canvasClosed,
6015
+ onOffcanvasClosed: canvasClosed,
5976
6016
  position: action.canvasPosition,
5977
6017
  "canvas-size": action.canvasSize,
5978
6018
  "canvas-title": action.canvasTitle,
5979
6019
  "canvas-id": action.canvasId
5980
6020
  }, {
5981
6021
  default: vue.withCtx(() => [
5982
- (_ctx.selectedRecord)
6022
+ (selectedRecord.value)
5983
6023
  ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(action.canvasComponent), vue.mergeProps({
5984
6024
  key: 0,
5985
- onRecordUpdated: _ctx.reloadData,
5986
- ref_for: true
5987
- }, _ctx.cleanCanvasProps(action), { record: _ctx.selectedRecord }), null, 16 /* FULL_PROPS */, ["onRecordUpdated", "record"]))
6025
+ onRecordUpdated: reloadData
6026
+ }, { ref_for: true }, cleanCanvasProps(action), { record: selectedRecord.value }), null, 16 /* FULL_PROPS */, ["record"]))
5988
6027
  : vue.createCommentVNode("v-if", true)
5989
6028
  ]),
5990
6029
  _: 2 /* DYNAMIC */
5991
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onOffcanvasClosed", "position", "canvas-size", "canvas-title", "canvas-id"]))
6030
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["position", "canvas-size", "canvas-title", "canvas-id"]))
5992
6031
  : vue.createCommentVNode("v-if", true)
5993
6032
  ], 64 /* STABLE_FRAGMENT */))
5994
6033
  }), 128 /* KEYED_FRAGMENT */))
@@ -5997,7 +6036,7 @@ return (_ctx, _cache) => {
5997
6036
  }
5998
6037
  }
5999
6038
 
6000
- });
6039
+ };
6001
6040
 
6002
6041
  script$d.__file = "src/lib/components/ShTable.vue";
6003
6042
 
@@ -6271,7 +6310,7 @@ return (_ctx, _cache) => {
6271
6310
  vue.createTextVNode(vue.toDisplayString(tab.label) + " ", 1 /* TEXT */),
6272
6311
  (tab.count || tab.tabCount)
6273
6312
  ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
6274
- _cache[0] || (_cache[0] = vue.createElementVNode("i", { class: "d-none" }, null, -1 /* HOISTED */)),
6313
+ _cache[0] || (_cache[0] = vue.createElementVNode("i", { class: "d-none" }, null, -1 /* CACHED */)),
6275
6314
  vue.createElementVNode("sup", _hoisted_3$4, vue.toDisplayString(tab.count ?? tab.tabCount), 1 /* TEXT */)
6276
6315
  ], 64 /* STABLE_FRAGMENT */))
6277
6316
  : vue.createCommentVNode("v-if", true)
@@ -6487,9 +6526,9 @@ return (_ctx, _cache) => {
6487
6526
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
6488
6527
  vue.createElementVNode("div", _hoisted_2$5, [
6489
6528
  (loadingModules.value)
6490
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, _cache[1] || (_cache[1] = [
6491
- vue.createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* HOISTED */)
6492
- ])))
6529
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [...(_cache[1] || (_cache[1] = [
6530
+ vue.createElementVNode("span", { class: "spinner-grow mx-auto" }, null, -1 /* CACHED */)
6531
+ ]))]))
6493
6532
  : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_4$3, [
6494
6533
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(modules.value, (module) => {
6495
6534
  return (vue.openBlock(), vue.createElementBlock("li", {
@@ -6546,10 +6585,10 @@ return (_ctx, _cache) => {
6546
6585
  data: {permissions: selectedPermissions.value},
6547
6586
  class: "btn btn-primary d-block"
6548
6587
  }, {
6549
- default: vue.withCtx(() => _cache[2] || (_cache[2] = [
6550
- vue.createElementVNode("i", { class: "bi-check" }, null, -1 /* HOISTED */),
6551
- vue.createTextVNode(" Save")
6552
- ])),
6588
+ default: vue.withCtx(() => [...(_cache[2] || (_cache[2] = [
6589
+ vue.createElementVNode("i", { class: "bi-check" }, null, -1 /* CACHED */),
6590
+ vue.createTextVNode(" Save", -1 /* CACHED */)
6591
+ ]))]),
6553
6592
  _: 1 /* STABLE */
6554
6593
  }, 8 /* PROPS */, ["url", "data"])
6555
6594
  ])
@@ -6935,7 +6974,7 @@ return (_ctx, _cache) => {
6935
6974
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
6936
6975
  vue.createVNode(script$4, null, {
6937
6976
  default: vue.withCtx(() => [
6938
- _cache[5] || (_cache[5] = vue.createElementVNode("h5", { class: "card-title" }, "Details", -1 /* HOISTED */)),
6977
+ _cache[5] || (_cache[5] = vue.createElementVNode("h5", { class: "card-title" }, "Details", -1 /* CACHED */)),
6939
6978
  vue.createElementVNode("table", _hoisted_4$2, [
6940
6979
  vue.createElementVNode("tbody", null, [
6941
6980
  (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(UserdetailsColumns, (column) => {
@@ -6959,10 +6998,10 @@ return (_ctx, _cache) => {
6959
6998
  onSuccess: _cache[0] || (_cache[0] = $event => (detailsUpdated('details'))),
6960
6999
  fields: ['name','email','phone']
6961
7000
  }, {
6962
- default: vue.withCtx(() => _cache[3] || (_cache[3] = [
6963
- vue.createElementVNode("i", { class: "bi-pen" }, null, -1 /* HOISTED */),
6964
- vue.createTextVNode(" Edit Details")
6965
- ])),
7001
+ default: vue.withCtx(() => [...(_cache[3] || (_cache[3] = [
7002
+ vue.createElementVNode("i", { class: "bi-pen" }, null, -1 /* CACHED */),
7003
+ vue.createTextVNode(" Edit Details", -1 /* CACHED */)
7004
+ ]))]),
6966
7005
  _: 1 /* STABLE */
6967
7006
  }, 8 /* PROPS */, ["current-data"]))
6968
7007
  : vue.createCommentVNode("v-if", true),
@@ -6988,10 +7027,10 @@ return (_ctx, _cache) => {
6988
7027
  }
6989
7028
  ]
6990
7029
  }, {
6991
- default: vue.withCtx(() => _cache[4] || (_cache[4] = [
6992
- vue.createElementVNode("i", { class: "bi-key" }, null, -1 /* HOISTED */),
6993
- vue.createTextVNode(" Change Password")
6994
- ])),
7030
+ default: vue.withCtx(() => [...(_cache[4] || (_cache[4] = [
7031
+ vue.createElementVNode("i", { class: "bi-key" }, null, -1 /* CACHED */),
7032
+ vue.createTextVNode(" Change Password", -1 /* CACHED */)
7033
+ ]))]),
6995
7034
  _: 1 /* STABLE */
6996
7035
  }))
6997
7036
  : vue.createCommentVNode("v-if", true)
@@ -7015,13 +7054,13 @@ return (_ctx, _cache) => {
7015
7054
  type: 'file',
7016
7055
  }]
7017
7056
  }, {
7018
- default: vue.withCtx(() => _cache[6] || (_cache[6] = [
7019
- vue.createElementVNode("i", { class: "bi-pen" }, null, -1 /* HOISTED */)
7020
- ])),
7057
+ default: vue.withCtx(() => [...(_cache[6] || (_cache[6] = [
7058
+ vue.createElementVNode("i", { class: "bi-pen" }, null, -1 /* CACHED */)
7059
+ ]))]),
7021
7060
  _: 1 /* STABLE */
7022
7061
  }),
7023
7062
  vue.createElementVNode("div", null, [
7024
- _cache[7] || (_cache[7] = vue.createElementVNode("h5", { class: "card-title" }, "Profile Picture", -1 /* HOISTED */)),
7063
+ _cache[7] || (_cache[7] = vue.createElementVNode("h5", { class: "card-title" }, "Profile Picture", -1 /* CACHED */)),
7025
7064
  vue.createElementVNode("img", {
7026
7065
  src: showProfilePicture(vue.unref(user)?.profile_picture),
7027
7066
  class: "img-fluid",
@@ -7071,7 +7110,7 @@ department.value = dept;
7071
7110
 
7072
7111
  return (_ctx, _cache) => {
7073
7112
  return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
7074
- _cache[2] || (_cache[2] = vue.createElementVNode("h5", null, "Departments", -1 /* HOISTED */)),
7113
+ _cache[2] || (_cache[2] = vue.createElementVNode("h5", null, "Departments", -1 /* CACHED */)),
7075
7114
  vue.createElementVNode("div", _hoisted_1$2, [
7076
7115
  vue.createElementVNode("div", _hoisted_2$2, [
7077
7116
  vue.createElementVNode("a", {
@@ -7080,10 +7119,10 @@ return (_ctx, _cache) => {
7080
7119
  ref: "addDeptBtn",
7081
7120
  href: "#sh_department_modal",
7082
7121
  class: "btn btn-info btn-sm"
7083
- }, _cache[1] || (_cache[1] = [
7084
- vue.createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* HOISTED */),
7085
- vue.createTextVNode(" ADD DEPARTMENT")
7086
- ]), 512 /* NEED_PATCH */),
7122
+ }, [...(_cache[1] || (_cache[1] = [
7123
+ vue.createElementVNode("i", { class: "fa fa-plus" }, null, -1 /* CACHED */),
7124
+ vue.createTextVNode(" ADD DEPARTMENT", -1 /* CACHED */)
7125
+ ]))], 512 /* NEED_PATCH */),
7087
7126
  vue.createVNode(script$d, {
7088
7127
  reload: vue.unref(reload),
7089
7128
  headers: ['id','name','description', 'created_at'],
@@ -7240,7 +7279,7 @@ return (_ctx, _cache) => {
7240
7279
  }, [
7241
7280
  vue.createElementVNode("i", { class: "bi-plus" }),
7242
7281
  vue.createTextVNode(" ADD Module")
7243
- ], -1 /* HOISTED */)),
7282
+ ], -1 /* CACHED */)),
7244
7283
  vue.createElementVNode("h5", null, "Department #" + vue.toDisplayString(vue.unref(department).id) + " - " + vue.toDisplayString(vue.unref(department).name) + " Allowed Modules", 1 /* TEXT */),
7245
7284
  vue.createVNode(script$d, {
7246
7285
  actions: {
@@ -7320,10 +7359,10 @@ return (_ctx, _cache) => {
7320
7359
  vue.createElementVNode("button", {
7321
7360
  onClick: submitPermissions,
7322
7361
  class: "btn btn-info"
7323
- }, _cache[1] || (_cache[1] = [
7324
- vue.createElementVNode("i", { class: "fa fa-save" }, null, -1 /* HOISTED */),
7325
- vue.createTextVNode(" Submit")
7326
- ]))
7362
+ }, [...(_cache[1] || (_cache[1] = [
7363
+ vue.createElementVNode("i", { class: "fa fa-save" }, null, -1 /* CACHED */),
7364
+ vue.createTextVNode(" Submit", -1 /* CACHED */)
7365
+ ]))])
7327
7366
  ], 64 /* STABLE_FRAGMENT */))
7328
7367
  : vue.createCommentVNode("v-if", true)
7329
7368
  ]),
@@ -7416,7 +7455,7 @@ const forgotSuccessful = ()=>{
7416
7455
  return (_ctx, _cache) => {
7417
7456
  return (vue.unref(user))
7418
7457
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
7419
- _cache[4] || (_cache[4] = vue.createTextVNode("You are signed is as ")),
7458
+ _cache[4] || (_cache[4] = vue.createTextVNode("You are signed is as ", -1 /* CACHED */)),
7420
7459
  vue.createElementVNode("strong", null, vue.toDisplayString(vue.unref(user).name), 1 /* TEXT */)
7421
7460
  ]))
7422
7461
  : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
@@ -7433,10 +7472,10 @@ return (_ctx, _cache) => {
7433
7472
  vue.createElementVNode("strong", {
7434
7473
  onClick: _cache[0] || (_cache[0] = $event => (goToSection('login'))),
7435
7474
  class: "sh-register-link text-primary"
7436
- }, _cache[5] || (_cache[5] = [
7437
- vue.createElementVNode("i", { class: "bi bi-arrow-left" }, null, -1 /* HOISTED */),
7438
- vue.createTextVNode(" Back to Login ")
7439
- ]))
7475
+ }, [...(_cache[5] || (_cache[5] = [
7476
+ vue.createElementVNode("i", { class: "bi bi-arrow-left" }, null, -1 /* CACHED */),
7477
+ vue.createTextVNode(" Back to Login ", -1 /* CACHED */)
7478
+ ]))])
7440
7479
  ])
7441
7480
  ]))
7442
7481
  : vue.createCommentVNode("v-if", true),
@@ -7457,7 +7496,7 @@ return (_ctx, _cache) => {
7457
7496
  class: "sh-forgot-link text-primary",
7458
7497
  onClick: _cache[1] || (_cache[1] = $event => (goToSection('forgot')))
7459
7498
  }, "Forgotten password?"),
7460
- _cache[6] || (_cache[6] = vue.createElementVNode("strong", { class: "bi-dot" }, null, -1 /* HOISTED */)),
7499
+ _cache[6] || (_cache[6] = vue.createElementVNode("strong", { class: "bi-dot" }, null, -1 /* CACHED */)),
7461
7500
  vue.createElementVNode("strong", {
7462
7501
  onClick: _cache[2] || (_cache[2] = $event => (goToSection('register'))),
7463
7502
  class: "sh-register-link text-primary"
@@ -7716,7 +7755,7 @@ exports.ShModalForm = script$n;
7716
7755
  exports.ShModalFormAuto = script$m;
7717
7756
  exports.ShPhone = script$A;
7718
7757
  exports.ShQueryPopups = script$5;
7719
- exports.ShRange = script$e;
7758
+ exports.ShRange = script$f;
7720
7759
  exports.ShRoutePopups = script$7;
7721
7760
  exports.ShSilentAction = script$i;
7722
7761
  exports.ShSuggest = script$z;