@rural-environmental-registry/map_component 2.0.0 → 2.0.1
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.
- package/dist/index.css +1 -1
- package/dist/index.mjs +1944 -1931
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/menu/ChildMenu.vue +18 -11
- package/src/components/menu/LayerMenu.vue +1 -2
- package/src/types/index.ts +2 -0
- package/src/utils/layersConfigNormalizer.ts +3 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type LayerActionDefaultItem = {
|
|
|
19
19
|
key?: string;
|
|
20
20
|
name: string;
|
|
21
21
|
icon?: FaIconName;
|
|
22
|
+
tooltip?: string;
|
|
22
23
|
style?: LayerActionStyle;
|
|
23
24
|
disabled?: boolean;
|
|
24
25
|
visible?: boolean;
|
|
@@ -37,6 +38,7 @@ export type LayerActionConfig = {
|
|
|
37
38
|
type?: 'edit' | 'import' | 'delete' | 'visibility' | 'custom' | 'cancel' | 'conclude';
|
|
38
39
|
disabled?: boolean;
|
|
39
40
|
visible?: boolean;
|
|
41
|
+
tooltip?: string;
|
|
40
42
|
style?: LayerActionStyle;
|
|
41
43
|
};
|
|
42
44
|
export type LayerMetricsConfig = {
|
package/package.json
CHANGED
|
@@ -84,19 +84,26 @@
|
|
|
84
84
|
v-if="!hideControls && visibleActions.length"
|
|
85
85
|
class="child-menu-actions"
|
|
86
86
|
>
|
|
87
|
-
<
|
|
87
|
+
<ElTooltip
|
|
88
88
|
v-for="action in visibleActions"
|
|
89
89
|
:key="action.key"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
@click.stop="onActionClick(action)"
|
|
90
|
+
:content="action.tooltip || action.name"
|
|
91
|
+
:disabled="!(action.tooltip || action.name)"
|
|
92
|
+
placement="top"
|
|
94
93
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
<button
|
|
95
|
+
type="button"
|
|
96
|
+
class="child-action-button"
|
|
97
|
+
:disabled="action.disabled"
|
|
98
|
+
:aria-label="action.tooltip || action.name"
|
|
99
|
+
@click.stop="onActionClick(action)"
|
|
100
|
+
>
|
|
101
|
+
<FontAwesomeIcon
|
|
102
|
+
v-if="action.icon"
|
|
103
|
+
:iconName="action.icon"
|
|
104
|
+
/>
|
|
105
|
+
</button>
|
|
106
|
+
</ElTooltip>
|
|
100
107
|
</div>
|
|
101
108
|
<template v-else-if="!hideControls && visibilityMode !== 'eye'">
|
|
102
109
|
<ElSwitch
|
|
@@ -367,7 +374,7 @@
|
|
|
367
374
|
align-items: center;
|
|
368
375
|
justify-content: center;
|
|
369
376
|
border: none !important;
|
|
370
|
-
background: transparent !important
|
|
377
|
+
background: transparent !important;
|
|
371
378
|
color: var(--mapa-base-green);
|
|
372
379
|
cursor: pointer;
|
|
373
380
|
padding: var(--mapa-size-base-2);
|
package/src/types/index.ts
CHANGED
|
@@ -47,6 +47,7 @@ export type LayerActionDefaultItem = {
|
|
|
47
47
|
key?: string
|
|
48
48
|
name: string
|
|
49
49
|
icon?: FaIconName
|
|
50
|
+
tooltip?: string
|
|
50
51
|
style?: LayerActionStyle
|
|
51
52
|
disabled?: boolean
|
|
52
53
|
visible?: boolean
|
|
@@ -67,6 +68,7 @@ export type LayerActionConfig = {
|
|
|
67
68
|
type?: 'edit' | 'import' | 'delete' | 'visibility' | 'custom' | 'cancel' | 'conclude'
|
|
68
69
|
disabled?: boolean
|
|
69
70
|
visible?: boolean
|
|
71
|
+
tooltip?: string
|
|
70
72
|
style?: LayerActionStyle
|
|
71
73
|
}
|
|
72
74
|
|
|
@@ -110,6 +110,7 @@ export const resolveLayerActions = (
|
|
|
110
110
|
name: defaults.edit.name,
|
|
111
111
|
icon: defaults.edit.icon ?? 'pencil',
|
|
112
112
|
type: 'edit',
|
|
113
|
+
tooltip: defaults.edit.tooltip,
|
|
113
114
|
style: defaults.edit.style,
|
|
114
115
|
disabled: defaults.edit.disabled
|
|
115
116
|
})
|
|
@@ -121,6 +122,7 @@ export const resolveLayerActions = (
|
|
|
121
122
|
name: defaults.import.name,
|
|
122
123
|
icon: defaults.import.icon ?? 'upload',
|
|
123
124
|
type: 'import',
|
|
125
|
+
tooltip: defaults.import.tooltip,
|
|
124
126
|
style: defaults.import.style,
|
|
125
127
|
disabled: defaults.import.disabled
|
|
126
128
|
})
|
|
@@ -132,6 +134,7 @@ export const resolveLayerActions = (
|
|
|
132
134
|
name: defaults.delete.name,
|
|
133
135
|
icon: defaults.delete.icon ?? 'trash',
|
|
134
136
|
type: 'delete',
|
|
137
|
+
tooltip: defaults.delete.tooltip,
|
|
135
138
|
style: defaults.delete.style,
|
|
136
139
|
disabled: defaults.delete.disabled
|
|
137
140
|
})
|