@welldot/vue 0.0.0-stage → 0.1.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/LICENSE +202 -0
- package/README.md +563 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/_virtual/icons/ph/caret-down.js +21 -0
- package/dist/_virtual/icons/ph/caret-down.js.map +1 -0
- package/dist/_virtual/icons/ph/info.js +21 -0
- package/dist/_virtual/icons/ph/info.js.map +1 -0
- package/dist/_virtual/icons/ph/pencil-simple-line.js +21 -0
- package/dist/_virtual/icons/ph/pencil-simple-line.js.map +1 -0
- package/dist/_virtual/icons/ph/pencil-simple.js +21 -0
- package/dist/_virtual/icons/ph/pencil-simple.js.map +1 -0
- package/dist/_virtual/icons/ph/plus.js +21 -0
- package/dist/_virtual/icons/ph/plus.js.map +1 -0
- package/dist/_virtual/icons/ph/x.js +21 -0
- package/dist/_virtual/icons/ph/x.js.map +1 -0
- package/dist/components/WellChip.d.ts +30 -0
- package/dist/components/WellChip.d.ts.map +1 -0
- package/dist/components/WellChip.js +9 -0
- package/dist/components/WellChip.js.map +1 -0
- package/dist/components/WellChip.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/components/WellChip.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellComboSelect.d.ts +19 -0
- package/dist/components/WellComboSelect.d.ts.map +1 -0
- package/dist/components/WellComboSelect.js +7 -0
- package/dist/components/WellComboSelect.js.map +1 -0
- package/dist/components/WellComboSelect.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/WellComboSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellInfoPopover.d.ts +31 -0
- package/dist/components/WellInfoPopover.d.ts.map +1 -0
- package/dist/components/WellInfoPopover.js +7 -0
- package/dist/components/WellInfoPopover.js.map +1 -0
- package/dist/components/WellInfoPopover.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/components/WellInfoPopover.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellInputNumber.d.ts +4 -0
- package/dist/components/WellInputNumber.d.ts.map +1 -0
- package/dist/components/WellInputNumber.js +7 -0
- package/dist/components/WellInputNumber.js.map +1 -0
- package/dist/components/WellInputNumber.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/components/WellInputNumber.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellLabeledField.d.ts +22 -0
- package/dist/components/WellLabeledField.d.ts.map +1 -0
- package/dist/components/WellLabeledField.js +7 -0
- package/dist/components/WellLabeledField.js.map +1 -0
- package/dist/components/WellLabeledField.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/components/WellLabeledField.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTagSelect.d.ts +21 -0
- package/dist/components/WellTagSelect.d.ts.map +1 -0
- package/dist/components/WellTagSelect.js +7 -0
- package/dist/components/WellTagSelect.js.map +1 -0
- package/dist/components/WellTagSelect.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/components/WellTagSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTextureSelect.d.ts +30 -0
- package/dist/components/WellTextureSelect.d.ts.map +1 -0
- package/dist/components/WellTextureSelect.js +7 -0
- package/dist/components/WellTextureSelect.js.map +1 -0
- package/dist/components/WellTextureSelect.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/components/WellTextureSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellTextureThumbnail.d.ts +10 -0
- package/dist/components/WellTextureThumbnail.d.ts.map +1 -0
- package/dist/components/WellTextureThumbnail.js +9 -0
- package/dist/components/WellTextureThumbnail.js.map +1 -0
- package/dist/components/WellTextureThumbnail.vue_vue_type_script_setup_true_lang.js +393 -0
- package/dist/components/WellTextureThumbnail.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/WellUnitInput.d.ts +19 -0
- package/dist/components/WellUnitInput.d.ts.map +1 -0
- package/dist/components/WellUnitInput.js +7 -0
- package/dist/components/WellUnitInput.js.map +1 -0
- package/dist/components/WellUnitInput.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/components/WellUnitInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/parts/WellInfoTrigger.d.ts +8 -0
- package/dist/components/parts/WellInfoTrigger.d.ts.map +1 -0
- package/dist/components/parts/WellInfoTrigger.js +7 -0
- package/dist/components/parts/WellInfoTrigger.js.map +1 -0
- package/dist/components/parts/WellInfoTrigger.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/components/parts/WellInfoTrigger.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/composables/useWellNumberFormat.d.ts +12 -0
- package/dist/composables/useWellNumberFormat.d.ts.map +1 -0
- package/dist/composables/useWellNumberFormat.js +25 -0
- package/dist/composables/useWellNumberFormat.js.map +1 -0
- package/dist/composables/useWellText.d.ts +11 -0
- package/dist/composables/useWellText.d.ts.map +1 -0
- package/dist/composables/useWellText.js +15 -0
- package/dist/composables/useWellText.js.map +1 -0
- package/dist/composables/useWellUnits.d.ts +29 -0
- package/dist/composables/useWellUnits.d.ts.map +1 -0
- package/dist/composables/useWellUnits.js +52 -0
- package/dist/composables/useWellUnits.js.map +1 -0
- package/dist/config.d.ts +110 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +76 -0
- package/dist/config.js.map +1 -0
- package/dist/grid/WellDataGrid.d.ts +34 -0
- package/dist/grid/WellDataGrid.d.ts.map +1 -0
- package/dist/grid/WellDataGrid.js +9 -0
- package/dist/grid/WellDataGrid.js.map +1 -0
- package/dist/grid/WellDataGrid.vue_vue_type_script_setup_true_lang.js +87 -0
- package/dist/grid/WellDataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.d.ts +10 -0
- package/dist/grid/cells/GridCheckboxCell.d.ts.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.js +7 -0
- package/dist/grid/cells/GridCheckboxCell.js.map +1 -0
- package/dist/grid/cells/GridCheckboxCell.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/grid/cells/GridCheckboxCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridColorCell.d.ts +7 -0
- package/dist/grid/cells/GridColorCell.d.ts.map +1 -0
- package/dist/grid/cells/GridColorCell.js +7 -0
- package/dist/grid/cells/GridColorCell.js.map +1 -0
- package/dist/grid/cells/GridColorCell.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/grid/cells/GridColorCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.d.ts +12 -0
- package/dist/grid/cells/GridColorPickerEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.js +7 -0
- package/dist/grid/cells/GridColorPickerEditor.js.map +1 -0
- package/dist/grid/cells/GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/grid/cells/GridColorPickerEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridComboEditor.d.ts +14 -0
- package/dist/grid/cells/GridComboEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridComboEditor.js +7 -0
- package/dist/grid/cells/GridComboEditor.js.map +1 -0
- package/dist/grid/cells/GridComboEditor.vue_vue_type_script_setup_true_lang.js +177 -0
- package/dist/grid/cells/GridComboEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridDeleteCell.d.ts +12 -0
- package/dist/grid/cells/GridDeleteCell.d.ts.map +1 -0
- package/dist/grid/cells/GridDeleteCell.js +7 -0
- package/dist/grid/cells/GridDeleteCell.js.map +1 -0
- package/dist/grid/cells/GridDeleteCell.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/grid/cells/GridDeleteCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridDragCell.d.ts +16 -0
- package/dist/grid/cells/GridDragCell.d.ts.map +1 -0
- package/dist/grid/cells/GridDragCell.js +7 -0
- package/dist/grid/cells/GridDragCell.js.map +1 -0
- package/dist/grid/cells/GridDragCell.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/grid/cells/GridDragCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridFormattedCell.d.ts +9 -0
- package/dist/grid/cells/GridFormattedCell.d.ts.map +1 -0
- package/dist/grid/cells/GridFormattedCell.js +7 -0
- package/dist/grid/cells/GridFormattedCell.js.map +1 -0
- package/dist/grid/cells/GridFormattedCell.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/grid/cells/GridFormattedCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridHeaderCell.d.ts +11 -0
- package/dist/grid/cells/GridHeaderCell.d.ts.map +1 -0
- package/dist/grid/cells/GridHeaderCell.js +7 -0
- package/dist/grid/cells/GridHeaderCell.js.map +1 -0
- package/dist/grid/cells/GridHeaderCell.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/grid/cells/GridHeaderCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridNumberEditor.d.ts +9 -0
- package/dist/grid/cells/GridNumberEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridNumberEditor.js +7 -0
- package/dist/grid/cells/GridNumberEditor.js.map +1 -0
- package/dist/grid/cells/GridNumberEditor.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/grid/cells/GridNumberEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.d.ts +12 -0
- package/dist/grid/cells/GridSelectButtonCell.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.js +7 -0
- package/dist/grid/cells/GridSelectButtonCell.js.map +1 -0
- package/dist/grid/cells/GridSelectButtonCell.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/grid/cells/GridSelectButtonCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectCell.d.ts +9 -0
- package/dist/grid/cells/GridSelectCell.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectCell.js +7 -0
- package/dist/grid/cells/GridSelectCell.js.map +1 -0
- package/dist/grid/cells/GridSelectCell.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/grid/cells/GridSelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridSelectEditor.d.ts +11 -0
- package/dist/grid/cells/GridSelectEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridSelectEditor.js +7 -0
- package/dist/grid/cells/GridSelectEditor.js.map +1 -0
- package/dist/grid/cells/GridSelectEditor.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/grid/cells/GridSelectEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextEditor.d.ts +9 -0
- package/dist/grid/cells/GridTextEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridTextEditor.js +7 -0
- package/dist/grid/cells/GridTextEditor.js.map +1 -0
- package/dist/grid/cells/GridTextEditor.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/grid/cells/GridTextEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.d.ts +7 -0
- package/dist/grid/cells/GridTextureSelectCell.d.ts.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.js +7 -0
- package/dist/grid/cells/GridTextureSelectCell.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectCell.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/grid/cells/GridTextureSelectCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.d.ts +13 -0
- package/dist/grid/cells/GridTextureSelectEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.js +7 -0
- package/dist/grid/cells/GridTextureSelectEditor.js.map +1 -0
- package/dist/grid/cells/GridTextureSelectEditor.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/grid/cells/GridTextureSelectEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridUnitCell.d.ts +9 -0
- package/dist/grid/cells/GridUnitCell.d.ts.map +1 -0
- package/dist/grid/cells/GridUnitCell.js +7 -0
- package/dist/grid/cells/GridUnitCell.js.map +1 -0
- package/dist/grid/cells/GridUnitCell.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/grid/cells/GridUnitCell.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/cells/GridUnitEditor.d.ts +11 -0
- package/dist/grid/cells/GridUnitEditor.d.ts.map +1 -0
- package/dist/grid/cells/GridUnitEditor.js +7 -0
- package/dist/grid/cells/GridUnitEditor.js.map +1 -0
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/columnStretchPlugin.d.ts +12 -0
- package/dist/grid/columnStretchPlugin.d.ts.map +1 -0
- package/dist/grid/columnStretchPlugin.js +35 -0
- package/dist/grid/columnStretchPlugin.js.map +1 -0
- package/dist/grid/composables/useCellTemplate.d.ts +35 -0
- package/dist/grid/composables/useCellTemplate.d.ts.map +1 -0
- package/dist/grid/composables/useCellTemplate.js +30 -0
- package/dist/grid/composables/useCellTemplate.js.map +1 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.d.ts +5 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.d.ts.map +1 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.js +12 -0
- package/dist/grid/composables/useGridOverlayFocusGuard.js.map +1 -0
- package/dist/grid/composables/useUnitSuffix.d.ts +9 -0
- package/dist/grid/composables/useUnitSuffix.d.ts.map +1 -0
- package/dist/grid/composables/useUnitSuffix.js +13 -0
- package/dist/grid/composables/useUnitSuffix.js.map +1 -0
- package/dist/grid/gridHeight.d.ts +11 -0
- package/dist/grid/gridHeight.d.ts.map +1 -0
- package/dist/grid/gridHeight.js +8 -0
- package/dist/grid/gridHeight.js.map +1 -0
- package/dist/grid/index.d.ts +8 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +4 -0
- package/dist/grid/parts/WellGridAddButton.d.ts +5 -0
- package/dist/grid/parts/WellGridAddButton.d.ts.map +1 -0
- package/dist/grid/parts/WellGridAddButton.js +7 -0
- package/dist/grid/parts/WellGridAddButton.js.map +1 -0
- package/dist/grid/parts/WellGridAddButton.vue_vue_type_script_setup_true_lang.js +23 -0
- package/dist/grid/parts/WellGridAddButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.d.ts +5 -0
- package/dist/grid/parts/WellGridDeleteButton.d.ts.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.js +7 -0
- package/dist/grid/parts/WellGridDeleteButton.js.map +1 -0
- package/dist/grid/parts/WellGridDeleteButton.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/grid/parts/WellGridDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/grid/types.d.ts +90 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/grid/useWellGridColumns.d.ts +40 -0
- package/dist/grid/useWellGridColumns.d.ts.map +1 -0
- package/dist/grid/useWellGridColumns.js +242 -0
- package/dist/grid/useWellGridColumns.js.map +1 -0
- package/dist/grid.css +407 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/location/WellCoordinateInput.d.ts +14 -0
- package/dist/location/WellCoordinateInput.d.ts.map +1 -0
- package/dist/location/WellCoordinateInput.js +7 -0
- package/dist/location/WellCoordinateInput.js.map +1 -0
- package/dist/location/WellCoordinateInput.vue_vue_type_script_setup_true_lang.js +53 -0
- package/dist/location/WellCoordinateInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/WellLocationMap.d.ts +22 -0
- package/dist/location/WellLocationMap.d.ts.map +1 -0
- package/dist/location/WellLocationMap.js +9 -0
- package/dist/location/WellLocationMap.js.map +1 -0
- package/dist/location/WellLocationMap.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/location/WellLocationMap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/WellLocationPicker.d.ts +32 -0
- package/dist/location/WellLocationPicker.d.ts.map +1 -0
- package/dist/location/WellLocationPicker.js +7 -0
- package/dist/location/WellLocationPicker.js.map +1 -0
- package/dist/location/WellLocationPicker.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/location/WellLocationPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/location/index.d.ts +6 -0
- package/dist/location/index.d.ts.map +1 -0
- package/dist/location/index.js +5 -0
- package/dist/location/location.d.ts +61 -0
- package/dist/location/location.d.ts.map +1 -0
- package/dist/location/location.js +15 -0
- package/dist/location/location.js.map +1 -0
- package/dist/nuxt/module.d.ts +76 -0
- package/dist/nuxt/module.d.ts.map +1 -0
- package/dist/nuxt/module.js +129 -0
- package/dist/nuxt/module.js.map +1 -0
- package/dist/nuxt/runtime/plugin.d.ts +14 -0
- package/dist/nuxt/runtime/plugin.d.ts.map +1 -0
- package/dist/nuxt/runtime/plugin.js +13 -0
- package/dist/nuxt/runtime/plugin.js.map +1 -0
- package/dist/style.css +2 -0
- package/dist/tailwind.css +160 -0
- package/dist/theme/define.d.ts +44 -0
- package/dist/theme/define.d.ts.map +1 -0
- package/dist/theme/define.js +14 -0
- package/dist/theme/define.js.map +1 -0
- package/dist/theme/index.d.ts +5 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/preset.d.ts +20 -0
- package/dist/theme/preset.d.ts.map +1 -0
- package/dist/theme/preset.js +977 -0
- package/dist/theme/preset.js.map +1 -0
- package/dist/theme/pt.d.ts +8 -0
- package/dist/theme/pt.d.ts.map +1 -0
- package/dist/theme/pt.js +66 -0
- package/dist/theme/pt.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +134 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DEFAULT_TILE_ATTRIBUTION as e, DEFAULT_TILE_URL as t, MARKER_ANCHOR as n, MARKER_SIZE as r, MARKER_SVG as i } from "./location.js";
|
|
2
|
+
import { createElementBlock as a, defineComponent as o, mergeModels as s, normalizeStyle as c, onMounted as l, onUnmounted as u, openBlock as d, useModel as f, useTemplateRef as p, watch as m } from "vue";
|
|
3
|
+
import { clampLat as h, clampLng as g } from "@welldot/utils";
|
|
4
|
+
//#region src/location/WellLocationMap.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = /* @__PURE__ */ o({
|
|
6
|
+
__name: "WellLocationMap",
|
|
7
|
+
props: /* @__PURE__ */ s({
|
|
8
|
+
readonly: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: !1
|
|
11
|
+
},
|
|
12
|
+
tileUrl: { default: t },
|
|
13
|
+
attribution: { default: e },
|
|
14
|
+
height: { default: "16rem" }
|
|
15
|
+
}, {
|
|
16
|
+
lat: { required: !0 },
|
|
17
|
+
latModifiers: {},
|
|
18
|
+
lng: { required: !0 },
|
|
19
|
+
lngModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: ["update:lat", "update:lng"],
|
|
22
|
+
setup(e) {
|
|
23
|
+
let t = e, o = f(e, "lat"), s = f(e, "lng"), _ = p("mapEl"), v = null, y = null, b = null, x = !1, S = null;
|
|
24
|
+
async function C() {
|
|
25
|
+
let e = await import("leaflet");
|
|
26
|
+
return e.default ?? e;
|
|
27
|
+
}
|
|
28
|
+
function w(e) {
|
|
29
|
+
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
30
|
+
}
|
|
31
|
+
function T(e, t) {
|
|
32
|
+
o.value = h(e), s.value = g(t);
|
|
33
|
+
}
|
|
34
|
+
let E = null;
|
|
35
|
+
function D() {
|
|
36
|
+
if (!y) return;
|
|
37
|
+
let e = y.getLatLng();
|
|
38
|
+
T(e.lat, e.lng);
|
|
39
|
+
}
|
|
40
|
+
function O(e, t) {
|
|
41
|
+
if (!v || !y) return;
|
|
42
|
+
let n = v, r = y;
|
|
43
|
+
r.options.draggable = t, t ? r.dragging?.enable() : r.dragging?.disable(), r.off("dragend", D), t && r.on("dragend", D), E && n.off("click", E), E = null, t && (E = (t) => {
|
|
44
|
+
let n = e.latLng(h(t.latlng.lat), g(t.latlng.lng));
|
|
45
|
+
r.setLatLng(n), T(n.lat, n.lng);
|
|
46
|
+
}, n.on("click", E)), r.getElement()?.style.setProperty("cursor", t ? "" : "default");
|
|
47
|
+
}
|
|
48
|
+
return l(async () => {
|
|
49
|
+
let e = await C();
|
|
50
|
+
if (await import("leaflet/dist/leaflet.css"), x || !_.value) return;
|
|
51
|
+
let a = h(w(o.value)), c = g(w(s.value)), l = a === 0 && c === 0;
|
|
52
|
+
v = e.map(_.value, {
|
|
53
|
+
zoomControl: !0,
|
|
54
|
+
maxBounds: e.latLngBounds([-90, -180], [90, 180]),
|
|
55
|
+
maxBoundsViscosity: 1,
|
|
56
|
+
minZoom: 2
|
|
57
|
+
}).setView([a, c], l ? 2 : 13), e.tileLayer(t.tileUrl, {
|
|
58
|
+
attribution: t.attribution,
|
|
59
|
+
maxZoom: 19,
|
|
60
|
+
noWrap: !0
|
|
61
|
+
}).addTo(v);
|
|
62
|
+
let u = e.divIcon({
|
|
63
|
+
className: "well-location-marker",
|
|
64
|
+
html: i,
|
|
65
|
+
iconSize: r,
|
|
66
|
+
iconAnchor: n
|
|
67
|
+
});
|
|
68
|
+
y = e.marker([a, c], {
|
|
69
|
+
icon: u,
|
|
70
|
+
draggable: !t.readonly
|
|
71
|
+
}).addTo(v), S = e, O(e, !t.readonly), typeof ResizeObserver < "u" && (b = new ResizeObserver(() => v?.invalidateSize()), b.observe(_.value));
|
|
72
|
+
}), u(() => {
|
|
73
|
+
x = !0, b?.disconnect(), b = null, v?.remove(), v = null, y = null, E = null;
|
|
74
|
+
}), m(() => t.readonly, (e) => {
|
|
75
|
+
S && O(S, !e);
|
|
76
|
+
}), m([o, s], ([e, t]) => {
|
|
77
|
+
if (!v || !y) return;
|
|
78
|
+
let n = h(w(e)), r = g(w(t));
|
|
79
|
+
y.setLatLng([n, r]), v.setView([n, r], v.getZoom());
|
|
80
|
+
}), (e, n) => (d(), a("div", {
|
|
81
|
+
ref_key: "mapEl",
|
|
82
|
+
ref: _,
|
|
83
|
+
class: "well-location-map w-full rounded-lg overflow-hidden border border-surface-200",
|
|
84
|
+
style: c({ height: t.height })
|
|
85
|
+
}, null, 4));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
export { _ as default };
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=WellLocationMap.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WellLocationMap.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/location/WellLocationMap.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Leaflet map with a single pin at `lat`/`lng`. Click the map or drag the\n * pin to move it (unless `readonly`, which can change at any time). Leaflet and its CSS are imported\n * dynamically on mount, so server-side rendering outputs an empty `div` and\n * no `<ClientOnly>` is needed. `leaflet` is an optional peer dependency.\n *\n * The pin is an inline SVG (`L.divIcon`) filled with the theme's primary\n * colour; no marker images are fetched.\n */\nimport { clampLat, clampLng } from '@welldot/utils';\nimport type { LeafletMouseEvent, Map as LeafletMap, Marker } from 'leaflet';\nimport { onMounted, onUnmounted, useTemplateRef, watch } from 'vue';\nimport {\n DEFAULT_TILE_ATTRIBUTION,\n DEFAULT_TILE_URL,\n MARKER_ANCHOR,\n MARKER_SIZE,\n MARKER_SVG,\n type WellLocationMapProps,\n} from './location';\n\ntype Leaflet = typeof import('leaflet');\n\nconst props = withDefaults(defineProps<WellLocationMapProps>(), {\n readonly: false,\n tileUrl: DEFAULT_TILE_URL,\n attribution: DEFAULT_TILE_ATTRIBUTION,\n height: '16rem',\n});\nconst lat = defineModel<number>('lat', { required: true });\nconst lng = defineModel<number>('lng', { required: true });\n\nconst mapEl = useTemplateRef<HTMLElement>('mapEl');\nlet map: LeafletMap | null = null;\nlet marker: Marker | null = null;\nlet resizeObserver: ResizeObserver | null = null;\nlet unmounted = false;\n/** Leaflet namespace, once loaded on mount. */\nlet leaflet: Leaflet | null = null;\n\n/** Leaflet ships UMD; depending on the bundler the namespace is `default`. */\nasync function loadLeaflet(): Promise<Leaflet> {\n const mod = (await import('leaflet')) as Leaflet & { default?: Leaflet };\n return mod.default ?? mod;\n}\n\nfunction finite(value: number | null | undefined): number {\n return typeof value === 'number' && Number.isFinite(value) ? value : 0;\n}\n\nfunction setCoordinates(newLat: number, newLng: number) {\n lat.value = clampLat(newLat);\n lng.value = clampLng(newLng);\n}\n\n/** Map click handler while editable (kept to remove it again). */\nlet onMapClick: ((e: LeafletMouseEvent) => void) | null = null;\n\nfunction onMarkerDragEnd() {\n if (!marker) return;\n const pos = marker.getLatLng();\n setCoordinates(pos.lat, pos.lng);\n}\n\n/**\n * Turns pin dragging and click-to-move on or off. Called on mount and\n * whenever `readonly` changes.\n */\nfunction setEditable(L: Leaflet, editable: boolean) {\n if (!map || !marker) return;\n const m = map;\n const pin = marker;\n\n pin.options.draggable = editable;\n if (editable) pin.dragging?.enable();\n else pin.dragging?.disable();\n pin.off('dragend', onMarkerDragEnd);\n if (editable) pin.on('dragend', onMarkerDragEnd);\n\n if (onMapClick) m.off('click', onMapClick);\n onMapClick = null;\n if (editable) {\n onMapClick = e => {\n const clamped = L.latLng(clampLat(e.latlng.lat), clampLng(e.latlng.lng));\n pin.setLatLng(clamped);\n setCoordinates(clamped.lat, clamped.lng);\n };\n m.on('click', onMapClick);\n }\n\n // Leaflet gives every interactive marker a pointer cursor; a read-only\n // pin does nothing on click or drag.\n pin.getElement()?.style.setProperty('cursor', editable ? '' : 'default');\n}\n\nonMounted(async () => {\n const L = await loadLeaflet();\n await import('leaflet/dist/leaflet.css');\n // Unmounted while leaflet was loading.\n if (unmounted || !mapEl.value) return;\n\n const initialLat = clampLat(finite(lat.value));\n const initialLng = clampLng(finite(lng.value));\n const isDefault = initialLat === 0 && initialLng === 0;\n\n map = L.map(mapEl.value, {\n zoomControl: true,\n maxBounds: L.latLngBounds([-90, -180], [90, 180]),\n maxBoundsViscosity: 1.0,\n minZoom: 2,\n }).setView([initialLat, initialLng], isDefault ? 2 : 13);\n\n L.tileLayer(props.tileUrl, {\n attribution: props.attribution,\n maxZoom: 19,\n noWrap: true,\n }).addTo(map);\n\n const icon = L.divIcon({\n className: 'well-location-marker',\n html: MARKER_SVG,\n iconSize: MARKER_SIZE,\n iconAnchor: MARKER_ANCHOR,\n });\n\n marker = L.marker([initialLat, initialLng], {\n icon,\n draggable: !props.readonly,\n }).addTo(map);\n\n leaflet = L;\n setEditable(L, !props.readonly);\n\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => map?.invalidateSize());\n resizeObserver.observe(mapEl.value);\n }\n});\n\nonUnmounted(() => {\n unmounted = true;\n resizeObserver?.disconnect();\n resizeObserver = null;\n map?.remove();\n map = null;\n marker = null;\n onMapClick = null;\n});\n\nwatch(\n () => props.readonly,\n readonly => {\n if (leaflet) setEditable(leaflet, !readonly);\n },\n);\n\nwatch([lat, lng], ([newLat, newLng]) => {\n if (!map || !marker) return;\n const clampedLat = clampLat(finite(newLat));\n const clampedLng = clampLng(finite(newLng));\n marker.setLatLng([clampedLat, clampedLng]);\n map.setView([clampedLat, clampedLng], map.getZoom());\n});\n</script>\n\n<template>\n <div\n ref=\"mapEl\"\n class=\"well-location-map w-full rounded-lg overflow-hidden border border-surface-200\"\n :style=\"{ height: props.height }\"\n />\n</template>\n\n<style scoped>\n/* Leaflet creates the marker element outside Vue's render, so the scoped\n attribute is only on the map root: reach the marker through `:deep`. */\n.well-location-map :deep(.well-location-marker) {\n background: none;\n border: none;\n}\n\n.well-location-map :deep(.well-location-marker svg) {\n display: block;\n overflow: visible;\n filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.35));\n}\n\n.well-location-map :deep(.well-location-marker__pin) {\n fill: var(--p-primary-color, var(--color-primary-500, #2563eb));\n stroke: rgb(0 0 0 / 0.2);\n stroke-width: 0.75;\n}\n\n.well-location-map :deep(.well-location-marker__dot) {\n fill: #fff;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAwBA,IAAM,IAAQ,GAMR,IAAM,EAAmB,GAAC,MAA0B,EACpD,IAAM,EAAmB,GAAC,MAA0B,EAEpD,IAAQ,EAA4B,QAAQ,EAC9C,IAAyB,MACzB,IAAwB,MACxB,IAAwC,MACxC,IAAY,IAEZ,IAA0B;EAG9B,eAAe,IAAgC;GAC7C,IAAM,IAAO,MAAM,OAAO;AAC1B,UAAO,EAAI,WAAW;;EAGxB,SAAS,EAAO,GAA0C;AACxD,UAAO,OAAO,KAAU,YAAY,OAAO,SAAS,EAAM,GAAG,IAAQ;;EAGvE,SAAS,EAAe,GAAgB,GAAgB;AAEtD,GADA,EAAI,QAAQ,EAAS,EAAO,EAC5B,EAAI,QAAQ,EAAS,EAAO;;EAI9B,IAAI,IAAsD;EAE1D,SAAS,IAAkB;AACzB,OAAI,CAAC,EAAQ;GACb,IAAM,IAAM,EAAO,WAAW;AAC9B,KAAe,EAAI,KAAK,EAAI,IAAI;;EAOlC,SAAS,EAAY,GAAY,GAAmB;AAClD,OAAI,CAAC,KAAO,CAAC,EAAQ;GACrB,IAAM,IAAI,GACJ,IAAM;AAqBZ,GAnBA,EAAI,QAAQ,YAAY,GACpB,IAAU,EAAI,UAAU,QAAQ,GAC/B,EAAI,UAAU,SAAS,EAC5B,EAAI,IAAI,WAAW,EAAgB,EAC/B,KAAU,EAAI,GAAG,WAAW,EAAgB,EAE5C,KAAY,EAAE,IAAI,SAAS,EAAW,EAC1C,IAAa,MACT,MACF,KAAa,MAAK;IAChB,IAAM,IAAU,EAAE,OAAO,EAAS,EAAE,OAAO,IAAI,EAAE,EAAS,EAAE,OAAO,IAAI,CAAC;AAExE,IADA,EAAI,UAAU,EAAQ,EACtB,EAAe,EAAQ,KAAK,EAAQ,IAAI;MAE1C,EAAE,GAAG,SAAS,EAAW,GAK3B,EAAI,YAAY,EAAE,MAAM,YAAY,UAAU,IAAW,KAAK,UAAU;;SAG1E,EAAU,YAAY;GACpB,IAAM,IAAI,MAAM,GAAa;AAG7B,OAFA,MAAM,OAAO,6BAET,KAAa,CAAC,EAAM,MAAO;GAE/B,IAAM,IAAa,EAAS,EAAO,EAAI,MAAM,CAAC,EACxC,IAAa,EAAS,EAAO,EAAI,MAAM,CAAC,EACxC,IAAY,MAAe,KAAK,MAAe;AASrD,GAPA,IAAM,EAAE,IAAI,EAAM,OAAO;IACvB,aAAa;IACb,WAAW,EAAE,aAAa,CAAC,KAAK,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC;IACjD,oBAAoB;IACpB,SAAS;IACV,CAAC,CAAC,QAAQ,CAAC,GAAY,EAAW,EAAE,IAAY,IAAI,GAAG,EAExD,EAAE,UAAU,EAAM,SAAS;IACzB,aAAa,EAAM;IACnB,SAAS;IACT,QAAQ;IACT,CAAC,CAAC,MAAM,EAAI;GAEb,IAAM,IAAO,EAAE,QAAQ;IACrB,WAAW;IACX,MAAM;IACN,UAAU;IACV,YAAY;IACb,CAAC;AAUF,GARA,IAAS,EAAE,OAAO,CAAC,GAAY,EAAW,EAAE;IAC1C;IACA,WAAW,CAAC,EAAM;IACnB,CAAC,CAAC,MAAM,EAAI,EAEb,IAAU,GACV,EAAY,GAAG,CAAC,EAAM,SAAS,EAE3B,OAAO,iBAAmB,QAC5B,IAAiB,IAAI,qBAAqB,GAAK,gBAAgB,CAAC,EAChE,EAAe,QAAQ,EAAM,MAAM;IAErC,EAEF,QAAkB;AAOhB,GANA,IAAY,IACZ,GAAgB,YAAY,EAC5B,IAAiB,MACjB,GAAK,QAAQ,EACb,IAAM,MACN,IAAS,MACT,IAAa;IACb,EAEF,QACQ,EAAM,WACZ,MAAY;AACV,GAAI,KAAS,EAAY,GAAS,CAAC,EAAS;IAE/C,EAED,EAAM,CAAC,GAAK,EAAI,GAAG,CAAC,GAAQ,OAAY;AACtC,OAAI,CAAC,KAAO,CAAC,EAAQ;GACrB,IAAM,IAAa,EAAS,EAAO,EAAO,CAAC,EACrC,IAAa,EAAS,EAAO,EAAO,CAAC;AAE3C,GADA,EAAO,UAAU,CAAC,GAAY,EAAW,CAAC,EAC1C,EAAI,QAAQ,CAAC,GAAY,EAAW,EAAE,EAAI,SAAS,CAAC;IACpD,kBAIA,EAIE,OAAA;YAHI;GAAJ,KAAI;GACJ,OAAM;GACL,OAAK,EAAA,EAAA,QAAY,EAAM,QAAM,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CoordFormat } from '@welldot/utils';
|
|
2
|
+
import { WellLocationPickerProps } from './location';
|
|
3
|
+
type __VLS_Props = WellLocationPickerProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
'lat': number;
|
|
6
|
+
'lng': number;
|
|
7
|
+
'elevation'?: number | null;
|
|
8
|
+
/**
|
|
9
|
+
* Bound by the parent: the parent's value wins. Unbound: `defineModel`
|
|
10
|
+
* keeps a local value, `undefined` until the first toggle, so the
|
|
11
|
+
* configured format applies until then.
|
|
12
|
+
*/
|
|
13
|
+
'format'?: CoordFormat;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
"update:lat": (value: number) => any;
|
|
18
|
+
"update:lng": (value: number) => any;
|
|
19
|
+
"update:elevation": (value: number | null | undefined) => any;
|
|
20
|
+
"update:format": (value: CoordFormat | undefined) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
+
"onUpdate:lat"?: ((value: number) => any) | undefined;
|
|
23
|
+
"onUpdate:lng"?: ((value: number) => any) | undefined;
|
|
24
|
+
"onUpdate:elevation"?: ((value: number | null | undefined) => any) | undefined;
|
|
25
|
+
"onUpdate:format"?: ((value: CoordFormat | undefined) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
labels: import('./location').WellLocationPickerLabels;
|
|
28
|
+
showElevation: boolean;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
32
|
+
//# sourceMappingURL=WellLocationPicker.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WellLocationPicker.d.ts","sourceRoot":"","sources":["../../src/location/WellLocationPicker.vue"],"names":[],"mappings":"AAqHA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQlD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAI1D,KAAK,WAAW,GAAG,uBAAuB,CAAC;AAoC3C,KAAK,gBAAgB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAaF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA+KxD,QAAA,MAAM,YAAY;;;;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WellLocationPicker.js","names":[],"sources":["../../src/location/WellLocationPicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Location editor: DD/DMS toggle, latitude/longitude text inputs, optional\n * elevation (in the configured length unit) and a map to click or drag the\n * pin. Coordinates are decimal degrees; elevation is canonical metres.\n *\n * `v-model:format` is optional. Unbound, the format follows\n * `createWelldot({ coordinateFormat })` until the user toggles it, after\n * which it is kept as local state (and `update:format` is still emitted).\n *\n * Text comes from `labels`; an omitted label is not rendered. The only\n * built-in text is locale-independent (`DD`/`DMS`, placeholder examples).\n */\nimport type { CoordFormat } from '@welldot/utils';\nimport SelectButton from 'primevue/selectbutton';\nimport { computed } from 'vue';\nimport WellLabeledField from '../components/WellLabeledField.vue';\nimport WellUnitInput from '../components/WellUnitInput.vue';\nimport { useWellText } from '../composables/useWellText';\nimport { useWellUnits } from '../composables/useWellUnits';\nimport { useWelldotConfig } from '../config';\nimport type { WellLocationPickerProps } from './location';\nimport WellCoordinateInput from './WellCoordinateInput.vue';\nimport WellLocationMap from './WellLocationMap.vue';\n\nconst props = withDefaults(defineProps<WellLocationPickerProps>(), {\n showElevation: true,\n labels: () => ({}),\n});\nconst lat = defineModel<number>('lat', { required: true });\nconst lng = defineModel<number>('lng', { required: true });\nconst elevation = defineModel<number | null>('elevation');\n/**\n * Bound by the parent: the parent's value wins. Unbound: `defineModel`\n * keeps a local value, `undefined` until the first toggle, so the\n * configured format applies until then.\n */\nconst formatModel = defineModel<CoordFormat>('format');\n\nconst config = useWelldotConfig();\nconst text = useWellText();\nconst { unit: lengthUnit } = useWellUnits('length');\n\nconst format = computed<CoordFormat>({\n get: () => formatModel.value ?? config.coordinateFormat,\n set: value => {\n if (value) formatModel.value = value;\n },\n});\n\nconst FORMAT_OPTIONS: Array<{ label: string; value: CoordFormat }> = [\n { label: 'DD', value: 'DD' },\n { label: 'DMS', value: 'DMS' },\n];\n\nconst elevationLabel = computed(() => {\n const label = text(props.labels.elevation);\n return label ? `${label} (${lengthUnit.value})` : undefined;\n});\nconst hintText = computed(() => text(props.labels.hint));\n</script>\n\n<template>\n <div class=\"flex flex-col gap-5\">\n <WellLabeledField :label=\"labels.coordinates\">\n <div class=\"flex items-center\">\n <SelectButton\n v-model=\"format\"\n :options=\"FORMAT_OPTIONS\"\n option-label=\"label\"\n option-value=\"value\"\n :allow-empty=\"false\"\n class=\"w-auto h-8 gap-0!\"\n :pt=\"{\n pcToggleButton: {\n root: 'font-mono text-xs h-7 p-0 border-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1',\n content: 'px-2 py-0 rounded-full',\n },\n }\"\n size=\"small\"\n />\n </div>\n </WellLabeledField>\n\n <div class=\"grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-4\">\n <WellLabeledField :label=\"labels.latitude\">\n <WellCoordinateInput v-model=\"lat\" axis=\"lat\" :format=\"format\" />\n </WellLabeledField>\n\n <WellLabeledField :label=\"labels.longitude\">\n <WellCoordinateInput v-model=\"lng\" axis=\"lng\" :format=\"format\" />\n </WellLabeledField>\n\n <WellLabeledField v-if=\"showElevation\" :label=\"elevationLabel\">\n <WellUnitInput\n v-model=\"elevation\"\n unit-type=\"length\"\n class=\"w-full\"\n :max-fraction-digits=\"3\"\n />\n </WellLabeledField>\n </div>\n\n <div class=\"flex flex-col gap-1\">\n <span\n v-if=\"hintText\"\n class=\"text-[10px] font-semibold tracking-widest uppercase text-content-400\"\n >\n {{ hintText }}\n </span>\n <WellLocationMap v-model:lat=\"lat\" v-model:lng=\"lng\" />\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useWelldotConfig as e } from "../config.js";
|
|
2
|
+
import { useWellText as t } from "../composables/useWellText.js";
|
|
3
|
+
import { useWellUnits as n } from "../composables/useWellUnits.js";
|
|
4
|
+
import r from "../components/WellLabeledField.js";
|
|
5
|
+
import i from "../components/WellUnitInput.js";
|
|
6
|
+
import a from "./WellCoordinateInput.js";
|
|
7
|
+
import o from "./WellLocationMap.js";
|
|
8
|
+
import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeModels as m, openBlock as h, toDisplayString as g, unref as _, useModel as v, withCtx as y } from "vue";
|
|
9
|
+
import b from "primevue/selectbutton";
|
|
10
|
+
//#region src/location/WellLocationPicker.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var x = { class: "flex flex-col gap-5" }, S = { class: "flex items-center" }, C = { class: "grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-4" }, w = { class: "flex flex-col gap-1" }, T = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-[10px] font-semibold tracking-widest uppercase text-content-400"
|
|
14
|
+
}, E = /* @__PURE__ */ p({
|
|
15
|
+
__name: "WellLocationPicker",
|
|
16
|
+
props: /* @__PURE__ */ m({
|
|
17
|
+
showElevation: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !0
|
|
20
|
+
},
|
|
21
|
+
labels: { default: () => ({}) }
|
|
22
|
+
}, {
|
|
23
|
+
lat: { required: !0 },
|
|
24
|
+
latModifiers: {},
|
|
25
|
+
lng: { required: !0 },
|
|
26
|
+
lngModifiers: {},
|
|
27
|
+
elevation: {},
|
|
28
|
+
elevationModifiers: {},
|
|
29
|
+
format: {},
|
|
30
|
+
formatModifiers: {}
|
|
31
|
+
}),
|
|
32
|
+
emits: [
|
|
33
|
+
"update:lat",
|
|
34
|
+
"update:lng",
|
|
35
|
+
"update:elevation",
|
|
36
|
+
"update:format"
|
|
37
|
+
],
|
|
38
|
+
setup(p) {
|
|
39
|
+
let m = p, E = v(p, "lat"), D = v(p, "lng"), O = v(p, "elevation"), k = v(p, "format"), A = e(), j = t(), { unit: M } = n("length"), N = s({
|
|
40
|
+
get: () => k.value ?? A.coordinateFormat,
|
|
41
|
+
set: (e) => {
|
|
42
|
+
e && (k.value = e);
|
|
43
|
+
}
|
|
44
|
+
}), P = [{
|
|
45
|
+
label: "DD",
|
|
46
|
+
value: "DD"
|
|
47
|
+
}, {
|
|
48
|
+
label: "DMS",
|
|
49
|
+
value: "DMS"
|
|
50
|
+
}], F = s(() => {
|
|
51
|
+
let e = j(m.labels.elevation);
|
|
52
|
+
return e ? `${e} (${M.value})` : void 0;
|
|
53
|
+
}), I = s(() => j(m.labels.hint));
|
|
54
|
+
return (e, t) => (h(), u("div", x, [
|
|
55
|
+
f(r, { label: p.labels.coordinates }, {
|
|
56
|
+
default: y(() => [d("div", S, [f(_(b), {
|
|
57
|
+
modelValue: N.value,
|
|
58
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => N.value = e),
|
|
59
|
+
options: P,
|
|
60
|
+
"option-label": "label",
|
|
61
|
+
"option-value": "value",
|
|
62
|
+
"allow-empty": !1,
|
|
63
|
+
class: "w-auto h-8 gap-0!",
|
|
64
|
+
pt: { pcToggleButton: {
|
|
65
|
+
root: "font-mono text-xs h-7 p-0 border-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1",
|
|
66
|
+
content: "px-2 py-0 rounded-full"
|
|
67
|
+
} },
|
|
68
|
+
size: "small"
|
|
69
|
+
}, null, 8, ["modelValue"])])]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["label"]),
|
|
72
|
+
d("div", C, [
|
|
73
|
+
f(r, { label: p.labels.latitude }, {
|
|
74
|
+
default: y(() => [f(a, {
|
|
75
|
+
modelValue: E.value,
|
|
76
|
+
"onUpdate:modelValue": t[1] || (t[1] = (e) => E.value = e),
|
|
77
|
+
axis: "lat",
|
|
78
|
+
format: N.value
|
|
79
|
+
}, null, 8, ["modelValue", "format"])]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["label"]),
|
|
82
|
+
f(r, { label: p.labels.longitude }, {
|
|
83
|
+
default: y(() => [f(a, {
|
|
84
|
+
modelValue: D.value,
|
|
85
|
+
"onUpdate:modelValue": t[2] || (t[2] = (e) => D.value = e),
|
|
86
|
+
axis: "lng",
|
|
87
|
+
format: N.value
|
|
88
|
+
}, null, 8, ["modelValue", "format"])]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["label"]),
|
|
91
|
+
p.showElevation ? (h(), c(r, {
|
|
92
|
+
key: 0,
|
|
93
|
+
label: F.value
|
|
94
|
+
}, {
|
|
95
|
+
default: y(() => [f(i, {
|
|
96
|
+
modelValue: O.value,
|
|
97
|
+
"onUpdate:modelValue": t[3] || (t[3] = (e) => O.value = e),
|
|
98
|
+
"unit-type": "length",
|
|
99
|
+
class: "w-full",
|
|
100
|
+
"max-fraction-digits": 3
|
|
101
|
+
}, null, 8, ["modelValue"])]),
|
|
102
|
+
_: 1
|
|
103
|
+
}, 8, ["label"])) : l("", !0)
|
|
104
|
+
]),
|
|
105
|
+
d("div", w, [I.value ? (h(), u("span", T, g(I.value), 1)) : l("", !0), f(o, {
|
|
106
|
+
lat: E.value,
|
|
107
|
+
"onUpdate:lat": t[4] || (t[4] = (e) => E.value = e),
|
|
108
|
+
lng: D.value,
|
|
109
|
+
"onUpdate:lng": t[5] || (t[5] = (e) => D.value = e)
|
|
110
|
+
}, null, 8, ["lat", "lng"])])
|
|
111
|
+
]));
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
//#endregion
|
|
115
|
+
export { E as default };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=WellLocationPicker.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WellLocationPicker.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../src/location/WellLocationPicker.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Location editor: DD/DMS toggle, latitude/longitude text inputs, optional\n * elevation (in the configured length unit) and a map to click or drag the\n * pin. Coordinates are decimal degrees; elevation is canonical metres.\n *\n * `v-model:format` is optional. Unbound, the format follows\n * `createWelldot({ coordinateFormat })` until the user toggles it, after\n * which it is kept as local state (and `update:format` is still emitted).\n *\n * Text comes from `labels`; an omitted label is not rendered. The only\n * built-in text is locale-independent (`DD`/`DMS`, placeholder examples).\n */\nimport type { CoordFormat } from '@welldot/utils';\nimport SelectButton from 'primevue/selectbutton';\nimport { computed } from 'vue';\nimport WellLabeledField from '../components/WellLabeledField.vue';\nimport WellUnitInput from '../components/WellUnitInput.vue';\nimport { useWellText } from '../composables/useWellText';\nimport { useWellUnits } from '../composables/useWellUnits';\nimport { useWelldotConfig } from '../config';\nimport type { WellLocationPickerProps } from './location';\nimport WellCoordinateInput from './WellCoordinateInput.vue';\nimport WellLocationMap from './WellLocationMap.vue';\n\nconst props = withDefaults(defineProps<WellLocationPickerProps>(), {\n showElevation: true,\n labels: () => ({}),\n});\nconst lat = defineModel<number>('lat', { required: true });\nconst lng = defineModel<number>('lng', { required: true });\nconst elevation = defineModel<number | null>('elevation');\n/**\n * Bound by the parent: the parent's value wins. Unbound: `defineModel`\n * keeps a local value, `undefined` until the first toggle, so the\n * configured format applies until then.\n */\nconst formatModel = defineModel<CoordFormat>('format');\n\nconst config = useWelldotConfig();\nconst text = useWellText();\nconst { unit: lengthUnit } = useWellUnits('length');\n\nconst format = computed<CoordFormat>({\n get: () => formatModel.value ?? config.coordinateFormat,\n set: value => {\n if (value) formatModel.value = value;\n },\n});\n\nconst FORMAT_OPTIONS: Array<{ label: string; value: CoordFormat }> = [\n { label: 'DD', value: 'DD' },\n { label: 'DMS', value: 'DMS' },\n];\n\nconst elevationLabel = computed(() => {\n const label = text(props.labels.elevation);\n return label ? `${label} (${lengthUnit.value})` : undefined;\n});\nconst hintText = computed(() => text(props.labels.hint));\n</script>\n\n<template>\n <div class=\"flex flex-col gap-5\">\n <WellLabeledField :label=\"labels.coordinates\">\n <div class=\"flex items-center\">\n <SelectButton\n v-model=\"format\"\n :options=\"FORMAT_OPTIONS\"\n option-label=\"label\"\n option-value=\"value\"\n :allow-empty=\"false\"\n class=\"w-auto h-8 gap-0!\"\n :pt=\"{\n pcToggleButton: {\n root: 'font-mono text-xs h-7 p-0 border-none bg-transparent outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1',\n content: 'px-2 py-0 rounded-full',\n },\n }\"\n size=\"small\"\n />\n </div>\n </WellLabeledField>\n\n <div class=\"grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-4\">\n <WellLabeledField :label=\"labels.latitude\">\n <WellCoordinateInput v-model=\"lat\" axis=\"lat\" :format=\"format\" />\n </WellLabeledField>\n\n <WellLabeledField :label=\"labels.longitude\">\n <WellCoordinateInput v-model=\"lng\" axis=\"lng\" :format=\"format\" />\n </WellLabeledField>\n\n <WellLabeledField v-if=\"showElevation\" :label=\"elevationLabel\">\n <WellUnitInput\n v-model=\"elevation\"\n unit-type=\"length\"\n class=\"w-full\"\n :max-fraction-digits=\"3\"\n />\n </WellLabeledField>\n </div>\n\n <div class=\"flex flex-col gap-1\">\n <span\n v-if=\"hintText\"\n class=\"text-[10px] font-semibold tracking-widest uppercase text-content-400\"\n >\n {{ hintText }}\n </span>\n <WellLocationMap v-model:lat=\"lat\" v-model:lng=\"lng\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBA,IAAM,IAAQ,GAIR,IAAM,EAAmB,GAAC,MAA0B,EACpD,IAAM,EAAmB,GAAC,MAA0B,EACpD,IAAY,EAA0B,GAAC,YAAY,EAMnD,IAAc,EAAwB,GAAC,SAAS,EAEhD,IAAS,GAAkB,EAC3B,IAAO,GAAa,EACpB,EAAE,MAAM,MAAe,EAAa,SAAS,EAE7C,IAAS,EAAsB;GACnC,WAAW,EAAY,SAAS,EAAO;GACvC,MAAK,MAAS;AACZ,IAAI,MAAO,EAAY,QAAQ;;GAElC,CAAC,EAEI,IAA+D,CACnE;GAAE,OAAO;GAAM,OAAO;GAAM,EAC5B;GAAE,OAAO;GAAO,OAAO;GAAO,CAC/B,EAEK,IAAiB,QAAe;GACpC,IAAM,IAAQ,EAAK,EAAM,OAAO,UAAU;AAC1C,UAAO,IAAQ,GAAG,EAAM,IAAI,EAAW,MAAM,KAAK,KAAA;IAClD,EACI,IAAW,QAAe,EAAK,EAAM,OAAO,KAAK,CAAC;yBAItD,EAiDM,OAjDN,GAiDM;GAhDJ,EAkBmB,GAAA,EAlBA,OAAO,EAAA,OAAO,aAAA,EAAA;qBAiBzB,CAhBN,EAgBM,OAhBN,GAgBM,CAfJ,EAcE,EAAA,EAAA,EAAA;iBAbS,EAAA;qDAAM,QAAA;KACd,SAAS;KACV,gBAAa;KACb,gBAAa;KACZ,eAAa;KACd,OAAM;KACL,IAAI,EAAA,gBAAA;;;QAKJ;KACD,MAAK;;;;GAKX,EAiBM,OAjBN,GAiBM;IAhBJ,EAEmB,GAAA,EAFA,OAAO,EAAA,OAAO,UAAA,EAAA;sBACkC,CAAjE,EAAiE,GAAA;kBAAnC,EAAA;sDAAG,QAAA;MAAE,MAAK;MAAO,QAAQ,EAAA;;;;IAGzD,EAEmB,GAAA,EAFA,OAAO,EAAA,OAAO,WAAA,EAAA;sBACkC,CAAjE,EAAiE,GAAA;kBAAnC,EAAA;sDAAG,QAAA;MAAE,MAAK;MAAO,QAAQ,EAAA;;;;IAGjC,EAAA,iBAAA,GAAA,EAAxB,EAOmB,GAAA;;KAPqB,OAAO,EAAA;;sBAM3C,CALF,EAKE,GAAA;kBAJS,EAAA;sDAAS,QAAA;MAClB,aAAU;MACV,OAAM;MACL,uBAAqB;;;;;GAK5B,EAQM,OARN,GAQM,CANI,EAAA,SAAA,GAAA,EADR,EAKO,QALP,GAKO,EADF,EAAA,MAAQ,EAAA,EAAA,IAAA,EAAA,IAAA,GAAA,EAEb,EAAuD,GAAA;IAA9B,KAAK,EAAA;6CAAG,QAAA;IAAU,KAAK,EAAA;6CAAG,QAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as WellCoordinateInput } from './WellCoordinateInput';
|
|
2
|
+
export { default as WellLocationMap } from './WellLocationMap';
|
|
3
|
+
export { default as WellLocationPicker } from './WellLocationPicker';
|
|
4
|
+
export { COORDINATE_PLACEHOLDERS, DEFAULT_TILE_ATTRIBUTION, DEFAULT_TILE_URL, } from './location';
|
|
5
|
+
export type { CoordFormat, CoordinateAxis, WellCoordinateInputProps, WellLocationMapProps, WellLocationPickerLabelKey, WellLocationPickerLabels, WellLocationPickerProps, } from './location';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/location/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { COORDINATE_PLACEHOLDERS as e, DEFAULT_TILE_ATTRIBUTION as t, DEFAULT_TILE_URL as n } from "./location.js";
|
|
2
|
+
import r from "./WellCoordinateInput.js";
|
|
3
|
+
import i from "./WellLocationMap.js";
|
|
4
|
+
import a from "./WellLocationPicker.js";
|
|
5
|
+
export { e as COORDINATE_PLACEHOLDERS, t as DEFAULT_TILE_ATTRIBUTION, n as DEFAULT_TILE_URL, r as WellCoordinateInput, i as WellLocationMap, a as WellLocationPicker };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { LanguageTextInput } from '@welldot/core';
|
|
2
|
+
import { CoordFormat } from '@welldot/utils';
|
|
3
|
+
export type { CoordFormat } from '@welldot/utils';
|
|
4
|
+
/** Which coordinate a `WellCoordinateInput` edits. */
|
|
5
|
+
export type CoordinateAxis = 'lat' | 'lng';
|
|
6
|
+
/**
|
|
7
|
+
* Built-in, locale-independent placeholder examples, one per axis and format.
|
|
8
|
+
* They are valid inputs and round-trip through `parseToDd`/`formatCoord`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const COORDINATE_PLACEHOLDERS: Readonly<Record<CoordinateAxis, Readonly<Record<CoordFormat, string>>>>;
|
|
11
|
+
/** Default tile layer of `WellLocationMap` (OpenStreetMap). */
|
|
12
|
+
export declare const DEFAULT_TILE_URL = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png";
|
|
13
|
+
/** Attribution matching {@link DEFAULT_TILE_URL}. */
|
|
14
|
+
export declare const DEFAULT_TILE_ATTRIBUTION = "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors";
|
|
15
|
+
/** Text of `WellLocationPicker`. An omitted label is not rendered. */
|
|
16
|
+
export interface WellLocationPickerLabels {
|
|
17
|
+
/** Label above the DD/DMS toggle. */
|
|
18
|
+
coordinates?: LanguageTextInput;
|
|
19
|
+
latitude?: LanguageTextInput;
|
|
20
|
+
longitude?: LanguageTextInput;
|
|
21
|
+
/** Elevation label; the length unit is appended, e.g. `Elevation (m)`. */
|
|
22
|
+
elevation?: LanguageTextInput;
|
|
23
|
+
/** Hint above the map, e.g. "Click the map or drag the pin". */
|
|
24
|
+
hint?: LanguageTextInput;
|
|
25
|
+
}
|
|
26
|
+
export type WellLocationPickerLabelKey = keyof WellLocationPickerLabels;
|
|
27
|
+
/** Props of `WellCoordinateInput` (besides `v-model`). */
|
|
28
|
+
export interface WellCoordinateInputProps {
|
|
29
|
+
axis: CoordinateAxis;
|
|
30
|
+
/** Display format. Falls back to `createWelldot({ coordinateFormat })`. */
|
|
31
|
+
format?: CoordFormat;
|
|
32
|
+
/** Overrides the built-in example ({@link COORDINATE_PLACEHOLDERS}). */
|
|
33
|
+
placeholder?: LanguageTextInput;
|
|
34
|
+
}
|
|
35
|
+
/** Props of `WellLocationMap` (besides `v-model:lat` / `v-model:lng`). */
|
|
36
|
+
export interface WellLocationMapProps {
|
|
37
|
+
/** Display only: no pin dragging or click-to-place. */
|
|
38
|
+
readonly?: boolean;
|
|
39
|
+
/** Tile URL template. Read once on mount. Default OpenStreetMap. */
|
|
40
|
+
tileUrl?: string;
|
|
41
|
+
/** Tile attribution HTML. Read once on mount. */
|
|
42
|
+
attribution?: string;
|
|
43
|
+
/** CSS height of the map. Default `16rem`. */
|
|
44
|
+
height?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Props of `WellLocationPicker` (besides its models). */
|
|
47
|
+
export interface WellLocationPickerProps {
|
|
48
|
+
/** Shows the elevation input. Default `true`. */
|
|
49
|
+
showElevation?: boolean;
|
|
50
|
+
labels?: WellLocationPickerLabels;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Inline SVG pin for the leaflet `divIcon`. Its fill follows the theme's
|
|
54
|
+
* primary colour through the `.well-location-marker` styles of
|
|
55
|
+
* `WellLocationMap`; the tip is at the bottom centre (12, 36 of 24×36).
|
|
56
|
+
*/
|
|
57
|
+
export declare const MARKER_SVG: string;
|
|
58
|
+
/** `[width, height]` of the marker and the anchor at the pin's tip. */
|
|
59
|
+
export declare const MARKER_SIZE: [number, number];
|
|
60
|
+
export declare const MARKER_ANCHOR: [number, number];
|
|
61
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/location/location.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,CAI7D,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,uDACyB,CAAC;AAEvD,qDAAqD;AACrD,eAAO,MAAM,wBAAwB,8FACsD,CAAC;AAE5F,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,gEAAgE;IAChE,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,wBAAwB,CAAC;AAExE,0DAA0D;AAC1D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,0EAA0E;AAC1E,MAAM,WAAW,oBAAoB;IACnC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0DAA0D;AAC1D,MAAM,WAAW,uBAAuB;IACtC,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,wBAAwB,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAIb,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAY,CAAC;AACtD,eAAO,MAAM,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,CAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/location/location.ts
|
|
2
|
+
var e = Object.freeze({
|
|
3
|
+
lat: Object.freeze({
|
|
4
|
+
DD: "-23.512533",
|
|
5
|
+
DMS: "23°30'45.12\"S"
|
|
6
|
+
}),
|
|
7
|
+
lng: Object.freeze({
|
|
8
|
+
DD: "-48.503900",
|
|
9
|
+
DMS: "48°30'14.04\"W"
|
|
10
|
+
})
|
|
11
|
+
}), t = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", n = "© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors", r = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 36\" width=\"28\" height=\"42\" aria-hidden=\"true\" focusable=\"false\"><path class=\"well-location-marker__pin\" d=\"M12 0C5.37 0 0 5.37 0 12c0 8.4 10.2 22.2 10.63 22.78a1.7 1.7 0 0 0 2.74 0C13.8 34.2 24 20.4 24 12 24 5.37 18.63 0 12 0Z\"/><circle class=\"well-location-marker__dot\" cx=\"12\" cy=\"12\" r=\"4.5\"/></svg>", i = [28, 42], a = [14, 41];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as COORDINATE_PLACEHOLDERS, n as DEFAULT_TILE_ATTRIBUTION, t as DEFAULT_TILE_URL, a as MARKER_ANCHOR, i as MARKER_SIZE, r as MARKER_SVG };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","names":[],"sources":["../../src/location/location.ts"],"sourcesContent":["// Shared constants and types of `@welldot/vue/location`. Kept outside the\n// SFCs so they can be exported from the subpath entry.\nimport type { LanguageTextInput } from '@welldot/core';\nimport type { CoordFormat } from '@welldot/utils';\n\nexport type { CoordFormat } from '@welldot/utils';\n\n/** Which coordinate a `WellCoordinateInput` edits. */\nexport type CoordinateAxis = 'lat' | 'lng';\n\n/**\n * Built-in, locale-independent placeholder examples, one per axis and format.\n * They are valid inputs and round-trip through `parseToDd`/`formatCoord`.\n */\nexport const COORDINATE_PLACEHOLDERS: Readonly<\n Record<CoordinateAxis, Readonly<Record<CoordFormat, string>>>\n> = Object.freeze({\n lat: Object.freeze({ DD: '-23.512533', DMS: `23°30'45.12\"S` }),\n lng: Object.freeze({ DD: '-48.503900', DMS: `48°30'14.04\"W` }),\n});\n\n/** Default tile layer of `WellLocationMap` (OpenStreetMap). */\nexport const DEFAULT_TILE_URL =\n 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';\n\n/** Attribution matching {@link DEFAULT_TILE_URL}. */\nexport const DEFAULT_TILE_ATTRIBUTION =\n '© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors';\n\n/** Text of `WellLocationPicker`. An omitted label is not rendered. */\nexport interface WellLocationPickerLabels {\n /** Label above the DD/DMS toggle. */\n coordinates?: LanguageTextInput;\n latitude?: LanguageTextInput;\n longitude?: LanguageTextInput;\n /** Elevation label; the length unit is appended, e.g. `Elevation (m)`. */\n elevation?: LanguageTextInput;\n /** Hint above the map, e.g. \"Click the map or drag the pin\". */\n hint?: LanguageTextInput;\n}\n\nexport type WellLocationPickerLabelKey = keyof WellLocationPickerLabels;\n\n/** Props of `WellCoordinateInput` (besides `v-model`). */\nexport interface WellCoordinateInputProps {\n axis: CoordinateAxis;\n /** Display format. Falls back to `createWelldot({ coordinateFormat })`. */\n format?: CoordFormat;\n /** Overrides the built-in example ({@link COORDINATE_PLACEHOLDERS}). */\n placeholder?: LanguageTextInput;\n}\n\n/** Props of `WellLocationMap` (besides `v-model:lat` / `v-model:lng`). */\nexport interface WellLocationMapProps {\n /** Display only: no pin dragging or click-to-place. */\n readonly?: boolean;\n /** Tile URL template. Read once on mount. Default OpenStreetMap. */\n tileUrl?: string;\n /** Tile attribution HTML. Read once on mount. */\n attribution?: string;\n /** CSS height of the map. Default `16rem`. */\n height?: string;\n}\n\n/** Props of `WellLocationPicker` (besides its models). */\nexport interface WellLocationPickerProps {\n /** Shows the elevation input. Default `true`. */\n showElevation?: boolean;\n labels?: WellLocationPickerLabels;\n}\n\n/**\n * Inline SVG pin for the leaflet `divIcon`. Its fill follows the theme's\n * primary colour through the `.well-location-marker` styles of\n * `WellLocationMap`; the tip is at the bottom centre (12, 36 of 24×36).\n */\nexport const MARKER_SVG =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 36\" width=\"28\" height=\"42\" aria-hidden=\"true\" focusable=\"false\">' +\n '<path class=\"well-location-marker__pin\" d=\"M12 0C5.37 0 0 5.37 0 12c0 8.4 10.2 22.2 10.63 22.78a1.7 1.7 0 0 0 2.74 0C13.8 34.2 24 20.4 24 12 24 5.37 18.63 0 12 0Z\"/>' +\n '<circle class=\"well-location-marker__dot\" cx=\"12\" cy=\"12\" r=\"4.5\"/>' +\n '</svg>';\n\n/** `[width, height]` of the marker and the anchor at the pin's tip. */\nexport const MARKER_SIZE: [number, number] = [28, 42];\nexport const MARKER_ANCHOR: [number, number] = [14, 41];\n"],"mappings":";AAcA,IAAa,IAET,OAAO,OAAO;CAChB,KAAK,OAAO,OAAO;EAAE,IAAI;EAAc,KAAK;EAAiB,CAAC;CAC9D,KAAK,OAAO,OAAO;EAAE,IAAI;EAAc,KAAK;EAAiB,CAAC;CAC/D,CAAC,EAGW,IACX,sDAGW,IACX,6FAiDW,IACX,kYAMW,IAAgC,CAAC,IAAI,GAAG,EACxC,IAAkC,CAAC,IAAI,GAAG"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** Options of `@welldot/vue/nuxt`, under the `welldot` key of `nuxt.config`. */
|
|
2
|
+
export interface WelldotModuleOptions {
|
|
3
|
+
/** Register `WellDataGrid` (`@welldot/vue/grid`). Default `true`. */
|
|
4
|
+
grid?: boolean;
|
|
5
|
+
/** Register the location components (`@welldot/vue/location`). Default `true`. */
|
|
6
|
+
location?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Default `primevue.importTheme` / `importPT` to the Welldot preset and pass
|
|
9
|
+
* through, each only when the app hasn't set it. Default `true`.
|
|
10
|
+
*
|
|
11
|
+
* Pass an object to customize them: `preset` / `pt` are paths (aliases
|
|
12
|
+
* allowed) to files whose default export is merged onto `WelldotPreset` /
|
|
13
|
+
* `welldotPt` with `defineWelldotTheme` / `defineWelldotPt`.
|
|
14
|
+
*/
|
|
15
|
+
theme?: boolean | WelldotThemeFiles;
|
|
16
|
+
/**
|
|
17
|
+
* Wire `createWelldot({ locale })` to `@nuxtjs/i18n`. Default: on when the
|
|
18
|
+
* `@nuxtjs/i18n` module is installed.
|
|
19
|
+
*/
|
|
20
|
+
i18n?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Override files for the `theme` option. */
|
|
23
|
+
export interface WelldotThemeFiles {
|
|
24
|
+
/** File default-exporting `WelldotThemeOverrides` (e.g. `'~/theme/preset'`). */
|
|
25
|
+
preset?: string;
|
|
26
|
+
/** File default-exporting PrimeVue PT overrides (e.g. `'~/theme/pt'`). */
|
|
27
|
+
pt?: string;
|
|
28
|
+
}
|
|
29
|
+
declare module '@nuxt/schema' {
|
|
30
|
+
interface NuxtConfig {
|
|
31
|
+
welldot?: WelldotModuleOptions;
|
|
32
|
+
}
|
|
33
|
+
interface NuxtOptions {
|
|
34
|
+
welldot?: WelldotModuleOptions;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Component names per entry point. Names are registered as-is (no prefix). */
|
|
38
|
+
export declare const WELLDOT_COMPONENTS: {
|
|
39
|
+
readonly '@welldot/vue': readonly ["WellLabeledField", "WellChip", "WellTagSelect", "WellComboSelect", "WellInfoPopover", "WellInputNumber", "WellUnitInput", "WellTextureThumbnail", "WellTextureSelect"];
|
|
40
|
+
readonly '@welldot/vue/grid': readonly ["WellDataGrid"];
|
|
41
|
+
readonly '@welldot/vue/location': readonly ["WellCoordinateInput", "WellLocationMap", "WellLocationPicker"];
|
|
42
|
+
};
|
|
43
|
+
/** Auto-imported from `@welldot/vue`. */
|
|
44
|
+
export declare const WELLDOT_IMPORTS: readonly ["createWelldot", "useWelldotConfig", "useWellText", "useWellUnits", "useWellNumberFormat"];
|
|
45
|
+
/**
|
|
46
|
+
* The PrimeVue module emits `import <as> from '<from>'` (a default import),
|
|
47
|
+
* while `@welldot/vue/theme` only has named exports. These generated files
|
|
48
|
+
* re-export them as defaults, merged with the app's override file if any.
|
|
49
|
+
*/
|
|
50
|
+
declare const THEME_TEMPLATES: {
|
|
51
|
+
readonly importTheme: {
|
|
52
|
+
readonly filename: "welldot/primevue-theme.mjs";
|
|
53
|
+
readonly as: "WelldotPreset";
|
|
54
|
+
readonly named: "WelldotPreset";
|
|
55
|
+
readonly define: "defineWelldotTheme";
|
|
56
|
+
readonly file: "preset";
|
|
57
|
+
};
|
|
58
|
+
readonly importPT: {
|
|
59
|
+
readonly filename: "welldot/primevue-pt.mjs";
|
|
60
|
+
readonly as: "welldotPt";
|
|
61
|
+
readonly named: "welldotPt";
|
|
62
|
+
readonly define: "defineWelldotPt";
|
|
63
|
+
readonly file: "pt";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/** Contents of a theme shim; `overrides` is the resolved override file. */
|
|
67
|
+
export declare function themeTemplateContents(key: ThemeKey, overrides?: string): string;
|
|
68
|
+
type ThemeKey = keyof typeof THEME_TEMPLATES;
|
|
69
|
+
/**
|
|
70
|
+
* Matches the package's built files under `distDir`, except the Nuxt runtime
|
|
71
|
+
* (`nuxt/runtime/`), for `imports.transform.exclude`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function distExcludePattern(distDir: string): RegExp;
|
|
74
|
+
declare const _default: import('@nuxt/schema').NuxtModule<WelldotModuleOptions, WelldotModuleOptions, false>;
|
|
75
|
+
export default _default;
|
|
76
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/nuxt/module.ts"],"names":[],"mappings":"AAYA,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC;IACpC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,UAAU;QAClB,OAAO,CAAC,EAAE,oBAAoB,CAAC;KAChC;IACD,UAAU,WAAW;QACnB,OAAO,CAAC,EAAE,oBAAoB,CAAC;KAChC;CACF;AAMD,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;CAkBrB,CAAC;AAEX,yCAAyC;AACzC,eAAO,MAAM,eAAe,sGAMlB,CAAC;AAaX;;;;GAIG;AACH,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;CAeX,CAAC;AAEX,2EAA2E;AAC3E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,UAUtE;AAED,KAAK,QAAQ,GAAG,MAAM,OAAO,eAAe,CAAC;AAkC7C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI1D;;AAED,wBAsFG"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { addComponent as e, addImports as t, addPlugin as n, addTemplate as r, createResolver as i, defineNuxtModule as a, hasNuxtModule as o, resolvePath as s } from "@nuxt/kit";
|
|
2
|
+
//#region src/nuxt/module.ts
|
|
3
|
+
var c = "@welldot/vue", l = "@primevue/nuxt-module", u = "@nuxtjs/i18n", d = {
|
|
4
|
+
"@welldot/vue": [
|
|
5
|
+
"WellLabeledField",
|
|
6
|
+
"WellChip",
|
|
7
|
+
"WellTagSelect",
|
|
8
|
+
"WellComboSelect",
|
|
9
|
+
"WellInfoPopover",
|
|
10
|
+
"WellInputNumber",
|
|
11
|
+
"WellUnitInput",
|
|
12
|
+
"WellTextureThumbnail",
|
|
13
|
+
"WellTextureSelect"
|
|
14
|
+
],
|
|
15
|
+
"@welldot/vue/grid": ["WellDataGrid"],
|
|
16
|
+
"@welldot/vue/location": [
|
|
17
|
+
"WellCoordinateInput",
|
|
18
|
+
"WellLocationMap",
|
|
19
|
+
"WellLocationPicker"
|
|
20
|
+
]
|
|
21
|
+
}, f = [
|
|
22
|
+
"createWelldot",
|
|
23
|
+
"useWelldotConfig",
|
|
24
|
+
"useWellText",
|
|
25
|
+
"useWellUnits",
|
|
26
|
+
"useWellNumberFormat"
|
|
27
|
+
], p = {
|
|
28
|
+
importTheme: {
|
|
29
|
+
filename: "welldot/primevue-theme.mjs",
|
|
30
|
+
as: "WelldotPreset",
|
|
31
|
+
named: "WelldotPreset",
|
|
32
|
+
define: "defineWelldotTheme",
|
|
33
|
+
file: "preset"
|
|
34
|
+
},
|
|
35
|
+
importPT: {
|
|
36
|
+
filename: "welldot/primevue-pt.mjs",
|
|
37
|
+
as: "welldotPt",
|
|
38
|
+
named: "welldotPt",
|
|
39
|
+
define: "defineWelldotPt",
|
|
40
|
+
file: "pt"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
function m(e, t) {
|
|
44
|
+
let { named: n, define: r } = p[e];
|
|
45
|
+
return t ? [
|
|
46
|
+
`import { ${r} } from '@welldot/vue/theme';`,
|
|
47
|
+
`import overrides from ${JSON.stringify(t)};`,
|
|
48
|
+
`export default ${r}(overrides);`,
|
|
49
|
+
""
|
|
50
|
+
].join("\n") : `export { ${n} as default } from '@welldot/vue/theme';\n`;
|
|
51
|
+
}
|
|
52
|
+
var h = Object.keys(p);
|
|
53
|
+
function g(e, t) {
|
|
54
|
+
let { filename: n, as: r } = p[t];
|
|
55
|
+
return {
|
|
56
|
+
from: `${e.options.buildDir}/${n}`,
|
|
57
|
+
as: r
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function _(e) {
|
|
61
|
+
let t = e.options.primevue;
|
|
62
|
+
return t && typeof t == "object" ? t : void 0;
|
|
63
|
+
}
|
|
64
|
+
function v(e) {
|
|
65
|
+
for (let t of e.options.modules) if (Array.isArray(t) && typeof t[0] == "string" && t[0].startsWith(`${c}/nuxt`)) {
|
|
66
|
+
let e = t[1];
|
|
67
|
+
if (e?.theme !== void 0) return e.theme !== !1;
|
|
68
|
+
}
|
|
69
|
+
return e.options.welldot?.theme !== !1;
|
|
70
|
+
}
|
|
71
|
+
function y(e) {
|
|
72
|
+
let t = e.replace(/\\/g, "/").replace(/\/+$/, "").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
73
|
+
return RegExp(`^${t}/(?!nuxt/runtime/)`);
|
|
74
|
+
}
|
|
75
|
+
var b = a({
|
|
76
|
+
meta: {
|
|
77
|
+
name: c,
|
|
78
|
+
configKey: "welldot",
|
|
79
|
+
compatibility: { nuxt: ">=3.15.0" }
|
|
80
|
+
},
|
|
81
|
+
defaults: {
|
|
82
|
+
grid: !0,
|
|
83
|
+
location: !0,
|
|
84
|
+
theme: !0
|
|
85
|
+
},
|
|
86
|
+
moduleDependencies(e) {
|
|
87
|
+
return v(e) ? { [l]: {
|
|
88
|
+
optional: !0,
|
|
89
|
+
defaults: {
|
|
90
|
+
importTheme: g(e, "importTheme"),
|
|
91
|
+
importPT: g(e, "importPT")
|
|
92
|
+
}
|
|
93
|
+
} } : {};
|
|
94
|
+
},
|
|
95
|
+
setup(a, v) {
|
|
96
|
+
var b;
|
|
97
|
+
let x = i(import.meta.url), S = ["@welldot/vue"];
|
|
98
|
+
a.grid !== !1 && S.push("@welldot/vue/grid"), a.location !== !1 && S.push("@welldot/vue/location");
|
|
99
|
+
for (let t of S) for (let n of d[t]) e({
|
|
100
|
+
name: n,
|
|
101
|
+
export: n,
|
|
102
|
+
filePath: t
|
|
103
|
+
});
|
|
104
|
+
t(f.map((e) => ({
|
|
105
|
+
name: e,
|
|
106
|
+
from: c
|
|
107
|
+
}))), v.options.build.transpile.push(c);
|
|
108
|
+
let C = (b = v.options).imports ?? (b.imports = {}), w = C.transform ?? (C.transform = {});
|
|
109
|
+
if ((w.exclude ?? (w.exclude = [])).push(y(x.resolve(".."))), a.theme !== !1 && o(l, v)) {
|
|
110
|
+
let e = typeof a.theme == "object" ? a.theme : {}, t = _(v) ?? (v.options.primevue = {});
|
|
111
|
+
for (let n of h) {
|
|
112
|
+
let i = g(v, n);
|
|
113
|
+
if (t[n] || (t[n] = i), t[n]?.from === i.from) {
|
|
114
|
+
let t = e[p[n].file];
|
|
115
|
+
r({
|
|
116
|
+
filename: p[n].filename,
|
|
117
|
+
getContents: async () => m(n, t ? await s(t, { cwd: v.options.rootDir }) : void 0),
|
|
118
|
+
write: !0
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
(a.i18n ?? o(u, v)) && n(x.resolve("./runtime/plugin"));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
//#endregion
|
|
127
|
+
export { d as WELLDOT_COMPONENTS, f as WELLDOT_IMPORTS, b as default, y as distExcludePattern, m as themeTemplateContents };
|
|
128
|
+
|
|
129
|
+
//# sourceMappingURL=module.js.map
|