@afeefa/vue-app 0.0.263 → 0.0.265

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.263
1
+ 0.0.265
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@afeefa/vue-app",
3
- "version": "0.0.263",
3
+ "version": "0.0.265",
4
4
  "description": "",
5
5
  "author": "Afeefa Kollektiv <kollektiv@afeefa.de>",
6
6
  "license": "MIT",
@@ -2,6 +2,7 @@
2
2
  <div class="contextEditor">
3
3
  <!-- click.stop prevents possible surrounding v-input to focus -->
4
4
  <div
5
+ v-if="!customAnchor"
5
6
  class="activator"
6
7
  @click.stop="open"
7
8
  >
@@ -32,7 +33,7 @@ import { Positions, PositionConfig } from '../services/PositionService'
32
33
  import { randomCssClass } from '../utils/random'
33
34
 
34
35
  @Component({
35
- props: ['contentHeight', 'repositionWatchKey', 'triggerIcon']
36
+ props: ['contentHeight', 'repositionWatchKey', 'triggerIcon', 'customAnchor']
36
37
  })
37
38
  export default class AContextMenu extends Mixins(UsesPositionServiceMixin) {
38
39
  CONTEXT_MENU = true
@@ -44,9 +45,27 @@ export default class AContextMenu extends Mixins(UsesPositionServiceMixin) {
44
45
  return 'popUp-' + this.menuId
45
46
  }
46
47
 
48
+ mounted () {
49
+ if (this.customAnchor) {
50
+ this.open()
51
+ }
52
+ }
53
+
47
54
  positionize () {
55
+ let anchor = this.customAnchor || [this, '.activator']
56
+
57
+ if (!Array.isArray(anchor)) {
58
+ if (typeof anchor === 'string') {
59
+ anchor = [document.documentElement, anchor]
60
+ } else if (typeof anchor === 'object') { // dom element or vue ref
61
+ anchor = [anchor]
62
+ } else {
63
+ anchor = [document.documentElement]
64
+ }
65
+ }
66
+
48
67
  const position = new PositionConfig()
49
- .setAnchor(this, '.activator')
68
+ .setAnchor(...anchor)
50
69
  .setTarget(
51
70
  document.documentElement,
52
71
  '.' + this.popUpCssClass + ' .popUpContent'
@@ -104,6 +123,13 @@ export default class AContextMenu extends Mixins(UsesPositionServiceMixin) {
104
123
  this.urp_update()
105
124
  }
106
125
 
126
+ @Watch('customAnchor')
127
+ customAnchorChanged () {
128
+ if (this.customAnchor && !this.isOpen) {
129
+ this.open()
130
+ }
131
+ }
132
+
107
133
  getContainer () {
108
134
  return document.querySelector('.v-application')
109
135
  }
@@ -30,7 +30,10 @@ export class AfeefaAdmin {
30
30
  }
31
31
 
32
32
  customConfig (customConfig) {
33
- adminConfig.config = customConfig
33
+ adminConfig.config = {
34
+ ...adminConfig.config,
35
+ ...customConfig
36
+ }
34
37
  return this
35
38
  }
36
39
 
@@ -17,7 +17,9 @@ class AdminConfig {
17
17
  icons: {}
18
18
  }
19
19
 
20
- config = {}
20
+ config = {
21
+ has2FA: false
22
+ }
21
23
  }
22
24
 
23
25
  export const adminConfig = new AdminConfig()