@formixru/b2b-ui 2.2.0 → 2.4.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/CHANGELOG.md +9 -0
- package/package.json +3 -3
- package/src/components/request/index.js +21 -8
- package/src/variables.scss +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## v2.4.0
|
|
2
|
+
|
|
3
|
+
- `@advdominion/tooltip` обновлён до 5-й версии
|
|
4
|
+
- Исправдение стилей `.warning-message`
|
|
5
|
+
|
|
6
|
+
## v2.3.0
|
|
7
|
+
|
|
8
|
+
- В `Request` добавлена поддержка id диалогового окна или сайдбара как c `#`, так и без неё
|
|
9
|
+
|
|
1
10
|
## v2.2.0
|
|
2
11
|
|
|
3
12
|
- Доработки по стилям `.tabs`/`.warning-message`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formixru/b2b-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@advdominion/get-scrollbar-width": "^2.0.0",
|
|
28
28
|
"@advdominion/is": "^1.0.1",
|
|
29
29
|
"@advdominion/pluralize": "^1.0.1",
|
|
30
|
-
"@advdominion/tooltip": "^
|
|
30
|
+
"@advdominion/tooltip": "^5.0.0",
|
|
31
31
|
"@eslint/eslintrc": "^3.3.1",
|
|
32
32
|
"@eslint/js": "^9.33.0",
|
|
33
33
|
"@floating-ui/dom": "^1.7.4",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@advdominion/get-scrollbar-width": "^2.0.0",
|
|
82
82
|
"@advdominion/is": "^1.0.0",
|
|
83
83
|
"@advdominion/pluralize": "^1.0.0",
|
|
84
|
-
"@advdominion/tooltip": "^
|
|
84
|
+
"@advdominion/tooltip": "^5.0.0",
|
|
85
85
|
"color": "^5.0.0",
|
|
86
86
|
"dayjs": "^1.0.0",
|
|
87
87
|
"imask": "^7.0.0",
|
|
@@ -15,6 +15,13 @@ export const initRequestContent = ($b) => {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
const getElementId = (id) => {
|
|
19
|
+
if (!id || id.startsWith('#')) {
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
return `#${id}`;
|
|
23
|
+
};
|
|
24
|
+
|
|
18
25
|
export const request = async ({
|
|
19
26
|
$b,
|
|
20
27
|
url = '',
|
|
@@ -90,18 +97,20 @@ export const request = async ({
|
|
|
90
97
|
console.warn('Функция __FORMIX__REQUEST__INTERCEPT_DATA не установлена');
|
|
91
98
|
}
|
|
92
99
|
if (data.dialog) {
|
|
93
|
-
const
|
|
100
|
+
const elementId = getElementId(data.dialog.id);
|
|
101
|
+
const $dialog = document.querySelector(elementId);
|
|
94
102
|
if ($dialog) {
|
|
95
103
|
$dialog.querySelector('.dialog__container').innerHTML = data.dialog.content;
|
|
96
104
|
await showDialog($dialog);
|
|
97
105
|
initRequestContent($dialog);
|
|
98
106
|
} else {
|
|
99
|
-
console.error(`Диалоговое окно с id ${
|
|
107
|
+
console.error(`Диалоговое окно с id ${elementId?.replace(/^#/, '')} не найдено`);
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
if (data.reloadOnHideDialog) {
|
|
103
111
|
if (data.dialog) {
|
|
104
|
-
const
|
|
112
|
+
const elementId = getElementId(data.dialog.id);
|
|
113
|
+
const $dialog = document.querySelector(elementId);
|
|
105
114
|
$dialog?.addEventListener('dialog-hide', () => {
|
|
106
115
|
location.reload();
|
|
107
116
|
});
|
|
@@ -113,7 +122,8 @@ export const request = async ({
|
|
|
113
122
|
}
|
|
114
123
|
if (data.hideDialog) {
|
|
115
124
|
if (data.dialog) {
|
|
116
|
-
const
|
|
125
|
+
const elementId = getElementId(data.dialog.id);
|
|
126
|
+
const $dialog = document.querySelector(elementId);
|
|
117
127
|
if ($dialog) {
|
|
118
128
|
hideDialog($dialog);
|
|
119
129
|
}
|
|
@@ -122,18 +132,20 @@ export const request = async ({
|
|
|
122
132
|
}
|
|
123
133
|
}
|
|
124
134
|
if (data.sidebar) {
|
|
125
|
-
const
|
|
135
|
+
const elementId = getElementId(data.sidebar.id);
|
|
136
|
+
const $sidebar = document.querySelector(elementId);
|
|
126
137
|
if ($sidebar) {
|
|
127
138
|
$sidebar.innerHTML = data.sidebar.content;
|
|
128
139
|
await showSidebar($sidebar);
|
|
129
140
|
initRequestContent($sidebar);
|
|
130
141
|
} else {
|
|
131
|
-
console.error(`Сайдбар с id ${
|
|
142
|
+
console.error(`Сайдбар с id ${elementId?.replace(/^#/, '')} не найден`);
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
if (data.reloadOnHideSidebar) {
|
|
135
146
|
if (data.sidebar) {
|
|
136
|
-
const
|
|
147
|
+
const elementId = getElementId(data.sidebar.id);
|
|
148
|
+
const $sidebar = document.querySelector(elementId);
|
|
137
149
|
$sidebar?.addEventListener('sidebar-hide', () => {
|
|
138
150
|
location.reload();
|
|
139
151
|
});
|
|
@@ -145,7 +157,8 @@ export const request = async ({
|
|
|
145
157
|
}
|
|
146
158
|
if (data.hideSidebar) {
|
|
147
159
|
if (data.sidebar) {
|
|
148
|
-
const
|
|
160
|
+
const elementId = getElementId(data.sidebar.id);
|
|
161
|
+
const $sidebar = document.querySelector(elementId);
|
|
149
162
|
if ($sidebar) {
|
|
150
163
|
hideSidebar($sidebar);
|
|
151
164
|
}
|
package/src/variables.scss
CHANGED
|
@@ -1021,7 +1021,7 @@ $warning-message-success-color: $color-success !default;
|
|
|
1021
1021
|
$warning-message-solid-success-color: $warning-message-solid-color !default;
|
|
1022
1022
|
$warning-message-info-color: $color-primary !default;
|
|
1023
1023
|
$warning-message-solid-info-color: $warning-message-solid-color !default;
|
|
1024
|
-
$warning-message-light-info-color: $color-primary-
|
|
1024
|
+
$warning-message-light-info-color: $color-primary-80 !default;
|
|
1025
1025
|
$warning-message-solid-light-info-color: $font-color-secondary !default;
|
|
1026
1026
|
$warning-message-error-color: $color-error !default;
|
|
1027
1027
|
$warning-message-solid-error-color: $warning-message-solid-color !default;
|