@salla.sa/twilight-components 2.9.41 → 2.9.42
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/cjs/index-1d2b3370.js +2 -2
- package/dist/cjs/{index-8abe1667.js → index-53c1e9f1.js} +2232 -39
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{salla-button_33.cjs.entry.js → salla-button_34.cjs.entry.js} +614 -0
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/assets/svg/location-marker.svg +4 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-map/map-styles.js +345 -0
- package/dist/collection/components/salla-map/salla-map.css +59 -0
- package/dist/collection/components/salla-map/salla-map.js +393 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2233 -39
- package/dist/components/salla-map.d.ts +11 -0
- package/dist/components/salla-map.js +670 -0
- package/dist/esm/{index-fa058d0e.js → index-dc279949.js} +2232 -39
- package/dist/esm/index-f1d446ac.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{salla-button_33.entry.js → salla-button_34.entry.js} +614 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/esm-es5/index-dc279949.js +30 -0
- package/dist/esm-es5/index-f1d446ac.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{salla-button_33.entry.js → salla-button_34.entry.js} +4 -4
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/p-19ce7aa8.js +24 -0
- package/dist/twilight/{p-6f94dcce.entry.js → p-382b121a.entry.js} +4 -4
- package/dist/twilight/p-4733b689.system.js +4 -0
- package/dist/twilight/p-6b59d89a.system.js +30 -0
- package/dist/twilight/{p-79eae6ae.system.entry.js → p-b45e1ab3.system.entry.js} +5 -5
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-map/map-styles.d.ts +6 -0
- package/dist/types/components/salla-map/salla-map.d.ts +57 -0
- package/dist/types/components.d.ts +75 -0
- package/package.json +4 -3
- package/dist/esm-es5/index-fa058d0e.js +0 -24
- package/dist/twilight/p-175df7e0.system.js +0 -24
- package/dist/twilight/p-9e980a1a.js +0 -24
- package/dist/twilight/p-cb28d2ec.system.js +0 -4
|
@@ -20006,6 +20006,619 @@ const SallaLoyalty = class {
|
|
|
20006
20006
|
};
|
|
20007
20007
|
SallaLoyalty.style = sallaLoyaltyCss;
|
|
20008
20008
|
|
|
20009
|
+
const Location = `<!-- Generated by IcoMoon.io -->
|
|
20010
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20011
|
+
<title>location</title>
|
|
20012
|
+
<path d="M16.001 0c-7.879 0-12.001 6.204-12.001 12.333 0 5.813 9.853 17.833 10.976 19.185 0.253 0.305 0.629 0.481 1.025 0.481s0.772-0.176 1.027-0.481c1.121-1.352 10.972-13.372 10.972-19.185 0-6.129-4.121-12.333-11.999-12.333zM16.001 28.549c-3.32-4.184-9.335-12.527-9.335-16.216 0-4.656 2.92-9.667 9.335-9.667 6.412 0 9.332 5.011 9.332 9.667 0 3.689-6.013 12.032-9.332 16.216zM16 6.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16 14.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>
|
|
20013
|
+
</svg>
|
|
20014
|
+
`;
|
|
20015
|
+
|
|
20016
|
+
const Edit = `<!-- Generated by IcoMoon.io -->
|
|
20017
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20018
|
+
<title>edit</title>
|
|
20019
|
+
<path d="M30.583 1.417c-1.828-1.829-5.019-1.829-6.847 0l-13.396 13.396c-0.161 0.161-0.279 0.361-0.341 0.581l-1.949 6.911c-0.131 0.464 0 0.964 0.341 1.305 0.253 0.252 0.593 0.389 0.943 0.389 0.121 0 0.243-0.016 0.361-0.051l6.911-1.949c0.22-0.061 0.419-0.179 0.581-0.34l10.455-10.453s0 0 0 0l2.941-2.941c1.887-1.888 1.887-4.96 0-6.848zM15.547 19.528l-4.284 1.208 1.208-4.284 9.265-9.265 3.076 3.076zM28.696 6.38l-1.999 1.999-3.076-3.076 1.999-1.999c0.849-0.848 2.227-0.848 3.076 0 0.848 0.848 0.848 2.227 0 3.076zM24 20c-0.737 0-1.333 0.597-1.333 1.333v4c0 2.205-1.795 4-4 4h-12c-2.205 0-4-1.795-4-4v-12c0-2.205 1.795-4 4-4h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-4c-3.676 0-6.667 2.991-6.667 6.667v12c0 3.676 2.991 6.667 6.667 6.667h12c3.676 0 6.667-2.991 6.667-6.667v-4c0-0.736-0.596-1.333-1.333-1.333z"></path>
|
|
20020
|
+
</svg>
|
|
20021
|
+
`;
|
|
20022
|
+
|
|
20023
|
+
const CurrentLocation = `<!-- Generated by IcoMoon.io -->
|
|
20024
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20025
|
+
<title>location-target</title>
|
|
20026
|
+
<path d="M16 9.333c-3.676 0-6.667 2.991-6.667 6.667s2.991 6.667 6.667 6.667 6.667-2.991 6.667-6.667-2.991-6.667-6.667-6.667zM16 20c-2.205 0-4-1.795-4-4s1.795-4 4-4 4 1.795 4 4-1.795 4-4 4zM30.667 14.667h-1.401c-0.627-6.289-5.643-11.305-11.932-11.932v-1.401c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.401c-6.289 0.627-11.305 5.643-11.932 11.932h-1.401c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h1.401c0.628 6.289 5.643 11.305 11.932 11.932v1.401c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-1.401c6.289-0.628 11.305-5.643 11.932-11.932h1.401c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM16 26.667c-5.881 0-10.667-4.785-10.667-10.667s4.785-10.667 10.667-10.667 10.667 4.785 10.667 10.667-4.785 10.667-10.667 10.667z"></path>
|
|
20027
|
+
</svg>
|
|
20028
|
+
`;
|
|
20029
|
+
|
|
20030
|
+
const LocationMarker = `<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
20031
|
+
<rect width="36" height="36" rx="18" fill="#5CD5C4"/>
|
|
20032
|
+
<path d="M18 10C17.0104 10 16.1458 10.1771 15.4062 10.5312C14.6562 10.8854 14.026 11.3542 13.5156 11.9375C13.0156 12.5104 12.6406 13.1667 12.3906 13.9062C12.1302 14.6458 12 15.401 12 16.1719C12 16.8906 12.2604 17.7656 12.7812 18.7969C13.3021 19.8281 13.8854 20.8333 14.5312 21.8125C15.1875 22.7812 15.8073 23.6406 16.3906 24.3906C16.9844 25.1302 17.349 25.5885 17.4844 25.7656C17.5469 25.8385 17.625 25.8958 17.7188 25.9375C17.8125 25.9792 17.9062 26 18 26C18.1042 26 18.1979 25.9792 18.2812 25.9375C18.375 25.8958 18.4531 25.8385 18.5156 25.7656C18.651 25.5885 19.0156 25.1302 19.6094 24.3906C20.1927 23.6406 20.8073 22.7812 21.4531 21.8125C22.1094 20.8333 22.6979 19.8281 23.2188 18.7969C23.7396 17.7656 24 16.8906 24 16.1719C24 15.401 23.8698 14.6458 23.6094 13.9062C23.3594 13.1667 22.9792 12.5104 22.4688 11.9375C21.9688 11.3542 21.3438 10.8854 20.5938 10.5312C19.8542 10.1771 18.9896 10 18 10ZM18 24.2812C17.5833 23.75 17.1094 23.1198 16.5781 22.3906C16.0365 21.651 15.526 20.901 15.0469 20.1406C14.5677 19.3698 14.1615 18.6302 13.8281 17.9219C13.4948 17.2135 13.3281 16.6302 13.3281 16.1719C13.3281 15.5885 13.4219 15.0052 13.6094 14.4219C13.7969 13.849 14.0781 13.3333 14.4531 12.875C14.8385 12.4167 15.3281 12.0469 15.9219 11.7656C16.5052 11.474 17.1979 11.3281 18 11.3281C18.8021 11.3281 19.4948 11.474 20.0781 11.7656C20.6719 12.0469 21.1562 12.4167 21.5312 12.875C21.9167 13.3333 22.2031 13.849 22.3906 14.4219C22.5781 15.0052 22.6719 15.5885 22.6719 16.1719C22.6719 16.6302 22.5052 17.2135 22.1719 17.9219C21.8385 18.6302 21.4323 19.3698 20.9531 20.1406C20.474 20.901 19.9688 21.651 19.4375 22.3906C18.8958 23.1198 18.4167 23.75 18 24.2812ZM18 13.3281C17.2604 13.3281 16.6302 13.5885 16.1094 14.1094C15.5885 14.6302 15.3281 15.2604 15.3281 16C15.3281 16.7396 15.5885 17.3698 16.1094 17.8906C16.6302 18.4115 17.2604 18.6719 18 18.6719C18.7396 18.6719 19.3698 18.4115 19.8906 17.8906C20.4115 17.3698 20.6719 16.7396 20.6719 16C20.6719 15.2604 20.4115 14.6302 19.8906 14.1094C19.3698 13.5885 18.7396 13.3281 18 13.3281ZM18 17.3281C17.6354 17.3281 17.3229 17.1979 17.0625 16.9375C16.8021 16.6771 16.6719 16.3646 16.6719 16C16.6719 15.6354 16.8021 15.3229 17.0625 15.0625C17.3229 14.8021 17.6354 14.6719 18 14.6719C18.3646 14.6719 18.6771 14.8021 18.9375 15.0625C19.1979 15.3229 19.3281 15.6354 19.3281 16C19.3281 16.3646 19.1979 16.6771 18.9375 16.9375C18.6771 17.1979 18.3646 17.3281 18 17.3281Z" fill="white"/>
|
|
20033
|
+
</svg>
|
|
20034
|
+
`;
|
|
20035
|
+
|
|
20036
|
+
// export json
|
|
20037
|
+
const light = [
|
|
20038
|
+
{
|
|
20039
|
+
featureType: 'water',
|
|
20040
|
+
elementType: 'geometry',
|
|
20041
|
+
stylers: [
|
|
20042
|
+
{
|
|
20043
|
+
color: '#e9e9e9',
|
|
20044
|
+
},
|
|
20045
|
+
{
|
|
20046
|
+
lightness: 17,
|
|
20047
|
+
},
|
|
20048
|
+
],
|
|
20049
|
+
},
|
|
20050
|
+
{
|
|
20051
|
+
featureType: 'landscape',
|
|
20052
|
+
elementType: 'geometry',
|
|
20053
|
+
stylers: [
|
|
20054
|
+
{
|
|
20055
|
+
color: '#f5f5f5',
|
|
20056
|
+
},
|
|
20057
|
+
{
|
|
20058
|
+
lightness: 20,
|
|
20059
|
+
},
|
|
20060
|
+
],
|
|
20061
|
+
},
|
|
20062
|
+
{
|
|
20063
|
+
featureType: 'road.highway',
|
|
20064
|
+
elementType: 'geometry.fill',
|
|
20065
|
+
stylers: [
|
|
20066
|
+
{
|
|
20067
|
+
color: '#ffffff',
|
|
20068
|
+
},
|
|
20069
|
+
{
|
|
20070
|
+
lightness: 17,
|
|
20071
|
+
},
|
|
20072
|
+
],
|
|
20073
|
+
},
|
|
20074
|
+
{
|
|
20075
|
+
featureType: 'road.highway',
|
|
20076
|
+
elementType: 'geometry.stroke',
|
|
20077
|
+
stylers: [
|
|
20078
|
+
{
|
|
20079
|
+
color: '#ffffff',
|
|
20080
|
+
},
|
|
20081
|
+
{
|
|
20082
|
+
lightness: 29,
|
|
20083
|
+
},
|
|
20084
|
+
{
|
|
20085
|
+
weight: 0.2,
|
|
20086
|
+
},
|
|
20087
|
+
],
|
|
20088
|
+
},
|
|
20089
|
+
{
|
|
20090
|
+
featureType: 'road.arterial',
|
|
20091
|
+
elementType: 'geometry',
|
|
20092
|
+
stylers: [
|
|
20093
|
+
{
|
|
20094
|
+
color: '#ffffff',
|
|
20095
|
+
},
|
|
20096
|
+
{
|
|
20097
|
+
lightness: 18,
|
|
20098
|
+
},
|
|
20099
|
+
],
|
|
20100
|
+
},
|
|
20101
|
+
{
|
|
20102
|
+
featureType: 'road.local',
|
|
20103
|
+
elementType: 'geometry',
|
|
20104
|
+
stylers: [
|
|
20105
|
+
{
|
|
20106
|
+
color: '#ffffff',
|
|
20107
|
+
},
|
|
20108
|
+
{
|
|
20109
|
+
lightness: 16,
|
|
20110
|
+
},
|
|
20111
|
+
],
|
|
20112
|
+
},
|
|
20113
|
+
{
|
|
20114
|
+
featureType: 'poi',
|
|
20115
|
+
elementType: 'geometry',
|
|
20116
|
+
stylers: [
|
|
20117
|
+
{
|
|
20118
|
+
color: '#f5f5f5',
|
|
20119
|
+
},
|
|
20120
|
+
{
|
|
20121
|
+
lightness: 21,
|
|
20122
|
+
},
|
|
20123
|
+
],
|
|
20124
|
+
},
|
|
20125
|
+
{
|
|
20126
|
+
featureType: 'poi.park',
|
|
20127
|
+
elementType: 'geometry',
|
|
20128
|
+
stylers: [
|
|
20129
|
+
{
|
|
20130
|
+
color: '#dedede',
|
|
20131
|
+
},
|
|
20132
|
+
{
|
|
20133
|
+
lightness: 21,
|
|
20134
|
+
},
|
|
20135
|
+
],
|
|
20136
|
+
},
|
|
20137
|
+
{
|
|
20138
|
+
elementType: 'labels.text.stroke',
|
|
20139
|
+
stylers: [
|
|
20140
|
+
{
|
|
20141
|
+
visibility: 'on',
|
|
20142
|
+
},
|
|
20143
|
+
{
|
|
20144
|
+
color: '#ffffff',
|
|
20145
|
+
},
|
|
20146
|
+
{
|
|
20147
|
+
lightness: 16,
|
|
20148
|
+
},
|
|
20149
|
+
],
|
|
20150
|
+
},
|
|
20151
|
+
{
|
|
20152
|
+
elementType: 'labels.text.fill',
|
|
20153
|
+
stylers: [
|
|
20154
|
+
{
|
|
20155
|
+
saturation: 36,
|
|
20156
|
+
},
|
|
20157
|
+
{
|
|
20158
|
+
color: '#333333',
|
|
20159
|
+
},
|
|
20160
|
+
{
|
|
20161
|
+
lightness: 40,
|
|
20162
|
+
},
|
|
20163
|
+
],
|
|
20164
|
+
},
|
|
20165
|
+
{
|
|
20166
|
+
elementType: 'labels.icon',
|
|
20167
|
+
stylers: [
|
|
20168
|
+
{
|
|
20169
|
+
visibility: 'off',
|
|
20170
|
+
},
|
|
20171
|
+
],
|
|
20172
|
+
},
|
|
20173
|
+
{
|
|
20174
|
+
featureType: 'transit',
|
|
20175
|
+
elementType: 'geometry',
|
|
20176
|
+
stylers: [
|
|
20177
|
+
{
|
|
20178
|
+
color: '#f2f2f2',
|
|
20179
|
+
},
|
|
20180
|
+
{
|
|
20181
|
+
lightness: 19,
|
|
20182
|
+
},
|
|
20183
|
+
],
|
|
20184
|
+
},
|
|
20185
|
+
{
|
|
20186
|
+
featureType: 'administrative',
|
|
20187
|
+
elementType: 'geometry.fill',
|
|
20188
|
+
stylers: [
|
|
20189
|
+
{
|
|
20190
|
+
color: '#fefefe',
|
|
20191
|
+
},
|
|
20192
|
+
{
|
|
20193
|
+
lightness: 20,
|
|
20194
|
+
},
|
|
20195
|
+
],
|
|
20196
|
+
},
|
|
20197
|
+
{
|
|
20198
|
+
featureType: 'administrative',
|
|
20199
|
+
elementType: 'geometry.stroke',
|
|
20200
|
+
stylers: [
|
|
20201
|
+
{
|
|
20202
|
+
color: '#fefefe',
|
|
20203
|
+
},
|
|
20204
|
+
{
|
|
20205
|
+
lightness: 17,
|
|
20206
|
+
},
|
|
20207
|
+
{
|
|
20208
|
+
weight: 1.2,
|
|
20209
|
+
},
|
|
20210
|
+
],
|
|
20211
|
+
},
|
|
20212
|
+
];
|
|
20213
|
+
const dark = [
|
|
20214
|
+
{
|
|
20215
|
+
elementType: 'geometry',
|
|
20216
|
+
stylers: [
|
|
20217
|
+
{
|
|
20218
|
+
color: '#242f3e',
|
|
20219
|
+
},
|
|
20220
|
+
],
|
|
20221
|
+
},
|
|
20222
|
+
{
|
|
20223
|
+
elementType: 'labels.text.fill',
|
|
20224
|
+
stylers: [
|
|
20225
|
+
{
|
|
20226
|
+
color: '#746855',
|
|
20227
|
+
},
|
|
20228
|
+
],
|
|
20229
|
+
},
|
|
20230
|
+
{
|
|
20231
|
+
elementType: 'labels.text.stroke',
|
|
20232
|
+
stylers: [
|
|
20233
|
+
{
|
|
20234
|
+
color: '#242f3e',
|
|
20235
|
+
},
|
|
20236
|
+
],
|
|
20237
|
+
},
|
|
20238
|
+
{
|
|
20239
|
+
featureType: 'administrative.locality',
|
|
20240
|
+
elementType: 'labels.text.fill',
|
|
20241
|
+
stylers: [
|
|
20242
|
+
{
|
|
20243
|
+
color: '#d59563',
|
|
20244
|
+
},
|
|
20245
|
+
],
|
|
20246
|
+
},
|
|
20247
|
+
{
|
|
20248
|
+
featureType: 'poi',
|
|
20249
|
+
elementType: 'labels.text.fill',
|
|
20250
|
+
stylers: [
|
|
20251
|
+
{
|
|
20252
|
+
color: '#d59563',
|
|
20253
|
+
},
|
|
20254
|
+
],
|
|
20255
|
+
},
|
|
20256
|
+
{
|
|
20257
|
+
featureType: 'poi.park',
|
|
20258
|
+
elementType: 'geometry',
|
|
20259
|
+
stylers: [
|
|
20260
|
+
{
|
|
20261
|
+
color: '#263c3f',
|
|
20262
|
+
},
|
|
20263
|
+
],
|
|
20264
|
+
},
|
|
20265
|
+
{
|
|
20266
|
+
featureType: 'poi.park',
|
|
20267
|
+
elementType: 'labels.text.fill',
|
|
20268
|
+
stylers: [
|
|
20269
|
+
{
|
|
20270
|
+
color: '#6b9a76',
|
|
20271
|
+
},
|
|
20272
|
+
],
|
|
20273
|
+
},
|
|
20274
|
+
{
|
|
20275
|
+
featureType: 'road',
|
|
20276
|
+
elementType: 'geometry',
|
|
20277
|
+
stylers: [
|
|
20278
|
+
{
|
|
20279
|
+
color: '#38414e',
|
|
20280
|
+
},
|
|
20281
|
+
],
|
|
20282
|
+
},
|
|
20283
|
+
{
|
|
20284
|
+
featureType: 'road',
|
|
20285
|
+
elementType: 'geometry.stroke',
|
|
20286
|
+
stylers: [
|
|
20287
|
+
{
|
|
20288
|
+
color: '#212a37',
|
|
20289
|
+
},
|
|
20290
|
+
],
|
|
20291
|
+
},
|
|
20292
|
+
{
|
|
20293
|
+
featureType: 'road',
|
|
20294
|
+
elementType: 'labels.text.fill',
|
|
20295
|
+
stylers: [
|
|
20296
|
+
{
|
|
20297
|
+
color: '#9ca5b3',
|
|
20298
|
+
},
|
|
20299
|
+
],
|
|
20300
|
+
},
|
|
20301
|
+
{
|
|
20302
|
+
featureType: 'road.highway',
|
|
20303
|
+
elementType: 'geometry',
|
|
20304
|
+
stylers: [
|
|
20305
|
+
{
|
|
20306
|
+
color: '#746855',
|
|
20307
|
+
},
|
|
20308
|
+
],
|
|
20309
|
+
},
|
|
20310
|
+
{
|
|
20311
|
+
featureType: 'road.highway',
|
|
20312
|
+
elementType: 'geometry.stroke',
|
|
20313
|
+
stylers: [
|
|
20314
|
+
{
|
|
20315
|
+
color: '#1f2835',
|
|
20316
|
+
},
|
|
20317
|
+
],
|
|
20318
|
+
},
|
|
20319
|
+
{
|
|
20320
|
+
featureType: 'road.highway',
|
|
20321
|
+
elementType: 'labels.text.fill',
|
|
20322
|
+
stylers: [
|
|
20323
|
+
{
|
|
20324
|
+
color: '#f3d19c',
|
|
20325
|
+
},
|
|
20326
|
+
],
|
|
20327
|
+
},
|
|
20328
|
+
{
|
|
20329
|
+
featureType: 'transit',
|
|
20330
|
+
elementType: 'geometry',
|
|
20331
|
+
stylers: [
|
|
20332
|
+
{
|
|
20333
|
+
color: '#2f3948',
|
|
20334
|
+
},
|
|
20335
|
+
],
|
|
20336
|
+
},
|
|
20337
|
+
{
|
|
20338
|
+
featureType: 'transit.station',
|
|
20339
|
+
elementType: 'labels.text.fill',
|
|
20340
|
+
stylers: [
|
|
20341
|
+
{
|
|
20342
|
+
color: '#d59563',
|
|
20343
|
+
},
|
|
20344
|
+
],
|
|
20345
|
+
},
|
|
20346
|
+
{
|
|
20347
|
+
featureType: 'water',
|
|
20348
|
+
elementType: 'geometry',
|
|
20349
|
+
stylers: [
|
|
20350
|
+
{
|
|
20351
|
+
color: '#17263c',
|
|
20352
|
+
},
|
|
20353
|
+
],
|
|
20354
|
+
},
|
|
20355
|
+
{
|
|
20356
|
+
featureType: 'water',
|
|
20357
|
+
elementType: 'labels.text.fill',
|
|
20358
|
+
stylers: [
|
|
20359
|
+
{
|
|
20360
|
+
color: '#515c6d',
|
|
20361
|
+
},
|
|
20362
|
+
],
|
|
20363
|
+
},
|
|
20364
|
+
{
|
|
20365
|
+
featureType: 'water',
|
|
20366
|
+
elementType: 'labels.text.stroke',
|
|
20367
|
+
stylers: [
|
|
20368
|
+
{
|
|
20369
|
+
color: '#17263c',
|
|
20370
|
+
},
|
|
20371
|
+
],
|
|
20372
|
+
},
|
|
20373
|
+
];
|
|
20374
|
+
const styles = {
|
|
20375
|
+
light,
|
|
20376
|
+
dark,
|
|
20377
|
+
};
|
|
20378
|
+
|
|
20379
|
+
class Loader {
|
|
20380
|
+
constructor(apiKey = null, options = {}) {
|
|
20381
|
+
this.apiKey = apiKey;
|
|
20382
|
+
this.options = options;
|
|
20383
|
+
if (typeof window === 'undefined') {
|
|
20384
|
+
throw new Error('google-maps is supported only in browser environment');
|
|
20385
|
+
}
|
|
20386
|
+
}
|
|
20387
|
+
load() {
|
|
20388
|
+
if (typeof this.api !== 'undefined') {
|
|
20389
|
+
return Promise.resolve(this.api);
|
|
20390
|
+
}
|
|
20391
|
+
if (typeof this.loader !== 'undefined') {
|
|
20392
|
+
return this.loader;
|
|
20393
|
+
}
|
|
20394
|
+
window[Loader.CALLBACK_NAME] = () => {
|
|
20395
|
+
this.api = window['google'];
|
|
20396
|
+
if (typeof this.resolve === 'undefined') {
|
|
20397
|
+
throw new Error('Should not happen');
|
|
20398
|
+
}
|
|
20399
|
+
this.resolve(this.api);
|
|
20400
|
+
};
|
|
20401
|
+
window['gm_authFailure'] = () => {
|
|
20402
|
+
if (typeof this.reject === 'undefined') {
|
|
20403
|
+
throw new Error('Should not happen');
|
|
20404
|
+
}
|
|
20405
|
+
this.reject(new Error('google-maps: authentication error'));
|
|
20406
|
+
};
|
|
20407
|
+
return this.loader = new Promise((resolve, reject) => {
|
|
20408
|
+
this.resolve = resolve;
|
|
20409
|
+
this.reject = reject;
|
|
20410
|
+
const script = document.createElement('script');
|
|
20411
|
+
script.src = this.createUrl();
|
|
20412
|
+
script.async = true;
|
|
20413
|
+
script.onerror = (e) => reject(e);
|
|
20414
|
+
document.head.appendChild(script);
|
|
20415
|
+
});
|
|
20416
|
+
}
|
|
20417
|
+
createUrl() {
|
|
20418
|
+
const parameters = [
|
|
20419
|
+
`callback=${Loader.CALLBACK_NAME}`,
|
|
20420
|
+
];
|
|
20421
|
+
if (this.apiKey) {
|
|
20422
|
+
parameters.push(`key=${this.apiKey}`);
|
|
20423
|
+
}
|
|
20424
|
+
for (let name in this.options) {
|
|
20425
|
+
if (this.options.hasOwnProperty(name)) {
|
|
20426
|
+
let value = this.options[name];
|
|
20427
|
+
if (name === 'version') {
|
|
20428
|
+
name = 'v';
|
|
20429
|
+
}
|
|
20430
|
+
if (name === 'libraries') {
|
|
20431
|
+
value = value.join(',');
|
|
20432
|
+
}
|
|
20433
|
+
parameters.push(`${name}=${value}`);
|
|
20434
|
+
}
|
|
20435
|
+
}
|
|
20436
|
+
return `https://maps.googleapis.com/maps/api/js?${parameters.join('&')}`;
|
|
20437
|
+
}
|
|
20438
|
+
}
|
|
20439
|
+
Loader.CALLBACK_NAME = '_dk_google_maps_loader_cb';
|
|
20440
|
+
|
|
20441
|
+
const sallaMapCss = ".s-map-wrapper .s-map-location-button .s-map-location-icon{margin-right:10px}.s-map-modal-wrapper .s-map-modal-body{padding:0}.s-map-modal-wrapper .s-map-title{position:relative;margin-top:-0.5rem;margin-bottom:1rem;padding-left:1rem;padding-right:1rem}.s-map-modal-wrapper .s-map-modal-body{overflow:hidden;position:relative}.s-map-modal-wrapper .s-map-modal-body .s-map-element{height:400px;width:100%}.s-map-modal-wrapper .s-map-modal-body .s-map-search-wrapper{position:absolute;top:0px;z-index:11;z-index:1;margin:20px;width:-webkit-fill-available}.s-map-modal-wrapper .s-map-modal-body .s-map-search-wrapper input{width:100%;height:40px;padding:10px}.s-map-modal-wrapper .s-map-modal-body .s-map-search-wrapper .s-map-search-results{height:100px;padding:10px;margin-top:1px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.s-map-modal-wrapper .s-map-modal-body .s-loading-container{margin:0;position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);padding:5rem}.s-map-modal-wrapper .s-map-modal-body .s-map-my-location-icon{position:absolute;bottom:1.5rem;margin:10px}";
|
|
20442
|
+
|
|
20443
|
+
const SallaMap = class {
|
|
20444
|
+
constructor(hostRef) {
|
|
20445
|
+
index.registerInstance(this, hostRef);
|
|
20446
|
+
this.selected = index.createEvent(this, "selected", 7);
|
|
20447
|
+
this.mapClicked = index.createEvent(this, "mapClicked", 7);
|
|
20448
|
+
this.currentLocationChanged = index.createEvent(this, "currentLocationChanged", 7);
|
|
20449
|
+
// state variables
|
|
20450
|
+
this.modalActivityTitle = 'Activity Location';
|
|
20451
|
+
this.confirmButtonTitle = 'Confirm';
|
|
20452
|
+
this.locateButtonTitle = 'Locate';
|
|
20453
|
+
this.locateButtonEdit = 'Edit';
|
|
20454
|
+
this.searchInputValue = null;
|
|
20455
|
+
/**
|
|
20456
|
+
* Sets the search bar visibility.
|
|
20457
|
+
*/
|
|
20458
|
+
this.seachable = false;
|
|
20459
|
+
/**
|
|
20460
|
+
* Sets the start location.
|
|
20461
|
+
*/
|
|
20462
|
+
// start in mecca 🕋 ❤️
|
|
20463
|
+
this.lat = 21.419421;
|
|
20464
|
+
this.lng = 39.82553;
|
|
20465
|
+
/**
|
|
20466
|
+
* Sets the search bar visibility.
|
|
20467
|
+
*/
|
|
20468
|
+
this.apiKey = null;
|
|
20469
|
+
/**
|
|
20470
|
+
* Sets start map zoom.
|
|
20471
|
+
*/
|
|
20472
|
+
this.zoom = 10;
|
|
20473
|
+
/**
|
|
20474
|
+
* Sets map style.
|
|
20475
|
+
*/
|
|
20476
|
+
this.theme = 'light';
|
|
20477
|
+
salla.lang.onLoaded(() => {
|
|
20478
|
+
this.modalActivityTitle = salla.lang.get('pages.checkout.select_your_address_from_map');
|
|
20479
|
+
this.confirmButtonTitle = salla.lang.get('pages.checkout.confirm_address');
|
|
20480
|
+
this.locateButtonTitle = salla.lang.get('pages.checkout.confirm_address');
|
|
20481
|
+
this.locateButtonEdit = salla.lang.get('common.elements.edit');
|
|
20482
|
+
});
|
|
20483
|
+
}
|
|
20484
|
+
formatAddress(address) {
|
|
20485
|
+
return address.length > 25 ? address.substring(0, 25) + '...' : address;
|
|
20486
|
+
}
|
|
20487
|
+
getPositionAddress(location) {
|
|
20488
|
+
if (this.seachable) {
|
|
20489
|
+
// get address and set it to search input
|
|
20490
|
+
const Geocoder = new google.maps.Geocoder();
|
|
20491
|
+
Geocoder.geocode({
|
|
20492
|
+
location,
|
|
20493
|
+
}, (results, status) => {
|
|
20494
|
+
if (status === google.maps.GeocoderStatus.OK) {
|
|
20495
|
+
this.searchInputValue = results[0].formatted_address;
|
|
20496
|
+
this.searchInput.value = results[0].formatted_address;
|
|
20497
|
+
}
|
|
20498
|
+
});
|
|
20499
|
+
}
|
|
20500
|
+
}
|
|
20501
|
+
initGoogleMaps(options, mapDOM) {
|
|
20502
|
+
const loader = new Loader(this.apiKey, options);
|
|
20503
|
+
loader.load().then(google => {
|
|
20504
|
+
this.map = new google.maps.Map(mapDOM, {
|
|
20505
|
+
center: {
|
|
20506
|
+
lat: this.lat,
|
|
20507
|
+
lng: this.lng,
|
|
20508
|
+
},
|
|
20509
|
+
zoom: this.zoom,
|
|
20510
|
+
zoomControl: true,
|
|
20511
|
+
mapTypeControl: false,
|
|
20512
|
+
scaleControl: false,
|
|
20513
|
+
streetViewControl: false,
|
|
20514
|
+
rotateControl: false,
|
|
20515
|
+
fullscreenControl: false,
|
|
20516
|
+
disableDefaultUI: false,
|
|
20517
|
+
});
|
|
20518
|
+
this.map.setOptions({
|
|
20519
|
+
styles: this.theme === 'light' ? styles.light : styles.dark,
|
|
20520
|
+
});
|
|
20521
|
+
this.marker = new google.maps.Marker({
|
|
20522
|
+
position: this.map.getCenter(),
|
|
20523
|
+
map: this.map,
|
|
20524
|
+
icon: {
|
|
20525
|
+
url: 'data:image/svg+xml;utf8,' + encodeURIComponent(LocationMarker),
|
|
20526
|
+
scaledSize: new google.maps.Size(30, 30),
|
|
20527
|
+
},
|
|
20528
|
+
});
|
|
20529
|
+
if (this.seachable) {
|
|
20530
|
+
const searchBox = new google.maps.places.SearchBox(this.searchInput);
|
|
20531
|
+
google.maps.event.addListener(searchBox, 'places_changed', () => {
|
|
20532
|
+
const places = searchBox.getPlaces();
|
|
20533
|
+
// goto first place
|
|
20534
|
+
if (places.length > 0 && this.map) {
|
|
20535
|
+
this.map.setCenter(places[0].geometry.location);
|
|
20536
|
+
this.lat = places[0].geometry.location.lat();
|
|
20537
|
+
this.lng = places[0].geometry.location.lng();
|
|
20538
|
+
// set marker
|
|
20539
|
+
this.marker.setPosition(places[0].geometry.location);
|
|
20540
|
+
this.searchInputValue = places[0].formatted_address;
|
|
20541
|
+
}
|
|
20542
|
+
});
|
|
20543
|
+
}
|
|
20544
|
+
// add listener to map
|
|
20545
|
+
google.maps.event.addListener(this.map, 'click', e => {
|
|
20546
|
+
this.searchInputValue = null;
|
|
20547
|
+
this.marker.setPosition(e.latLng);
|
|
20548
|
+
this.lat = e.latLng.lat();
|
|
20549
|
+
this.lng = e.latLng.lng();
|
|
20550
|
+
this.getPositionAddress(e.latLng);
|
|
20551
|
+
this.mapClicked.emit({
|
|
20552
|
+
lat: e.latLng.lat(),
|
|
20553
|
+
lng: e.latLng.lng(),
|
|
20554
|
+
address: this.searchInputValue ? this.searchInputValue : null,
|
|
20555
|
+
});
|
|
20556
|
+
});
|
|
20557
|
+
// get current location
|
|
20558
|
+
this.getCurrentLocation();
|
|
20559
|
+
});
|
|
20560
|
+
}
|
|
20561
|
+
getCurrentLocation() {
|
|
20562
|
+
if (navigator.geolocation && this.map) {
|
|
20563
|
+
navigator.geolocation.getCurrentPosition(position => {
|
|
20564
|
+
// set map to this location
|
|
20565
|
+
const mapOptions = {
|
|
20566
|
+
center: new google.maps.LatLng(position.coords.latitude, position.coords.longitude),
|
|
20567
|
+
zoom: 15,
|
|
20568
|
+
};
|
|
20569
|
+
this.map.setOptions(mapOptions);
|
|
20570
|
+
// set marker
|
|
20571
|
+
this.marker.setPosition(mapOptions.center);
|
|
20572
|
+
this.getPositionAddress(mapOptions.center);
|
|
20573
|
+
this.currentLocationChanged.emit({
|
|
20574
|
+
lat: position.coords.latitude,
|
|
20575
|
+
lng: position.coords.longitude,
|
|
20576
|
+
address: this.searchInputValue ? this.searchInputValue : null,
|
|
20577
|
+
});
|
|
20578
|
+
});
|
|
20579
|
+
}
|
|
20580
|
+
}
|
|
20581
|
+
/**
|
|
20582
|
+
* Open location component
|
|
20583
|
+
*/
|
|
20584
|
+
async open() {
|
|
20585
|
+
var _a, _b;
|
|
20586
|
+
// only init google maps on modal open :) to save resources
|
|
20587
|
+
if (!this.map)
|
|
20588
|
+
this.initGoogleMaps({
|
|
20589
|
+
libraries: this.seachable ? ['places', 'search'] : [],
|
|
20590
|
+
language: salla.config.get('user.language_code') ||
|
|
20591
|
+
((_a = document.querySelector("meta[charset='UTF-8']")) === null || _a === void 0 ? void 0 : _a.getAttribute('lang')) ||
|
|
20592
|
+
'ar',
|
|
20593
|
+
}, this.mapElement);
|
|
20594
|
+
return (_b = this.locationModal) === null || _b === void 0 ? void 0 : _b.open();
|
|
20595
|
+
}
|
|
20596
|
+
// rendering functions
|
|
20597
|
+
getLocationModal() {
|
|
20598
|
+
return (index.h("div", null, index.h("div", { class: "s-map-title" }, this.modalActivityTitle), index.h("div", { class: "s-map-modal-body" }, index.h("div", { class: "s-map-element ", ref: el => (this.mapElement = el) }), this.seachable && (index.h("div", { class: "s-map-search-wrapper" }, index.h("input", { class: "s-map-search-input", ref: el => (this.searchInput = el) }))), index.h("salla-button", { class: "s-map-my-location-icon", onClick: () => {
|
|
20599
|
+
this.getCurrentLocation();
|
|
20600
|
+
}, shape: "icon", color: "primary" }, index.h("span", { class: "s-map-location-icon", innerHTML: CurrentLocation })), index.h("salla-button", { color: "primary", width: "wide", onClick: () => {
|
|
20601
|
+
let points = {
|
|
20602
|
+
lat: this.lat,
|
|
20603
|
+
lng: this.lng,
|
|
20604
|
+
address: this.searchInputValue ? this.searchInputValue : null,
|
|
20605
|
+
};
|
|
20606
|
+
salla.event.emit('salla-map::selected', points);
|
|
20607
|
+
this.selected.emit(points);
|
|
20608
|
+
this.locationModal.close();
|
|
20609
|
+
} }, this.confirmButtonTitle))));
|
|
20610
|
+
}
|
|
20611
|
+
// render
|
|
20612
|
+
render() {
|
|
20613
|
+
return (index.h(index.Host, { class: "s-map-wrapper" }, index.h("salla-modal", { class: "s-map-modal-wrapper", ref: modal => {
|
|
20614
|
+
this.locationModal = modal;
|
|
20615
|
+
} }, this.getLocationModal()), index.h("slot", { name: "button" }, index.h("salla-button", { onClick: () => {
|
|
20616
|
+
this.open();
|
|
20617
|
+
}, color: "primary", class: "s-map-location-button" }, index.h("span", { class: "s-map-location-icon", innerHTML: this.searchInputValue ? Edit : Location }), this.searchInputValue ? (index.h("div", null, this.locateButtonEdit, " | ", this.formatAddress(this.searchInputValue))) : (this.locateButtonTitle)))));
|
|
20618
|
+
}
|
|
20619
|
+
};
|
|
20620
|
+
SallaMap.style = sallaMapCss;
|
|
20621
|
+
|
|
20009
20622
|
const AlertEngineIcon = `<!-- Generated by IcoMoon.io -->
|
|
20010
20623
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20011
20624
|
<title>alert-engine</title>
|
|
@@ -25386,6 +25999,7 @@ exports.salla_loading = SallaLoading;
|
|
|
25386
25999
|
exports.salla_localization_modal = SallaLocalizationModal;
|
|
25387
26000
|
exports.salla_login_modal = SallaLoginModal;
|
|
25388
26001
|
exports.salla_loyalty = SallaLoyalty;
|
|
26002
|
+
exports.salla_map = SallaMap;
|
|
25389
26003
|
exports.salla_modal = SallaModal;
|
|
25390
26004
|
exports.salla_offer_modal = SallaOfferModal;
|
|
25391
26005
|
exports.salla_placeholder = SallaPlaceholder;
|