@evergis/uilib-gl 1.0.116 → 1.0.118

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,157 +1,157 @@
1
- # 🛴 Evergis UI
2
- ## Contributing
3
-
4
- 🏆 **Before start:**
5
-
6
- ```
7
- yarn
8
- ```
9
- Update webstorm to >2017.3.3
10
-
11
- Install Styled Components plugin [Jetbrains plugins](https://plugins.jetbrains.com/plugin/9997-styled-components)
12
-
13
- 🛠️ **Start dev:**
14
-
15
- ```
16
- yarn storybook
17
- ```
18
-
19
- Open in browser localhost:6006
20
-
21
- ✅ **Start tests:**
22
-
23
- ```
24
- yarn test
25
- ```
26
-
27
- ## How to release
28
-
29
- 1. Создать временную ветку из `master`
30
- 2. Изменить версию пакета в `package.json`
31
- 3. `yarn` - освежить все зависимости
32
- 4. `yarn lint:fix` - автопоправка eslint ошибок
33
- 5. `yarn build` - сборка
34
- 6. В корне проекта создать файл `.npmrc` со следующим содержимым:
35
-
36
- ```
37
- //registry.npmjs.org/:_authToken=npm_XXX
38
- ```
39
-
40
- Здесь `npm_XXX` -- granular token; создать его можно [по инструкции](https://docs.npmjs.com/creating-and-viewing-access-tokens). ВАЖНО: с 09.12.2025 срок действия токена не может превышать 90 дней.
41
-
42
- **Примечение:** При создании токена необходимо *ОБЯЗАТЕЛЬНО* выбрать опцию `Bypass two-factor authentication (2FA)`.
43
-
44
- 7. `npm login` - залогиниться в npm (ВАЖНО: с 12.12.2025 сессия длится 12 часов, проверить, всё ли мы ещё залогинены, можно с помощью команды `npm whoami`).
45
- 8. `npm publish` - паблиш
46
- 9. Создать МР из временной ветки в `master`
47
-
48
- ## How to link
49
-
50
- For testing uilib locally in client (or other projects)
51
- without rebuilding after every update use linking:
52
-
53
- 1. `yarn build` - сборка
54
- 2. `yarn link` - создаём глобальную ссылку на uilib
55
- 3. Открываем client или другой проект
56
- 4. `yarn link "@evergis/uilib-gl"` - привязываем uilib к проекту
57
- 5. `yarn start` - запускаем проект с привязанной uilib
58
- 6. `yarn build` - после изменений в uilib делаем его пересборку
59
-
60
- ### How to manage icons
61
-
62
- **Источник истины набора иконок — объект `iconTypes` в `src/atoms/Icon/Icon.ts`.**
63
- Инвариант: множество codepoint-ов в `iconTypes` == глифы в `src/fonts/EverCloud.svg` ==
64
- иконки в `src/fonts/selection.json`. Проверяется командой `yarn check-icons`.
65
-
66
- #### Добавить иконку (рекомендуемый способ)
67
-
68
- ```
69
- yarn add-icon <путь-к.svg> [--name <имя>] [--padding <0..0.4>]
70
- ```
71
-
72
- Скрипт сам: нормализует SVG (SVGO), переносит контур в координаты шрифта (грид 1024,
73
- флип Y, baseline), назначает следующий свободный codepoint, дописывает глиф в
74
- `EverCloud.svg` + запись в `selection.json`, вставляет строку в `iconTypes` и
75
- пересобирает `EverCloud.ttf/woff/eot`. После этого иконка доступна как
76
- `<Icon kind="<имя>" />`. Если имя уже занято — команда падает с ошибкой.
77
-
78
- Требования к исходному SVG: монохромный, контуры залиты (`fill`, не `stroke`),
79
- есть `viewBox` (желательно квадратный и без лишних полей). Результат стоит
80
- проверить визуально в Storybook (`yarn storybook`, story `Atoms/Icon`) — особенно
81
- иконки с отверстиями: при неверном направлении контуров дыра может залиться,
82
- тогда поправьте исходный SVG и перезапустите.
83
-
84
- Дубликаты по содержимому: скрипт сравнивает форму новой иконки с уже имеющимися
85
- (растровая «подпись» 32×32) и падает с ошибкой, если такая иконка уже есть. Обойти
86
- намеренно — флаг `--force`.
87
-
88
- #### Удалить иконку
89
-
90
- ```
91
- yarn remove-icon <имя> [<имя2> ...] [--dry-run]
92
- ```
93
-
94
- Снимает строку из `iconTypes` и пересобирает шрифт: глиф уходит из `EverCloud.svg`,
95
- `selection.json` и всех бинарников. Если codepoint иконки используется ещё одним
96
- именем-алиасом (напр. `geom_polygon`/`geom_multipolygon`), глиф сохраняется —
97
- снимается только имя.
98
-
99
- Вспомогательные команды: `yarn build-font` — пересобрать шрифт из текущих
100
- исходников (с приведением к `iconTypes`); `yarn check-icons` — проверить инвариант.
101
-
102
- #### Ручной способ через icomoon (fallback)
103
-
104
- 1. https://icomoon.io/app/#/projects
105
- 2. Import Project из `src/fonts/selection.json`
106
- 3. Load
107
- 4. Клик по гамбургер набора EverCloud в правом верхнем углу Import to Set
108
- 5. Generate Font в правом нижнем углу
109
- 6. Замена файлов `src/fonts` на загруженные из архива (папка fonts и selection.json)
110
-
111
- Совместимость двух систем: `yarn add-icon` хранит путь в `selection.json` в тех же
112
- координатах, что и icomoon (связь с глифом шрифта — `font_y = 832 − stored_y`).
113
- Поэтому оба workflow взаимозаменяемы: `selection.json` можно ре-импортировать в
114
- icomoon и перегенерировать шрифт (иконки, добавленные скриптом, отобразятся
115
- корректно), а результат генерации icomoon обрабатывается `yarn build-font` штатно.
116
-
117
- ## Used libraries, languages and tools
118
-
119
- 1. Typescript [Docs](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
120
- 2. React [Docs](https://reactjs.org/docs/hello-world.html)
121
- 3. Styled-components [Docs](https://www.styled-components.com/docs)
122
- 4. Jest [Docs](https://facebook.github.io/jest/docs/en/using-matchers.html)
123
- 6. Storybook [Docs](https://storybook.js.org/basics/writing-stories/)
124
-
125
- ## Style Guide
126
- 1. Every component in separate directory
127
- 2. Test file in same directory, with name *.test.tsx
128
- 3. Do not write snapshot tests for components, for snapshot testing used stories, test only specific behavior and functions
129
- 4. Story file in same directory, with name *.story.tsx
130
- 5. Write stories for every possible component state
131
- 6. Every component must be working without any props
132
- 7. Do not create pull request with any linters or ts errors
133
- 8. File naming convention:
134
-
135
- 1. PascalCase for file exporting classes and Components
136
- 2. camelCase for file exporting objects and functions
137
- 3. kebab-case for module replacements
138
- 9. Do not use default exports
139
- 10. Write component description in source file
140
-
141
- ### Completed Component must include the following:
142
- 1. Stories for every possible component state
143
- 2. Tests for specific behaviors and functions
144
- 3. Declared Theme variables
145
- 4. Props type
146
- 5. Component description
147
-
148
- ## Project structure
149
- 1. Import "styled-components" maps to styled-with-theme.ts
150
- 2. theme is theme folder 🚢
151
- 3. Simple reusable styled components and html tags with style are located in atoms folder
152
- 4. Groups of atoms are located in molecules folder
153
- 5. Groups of atoms, molecules and other are located in organisms folder
154
-
155
- ## Todo
156
- 1. Upgrade tippy (tooltip) package version
157
- 2. Upgrade imask & react-imask packages version
1
+ # 🛴 Evergis UI
2
+ ## Contributing
3
+
4
+ 🏆 **Before start:**
5
+
6
+ ```
7
+ yarn
8
+ ```
9
+ Update webstorm to >2017.3.3
10
+
11
+ Install Styled Components plugin [Jetbrains plugins](https://plugins.jetbrains.com/plugin/9997-styled-components)
12
+
13
+ 🛠️ **Start dev:**
14
+
15
+ ```
16
+ yarn storybook
17
+ ```
18
+
19
+ Open in browser localhost:6006
20
+
21
+ ✅ **Start tests:**
22
+
23
+ ```
24
+ yarn test
25
+ ```
26
+
27
+ ## How to release
28
+
29
+ 1. Создать временную ветку из `master`
30
+ 2. Изменить версию пакета в `package.json`
31
+ 3. `yarn` - освежить все зависимости
32
+ 4. `yarn lint:fix` - автопоправка eslint ошибок
33
+ 5. `yarn build` - сборка
34
+ 6. В корне проекта создать файл `.npmrc` со следующим содержимым:
35
+
36
+ ```
37
+ //registry.npmjs.org/:_authToken=npm_XXX
38
+ ```
39
+
40
+ Здесь `npm_XXX` -- granular token; создать его можно [по инструкции](https://docs.npmjs.com/creating-and-viewing-access-tokens). ВАЖНО: с 09.12.2025 срок действия токена не может превышать 90 дней.
41
+
42
+ **Примечение:** При создании токена необходимо *ОБЯЗАТЕЛЬНО* выбрать опцию `Bypass two-factor authentication (2FA)`.
43
+
44
+ 7. `npm login` - залогиниться в npm (ВАЖНО: с 12.12.2025 сессия длится 12 часов, проверить, всё ли мы ещё залогинены, можно с помощью команды `npm whoami`).
45
+ 8. `npm publish` - паблиш
46
+ 9. Создать МР из временной ветки в `master`
47
+
48
+ ## How to link
49
+
50
+ For testing uilib locally in client (or other projects)
51
+ without rebuilding after every update use linking:
52
+
53
+ 1. `yarn build` - сборка
54
+ 2. `yarn link` - создаём глобальную ссылку на uilib
55
+ 3. Открываем client или другой проект
56
+ 4. `yarn link "@evergis/uilib-gl"` - привязываем uilib к проекту
57
+ 5. `yarn start` - запускаем проект с привязанной uilib
58
+ 6. `yarn build` - после изменений в uilib делаем его пересборку
59
+
60
+ ### How to manage icons
61
+
62
+ **Источник истины набора иконок — объект `iconTypes` в `src/atoms/Icon/Icon.ts`.**
63
+ Инвариант: множество codepoint-ов в `iconTypes` == глифы в `src/fonts/EverCloud.svg` ==
64
+ иконки в `src/fonts/selection.json`. Проверяется командой `yarn check-icons`.
65
+
66
+ #### Добавить иконку (рекомендуемый способ)
67
+
68
+ ```
69
+ yarn add-icon <путь-к.svg> [--name <имя>] [--padding <0..0.4>]
70
+ ```
71
+
72
+ Скрипт сам: нормализует SVG (SVGO), переносит контур в координаты шрифта (грид 1024,
73
+ флип Y, baseline), назначает следующий свободный codepoint, дописывает глиф в
74
+ `EverCloud.svg` + запись в `selection.json`, вставляет строку в `iconTypes` и
75
+ пересобирает `EverCloud.ttf/woff/eot`. После этого иконка доступна как
76
+ `<Icon kind="<имя>" />`. Если имя уже занято — команда падает с ошибкой.
77
+
78
+ Требования к исходному SVG: монохромный, контуры залиты (`fill`, не `stroke`),
79
+ есть `viewBox` (желательно квадратный и без лишних полей). Результат стоит
80
+ проверить визуально в Storybook (`yarn storybook`, story `Atoms/Icon`) — особенно
81
+ иконки с отверстиями: при неверном направлении контуров дыра может залиться,
82
+ тогда поправьте исходный SVG и перезапустите.
83
+
84
+ Дубликаты по содержимому: скрипт сравнивает форму новой иконки с уже имеющимися
85
+ (растровая «подпись» 32×32) и падает с ошибкой, если такая иконка уже есть. Обойти
86
+ намеренно — флаг `--force`.
87
+
88
+ #### Удалить иконку
89
+
90
+ ```
91
+ yarn remove-icon <имя> [<имя2> ...] [--dry-run]
92
+ ```
93
+
94
+ Снимает строку из `iconTypes` и пересобирает шрифт: глиф уходит из `EverCloud.svg`,
95
+ `selection.json` и всех бинарников. Если codepoint иконки используется ещё одним
96
+ именем-алиасом (напр. `geom_polygon`/`geom_multipolygon`), глиф сохраняется —
97
+ снимается только имя.
98
+
99
+ Вспомогательные команды: `yarn build-font` — пересобрать шрифт из текущих
100
+ исходников (с приведением к `iconTypes`); `yarn check-icons` — проверить инвариант.
101
+
102
+ #### Ручной способ через icomoon (fallback)
103
+
104
+ 1. https://icomoon.io/app/#/projects
105
+ 2. Import Project из `src/fonts/selection.json`
106
+ 3. Load
107
+ 4. Клик по гамбургер набора EverCloud в правом верхнем углу Import to Set
108
+ 5. Generate Font в правом нижнем углу
109
+ 6. Замена файлов `src/fonts` на загруженные из архива (папка fonts и selection.json)
110
+
111
+ Совместимость двух систем: `yarn add-icon` хранит путь в `selection.json` в тех же
112
+ координатах, что и icomoon (связь с глифом шрифта — `font_y = 832 − stored_y`).
113
+ Поэтому оба workflow взаимозаменяемы: `selection.json` можно ре-импортировать в
114
+ icomoon и перегенерировать шрифт (иконки, добавленные скриптом, отобразятся
115
+ корректно), а результат генерации icomoon обрабатывается `yarn build-font` штатно.
116
+
117
+ ## Used libraries, languages and tools
118
+
119
+ 1. Typescript [Docs](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
120
+ 2. React [Docs](https://reactjs.org/docs/hello-world.html)
121
+ 3. Styled-components [Docs](https://www.styled-components.com/docs)
122
+ 4. Jest [Docs](https://facebook.github.io/jest/docs/en/using-matchers.html)
123
+ 6. Storybook [Docs](https://storybook.js.org/basics/writing-stories/)
124
+
125
+ ## Style Guide
126
+ 1. Every component in separate directory
127
+ 2. Test file in same directory, with name *.test.tsx
128
+ 3. Do not write snapshot tests for components, for snapshot testing used stories, test only specific behavior and functions
129
+ 4. Story file in same directory, with name *.story.tsx
130
+ 5. Write stories for every possible component state
131
+ 6. Every component must be working without any props
132
+ 7. Do not create pull request with any linters or ts errors
133
+ 8. File naming convention:
134
+
135
+ 1. PascalCase for file exporting classes and Components
136
+ 2. camelCase for file exporting objects and functions
137
+ 3. kebab-case for module replacements
138
+ 9. Do not use default exports
139
+ 10. Write component description in source file
140
+
141
+ ### Completed Component must include the following:
142
+ 1. Stories for every possible component state
143
+ 2. Tests for specific behaviors and functions
144
+ 3. Declared Theme variables
145
+ 4. Props type
146
+ 5. Component description
147
+
148
+ ## Project structure
149
+ 1. Import "styled-components" maps to styled-with-theme.ts
150
+ 2. theme is theme folder 🚢
151
+ 3. Simple reusable styled components and html tags with style are located in atoms folder
152
+ 4. Groups of atoms are located in molecules folder
153
+ 5. Groups of atoms, molecules and other are located in organisms folder
154
+
155
+ ## Todo
156
+ 1. Upgrade tippy (tooltip) package version
157
+ 2. Upgrade imask & react-imask packages version
@@ -348,6 +348,7 @@ export declare const iconTypes: {
348
348
  json: string;
349
349
  rollup: string;
350
350
  no_geom: string;
351
+ legend: string;
351
352
  };
352
353
  export declare const Icon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, IIconProps, never>;
353
354
  export declare const injectIcon: (icon: IconTypesKeys) => import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<import("styled-components").DefaultTheme>>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * Обёртка инпута-якоря: даёт полю собственный фон (сам `Input` прозрачен — `background: transparent`
3
4
  * в `inputMixin`), а `inline-flex` + `align-self` не дают обёртке растягиваться во flex-контейнере,
@@ -6,10 +7,12 @@
6
7
  export declare const AnchorWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
7
8
  export declare const FieldIcons: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("../../atoms/Grid").FlexProps, never>;
8
9
  export declare const CountBadge: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
9
- export declare const ResetIcon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../atoms/Icon").IIconProps, never>;
10
- export declare const Chevron: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../atoms/Icon").IIconProps & {
11
- isOpen?: boolean | undefined;
12
- }, never>;
10
+ /** Иконка свёрнутого состояния без выбора (справа в инпуте). */
11
+ export declare const TreeIcon: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../atoms/Icon").IIconProps, never>;
12
+ /** Кнопка «применить» (success). */
13
+ export declare const SuccessControl: import("styled-components").StyledComponent<import("react").FC<import("../../molecules/IconButton").IIconButtonProps>, import("styled-components").DefaultTheme, {}, never>;
14
+ /** Кнопка «очистить» (error) — цвет как на макете (приглушённый серый). */
15
+ export declare const ClearControl: import("styled-components").StyledComponent<import("react").FC<import("../../molecules/IconButton").IIconButtonProps>, import("styled-components").DefaultTheme, {}, never>;
13
16
  export declare const Content: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
14
17
  width?: string | undefined;
15
18
  }, never>;
@@ -21,6 +21,10 @@ export interface ITreeDropdownProps {
21
21
  onClose?: VoidFunction;
22
22
  onToggleSelect: (item: TreeItemProps) => void;
23
23
  onReset?: VoidFunction;
24
+ /** Выбор изменён с момента последнего сохранения — активирует кнопку «применить» (success, primary). */
25
+ dirty?: boolean;
26
+ /** Применить текущий выбор (сохранить фильтр) — клик по кнопке success. */
27
+ onSave?: VoidFunction;
24
28
  }
25
29
  export interface ITreeDropdownContextValue {
26
30
  selectedIds: Set<TreeId>;
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from "react";
2
2
  import { ITreeDropdownProps } from "./types";
3
- export declare const useTreeDropdown: ({ multiSelect, selectedIds, selectedCount, selectedLabel, searchValue, onOpen, onClose, onToggleSelect, onReset, onSearchChange, }: ITreeDropdownProps) => {
3
+ export declare const useTreeDropdown: ({ multiSelect, selectedIds, selectedCount, selectedLabel, searchValue, onOpen, onClose, onToggleSelect, onReset, onSave, onSearchChange, }: ITreeDropdownProps) => {
4
4
  open: boolean;
5
5
  openDropdown: () => void;
6
6
  closeDropdown: () => void;
@@ -8,6 +8,9 @@ export declare const useTreeDropdown: ({ multiSelect, selectedIds, selectedCount
8
8
  handleReset: (event: {
9
9
  stopPropagation: VoidFunction;
10
10
  }) => void;
11
+ handleSave: (event: {
12
+ stopPropagation: VoidFunction;
13
+ }) => void;
11
14
  contextValue: import("./types").ITreeDropdownContextValue;
12
15
  count: number;
13
16
  displayValue: string;
@@ -0,0 +1,9 @@
1
+ declare type StopEvent = {
2
+ stopPropagation: VoidFunction;
3
+ };
4
+ /** Обработчики управляющих кнопок инпута: очистка (error) и применение выбора (success). */
5
+ export declare const useTreeDropdownActions: (closeDropdown: VoidFunction, onReset?: VoidFunction | undefined, onSave?: VoidFunction | undefined) => {
6
+ handleReset: (event: StopEvent) => void;
7
+ handleSave: (event: StopEvent) => void;
8
+ };
9
+ export {};