@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,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Working with data stored in hash.
|
|
3
|
+
*
|
|
4
|
+
* Работа с данными сохраненными в хеш.
|
|
5
|
+
*/
|
|
6
|
+
export declare class Hash {
|
|
7
|
+
private static hash;
|
|
8
|
+
private static watch;
|
|
9
|
+
private static block;
|
|
10
|
+
/**
|
|
11
|
+
* Get data from hash.
|
|
12
|
+
*
|
|
13
|
+
* Получение данных из хэша.
|
|
14
|
+
* @param name variable names/ названия переменных
|
|
15
|
+
* @param defaultValue value or function to change data/ значение или функция для изменения данных
|
|
16
|
+
*/
|
|
17
|
+
static get<T>(name: string, defaultValue?: T | (() => T)): T;
|
|
18
|
+
/**
|
|
19
|
+
* Change data in hash.
|
|
20
|
+
*
|
|
21
|
+
* Изменение данных в хэше.
|
|
22
|
+
* @param name variable names/ названия переменных
|
|
23
|
+
* @param callback value or function to change data/ значение или функция для изменения данных
|
|
24
|
+
*/
|
|
25
|
+
static set<T>(name: string, callback: T | (() => T)): void;
|
|
26
|
+
/**
|
|
27
|
+
* Adding an event when data is changed.
|
|
28
|
+
*
|
|
29
|
+
* Добавление события при изменении данных.
|
|
30
|
+
* @param name variable names/ названия переменных
|
|
31
|
+
* @param callback the function is called when the data is changed/ функция вызывается при изменении данных
|
|
32
|
+
*/
|
|
33
|
+
static addWatch<T>(name: string, callback: (value: T) => void): void;
|
|
34
|
+
/**
|
|
35
|
+
* Update hash variable from URL string.
|
|
36
|
+
*
|
|
37
|
+
* Обновление переменной хэша из строки URL.
|
|
38
|
+
*/
|
|
39
|
+
static reload(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Obtaining data from the URL string.
|
|
42
|
+
*
|
|
43
|
+
* Получение данных из строки URL.
|
|
44
|
+
*/
|
|
45
|
+
private static getLocation;
|
|
46
|
+
/**
|
|
47
|
+
* Update hash string in URL.
|
|
48
|
+
*
|
|
49
|
+
* Обновление строки хэша в URL.
|
|
50
|
+
*/
|
|
51
|
+
private static update;
|
|
52
|
+
/**
|
|
53
|
+
* Calling all functions whose data has changed.
|
|
54
|
+
*
|
|
55
|
+
* Вызов всех функций, у которых были изменены данные.
|
|
56
|
+
* @param location fresh data/ свежий данные
|
|
57
|
+
*/
|
|
58
|
+
private static makeWatch;
|
|
59
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type IconsItem = string | Promise<string | any>;
|
|
2
|
+
/**
|
|
3
|
+
* Class for managing icons.
|
|
4
|
+
*
|
|
5
|
+
* Класс для управления иконками.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Icons {
|
|
8
|
+
protected static icons: Record<string, IconsItem>;
|
|
9
|
+
protected static url: string;
|
|
10
|
+
/**
|
|
11
|
+
* Checks if the given icon is in the list of connected icons.
|
|
12
|
+
*
|
|
13
|
+
* Проверяет, есть ли данная иконка в списке подключенных иконок.
|
|
14
|
+
* @param index icon name/ название иконки
|
|
15
|
+
*/
|
|
16
|
+
static is(index: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the icon by the name.
|
|
19
|
+
*
|
|
20
|
+
* Возвращает иконку по названию.
|
|
21
|
+
* @param index icon name/ название иконки
|
|
22
|
+
* @param url path to the storage location of the icon, if the icon does not exist/
|
|
23
|
+
* путь к месту хранения иконки, если иконка не существует
|
|
24
|
+
* @param wait waiting time for picture loading/
|
|
25
|
+
* время ожидания загрузки картинки
|
|
26
|
+
*/
|
|
27
|
+
static get(index: string, url?: string, wait?: number): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a list of names of all registered icons.
|
|
30
|
+
*
|
|
31
|
+
* Возвращает список названий всех зарегистрированных иконок.
|
|
32
|
+
*/
|
|
33
|
+
static getNameList(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Returns a global link.
|
|
36
|
+
*
|
|
37
|
+
* Возвращает глобальную ссылку.
|
|
38
|
+
*/
|
|
39
|
+
static getUrlGlobal(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Adding custom icons.
|
|
42
|
+
*
|
|
43
|
+
* Добавление пользовательских иконок.
|
|
44
|
+
* @param index icon name/ название иконки
|
|
45
|
+
* @param file path to the file/ путь к файлу
|
|
46
|
+
*/
|
|
47
|
+
static add(index: string, file: IconsItem): void;
|
|
48
|
+
/**
|
|
49
|
+
* Adding custom icons in loading mode.
|
|
50
|
+
*
|
|
51
|
+
* Добавление пользовательских иконок в режиме загрузки.
|
|
52
|
+
* @param index icon name/ название иконки
|
|
53
|
+
*/
|
|
54
|
+
static addLoad(index: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Adding custom global icons.
|
|
57
|
+
*
|
|
58
|
+
* Добавление пользовательских глобальных иконок.
|
|
59
|
+
* @param index icon name/ название иконки
|
|
60
|
+
* @param file path to the file/ путь к файлу
|
|
61
|
+
*/
|
|
62
|
+
static addGlobal(index: string, file: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Adding an icon by the list.
|
|
65
|
+
*
|
|
66
|
+
* Добавление иконки по списку.
|
|
67
|
+
* @param list list of icons/ список иконки
|
|
68
|
+
*/
|
|
69
|
+
static addByList(list: Record<string, IconsItem>): void;
|
|
70
|
+
/**
|
|
71
|
+
* Changes the file path.
|
|
72
|
+
*
|
|
73
|
+
* Изменяет путь к файлу.
|
|
74
|
+
* @param url new file path/ новый путь к файлу
|
|
75
|
+
*/
|
|
76
|
+
static setUrl(url: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the icon name.
|
|
79
|
+
*
|
|
80
|
+
* Возвращает название иконки.
|
|
81
|
+
* @param index icon name/ название иконки
|
|
82
|
+
*/
|
|
83
|
+
protected static getName(index: string): string;
|
|
84
|
+
/**
|
|
85
|
+
* Script execution delay.
|
|
86
|
+
*
|
|
87
|
+
* Задержка выполнения скрипта.
|
|
88
|
+
*/
|
|
89
|
+
protected static wait(): Promise<void>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EventItem } from './EventItem';
|
|
2
|
+
import { ElementOrString, EventListenerDetail } from '../types/basicTypes';
|
|
3
|
+
type LoadingDetail = {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Class for working with global loading.
|
|
8
|
+
*
|
|
9
|
+
* Класс для работы с глобальной загрузкой.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Loading {
|
|
12
|
+
protected static value: number;
|
|
13
|
+
protected static event?: EventItem<Window, CustomEvent>;
|
|
14
|
+
/**
|
|
15
|
+
* Check if the loader is active now.
|
|
16
|
+
*
|
|
17
|
+
* Проверить, активен ли сейчас загрузчик.
|
|
18
|
+
*/
|
|
19
|
+
static is(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Shows the loader.
|
|
22
|
+
*
|
|
23
|
+
* Показывает загрузчик.
|
|
24
|
+
*/
|
|
25
|
+
static show(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Hides the loader.
|
|
28
|
+
*
|
|
29
|
+
* Скрывает загрузчик.
|
|
30
|
+
*/
|
|
31
|
+
static hide(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Event registration to listen for data changes.
|
|
34
|
+
*
|
|
35
|
+
* Регистрация события для прослушивания изменений данных.
|
|
36
|
+
* @param listener the object that receives a notification (an object that implements the
|
|
37
|
+
* Event interface) when an event of the specified type occurs/ объект, который принимает
|
|
38
|
+
* уведомление, когда событие указанного типа произошло
|
|
39
|
+
* @param element element/ элемент
|
|
40
|
+
*/
|
|
41
|
+
static registrationEvent(listener: EventListenerDetail<CustomEvent, LoadingDetail>, element?: ElementOrString<HTMLElement>): void;
|
|
42
|
+
/**
|
|
43
|
+
* Calls the event listener.
|
|
44
|
+
*
|
|
45
|
+
* Вызывает слушателя событий.
|
|
46
|
+
*/
|
|
47
|
+
protected static dispatch(): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Class for getting the scroll width.
|
|
3
|
+
*
|
|
4
|
+
* Класс для получения ширины скролла.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ScrollbarWidth {
|
|
7
|
+
private static storage;
|
|
8
|
+
private static calculate;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether to enable scroll hiding.
|
|
11
|
+
*
|
|
12
|
+
* Проверяет, надо ли включить скрытие скролла.
|
|
13
|
+
*/
|
|
14
|
+
static is(): Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the width of the scroll.
|
|
17
|
+
*
|
|
18
|
+
* Возвращает ширину скролла.
|
|
19
|
+
*/
|
|
20
|
+
static get(): Promise<number>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates elements to check the width of the scroll.
|
|
23
|
+
*
|
|
24
|
+
* Создает элементы для проверки ширины скролла.
|
|
25
|
+
*/
|
|
26
|
+
private static createElement;
|
|
27
|
+
/**
|
|
28
|
+
* Initialization of data to check the width of the scroll.
|
|
29
|
+
*
|
|
30
|
+
* Инициализация данных для проверки ширины скролла.
|
|
31
|
+
*/
|
|
32
|
+
private static init;
|
|
33
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type TranslateCode = string | string[];
|
|
2
|
+
export type TranslateList<T extends TranslateCode[]> = {
|
|
3
|
+
[K in T[number] as K extends readonly string[] ? K[0] : K]: string;
|
|
4
|
+
};
|
|
5
|
+
export type TranslateItemOrList<T extends TranslateCode> = T extends string[] ? TranslateList<T> : string;
|
|
6
|
+
/**
|
|
7
|
+
* Class for getting the translated text.
|
|
8
|
+
*
|
|
9
|
+
* Класс для получения переведенного текста.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Translate {
|
|
12
|
+
protected static url: string;
|
|
13
|
+
protected static propsName: string;
|
|
14
|
+
protected static readonly data: Record<string, string>;
|
|
15
|
+
protected static cache: string[];
|
|
16
|
+
protected static resolveList: (() => void)[];
|
|
17
|
+
protected static timeout?: any;
|
|
18
|
+
/**
|
|
19
|
+
* Getting the translation text by its code.
|
|
20
|
+
*
|
|
21
|
+
* Получение текста перевода по его коду.
|
|
22
|
+
* @param name code name/ название кода
|
|
23
|
+
* @param replacement If set, replaces the text with the specified values/ если установлено, заменяет текст на указанные значения
|
|
24
|
+
*/
|
|
25
|
+
static get(name: string, replacement?: string[] | Record<string, string | number>): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Getting the translation text by its code (Sync).
|
|
28
|
+
*
|
|
29
|
+
* Получение текста перевода по его коду (Sync).
|
|
30
|
+
* @param name code name/ название кода
|
|
31
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
32
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
33
|
+
* @param replacement If set, replaces the text with the specified values/
|
|
34
|
+
* если установлено, заменяет текст на указанные значения
|
|
35
|
+
*/
|
|
36
|
+
static getSync(name: string, first?: boolean, replacement?: string[] | Record<string, string | number>): string;
|
|
37
|
+
/**
|
|
38
|
+
* Getting a list of translations by an array of text codes.
|
|
39
|
+
*
|
|
40
|
+
* Получение списка переводов по массиву кодов текста.
|
|
41
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
42
|
+
*/
|
|
43
|
+
static getList<T extends TranslateCode[]>(names: T): Promise<TranslateList<T>>;
|
|
44
|
+
/**
|
|
45
|
+
* Getting a list of translations by an array of text codes.
|
|
46
|
+
*
|
|
47
|
+
* Получение списка переводов по массиву кодов текста.
|
|
48
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
49
|
+
* @param first If set to false, returns an empty string if there is no text/
|
|
50
|
+
* если установлено false, возвращает пустую строку, если нет текста
|
|
51
|
+
*/
|
|
52
|
+
static getListSync<T extends TranslateCode[]>(names: T, first?: boolean): TranslateList<T>;
|
|
53
|
+
/**
|
|
54
|
+
* Added a list of translated texts.
|
|
55
|
+
*
|
|
56
|
+
* Добавлен список переведенных текстов.
|
|
57
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
58
|
+
*/
|
|
59
|
+
static add(names: string | string[]): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Adds texts in sync mode.
|
|
62
|
+
*
|
|
63
|
+
* Добавляет тексты в режиме синхронизации.
|
|
64
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
65
|
+
*/
|
|
66
|
+
static addSync(data: Record<string, string>): void;
|
|
67
|
+
/**
|
|
68
|
+
* Adding data in the form of a query or directly, depending on the execution environment.
|
|
69
|
+
*
|
|
70
|
+
* Добавление данных в виде запроса или напрямую, в зависимости от среды выполнения.
|
|
71
|
+
* @param data list of texts in the form of key-value/ список текстов в виде ключ-значение
|
|
72
|
+
*/
|
|
73
|
+
static addNormalOrSync(data: Record<string, string>): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Change the path to the script for obtaining the translation.
|
|
76
|
+
*
|
|
77
|
+
* Изменить путь к скрипту для получения перевода.
|
|
78
|
+
* @param url path to the script/ путь к скрипту
|
|
79
|
+
*/
|
|
80
|
+
static setUrl(url: string): Translate;
|
|
81
|
+
static setPropsName(name: string): Translate;
|
|
82
|
+
/**
|
|
83
|
+
* Getting the full title for translation.
|
|
84
|
+
*
|
|
85
|
+
* Получение полного названия для перевода.
|
|
86
|
+
* @param name code name/ название кода
|
|
87
|
+
*/
|
|
88
|
+
protected static getName(name: string): string;
|
|
89
|
+
/**
|
|
90
|
+
* Returns a list of names that are not yet in the list.
|
|
91
|
+
*
|
|
92
|
+
* Возвращает список имен, которых еще нет в списке.
|
|
93
|
+
* @param names list of codes to get translations/ список кодов для получения переводов
|
|
94
|
+
*/
|
|
95
|
+
protected static getNamesNone(names: string | string[]): string[];
|
|
96
|
+
/**
|
|
97
|
+
* Getting the list of translations from the server.
|
|
98
|
+
*
|
|
99
|
+
* Получение списка переводов с сервера.
|
|
100
|
+
*/
|
|
101
|
+
protected static getResponse(): Promise<Record<string, string>>;
|
|
102
|
+
/**
|
|
103
|
+
* Replaces the text with the specified values.
|
|
104
|
+
*
|
|
105
|
+
* Заменяет текст на указанные значения.
|
|
106
|
+
* @param text text to replace/ текст для замены
|
|
107
|
+
* @param replacement values for replacement/ значения для замены
|
|
108
|
+
*/
|
|
109
|
+
protected static replacement(text: string, replacement?: string[] | Record<string, string | number>): any;
|
|
110
|
+
/**
|
|
111
|
+
* Adding translation data from the server.
|
|
112
|
+
*
|
|
113
|
+
* Добавление данных по переводу с сервера.
|
|
114
|
+
*/
|
|
115
|
+
protected static make(): Promise<void>;
|
|
116
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DesignChanged } from './DesignChanged';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for working with the constructor.
|
|
4
|
+
*
|
|
5
|
+
* Базовый класс для работы с конструктором.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class DesignAbstract<T extends Record<string, any>, C extends Record<string, any>> {
|
|
8
|
+
protected readonly props: T;
|
|
9
|
+
protected readonly callback?: ((event: C) => void) | undefined;
|
|
10
|
+
protected readonly event: C;
|
|
11
|
+
protected readonly changed: DesignChanged<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Constructor
|
|
14
|
+
* @param props base data/ базовые данные
|
|
15
|
+
* @param callback callback function when the value changes/
|
|
16
|
+
* функция обратного вызова при изменении значения
|
|
17
|
+
* @param changed base data/ данный для слежения
|
|
18
|
+
*/
|
|
19
|
+
constructor(props: T, callback?: ((event: C) => void) | undefined, changed?: string[]);
|
|
20
|
+
/**
|
|
21
|
+
* Calls the callback function.
|
|
22
|
+
*
|
|
23
|
+
* Вызывает функцию обратного вызова.
|
|
24
|
+
* @param compelled forces data to update/ вынуждает обновлять данные
|
|
25
|
+
*/
|
|
26
|
+
make(compelled?: boolean): this;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if there are values in the property.
|
|
29
|
+
*
|
|
30
|
+
* Проверяет, есть ли значения в свойстве.
|
|
31
|
+
* @param name property names/ названия свойств
|
|
32
|
+
*/
|
|
33
|
+
protected is<K extends keyof T>(name: K): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if the value has been changed by the property name.
|
|
36
|
+
*
|
|
37
|
+
* Проверяет, было ли изменено значение по названию свойства.
|
|
38
|
+
* @param name property names/ названия свойств
|
|
39
|
+
* @param nameProp names of properties of the input variable/ названия свойств входной переменной
|
|
40
|
+
*/
|
|
41
|
+
protected isChanged<K extends keyof C & string, KT extends keyof T & string>(name: K, nameProp?: KT | KT[]): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Calls the callback function.
|
|
44
|
+
*
|
|
45
|
+
* Вызывает функцию обратного вызова.
|
|
46
|
+
* @param compelled forces data to update/ вынуждает обновлять данные
|
|
47
|
+
*/
|
|
48
|
+
makeCallback(compelled?: boolean): void;
|
|
49
|
+
/**
|
|
50
|
+
* The function calls an image call.
|
|
51
|
+
*
|
|
52
|
+
* Функция вызывает образный вызов.
|
|
53
|
+
*/
|
|
54
|
+
protected makeCallbackItem(): void;
|
|
55
|
+
/**
|
|
56
|
+
* A function that is called each time the input values are changed.
|
|
57
|
+
*
|
|
58
|
+
* Функция, которая вызывается каждый раз, когда изменяются входные значения.
|
|
59
|
+
*/
|
|
60
|
+
protected abstract initEvent(): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DesignAbstract } from './DesignAbstract';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for working with the constructor.
|
|
4
|
+
*
|
|
5
|
+
* Базовый класс для работы с конструктором.
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class DesignAsyncAbstract<T extends Record<string, any>, C extends Record<string, any>> extends DesignAbstract<T, C> {
|
|
8
|
+
/**
|
|
9
|
+
* Calls the callback function.
|
|
10
|
+
*
|
|
11
|
+
* Вызывает функцию обратного вызова.
|
|
12
|
+
* @param compelled forces data to update/ вынуждает обновлять данные
|
|
13
|
+
*/
|
|
14
|
+
make(compelled?: boolean): this;
|
|
15
|
+
/**
|
|
16
|
+
* Calls the callback function.
|
|
17
|
+
*
|
|
18
|
+
* Вызывает функцию обратного вызова.
|
|
19
|
+
* @param compelled forces data to update/ вынуждает обновлять данные
|
|
20
|
+
*/
|
|
21
|
+
makeCallback(compelled?: boolean): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* A function that is called each time the input values are changed.
|
|
24
|
+
*
|
|
25
|
+
* Функция, которая вызывается каждый раз, когда изменяются входные значения.
|
|
26
|
+
*/
|
|
27
|
+
protected abstract initEvent(): Promise<void>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The class checks the values that have been edited.
|
|
3
|
+
*
|
|
4
|
+
* Класс проверяет значения, которые были отредактированы.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DesignChanged<T extends Record<string, any>> {
|
|
7
|
+
protected readonly props: T;
|
|
8
|
+
protected readonly watch: string[];
|
|
9
|
+
private readonly cache;
|
|
10
|
+
/**
|
|
11
|
+
* Constructor
|
|
12
|
+
* @param props base data/ базовые данные
|
|
13
|
+
* @param watch data for tracking/ данные для слежения
|
|
14
|
+
*/
|
|
15
|
+
constructor(props: T, watch?: string[]);
|
|
16
|
+
/**
|
|
17
|
+
* Checks if the value has been updated.
|
|
18
|
+
*
|
|
19
|
+
* Проверяет, обновлено ли значение.
|
|
20
|
+
* @param name property name/ название свойства
|
|
21
|
+
*/
|
|
22
|
+
is(name: string | string[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if there are changes in the data.
|
|
25
|
+
*
|
|
26
|
+
* Проверяет, есть ли изменения в данных.
|
|
27
|
+
*/
|
|
28
|
+
isChanged(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Updates all values.
|
|
31
|
+
*
|
|
32
|
+
* Обновляет все значения.
|
|
33
|
+
*/
|
|
34
|
+
update(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Checking additional data.
|
|
37
|
+
*
|
|
38
|
+
* Проверка дополнительных данных.
|
|
39
|
+
* @param name property name/ название свойства
|
|
40
|
+
*/
|
|
41
|
+
protected isDifferent(name: string): boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ComputedRef, VNode } from 'vue';
|
|
2
|
+
import { RawChildren, RawSlots } from '../../types/refTypes';
|
|
3
|
+
import { ConstrComponent, ConstrComponentMod, ConstrItem } from '../../types/constructorTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Class for working with connected components.
|
|
6
|
+
*
|
|
7
|
+
* Класс для работы с подключенными компонентами.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DesignComponents<COMP extends ConstrComponent, P extends ConstrItem> {
|
|
10
|
+
protected readonly components: COMP;
|
|
11
|
+
protected readonly modification?: ConstrComponentMod<P> | undefined;
|
|
12
|
+
/** Cache for computed properties/ Кэш для вычисляемых свойств */
|
|
13
|
+
protected caching: Record<string, ComputedRef<any>>;
|
|
14
|
+
/**
|
|
15
|
+
* Constructor
|
|
16
|
+
* @param components list of connected components/ список подключенных компонентов
|
|
17
|
+
* @param modification data for modification/ данные для модификации
|
|
18
|
+
*/
|
|
19
|
+
constructor(components?: COMP, modification?: ConstrComponentMod<P> | undefined);
|
|
20
|
+
/**
|
|
21
|
+
* Check the presence of the component.
|
|
22
|
+
*
|
|
23
|
+
* Проверить наличие компонента.
|
|
24
|
+
* @param name name of the component/ названия компонента
|
|
25
|
+
*/
|
|
26
|
+
is<K extends keyof COMP>(name: K): name is K;
|
|
27
|
+
/**
|
|
28
|
+
* Getting the object of the component.
|
|
29
|
+
*
|
|
30
|
+
* Получение объекта компонента.
|
|
31
|
+
* @param name name of the component/ названия компонента
|
|
32
|
+
*/
|
|
33
|
+
get<K extends keyof COMP>(name: K): COMP[K];
|
|
34
|
+
/**
|
|
35
|
+
* Returns the modified input data of the connected components.
|
|
36
|
+
*
|
|
37
|
+
* Возвращает модифицированные входные данные у подключенных компонентов.
|
|
38
|
+
* @param index the name of this/ название данного
|
|
39
|
+
* @param props basic data/ базовые данные
|
|
40
|
+
*/
|
|
41
|
+
getModification<K extends keyof P>(index?: K & string | string, props?: P[K] | Record<string, any>): Record<string, any> | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Rendering a component by its name and returning an array with one component.
|
|
44
|
+
*
|
|
45
|
+
* Рендеринг компонента по его имени и возвращение массива с одним компонентом.
|
|
46
|
+
* @param name name of the component/ названия компонента
|
|
47
|
+
* @param props property of the component/ свойство компонента
|
|
48
|
+
* @param children sub-elements of the component/ под элементы компонента
|
|
49
|
+
* @param index the name of the key/ названия ключа
|
|
50
|
+
*/
|
|
51
|
+
render<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode[];
|
|
52
|
+
/**
|
|
53
|
+
* Rendering a component by its name.
|
|
54
|
+
*
|
|
55
|
+
* Рендеринг компонента по его имени.
|
|
56
|
+
* @param name name of the component/ названия компонента
|
|
57
|
+
* @param props property of the component/ свойство компонента
|
|
58
|
+
* @param children sub-elements of the component/ под элементы компонента
|
|
59
|
+
* @param index the name of the key/ названия ключа
|
|
60
|
+
*/
|
|
61
|
+
renderOne<K extends keyof COMP, PK extends keyof P>(name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): VNode | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Rendering the component by its name.
|
|
64
|
+
*
|
|
65
|
+
* Рендеринг компонента по его имени.
|
|
66
|
+
* @param item an array to which the rendered object will be added/
|
|
67
|
+
* массив, по которому будет добавлять объект
|
|
68
|
+
* @param name name of the component/ названия компонента
|
|
69
|
+
* @param props property of the component/ свойство компонента
|
|
70
|
+
* @param children sub-elements of the component/ под элементы компонента
|
|
71
|
+
* @param index the name of the key/ названия ключа
|
|
72
|
+
*/
|
|
73
|
+
renderAdd<K extends keyof COMP, PK extends keyof P>(item: any[], name: K & string, props?: P[PK] & ConstrItem | ConstrItem, children?: RawChildren | RawSlots, index?: PK & string | string): this;
|
|
74
|
+
/**
|
|
75
|
+
* Calculates modified input data for connected components.
|
|
76
|
+
*
|
|
77
|
+
* Вычисляет модифицированные входные данные для подключенных компонентов.
|
|
78
|
+
* @param index the name of this/ название данного
|
|
79
|
+
*/
|
|
80
|
+
protected computeModification<K extends keyof P>(index: K & string | string): Record<string, any>;
|
|
81
|
+
}
|