@afeefa/vue-app 0.0.55 → 0.0.58

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.
@@ -1 +1 @@
1
- 0.0.55
1
+ 0.0.58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.55",
3
+ "version": "0.0.58",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -132,6 +132,8 @@ export default class ADialog extends Mixins(UsesPositionServiceMixin) {
132
132
  if (!Array.isArray(anchor)) {
133
133
  if (typeof anchor === 'string') {
134
134
  anchor = [document.documentElement, anchor]
135
+ } else if (typeof anchor === 'object') { // dom element or vue ref
136
+ anchor = [anchor]
135
137
  } else {
136
138
  anchor = [document.documentElement]
137
139
  }
@@ -1,28 +1,88 @@
1
1
  <template>
2
2
  <div :class="['a-rich-text-editor a-text-input', {'a-text-input-focused': focus}]">
3
- <div v-if="editor">
4
- <button
5
- type="button"
6
- :class="{ 'is-active': editor.isActive('bold') }"
3
+ <div
4
+ v-if="editor"
5
+ class="menu-bar"
6
+ >
7
+ <v-btn
8
+ small
9
+ :class="['menu-button', {'is-active': focus && editor.isActive('bold')}]"
7
10
  @click="editor.chain().focus().toggleBold().run()"
8
11
  >
9
- bold
10
- <a-mdi-icon />
11
- </button>
12
- <button
13
- type="button"
14
- :class="{ 'is-active': editor.isActive('italic') }"
12
+ <v-icon>{{ boldIcon }}</v-icon>
13
+ </v-btn>
14
+
15
+ <v-btn
16
+ small
17
+ :class="['menu-button', {'is-active': focus && editor.isActive('italic')}]"
15
18
  @click="editor.chain().focus().toggleItalic().run()"
16
19
  >
17
- italic
18
- </button>
19
- <button
20
- type="button"
21
- :class="{ 'is-active': editor.isActive('strike') }"
20
+ <v-icon>{{ italicIcon }}</v-icon>
21
+ </v-btn>
22
+
23
+ <v-btn
24
+ small
25
+ :class="['menu-button', 'strike', {'is-active': focus && editor.isActive('strike')}]"
22
26
  @click="editor.chain().focus().toggleStrike().run()"
23
27
  >
24
- strike
25
- </button>
28
+ <v-icon>{{ strikeIcon }}</v-icon>
29
+ </v-btn>
30
+
31
+ <v-btn
32
+ small
33
+ :class="['menu-button', {'is-active': focus && editor.isActive('heading', {level: 1})}]"
34
+ @click="editor.chain().focus().toggleHeading({level: 1}).run()"
35
+ >
36
+ <v-icon>{{ h1Icon }}</v-icon>
37
+ </v-btn>
38
+
39
+ <v-btn
40
+ small
41
+ :class="['menu-button', {'is-active': focus && editor.isActive('heading', {level: 2})}]"
42
+ @click="editor.chain().focus().toggleHeading({level: 2}).run()"
43
+ >
44
+ <v-icon>{{ h2Icon }}</v-icon>
45
+ </v-btn>
46
+
47
+ <v-btn
48
+ small
49
+ :class="['menu-button', {'is-active': focus && editor.isActive('bulletList')}]"
50
+ @click="editor.chain().focus().toggleBulletList().run()"
51
+ >
52
+ <v-icon>{{ ulIcon }}</v-icon>
53
+ </v-btn>
54
+
55
+ <v-btn
56
+ small
57
+ :class="['menu-button', {'is-active': focus && editor.isActive('orderedList')}]"
58
+ @click="editor.chain().focus().toggleOrderedList().run()"
59
+ >
60
+ <v-icon>{{ olIcon }}</v-icon>
61
+ </v-btn>
62
+
63
+ <v-btn
64
+ small
65
+ :class="['menu-button', {'is-active': focus && editor.isActive('blockquote')}]"
66
+ @click="editor.chain().focus().toggleBlockquote().run()"
67
+ >
68
+ <v-icon>{{ commentIcon }}</v-icon>
69
+ </v-btn>
70
+
71
+ <v-btn
72
+ small
73
+ class="menu-button"
74
+ @click="editor.chain().focus().undo().run()"
75
+ >
76
+ <v-icon>{{ undoIcon }}</v-icon>
77
+ </v-btn>
78
+
79
+ <v-btn
80
+ small
81
+ class="menu-button"
82
+ @click="editor.chain().focus().redo().run()"
83
+ >
84
+ <v-icon>{{ redoIcon }}</v-icon>
85
+ </v-btn>
26
86
  </div>
27
87
 
28
88
  <editor-content
@@ -37,6 +97,18 @@
37
97
  import { Component, Vue, Watch } from '@a-vue'
38
98
  import { Editor, EditorContent } from '@tiptap/vue-2'
39
99
  import StarterKit from '@tiptap/starter-kit'
100
+ import {
101
+ mdiFormatBold,
102
+ mdiFormatItalic,
103
+ mdiFormatStrikethroughVariant,
104
+ mdiFormatHeader1,
105
+ mdiFormatHeader2,
106
+ mdiFormatListBulleted,
107
+ mdiFormatListNumbered,
108
+ mdiFormatQuoteClose,
109
+ mdiRotateLeft,
110
+ mdiRotateRight
111
+ } from '@mdi/js'
40
112
 
41
113
  @Component({
42
114
  props: ['value', 'validator'],
@@ -49,6 +121,17 @@ export default class ARichTextArea extends Vue {
49
121
  internalValue = null
50
122
  focus = false
51
123
 
124
+ boldIcon = mdiFormatBold
125
+ italicIcon = mdiFormatItalic
126
+ strikeIcon = mdiFormatStrikethroughVariant
127
+ h1Icon = mdiFormatHeader1
128
+ h2Icon = mdiFormatHeader2
129
+ ulIcon = mdiFormatListBulleted
130
+ olIcon = mdiFormatListNumbered
131
+ commentIcon = mdiFormatQuoteClose
132
+ undoIcon = mdiRotateLeft
133
+ redoIcon = mdiRotateRight
134
+
52
135
  created () {
53
136
  this.internalValue = this.value
54
137
  }
@@ -59,7 +142,7 @@ export default class ARichTextArea extends Vue {
59
142
  }
60
143
 
61
144
  this.editor = new Editor({
62
- content: '<p>I’m running Tiptap with Vue.js. 🎉</p>',
145
+ content: this.internalValue,
63
146
  extensions: [
64
147
  StarterKit
65
148
  ],
@@ -118,4 +201,57 @@ export default class ARichTextArea extends Vue {
118
201
  }
119
202
  }
120
203
  }
204
+
205
+ .menu-bar {
206
+ margin: -.2rem 0 .5rem -.2rem;
207
+ }
208
+
209
+ .menu-button {
210
+ padding: 0 !important;
211
+ width: 30px !important;
212
+ height: 32px !important;
213
+ min-width: unset !important;
214
+ text-align: center;
215
+ font-size: 1rem;
216
+ background: white !important;
217
+ border: none;
218
+ box-shadow: none;
219
+ border-radius: 0;
220
+
221
+ ::v-deep .v-icon {
222
+ font-size: 20px;
223
+ width: 20px;
224
+ height: 20px;
225
+ }
226
+
227
+ &.strike {
228
+ ::v-deep .v-icon {
229
+ width: 15px;
230
+ }
231
+ }
232
+
233
+ svg {
234
+ width: unset;
235
+ }
236
+
237
+ &.is-active {
238
+ background: #ECECEC !important;
239
+ }
240
+ }
241
+
242
+ ::v-deep .ProseMirror {
243
+ min-height: 200px;
244
+
245
+ > :last-child {
246
+ margin: 0;
247
+ }
248
+
249
+ li p {
250
+ margin: 0;
251
+ }
252
+
253
+ ul {
254
+ margin: 16px 0;
255
+ }
256
+ }
121
257
  </style>
@@ -21,7 +21,7 @@
21
21
 
22
22
  <template #default="{changed, valid}">
23
23
  <a-row
24
- class="mt-8 mb-2 gap-4"
24
+ class="mt-8 mb-1 pb-1 gap-4"
25
25
  right
26
26
  >
27
27
  <v-btn
@@ -31,23 +31,25 @@
31
31
  Schließen
32
32
  </v-btn>
33
33
 
34
- <v-btn
35
- small
36
- :disabled="!changed || !valid"
37
- color="green white--text"
38
- @click="save"
39
- >
40
- Speichern
41
- </v-btn>
34
+ <a-row gap="2">
35
+ <v-btn
36
+ small
37
+ :disabled="!changed || !valid"
38
+ color="green white--text"
39
+ @click="save"
40
+ >
41
+ Speichern
42
+ </v-btn>
42
43
 
43
- <v-btn
44
- v-if="changed"
45
- small
46
- text
47
- @click="reset"
48
- >
49
- Zurücksetzen
50
- </v-btn>
44
+ <v-icon
45
+ v-if="changed"
46
+ small
47
+ text
48
+ @click="reset"
49
+ >
50
+ {{ undoIcon }}
51
+ </v-icon>
52
+ </a-row>
51
53
  </a-row>
52
54
  </template>
53
55
  </edit-form>
@@ -57,6 +59,7 @@
57
59
 
58
60
  <script>
59
61
  import { Component, Vue, Watch } from '@a-vue'
62
+ import { mdiRotateLeft} from '@mdi/js'
60
63
 
61
64
  @Component({
62
65
  props: ['model', 'title', 'show']
@@ -64,6 +67,8 @@ import { Component, Vue, Watch } from '@a-vue'
64
67
  export default class EditModal extends Vue {
65
68
  show_ = false
66
69
 
70
+ undoIcon = mdiRotateLeft
71
+
67
72
  /**
68
73
  * visiblility changes from outside
69
74
  * this will trigger the show_ watcher,
@@ -17,7 +17,9 @@ import { Component, Mixins } from '@a-vue'
17
17
  import { ListFilterMixin } from '../ListFilterMixin'
18
18
  import { ListAction } from '@a-vue/api-resources/ApiActions'
19
19
 
20
- @Component
20
+ @Component({
21
+ props: ['itemTitle', 'itemValue']
22
+ })
21
23
  export default class ListFilterSelect extends Mixins(ListFilterMixin) {
22
24
  items = null
23
25
 
@@ -60,10 +62,20 @@ export default class ListFilterSelect extends Mixins(ListFilterMixin) {
60
62
 
61
63
  return [
62
64
  ...this.createOptions(),
63
- ...models.map(model => ({
64
- itemTitle: model.name,
65
- itemValue: model.id
66
- }))
65
+ ...models.map(model => {
66
+ let itemValue
67
+ if (this.itemValue) {
68
+ itemValue = this.itemValue(model)
69
+ } else if (model.value !== undefined) {
70
+ itemValue = model.value
71
+ } else {
72
+ itemValue = model.id
73
+ }
74
+ return {
75
+ itemTitle: (this.itemTitle && this.itemTitle(model)) || model.name || model.title,
76
+ itemValue
77
+ }
78
+ })
67
79
  ]
68
80
  }
69
81
 
@@ -28,6 +28,7 @@
28
28
  <a-table-row
29
29
  v-for="model in models_"
30
30
  :key="model.id"
31
+ :class="getModelClass(model)"
31
32
  >
32
33
  <v-icon
33
34
  v-if="$has.icon"
@@ -49,6 +50,7 @@
49
50
  <div
50
51
  v-for="model in models_"
51
52
  :key="model.id"
53
+ :class="getModelClass(model)"
52
54
  >
53
55
  <slot
54
56
  name="model"
@@ -73,7 +75,9 @@ import { Component, Watch, Mixins } from '@a-vue'
73
75
  import { ListViewMixin } from '@a-vue/components/list/ListViewMixin'
74
76
  import { LoadingEvent } from '@a-vue/events'
75
77
 
76
- @Component
78
+ @Component({
79
+ props: ['modelClass']
80
+ })
77
81
  export default class ListView extends Mixins(ListViewMixin) {
78
82
  $hasOptions = ['icon']
79
83
 
@@ -89,6 +93,10 @@ export default class ListView extends Mixins(ListViewMixin) {
89
93
  this.$emit('update:isLoading', this.isLoading)
90
94
  }
91
95
 
96
+ getModelClass (model) {
97
+ return this.modelClass && this.modelClass(model)
98
+ }
99
+
92
100
  setFilter (name, value) {
93
101
  this.filters[name].value = value
94
102
  }
@@ -1,11 +1,15 @@
1
1
  <template>
2
- <div>ICON</div>
2
+ <div>TEST</div>
3
3
  </template>
4
4
 
5
5
 
6
6
  <script>
7
- export default {
7
+ import { Component, Vue } from '@a-vue'
8
8
 
9
+ @Component({
10
+ props: ['name']
11
+ })
12
+ export default class Splash extends Vue {
9
13
  }
10
14
  </script>
11
15