@dxtmisha/functional 1.11.1 → 1.11.7

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 (69) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/ai-description.txt +5 -0
  3. package/ai-types.txt +176 -138
  4. package/dist/classes/design/DesignAbstract.d.ts +61 -0
  5. package/dist/classes/design/DesignAsyncAbstract.d.ts +28 -0
  6. package/dist/classes/design/DesignChanged.d.ts +42 -0
  7. package/dist/classes/design/DesignComp.d.ts +4 -0
  8. package/dist/classes/design/DesignComponents.d.ts +81 -0
  9. package/dist/classes/design/DesignConstructorAbstract.d.ts +150 -0
  10. package/dist/classes/ref/DatetimeRef.d.ts +123 -0
  11. package/dist/classes/ref/EffectScopeGlobal.d.ts +22 -0
  12. package/dist/classes/ref/EventRef.d.ts +22 -0
  13. package/dist/classes/ref/GeoFlagRef.d.ts +51 -0
  14. package/dist/classes/ref/GeoIntlRef.d.ts +213 -0
  15. package/dist/classes/ref/GeoRef.d.ts +58 -0
  16. package/dist/classes/ref/ListDataRef.d.ts +359 -0
  17. package/dist/classes/ref/RouterItemRef.d.ts +61 -0
  18. package/dist/classes/ref/ScrollbarWidthRef.d.ts +22 -0
  19. package/dist/composables/ref/useApiAsyncRef.d.ts +18 -0
  20. package/dist/composables/ref/useApiDelete.d.ts +20 -0
  21. package/dist/composables/ref/useApiGet.d.ts +20 -0
  22. package/dist/composables/ref/useApiManagementAsyncRef.d.ts +49 -0
  23. package/dist/composables/ref/useApiManagementRef.d.ts +155 -0
  24. package/dist/composables/ref/useApiPost.d.ts +20 -0
  25. package/dist/composables/ref/useApiPut.d.ts +20 -0
  26. package/dist/composables/ref/useApiRef.d.ts +106 -0
  27. package/dist/composables/ref/useApiRequest.d.ts +28 -0
  28. package/dist/composables/ref/useBroadcastValueRef.d.ts +11 -0
  29. package/dist/composables/ref/useCookieRef.d.ts +11 -0
  30. package/dist/composables/ref/useFormattersRef.d.ts +21 -0
  31. package/dist/composables/ref/useGeoIntlRef.d.ts +7 -0
  32. package/dist/composables/ref/useHashRef.d.ts +9 -0
  33. package/dist/composables/ref/useLazyItemByMarginRef.d.ts +22 -0
  34. package/dist/composables/ref/useLazyRef.d.ts +42 -0
  35. package/dist/composables/ref/useLoadingRef.d.ts +7 -0
  36. package/dist/composables/ref/useMeta.d.ts +223 -0
  37. package/dist/composables/ref/useRouterList.d.ts +28 -0
  38. package/dist/composables/ref/useSearchRef.d.ts +36 -0
  39. package/dist/composables/ref/useSearchValueRef.d.ts +19 -0
  40. package/dist/composables/ref/useSessionRef.d.ts +9 -0
  41. package/dist/composables/ref/useStorageRef.d.ts +10 -0
  42. package/dist/composables/ref/useTranslateRef.d.ts +40 -0
  43. package/dist/flags.d.ts +1 -0
  44. package/dist/functions/basic.d.ts +1 -0
  45. package/dist/functions/computedAsync.d.ts +13 -0
  46. package/dist/functions/computedByLanguage.d.ts +15 -0
  47. package/dist/functions/computedEternity.d.ts +15 -0
  48. package/dist/functions/dxtFunctionalPlugin.d.ts +61 -0
  49. package/dist/functions/executeUse.d.ts +216 -0
  50. package/dist/functions/getInject.d.ts +7 -0
  51. package/dist/functions/getOptions.d.ts +10 -0
  52. package/dist/functions/ref/getBindRef.d.ts +13 -0
  53. package/dist/functions/ref/getRef.d.ts +8 -0
  54. package/dist/functions/ref/render.d.ts +13 -0
  55. package/dist/functions/ref/setRef.d.ts +9 -0
  56. package/dist/functions/ref/toRefItem.d.ts +9 -0
  57. package/dist/functions/render/getBind.d.ts +14 -0
  58. package/dist/functions/render/getClassName.d.ts +8 -0
  59. package/dist/functions/render/getIndexForRender.d.ts +10 -0
  60. package/dist/functions/toBind.d.ts +10 -0
  61. package/dist/functions/toBinds.d.ts +9 -0
  62. package/dist/library.d.ts +62 -2772
  63. package/dist/library.js +323 -262
  64. package/dist/types/apiTypes.d.ts +66 -0
  65. package/dist/types/constructorTypes.d.ts +126 -0
  66. package/dist/types/listTypes.d.ts +63 -0
  67. package/dist/types/refTypes.d.ts +36 -0
  68. package/dist/types/searchTypes.d.ts +6 -0
  69. package/package.json +7 -5
@@ -0,0 +1,66 @@
1
+ import { ApiData, ApiDataValidation, ApiDefaultValue, ApiFetch, ApiMethodItem, SearchColumns, SearchItem, SearchOptions } from '@dxtmisha/functional-basic';
2
+ import { RefOrNormal, RefType } from './refTypes';
3
+ import { Ref } from 'vue';
4
+ /** Options for api requests/ Опции для запросов api */
5
+ export type ApiOptions = ApiMethodItem | RefOrNormal<ApiFetch>;
6
+ /**
7
+ * Base type for API management values, either a single value or an array.
8
+ *
9
+ * Базовый тип для значений управления API: одиночное значение или массив.
10
+ */
11
+ export type ApiManagementValue = ApiDefaultValue | ApiDefaultValue[];
12
+ /**
13
+ * Configuration for the main GET request in API management.
14
+ *
15
+ * Конфигурация для основного GET-запроса в управлении API.
16
+ */
17
+ export type ApiManagementGet<Return extends ApiManagementValue, Type extends ApiManagementValue = Return> = {
18
+ /** API endpoint path / Путь к API */
19
+ path?: RefOrNormal<string | undefined>;
20
+ /** Additional request options / Дополнительные опции запроса */
21
+ options?: ApiOptions;
22
+ /** Enable reactive updates when path or options change / Включить реактивные обновления при изменении пути или опций */
23
+ reactivity?: boolean;
24
+ /** Condition to trigger the request / Условие выполнения запроса */
25
+ conditions?: RefType<boolean>;
26
+ /** Custom transformation for the fetched data / Пользовательская трансформация полученных данных */
27
+ transformation?: (data: Type, isResponseContractValid?: ApiDataValidation) => ApiData<Return>;
28
+ /** Function to validate response data contract / Функция для проверки контракта данных ответа */
29
+ validateResponseContract?: (data: Type) => ApiDataValidation;
30
+ /** Validation function or class constructor for data / Функция валидации или конструктор класса для данных */
31
+ typeData?: ((data: Return) => boolean) | any;
32
+ /** Whether to clear data when the component is unmounted / Удалять ли данные при размонтировании компонента */
33
+ unmounted?: boolean;
34
+ /** Function to provide skeleton data during loading / Функция, предоставляющая данные-заглушки во время загрузки */
35
+ skeleton?: () => Return;
36
+ };
37
+ /**
38
+ * Configuration for client-side search across API data.
39
+ *
40
+ * Конфигурация для клиентского поиска по данным API.
41
+ */
42
+ export type ApiManagementSearch<T extends SearchItem, K extends SearchColumns<T>> = {
43
+ /** List of columns to search through / Список столбцов для поиска */
44
+ columns: K;
45
+ /** Reactive search query / Реактивная строка поиска */
46
+ value?: Ref<string>;
47
+ /** Additional search algorithm options / Дополнительные опции алгоритма поиска */
48
+ options?: SearchOptions;
49
+ };
50
+ /**
51
+ * Configuration for mutation requests (POST, PUT, DELETE).
52
+ *
53
+ * Конфигурация для запросов мутации (POST, PUT, DELETE).
54
+ */
55
+ export type ApiManagementRequest<T, Return extends ApiData<T> = ApiData<T>> = {
56
+ /** Target API endpoint path / Целевой путь к API */
57
+ path?: RefOrNormal<string | undefined>;
58
+ /** Action to perform after a successful request / Действие после успешного выполнения запроса */
59
+ action?: (data: Return | undefined) => Promise<void> | void;
60
+ /** Transformation before sending data / Трансформация перед отправкой данных */
61
+ transformation?: (data: T) => Return;
62
+ /** Whether to wrap the payload in a 'data' property / Обертывать ли полезную нагрузку в свойство 'data' */
63
+ toData?: boolean;
64
+ /** Additional mutation request options / Дополнительные опции запроса мутации */
65
+ options?: ApiOptions;
66
+ };
@@ -0,0 +1,126 @@
1
+ import { Ref, PropType, ComputedRef } from 'vue';
2
+ import { Undefined } from '@dxtmisha/functional-basic';
3
+ import { RefOrNormal, RefType } from './refTypes';
4
+ /** Generic record type for constructor items/ Дженерик тип записи для элементов конструктора */
5
+ export type ConstrItem = Record<string, any>;
6
+ /** Constructor value wrapper with optional value property/ Обертка значения конструктора с опциональным свойством value */
7
+ export type ConstrValue<T = any> = {
8
+ /** Optional value of type T/ Опциональное значение типа T */
9
+ value?: T;
10
+ };
11
+ /** Generic record type for constructor components/ Дженерик тип записи для компонентов конструктора */
12
+ export type ConstrComponent = Record<string, any>;
13
+ /**
14
+ * Constructor component modification type with reactive or normal values/
15
+ * Тип модификации компонента конструктора с реактивными или обычными значениями
16
+ */
17
+ export type ConstrComponentMod<P extends ConstrItem> = ConstrItem | {
18
+ [K in keyof P]?: RefOrNormal<P[K]>;
19
+ };
20
+ export type ConstrExpose<E extends Element, EXPOSE extends ConstrItem> = EXPOSE & {
21
+ elementHtml?: ComputedRef<E | undefined>;
22
+ };
23
+ /** Utility type to convert union types to intersection types/ Утилитарный тип для преобразования объединенных типов в пересеченные */
24
+ export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
25
+ /** Extract emit item type from constructor item/ Извлечение типа элемента emit из элемента конструктора */
26
+ export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
27
+ /**
28
+ * Constructor emit type with proper event handler signatures/
29
+ * Тип emit конструктора с правильными сигнатурами обработчиков событий
30
+ */
31
+ export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
32
+ [K in keyof T]: (evt: K, ...args: T[K]) => void;
33
+ }>>;
34
+ /** Object type for CSS class names with boolean values/ Тип объекта для CSS классов с булевыми значениями */
35
+ export type ConstrClassObject = Record<string, boolean | undefined>;
36
+ /**
37
+ * Constructor class type supporting strings, arrays, and objects/
38
+ * Тип класса конструктора, поддерживающий строки, массивы и объекты
39
+ */
40
+ export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
41
+ /** Record type for mapping class names to class definitions/ Тип записи для сопоставления имен классов с определениями классов */
42
+ export type ConstrClassList = Record<string, ConstrClass>;
43
+ /** Constructor classes with required main class and additional class list/ Классы конструктора с обязательным основным классом и дополнительным списком классов */
44
+ export type ConstrClasses = {
45
+ main: ConstrClass;
46
+ } & ConstrClassList;
47
+ /** Constructor style item type for individual style properties/ Тип элемента стиля конструктора для отдельных свойств стиля */
48
+ export type ConstrStylesItem = string | null;
49
+ /**
50
+ * Constructor styles type supporting objects and arrays of style definitions/
51
+ * Тип стилей конструктора, поддерживающий объекты и массивы определений стилей
52
+ */
53
+ export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
54
+ /**
55
+ * Constructor options interface for component configuration/
56
+ * Интерфейс опций конструктора для конфигурации компонента
57
+ */
58
+ export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
59
+ /** Optional components configuration/ Опциональная конфигурация компонентов */
60
+ components?: COMP;
61
+ /** Optional component modifications/ Опциональные модификации компонента */
62
+ compMod?: ConstrComponentMod<P>;
63
+ /** Optional emit handlers/ Опциональные обработчики emit */
64
+ emits?: ConstrEmit<EMITS>;
65
+ /** Optional reactive classes/ Опциональные реактивные классы */
66
+ classes?: RefType<ConstrClasses>;
67
+ /** Optional reactive styles/ Опциональные реактивные стили */
68
+ styles?: RefType<ConstrStyles>;
69
+ };
70
+ /**
71
+ * Constructor setup interface for component initialization/
72
+ * Интерфейс настройки конструктора для инициализации компонента
73
+ */
74
+ export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
75
+ /** Component name/ Имя компонента */
76
+ name: string;
77
+ /** Reactive element reference/ Реактивная ссылка на элемент */
78
+ element: Ref<E | undefined>;
79
+ /** Reactive classes/ Реактивные классы */
80
+ classes: RefType<CLASSES>;
81
+ /** Reactive styles/ Реактивные стили */
82
+ styles: RefType<ConstrStyles>;
83
+ } & SETUP;
84
+ /** Constructor registration configuration/ Конфигурация регистрации конструктора */
85
+ export type ConstrRegistration = {
86
+ /** Optional flag for registration/ Опциональный флаг для регистрации */
87
+ flag?: boolean;
88
+ /** Optional translation map/ Опциональная карта переводов */
89
+ translate?: Record<string, string>;
90
+ };
91
+ /**
92
+ * Constructor bind type for component binding with class and style support/
93
+ * Тип привязки конструктора для привязки компонента с поддержкой классов и стилей
94
+ */
95
+ export type ConstrBind<T> = T & Record<string, any> & {
96
+ /** Optional key/ Опциональный ключ */
97
+ key?: string;
98
+ /** Optional CSS classes/ Опциональные CSS классы */
99
+ class?: ConstrClass;
100
+ /** Optional styles/ Опциональные стили */
101
+ style?: ConstrStyles;
102
+ };
103
+ /** Constructor prop item options for Vue prop definitions/ Опции элемента prop конструктора для определений Vue prop */
104
+ export type ConstrPropItemOptions<T = any> = {
105
+ /** Vue prop type/ Тип Vue prop */
106
+ type?: PropType<T>;
107
+ /** Required flag/ Флаг обязательности */
108
+ required?: boolean;
109
+ /** Default value/ Значение по умолчанию */
110
+ default?: any;
111
+ /** Custom validator function/ Пользовательская функция валидации */
112
+ validator?(value: any, props: any): boolean;
113
+ };
114
+ /** Constructor prop item type with options or direct PropType/ Тип элемента prop конструктора с опциями или прямым PropType */
115
+ export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
116
+ /** Constructor props type for component prop definitions/ Тип props конструктора для определений props компонента */
117
+ export type ConstrProps<P = Record<string, any>> = {
118
+ [K in keyof P]: ConstrPropItem<P[K]>;
119
+ };
120
+ /**
121
+ * Props for link handling/ Пропсы для обработки ссылок
122
+ */
123
+ export type ConstrHrefProps = {
124
+ /** Hyperlink reference/ Гиперссылка */
125
+ href?: string;
126
+ };
@@ -0,0 +1,63 @@
1
+ import { NumberOrString, NumberOrStringOrBoolean } from '@dxtmisha/functional-basic';
2
+ import { ConstrBind } from './constructorTypes';
3
+ /** Type of list item/ Тип элемента списка */
4
+ export type ListType = 'item' | 'space' | 'line' | 'subtitle' | 'html' | 'menu' | 'menu-group' | 'group';
5
+ /** Basic data structure for list item/ Базовая структура данных для элемента списка */
6
+ export type ListDataBasic = {
7
+ /** Optional display label/ Опциональная отображаемая метка */
8
+ label?: NumberOrString;
9
+ /** Any value associated with the item/ Любое значение, связанное с элементом */
10
+ value?: any;
11
+ /** Search text for filtering/ Текст поиска для фильтрации */
12
+ search?: string;
13
+ };
14
+ /** Extended list item with type and index/ Расширенный элемент списка с типом и индексом */
15
+ export type ListDataItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item & {
16
+ /** Parent item identifier/ Идентификатор родительского элемента */
17
+ parent?: string;
18
+ /** Type of list item/ Тип элемента списка */
19
+ type: ListType;
20
+ /** Unique item identifier/ Уникальный идентификатор элемента */
21
+ index: string;
22
+ }>;
23
+ /** Array of list data items/ Массив элементов данных списка */
24
+ export type ListList<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item>[];
25
+ /**
26
+ * List or record structure for list data/
27
+ * Структура списка или записи для данных списка
28
+ */
29
+ export type ListRecord<Item extends ListDataBasic = ListDataBasic> = ListList<Item> | Record<string, any>;
30
+ /**
31
+ * Extended list item with additional state properties/
32
+ * Расширенный элемент списка с дополнительными свойствами состояния
33
+ */
34
+ export type ListDataFullItem<Item extends ListDataBasic = ListDataBasic> = ListDataItem<Item> & {
35
+ /** Whether the item has focus/ Имеет ли элемент фокус */
36
+ focus: boolean;
37
+ /** Highlighted text portion/ Выделенная часть текста */
38
+ highlight?: string;
39
+ /** Whether the item is selected/ Выбран ли элемент */
40
+ selected: boolean;
41
+ /** Whether the item is disabled/ Отключен ли элемент */
42
+ disabled?: boolean;
43
+ };
44
+ /**
45
+ * Array of extended list items with state/
46
+ * Массив расширенных элементов списка с состоянием
47
+ */
48
+ export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
49
+ /** Input item for list creation/ Входной элемент для создания списка */
50
+ export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
51
+ /**
52
+ * Various input formats for list creation/
53
+ * Различные форматы входных данных для создания списка
54
+ */
55
+ export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
56
+ /** Single selected item identifier/ Идентификатор одного выбранного элемента */
57
+ export type ListSelectedItem = NumberOrStringOrBoolean;
58
+ /** Single or multiple selected items/ Один или несколько выбранных элементов */
59
+ export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
60
+ /** Name of selected list item/ Название выбранного элемента списка */
61
+ export type ListName = string | number | undefined;
62
+ /** Array of list item names/ Массив названий выбранных элементов списка */
63
+ export type ListNames = ListName[];
@@ -0,0 +1,36 @@
1
+ import { ComputedRef, Ref, VNode, VNodeArrayChildren } from 'vue';
2
+ /**
3
+ * Union type for Vue reactive references (computed or ref)/
4
+ * Объединенный тип для Vue реактивных ссылок (computed или ref)
5
+ */
6
+ export type RefType<T> = ComputedRef<T> | Ref<T>;
7
+ /**
8
+ * Union type for Vue reactive references that can be undefined/
9
+ * Объединенный тип для Vue реактивных ссылок, которые могут быть undefined
10
+ */
11
+ export type RefUndefined<T> = RefType<T | undefined>;
12
+ /**
13
+ * Union type that can be either a Vue reactive reference or a normal value/
14
+ * Объединенный тип, который может быть либо Vue реактивной ссылкой, либо обычным значением
15
+ */
16
+ export type RefOrNormal<T> = RefType<T> | T;
17
+ /**
18
+ * Union type for Vue raw children content
19
+ * (strings, numbers, booleans, VNodes, arrays, functions)/
20
+ * Объединенный тип для Vue сырого содержимого дочерних элементов
21
+ * (строки, числа, булевы, VNode, массивы, функции)
22
+ */
23
+ export type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
24
+ /**
25
+ * Type for Vue raw slots with optional stability flag/
26
+ * Тип для Vue сырых слотов с опциональным флагом стабильности
27
+ */
28
+ export type RawSlots = {
29
+ /** Slot name mapping to unknown content/ Маппинг имени слота к неизвестному содержимому */
30
+ [name: string]: unknown;
31
+ /**
32
+ * Optional stability flag for performance optimization/
33
+ * Опциональный флаг стабильности для оптимизации производительности
34
+ */
35
+ $stable?: boolean;
36
+ };
@@ -0,0 +1,6 @@
1
+ import { RefOrNormal } from './refTypes';
2
+ import { SearchItem, SearchListValue } from '@dxtmisha/functional-basic';
3
+ /** Search list data / Данные списка поиска */
4
+ export type SearchListValueRef<T extends SearchItem> = RefOrNormal<SearchListValue<T>>;
5
+ /** Search list input / Входные данные списка поиска */
6
+ export type SearchListInput<T extends SearchItem> = SearchListValueRef<T> | (() => SearchListValueRef<T>);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/functional",
3
3
  "private": false,
4
- "version": "1.11.1",
4
+ "version": "1.11.7",
5
5
  "type": "module",
6
6
  "description": "A comprehensive library of utilities, base classes, and Vue 3 composables for reactive web development. Extends @dxtmisha/functional-basic with Composition API.",
7
7
  "keywords": [
@@ -40,16 +40,18 @@
40
40
  "preview": "vite preview",
41
41
  "test": "vitest",
42
42
  "library": "dxt-library",
43
- "dxt-types": "dxt-types",
43
+ "types": "dxt-types",
44
44
  "prepublishOnly": "npm run library && npm run build",
45
- "public": "npm publish --access public"
45
+ "publish-to-npm": "npm publish --access public"
46
46
  },
47
47
  "files": [
48
48
  "dist",
49
+ "ai-description.txt",
49
50
  "ai-types.txt",
50
- "README.md",
51
+ "CHANGELOG.md",
52
+ "LICENSE",
51
53
  "package.json",
52
- "LICENSE"
54
+ "README.md"
53
55
  ],
54
56
  "main": "dist/library.js",
55
57
  "module": "dist/library.js",