@leavepulse/ui 0.78.1 → 0.78.2
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/chunks/{DropzoneLinkField-CLLhd3WB.js → DropzoneLinkField-CyE7TJ5f.js} +1 -1
- package/dist/chunks/LpAddressInput-ft8fQOGx.js +401 -0
- package/dist/chunks/{LpAppShell-BKbYCHkx.js → LpAppShell-DkvU6IBB.js} +1 -1
- package/dist/chunks/LpAutocomplete-CrZbd0uv.js +310 -0
- package/dist/chunks/LpCheckbox-CCWCwD0y.js +129 -0
- package/dist/chunks/{LpCodeDisplay-D3BUAhV1.js → LpCodeDisplay-D59uPwRb.js} +1 -1
- package/dist/chunks/LpColorPicker-BONURBFN.js +574 -0
- package/dist/chunks/LpDatePicker-C2AOtxgF.js +171 -0
- package/dist/chunks/{LpDateRangePicker-CNQXdTVv.js → LpDateRangePicker-CiXdIAyh.js} +43 -35
- package/dist/chunks/{LpFileTree-C-rJKzEQ.js → LpFileTree-CpNurwZp.js} +2 -2
- package/dist/chunks/{LpFileTreeNode-BgYn4U1J.js → LpFileTreeNode-DdF8Cq-s.js} +1 -1
- package/dist/chunks/{LpInput-D0O6dpuA.js → LpInput-CbI7z5fQ.js} +3 -4
- package/dist/chunks/{LpLogInspector-BdQlX6S-.js → LpLogInspector-CcSJSGan.js} +1 -1
- package/dist/chunks/{LpLogViewer-umCZBapN.js → LpLogViewer-CWu49Dko.js} +2 -2
- package/dist/chunks/{LpModalNav-gOi1Giz1.js → LpModalNav-DI3BW5ff.js} +1 -1
- package/dist/chunks/LpNumberField-C8LfUz_R.js +154 -0
- package/dist/chunks/LpOtpInput-B1X9l9no.js +140 -0
- package/dist/chunks/{LpPaletteTheme-BIXpZLGe.js → LpPaletteTheme-B-xuZiKK.js} +2 -2
- package/dist/chunks/{LpPasswordInput-D4HPhqfV.js → LpPasswordInput-Duc_3wPv.js} +1 -1
- package/dist/chunks/{LpPhoneInput-BSL7NX4z.js → LpPhoneInput-CctcRK9K.js} +124 -118
- package/dist/chunks/LpRadioGroup-DTM0nd9G.js +103 -0
- package/dist/chunks/LpRangeSlider-DJsEZXad.js +97 -0
- package/dist/chunks/LpRepeater-Czib3rmv.js +193 -0
- package/dist/chunks/{LpSecretField-B2roc4Iz.js → LpSecretField-BtlCk3IH.js} +1 -1
- package/dist/chunks/LpSegmented-sskrJKJJ.js +128 -0
- package/dist/chunks/LpSelect-JFZehOkd.js +515 -0
- package/dist/chunks/{LpSidebar-DDNJzb69.js → LpSidebar-CvRvVBTt.js} +1 -1
- package/dist/chunks/LpSlider-C4ilCtZX.js +76 -0
- package/dist/chunks/LpSwitch-DyAYTchz.js +122 -0
- package/dist/chunks/{LpTableFilter-B_XMOeAh.js → LpTableFilter-CJg5eIcV.js} +2 -2
- package/dist/chunks/{LpTagsInput-Dt0mteSj.js → LpTagsInput-CkNxpNYa.js} +4 -3
- package/dist/chunks/{LpTextarea-Co0b9PVx.js → LpTextarea-CFK_5QB8.js} +3 -2
- package/dist/chunks/{LpThemeStudio-ChU0_Ga8.js → LpThemeStudio-R-wohbCY.js} +2 -2
- package/dist/chunks/{LpThemeSwitcher-DmCZ21P_.js → LpThemeSwitcher-Bzy15MCP.js} +1 -1
- package/dist/chunks/LpTimeField-B5n0m8m0.js +115 -0
- package/dist/chunks/{LpTopologyCanvas-jqz1KCq2.js → LpTopologyCanvas-BNgw9RyZ.js} +2 -2
- package/dist/chunks/{LpWorkspaceSwitcher-BeNHCLd5.js → LpWorkspaceSwitcher-ugv-fyig.js} +1 -1
- package/dist/components/DropzoneLinkField.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +4 -0
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.d.ts +3 -3
- package/dist/components/LpAppShell.vue.d.ts +1 -1
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.d.ts +4 -0
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpChart.vue.d.ts +1 -1
- package/dist/components/LpCheckbox.vue.d.ts +4 -0
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeDisplay.vue.js +1 -1
- package/dist/components/LpCollapse.vue.d.ts +1 -1
- package/dist/components/LpColorPicker.vue.d.ts +5 -3
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDateRangePicker.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +1 -1
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.d.ts +1 -1
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLogInspector.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +4 -0
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.d.ts +4 -0
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPaletteTheme.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.d.ts +4 -0
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.d.ts +4 -0
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpRangeSlider.vue.d.ts +4 -0
- package/dist/components/LpRangeSlider.vue.js +1 -1
- package/dist/components/LpRepeater.vue.d.ts +2 -0
- package/dist/components/LpRepeater.vue.js +1 -1
- package/dist/components/LpScrollArea.vue.d.ts +1 -1
- package/dist/components/LpSecretField.vue.js +1 -1
- package/dist/components/LpSegmented.vue.d.ts +4 -0
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.d.ts +2 -0
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShinyText.vue.d.ts +1 -1
- package/dist/components/LpSidebar.vue.d.ts +1 -1
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSlider.vue.d.ts +4 -0
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpSwitch.vue.d.ts +4 -0
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.js +2 -2
- package/dist/components/LpTableFilter.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +1 -1
- package/dist/components/LpTagsInput.vue.js +1 -1
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeStudio.vue.js +1 -1
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTimeField.vue.d.ts +4 -0
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpWorkspaceSwitcher.vue.js +1 -1
- package/dist/components/calendar.d.ts +2 -0
- package/dist/composables/useField.d.ts +50 -0
- package/dist/composables/useField.js +31 -2
- package/dist/composables/useMergedClass.d.ts +6 -2
- package/dist/composables/useMergedClass.js +6 -6
- package/dist/index.js +34 -34
- package/package.json +1 -1
- package/src/components/LpAddressInput.vue +8 -4
- package/src/components/LpAutocomplete.vue +11 -5
- package/src/components/LpCheckbox.vue +8 -6
- package/src/components/LpColorPicker.vue +7 -4
- package/src/components/LpDatePicker.vue +8 -4
- package/src/components/LpDateRangePicker.vue +8 -4
- package/src/components/LpInput.vue +3 -4
- package/src/components/LpNumberField.vue +11 -6
- package/src/components/LpOtpInput.vue +8 -6
- package/src/components/LpPhoneInput.vue +11 -6
- package/src/components/LpRadioGroup.vue +9 -5
- package/src/components/LpRangeSlider.vue +8 -4
- package/src/components/LpRepeater.vue +16 -4
- package/src/components/LpSegmented.vue +8 -4
- package/src/components/LpSelect.vue +8 -7
- package/src/components/LpSlider.vue +8 -4
- package/src/components/LpSwitch.vue +8 -5
- package/src/components/LpTagsInput.vue +4 -3
- package/src/components/LpTextarea.vue +3 -2
- package/src/components/LpTimeField.vue +8 -6
- package/src/components/calendar.ts +2 -0
- package/src/composables/useField.ts +52 -0
- package/src/composables/useMergedClass.ts +11 -5
- package/dist/chunks/LpAddressInput-BSS49jpm.js +0 -393
- package/dist/chunks/LpAutocomplete-DkY6CSyD.js +0 -302
- package/dist/chunks/LpCheckbox-D6RuDW4X.js +0 -124
- package/dist/chunks/LpColorPicker-COHzV68R.js +0 -567
- package/dist/chunks/LpDatePicker-DwSDY0mt.js +0 -163
- package/dist/chunks/LpNumberField-Csg-1Zh_.js +0 -148
- package/dist/chunks/LpOtpInput-BRpLBbOD.js +0 -132
- package/dist/chunks/LpRadioGroup-BrazjLY_.js +0 -95
- package/dist/chunks/LpRangeSlider-fz61tzc-.js +0 -89
- package/dist/chunks/LpRepeater-BkJHSPI1.js +0 -180
- package/dist/chunks/LpSegmented-DbEJhbv-.js +0 -123
- package/dist/chunks/LpSelect-Y-iuSymW.js +0 -512
- package/dist/chunks/LpSlider-A4ixovgS.js +0 -68
- package/dist/chunks/LpSwitch-DnC2-0aV.js +0 -115
- package/dist/chunks/LpTimeField-DeOcKWJq.js +0 -110
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, useModel, ref, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, createTextVNode, toDisplayString, normalizeClass, mergeModels } from "vue";
|
|
2
2
|
import { _ as _sfc_main$2 } from "./LpButton-DSHioIfD.js";
|
|
3
|
-
import { _ as _sfc_main$1 } from "./LpInput-
|
|
3
|
+
import { _ as _sfc_main$1 } from "./LpInput-CbI7z5fQ.js";
|
|
4
4
|
const _hoisted_1 = { class: "flex w-full flex-col gap-1.5" };
|
|
5
5
|
const _hoisted_2 = { class: "flex items-center gap-2" };
|
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { defineComponent, defineAsyncComponent, computed, watch, ref, onMounted, openBlock, createBlock, normalizeProps, guardReactiveProps, unref, withCtx, createElementVNode, mergeProps, createVNode, createCommentVNode, createElementBlock, createTextVNode, toDisplayString, renderSlot, normalizeClass } from "vue";
|
|
2
|
+
import { _ as _sfc_main$1 } from "./FieldWrapper-DnuMTrqW.js";
|
|
3
|
+
import { useAsyncTask } from "../composables/useAsyncTask.js";
|
|
4
|
+
import { OSM_TILES, createNominatimProvider, emptyAddress, formatAddress } from "../components/address.js";
|
|
5
|
+
import { flagEmoji, loadCountries } from "../components/countries.js";
|
|
6
|
+
import { _ as _sfc_main$3 } from "./LpAutocomplete-CrZbd0uv.js";
|
|
7
|
+
import { _ as _sfc_main$4 } from "./LpButton-DSHioIfD.js";
|
|
8
|
+
import { _ as _sfc_main$2 } from "./LpFormField-BKYn9dyP.js";
|
|
9
|
+
import { _ as _sfc_main$5 } from "./LpIcon-C6JpQ5td.js";
|
|
10
|
+
import { _ as _sfc_main$6 } from "./LpInput-CbI7z5fQ.js";
|
|
11
|
+
import { _ as _sfc_main$8 } from "./LpModal-DDvrSAnf.js";
|
|
12
|
+
import { _ as _sfc_main$7 } from "./LpSelect-JFZehOkd.js";
|
|
13
|
+
import { useOwnField, mergeDescribedBy } from "../composables/useField.js";
|
|
14
|
+
import { useLabels } from "../composables/useLpConfig.js";
|
|
15
|
+
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
16
|
+
const _hoisted_1 = ["aria-labelledby", "aria-invalid", "aria-describedby"];
|
|
17
|
+
const _hoisted_2 = { class: "flex items-stretch gap-2" };
|
|
18
|
+
const _hoisted_3 = { class: "grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]" };
|
|
19
|
+
const _hoisted_4 = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "flex items-center gap-2"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_5 = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "text-xs text-muted"
|
|
26
|
+
};
|
|
27
|
+
const __default__ = { inheritAttrs: false };
|
|
28
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
29
|
+
...__default__,
|
|
30
|
+
__name: "LpAddressInput",
|
|
31
|
+
props: {
|
|
32
|
+
modelValue: {},
|
|
33
|
+
provider: {},
|
|
34
|
+
tiles: { default: () => OSM_TILES },
|
|
35
|
+
only: {},
|
|
36
|
+
secondLine: { type: Boolean },
|
|
37
|
+
minChars: { default: 3 },
|
|
38
|
+
debounce: { default: 350 },
|
|
39
|
+
language: {},
|
|
40
|
+
disabled: { type: Boolean },
|
|
41
|
+
invalid: { type: Boolean },
|
|
42
|
+
error: {},
|
|
43
|
+
size: { default: "md" },
|
|
44
|
+
hideMap: { type: Boolean },
|
|
45
|
+
labels: {}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:modelValue", "pick"],
|
|
48
|
+
setup(__props, { emit: __emit }) {
|
|
49
|
+
const LpMapPicker = defineAsyncComponent(() => import("../components/LpMapPicker.vue.js"));
|
|
50
|
+
const props = __props;
|
|
51
|
+
const emit = __emit;
|
|
52
|
+
const DEFAULT_LABELS = {
|
|
53
|
+
line: "Street and number",
|
|
54
|
+
linePlaceholder: "Baker Street 221B",
|
|
55
|
+
secondLine: "Apartment, suite (optional)",
|
|
56
|
+
secondLinePlaceholder: "Flat 4",
|
|
57
|
+
city: "City",
|
|
58
|
+
cityPlaceholder: "London",
|
|
59
|
+
postalCode: "Postcode",
|
|
60
|
+
postalCodePlaceholder: "NW1 6XE",
|
|
61
|
+
country: "Country",
|
|
62
|
+
countryPlaceholder: "Select country…",
|
|
63
|
+
countrySearch: "Search country…",
|
|
64
|
+
pickOnMap: "Pick on map",
|
|
65
|
+
mapTitle: "Pick a location",
|
|
66
|
+
mapHint: "Click the map to drop a pin, drag to move around.",
|
|
67
|
+
use: "Use this address",
|
|
68
|
+
cancel: "Cancel",
|
|
69
|
+
searching: "Searching…",
|
|
70
|
+
noSuggestions: "No suggestions",
|
|
71
|
+
nothingHere: "No address found here"
|
|
72
|
+
};
|
|
73
|
+
const text = useLabels("addressInput", DEFAULT_LABELS, () => props.labels);
|
|
74
|
+
const fallbackProvider = createNominatimProvider();
|
|
75
|
+
const geocoder = computed(() => props.provider ?? fallbackProvider);
|
|
76
|
+
const value = computed(() => props.modelValue ?? emptyAddress());
|
|
77
|
+
let latest;
|
|
78
|
+
watch(
|
|
79
|
+
() => props.modelValue,
|
|
80
|
+
() => latest = void 0
|
|
81
|
+
);
|
|
82
|
+
function patch(changes) {
|
|
83
|
+
latest = { ...latest ?? value.value, ...changes };
|
|
84
|
+
emit("update:modelValue", latest);
|
|
85
|
+
}
|
|
86
|
+
function edit(changes) {
|
|
87
|
+
patch({ ...changes, lat: void 0, lon: void 0 });
|
|
88
|
+
}
|
|
89
|
+
const allCountries = ref([]);
|
|
90
|
+
const countries = computed(() => {
|
|
91
|
+
const only = props.only?.map((code) => code.toUpperCase());
|
|
92
|
+
return only?.length ? allCountries.value.filter((c) => only.includes(c.iso2)) : allCountries.value;
|
|
93
|
+
});
|
|
94
|
+
const countryOptions = computed(
|
|
95
|
+
() => countries.value.map((country) => ({
|
|
96
|
+
value: country.iso2,
|
|
97
|
+
label: `${flagEmoji(country.iso2)} ${country.name}`
|
|
98
|
+
}))
|
|
99
|
+
);
|
|
100
|
+
onMounted(async () => {
|
|
101
|
+
allCountries.value = await loadCountries();
|
|
102
|
+
});
|
|
103
|
+
function useSuggestions(field2) {
|
|
104
|
+
const options = ref([]);
|
|
105
|
+
const task = useAsyncTask();
|
|
106
|
+
function query(term) {
|
|
107
|
+
if (term.trim().length < props.minChars) {
|
|
108
|
+
task.cancel();
|
|
109
|
+
options.value = [];
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
task.run(
|
|
113
|
+
(signal) => geocoder.value.search(term.trim(), field2, {
|
|
114
|
+
country: value.value.country || void 0,
|
|
115
|
+
language: props.language,
|
|
116
|
+
signal
|
|
117
|
+
}),
|
|
118
|
+
{
|
|
119
|
+
delay: props.debounce,
|
|
120
|
+
apply: (found) => options.value = found,
|
|
121
|
+
// Network failure: leave the field usable as free text.
|
|
122
|
+
fail: () => options.value = []
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return { options, loading: task.pending, query };
|
|
127
|
+
}
|
|
128
|
+
const lineSuggestions = useSuggestions("line");
|
|
129
|
+
const citySuggestions = useSuggestions("city");
|
|
130
|
+
function applySuggestion(suggestion, keep) {
|
|
131
|
+
const parsed = suggestion.address;
|
|
132
|
+
const changes = { lat: suggestion.lat, lon: suggestion.lon };
|
|
133
|
+
if (parsed.line && keep !== "line") changes.line = parsed.line;
|
|
134
|
+
if (parsed.city) changes.city = parsed.city;
|
|
135
|
+
if (parsed.postalCode) changes.postalCode = parsed.postalCode;
|
|
136
|
+
if (parsed.country) changes.country = parsed.country;
|
|
137
|
+
patch(changes);
|
|
138
|
+
}
|
|
139
|
+
function onLineSelect(chosen) {
|
|
140
|
+
const suggestion = lineSuggestions.options.value.find((option) => option.value === chosen);
|
|
141
|
+
if (suggestion) applySuggestion(suggestion, "line");
|
|
142
|
+
}
|
|
143
|
+
function onCitySelect(chosen) {
|
|
144
|
+
const suggestion = citySuggestions.options.value.find((option) => option.value === chosen);
|
|
145
|
+
if (suggestion) applySuggestion(suggestion, "city");
|
|
146
|
+
}
|
|
147
|
+
const mapOpen = ref(false);
|
|
148
|
+
const point = ref();
|
|
149
|
+
const resolved = ref();
|
|
150
|
+
const resolving = ref(false);
|
|
151
|
+
computed(
|
|
152
|
+
() => countries.value.find((c) => c.iso2 === value.value.country)?.name
|
|
153
|
+
);
|
|
154
|
+
const preview = computed(() => {
|
|
155
|
+
if (resolving.value) return text.value.searching;
|
|
156
|
+
if (!point.value) return text.value.mapHint;
|
|
157
|
+
if (!resolved.value) return text.value.nothingHere;
|
|
158
|
+
const parsed = resolved.value.address;
|
|
159
|
+
return formatAddress(
|
|
160
|
+
{
|
|
161
|
+
line: parsed.line ?? "",
|
|
162
|
+
city: parsed.city ?? "",
|
|
163
|
+
postalCode: parsed.postalCode ?? "",
|
|
164
|
+
country: parsed.country ?? ""
|
|
165
|
+
},
|
|
166
|
+
countries.value.find((c) => c.iso2 === parsed.country)?.name
|
|
167
|
+
);
|
|
168
|
+
});
|
|
169
|
+
watch(mapOpen, (open) => {
|
|
170
|
+
if (!open) return;
|
|
171
|
+
point.value = value.value.lat != null && value.value.lon != null ? { lat: value.value.lat, lon: value.value.lon } : void 0;
|
|
172
|
+
resolved.value = void 0;
|
|
173
|
+
});
|
|
174
|
+
const reverse = useAsyncTask();
|
|
175
|
+
watch(reverse.pending, (busy) => resolving.value = busy);
|
|
176
|
+
function onPick(next) {
|
|
177
|
+
point.value = next;
|
|
178
|
+
resolved.value = void 0;
|
|
179
|
+
reverse.run(
|
|
180
|
+
() => geocoder.value.reverse(next.lat, next.lon, { language: props.language }),
|
|
181
|
+
{
|
|
182
|
+
apply: (found) => resolved.value = found,
|
|
183
|
+
fail: () => resolved.value = void 0
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
function confirmPoint() {
|
|
188
|
+
if (!point.value) return;
|
|
189
|
+
const parsed = resolved.value?.address ?? {};
|
|
190
|
+
patch({
|
|
191
|
+
line: parsed.line ?? value.value.line,
|
|
192
|
+
city: parsed.city ?? value.value.city,
|
|
193
|
+
postalCode: parsed.postalCode ?? value.value.postalCode,
|
|
194
|
+
country: parsed.country ?? value.value.country,
|
|
195
|
+
lat: point.value.lat,
|
|
196
|
+
lon: point.value.lon
|
|
197
|
+
});
|
|
198
|
+
emit("pick", point.value);
|
|
199
|
+
mapOpen.value = false;
|
|
200
|
+
}
|
|
201
|
+
const { field, wrapper, ownAttrs } = useOwnField(() => ({ error: props.error, invalid: props.invalid, disabled: props.disabled }));
|
|
202
|
+
const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
203
|
+
"flex flex-col gap-3",
|
|
204
|
+
() => ownAttrs()
|
|
205
|
+
);
|
|
206
|
+
return (_ctx, _cache) => {
|
|
207
|
+
return openBlock(), createBlock(_sfc_main$1, normalizeProps(guardReactiveProps(unref(wrapper))), {
|
|
208
|
+
default: withCtx(() => [
|
|
209
|
+
createElementVNode("div", mergeProps({
|
|
210
|
+
role: "group",
|
|
211
|
+
"aria-labelledby": unref(field).labelId,
|
|
212
|
+
"aria-invalid": unref(field).invalid || void 0,
|
|
213
|
+
class: unref(rootClass)
|
|
214
|
+
}, unref(rest), {
|
|
215
|
+
"aria-describedby": unref(mergeDescribedBy)(unref(rest)["aria-describedby"], unref(field).describedBy)
|
|
216
|
+
}), [
|
|
217
|
+
createVNode(_sfc_main$2, {
|
|
218
|
+
label: unref(text).line
|
|
219
|
+
}, {
|
|
220
|
+
default: withCtx(() => [
|
|
221
|
+
createElementVNode("div", _hoisted_2, [
|
|
222
|
+
createVNode(_sfc_main$3, {
|
|
223
|
+
class: "min-w-0 flex-1",
|
|
224
|
+
"model-value": value.value.line,
|
|
225
|
+
options: unref(lineSuggestions).options.value,
|
|
226
|
+
loading: unref(lineSuggestions).loading.value,
|
|
227
|
+
filter: false,
|
|
228
|
+
"min-chars": __props.minChars,
|
|
229
|
+
disabled: unref(field).disabled,
|
|
230
|
+
invalid: unref(field).invalid,
|
|
231
|
+
size: __props.size,
|
|
232
|
+
placeholder: unref(text).linePlaceholder,
|
|
233
|
+
"empty-text": unref(text).noSuggestions,
|
|
234
|
+
"loading-text": unref(text).searching,
|
|
235
|
+
icon: "lucide:map-pin",
|
|
236
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = (next) => {
|
|
237
|
+
edit({ line: next });
|
|
238
|
+
unref(lineSuggestions).query(next);
|
|
239
|
+
}),
|
|
240
|
+
onSelect: onLineSelect
|
|
241
|
+
}, null, 8, ["model-value", "options", "loading", "min-chars", "disabled", "invalid", "size", "placeholder", "empty-text", "loading-text"]),
|
|
242
|
+
!__props.hideMap ? (openBlock(), createBlock(_sfc_main$4, {
|
|
243
|
+
key: 0,
|
|
244
|
+
variant: "soft",
|
|
245
|
+
size: __props.size,
|
|
246
|
+
square: "",
|
|
247
|
+
disabled: unref(field).disabled,
|
|
248
|
+
title: unref(text).pickOnMap,
|
|
249
|
+
"aria-label": unref(text).pickOnMap,
|
|
250
|
+
onClick: _cache[1] || (_cache[1] = ($event) => mapOpen.value = true)
|
|
251
|
+
}, {
|
|
252
|
+
default: withCtx(() => [
|
|
253
|
+
createVNode(_sfc_main$5, {
|
|
254
|
+
name: "lucide:map",
|
|
255
|
+
size: 16
|
|
256
|
+
})
|
|
257
|
+
]),
|
|
258
|
+
_: 1
|
|
259
|
+
}, 8, ["size", "disabled", "title", "aria-label"])) : createCommentVNode("", true)
|
|
260
|
+
])
|
|
261
|
+
]),
|
|
262
|
+
_: 1
|
|
263
|
+
}, 8, ["label"]),
|
|
264
|
+
__props.secondLine ? (openBlock(), createBlock(_sfc_main$6, {
|
|
265
|
+
key: 0,
|
|
266
|
+
"model-value": value.value.line2 ?? "",
|
|
267
|
+
label: unref(text).secondLine,
|
|
268
|
+
placeholder: unref(text).secondLinePlaceholder,
|
|
269
|
+
disabled: unref(field).disabled,
|
|
270
|
+
invalid: unref(field).invalid,
|
|
271
|
+
size: __props.size,
|
|
272
|
+
autocomplete: "address-line2",
|
|
273
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = (next) => patch({ line2: next }))
|
|
274
|
+
}, null, 8, ["model-value", "label", "placeholder", "disabled", "invalid", "size"])) : createCommentVNode("", true),
|
|
275
|
+
createElementVNode("div", _hoisted_3, [
|
|
276
|
+
createVNode(_sfc_main$2, {
|
|
277
|
+
label: unref(text).city
|
|
278
|
+
}, {
|
|
279
|
+
default: withCtx(() => [
|
|
280
|
+
createVNode(_sfc_main$3, {
|
|
281
|
+
"model-value": value.value.city,
|
|
282
|
+
options: unref(citySuggestions).options.value,
|
|
283
|
+
loading: unref(citySuggestions).loading.value,
|
|
284
|
+
filter: false,
|
|
285
|
+
"min-chars": __props.minChars,
|
|
286
|
+
disabled: unref(field).disabled,
|
|
287
|
+
invalid: unref(field).invalid,
|
|
288
|
+
size: __props.size,
|
|
289
|
+
placeholder: unref(text).cityPlaceholder,
|
|
290
|
+
"empty-text": unref(text).noSuggestions,
|
|
291
|
+
"loading-text": unref(text).searching,
|
|
292
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = (next) => {
|
|
293
|
+
edit({ city: next });
|
|
294
|
+
unref(citySuggestions).query(next);
|
|
295
|
+
}),
|
|
296
|
+
onSelect: onCitySelect
|
|
297
|
+
}, null, 8, ["model-value", "options", "loading", "min-chars", "disabled", "invalid", "size", "placeholder", "empty-text", "loading-text"])
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
}, 8, ["label"]),
|
|
301
|
+
createVNode(_sfc_main$6, {
|
|
302
|
+
"model-value": value.value.postalCode,
|
|
303
|
+
label: unref(text).postalCode,
|
|
304
|
+
placeholder: unref(text).postalCodePlaceholder,
|
|
305
|
+
disabled: unref(field).disabled,
|
|
306
|
+
invalid: unref(field).invalid,
|
|
307
|
+
size: __props.size,
|
|
308
|
+
autocomplete: "postal-code",
|
|
309
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = (next) => edit({ postalCode: next }))
|
|
310
|
+
}, null, 8, ["model-value", "label", "placeholder", "disabled", "invalid", "size"])
|
|
311
|
+
]),
|
|
312
|
+
createVNode(_sfc_main$2, {
|
|
313
|
+
label: unref(text).country
|
|
314
|
+
}, {
|
|
315
|
+
default: withCtx(() => [
|
|
316
|
+
createVNode(_sfc_main$7, {
|
|
317
|
+
"model-value": value.value.country,
|
|
318
|
+
options: countryOptions.value,
|
|
319
|
+
placeholder: unref(text).countryPlaceholder,
|
|
320
|
+
"search-placeholder": unref(text).countrySearch,
|
|
321
|
+
disabled: unref(field).disabled,
|
|
322
|
+
invalid: unref(field).invalid,
|
|
323
|
+
size: __props.size,
|
|
324
|
+
searchable: "",
|
|
325
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = (next) => edit({ country: String(next ?? "") }))
|
|
326
|
+
}, null, 8, ["model-value", "options", "placeholder", "search-placeholder", "disabled", "invalid", "size"])
|
|
327
|
+
]),
|
|
328
|
+
_: 1
|
|
329
|
+
}, 8, ["label"]),
|
|
330
|
+
!__props.hideMap ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
331
|
+
createVNode(_sfc_main$4, {
|
|
332
|
+
variant: "soft",
|
|
333
|
+
size: __props.size === "lg" ? "md" : "sm",
|
|
334
|
+
disabled: unref(field).disabled,
|
|
335
|
+
onClick: _cache[6] || (_cache[6] = ($event) => mapOpen.value = true)
|
|
336
|
+
}, {
|
|
337
|
+
default: withCtx(() => [
|
|
338
|
+
createVNode(_sfc_main$5, {
|
|
339
|
+
name: "lucide:map",
|
|
340
|
+
size: 15
|
|
341
|
+
}),
|
|
342
|
+
createTextVNode(" " + toDisplayString(unref(text).pickOnMap), 1)
|
|
343
|
+
]),
|
|
344
|
+
_: 1
|
|
345
|
+
}, 8, ["size", "disabled"]),
|
|
346
|
+
value.value.lat != null && value.value.lon != null ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(value.value.lat.toFixed(5)) + ", " + toDisplayString(value.value.lon.toFixed(5)), 1)) : createCommentVNode("", true)
|
|
347
|
+
])) : createCommentVNode("", true),
|
|
348
|
+
createVNode(_sfc_main$8, {
|
|
349
|
+
open: mapOpen.value,
|
|
350
|
+
"onUpdate:open": _cache[8] || (_cache[8] = ($event) => mapOpen.value = $event),
|
|
351
|
+
title: unref(text).mapTitle,
|
|
352
|
+
size: "2xl"
|
|
353
|
+
}, {
|
|
354
|
+
footer: withCtx(() => [
|
|
355
|
+
createVNode(_sfc_main$4, {
|
|
356
|
+
variant: "ghost",
|
|
357
|
+
onClick: _cache[7] || (_cache[7] = ($event) => mapOpen.value = false)
|
|
358
|
+
}, {
|
|
359
|
+
default: withCtx(() => [
|
|
360
|
+
createTextVNode(toDisplayString(unref(text).cancel), 1)
|
|
361
|
+
]),
|
|
362
|
+
_: 1
|
|
363
|
+
}),
|
|
364
|
+
createVNode(_sfc_main$4, {
|
|
365
|
+
disabled: !point.value,
|
|
366
|
+
onClick: confirmPoint
|
|
367
|
+
}, {
|
|
368
|
+
default: withCtx(() => [
|
|
369
|
+
createTextVNode(toDisplayString(unref(text).use), 1)
|
|
370
|
+
]),
|
|
371
|
+
_: 1
|
|
372
|
+
}, 8, ["disabled"])
|
|
373
|
+
]),
|
|
374
|
+
default: withCtx(() => [
|
|
375
|
+
renderSlot(_ctx.$slots, "map", {
|
|
376
|
+
point: point.value,
|
|
377
|
+
setPoint: onPick,
|
|
378
|
+
tiles: __props.tiles
|
|
379
|
+
}, () => [
|
|
380
|
+
createVNode(unref(LpMapPicker), {
|
|
381
|
+
"model-value": point.value,
|
|
382
|
+
tiles: __props.tiles,
|
|
383
|
+
"onUpdate:modelValue": onPick
|
|
384
|
+
}, null, 8, ["model-value", "tiles"])
|
|
385
|
+
]),
|
|
386
|
+
createElementVNode("p", {
|
|
387
|
+
class: normalizeClass(["mt-3 min-h-5 text-sm", resolved.value || resolving.value ? "text-ink" : "text-muted"])
|
|
388
|
+
}, toDisplayString(preview.value), 3)
|
|
389
|
+
]),
|
|
390
|
+
_: 3
|
|
391
|
+
}, 8, ["open", "title"])
|
|
392
|
+
], 16, _hoisted_1)
|
|
393
|
+
]),
|
|
394
|
+
_: 3
|
|
395
|
+
}, 16);
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
export {
|
|
400
|
+
_sfc_main as _
|
|
401
|
+
};
|
|
@@ -12,7 +12,7 @@ import { _ as _sfc_main$4 } from "./LpIcon-C6JpQ5td.js";
|
|
|
12
12
|
import { _ as _sfc_main$8 } from "./LpPageScrollbar-D2O0xhJw.js";
|
|
13
13
|
import { _ as _sfc_main$7 } from "./LpScrollArea-CqvwfZs2.js";
|
|
14
14
|
import { _ as _sfc_main$5 } from "./LpShift-DAgS_d2x.js";
|
|
15
|
-
import { _ as _sfc_main$1 } from "./LpSidebar-
|
|
15
|
+
import { _ as _sfc_main$1 } from "./LpSidebar-CvRvVBTt.js";
|
|
16
16
|
import { mergeClass, useMergedAttrs } from "../composables/useMergedClass.js";
|
|
17
17
|
import { nodeWindow } from "../composables/realm.js";
|
|
18
18
|
const _hoisted_1 = ["href"];
|