bfg-common 1.5.130 → 1.5.131
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.
|
@@ -443,7 +443,7 @@ const onSaveOptions = (name: string): void => {
|
|
|
443
443
|
const prefix = props.project === 'sphere'
|
|
444
444
|
useLocalStorage(`${name}ChartOptions`, saveOptionsData, prefix)
|
|
445
445
|
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
446
|
-
localSelectedChartOptionName.value = name
|
|
446
|
+
// localSelectedChartOptionName.value = name
|
|
447
447
|
emits('save-option-name')
|
|
448
448
|
}
|
|
449
449
|
|
package/package.json
CHANGED
package/plugins/directives.ts
CHANGED
|
@@ -3,22 +3,69 @@ import type { DirectiveBinding } from '@vue/runtime-core'
|
|
|
3
3
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
4
4
|
nuxtApp.vueApp.directive('development', {
|
|
5
5
|
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
el
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
el.addEventListener(
|
|
14
|
-
'click',
|
|
15
|
-
(e: MouseEvent) => {
|
|
16
|
-
e.preventDefault()
|
|
17
|
-
e.stopPropagation()
|
|
18
|
-
return false
|
|
19
|
-
},
|
|
20
|
-
true
|
|
21
|
-
)
|
|
6
|
+
applyDevelopmentState(el, binding.value)
|
|
7
|
+
},
|
|
8
|
+
updated(el: HTMLElement, binding: DirectiveBinding) {
|
|
9
|
+
applyDevelopmentState(el, binding.value)
|
|
10
|
+
},
|
|
11
|
+
unmounted(el: HTMLElement) {
|
|
12
|
+
cleanupDevelopment(el)
|
|
22
13
|
},
|
|
23
14
|
})
|
|
24
15
|
})
|
|
16
|
+
function applyDevelopmentState(el: HTMLElement, isDevelopment: boolean) {
|
|
17
|
+
cleanupDevelopment(el)
|
|
18
|
+
if (!isDevelopment) return
|
|
19
|
+
|
|
20
|
+
el.setAttribute('title', 'In development')
|
|
21
|
+
el.setAttribute('disabled', 'true')
|
|
22
|
+
el.style.opacity = '0.6'
|
|
23
|
+
el.style.cursor = 'not-allowed'
|
|
24
|
+
|
|
25
|
+
// Оборачиваем, чтобы не навешивать несколько обработчиков
|
|
26
|
+
const preventClick = (e: MouseEvent) => {
|
|
27
|
+
e.preventDefault()
|
|
28
|
+
e.stopPropagation()
|
|
29
|
+
return false
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
el.addEventListener('click', preventClick, true)
|
|
33
|
+
|
|
34
|
+
// Сохраняем ссылку на обработчик в DOM-элементе, если понадобится удалить потом
|
|
35
|
+
;(el as any)._developmentClickHandler = preventClick
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function cleanupDevelopment(el: HTMLElement) {
|
|
39
|
+
el.removeAttribute('title')
|
|
40
|
+
el.style.opacity = ''
|
|
41
|
+
el.style.cursor = ''
|
|
42
|
+
|
|
43
|
+
const handler = (el as any)._developmentClickHandler
|
|
44
|
+
if (handler) {
|
|
45
|
+
el.removeEventListener('click', handler, true)
|
|
46
|
+
delete (el as any)._developmentClickHandler
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// export default defineNuxtPlugin((nuxtApp) => {
|
|
51
|
+
// nuxtApp.vueApp.directive('development', {
|
|
52
|
+
// mounted(el: HTMLElement, binding: DirectiveBinding) {
|
|
53
|
+
// if (!binding.value) return
|
|
54
|
+
//
|
|
55
|
+
// el.setAttribute('title', 'In development')
|
|
56
|
+
// el.setAttribute('disabled', 'true')
|
|
57
|
+
// el.style.opacity = '0.6'
|
|
58
|
+
// el.style.cursor = 'not-allowed'
|
|
59
|
+
//
|
|
60
|
+
// el.addEventListener(
|
|
61
|
+
// 'click',
|
|
62
|
+
// (e: MouseEvent) => {
|
|
63
|
+
// e.preventDefault()
|
|
64
|
+
// e.stopPropagation()
|
|
65
|
+
// return false
|
|
66
|
+
// },
|
|
67
|
+
// true
|
|
68
|
+
// )
|
|
69
|
+
// },
|
|
70
|
+
// })
|
|
71
|
+
// })
|