@evergis/react 4.0.121 → 4.0.123
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 -21
- package/README.md +7 -7
- package/dist/components/Dashboard/containers/registry.d.ts +15 -0
- package/dist/components/Dashboard/hooks/useWrapperSize.d.ts +7 -0
- package/dist/components/Dashboard/styled.d.ts +18 -0
- package/dist/components/Dashboard/utils/formatElementValue.d.ts +6 -1
- package/dist/components/Dashboard/utils/getContainerComponent.d.ts +8 -0
- package/dist/index.js +2995 -2904
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +2994 -2905
- package/dist/react.esm.js.map +1 -1
- package/package.json +4 -4
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`!
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ProgressContainerProps, RoundedBackgroundContainerProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Шаблоны, чей компонент держит `id`, `data-templatename`, авторский `style` и `$sizeCss`
|
|
5
|
+
* на ЕДИНСТВЕННОМ собственном корне — через `useContainerRoot` / `useWrapperSize`.
|
|
6
|
+
*
|
|
7
|
+
* Такому контейнеру не нужна внешняя обёртка `ElementValueWrapper`: она добавляла в DOM второй
|
|
8
|
+
* узел с теми же атрибутами и стилями (см. `formatElementValue`).
|
|
9
|
+
*
|
|
10
|
+
* Остальных здесь нет намеренно: `DefaultAttributes`, `EditGroup` и `OneColumn`/`TwoColumn`
|
|
11
|
+
* в режиме `attributesToRender` возвращают НЕСКОЛЬКО корней, а `Title`, `Icon`, `Divider`,
|
|
12
|
+
* `Tabs`, `AddFeature`, `ExportPdf`, `Progress`, `RoundedBackground` ставят `id`/`style` руками.
|
|
13
|
+
* Для них обёртка — единственный одиночный узел, снимать её нельзя.
|
|
14
|
+
*
|
|
15
|
+
* Переводишь очередной контейнер на `useContainerRoot` — добавь его сюда.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ROOT_OWNING_TEMPLATES: ReadonlySet<string>;
|
|
3
18
|
export declare const getContainerComponents: () => {
|
|
4
19
|
readonly DefaultAttributes: FC<import('../componentTypes').DefaultAttributesContainerProps>;
|
|
5
20
|
readonly Pages: FC<import('../componentTypes').PagesContainerProps>;
|
|
@@ -8,9 +8,12 @@ interface UseWrapperSizeParams {
|
|
|
8
8
|
}
|
|
9
9
|
export interface WrapperRootProps {
|
|
10
10
|
id?: string;
|
|
11
|
+
/** Дубль `id` для внешних селекторов: раньше его нёс `ElementValueWrapper` вокруг контейнера. */
|
|
12
|
+
"data-id"?: string;
|
|
11
13
|
"data-templatename"?: string;
|
|
12
14
|
style?: CSSProperties;
|
|
13
15
|
$sizeCss?: CSSObject;
|
|
16
|
+
$noMargin?: boolean;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Пропсы корневой обёртки контейнера: идентификаторы для внешних селекторов, авторский `style`
|
|
@@ -18,6 +21,10 @@ export interface WrapperRootProps {
|
|
|
18
21
|
*
|
|
19
22
|
* Размеры уходят styled-пропом (класс), а не inline-стилем, поэтому перебиваются снаружи
|
|
20
23
|
* без `!important`. Авторский `style` остаётся inline — у него приоритет по замыслу автора конфига.
|
|
24
|
+
*
|
|
25
|
+
* `data-id` и `$noMargin` раньше жили на внешней обёртке `ElementValueWrapper`; она вешала их
|
|
26
|
+
* на второй узел поверх этого корня, дублируя стили, и для таких контейнеров больше не создаётся
|
|
27
|
+
* (см. `ROOT_OWNING_TEMPLATES`).
|
|
21
28
|
*/
|
|
22
29
|
export declare const useWrapperSize: ({ elementConfig, defaults }: UseWrapperSizeParams) => WrapperRootProps;
|
|
23
30
|
export {};
|
|
@@ -4,6 +4,8 @@ import { AlignItems } from './types';
|
|
|
4
4
|
/** Пропсы корневой обёртки контейнера — см. `useWrapperSize`. */
|
|
5
5
|
export interface ContainerRootProps {
|
|
6
6
|
$sizeCss?: CSSObject;
|
|
7
|
+
$noMargin?: boolean;
|
|
8
|
+
"data-id"?: string;
|
|
7
9
|
"data-templatename"?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
@@ -14,6 +16,22 @@ export interface ContainerRootProps {
|
|
|
14
16
|
* вставки стилей). Снаружи такое правило по-прежнему перебивается `#id` без `!important`.
|
|
15
17
|
*/
|
|
16
18
|
export declare const sizeCssMixin: import('styled-components').FlattenInterpolation<import('styled-components').ThemedStyledProps<ContainerRootProps, any>>;
|
|
19
|
+
/**
|
|
20
|
+
* `options.noMargin` контейнера: гасит отступ, который родительская колонка ставит своим детям
|
|
21
|
+
* (`Container > *:not(:last-child)`).
|
|
22
|
+
*
|
|
23
|
+
* `&&&&` — ровно та сила, что была у обёртки `ElementValueWrapper`: правило должно перебивать
|
|
24
|
+
* и родительскую колонку, и собственные `defaults` контейнера, пришедшие в `$sizeCss`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const noMarginMixin: import('styled-components').FlattenInterpolation<import('styled-components').ThemedStyledProps<ContainerRootProps, any>>;
|
|
27
|
+
/**
|
|
28
|
+
* Обёртка значения элемента.
|
|
29
|
+
*
|
|
30
|
+
* Контейнеры, владеющие своим корнем (`ROOT_OWNING_TEMPLATES`), сюда больше не попадают —
|
|
31
|
+
* обёртка дублировала их `data-id`, `data-templatename` и `style` вторым узлом DOM.
|
|
32
|
+
* `$sizeTransparent` поэтому работает только на контейнерах, которые ещё не переведены
|
|
33
|
+
* на `useContainerRoot`.
|
|
34
|
+
*/
|
|
17
35
|
export declare const ElementValueWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
18
36
|
noMargin?: boolean;
|
|
19
37
|
$sizeTransparent?: boolean;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { i18n } from 'i18next';
|
|
3
3
|
import { ClientFeatureAttribute, ConfigContainerChild, RenderElementValue } from '../types';
|
|
4
|
-
export declare const formatElementValue: ({ t, value, elementConfig, attributes, wrap, }: {
|
|
4
|
+
export declare const formatElementValue: ({ t, value, elementConfig, attributes, wrap, hasOwnRoot, }: {
|
|
5
5
|
t: i18n["t"];
|
|
6
6
|
value: RenderElementValue;
|
|
7
7
|
elementConfig: ConfigContainerChild;
|
|
8
8
|
attributes: ClientFeatureAttribute[];
|
|
9
9
|
wrap?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Значение — контейнер, который сам держит `id`, `data-templatename`, авторский `style`
|
|
12
|
+
* и `$sizeCss` на своём единственном корне (см. `useWrapperSize`). Обёртка ему не нужна.
|
|
13
|
+
*/
|
|
14
|
+
hasOwnRoot?: boolean;
|
|
10
15
|
}) => ReactNode | string;
|
|
@@ -1 +1,9 @@
|
|
|
1
1
|
export declare const getContainerComponent: (innerTemplateName: string) => any;
|
|
2
|
+
/**
|
|
3
|
+
* Контейнер этого шаблона сам держит идентификаторы и стили на своём единственном корне —
|
|
4
|
+
* внешняя обёртка ему не нужна, см. {@link ROOT_OWNING_TEMPLATES}.
|
|
5
|
+
*
|
|
6
|
+
* Живёт рядом с `getContainerComponent` ради правила про неизвестный шаблон: тот резолвится
|
|
7
|
+
* в `default` (= `ContainersGroupContainer`), а он корнем владеет.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isRootOwningContainer: (templateName?: string) => boolean;
|