@dxtmisha/functional 1.15.2 → 1.15.5
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/CHANGELOG.md +26 -0
- package/README.md +42 -21
- package/ai-description.md +29 -25
- package/ai-doc.md +36 -106
- package/ai-types.md +379 -392
- package/dist/classes/ref/GeoIntlRef.d.ts +7 -0
- package/dist/composables/ref/useGeoIntlRef.d.ts +7 -0
- package/dist/composables/ref/useLazyItemByMarginRef.d.ts +6 -4
- package/dist/composables/ref/useLazyRef.d.ts +1 -1
- package/dist/composables/ref/useMeta.d.ts +5 -5
- package/dist/composables/ref/useSearchRef.d.ts +2 -2
- package/dist/library.js +17 -18
- package/dist/types/searchTypes.d.ts +5 -1
- package/package.json +36 -11
|
@@ -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:
|
|
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
|
|
15
|
+
export declare const useLazyItemByMarginRef: (element: RefType<HTMLElement | undefined>, rootMargin?: string) => {
|
|
14
16
|
/** Lazy item status/ Статус ленивого элемента */
|
|
15
|
-
lazyItemStatus:
|
|
17
|
+
lazyItemStatus: ShallowRef<boolean, boolean>;
|
|
16
18
|
/**
|
|
17
19
|
* Getting a tracked lazy item.
|
|
18
20
|
*
|
|
19
21
|
* Получение отслеживаемого ленивого элемента.
|
|
20
22
|
*/
|
|
21
|
-
readonly lazyItem:
|
|
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
|
|
22
|
+
getItem(element?: HTMLElement): LazyItem | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Adding an element for tracking.
|
|
25
25
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MetaRobots,
|
|
1
|
+
import { MetaRobots, Meta } from '@dxtmisha/functional-basic';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* Vue composable for reactive meta tags management with automatic DOM synchronization.
|
|
@@ -8,7 +8,7 @@ import { Ref } from 'vue';
|
|
|
8
8
|
* Использует паттерн singleton - все компоненты используют одно состояние мета-тегов.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useMeta: () => Readonly<{
|
|
11
|
-
meta:
|
|
11
|
+
meta: Meta;
|
|
12
12
|
/** Reactive page title (without suffix) / Реактивный заголовок страницы (без суффикса) */
|
|
13
13
|
title: Ref<string, string>;
|
|
14
14
|
/** Reactive keywords meta tag / Реактивный мета-тег keywords */
|
|
@@ -111,10 +111,10 @@ export declare const useMeta: () => Readonly<{
|
|
|
111
111
|
* Устанавливает суффикс для заголовка страницы.
|
|
112
112
|
* @param suffix Suffix to set / Суффикс для установки
|
|
113
113
|
*/
|
|
114
|
-
setSuffix: (suffix: string) =>
|
|
114
|
+
setSuffix: (suffix: string) => void;
|
|
115
115
|
} & {
|
|
116
116
|
init(): Readonly<{
|
|
117
|
-
meta:
|
|
117
|
+
meta: Meta;
|
|
118
118
|
/** Reactive page title (without suffix) / Реактивный заголовок страницы (без суффикса) */
|
|
119
119
|
title: Ref<string, string>;
|
|
120
120
|
/** Reactive keywords meta tag / Реактивный мета-тег keywords */
|
|
@@ -217,7 +217,7 @@ export declare const useMeta: () => Readonly<{
|
|
|
217
217
|
* Устанавливает суффикс для заголовка страницы.
|
|
218
218
|
* @param suffix Suffix to set / Суффикс для установки
|
|
219
219
|
*/
|
|
220
|
-
setSuffix: (suffix: string) =>
|
|
220
|
+
setSuffix: (suffix: string) => void;
|
|
221
221
|
}>;
|
|
222
222
|
destroyExecute?(): void;
|
|
223
223
|
}>;
|
|
@@ -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
|
|
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,
|
|
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:
|
|
975
|
-
search:
|
|
976
|
-
loading:
|
|
977
|
-
listSearch:
|
|
978
|
-
length: F(() =>
|
|
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
|
|
1185
|
+
let n = mt(), r = (t) => {
|
|
1185
1186
|
let n = Object.freeze(e(...t));
|
|
1186
1187
|
return {
|
|
1187
1188
|
...n,
|
|
@@ -1189,21 +1190,19 @@ function $(e, t = "provide") {
|
|
|
1189
1190
|
return n;
|
|
1190
1191
|
}
|
|
1191
1192
|
};
|
|
1192
|
-
},
|
|
1193
|
-
let t = Object.freeze(
|
|
1193
|
+
}, i = (e) => {
|
|
1194
|
+
let t = Object.freeze(r(e));
|
|
1194
1195
|
return me(n, t), t;
|
|
1195
|
-
},
|
|
1196
|
-
let t =
|
|
1196
|
+
}, a = (e) => {
|
|
1197
|
+
let t = r(e);
|
|
1197
1198
|
return Object.freeze({
|
|
1198
1199
|
...t,
|
|
1199
1200
|
destroyExecute() {
|
|
1200
|
-
|
|
1201
|
+
x.remove(n);
|
|
1201
1202
|
}
|
|
1202
1203
|
});
|
|
1203
|
-
},
|
|
1204
|
-
|
|
1205
|
-
}), r);
|
|
1206
|
-
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;
|
|
1207
1206
|
}
|
|
1208
1207
|
function gt(e) {
|
|
1209
1208
|
return $(e, "global");
|
|
@@ -1220,7 +1219,7 @@ function yt() {
|
|
|
1220
1219
|
//#endregion
|
|
1221
1220
|
//#region src/composables/ref/useMeta.ts
|
|
1222
1221
|
var bt = vt(() => {
|
|
1223
|
-
let e = _, t = L(e.getTitle()), n = L(e.getKeywords()), r = L(e.getDescription()), i = L(e.getImage()), a = L(e.getCanonical()), o = L(e.getRobots()), s = L(e.getAuthor()), c = L(e.getSiteName()), l = () => e.html(), u = (e) => {
|
|
1222
|
+
let e = _.getItem(), t = L(e.getTitle()), n = L(e.getKeywords()), r = L(e.getDescription()), i = L(e.getImage()), a = L(e.getCanonical()), o = L(e.getRobots()), s = L(e.getAuthor()), c = L(e.getSiteName()), l = () => e.html(), u = (e) => {
|
|
1224
1223
|
t.value = e, x();
|
|
1225
1224
|
}, d = (e) => {
|
|
1226
1225
|
n.value = e, x();
|
|
@@ -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.
|
|
4
|
+
"version": "1.15.5",
|
|
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
|
|
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
|
-
"
|
|
24
|
-
"
|
|
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
|
|
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
|
|
57
|
+
"directory": "packages/functional"
|
|
33
58
|
},
|
|
34
59
|
"bugs": {
|
|
35
60
|
"url": "https://github.com/dxtmisha/dxt-ui/issues"
|