@redneckz/wildless-cms-uni-blocks 0.14.845 → 0.14.850
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/bundle/bundle.umd.js +27 -78
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/bundle/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/bundle/hooks/useAspects/handleAspects.d.ts +1 -1
- package/bundle/hooks/useAspects/useAspects.d.ts +1 -1
- package/bundle/retail/validator/validators.d.ts +1 -0
- package/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/dist/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/dist/components/Header/HeaderChatBotButton.js +15 -4
- package/dist/components/Header/HeaderChatBotButton.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +1 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/dist/hooks/useAspects/handleAspects.d.ts +1 -1
- package/dist/hooks/useAspects/handleAspects.js +5 -2
- package/dist/hooks/useAspects/handleAspects.js.map +1 -1
- package/dist/hooks/useAspects/useAspects.d.ts +1 -1
- package/dist/retail/components/Fields/BeginDateField.js +1 -1
- package/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/dist/retail/components/Fields/ParticipantDateRegistrationField.js +1 -1
- package/dist/retail/components/Fields/ParticipantDateRegistrationField.js.map +1 -1
- package/dist/retail/utils/renderStep.js +3 -1
- package/dist/retail/utils/renderStep.js.map +1 -1
- package/dist/retail/validator/validatorObj.js +2 -2
- package/dist/retail/validator/validatorObj.js.map +1 -1
- package/dist/retail/validator/validators.d.ts +1 -0
- package/dist/retail/validator/validators.js +3 -1
- package/dist/retail/validator/validators.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/lib/components/Header/HeaderChatBotButton.js +15 -4
- package/lib/components/Header/HeaderChatBotButton.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +1 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/lib/hooks/useAspects/handleAspects.d.ts +1 -1
- package/lib/hooks/useAspects/handleAspects.js +5 -2
- package/lib/hooks/useAspects/handleAspects.js.map +1 -1
- package/lib/hooks/useAspects/useAspects.d.ts +1 -1
- package/lib/retail/components/Fields/BeginDateField.js +1 -1
- package/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/lib/retail/components/Fields/ParticipantDateRegistrationField.js +1 -1
- package/lib/retail/components/Fields/ParticipantDateRegistrationField.js.map +1 -1
- package/lib/retail/utils/renderStep.js +3 -1
- package/lib/retail/utils/renderStep.js.map +1 -1
- package/lib/retail/validator/validatorObj.js +3 -3
- package/lib/retail/validator/validatorObj.js.map +1 -1
- package/lib/retail/validator/validators.d.ts +1 -0
- package/lib/retail/validator/validators.js +1 -0
- package/lib/retail/validator/validators.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +27 -78
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/bundle/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/bundle/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/bundle/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/bundle/retail/validator/validators.d.ts +1 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/dist/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/dist/components/Header/HeaderChatBotButton.js +15 -4
- package/mobile/dist/components/Header/HeaderChatBotButton.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/dist/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/dist/hooks/useAspects/handleAspects.js +5 -2
- package/mobile/dist/hooks/useAspects/handleAspects.js.map +1 -1
- package/mobile/dist/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js +1 -1
- package/mobile/dist/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/ParticipantDateRegistrationField.js +1 -1
- package/mobile/dist/retail/components/Fields/ParticipantDateRegistrationField.js.map +1 -1
- package/mobile/dist/retail/utils/renderStep.js +3 -1
- package/mobile/dist/retail/utils/renderStep.js.map +1 -1
- package/mobile/dist/retail/validator/validatorObj.js +2 -2
- package/mobile/dist/retail/validator/validatorObj.js.map +1 -1
- package/mobile/dist/retail/validator/validators.d.ts +1 -0
- package/mobile/dist/retail/validator/validators.js +3 -1
- package/mobile/dist/retail/validator/validators.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/lib/components/Header/HeaderChatBotButton.js +15 -4
- package/mobile/lib/components/Header/HeaderChatBotButton.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/lib/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/lib/hooks/useAspects/handleAspects.js +5 -2
- package/mobile/lib/hooks/useAspects/handleAspects.js.map +1 -1
- package/mobile/lib/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js +1 -1
- package/mobile/lib/retail/components/Fields/BeginDateField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/ParticipantDateRegistrationField.js +1 -1
- package/mobile/lib/retail/components/Fields/ParticipantDateRegistrationField.js.map +1 -1
- package/mobile/lib/retail/utils/renderStep.js +3 -1
- package/mobile/lib/retail/utils/renderStep.js.map +1 -1
- package/mobile/lib/retail/validator/validatorObj.js +3 -3
- package/mobile/lib/retail/validator/validatorObj.js.map +1 -1
- package/mobile/lib/retail/validator/validators.d.ts +1 -0
- package/mobile/lib/retail/validator/validators.js +1 -0
- package/mobile/lib/retail/validator/validators.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.d.ts +1 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/src/components/Header/HeaderChatBotButton.tsx +18 -12
- package/mobile/src/components/Header/HeaderSubMenu.tsx +0 -1
- package/mobile/src/components/Header/HeaderTop.tsx +1 -6
- package/mobile/src/hooks/useAspects/aspects/forwardQuery.ts +1 -1
- package/mobile/src/hooks/useAspects/handleAspects.ts +6 -2
- package/mobile/src/hooks/useAspects/useAspects.ts +1 -1
- package/mobile/src/retail/components/Fields/BeginDateField.tsx +1 -0
- package/mobile/src/retail/components/Fields/ParticipantDateRegistrationField.tsx +5 -1
- package/mobile/src/retail/utils/renderStep.tsx +3 -1
- package/mobile/src/retail/validator/validatorObj.ts +3 -2
- package/mobile/src/retail/validator/validators.ts +3 -0
- package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +1 -0
- package/package.json +1 -1
- package/src/components/Header/HeaderChatBotButton.tsx +18 -12
- package/src/components/Header/HeaderSubMenu.tsx +0 -1
- package/src/components/Header/HeaderTop.tsx +1 -6
- package/src/hooks/useAspects/aspects/forwardQuery.ts +1 -1
- package/src/hooks/useAspects/handleAspects.ts +6 -2
- package/src/hooks/useAspects/useAspects.ts +1 -1
- package/src/retail/components/Fields/BeginDateField.tsx +1 -0
- package/src/retail/components/Fields/ParticipantDateRegistrationField.tsx +5 -1
- package/src/retail/utils/renderStep.tsx +3 -1
- package/src/retail/validator/validatorObj.ts +3 -2
- package/src/retail/validator/validators.ts +3 -0
- package/src/ui-kit/DatePicker/DatePickerControl.tsx +1 -0
- package/bundle/components/Header/useChatBot.d.ts +0 -5
- package/dist/components/Header/useChatBot.d.ts +0 -5
- package/dist/components/Header/useChatBot.js +0 -61
- package/dist/components/Header/useChatBot.js.map +0 -1
- package/lib/components/Header/useChatBot.d.ts +0 -5
- package/lib/components/Header/useChatBot.js +0 -58
- package/lib/components/Header/useChatBot.js.map +0 -1
- package/mobile/bundle/components/Header/useChatBot.d.ts +0 -5
- package/mobile/dist/components/Header/useChatBot.d.ts +0 -5
- package/mobile/dist/components/Header/useChatBot.js +0 -61
- package/mobile/dist/components/Header/useChatBot.js.map +0 -1
- package/mobile/lib/components/Header/useChatBot.d.ts +0 -5
- package/mobile/lib/components/Header/useChatBot.js +0 -58
- package/mobile/lib/components/Header/useChatBot.js.map +0 -1
- package/mobile/src/components/Header/useChatBot.ts +0 -86
- package/src/components/Header/useChatBot.ts +0 -86
package/bundle/bundle.umd.js
CHANGED
|
@@ -1057,9 +1057,12 @@
|
|
|
1057
1057
|
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1058
1058
|
};
|
|
1059
1059
|
|
|
1060
|
-
const handleAspects = ({ aspectsAttributes, aspects, ev }) => {
|
|
1060
|
+
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1061
1061
|
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1062
|
-
aspects[aspectName ?? '']
|
|
1062
|
+
const aspectFn = aspects[aspectName ?? ''];
|
|
1063
|
+
if (aspectFn) {
|
|
1064
|
+
await aspectFn(ev, params);
|
|
1065
|
+
}
|
|
1063
1066
|
}
|
|
1064
1067
|
};
|
|
1065
1068
|
|
|
@@ -1102,7 +1105,7 @@
|
|
|
1102
1105
|
return url.toString();
|
|
1103
1106
|
};
|
|
1104
1107
|
|
|
1105
|
-
const forwardQuery = (ev) => {
|
|
1108
|
+
const forwardQuery = async (ev) => {
|
|
1106
1109
|
const anchor = ev.target?.closest('a');
|
|
1107
1110
|
const navigator = locationNavigator();
|
|
1108
1111
|
if (isURL(anchor?.href) && !anchor?.href?.startsWith(navigator.origin)) {
|
|
@@ -2463,6 +2466,7 @@
|
|
|
2463
2466
|
return false;
|
|
2464
2467
|
})('Укажите дату выдачи паспорта');
|
|
2465
2468
|
const deliveryDateValidator = (errorMsg) => validator((_) => _?.getTime() >= new Date().getTime())(errorMsg);
|
|
2469
|
+
const notLaterDateValidator = (errorMsg) => validator((_) => _?.getTime() <= new Date().getTime())(errorMsg);
|
|
2466
2470
|
const numberValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 6)(errorMsg);
|
|
2467
2471
|
const serieValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length === 4)(errorMsg);
|
|
2468
2472
|
const snilsValidate = (snils) => {
|
|
@@ -2529,7 +2533,7 @@
|
|
|
2529
2533
|
lastJobExperience: jobNumberValidator('Укажите стаж на последнем месте работы'),
|
|
2530
2534
|
experience5Years: jobNumberValidator('Укажите общий стаж за последние 5 лет'),
|
|
2531
2535
|
jobsNumber: jobNumberValidator('Укажите количество мест работы за последние 5 лет'),
|
|
2532
|
-
beginDate:
|
|
2536
|
+
beginDate: notLaterDateValidator('Укажите дату заключения трудового договора'),
|
|
2533
2537
|
addressFact: addressDaDataValidator(),
|
|
2534
2538
|
addressRegistration: addressDaDataValidator(),
|
|
2535
2539
|
addressRetail: defaultSelectValidator('Выберите адрес банка'),
|
|
@@ -2556,7 +2560,7 @@
|
|
|
2556
2560
|
dulNumber: numberValidator('Укажите номер паспорта'),
|
|
2557
2561
|
dulSubdivisionCode: numberValidator('Укажите код подразделения'),
|
|
2558
2562
|
dulIssuedBy: defaultValidator('Укажите организацию, выдавшую паспорт'),
|
|
2559
|
-
participantDateRegistration:
|
|
2563
|
+
participantDateRegistration: notLaterDateValidator('Укажите дату регистрации'),
|
|
2560
2564
|
retirementIncome: defaultValidator(),
|
|
2561
2565
|
otherIncome: defaultValidator(),
|
|
2562
2566
|
wages: defaultValidator(),
|
|
@@ -3509,16 +3513,6 @@
|
|
|
3509
3513
|
});
|
|
3510
3514
|
}
|
|
3511
3515
|
};
|
|
3512
|
-
const initializeExternalStylesheet = (url = '') => {
|
|
3513
|
-
const link = globalThis.document.getElementById(url);
|
|
3514
|
-
if (!link) {
|
|
3515
|
-
const newLink = globalThis.document.createElement('link');
|
|
3516
|
-
newLink.href = url;
|
|
3517
|
-
newLink.id = url;
|
|
3518
|
-
newLink.rel = 'stylesheet';
|
|
3519
|
-
globalThis.document.head.appendChild(newLink);
|
|
3520
|
-
}
|
|
3521
|
-
};
|
|
3522
3516
|
function useExternalNS(namespaceName, url, unmountNS = true) {
|
|
3523
3517
|
const [externalNS, setExternalNS] = useState(undefined);
|
|
3524
3518
|
useEffect(() => {
|
|
@@ -3852,7 +3846,7 @@
|
|
|
3852
3846
|
|
|
3853
3847
|
const BankruptcyFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u0412 \u043E\u0442\u043D\u043E\u0448\u0435\u043D\u0438\u0438 \u043C\u0435\u043D\u044F \u0432\u0435\u0434\u0451\u0442\u0441\u044F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0441\u0442\u0432\u043E \u043F\u043E \u0434\u0435\u043B\u0443 \u043E \u0431\u0430\u043D\u043A\u0440\u043E\u0442\u0441\u0442\u0432\u0435", ...field(input?.name ?? '') })));
|
|
3854
3848
|
|
|
3855
|
-
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: isEsiaAuthorize(field, input) })));
|
|
3849
|
+
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...field(input?.name ?? ''), ...input, disabled: isEsiaAuthorize(field, input), maxDate: new Date() })));
|
|
3856
3850
|
|
|
3857
3851
|
const BirthPlaceField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...field(input?.name ?? ''), ...input, disabled: isEsiaAuthorize(field, input) })));
|
|
3858
3852
|
|
|
@@ -4746,7 +4740,7 @@
|
|
|
4746
4740
|
|
|
4747
4741
|
const OtherIncomeField = JSX(({ field, input }) => (jsx(DaDataInputControl, { label: "\u0418\u043D\u044B\u0435 \u0434\u043E\u0445\u043E\u0434\u044B", placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435", isInteger: true, ...field(input?.name ?? ''), ...input })));
|
|
4748
4742
|
|
|
4749
|
-
const ParticipantDateRegistrationField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E \u043C\u0435\u0441\u0442\u0443 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430", ...field(input?.name ?? '') })));
|
|
4743
|
+
const ParticipantDateRegistrationField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043F\u043E \u043C\u0435\u0441\u0442\u0443 \u0436\u0438\u0442\u0435\u043B\u044C\u0441\u0442\u0432\u0430", ...field(input?.name ?? ''), maxDate: new Date() })));
|
|
4750
4744
|
|
|
4751
4745
|
const MAX_PART = 100;
|
|
4752
4746
|
const MIN_PART = 0;
|
|
@@ -7806,7 +7800,9 @@
|
|
|
7806
7800
|
const cleanElements = [
|
|
7807
7801
|
!checkCondition({ condition }, getValue(field)) ? renderTitle(title) : null,
|
|
7808
7802
|
...renderInputs({ field, inputs, params }),
|
|
7809
|
-
]
|
|
7803
|
+
]
|
|
7804
|
+
.filter(Boolean)
|
|
7805
|
+
.map((_, j) => ({ ..._, key: _.key ?? `elem-${j}` }));
|
|
7810
7806
|
return cleanElements.length ? (jsx("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: cleanElements }, `section-${i}`)) : null;
|
|
7811
7807
|
});
|
|
7812
7808
|
const getValue = (field) => (name) => field(name)?.value;
|
|
@@ -9859,65 +9855,18 @@
|
|
|
9859
9855
|
});
|
|
9860
9856
|
const getDataTestIdAttribute = (dataTestId) => dataTestId ? { 'data-test-id': dataTestId } : null;
|
|
9861
9857
|
|
|
9862
|
-
const
|
|
9863
|
-
const
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
};
|
|
9872
|
-
const useChatBot = (chat) => {
|
|
9873
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
9874
|
-
useEffect(() => globalThis.localStorage?.setItem(CHAT_STORAGE_NAME, String(Date.now())), []);
|
|
9875
|
-
const chatUrl = CHATBOT_URL[chat ?? ''];
|
|
9876
|
-
const load = useCallback((ev) => {
|
|
9877
|
-
if (!chatUrl) {
|
|
9878
|
-
return;
|
|
9879
|
-
}
|
|
9880
|
-
setIsLoading(true);
|
|
9881
|
-
if (chat === 'business') {
|
|
9882
|
-
renderBusinessChatBot(chatUrl).finally(() => setIsLoading(false));
|
|
9883
|
-
}
|
|
9884
|
-
else {
|
|
9885
|
-
renderPersonalChatBot(ev, chatUrl).finally(() => setIsLoading(false));
|
|
9858
|
+
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
9859
|
+
const HeaderChatBotButton = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
9860
|
+
const [isLoading, { setTrue: startLoad, setFalse: endLoad }] = useBool(false);
|
|
9861
|
+
const aspects = useAspects();
|
|
9862
|
+
const handleClick = useCallback((ev) => {
|
|
9863
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
9864
|
+
if (openChatBot) {
|
|
9865
|
+
startLoad();
|
|
9866
|
+
openChatBot(ev).finally(endLoad);
|
|
9886
9867
|
}
|
|
9887
|
-
}, [
|
|
9888
|
-
return {
|
|
9889
|
-
};
|
|
9890
|
-
const renderPersonalChatBot = async (ev, chatUrl) => {
|
|
9891
|
-
const target = ev.target;
|
|
9892
|
-
if (!target?.classList.contains(CHAT_BUTTON_EXTERNAL_NAME)) {
|
|
9893
|
-
target?.classList.add(CHAT_BUTTON_EXTERNAL_NAME);
|
|
9894
|
-
}
|
|
9895
|
-
const chatFrame = globalThis.document.getElementById(CHAT_FRAME_ID);
|
|
9896
|
-
if (!chatFrame) {
|
|
9897
|
-
await initializeExternalNS(CHAT_NAMESPACE, chatUrl);
|
|
9898
|
-
}
|
|
9899
|
-
};
|
|
9900
|
-
const renderBusinessChatBot = async (chatUrl) => {
|
|
9901
|
-
const businessChat = (await initializeExternalNS(CHAT_NAMESPACE, `${chatUrl}/bundle.js`, true));
|
|
9902
|
-
initializeExternalStylesheet(`${chatUrl}/bundle.css`);
|
|
9903
|
-
const chatFrame = globalThis.document.getElementById(CHAT_FRAME_ID);
|
|
9904
|
-
if (chatFrame) {
|
|
9905
|
-
businessChat?.chatOpen?.();
|
|
9906
|
-
}
|
|
9907
|
-
else {
|
|
9908
|
-
createChatFrame();
|
|
9909
|
-
businessChat?.render?.(CHAT_FRAME_ID, true, BUSINESS_CHAT_PREFIX, BUSINESS_CHAT_CLASSNAME);
|
|
9910
|
-
}
|
|
9911
|
-
};
|
|
9912
|
-
const createChatFrame = () => {
|
|
9913
|
-
const chatFrame = globalThis.document.createElement('div');
|
|
9914
|
-
chatFrame.id = CHAT_FRAME_ID;
|
|
9915
|
-
globalThis.document.body.appendChild(chatFrame);
|
|
9916
|
-
};
|
|
9917
|
-
|
|
9918
|
-
const HeaderChatBotButton = JSX(({ chat = 'personal', iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large', }) => {
|
|
9919
|
-
const { load, isLoading } = useChatBot(chat);
|
|
9920
|
-
return (jsx(HeaderSecondaryMenuButton, { className: className, image: { icon: 'ChatBotIcon', iconVersion }, ariaLabel: ariaLabel, onClick: load, buttonSize: buttonSize, isGrayBg: true, version: version, isLoading: isLoading, dataTestId: "chat icon" }));
|
|
9868
|
+
}, []);
|
|
9869
|
+
return (jsx(HeaderSecondaryMenuButton, { className: className, image: { icon: 'ChatBotIcon', iconVersion }, ariaLabel: ariaLabel, onClick: handleClick, buttonSize: buttonSize, isGrayBg: true, version: version, isLoading: isLoading, disabled: isLoading, dataTestId: "chat icon" }));
|
|
9921
9870
|
});
|
|
9922
9871
|
|
|
9923
9872
|
const HeaderItem = JSX(({ className = '', active, dataItemName, children, data, ...rest }) => {
|
|
@@ -9962,7 +9911,7 @@
|
|
|
9962
9911
|
? handleIntersectionActivation$1(index)
|
|
9963
9912
|
: handleIntersectionDeactivation$1(index));
|
|
9964
9913
|
}), [subItems]);
|
|
9965
|
-
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion,
|
|
9914
|
+
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion, ariaLabel: chatBotAriaLabel })) : null, jsx(InternetBankButton, { version: version, ...internetBankButton })] }));
|
|
9966
9915
|
});
|
|
9967
9916
|
const handleIntersectionActivation$1 = (index) => (prev) => Math.max(prev, index + 1);
|
|
9968
9917
|
const handleIntersectionDeactivation$1 = (index) => (prev) => Math.min(prev, index);
|
|
@@ -11036,7 +10985,7 @@
|
|
|
11036
10985
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11037
10986
|
});
|
|
11038
10987
|
|
|
11039
|
-
const packageVersion = "0.14.
|
|
10988
|
+
const packageVersion = "0.14.849";
|
|
11040
10989
|
|
|
11041
10990
|
exports.Blocks = Blocks;
|
|
11042
10991
|
exports.ContentPage = ContentPage;
|