@iankibetsh/shframework 2.0.5 → 2.0.7

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 CHANGED
@@ -2969,7 +2969,7 @@ vue.onMounted(()=>{
2969
2969
  if(props.data){
2970
2970
  selectOptions.value = props.data.map(item=>{
2971
2971
  return {
2972
- id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
2972
+ id: typeof item.id !== 'undefined' ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
2973
2973
  name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
2974
2974
  }
2975
2975
  });
@@ -3082,7 +3082,7 @@ var script$l = {
3082
3082
  'emails',
3083
3083
  'phones','numbers','selects','dates','gqlMutation'
3084
3084
  ],
3085
- emits: ['success'],
3085
+ emits: ['success','fieldChanged','formSubmitted','formError'],
3086
3086
  setup(__props, { emit }) {
3087
3087
 
3088
3088
  const props = __props;
@@ -3156,7 +3156,10 @@ const getComponentClass = field => validationErrors.value[field] ? getElementCla
3156
3156
  const getHelperText = field => (props.helperTexts && props.helperTexts[field]) ? props.helperTexts[field]:false;
3157
3157
  const getElementClass = section => (props.formClasses && props.formClasses[section]) ? props.formClasses[section]:shFormElementClasses.value[section] ?? ___default["default"].snakeCase(section).replace(/_/gi,'-');
3158
3158
  const getPlaceholder = field => (props.placeHolders && props.placeHolders[field]) && props.placeHolders[field];
3159
- const removeValidationError = field => delete validationErrors.value[field];
3159
+ const fieldChanged = field => {
3160
+ delete validationErrors.value[field];
3161
+ emit('fieldChanged', field, formFields.value.filter(f=>f.field === field)[0].value);
3162
+ };
3160
3163
  const getComponentProps = field => {
3161
3164
  const newField = {...field};
3162
3165
  delete newField.component;
@@ -3305,8 +3308,8 @@ return (_ctx, _cache) => {
3305
3308
  : vue.createCommentVNode("v-if", true),
3306
3309
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getFieldComponent(field)), vue.mergeProps(getComponentProps(field), {
3307
3310
  isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
3308
- onClick: $event => (removeValidationError(field.field)),
3309
- "onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
3311
+ onClick: $event => (fieldChanged(field.field)),
3312
+ "onUpdate:modelValue": [$event => (fieldChanged(field.field)), $event => ((formFields.value[index].value) = $event)],
3310
3313
  modelValue: formFields.value[index].value,
3311
3314
  class: getComponentClass(field.field)
3312
3315
  }), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
@@ -3433,19 +3436,28 @@ const _hoisted_5$6 = /*#__PURE__*/vue.createElementVNode("button", {
3433
3436
  const _hoisted_6$5 = { class: "modal-body" };
3434
3437
  const _hoisted_7$4 = { class: "section" };
3435
3438
 
3439
+
3436
3440
  var script$j = {
3437
3441
  __name: 'ShModal',
3438
3442
  props: {
3439
- modalId: {
3440
- required: true,
3441
- type: String
3442
- },
3443
- modalTitle: {
3444
- type: String
3445
- },
3446
- modalSize: {
3447
- type: String
3448
- }
3443
+ modalId: {
3444
+ required: true,
3445
+ type: String
3446
+ },
3447
+ modalTitle: {
3448
+ type: String
3449
+ },
3450
+ modalSize: {
3451
+ type: String
3452
+ },
3453
+ Static: {
3454
+ type: Boolean,
3455
+ default: false
3456
+ },
3457
+ bsKeyboard: {
3458
+ type: Boolean,
3459
+ default: true
3460
+ }
3449
3461
  },
3450
3462
  emits: ['modalClosed'],
3451
3463
  setup(__props, { emit }) {
@@ -3454,11 +3466,11 @@ const props = __props;
3454
3466
 
3455
3467
 
3456
3468
 
3457
- vue.onMounted(()=>{
3458
- const modal = document.getElementById(props.modalId);
3459
- modal.addEventListener('hidden.bs.modal', event => {
3460
- event.target.id == props.modalId && emit('modalClosed');
3461
- });
3469
+ vue.onMounted(() => {
3470
+ const modal = document.getElementById(props.modalId);
3471
+ modal.addEventListener('hidden.bs.modal', event => {
3472
+ event.target.id == props.modalId && emit('modalClosed');
3473
+ });
3462
3474
  });
3463
3475
 
3464
3476
  return (_ctx, _cache) => {
@@ -5879,7 +5891,9 @@ return (_ctx, _cache) => {
5879
5891
  key: 0,
5880
5892
  "modal-title": title.value,
5881
5893
  "modal-id": vue.unref(modalId),
5882
- "modal-size": size.value
5894
+ "modal-size": size.value,
5895
+ "data-bs-backdrop": "static",
5896
+ "data-bs-keyboard": "false"
5883
5897
  }, {
5884
5898
  default: vue.withCtx(() => [
5885
5899
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(componentView.value)))
@@ -6023,6 +6037,8 @@ return (_ctx, _cache) => {
6023
6037
  ? (vue.openBlock(), vue.createBlock(script$j, {
6024
6038
  key: 0,
6025
6039
  "modal-title": title.value,
6040
+ "data-bs-backdrop": "static",
6041
+ "data-bs-keyboard": "false",
6026
6042
  "modal-id": vue.unref(modalId),
6027
6043
  "modal-size": size.value
6028
6044
  }, {
package/dist/library.mjs CHANGED
@@ -2957,7 +2957,7 @@ onMounted(()=>{
2957
2957
  if(props.data){
2958
2958
  selectOptions.value = props.data.map(item=>{
2959
2959
  return {
2960
- id: item.id ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
2960
+ id: typeof item.id !== 'undefined' ? item.id : item.key ? item.key : item.value ? item.value:item.name ? item.name:item.label,
2961
2961
  name: item.label ? item.label : item.name ? item.name : item.value ? item.value:item.id ? item.id:item.option
2962
2962
  }
2963
2963
  });
@@ -3070,7 +3070,7 @@ var script$l = {
3070
3070
  'emails',
3071
3071
  'phones','numbers','selects','dates','gqlMutation'
3072
3072
  ],
3073
- emits: ['success'],
3073
+ emits: ['success','fieldChanged','formSubmitted','formError'],
3074
3074
  setup(__props, { emit }) {
3075
3075
 
3076
3076
  const props = __props;
@@ -3144,7 +3144,10 @@ const getComponentClass = field => validationErrors.value[field] ? getElementCla
3144
3144
  const getHelperText = field => (props.helperTexts && props.helperTexts[field]) ? props.helperTexts[field]:false;
3145
3145
  const getElementClass = section => (props.formClasses && props.formClasses[section]) ? props.formClasses[section]:shFormElementClasses.value[section] ?? _.snakeCase(section).replace(/_/gi,'-');
3146
3146
  const getPlaceholder = field => (props.placeHolders && props.placeHolders[field]) && props.placeHolders[field];
3147
- const removeValidationError = field => delete validationErrors.value[field];
3147
+ const fieldChanged = field => {
3148
+ delete validationErrors.value[field];
3149
+ emit('fieldChanged', field, formFields.value.filter(f=>f.field === field)[0].value);
3150
+ };
3148
3151
  const getComponentProps = field => {
3149
3152
  const newField = {...field};
3150
3153
  delete newField.component;
@@ -3293,8 +3296,8 @@ return (_ctx, _cache) => {
3293
3296
  : createCommentVNode("v-if", true),
3294
3297
  (openBlock(), createBlock(resolveDynamicComponent(getFieldComponent(field)), mergeProps(getComponentProps(field), {
3295
3298
  isInvalid: typeof validationErrors.value[field.field] !== 'undefined',
3296
- onClick: $event => (removeValidationError(field.field)),
3297
- "onUpdate:modelValue": [$event => (removeValidationError(field.field)), $event => ((formFields.value[index].value) = $event)],
3299
+ onClick: $event => (fieldChanged(field.field)),
3300
+ "onUpdate:modelValue": [$event => (fieldChanged(field.field)), $event => ((formFields.value[index].value) = $event)],
3298
3301
  modelValue: formFields.value[index].value,
3299
3302
  class: getComponentClass(field.field)
3300
3303
  }), null, 16 /* FULL_PROPS */, ["isInvalid", "onClick", "onUpdate:modelValue", "modelValue", "class"])),
@@ -3421,19 +3424,28 @@ const _hoisted_5$6 = /*#__PURE__*/createElementVNode("button", {
3421
3424
  const _hoisted_6$5 = { class: "modal-body" };
3422
3425
  const _hoisted_7$4 = { class: "section" };
3423
3426
 
3427
+
3424
3428
  var script$j = {
3425
3429
  __name: 'ShModal',
3426
3430
  props: {
3427
- modalId: {
3428
- required: true,
3429
- type: String
3430
- },
3431
- modalTitle: {
3432
- type: String
3433
- },
3434
- modalSize: {
3435
- type: String
3436
- }
3431
+ modalId: {
3432
+ required: true,
3433
+ type: String
3434
+ },
3435
+ modalTitle: {
3436
+ type: String
3437
+ },
3438
+ modalSize: {
3439
+ type: String
3440
+ },
3441
+ Static: {
3442
+ type: Boolean,
3443
+ default: false
3444
+ },
3445
+ bsKeyboard: {
3446
+ type: Boolean,
3447
+ default: true
3448
+ }
3437
3449
  },
3438
3450
  emits: ['modalClosed'],
3439
3451
  setup(__props, { emit }) {
@@ -3442,11 +3454,11 @@ const props = __props;
3442
3454
 
3443
3455
 
3444
3456
 
3445
- onMounted(()=>{
3446
- const modal = document.getElementById(props.modalId);
3447
- modal.addEventListener('hidden.bs.modal', event => {
3448
- event.target.id == props.modalId && emit('modalClosed');
3449
- });
3457
+ onMounted(() => {
3458
+ const modal = document.getElementById(props.modalId);
3459
+ modal.addEventListener('hidden.bs.modal', event => {
3460
+ event.target.id == props.modalId && emit('modalClosed');
3461
+ });
3450
3462
  });
3451
3463
 
3452
3464
  return (_ctx, _cache) => {
@@ -5867,7 +5879,9 @@ return (_ctx, _cache) => {
5867
5879
  key: 0,
5868
5880
  "modal-title": title.value,
5869
5881
  "modal-id": unref(modalId),
5870
- "modal-size": size.value
5882
+ "modal-size": size.value,
5883
+ "data-bs-backdrop": "static",
5884
+ "data-bs-keyboard": "false"
5871
5885
  }, {
5872
5886
  default: withCtx(() => [
5873
5887
  (openBlock(), createBlock(resolveDynamicComponent(componentView.value)))
@@ -6011,6 +6025,8 @@ return (_ctx, _cache) => {
6011
6025
  ? (openBlock(), createBlock(script$j, {
6012
6026
  key: 0,
6013
6027
  "modal-title": title.value,
6028
+ "data-bs-backdrop": "static",
6029
+ "data-bs-keyboard": "false",
6014
6030
  "modal-id": unref(modalId),
6015
6031
  "modal-size": size.value
6016
6032
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",