@sima-land/ui-nucleons 44.2.10 → 45.0.0-alpha.0
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/_internal/custom-scrollbar/index.d.ts +13 -7
- package/_internal/custom-scrollbar/index.js +29 -15
- package/_internal/dropdown-loading/index.d.ts +3 -3
- package/_internal/dropdown-loading/index.js +4 -2
- package/_internal/page-scroll-lock/adapters/body-scroll-lock.d.ts +39 -0
- package/_internal/page-scroll-lock/adapters/body-scroll-lock.js +62 -0
- package/_internal/page-scroll-lock/adapters/ui-nucleons.d.ts +25 -0
- package/_internal/page-scroll-lock/adapters/ui-nucleons.js +103 -0
- package/_internal/page-scroll-lock/context.d.ts +13 -0
- package/_internal/page-scroll-lock/context.js +54 -0
- package/_internal/page-scroll-lock/hook.d.ts +12 -0
- package/_internal/page-scroll-lock/hook.js +26 -0
- package/_internal/page-scroll-lock/index.d.ts +4 -0
- package/_internal/page-scroll-lock/index.js +9 -0
- package/_internal/page-scroll-lock/types.d.ts +22 -0
- package/_internal/{checkbox/index.js → page-scroll-lock/types.js} +0 -0
- package/_internal/readme.md +2 -0
- package/_internal/utils/dropdown.d.ts +1 -0
- package/_internal/utils/dropdown.js +1 -0
- package/alert/alert.module.scss +1 -24
- package/alert/index.d.ts +11 -17
- package/alert/index.js +33 -16
- package/arrow-button/arrow-button.module.scss +2 -0
- package/arrow-button/index.d.ts +2 -2
- package/autocomplete/autocomplete.d.ts +8 -0
- package/autocomplete/autocomplete.js +190 -0
- package/autocomplete/autocomplete.module.scss +2 -15
- package/autocomplete/index.d.ts +2 -27
- package/autocomplete/index.js +2 -126
- package/autocomplete/types.d.ts +19 -0
- package/autocomplete/types.js +2 -0
- package/autocomplete-deprecated/autocomplete.module.scss +20 -0
- package/autocomplete-deprecated/index.d.ts +28 -0
- package/autocomplete-deprecated/index.js +130 -0
- package/avatar/index.d.ts +2 -2
- package/avatar/user.d.ts +1 -1
- package/base-input/base-input.d.ts +11 -0
- package/base-input/base-input.js +96 -0
- package/base-input/base-input.module.scss +3 -3
- package/base-input/index.d.ts +2 -23
- package/base-input/index.js +2 -76
- package/base-input/types.d.ts +31 -0
- package/base-input/types.js +2 -0
- package/base-input/utils.d.ts +6 -0
- package/base-input/utils.js +14 -0
- package/base-input-deprecated/base-input.module.scss +66 -0
- package/base-input-deprecated/index.d.ts +24 -0
- package/base-input-deprecated/index.js +80 -0
- package/bordered-layout/index.d.ts +1 -0
- package/bordered-layout/index.js +1 -0
- package/bottom-bar/bottom-bar-util.scss +20 -0
- package/bottom-bar/bottom-bar.d.ts +12 -0
- package/bottom-bar/bottom-bar.js +47 -0
- package/bottom-bar/bottom-bar.module.scss +14 -0
- package/bottom-bar/index.d.ts +2 -21
- package/bottom-bar/index.js +5 -44
- package/bottom-bar/types.d.ts +10 -0
- package/bottom-bar/types.js +2 -0
- package/box/index.d.ts +1 -1
- package/breakpoints.scss +1 -1
- package/button/button.module.scss +70 -53
- package/button/index.d.ts +26 -41
- package/button/index.js +22 -46
- package/card/index.d.ts +2 -1
- package/card/index.js +23 -6
- package/card/slots.d.ts +17 -3
- package/card/slots.js +15 -13
- package/carousel/draggable.d.ts +7 -3
- package/carousel/draggable.js +10 -3
- package/carousel/helpers/draggable-event.d.ts +5 -2
- package/carousel/helpers/draggable-event.js +5 -0
- package/carousel/index.d.ts +1 -1
- package/carousel/index.js +24 -24
- package/checkbox/checkbox.module.scss +1 -0
- package/checkbox/index.d.ts +3 -3
- package/checkbox-field/index.d.ts +3 -0
- package/checkbox-field/index.js +3 -0
- package/clean-buttons/clean-buttons-util.scss +15 -0
- package/clean-buttons/clean-buttons.module.scss +5 -3
- package/clean-buttons/index.d.ts +16 -7
- package/clean-buttons/index.js +17 -14
- package/clean-buttons/types.d.ts +1 -1
- package/clean-buttons/utils.d.ts +5 -1
- package/clean-buttons/utils.js +4 -0
- package/{colors.d.ts → colors/index.d.ts} +1 -1
- package/{colors.js → colors/index.js} +0 -0
- package/dot-nav/index.d.ts +1 -1
- package/dropdown/index.d.ts +1 -0
- package/dropdown/utils.d.ts +19 -0
- package/dropdown/utils.js +45 -0
- package/dropdown-item/dropdown-item.module.scss +80 -15
- package/dropdown-item/index.d.ts +20 -9
- package/dropdown-item/index.js +12 -9
- package/dropdown-item/types.d.ts +3 -0
- package/dropdown-item/types.js +2 -0
- package/dropdown-item/utils.d.ts +45 -0
- package/dropdown-item/utils.js +89 -0
- package/expandable/utils.js +3 -3
- package/field-block/field-block.module.scss +155 -0
- package/field-block/index.d.ts +63 -0
- package/field-block/index.js +43 -0
- package/field-grid/index.d.ts +5 -4
- package/field-grid/index.js +1 -0
- package/helpers/bounds-of.d.ts +5 -1
- package/helpers/bounds-of.js +5 -0
- package/helpers/center-of.d.ts +4 -1
- package/helpers/center-of.js +8 -1
- package/helpers/create-container.d.ts +5 -2
- package/helpers/create-container.js +7 -2
- package/helpers/define-slots.d.ts +3 -3
- package/helpers/define-slots.js +5 -3
- package/helpers/events.d.ts +16 -8
- package/helpers/events.js +41 -15
- package/helpers/find-child-element.d.ts +12 -9
- package/helpers/find-child-element.js +9 -5
- package/helpers/find-offset-parent.d.ts +1 -2
- package/helpers/find-offset-parent.js +2 -2
- package/helpers/find-sibling-index.d.ts +11 -8
- package/helpers/find-sibling-index.js +8 -3
- package/helpers/fit-element-height.d.ts +5 -5
- package/helpers/fit-element-height.js +9 -7
- package/helpers/format-date.d.ts +11 -11
- package/helpers/format-date.js +15 -13
- package/helpers/format-number.d.ts +1 -1
- package/helpers/format-number.js +2 -2
- package/helpers/get-date-interval-data.d.ts +4 -1
- package/helpers/get-date-interval-data.js +7 -2
- package/helpers/get-declination.d.ts +5 -1
- package/helpers/get-declination.js +5 -0
- package/helpers/get-fraction-depth.d.ts +1 -1
- package/helpers/get-fraction-depth.js +2 -2
- package/helpers/get-no-index.d.ts +2 -2
- package/helpers/get-no-index.js +4 -3
- package/helpers/get-relative-pos.d.ts +4 -1
- package/helpers/get-relative-pos.js +7 -2
- package/helpers/get-scroll-parent.d.ts +1 -2
- package/helpers/get-scroll-parent.js +5 -5
- package/helpers/is-browser.d.ts +4 -1
- package/helpers/is-browser.js +8 -1
- package/helpers/is-fully-scrolled.d.ts +3 -3
- package/helpers/is-fully-scrolled.js +2 -2
- package/helpers/is-touch-device.d.ts +1 -1
- package/helpers/is-touch-device.js +4 -5
- package/helpers/layer.d.ts +1 -1
- package/helpers/layer.js +2 -2
- package/helpers/max-index-of.d.ts +4 -1
- package/helpers/max-index-of.js +7 -2
- package/helpers/media-query-list.d.ts +1 -1
- package/helpers/media-query-list.js +2 -2
- package/helpers/on.d.ts +4 -1
- package/helpers/on.js +7 -2
- package/helpers/point.d.ts +4 -1
- package/helpers/point.js +8 -1
- package/helpers/rename.d.ts +3 -1
- package/helpers/rename.js +1 -0
- package/helpers/scroll-to-child.d.ts +1 -1
- package/helpers/scroll-to-child.js +3 -2
- package/helpers/styles.d.ts +8 -2
- package/helpers/styles.js +18 -4
- package/helpers/with-prevent.d.ts +9 -6
- package/helpers/with-prevent.js +16 -9
- package/hint/hint-view.d.ts +26 -0
- package/hint/hint-view.js +43 -0
- package/hint/hint-view.module.scss +31 -0
- package/hint/hint.d.ts +14 -0
- package/hint/hint.js +41 -0
- package/hint/index.d.ts +5 -8
- package/hint/index.js +13 -48
- package/hint/utils.d.ts +61 -0
- package/hint/utils.js +161 -0
- package/{hint → hint-deprecated}/hint.module.scss +0 -0
- package/hint-deprecated/index.d.ts +11 -0
- package/hint-deprecated/index.js +53 -0
- package/hooks/breakpoint/index.d.ts +7 -4
- package/hooks/breakpoint/index.js +21 -13
- package/hooks/breakpoint/types.d.ts +3 -4
- package/hooks/breakpoint/utils.d.ts +2 -1
- package/hooks/breakpoint/utils.js +2 -1
- package/hooks/index.d.ts +8 -8
- package/hooks/index.js +27 -19
- package/hooks/intersection/test-utils.d.ts +1 -1
- package/hooks/intersection/test-utils.js +2 -1
- package/hooks/styles.d.ts +6 -0
- package/hooks/styles.js +26 -0
- package/info-text/index.d.ts +23 -0
- package/info-text/index.js +60 -0
- package/info-text/info-text.module.scss +28 -0
- package/input/index.d.ts +32 -0
- package/input/index.js +96 -0
- package/input/input.module.scss +20 -0
- package/input/utils.d.ts +36 -0
- package/input/utils.js +71 -0
- package/layout/index.d.ts +6 -11
- package/layout/index.js +6 -60
- package/layout/layout.d.ts +10 -0
- package/layout/layout.js +32 -0
- package/layout/layout.module.scss +33 -26
- package/layout/legacy.d.ts +15 -0
- package/layout/legacy.js +68 -0
- package/layout/legacy.module.scss +49 -0
- package/layout/types.d.ts +6 -0
- package/layout/types.js +2 -0
- package/link/index.d.ts +4 -1
- package/link/index.js +2 -2
- package/link/link.module.scss +10 -0
- package/loading-overlay/index.d.ts +1 -0
- package/loading-overlay/index.js +1 -0
- package/masked-field/index.d.ts +1 -0
- package/masked-field/index.js +1 -0
- package/masked-input/hook.d.ts +8 -0
- package/masked-input/hook.js +72 -0
- package/masked-input/index.d.ts +5 -0
- package/masked-input/index.js +7 -0
- package/masked-input/masked-input.d.ts +8 -0
- package/masked-input/masked-input.js +73 -0
- package/masked-input/types.d.ts +51 -0
- package/masked-input/types.js +2 -0
- package/masked-input/utils.d.ts +15 -0
- package/masked-input/utils.js +49 -0
- package/modal/index.d.ts +10 -12
- package/modal/index.js +27 -64
- package/modal/modal.module.scss +98 -55
- package/modal/slots.d.ts +13 -10
- package/modal/slots.js +30 -28
- package/modal/utils.d.ts +8 -10
- package/modal/utils.js +2 -26
- package/modal-overlay/index.d.ts +13 -0
- package/modal-overlay/index.js +60 -0
- package/modal-overlay/modal-overlay-util.scss +1 -0
- package/modal-overlay/modal-overlay.module.scss +14 -0
- package/modal-overlay/utils.d.ts +14 -0
- package/modal-overlay/utils.js +32 -0
- package/package.json +49 -41
- package/pagination/utils.d.ts +2 -2
- package/panel/index.d.ts +27 -13
- package/panel/index.js +43 -9
- package/panel/panel.module.scss +49 -8
- package/phone-input/index.d.ts +4 -28
- package/phone-input/index.js +2 -121
- package/phone-input/phone-input.d.ts +8 -0
- package/phone-input/phone-input.js +133 -0
- package/phone-input/phone-input.module.scss +8 -32
- package/phone-input/presets.d.ts +21 -22
- package/phone-input/presets.js +1 -2
- package/phone-input/types.d.ts +6 -0
- package/phone-input/types.js +2 -0
- package/phone-input/utils.d.ts +30 -1
- package/phone-input/utils.js +52 -3
- package/phone-input-deprecated/index.d.ts +29 -0
- package/phone-input-deprecated/index.js +124 -0
- package/phone-input-deprecated/phone-input.module.scss +41 -0
- package/plate/index.d.ts +3 -3
- package/plate/index.js +2 -2
- package/plate/plate.module.scss +3 -0
- package/popup/index.d.ts +5 -0
- package/popup/index.js +12 -0
- package/popup/popup-view.d.ts +14 -0
- package/popup/popup-view.js +35 -0
- package/popup/popup-view.module.scss +40 -0
- package/popup/popup.d.ts +17 -0
- package/popup/popup.js +73 -0
- package/popup/utils.d.ts +38 -0
- package/popup/utils.js +83 -0
- package/price/index.d.ts +1 -1
- package/price/index.js +3 -3
- package/price/utils.d.ts +5 -5
- package/price/utils.js +33 -23
- package/radio-button/index.d.ts +10 -0
- package/radio-button/index.js +33 -0
- package/radio-button/radio-button.module.scss +46 -0
- package/rating/index.d.ts +2 -1
- package/rating/types.d.ts +1 -1
- package/readme.md +34 -41
- package/screen/index.d.ts +4 -2
- package/screen/index.js +34 -3
- package/screen/screen.module.scss +0 -2
- package/screen/slots.d.ts +2 -8
- package/screen/slots.js +8 -9
- package/screen/utils.d.ts +2 -1
- package/select/index.d.ts +2 -33
- package/select/index.js +3 -109
- package/select/parts/block.d.ts +8 -0
- package/select/parts/block.js +70 -0
- package/select/parts/block.module.scss +3 -0
- package/select/parts/button.d.ts +8 -0
- package/select/parts/button.js +69 -0
- package/select/parts/menu.d.ts +8 -0
- package/select/parts/menu.js +105 -0
- package/select/parts/menu.module.scss +4 -0
- package/select/select.d.ts +14 -0
- package/select/select.js +145 -0
- package/select/types.d.ts +55 -0
- package/select/types.js +2 -0
- package/select/utils.d.ts +3 -0
- package/select/utils.js +13 -0
- package/select-deprecated/index.d.ts +34 -0
- package/select-deprecated/index.js +112 -0
- package/{select → select-deprecated}/select.module.scss +0 -0
- package/shadows.scss +18 -0
- package/side-page/index.d.ts +11 -26
- package/side-page/index.js +21 -26
- package/side-page/side-page.module.scss +35 -29
- package/side-page/slots.d.ts +12 -20
- package/side-page/slots.js +16 -28
- package/spinner/index.d.ts +18 -6
- package/spinner/index.js +25 -12
- package/spinner/spinner.module.scss +8 -0
- package/stepper/index.d.ts +18 -10
- package/stepper/index.js +17 -8
- package/stepper/stepper.module.scss +14 -15
- package/styling/fonts.d.ts +3 -3
- package/switcher-row/index.d.ts +42 -0
- package/switcher-row/index.js +59 -0
- package/switcher-row/switcher-row.module.scss +55 -0
- package/text/index.d.ts +1 -1
- package/text-button/index.d.ts +42 -0
- package/text-button/index.js +46 -0
- package/text-button/text-button.module.scss +99 -0
- package/text-field/index.d.ts +7 -6
- package/text-field/index.js +3 -2
- package/textarea/index.d.ts +21 -0
- package/textarea/index.js +85 -0
- package/textarea/textarea.module.scss +15 -0
- package/toggle/index.d.ts +3 -3
- package/toggle/toggle.module.scss +17 -8
- package/tooltip/index.d.ts +1 -0
- package/tooltip/index.js +1 -0
- package/top-bar/index.d.ts +3 -40
- package/top-bar/index.js +4 -60
- package/top-bar/top-bar-util.scss +29 -0
- package/top-bar/top-bar.d.ts +9 -0
- package/top-bar/top-bar.js +101 -0
- package/top-bar/top-bar.module.scss +129 -67
- package/top-bar/types.d.ts +31 -0
- package/top-bar/types.js +2 -0
- package/top-bar/utils.d.ts +14 -0
- package/top-bar/utils.js +56 -0
- package/touch-slider/index.d.ts +1 -0
- package/touch-slider/index.js +3 -2
- package/types.d.ts +18 -0
- package/types.js +2 -0
- package/unknown-content/index.d.ts +3 -3
- package/unknown-content/index.js +3 -3
- package/unknown-content/unknown-content.module.scss +16 -12
- package/upload-area/index.d.ts +2 -0
- package/upload-area/index.js +5 -0
- package/upload-area/types.d.ts +32 -0
- package/upload-area/types.js +2 -0
- package/upload-area/upload-area-util.scss +17 -0
- package/upload-area/upload-area.d.ts +8 -0
- package/upload-area/upload-area.js +105 -0
- package/upload-area/upload-area.module.scss +78 -0
- package/{upload → upload-area}/upload.svg +0 -0
- package/upload-area/utils.d.ts +17 -0
- package/upload-area/utils.js +48 -0
- package/utils.scss +74 -1
- package/with-hint/index.d.ts +3 -2
- package/with-hint/index.js +1 -0
- package/with-hint/positioning-hint.d.ts +1 -1
- package/with-hint/positioning-hint.js +2 -2
- package/with-tooltip/index.d.ts +2 -1
- package/with-tooltip/index.js +1 -0
- package/with-tooltip/utils.d.ts +2 -2
- package/_internal/body-scroll.d.ts +0 -23
- package/_internal/body-scroll.js +0 -41
- package/_internal/checkbox/index.d.ts +0 -5
- package/constants.d.ts +0 -6
- package/constants.js +0 -9
- package/nav-bar/index.d.ts +0 -46
- package/nav-bar/index.js +0 -76
- package/nav-bar/nav-bar.module.scss +0 -95
- package/upload/area.d.ts +0 -25
- package/upload/area.js +0 -65
- package/upload/area.module.scss +0 -44
- package/upload/utils.d.ts +0 -29
- package/upload/utils.js +0 -45
|
@@ -4,4 +4,8 @@
|
|
|
4
4
|
* @param titles Массив со склонениями слова. Например: ['отзыв', 'отзыва', 'отзывов'].
|
|
5
5
|
* @return Слово в нужном склонении.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export declare function getDeclination(number: number, titles: string[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
10
|
+
*/
|
|
11
|
+
export default getDeclination;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeclination = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Возвращает нужное склонение из переданного списка по переданному числу.
|
|
5
6
|
* @param number Число, используемое для склонения.
|
|
@@ -14,4 +15,8 @@ function getDeclination(number, titles) {
|
|
|
14
15
|
: cases[positiveNumber % 10 < 5 ? positiveNumber % 10 : 5];
|
|
15
16
|
return titles[index];
|
|
16
17
|
}
|
|
18
|
+
exports.getDeclination = getDeclination;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
21
|
+
*/
|
|
17
22
|
exports.default = getDeclination;
|
|
@@ -6,8 +6,8 @@ exports.getFractionDepth = void 0;
|
|
|
6
6
|
* @param fraction Дробь.
|
|
7
7
|
* @return Разрядность / Количество символов после точки.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
function getFractionDepth(fraction = null) {
|
|
10
10
|
const fractionString = Number(fraction).toString();
|
|
11
11
|
return fractionString.includes('.') ? fractionString.length - fractionString.indexOf('.') - 1 : 0;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
13
13
|
exports.getFractionDepth = getFractionDepth;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Возвращает объект с исходной строкой в тэге <!--noindex--> для запрета отслеживания контента поисковиками.
|
|
3
|
-
* @param
|
|
3
|
+
* @param content Исходная строка.
|
|
4
4
|
* @return Объект, содержащий обернутую строку, для использования c атрибутом dangerouslySetInnerHTML.
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare function getNoIndex(content: unknown): {
|
|
7
7
|
__html: string;
|
|
8
8
|
} | undefined;
|
package/helpers/get-no-index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNoIndex = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
4
|
/**
|
|
6
5
|
* Возвращает объект с исходной строкой в тэге <!--noindex--> для запрета отслеживания контента поисковиками.
|
|
7
|
-
* @param
|
|
6
|
+
* @param content Исходная строка.
|
|
8
7
|
* @return Объект, содержащий обернутую строку, для использования c атрибутом dangerouslySetInnerHTML.
|
|
9
8
|
*/
|
|
10
|
-
|
|
9
|
+
function getNoIndex(content) {
|
|
10
|
+
return content ? { __html: `<!--noindex-->${String(content)}<!--/noindex-->` } : undefined;
|
|
11
|
+
}
|
|
11
12
|
exports.getNoIndex = getNoIndex;
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* @param parent Элемент, относительно которого необходимо определить позицию.
|
|
5
5
|
* @return Относительная позиция элемента.
|
|
6
6
|
*/
|
|
7
|
-
declare
|
|
7
|
+
export declare function getRelativePos(target: Element, parent?: HTMLElement | null): {
|
|
8
8
|
x: number;
|
|
9
9
|
y: number;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
13
|
+
*/
|
|
11
14
|
export default getRelativePos;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRelativePos = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Определяет позицию элемента относительно другого заданного элемента.
|
|
5
6
|
* @param target Элемент для определения позиции.
|
|
6
7
|
* @param parent Элемент, относительно которого необходимо определить позицию.
|
|
7
8
|
* @return Относительная позиция элемента.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
function getRelativePos(target, parent = target.parentElement) {
|
|
10
11
|
const targetBounds = target.getBoundingClientRect();
|
|
11
12
|
const parentBounds = parent === null || parent === void 0 ? void 0 : parent.getBoundingClientRect();
|
|
12
13
|
return {
|
|
13
14
|
x: targetBounds.left - ((parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.left) || 0),
|
|
14
15
|
y: targetBounds.top - ((parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.top) || 0),
|
|
15
16
|
};
|
|
16
|
-
}
|
|
17
|
+
}
|
|
18
|
+
exports.getRelativePos = getRelativePos;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
21
|
+
*/
|
|
17
22
|
exports.default = getRelativePos;
|
|
@@ -3,5 +3,4 @@
|
|
|
3
3
|
* @param element Элемент.
|
|
4
4
|
* @return Ближайший родительский элемент с возможностью прокрутки.
|
|
5
5
|
*/
|
|
6
|
-
declare
|
|
7
|
-
export { getScrollParent };
|
|
6
|
+
export declare function getScrollParent(element: Element | undefined | null): HTMLElement;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getScrollParent = void 0;
|
|
4
|
-
// не надо использовать глобальный поиск здесь, чтобы regex не сохранял lastIndex
|
|
4
|
+
// ВАЖНО: не надо использовать глобальный поиск здесь, чтобы regex не сохранял lastIndex
|
|
5
5
|
const regex = /(auto|scroll)/;
|
|
6
6
|
/**
|
|
7
7
|
* Определяет, имеет ли элемент возможность прокручиваться.
|
|
8
8
|
* @param element Элемент.
|
|
9
9
|
* @return Имеет ли элемент возможность прокручиваться.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
function isScrollable(element) {
|
|
12
12
|
let result = false;
|
|
13
13
|
if (element) {
|
|
14
14
|
const styles = getComputedStyle(element);
|
|
15
15
|
result = regex.test(styles.overflow + styles.overflowX + styles.overflowY);
|
|
16
16
|
}
|
|
17
17
|
return result;
|
|
18
|
-
}
|
|
18
|
+
}
|
|
19
19
|
/**
|
|
20
20
|
* Возвращает ближайший родительский элемент с возможностью прокрутки.
|
|
21
21
|
* @param element Элемент.
|
|
22
22
|
* @return Ближайший родительский элемент с возможностью прокрутки.
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
function getScrollParent(element) {
|
|
25
25
|
let result;
|
|
26
26
|
if (!element || element === document.body) {
|
|
27
27
|
// @todo прокрутка на body не работает с addEventListener, https://stackoverflow.com/a/43632204/13166471
|
|
@@ -34,5 +34,5 @@ const getScrollParent = (element) => {
|
|
|
34
34
|
: getScrollParent(element.parentElement);
|
|
35
35
|
}
|
|
36
36
|
return result;
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
exports.getScrollParent = getScrollParent;
|
package/helpers/is-browser.d.ts
CHANGED
|
@@ -2,5 +2,8 @@
|
|
|
2
2
|
* Проверка находимся в браузере или нет.
|
|
3
3
|
* @return Если в браузере true, если нет false.
|
|
4
4
|
*/
|
|
5
|
-
declare
|
|
5
|
+
export declare function isBrowser(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
8
|
+
*/
|
|
6
9
|
export default isBrowser;
|
package/helpers/is-browser.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBrowser = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Проверка находимся в браузере или нет.
|
|
5
6
|
* @return Если в браузере true, если нет false.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
+
function isBrowser() {
|
|
9
|
+
return typeof window !== 'undefined';
|
|
10
|
+
}
|
|
11
|
+
exports.isBrowser = isBrowser;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
14
|
+
*/
|
|
8
15
|
exports.default = isBrowser;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* @param options.threshold Отступ от конца.
|
|
6
6
|
* @return Прокручен ли переданный элемент до конца по вертикали.
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
9
|
-
threshold?: number
|
|
10
|
-
})
|
|
8
|
+
export declare function isFullyScrolled(element?: HTMLElement | undefined | null, { threshold }?: {
|
|
9
|
+
threshold?: number;
|
|
10
|
+
}): boolean;
|
|
@@ -8,7 +8,7 @@ exports.isFullyScrolled = void 0;
|
|
|
8
8
|
* @param options.threshold Отступ от конца.
|
|
9
9
|
* @return Прокручен ли переданный элемент до конца по вертикали.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
function isFullyScrolled(element, { threshold = 0 } = {}) {
|
|
12
12
|
let result = false;
|
|
13
13
|
if (element) {
|
|
14
14
|
const { scrollTop, clientHeight, scrollHeight } = element;
|
|
@@ -16,5 +16,5 @@ const isFullyScrolled = (element, { threshold = 0 } = {}) => {
|
|
|
16
16
|
result = bottom >= scrollHeight;
|
|
17
17
|
}
|
|
18
18
|
return result;
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
exports.isFullyScrolled = isFullyScrolled;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.isTouchDevice = void 0;
|
|
7
|
-
const is_browser_1 =
|
|
4
|
+
const is_browser_1 = require("./is-browser");
|
|
8
5
|
/**
|
|
9
6
|
* Проверяет поддержку touch событий.
|
|
10
7
|
* @return True - если поддерживает, false - если нет.
|
|
11
8
|
*/
|
|
12
|
-
|
|
9
|
+
function isTouchDevice() {
|
|
10
|
+
return (0, is_browser_1.isBrowser)() && 'ontouchstart' in window;
|
|
11
|
+
}
|
|
13
12
|
exports.isTouchDevice = isTouchDevice;
|
package/helpers/layer.d.ts
CHANGED
package/helpers/layer.js
CHANGED
|
@@ -11,8 +11,8 @@ exports.LayerProvider = LayerContext.Provider;
|
|
|
11
11
|
* Хук, возвращающий индекс текущего "слоя".
|
|
12
12
|
* @return Индекс.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
function useLayer() {
|
|
15
15
|
const currentLayer = (0, react_1.useContext)(LayerContext);
|
|
16
16
|
return currentLayer;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
exports.useLayer = useLayer;
|
|
@@ -3,5 +3,8 @@
|
|
|
3
3
|
* @param list Список.
|
|
4
4
|
* @return Максимальный индекс.
|
|
5
5
|
*/
|
|
6
|
-
declare
|
|
6
|
+
export declare function maxIndexOf(list?: ArrayLike<any> | null): number;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
9
|
+
*/
|
|
7
10
|
export default maxIndexOf;
|
package/helpers/max-index-of.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maxIndexOf = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Возвращает максимальный индекс списка.
|
|
5
6
|
* @param list Список.
|
|
6
7
|
* @return Максимальный индекс.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
+
function maxIndexOf(list) {
|
|
9
10
|
let maxIndex = -1;
|
|
10
11
|
if (list) {
|
|
11
12
|
maxIndex = list.length > 0 ? list.length - 1 : 0;
|
|
12
13
|
}
|
|
13
14
|
return maxIndex;
|
|
14
|
-
}
|
|
15
|
+
}
|
|
16
|
+
exports.maxIndexOf = maxIndexOf;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
19
|
+
*/
|
|
15
20
|
exports.default = maxIndexOf;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @param fn Обработчик.
|
|
5
5
|
* @return Интерфейс отписки.
|
|
6
6
|
*/
|
|
7
|
-
export declare
|
|
7
|
+
export declare function subscribe(mql: MediaQueryList, fn: (e: MediaQueryListEvent) => void): {
|
|
8
8
|
unsubscribe: () => void;
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@ exports.subscribe = void 0;
|
|
|
7
7
|
* @param fn Обработчик.
|
|
8
8
|
* @return Интерфейс отписки.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
function subscribe(mql, fn) {
|
|
11
11
|
if (mql.addEventListener) {
|
|
12
12
|
mql.addEventListener('change', fn);
|
|
13
13
|
}
|
|
@@ -24,5 +24,5 @@ const subscribe = (mql, fn) => {
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
exports.subscribe = subscribe;
|
package/helpers/on.d.ts
CHANGED
|
@@ -7,5 +7,8 @@ import React from 'react';
|
|
|
7
7
|
* @param options Опции подписки.
|
|
8
8
|
* @return Функция отписки.
|
|
9
9
|
*/
|
|
10
|
-
declare
|
|
10
|
+
export declare function on<T extends Event | React.SyntheticEvent>(target: EventTarget, eventNames: string, callback: (e: T) => void, options?: boolean | EventListenerOptions | AddEventListenerOptions | undefined): () => undefined;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
13
|
+
*/
|
|
11
14
|
export default on;
|
package/helpers/on.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.on = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Выполняет подписку на событие целевого объекта.
|
|
5
6
|
* @param target Целевой объект.
|
|
@@ -8,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
9
|
* @param options Опции подписки.
|
|
9
10
|
* @return Функция отписки.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
function on(target, eventNames, callback, options) {
|
|
12
13
|
const eventNamesList = eventNames.split(' ');
|
|
13
14
|
// обернуто чтобы прокинуть T
|
|
14
15
|
// eslint-disable-next-line require-jsdoc
|
|
@@ -19,5 +20,9 @@ const on = (target, eventNames, callback, options) => {
|
|
|
19
20
|
return () => void eventNamesList.forEach(eventName => {
|
|
20
21
|
target.removeEventListener(eventName, wrapped, options);
|
|
21
22
|
});
|
|
22
|
-
}
|
|
23
|
+
}
|
|
24
|
+
exports.on = on;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
27
|
+
*/
|
|
23
28
|
exports.default = on;
|
package/helpers/point.d.ts
CHANGED
|
@@ -8,5 +8,8 @@ export interface IPoint {
|
|
|
8
8
|
* @param y Координата по оси Y.
|
|
9
9
|
* @return Объект представляющий точку.
|
|
10
10
|
*/
|
|
11
|
-
declare
|
|
11
|
+
export declare function Point(x?: number, y?: number): IPoint;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
14
|
+
*/
|
|
12
15
|
export default Point;
|
package/helpers/point.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Point = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* Возвращает объект представляющий точку в двухмерном пространстве.
|
|
5
6
|
* @param x Координата по оси X.
|
|
6
7
|
* @param y Координата по оси Y.
|
|
7
8
|
* @return Объект представляющий точку.
|
|
8
9
|
*/
|
|
9
|
-
|
|
10
|
+
function Point(x = 0, y = 0) {
|
|
11
|
+
return { x, y };
|
|
12
|
+
}
|
|
13
|
+
exports.Point = Point;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
16
|
+
*/
|
|
10
17
|
exports.default = Point;
|
package/helpers/rename.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
|
-
|
|
2
|
+
/// <reference types="lodash" />
|
|
3
|
+
type ObjectKey = string | number | symbol;
|
|
3
4
|
/**
|
|
4
5
|
* Переименовывает свойство, возвращая новый объект.
|
|
6
|
+
* @deprecated Эта функция не относится напрямую к работе с UI и будет удалена в будущем.
|
|
5
7
|
* @param fromKey Старый ключ.
|
|
6
8
|
* @param toKey Новый ключ.
|
|
7
9
|
* @param source Объект.
|
package/helpers/rename.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.rename = void 0;
|
|
|
4
4
|
const fp_1 = require("lodash/fp");
|
|
5
5
|
/**
|
|
6
6
|
* Переименовывает свойство, возвращая новый объект.
|
|
7
|
+
* @deprecated Эта функция не относится напрямую к работе с UI и будет удалена в будущем.
|
|
7
8
|
* @param fromKey Старый ключ.
|
|
8
9
|
* @param toKey Новый ключ.
|
|
9
10
|
* @param source Объект.
|
|
@@ -10,7 +10,7 @@ const bounds_of_1 = __importDefault(require("./bounds-of"));
|
|
|
10
10
|
* @param parent Родительский элемент.
|
|
11
11
|
* @param child Дочерний элемент.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
function scrollToChild(parent, child) {
|
|
14
14
|
const [parentRect, childRect] = [parent, child].map(bounds_of_1.default);
|
|
15
15
|
// ВАЖНО: не надо использовать offsetTop здесь, offsetParent может не соответствовать указанному родителю
|
|
16
16
|
if (childRect.bottom > parentRect.bottom) {
|
|
@@ -19,5 +19,6 @@ const scrollToChild = (parent, child) => {
|
|
|
19
19
|
else if (childRect.top < parentRect.top) {
|
|
20
20
|
parent.scrollTop -= parentRect.top - childRect.top;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
// @todo доделать для OverlayScrollbars?
|
|
23
|
+
}
|
|
23
24
|
exports.scrollToChild = scrollToChild;
|
package/helpers/styles.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param easing Функция плавности.
|
|
6
6
|
* @return Значение CSS-свойства "transition".
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
8
|
+
export declare function getTransitionStyle(duration?: number, property?: string, easing?: string): string;
|
|
9
9
|
/**
|
|
10
10
|
* Возвращает строку значения CSS-свойства с трансформацией смещения.
|
|
11
11
|
*
|
|
@@ -16,4 +16,10 @@ export declare const getTransitionStyle: (duration?: number, property?: string,
|
|
|
16
16
|
* @param z Смещение по оси z в пикселях.
|
|
17
17
|
* @return Значение CSS-свойства с трансформацией смещения.
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare function getTranslateStyle(x?: number, y?: number, z?: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* Устанавливает на переданный элемент css-переменную "--vh".
|
|
22
|
+
* Значение переменной является аналогом `1vh` с учетом особенностей viewport'а мобильный устройств.
|
|
23
|
+
* @param element Элемент на котором будет задана css-переменная.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setViewportHeightUnit(element: HTMLElement): void;
|
package/helpers/styles.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTranslateStyle = exports.getTransitionStyle = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
3
|
+
exports.setViewportHeightUnit = exports.getTranslateStyle = exports.getTransitionStyle = void 0;
|
|
5
4
|
/**
|
|
6
5
|
* Возвращает строку значения CSS-свойства "transition".
|
|
7
6
|
* @param duration Длительность перехода в миллисекундах.
|
|
@@ -9,7 +8,9 @@ const lodash_1 = require("lodash");
|
|
|
9
8
|
* @param easing Функция плавности.
|
|
10
9
|
* @return Значение CSS-свойства "transition".
|
|
11
10
|
*/
|
|
12
|
-
|
|
11
|
+
function getTransitionStyle(duration = 0, property = 'all', easing = 'ease-out') {
|
|
12
|
+
return `${property} ${Number.isFinite(duration) ? duration : 0}ms ${easing}`;
|
|
13
|
+
}
|
|
13
14
|
exports.getTransitionStyle = getTransitionStyle;
|
|
14
15
|
/**
|
|
15
16
|
* Возвращает строку значения CSS-свойства с трансформацией смещения.
|
|
@@ -21,5 +22,18 @@ exports.getTransitionStyle = getTransitionStyle;
|
|
|
21
22
|
* @param z Смещение по оси z в пикселях.
|
|
22
23
|
* @return Значение CSS-свойства с трансформацией смещения.
|
|
23
24
|
*/
|
|
24
|
-
|
|
25
|
+
function getTranslateStyle(x = 0, y = 0, z = 0) {
|
|
26
|
+
return `translate3d(${x}px, ${y}px, ${z}px)`;
|
|
27
|
+
}
|
|
25
28
|
exports.getTranslateStyle = getTranslateStyle;
|
|
29
|
+
/**
|
|
30
|
+
* Устанавливает на переданный элемент css-переменную "--vh".
|
|
31
|
+
* Значение переменной является аналогом `1vh` с учетом особенностей viewport'а мобильный устройств.
|
|
32
|
+
* @param element Элемент на котором будет задана css-переменная.
|
|
33
|
+
*/
|
|
34
|
+
function setViewportHeightUnit(element) {
|
|
35
|
+
const { visualViewport } = window;
|
|
36
|
+
const height = visualViewport ? visualViewport.height * visualViewport.scale : window.innerHeight;
|
|
37
|
+
element.style.setProperty('--vh', `${height / 100}px`);
|
|
38
|
+
}
|
|
39
|
+
exports.setViewportHeightUnit = setViewportHeightUnit;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Декорирует переданную функцию-обработчик события
|
|
4
|
-
* @param callback
|
|
5
|
-
* @return Декорированная
|
|
3
|
+
* Декорирует переданную функцию-обработчик события вызывая preventDefault и stopPropagation.
|
|
4
|
+
* @param callback Функция-обработчик.
|
|
5
|
+
* @return Декорированная функция-обработчик.
|
|
6
6
|
*/
|
|
7
|
-
declare
|
|
8
|
-
|
|
7
|
+
export declare function withEventMute<T extends Event | SyntheticEvent>(callback?: (event: T) => void): (event: T) => void;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
10
|
+
*/
|
|
11
|
+
export default withEventMute;
|
package/helpers/with-prevent.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withEventMute = void 0;
|
|
3
4
|
/**
|
|
4
|
-
* Декорирует переданную функцию-обработчик события
|
|
5
|
-
* @param callback
|
|
6
|
-
* @return Декорированная
|
|
5
|
+
* Декорирует переданную функцию-обработчик события вызывая preventDefault и stopPropagation.
|
|
6
|
+
* @param callback Функция-обработчик.
|
|
7
|
+
* @return Декорированная функция-обработчик.
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
event
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function withEventMute(callback) {
|
|
10
|
+
return (event) => {
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
event.stopPropagation(); // @todo придумать как вынести
|
|
13
|
+
callback === null || callback === void 0 ? void 0 : callback(event);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
exports.withEventMute = withEventMute;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Следует использовать именованный экспорт. Экспорт по умолчанию будет удалён в будущем.
|
|
19
|
+
*/
|
|
20
|
+
exports.default = withEventMute;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { WithTestId } from '../types';
|
|
3
|
+
export interface HintViewProps extends HTMLAttributes<HTMLDivElement>, WithTestId {
|
|
4
|
+
/** Ref корневого элемента. */
|
|
5
|
+
hintRef?: Ref<HTMLDivElement>;
|
|
6
|
+
}
|
|
7
|
+
/** Длина стороны квадрата, составленного из двух стрелок (треугольников). */
|
|
8
|
+
export declare const arrowSquareSize: number;
|
|
9
|
+
/**
|
|
10
|
+
* "Хинт" - всплывающая подсказка.
|
|
11
|
+
* @param props Свойства.
|
|
12
|
+
* @return Элемент.
|
|
13
|
+
*/
|
|
14
|
+
export declare function HintView({ hintRef, className, children, 'data-testid': testId, ...rest }: HintViewProps): JSX.Element;
|
|
15
|
+
export declare namespace HintView {
|
|
16
|
+
var Arrow: typeof HintArrow;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Стрелка хинта.
|
|
20
|
+
* @param props Свойства.
|
|
21
|
+
* @return Элемент.
|
|
22
|
+
*/
|
|
23
|
+
declare function HintArrow({ arrowRef, className, ...rest }: Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
24
|
+
arrowRef?: Ref<HTMLDivElement>;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.HintView = exports.arrowSquareSize = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
|
+
const hint_view_module_scss_1 = __importDefault(require("./hint-view.module.scss"));
|
|
21
|
+
const cx = bind_1.default.bind(hint_view_module_scss_1.default);
|
|
22
|
+
/** Длина стороны квадрата, составленного из двух стрелок (треугольников). */
|
|
23
|
+
exports.arrowSquareSize = Math.sqrt(4 * 4 + 4 * 4);
|
|
24
|
+
/**
|
|
25
|
+
* "Хинт" - всплывающая подсказка.
|
|
26
|
+
* @param props Свойства.
|
|
27
|
+
* @return Элемент.
|
|
28
|
+
*/
|
|
29
|
+
function HintView(_a) {
|
|
30
|
+
var { hintRef, className, children, 'data-testid': testId = 'hint' } = _a, rest = __rest(_a, ["hintRef", "className", "children", 'data-testid']);
|
|
31
|
+
return (react_1.default.createElement("div", Object.assign({ ref: hintRef, className: cx('root', className), "data-testid": testId }, rest), children));
|
|
32
|
+
}
|
|
33
|
+
exports.HintView = HintView;
|
|
34
|
+
/**
|
|
35
|
+
* Стрелка хинта.
|
|
36
|
+
* @param props Свойства.
|
|
37
|
+
* @return Элемент.
|
|
38
|
+
*/
|
|
39
|
+
function HintArrow(_a) {
|
|
40
|
+
var { arrowRef, className } = _a, rest = __rest(_a, ["arrowRef", "className"]);
|
|
41
|
+
return react_1.default.createElement("div", Object.assign({ ref: arrowRef, className: cx('arrow', className) }, rest));
|
|
42
|
+
}
|
|
43
|
+
HintView.Arrow = HintArrow;
|