@iankibetsh/shframework 4.1.2 → 4.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist/library.mjs.css +56 -40
- package/dist/library.js +634 -606
- package/dist/library.mjs +626 -598
- package/package.json +1 -1
package/dist/library.mjs
CHANGED
|
@@ -1898,7 +1898,7 @@ const countries = [
|
|
|
1898
1898
|
}
|
|
1899
1899
|
];
|
|
1900
1900
|
|
|
1901
|
-
var script$
|
|
1901
|
+
var script$v = {
|
|
1902
1902
|
name: 'PhoneInput',
|
|
1903
1903
|
props: ['modelValue', 'country_code'],
|
|
1904
1904
|
data () {
|
|
@@ -1968,7 +1968,7 @@ var script$u = {
|
|
|
1968
1968
|
}
|
|
1969
1969
|
};
|
|
1970
1970
|
|
|
1971
|
-
const _hoisted_1$
|
|
1971
|
+
const _hoisted_1$o = { class: "sh-phone mb-3" };
|
|
1972
1972
|
const _hoisted_2$e = {
|
|
1973
1973
|
key: 0,
|
|
1974
1974
|
style: {"display":"contents"}
|
|
@@ -1977,7 +1977,7 @@ const _hoisted_3$d = ["src"];
|
|
|
1977
1977
|
const _hoisted_4$d = ["value"];
|
|
1978
1978
|
|
|
1979
1979
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1980
|
-
return (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1980
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
1981
1981
|
($data.selectedCountry)
|
|
1982
1982
|
? (openBlock(), createElementBlock("div", _hoisted_2$e, [
|
|
1983
1983
|
createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$d),
|
|
@@ -2011,10 +2011,10 @@ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2011
2011
|
]))
|
|
2012
2012
|
}
|
|
2013
2013
|
|
|
2014
|
-
script$
|
|
2015
|
-
script$
|
|
2014
|
+
script$v.render = render$3;
|
|
2015
|
+
script$v.__file = "src/lib/components/form-components/PhoneInput.vue";
|
|
2016
2016
|
|
|
2017
|
-
const _hoisted_1$
|
|
2017
|
+
const _hoisted_1$n = {
|
|
2018
2018
|
key: 0,
|
|
2019
2019
|
class: "dropdown sh-suggest"
|
|
2020
2020
|
};
|
|
@@ -2035,7 +2035,7 @@ const _hoisted_10$6 = {
|
|
|
2035
2035
|
};
|
|
2036
2036
|
|
|
2037
2037
|
|
|
2038
|
-
var script$
|
|
2038
|
+
var script$u = {
|
|
2039
2039
|
__name: 'ShSuggest',
|
|
2040
2040
|
props: ['data','allowMultiple','url','modelValue'],
|
|
2041
2041
|
emits: ['update:modelValue'],
|
|
@@ -2119,7 +2119,7 @@ function filterData(e){
|
|
|
2119
2119
|
|
|
2120
2120
|
return (_ctx, _cache) => {
|
|
2121
2121
|
return (unref(id))
|
|
2122
|
-
? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2122
|
+
? (openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
2123
2123
|
createElementVNode("div", {
|
|
2124
2124
|
id: unref(id),
|
|
2125
2125
|
"data-bs-toggle": "dropdown",
|
|
@@ -2180,15 +2180,15 @@ return (_ctx, _cache) => {
|
|
|
2180
2180
|
|
|
2181
2181
|
};
|
|
2182
2182
|
|
|
2183
|
-
script$
|
|
2184
|
-
script$
|
|
2183
|
+
script$u.__scopeId = "data-v-71cc9569";
|
|
2184
|
+
script$u.__file = "src/lib/components/form-components/ShSuggest.vue";
|
|
2185
2185
|
|
|
2186
|
-
var script$
|
|
2186
|
+
var script$t = {
|
|
2187
2187
|
name: 'ShForm',
|
|
2188
2188
|
components: {
|
|
2189
|
-
PhoneInput: script$
|
|
2190
|
-
ShSuggest: script$
|
|
2191
|
-
ShPhone: script$
|
|
2189
|
+
PhoneInput: script$v,
|
|
2190
|
+
ShSuggest: script$u,
|
|
2191
|
+
ShPhone: script$v
|
|
2192
2192
|
},
|
|
2193
2193
|
props: [
|
|
2194
2194
|
'action',
|
|
@@ -2512,7 +2512,7 @@ var script$s = {
|
|
|
2512
2512
|
}
|
|
2513
2513
|
};
|
|
2514
2514
|
|
|
2515
|
-
const _hoisted_1$
|
|
2515
|
+
const _hoisted_1$m = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
|
|
2516
2516
|
const _hoisted_2$c = {
|
|
2517
2517
|
ref: "ShAutoForm",
|
|
2518
2518
|
class: "sh-form"
|
|
@@ -2573,7 +2573,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2573
2573
|
const _component_ShSuggest = resolveComponent("ShSuggest");
|
|
2574
2574
|
|
|
2575
2575
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
2576
|
-
_hoisted_1$
|
|
2576
|
+
_hoisted_1$m,
|
|
2577
2577
|
createElementVNode("form", _hoisted_2$c, [
|
|
2578
2578
|
createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
|
|
2579
2579
|
createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
|
|
@@ -2781,10 +2781,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2781
2781
|
], 64 /* STABLE_FRAGMENT */))
|
|
2782
2782
|
}
|
|
2783
2783
|
|
|
2784
|
-
script$
|
|
2785
|
-
script$
|
|
2784
|
+
script$t.render = render$2;
|
|
2785
|
+
script$t.__file = "src/lib/components/ShForm.vue";
|
|
2786
2786
|
|
|
2787
|
-
var script$
|
|
2787
|
+
var script$s = {
|
|
2788
2788
|
__name: 'EmailInput',
|
|
2789
2789
|
props: ['modelValue','label'],
|
|
2790
2790
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2824,12 +2824,12 @@ return (_ctx, _cache) => {
|
|
|
2824
2824
|
|
|
2825
2825
|
};
|
|
2826
2826
|
|
|
2827
|
-
script$
|
|
2827
|
+
script$s.__file = "src/lib/components/form-components/EmailInput.vue";
|
|
2828
2828
|
|
|
2829
|
-
const _hoisted_1$
|
|
2829
|
+
const _hoisted_1$l = ["min", "max"];
|
|
2830
2830
|
|
|
2831
2831
|
|
|
2832
|
-
var script$
|
|
2832
|
+
var script$r = {
|
|
2833
2833
|
__name: 'NumberInput',
|
|
2834
2834
|
props: ['modelValue','label','min','max'],
|
|
2835
2835
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2863,7 +2863,7 @@ return (_ctx, _cache) => {
|
|
|
2863
2863
|
onChange: modelValueUpdated,
|
|
2864
2864
|
onKeydown: modelValueUpdated,
|
|
2865
2865
|
onUpdated: modelValueUpdated
|
|
2866
|
-
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$
|
|
2866
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$l)), [
|
|
2867
2867
|
[vModelText, inputModel.value]
|
|
2868
2868
|
])
|
|
2869
2869
|
}
|
|
@@ -2871,9 +2871,9 @@ return (_ctx, _cache) => {
|
|
|
2871
2871
|
|
|
2872
2872
|
};
|
|
2873
2873
|
|
|
2874
|
-
script$
|
|
2874
|
+
script$r.__file = "src/lib/components/form-components/NumberInput.vue";
|
|
2875
2875
|
|
|
2876
|
-
var script$
|
|
2876
|
+
var script$q = {
|
|
2877
2877
|
__name: 'TextInput',
|
|
2878
2878
|
props: ['modelValue','label','isInvalid'],
|
|
2879
2879
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2915,9 +2915,9 @@ return (_ctx, _cache) => {
|
|
|
2915
2915
|
|
|
2916
2916
|
};
|
|
2917
2917
|
|
|
2918
|
-
script$
|
|
2918
|
+
script$q.__file = "src/lib/components/form-components/TextInput.vue";
|
|
2919
2919
|
|
|
2920
|
-
var script$
|
|
2920
|
+
var script$p = {
|
|
2921
2921
|
__name: 'TextAreaInput',
|
|
2922
2922
|
props: ['modelValue','label'],
|
|
2923
2923
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2957,12 +2957,12 @@ return (_ctx, _cache) => {
|
|
|
2957
2957
|
|
|
2958
2958
|
};
|
|
2959
2959
|
|
|
2960
|
-
script$
|
|
2960
|
+
script$p.__file = "src/lib/components/form-components/TextAreaInput.vue";
|
|
2961
2961
|
|
|
2962
|
-
const _hoisted_1$
|
|
2962
|
+
const _hoisted_1$k = ["value"];
|
|
2963
2963
|
|
|
2964
2964
|
|
|
2965
|
-
var script$
|
|
2965
|
+
var script$o = {
|
|
2966
2966
|
__name: 'SelectInput',
|
|
2967
2967
|
props: ['modelValue','label','data','dataUrl'],
|
|
2968
2968
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -3018,7 +3018,7 @@ return (_ctx, _cache) => {
|
|
|
3018
3018
|
return (openBlock(), createElementBlock("option", {
|
|
3019
3019
|
key: option.id,
|
|
3020
3020
|
value: option.id
|
|
3021
|
-
}, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$
|
|
3021
|
+
}, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$k))
|
|
3022
3022
|
}), 128 /* KEYED_FRAGMENT */))
|
|
3023
3023
|
], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
|
|
3024
3024
|
[vModelSelect, inputModel.value]
|
|
@@ -3028,9 +3028,9 @@ return (_ctx, _cache) => {
|
|
|
3028
3028
|
|
|
3029
3029
|
};
|
|
3030
3030
|
|
|
3031
|
-
script$
|
|
3031
|
+
script$o.__file = "src/lib/components/form-components/SelectInput.vue";
|
|
3032
3032
|
|
|
3033
|
-
var script$
|
|
3033
|
+
var script$n = {
|
|
3034
3034
|
__name: 'PasswordInput',
|
|
3035
3035
|
props: ['modelValue','label'],
|
|
3036
3036
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -3066,9 +3066,9 @@ return (_ctx, _cache) => {
|
|
|
3066
3066
|
|
|
3067
3067
|
};
|
|
3068
3068
|
|
|
3069
|
-
script$
|
|
3069
|
+
script$n.__file = "src/lib/components/form-components/PasswordInput.vue";
|
|
3070
3070
|
|
|
3071
|
-
const _hoisted_1$
|
|
3071
|
+
const _hoisted_1$j = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
|
|
3072
3072
|
const _hoisted_2$b = ["onUpdate:modelValue"];
|
|
3073
3073
|
const _hoisted_3$a = ["innerHTML"];
|
|
3074
3074
|
const _hoisted_4$a = ["innerHTML"];
|
|
@@ -3095,7 +3095,7 @@ const _hoisted_12$3 = {
|
|
|
3095
3095
|
const _hoisted_13$3 = { key: 1 };
|
|
3096
3096
|
|
|
3097
3097
|
|
|
3098
|
-
var script$
|
|
3098
|
+
var script$m = {
|
|
3099
3099
|
__name: 'ShAutoForm',
|
|
3100
3100
|
props: [
|
|
3101
3101
|
'action','successCallback','retainDataAfterSubmission',
|
|
@@ -3128,19 +3128,19 @@ const getFieldComponent = (fieldObj)=>{
|
|
|
3128
3128
|
const defaultPhones = ['phone'];
|
|
3129
3129
|
const defaultEmails = ['email'];
|
|
3130
3130
|
const formComponents = inject('formComponents');
|
|
3131
|
-
const TextComponent = formComponents.text ?? script$
|
|
3132
|
-
const TextAreaComponent = formComponents.textArea ?? script$
|
|
3133
|
-
const EmailComponent = formComponents.email ?? script$
|
|
3134
|
-
const PhoneComponent = formComponents.phone ?? script$
|
|
3135
|
-
const NumberComponent = formComponents.number ?? script$
|
|
3136
|
-
const SelectComponent = formComponents.select ?? script$
|
|
3137
|
-
const PasswordComponent = formComponents.password ?? script$
|
|
3131
|
+
const TextComponent = formComponents.text ?? script$q;
|
|
3132
|
+
const TextAreaComponent = formComponents.textArea ?? script$p;
|
|
3133
|
+
const EmailComponent = formComponents.email ?? script$s;
|
|
3134
|
+
const PhoneComponent = formComponents.phone ?? script$v;
|
|
3135
|
+
const NumberComponent = formComponents.number ?? script$r;
|
|
3136
|
+
const SelectComponent = formComponents.select ?? script$o;
|
|
3137
|
+
const PasswordComponent = formComponents.password ?? script$n;
|
|
3138
3138
|
if(props.customComponents && props.customComponents[field]) {
|
|
3139
3139
|
return props.customComponents[field]
|
|
3140
3140
|
}
|
|
3141
3141
|
if(fieldObj.type){
|
|
3142
3142
|
if(fieldObj.type === 'suggest' || fieldObj.type === 'suggests'){
|
|
3143
|
-
return script$
|
|
3143
|
+
return script$u
|
|
3144
3144
|
}
|
|
3145
3145
|
return fieldObj.type === 'number' ? NumberComponent:fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type === 'password' ? PasswordComponent:fieldObj.type === 'select' ? SelectComponent:TextComponent
|
|
3146
3146
|
}else
|
|
@@ -3149,16 +3149,16 @@ const getFieldComponent = (fieldObj)=>{
|
|
|
3149
3149
|
}
|
|
3150
3150
|
else
|
|
3151
3151
|
if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
|
|
3152
|
-
return formComponents.textArea ?? script$
|
|
3152
|
+
return formComponents.textArea ?? script$p
|
|
3153
3153
|
} else
|
|
3154
3154
|
if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
|
|
3155
|
-
return formComponents.email ?? script$
|
|
3155
|
+
return formComponents.email ?? script$s
|
|
3156
3156
|
} else
|
|
3157
3157
|
if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
|
|
3158
|
-
return formComponents.phone ?? script$
|
|
3158
|
+
return formComponents.phone ?? script$v
|
|
3159
3159
|
} else
|
|
3160
3160
|
if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
|
|
3161
|
-
return formComponents.number ?? script$
|
|
3161
|
+
return formComponents.number ?? script$r
|
|
3162
3162
|
}
|
|
3163
3163
|
// else
|
|
3164
3164
|
// if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
|
|
@@ -3167,7 +3167,7 @@ const getFieldComponent = (fieldObj)=>{
|
|
|
3167
3167
|
// if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
|
|
3168
3168
|
// return formComponents.date ?? DateInput
|
|
3169
3169
|
// }
|
|
3170
|
-
return formComponents.text ?? script$
|
|
3170
|
+
return formComponents.text ?? script$q
|
|
3171
3171
|
};
|
|
3172
3172
|
const shFormElementClasses = ref(null);
|
|
3173
3173
|
shFormElementClasses.value = inject('shFormElementClasses');
|
|
@@ -3305,7 +3305,7 @@ onMounted((ev)=>{
|
|
|
3305
3305
|
|
|
3306
3306
|
return (_ctx, _cache) => {
|
|
3307
3307
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3308
|
-
_hoisted_1$
|
|
3308
|
+
_hoisted_1$j,
|
|
3309
3309
|
createElementVNode("form", {
|
|
3310
3310
|
class: normalizeClass([__props.formClass, "sh-form"]),
|
|
3311
3311
|
ref_key: "shAutoForm",
|
|
@@ -3391,12 +3391,12 @@ return (_ctx, _cache) => {
|
|
|
3391
3391
|
|
|
3392
3392
|
};
|
|
3393
3393
|
|
|
3394
|
-
script$
|
|
3394
|
+
script$m.__file = "src/lib/components/ShAutoForm.vue";
|
|
3395
3395
|
|
|
3396
|
-
const _hoisted_1$
|
|
3396
|
+
const _hoisted_1$i = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, "To prevent default class", -1 /* HOISTED */);
|
|
3397
3397
|
const _hoisted_2$a = { class: "dropdown" };
|
|
3398
3398
|
|
|
3399
|
-
var script$
|
|
3399
|
+
var script$l = {
|
|
3400
3400
|
__name: 'ShDropDownForm',
|
|
3401
3401
|
props: ['action',
|
|
3402
3402
|
'classes',
|
|
@@ -3426,7 +3426,7 @@ const dropdownId = 'rand' + (Math.random() + 1).toString(36).substring(2);
|
|
|
3426
3426
|
|
|
3427
3427
|
return (_ctx, _cache) => {
|
|
3428
3428
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
3429
|
-
_hoisted_1$
|
|
3429
|
+
_hoisted_1$i,
|
|
3430
3430
|
createElementVNode("div", _hoisted_2$a, [
|
|
3431
3431
|
createElementVNode("a", {
|
|
3432
3432
|
class: normalizeClass(unref(btnClass)),
|
|
@@ -3443,7 +3443,7 @@ return (_ctx, _cache) => {
|
|
|
3443
3443
|
class: "dropdown-menu px-2 py-1",
|
|
3444
3444
|
"aria-labelledby": dropdownId
|
|
3445
3445
|
}, [
|
|
3446
|
-
createVNode(script$
|
|
3446
|
+
createVNode(script$t, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
|
|
3447
3447
|
])
|
|
3448
3448
|
])
|
|
3449
3449
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -3452,9 +3452,9 @@ return (_ctx, _cache) => {
|
|
|
3452
3452
|
|
|
3453
3453
|
};
|
|
3454
3454
|
|
|
3455
|
-
script$
|
|
3455
|
+
script$l.__file = "src/lib/components/ShDropDownForm.vue";
|
|
3456
3456
|
|
|
3457
|
-
const _hoisted_1$
|
|
3457
|
+
const _hoisted_1$h = ["id"];
|
|
3458
3458
|
const _hoisted_2$9 = { class: "modal-content" };
|
|
3459
3459
|
const _hoisted_3$9 = { class: "modal-header" };
|
|
3460
3460
|
const _hoisted_4$9 = { class: "modal-title" };
|
|
@@ -3467,7 +3467,7 @@ const _hoisted_6$5 = { class: "modal-body" };
|
|
|
3467
3467
|
const _hoisted_7$4 = { class: "section" };
|
|
3468
3468
|
|
|
3469
3469
|
|
|
3470
|
-
var script$
|
|
3470
|
+
var script$k = {
|
|
3471
3471
|
__name: 'ShModal',
|
|
3472
3472
|
props: {
|
|
3473
3473
|
modalId: {
|
|
@@ -3524,17 +3524,17 @@ return (_ctx, _cache) => {
|
|
|
3524
3524
|
])
|
|
3525
3525
|
])
|
|
3526
3526
|
], 2 /* CLASS */)
|
|
3527
|
-
], 8 /* PROPS */, _hoisted_1$
|
|
3527
|
+
], 8 /* PROPS */, _hoisted_1$h))
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
3530
|
|
|
3531
3531
|
};
|
|
3532
3532
|
|
|
3533
|
-
script$
|
|
3533
|
+
script$k.__file = "src/lib/components/ShModal.vue";
|
|
3534
3534
|
|
|
3535
|
-
const _hoisted_1$
|
|
3535
|
+
const _hoisted_1$g = ["href"];
|
|
3536
3536
|
|
|
3537
|
-
var script$
|
|
3537
|
+
var script$j = {
|
|
3538
3538
|
__name: 'ShModalForm',
|
|
3539
3539
|
props: ['action',
|
|
3540
3540
|
'classes',
|
|
@@ -3573,13 +3573,13 @@ return (_ctx, _cache) => {
|
|
|
3573
3573
|
"data-bs-toggle": "modal"
|
|
3574
3574
|
}, [
|
|
3575
3575
|
renderSlot(_ctx.$slots, "default")
|
|
3576
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$
|
|
3577
|
-
createVNode(script$
|
|
3576
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$g),
|
|
3577
|
+
createVNode(script$k, {
|
|
3578
3578
|
"modal-id": modalId,
|
|
3579
3579
|
"modal-title": __props.modalTitle
|
|
3580
3580
|
}, {
|
|
3581
3581
|
default: withCtx(() => [
|
|
3582
|
-
createVNode(script$
|
|
3582
|
+
createVNode(script$t, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
|
|
3583
3583
|
]),
|
|
3584
3584
|
_: 1 /* STABLE */
|
|
3585
3585
|
}, 8 /* PROPS */, ["modal-title"])
|
|
@@ -3589,11 +3589,11 @@ return (_ctx, _cache) => {
|
|
|
3589
3589
|
|
|
3590
3590
|
};
|
|
3591
3591
|
|
|
3592
|
-
script$
|
|
3592
|
+
script$j.__file = "src/lib/components/ShModalForm.vue";
|
|
3593
3593
|
|
|
3594
|
-
const _hoisted_1$
|
|
3594
|
+
const _hoisted_1$f = ["href"];
|
|
3595
3595
|
|
|
3596
|
-
var script$
|
|
3596
|
+
var script$i = {
|
|
3597
3597
|
__name: 'ShModalFormAuto',
|
|
3598
3598
|
props: ['action',
|
|
3599
3599
|
'classes',
|
|
@@ -3633,13 +3633,13 @@ return (_ctx, _cache) => {
|
|
|
3633
3633
|
"data-bs-toggle": "modal"
|
|
3634
3634
|
}, [
|
|
3635
3635
|
renderSlot(_ctx.$slots, "default")
|
|
3636
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$
|
|
3637
|
-
createVNode(script$
|
|
3636
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$f),
|
|
3637
|
+
createVNode(script$k, {
|
|
3638
3638
|
"modal-id": modalId,
|
|
3639
3639
|
"modal-title": __props.modalTitle
|
|
3640
3640
|
}, {
|
|
3641
3641
|
default: withCtx(() => [
|
|
3642
|
-
createVNode(script$
|
|
3642
|
+
createVNode(script$m, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
|
|
3643
3643
|
]),
|
|
3644
3644
|
_: 1 /* STABLE */
|
|
3645
3645
|
}, 8 /* PROPS */, ["modal-title"])
|
|
@@ -3649,9 +3649,9 @@ return (_ctx, _cache) => {
|
|
|
3649
3649
|
|
|
3650
3650
|
};
|
|
3651
3651
|
|
|
3652
|
-
script$
|
|
3652
|
+
script$i.__file = "src/lib/components/ShModalFormAuto.vue";
|
|
3653
3653
|
|
|
3654
|
-
const _hoisted_1$
|
|
3654
|
+
const _hoisted_1$e = ["id"];
|
|
3655
3655
|
const _hoisted_2$8 = { class: "offcanvas-header" };
|
|
3656
3656
|
const _hoisted_3$8 = {
|
|
3657
3657
|
class: "offcanvas-title",
|
|
@@ -3659,7 +3659,7 @@ const _hoisted_3$8 = {
|
|
|
3659
3659
|
};
|
|
3660
3660
|
const _hoisted_4$8 = { class: "offcanvas-body" };
|
|
3661
3661
|
|
|
3662
|
-
var script$
|
|
3662
|
+
var script$h = {
|
|
3663
3663
|
__name: 'ShCanvas',
|
|
3664
3664
|
props: {
|
|
3665
3665
|
canvasId: {
|
|
@@ -3718,13 +3718,29 @@ return (_ctx, _cache) => {
|
|
|
3718
3718
|
createElementVNode("div", _hoisted_4$8, [
|
|
3719
3719
|
renderSlot(_ctx.$slots, "default")
|
|
3720
3720
|
])
|
|
3721
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$
|
|
3721
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$e))
|
|
3722
3722
|
}
|
|
3723
3723
|
}
|
|
3724
3724
|
|
|
3725
3725
|
};
|
|
3726
3726
|
|
|
3727
|
-
script$
|
|
3727
|
+
script$h.__file = "src/lib/components/ShCanvas.vue";
|
|
3728
|
+
|
|
3729
|
+
const _hoisted_1$d = { class: "callout callout-info" };
|
|
3730
|
+
|
|
3731
|
+
function render$1(_ctx, _cache) {
|
|
3732
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
3733
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
3734
|
+
createTextVNode(" No records found ")
|
|
3735
|
+
])
|
|
3736
|
+
]))
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
const script$g = {};
|
|
3740
|
+
|
|
3741
|
+
script$g.render = render$1;
|
|
3742
|
+
script$g.__scopeId = "data-v-55cf77fb";
|
|
3743
|
+
script$g.__file = "src/lib/components/others/NoRecords.vue";
|
|
3728
3744
|
|
|
3729
3745
|
var script$f = {
|
|
3730
3746
|
name: 'Pagination',
|
|
@@ -3845,7 +3861,7 @@ const _hoisted_23$1 = {
|
|
|
3845
3861
|
class: "spinner-border"
|
|
3846
3862
|
};
|
|
3847
3863
|
|
|
3848
|
-
function render
|
|
3864
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3849
3865
|
return ($props.paginationStyle !== 'loadMore')
|
|
3850
3866
|
? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
3851
3867
|
createElementVNode("div", _hoisted_2$7, [
|
|
@@ -3922,7 +3938,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3922
3938
|
]))
|
|
3923
3939
|
}
|
|
3924
3940
|
|
|
3925
|
-
script$f.render = render
|
|
3941
|
+
script$f.render = render;
|
|
3926
3942
|
script$f.__file = "src/lib/components/list_templates/Pagination.vue";
|
|
3927
3943
|
|
|
3928
3944
|
const _hoisted_1$b = /*#__PURE__*/createElementVNode("span", {
|
|
@@ -4315,309 +4331,6 @@ return (_ctx, _cache) => {
|
|
|
4315
4331
|
|
|
4316
4332
|
script$c.__file = "src/lib/components/ShRange.vue";
|
|
4317
4333
|
|
|
4318
|
-
var script$b = {
|
|
4319
|
-
name: 'sh-table',
|
|
4320
|
-
props: ['endPoint', 'headers','cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange'],
|
|
4321
|
-
data() {
|
|
4322
|
-
return {
|
|
4323
|
-
order_by: '',
|
|
4324
|
-
order_method: '',
|
|
4325
|
-
per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
|
|
4326
|
-
page: 1,
|
|
4327
|
-
exactMatch: false,
|
|
4328
|
-
filter_value: '',
|
|
4329
|
-
loading: 'loading',
|
|
4330
|
-
loading_error: '',
|
|
4331
|
-
records: [],
|
|
4332
|
-
total: 0,
|
|
4333
|
-
pagination_data: null,
|
|
4334
|
-
moreDetailsId: null,
|
|
4335
|
-
moreDetailsModel: null,
|
|
4336
|
-
downloading: false,
|
|
4337
|
-
appUrl: window.VITE_APP_API_URL,
|
|
4338
|
-
hasCanvas: 0,
|
|
4339
|
-
selectedRecord: null,
|
|
4340
|
-
timeOut: null,
|
|
4341
|
-
tableHeaders: [],
|
|
4342
|
-
pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'),
|
|
4343
|
-
range: null,
|
|
4344
|
-
from: null,
|
|
4345
|
-
to: null,
|
|
4346
|
-
period: null
|
|
4347
|
-
}
|
|
4348
|
-
},
|
|
4349
|
-
mounted() {
|
|
4350
|
-
if (this.headers) {
|
|
4351
|
-
this.tableHeaders = this.headers;
|
|
4352
|
-
}
|
|
4353
|
-
|
|
4354
|
-
if (this.actions && this.actions.actions) {
|
|
4355
|
-
this.actions.actions.forEach(action => {
|
|
4356
|
-
if (action.canvasComponent) {
|
|
4357
|
-
this.hasCanvas = true;
|
|
4358
|
-
}
|
|
4359
|
-
});
|
|
4360
|
-
}
|
|
4361
|
-
if(this.cacheKey){
|
|
4362
|
-
this.setCachedData();
|
|
4363
|
-
}
|
|
4364
|
-
this.reloadData();
|
|
4365
|
-
},
|
|
4366
|
-
methods: {
|
|
4367
|
-
rangeChanged: function (newRange) {
|
|
4368
|
-
this.range = newRange;
|
|
4369
|
-
this.from = newRange.from.format('L');
|
|
4370
|
-
this.to = newRange.to.format('L');
|
|
4371
|
-
this.period = newRange.period;
|
|
4372
|
-
this.reloadData();
|
|
4373
|
-
},
|
|
4374
|
-
userTyping: function () {
|
|
4375
|
-
if (this.timeOut) {
|
|
4376
|
-
clearTimeout(this.timeOut);
|
|
4377
|
-
}
|
|
4378
|
-
const self = this;
|
|
4379
|
-
this.timeOut = setTimeout(() => {
|
|
4380
|
-
self.reloadData(1);
|
|
4381
|
-
}, 800);
|
|
4382
|
-
},
|
|
4383
|
-
cleanCanvasProps: function (actions) {
|
|
4384
|
-
let replaced = actions;
|
|
4385
|
-
replaced.class = null;
|
|
4386
|
-
return replaced
|
|
4387
|
-
},
|
|
4388
|
-
newRecordAdded: function (ev) {
|
|
4389
|
-
const record = ev.log;
|
|
4390
|
-
if (record.user) {
|
|
4391
|
-
record.user = record.user.name;
|
|
4392
|
-
}
|
|
4393
|
-
this.records.unshift(record);
|
|
4394
|
-
},
|
|
4395
|
-
canvasClosed: function () {
|
|
4396
|
-
this.selectedRecord = null;
|
|
4397
|
-
},
|
|
4398
|
-
rowSelected: function (row) {
|
|
4399
|
-
this.selectedRecord = null;
|
|
4400
|
-
setTimeout(() => {
|
|
4401
|
-
this.selectedRecord = row;
|
|
4402
|
-
this.$emit('rowSelected', row);
|
|
4403
|
-
}, 100);
|
|
4404
|
-
},
|
|
4405
|
-
changeKey: function (key, value) {
|
|
4406
|
-
this[key] = value;
|
|
4407
|
-
if (key === 'order_by') {
|
|
4408
|
-
this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
|
|
4409
|
-
}
|
|
4410
|
-
if (key === 'per_page') {
|
|
4411
|
-
this.page = 1;
|
|
4412
|
-
}
|
|
4413
|
-
this.reloadData();
|
|
4414
|
-
},
|
|
4415
|
-
getLinkClass: function (config) {
|
|
4416
|
-
if (typeof config === 'object') {
|
|
4417
|
-
return config.class
|
|
4418
|
-
}
|
|
4419
|
-
return ''
|
|
4420
|
-
},
|
|
4421
|
-
reloadNotifications: function () {
|
|
4422
|
-
this.reloadData();
|
|
4423
|
-
},
|
|
4424
|
-
replaceActionUrl: function (path, obj) {
|
|
4425
|
-
if (path) {
|
|
4426
|
-
var matches = path.match(/\{(.*?)\}/g);
|
|
4427
|
-
try {
|
|
4428
|
-
matches.forEach(key => {
|
|
4429
|
-
key = key.replace('{', '');
|
|
4430
|
-
key = key.replace('}', '');
|
|
4431
|
-
path = path.replace(`{${key}}`, obj[key]);
|
|
4432
|
-
});
|
|
4433
|
-
return path
|
|
4434
|
-
} catch (e) {
|
|
4435
|
-
return path
|
|
4436
|
-
}
|
|
4437
|
-
}
|
|
4438
|
-
return ''
|
|
4439
|
-
},
|
|
4440
|
-
doEmitAction: function (action, data) {
|
|
4441
|
-
if (typeof action === 'function') {
|
|
4442
|
-
action(data);
|
|
4443
|
-
} else {
|
|
4444
|
-
this.$emit(action, data);
|
|
4445
|
-
}
|
|
4446
|
-
},
|
|
4447
|
-
getFieldType: function (field) {
|
|
4448
|
-
const numbers = ['age', 'interest_rate_pa'];
|
|
4449
|
-
const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
|
|
4450
|
-
const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
|
|
4451
|
-
if (numbers.includes(field)) {
|
|
4452
|
-
return 'numeric'
|
|
4453
|
-
}
|
|
4454
|
-
if (moneys.includes(field)) {
|
|
4455
|
-
return 'money'
|
|
4456
|
-
}
|
|
4457
|
-
if (dates.includes(field)) {
|
|
4458
|
-
return 'date'
|
|
4459
|
-
}
|
|
4460
|
-
return 'string'
|
|
4461
|
-
},
|
|
4462
|
-
replaceLinkUrl: function (path, obj) {
|
|
4463
|
-
if (typeof path === 'object') {
|
|
4464
|
-
path = path.link ?? path.url;
|
|
4465
|
-
}
|
|
4466
|
-
var matches = path.match(/\{(.*?)\}/g);
|
|
4467
|
-
matches && matches.forEach(key => {
|
|
4468
|
-
key = key.replace('{', '');
|
|
4469
|
-
key = key.replace('}', '');
|
|
4470
|
-
path = path.replace(`{${key}}`, obj[key]);
|
|
4471
|
-
});
|
|
4472
|
-
return path
|
|
4473
|
-
},
|
|
4474
|
-
formatDate: function (date) {
|
|
4475
|
-
return moment(date).format('lll')
|
|
4476
|
-
},
|
|
4477
|
-
setMoreDetailsModel: function (row) {
|
|
4478
|
-
this.moreDetailsModel = null;
|
|
4479
|
-
this.moreDetailsModel = row;
|
|
4480
|
-
},
|
|
4481
|
-
loadMoreRecords: function () {
|
|
4482
|
-
this.reloadData(this.page + 1, 1);
|
|
4483
|
-
},
|
|
4484
|
-
exportData: function (template) {
|
|
4485
|
-
this.downloading = true;
|
|
4486
|
-
const headers = [];
|
|
4487
|
-
const fields = this.downloadFields ? this.downloadFields : this.headers;
|
|
4488
|
-
fields.forEach(header => {
|
|
4489
|
-
if (typeof header === 'string') {
|
|
4490
|
-
headers.push(header);
|
|
4491
|
-
}
|
|
4492
|
-
});
|
|
4493
|
-
const data = {
|
|
4494
|
-
titles: headers,
|
|
4495
|
-
export: 1
|
|
4496
|
-
};
|
|
4497
|
-
shApis.doPost(this.endPoint, data).then(res => {
|
|
4498
|
-
this.downloading = false;
|
|
4499
|
-
if (res.data.file) {
|
|
4500
|
-
const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
|
|
4501
|
-
window.location.href = url;
|
|
4502
|
-
// window.open('https://facebook.com')
|
|
4503
|
-
// window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
|
|
4504
|
-
}
|
|
4505
|
-
}).catch(reason => {
|
|
4506
|
-
this.downloading = false;
|
|
4507
|
-
const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
|
|
4508
|
-
shRepo.swalError('Error', error);
|
|
4509
|
-
});
|
|
4510
|
-
},
|
|
4511
|
-
setCachedData: function () {
|
|
4512
|
-
if (this.cacheKey) {
|
|
4513
|
-
this.records = ShStorage.getItem('sh_table_cache_' + this.cacheKey, []);
|
|
4514
|
-
}
|
|
4515
|
-
},
|
|
4516
|
-
reloadData: function (page, append) {
|
|
4517
|
-
if (typeof page !== 'undefined') {
|
|
4518
|
-
this.page = page;
|
|
4519
|
-
}
|
|
4520
|
-
if (this.cacheKey && this.records && this.records.length > 0 && this.page < 2 ) {
|
|
4521
|
-
this.loading = 'done';
|
|
4522
|
-
} else if(!append){
|
|
4523
|
-
this.loading = 'loading';
|
|
4524
|
-
}
|
|
4525
|
-
const data = {
|
|
4526
|
-
order_by: this.order_by,
|
|
4527
|
-
order_method: this.order_method,
|
|
4528
|
-
per_page: this.per_page,
|
|
4529
|
-
page: this.page,
|
|
4530
|
-
filter_value: this.filter_value,
|
|
4531
|
-
paginated: true,
|
|
4532
|
-
from: this.from,
|
|
4533
|
-
to: this.to,
|
|
4534
|
-
period: this.period,
|
|
4535
|
-
exact: this.exactMatch
|
|
4536
|
-
};
|
|
4537
|
-
if (this.pagination_data) {
|
|
4538
|
-
this.pagination_data.loading = 1;
|
|
4539
|
-
}
|
|
4540
|
-
let endPoint = this.endPoint;
|
|
4541
|
-
if (!this.endPoint && this.query) {
|
|
4542
|
-
//send ql query
|
|
4543
|
-
endPoint = 'sh-ql';
|
|
4544
|
-
data.query = this.query;
|
|
4545
|
-
}
|
|
4546
|
-
shApis.doGet(endPoint, data).then(req => {
|
|
4547
|
-
this.$emit('dataReloaded', this.pagination_data);
|
|
4548
|
-
this.loading = 'done';
|
|
4549
|
-
const response = req.data.data;
|
|
4550
|
-
if(this.page < 2 && this.cacheKey){
|
|
4551
|
-
ShStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
|
|
4552
|
-
}
|
|
4553
|
-
this.pagination_data = {
|
|
4554
|
-
current: response.current_page,
|
|
4555
|
-
start: response.from,
|
|
4556
|
-
end: response.last_page,
|
|
4557
|
-
record_count: response.total,
|
|
4558
|
-
per_page: response.per_page,
|
|
4559
|
-
loading: 0,
|
|
4560
|
-
displayCount: response.total > response.per_page ? response.per_page : response.total
|
|
4561
|
-
};
|
|
4562
|
-
if (!this.headers && response.total > 0) {
|
|
4563
|
-
this.tableHeaders = Object.keys(response.data[0]);
|
|
4564
|
-
}
|
|
4565
|
-
if (append) {
|
|
4566
|
-
this.records.push(...response.data);
|
|
4567
|
-
let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
|
|
4568
|
-
if (totalShown > response.total) {
|
|
4569
|
-
totalShown = response.total;
|
|
4570
|
-
}
|
|
4571
|
-
this.pagination_data.displayCount = totalShown;
|
|
4572
|
-
const scrollingElement = (document.scrollingElement || document.body);
|
|
4573
|
-
scrollingElement.scrollTop = scrollingElement.scrollHeight;
|
|
4574
|
-
} else {
|
|
4575
|
-
this.records = response.data;
|
|
4576
|
-
}
|
|
4577
|
-
}).catch(reason => {
|
|
4578
|
-
const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.endPoint})`;
|
|
4579
|
-
this.loading_error = error;
|
|
4580
|
-
this.loading = 'error';
|
|
4581
|
-
});
|
|
4582
|
-
}
|
|
4583
|
-
},
|
|
4584
|
-
watch: {
|
|
4585
|
-
hideIds: {
|
|
4586
|
-
handler(newValue) {
|
|
4587
|
-
this.records = this.records.filter(record => !newValue.includes(record.id) && record);
|
|
4588
|
-
},
|
|
4589
|
-
deep: true
|
|
4590
|
-
},
|
|
4591
|
-
reload() {
|
|
4592
|
-
this.reloadData();
|
|
4593
|
-
},
|
|
4594
|
-
endPoint() {
|
|
4595
|
-
this.reloadData();
|
|
4596
|
-
}
|
|
4597
|
-
},
|
|
4598
|
-
components: {
|
|
4599
|
-
ShRange: script$c,
|
|
4600
|
-
ShSilentAction: script$d,
|
|
4601
|
-
ShConfirmAction: script$e,
|
|
4602
|
-
ShCanvas: script$g,
|
|
4603
|
-
pagination: script$f
|
|
4604
|
-
},
|
|
4605
|
-
computed: {
|
|
4606
|
-
windowWidth: function () {
|
|
4607
|
-
return window.innerWidth
|
|
4608
|
-
},
|
|
4609
|
-
user() {
|
|
4610
|
-
return null
|
|
4611
|
-
},
|
|
4612
|
-
hasDefaultSlot() {
|
|
4613
|
-
return !!this.$slots.default
|
|
4614
|
-
},
|
|
4615
|
-
hasRecordsSlot() {
|
|
4616
|
-
return !!this.$slots.records
|
|
4617
|
-
}
|
|
4618
|
-
}
|
|
4619
|
-
};
|
|
4620
|
-
|
|
4621
4334
|
const _hoisted_1$8 = { class: "auto-table mt-2" };
|
|
4622
4335
|
const _hoisted_2$5 = {
|
|
4623
4336
|
key: 0,
|
|
@@ -4663,40 +4376,39 @@ const _hoisted_16$1 = {
|
|
|
4663
4376
|
key: 1,
|
|
4664
4377
|
class: "alert alert-danger"
|
|
4665
4378
|
};
|
|
4666
|
-
const _hoisted_17$1 = {
|
|
4667
|
-
const _hoisted_18$1 = {
|
|
4379
|
+
const _hoisted_17$1 = {
|
|
4668
4380
|
key: 0,
|
|
4669
4381
|
class: "text-center"
|
|
4670
4382
|
};
|
|
4671
|
-
const
|
|
4383
|
+
const _hoisted_18$1 = /*#__PURE__*/createElementVNode("div", {
|
|
4672
4384
|
class: "spinner-border",
|
|
4673
4385
|
role: "status"
|
|
4674
4386
|
}, [
|
|
4675
4387
|
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
4676
4388
|
], -1 /* HOISTED */);
|
|
4677
|
-
const
|
|
4678
|
-
|
|
4389
|
+
const _hoisted_19 = [
|
|
4390
|
+
_hoisted_18$1
|
|
4679
4391
|
];
|
|
4680
|
-
const
|
|
4392
|
+
const _hoisted_20 = {
|
|
4681
4393
|
key: 1,
|
|
4682
4394
|
class: "alert alert-danger"
|
|
4683
4395
|
};
|
|
4684
|
-
const
|
|
4685
|
-
const
|
|
4396
|
+
const _hoisted_21 = /*#__PURE__*/createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
|
|
4397
|
+
const _hoisted_22 = { class: "sh-thead" };
|
|
4398
|
+
const _hoisted_23 = ["onClick"];
|
|
4686
4399
|
const _hoisted_24 = ["onClick"];
|
|
4687
4400
|
const _hoisted_25 = ["onClick"];
|
|
4688
|
-
const _hoisted_26 =
|
|
4689
|
-
const _hoisted_27 = {
|
|
4401
|
+
const _hoisted_26 = {
|
|
4690
4402
|
key: 0,
|
|
4691
4403
|
class: "text-capitalize"
|
|
4692
4404
|
};
|
|
4693
|
-
const
|
|
4694
|
-
const
|
|
4405
|
+
const _hoisted_27 = { class: "sh-tbody" };
|
|
4406
|
+
const _hoisted_28 = {
|
|
4695
4407
|
key: 0,
|
|
4696
4408
|
class: "text-center"
|
|
4697
4409
|
};
|
|
4698
|
-
const
|
|
4699
|
-
const
|
|
4410
|
+
const _hoisted_29 = ["colspan"];
|
|
4411
|
+
const _hoisted_30 = /*#__PURE__*/createElementVNode("div", { class: "text-center" }, [
|
|
4700
4412
|
/*#__PURE__*/createElementVNode("div", {
|
|
4701
4413
|
class: "spinner-border",
|
|
4702
4414
|
role: "status"
|
|
@@ -4704,42 +4416,42 @@ const _hoisted_31 = /*#__PURE__*/createElementVNode("div", { class: "text-center
|
|
|
4704
4416
|
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
4705
4417
|
])
|
|
4706
4418
|
], -1 /* HOISTED */);
|
|
4707
|
-
const
|
|
4708
|
-
|
|
4419
|
+
const _hoisted_31 = [
|
|
4420
|
+
_hoisted_30
|
|
4709
4421
|
];
|
|
4710
|
-
const
|
|
4422
|
+
const _hoisted_32 = {
|
|
4711
4423
|
key: 1,
|
|
4712
4424
|
class: "text-center alert alert-danger"
|
|
4713
4425
|
};
|
|
4714
|
-
const
|
|
4715
|
-
const
|
|
4426
|
+
const _hoisted_33 = ["colspan"];
|
|
4427
|
+
const _hoisted_34 = {
|
|
4716
4428
|
key: 2,
|
|
4717
4429
|
class: "text-center alert alert-info no_records"
|
|
4718
4430
|
};
|
|
4719
|
-
const
|
|
4720
|
-
const
|
|
4721
|
-
const
|
|
4722
|
-
const
|
|
4723
|
-
const
|
|
4431
|
+
const _hoisted_35 = ["colspan"];
|
|
4432
|
+
const _hoisted_36 = /*#__PURE__*/createElementVNode("i", { class: "bi-info-circle" }, null, -1 /* HOISTED */);
|
|
4433
|
+
const _hoisted_37 = ["onClick"];
|
|
4434
|
+
const _hoisted_38 = { key: 1 };
|
|
4435
|
+
const _hoisted_39 = {
|
|
4724
4436
|
key: 2,
|
|
4725
4437
|
class: "text-success fw-bold"
|
|
4726
4438
|
};
|
|
4727
|
-
const
|
|
4439
|
+
const _hoisted_40 = { key: 3 };
|
|
4440
|
+
const _hoisted_41 = ["innerHTML"];
|
|
4728
4441
|
const _hoisted_42 = ["innerHTML"];
|
|
4729
4442
|
const _hoisted_43 = ["innerHTML"];
|
|
4730
|
-
const _hoisted_44 =
|
|
4731
|
-
const _hoisted_45 = {
|
|
4443
|
+
const _hoisted_44 = {
|
|
4732
4444
|
key: 0,
|
|
4733
4445
|
style: {"white-space":"nowrap"}
|
|
4734
4446
|
};
|
|
4735
|
-
const
|
|
4736
|
-
const
|
|
4737
|
-
const
|
|
4738
|
-
const
|
|
4447
|
+
const _hoisted_45 = ["href"];
|
|
4448
|
+
const _hoisted_46 = ["title", "onClick"];
|
|
4449
|
+
const _hoisted_47 = { key: 5 };
|
|
4450
|
+
const _hoisted_48 = {
|
|
4739
4451
|
key: 0,
|
|
4740
4452
|
class: "text-center"
|
|
4741
4453
|
};
|
|
4742
|
-
const
|
|
4454
|
+
const _hoisted_49 = /*#__PURE__*/createElementVNode("div", { class: "text-center" }, [
|
|
4743
4455
|
/*#__PURE__*/createElementVNode("div", {
|
|
4744
4456
|
class: "spinner-border",
|
|
4745
4457
|
role: "status"
|
|
@@ -4747,58 +4459,362 @@ const _hoisted_50 = /*#__PURE__*/createElementVNode("div", { class: "text-center
|
|
|
4747
4459
|
/*#__PURE__*/createElementVNode("span", { class: "visually-hidden" }, "Loading...")
|
|
4748
4460
|
])
|
|
4749
4461
|
], -1 /* HOISTED */);
|
|
4750
|
-
const
|
|
4751
|
-
|
|
4462
|
+
const _hoisted_50 = [
|
|
4463
|
+
_hoisted_49
|
|
4752
4464
|
];
|
|
4753
|
-
const
|
|
4754
|
-
const
|
|
4465
|
+
const _hoisted_51 = { key: 1 };
|
|
4466
|
+
const _hoisted_52 = {
|
|
4755
4467
|
key: 2,
|
|
4756
4468
|
class: "mobile-list-items"
|
|
4757
4469
|
};
|
|
4758
|
-
const
|
|
4759
|
-
const
|
|
4470
|
+
const _hoisted_53 = ["onClick"];
|
|
4471
|
+
const _hoisted_54 = {
|
|
4760
4472
|
key: 0,
|
|
4761
4473
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
4762
4474
|
};
|
|
4763
|
-
const
|
|
4475
|
+
const _hoisted_55 = {
|
|
4764
4476
|
key: 1,
|
|
4765
4477
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
4766
4478
|
};
|
|
4767
|
-
const
|
|
4479
|
+
const _hoisted_56 = {
|
|
4768
4480
|
key: 2,
|
|
4769
4481
|
class: "mb-1 font-weight-bold text-capitalize profile-form-title"
|
|
4770
4482
|
};
|
|
4771
|
-
const
|
|
4772
|
-
const
|
|
4483
|
+
const _hoisted_57 = { key: 1 };
|
|
4484
|
+
const _hoisted_58 = {
|
|
4773
4485
|
key: 2,
|
|
4774
4486
|
class: "text-primary fw-bold"
|
|
4775
4487
|
};
|
|
4776
|
-
const
|
|
4488
|
+
const _hoisted_59 = { key: 3 };
|
|
4489
|
+
const _hoisted_60 = ["innerHTML"];
|
|
4777
4490
|
const _hoisted_61 = ["innerHTML"];
|
|
4778
4491
|
const _hoisted_62 = ["innerHTML"];
|
|
4779
|
-
const _hoisted_63 =
|
|
4780
|
-
const _hoisted_64 =
|
|
4781
|
-
const _hoisted_65 =
|
|
4782
|
-
const _hoisted_66 = ["
|
|
4783
|
-
|
|
4492
|
+
const _hoisted_63 = /*#__PURE__*/createElementVNode("hr", { class: "my-2" }, null, -1 /* HOISTED */);
|
|
4493
|
+
const _hoisted_64 = { key: 0 };
|
|
4494
|
+
const _hoisted_65 = ["href"];
|
|
4495
|
+
const _hoisted_66 = ["title", "onClick"];
|
|
4496
|
+
|
|
4497
|
+
const __default__ = {
|
|
4498
|
+
name: 'sh-table',
|
|
4499
|
+
props: ['endPoint', 'headers', 'cacheKey', 'query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle', 'hasRange','noRecordsMessage'],
|
|
4500
|
+
data(){
|
|
4501
|
+
return {
|
|
4502
|
+
order_by: '',
|
|
4503
|
+
order_method: '',
|
|
4504
|
+
per_page: this.pageCount ?? shRepo.getShConfig('tablePerPage', 10),
|
|
4505
|
+
page: 1,
|
|
4506
|
+
exactMatch: false,
|
|
4507
|
+
filter_value: '',
|
|
4508
|
+
loading: 'loading',
|
|
4509
|
+
loading_error: '',
|
|
4510
|
+
records: [],
|
|
4511
|
+
total: 0,
|
|
4512
|
+
pagination_data: null,
|
|
4513
|
+
moreDetailsId: null,
|
|
4514
|
+
moreDetailsModel: null,
|
|
4515
|
+
downloading: false,
|
|
4516
|
+
appUrl: window.VITE_APP_API_URL,
|
|
4517
|
+
hasCanvas: 0,
|
|
4518
|
+
selectedRecord: null,
|
|
4519
|
+
timeOut: null,
|
|
4520
|
+
tableHeaders: [],
|
|
4521
|
+
pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle', 'loadMore'),
|
|
4522
|
+
range: null,
|
|
4523
|
+
from: null,
|
|
4524
|
+
to: null,
|
|
4525
|
+
period: null
|
|
4526
|
+
}
|
|
4527
|
+
},
|
|
4528
|
+
mounted(){
|
|
4529
|
+
if (this.headers) {
|
|
4530
|
+
this.tableHeaders = this.headers;
|
|
4531
|
+
}
|
|
4784
4532
|
|
|
4785
|
-
|
|
4786
|
-
|
|
4533
|
+
if (this.actions && this.actions.actions) {
|
|
4534
|
+
this.actions.actions.forEach(action => {
|
|
4535
|
+
if (action.canvasComponent) {
|
|
4536
|
+
this.hasCanvas = true;
|
|
4537
|
+
}
|
|
4538
|
+
});
|
|
4539
|
+
}
|
|
4540
|
+
if (this.cacheKey) {
|
|
4541
|
+
this.setCachedData();
|
|
4542
|
+
}
|
|
4543
|
+
this.reloadData();
|
|
4544
|
+
},
|
|
4545
|
+
methods: {
|
|
4546
|
+
rangeChanged: function (newRange){
|
|
4547
|
+
this.range = newRange;
|
|
4548
|
+
this.from = newRange.from.format('L');
|
|
4549
|
+
this.to = newRange.to.format('L');
|
|
4550
|
+
this.period = newRange.period;
|
|
4551
|
+
this.reloadData();
|
|
4552
|
+
},
|
|
4553
|
+
userTyping: function (){
|
|
4554
|
+
if (this.timeOut) {
|
|
4555
|
+
clearTimeout(this.timeOut);
|
|
4556
|
+
}
|
|
4557
|
+
const self = this;
|
|
4558
|
+
this.timeOut = setTimeout(() => {
|
|
4559
|
+
self.reloadData(1);
|
|
4560
|
+
}, 800);
|
|
4561
|
+
},
|
|
4562
|
+
cleanCanvasProps: function (actions){
|
|
4563
|
+
let replaced = actions;
|
|
4564
|
+
replaced.class = null;
|
|
4565
|
+
return replaced
|
|
4566
|
+
},
|
|
4567
|
+
newRecordAdded: function (ev){
|
|
4568
|
+
const record = ev.log;
|
|
4569
|
+
if (record.user) {
|
|
4570
|
+
record.user = record.user.name;
|
|
4571
|
+
}
|
|
4572
|
+
this.records.unshift(record);
|
|
4573
|
+
},
|
|
4574
|
+
canvasClosed: function (){
|
|
4575
|
+
this.selectedRecord = null;
|
|
4576
|
+
},
|
|
4577
|
+
rowSelected: function (row){
|
|
4578
|
+
this.selectedRecord = null;
|
|
4579
|
+
setTimeout(() => {
|
|
4580
|
+
this.selectedRecord = row;
|
|
4581
|
+
this.$emit('rowSelected', row);
|
|
4582
|
+
}, 100);
|
|
4583
|
+
},
|
|
4584
|
+
changeKey: function (key, value){
|
|
4585
|
+
this[key] = value;
|
|
4586
|
+
if (key === 'order_by') {
|
|
4587
|
+
this.order_method = (this.order_method === 'desc') ? 'asc' : 'desc';
|
|
4588
|
+
}
|
|
4589
|
+
if (key === 'per_page') {
|
|
4590
|
+
this.page = 1;
|
|
4591
|
+
}
|
|
4592
|
+
this.reloadData();
|
|
4593
|
+
},
|
|
4594
|
+
getLinkClass: function (config){
|
|
4595
|
+
if (typeof config === 'object') {
|
|
4596
|
+
return config.class
|
|
4597
|
+
}
|
|
4598
|
+
return ''
|
|
4599
|
+
},
|
|
4600
|
+
reloadNotifications: function (){
|
|
4601
|
+
this.reloadData();
|
|
4602
|
+
},
|
|
4603
|
+
replaceActionUrl: function (path, obj){
|
|
4604
|
+
if (path) {
|
|
4605
|
+
var matches = path.match(/\{(.*?)\}/g);
|
|
4606
|
+
try {
|
|
4607
|
+
matches.forEach(key => {
|
|
4608
|
+
key = key.replace('{', '');
|
|
4609
|
+
key = key.replace('}', '');
|
|
4610
|
+
path = path.replace(`{${key}}`, obj[key]);
|
|
4611
|
+
});
|
|
4612
|
+
return path
|
|
4613
|
+
} catch (e) {
|
|
4614
|
+
return path
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
return ''
|
|
4618
|
+
},
|
|
4619
|
+
doEmitAction: function (action, data){
|
|
4620
|
+
if (typeof action === 'function') {
|
|
4621
|
+
action(data);
|
|
4622
|
+
} else {
|
|
4623
|
+
this.$emit(action, data);
|
|
4624
|
+
}
|
|
4625
|
+
},
|
|
4626
|
+
getFieldType: function (field){
|
|
4627
|
+
const numbers = ['age', 'interest_rate_pa'];
|
|
4628
|
+
const moneys = ['amount', 'paid_amount', 'total_paid', 'total', 'monthly_fee', 'share_cost', 'min_contribution', 'min_membership_contribution'];
|
|
4629
|
+
const dates = ['invoice_date', 'free_tier_days', 'updated_at', 'created_at', 'end_time'];
|
|
4630
|
+
if (numbers.includes(field)) {
|
|
4631
|
+
return 'numeric'
|
|
4632
|
+
}
|
|
4633
|
+
if (moneys.includes(field)) {
|
|
4634
|
+
return 'money'
|
|
4635
|
+
}
|
|
4636
|
+
if (dates.includes(field)) {
|
|
4637
|
+
return 'date'
|
|
4638
|
+
}
|
|
4639
|
+
return 'string'
|
|
4640
|
+
},
|
|
4641
|
+
replaceLinkUrl: function (path, obj){
|
|
4642
|
+
if (typeof path === 'object') {
|
|
4643
|
+
path = path.link ?? path.url;
|
|
4644
|
+
}
|
|
4645
|
+
var matches = path.match(/\{(.*?)\}/g);
|
|
4646
|
+
matches && matches.forEach(key => {
|
|
4647
|
+
key = key.replace('{', '');
|
|
4648
|
+
key = key.replace('}', '');
|
|
4649
|
+
path = path.replace(`{${key}}`, obj[key]);
|
|
4650
|
+
});
|
|
4651
|
+
return path
|
|
4652
|
+
},
|
|
4653
|
+
formatDate: function (date){
|
|
4654
|
+
return moment(date).format('lll')
|
|
4655
|
+
},
|
|
4656
|
+
setMoreDetailsModel: function (row){
|
|
4657
|
+
this.moreDetailsModel = null;
|
|
4658
|
+
this.moreDetailsModel = row;
|
|
4659
|
+
},
|
|
4660
|
+
loadMoreRecords: function (){
|
|
4661
|
+
this.reloadData(this.page + 1, 1);
|
|
4662
|
+
},
|
|
4663
|
+
exportData: function (template){
|
|
4664
|
+
this.downloading = true;
|
|
4665
|
+
const headers = [];
|
|
4666
|
+
const fields = this.downloadFields ? this.downloadFields : this.headers;
|
|
4667
|
+
fields.forEach(header => {
|
|
4668
|
+
if (typeof header === 'string') {
|
|
4669
|
+
headers.push(header);
|
|
4670
|
+
}
|
|
4671
|
+
});
|
|
4672
|
+
const data = {
|
|
4673
|
+
titles: headers,
|
|
4674
|
+
export: 1
|
|
4675
|
+
};
|
|
4676
|
+
shApis.doPost(this.endPoint, data).then(res => {
|
|
4677
|
+
this.downloading = false;
|
|
4678
|
+
if (res.data.file) {
|
|
4679
|
+
const url = this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name;
|
|
4680
|
+
window.location.href = url;
|
|
4681
|
+
// window.open('https://facebook.com')
|
|
4682
|
+
// window.open(this.appUrl + 'external-download?file=' + res.data.file + '&name=' + res.data.name, '_blank').focus()
|
|
4683
|
+
}
|
|
4684
|
+
}).catch(reason => {
|
|
4685
|
+
this.downloading = false;
|
|
4686
|
+
const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText}`;
|
|
4687
|
+
shRepo.swalError('Error', error);
|
|
4688
|
+
});
|
|
4689
|
+
},
|
|
4690
|
+
setCachedData: function (){
|
|
4691
|
+
if (this.cacheKey) {
|
|
4692
|
+
this.records = ShStorage.getItem('sh_table_cache_' + this.cacheKey, []);
|
|
4693
|
+
}
|
|
4694
|
+
},
|
|
4695
|
+
reloadData: function (page, append){
|
|
4696
|
+
if (typeof page !== 'undefined') {
|
|
4697
|
+
this.page = page;
|
|
4698
|
+
}
|
|
4699
|
+
if (this.cacheKey && this.records && this.page < 2) {
|
|
4700
|
+
this.loading = 'done';
|
|
4701
|
+
} else if (!append) {
|
|
4702
|
+
this.loading = 'loading';
|
|
4703
|
+
}
|
|
4704
|
+
const data = {
|
|
4705
|
+
order_by: this.order_by,
|
|
4706
|
+
order_method: this.order_method,
|
|
4707
|
+
per_page: this.per_page,
|
|
4708
|
+
page: this.page,
|
|
4709
|
+
filter_value: this.filter_value,
|
|
4710
|
+
paginated: true,
|
|
4711
|
+
from: this.from,
|
|
4712
|
+
to: this.to,
|
|
4713
|
+
period: this.period,
|
|
4714
|
+
exact: this.exactMatch
|
|
4715
|
+
};
|
|
4716
|
+
if (this.pagination_data) {
|
|
4717
|
+
this.pagination_data.loading = 1;
|
|
4718
|
+
}
|
|
4719
|
+
let endPoint = this.endPoint;
|
|
4720
|
+
if (!this.endPoint && this.query) {
|
|
4721
|
+
//send ql query
|
|
4722
|
+
endPoint = 'sh-ql';
|
|
4723
|
+
data.query = this.query;
|
|
4724
|
+
}
|
|
4725
|
+
shApis.doGet(endPoint, data).then(req => {
|
|
4726
|
+
this.$emit('dataReloaded', this.pagination_data);
|
|
4727
|
+
this.loading = 'done';
|
|
4728
|
+
const response = req.data.data;
|
|
4729
|
+
if (this.page < 2 && this.cacheKey) {
|
|
4730
|
+
ShStorage.setItem('sh_table_cache_' + this.cacheKey, response.data);
|
|
4731
|
+
}
|
|
4732
|
+
this.pagination_data = {
|
|
4733
|
+
current: response.current_page,
|
|
4734
|
+
start: response.from,
|
|
4735
|
+
end: response.last_page,
|
|
4736
|
+
record_count: response.total,
|
|
4737
|
+
per_page: response.per_page,
|
|
4738
|
+
loading: 0,
|
|
4739
|
+
displayCount: response.total > response.per_page ? response.per_page : response.total
|
|
4740
|
+
};
|
|
4741
|
+
if (!this.headers && response.total > 0) {
|
|
4742
|
+
this.tableHeaders = Object.keys(response.data[0]);
|
|
4743
|
+
}
|
|
4744
|
+
if (append) {
|
|
4745
|
+
this.records.push(...response.data);
|
|
4746
|
+
let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
|
|
4747
|
+
if (totalShown > response.total) {
|
|
4748
|
+
totalShown = response.total;
|
|
4749
|
+
}
|
|
4750
|
+
this.pagination_data.displayCount = totalShown;
|
|
4751
|
+
const scrollingElement = (document.scrollingElement || document.body);
|
|
4752
|
+
scrollingElement.scrollTop = scrollingElement.scrollHeight;
|
|
4753
|
+
} else {
|
|
4754
|
+
this.records = response.data;
|
|
4755
|
+
}
|
|
4756
|
+
}).catch(reason => {
|
|
4757
|
+
const error = (typeof reason.response === 'undefined') ? 'Error getting data from backend' : `${reason.response.status}:${reason.response.statusText} (${this.endPoint})`;
|
|
4758
|
+
this.loading_error = error;
|
|
4759
|
+
this.loading = 'error';
|
|
4760
|
+
});
|
|
4761
|
+
}
|
|
4762
|
+
},
|
|
4763
|
+
watch: {
|
|
4764
|
+
hideIds: {
|
|
4765
|
+
handler(newValue){
|
|
4766
|
+
this.records = this.records.filter(record => !newValue.includes(record.id) && record);
|
|
4767
|
+
},
|
|
4768
|
+
deep: true
|
|
4769
|
+
},
|
|
4770
|
+
reload(){
|
|
4771
|
+
this.reloadData();
|
|
4772
|
+
},
|
|
4773
|
+
endPoint(){
|
|
4774
|
+
this.reloadData();
|
|
4775
|
+
}
|
|
4776
|
+
},
|
|
4777
|
+
components: {
|
|
4778
|
+
ShRange: script$c,
|
|
4779
|
+
ShSilentAction: script$d,
|
|
4780
|
+
ShConfirmAction: script$e,
|
|
4781
|
+
ShCanvas: script$h,
|
|
4782
|
+
pagination: script$f
|
|
4783
|
+
},
|
|
4784
|
+
computed: {
|
|
4785
|
+
windowWidth: function (){
|
|
4786
|
+
return window.innerWidth
|
|
4787
|
+
},
|
|
4788
|
+
user(){
|
|
4789
|
+
return null
|
|
4790
|
+
},
|
|
4791
|
+
hasDefaultSlot(){
|
|
4792
|
+
return !!this.$slots.default
|
|
4793
|
+
},
|
|
4794
|
+
hasRecordsSlot(){
|
|
4795
|
+
return !!this.$slots.records
|
|
4796
|
+
}
|
|
4797
|
+
}
|
|
4798
|
+
};
|
|
4799
|
+
|
|
4800
|
+
|
|
4801
|
+
var script$b = /*#__PURE__*/Object.assign(__default__, {
|
|
4802
|
+
setup(__props) {
|
|
4803
|
+
|
|
4804
|
+
const noRecordsComponent = inject('noRecordsComponent', script$g);
|
|
4805
|
+
|
|
4806
|
+
return (_ctx, _cache) => {
|
|
4787
4807
|
const _component_router_link = resolveComponent("router-link");
|
|
4788
|
-
const _component_sh_confirm_action = resolveComponent("sh-confirm-action");
|
|
4789
|
-
const _component_sh_silent_action = resolveComponent("sh-silent-action");
|
|
4790
|
-
const _component_pagination = resolveComponent("pagination");
|
|
4791
|
-
const _component_sh_canvas = resolveComponent("sh-canvas");
|
|
4792
4808
|
|
|
4793
4809
|
return (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
4794
|
-
(
|
|
4810
|
+
(__props.hasDownload)
|
|
4795
4811
|
? (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
4796
4812
|
createElementVNode("button", {
|
|
4797
|
-
disabled:
|
|
4813
|
+
disabled: _ctx.downloading,
|
|
4798
4814
|
class: "btn btn-warning btn-sm",
|
|
4799
|
-
onClick: _cache[0] || (_cache[0] = $event => (
|
|
4815
|
+
onClick: _cache[0] || (_cache[0] = $event => (_ctx.exportData()))
|
|
4800
4816
|
}, [
|
|
4801
|
-
(
|
|
4817
|
+
(!_ctx.downloading)
|
|
4802
4818
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4803
4819
|
_hoisted_4$5,
|
|
4804
4820
|
createTextVNode(" Export ")
|
|
@@ -4810,37 +4826,37 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4810
4826
|
], 8 /* PROPS */, _hoisted_3$5)
|
|
4811
4827
|
]))
|
|
4812
4828
|
: createCommentVNode("v-if", true),
|
|
4813
|
-
(
|
|
4829
|
+
(!__props.hideSearch)
|
|
4814
4830
|
? (openBlock(), createElementBlock("div", _hoisted_7$2, [
|
|
4815
4831
|
createElementVNode("div", _hoisted_8$2, [
|
|
4816
|
-
(
|
|
4832
|
+
(__props.hasRange)
|
|
4817
4833
|
? (openBlock(), createElementBlock("div", _hoisted_9$2, [
|
|
4818
|
-
createVNode(
|
|
4834
|
+
createVNode(script$c, { onRangeSelected: _ctx.rangeChanged }, null, 8 /* PROPS */, ["onRangeSelected"])
|
|
4819
4835
|
]))
|
|
4820
4836
|
: createCommentVNode("v-if", true),
|
|
4821
4837
|
createElementVNode("div", {
|
|
4822
|
-
class: normalizeClass(["sh-search-bar input-group",
|
|
4838
|
+
class: normalizeClass(["sh-search-bar input-group", __props.hasRange ? 'ms-2':''])
|
|
4823
4839
|
}, [
|
|
4824
4840
|
withDirectives(createElementVNode("input", {
|
|
4825
|
-
onKeydown: _cache[1] || (_cache[1] = (...args) => (
|
|
4826
|
-
onKeyup: _cache[2] || (_cache[2] = (...args) => (
|
|
4841
|
+
onKeydown: _cache[1] || (_cache[1] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
|
|
4842
|
+
onKeyup: _cache[2] || (_cache[2] = (...args) => (_ctx.userTyping && _ctx.userTyping(...args))),
|
|
4827
4843
|
type: "search",
|
|
4828
|
-
onChange: _cache[3] || (_cache[3] = $event => (
|
|
4829
|
-
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((
|
|
4830
|
-
placeholder:
|
|
4844
|
+
onChange: _cache[3] || (_cache[3] = $event => (_ctx.reloadData(1))),
|
|
4845
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = $event => ((_ctx.filter_value) = $event)),
|
|
4846
|
+
placeholder: __props.searchPlaceholder ? __props.searchPlaceholder : 'Search',
|
|
4831
4847
|
class: "form-control sh-search-input"
|
|
4832
4848
|
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_10$1), [
|
|
4833
|
-
[vModelText,
|
|
4849
|
+
[vModelText, _ctx.filter_value]
|
|
4834
4850
|
]),
|
|
4835
|
-
(
|
|
4851
|
+
(_ctx.filter_value.length > 1)
|
|
4836
4852
|
? (openBlock(), createElementBlock("span", _hoisted_11$1, [
|
|
4837
4853
|
withDirectives(createElementVNode("input", {
|
|
4838
|
-
onChange: _cache[5] || (_cache[5] = (...args) => (
|
|
4854
|
+
onChange: _cache[5] || (_cache[5] = (...args) => (_ctx.reloadData && _ctx.reloadData(...args))),
|
|
4839
4855
|
value: true,
|
|
4840
|
-
"onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ((
|
|
4856
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = $event => ((_ctx.exactMatch) = $event)),
|
|
4841
4857
|
type: "checkbox"
|
|
4842
4858
|
}, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */), [
|
|
4843
|
-
[vModelCheckbox,
|
|
4859
|
+
[vModelCheckbox, _ctx.exactMatch]
|
|
4844
4860
|
]),
|
|
4845
4861
|
_hoisted_12$1
|
|
4846
4862
|
]))
|
|
@@ -4849,17 +4865,17 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4849
4865
|
])
|
|
4850
4866
|
]))
|
|
4851
4867
|
: createCommentVNode("v-if", true),
|
|
4852
|
-
(
|
|
4868
|
+
(_ctx.hasDefaultSlot)
|
|
4853
4869
|
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4854
|
-
(
|
|
4870
|
+
(_ctx.loading === 'loading')
|
|
4855
4871
|
? (openBlock(), createElementBlock("div", _hoisted_13$1, _hoisted_15$1))
|
|
4856
|
-
: (
|
|
4872
|
+
: (_ctx.loading === 'error')
|
|
4857
4873
|
? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
4858
|
-
createElementVNode("span",
|
|
4874
|
+
createElementVNode("span", null, toDisplayString(_ctx.loading_error), 1 /* TEXT */)
|
|
4859
4875
|
]))
|
|
4860
4876
|
: createCommentVNode("v-if", true),
|
|
4861
|
-
(
|
|
4862
|
-
? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(
|
|
4877
|
+
(_ctx.loading === 'done')
|
|
4878
|
+
? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.records, (record) => {
|
|
4863
4879
|
return renderSlot(_ctx.$slots, "default", {
|
|
4864
4880
|
key: record.id,
|
|
4865
4881
|
record: record
|
|
@@ -4867,137 +4883,145 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4867
4883
|
}), 128 /* KEYED_FRAGMENT */))
|
|
4868
4884
|
: createCommentVNode("v-if", true)
|
|
4869
4885
|
], 64 /* STABLE_FRAGMENT */))
|
|
4870
|
-
: (
|
|
4886
|
+
: (_ctx.hasRecordsSlot)
|
|
4871
4887
|
? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
4872
|
-
(
|
|
4873
|
-
? (openBlock(), createElementBlock("div",
|
|
4874
|
-
: (
|
|
4875
|
-
? (openBlock(), createElementBlock("div",
|
|
4876
|
-
createElementVNode("span",
|
|
4888
|
+
(_ctx.loading === 'loading')
|
|
4889
|
+
? (openBlock(), createElementBlock("div", _hoisted_17$1, _hoisted_19))
|
|
4890
|
+
: (_ctx.loading === 'error')
|
|
4891
|
+
? (openBlock(), createElementBlock("div", _hoisted_20, [
|
|
4892
|
+
createElementVNode("span", null, toDisplayString(_ctx.loading_error), 1 /* TEXT */)
|
|
4877
4893
|
]))
|
|
4878
4894
|
: createCommentVNode("v-if", true),
|
|
4879
|
-
(
|
|
4880
|
-
?
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4895
|
+
(_ctx.loading === 'done')
|
|
4896
|
+
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
4897
|
+
(_ctx.records.length === 0)
|
|
4898
|
+
? (openBlock(), createBlock(resolveDynamicComponent(unref(noRecordsComponent)), { key: 0 }, {
|
|
4899
|
+
default: withCtx(() => [
|
|
4900
|
+
_hoisted_21,
|
|
4901
|
+
createTextVNode(" " + toDisplayString(__props.noRecordsMessage ?? 'No records found'), 1 /* TEXT */)
|
|
4902
|
+
]),
|
|
4903
|
+
_: 1 /* STABLE */
|
|
4904
|
+
}))
|
|
4905
|
+
: createCommentVNode("v-if", true),
|
|
4906
|
+
renderSlot(_ctx.$slots, "records", { records: _ctx.records })
|
|
4907
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
4884
4908
|
: createCommentVNode("v-if", true)
|
|
4885
4909
|
], 64 /* STABLE_FRAGMENT */))
|
|
4886
|
-
: (
|
|
4910
|
+
: (_ctx.windowWidth > 700)
|
|
4887
4911
|
? (openBlock(), createElementBlock("table", {
|
|
4888
4912
|
key: 4,
|
|
4889
|
-
class: normalizeClass(["table sh-table",
|
|
4913
|
+
class: normalizeClass(["table sh-table", __props.tableHover ? 'table-hover':''])
|
|
4890
4914
|
}, [
|
|
4891
|
-
createElementVNode("thead",
|
|
4915
|
+
createElementVNode("thead", _hoisted_22, [
|
|
4892
4916
|
createElementVNode("tr", null, [
|
|
4893
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
4917
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tableHeaders, (title) => {
|
|
4894
4918
|
return (openBlock(), createElementBlock("th", { key: title }, [
|
|
4895
4919
|
(typeof title === 'string')
|
|
4896
4920
|
? (openBlock(), createElementBlock("a", {
|
|
4897
4921
|
key: 0,
|
|
4898
4922
|
class: "text-capitalize",
|
|
4899
|
-
onClick: $event => (
|
|
4900
|
-
}, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */,
|
|
4923
|
+
onClick: $event => (_ctx.changeKey('order_by',title))
|
|
4924
|
+
}, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_23))
|
|
4901
4925
|
: (typeof title === 'function')
|
|
4902
4926
|
? (openBlock(), createElementBlock("a", {
|
|
4903
4927
|
key: 1,
|
|
4904
4928
|
class: "text-capitalize",
|
|
4905
|
-
onClick: $event => (
|
|
4906
|
-
}, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */,
|
|
4929
|
+
onClick: $event => (_ctx.changeKey('order_by',title(null)))
|
|
4930
|
+
}, toDisplayString(title(null).replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_24))
|
|
4907
4931
|
: (typeof title !== 'undefined')
|
|
4908
4932
|
? (openBlock(), createElementBlock("a", {
|
|
4909
4933
|
key: 2,
|
|
4910
4934
|
class: "text-capitalize",
|
|
4911
|
-
onClick: $event => (
|
|
4912
|
-
}, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */,
|
|
4935
|
+
onClick: $event => (_ctx.changeKey('order_by',title))
|
|
4936
|
+
}, toDisplayString(title.replace(/_/g, ' ')), 9 /* TEXT, PROPS */, _hoisted_25))
|
|
4913
4937
|
: createCommentVNode("v-if", true)
|
|
4914
4938
|
]))
|
|
4915
4939
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
4916
|
-
(
|
|
4917
|
-
? (openBlock(), createElementBlock("th",
|
|
4940
|
+
(__props.actions)
|
|
4941
|
+
? (openBlock(), createElementBlock("th", _hoisted_26, toDisplayString(__props.actions.label), 1 /* TEXT */))
|
|
4918
4942
|
: createCommentVNode("v-if", true)
|
|
4919
4943
|
])
|
|
4920
4944
|
]),
|
|
4921
|
-
createElementVNode("tbody",
|
|
4922
|
-
(
|
|
4923
|
-
? (openBlock(), createElementBlock("tr",
|
|
4945
|
+
createElementVNode("tbody", _hoisted_27, [
|
|
4946
|
+
(_ctx.loading === 'loading')
|
|
4947
|
+
? (openBlock(), createElementBlock("tr", _hoisted_28, [
|
|
4924
4948
|
createElementVNode("td", {
|
|
4925
|
-
colspan:
|
|
4926
|
-
},
|
|
4949
|
+
colspan: _ctx.tableHeaders.length
|
|
4950
|
+
}, _hoisted_31, 8 /* PROPS */, _hoisted_29)
|
|
4927
4951
|
]))
|
|
4928
|
-
: (
|
|
4929
|
-
? (openBlock(), createElementBlock("tr",
|
|
4952
|
+
: (_ctx.loading === 'error')
|
|
4953
|
+
? (openBlock(), createElementBlock("tr", _hoisted_32, [
|
|
4930
4954
|
createElementVNode("td", {
|
|
4931
|
-
colspan:
|
|
4932
|
-
}, toDisplayString(
|
|
4955
|
+
colspan: _ctx.tableHeaders.length
|
|
4956
|
+
}, toDisplayString(_ctx.loading_error), 9 /* TEXT, PROPS */, _hoisted_33)
|
|
4933
4957
|
]))
|
|
4934
|
-
: (
|
|
4935
|
-
? (openBlock(), createElementBlock("tr",
|
|
4958
|
+
: (_ctx.records.length === 0)
|
|
4959
|
+
? (openBlock(), createElementBlock("tr", _hoisted_34, [
|
|
4936
4960
|
createElementVNode("td", {
|
|
4937
|
-
colspan:
|
|
4961
|
+
colspan: __props.actions ? _ctx.tableHeaders.length + 1 : _ctx.tableHeaders.length
|
|
4938
4962
|
}, [
|
|
4939
|
-
|
|
4963
|
+
_hoisted_36,
|
|
4940
4964
|
createTextVNode(" No records found ")
|
|
4941
|
-
], 8 /* PROPS */,
|
|
4965
|
+
], 8 /* PROPS */, _hoisted_35)
|
|
4942
4966
|
]))
|
|
4943
|
-
: (
|
|
4944
|
-
? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(
|
|
4967
|
+
: (_ctx.loading === 'done')
|
|
4968
|
+
? (openBlock(true), createElementBlock(Fragment, { key: 3 }, renderList(_ctx.records, (record, index) => {
|
|
4945
4969
|
return (openBlock(), createElementBlock("tr", {
|
|
4946
4970
|
key: record.id,
|
|
4947
4971
|
class: normalizeClass(record.class),
|
|
4948
|
-
onClick: $event => (
|
|
4972
|
+
onClick: $event => (_ctx.rowSelected(record))
|
|
4949
4973
|
}, [
|
|
4950
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
4974
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tableHeaders, (key) => {
|
|
4951
4975
|
return (openBlock(), createElementBlock("td", { key: key }, [
|
|
4952
|
-
(typeof key === 'string' &&
|
|
4976
|
+
(typeof key === 'string' && __props.links && __props.links[key])
|
|
4953
4977
|
? (openBlock(), createBlock(_component_router_link, {
|
|
4954
4978
|
key: 0,
|
|
4955
|
-
target:
|
|
4956
|
-
to:
|
|
4957
|
-
class: normalizeClass(
|
|
4979
|
+
target: __props.links[key].target ? '_blank':'',
|
|
4980
|
+
to: _ctx.replaceLinkUrl(__props.links[key],record),
|
|
4981
|
+
class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
|
|
4958
4982
|
innerHTML: record[key]
|
|
4959
4983
|
}, null, 8 /* PROPS */, ["target", "to", "class", "innerHTML"]))
|
|
4960
|
-
: (
|
|
4961
|
-
? (openBlock(), createElementBlock("span",
|
|
4962
|
-
: (
|
|
4963
|
-
? (openBlock(), createElementBlock("span",
|
|
4964
|
-
: (
|
|
4965
|
-
? (openBlock(), createElementBlock("span",
|
|
4984
|
+
: (_ctx.getFieldType(key) === 'numeric')
|
|
4985
|
+
? (openBlock(), createElementBlock("span", _hoisted_38, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
|
|
4986
|
+
: (_ctx.getFieldType(key) === 'money')
|
|
4987
|
+
? (openBlock(), createElementBlock("span", _hoisted_39, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
|
|
4988
|
+
: (_ctx.getFieldType(key) === 'date')
|
|
4989
|
+
? (openBlock(), createElementBlock("span", _hoisted_40, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
|
|
4966
4990
|
: (typeof key === 'string')
|
|
4967
4991
|
? (openBlock(), createElementBlock("span", {
|
|
4968
4992
|
key: 4,
|
|
4969
4993
|
innerHTML: record[key]
|
|
4970
|
-
}, null, 8 /* PROPS */,
|
|
4994
|
+
}, null, 8 /* PROPS */, _hoisted_41))
|
|
4971
4995
|
: (typeof key === 'function')
|
|
4972
4996
|
? (openBlock(), createElementBlock("span", {
|
|
4973
4997
|
key: 5,
|
|
4974
4998
|
innerHTML: key(record, index)
|
|
4975
|
-
}, null, 8 /* PROPS */,
|
|
4999
|
+
}, null, 8 /* PROPS */, _hoisted_42))
|
|
4976
5000
|
: (openBlock(), createElementBlock("span", {
|
|
4977
5001
|
key: 6,
|
|
4978
5002
|
innerHTML: record[key[0]]
|
|
4979
|
-
}, null, 8 /* PROPS */,
|
|
5003
|
+
}, null, 8 /* PROPS */, _hoisted_43))
|
|
4980
5004
|
]))
|
|
4981
5005
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
4982
|
-
(
|
|
4983
|
-
? (openBlock(), createElementBlock("td",
|
|
4984
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5006
|
+
(__props.actions)
|
|
5007
|
+
? (openBlock(), createElementBlock("td", _hoisted_44, [
|
|
5008
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions.actions, (act) => {
|
|
4985
5009
|
return (openBlock(), createElementBlock(Fragment, {
|
|
4986
5010
|
key: act.path
|
|
4987
5011
|
}, [
|
|
4988
|
-
(!act.permission ||
|
|
5012
|
+
(!act.permission || _ctx.user.isAllowedTo(act.permission))
|
|
4989
5013
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4990
5014
|
(!act.validator || act.validator(record))
|
|
4991
5015
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4992
5016
|
(['confirmAction','confirmaction','confirm-action','confirm'].includes(act.type))
|
|
4993
|
-
? (openBlock(), createBlock(
|
|
5017
|
+
? (openBlock(), createBlock(script$e, {
|
|
4994
5018
|
key: 0,
|
|
4995
|
-
onActionSuccessful: $event => (
|
|
4996
|
-
onActionFailed: $event => (
|
|
4997
|
-
onActionCanceled: $event => (
|
|
5019
|
+
onActionSuccessful: $event => (_ctx.doEmitAction('actionSuccessful',record)),
|
|
5020
|
+
onActionFailed: $event => (_ctx.doEmitAction('actionFailed',record)),
|
|
5021
|
+
onActionCanceled: $event => (_ctx.doEmitAction('actionCanceled',record)),
|
|
4998
5022
|
"loading-message": act.label,
|
|
4999
5023
|
class: normalizeClass(act.class),
|
|
5000
|
-
url:
|
|
5024
|
+
url: _ctx.replaceActionUrl(act.url,record)
|
|
5001
5025
|
}, {
|
|
5002
5026
|
default: withCtx(() => [
|
|
5003
5027
|
(act.icon)
|
|
@@ -5011,14 +5035,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5011
5035
|
_: 2 /* DYNAMIC */
|
|
5012
5036
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onActionSuccessful", "onActionFailed", "onActionCanceled", "loading-message", "class", "url"]))
|
|
5013
5037
|
: (['silentAction','silentaction','silent-action','silent'].includes(act.type))
|
|
5014
|
-
? (openBlock(), createBlock(
|
|
5038
|
+
? (openBlock(), createBlock(script$d, {
|
|
5015
5039
|
key: 1,
|
|
5016
|
-
onActionSuccessful: $event => (
|
|
5017
|
-
onActionFailed: $event => (
|
|
5018
|
-
onActionCanceled: $event => (
|
|
5040
|
+
onActionSuccessful: $event => (_ctx.doEmitAction('actionSuccessful',record)),
|
|
5041
|
+
onActionFailed: $event => (_ctx.doEmitAction('actionFailed',record)),
|
|
5042
|
+
onActionCanceled: $event => (_ctx.doEmitAction('actionCanceled',record)),
|
|
5019
5043
|
"loading-message": act.label,
|
|
5020
5044
|
class: normalizeClass(act.class),
|
|
5021
|
-
url:
|
|
5045
|
+
url: _ctx.replaceActionUrl(act.url,record)
|
|
5022
5046
|
}, {
|
|
5023
5047
|
default: withCtx(() => [
|
|
5024
5048
|
(act.icon)
|
|
@@ -5045,13 +5069,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5045
5069
|
}, null, 2 /* CLASS */))
|
|
5046
5070
|
: createCommentVNode("v-if", true),
|
|
5047
5071
|
createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
|
|
5048
|
-
], 10 /* CLASS, PROPS */,
|
|
5072
|
+
], 10 /* CLASS, PROPS */, _hoisted_45))
|
|
5049
5073
|
: (act.emits)
|
|
5050
5074
|
? (openBlock(), createElementBlock("button", {
|
|
5051
5075
|
key: 3,
|
|
5052
5076
|
title: act.title,
|
|
5053
5077
|
class: normalizeClass(act.class ? act.class:'btn btn-default'),
|
|
5054
|
-
onClick: $event => (
|
|
5078
|
+
onClick: $event => (_ctx.doEmitAction(act.emits,record))
|
|
5055
5079
|
}, [
|
|
5056
5080
|
(act.icon)
|
|
5057
5081
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -5060,12 +5084,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5060
5084
|
}, null, 2 /* CLASS */))
|
|
5061
5085
|
: createCommentVNode("v-if", true),
|
|
5062
5086
|
createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
|
|
5063
|
-
], 10 /* CLASS, PROPS */,
|
|
5087
|
+
], 10 /* CLASS, PROPS */, _hoisted_46))
|
|
5064
5088
|
: (!act.emits)
|
|
5065
5089
|
? (openBlock(), createBlock(_component_router_link, {
|
|
5066
5090
|
key: 4,
|
|
5067
5091
|
title: act.title,
|
|
5068
|
-
to:
|
|
5092
|
+
to: _ctx.replaceActionUrl(act.path,record),
|
|
5069
5093
|
class: normalizeClass(act.class)
|
|
5070
5094
|
}, {
|
|
5071
5095
|
default: withCtx(() => [
|
|
@@ -5088,74 +5112,74 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5088
5112
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5089
5113
|
]))
|
|
5090
5114
|
: createCommentVNode("v-if", true)
|
|
5091
|
-
], 10 /* CLASS, PROPS */,
|
|
5115
|
+
], 10 /* CLASS, PROPS */, _hoisted_37))
|
|
5092
5116
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5093
5117
|
: createCommentVNode("v-if", true)
|
|
5094
5118
|
])
|
|
5095
5119
|
], 2 /* CLASS */))
|
|
5096
|
-
: (openBlock(), createElementBlock("div",
|
|
5097
|
-
(
|
|
5098
|
-
? (openBlock(), createElementBlock("div",
|
|
5099
|
-
: (
|
|
5100
|
-
? (openBlock(), createElementBlock("div",
|
|
5101
|
-
createElementVNode("span", null, toDisplayString(
|
|
5120
|
+
: (openBlock(), createElementBlock("div", _hoisted_47, [
|
|
5121
|
+
(_ctx.loading === 'loading')
|
|
5122
|
+
? (openBlock(), createElementBlock("div", _hoisted_48, _hoisted_50))
|
|
5123
|
+
: (_ctx.loading === 'error')
|
|
5124
|
+
? (openBlock(), createElementBlock("div", _hoisted_51, [
|
|
5125
|
+
createElementVNode("span", null, toDisplayString(_ctx.loading_error), 1 /* TEXT */)
|
|
5102
5126
|
]))
|
|
5103
|
-
: (
|
|
5104
|
-
? (openBlock(), createElementBlock("div",
|
|
5105
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5127
|
+
: (_ctx.loading === 'done')
|
|
5128
|
+
? (openBlock(), createElementBlock("div", _hoisted_52, [
|
|
5129
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.records, (record, index) => {
|
|
5106
5130
|
return (openBlock(), createElementBlock("div", {
|
|
5107
5131
|
key: record.id,
|
|
5108
5132
|
class: "single-mobile-req bg-light p-3",
|
|
5109
|
-
onClick: $event => (
|
|
5133
|
+
onClick: $event => (_ctx.rowSelected(record))
|
|
5110
5134
|
}, [
|
|
5111
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5135
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.tableHeaders, (key) => {
|
|
5112
5136
|
return (openBlock(), createElementBlock(Fragment, {
|
|
5113
5137
|
key: key[0]
|
|
5114
5138
|
}, [
|
|
5115
5139
|
(typeof key === 'string' )
|
|
5116
|
-
? (openBlock(), createElementBlock("p",
|
|
5140
|
+
? (openBlock(), createElementBlock("p", _hoisted_54, toDisplayString(key.replace(/_/g, ' ')), 1 /* TEXT */))
|
|
5117
5141
|
: (typeof key === 'function')
|
|
5118
|
-
? (openBlock(), createElementBlock("p",
|
|
5119
|
-
: (openBlock(), createElementBlock("p",
|
|
5142
|
+
? (openBlock(), createElementBlock("p", _hoisted_55, toDisplayString(key(null).replace(/_/g, ' ')), 1 /* TEXT */))
|
|
5143
|
+
: (openBlock(), createElementBlock("p", _hoisted_56, toDisplayString(key[1].replace(/_/g, ' ')), 1 /* TEXT */)),
|
|
5120
5144
|
createElementVNode("span", null, [
|
|
5121
|
-
(typeof key === 'string' &&
|
|
5145
|
+
(typeof key === 'string' && __props.links && __props.links[key])
|
|
5122
5146
|
? (openBlock(), createBlock(_component_router_link, {
|
|
5123
5147
|
key: 0,
|
|
5124
|
-
to:
|
|
5125
|
-
class: normalizeClass(
|
|
5148
|
+
to: _ctx.replaceLinkUrl(__props.links[key],record),
|
|
5149
|
+
class: normalizeClass(_ctx.getLinkClass(__props.links[key])),
|
|
5126
5150
|
innerHTML: record[key]
|
|
5127
5151
|
}, null, 8 /* PROPS */, ["to", "class", "innerHTML"]))
|
|
5128
|
-
: (
|
|
5129
|
-
? (openBlock(), createElementBlock("span",
|
|
5130
|
-
: (
|
|
5131
|
-
? (openBlock(), createElementBlock("span",
|
|
5132
|
-
: (
|
|
5133
|
-
? (openBlock(), createElementBlock("span",
|
|
5152
|
+
: (_ctx.getFieldType(key) === 'numeric')
|
|
5153
|
+
? (openBlock(), createElementBlock("span", _hoisted_57, toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
|
|
5154
|
+
: (_ctx.getFieldType(key) === 'money')
|
|
5155
|
+
? (openBlock(), createElementBlock("span", _hoisted_58, "KES " + toDisplayString(Intl.NumberFormat().format(record[key])), 1 /* TEXT */))
|
|
5156
|
+
: (_ctx.getFieldType(key) === 'date')
|
|
5157
|
+
? (openBlock(), createElementBlock("span", _hoisted_59, toDisplayString(_ctx.formatDate(record[key])), 1 /* TEXT */))
|
|
5134
5158
|
: (typeof key === 'string')
|
|
5135
5159
|
? (openBlock(), createElementBlock("span", {
|
|
5136
5160
|
key: 4,
|
|
5137
5161
|
innerHTML: record[key]
|
|
5138
|
-
}, null, 8 /* PROPS */,
|
|
5162
|
+
}, null, 8 /* PROPS */, _hoisted_60))
|
|
5139
5163
|
: (typeof key === 'function')
|
|
5140
5164
|
? (openBlock(), createElementBlock("span", {
|
|
5141
5165
|
key: 5,
|
|
5142
5166
|
innerHTML: key(record, index )
|
|
5143
|
-
}, null, 8 /* PROPS */,
|
|
5167
|
+
}, null, 8 /* PROPS */, _hoisted_61))
|
|
5144
5168
|
: (openBlock(), createElementBlock("span", {
|
|
5145
5169
|
key: 6,
|
|
5146
5170
|
innerHTML: record[key[0]]
|
|
5147
|
-
}, null, 8 /* PROPS */,
|
|
5171
|
+
}, null, 8 /* PROPS */, _hoisted_62))
|
|
5148
5172
|
]),
|
|
5149
|
-
|
|
5173
|
+
_hoisted_63
|
|
5150
5174
|
], 64 /* STABLE_FRAGMENT */))
|
|
5151
5175
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
5152
|
-
(
|
|
5153
|
-
? (openBlock(), createElementBlock("div",
|
|
5154
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5176
|
+
(__props.actions)
|
|
5177
|
+
? (openBlock(), createElementBlock("div", _hoisted_64, [
|
|
5178
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.actions.actions, (act) => {
|
|
5155
5179
|
return (openBlock(), createElementBlock(Fragment, {
|
|
5156
5180
|
key: act.path
|
|
5157
5181
|
}, [
|
|
5158
|
-
(!act.permission ||
|
|
5182
|
+
(!act.permission || _ctx.user.isAllowedTo(act.permission))
|
|
5159
5183
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
5160
5184
|
(!act.validator || act.validator(record))
|
|
5161
5185
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
@@ -5173,13 +5197,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5173
5197
|
}, null, 2 /* CLASS */))
|
|
5174
5198
|
: createCommentVNode("v-if", true),
|
|
5175
5199
|
createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
|
|
5176
|
-
], 10 /* CLASS, PROPS */,
|
|
5200
|
+
], 10 /* CLASS, PROPS */, _hoisted_65))
|
|
5177
5201
|
: (act.emits)
|
|
5178
5202
|
? (openBlock(), createElementBlock("button", {
|
|
5179
5203
|
key: 1,
|
|
5180
5204
|
title: act.title,
|
|
5181
5205
|
class: normalizeClass(act.class ? act.class:'btn btn-default'),
|
|
5182
|
-
onClick: $event => (
|
|
5206
|
+
onClick: $event => (_ctx.doEmitAction(act.emits,record))
|
|
5183
5207
|
}, [
|
|
5184
5208
|
(act.icon)
|
|
5185
5209
|
? (openBlock(), createElementBlock("span", {
|
|
@@ -5188,12 +5212,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5188
5212
|
}, null, 2 /* CLASS */))
|
|
5189
5213
|
: createCommentVNode("v-if", true),
|
|
5190
5214
|
createTextVNode(" " + toDisplayString(act.label), 1 /* TEXT */)
|
|
5191
|
-
], 10 /* CLASS, PROPS */,
|
|
5215
|
+
], 10 /* CLASS, PROPS */, _hoisted_66))
|
|
5192
5216
|
: (!act.emits)
|
|
5193
5217
|
? (openBlock(), createBlock(_component_router_link, {
|
|
5194
5218
|
key: 2,
|
|
5195
5219
|
title: act.title,
|
|
5196
|
-
to:
|
|
5220
|
+
to: _ctx.replaceActionUrl(act.path,record),
|
|
5197
5221
|
class: normalizeClass(act.class)
|
|
5198
5222
|
}, {
|
|
5199
5223
|
default: withCtx(() => [
|
|
@@ -5216,42 +5240,42 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5216
5240
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5217
5241
|
]))
|
|
5218
5242
|
: createCommentVNode("v-if", true)
|
|
5219
|
-
], 8 /* PROPS */,
|
|
5243
|
+
], 8 /* PROPS */, _hoisted_53))
|
|
5220
5244
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5221
5245
|
]))
|
|
5222
5246
|
: createCommentVNode("v-if", true)
|
|
5223
5247
|
])),
|
|
5224
|
-
(
|
|
5225
|
-
? (openBlock(), createBlock(
|
|
5248
|
+
(_ctx.pagination_data)
|
|
5249
|
+
? (openBlock(), createBlock(script$f, {
|
|
5226
5250
|
key: 6,
|
|
5227
|
-
onLoadMoreRecords:
|
|
5228
|
-
"hide-load-more":
|
|
5229
|
-
"hide-count":
|
|
5230
|
-
pagination_data:
|
|
5231
|
-
onChangeKey:
|
|
5232
|
-
"pagination-style":
|
|
5251
|
+
onLoadMoreRecords: _ctx.loadMoreRecords,
|
|
5252
|
+
"hide-load-more": __props.hideLoadMore,
|
|
5253
|
+
"hide-count": __props.hideCount,
|
|
5254
|
+
pagination_data: _ctx.pagination_data,
|
|
5255
|
+
onChangeKey: _ctx.changeKey,
|
|
5256
|
+
"pagination-style": _ctx.pageStyle
|
|
5233
5257
|
}, null, 8 /* PROPS */, ["onLoadMoreRecords", "hide-load-more", "hide-count", "pagination_data", "onChangeKey", "pagination-style"]))
|
|
5234
5258
|
: createCommentVNode("v-if", true),
|
|
5235
|
-
(
|
|
5236
|
-
? (openBlock(true), createElementBlock(Fragment, { key: 7 }, renderList(
|
|
5259
|
+
(__props.actions)
|
|
5260
|
+
? (openBlock(true), createElementBlock(Fragment, { key: 7 }, renderList(__props.actions.actions, (action) => {
|
|
5237
5261
|
return (openBlock(), createElementBlock(Fragment, {
|
|
5238
5262
|
key: action.label
|
|
5239
5263
|
}, [
|
|
5240
5264
|
(action.canvasId)
|
|
5241
|
-
? (openBlock(), createBlock(
|
|
5265
|
+
? (openBlock(), createBlock(script$h, {
|
|
5242
5266
|
key: 0,
|
|
5243
|
-
onOffcanvasClosed:
|
|
5267
|
+
onOffcanvasClosed: _ctx.canvasClosed,
|
|
5244
5268
|
position: action.canvasPosition,
|
|
5245
5269
|
"canvas-size": action.canvasSize,
|
|
5246
5270
|
"canvas-title": action.canvasTitle,
|
|
5247
5271
|
"canvas-id": action.canvasId
|
|
5248
5272
|
}, {
|
|
5249
5273
|
default: withCtx(() => [
|
|
5250
|
-
(
|
|
5274
|
+
(_ctx.selectedRecord)
|
|
5251
5275
|
? (openBlock(), createBlock(resolveDynamicComponent(action.canvasComponent), mergeProps({
|
|
5252
5276
|
key: 0,
|
|
5253
|
-
onRecordUpdated:
|
|
5254
|
-
},
|
|
5277
|
+
onRecordUpdated: _ctx.reloadData
|
|
5278
|
+
}, _ctx.cleanCanvasProps(action), { record: _ctx.selectedRecord }), null, 16 /* FULL_PROPS */, ["onRecordUpdated", "record"]))
|
|
5255
5279
|
: createCommentVNode("v-if", true)
|
|
5256
5280
|
]),
|
|
5257
5281
|
_: 2 /* DYNAMIC */
|
|
@@ -5262,8 +5286,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5262
5286
|
: createCommentVNode("v-if", true)
|
|
5263
5287
|
]))
|
|
5264
5288
|
}
|
|
5289
|
+
}
|
|
5290
|
+
|
|
5291
|
+
});
|
|
5265
5292
|
|
|
5266
|
-
script$b.render = render;
|
|
5267
5293
|
script$b.__file = "src/lib/components/ShTable.vue";
|
|
5268
5294
|
|
|
5269
5295
|
var script$a = {
|
|
@@ -5946,7 +5972,7 @@ return (_ctx, _cache) => {
|
|
|
5946
5972
|
class: "d-none"
|
|
5947
5973
|
}, "Open Modal", 8 /* PROPS */, _hoisted_1$3),
|
|
5948
5974
|
(popUp.value === 'modal')
|
|
5949
|
-
? (openBlock(), createBlock(script$
|
|
5975
|
+
? (openBlock(), createBlock(script$k, {
|
|
5950
5976
|
key: 0,
|
|
5951
5977
|
"modal-title": title.value,
|
|
5952
5978
|
"modal-id": unref(modalId),
|
|
@@ -5961,7 +5987,7 @@ return (_ctx, _cache) => {
|
|
|
5961
5987
|
}, 8 /* PROPS */, ["modal-title", "modal-id", "modal-size"]))
|
|
5962
5988
|
: createCommentVNode("v-if", true),
|
|
5963
5989
|
(['offcanvas','canvas','offCanvas'].includes(popUp.value))
|
|
5964
|
-
? (openBlock(), createBlock(script$
|
|
5990
|
+
? (openBlock(), createBlock(script$h, {
|
|
5965
5991
|
key: 1,
|
|
5966
5992
|
"canvas-id": unref(canvasId),
|
|
5967
5993
|
"canvas-title": title.value,
|
|
@@ -5992,7 +6018,7 @@ const fields = route.query.fields.split(',');
|
|
|
5992
6018
|
const action = route.query.action;
|
|
5993
6019
|
|
|
5994
6020
|
return (_ctx, _cache) => {
|
|
5995
|
-
return (openBlock(), createBlock(script$
|
|
6021
|
+
return (openBlock(), createBlock(script$m, {
|
|
5996
6022
|
fields: unref(fields),
|
|
5997
6023
|
action: unref(action)
|
|
5998
6024
|
}, null, 8 /* PROPS */, ["fields", "action"]))
|
|
@@ -6093,7 +6119,7 @@ const goBack = () => {
|
|
|
6093
6119
|
return (_ctx, _cache) => {
|
|
6094
6120
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
6095
6121
|
(popUp.value === 'modal')
|
|
6096
|
-
? (openBlock(), createBlock(script$
|
|
6122
|
+
? (openBlock(), createBlock(script$k, {
|
|
6097
6123
|
key: 0,
|
|
6098
6124
|
"modal-title": title.value,
|
|
6099
6125
|
"data-bs-backdrop": "static",
|
|
@@ -6108,7 +6134,7 @@ return (_ctx, _cache) => {
|
|
|
6108
6134
|
}, 8 /* PROPS */, ["modal-title", "modal-id", "modal-size"]))
|
|
6109
6135
|
: createCommentVNode("v-if", true),
|
|
6110
6136
|
(['offcanvas','canvas','offCanvas'].includes(popUp.value))
|
|
6111
|
-
? (openBlock(), createBlock(script$
|
|
6137
|
+
? (openBlock(), createBlock(script$h, {
|
|
6112
6138
|
"canvas-title": title.value,
|
|
6113
6139
|
key: size.value + position.value,
|
|
6114
6140
|
"canvas-id": unref(canvasId),
|
|
@@ -6213,12 +6239,12 @@ return (_ctx, _cache) => {
|
|
|
6213
6239
|
]
|
|
6214
6240
|
}
|
|
6215
6241
|
}, null, 8 /* PROPS */, ["reload", "actions"]),
|
|
6216
|
-
createVNode(script$
|
|
6242
|
+
createVNode(script$k, {
|
|
6217
6243
|
"modal-id": "sh_department_modal",
|
|
6218
6244
|
"modal-title": "Department Form"
|
|
6219
6245
|
}, {
|
|
6220
6246
|
default: withCtx(() => [
|
|
6221
|
-
createVNode(script$
|
|
6247
|
+
createVNode(script$t, {
|
|
6222
6248
|
"success-callback": "departmentAdded",
|
|
6223
6249
|
"current-data": department.value,
|
|
6224
6250
|
onDepartmentAdded: departmentAdded,
|
|
@@ -6373,12 +6399,12 @@ return (_ctx, _cache) => {
|
|
|
6373
6399
|
headers: ['id',showModule,'created_at'],
|
|
6374
6400
|
"end-point": 'admin/departments/department/list-modules/' + id.value
|
|
6375
6401
|
}, null, 8 /* PROPS */, ["actions", "reload", "headers", "end-point"]),
|
|
6376
|
-
createVNode(script$
|
|
6402
|
+
createVNode(script$k, {
|
|
6377
6403
|
"modal-id": "addModule",
|
|
6378
6404
|
"modal-title": "Add Module Department"
|
|
6379
6405
|
}, {
|
|
6380
6406
|
default: withCtx(() => [
|
|
6381
|
-
createVNode(script$
|
|
6407
|
+
createVNode(script$t, {
|
|
6382
6408
|
"reload-select-items": unref(reload),
|
|
6383
6409
|
"success-callback": moduleAdded,
|
|
6384
6410
|
"fill-selects": {
|
|
@@ -6400,7 +6426,7 @@ return (_ctx, _cache) => {
|
|
|
6400
6426
|
ref: permissionCanvasBtn,
|
|
6401
6427
|
"data-bs-toggle": "offcanvas"
|
|
6402
6428
|
}, null, 512 /* NEED_PATCH */),
|
|
6403
|
-
createVNode(script$
|
|
6429
|
+
createVNode(script$h, {
|
|
6404
6430
|
"canvas-id": "permissionsCanvas",
|
|
6405
6431
|
position: "end enlarged",
|
|
6406
6432
|
"canvas-title": "Module Permissions"
|
|
@@ -6515,7 +6541,7 @@ return (_ctx, _cache) => {
|
|
|
6515
6541
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
6516
6542
|
(section.value === 'login')
|
|
6517
6543
|
? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
6518
|
-
createVNode(script$
|
|
6544
|
+
createVNode(script$t, {
|
|
6519
6545
|
class: "sh-login-form",
|
|
6520
6546
|
fields: ['email','password'],
|
|
6521
6547
|
"action-label": "Login",
|
|
@@ -6540,7 +6566,7 @@ return (_ctx, _cache) => {
|
|
|
6540
6566
|
(unref(registerSubTitle))
|
|
6541
6567
|
? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
|
|
6542
6568
|
: createCommentVNode("v-if", true),
|
|
6543
|
-
createVNode(script$
|
|
6569
|
+
createVNode(script$t, {
|
|
6544
6570
|
class: "sh-login-form",
|
|
6545
6571
|
fields: unref(registrationFields),
|
|
6546
6572
|
"action-label": "Sign Up",
|
|
@@ -6587,10 +6613,11 @@ const ShFrontend = {
|
|
|
6587
6613
|
const registerTitle = options.registerTitle ?? 'Create a new account';
|
|
6588
6614
|
const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
|
|
6589
6615
|
const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
|
|
6590
|
-
options.formTextInput ?? script$
|
|
6616
|
+
options.formTextInput ?? script$q;
|
|
6591
6617
|
const loginUrl = options.loginUrl ?? `/login`;
|
|
6592
6618
|
const redirectLogin = options.redirectLogin ?? `/`;
|
|
6593
6619
|
const redirectRegister = options.redirectRegister ?? `/`;
|
|
6620
|
+
const noRecordsComponent = options.noRecordsComponent ?? script$g;
|
|
6594
6621
|
const registrationFields = options.registrationFields ?? ['name','email','phone','password','password_confirmation'];
|
|
6595
6622
|
const AuthComponent = options.authComponent ?? script;
|
|
6596
6623
|
app.provide('loginEndpoint',loginEndpoint);
|
|
@@ -6604,6 +6631,7 @@ const ShFrontend = {
|
|
|
6604
6631
|
app.provide('formComponents', options.shFormComponents ?? {});
|
|
6605
6632
|
app.provide('loginUrl', loginUrl);
|
|
6606
6633
|
app.provide('shFormElementClasses',defaultFormElementClasses);
|
|
6634
|
+
app.provide('noRecordsComponent',noRecordsComponent);
|
|
6607
6635
|
window.swalPosition = swalPosition;
|
|
6608
6636
|
if(options.router) {
|
|
6609
6637
|
options.router.addRoute({
|
|
@@ -6645,4 +6673,4 @@ var shGql = {
|
|
|
6645
6673
|
mutate
|
|
6646
6674
|
};
|
|
6647
6675
|
|
|
6648
|
-
export { countries as Countries, script$6 as ManagePermissions, script$
|
|
6676
|
+
export { countries as Countries, script$6 as ManagePermissions, script$m as ShAutoForm, script$h as ShCanvas, script$7 as ShCanvasBtn, script$e as ShConfirmAction, script$l as ShDropDownForm, script$9 as ShDynamicTabs, script$t as ShForm, ShFrontend, script$k as ShModal, script$8 as ShModalBtn, script$j as ShModalForm, script$i as ShModalFormAuto, script$v as ShPhone, script$3 as ShQueryPopups, script$c as ShRange, script$5 as ShRoutePopups, script$d as ShSilentAction, script$u as ShSuggest, script$b as ShTable, script$a as ShTabs, shApis, shGql, shRepo, ShStorage as shStorage, useAppStore, useUserStore };
|