datastake-daf 0.6.782 → 0.6.784

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.
Files changed (58) hide show
  1. package/dist/components/index.js +400 -328
  2. package/dist/hooks/index.js +3 -1
  3. package/dist/pages/index.js +3035 -685
  4. package/dist/utils/index.js +22 -0
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/Charts/BarChart/index.jsx +1 -1
  7. package/src/@daf/core/components/Dashboard/Map/ChainIcon/Markers/StakeholderMarker.js +9 -76
  8. package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +116 -8
  9. package/src/@daf/core/components/Dashboard/Map/ChainIcon/utils.js +73 -17
  10. package/src/@daf/core/components/Dashboard/Map/helper.js +1 -0
  11. package/src/@daf/core/components/Dashboard/Map/hook.js +64 -29
  12. package/src/@daf/core/components/Dashboard/Map/style.js +20 -5
  13. package/src/@daf/core/components/Screens/BaseScreen/index.jsx +1 -0
  14. package/src/@daf/core/components/Select/MultiSelect/index.jsx +4 -2
  15. package/src/@daf/core/components/Select/MultiSelect/style.js +15 -0
  16. package/src/@daf/hooks/useGetQueryParams.js +3 -1
  17. package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/hook.js +6 -7
  18. package/src/@daf/pages/Dashboards/UserDashboard/components/ContributionsGraph/index.jsx +1 -1
  19. package/src/@daf/pages/Documents/config.js +5 -5
  20. package/src/@daf/pages/Events/Activities/columns.js +5 -0
  21. package/src/@daf/pages/Events/Activities/config.js +21 -17
  22. package/src/@daf/pages/Events/Incidents/columns.js +5 -0
  23. package/src/@daf/pages/Events/Incidents/config.js +14 -11
  24. package/src/@daf/pages/Events/columns.js +6 -0
  25. package/src/@daf/pages/Events/config.js +0 -16
  26. package/src/@daf/pages/Locations/MineSite/columns.js +5 -1
  27. package/src/@daf/pages/Locations/MineSite/config.js +21 -24
  28. package/src/@daf/pages/Partners/columns.js +3 -1
  29. package/src/@daf/pages/Partners/config.js +13 -9
  30. package/src/@daf/pages/Partners/create.jsx +5 -2
  31. package/src/@daf/pages/Partners/edit.jsx +4 -2
  32. package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -0
  33. package/src/@daf/pages/Stakeholders/Operators/config.js +8 -8
  34. package/src/@daf/pages/Stakeholders/Workers/columns.js +19 -13
  35. package/src/@daf/pages/Stakeholders/Workers/config.js +8 -23
  36. package/src/@daf/pages/Summary/Minesite/index.jsx +6 -4
  37. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +2 -0
  38. package/src/@daf/pages/Summary/Operator/index.jsx +6 -3
  39. package/src/@daf/pages/TablePage/index.jsx +8 -2
  40. package/src/@daf/pages/Template/components/LinkingTemplate/columns.js +95 -0
  41. package/src/@daf/pages/Template/components/LinkingTemplate/config.js +88 -0
  42. package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +121 -0
  43. package/src/@daf/pages/Template/index.jsx +10 -0
  44. package/src/@daf/pages/View/hooks/useCallToGetData.js +73 -0
  45. package/src/@daf/pages/View/hooks/usePrepareForm.js +86 -0
  46. package/src/@daf/pages/View/hooks/useSubmitSubject.js +40 -0
  47. package/src/@daf/pages/View/hooks/useViewActions.js +83 -0
  48. package/src/@daf/pages/View/hooks/useViewPermissions.js +74 -0
  49. package/src/@daf/pages/View/hooks/useViewUrlParams.js +93 -0
  50. package/src/@daf/pages/View/index.jsx +326 -0
  51. package/src/@daf/utils/object.js +3 -1
  52. package/src/constants/locales/en/translation.js +3 -0
  53. package/src/constants/locales/fr/translation.js +3 -0
  54. package/src/constants/locales/sp/translation.js +3 -0
  55. package/src/pages.js +4 -1
  56. package/src/utils.js +1 -1
  57. package/dist/style/datastake/mapbox-gl.css +0 -330
  58. package/src/@daf/hooks/useViewFormUrlParams.js +0 -84
@@ -0,0 +1,326 @@
1
+ import React, { useMemo, useState, useEffect } from 'react'
2
+ import { useViewUrlParams } from './hooks/useViewUrlParams.js'
3
+ import { usePrepareForm } from './hooks/usePrepareForm.js'
4
+ import { useViewPermissions } from './hooks/useViewPermissions.js'
5
+ import { useSubmitSubject } from './hooks/useSubmitSubject.js'
6
+ import { useCallToGetData } from './hooks/useCallToGetData.js'
7
+ import { useViewActions } from './hooks/useViewActions.js'
8
+
9
+ import { groupSubsections } from '../../../@daf/core/components/ViewForm/helper.js'
10
+ import Loading from '../../../@daf/core/components/Loading/index.jsx'
11
+ import Header from '../../../@daf/core/components/Header/index.jsx'
12
+ import Multiselect from '../../../@daf/core/components/Select/MultiSelect/index.jsx'
13
+ import ViewFormNavigation from '../../../@daf/core/components/ViewForm/navigation.jsx'
14
+ import ViewForm from '../../../@daf/core/components/ViewForm/content.jsx'
15
+ import Records from '../../../@daf/core/components/ViewForm/components/Records/index.jsx'
16
+ import { Template } from '../Template/index.jsx'
17
+
18
+ const View = ({
19
+ push,
20
+ getRedirectLink,
21
+ allData,
22
+ ajaxForms,
23
+ changeAjaxForms,
24
+ t,
25
+ namespaceConfiguration,
26
+ params,
27
+ pathname,
28
+ search,
29
+ searchParams,
30
+ setSearchParams,
31
+ mode="app",
32
+ APP,
33
+ viewConfig,
34
+ partners,
35
+ setSelectedPartners,
36
+ user,
37
+ serviceMap,
38
+ actionMap,
39
+ goBack,
40
+ breadcrumbs,
41
+ theme,
42
+ buttonActions,
43
+ generatePath,
44
+ getApiBaseUrl,
45
+ getAppHeader,
46
+ location,
47
+ isMobile,
48
+ linkingTemplateContextData,
49
+ addData,
50
+ options,
51
+ getSubjectsDetails,
52
+ // ADD CALLBACK TO GET THE CURRENT NAMESPACE CONFIG
53
+ }) => {
54
+ const getNamespaceConfig = (namespace) => namespaceConfiguration?.[namespace] || {};
55
+ const [openRecordsModal, setOpenRecordsModal] = useState(false);
56
+
57
+ // HANDLES THE URL PARAMS FOR THE VIEW PAGE
58
+ const {
59
+ namespace,
60
+ id,
61
+ group,
62
+ subsection,
63
+ source,
64
+ setSource,
65
+ sourceUrl,
66
+ version,
67
+ setVersion,
68
+ versionUrl,
69
+ goBackFromSource,
70
+ getEditLink,
71
+ match,
72
+ } = useViewUrlParams({
73
+ params,
74
+ push,
75
+ pathname,
76
+ search,
77
+ searchParams,
78
+ setSearchParams,
79
+ });
80
+
81
+ const namespaceConfig = useMemo(() => getNamespaceConfig(namespace), [namespace]);
82
+
83
+ // PREPARES THE FORM FOR THE VIEW PAGE
84
+ const {
85
+ form,
86
+ data,
87
+ groups,
88
+ linkingForms,
89
+ loading,
90
+ setLoading,
91
+ notFound,
92
+ } = usePrepareForm({
93
+ namespaceConfig,
94
+ allData,
95
+ id,
96
+ namespace,
97
+ t,
98
+ mode,
99
+ APP,
100
+ viewConfig,
101
+ });
102
+
103
+ const { canEdit, isSupported } = useViewPermissions({
104
+ data,
105
+ id,
106
+ namespace,
107
+ user,
108
+ push,
109
+ getRedirectLink,
110
+ namespaceConfig: namespaceConfiguration,
111
+ APP,
112
+ viewConfig,
113
+ });
114
+
115
+ const groupForm = useMemo(() => {
116
+ const gF = form[group] || {};
117
+ if (subsection) {
118
+ const sectionForms = groupSubsections(gF);
119
+ if (sectionForms[subsection]) {
120
+ return sectionForms[subsection];
121
+ }
122
+ }
123
+ return gF;
124
+ }, [form, group, subsection]);
125
+
126
+ const { submitSubject, isDisabled, submitLoading, isPublished } = useSubmitSubject({
127
+ namespace,
128
+ data,
129
+ serviceMap,
130
+ });
131
+
132
+ const { pageActions, extraPageActions } = useViewActions({
133
+ namespace,
134
+ data,
135
+ isSupported,
136
+ canEdit,
137
+ versionUrl,
138
+ sourceUrl,
139
+ getEditLink,
140
+ submitSubject,
141
+ isDisabled,
142
+ setOpenRecordsModal,
143
+ goBackFromSource,
144
+ push,
145
+ getRedirectLink,
146
+ t,
147
+ viewConfig,
148
+ buttonActions,
149
+ });
150
+
151
+ useEffect(() => {
152
+ if(namespace && id && namespaceConfig && typeof getSubjectsDetails === 'function') {
153
+ getSubjectsDetails({
154
+ namespace,
155
+ id,
156
+ namespaceConfig,
157
+ })
158
+ }
159
+ }, [namespace, id, namespaceConfig])
160
+
161
+ const action = useMemo(() => actionMap?.[namespaceConfig?.action], [namespaceConfig?.action, actionMap]);
162
+
163
+ const namespaceGet = {
164
+ [namespace]: () => {
165
+ return action?.({
166
+ namespace: namespaceConfig?.namespace,
167
+ module: APP,
168
+ view: namespaceConfig?.view,
169
+ ...(namespaceConfig?.scope && { scope: namespaceConfig.scope }),
170
+ datastakeId: id,
171
+ version,
172
+ source,
173
+ })
174
+ }
175
+ }
176
+
177
+ useCallToGetData({
178
+ namespaceConfig,
179
+ namespace,
180
+ allData,
181
+ id,
182
+ isSupported,
183
+ namespaceGet,
184
+ source,
185
+ version,
186
+ user,
187
+ setLoading,
188
+ APP
189
+ })
190
+
191
+ const extraLinking = useMemo(() => {
192
+ return null;
193
+ }, [namespace, match, data]);
194
+
195
+ const sourceOptions = useMemo(() => {
196
+ return partners.map((partner) => {
197
+ const isOwnData = partner.id === user?.company?.id;
198
+
199
+ return {
200
+ label: partner.nickName,
201
+ value: partner.id,
202
+ avatar: isOwnData ? <span>OWN</span> : undefined,
203
+ background: isOwnData ? theme.colorPrimary7 : undefined,
204
+ color: isOwnData ? "white" : undefined,
205
+ };
206
+ });
207
+ }, [partners, user]);
208
+
209
+ const actionButtons = useMemo(() => {
210
+ return groupForm?.template === "linkingSubjects"
211
+ ? pageActions.filter((v) => v.key !== "edit")
212
+ : pageActions;
213
+ }, [groupForm, pageActions]);
214
+
215
+ if(!isSupported || notFound) {
216
+ return <Loading />
217
+ }
218
+
219
+ return (
220
+ <>
221
+ <div className={"daf-view-form"}>
222
+ <Header
223
+ title={data?.name || ""}
224
+ breadcrumbs={breadcrumbs}
225
+ goBackTo={goBack}
226
+ actionButtons={actionButtons}
227
+ extraButtons={extraPageActions}
228
+ addedHeaderFirst
229
+ addedHeader={
230
+ <div className="flex flex-row gap-4">
231
+ <Multiselect
232
+ options={[...sourceOptions]}
233
+ isAvatarGroup
234
+ selectionType="checkbox"
235
+ key={partners?.length}
236
+ canUnselectLast={false}
237
+ isSingle
238
+ onChange={(selected) => {
239
+ setSelectedPartners((prev) => ({
240
+ ...prev,
241
+ partners: selected,
242
+ loading: false,
243
+ }));
244
+ }}
245
+ dropDownWidth={200}
246
+ defaultSelected={(partners || []).map((p) => p.id) || []}
247
+ />
248
+ </div>
249
+ }
250
+ />
251
+ <div className="view-content">
252
+ <ViewFormNavigation
253
+ mod={APP}
254
+ data={data}
255
+ match={match}
256
+ form={form}
257
+ group={group}
258
+ subsection={subsection}
259
+ search={search}
260
+ goTo={push}
261
+ getRedirectLink={getRedirectLink}
262
+ generatePath={generatePath}
263
+ params={params}
264
+ />
265
+ {groupForm.template ? (<Template
266
+ namespace={namespace}
267
+ conf={{
268
+ mod: APP,
269
+ group: group,
270
+ form: groupForm,
271
+ data: data[group] ? data[group] : data || {},
272
+ allData: data,
273
+ linkingForms: linkingForms || {},
274
+ linkingData: data.linking || {},
275
+ match,
276
+ canEdit: isSupported && canEdit,
277
+ mode,
278
+ user: user,
279
+ t: t,
280
+ location: location,
281
+ isMobile: isMobile,
282
+ linkingTemplateContextData: linkingTemplateContextData,
283
+ addData: addData,
284
+ options: options,
285
+ }}
286
+ />) : (
287
+ <ViewForm
288
+ form={groupForm}
289
+ data={data || {}}
290
+ groupConfig={groups || {}}
291
+ linkingData={(data || {}).linking || {}}
292
+ linkingForms={linkingForms || {}}
293
+ ajaxOptions={[]}
294
+ extraLinking={extraLinking}
295
+ t={t}
296
+ app={APP}
297
+ ajaxForms={ajaxForms}
298
+ language={user?.language}
299
+ changeAjaxForms={changeAjaxForms}
300
+ getApiBaseUrl={getApiBaseUrl}
301
+ getAppHeader={getAppHeader}
302
+ user={user}
303
+ />
304
+ )}
305
+ </div>
306
+ </div>
307
+ {openRecordsModal && (
308
+ <Records
309
+ open={openRecordsModal}
310
+ onClose={() => setOpenRecordsModal(false)}
311
+ t={t}
312
+ sourceOptions={[]}
313
+ versionOptions={[]}
314
+ id={params?.id}
315
+ subject={namespace}
316
+ onSubmit={(values) => {
317
+ setSource(values?.source);
318
+ setVersion(values?.version);
319
+ }}
320
+ />
321
+ )}
322
+ </>
323
+ )
324
+ }
325
+
326
+ export default View
@@ -61,4 +61,6 @@ export const removeKeysFromObject = (obj = {}, keys = []) => {
61
61
  }
62
62
  }
63
63
  return result;
64
- }
64
+ }
65
+
66
+ export const hasKeyInObject = (obj, key) => Object.keys(obj || {}).includes(key);
@@ -1,4 +1,7 @@
1
1
  const en = {
2
+ "Site": "Site",
3
+ "Production Sites": "Production Sites",
4
+ "Type of account": "Type of account",
2
5
  "accounts": "Accounts",
3
6
  "users": "Users",
4
7
  "subjects": "Subjects",
@@ -1,4 +1,7 @@
1
1
  const fr = {
2
+ "Site": "Site",
3
+ "Production Sites": "Sites de production",
4
+ "Type of account": "Type de compte",
2
5
  "accounts": "Comptes",
3
6
  "users": "Utilisateurs",
4
7
  "subjects": "Sujets",
@@ -1,4 +1,7 @@
1
1
  const sp = {
2
+ "Site": "Sitio",
3
+ "Production Sites": "Centros de producción",
4
+ "Type of account": "Tipo de cuenta",
2
5
  "Identified Customers": "Clientes identificados",
3
6
  "Identified Suppliers": "Proveedores identificados",
4
7
  "Associated Mine Sites": "Sitios mineros asociados",
package/src/pages.js CHANGED
@@ -19,4 +19,7 @@ export { default as TablePage } from './@daf/pages/TablePage/index.jsx';
19
19
  export { default as OperatorSummary } from './@daf/pages/Summary/Operator/index.jsx';
20
20
  export { default as RestorationActivitySummary } from './@daf/pages/Summary/Activities/Restoration/index.jsx';
21
21
  export { default as PlantingCycleSummary } from './@daf/pages/Summary/Activities/PlantingCycle/index.jsx';
22
- export { default as MineSummary } from './@daf/pages/Summary/Minesite/index.jsx';
22
+ export { default as MineSummary } from './@daf/pages/Summary/Minesite/index.jsx';
23
+
24
+ // View
25
+ export { default as View } from './@daf/pages/View/index.jsx';
package/src/utils.js CHANGED
@@ -27,7 +27,7 @@ export { default as locales } from './constants/locales/index.js';
27
27
 
28
28
  export { getTagColor } from "./@daf/utils/productTag.js";
29
29
 
30
- export { convertUndefinedToNull } from './@daf/utils/object'
30
+ export { convertUndefinedToNull, hasKeyInObject, removeKeysFromObject } from './@daf/utils/object'
31
31
 
32
32
  export { default as ErrorFormat, formatErrors } from './helpers/ErrorFormater'
33
33
 
@@ -1,330 +0,0 @@
1
- /* Isolated Mapbox GL CSS - Scoped to prevent Leaflet conflicts */
2
-
3
- /* Mapbox GL Core Styles - Scoped with .mapbox-gl-scope */
4
- .mapbox-gl-scope .mapboxgl-map {
5
- font: 12px/20px Helvetica Neue, Arial, Helvetica, sans-serif;
6
- overflow: hidden;
7
- position: relative;
8
- -webkit-tap-highlight-color: rgb(0 0 0/0);
9
- }
10
-
11
- .mapbox-gl-scope .mapboxgl-canvas {
12
- left: 0;
13
- position: absolute;
14
- top: 0;
15
- }
16
-
17
- .mapbox-gl-scope .mapboxgl-map:-webkit-full-screen {
18
- height: 100%;
19
- width: 100%;
20
- }
21
-
22
- .mapbox-gl-scope .mapboxgl-canary {
23
- background-color: salmon;
24
- }
25
-
26
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive,
27
- .mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
28
- cursor: grab;
29
- -webkit-user-select: none;
30
- user-select: none;
31
- }
32
-
33
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer {
34
- cursor: pointer;
35
- }
36
-
37
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive:active,
38
- .mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {
39
- cursor: grabbing;
40
- }
41
-
42
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,
43
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {
44
- touch-action: pan-x pan-y;
45
- }
46
-
47
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan,
48
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {
49
- touch-action: pinch-zoom;
50
- }
51
-
52
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
53
- .mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
54
- touch-action: none;
55
- }
56
-
57
- /* Control positioning */
58
- .mapbox-gl-scope .mapboxgl-ctrl-bottom,
59
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left,
60
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right,
61
- .mapbox-gl-scope .mapboxgl-ctrl-left,
62
- .mapbox-gl-scope .mapboxgl-ctrl-right,
63
- .mapbox-gl-scope .mapboxgl-ctrl-top,
64
- .mapbox-gl-scope .mapboxgl-ctrl-top-left,
65
- .mapbox-gl-scope .mapboxgl-ctrl-top-right {
66
- pointer-events: none;
67
- position: absolute;
68
- z-index: 2;
69
- }
70
-
71
- .mapbox-gl-scope .mapboxgl-ctrl-top-left {
72
- left: 0;
73
- top: 0;
74
- }
75
-
76
- .mapbox-gl-scope .mapboxgl-ctrl-top {
77
- left: 50%;
78
- top: 0;
79
- transform: translateX(-50%);
80
- }
81
-
82
- .mapbox-gl-scope .mapboxgl-ctrl-top-right {
83
- right: 0;
84
- top: 0;
85
- }
86
-
87
- .mapbox-gl-scope .mapboxgl-ctrl-right {
88
- right: 0;
89
- top: 50%;
90
- transform: translateY(-50%);
91
- }
92
-
93
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right {
94
- bottom: 0;
95
- right: 0;
96
- }
97
-
98
- .mapbox-gl-scope .mapboxgl-ctrl-bottom {
99
- bottom: 0;
100
- left: 50%;
101
- transform: translateX(-50%);
102
- }
103
-
104
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left {
105
- bottom: 0;
106
- left: 0;
107
- }
108
-
109
- .mapbox-gl-scope .mapboxgl-ctrl-left {
110
- left: 0;
111
- top: 50%;
112
- transform: translateY(-50%);
113
- }
114
-
115
- .mapbox-gl-scope .mapboxgl-ctrl {
116
- clear: both;
117
- pointer-events: auto;
118
- transform: translate(0);
119
- }
120
-
121
- .mapbox-gl-scope .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
122
- float: left;
123
- margin: 10px 0 0 10px;
124
- }
125
-
126
- .mapbox-gl-scope .mapboxgl-ctrl-top .mapboxgl-ctrl {
127
- float: left;
128
- margin: 10px 0;
129
- }
130
-
131
- .mapbox-gl-scope .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
132
- float: right;
133
- margin: 10px 10px 0 0;
134
- }
135
-
136
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,
137
- .mapbox-gl-scope .mapboxgl-ctrl-right .mapboxgl-ctrl {
138
- float: right;
139
- margin: 0 10px 10px 0;
140
- }
141
-
142
- .mapbox-gl-scope .mapboxgl-ctrl-bottom .mapboxgl-ctrl {
143
- float: left;
144
- margin: 10px 0;
145
- }
146
-
147
- .mapbox-gl-scope .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,
148
- .mapbox-gl-scope .mapboxgl-ctrl-left .mapboxgl-ctrl {
149
- float: left;
150
- margin: 0 0 10px 10px;
151
- }
152
-
153
- /* Control group styling */
154
- .mapbox-gl-scope .mapboxgl-ctrl-group {
155
- background: #fff;
156
- border-radius: 4px;
157
- }
158
-
159
- .mapbox-gl-scope .mapboxgl-ctrl-group:not(:empty) {
160
- box-shadow: 0 0 0 2px #0000001a;
161
- }
162
-
163
- .mapbox-gl-scope .mapboxgl-ctrl-group button {
164
- background-color: initial;
165
- border: 0;
166
- box-sizing: border-box;
167
- cursor: pointer;
168
- display: block;
169
- height: 29px;
170
- outline: none;
171
- overflow: hidden;
172
- padding: 0;
173
- width: 29px;
174
- }
175
-
176
- .mapbox-gl-scope .mapboxgl-ctrl-group button+button {
177
- border-top: 1px solid #ddd;
178
- }
179
-
180
- .mapbox-gl-scope .mapboxgl-ctrl button .mapboxgl-ctrl-icon {
181
- background-position: 50%;
182
- background-repeat: no-repeat;
183
- display: block;
184
- height: 100%;
185
- width: 100%;
186
- }
187
-
188
- .mapbox-gl-scope .mapboxgl-ctrl-attrib-button:focus,
189
- .mapbox-gl-scope .mapboxgl-ctrl-group button:focus {
190
- box-shadow: 0 0 2px 2px #0096ff;
191
- }
192
-
193
- .mapbox-gl-scope .mapboxgl-ctrl button:disabled {
194
- cursor: not-allowed;
195
- }
196
-
197
- .mapbox-gl-scope .mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon {
198
- opacity: .25;
199
- }
200
-
201
- .mapbox-gl-scope .mapboxgl-ctrl-group button:first-child {
202
- border-radius: 4px 4px 0 0;
203
- }
204
-
205
- .mapbox-gl-scope .mapboxgl-ctrl-group button:last-child {
206
- border-radius: 0 0 4px 4px;
207
- }
208
-
209
- .mapbox-gl-scope .mapboxgl-ctrl-group button:only-child {
210
- border-radius: inherit;
211
- }
212
-
213
- .mapbox-gl-scope .mapboxgl-ctrl button:not(:disabled):hover {
214
- background-color: #0000000d;
215
- }
216
-
217
- /* Marker styles */
218
- .mapbox-gl-scope .mapboxgl-marker {
219
- position: absolute;
220
- z-index: 1;
221
- }
222
-
223
- .mapbox-gl-scope .mapboxgl-marker svg {
224
- display: block;
225
- }
226
-
227
- /* Popup styles */
228
- .mapbox-gl-scope .mapboxgl-popup {
229
- position: absolute;
230
- text-align: center;
231
- margin-bottom: 20px;
232
- }
233
-
234
- .mapbox-gl-scope .mapboxgl-popup-content-wrapper {
235
- padding: 1px;
236
- text-align: left;
237
- border-radius: 12px;
238
- }
239
-
240
- .mapbox-gl-scope .mapboxgl-popup-content {
241
- margin: 13px 24px 13px 20px;
242
- line-height: 1.3;
243
- font-size: 13px;
244
- min-height: 1px;
245
- }
246
-
247
- .mapbox-gl-scope .mapboxgl-popup-content p {
248
- margin: 17px 0;
249
- }
250
-
251
- .mapbox-gl-scope .mapboxgl-popup-tip-container {
252
- width: 40px;
253
- height: 20px;
254
- position: absolute;
255
- left: 50%;
256
- margin-top: -1px;
257
- margin-left: -20px;
258
- overflow: hidden;
259
- pointer-events: none;
260
- }
261
-
262
- .mapbox-gl-scope .mapboxgl-popup-tip {
263
- width: 17px;
264
- height: 17px;
265
- padding: 1px;
266
- margin: -10px auto 0;
267
- pointer-events: auto;
268
- -webkit-transform: rotate(45deg);
269
- -moz-transform: rotate(45deg);
270
- -ms-transform: rotate(45deg);
271
- transform: rotate(45deg);
272
- }
273
-
274
- .mapbox-gl-scope .mapboxgl-popup-content-wrapper,
275
- .mapbox-gl-scope .mapboxgl-popup-tip {
276
- background: white;
277
- color: #333;
278
- box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
279
- }
280
-
281
- .mapbox-gl-scope .mapboxgl-popup-close-button {
282
- position: absolute;
283
- top: 0;
284
- right: 0;
285
- border: none;
286
- text-align: center;
287
- width: 24px;
288
- height: 24px;
289
- font: 16px/24px Tahoma, Verdana, sans-serif;
290
- color: #757575;
291
- text-decoration: none;
292
- background: transparent;
293
- }
294
-
295
- .mapbox-gl-scope .mapboxgl-popup-close-button:hover,
296
- .mapbox-gl-scope .mapboxgl-popup-close-button:focus {
297
- color: #585858;
298
- }
299
-
300
- /* Attribution */
301
- .mapbox-gl-scope .mapboxgl-ctrl-attribution {
302
- background: #fff;
303
- background: rgba(255, 255, 255, 0.8);
304
- margin: 0;
305
- }
306
-
307
- .mapbox-gl-scope .mapboxgl-ctrl-attribution,
308
- .mapbox-gl-scope .mapboxgl-ctrl-scale-line {
309
- padding: 0 5px;
310
- color: #333;
311
- line-height: 1.4;
312
- }
313
-
314
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a {
315
- text-decoration: none;
316
- }
317
-
318
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a:hover,
319
- .mapbox-gl-scope .mapboxgl-ctrl-attribution a:focus {
320
- text-decoration: underline;
321
- }
322
-
323
- /* Hide attribution by default */
324
- .mapbox-gl-scope .mapboxgl-ctrl-attribution {
325
- display: none !important;
326
- }
327
-
328
- .mapbox-gl-scope .mapboxgl-ctrl-logo {
329
- display: none !important;
330
- }