inertia-bootstrap-forms 1.0.50 → 1.0.51
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/inertia-bootstrap-forms.es.js +751 -828
- package/dist/inertia-bootstrap-forms.umd.js +3 -3
- package/dist/style.css +1 -1
- package/index.d.ts +28 -1
- package/package.json +1 -1
- package/src/EditorInput.vue +50 -129
- package/src/css/loader.gif +0 -0
package/index.d.ts
CHANGED
|
@@ -123,7 +123,34 @@ export const CheckboxButtonInput: DefineComponent<{
|
|
|
123
123
|
export const CheckboxInput: DefineComponent<{}, {}, any>;
|
|
124
124
|
export const CheckboxToggle: DefineComponent<{}, {}, any>;
|
|
125
125
|
export const countryCodes: any;
|
|
126
|
-
export const EditorInput: DefineComponent<{
|
|
126
|
+
export const EditorInput: DefineComponent<{
|
|
127
|
+
name: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: true,
|
|
130
|
+
},
|
|
131
|
+
modelValue: String,
|
|
132
|
+
placeholder: {
|
|
133
|
+
type: String,
|
|
134
|
+
default: 'اینجا بنویسید...',
|
|
135
|
+
},
|
|
136
|
+
invalid: Boolean,
|
|
137
|
+
allowLink: Boolean,
|
|
138
|
+
height: Number,
|
|
139
|
+
minHeight: Number,
|
|
140
|
+
useStyle: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: false,
|
|
143
|
+
},
|
|
144
|
+
modules: {
|
|
145
|
+
default: [],
|
|
146
|
+
required: false,
|
|
147
|
+
},
|
|
148
|
+
options: {
|
|
149
|
+
type: Object,
|
|
150
|
+
default: {},
|
|
151
|
+
required: false,
|
|
152
|
+
},
|
|
153
|
+
}, {}, any>;
|
|
127
154
|
export const EmailInput: DefineComponent<{}, {}, any>;
|
|
128
155
|
export const DropzoneInput: DefineComponent<{}, {}, any>;
|
|
129
156
|
export const FileInput: DefineComponent<{}, {}, any>;
|
package/package.json
CHANGED
package/src/EditorInput.vue
CHANGED
|
@@ -3,142 +3,63 @@ import Editor from '@tinymce/tinymce-vue';
|
|
|
3
3
|
import {computed, defineComponent, inject} from "vue";
|
|
4
4
|
|
|
5
5
|
export default defineComponent({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
modelValue: String,
|
|
13
|
-
placeholder: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: 'اینجا بنویسید...',
|
|
16
|
-
},
|
|
17
|
-
invalid: Boolean,
|
|
18
|
-
allowLink: Boolean,
|
|
19
|
-
height: Number,
|
|
20
|
-
minHeight: Number,
|
|
21
|
-
useStyle: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: false,
|
|
24
|
-
},
|
|
25
|
-
modules: {
|
|
26
|
-
default: [],
|
|
27
|
-
required: false,
|
|
28
|
-
},
|
|
6
|
+
components: {Editor},
|
|
7
|
+
props: {
|
|
8
|
+
name: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
29
11
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
modelValue: String,
|
|
13
|
+
options: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: {},
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
setup(props) {
|
|
20
|
+
let form = inject('form', {
|
|
21
|
+
errors: {},
|
|
22
|
+
getID(name) {
|
|
23
|
+
return name;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
let group = inject('group', {});
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
28
|
+
const modelValue = computed({
|
|
29
|
+
get() {
|
|
30
|
+
return (group.value && form.value[group.value.name]) ? group.value?.getData(props.name) : form.value[props.name];
|
|
31
|
+
},
|
|
32
|
+
set(value) {
|
|
33
|
+
if (group?.value?.name) {
|
|
34
|
+
group.value.setData(props.name, value);
|
|
35
|
+
} else {
|
|
36
|
+
form.value[props.name] = value;
|
|
49
37
|
}
|
|
50
|
-
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
51
40
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
return {modelValue, form, group};
|
|
42
|
+
},
|
|
43
|
+
emits: ['update:modelValue'],
|
|
55
44
|
})
|
|
56
45
|
</script>
|
|
57
46
|
|
|
58
47
|
<template>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
base_url: '/js/tinymce/',
|
|
65
|
-
disabled: false,
|
|
66
|
-
inline: false,
|
|
67
|
-
toolbar_sticky: true,
|
|
68
|
-
menubar: false,
|
|
69
|
-
contextmenu: false,
|
|
70
|
-
branding: false,
|
|
71
|
-
font_formats: true,
|
|
72
|
-
directionality: 'rtl',
|
|
73
|
-
placeholder: placeholder,
|
|
74
|
-
plugins: [
|
|
75
|
-
...modules,
|
|
76
|
-
'link',
|
|
77
|
-
'lists',
|
|
78
|
-
'directionality',
|
|
79
|
-
'fullscreen',
|
|
80
|
-
'wordcount',
|
|
81
|
-
'table',
|
|
82
|
-
'autosave',
|
|
83
|
-
'autoresize',
|
|
84
|
-
],
|
|
85
|
-
style_formats : [
|
|
86
|
-
{title : 'وسط چین', classes : 'text-center', block: 'div'},
|
|
87
|
-
{title : 'فاصله از بالا و پایین', classes : 'my-3', block: 'div'},
|
|
88
|
-
{title : 'باکس اطلاعات', classes : 'code-box', block: 'span'},
|
|
89
|
-
],
|
|
90
|
-
setup: function(editor) {
|
|
91
|
-
// editor.on('init', function(e) {
|
|
92
|
-
// editor.setContent(modelValue || '');
|
|
93
|
-
// });
|
|
94
|
-
//
|
|
95
|
-
// editor.on('paste cut reset keyup input focusout', function(e) {
|
|
96
|
-
// // console.log('form', form);
|
|
97
|
-
// // $emit('update:modelValue', editor.getContent());
|
|
98
|
-
// });
|
|
99
|
-
},
|
|
100
|
-
language: 'fa',
|
|
101
|
-
toolbar: (useStyle ? 'styles |' : '') + 'fontsize | bold italic h1 h2 h3 h4 | link | numlist bullist | alignjustify aligncenter | table image link unlink | rtl ltr | pagebreak codesample | fullscreen code',
|
|
102
|
-
fullscreen: true,
|
|
103
|
-
auto_save: true,
|
|
104
|
-
auto_link: true,
|
|
105
|
-
// images_upload_url: 'files/upload',
|
|
106
|
-
// images_upload_handler: this.uploader,
|
|
107
|
-
images_file_types: 'jpeg,jpg,png',
|
|
108
|
-
autoresize_bottom_margin: 50,
|
|
109
|
-
allow_link: !!this.allowLink,
|
|
110
|
-
allow_style: true,
|
|
111
|
-
allow_link_style: false,
|
|
112
|
-
height: this.height || 400,
|
|
113
|
-
min_height: (this.minHeight || this.height) || 400,
|
|
114
|
-
allow_code: false,
|
|
115
|
-
autoresize_on_init: true,
|
|
116
|
-
autosave_ask_before_unload: false,
|
|
117
|
-
autosave_interval: '5s',
|
|
118
|
-
autosave_restore_when_empty: true,
|
|
119
|
-
paste_data_images: false,
|
|
120
|
-
paste_block_drop: false,
|
|
121
|
-
relative_urls: false,
|
|
122
|
-
remove_script_host: false,
|
|
123
|
-
paste_as_text: true,
|
|
124
|
-
valid_elements: 'p,a,b,strong,i,em,h1,h2,h3,h4,h5,ul,ol,li,img,br',
|
|
125
|
-
paste_word_valid_elements: 'p,a,b,strong,i,em,h1,h2,h3,h4,h5,ul,ol,li,img,br',
|
|
126
|
-
paste_tab_spaces: 0,
|
|
127
|
-
default_link_target: '_blank',
|
|
128
|
-
link_assume_external_targets: true,
|
|
129
|
-
link_quicklink: true,
|
|
130
|
-
powerpaste_word_import: 'clean',
|
|
131
|
-
powerpaste_html_import: 'clean',
|
|
132
|
-
auto_refresh_interval: 500,
|
|
133
|
-
convert_urls: false,
|
|
134
|
-
verify_html: false,
|
|
135
|
-
valid_children: '+a[div|h1|h2|h3|h4|h5|h6|p|#text]',
|
|
136
|
-
}"
|
|
137
|
-
/>
|
|
48
|
+
<Editor
|
|
49
|
+
v-model="modelValue"
|
|
50
|
+
class="tiny-editor-input-el"
|
|
51
|
+
:init="options"
|
|
52
|
+
/>
|
|
138
53
|
</template>
|
|
139
|
-
<style
|
|
140
|
-
textarea {
|
|
141
|
-
|
|
142
|
-
|
|
54
|
+
<style>
|
|
55
|
+
textarea.tiny-editor-input-el {
|
|
56
|
+
width: 100%;
|
|
57
|
+
min-height: 200px;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
border: 0;
|
|
60
|
+
outline: none;
|
|
61
|
+
background-image: url("css/loader.gif");
|
|
62
|
+
background-repeat: no-repeat;
|
|
63
|
+
background-position: center center;
|
|
143
64
|
}
|
|
144
|
-
</style>
|
|
65
|
+
</style>
|
|
Binary file
|