@burh/nuxt-core 1.0.38 → 1.0.40

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.
@@ -25,7 +25,8 @@
25
25
  type: String,
26
26
  default: ''
27
27
  },
28
- name: String
28
+ name: String,
29
+ error: Array,
29
30
  },
30
31
  data () {
31
32
  return {
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <div class="quill">
3
+ <div :id="toolbarId">
4
+ <div class="ql-formats">
5
+ <button class="ql-bold"></button>
6
+ <button class="ql-italic"></button>
7
+ <button class="ql-underline"></button>
8
+ <button class="ql-link"></button>
9
+ <button class="ql-blockquote"></button>
10
+ <button class="ql-code"></button>
11
+ <button class="ql-image"></button>
12
+ <button type="button" class="ql-list" value="ordered"></button>
13
+ <button type="button" class="ql-list" value="bullet"></button>
14
+ </div>
15
+ </div>
16
+ <div :id="editorId" :name="name" class ref="editor"></div>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ export default {
21
+ name: "html-editor",
22
+ props: {
23
+ value: {
24
+ type: String,
25
+ default: "",
26
+ },
27
+ name: String,
28
+ },
29
+ data() {
30
+ return {
31
+ editor: null,
32
+ content: null,
33
+ lastHtmlValue: "",
34
+ editorId: null,
35
+ toolbarId: null,
36
+ };
37
+ },
38
+ methods: {
39
+ initialize(Quill) {
40
+ this.editor = new Quill(`#${this.editorId}`, {
41
+ theme: "snow",
42
+ modules: {
43
+ toolbar: `#${this.toolbarId}`,
44
+ },
45
+ });
46
+
47
+ if (this.value.length > 0) {
48
+ this.editor.pasteHTML(this.value);
49
+ }
50
+
51
+ let editorRef = this.$refs.editor;
52
+ let node = editorRef.children[0];
53
+ this.editor.on("text-change", () => {
54
+ let html = node.innerHTML;
55
+ if (html === "<p><br></p>") {
56
+ html = "";
57
+ }
58
+ this.content = html;
59
+ this.$emit("input", this.content);
60
+ });
61
+ },
62
+ pasteHTML() {
63
+ if (!this.editor) {
64
+ return;
65
+ }
66
+ this.editor.pasteHTML(this.value);
67
+ },
68
+ randomString() {
69
+ let text = "";
70
+ let possible =
71
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
72
+
73
+ for (let i = 0; i < 5; i++)
74
+ text += possible.charAt(
75
+ Math.floor(Math.random() * possible.length)
76
+ );
77
+
78
+ return text;
79
+ },
80
+ },
81
+ async mounted() {
82
+ let Quill = await import("quill");
83
+ Quill = Quill.default || Quill;
84
+ this.editorId = this.randomString();
85
+ this.toolbarId = this.randomString();
86
+ this.$nextTick(() => {
87
+ this.initialize(Quill);
88
+ });
89
+ },
90
+ watch: {
91
+ value(newVal) {
92
+ if (newVal !== this.content) {
93
+ this.pasteHTML(newVal);
94
+ }
95
+ },
96
+ },
97
+ };
98
+ </script>
99
+ <style lang="scss">
100
+ .ql-clipboard {
101
+ display: none;
102
+ }
103
+ .ql-editor {
104
+ margin-bottom: 1.5rem;
105
+ resize: vertical;
106
+ overflow-y: scroll;
107
+ }
108
+ </style>
@@ -156,6 +156,20 @@ export default {
156
156
  default: ''
157
157
  },
158
158
  },
159
+ watch:{
160
+ titleValue(newValue){
161
+ this.configInfo.title = newValue;
162
+ },
163
+ textAreaValue(newValue){
164
+ this.configInfo.textarea = newValue;
165
+ },
166
+ workloadValue(newValue){
167
+ this.configInfo.workload = newValue;
168
+ },
169
+ time(newValue){
170
+ this.configInfo.selectedTime = newValue;
171
+ }
172
+ },
159
173
  mounted() {
160
174
  this.loadTime();
161
175
  },
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <modal :show.sync="showModal" v-on:close="$emit('close-modal')" bodyClasses="row px-4">
3
+
4
+ <h2 class="col-12 text-center">Ahh!</h2>
5
+
6
+ <p class="col-12 text-center">Não é possivel mais editar este curso.</p>
7
+
8
+ <div class="col-12 mb-4">
9
+ <img class="d-block ml-auto" src="/img/content/avatar-burh-404.svg" alt="imagem de erro">
10
+ </div>
11
+
12
+ <div class="col-12">
13
+ <p class="text-center">Este curso já tem alunos em progresso, para não alterar o progresso deles, não é possível editar este curso. Mas tudo bem! Você pode duplicar este e criar um novo.</p>
14
+ </div>
15
+
16
+ <template slot="footer">
17
+ <base-button type="link" @click="$emit('btn-first-click')">Fechar
18
+ </base-button>
19
+ <base-button type="primary" class="mx-auto" @click="$emit('btn-second-click')">Criar Cópia Editável</base-button>
20
+ </template>
21
+ </modal>
22
+ </template>
23
+
24
+ <script>
25
+
26
+ export default {
27
+ name: 'course-message-modal',
28
+ props: {
29
+ active: false,
30
+ courseName: {
31
+ type: String,
32
+ default : ''
33
+ },
34
+ data: {
35
+ type: String,
36
+ default:()=>''
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ showModal: this.active
42
+ }
43
+ },
44
+ watch: {
45
+ active(value) {
46
+ this.showModal = value;
47
+ }
48
+ }
49
+ }
50
+ </script>
51
+
52
+ <style lang="scss">
53
+ .modal-footer {
54
+ display: block;
55
+
56
+ @media (max-width: 780px) {
57
+ .btn {
58
+ display: block;
59
+ width: 100%;
60
+ }
61
+ }
62
+ @media (min-width: 780px) {
63
+ display: flex;
64
+ }
65
+ }
66
+ </style>
@@ -0,0 +1,61 @@
1
+ <template>
2
+ <modal :show.sync="openModal" v-on:close="$emit('close-modal-video')" modalContentClasses="container-fluid" class="modal">
3
+ <template slot="header">
4
+ <div class=""><h2 class="display-4">Editar capa do treinamento</h2></div>
5
+ </template>
6
+
7
+ <dropzone-file-upload v-model="fileToUpload"></dropzone-file-upload>
8
+
9
+ <div class="d-flex">
10
+ <base-button size="md" type="primary" role="button"
11
+ @click="saveImage"
12
+ class="ml-auto">Salvar Imagem
13
+ </base-button>
14
+ </div>
15
+ </modal>
16
+ </template>
17
+ <script>
18
+ import DropzoneFileUpload from '@burh/nuxt-core/components/argon-core/Inputs/DropzoneFileUpload.vue';
19
+ export default {
20
+ components: {
21
+ DropzoneFileUpload,
22
+ },
23
+ props:{
24
+ show: false
25
+ },
26
+ data(){
27
+ return{
28
+ fileToUpload: null,
29
+ }
30
+ },
31
+ model:{
32
+ prop: 'show'
33
+ },
34
+ computed:{
35
+ openModal:{
36
+ get(){
37
+ return this.show
38
+ },
39
+ set(show){
40
+ this.$emit('input', show)
41
+ }
42
+ }
43
+ },
44
+ methods:{
45
+ async saveImage(){
46
+ let image = this.fileToUpload
47
+ this.$emit('save-img', image)
48
+
49
+ this.$emit('close-modal-video')
50
+ }
51
+ }
52
+ }
53
+ </script>
54
+ <style lang="scss" scoped>
55
+ /deep/.dropzone {
56
+ button.dz-button {
57
+ background-color: transparent;
58
+ border: 0;
59
+ }
60
+ }
61
+ </style>
@@ -57,7 +57,7 @@ export default {
57
57
  BaseNav,
58
58
  UserMenuDropdown,
59
59
  AppLinkArea,
60
- AvatarLink
60
+ AvatarLink,
61
61
  },
62
62
  props: {
63
63
  currentUser: Object,
@@ -68,11 +68,11 @@ export default {
68
68
  showableProducts: Object,
69
69
  activeProducts: Array,
70
70
  gridApps: Array,
71
- indexRoute: String,
72
71
  },
73
72
  data() {
74
73
  return {
75
- console: console,
74
+ console: console,
75
+ indexRoute: String,
76
76
  urlBackToBusiness: process.env.oldBusinessUrl
77
77
  };
78
78
  },
@@ -82,7 +82,13 @@ export default {
82
82
  },
83
83
  redirectIndex() {
84
84
  this.$router.push(this.indexRoute);
85
- }
85
+ },
86
+ getCurrentApp(){
87
+ this.indexRoute = `/${this.$route.path.split('/')[1]}`
88
+ },
89
+ },
90
+ mounted(){
91
+ this.getCurrentApp();
86
92
  }
87
93
  };
88
94
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {
@@ -58,6 +58,7 @@
58
58
  "perfect-scrollbar": "^1.4.0",
59
59
  "prismjs": "^1.17.1",
60
60
  "quill": "^1.3.6",
61
+ "quill-image-resize-module": "^3.0.0",
61
62
  "read-env": "^1.3.0",
62
63
  "sticky-js": "^1.2.0",
63
64
  "sweetalert2": "^8.11.6",