@iankibetsh/shframework 1.8.0 → 1.8.3
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/library.js +135 -70
- package/dist/library.mjs +136 -71
- package/package.json +10 -3
package/dist/library.js
CHANGED
|
@@ -1896,6 +1896,14 @@ var script$s = {
|
|
|
1896
1896
|
mounted () {
|
|
1897
1897
|
this.setSelectedCountry();
|
|
1898
1898
|
},
|
|
1899
|
+
watch: {
|
|
1900
|
+
modelValue: function(newVal){
|
|
1901
|
+
if(!this.input){
|
|
1902
|
+
let phone = newVal.replace('+254','');
|
|
1903
|
+
this.input = phone.replace('+1','');
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1899
1907
|
methods: {
|
|
1900
1908
|
updateValue: function () {
|
|
1901
1909
|
let phone = this.input;
|
|
@@ -1991,7 +1999,7 @@ const _hoisted_4$c = ["onClick"];
|
|
|
1991
1999
|
const _hoisted_5$a = ["id"];
|
|
1992
2000
|
const _hoisted_6$9 = ["id", "aria-labelledby"];
|
|
1993
2001
|
const _hoisted_7$7 = { key: 0 };
|
|
1994
|
-
const _hoisted_8$
|
|
2002
|
+
const _hoisted_8$6 = ["onClick"];
|
|
1995
2003
|
const _hoisted_9$6 = {
|
|
1996
2004
|
key: 1,
|
|
1997
2005
|
class: "dropdown-item sh-suggest-no-results"
|
|
@@ -2127,7 +2135,7 @@ return (_ctx, _cache) => {
|
|
|
2127
2135
|
onClick: $event => (addSuggestion(suggestion)),
|
|
2128
2136
|
class: vue.normalizeClass(["dropdown-item", vue.unref(selectedSuggestions).includes(suggestion) ? 'active':'']),
|
|
2129
2137
|
href: "#"
|
|
2130
|
-
}, vue.toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$
|
|
2138
|
+
}, vue.toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$6)
|
|
2131
2139
|
]))
|
|
2132
2140
|
: vue.createCommentVNode("v-if", true)
|
|
2133
2141
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -2487,7 +2495,7 @@ const _hoisted_4$b = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-excla
|
|
|
2487
2495
|
const _hoisted_5$9 = { key: 0 };
|
|
2488
2496
|
const _hoisted_6$8 = { key: 1 };
|
|
2489
2497
|
const _hoisted_7$6 = { class: "row" };
|
|
2490
|
-
const _hoisted_8$
|
|
2498
|
+
const _hoisted_8$5 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
|
|
2491
2499
|
const _hoisted_9$5 = { class: "col-md-12" };
|
|
2492
2500
|
const _hoisted_10$4 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
|
|
2493
2501
|
const _hoisted_11$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
@@ -2559,7 +2567,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2559
2567
|
class: vue.normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
|
|
2560
2568
|
key: field
|
|
2561
2569
|
}, [
|
|
2562
|
-
vue.createElementVNode("label", _hoisted_8$
|
|
2570
|
+
vue.createElementVNode("label", _hoisted_8$5, vue.toDisplayString($options.getLabel(field)), 1 /* TEXT */),
|
|
2563
2571
|
vue.createElementVNode("div", _hoisted_9$5, [
|
|
2564
2572
|
($options.getFieldType(field) === 'component')
|
|
2565
2573
|
? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.customComponent[field]), {
|
|
@@ -2762,7 +2770,11 @@ const modelValueUpdated = (e) => {
|
|
|
2762
2770
|
vue.onMounted(()=>{
|
|
2763
2771
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2764
2772
|
});
|
|
2765
|
-
|
|
2773
|
+
vue.watch(()=>props.modelValue, (newValue)=>{
|
|
2774
|
+
if(newValue) {
|
|
2775
|
+
inputModel.value = newValue;
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2766
2778
|
|
|
2767
2779
|
return (_ctx, _cache) => {
|
|
2768
2780
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
@@ -2803,7 +2815,11 @@ const modelValueUpdated = (e) => {
|
|
|
2803
2815
|
vue.onMounted(()=>{
|
|
2804
2816
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2805
2817
|
});
|
|
2806
|
-
|
|
2818
|
+
vue.watch(()=>props.modelValue, (newValue)=>{
|
|
2819
|
+
if(newValue) {
|
|
2820
|
+
inputModel.value = newValue;
|
|
2821
|
+
}
|
|
2822
|
+
});
|
|
2807
2823
|
|
|
2808
2824
|
return (_ctx, _cache) => {
|
|
2809
2825
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
@@ -2844,6 +2860,12 @@ vue.onMounted(()=>{
|
|
|
2844
2860
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2845
2861
|
});
|
|
2846
2862
|
|
|
2863
|
+
vue.watch(()=>props.modelValue, (newValue)=>{
|
|
2864
|
+
if(newValue) {
|
|
2865
|
+
inputModel.value = newValue;
|
|
2866
|
+
}
|
|
2867
|
+
});
|
|
2868
|
+
|
|
2847
2869
|
|
|
2848
2870
|
return (_ctx, _cache) => {
|
|
2849
2871
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
@@ -2881,7 +2903,11 @@ const modelValueUpdated = (e) => {
|
|
|
2881
2903
|
vue.onMounted(()=>{
|
|
2882
2904
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2883
2905
|
});
|
|
2884
|
-
|
|
2906
|
+
vue.watch(()=>props.modelValue, (newValue)=>{
|
|
2907
|
+
if(newValue) {
|
|
2908
|
+
inputModel.value = newValue;
|
|
2909
|
+
}
|
|
2910
|
+
});
|
|
2885
2911
|
|
|
2886
2912
|
return (_ctx, _cache) => {
|
|
2887
2913
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
|
|
@@ -2941,7 +2967,11 @@ vue.onMounted(()=>{
|
|
|
2941
2967
|
});
|
|
2942
2968
|
}
|
|
2943
2969
|
});
|
|
2944
|
-
|
|
2970
|
+
vue.watch(()=>props.modelValue, (newValue)=>{
|
|
2971
|
+
if(newValue) {
|
|
2972
|
+
inputModel.value = newValue;
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2945
2975
|
|
|
2946
2976
|
return (_ctx, _cache) => {
|
|
2947
2977
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
|
|
@@ -3005,17 +3035,18 @@ return (_ctx, _cache) => {
|
|
|
3005
3035
|
script$k.__file = "src/lib/components/form-components/PasswordInput.vue";
|
|
3006
3036
|
|
|
3007
3037
|
const _hoisted_1$i = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
|
|
3008
|
-
const _hoisted_2$b = ["
|
|
3038
|
+
const _hoisted_2$b = ["onUpdate:modelValue"];
|
|
3009
3039
|
const _hoisted_3$a = ["innerHTML"];
|
|
3010
3040
|
const _hoisted_4$a = ["innerHTML"];
|
|
3011
|
-
const _hoisted_5$8 = ["
|
|
3012
|
-
const _hoisted_6$7 =
|
|
3041
|
+
const _hoisted_5$8 = ["innerHTML"];
|
|
3042
|
+
const _hoisted_6$7 = ["disabled"];
|
|
3043
|
+
const _hoisted_7$5 = {
|
|
3013
3044
|
key: 0,
|
|
3014
3045
|
class: "spinner-border spinner-border-sm",
|
|
3015
3046
|
role: "status",
|
|
3016
3047
|
"aria-hidden": "true"
|
|
3017
3048
|
};
|
|
3018
|
-
const
|
|
3049
|
+
const _hoisted_8$4 = { key: 1 };
|
|
3019
3050
|
|
|
3020
3051
|
|
|
3021
3052
|
var script$j = {
|
|
@@ -3094,7 +3125,7 @@ shFormElementClasses.value = vue.inject('shFormElementClasses');
|
|
|
3094
3125
|
const shAutoForm = vue.ref(null);
|
|
3095
3126
|
const closeModal = e => {
|
|
3096
3127
|
setTimeout(() => {
|
|
3097
|
-
const modal =
|
|
3128
|
+
const modal = shAutoForm.value.closest('.modal-dialog');
|
|
3098
3129
|
if(modal){
|
|
3099
3130
|
const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
|
|
3100
3131
|
closeBtn && closeBtn.click();
|
|
@@ -3151,17 +3182,24 @@ const submitForm = e => {
|
|
|
3151
3182
|
return false
|
|
3152
3183
|
};
|
|
3153
3184
|
const submitBtnWidth = vue.ref(null);
|
|
3154
|
-
const setExistingData = ()=>{
|
|
3155
|
-
console.log(props.currentData, formFields.value);
|
|
3156
|
-
const existingData = props.currentData;
|
|
3185
|
+
const setExistingData = (existingData)=>{
|
|
3157
3186
|
if (props.currentData) {
|
|
3158
|
-
formFields.value.map(
|
|
3159
|
-
|
|
3187
|
+
const newFields = formFields.value.map(fl=>{
|
|
3188
|
+
if(existingData[fl.field]) {
|
|
3189
|
+
fl.value = existingData[fl.field];
|
|
3190
|
+
}
|
|
3191
|
+
return fl
|
|
3192
|
+
// console.log(fl)
|
|
3193
|
+
// console.log(field, existingData)
|
|
3194
|
+
// existingData[field.field] && (field.value = existingData[field.field])
|
|
3160
3195
|
});
|
|
3196
|
+
formFields.value = null;
|
|
3197
|
+
console.log(newFields);
|
|
3198
|
+
formFields.value = newFields;
|
|
3161
3199
|
}
|
|
3162
3200
|
};
|
|
3163
|
-
vue.watch(()=>props.currentData,()=>{
|
|
3164
|
-
setExistingData();
|
|
3201
|
+
vue.watch(()=>props.currentData,(newData)=>{
|
|
3202
|
+
setExistingData(newData);
|
|
3165
3203
|
});
|
|
3166
3204
|
vue.onMounted((ev)=>{
|
|
3167
3205
|
props.fields && props.fields.map(field=>{
|
|
@@ -3183,8 +3221,13 @@ vue.onMounted((ev)=>{
|
|
|
3183
3221
|
value: null
|
|
3184
3222
|
});
|
|
3185
3223
|
}
|
|
3224
|
+
formFields.value.push({
|
|
3225
|
+
field: 'id',
|
|
3226
|
+
type: 'hidden'
|
|
3227
|
+
// label: 'IF'
|
|
3228
|
+
});
|
|
3186
3229
|
});
|
|
3187
|
-
setExistingData();
|
|
3230
|
+
setExistingData(props.currentData);
|
|
3188
3231
|
});
|
|
3189
3232
|
|
|
3190
3233
|
|
|
@@ -3202,42 +3245,50 @@ return (_ctx, _cache) => {
|
|
|
3202
3245
|
key: field,
|
|
3203
3246
|
class: vue.normalizeClass(getElementClass('formGroup'))
|
|
3204
3247
|
}, [
|
|
3205
|
-
(
|
|
3206
|
-
? (vue.openBlock(), vue.createElementBlock("
|
|
3248
|
+
(field.type === 'hidden')
|
|
3249
|
+
? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
3207
3250
|
key: 0,
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
}, null,
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3251
|
+
type: "hidden",
|
|
3252
|
+
"onUpdate:modelValue": $event => ((formFields.value[index].value) = $event)
|
|
3253
|
+
}, null, 8 /* PROPS */, _hoisted_2$b)), [
|
|
3254
|
+
[vue.vModelText, formFields.value[index].value]
|
|
3255
|
+
])
|
|
3256
|
+
: (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
3257
|
+
(!vue.unref(isFloating) && field.label)
|
|
3258
|
+
? (vue.openBlock(), vue.createElementBlock("label", {
|
|
3259
|
+
key: 0,
|
|
3260
|
+
class: vue.normalizeClass(getElementClass('formLabel')),
|
|
3261
|
+
innerHTML: field.label
|
|
3262
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_3$a))
|
|
3263
|
+
: vue.createCommentVNode("v-if", true),
|
|
3264
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field)), vue.mergeProps(getComponentProps(field), {
|
|
3265
|
+
isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
|
|
3266
|
+
onClick: $event => (removeValidationError(field.field)),
|
|
3267
|
+
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3268
|
+
modelValue: formFields.value[index].value,
|
|
3269
|
+
class: getComponentClass(field.field)
|
|
3270
|
+
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
|
|
3271
|
+
(vue.unref(isFloating) && field.label)
|
|
3272
|
+
? (vue.openBlock(), vue.createElementBlock("label", {
|
|
3273
|
+
key: 1,
|
|
3274
|
+
class: vue.normalizeClass(getElementClass('formLabel')),
|
|
3275
|
+
innerHTML: field.label
|
|
3276
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_4$a))
|
|
3277
|
+
: vue.createCommentVNode("v-if", true),
|
|
3278
|
+
(field.helper)
|
|
3279
|
+
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3280
|
+
key: 2,
|
|
3281
|
+
class: vue.normalizeClass(getElementClass('helperText')),
|
|
3282
|
+
innerHTML: field.helper
|
|
3283
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_5$8))
|
|
3284
|
+
: vue.createCommentVNode("v-if", true),
|
|
3285
|
+
(validationErrors.value[field.field])
|
|
3286
|
+
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3287
|
+
key: 3,
|
|
3288
|
+
class: vue.normalizeClass(getElementClass('invalidFeedback'))
|
|
3289
|
+
}, vue.toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
|
|
3290
|
+
: vue.createCommentVNode("v-if", true)
|
|
3291
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
3241
3292
|
], 2 /* CLASS */))
|
|
3242
3293
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
3243
3294
|
vue.createElementVNode("div", {
|
|
@@ -3251,12 +3302,12 @@ return (_ctx, _cache) => {
|
|
|
3251
3302
|
class: vue.normalizeClass(getElementClass('actionBtn'))
|
|
3252
3303
|
}, [
|
|
3253
3304
|
(loading.value)
|
|
3254
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
3305
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$5))
|
|
3255
3306
|
: vue.createCommentVNode("v-if", true),
|
|
3256
3307
|
(!loading.value)
|
|
3257
|
-
? (vue.openBlock(), vue.createElementBlock("span",
|
|
3308
|
+
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$4, "Submit"))
|
|
3258
3309
|
: vue.createCommentVNode("v-if", true)
|
|
3259
|
-
], 14 /* CLASS, STYLE, PROPS */,
|
|
3310
|
+
], 14 /* CLASS, STYLE, PROPS */, _hoisted_6$7)
|
|
3260
3311
|
], 2 /* CLASS */)
|
|
3261
3312
|
], 34 /* CLASS, HYDRATE_EVENTS */)
|
|
3262
3313
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -3983,7 +4034,7 @@ script$b.__file = "src/lib/components/ShSilentAction.vue";
|
|
|
3983
4034
|
|
|
3984
4035
|
var script$a = {
|
|
3985
4036
|
name: 'sh-table',
|
|
3986
|
-
props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle'],
|
|
4037
|
+
props: ['endPoint', 'headers','query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle'],
|
|
3987
4038
|
inject: ['channel'],
|
|
3988
4039
|
data () {
|
|
3989
4040
|
return {
|
|
@@ -4004,10 +4055,14 @@ var script$a = {
|
|
|
4004
4055
|
hasCanvas: 0,
|
|
4005
4056
|
selectedRecord: null,
|
|
4006
4057
|
timeOut: null,
|
|
4058
|
+
tableHeaders: [],
|
|
4007
4059
|
pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle','loadMore')
|
|
4008
4060
|
}
|
|
4009
4061
|
},
|
|
4010
4062
|
mounted () {
|
|
4063
|
+
if(this.headers){
|
|
4064
|
+
this.tableHeaders = this.headers;
|
|
4065
|
+
}
|
|
4011
4066
|
if (this.event) ;
|
|
4012
4067
|
if (this.actions && this.actions.actions) {
|
|
4013
4068
|
this.actions.actions.forEach(action => {
|
|
@@ -4172,7 +4227,13 @@ var script$a = {
|
|
|
4172
4227
|
if (this.pagination_data) {
|
|
4173
4228
|
this.pagination_data.loading = 1;
|
|
4174
4229
|
}
|
|
4175
|
-
|
|
4230
|
+
let endPoint = this.endPoint;
|
|
4231
|
+
if(!this.endPoint && this.query){
|
|
4232
|
+
//send ql query
|
|
4233
|
+
endPoint = 'sh-ql';
|
|
4234
|
+
data.query = this.query;
|
|
4235
|
+
}
|
|
4236
|
+
shApis.doGet(endPoint, data).then(req => {
|
|
4176
4237
|
this.$emit('dataReloaded', this.pagination_data);
|
|
4177
4238
|
this.loading = 'done';
|
|
4178
4239
|
const response = req.data.data;
|
|
@@ -4185,6 +4246,9 @@ var script$a = {
|
|
|
4185
4246
|
loading: 0,
|
|
4186
4247
|
displayCount: response.total > response.per_page ? response.per_page : response.total
|
|
4187
4248
|
};
|
|
4249
|
+
if(!this.headers && response.total > 0){
|
|
4250
|
+
this.tableHeaders = Object.keys(response.data[0]);
|
|
4251
|
+
}
|
|
4188
4252
|
if (append) {
|
|
4189
4253
|
this.records.push(...response.data);
|
|
4190
4254
|
let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
|
|
@@ -4486,7 +4550,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4486
4550
|
}, [
|
|
4487
4551
|
vue.createElementVNode("thead", _hoisted_21, [
|
|
4488
4552
|
vue.createElementVNode("tr", null, [
|
|
4489
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($
|
|
4553
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (title) => {
|
|
4490
4554
|
return (vue.openBlock(), vue.createElementBlock("th", { key: title }, [
|
|
4491
4555
|
(typeof title === 'string')
|
|
4492
4556
|
? (vue.openBlock(), vue.createElementBlock("a", {
|
|
@@ -4518,19 +4582,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4518
4582
|
($data.loading === 'loading')
|
|
4519
4583
|
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_27, [
|
|
4520
4584
|
vue.createElementVNode("td", {
|
|
4521
|
-
colspan: $
|
|
4585
|
+
colspan: $data.tableHeaders.length
|
|
4522
4586
|
}, _hoisted_30, 8 /* PROPS */, _hoisted_28)
|
|
4523
4587
|
]))
|
|
4524
4588
|
: ($data.loading === 'error')
|
|
4525
4589
|
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_31, [
|
|
4526
4590
|
vue.createElementVNode("td", {
|
|
4527
|
-
colspan: $
|
|
4591
|
+
colspan: $data.tableHeaders.length
|
|
4528
4592
|
}, vue.toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_32)
|
|
4529
4593
|
]))
|
|
4530
4594
|
: ($data.records.length === 0)
|
|
4531
4595
|
? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_33, [
|
|
4532
4596
|
vue.createElementVNode("td", {
|
|
4533
|
-
colspan: $props.actions ? $
|
|
4597
|
+
colspan: $props.actions ? $data.tableHeaders.length + 1 : $data.tableHeaders.length
|
|
4534
4598
|
}, [
|
|
4535
4599
|
_hoisted_35,
|
|
4536
4600
|
vue.createTextVNode(" No records found ")
|
|
@@ -4543,7 +4607,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4543
4607
|
class: vue.normalizeClass(record.class),
|
|
4544
4608
|
onClick: $event => ($options.rowSelected(record))
|
|
4545
4609
|
}, [
|
|
4546
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($
|
|
4610
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (key) => {
|
|
4547
4611
|
return (vue.openBlock(), vue.createElementBlock("td", { key: key }, [
|
|
4548
4612
|
(typeof key === 'string' && $props.links && $props.links[key])
|
|
4549
4613
|
? (vue.openBlock(), vue.createBlock(_component_router_link, {
|
|
@@ -4704,7 +4768,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4704
4768
|
class: "single-mobile-req bg-light p-3",
|
|
4705
4769
|
onClick: $event => ($options.rowSelected(record))
|
|
4706
4770
|
}, [
|
|
4707
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($
|
|
4771
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($data.tableHeaders, (key) => {
|
|
4708
4772
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
4709
4773
|
key: key[0]
|
|
4710
4774
|
}, [
|
|
@@ -5248,7 +5312,7 @@ const _hoisted_6$3 = {
|
|
|
5248
5312
|
key: 1,
|
|
5249
5313
|
class: "d-flex flex-column w-100 px-2"
|
|
5250
5314
|
};
|
|
5251
|
-
const _hoisted_7$2 = ["checked", "disabled"];
|
|
5315
|
+
const _hoisted_7$2 = ["checked", "onClick", "disabled"];
|
|
5252
5316
|
const _hoisted_8$2 = ["onClick"];
|
|
5253
5317
|
const _hoisted_9$2 = {
|
|
5254
5318
|
id: "permissions-content",
|
|
@@ -5348,7 +5412,7 @@ const setPermissionsChanged = ()=>{
|
|
|
5348
5412
|
permissionsChanged.value = true;
|
|
5349
5413
|
return true
|
|
5350
5414
|
};
|
|
5351
|
-
const checkAllPermissions = ()=>{
|
|
5415
|
+
const checkAllPermissions = (module)=>{
|
|
5352
5416
|
if(selectedPermissions.value.length > 0) {
|
|
5353
5417
|
selectedPermissions.value = [];
|
|
5354
5418
|
} else {
|
|
@@ -5360,6 +5424,7 @@ const checkAllPermissions = ()=>{
|
|
|
5360
5424
|
selectedPermissions.value.push(permission);
|
|
5361
5425
|
});
|
|
5362
5426
|
});
|
|
5427
|
+
selectedPermissions.value.push(module);
|
|
5363
5428
|
}
|
|
5364
5429
|
permissionsChanged.value = true;
|
|
5365
5430
|
};
|
|
@@ -5386,7 +5451,7 @@ return (_ctx, _cache) => {
|
|
|
5386
5451
|
}, [
|
|
5387
5452
|
vue.createElementVNode("input", {
|
|
5388
5453
|
checked: departmentModules.value.includes(module),
|
|
5389
|
-
onClick: checkAllPermissions,
|
|
5454
|
+
onClick: $event => (checkAllPermissions(module)),
|
|
5390
5455
|
disabled: selectedModule.value !== module,
|
|
5391
5456
|
type: "checkbox"
|
|
5392
5457
|
}, null, 8 /* PROPS */, _hoisted_7$2),
|
package/dist/library.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import Axios from 'axios';
|
|
|
2
2
|
import moment from 'moment';
|
|
3
3
|
import Swal from 'sweetalert2';
|
|
4
4
|
import NProgress from 'nprogress';
|
|
5
|
-
import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, unref, normalizeClass, resolveComponent, createBlock, resolveDynamicComponent,
|
|
5
|
+
import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, ref, onMounted, unref, normalizeClass, resolveComponent, createBlock, resolveDynamicComponent, watch, inject, mergeProps, normalizeStyle, renderSlot, createVNode, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, shallowRef, vModelCheckbox, pushScopeId, popScopeId, markRaw, computed, isRef } from 'vue';
|
|
6
6
|
import _ from 'lodash';
|
|
7
7
|
import { useRoute, useRouter } from 'vue-router';
|
|
8
8
|
import { defineStore, storeToRefs } from 'pinia';
|
|
@@ -1884,6 +1884,14 @@ var script$s = {
|
|
|
1884
1884
|
mounted () {
|
|
1885
1885
|
this.setSelectedCountry();
|
|
1886
1886
|
},
|
|
1887
|
+
watch: {
|
|
1888
|
+
modelValue: function(newVal){
|
|
1889
|
+
if(!this.input){
|
|
1890
|
+
let phone = newVal.replace('+254','');
|
|
1891
|
+
this.input = phone.replace('+1','');
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1887
1895
|
methods: {
|
|
1888
1896
|
updateValue: function () {
|
|
1889
1897
|
let phone = this.input;
|
|
@@ -1979,7 +1987,7 @@ const _hoisted_4$c = ["onClick"];
|
|
|
1979
1987
|
const _hoisted_5$a = ["id"];
|
|
1980
1988
|
const _hoisted_6$9 = ["id", "aria-labelledby"];
|
|
1981
1989
|
const _hoisted_7$7 = { key: 0 };
|
|
1982
|
-
const _hoisted_8$
|
|
1990
|
+
const _hoisted_8$6 = ["onClick"];
|
|
1983
1991
|
const _hoisted_9$6 = {
|
|
1984
1992
|
key: 1,
|
|
1985
1993
|
class: "dropdown-item sh-suggest-no-results"
|
|
@@ -2115,7 +2123,7 @@ return (_ctx, _cache) => {
|
|
|
2115
2123
|
onClick: $event => (addSuggestion(suggestion)),
|
|
2116
2124
|
class: normalizeClass(["dropdown-item", unref(selectedSuggestions).includes(suggestion) ? 'active':'']),
|
|
2117
2125
|
href: "#"
|
|
2118
|
-
}, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$
|
|
2126
|
+
}, toDisplayString(suggestion.name ?? suggestion.text), 11 /* TEXT, CLASS, PROPS */, _hoisted_8$6)
|
|
2119
2127
|
]))
|
|
2120
2128
|
: createCommentVNode("v-if", true)
|
|
2121
2129
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -2475,7 +2483,7 @@ const _hoisted_4$b = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamati
|
|
|
2475
2483
|
const _hoisted_5$9 = { key: 0 };
|
|
2476
2484
|
const _hoisted_6$8 = { key: 1 };
|
|
2477
2485
|
const _hoisted_7$6 = { class: "row" };
|
|
2478
|
-
const _hoisted_8$
|
|
2486
|
+
const _hoisted_8$5 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
|
|
2479
2487
|
const _hoisted_9$5 = { class: "col-md-12" };
|
|
2480
2488
|
const _hoisted_10$4 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
|
|
2481
2489
|
const _hoisted_11$3 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
|
|
@@ -2547,7 +2555,7 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2547
2555
|
class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
|
|
2548
2556
|
key: field
|
|
2549
2557
|
}, [
|
|
2550
|
-
createElementVNode("label", _hoisted_8$
|
|
2558
|
+
createElementVNode("label", _hoisted_8$5, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
|
|
2551
2559
|
createElementVNode("div", _hoisted_9$5, [
|
|
2552
2560
|
($options.getFieldType(field) === 'component')
|
|
2553
2561
|
? (openBlock(), createBlock(resolveDynamicComponent($props.customComponent[field]), {
|
|
@@ -2750,7 +2758,11 @@ const modelValueUpdated = (e) => {
|
|
|
2750
2758
|
onMounted(()=>{
|
|
2751
2759
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2752
2760
|
});
|
|
2753
|
-
|
|
2761
|
+
watch(()=>props.modelValue, (newValue)=>{
|
|
2762
|
+
if(newValue) {
|
|
2763
|
+
inputModel.value = newValue;
|
|
2764
|
+
}
|
|
2765
|
+
});
|
|
2754
2766
|
|
|
2755
2767
|
return (_ctx, _cache) => {
|
|
2756
2768
|
return withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -2791,7 +2803,11 @@ const modelValueUpdated = (e) => {
|
|
|
2791
2803
|
onMounted(()=>{
|
|
2792
2804
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2793
2805
|
});
|
|
2794
|
-
|
|
2806
|
+
watch(()=>props.modelValue, (newValue)=>{
|
|
2807
|
+
if(newValue) {
|
|
2808
|
+
inputModel.value = newValue;
|
|
2809
|
+
}
|
|
2810
|
+
});
|
|
2795
2811
|
|
|
2796
2812
|
return (_ctx, _cache) => {
|
|
2797
2813
|
return withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -2832,6 +2848,12 @@ onMounted(()=>{
|
|
|
2832
2848
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2833
2849
|
});
|
|
2834
2850
|
|
|
2851
|
+
watch(()=>props.modelValue, (newValue)=>{
|
|
2852
|
+
if(newValue) {
|
|
2853
|
+
inputModel.value = newValue;
|
|
2854
|
+
}
|
|
2855
|
+
});
|
|
2856
|
+
|
|
2835
2857
|
|
|
2836
2858
|
return (_ctx, _cache) => {
|
|
2837
2859
|
return withDirectives((openBlock(), createElementBlock("input", {
|
|
@@ -2869,7 +2891,11 @@ const modelValueUpdated = (e) => {
|
|
|
2869
2891
|
onMounted(()=>{
|
|
2870
2892
|
props.modelValue && (inputModel.value = props.modelValue);
|
|
2871
2893
|
});
|
|
2872
|
-
|
|
2894
|
+
watch(()=>props.modelValue, (newValue)=>{
|
|
2895
|
+
if(newValue) {
|
|
2896
|
+
inputModel.value = newValue;
|
|
2897
|
+
}
|
|
2898
|
+
});
|
|
2873
2899
|
|
|
2874
2900
|
return (_ctx, _cache) => {
|
|
2875
2901
|
return withDirectives((openBlock(), createElementBlock("textarea", {
|
|
@@ -2929,7 +2955,11 @@ onMounted(()=>{
|
|
|
2929
2955
|
});
|
|
2930
2956
|
}
|
|
2931
2957
|
});
|
|
2932
|
-
|
|
2958
|
+
watch(()=>props.modelValue, (newValue)=>{
|
|
2959
|
+
if(newValue) {
|
|
2960
|
+
inputModel.value = newValue;
|
|
2961
|
+
}
|
|
2962
|
+
});
|
|
2933
2963
|
|
|
2934
2964
|
return (_ctx, _cache) => {
|
|
2935
2965
|
return withDirectives((openBlock(), createElementBlock("select", {
|
|
@@ -2993,17 +3023,18 @@ return (_ctx, _cache) => {
|
|
|
2993
3023
|
script$k.__file = "src/lib/components/form-components/PasswordInput.vue";
|
|
2994
3024
|
|
|
2995
3025
|
const _hoisted_1$i = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
|
|
2996
|
-
const _hoisted_2$b = ["
|
|
3026
|
+
const _hoisted_2$b = ["onUpdate:modelValue"];
|
|
2997
3027
|
const _hoisted_3$a = ["innerHTML"];
|
|
2998
3028
|
const _hoisted_4$a = ["innerHTML"];
|
|
2999
|
-
const _hoisted_5$8 = ["
|
|
3000
|
-
const _hoisted_6$7 =
|
|
3029
|
+
const _hoisted_5$8 = ["innerHTML"];
|
|
3030
|
+
const _hoisted_6$7 = ["disabled"];
|
|
3031
|
+
const _hoisted_7$5 = {
|
|
3001
3032
|
key: 0,
|
|
3002
3033
|
class: "spinner-border spinner-border-sm",
|
|
3003
3034
|
role: "status",
|
|
3004
3035
|
"aria-hidden": "true"
|
|
3005
3036
|
};
|
|
3006
|
-
const
|
|
3037
|
+
const _hoisted_8$4 = { key: 1 };
|
|
3007
3038
|
|
|
3008
3039
|
|
|
3009
3040
|
var script$j = {
|
|
@@ -3082,7 +3113,7 @@ shFormElementClasses.value = inject('shFormElementClasses');
|
|
|
3082
3113
|
const shAutoForm = ref(null);
|
|
3083
3114
|
const closeModal = e => {
|
|
3084
3115
|
setTimeout(() => {
|
|
3085
|
-
const modal =
|
|
3116
|
+
const modal = shAutoForm.value.closest('.modal-dialog');
|
|
3086
3117
|
if(modal){
|
|
3087
3118
|
const closeBtn = modal.querySelector('[data-bs-dismiss="modal"]');
|
|
3088
3119
|
closeBtn && closeBtn.click();
|
|
@@ -3139,17 +3170,24 @@ const submitForm = e => {
|
|
|
3139
3170
|
return false
|
|
3140
3171
|
};
|
|
3141
3172
|
const submitBtnWidth = ref(null);
|
|
3142
|
-
const setExistingData = ()=>{
|
|
3143
|
-
console.log(props.currentData, formFields.value);
|
|
3144
|
-
const existingData = props.currentData;
|
|
3173
|
+
const setExistingData = (existingData)=>{
|
|
3145
3174
|
if (props.currentData) {
|
|
3146
|
-
formFields.value.map(
|
|
3147
|
-
|
|
3175
|
+
const newFields = formFields.value.map(fl=>{
|
|
3176
|
+
if(existingData[fl.field]) {
|
|
3177
|
+
fl.value = existingData[fl.field];
|
|
3178
|
+
}
|
|
3179
|
+
return fl
|
|
3180
|
+
// console.log(fl)
|
|
3181
|
+
// console.log(field, existingData)
|
|
3182
|
+
// existingData[field.field] && (field.value = existingData[field.field])
|
|
3148
3183
|
});
|
|
3184
|
+
formFields.value = null;
|
|
3185
|
+
console.log(newFields);
|
|
3186
|
+
formFields.value = newFields;
|
|
3149
3187
|
}
|
|
3150
3188
|
};
|
|
3151
|
-
watch(()=>props.currentData,()=>{
|
|
3152
|
-
setExistingData();
|
|
3189
|
+
watch(()=>props.currentData,(newData)=>{
|
|
3190
|
+
setExistingData(newData);
|
|
3153
3191
|
});
|
|
3154
3192
|
onMounted((ev)=>{
|
|
3155
3193
|
props.fields && props.fields.map(field=>{
|
|
@@ -3171,8 +3209,13 @@ onMounted((ev)=>{
|
|
|
3171
3209
|
value: null
|
|
3172
3210
|
});
|
|
3173
3211
|
}
|
|
3212
|
+
formFields.value.push({
|
|
3213
|
+
field: 'id',
|
|
3214
|
+
type: 'hidden'
|
|
3215
|
+
// label: 'IF'
|
|
3216
|
+
});
|
|
3174
3217
|
});
|
|
3175
|
-
setExistingData();
|
|
3218
|
+
setExistingData(props.currentData);
|
|
3176
3219
|
});
|
|
3177
3220
|
|
|
3178
3221
|
|
|
@@ -3190,42 +3233,50 @@ return (_ctx, _cache) => {
|
|
|
3190
3233
|
key: field,
|
|
3191
3234
|
class: normalizeClass(getElementClass('formGroup'))
|
|
3192
3235
|
}, [
|
|
3193
|
-
(
|
|
3194
|
-
? (openBlock(), createElementBlock("
|
|
3236
|
+
(field.type === 'hidden')
|
|
3237
|
+
? withDirectives((openBlock(), createElementBlock("input", {
|
|
3195
3238
|
key: 0,
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
}, null,
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3239
|
+
type: "hidden",
|
|
3240
|
+
"onUpdate:modelValue": $event => ((formFields.value[index].value) = $event)
|
|
3241
|
+
}, null, 8 /* PROPS */, _hoisted_2$b)), [
|
|
3242
|
+
[vModelText, formFields.value[index].value]
|
|
3243
|
+
])
|
|
3244
|
+
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3245
|
+
(!unref(isFloating) && field.label)
|
|
3246
|
+
? (openBlock(), createElementBlock("label", {
|
|
3247
|
+
key: 0,
|
|
3248
|
+
class: normalizeClass(getElementClass('formLabel')),
|
|
3249
|
+
innerHTML: field.label
|
|
3250
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_3$a))
|
|
3251
|
+
: createCommentVNode("v-if", true),
|
|
3252
|
+
(openBlock(), createBlock(resolveDynamicComponent(getFieldComponent(field)), mergeProps(getComponentProps(field), {
|
|
3253
|
+
isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
|
|
3254
|
+
onClick: $event => (removeValidationError(field.field)),
|
|
3255
|
+
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3256
|
+
modelValue: formFields.value[index].value,
|
|
3257
|
+
class: getComponentClass(field.field)
|
|
3258
|
+
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
|
|
3259
|
+
(unref(isFloating) && field.label)
|
|
3260
|
+
? (openBlock(), createElementBlock("label", {
|
|
3261
|
+
key: 1,
|
|
3262
|
+
class: normalizeClass(getElementClass('formLabel')),
|
|
3263
|
+
innerHTML: field.label
|
|
3264
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_4$a))
|
|
3265
|
+
: createCommentVNode("v-if", true),
|
|
3266
|
+
(field.helper)
|
|
3267
|
+
? (openBlock(), createElementBlock("div", {
|
|
3268
|
+
key: 2,
|
|
3269
|
+
class: normalizeClass(getElementClass('helperText')),
|
|
3270
|
+
innerHTML: field.helper
|
|
3271
|
+
}, null, 10 /* CLASS, PROPS */, _hoisted_5$8))
|
|
3272
|
+
: createCommentVNode("v-if", true),
|
|
3273
|
+
(validationErrors.value[field.field])
|
|
3274
|
+
? (openBlock(), createElementBlock("div", {
|
|
3275
|
+
key: 3,
|
|
3276
|
+
class: normalizeClass(getElementClass('invalidFeedback'))
|
|
3277
|
+
}, toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
|
|
3278
|
+
: createCommentVNode("v-if", true)
|
|
3279
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
3229
3280
|
], 2 /* CLASS */))
|
|
3230
3281
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
3231
3282
|
createElementVNode("div", {
|
|
@@ -3239,12 +3290,12 @@ return (_ctx, _cache) => {
|
|
|
3239
3290
|
class: normalizeClass(getElementClass('actionBtn'))
|
|
3240
3291
|
}, [
|
|
3241
3292
|
(loading.value)
|
|
3242
|
-
? (openBlock(), createElementBlock("span",
|
|
3293
|
+
? (openBlock(), createElementBlock("span", _hoisted_7$5))
|
|
3243
3294
|
: createCommentVNode("v-if", true),
|
|
3244
3295
|
(!loading.value)
|
|
3245
|
-
? (openBlock(), createElementBlock("span",
|
|
3296
|
+
? (openBlock(), createElementBlock("span", _hoisted_8$4, "Submit"))
|
|
3246
3297
|
: createCommentVNode("v-if", true)
|
|
3247
|
-
], 14 /* CLASS, STYLE, PROPS */,
|
|
3298
|
+
], 14 /* CLASS, STYLE, PROPS */, _hoisted_6$7)
|
|
3248
3299
|
], 2 /* CLASS */)
|
|
3249
3300
|
], 34 /* CLASS, HYDRATE_EVENTS */)
|
|
3250
3301
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -3971,7 +4022,7 @@ script$b.__file = "src/lib/components/ShSilentAction.vue";
|
|
|
3971
4022
|
|
|
3972
4023
|
var script$a = {
|
|
3973
4024
|
name: 'sh-table',
|
|
3974
|
-
props: ['endPoint', 'headers', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle'],
|
|
4025
|
+
props: ['endPoint', 'headers','query', 'pageCount', 'actions', 'hideCount', 'hideLoadMore', 'links', 'reload', 'hideSearch', 'sharedData', 'searchPlaceholder', 'event', 'displayMore', 'displayMoreBtnClass', 'moreDetailsColumns', 'moreDetailsFields', 'hasDownload', 'downloadFields', 'tableHover', 'hideIds', 'paginationStyle'],
|
|
3975
4026
|
inject: ['channel'],
|
|
3976
4027
|
data () {
|
|
3977
4028
|
return {
|
|
@@ -3992,10 +4043,14 @@ var script$a = {
|
|
|
3992
4043
|
hasCanvas: 0,
|
|
3993
4044
|
selectedRecord: null,
|
|
3994
4045
|
timeOut: null,
|
|
4046
|
+
tableHeaders: [],
|
|
3995
4047
|
pageStyle: this.paginationStyle ?? shRepo.getShConfig('tablePaginationStyle','loadMore')
|
|
3996
4048
|
}
|
|
3997
4049
|
},
|
|
3998
4050
|
mounted () {
|
|
4051
|
+
if(this.headers){
|
|
4052
|
+
this.tableHeaders = this.headers;
|
|
4053
|
+
}
|
|
3999
4054
|
if (this.event) ;
|
|
4000
4055
|
if (this.actions && this.actions.actions) {
|
|
4001
4056
|
this.actions.actions.forEach(action => {
|
|
@@ -4160,7 +4215,13 @@ var script$a = {
|
|
|
4160
4215
|
if (this.pagination_data) {
|
|
4161
4216
|
this.pagination_data.loading = 1;
|
|
4162
4217
|
}
|
|
4163
|
-
|
|
4218
|
+
let endPoint = this.endPoint;
|
|
4219
|
+
if(!this.endPoint && this.query){
|
|
4220
|
+
//send ql query
|
|
4221
|
+
endPoint = 'sh-ql';
|
|
4222
|
+
data.query = this.query;
|
|
4223
|
+
}
|
|
4224
|
+
shApis.doGet(endPoint, data).then(req => {
|
|
4164
4225
|
this.$emit('dataReloaded', this.pagination_data);
|
|
4165
4226
|
this.loading = 'done';
|
|
4166
4227
|
const response = req.data.data;
|
|
@@ -4173,6 +4234,9 @@ var script$a = {
|
|
|
4173
4234
|
loading: 0,
|
|
4174
4235
|
displayCount: response.total > response.per_page ? response.per_page : response.total
|
|
4175
4236
|
};
|
|
4237
|
+
if(!this.headers && response.total > 0){
|
|
4238
|
+
this.tableHeaders = Object.keys(response.data[0]);
|
|
4239
|
+
}
|
|
4176
4240
|
if (append) {
|
|
4177
4241
|
this.records.push(...response.data);
|
|
4178
4242
|
let totalShown = response.total > response.per_page ? response.per_page * response.current_page : response.total;
|
|
@@ -4474,7 +4538,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4474
4538
|
}, [
|
|
4475
4539
|
createElementVNode("thead", _hoisted_21, [
|
|
4476
4540
|
createElementVNode("tr", null, [
|
|
4477
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($
|
|
4541
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.tableHeaders, (title) => {
|
|
4478
4542
|
return (openBlock(), createElementBlock("th", { key: title }, [
|
|
4479
4543
|
(typeof title === 'string')
|
|
4480
4544
|
? (openBlock(), createElementBlock("a", {
|
|
@@ -4506,19 +4570,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4506
4570
|
($data.loading === 'loading')
|
|
4507
4571
|
? (openBlock(), createElementBlock("tr", _hoisted_27, [
|
|
4508
4572
|
createElementVNode("td", {
|
|
4509
|
-
colspan: $
|
|
4573
|
+
colspan: $data.tableHeaders.length
|
|
4510
4574
|
}, _hoisted_30, 8 /* PROPS */, _hoisted_28)
|
|
4511
4575
|
]))
|
|
4512
4576
|
: ($data.loading === 'error')
|
|
4513
4577
|
? (openBlock(), createElementBlock("tr", _hoisted_31, [
|
|
4514
4578
|
createElementVNode("td", {
|
|
4515
|
-
colspan: $
|
|
4579
|
+
colspan: $data.tableHeaders.length
|
|
4516
4580
|
}, toDisplayString($data.loading_error), 9 /* TEXT, PROPS */, _hoisted_32)
|
|
4517
4581
|
]))
|
|
4518
4582
|
: ($data.records.length === 0)
|
|
4519
4583
|
? (openBlock(), createElementBlock("tr", _hoisted_33, [
|
|
4520
4584
|
createElementVNode("td", {
|
|
4521
|
-
colspan: $props.actions ? $
|
|
4585
|
+
colspan: $props.actions ? $data.tableHeaders.length + 1 : $data.tableHeaders.length
|
|
4522
4586
|
}, [
|
|
4523
4587
|
_hoisted_35,
|
|
4524
4588
|
createTextVNode(" No records found ")
|
|
@@ -4531,7 +4595,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4531
4595
|
class: normalizeClass(record.class),
|
|
4532
4596
|
onClick: $event => ($options.rowSelected(record))
|
|
4533
4597
|
}, [
|
|
4534
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($
|
|
4598
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.tableHeaders, (key) => {
|
|
4535
4599
|
return (openBlock(), createElementBlock("td", { key: key }, [
|
|
4536
4600
|
(typeof key === 'string' && $props.links && $props.links[key])
|
|
4537
4601
|
? (openBlock(), createBlock(_component_router_link, {
|
|
@@ -4692,7 +4756,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4692
4756
|
class: "single-mobile-req bg-light p-3",
|
|
4693
4757
|
onClick: $event => ($options.rowSelected(record))
|
|
4694
4758
|
}, [
|
|
4695
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($
|
|
4759
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($data.tableHeaders, (key) => {
|
|
4696
4760
|
return (openBlock(), createElementBlock(Fragment, {
|
|
4697
4761
|
key: key[0]
|
|
4698
4762
|
}, [
|
|
@@ -5236,7 +5300,7 @@ const _hoisted_6$3 = {
|
|
|
5236
5300
|
key: 1,
|
|
5237
5301
|
class: "d-flex flex-column w-100 px-2"
|
|
5238
5302
|
};
|
|
5239
|
-
const _hoisted_7$2 = ["checked", "disabled"];
|
|
5303
|
+
const _hoisted_7$2 = ["checked", "onClick", "disabled"];
|
|
5240
5304
|
const _hoisted_8$2 = ["onClick"];
|
|
5241
5305
|
const _hoisted_9$2 = {
|
|
5242
5306
|
id: "permissions-content",
|
|
@@ -5336,7 +5400,7 @@ const setPermissionsChanged = ()=>{
|
|
|
5336
5400
|
permissionsChanged.value = true;
|
|
5337
5401
|
return true
|
|
5338
5402
|
};
|
|
5339
|
-
const checkAllPermissions = ()=>{
|
|
5403
|
+
const checkAllPermissions = (module)=>{
|
|
5340
5404
|
if(selectedPermissions.value.length > 0) {
|
|
5341
5405
|
selectedPermissions.value = [];
|
|
5342
5406
|
} else {
|
|
@@ -5348,6 +5412,7 @@ const checkAllPermissions = ()=>{
|
|
|
5348
5412
|
selectedPermissions.value.push(permission);
|
|
5349
5413
|
});
|
|
5350
5414
|
});
|
|
5415
|
+
selectedPermissions.value.push(module);
|
|
5351
5416
|
}
|
|
5352
5417
|
permissionsChanged.value = true;
|
|
5353
5418
|
};
|
|
@@ -5374,7 +5439,7 @@ return (_ctx, _cache) => {
|
|
|
5374
5439
|
}, [
|
|
5375
5440
|
createElementVNode("input", {
|
|
5376
5441
|
checked: departmentModules.value.includes(module),
|
|
5377
|
-
onClick: checkAllPermissions,
|
|
5442
|
+
onClick: $event => (checkAllPermissions(module)),
|
|
5378
5443
|
disabled: selectedModule.value !== module,
|
|
5379
5444
|
type: "checkbox"
|
|
5380
5445
|
}, null, 8 /* PROPS */, _hoisted_7$2),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iankibetsh/shframework",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "Vue library for handling laravel backend",
|
|
5
5
|
"main": "dist/library.js",
|
|
6
6
|
"module": "dist/library.mjs",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"axios": "^0.27.2",
|
|
26
|
+
"bootstrap": "^5.3.0-alpha1",
|
|
26
27
|
"bootstrap-icons": "^1.9.1",
|
|
27
28
|
"moment": "^2.29.3",
|
|
28
29
|
"nprogress": "^0.2.0",
|
|
@@ -37,8 +38,14 @@
|
|
|
37
38
|
"rollup-plugin-dotenv": "^0.3.0",
|
|
38
39
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
39
40
|
"rollup-plugin-vue": "^6.0.0",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
41
|
+
"@vitejs/plugin-vue": "^3.2.0",
|
|
42
|
+
"@vue/test-utils": "^2.2.4",
|
|
43
|
+
"eslint": "^8.22.0",
|
|
44
|
+
"eslint-plugin-vue": "^9.3.0",
|
|
45
|
+
"jsdom": "^20.0.3",
|
|
46
|
+
"sass": "^1.56.2",
|
|
47
|
+
"vite": "^3.2.4",
|
|
48
|
+
"vitest": "^0.25.3"
|
|
42
49
|
},
|
|
43
50
|
"dependencies": {
|
|
44
51
|
"vue-router": "^4.1.4"
|