@leaflink/stash 53.4.6 → 53.4.8

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 (58) hide show
  1. package/dist/AppSidebar.js +56 -52
  2. package/dist/AppSidebar.js.map +1 -1
  3. package/dist/AppTopbar.js +1 -1
  4. package/dist/Copy.js +1 -1
  5. package/dist/DataViewFilters.js +1 -1
  6. package/dist/DataViewFilters.js.map +1 -1
  7. package/dist/DataViewToolbar.js +139 -125
  8. package/dist/DataViewToolbar.js.map +1 -1
  9. package/dist/DatePicker.js +1114 -1113
  10. package/dist/DatePicker.js.map +1 -1
  11. package/dist/Modal.js +105 -89
  12. package/dist/Modal.js.map +1 -1
  13. package/dist/Modals.js +30 -26
  14. package/dist/Modals.js.map +1 -1
  15. package/dist/MoreActions.js +294 -288
  16. package/dist/MoreActions.js.map +1 -1
  17. package/dist/PageNavigation.js +1 -1
  18. package/dist/RadioGroup.js +69 -62
  19. package/dist/RadioGroup.js.map +1 -1
  20. package/dist/SearchBar.js +27 -25
  21. package/dist/SearchBar.js.map +1 -1
  22. package/dist/Select.js +103 -101
  23. package/dist/Select.js.map +1 -1
  24. package/dist/Stepper.js +1 -1
  25. package/dist/Tab.js +1 -1
  26. package/dist/Table.js +1 -1
  27. package/dist/Tabs.js +2 -2
  28. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
  29. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
  30. package/dist/Thumbnail.js +42 -42
  31. package/dist/Thumbnail.js.map +1 -1
  32. package/dist/ThumbnailGroup.js +24 -22
  33. package/dist/ThumbnailGroup.js.map +1 -1
  34. package/dist/Timeline.js +15 -13
  35. package/dist/Timeline.js.map +1 -1
  36. package/dist/Toast.vue.d.ts +1 -1
  37. package/dist/Tooltip.js +1 -1
  38. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
  39. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js.map → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js.map} +1 -1
  40. package/dist/components.css +1 -1
  41. package/dist/getContrastingTextColor.d.ts +8 -0
  42. package/dist/index-t9tXBnql.js +469 -0
  43. package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
  44. package/dist/templateRefNarrowing-CeANDylX.js +22 -0
  45. package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
  46. package/dist/useMediaQuery.d.ts +12 -10
  47. package/dist/useMediaQuery.js +7 -29
  48. package/dist/useMediaQuery.js.map +1 -1
  49. package/dist/useSortable.js +1 -1
  50. package/dist/useValidation.d.ts +11 -1
  51. package/dist/useValidation.js +240 -198
  52. package/dist/useValidation.js.map +1 -1
  53. package/dist/utils/getContrastingTextColor.js +36 -24
  54. package/dist/utils/getContrastingTextColor.js.map +1 -1
  55. package/package.json +1 -2
  56. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
  57. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
  58. package/dist/index-DA70nQCT.js +0 -424
@@ -0,0 +1,22 @@
1
+ const o = typeof HTMLElement < "u";
2
+ function l(n) {
3
+ return o && n instanceof HTMLElement ? n : null;
4
+ }
5
+ function c(n) {
6
+ return !o || !n || typeof n != "object" || !("$el" in n) ? !1 : n.$el instanceof HTMLElement;
7
+ }
8
+ function r(n) {
9
+ return c(n) ? n.$el : null;
10
+ }
11
+ function i(n) {
12
+ if (!n || typeof n != "object" || !("calendarRef" in n)) return null;
13
+ const t = n.calendarRef, e = t == null ? void 0 : t.focusDate;
14
+ return typeof e != "function" ? null : (f) => e.call(t, f);
15
+ }
16
+ export {
17
+ r as a,
18
+ i as g,
19
+ c as i,
20
+ l as t
21
+ };
22
+ //# sourceMappingURL=templateRefNarrowing-CeANDylX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateRefNarrowing-CeANDylX.js","sources":["../src/utils/templateRefNarrowing.ts"],"sourcesContent":["/**\n * Type-narrowing helpers for untyped template refs (useTemplateRef() without a type argument).\n * Use these instead of type assertions so types stay accurate and the code follows\n * \"prefer type narrowing over assertions\" (code-patterns.mdc).\n *\n * All helpers are SSR-safe: they return null / false when HTMLElement is not defined (e.g. Node during VitePress SSR).\n */\n\nconst hasHTMLElement = typeof HTMLElement !== 'undefined';\n\n/**\n * Returns the value as an HTMLElement if it is one, otherwise null.\n * Use when a template ref is bound to an HTML element.\n */\nexport function toElement(value: unknown): HTMLElement | null {\n return hasHTMLElement && value instanceof HTMLElement ? value : null;\n}\n\n/**\n * Type guard: true when value is an object with an $el property that is an HTMLElement.\n * Use for template refs bound to Vue component instances (Field, Dropdown, etc.).\n */\nexport function isComponentWithEl(value: unknown): value is { $el: HTMLElement } {\n if (!hasHTMLElement || !value || typeof value !== 'object' || !('$el' in value)) return false;\n\n // Intentional cast: we've confirmed '$el' in value; TypeScript needs this to narrow to { $el: HTMLElement }.\n const el = (value as { $el: unknown }).$el;\n\n return el instanceof HTMLElement;\n}\n\n/**\n * Returns the component's $el if value is a component-with-$el, otherwise null.\n */\nexport function toComponentEl(value: unknown): HTMLElement | null {\n return isComponentWithEl(value) ? value.$el : null;\n}\n\n/**\n * Returns a focusDate-like function if value has calendarRef.focusDate, otherwise null.\n * Use for v-calendar DatePicker refs when calling focusDate. The returned function\n * invokes focusDate with the correct `this` (the calendar ref object) so component\n * methods work when called.\n */\nexport function getCalendarFocusDate(value: unknown): ((date: Date) => void) | null {\n if (!value || typeof value !== 'object' || !('calendarRef' in value)) return null;\n\n const calendar = (value as { calendarRef?: { focusDate?: (d: Date) => void } }).calendarRef;\n const focusDate = calendar?.focusDate;\n\n if (typeof focusDate !== 'function') return null;\n\n return (date: Date) => focusDate.call(calendar, date);\n}\n"],"names":["hasHTMLElement","toElement","value","isComponentWithEl","toComponentEl","getCalendarFocusDate","calendar","focusDate","date"],"mappings":"AAQA,MAAMA,IAAiB,OAAO,cAAgB;AAMvC,SAASC,EAAUC,GAAoC;AAC5D,SAAOF,KAAkBE,aAAiB,cAAcA,IAAQ;AAClE;AAMO,SAASC,EAAkBD,GAA+C;AAC/E,SAAI,CAACF,KAAkB,CAACE,KAAS,OAAOA,KAAU,YAAY,EAAE,SAASA,KAAe,KAG5EA,EAA2B,eAElB;AACvB;AAKO,SAASE,EAAcF,GAAoC;AAChE,SAAOC,EAAkBD,CAAK,IAAIA,EAAM,MAAM;AAChD;AAQO,SAASG,EAAqBH,GAA+C;AAClF,MAAI,CAACA,KAAS,OAAOA,KAAU,YAAY,EAAE,iBAAiBA,GAAQ,QAAO;AAE7E,QAAMI,IAAYJ,EAA8D,aAC1EK,IAAYD,KAAA,gBAAAA,EAAU;AAE5B,SAAI,OAAOC,KAAc,aAAmB,OAErC,CAACC,MAAeD,EAAU,KAAKD,GAAUE,CAAI;AACtD;"}
@@ -1,16 +1,18 @@
1
- import { ComputedRef } from 'vue';
2
- import { MaybeRefOrGetter } from 'vue';
3
- import { Ref } from 'vue';
4
-
5
- export declare interface QueryCacheItem {
6
- hasMatches: Ref<boolean>;
7
- mediaQueryList: MediaQueryList;
8
- }
1
+ import { provideSSRWidth } from '@vueuse/core';
2
+ import { useMediaQuery } from '@vueuse/core';
3
+ import { useSSRWidth } from '@vueuse/core';
9
4
 
10
5
  /**
11
- * Given a media query, this composable returns a reactive boolean indicating if the current window dimensions match the media query.
6
+ * No-op for backwards compatibility with test setup. VueUse's useMediaQuery does not
7
+ * use a shared cache, so there is nothing to clear.
12
8
  */
13
- declare function useMediaQuery(query: MaybeRefOrGetter<string>): ComputedRef<boolean>;
9
+ export declare function clearQueryCache(): void;
10
+
11
+ export { provideSSRWidth }
12
+
14
13
  export default useMediaQuery;
14
+ export { useMediaQuery }
15
+
16
+ export { useSSRWidth }
15
17
 
16
18
  export { }
@@ -1,33 +1,11 @@
1
- import { toValue as t, ref as h, watch as d, onScopeDispose as m, computed as u } from "vue";
2
- const s = /* @__PURE__ */ new Map();
3
- function f(e) {
4
- s.has(t(e)) || s.set(t(e), {
5
- hasMatches: h(!1),
6
- mediaQueryList: window.matchMedia(t(e))
7
- });
8
- const a = s.get(t(e));
9
- function n(i) {
10
- a.hasMatches.value = i.matches;
11
- }
12
- function c() {
13
- var i;
14
- typeof ((i = a.mediaQueryList) == null ? void 0 : i.removeEventListener) == "function" && a.mediaQueryList.removeEventListener("change", n);
15
- }
16
- const o = d(
17
- () => t(e),
18
- () => {
19
- c(), a.mediaQueryList = window.matchMedia(t(e)), a.mediaQueryList.addEventListener("change", n), a.hasMatches.value = a.mediaQueryList.matches;
20
- },
21
- { immediate: !0 }
22
- );
23
- return m(() => {
24
- o(), c(), s.delete(t(e));
25
- }), u(() => {
26
- var i;
27
- return !!((i = s.get(t(e))) != null && i.hasMatches.value);
28
- });
1
+ import { a as s, p as t, a as u, b as d } from "./index-t9tXBnql.js";
2
+ function e() {
29
3
  }
30
4
  export {
31
- f as default
5
+ e as clearQueryCache,
6
+ s as default,
7
+ t as provideSSRWidth,
8
+ u as useMediaQuery,
9
+ d as useSSRWidth
32
10
  };
33
11
  //# sourceMappingURL=useMediaQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMediaQuery.js","sources":["../src/composables/useMediaQuery/useMediaQuery.ts"],"sourcesContent":["import { computed, MaybeRefOrGetter, onScopeDispose, Ref, ref, toValue, watch } from 'vue';\n\nexport interface QueryCacheItem {\n hasMatches: Ref<boolean>;\n mediaQueryList: MediaQueryList;\n}\n\nconst queryCache = new Map<string, QueryCacheItem>();\n\n/**\n * Given a media query, this composable returns a reactive boolean indicating if the current window dimensions match the media query.\n */\nexport default function useMediaQuery(query: MaybeRefOrGetter<string>) {\n if (!queryCache.has(toValue(query))) {\n queryCache.set(toValue(query), {\n hasMatches: ref(false),\n mediaQueryList: window.matchMedia(toValue(query)),\n });\n }\n\n const queryCacheItem = queryCache.get(toValue(query)) as QueryCacheItem;\n\n function onMediaChange(event: MediaQueryListEvent) {\n queryCacheItem.hasMatches.value = event.matches;\n }\n\n function cleanup() {\n if (typeof queryCacheItem.mediaQueryList?.removeEventListener === 'function') {\n queryCacheItem.mediaQueryList.removeEventListener('change', onMediaChange);\n }\n }\n\n const stopWatch = watch(\n () => toValue(query),\n () => {\n cleanup();\n\n queryCacheItem.mediaQueryList = window.matchMedia(toValue(query));\n queryCacheItem.mediaQueryList.addEventListener('change', onMediaChange);\n queryCacheItem.hasMatches.value = queryCacheItem.mediaQueryList.matches;\n },\n { immediate: true },\n );\n\n onScopeDispose(() => {\n stopWatch();\n cleanup();\n queryCache.delete(toValue(query));\n });\n\n return computed(() => !!queryCache.get(toValue(query))?.hasMatches.value);\n}\n"],"names":["queryCache","useMediaQuery","query","toValue","ref","queryCacheItem","onMediaChange","event","cleanup","_a","stopWatch","watch","onScopeDispose","computed"],"mappings":";AAOA,MAAMA,wBAAiB,IAAA;AAKvB,SAAwBC,EAAcC,GAAiC;AACrE,EAAKF,EAAW,IAAIG,EAAQD,CAAK,CAAC,KAChCF,EAAW,IAAIG,EAAQD,CAAK,GAAG;AAAA,IAC7B,YAAYE,EAAI,EAAK;AAAA,IACrB,gBAAgB,OAAO,WAAWD,EAAQD,CAAK,CAAC;AAAA,EAAA,CACjD;AAGH,QAAMG,IAAiBL,EAAW,IAAIG,EAAQD,CAAK,CAAC;AAEpD,WAASI,EAAcC,GAA4B;AACjD,IAAAF,EAAe,WAAW,QAAQE,EAAM;AAAA,EAC1C;AAEA,WAASC,IAAU;;AACjB,IAAI,SAAOC,IAAAJ,EAAe,mBAAf,gBAAAI,EAA+B,wBAAwB,cAChEJ,EAAe,eAAe,oBAAoB,UAAUC,CAAa;AAAA,EAE7E;AAEA,QAAMI,IAAYC;AAAA,IAChB,MAAMR,EAAQD,CAAK;AAAA,IACnB,MAAM;AACJ,MAAAM,EAAA,GAEAH,EAAe,iBAAiB,OAAO,WAAWF,EAAQD,CAAK,CAAC,GAChEG,EAAe,eAAe,iBAAiB,UAAUC,CAAa,GACtED,EAAe,WAAW,QAAQA,EAAe,eAAe;AAAA,IAClE;AAAA,IACA,EAAE,WAAW,GAAA;AAAA,EAAK;AAGpB,SAAAO,EAAe,MAAM;AACnB,IAAAF,EAAA,GACAF,EAAA,GACAR,EAAW,OAAOG,EAAQD,CAAK,CAAC;AAAA,EAClC,CAAC,GAEMW,EAAS;;AAAM,YAAC,GAACJ,IAAAT,EAAW,IAAIG,EAAQD,CAAK,CAAC,MAA7B,QAAAO,EAAgC,WAAW;AAAA,GAAK;AAC1E;"}
1
+ {"version":3,"file":"useMediaQuery.js","sources":["../src/composables/useMediaQuery/useMediaQuery.ts"],"sourcesContent":["/**\n * Re-export useMediaQuery and SSR helpers from VueUse so we get maintained behavior\n * (SSR, ssrWidth, pxValue for units) without duplicating logic.\n * See https://vueuse.org/core/useMediaQuery/\n */\nexport { useMediaQuery as default, provideSSRWidth, useMediaQuery, useSSRWidth } from '@vueuse/core';\n\n/**\n * No-op for backwards compatibility with test setup. VueUse's useMediaQuery does not\n * use a shared cache, so there is nothing to clear.\n */\nexport function clearQueryCache(): void {}\n"],"names":["clearQueryCache"],"mappings":";AAWO,SAASA,IAAwB;AAAC;"}
@@ -1,5 +1,5 @@
1
1
  import v from "@leaflink/snitch";
2
- import { a as I } from "./index-DA70nQCT.js";
2
+ import { c as I } from "./index-t9tXBnql.js";
3
3
  import { isRef as w, toValue as D, nextTick as A, computed as i, ref as y, watch as S, onMounted as $, onBeforeUnmount as G } from "vue";
4
4
  function O({ list: n, from: s, to: e }) {
5
5
  if (s === e) return;
@@ -92,7 +92,7 @@ export default useValidation;
92
92
  * The inputs for useValidation
93
93
  */
94
94
  export declare interface UseValidationArgs<Values extends object> {
95
- rules: ValidationRules<Values>;
95
+ rules: MaybeRefOrGetter<ValidationRules<Values> | ValidationRulesDeep>;
96
96
  values: MaybeRefOrGetter<{
97
97
  [Property in keyof Values]: Values[Property];
98
98
  }>;
@@ -236,6 +236,16 @@ export declare type ValidationRules<Values extends object> = {
236
236
  [Property in keyof Values]: ValidationRule<Values[Property]>[];
237
237
  };
238
238
 
239
+ /**
240
+ * Nested rules tree: each leaf key maps to `ValidationRule[]`. Use for nested objects or arrays of
241
+ * per-row rule objects (e.g. `terpenes: [{ name: [...], amount: [...] }]`). Inline rule objects
242
+ * should use `validator(value: unknown)` (then narrow) so they match `ValidationRule<unknown>`;
243
+ * you do not need to import this type when `useValidation` can infer `values`.
244
+ */
245
+ export declare interface ValidationRulesDeep {
246
+ [key: string]: ValidationRule<unknown>[] | ValidationRulesDeep | ValidationRulesDeep[];
247
+ }
248
+
239
249
  /**
240
250
  * A function that returns `true` if the received value is valid and `false` if invalid.
241
251
  */