@iankibetsh/shframework 1.3.5 → 1.3.6
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 +176 -53
- package/dist/library.mjs +175 -52
- package/package.json +1 -1
package/dist/library.js
CHANGED
|
@@ -1874,7 +1874,7 @@ const countries = [
|
|
|
1874
1874
|
}
|
|
1875
1875
|
];
|
|
1876
1876
|
|
|
1877
|
-
var script$
|
|
1877
|
+
var script$n = {
|
|
1878
1878
|
name: 'ShPhone',
|
|
1879
1879
|
props: ['modelValue', 'country_code'],
|
|
1880
1880
|
data () {
|
|
@@ -1936,7 +1936,7 @@ var script$l = {
|
|
|
1936
1936
|
}
|
|
1937
1937
|
};
|
|
1938
1938
|
|
|
1939
|
-
const _hoisted_1$
|
|
1939
|
+
const _hoisted_1$i = { class: "sh-phone mb-3" };
|
|
1940
1940
|
const _hoisted_2$c = {
|
|
1941
1941
|
key: 0,
|
|
1942
1942
|
style: {"display":"contents"}
|
|
@@ -1945,7 +1945,7 @@ const _hoisted_3$b = ["src"];
|
|
|
1945
1945
|
const _hoisted_4$b = ["value"];
|
|
1946
1946
|
|
|
1947
1947
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1948
|
-
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1948
|
+
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
1949
1949
|
($data.selectedCountry)
|
|
1950
1950
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
|
|
1951
1951
|
vue.createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$b),
|
|
@@ -1979,10 +1979,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1979
1979
|
]))
|
|
1980
1980
|
}
|
|
1981
1981
|
|
|
1982
|
-
script$
|
|
1983
|
-
script$
|
|
1982
|
+
script$n.render = render$7;
|
|
1983
|
+
script$n.__file = "src/lib/components/form-components/ShPhone.vue";
|
|
1984
1984
|
|
|
1985
|
-
var script$
|
|
1985
|
+
var script$m = {
|
|
1986
1986
|
name: 'ShEditor',
|
|
1987
1987
|
props: ['modelValue'],
|
|
1988
1988
|
components: {
|
|
@@ -2021,7 +2021,7 @@ var script$k = {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
};
|
|
2023
2023
|
|
|
2024
|
-
const _hoisted_1$
|
|
2024
|
+
const _hoisted_1$h = /*#__PURE__*/vue.createElementVNode("textarea", {
|
|
2025
2025
|
id: "tiny",
|
|
2026
2026
|
style: {"display":"none"},
|
|
2027
2027
|
"data-cy": "tinymce_editor"
|
|
@@ -2031,7 +2031,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2031
2031
|
const _component_editor = vue.resolveComponent("editor");
|
|
2032
2032
|
|
|
2033
2033
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
2034
|
-
_hoisted_1$
|
|
2034
|
+
_hoisted_1$h,
|
|
2035
2035
|
vue.createElementVNode("div", {
|
|
2036
2036
|
onFocusin: _cache[1] || (_cache[1] = vue.withModifiers(() => {}, ["stop"])),
|
|
2037
2037
|
class: "sh-editor w-100"
|
|
@@ -2056,10 +2056,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2056
2056
|
], 64 /* STABLE_FRAGMENT */))
|
|
2057
2057
|
}
|
|
2058
2058
|
|
|
2059
|
-
script$
|
|
2060
|
-
script$
|
|
2059
|
+
script$m.render = render$6;
|
|
2060
|
+
script$m.__file = "src/lib/components/form-components/ShEditor.vue";
|
|
2061
2061
|
|
|
2062
|
-
const _hoisted_1$
|
|
2062
|
+
const _hoisted_1$g = {
|
|
2063
2063
|
key: 0,
|
|
2064
2064
|
class: "dropdown sh-suggest"
|
|
2065
2065
|
};
|
|
@@ -2080,7 +2080,7 @@ const _hoisted_10$3 = {
|
|
|
2080
2080
|
};
|
|
2081
2081
|
|
|
2082
2082
|
|
|
2083
|
-
var script$
|
|
2083
|
+
var script$l = {
|
|
2084
2084
|
__name: 'ShSuggest',
|
|
2085
2085
|
props: ['fillSelects','modelValue'],
|
|
2086
2086
|
emits: ['update:modelValue'],
|
|
@@ -2161,7 +2161,7 @@ function filterData(e){
|
|
|
2161
2161
|
|
|
2162
2162
|
return (_ctx, _cache) => {
|
|
2163
2163
|
return (vue.unref(id))
|
|
2164
|
-
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
2164
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
|
|
2165
2165
|
vue.createElementVNode("div", {
|
|
2166
2166
|
id: vue.unref(id),
|
|
2167
2167
|
"data-bs-toggle": "dropdown",
|
|
@@ -2221,15 +2221,15 @@ return (_ctx, _cache) => {
|
|
|
2221
2221
|
|
|
2222
2222
|
};
|
|
2223
2223
|
|
|
2224
|
-
script$
|
|
2225
|
-
script$
|
|
2224
|
+
script$l.__scopeId = "data-v-71cc9569";
|
|
2225
|
+
script$l.__file = "src/lib/components/form-components/ShSuggest.vue";
|
|
2226
2226
|
|
|
2227
|
-
var script$
|
|
2227
|
+
var script$k = {
|
|
2228
2228
|
name: 'ShForm',
|
|
2229
2229
|
components: {
|
|
2230
|
-
ShSuggest: script$
|
|
2231
|
-
ShEditor: script$
|
|
2232
|
-
ShPhone: script$
|
|
2230
|
+
ShSuggest: script$l,
|
|
2231
|
+
ShEditor: script$m,
|
|
2232
|
+
ShPhone: script$n
|
|
2233
2233
|
},
|
|
2234
2234
|
props: [
|
|
2235
2235
|
'action',
|
|
@@ -2547,7 +2547,7 @@ var script$i = {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
};
|
|
2549
2549
|
|
|
2550
|
-
const _hoisted_1$
|
|
2550
|
+
const _hoisted_1$f = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
|
|
2551
2551
|
const _hoisted_2$a = {
|
|
2552
2552
|
ref: "ShAutoForm",
|
|
2553
2553
|
class: "sh-form"
|
|
@@ -2609,7 +2609,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2609
2609
|
const _component_ShEditor = vue.resolveComponent("ShEditor");
|
|
2610
2610
|
|
|
2611
2611
|
return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
2612
|
-
_hoisted_1$
|
|
2612
|
+
_hoisted_1$f,
|
|
2613
2613
|
vue.createElementVNode("form", _hoisted_2$a, [
|
|
2614
2614
|
vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
|
|
2615
2615
|
vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
|
|
@@ -2826,10 +2826,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2826
2826
|
], 64 /* STABLE_FRAGMENT */))
|
|
2827
2827
|
}
|
|
2828
2828
|
|
|
2829
|
-
script$
|
|
2830
|
-
script$
|
|
2829
|
+
script$k.render = render$5;
|
|
2830
|
+
script$k.__file = "src/lib/components/ShForm.vue";
|
|
2831
2831
|
|
|
2832
|
-
var script$
|
|
2832
|
+
var script$j = {
|
|
2833
2833
|
__name: 'EmailInput',
|
|
2834
2834
|
props: ['modelValue','label'],
|
|
2835
2835
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2865,11 +2865,14 @@ return (_ctx, _cache) => {
|
|
|
2865
2865
|
|
|
2866
2866
|
};
|
|
2867
2867
|
|
|
2868
|
-
script$
|
|
2868
|
+
script$j.__file = "src/lib/components/form-components/EmailInput.vue";
|
|
2869
2869
|
|
|
2870
|
-
|
|
2870
|
+
const _hoisted_1$e = ["min", "max"];
|
|
2871
|
+
|
|
2872
|
+
|
|
2873
|
+
var script$i = {
|
|
2871
2874
|
__name: 'NumberInput',
|
|
2872
|
-
props: ['modelValue','label'],
|
|
2875
|
+
props: ['modelValue','label','min','max'],
|
|
2873
2876
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
2874
2877
|
setup(__props, { emit }) {
|
|
2875
2878
|
|
|
@@ -2890,12 +2893,14 @@ vue.onMounted(()=>{
|
|
|
2890
2893
|
|
|
2891
2894
|
return (_ctx, _cache) => {
|
|
2892
2895
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
2896
|
+
min: __props.min,
|
|
2897
|
+
max: __props.max,
|
|
2893
2898
|
type: "number",
|
|
2894
2899
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
2895
2900
|
onChange: modelValueUpdated,
|
|
2896
2901
|
onKeydown: modelValueUpdated,
|
|
2897
2902
|
onUpdated: modelValueUpdated
|
|
2898
|
-
}, null,
|
|
2903
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$e)), [
|
|
2899
2904
|
[vue.vModelText, inputModel.value]
|
|
2900
2905
|
])
|
|
2901
2906
|
}
|
|
@@ -2903,9 +2908,9 @@ return (_ctx, _cache) => {
|
|
|
2903
2908
|
|
|
2904
2909
|
};
|
|
2905
2910
|
|
|
2906
|
-
script$
|
|
2911
|
+
script$i.__file = "src/lib/components/form-components/NumberInput.vue";
|
|
2907
2912
|
|
|
2908
|
-
var script$
|
|
2913
|
+
var script$h = {
|
|
2909
2914
|
__name: 'TextInput',
|
|
2910
2915
|
props: ['modelValue','label'],
|
|
2911
2916
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2941,9 +2946,9 @@ return (_ctx, _cache) => {
|
|
|
2941
2946
|
|
|
2942
2947
|
};
|
|
2943
2948
|
|
|
2944
|
-
script$
|
|
2949
|
+
script$h.__file = "src/lib/components/form-components/TextInput.vue";
|
|
2945
2950
|
|
|
2946
|
-
var script$
|
|
2951
|
+
var script$g = {
|
|
2947
2952
|
__name: 'TextAreaInput',
|
|
2948
2953
|
props: ['modelValue','label'],
|
|
2949
2954
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2979,7 +2984,111 @@ return (_ctx, _cache) => {
|
|
|
2979
2984
|
|
|
2980
2985
|
};
|
|
2981
2986
|
|
|
2982
|
-
script$
|
|
2987
|
+
script$g.__file = "src/lib/components/form-components/TextAreaInput.vue";
|
|
2988
|
+
|
|
2989
|
+
const _hoisted_1$d = ["value"];
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
var script$f = {
|
|
2993
|
+
__name: 'SelectInput',
|
|
2994
|
+
props: ['modelValue','label','data','dataUrl'],
|
|
2995
|
+
emits: ['update:modelValue','clearValidationErrors'],
|
|
2996
|
+
setup(__props, { emit }) {
|
|
2997
|
+
|
|
2998
|
+
const props = __props;
|
|
2999
|
+
|
|
3000
|
+
|
|
3001
|
+
|
|
3002
|
+
const inputModel = vue.ref(null);
|
|
3003
|
+
const selectOptions = vue.ref(null);
|
|
3004
|
+
const modelValueUpdated = (e) => {
|
|
3005
|
+
emit('clearValidationErrors');
|
|
3006
|
+
emit('update:modelValue',inputModel);
|
|
3007
|
+
};
|
|
3008
|
+
vue.onMounted(()=>{
|
|
3009
|
+
props.modelValue && (inputModel.value = props.modelValue);
|
|
3010
|
+
if(props.data){
|
|
3011
|
+
selectOptions.value = props.data.map(item=>{
|
|
3012
|
+
return {
|
|
3013
|
+
id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
|
|
3014
|
+
name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
|
|
3015
|
+
}
|
|
3016
|
+
});
|
|
3017
|
+
} else if (props.dataUrl){
|
|
3018
|
+
shApis.doGet(props.dataUrl,{all:1}).then(res=>{
|
|
3019
|
+
selectOptions.value = res.data.map(item=>{
|
|
3020
|
+
return {
|
|
3021
|
+
id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
|
|
3022
|
+
name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
|
|
3023
|
+
}
|
|
3024
|
+
});
|
|
3025
|
+
}).catch(ex=>{
|
|
3026
|
+
console.log(ex);
|
|
3027
|
+
});
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
|
|
3031
|
+
|
|
3032
|
+
return (_ctx, _cache) => {
|
|
3033
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
|
|
3034
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
3035
|
+
onChange: modelValueUpdated,
|
|
3036
|
+
onKeydown: modelValueUpdated,
|
|
3037
|
+
onUpdated: modelValueUpdated
|
|
3038
|
+
}, [
|
|
3039
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selectOptions.value, (option) => {
|
|
3040
|
+
return (vue.openBlock(), vue.createElementBlock("option", {
|
|
3041
|
+
key: option.id,
|
|
3042
|
+
value: option.id
|
|
3043
|
+
}, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$d))
|
|
3044
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
3045
|
+
], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
|
|
3046
|
+
[vue.vModelSelect, inputModel.value]
|
|
3047
|
+
])
|
|
3048
|
+
}
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
};
|
|
3052
|
+
|
|
3053
|
+
script$f.__file = "src/lib/components/form-components/SelectInput.vue";
|
|
3054
|
+
|
|
3055
|
+
var script$e = {
|
|
3056
|
+
__name: 'PasswordInput',
|
|
3057
|
+
props: ['modelValue','label'],
|
|
3058
|
+
emits: ['update:modelValue','clearValidationErrors'],
|
|
3059
|
+
setup(__props, { emit }) {
|
|
3060
|
+
|
|
3061
|
+
const props = __props;
|
|
3062
|
+
|
|
3063
|
+
|
|
3064
|
+
|
|
3065
|
+
const inputModel = vue.ref(null);
|
|
3066
|
+
|
|
3067
|
+
const modelValueUpdated = (e) => {
|
|
3068
|
+
emit('clearValidationErrors');
|
|
3069
|
+
emit('update:modelValue',inputModel);
|
|
3070
|
+
};
|
|
3071
|
+
vue.onMounted(()=>{
|
|
3072
|
+
props.modelValue && (inputModel.value = props.modelValue);
|
|
3073
|
+
});
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
return (_ctx, _cache) => {
|
|
3077
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
3078
|
+
type: "password",
|
|
3079
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
3080
|
+
onChange: modelValueUpdated,
|
|
3081
|
+
onKeydown: modelValueUpdated,
|
|
3082
|
+
onUpdated: modelValueUpdated
|
|
3083
|
+
}, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
|
|
3084
|
+
[vue.vModelText, inputModel.value]
|
|
3085
|
+
])
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
};
|
|
3090
|
+
|
|
3091
|
+
script$e.__file = "src/lib/components/form-components/PasswordInput.vue";
|
|
2983
3092
|
|
|
2984
3093
|
const _hoisted_1$c = /*#__PURE__*/vue.createElementVNode("div", null, null, -1 /* HOISTED */);
|
|
2985
3094
|
const _hoisted_2$9 = ["innerHTML"];
|
|
@@ -3015,26 +3124,42 @@ const props = __props;
|
|
|
3015
3124
|
|
|
3016
3125
|
|
|
3017
3126
|
const formFields = vue.ref([]);
|
|
3018
|
-
const getFieldComponent = (
|
|
3127
|
+
const getFieldComponent = (fieldObj)=>{
|
|
3128
|
+
const field = fieldObj.field;
|
|
3019
3129
|
const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
|
|
3020
3130
|
const defaultNumbers = ['age'];
|
|
3131
|
+
const passwords = ['password','password_confirmation','pin'];
|
|
3021
3132
|
const defaultPhones = ['phone'];
|
|
3022
|
-
const defaultEmails = ['
|
|
3133
|
+
const defaultEmails = ['email'];
|
|
3023
3134
|
const formComponents = vue.inject('formComponents');
|
|
3135
|
+
const TextComponent = formComponents.text ?? script$h;
|
|
3136
|
+
const TextAreaComponent = formComponents.textArea ?? script$g;
|
|
3137
|
+
const EmailComponent = formComponents.email ?? script$j;
|
|
3138
|
+
const PhoneComponent = formComponents.phone ?? script$n;
|
|
3139
|
+
const NumberComponent = formComponents.number ?? script$i;
|
|
3140
|
+
const SelectComponent = formComponents.select ?? script$f;
|
|
3141
|
+
const PasswordComponent = formComponents.password ?? script$e;
|
|
3024
3142
|
if(props.customComponents && props.customComponents[field]) {
|
|
3025
3143
|
return props.customComponents[field]
|
|
3026
|
-
}
|
|
3144
|
+
}
|
|
3145
|
+
if(fieldObj.type){
|
|
3146
|
+
return fieldObj.type === 'number' ? NumberComponent:fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type ? SelectComponent:TextComponent
|
|
3147
|
+
}else
|
|
3148
|
+
if(passwords.includes(field)){
|
|
3149
|
+
return PasswordComponent
|
|
3150
|
+
}
|
|
3151
|
+
else
|
|
3027
3152
|
if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
|
|
3028
|
-
return formComponents.textArea ?? script$
|
|
3153
|
+
return formComponents.textArea ?? script$g
|
|
3029
3154
|
} else
|
|
3030
3155
|
if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
|
|
3031
|
-
return formComponents.email ?? script$
|
|
3156
|
+
return formComponents.email ?? script$j
|
|
3032
3157
|
} else
|
|
3033
3158
|
if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
|
|
3034
|
-
return formComponents.phone ?? script$
|
|
3159
|
+
return formComponents.phone ?? script$n
|
|
3035
3160
|
} else
|
|
3036
3161
|
if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
|
|
3037
|
-
return formComponents.number ?? script$
|
|
3162
|
+
return formComponents.number ?? script$i
|
|
3038
3163
|
}
|
|
3039
3164
|
// else
|
|
3040
3165
|
// if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
|
|
@@ -3043,7 +3168,7 @@ const getFieldComponent = (field)=>{
|
|
|
3043
3168
|
// if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
|
|
3044
3169
|
// return formComponents.date ?? DateInput
|
|
3045
3170
|
// }
|
|
3046
|
-
return formComponents.text ?? script$
|
|
3171
|
+
return formComponents.text ?? script$h
|
|
3047
3172
|
};
|
|
3048
3173
|
const shFormElementClasses = vue.ref(null);
|
|
3049
3174
|
shFormElementClasses.value = vue.inject('shFormElementClasses');
|
|
@@ -3110,7 +3235,6 @@ vue.onMounted((ev)=>{
|
|
|
3110
3235
|
fieldObj.label && getLabel(fieldObj.field);
|
|
3111
3236
|
!fieldObj.helper && fieldObj.helperText ? fieldObj.helper = fieldObj.helperText : fieldObj.helper = getHelperText(fieldObj.field);
|
|
3112
3237
|
fieldObj.helperText === undefined && (fieldObj.label = getLabel(fieldObj.field));
|
|
3113
|
-
fieldObj.component && getfieldObjComponent(fieldObj.field);
|
|
3114
3238
|
fieldObj.placeholder && fieldObj.placeHolder && getPlaceholder(fieldObj.field);
|
|
3115
3239
|
fieldObj.value = null;
|
|
3116
3240
|
formFields.value.push(fieldObj);
|
|
@@ -3118,7 +3242,6 @@ vue.onMounted((ev)=>{
|
|
|
3118
3242
|
formFields.value.push({
|
|
3119
3243
|
field:field,label: getLabel(field),
|
|
3120
3244
|
helper: getHelperText(field),
|
|
3121
|
-
component: getFieldComponent(field),
|
|
3122
3245
|
placeholder: getPlaceholder(field),
|
|
3123
3246
|
value: null
|
|
3124
3247
|
});
|
|
@@ -3148,7 +3271,7 @@ return (_ctx, _cache) => {
|
|
|
3148
3271
|
innerHTML: field.label
|
|
3149
3272
|
}, null, 10 /* CLASS, PROPS */, _hoisted_2$9))
|
|
3150
3273
|
: vue.createCommentVNode("v-if", true),
|
|
3151
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field
|
|
3274
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field)), vue.mergeProps(getComponentProps(field), {
|
|
3152
3275
|
onClick: $event => (removeValidationError(field.field)),
|
|
3153
3276
|
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3154
3277
|
modelValue: formFields.value[index].value,
|
|
@@ -3254,7 +3377,7 @@ return (_ctx, _cache) => {
|
|
|
3254
3377
|
class: "dropdown-menu px-2 py-1",
|
|
3255
3378
|
"aria-labelledby": dropdownId
|
|
3256
3379
|
}, [
|
|
3257
|
-
vue.createVNode(script$
|
|
3380
|
+
vue.createVNode(script$k, vue.normalizeProps(vue.guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
|
|
3258
3381
|
])
|
|
3259
3382
|
])
|
|
3260
3383
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -3358,7 +3481,7 @@ return (_ctx, _cache) => {
|
|
|
3358
3481
|
"modal-title": __props.modalTitle
|
|
3359
3482
|
}, {
|
|
3360
3483
|
default: vue.withCtx(() => [
|
|
3361
|
-
vue.createVNode(script$
|
|
3484
|
+
vue.createVNode(script$k, vue.mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
|
|
3362
3485
|
]),
|
|
3363
3486
|
_: 1 /* STABLE */
|
|
3364
3487
|
}, 8 /* PROPS */, ["modal-title"])
|
|
@@ -5024,7 +5147,7 @@ return (_ctx, _cache) => {
|
|
|
5024
5147
|
"modal-title": "Department Form"
|
|
5025
5148
|
}, {
|
|
5026
5149
|
default: vue.withCtx(() => [
|
|
5027
|
-
vue.createVNode(script$
|
|
5150
|
+
vue.createVNode(script$k, {
|
|
5028
5151
|
"success-callback": "departmentAdded",
|
|
5029
5152
|
onDepartmentAdded: departmentAdded,
|
|
5030
5153
|
action: "admin/departments/store",
|
|
@@ -5183,7 +5306,7 @@ return (_ctx, _cache) => {
|
|
|
5183
5306
|
"modal-title": "Add Module Department"
|
|
5184
5307
|
}, {
|
|
5185
5308
|
default: vue.withCtx(() => [
|
|
5186
|
-
vue.createVNode(script$
|
|
5309
|
+
vue.createVNode(script$k, {
|
|
5187
5310
|
"reload-select-items": vue.unref(reload),
|
|
5188
5311
|
"success-callback": moduleAdded,
|
|
5189
5312
|
"fill-selects": {
|
|
@@ -5320,7 +5443,7 @@ return (_ctx, _cache) => {
|
|
|
5320
5443
|
: (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
5321
5444
|
(section.value === 'login')
|
|
5322
5445
|
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
5323
|
-
vue.createVNode(script$
|
|
5446
|
+
vue.createVNode(script$k, {
|
|
5324
5447
|
class: "sh-login-form",
|
|
5325
5448
|
fields: ['email','password'],
|
|
5326
5449
|
"action-label": "Login",
|
|
@@ -5345,7 +5468,7 @@ return (_ctx, _cache) => {
|
|
|
5345
5468
|
(vue.unref(registerSubTitle))
|
|
5346
5469
|
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8, vue.toDisplayString(vue.unref(registerSubTitle)), 1 /* TEXT */))
|
|
5347
5470
|
: vue.createCommentVNode("v-if", true),
|
|
5348
|
-
vue.createVNode(script$
|
|
5471
|
+
vue.createVNode(script$k, {
|
|
5349
5472
|
class: "sh-login-form",
|
|
5350
5473
|
fields: vue.unref(registrationFields),
|
|
5351
5474
|
"action-label": "Sign Up",
|
|
@@ -5392,7 +5515,7 @@ const ShFrontend = {
|
|
|
5392
5515
|
const registerTitle = options.registerTitle ?? 'Create a new account';
|
|
5393
5516
|
const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
|
|
5394
5517
|
const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
|
|
5395
|
-
options.formTextInput ?? script$
|
|
5518
|
+
options.formTextInput ?? script$h;
|
|
5396
5519
|
const loginUrl = options.loginUrl ?? `/login`;
|
|
5397
5520
|
const redirectLogin = options.redirectLogin ?? `/`;
|
|
5398
5521
|
const redirectRegister = options.redirectRegister ?? `/`;
|
|
@@ -5438,11 +5561,11 @@ exports.ShCanvas = script$9;
|
|
|
5438
5561
|
exports.ShConfirmAction = script$7;
|
|
5439
5562
|
exports.ShDropDownForm = script$c;
|
|
5440
5563
|
exports.ShDynamicTabs = script$3;
|
|
5441
|
-
exports.ShForm = script$
|
|
5564
|
+
exports.ShForm = script$k;
|
|
5442
5565
|
exports.ShFrontend = ShFrontend;
|
|
5443
5566
|
exports.ShModal = script$b;
|
|
5444
5567
|
exports.ShModalForm = script$a;
|
|
5445
|
-
exports.ShPhone = script$
|
|
5568
|
+
exports.ShPhone = script$n;
|
|
5446
5569
|
exports.ShSilentAction = script$6;
|
|
5447
5570
|
exports.ShTable = script$5;
|
|
5448
5571
|
exports.ShTabs = script$4;
|
package/dist/library.mjs
CHANGED
|
@@ -1861,7 +1861,7 @@ const countries = [
|
|
|
1861
1861
|
}
|
|
1862
1862
|
];
|
|
1863
1863
|
|
|
1864
|
-
var script$
|
|
1864
|
+
var script$n = {
|
|
1865
1865
|
name: 'ShPhone',
|
|
1866
1866
|
props: ['modelValue', 'country_code'],
|
|
1867
1867
|
data () {
|
|
@@ -1923,7 +1923,7 @@ var script$l = {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
};
|
|
1925
1925
|
|
|
1926
|
-
const _hoisted_1$
|
|
1926
|
+
const _hoisted_1$i = { class: "sh-phone mb-3" };
|
|
1927
1927
|
const _hoisted_2$c = {
|
|
1928
1928
|
key: 0,
|
|
1929
1929
|
style: {"display":"contents"}
|
|
@@ -1932,7 +1932,7 @@ const _hoisted_3$b = ["src"];
|
|
|
1932
1932
|
const _hoisted_4$b = ["value"];
|
|
1933
1933
|
|
|
1934
1934
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1935
|
-
return (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1935
|
+
return (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1936
1936
|
($data.selectedCountry)
|
|
1937
1937
|
? (openBlock(), createElementBlock("div", _hoisted_2$c, [
|
|
1938
1938
|
createElementVNode("img", { src: $data.flag }, null, 8 /* PROPS */, _hoisted_3$b),
|
|
@@ -1966,10 +1966,10 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1966
1966
|
]))
|
|
1967
1967
|
}
|
|
1968
1968
|
|
|
1969
|
-
script$
|
|
1970
|
-
script$
|
|
1969
|
+
script$n.render = render$7;
|
|
1970
|
+
script$n.__file = "src/lib/components/form-components/ShPhone.vue";
|
|
1971
1971
|
|
|
1972
|
-
var script$
|
|
1972
|
+
var script$m = {
|
|
1973
1973
|
name: 'ShEditor',
|
|
1974
1974
|
props: ['modelValue'],
|
|
1975
1975
|
components: {
|
|
@@ -2008,7 +2008,7 @@ var script$k = {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
};
|
|
2010
2010
|
|
|
2011
|
-
const _hoisted_1$
|
|
2011
|
+
const _hoisted_1$h = /*#__PURE__*/createElementVNode("textarea", {
|
|
2012
2012
|
id: "tiny",
|
|
2013
2013
|
style: {"display":"none"},
|
|
2014
2014
|
"data-cy": "tinymce_editor"
|
|
@@ -2018,7 +2018,7 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2018
2018
|
const _component_editor = resolveComponent("editor");
|
|
2019
2019
|
|
|
2020
2020
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
2021
|
-
_hoisted_1$
|
|
2021
|
+
_hoisted_1$h,
|
|
2022
2022
|
createElementVNode("div", {
|
|
2023
2023
|
onFocusin: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"])),
|
|
2024
2024
|
class: "sh-editor w-100"
|
|
@@ -2043,10 +2043,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2043
2043
|
], 64 /* STABLE_FRAGMENT */))
|
|
2044
2044
|
}
|
|
2045
2045
|
|
|
2046
|
-
script$
|
|
2047
|
-
script$
|
|
2046
|
+
script$m.render = render$6;
|
|
2047
|
+
script$m.__file = "src/lib/components/form-components/ShEditor.vue";
|
|
2048
2048
|
|
|
2049
|
-
const _hoisted_1$
|
|
2049
|
+
const _hoisted_1$g = {
|
|
2050
2050
|
key: 0,
|
|
2051
2051
|
class: "dropdown sh-suggest"
|
|
2052
2052
|
};
|
|
@@ -2067,7 +2067,7 @@ const _hoisted_10$3 = {
|
|
|
2067
2067
|
};
|
|
2068
2068
|
|
|
2069
2069
|
|
|
2070
|
-
var script$
|
|
2070
|
+
var script$l = {
|
|
2071
2071
|
__name: 'ShSuggest',
|
|
2072
2072
|
props: ['fillSelects','modelValue'],
|
|
2073
2073
|
emits: ['update:modelValue'],
|
|
@@ -2148,7 +2148,7 @@ function filterData(e){
|
|
|
2148
2148
|
|
|
2149
2149
|
return (_ctx, _cache) => {
|
|
2150
2150
|
return (unref(id))
|
|
2151
|
-
? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2151
|
+
? (openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
2152
2152
|
createElementVNode("div", {
|
|
2153
2153
|
id: unref(id),
|
|
2154
2154
|
"data-bs-toggle": "dropdown",
|
|
@@ -2208,15 +2208,15 @@ return (_ctx, _cache) => {
|
|
|
2208
2208
|
|
|
2209
2209
|
};
|
|
2210
2210
|
|
|
2211
|
-
script$
|
|
2212
|
-
script$
|
|
2211
|
+
script$l.__scopeId = "data-v-71cc9569";
|
|
2212
|
+
script$l.__file = "src/lib/components/form-components/ShSuggest.vue";
|
|
2213
2213
|
|
|
2214
|
-
var script$
|
|
2214
|
+
var script$k = {
|
|
2215
2215
|
name: 'ShForm',
|
|
2216
2216
|
components: {
|
|
2217
|
-
ShSuggest: script$
|
|
2218
|
-
ShEditor: script$
|
|
2219
|
-
ShPhone: script$
|
|
2217
|
+
ShSuggest: script$l,
|
|
2218
|
+
ShEditor: script$m,
|
|
2219
|
+
ShPhone: script$n
|
|
2220
2220
|
},
|
|
2221
2221
|
props: [
|
|
2222
2222
|
'action',
|
|
@@ -2534,7 +2534,7 @@ var script$i = {
|
|
|
2534
2534
|
}
|
|
2535
2535
|
};
|
|
2536
2536
|
|
|
2537
|
-
const _hoisted_1$
|
|
2537
|
+
const _hoisted_1$f = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
|
|
2538
2538
|
const _hoisted_2$a = {
|
|
2539
2539
|
ref: "ShAutoForm",
|
|
2540
2540
|
class: "sh-form"
|
|
@@ -2596,7 +2596,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2596
2596
|
const _component_ShEditor = resolveComponent("ShEditor");
|
|
2597
2597
|
|
|
2598
2598
|
return (openBlock(), createElementBlock(Fragment, null, [
|
|
2599
|
-
_hoisted_1$
|
|
2599
|
+
_hoisted_1$f,
|
|
2600
2600
|
createElementVNode("form", _hoisted_2$a, [
|
|
2601
2601
|
createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
|
|
2602
2602
|
createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
|
|
@@ -2813,10 +2813,10 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2813
2813
|
], 64 /* STABLE_FRAGMENT */))
|
|
2814
2814
|
}
|
|
2815
2815
|
|
|
2816
|
-
script$
|
|
2817
|
-
script$
|
|
2816
|
+
script$k.render = render$5;
|
|
2817
|
+
script$k.__file = "src/lib/components/ShForm.vue";
|
|
2818
2818
|
|
|
2819
|
-
var script$
|
|
2819
|
+
var script$j = {
|
|
2820
2820
|
__name: 'EmailInput',
|
|
2821
2821
|
props: ['modelValue','label'],
|
|
2822
2822
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2852,11 +2852,14 @@ return (_ctx, _cache) => {
|
|
|
2852
2852
|
|
|
2853
2853
|
};
|
|
2854
2854
|
|
|
2855
|
-
script$
|
|
2855
|
+
script$j.__file = "src/lib/components/form-components/EmailInput.vue";
|
|
2856
2856
|
|
|
2857
|
-
|
|
2857
|
+
const _hoisted_1$e = ["min", "max"];
|
|
2858
|
+
|
|
2859
|
+
|
|
2860
|
+
var script$i = {
|
|
2858
2861
|
__name: 'NumberInput',
|
|
2859
|
-
props: ['modelValue','label'],
|
|
2862
|
+
props: ['modelValue','label','min','max'],
|
|
2860
2863
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
2861
2864
|
setup(__props, { emit }) {
|
|
2862
2865
|
|
|
@@ -2877,12 +2880,14 @@ onMounted(()=>{
|
|
|
2877
2880
|
|
|
2878
2881
|
return (_ctx, _cache) => {
|
|
2879
2882
|
return withDirectives((openBlock(), createElementBlock("input", {
|
|
2883
|
+
min: __props.min,
|
|
2884
|
+
max: __props.max,
|
|
2880
2885
|
type: "number",
|
|
2881
2886
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
2882
2887
|
onChange: modelValueUpdated,
|
|
2883
2888
|
onKeydown: modelValueUpdated,
|
|
2884
2889
|
onUpdated: modelValueUpdated
|
|
2885
|
-
}, null,
|
|
2890
|
+
}, null, 40 /* PROPS, HYDRATE_EVENTS */, _hoisted_1$e)), [
|
|
2886
2891
|
[vModelText, inputModel.value]
|
|
2887
2892
|
])
|
|
2888
2893
|
}
|
|
@@ -2890,9 +2895,9 @@ return (_ctx, _cache) => {
|
|
|
2890
2895
|
|
|
2891
2896
|
};
|
|
2892
2897
|
|
|
2893
|
-
script$
|
|
2898
|
+
script$i.__file = "src/lib/components/form-components/NumberInput.vue";
|
|
2894
2899
|
|
|
2895
|
-
var script$
|
|
2900
|
+
var script$h = {
|
|
2896
2901
|
__name: 'TextInput',
|
|
2897
2902
|
props: ['modelValue','label'],
|
|
2898
2903
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2928,9 +2933,9 @@ return (_ctx, _cache) => {
|
|
|
2928
2933
|
|
|
2929
2934
|
};
|
|
2930
2935
|
|
|
2931
|
-
script$
|
|
2936
|
+
script$h.__file = "src/lib/components/form-components/TextInput.vue";
|
|
2932
2937
|
|
|
2933
|
-
var script$
|
|
2938
|
+
var script$g = {
|
|
2934
2939
|
__name: 'TextAreaInput',
|
|
2935
2940
|
props: ['modelValue','label'],
|
|
2936
2941
|
emits: ['update:modelValue','clearValidationErrors'],
|
|
@@ -2966,7 +2971,111 @@ return (_ctx, _cache) => {
|
|
|
2966
2971
|
|
|
2967
2972
|
};
|
|
2968
2973
|
|
|
2969
|
-
script$
|
|
2974
|
+
script$g.__file = "src/lib/components/form-components/TextAreaInput.vue";
|
|
2975
|
+
|
|
2976
|
+
const _hoisted_1$d = ["value"];
|
|
2977
|
+
|
|
2978
|
+
|
|
2979
|
+
var script$f = {
|
|
2980
|
+
__name: 'SelectInput',
|
|
2981
|
+
props: ['modelValue','label','data','dataUrl'],
|
|
2982
|
+
emits: ['update:modelValue','clearValidationErrors'],
|
|
2983
|
+
setup(__props, { emit }) {
|
|
2984
|
+
|
|
2985
|
+
const props = __props;
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
|
|
2989
|
+
const inputModel = ref(null);
|
|
2990
|
+
const selectOptions = ref(null);
|
|
2991
|
+
const modelValueUpdated = (e) => {
|
|
2992
|
+
emit('clearValidationErrors');
|
|
2993
|
+
emit('update:modelValue',inputModel);
|
|
2994
|
+
};
|
|
2995
|
+
onMounted(()=>{
|
|
2996
|
+
props.modelValue && (inputModel.value = props.modelValue);
|
|
2997
|
+
if(props.data){
|
|
2998
|
+
selectOptions.value = props.data.map(item=>{
|
|
2999
|
+
return {
|
|
3000
|
+
id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
|
|
3001
|
+
name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
3004
|
+
} else if (props.dataUrl){
|
|
3005
|
+
shApis.doGet(props.dataUrl,{all:1}).then(res=>{
|
|
3006
|
+
selectOptions.value = res.data.map(item=>{
|
|
3007
|
+
return {
|
|
3008
|
+
id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
|
|
3009
|
+
name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
}).catch(ex=>{
|
|
3013
|
+
console.log(ex);
|
|
3014
|
+
});
|
|
3015
|
+
}
|
|
3016
|
+
});
|
|
3017
|
+
|
|
3018
|
+
|
|
3019
|
+
return (_ctx, _cache) => {
|
|
3020
|
+
return withDirectives((openBlock(), createElementBlock("select", {
|
|
3021
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
3022
|
+
onChange: modelValueUpdated,
|
|
3023
|
+
onKeydown: modelValueUpdated,
|
|
3024
|
+
onUpdated: modelValueUpdated
|
|
3025
|
+
}, [
|
|
3026
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(selectOptions.value, (option) => {
|
|
3027
|
+
return (openBlock(), createElementBlock("option", {
|
|
3028
|
+
key: option.id,
|
|
3029
|
+
value: option.id
|
|
3030
|
+
}, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$d))
|
|
3031
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
3032
|
+
], 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
|
|
3033
|
+
[vModelSelect, inputModel.value]
|
|
3034
|
+
])
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
};
|
|
3039
|
+
|
|
3040
|
+
script$f.__file = "src/lib/components/form-components/SelectInput.vue";
|
|
3041
|
+
|
|
3042
|
+
var script$e = {
|
|
3043
|
+
__name: 'PasswordInput',
|
|
3044
|
+
props: ['modelValue','label'],
|
|
3045
|
+
emits: ['update:modelValue','clearValidationErrors'],
|
|
3046
|
+
setup(__props, { emit }) {
|
|
3047
|
+
|
|
3048
|
+
const props = __props;
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
const inputModel = ref(null);
|
|
3053
|
+
|
|
3054
|
+
const modelValueUpdated = (e) => {
|
|
3055
|
+
emit('clearValidationErrors');
|
|
3056
|
+
emit('update:modelValue',inputModel);
|
|
3057
|
+
};
|
|
3058
|
+
onMounted(()=>{
|
|
3059
|
+
props.modelValue && (inputModel.value = props.modelValue);
|
|
3060
|
+
});
|
|
3061
|
+
|
|
3062
|
+
|
|
3063
|
+
return (_ctx, _cache) => {
|
|
3064
|
+
return withDirectives((openBlock(), createElementBlock("input", {
|
|
3065
|
+
type: "password",
|
|
3066
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((inputModel).value = $event)),
|
|
3067
|
+
onChange: modelValueUpdated,
|
|
3068
|
+
onKeydown: modelValueUpdated,
|
|
3069
|
+
onUpdated: modelValueUpdated
|
|
3070
|
+
}, null, 544 /* HYDRATE_EVENTS, NEED_PATCH */)), [
|
|
3071
|
+
[vModelText, inputModel.value]
|
|
3072
|
+
])
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
};
|
|
3077
|
+
|
|
3078
|
+
script$e.__file = "src/lib/components/form-components/PasswordInput.vue";
|
|
2970
3079
|
|
|
2971
3080
|
const _hoisted_1$c = /*#__PURE__*/createElementVNode("div", null, null, -1 /* HOISTED */);
|
|
2972
3081
|
const _hoisted_2$9 = ["innerHTML"];
|
|
@@ -3002,26 +3111,42 @@ const props = __props;
|
|
|
3002
3111
|
|
|
3003
3112
|
|
|
3004
3113
|
const formFields = ref([]);
|
|
3005
|
-
const getFieldComponent = (
|
|
3114
|
+
const getFieldComponent = (fieldObj)=>{
|
|
3115
|
+
const field = fieldObj.field;
|
|
3006
3116
|
const defaultTextareas = ['message', 'meta_description', 'comment', 'call_response', 'comments', 'description'];
|
|
3007
3117
|
const defaultNumbers = ['age'];
|
|
3118
|
+
const passwords = ['password','password_confirmation','pin'];
|
|
3008
3119
|
const defaultPhones = ['phone'];
|
|
3009
|
-
const defaultEmails = ['
|
|
3120
|
+
const defaultEmails = ['email'];
|
|
3010
3121
|
const formComponents = inject('formComponents');
|
|
3122
|
+
const TextComponent = formComponents.text ?? script$h;
|
|
3123
|
+
const TextAreaComponent = formComponents.textArea ?? script$g;
|
|
3124
|
+
const EmailComponent = formComponents.email ?? script$j;
|
|
3125
|
+
const PhoneComponent = formComponents.phone ?? script$n;
|
|
3126
|
+
const NumberComponent = formComponents.number ?? script$i;
|
|
3127
|
+
const SelectComponent = formComponents.select ?? script$f;
|
|
3128
|
+
const PasswordComponent = formComponents.password ?? script$e;
|
|
3011
3129
|
if(props.customComponents && props.customComponents[field]) {
|
|
3012
3130
|
return props.customComponents[field]
|
|
3013
|
-
}
|
|
3131
|
+
}
|
|
3132
|
+
if(fieldObj.type){
|
|
3133
|
+
return fieldObj.type === 'number' ? NumberComponent:fieldObj.type === 'textarea' ? TextAreaComponent : fieldObj.type === 'email' ? EmailComponent : fieldObj.type === 'phone' ? PhoneComponent : fieldObj.type ? SelectComponent:TextComponent
|
|
3134
|
+
}else
|
|
3135
|
+
if(passwords.includes(field)){
|
|
3136
|
+
return PasswordComponent
|
|
3137
|
+
}
|
|
3138
|
+
else
|
|
3014
3139
|
if((props.textAreas && props.textAreas.includes(field)) || defaultTextareas.includes(field)){
|
|
3015
|
-
return formComponents.textArea ?? script$
|
|
3140
|
+
return formComponents.textArea ?? script$g
|
|
3016
3141
|
} else
|
|
3017
3142
|
if((props.emails && props.emails.includes(field)) || defaultEmails.includes(field)){
|
|
3018
|
-
return formComponents.email ?? script$
|
|
3143
|
+
return formComponents.email ?? script$j
|
|
3019
3144
|
} else
|
|
3020
3145
|
if((props.phones && props.phones.includes(field)) || defaultPhones.includes(field)){
|
|
3021
|
-
return formComponents.phone ?? script$
|
|
3146
|
+
return formComponents.phone ?? script$n
|
|
3022
3147
|
} else
|
|
3023
3148
|
if((props.numbers && props.numbers.includes(field)) || defaultNumbers.includes(field)){
|
|
3024
|
-
return formComponents.number ?? script$
|
|
3149
|
+
return formComponents.number ?? script$i
|
|
3025
3150
|
}
|
|
3026
3151
|
// else
|
|
3027
3152
|
// if((props.selects && props.selects.includes(field)) || defaultSelects.includes(field)){
|
|
@@ -3030,7 +3155,7 @@ const getFieldComponent = (field)=>{
|
|
|
3030
3155
|
// if((props.dates && props.dates.includes(field)) || defaultDates.includes(field)){
|
|
3031
3156
|
// return formComponents.date ?? DateInput
|
|
3032
3157
|
// }
|
|
3033
|
-
return formComponents.text ?? script$
|
|
3158
|
+
return formComponents.text ?? script$h
|
|
3034
3159
|
};
|
|
3035
3160
|
const shFormElementClasses = ref(null);
|
|
3036
3161
|
shFormElementClasses.value = inject('shFormElementClasses');
|
|
@@ -3097,7 +3222,6 @@ onMounted((ev)=>{
|
|
|
3097
3222
|
fieldObj.label && getLabel(fieldObj.field);
|
|
3098
3223
|
!fieldObj.helper && fieldObj.helperText ? fieldObj.helper = fieldObj.helperText : fieldObj.helper = getHelperText(fieldObj.field);
|
|
3099
3224
|
fieldObj.helperText === undefined && (fieldObj.label = getLabel(fieldObj.field));
|
|
3100
|
-
fieldObj.component && getfieldObjComponent(fieldObj.field);
|
|
3101
3225
|
fieldObj.placeholder && fieldObj.placeHolder && getPlaceholder(fieldObj.field);
|
|
3102
3226
|
fieldObj.value = null;
|
|
3103
3227
|
formFields.value.push(fieldObj);
|
|
@@ -3105,7 +3229,6 @@ onMounted((ev)=>{
|
|
|
3105
3229
|
formFields.value.push({
|
|
3106
3230
|
field:field,label: getLabel(field),
|
|
3107
3231
|
helper: getHelperText(field),
|
|
3108
|
-
component: getFieldComponent(field),
|
|
3109
3232
|
placeholder: getPlaceholder(field),
|
|
3110
3233
|
value: null
|
|
3111
3234
|
});
|
|
@@ -3135,7 +3258,7 @@ return (_ctx, _cache) => {
|
|
|
3135
3258
|
innerHTML: field.label
|
|
3136
3259
|
}, null, 10 /* CLASS, PROPS */, _hoisted_2$9))
|
|
3137
3260
|
: createCommentVNode("v-if", true),
|
|
3138
|
-
(openBlock(), createBlock(resolveDynamicComponent(getFieldComponent(field
|
|
3261
|
+
(openBlock(), createBlock(resolveDynamicComponent(getFieldComponent(field)), mergeProps(getComponentProps(field), {
|
|
3139
3262
|
onClick: $event => (removeValidationError(field.field)),
|
|
3140
3263
|
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3141
3264
|
modelValue: formFields.value[index].value,
|
|
@@ -3241,7 +3364,7 @@ return (_ctx, _cache) => {
|
|
|
3241
3364
|
class: "dropdown-menu px-2 py-1",
|
|
3242
3365
|
"aria-labelledby": dropdownId
|
|
3243
3366
|
}, [
|
|
3244
|
-
createVNode(script$
|
|
3367
|
+
createVNode(script$k, normalizeProps(guardReactiveProps(props)), null, 16 /* FULL_PROPS */)
|
|
3245
3368
|
])
|
|
3246
3369
|
])
|
|
3247
3370
|
], 64 /* STABLE_FRAGMENT */))
|
|
@@ -3345,7 +3468,7 @@ return (_ctx, _cache) => {
|
|
|
3345
3468
|
"modal-title": __props.modalTitle
|
|
3346
3469
|
}, {
|
|
3347
3470
|
default: withCtx(() => [
|
|
3348
|
-
createVNode(script$
|
|
3471
|
+
createVNode(script$k, mergeProps({ onSuccess: success }, props), null, 16 /* FULL_PROPS */)
|
|
3349
3472
|
]),
|
|
3350
3473
|
_: 1 /* STABLE */
|
|
3351
3474
|
}, 8 /* PROPS */, ["modal-title"])
|
|
@@ -5011,7 +5134,7 @@ return (_ctx, _cache) => {
|
|
|
5011
5134
|
"modal-title": "Department Form"
|
|
5012
5135
|
}, {
|
|
5013
5136
|
default: withCtx(() => [
|
|
5014
|
-
createVNode(script$
|
|
5137
|
+
createVNode(script$k, {
|
|
5015
5138
|
"success-callback": "departmentAdded",
|
|
5016
5139
|
onDepartmentAdded: departmentAdded,
|
|
5017
5140
|
action: "admin/departments/store",
|
|
@@ -5170,7 +5293,7 @@ return (_ctx, _cache) => {
|
|
|
5170
5293
|
"modal-title": "Add Module Department"
|
|
5171
5294
|
}, {
|
|
5172
5295
|
default: withCtx(() => [
|
|
5173
|
-
createVNode(script$
|
|
5296
|
+
createVNode(script$k, {
|
|
5174
5297
|
"reload-select-items": unref(reload),
|
|
5175
5298
|
"success-callback": moduleAdded,
|
|
5176
5299
|
"fill-selects": {
|
|
@@ -5307,7 +5430,7 @@ return (_ctx, _cache) => {
|
|
|
5307
5430
|
: (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
5308
5431
|
(section.value === 'login')
|
|
5309
5432
|
? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
5310
|
-
createVNode(script$
|
|
5433
|
+
createVNode(script$k, {
|
|
5311
5434
|
class: "sh-login-form",
|
|
5312
5435
|
fields: ['email','password'],
|
|
5313
5436
|
"action-label": "Login",
|
|
@@ -5332,7 +5455,7 @@ return (_ctx, _cache) => {
|
|
|
5332
5455
|
(unref(registerSubTitle))
|
|
5333
5456
|
? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(registerSubTitle)), 1 /* TEXT */))
|
|
5334
5457
|
: createCommentVNode("v-if", true),
|
|
5335
|
-
createVNode(script$
|
|
5458
|
+
createVNode(script$k, {
|
|
5336
5459
|
class: "sh-login-form",
|
|
5337
5460
|
fields: unref(registrationFields),
|
|
5338
5461
|
"action-label": "Sign Up",
|
|
@@ -5379,7 +5502,7 @@ const ShFrontend = {
|
|
|
5379
5502
|
const registerTitle = options.registerTitle ?? 'Create a new account';
|
|
5380
5503
|
const registerSubTitle = options.registerSubTitle ?? `It's quick and easy`;
|
|
5381
5504
|
const logoutApiEndpoint = options.logoutApiEndpoint ?? `auth/logout`;
|
|
5382
|
-
options.formTextInput ?? script$
|
|
5505
|
+
options.formTextInput ?? script$h;
|
|
5383
5506
|
const loginUrl = options.loginUrl ?? `/login`;
|
|
5384
5507
|
const redirectLogin = options.redirectLogin ?? `/`;
|
|
5385
5508
|
const redirectRegister = options.redirectRegister ?? `/`;
|
|
@@ -5420,4 +5543,4 @@ const ShFrontend = {
|
|
|
5420
5543
|
}
|
|
5421
5544
|
};
|
|
5422
5545
|
|
|
5423
|
-
export { script$d as ShAutoForm, script$9 as ShCanvas, script$7 as ShConfirmAction, script$c as ShDropDownForm, script$3 as ShDynamicTabs, script$
|
|
5546
|
+
export { script$d as ShAutoForm, script$9 as ShCanvas, script$7 as ShConfirmAction, script$c as ShDropDownForm, script$3 as ShDynamicTabs, script$k as ShForm, ShFrontend, script$b as ShModal, script$a as ShModalForm, script$n as ShPhone, script$6 as ShSilentAction, script$5 as ShTable, script$4 as ShTabs, shApis, shRepo, ShStorage as shStorage, useUserStore };
|