inertia-bootstrap-forms 1.0.70 → 1.0.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inertia-bootstrap-forms",
3
- "version": "1.0.70",
3
+ "version": "1.0.72",
4
4
  "description": "Create bootstrap forms with inertia and twitter bootstrap",
5
5
  "main": "dist/inertia-bootstrap-forms.cjs.js",
6
6
  "module": "dist/inertia-bootstrap-forms.es.js",
@@ -3,6 +3,7 @@ import Editor from '@tinymce/tinymce-vue';
3
3
  import {computed, defineComponent, inject, ref} from "vue";
4
4
 
5
5
  export default defineComponent({
6
+ emits: ['update:modelValue', 'setContent'],
6
7
  components: {Editor},
7
8
  props: {
8
9
  name: {
@@ -59,14 +60,6 @@ export default defineComponent({
59
60
 
60
61
  return {modelValue, form, group, editorRef, handleInit};
61
62
  },
62
- emits: ['update:modelValue', 'setContent'],
63
- methods:{
64
- setContentInModelValue(content, format, paste, selection){
65
- this.modelValue = content;
66
- this.$emit('setContent', content, format, paste, selection);
67
- this.$emit('update:modelValue', content);
68
- }
69
- }
70
63
  })
71
64
  </script>
72
65
 
@@ -74,7 +67,6 @@ export default defineComponent({
74
67
  <Editor
75
68
  ref="editorRef"
76
69
  @init="handleInit"
77
- @setContent="setContentInModelValue"
78
70
  v-model="modelValue"
79
71
  class="tiny-editor-input-el"
80
72
  :init="{
@@ -67,6 +67,7 @@ export default defineComponent({
67
67
  processing,
68
68
  progress,
69
69
  wasSuccessful,
70
+ uploading,
70
71
  recentlySuccessful,
71
72
  __rememberable,
72
73
  ...cleanedData
@@ -3,21 +3,24 @@ import {Spinner} from 'vue3-bootstrap-components';
3
3
  import {defineComponent} from "vue";
4
4
 
5
5
  export default defineComponent({
6
- components: {
7
- Spinner
8
- },
9
- inject: ['form'],
10
- props: {},
6
+ components: {
7
+ Spinner
8
+ },
9
+ inject: ['form'],
10
+ props: {},
11
11
  })
12
12
  </script>
13
13
  <template>
14
- <button
15
- type="submit"
16
- :disabled="form?.processing"
17
- class="btn btn-primary px-3 px-sm-4">
18
- <Spinner v-if="form?.processing"/>
19
- <slot>
20
- تایید و ثبت اطلاعات
21
- </slot>
22
- </button>
14
+ <button
15
+ type="submit"
16
+ :disabled="form?.processing || form?.uploading"
17
+ class="btn btn-primary px-3 px-sm-4">
18
+ <Spinner v-if="form?.processing || form?.uploading"/>
19
+ <slot :form="form">
20
+ تایید و ثبت اطلاعات
21
+ </slot>
22
+ <slot name="progress">
23
+ <span class="submit-upload-percent" v-if="form?.uploading">{{ form?.uploading }}%</span>
24
+ </slot>
25
+ </button>
23
26
  </template>
package/src/UppyInput.vue CHANGED
@@ -119,7 +119,10 @@ uppy.value.on('file-removed', (file) => {
119
119
  emits('file-removed', file);
120
120
  });
121
121
 
122
- uppy.value.on('progress', (progress) => emits('progress', progress));
122
+ uppy.value.on('progress', (progress) => {
123
+ form.value['uploading'] = (progress >= 100 || progress <=0) ? null : progress;
124
+ emits('progress', progress)
125
+ });
123
126
  uppy.value.on('upload-progress', (file, progress) => emits('upload-progress', file, progress));
124
127
  uppy.value.on('upload-pause', (file, progress) => emits('upload-pause', file, progress));
125
128
  uppy.value.on('cancel-all', () => emits('cancel-all'));
@@ -161,9 +164,7 @@ onMounted(() => {
161
164
  }
162
165
 
163
166
  if(uppy.value?.opts?.restrictions){
164
- console.log(uppy.value?.opts?.restrictions);
165
167
  restrictionCaption.value = buildRestrictionsCaption(uppy.value.opts.restrictions)
166
- console.log('restrictionCaption', restrictionCaption.value);
167
168
  }
168
169
  });
169
170