@burh/nuxt-core 1.0.36 → 1.0.39

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.
@@ -16,6 +16,7 @@
16
16
  }
17
17
 
18
18
  .card-img-top {
19
+ height: 100%;
19
20
  @if ($enable-shadows == false) {
20
21
  width: calc(100% + 2px);
21
22
  margin-left: -1px;
@@ -1,72 +1,72 @@
1
1
  <template>
2
- <div class="card"
3
- :class="[
4
- {'card-lift--hover': hover},
5
- {'shadow': shadow},
6
- {[`shadow-${shadowSize}`]: shadowSize},
7
- {[`bg-gradient-${gradient}`]: gradient},
8
- {[`bg-${type}`]: type}
9
- ]">
2
+ <div class="card"
3
+ :class="[
4
+ {'card-lift--hover': hover},
5
+ {'shadow': shadow},
6
+ {[`shadow-${shadowSize}`]: shadowSize},
7
+ {[`bg-gradient-${gradient}`]: gradient},
8
+ {[`bg-${type}`]: type}
9
+ ]">
10
10
 
11
- <slot name="image"></slot>
12
- <div class="card-header" :class="headerClasses" v-if="$slots.header">
13
- <slot name="header">
14
- </slot>
15
- </div>
16
- <div class="card-body" :class="bodyClasses" v-if="!noBody">
17
- <slot></slot>
18
- </div>
11
+ <slot name="image"></slot>
12
+ <div class="card-header" :class="headerClasses" v-if="$slots.header">
13
+ <slot name="header">
14
+ </slot>
15
+ </div>
16
+ <div class="card-body" :class="bodyClasses" v-if="!noBody">
17
+ <slot></slot>
18
+ </div>
19
19
 
20
- <slot v-if="noBody"></slot>
20
+ <slot v-if="noBody"></slot>
21
21
 
22
- <div class="card-footer" :class="footerClasses" v-if="$slots.footer">
23
- <slot name="footer"></slot>
24
- </div>
25
- </div>
22
+ <div class="card-footer" :class="footerClasses" v-if="$slots.footer">
23
+ <slot name="footer"></slot>
24
+ </div>
25
+ </div>
26
26
  </template>
27
27
  <script>
28
- export default {
29
- name: "card",
30
- props: {
31
- type: {
32
- type: String,
33
- description: "Card type"
34
- },
35
- gradient: {
36
- type: String,
37
- description: "Card background gradient type (warning,danger etc)"
38
- },
39
- hover: {
40
- type: Boolean,
41
- description: "Whether card should move on hover"
42
- },
43
- shadow: {
44
- type: Boolean,
45
- description: "Whether card has shadow"
46
- },
47
- shadowSize: {
48
- type: String,
49
- description: "Card shadow size"
50
- },
51
- noBody: {
52
- type: Boolean,
53
- default: false,
54
- description: "Whether card should have wrapper body class"
55
- },
56
- bodyClasses: {
57
- type: [String, Object, Array],
58
- description: "Card body css classes"
59
- },
60
- headerClasses: {
61
- type: [String, Object, Array],
62
- description: "Card header css classes"
63
- },
64
- footerClasses: {
65
- type: [String, Object, Array],
66
- description: "Card footer css classes"
67
- }
68
- }
69
- };
28
+ export default {
29
+ name: 'card',
30
+ props: {
31
+ type: {
32
+ type: String,
33
+ description: 'Card type'
34
+ },
35
+ gradient: {
36
+ type: String,
37
+ description: 'Card background gradient type (warning,danger etc)'
38
+ },
39
+ hover: {
40
+ type: Boolean,
41
+ description: 'Whether card should move on hover'
42
+ },
43
+ shadow: {
44
+ type: Boolean,
45
+ description: 'Whether card has shadow'
46
+ },
47
+ shadowSize: {
48
+ type: String,
49
+ description: 'Card shadow size'
50
+ },
51
+ noBody: {
52
+ type: Boolean,
53
+ default: false,
54
+ description: 'Whether card should have wrapper body class'
55
+ },
56
+ bodyClasses: {
57
+ type: [String, Object, Array],
58
+ description: 'Card body css classes'
59
+ },
60
+ headerClasses: {
61
+ type: [String, Object, Array],
62
+ description: 'Card header css classes'
63
+ },
64
+ footerClasses: {
65
+ type: [String, Object, Array],
66
+ description: 'Card footer css classes'
67
+ }
68
+ }
69
+ };
70
70
  </script>
71
71
  <style>
72
72
  </style>
@@ -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 {
@@ -94,3 +95,11 @@
94
95
  }
95
96
  }
96
97
  </script>
98
+ <style lang="scss">
99
+ .ql-clipboard{
100
+ display: none;
101
+ }
102
+ .ql-editor{
103
+ margin-bottom: 1.5rem;
104
+ }
105
+ </style>
@@ -1,54 +1,54 @@
1
1
  <template>
2
2
  <div class="column">
3
3
  <div class="card card-app" @click.prevent="$emit('test-click')">
4
- <base-dropdown class="top-right custom" v-if="showMenu">
5
- <i slot="title-container"
6
- class="fa fa-ellipsis-h custom"
7
- aria-hidden="true"
8
- />
9
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="sendTest">
10
- <i class="fa fa-paper-plane" aria-hidden="true" />
11
- <span>
12
- Enviar teste
13
- </span>
14
- </li>
15
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="viewTest">
16
- <i class="fa fa-eye" aria-hidden="true" />
17
- <span>
18
- Visualizar teste
19
- </span>
20
- </li>
21
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="viewAnsweredTests">
22
- <i class="fa fa-file" aria-hidden="true" />
23
- <span>
24
- Respostas recebidas
25
- </span>
26
- </li>
27
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="exportExcel(id)">
28
- <i class="fa fa-arrow-circle-down" aria-hidden="true" />
29
- <span>
30
- Exportar Respostas
31
- </span>
32
- </li>
33
- <li class="dropdown-item d-flex align-items-center w-100" @click="copyTest">
34
- <i class="fa fa-clone" aria-hidden="true" />
35
- <span>
36
- Fazer uma cópia
37
- </span>
38
- </li>
39
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="openRenameEditor">
40
- <i class="fa fa-pen" aria-hidden="true" />
41
- <span>
42
- Renomear teste
43
- </span>
44
- </li>
45
- <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="deleteTest(id)">
46
- <i class="fa fa-trash" aria-hidden="true" />
47
- <span>
48
- Apagar teste
49
- </span>
50
- </li>
51
- </base-dropdown>
4
+ <base-dropdown class="top-right custom" v-if="showMenu">
5
+ <i slot="title-container"
6
+ class="fa fa-ellipsis-h custom"
7
+ aria-hidden="true"
8
+ />
9
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="sendTest">
10
+ <i class="fa fa-paper-plane" aria-hidden="true" />
11
+ <span>
12
+ Enviar teste
13
+ </span>
14
+ </li>
15
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="viewTest">
16
+ <i class="fa fa-eye" aria-hidden="true" />
17
+ <span>
18
+ Visualizar teste
19
+ </span>
20
+ </li>
21
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="viewAnsweredTests">
22
+ <i class="fa fa-file" aria-hidden="true" />
23
+ <span>
24
+ Respostas recebidas
25
+ </span>
26
+ </li>
27
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="exportExcel(id)">
28
+ <i class="fa fa-arrow-circle-down" aria-hidden="true" />
29
+ <span>
30
+ Exportar Respostas
31
+ </span>
32
+ </li>
33
+ <li class="dropdown-item d-flex align-items-center w-100" @click="copyTest">
34
+ <i class="fa fa-clone" aria-hidden="true" />
35
+ <span>
36
+ Fazer uma cópia
37
+ </span>
38
+ </li>
39
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="openRenameEditor">
40
+ <i class="fa fa-pen" aria-hidden="true" />
41
+ <span>
42
+ Renomear teste
43
+ </span>
44
+ </li>
45
+ <li v-if="isDefault" class="dropdown-item d-flex align-items-center w-100" @click="deleteTest(id)">
46
+ <i class="fa fa-trash" aria-hidden="true" />
47
+ <span>
48
+ Apagar teste
49
+ </span>
50
+ </li>
51
+ </base-dropdown>
52
52
  <img
53
53
  v-if="icon === ''"
54
54
  class="card__image"
@@ -62,13 +62,13 @@
62
62
  />
63
63
  </div>
64
64
  <input
65
- class="w-100"
66
- v-if="showNameEditor"
67
- v-model="newName"
68
- @keyup.enter="renameTest"
69
- @blur="renameTest"
70
- ref="teste"
71
- />
65
+ class="w-100"
66
+ v-if="showNameEditor"
67
+ v-model="newName"
68
+ @keyup.enter="renameTest"
69
+ @blur="renameTest"
70
+ ref="teste"
71
+ />
72
72
  <span v-else class="card-title w-100 text-center">{{text}}</span>
73
73
  </div>
74
74
  </template>
@@ -94,10 +94,10 @@ export default {
94
94
  default: false,
95
95
  description: 'Defines if option menu is visible'
96
96
  },
97
- isDefault: {
98
- type: Boolean,
99
- default: false,
100
- }
97
+ isDefault: {
98
+ type: Boolean,
99
+ default: false,
100
+ }
101
101
  },
102
102
  methods: {
103
103
  sendTest(e) {
@@ -113,15 +113,15 @@ export default {
113
113
  this.$emit('copy-test');
114
114
  },
115
115
  openRenameEditor() {
116
- this.showNameEditor = true;
116
+ this.showNameEditor = true;
117
117
 
118
- this.$nextTick()
119
- .then(() => this.$refs.teste.focus()
120
- )
118
+ this.$nextTick()
119
+ .then(() => this.$refs.teste.focus()
120
+ );
121
+ },
122
+ focusInput() {
123
+ this.$refs.teste.$el.focus();
121
124
  },
122
- focusInput() {
123
- this.$refs.teste.$el.focus();
124
- },
125
125
  renameTest() {
126
126
  const rename = {
127
127
  id: this.id,
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <card class="card-app card-app--training" :class="icon ? 'card--icon' : '' " @click.native="$emit('course-click')">
3
+ <base-dropdown class="top-right custom" v-if="showMenu">
4
+ <i slot="title-container"
5
+ class="fa fa-ellipsis-h custom"
6
+ aria-hidden="true"
7
+ />
8
+ <li v-for="actions in dropdownActions" class="dropdown-item d-flex align-items-center w-100" @click="$emit(actions.action)" :key="actions.name">
9
+ <i :class="actions.icon ? actions.icon : 'fa fa-paper-plane'" aria-hidden="true" />
10
+ <span>
11
+ {{actions.name}}
12
+ </span>
13
+ </li>
14
+ <li v-if="defaultAction" class="dropdown-item d-flex align-items-center w-100" @click="$emit(defaultAction.action)">
15
+ <i :class="defaultAction.icon ? defaultAction.icon : 'fa fa-clone'" aria-hidden="true" />
16
+ <span>
17
+ {{defaultAction.name}}
18
+ </span>
19
+ </li>
20
+ </base-dropdown>
21
+ <img v-if="image" slot="image" class="card-img-top" :src="image" alt="Card image cap">
22
+
23
+ <i v-if="icon" slot="image" :class="icon" class="card-img-top card__icon"/>
24
+ <!-- title -->
25
+ <h3 class="h6 title mb-2">{{title}}</h3>
26
+ <!-- descrição -->
27
+ <p v-if="description" class="card-title mb-2">{{description}}</p>
28
+ <!-- another information -->
29
+ <p v-if="info" class="card-title"><small class="text-muted">{{info}}</small></p>
30
+ </card>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: 'training-card',
36
+ data(){
37
+ return{
38
+ };
39
+ },
40
+ props: {
41
+ id: Number,
42
+ icon: String,
43
+ link: String,
44
+ image: String,
45
+ title: String,
46
+ description: String,
47
+ info: String,
48
+ showMenu: {
49
+ type: Boolean,
50
+ default: false,
51
+ description: 'Defines if option menu is visible'
52
+ },
53
+ dropdownActions: null,
54
+ defaultAction: null
55
+ }
56
+ };
57
+ </script>
58
+
59
+ <style lang="scss">
60
+ .title{
61
+ margin-bottom: 0px !important;
62
+ }
63
+
64
+ .card {
65
+ position: relative;
66
+ &:hover {
67
+ .custom {
68
+ display: block;
69
+ }
70
+ }
71
+ }
72
+
73
+ .custom {
74
+ color: #ffffff;
75
+ background-color: #8192a6;
76
+ border-radius: 15%;
77
+ font-size: 1.25rem;
78
+ padding: .25rem .5rem;
79
+ display: none;
80
+ &:hover {
81
+ cursor: pointer;
82
+ }
83
+ }
84
+
85
+ .top-right {
86
+ right: .5rem;
87
+ position: absolute;
88
+ top: .5rem;
89
+ z-index: 100;
90
+ }
91
+
92
+ .fa-plus::before {
93
+ content: "\f067";
94
+ position: relative;
95
+ top: 25%;
96
+ transform: translateY(-50%);
97
+ }
98
+ </style>
@@ -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>