@iankibetsh/shframework 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist/library.mjs.css +15 -15
- package/dist/library.js +24 -7
- package/dist/library.mjs +25 -8
- package/package.json +1 -1
|
@@ -95,6 +95,21 @@
|
|
|
95
95
|
flex-grow: 1;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
.sh-selected-item{
|
|
99
|
+
line-height: unset!important;
|
|
100
|
+
}
|
|
101
|
+
.sh-suggestion-input{
|
|
102
|
+
padding: 0.375rem 0.75rem;
|
|
103
|
+
}
|
|
104
|
+
.sh-suggest{
|
|
105
|
+
margin-bottom: 1rem;
|
|
106
|
+
}
|
|
107
|
+
.sh-suggest-control::after{
|
|
108
|
+
margin-top: auto;
|
|
109
|
+
margin-bottom: auto;
|
|
110
|
+
margin-right: 0.255em;
|
|
111
|
+
}
|
|
112
|
+
|
|
98
113
|
:root {
|
|
99
114
|
--ck-z-default: 10555 !important;
|
|
100
115
|
--ck-z-modal: calc(var(--ck-z-default) + 999) !important;
|
|
@@ -116,21 +131,6 @@
|
|
|
116
131
|
}
|
|
117
132
|
}
|
|
118
133
|
|
|
119
|
-
.sh-selected-item{
|
|
120
|
-
line-height: unset!important;
|
|
121
|
-
}
|
|
122
|
-
.sh-suggestion-input{
|
|
123
|
-
padding: 0.375rem 0.75rem;
|
|
124
|
-
}
|
|
125
|
-
.sh-suggest{
|
|
126
|
-
margin-bottom: 1rem;
|
|
127
|
-
}
|
|
128
|
-
.sh-suggest-control::after{
|
|
129
|
-
margin-top: auto;
|
|
130
|
-
margin-bottom: auto;
|
|
131
|
-
margin-right: 0.255em;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
134
|
.sh-forgot-link, .sh-register-link{
|
|
135
135
|
cursor: pointer;
|
|
136
136
|
}
|
package/dist/library.js
CHANGED
|
@@ -3107,6 +3107,7 @@ var script$e = {
|
|
|
3107
3107
|
'helperTexts','labels','data',
|
|
3108
3108
|
'actionLabel',
|
|
3109
3109
|
'textAreas',
|
|
3110
|
+
'currentData',
|
|
3110
3111
|
'emails',
|
|
3111
3112
|
'phones','numbers','selects','dates'
|
|
3112
3113
|
],
|
|
@@ -3226,14 +3227,28 @@ const submitForm = e => {
|
|
|
3226
3227
|
return false
|
|
3227
3228
|
};
|
|
3228
3229
|
const submitBtnWidth = vue.ref(null);
|
|
3230
|
+
const setExistingData = ()=>{
|
|
3231
|
+
console.log(props.currentData, formFields.value);
|
|
3232
|
+
const existingData = props.currentData;
|
|
3233
|
+
if (props.currentData) {
|
|
3234
|
+
formFields.value.map(field=>{
|
|
3235
|
+
existingData[field.field] && (field.value = existingData[field.field]);
|
|
3236
|
+
});
|
|
3237
|
+
}
|
|
3238
|
+
};
|
|
3239
|
+
vue.watch(()=>props.currentData,()=>{
|
|
3240
|
+
setExistingData();
|
|
3241
|
+
});
|
|
3229
3242
|
vue.onMounted((ev)=>{
|
|
3230
3243
|
props.fields && props.fields.map(field=>{
|
|
3231
3244
|
if(typeof field === 'object') {
|
|
3232
3245
|
const fieldObj = {...field};
|
|
3233
|
-
fieldObj.label && getLabel(fieldObj.field)
|
|
3234
|
-
|
|
3235
|
-
fieldObj.helperText
|
|
3236
|
-
fieldObj.
|
|
3246
|
+
// fieldObj.label && getLabel(fieldObj.field)
|
|
3247
|
+
fieldObj.helper = fieldObj.helperText ?? fieldObj.helper;
|
|
3248
|
+
// !fieldObj.helper && fieldObj.helperText ? fieldObj.helper = fieldObj.helperText : fieldObj.helper = getHelperText(fieldObj.field)
|
|
3249
|
+
// fieldObj.helperText === undefined && ()
|
|
3250
|
+
fieldObj.label = fieldObj.label ?? getLabel(fieldObj.field);
|
|
3251
|
+
// fieldObj.placeholder && fieldObj.placeHolder && getPlaceholder(fieldObj.field)
|
|
3237
3252
|
fieldObj.value = null;
|
|
3238
3253
|
formFields.value.push(fieldObj);
|
|
3239
3254
|
} else {
|
|
@@ -3245,6 +3260,7 @@ vue.onMounted((ev)=>{
|
|
|
3245
3260
|
});
|
|
3246
3261
|
}
|
|
3247
3262
|
});
|
|
3263
|
+
setExistingData();
|
|
3248
3264
|
});
|
|
3249
3265
|
|
|
3250
3266
|
|
|
@@ -3274,9 +3290,8 @@ return (_ctx, _cache) => {
|
|
|
3274
3290
|
onClick: $event => (removeValidationError(field.field)),
|
|
3275
3291
|
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3276
3292
|
modelValue: formFields.value[index].value,
|
|
3277
|
-
placeholder: vue.unref(isFloating) ? field.label:field.placeholder,
|
|
3278
3293
|
class: getComponentClass(field.field)
|
|
3279
|
-
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "
|
|
3294
|
+
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
|
|
3280
3295
|
(vue.unref(isFloating) && field.label)
|
|
3281
3296
|
? (vue.openBlock(), vue.createElementBlock("label", {
|
|
3282
3297
|
key: 1,
|
|
@@ -3296,7 +3311,9 @@ return (_ctx, _cache) => {
|
|
|
3296
3311
|
key: 3,
|
|
3297
3312
|
class: vue.normalizeClass(getElementClass('invalidFeedback'))
|
|
3298
3313
|
}, vue.toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
|
|
3299
|
-
: vue.createCommentVNode("v-if", true)
|
|
3314
|
+
: vue.createCommentVNode("v-if", true),
|
|
3315
|
+
vue.createCommentVNode(" <h5>{{ getFieldComponent(field) }}</h5>"),
|
|
3316
|
+
vue.createCommentVNode(" <h5>{{ getComponentProps(field) }}</h5>")
|
|
3300
3317
|
], 2 /* CLASS */))
|
|
3301
3318
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
3302
3319
|
vue.createElementVNode("div", {
|
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, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, resolveDynamicComponent, inject, mergeProps, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, shallowRef, vModelCheckbox, pushScopeId, popScopeId, computed, isRef
|
|
5
|
+
import { openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, withDirectives, Fragment, renderList, vModelSelect, vModelText, resolveComponent, withModifiers, createVNode, ref, onMounted, unref, normalizeClass, createBlock, resolveDynamicComponent, inject, watch, mergeProps, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, withCtx, createStaticVNode, shallowRef, vModelCheckbox, pushScopeId, popScopeId, computed, isRef } from 'vue';
|
|
6
6
|
import Editor from '@tinymce/tinymce-vue';
|
|
7
7
|
import _ from 'lodash';
|
|
8
8
|
import { useRoute, useRouter } from 'vue-router';
|
|
@@ -3094,6 +3094,7 @@ var script$e = {
|
|
|
3094
3094
|
'helperTexts','labels','data',
|
|
3095
3095
|
'actionLabel',
|
|
3096
3096
|
'textAreas',
|
|
3097
|
+
'currentData',
|
|
3097
3098
|
'emails',
|
|
3098
3099
|
'phones','numbers','selects','dates'
|
|
3099
3100
|
],
|
|
@@ -3213,14 +3214,28 @@ const submitForm = e => {
|
|
|
3213
3214
|
return false
|
|
3214
3215
|
};
|
|
3215
3216
|
const submitBtnWidth = ref(null);
|
|
3217
|
+
const setExistingData = ()=>{
|
|
3218
|
+
console.log(props.currentData, formFields.value);
|
|
3219
|
+
const existingData = props.currentData;
|
|
3220
|
+
if (props.currentData) {
|
|
3221
|
+
formFields.value.map(field=>{
|
|
3222
|
+
existingData[field.field] && (field.value = existingData[field.field]);
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
watch(()=>props.currentData,()=>{
|
|
3227
|
+
setExistingData();
|
|
3228
|
+
});
|
|
3216
3229
|
onMounted((ev)=>{
|
|
3217
3230
|
props.fields && props.fields.map(field=>{
|
|
3218
3231
|
if(typeof field === 'object') {
|
|
3219
3232
|
const fieldObj = {...field};
|
|
3220
|
-
fieldObj.label && getLabel(fieldObj.field)
|
|
3221
|
-
|
|
3222
|
-
fieldObj.helperText
|
|
3223
|
-
fieldObj.
|
|
3233
|
+
// fieldObj.label && getLabel(fieldObj.field)
|
|
3234
|
+
fieldObj.helper = fieldObj.helperText ?? fieldObj.helper;
|
|
3235
|
+
// !fieldObj.helper && fieldObj.helperText ? fieldObj.helper = fieldObj.helperText : fieldObj.helper = getHelperText(fieldObj.field)
|
|
3236
|
+
// fieldObj.helperText === undefined && ()
|
|
3237
|
+
fieldObj.label = fieldObj.label ?? getLabel(fieldObj.field);
|
|
3238
|
+
// fieldObj.placeholder && fieldObj.placeHolder && getPlaceholder(fieldObj.field)
|
|
3224
3239
|
fieldObj.value = null;
|
|
3225
3240
|
formFields.value.push(fieldObj);
|
|
3226
3241
|
} else {
|
|
@@ -3232,6 +3247,7 @@ onMounted((ev)=>{
|
|
|
3232
3247
|
});
|
|
3233
3248
|
}
|
|
3234
3249
|
});
|
|
3250
|
+
setExistingData();
|
|
3235
3251
|
});
|
|
3236
3252
|
|
|
3237
3253
|
|
|
@@ -3261,9 +3277,8 @@ return (_ctx, _cache) => {
|
|
|
3261
3277
|
onClick: $event => (removeValidationError(field.field)),
|
|
3262
3278
|
"onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
|
|
3263
3279
|
modelValue: formFields.value[index].value,
|
|
3264
|
-
placeholder: unref(isFloating) ? field.label:field.placeholder,
|
|
3265
3280
|
class: getComponentClass(field.field)
|
|
3266
|
-
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "
|
|
3281
|
+
}), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
|
|
3267
3282
|
(unref(isFloating) && field.label)
|
|
3268
3283
|
? (openBlock(), createElementBlock("label", {
|
|
3269
3284
|
key: 1,
|
|
@@ -3283,7 +3298,9 @@ return (_ctx, _cache) => {
|
|
|
3283
3298
|
key: 3,
|
|
3284
3299
|
class: normalizeClass(getElementClass('invalidFeedback'))
|
|
3285
3300
|
}, toDisplayString(validationErrors.value[field.field]), 3 /* TEXT, CLASS */))
|
|
3286
|
-
: createCommentVNode("v-if", true)
|
|
3301
|
+
: createCommentVNode("v-if", true),
|
|
3302
|
+
createCommentVNode(" <h5>{{ getFieldComponent(field) }}</h5>"),
|
|
3303
|
+
createCommentVNode(" <h5>{{ getComponentProps(field) }}</h5>")
|
|
3287
3304
|
], 2 /* CLASS */))
|
|
3288
3305
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
3289
3306
|
createElementVNode("div", {
|