sveltekit-ui 1.0.7 → 1.0.9
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/Components/ContentInput/index.svelte.js +1 -0
- package/dist/Components/Location/index.svelte +5 -11
- package/dist/Components/Location/index.svelte.js +9 -13
- package/dist/Components/LocationInput/index.svelte +5 -10
- package/dist/Components/LocationInput/index.svelte.js +16 -6
- package/dist/Components/TextInput/index.svelte.js +1 -0
- package/dist/client/types/index.js +78 -2238
- package/package.json +11 -8
- package/src/app.html +1 -0
- package/src/lib/Components/ContentInput/index.svelte.js +1 -0
- package/src/lib/Components/Location/index.svelte +5 -11
- package/src/lib/Components/Location/index.svelte.js +9 -13
- package/src/lib/Components/LocationInput/index.svelte +5 -10
- package/src/lib/Components/LocationInput/index.svelte.js +16 -6
- package/src/lib/Components/TextInput/index.svelte.js +1 -0
- package/src/lib/client/types/index.js +78 -2238
- package/src/routes/[component]/+page.svelte +3 -3
- package/svelte.config.js +1 -1
- package/dist/Components/FunctionInput/Node/helpers/DefinedTargetInput/index.svelte +0 -110
- package/dist/Components/FunctionInput/Node/helpers/Field/index.svelte +0 -109
- package/dist/Components/FunctionInput/Node/helpers/Field/index.svelte.js +0 -207
- package/dist/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte +0 -97
- package/dist/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte.js +0 -105
- package/dist/Components/FunctionInput/Node/helpers/ObjectInput/index.svelte +0 -198
- package/dist/Components/FunctionInput/Node/helpers/StackArea/index.svelte +0 -169
- package/dist/Components/FunctionInput/Node/helpers/StackArea/index.svelte.js +0 -152
- package/dist/Components/FunctionInput/Node/index.svelte +0 -144
- package/dist/Components/FunctionInput/Node/index.svelte.js +0 -134
- package/dist/Components/FunctionInput/index.svelte +0 -356
- package/dist/Components/FunctionInput/index.svelte.js +0 -1215
- package/src/lib/Components/FunctionInput/Node/helpers/DefinedTargetInput/index.svelte +0 -110
- package/src/lib/Components/FunctionInput/Node/helpers/Field/index.svelte +0 -109
- package/src/lib/Components/FunctionInput/Node/helpers/Field/index.svelte.js +0 -207
- package/src/lib/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte +0 -97
- package/src/lib/Components/FunctionInput/Node/helpers/InlineDropArea/index.svelte.js +0 -105
- package/src/lib/Components/FunctionInput/Node/helpers/ObjectInput/index.svelte +0 -198
- package/src/lib/Components/FunctionInput/Node/helpers/StackArea/index.svelte +0 -169
- package/src/lib/Components/FunctionInput/Node/helpers/StackArea/index.svelte.js +0 -152
- package/src/lib/Components/FunctionInput/Node/index.svelte +0 -144
- package/src/lib/Components/FunctionInput/Node/index.svelte.js +0 -134
- package/src/lib/Components/FunctionInput/index.svelte +0 -356
- package/src/lib/Components/FunctionInput/index.svelte.js +0 -1215
- package/src/routes/[component]/Showcase/FunctionInput/index.svelte +0 -77
|
@@ -134,6 +134,7 @@ export function create_content_input_manager(config) {
|
|
|
134
134
|
selector_id: element?.selector_id,
|
|
135
135
|
val: element?.attributes,
|
|
136
136
|
on_finish: (input) => {
|
|
137
|
+
console.log("on_finish_attribute", input)
|
|
137
138
|
attributes_input.popover_manager.close()
|
|
138
139
|
set_element_attributes(element?.selector_id, input)
|
|
139
140
|
},
|
|
@@ -2,19 +2,10 @@
|
|
|
2
2
|
import Popover from "../Popover/index.svelte"
|
|
3
3
|
import Button from "../Button/index.svelte"
|
|
4
4
|
import LoadingWheel from "../LoadingWheel/index.svelte"
|
|
5
|
-
import { onMount } from "svelte"
|
|
6
5
|
import { slide } from "svelte/transition"
|
|
6
|
+
import intersection_observer from "../../actions/intersection_observer.js"
|
|
7
7
|
|
|
8
8
|
let { manager } = $props()
|
|
9
|
-
|
|
10
|
-
onMount(() => {
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
if (typeof manager?.initialize_map == "function" && !manager?.is_popover) {
|
|
13
|
-
console.log("on_mount_initialize_map")
|
|
14
|
-
manager.initialize_map()
|
|
15
|
-
}
|
|
16
|
-
}, 20)
|
|
17
|
-
})
|
|
18
9
|
</script>
|
|
19
10
|
|
|
20
11
|
{#snippet location_content()}
|
|
@@ -25,7 +16,10 @@
|
|
|
25
16
|
<p>Loading Map</p>
|
|
26
17
|
</div>
|
|
27
18
|
</div>
|
|
28
|
-
<div
|
|
19
|
+
<div use:intersection_observer onappeared={() => manager?.initialize_map()}></div>
|
|
20
|
+
{#key manager?.id}
|
|
21
|
+
<div id="map_{manager?.id}" class="map" style="height: {manager?.height}; max-width: 100%;"></div>
|
|
22
|
+
{/key}
|
|
29
23
|
</div>
|
|
30
24
|
{/snippet}
|
|
31
25
|
|
|
@@ -61,8 +61,6 @@ export function create_location_manager(config) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
async function initialize_map() {
|
|
64
|
-
console.log("initialize_map")
|
|
65
|
-
map = null
|
|
66
64
|
if (!browser) {
|
|
67
65
|
console.log("browser is not defined")
|
|
68
66
|
return
|
|
@@ -78,10 +76,9 @@ export function create_location_manager(config) {
|
|
|
78
76
|
return
|
|
79
77
|
}
|
|
80
78
|
const { center_lat, center_lng, lat_span, lng_span } = get_map_region(val)
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
79
|
+
const center = new mapkit.Coordinate(center_lat, center_lng)
|
|
80
|
+
const span = new mapkit.CoordinateSpan(lat_span, lng_span)
|
|
81
|
+
const initial_region = new mapkit.CoordinateRegion(center, span)
|
|
85
82
|
if (!map) {
|
|
86
83
|
map = new mapkit.Map(`map_${id}`)
|
|
87
84
|
}
|
|
@@ -177,14 +174,14 @@ export function create_location_manager(config) {
|
|
|
177
174
|
return
|
|
178
175
|
}
|
|
179
176
|
const route = response.routes[0]
|
|
180
|
-
if (route.
|
|
181
|
-
route.
|
|
177
|
+
if (route.polyline) {
|
|
178
|
+
route.polyline.style = new mapkit.Style({
|
|
182
179
|
strokeColor: leg.stroke_color || "#0000ff",
|
|
183
180
|
lineWidth: leg.line_width || 3,
|
|
184
181
|
})
|
|
185
|
-
map.addOverlay(route.
|
|
182
|
+
map.addOverlay(route.polyline)
|
|
186
183
|
} else {
|
|
187
|
-
console.warn("no
|
|
184
|
+
console.warn("no polyline found for route", route)
|
|
188
185
|
}
|
|
189
186
|
})
|
|
190
187
|
}
|
|
@@ -214,8 +211,8 @@ export function create_location_manager(config) {
|
|
|
214
211
|
strokeColor: leg.stroke_color || "oklch(70% 0.3 210)",
|
|
215
212
|
lineWidth: leg.line_width || 3,
|
|
216
213
|
})
|
|
217
|
-
const
|
|
218
|
-
map.addOverlay(
|
|
214
|
+
const polyline = new mapkit.PolylineOverlay(coords, { style: overlay_style })
|
|
215
|
+
map.addOverlay(polyline)
|
|
219
216
|
}
|
|
220
217
|
|
|
221
218
|
function set_val(input) {
|
|
@@ -232,7 +229,6 @@ export function create_location_manager(config) {
|
|
|
232
229
|
target_height: config?.height ?? 440,
|
|
233
230
|
target_width: config?.width ?? 600,
|
|
234
231
|
on_open: () => {
|
|
235
|
-
console.log("on_open")
|
|
236
232
|
if (!map) {
|
|
237
233
|
setTimeout(() => {
|
|
238
234
|
initialize_map()
|
|
@@ -5,18 +5,10 @@
|
|
|
5
5
|
import Checkbox from "../Checkbox/index.svelte"
|
|
6
6
|
import Dropdown from "../Dropdown/index.svelte"
|
|
7
7
|
import LoadingWheel from "../LoadingWheel/index.svelte"
|
|
8
|
-
import { onMount } from "svelte"
|
|
9
8
|
import { slide } from "svelte/transition"
|
|
9
|
+
import intersection_observer from "../../actions/intersection_observer.js"
|
|
10
10
|
|
|
11
11
|
let { manager } = $props()
|
|
12
|
-
|
|
13
|
-
onMount(() => {
|
|
14
|
-
if (!manager?.is_popover) {
|
|
15
|
-
// setTimeout(() => {
|
|
16
|
-
manager?.initialize_map()
|
|
17
|
-
// }, 100)
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
12
|
</script>
|
|
21
13
|
|
|
22
14
|
{#snippet location_content()}
|
|
@@ -27,7 +19,10 @@
|
|
|
27
19
|
<p>Loading Map</p>
|
|
28
20
|
</div>
|
|
29
21
|
</div>
|
|
30
|
-
<div
|
|
22
|
+
<div use:intersection_observer onappeared={() => manager?.initialize_map()}></div>
|
|
23
|
+
{#key manager?.id}
|
|
24
|
+
<div id="map_{manager?.id}" class="map" style="height: {manager?.height}; max-width: 100%;"></div>
|
|
25
|
+
{/key}
|
|
31
26
|
{#if manager?.is_show_search}
|
|
32
27
|
<div class="search_container">
|
|
33
28
|
<div class="text_input">
|
|
@@ -586,7 +586,6 @@ export function create_location_input_manager(config) {
|
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
function prepare_search_options(is_autocomplete = false) {
|
|
589
|
-
console.log("prepare_search_options")
|
|
590
589
|
const result_type = Array.isArray(search_filter_result_type_dropdown_manager?.val)
|
|
591
590
|
? search_filter_result_type_dropdown_manager?.val
|
|
592
591
|
: []
|
|
@@ -638,7 +637,6 @@ export function create_location_input_manager(config) {
|
|
|
638
637
|
)
|
|
639
638
|
)
|
|
640
639
|
}
|
|
641
|
-
console.log("zzz", options)
|
|
642
640
|
return options
|
|
643
641
|
}
|
|
644
642
|
|
|
@@ -648,7 +646,6 @@ export function create_location_input_manager(config) {
|
|
|
648
646
|
return
|
|
649
647
|
}
|
|
650
648
|
const autocomplete_search_options = prepare_search_options(true)
|
|
651
|
-
console.log("autocomplete_search_options", autocomplete_search_options)
|
|
652
649
|
const place_search = new mapkit.Search()
|
|
653
650
|
place_search.autocomplete(
|
|
654
651
|
input,
|
|
@@ -660,7 +657,6 @@ export function create_location_input_manager(config) {
|
|
|
660
657
|
if (result.results.length > 0) {
|
|
661
658
|
let suggestions_prepped_loc = []
|
|
662
659
|
if (Array.isArray(result.results)) {
|
|
663
|
-
console.log("suggestions_results", result.results)
|
|
664
660
|
for (let suggestion of result.results) {
|
|
665
661
|
let choose_selection_button_manager = $state(null)
|
|
666
662
|
if (suggestion?.id) {
|
|
@@ -673,7 +669,7 @@ export function create_location_input_manager(config) {
|
|
|
673
669
|
choose_selection_button_manager = create_button_manager({
|
|
674
670
|
support_icon: "magnifying_glass",
|
|
675
671
|
is_uniform: true,
|
|
676
|
-
on_click: () => search_for(`${suggestion?.
|
|
672
|
+
on_click: () => search_for(`${suggestion?.displayLines?.[0]}`),
|
|
677
673
|
})
|
|
678
674
|
}
|
|
679
675
|
suggestions_prepped_loc.push({
|
|
@@ -691,7 +687,10 @@ export function create_location_input_manager(config) {
|
|
|
691
687
|
|
|
692
688
|
function search_for(input) {
|
|
693
689
|
const search_options = prepare_search_options()
|
|
694
|
-
|
|
690
|
+
if (!map) {
|
|
691
|
+
console.log("map not found")
|
|
692
|
+
return
|
|
693
|
+
}
|
|
695
694
|
map.removeAnnotations(map.annotations)
|
|
696
695
|
const place_search = new mapkit.Search()
|
|
697
696
|
place_search.search(
|
|
@@ -752,6 +751,16 @@ export function create_location_input_manager(config) {
|
|
|
752
751
|
}
|
|
753
752
|
}
|
|
754
753
|
|
|
754
|
+
function reset_map() {
|
|
755
|
+
// const el = document.getElementById(`map_${id}`)
|
|
756
|
+
// if (el) {
|
|
757
|
+
// // optional: remove child nodes or clear old map if you want
|
|
758
|
+
// // el.innerHTML = ''
|
|
759
|
+
// map = new mapkit.Map(`map_${id}`)
|
|
760
|
+
// }
|
|
761
|
+
initialize_map()
|
|
762
|
+
}
|
|
763
|
+
|
|
755
764
|
function finish() {
|
|
756
765
|
popover_manager.close()
|
|
757
766
|
if (typeof config?.on_finish == "function") {
|
|
@@ -951,5 +960,6 @@ export function create_location_input_manager(config) {
|
|
|
951
960
|
},
|
|
952
961
|
initialize_map,
|
|
953
962
|
set_val,
|
|
963
|
+
reset_map,
|
|
954
964
|
}
|
|
955
965
|
}
|
|
@@ -270,6 +270,7 @@ export function create_text_input_manager(config) {
|
|
|
270
270
|
icon_sw: 40,
|
|
271
271
|
min_height: 2,
|
|
272
272
|
border_radius: 0.5,
|
|
273
|
+
is_disabled: is_disabled,
|
|
273
274
|
popover_target: () => `popover_${popover_manager?.id}`,
|
|
274
275
|
})
|
|
275
276
|
set_null_button_manager = create_button_manager({
|