pui9-components 1.16.4
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/README.md +43 -0
- package/dist/demo.html +10 -0
- package/dist/pui9-components.common.js +81953 -0
- package/dist/pui9-components.common.js.map +1 -0
- package/dist/pui9-components.css +5 -0
- package/dist/pui9-components.umd.js +81963 -0
- package/dist/pui9-components.umd.js.map +1 -0
- package/dist/pui9-components.umd.min.js +308 -0
- package/dist/pui9-components.umd.min.js.map +1 -0
- package/package-lock.json +15945 -0
- package/package.json +78 -0
- package/src/App.vue +117 -0
- package/src/components/PuiCheckbox.vue +105 -0
- package/src/components/PuiCodeEditor.vue +123 -0
- package/src/components/PuiDateField.vue +1004 -0
- package/src/components/PuiField.vue +30 -0
- package/src/components/PuiFieldSet.vue +27 -0
- package/src/components/PuiFormFooter.vue +64 -0
- package/src/components/PuiFormFooterBtns.vue +118 -0
- package/src/components/PuiFormHeader.vue +25 -0
- package/src/components/PuiFormLoading.vue +12 -0
- package/src/components/PuiFormMiniAudit.vue +53 -0
- package/src/components/PuiMasterDetail.vue +96 -0
- package/src/components/PuiModalDialog.vue +87 -0
- package/src/components/PuiModalDialogForm.vue +205 -0
- package/src/components/PuiMultiSelect.vue +499 -0
- package/src/components/PuiNumberField.vue +503 -0
- package/src/components/PuiPasswordField.vue +105 -0
- package/src/components/PuiRadioGroup.vue +105 -0
- package/src/components/PuiRichTextEditor.vue +117 -0
- package/src/components/PuiSelect.vue +1638 -0
- package/src/components/PuiSelectDetailDialog.vue +106 -0
- package/src/components/PuiSelectTextService.vue +61 -0
- package/src/components/PuiSpinnerField.vue +484 -0
- package/src/components/PuiSwitch.vue +104 -0
- package/src/components/PuiTextArea.vue +203 -0
- package/src/components/PuiTextField.vue +272 -0
- package/src/dateTimeUtils.js +78 -0
- package/src/index.js +73 -0
- package/src/main.js +33 -0
- package/src/mixins/PuiFormComponentMixin.js +81 -0
- package/src/mixins/PuiMultiSelectMixin.js +106 -0
- package/src/mixins/PuiUtilsNumberMixin.js +19 -0
- package/src/plugins/vuetify.js +32 -0
- package/src/tests/TestAutocomplete.vue +138 -0
- package/src/tests/TestCodeEditor.vue +48 -0
- package/src/tests/TestField.vue +22 -0
- package/src/tests/TestFieldSet.vue +30 -0
- package/src/tests/TestInputCheckbox.vue +53 -0
- package/src/tests/TestInputDate.vue +146 -0
- package/src/tests/TestInputNumber.vue +77 -0
- package/src/tests/TestInputRadioGroup.vue +86 -0
- package/src/tests/TestInputSpinner.vue +77 -0
- package/src/tests/TestInputSwitch.vue +52 -0
- package/src/tests/TestInputText.vue +120 -0
- package/src/tests/TestInputTextArea.vue +73 -0
- package/src/tests/TestMultiSelect.vue +127 -0
- package/src/tests/TestPuiForm.vue +68 -0
- package/src/tests/TestRichTextEditor.vue +54 -0
- package/src/utils.js +148 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="richtexteditor-container ml-1 mr-1">
|
|
3
|
+
<div v-if="hasLabel()">
|
|
4
|
+
<label>{{ this.label }}</label>
|
|
5
|
+
<label class="richtexteditor-label-required" v-if="required">*</label>
|
|
6
|
+
</div>
|
|
7
|
+
<tinymce-editor v-bind:id="id" v-model="data" :plugins="plugins" :toolbar="toolbar" v-bind:ref="id" @onBlur="checkContent"></tinymce-editor>
|
|
8
|
+
<v-text-field v-if="required" v-model="data" :rules="getRules" style="display: none"></v-text-field>
|
|
9
|
+
<div class="richtexteditor-error-message">
|
|
10
|
+
<label class="richtexteditor-label-error">{{ $t('pui9.error.field_required') }}</label>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import Editor from '@tinymce/tinymce-vue';
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'PuiRichTextEditor',
|
|
20
|
+
components: {
|
|
21
|
+
'tinymce-editor': Editor
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
id: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
label: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
required: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
validationErrors: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
externalValue() {
|
|
47
|
+
return this.value;
|
|
48
|
+
},
|
|
49
|
+
getRules() {
|
|
50
|
+
const rules = [];
|
|
51
|
+
if (this.required) {
|
|
52
|
+
rules.push((data) => !!data || 'error');
|
|
53
|
+
}
|
|
54
|
+
return rules;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
plugins: [
|
|
60
|
+
'advlist autolink lists link image charmap preview hr anchor pagebreak',
|
|
61
|
+
'searchreplace wordcount visualblocks visualchars code fullscreen',
|
|
62
|
+
'insertdatetime nonbreaking save table directionality',
|
|
63
|
+
'emoticons template paste textpattern imagetools codesample toc'
|
|
64
|
+
],
|
|
65
|
+
toolbar: [
|
|
66
|
+
'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
|
|
67
|
+
],
|
|
68
|
+
data: this.value
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
mounted() {
|
|
72
|
+
this.loadData();
|
|
73
|
+
},
|
|
74
|
+
watch: {
|
|
75
|
+
data() {
|
|
76
|
+
this.checkContent();
|
|
77
|
+
this.$emit('input', this.data);
|
|
78
|
+
},
|
|
79
|
+
externalValue(newValue) {
|
|
80
|
+
this.data = newValue;
|
|
81
|
+
},
|
|
82
|
+
validationErrors() {
|
|
83
|
+
this.checkContent();
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
methods: {
|
|
87
|
+
hasLabel() {
|
|
88
|
+
return this.label !== undefined;
|
|
89
|
+
},
|
|
90
|
+
createEditor() {
|
|
91
|
+
Editor.init({
|
|
92
|
+
selector: '#editor',
|
|
93
|
+
plugins: 'image',
|
|
94
|
+
toolbar: ['undo redo | styleselect | bold italic | link image', 'alignleft aligncenter alignright']
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
loadData() {
|
|
98
|
+
this.data = this.$refs[this.id].value;
|
|
99
|
+
this.$emit('input', this.data);
|
|
100
|
+
},
|
|
101
|
+
checkContent() {
|
|
102
|
+
var errorMsg = this.$el.getElementsByClassName('richtexteditor-error-message');
|
|
103
|
+
var newsContainer = this.$el.getElementsByClassName('tox-tinymce');
|
|
104
|
+
|
|
105
|
+
if (this.required) {
|
|
106
|
+
if (this.data === null || this.data === '') {
|
|
107
|
+
errorMsg[0].style.display = 'block';
|
|
108
|
+
newsContainer[0].classList.add('richtexteditor-error-tinymce');
|
|
109
|
+
} else {
|
|
110
|
+
errorMsg[0].style.display = 'none';
|
|
111
|
+
newsContainer[0].classList.remove('richtexteditor-error-tinymce');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
</script>
|