vlite3 1.4.28 → 1.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/components/Carousel/Carousel.vue.d.ts +23 -23
  2. package/components/CategoryManager/CategoryManager.vue2.js +1 -1
  3. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  4. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  5. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  6. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  7. package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
  8. package/components/FilePicker/index.vue.js +2 -4
  9. package/components/Form/Form.vue.d.ts +0 -2
  10. package/components/Form/Form.vue.js +2 -2
  11. package/components/Form/Form.vue2.js +368 -336
  12. package/components/Form/index.vue.d.ts +1 -1
  13. package/components/GoogleMap.vue.d.ts +48 -0
  14. package/components/GoogleMap.vue.js +7 -0
  15. package/components/GoogleMap.vue2.js +164 -0
  16. package/components/NavbarCommandPalette.vue.js +1 -1
  17. package/components/Screen/ScreenFilter.vue.js +1 -1
  18. package/components/Tabes/Tabes.vue.d.ts +10 -1
  19. package/components/Tabes/Tabes.vue.js +1 -1
  20. package/components/Tabes/Tabes.vue2.js +234 -155
  21. package/components/Tabes/tabes.utils.d.ts +14 -0
  22. package/components/Tabes/tabes.utils.js +26 -0
  23. package/components/Tabes/types.d.ts +32 -0
  24. package/components/Workbook/Workbook.vue.d.ts +1 -1
  25. package/core/config.d.ts +6 -0
  26. package/core/index.js +13 -9
  27. package/index.d.ts +1 -0
  28. package/index.js +76 -74
  29. package/package.json +1 -1
  30. package/style.css +1 -1
  31. package/types/GoogleMap.type.d.ts +50 -0
  32. package/types/config.type.d.ts +3 -0
  33. package/types/index.d.ts +1 -0
  34. package/utils/GoogleMapLoader.d.ts +41 -0
  35. package/utils/GoogleMapLoader.js +47 -0
  36. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -35,11 +35,11 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
35
35
  size: InputSize;
36
36
  rounded: InputRounded;
37
37
  readonly: boolean;
38
+ draggable: boolean;
38
39
  disabled: boolean;
39
40
  layout: "table" | "accordion";
40
41
  isUpdate: boolean;
41
42
  modelValue: Record<string, any>[];
42
- draggable: boolean;
43
43
  errors: Record<string, string>;
44
44
  showRowNumbers: boolean;
45
45
  accordionTitleKey: string;
@@ -0,0 +1,48 @@
1
+ import { GoogleMapClickEvent, GoogleMapCoordinate, GoogleMapError, GoogleMapMarker, GoogleMapMarkerClickEvent, GoogleMapProps, GoogleMapReadyEvent } from '../types/GoogleMap.type';
2
+ declare function __VLS_template(): {
3
+ attrs: Partial<{}>;
4
+ slots: {
5
+ loading?(_: {}): any;
6
+ error?(_: {
7
+ error: GoogleMapError;
8
+ }): any;
9
+ };
10
+ refs: {
11
+ mapElement: HTMLDivElement;
12
+ };
13
+ rootEl: HTMLDivElement;
14
+ };
15
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
+ declare const __VLS_component: import('vue').DefineComponent<GoogleMapProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
+ error: (error: GoogleMapError) => any;
18
+ click: (event: GoogleMapClickEvent) => any;
19
+ ready: (event: GoogleMapReadyEvent) => any;
20
+ "center-changed": (center: GoogleMapCoordinate) => any;
21
+ "zoom-changed": (zoom: number) => any;
22
+ "marker-click": (event: GoogleMapMarkerClickEvent) => any;
23
+ }, string, import('vue').PublicProps, Readonly<GoogleMapProps> & Readonly<{
24
+ onError?: (error: GoogleMapError) => any;
25
+ onClick?: (event: GoogleMapClickEvent) => any;
26
+ onReady?: (event: GoogleMapReadyEvent) => any;
27
+ "onCenter-changed"?: (center: GoogleMapCoordinate) => any;
28
+ "onZoom-changed"?: (zoom: number) => any;
29
+ "onMarker-click"?: (event: GoogleMapMarkerClickEvent) => any;
30
+ }>, {
31
+ width: string | number;
32
+ height: string | number;
33
+ options: import('..').GoogleMapOptions;
34
+ zoom: number;
35
+ markers: GoogleMapMarker[];
36
+ ariaLabel: string;
37
+ loadingText: string;
38
+ errorText: string;
39
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
40
+ mapElement: HTMLDivElement;
41
+ }, HTMLDivElement>;
42
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
43
+ export default _default;
44
+ type __VLS_WithTemplateSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,7 @@
1
+ import o from "./GoogleMap.vue2.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0cfbb6c9"]]);
5
+ export {
6
+ c as default
7
+ };
@@ -0,0 +1,164 @@
1
+ import { defineComponent as P, shallowRef as i, computed as u, watch as f, onMounted as Z, onBeforeUnmount as j, openBlock as h, createElementBlock as k, normalizeStyle as q, createElementVNode as D, renderSlot as N, createTextVNode as S, toDisplayString as c, createCommentVNode as L, markRaw as M, nextTick as H } from "vue";
2
+ import { useVLiteConfig as U } from "../core/config.js";
3
+ import { onGoogleMapsAuthFailure as J, loadGoogleMaps as Q } from "../utils/GoogleMapLoader.js";
4
+ const W = ["aria-label", "aria-busy"], X = {
5
+ key: 0,
6
+ class: "vlite-google-map__state",
7
+ role: "status",
8
+ "aria-live": "polite"
9
+ }, Y = {
10
+ key: 1,
11
+ class: "vlite-google-map__state vlite-google-map__state--error",
12
+ role: "alert"
13
+ }, ee = {
14
+ key: 2,
15
+ class: "vlite-google-map__notice",
16
+ "aria-live": "polite"
17
+ }, oe = /* @__PURE__ */ P({
18
+ __name: "GoogleMap",
19
+ props: {
20
+ apiKey: {},
21
+ center: {},
22
+ markers: { default: () => [] },
23
+ zoom: { default: 12 },
24
+ height: { default: "400px" },
25
+ width: { default: "100%" },
26
+ options: { default: () => ({}) },
27
+ ariaLabel: { default: "Interactive Google map" },
28
+ loadingText: { default: "Loading map…" },
29
+ errorText: { default: "The map is unavailable." }
30
+ },
31
+ emits: ["ready", "click", "center-changed", "zoom-changed", "marker-click", "error"],
32
+ setup(d, { emit: F }) {
33
+ const l = d, n = F, K = U(), v = i(null), a = i(null), o = i(null), y = i([]), w = [], x = [], s = i(!0), r = i(null);
34
+ let b = null, _ = !1;
35
+ const O = J((e) => {
36
+ _ || g(e);
37
+ }), C = u(() => l.apiKey?.trim() || K.components?.googleMap?.apiKey?.trim()), R = u(() => ({
38
+ height: A(l.height),
39
+ width: A(l.width)
40
+ }));
41
+ function A(e) {
42
+ return typeof e == "number" ? `${e}px` : e;
43
+ }
44
+ function E(e) {
45
+ if (!e || typeof e != "object") return !1;
46
+ const t = e;
47
+ return Number.isFinite(t.lat) && Number.isFinite(t.lng) && t.lat >= -90 && t.lat <= 90 && t.lng >= -180 && t.lng <= 180;
48
+ }
49
+ const m = u(
50
+ () => l.markers.filter((e) => E(e))
51
+ ), z = u(() => l.markers.length - m.value.length), p = u(() => E(l.center) ? l.center : m.value[0] ?? null);
52
+ function g(e) {
53
+ r.value = e, s.value = !1, n("error", e);
54
+ }
55
+ function T() {
56
+ x.splice(0).forEach((e) => e.remove()), y.value.forEach((e) => {
57
+ o.value?.maps.event.clearInstanceListeners(e), e.setMap(null);
58
+ }), y.value = [];
59
+ }
60
+ function G() {
61
+ !a.value || !o.value || (T(), y.value = m.value.map((e, t) => {
62
+ const I = M(
63
+ new o.value.maps.Marker({
64
+ map: a.value,
65
+ position: { lat: e.lat, lng: e.lng },
66
+ title: e.title,
67
+ label: e.label
68
+ })
69
+ );
70
+ return x.push(
71
+ I.addListener(
72
+ "click",
73
+ ($) => n("marker-click", { marker: e, index: t, nativeEvent: $ })
74
+ )
75
+ ), I;
76
+ }));
77
+ }
78
+ function V() {
79
+ a.value && w.push(
80
+ a.value.addListener("click", (e) => {
81
+ const t = e?.latLng;
82
+ n("click", {
83
+ coordinate: t ? { lat: t.lat(), lng: t.lng() } : null,
84
+ nativeEvent: e
85
+ });
86
+ }),
87
+ a.value.addListener("center_changed", () => {
88
+ const e = a.value?.getCenter();
89
+ e && n("center-changed", { lat: e.lat(), lng: e.lng() });
90
+ }),
91
+ a.value.addListener("zoom_changed", () => {
92
+ const e = a.value?.getZoom();
93
+ typeof e == "number" && n("zoom-changed", e);
94
+ })
95
+ );
96
+ }
97
+ async function B() {
98
+ if (!C.value) {
99
+ g({ code: "invalid-api-key", message: "A Google Maps API key is required." });
100
+ return;
101
+ }
102
+ if (!p.value) {
103
+ g({
104
+ code: l.center == null ? "invalid-markers" : "invalid-center",
105
+ message: "Provide a valid center or at least one valid marker coordinate."
106
+ });
107
+ return;
108
+ }
109
+ s.value = !0, r.value = null;
110
+ try {
111
+ const e = await Q(C.value);
112
+ if (await H(), _ || !v.value || !p.value) return;
113
+ o.value = M(e), a.value = M(
114
+ new e.maps.Map(v.value, {
115
+ ...l.options,
116
+ center: p.value,
117
+ zoom: l.zoom
118
+ })
119
+ ), V(), G(), s.value = !1, n("ready", { map: a.value }), typeof ResizeObserver < "u" && (b = new ResizeObserver(() => {
120
+ a.value && o.value && o.value.maps.event.trigger(a.value, "resize");
121
+ }), b.observe(v.value));
122
+ } catch (e) {
123
+ const t = e;
124
+ g(
125
+ t?.code ? t : { code: "load-failed", message: "Google Maps could not be initialized.", cause: e }
126
+ );
127
+ }
128
+ }
129
+ return f(p, (e) => {
130
+ e && a.value && a.value.setCenter(e);
131
+ }), f(() => l.zoom, (e) => a.value?.setZoom(e)), f(() => l.options, (e) => a.value?.setOptions(e), {
132
+ deep: !0
133
+ }), f(m, G, { deep: !0 }), Z(B), j(() => {
134
+ _ = !0, O(), b?.disconnect(), T(), w.splice(0).forEach((e) => e.remove()), a.value && o.value?.maps.event.clearInstanceListeners(a.value), a.value = null, o.value = null;
135
+ }), (e, t) => (h(), k("div", {
136
+ class: "vlite-google-map",
137
+ style: q(R.value),
138
+ "aria-label": d.ariaLabel,
139
+ "aria-busy": s.value,
140
+ role: "region"
141
+ }, [
142
+ D("div", {
143
+ ref_key: "mapElement",
144
+ ref: v,
145
+ class: "vlite-google-map__canvas",
146
+ tabindex: "0"
147
+ }, null, 512),
148
+ s.value && !r.value ? (h(), k("div", X, [
149
+ N(e.$slots, "loading", {}, () => [
150
+ S(c(d.loadingText), 1)
151
+ ], !0)
152
+ ])) : L("", !0),
153
+ r.value ? (h(), k("div", Y, [
154
+ N(e.$slots, "error", { error: r.value }, () => [
155
+ S(c(d.errorText) + " " + c(r.value.message), 1)
156
+ ], !0)
157
+ ])) : L("", !0),
158
+ z.value ? (h(), k("p", ee, c(z.value) + " invalid marker" + c(z.value === 1 ? "" : "s") + " omitted. ", 1)) : L("", !0)
159
+ ], 12, W));
160
+ }
161
+ });
162
+ export {
163
+ oe as default
164
+ };
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
3
3
  import v from "./Modal.vue.js";
4
4
  import N from "./CommandPalette/CommandPaletteContent.vue.js";
5
5
  import { $t as U } from "../utils/i18n.js";
6
- /* empty css */
6
+ /* empty css */
7
7
  const V = { class: "block truncate -text-fs-1.5" }, S = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, A = /* @__PURE__ */ x({
8
8
  __name: "NavbarCommandPalette",
9
9
  props: {
@@ -16,7 +16,7 @@ import "v-datepicker-lite/style.css";
16
16
  /* empty css */
17
17
  import "@jaames/iro";
18
18
  import "@vueuse/core";
19
- /* empty css */
19
+ /* empty css */
20
20
  import "iconify-icon-picker";
21
21
  import "iconify-icon-picker/style.css";
22
22
  /* empty css */
@@ -1,4 +1,4 @@
1
- import { TabesOption, TabesSize, TabesVariant } from './types';
1
+ import { TabesMenuSelectPayload, TabesOption, TabesSize, TabesVariant } from './types';
2
2
  interface Props {
3
3
  options: TabesOption[];
4
4
  modelValue: string | number;
@@ -12,17 +12,26 @@ interface Props {
12
12
  */
13
13
  wrap?: boolean;
14
14
  tabClass?: string;
15
+ /** Text direction forwarded to menu dropdowns (LTR/RTL). */
16
+ direction?: 'ltr' | 'rtl';
15
17
  }
16
18
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
17
19
  change: (value: string | number) => any;
18
20
  "update:modelValue": (value: string | number) => any;
21
+ "menu-select": (payload: TabesMenuSelectPayload) => any;
22
+ "menu-open": (tab: TabesOption) => any;
23
+ "menu-close": (tab: TabesOption) => any;
19
24
  }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
20
25
  onChange?: (value: string | number) => any;
21
26
  "onUpdate:modelValue"?: (value: string | number) => any;
27
+ "onMenu-select"?: (payload: TabesMenuSelectPayload) => any;
28
+ "onMenu-open"?: (tab: TabesOption) => any;
29
+ "onMenu-close"?: (tab: TabesOption) => any;
22
30
  }>, {
23
31
  variant: TabesVariant;
24
32
  size: TabesSize;
25
33
  block: boolean;
34
+ direction: "ltr" | "rtl";
26
35
  wrap: boolean;
27
36
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
28
37
  scrollRef: HTMLDivElement;
@@ -1,7 +1,7 @@
1
1
  import o from "./Tabes.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2e086e79"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-cdf6b045"]]);
5
5
  export {
6
6
  m as default
7
7
  };