@dxtmisha/functional 1.15.3 → 1.15.6

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.
@@ -5,6 +5,13 @@ import { RefOrNormal } from '../../types/refTypes';
5
5
  * Reactive class for managing the formatting of numbers and dates.
6
6
  *
7
7
  * Реактивный класс для управления форматированием чисел и дат.
8
+ *
9
+ * @remarks
10
+ * Avoid using this reactive class if reactive updates are not required.
11
+ * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
12
+ *
13
+ * Старайтесь избегать этого класса, если не требуется реактивная переменная.
14
+ * Для нереактивного форматирования используйте обычный `GeoIntl` из `@dxtmisha/functional-basic`.
8
15
  */
9
16
  export declare class GeoIntlRef {
10
17
  private location;
@@ -3,5 +3,12 @@ import { GeoIntlRef } from '../../classes/ref/GeoIntlRef';
3
3
  * Returns a class object for working with data formatting.
4
4
  *
5
5
  * Возвращает объект класса для работы с форматированием данных.
6
+ *
7
+ * @remarks
8
+ * Avoid using this reactive composable if reactive updates are not required.
9
+ * For non-reactive formatting, use the standard `GeoIntl` class from `@dxtmisha/functional-basic`.
10
+ *
11
+ * Старайтесь избегать этого хука, если не требуется реактивная переменная.
12
+ * Для нереактивного форматирования используйте обычный `GeoIntl` из `@dxtmisha/functional-basic`.
6
13
  */
7
14
  export declare function useGeoIntlRef(): GeoIntlRef;
@@ -1,7 +1,9 @@
1
+ import { useLazyRef, LazyItem } from './useLazyRef';
1
2
  import { RefType } from '../../types/refTypes';
3
+ import { ShallowRef } from 'vue';
2
4
  export type LazyItemByMargin = {
3
5
  rootMargin: string;
4
- item: any;
6
+ item: ReturnType<typeof useLazyRef>;
5
7
  };
6
8
  /**
7
9
  * Hook for initializing the tracking of an element's appearance on the screen by margin.
@@ -10,13 +12,13 @@ export type LazyItemByMargin = {
10
12
  * @param element element for tracking/ элемента для отслеживания
11
13
  * @param rootMargin root margin for IntersectionObserver/ отступ для IntersectionObserver
12
14
  */
13
- export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin: string) => {
15
+ export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
14
16
  /** Lazy item status/ Статус ленивого элемента */
15
- lazyItemStatus: any;
17
+ lazyItemStatus: ShallowRef<boolean, boolean>;
16
18
  /**
17
19
  * Getting a tracked lazy item.
18
20
  *
19
21
  * Получение отслеживаемого ленивого элемента.
20
22
  */
21
- readonly lazyItem: any;
23
+ readonly lazyItem: LazyItem | undefined;
22
24
  };
@@ -19,7 +19,7 @@ export declare const useLazyRef: (options?: IntersectionObserverInit) => {
19
19
  * Получение отслеживаемого элемента.
20
20
  * @param element tracked element/ отслеживаемый элемент
21
21
  */
22
- getItem(element: HTMLElement): LazyItem;
22
+ getItem(element?: HTMLElement): LazyItem | undefined;
23
23
  /**
24
24
  * Adding an element for tracking.
25
25
  *
@@ -1,6 +1,6 @@
1
1
  import { Ref, ComputedRef } from 'vue';
2
2
  import { SearchColumns, SearchFormatList, SearchItem, SearchOptions } from '@dxtmisha/functional-basic';
3
- import { SearchListInput } from '../../types/searchTypes';
3
+ import { SearchColumnsInput, SearchListInput } from '../../types/searchTypes';
4
4
  /**
5
5
  * Composable for handling search logic with reactive data.
6
6
  *
@@ -10,7 +10,7 @@ import { SearchListInput } from '../../types/searchTypes';
10
10
  * @param value reactive search string / реактивная строка поиска
11
11
  * @param options search options / настройки поиска
12
12
  */
13
- export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns: K, value?: Ref<string>, options?: SearchOptions): {
13
+ export declare function useSearchRef<T extends SearchItem, K extends SearchColumns<T>>(list: SearchListInput<T>, columns?: SearchColumnsInput<T, K>, value?: Ref<string>, options?: SearchOptions): {
14
14
  /**
15
15
  * Whether the search is currently active (minimum character limit reached)/
16
16
  * Активен ли поиск в данный момент (достигнут ли лимит символов)
package/dist/library.js CHANGED
@@ -969,13 +969,13 @@ function Je(e, t) {
969
969
  //#endregion
970
970
  //#region src/composables/ref/useSearchRef.ts
971
971
  function Ye(e, t, n, r) {
972
- let i = new b(void 0, t, void 0, r), { search: a, searchDelay: o, loading: s } = Je(i, n), c = () => H(C(e)) || [], l = F(() => i.setValue(o.value).getItem().isSearch()), u = F(() => i.setList(c()).setValue(o.value).to());
972
+ let i = () => H(C(t)), a = new b(void 0, i(), void 0, r), { search: o, searchDelay: s, loading: c } = Je(a, n), l = () => H(C(e)) || [], u = F(() => a.setColumns(i()).setValue(s.value).getItem().isSearch()), d = F(() => a.setList(l()).setColumns(i()).setValue(s.value).to());
973
973
  return {
974
- isSearch: l,
975
- search: a,
976
- loading: s,
977
- listSearch: u,
978
- length: F(() => u.value.length)
974
+ isSearch: u,
975
+ search: o,
976
+ loading: c,
977
+ listSearch: d,
978
+ length: F(() => d.value.length)
979
979
  };
980
980
  }
981
981
  //#endregion
@@ -1126,6 +1126,7 @@ var ot = (e = { rootMargin: "128px 0px" }) => {
1126
1126
  return {
1127
1127
  intersectionObserver: n,
1128
1128
  getItem(e) {
1129
+ if (!e) return;
1129
1130
  let n = D(e);
1130
1131
  return t[n];
1131
1132
  },
@@ -1158,7 +1159,7 @@ var ot = (e = { rootMargin: "128px 0px" }) => {
1158
1159
  rootMargin: e,
1159
1160
  item: r
1160
1161
  }), r;
1161
- }, lt = (e, t) => {
1162
+ }, lt = (e, t = "128px 0px") => {
1162
1163
  let n = ct(t);
1163
1164
  return {
1164
1165
  lazyItemStatus: n.addLazyItem(e),
@@ -1181,7 +1182,7 @@ var dt = /* @__PURE__ */ function(e) {
1181
1182
  return e.global = "global", e.provide = "provide", e.local = "local", e;
1182
1183
  }({}), ft = 1, pt = re(1e5, 999999), mt = () => `__execute_use${pt}::${ft++}`, ht = () => x.get("__ui:execute-use-global__", () => []);
1183
1184
  function $(e, t = "provide") {
1184
- let n = mt(), r = `__executeUse::${n}__`, i = (t) => {
1185
+ let n = mt(), r = (t) => {
1185
1186
  let n = Object.freeze(e(...t));
1186
1187
  return {
1187
1188
  ...n,
@@ -1189,19 +1190,19 @@ function $(e, t = "provide") {
1189
1190
  return n;
1190
1191
  }
1191
1192
  };
1192
- }, a = (e) => {
1193
- let t = Object.freeze(i(e));
1193
+ }, i = (e) => {
1194
+ let t = Object.freeze(r(e));
1194
1195
  return me(n, t), t;
1195
- }, o = (e) => {
1196
- let t = i(e);
1196
+ }, a = (e) => {
1197
+ let t = r(e);
1197
1198
  return Object.freeze({
1198
1199
  ...t,
1199
1200
  destroyExecute() {
1200
- x.remove(r);
1201
+ x.remove(n);
1201
1202
  }
1202
1203
  });
1203
- }, s = (...e) => t === "provide" ? de(n, void 0) || a(e) : x.get(r, () => K.run(() => o(e)));
1204
- return t === "global" && ht().push(s), s;
1204
+ }, o = (...e) => t === "provide" ? de(n, void 0) || i(e) : x.get(n, () => K.run(() => a(e)));
1205
+ return t === "global" && ht().push(o), o;
1205
1206
  }
1206
1207
  function gt(e) {
1207
1208
  return $(e, "global");
@@ -1,6 +1,10 @@
1
1
  import { RefOrNormal } from './refTypes';
2
- import { SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
2
+ import { SearchColumns, SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
3
3
  /** Search list data / Данные списка поиска */
4
4
  export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
5
5
  /** Search list input / Входные данные списка поиска */
6
6
  export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
7
+ /** Search columns ref / Реактивные столбцы поиска */
8
+ export type SearchColumnsRef<T extends SearchItem, K extends SearchColumns<T>> = RefOrNormal<K>;
9
+ /** Search columns input / Входные данные столбцов поиска */
10
+ export type SearchColumnsInput<T extends SearchItem, K extends SearchColumns<T>> = SearchColumnsRef<T, K> | (() => SearchColumnsRef<T, K>);
package/package.json CHANGED
@@ -1,35 +1,60 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional",
3
3
  "private": false,
4
- "version": "1.15.3",
4
+ "version": "1.15.6",
5
5
  "type": "module",
6
- "description": "A comprehensive library of utilities, base classes, and Vue 3 composables for reactive web development. Extends @dxtmisha/functional-basic with Composition API.",
6
+ "description": "A comprehensive library of utilities, base classes, and Vue 3 composables for reactive web development — API orchestration, state singletons (executeUse), storage sync, i18n, formatters, and component design. Extends @dxtmisha/functional-basic.",
7
7
  "keywords": [
8
- "functional",
9
- "utilities",
10
- "helpers",
11
- "typescript",
12
8
  "vue",
13
9
  "vue3",
14
10
  "composition-api",
15
11
  "composables",
16
- "classes",
17
12
  "reactivity",
13
+ "typescript",
14
+ "utilities",
15
+ "helpers",
16
+ "functional",
17
+ "ssr",
18
+ "hydration",
18
19
  "api-client",
20
+ "execute-use",
21
+ "singletons",
22
+ "state-management",
23
+ "design-constructor",
24
+ "base-classes",
19
25
  "storage",
26
+ "localStorage",
27
+ "sessionStorage",
28
+ "cookie",
29
+ "broadcast-channel",
20
30
  "i18n",
31
+ "intl",
32
+ "localization",
33
+ "translate",
21
34
  "geo",
35
+ "geolocation",
36
+ "flags",
22
37
  "datetime",
23
- "cache",
24
- "ui"
38
+ "formatters",
39
+ "units",
40
+ "meta",
41
+ "seo",
42
+ "dom",
43
+ "events",
44
+ "list-data",
45
+ "search",
46
+ "lazy-loading",
47
+ "computed-async",
48
+ "router",
49
+ "dxt"
25
50
  ],
26
51
  "author": "dxtmisha@gmail.com",
27
52
  "license": "MIT",
28
- "homepage": "https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional-basic",
53
+ "homepage": "https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional",
29
54
  "repository": {
30
55
  "type": "git",
31
56
  "url": "git+https://github.com/dxtmisha/dxt-ui.git",
32
- "directory": "packages/functional-basic"
57
+ "directory": "packages/functional"
33
58
  },
34
59
  "bugs": {
35
60
  "url": "https://github.com/dxtmisha/dxt-ui/issues"
@@ -45,9 +70,11 @@
45
70
  "publish-to-npm": "npm publish --access public"
46
71
  },
47
72
  "files": [
73
+ "ai-prompts",
48
74
  "dist",
49
75
  "ai-description.md",
50
76
  "ai-doc.md",
77
+ "ai-mcp.json",
51
78
  "ai-types.md",
52
79
  "CHANGELOG.md",
53
80
  "LICENSE",