@dxtmisha/functional 1.0.9
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/LICENSE +21 -0
- package/README.md +767 -0
- package/dist/Icons-C2lZhD4l.js +1284 -0
- package/dist/classes/Api.d.ts +305 -0
- package/dist/classes/Cache.d.ts +34 -0
- package/dist/classes/CacheItem.d.ts +55 -0
- package/dist/classes/CacheStatic.d.ts +17 -0
- package/dist/classes/Cookie.d.ts +52 -0
- package/dist/classes/CookieBlock.d.ts +22 -0
- package/dist/classes/DataStorage.d.ts +70 -0
- package/dist/classes/Datetime.d.ts +482 -0
- package/dist/classes/EventItem.d.ts +160 -0
- package/dist/classes/Geo.d.ts +168 -0
- package/dist/classes/GeoFlag.d.ts +79 -0
- package/dist/classes/GeoIntl.d.ts +262 -0
- package/dist/classes/GeoPhone.d.ts +107 -0
- package/dist/classes/Global.d.ts +21 -0
- package/dist/classes/Hash.d.ts +59 -0
- package/dist/classes/Icons.d.ts +90 -0
- package/dist/classes/Loading.d.ts +49 -0
- package/dist/classes/ScrollbarWidth.d.ts +33 -0
- package/dist/classes/Translate.d.ts +116 -0
- package/dist/classes/design/DesignAbstract.d.ts +61 -0
- package/dist/classes/design/DesignAsyncAbstract.d.ts +28 -0
- package/dist/classes/design/DesignChanged.d.ts +42 -0
- package/dist/classes/design/DesignComp.d.ts +4 -0
- package/dist/classes/design/DesignComponents.d.ts +81 -0
- package/dist/classes/design/DesignConstructorAbstract.d.ts +150 -0
- package/dist/classes/ref/DatetimeRef.d.ts +119 -0
- package/dist/classes/ref/EventRef.d.ts +23 -0
- package/dist/classes/ref/GeoFlagRef.d.ts +52 -0
- package/dist/classes/ref/GeoIntlRef.d.ts +173 -0
- package/dist/classes/ref/GeoRef.d.ts +52 -0
- package/dist/classes/ref/ListDataRef.d.ts +228 -0
- package/dist/classes/ref/RouterItemRef.d.ts +36 -0
- package/dist/classes/ref/ScrollbarWidthRef.d.ts +24 -0
- package/dist/composables/ref/useApiRef.d.ts +25 -0
- package/dist/composables/ref/useCookieRef.d.ts +11 -0
- package/dist/composables/ref/useGeoIntlRef.d.ts +7 -0
- package/dist/composables/ref/useHashRef.d.ts +9 -0
- package/dist/composables/ref/useLazyRef.d.ts +33 -0
- package/dist/composables/ref/useLoadingRef.d.ts +7 -0
- package/dist/composables/ref/useSessionRef.d.ts +9 -0
- package/dist/composables/ref/useStorageRef.d.ts +10 -0
- package/dist/composables/ref/useTranslateRef.d.ts +16 -0
- package/dist/flags.d.ts +1 -0
- package/dist/flags.js +8 -0
- package/dist/functions/anyToString.d.ts +7 -0
- package/dist/functions/applyTemplate.d.ts +10 -0
- package/dist/functions/arrFill.d.ts +8 -0
- package/dist/functions/copyObject.d.ts +8 -0
- package/dist/functions/createElement.d.ts +13 -0
- package/dist/functions/domQuerySelector.d.ts +7 -0
- package/dist/functions/domQuerySelectorAll.d.ts +7 -0
- package/dist/functions/eventStopPropagation.d.ts +7 -0
- package/dist/functions/executeFunction.d.ts +8 -0
- package/dist/functions/executePromise.d.ts +7 -0
- package/dist/functions/executeUse.d.ts +11 -0
- package/dist/functions/forEach.d.ts +11 -0
- package/dist/functions/frame.d.ts +16 -0
- package/dist/functions/getAttributes.d.ts +8 -0
- package/dist/functions/getClipboardData.d.ts +11 -0
- package/dist/functions/getColumn.d.ts +10 -0
- package/dist/functions/getElement.d.ts +8 -0
- package/dist/functions/getElementId.d.ts +9 -0
- package/dist/functions/getElementItem.d.ts +11 -0
- package/dist/functions/getElementOrWindow.d.ts +8 -0
- package/dist/functions/getExp.d.ts +13 -0
- package/dist/functions/getItemByPath.d.ts +8 -0
- package/dist/functions/getKey.d.ts +7 -0
- package/dist/functions/getLengthOfAllArray.d.ts +8 -0
- package/dist/functions/getMaxLengthAllArray.d.ts +8 -0
- package/dist/functions/getMinLengthAllArray.d.ts +8 -0
- package/dist/functions/getMouseClient.d.ts +8 -0
- package/dist/functions/getMouseClientX.d.ts +7 -0
- package/dist/functions/getMouseClientY.d.ts +7 -0
- package/dist/functions/getObjectByKeys.d.ts +8 -0
- package/dist/functions/getObjectNoUndefined.d.ts +8 -0
- package/dist/functions/getObjectOrNone.d.ts +7 -0
- package/dist/functions/getRandomText.d.ts +11 -0
- package/dist/functions/getRequestString.d.ts +9 -0
- package/dist/functions/getStepPercent.d.ts +8 -0
- package/dist/functions/getStepValue.d.ts +8 -0
- package/dist/functions/goScroll.d.ts +10 -0
- package/dist/functions/inArray.d.ts +8 -0
- package/dist/functions/initScrollbarOffset.d.ts +6 -0
- package/dist/functions/intersectKey.d.ts +8 -0
- package/dist/functions/isArray.d.ts +7 -0
- package/dist/functions/isDifferent.d.ts +9 -0
- package/dist/functions/isDomRuntime.d.ts +10 -0
- package/dist/functions/isFilled.d.ts +9 -0
- package/dist/functions/isFloat.d.ts +7 -0
- package/dist/functions/isFunction.d.ts +8 -0
- package/dist/functions/isInDom.d.ts +8 -0
- package/dist/functions/isIntegerBetween.d.ts +8 -0
- package/dist/functions/isNull.d.ts +8 -0
- package/dist/functions/isNumber.d.ts +7 -0
- package/dist/functions/isObject.d.ts +7 -0
- package/dist/functions/isObjectNotArray.d.ts +7 -0
- package/dist/functions/isSelected.d.ts +8 -0
- package/dist/functions/isSelectedByList.d.ts +8 -0
- package/dist/functions/isString.d.ts +7 -0
- package/dist/functions/isWindow.d.ts +7 -0
- package/dist/functions/random.d.ts +8 -0
- package/dist/functions/ref/getBindRef.d.ts +13 -0
- package/dist/functions/ref/getComputedAsync.d.ts +9 -0
- package/dist/functions/ref/getRef.d.ts +8 -0
- package/dist/functions/ref/render.d.ts +13 -0
- package/dist/functions/ref/setRef.d.ts +9 -0
- package/dist/functions/ref/toComputed.d.ts +8 -0
- package/dist/functions/ref/toRefItem.d.ts +9 -0
- package/dist/functions/render/getBind.d.ts +14 -0
- package/dist/functions/render/getClassName.d.ts +8 -0
- package/dist/functions/render/getIndexForRender.d.ts +10 -0
- package/dist/functions/replaceRecursive.d.ts +10 -0
- package/dist/functions/replaceTemplate.d.ts +9 -0
- package/dist/functions/secondToTime.d.ts +7 -0
- package/dist/functions/setElementItem.d.ts +10 -0
- package/dist/functions/setValues.d.ts +17 -0
- package/dist/functions/splice.d.ts +12 -0
- package/dist/functions/strFill.d.ts +8 -0
- package/dist/functions/toArray.d.ts +17 -0
- package/dist/functions/toBind.d.ts +10 -0
- package/dist/functions/toBinds.d.ts +9 -0
- package/dist/functions/toCamelCase.d.ts +7 -0
- package/dist/functions/toCamelCaseFirst.d.ts +7 -0
- package/dist/functions/toDate.d.ts +7 -0
- package/dist/functions/toKebabCase.d.ts +15 -0
- package/dist/functions/toNumber.d.ts +8 -0
- package/dist/functions/toNumberByMax.d.ts +9 -0
- package/dist/functions/toPercent.d.ts +8 -0
- package/dist/functions/toPercentBy100.d.ts +8 -0
- package/dist/functions/transformation.d.ts +21 -0
- package/dist/functions/uniqueArray.d.ts +7 -0
- package/dist/functions/writeClipboardData.d.ts +7 -0
- package/dist/library.d.ts +135 -0
- package/dist/library.js +4254 -0
- package/dist/types/basicTypes.d.ts +126 -0
- package/dist/types/constructorTypes.d.ts +114 -0
- package/dist/types/geoTypes.d.ts +86 -0
- package/dist/types/listTypes.d.ts +61 -0
- package/dist/types/refTypes.d.ts +36 -0
- package/package.json +77 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** Union type for undefined and null values/ Объединенный тип для undefined и null значений */
|
|
2
|
+
export type Undefined = undefined | null;
|
|
3
|
+
/**
|
|
4
|
+
* Union type for all "empty" values including falsy primitives and string representations/
|
|
5
|
+
* Объединенный тип для всех "пустых" значений включая ложные примитивы и строковые представления
|
|
6
|
+
*/
|
|
7
|
+
export type EmptyValue = Undefined | 0 | false | '' | 'undefined' | 'null' | '0' | 'false' | '[]';
|
|
8
|
+
/** Union type for numeric and string values/ Объединенный тип для числовых и строковых значений */
|
|
9
|
+
export type NumberOrString = number | string;
|
|
10
|
+
/**
|
|
11
|
+
* Union type for numeric, string, and boolean values/
|
|
12
|
+
* Объединенный тип для числовых, строковых и булевых значений
|
|
13
|
+
*/
|
|
14
|
+
export type NumberOrStringOrBoolean = number | string | boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Union type for numeric, string, and Date values/
|
|
17
|
+
* Объединенный тип для числовых, строковых значений и Date
|
|
18
|
+
*/
|
|
19
|
+
export type NumberOrStringOrDate = NumberOrString | Date;
|
|
20
|
+
/**
|
|
21
|
+
* Generic type that can be either a single value or an array of values/
|
|
22
|
+
* Дженерик тип для одиночного значения или массива значений
|
|
23
|
+
*/
|
|
24
|
+
export type NormalOrArray<T = NumberOrString> = T | T[];
|
|
25
|
+
/**
|
|
26
|
+
* Generic type that can be either a direct value or a Promise resolving to that value/
|
|
27
|
+
* Дженерик тип для прямого значения или Promise
|
|
28
|
+
*/
|
|
29
|
+
export type NormalOrPromise<T> = T | Promise<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Generic record/object type with string keys/
|
|
32
|
+
* Дженерик тип записи/объекта со строковыми ключами
|
|
33
|
+
*/
|
|
34
|
+
export type ObjectItem<T = any> = Record<string, T>;
|
|
35
|
+
/** Generic type that can be either an array or an object/ Дженерик тип для массива или объекта */
|
|
36
|
+
export type ObjectOrArray<T = any> = T[] | ObjectItem<T>;
|
|
37
|
+
/**
|
|
38
|
+
* Function type that returns a value of type R/
|
|
39
|
+
* Тип функции, возвращающей значение типа R
|
|
40
|
+
*/
|
|
41
|
+
export type FunctionReturn<R = any> = () => R;
|
|
42
|
+
/** Function type that returns void/ Тип функции, возвращающей void */
|
|
43
|
+
export type FunctionVoid = () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Function type that accepts multiple arguments of type T and returns type R/
|
|
46
|
+
* Тип функции с переменными аргументами
|
|
47
|
+
*/
|
|
48
|
+
export type FunctionArgs<T, R> = (...args: T[]) => R;
|
|
49
|
+
/**
|
|
50
|
+
* Most generic function type that accepts any arguments and returns any value/
|
|
51
|
+
* Наиболее общий тип функции
|
|
52
|
+
*/
|
|
53
|
+
export type FunctionAnyType<T = any, R = any> = (...args: T[]) => R;
|
|
54
|
+
/**
|
|
55
|
+
* Generic record type for lists with string keys/
|
|
56
|
+
* Дженерик тип записи для списков со строковыми ключами
|
|
57
|
+
*/
|
|
58
|
+
export type ItemList<T = any> = Record<string, T>;
|
|
59
|
+
/**
|
|
60
|
+
* Generic item type with index and value properties/
|
|
61
|
+
* Дженерик тип элемента со свойствами index и value
|
|
62
|
+
*/
|
|
63
|
+
export type Item<V> = {
|
|
64
|
+
/** Unique string identifier for the item/ Уникальный строковый идентификатор элемента */
|
|
65
|
+
index: string;
|
|
66
|
+
/** The actual value of the item/ Фактическое значение элемента */
|
|
67
|
+
value: V;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Generic item type with label and value properties/
|
|
71
|
+
* Дженерик тип элемента со свойствами label и value
|
|
72
|
+
*/
|
|
73
|
+
export type ItemValue<V> = {
|
|
74
|
+
/** Display text for the item/ Отображаемый текст для элемента */
|
|
75
|
+
label: string;
|
|
76
|
+
/** The actual value of the item/ Фактическое значение элемента */
|
|
77
|
+
value: V;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Generic item type with name and value properties/
|
|
81
|
+
* Дженерик тип элемента со свойствами name и value
|
|
82
|
+
*/
|
|
83
|
+
export type ItemName<V> = {
|
|
84
|
+
/** Name identifier (string or number)/ Идентификатор имени (строка или число) */
|
|
85
|
+
name: string | number;
|
|
86
|
+
/** The actual value of the item/ Фактическое значение элемента */
|
|
87
|
+
value: V;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Union type for HTML elements and Window object/
|
|
91
|
+
* Объединенный тип для HTML элементов и объекта Window
|
|
92
|
+
*/
|
|
93
|
+
export type ElementOrWindow = HTMLElement | Window;
|
|
94
|
+
/**
|
|
95
|
+
* Generic type that can be either an element or a string selector/
|
|
96
|
+
* Дженерик тип для элемента или строкового селектора
|
|
97
|
+
*/
|
|
98
|
+
export type ElementOrString<E extends ElementOrWindow> = E | string;
|
|
99
|
+
/** Type for event listener options/ Тип для опций обработчика событий */
|
|
100
|
+
export type EventOptions = AddEventListenerOptions | boolean | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Generic event listener function type with additional detail parameter/
|
|
103
|
+
* Дженерик тип функции обработчика событий с дополнительным параметром detail
|
|
104
|
+
*/
|
|
105
|
+
export type EventListenerDetail<O extends Event, D extends Record<string, any>> = (event: O, detail?: D) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Type for tracking active event listeners and observers/
|
|
108
|
+
* Тип для отслеживания активных обработчиков событий и наблюдателей
|
|
109
|
+
*/
|
|
110
|
+
export type EventActivityItem<E extends ElementOrWindow> = {
|
|
111
|
+
/** The target element for the event/ Целевой элемент для события */
|
|
112
|
+
element: E | undefined;
|
|
113
|
+
/** The event type name/ Название типа события */
|
|
114
|
+
type: string;
|
|
115
|
+
/** Optional custom event listener/ Опциональный пользовательский обработчик событий */
|
|
116
|
+
listener?: (event: any | Event) => void;
|
|
117
|
+
/** Optional ResizeObserver instance/ Опциональный экземпляр ResizeObserver */
|
|
118
|
+
observer?: ResizeObserver;
|
|
119
|
+
};
|
|
120
|
+
/** Type for 2D coordinates/ Тип для 2D координат */
|
|
121
|
+
export type ImageCoordinator = {
|
|
122
|
+
/** X-axis coordinate/ Координата по оси X */
|
|
123
|
+
x: number;
|
|
124
|
+
/** Y-axis coordinate/ Координата по оси Y */
|
|
125
|
+
y: number;
|
|
126
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Ref, PropType } from 'vue';
|
|
2
|
+
import { Undefined } from './basicTypes';
|
|
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
|
+
/** Utility type to convert union types to intersection types/ Утилитарный тип д��я преобразования объединенных типов в пересеченные */
|
|
21
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
22
|
+
/** Extract emit item type from constructor item/ Извлечение типа элемен��а emit из элемента конструктора */
|
|
23
|
+
export type ConstrEmitItem<T extends ConstrItem> = T[keyof T];
|
|
24
|
+
/**
|
|
25
|
+
* Constructor emit type with proper event handler signatures/
|
|
26
|
+
* Тип emit конструктора с правильными сигнатурами обработчиков событий
|
|
27
|
+
*/
|
|
28
|
+
export type ConstrEmit<T extends ConstrItem = ConstrItem> = UnionToIntersection<ConstrEmitItem<{
|
|
29
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
30
|
+
}>>;
|
|
31
|
+
/** Object type for CSS class names with boolean values/ Тип объекта для CSS классов с булевыми значениями */
|
|
32
|
+
export type ConstrClassObject = Record<string, boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Constructor class type supporting strings, arrays, and objects/
|
|
35
|
+
* Тип класса конструктора, поддерживающий строки, массивы и объекты
|
|
36
|
+
*/
|
|
37
|
+
export type ConstrClass = string | (string | ConstrClass | Undefined)[] | ConstrClassObject;
|
|
38
|
+
/** Record type for mapping class names to class definitions/ Тип записи для сопоставления имен классов с определениями классов */
|
|
39
|
+
export type ConstrClassList = Record<string, ConstrClass>;
|
|
40
|
+
/** Constructor classes with required main class and additional class list/ Классы конструктора с обязательным основным классом и дополнительным списком классов */
|
|
41
|
+
export type ConstrClasses = {
|
|
42
|
+
main: ConstrClass;
|
|
43
|
+
} & ConstrClassList;
|
|
44
|
+
/** Constructor style item type for individual style properties/ Тип элемента стиля конструктора для отдельных свойств стиля */
|
|
45
|
+
export type ConstrStylesItem = string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Constructor styles type supporting objects and arrays of style definitions/
|
|
48
|
+
* Тип стилей конструктора, поддерживающий объекты и массивы определений стилей
|
|
49
|
+
*/
|
|
50
|
+
export type ConstrStyles = Record<string, ConstrStylesItem> | ConstrStyles[];
|
|
51
|
+
/**
|
|
52
|
+
* Constructor options interface for component configuration/
|
|
53
|
+
* Интерфейс опций конструктора для конфигурации компонента
|
|
54
|
+
*/
|
|
55
|
+
export type ConstrOptions<COMP extends ConstrComponent, EMITS extends ConstrItem, P extends ConstrItem> = {
|
|
56
|
+
/** Optional components configuration/ Опциональная конфигурация компонентов */
|
|
57
|
+
components?: COMP;
|
|
58
|
+
/** Optional component modifications/ Опциональные модификации компонента */
|
|
59
|
+
compMod?: ConstrComponentMod<P>;
|
|
60
|
+
/** Optional emit handlers/ Опциональные обработчики emit */
|
|
61
|
+
emits?: ConstrEmit<EMITS>;
|
|
62
|
+
/** Optional reactive classes/ Опциональные реактивные классы */
|
|
63
|
+
classes?: RefType<ConstrClasses>;
|
|
64
|
+
/** Optional reactive styles/ Опциональные реактивные стили */
|
|
65
|
+
styles?: RefType<ConstrStyles>;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Constructor setup interface for component initialization/
|
|
69
|
+
* Интерфейс настройки конструктора для инициализации компонента
|
|
70
|
+
*/
|
|
71
|
+
export type ConstrSetup<E extends Element, CLASSES extends ConstrClasses, SETUP extends ConstrItem> = {
|
|
72
|
+
/** Component name/ Имя компонента */
|
|
73
|
+
name: string;
|
|
74
|
+
/** Reactive element reference/ Реактивная ссылка на элемент */
|
|
75
|
+
element: Ref<E | undefined>;
|
|
76
|
+
/** Reactive classes/ Реактивные классы */
|
|
77
|
+
classes: RefType<CLASSES>;
|
|
78
|
+
/** Reactive styles/ Реактивные стили */
|
|
79
|
+
styles: RefType<ConstrStyles>;
|
|
80
|
+
} & SETUP;
|
|
81
|
+
/** Constructor registration configuration/ Конфигурация регистрации конструктора */
|
|
82
|
+
export type ConstrRegistration = {
|
|
83
|
+
/** Optional flag for registration/ Опциональный флаг для регистрации */
|
|
84
|
+
flag?: boolean;
|
|
85
|
+
/** Optional translation map/ Опциональная карта переводов */
|
|
86
|
+
translate?: Record<string, string>;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Constructor bind type for component binding with class and style support/
|
|
90
|
+
* Тип привязки конструктора для привязки компонента с поддержкой классов и стилей
|
|
91
|
+
*/
|
|
92
|
+
export type ConstrBind<T> = T & Record<string, any> & {
|
|
93
|
+
/** Optional CSS classes/ Опциональные CSS классы */
|
|
94
|
+
class?: ConstrClass;
|
|
95
|
+
/** Optional styles/ Опциональные стили */
|
|
96
|
+
style?: ConstrStyles;
|
|
97
|
+
};
|
|
98
|
+
/** Constructor prop item options for Vue prop definitions/ Опции элемента prop конструктора для определений Vue prop */
|
|
99
|
+
export type ConstrPropItemOptions<T = any> = {
|
|
100
|
+
/** Vue prop type/ Тип Vue prop */
|
|
101
|
+
type?: PropType<T>;
|
|
102
|
+
/** Required flag/ Флаг обязательности */
|
|
103
|
+
required?: boolean;
|
|
104
|
+
/** Default value/ Значение по умолчанию */
|
|
105
|
+
default?: any;
|
|
106
|
+
/** Custom validator function/ Пользовательская функция валидации */
|
|
107
|
+
validator?(value: any, props: any): boolean;
|
|
108
|
+
};
|
|
109
|
+
/** Constructor prop item type with options or direct PropType/ Тип элемента prop конструктора с опциями или прямым PropType */
|
|
110
|
+
export type ConstrPropItem<T = any> = ConstrPropItemOptions<T> | PropType<T>;
|
|
111
|
+
/** Constructor props type for component prop definitions/ Тип props конструктора для определений props компонента */
|
|
112
|
+
export type ConstrProps<P = Record<string, any>> = {
|
|
113
|
+
[K in keyof P]: ConstrPropItem<P[K]>;
|
|
114
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Union type for date format options in geographic context/
|
|
3
|
+
* Объединенный тип для опций формата даты в географическом контексте
|
|
4
|
+
*/
|
|
5
|
+
export type GeoDate = 'full' | 'datetime' | 'date' | 'year-month' | 'year' | 'month' | 'day' | 'day-month' | 'time' | 'hour-minute' | 'hour' | 'minute' | 'second';
|
|
6
|
+
/** First day of week code (0=Sunday, 1=Monday, 6=Saturday)/ Код первого дня недели (0=воскресенье, 1=понедельник, 6=суббота) */
|
|
7
|
+
export type GeoFirstDay = 1 | 6 | 0;
|
|
8
|
+
/** Hour format type (12-hour or 24-hour)/ Тип формата часов (12-часовой или 24-часовой) */
|
|
9
|
+
export type GeoHours = '12' | '24';
|
|
10
|
+
/** Timezone display style options/ Опции стиля отображения часового пояса */
|
|
11
|
+
export type GeoTimeZoneStyle = 'minute' | 'hour' | 'ISO8601' | 'RFC';
|
|
12
|
+
/** Geographic item interface for country and language data/ Интерфейс географического элемента для данных страны и языка */
|
|
13
|
+
export interface GeoItem {
|
|
14
|
+
/** Country code/ Код страны */
|
|
15
|
+
country: string;
|
|
16
|
+
/** Alternative country codes/ Альтернативные коды стран */
|
|
17
|
+
countryAlternative?: string[];
|
|
18
|
+
/** Language code/ Код языка */
|
|
19
|
+
language: string;
|
|
20
|
+
/** Alternative language codes/ Альтернативные коды языков */
|
|
21
|
+
languageAlternative?: string[];
|
|
22
|
+
/** First day of week/ Первый день недели */
|
|
23
|
+
firstDay?: string | null;
|
|
24
|
+
/** Timezone/ Часовой пояс */
|
|
25
|
+
zone?: string | null;
|
|
26
|
+
/** Phone country code/ Телефонный код страны */
|
|
27
|
+
phoneCode?: string;
|
|
28
|
+
/** Phone code for domestic calls/ Телефонный код для внутренних звонков */
|
|
29
|
+
phoneWithin?: string;
|
|
30
|
+
/** Phone number mask/ Маска телефонного номера */
|
|
31
|
+
phoneMask?: string | string[];
|
|
32
|
+
/** Name format pattern/ Шаблон формата имени */
|
|
33
|
+
nameFormat?: 'fl' | 'fsl' | 'lf' | 'lsf' | string;
|
|
34
|
+
}
|
|
35
|
+
/** Extended geographic item with required fields/ Расширенный географический элемент с обязательными полями */
|
|
36
|
+
export interface GeoItemFull extends Omit<GeoItem, 'firstDay'> {
|
|
37
|
+
/** Standard locale code/ Стандартный код локали */
|
|
38
|
+
standard: string;
|
|
39
|
+
/** First day of week (required)/ Первый день недели (обязательный) */
|
|
40
|
+
firstDay: string;
|
|
41
|
+
}
|
|
42
|
+
/** Geographic flag item for country flag display/ Элемент географического флага для отображения флага страны */
|
|
43
|
+
export interface GeoFlagItem {
|
|
44
|
+
/** Language name/ Название языка */
|
|
45
|
+
language: string;
|
|
46
|
+
/** Country name/ Название страны */
|
|
47
|
+
country: string;
|
|
48
|
+
/** Standard locale code/ Стандартный код локали */
|
|
49
|
+
standard: string;
|
|
50
|
+
/** Flag icon identifier/ Идентификатор иконки флага */
|
|
51
|
+
icon?: string;
|
|
52
|
+
/** Display label/ Отображаемая метка */
|
|
53
|
+
label: string;
|
|
54
|
+
/** Value for selection/ Значение для выбора */
|
|
55
|
+
value: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extended geographic flag item with national language information/
|
|
59
|
+
* Расширенный элемент географического флага с информацией о национальном языке
|
|
60
|
+
*/
|
|
61
|
+
export interface GeoFlagNational extends GeoFlagItem {
|
|
62
|
+
/** Description in national language/ Описание на национальном языке */
|
|
63
|
+
description: string;
|
|
64
|
+
/** Language name in national language/ Название языка на национальном языке */
|
|
65
|
+
nationalLanguage: string;
|
|
66
|
+
/** Country name in national language/ Название страны на национальном языке */
|
|
67
|
+
nationalCountry: string;
|
|
68
|
+
}
|
|
69
|
+
export interface GeoPhoneValue {
|
|
70
|
+
phone: number;
|
|
71
|
+
within: number;
|
|
72
|
+
mask: string[];
|
|
73
|
+
value: string;
|
|
74
|
+
}
|
|
75
|
+
export interface GeoPhoneMap {
|
|
76
|
+
items: GeoPhoneValue[];
|
|
77
|
+
info: GeoPhoneValue | undefined;
|
|
78
|
+
value: string | undefined;
|
|
79
|
+
mask: string[];
|
|
80
|
+
maskFull: string[];
|
|
81
|
+
next: Record<string, GeoPhoneMap>;
|
|
82
|
+
}
|
|
83
|
+
export interface GeoPhoneMapInfo {
|
|
84
|
+
item?: GeoPhoneMap;
|
|
85
|
+
phone?: string;
|
|
86
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ConstrBind } from './constructorTypes';
|
|
2
|
+
import { NumberOrString, NumberOrStringOrBoolean } from './basicTypes';
|
|
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
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Array of extended list items with state/
|
|
44
|
+
* Массив расширенных элементов списка с состоянием
|
|
45
|
+
*/
|
|
46
|
+
export type ListDataFull<Item extends ListDataBasic = ListDataBasic> = ListDataFullItem<Item>[];
|
|
47
|
+
/** Input item for list creation/ Входной элемент для создания списка */
|
|
48
|
+
export type ListListInputItem<Item extends ListDataBasic = ListDataBasic> = ConstrBind<Item>;
|
|
49
|
+
/**
|
|
50
|
+
* Various input formats for list creation/
|
|
51
|
+
* Различные форматы входных данных для создания списка
|
|
52
|
+
*/
|
|
53
|
+
export type ListListInput<Item extends ListDataBasic = ListDataBasic> = ListListInputItem<Item>[] | string[] | Record<string, ListListInputItem<Item>> | Record<string, string>;
|
|
54
|
+
/** Single selected item identifier/ Идентификатор одного выбранного элемента */
|
|
55
|
+
export type ListSelectedItem = NumberOrStringOrBoolean;
|
|
56
|
+
/** Single or multiple selected items/ Один или несколько выбранных элементов */
|
|
57
|
+
export type ListSelectedList = ListSelectedItem | ListSelectedItem[];
|
|
58
|
+
/** Name of selected list item/ Название выбранного элемента списка */
|
|
59
|
+
export type ListName = string | number | undefined;
|
|
60
|
+
/** Array of list item names/ Массив названий выбранных элементов списка */
|
|
61
|
+
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
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxtmisha/functional",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "1.0.9",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Comprehensive functional utilities library for DXT UI - classes, composables, functions and types for modern web development",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"functional",
|
|
9
|
+
"utilities",
|
|
10
|
+
"helpers",
|
|
11
|
+
"typescript",
|
|
12
|
+
"vue",
|
|
13
|
+
"composables",
|
|
14
|
+
"classes",
|
|
15
|
+
"geo",
|
|
16
|
+
"datetime",
|
|
17
|
+
"cache",
|
|
18
|
+
"api",
|
|
19
|
+
"ui",
|
|
20
|
+
"dxt"
|
|
21
|
+
],
|
|
22
|
+
"author": "dxtmisha@gmail.com",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"homepage": "https://github.com/dxtmisha/dxt-ui/tree/main/packages/functional",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/dxtmisha/dxt-ui.git",
|
|
28
|
+
"directory": "packages/functional"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/dxtmisha/dxt-ui/issues"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"dev": "vite",
|
|
35
|
+
"build": "vue-tsc -b && vite build",
|
|
36
|
+
"preview": "vite preview",
|
|
37
|
+
"test": "vitest",
|
|
38
|
+
"library": "dxt-library",
|
|
39
|
+
"prepublishOnly": "npm run build"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"README.md",
|
|
44
|
+
"package.json",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"main": "dist/library.js",
|
|
48
|
+
"module": "dist/library.js",
|
|
49
|
+
"types": "dist/library.d.ts",
|
|
50
|
+
"exports": {
|
|
51
|
+
".": {
|
|
52
|
+
"import": "./dist/library.js",
|
|
53
|
+
"types": "./dist/library.d.ts"
|
|
54
|
+
},
|
|
55
|
+
"./flags": {
|
|
56
|
+
"import": "./dist/flags.js",
|
|
57
|
+
"types": "./dist/flags.d.ts"
|
|
58
|
+
},
|
|
59
|
+
"./types/*": "./dist/*"
|
|
60
|
+
},
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=18.0.0"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@dxtmisha/media": ">=0.3.0",
|
|
66
|
+
"vue": ">=3.0.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"@dxtmisha/media": {
|
|
70
|
+
"optional": true
|
|
71
|
+
},
|
|
72
|
+
"vue": {
|
|
73
|
+
"optional": true
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {}
|
|
77
|
+
}
|