@evergis/react 4.0.155 → 4.0.157

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Everpoint
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Everpoint
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @evergis/react
2
-
3
- В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
- но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
-
6
- ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
- от системы поддержки мультиязычности `Evergis Online`!
1
+ # @evergis/react
2
+
3
+ В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
+ но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
+
6
+ ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
+ от системы поддержки мультиязычности `Evergis Online`!
@@ -4,6 +4,4 @@ export declare const LayersContainerWrapper: import('styled-components').StyledC
4
4
  isMain?: boolean;
5
5
  noBorders?: boolean;
6
6
  $alignItems?: import('../..').AlignItems;
7
- } & {
8
- isPresentationMode?: boolean;
9
7
  }, never>;
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { ModalHeaderBackgroundProps } from './types';
3
+ /**
4
+ * Фон шапки модалки (`modal.options.header`): градиент, картинка слота `bgImage` и `overlay` —
5
+ * снизу вверх. Нечего рисовать — в DOM не появляется ничего.
6
+ */
7
+ export declare const ModalHeaderBackground: FC<ModalHeaderBackgroundProps>;
@@ -0,0 +1,20 @@
1
+ import { ModalHeaderBgPosition } from '../../../../types';
2
+ import { HeaderBackgroundLayerProps } from './types';
3
+ /**
4
+ * Слой шапки модалки: лежит под заголовком и содержимым (`z-index: -1` внутри изолированного окна),
5
+ * клики пропускает. Без отступа повторяет верхние скругления окна — на мобильной ширине окно
6
+ * квадратное, и слой вслед за ним тоже.
7
+ */
8
+ export declare const HeaderBackgroundLayer: import('styled-components').StyledComponent<"div", any, HeaderBackgroundLayerProps, never>;
9
+ /** Рисунок из шапки карточки: растянут по ширине окна, видна его верхняя, самая насыщенная часть. */
10
+ export declare const HeaderGradient: import('styled-components').StyledComponent<"div", any, {}, never>;
11
+ /**
12
+ * Картинка слота `bgImage`. По умолчанию заполняет шапку (`cover`); авторский `fit` у слота
13
+ * перебивает его (`&&` у `ElementImg`). Якорь задаёт только `header.bgPosition`.
14
+ */
15
+ export declare const HeaderImage: import('styled-components').StyledComponent<"div", any, {
16
+ $bgPosition?: ModalHeaderBgPosition;
17
+ }, never>;
18
+ export declare const HeaderOverlay: import('styled-components').StyledComponent<"div", any, {
19
+ $overlay: string;
20
+ }, never>;
@@ -0,0 +1,13 @@
1
+ import { ConfigModalHeaderOptions, RenderElementFunction } from '../../../../types';
2
+ export interface ModalHeaderBackgroundProps {
3
+ header?: ConfigModalHeaderOptions;
4
+ /** Среди прямых детей модалки есть слот `bgImage`. */
5
+ hasBgImage?: boolean;
6
+ /** Рендер слотов модалки — видит только её прямых детей. */
7
+ renderElement: RenderElementFunction;
8
+ }
9
+ export interface HeaderBackgroundLayerProps {
10
+ $height: string;
11
+ $withPadding?: boolean;
12
+ $bottomBlur?: boolean;
13
+ }
@@ -0,0 +1,29 @@
1
+ import { ModalHeaderBgPosition } from '../../types';
2
+ /** Slot-id иконки перед заголовком модалки — тот же, что у заголовка контейнера. */
3
+ export declare const MODAL_TITLE_ICON_SLOT_ID = "titleIcon";
4
+ /**
5
+ * Слоты, которые модалка рисует сама: иконка заголовка и фон шапки. Берутся только из ПРЯМЫХ детей
6
+ * модалки — `renderElement` ищет `id` по всему поддереву, и слот вложенного контейнера иначе всплыл бы
7
+ * в заголовок модалки.
8
+ */
9
+ export declare const MODAL_SLOT_IDS: string[];
10
+ /** Отступ диалога сверху, по бокам и снизу — по макету. */
11
+ export declare const MODAL_PADDING = "3rem";
12
+ /** Зазор между заголовком и содержимым — по макету. */
13
+ export declare const MODAL_TITLE_GAP = "2rem";
14
+ /**
15
+ * Ширина скроллбара хоста (глобальный `::-webkit-scrollbar` client-new). Место под него
16
+ * зарезервировано всегда (`scrollbar-gutter: stable`), поэтому на эту ширину уменьшается правый
17
+ * отступ содержимого: правый край контента остаётся на одной линии с крестиком.
18
+ */
19
+ export declare const MODAL_SCROLLBAR_WIDTH = "0.75rem";
20
+ /** Тень диалога — по макету. */
21
+ export declare const MODAL_SHADOW = "0 0.1875rem 0.3125rem rgba(0, 0, 0, 0.15)";
22
+ /** Высота шапки по умолчанию (82px) — по макету. */
23
+ export declare const MODAL_HEADER_HEIGHT = "5.125rem";
24
+ /** Отступ шапки от краёв диалога при `header.withPadding` — по макету. */
25
+ export declare const MODAL_HEADER_PADDING = "0.5rem";
26
+ /** Растворение шапки книзу: непрозрачно сверху, полностью прозрачно к 95% высоты — по макету. */
27
+ export declare const MODAL_HEADER_BLUR_MASK = "linear-gradient(to bottom, #000 0%, transparent 95%)";
28
+ /** `header.bgPosition` → `object-position` картинки шапки. */
29
+ export declare const MODAL_HEADER_BG_POSITION: Record<ModalHeaderBgPosition, string>;
@@ -0,0 +1,2 @@
1
+ export * from './useModalContent';
2
+ export * from './useModalOpen';
@@ -0,0 +1,16 @@
1
+ import { ConfigContainerChild, WidgetType } from '../../../types';
2
+ /**
3
+ * Конфиг модалки `modalId` и рендер её детей.
4
+ *
5
+ * Рендеров два: `renderElement` — для тела, `renderSlot` — для слотов, которые модалка рисует сама
6
+ * (`titleIcon`, `bgImage`). `renderElement` ищет `id` по всему поддереву, поэтому слот вложенного
7
+ * контейнера всплыл бы в заголовок или шапку модалки; `renderSlot` видит только её прямых детей.
8
+ */
9
+ export declare const useModalContent: (type: WidgetType, modalId?: string) => {
10
+ modalConfig: any;
11
+ modalContent: ConfigContainerChild[];
12
+ renderElement: import('../../../types').RenderElementFunction;
13
+ renderSlot: import('../../../types').RenderElementFunction;
14
+ hasTitleIcon: boolean;
15
+ hasBgImage: boolean;
16
+ };
@@ -1 +1,18 @@
1
1
  export declare const ModalIcon: import('styled-components').StyledComponent<import('react').FC<import('@evergis/uilib-gl').IIconButtonProps>, any, {}, never>;
2
+ /**
3
+ * Окно диалога. `className` у `Dialog` уходит на его бланк, поэтому стили ложатся на само окно.
4
+ *
5
+ * `position: relative` + `isolation: isolate` делают окно хостом слоя шапки: слой с `z-index: -1`
6
+ * ложится поверх фона окна, но под заголовком и содержимым. `&&` перебивает стили бланка uilib-gl.
7
+ */
8
+ export declare const ModalDialog: import('styled-components').StyledComponent<import('react').FC<import('@evergis/uilib-gl').IDialogProps>, any, {}, never>;
9
+ /** Прозрачный фон — иначе заливка заголовка uilib-gl перекрыла бы шапку. */
10
+ export declare const ModalTitle: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').IDialogTitleProps, never>;
11
+ export declare const ModalTitleRow: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
12
+ export declare const ModalTitleText: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
13
+ /**
14
+ * Глиф крестика 1rem по центру кнопки 3rem × 2.25rem. Отрицательные отступы ставят его в правый
15
+ * верхний угол строки заголовка, как в макете, а кликабельная площадь кнопки сохраняется.
16
+ */
17
+ export declare const ModalCloseButton: import('styled-components').StyledComponent<import('react').FC<import('@evergis/uilib-gl').IIconButtonProps>, any, {}, never>;
18
+ export declare const ModalContent: import('styled-components').StyledComponent<"div", any, {}, never>;
@@ -6,6 +6,5 @@ export declare const DashboardPlaceholder: import('styled-components').StyledCom
6
6
  }, never>;
7
7
  export declare const DashboardWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
8
8
  hasImage?: boolean;
9
- isPresentationMode?: boolean;
10
9
  }, never>;
11
10
  export declare const DashboardContent: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
@@ -760,11 +760,36 @@ export interface ConfigTask {
760
760
  updateDate?: string;
761
761
  id?: string;
762
762
  }
763
+ /** Край, к которому прижимается картинка слота `bgImage` в шапке модалки. */
764
+ export declare const MODAL_HEADER_BG_POSITIONS: readonly ["left", "right", "top", "bottom"];
765
+ export type ModalHeaderBgPosition = (typeof MODAL_HEADER_BG_POSITIONS)[number];
766
+ /**
767
+ * Фон шапки модалки — абсолютный слой под заголовком и содержимым: раскладку диалога он не сдвигает.
768
+ *
769
+ * Слой рисуется, когда есть что рисовать: `gradient`, `overlay` или слот `bgImage` среди детей модалки.
770
+ * Порядок снизу вверх: градиент → картинка `bgImage` → `overlay`. Сам слот `bgImage` — обычный
771
+ * элемент `type: "image"`; его геометрию и якорь задают эти опции, а масштаб — его собственный `fit`.
772
+ */
773
+ export interface ConfigModalHeaderOptions {
774
+ /** Градиентный рисунок из шапки карточки объекта (`header-gradient.png`). */
775
+ gradient?: boolean;
776
+ /** Высота блока шапки от верхнего края диалога, px. По умолчанию 82px — по макету. */
777
+ height?: number;
778
+ /** Отступ 0.5rem сверху и по бокам: шапка становится отдельной скруглённой плашкой. */
779
+ withPadding?: boolean;
780
+ /** Растворение шапки книзу — до прозрачного к 95% высоты. По умолчанию включено, `false` выключает. */
781
+ bottomBlur?: boolean;
782
+ /** Якорь картинки `bgImage` (`object-position`). Не задан — по центру. */
783
+ bgPosition?: ModalHeaderBgPosition;
784
+ /** CSS `background` поверх картинки: цвет или градиент. Работает и без картинки. */
785
+ overlay?: string;
786
+ }
763
787
  export interface ConfigModalOptions {
764
788
  title?: string;
765
789
  maxWidth?: string;
766
790
  minWidth?: string;
767
791
  minHeight?: string;
792
+ header?: ConfigModalHeaderOptions;
768
793
  }
769
794
  export interface ConfigModalContentRef {
770
795
  containerId: string;