funda-ui 4.7.150 → 4.7.155
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/CascadingSelect/index.js +13 -6
- package/CascadingSelectE2E/index.js +13 -6
- package/Chatbox/index.css +8 -0
- package/Chatbox/index.d.ts +8 -0
- package/Chatbox/index.js +265 -171
- package/Date/index.js +13 -6
- package/DropdownMenu/index.js +13 -6
- package/EventCalendar/index.js +42 -35
- package/EventCalendarTimeline/index.js +55 -41
- package/LiveSearch/index.js +13 -6
- package/ModalDialog/index.js +13 -6
- package/RootPortal/index.d.ts +2 -1
- package/RootPortal/index.js +13 -6
- package/Select/index.js +13 -6
- package/Toast/index.js +13 -6
- package/Tooltip/index.js +13 -6
- package/lib/cjs/CascadingSelect/index.js +13 -6
- package/lib/cjs/CascadingSelectE2E/index.js +13 -6
- package/lib/cjs/Chatbox/index.d.ts +8 -0
- package/lib/cjs/Chatbox/index.js +265 -171
- package/lib/cjs/Date/index.js +13 -6
- package/lib/cjs/DropdownMenu/index.js +13 -6
- package/lib/cjs/EventCalendar/index.js +42 -35
- package/lib/cjs/EventCalendarTimeline/index.js +55 -41
- package/lib/cjs/LiveSearch/index.js +13 -6
- package/lib/cjs/ModalDialog/index.js +13 -6
- package/lib/cjs/RootPortal/index.d.ts +2 -1
- package/lib/cjs/RootPortal/index.js +13 -6
- package/lib/cjs/Select/index.js +13 -6
- package/lib/cjs/Toast/index.js +13 -6
- package/lib/cjs/Tooltip/index.js +13 -6
- package/lib/css/Chatbox/index.css +8 -0
- package/lib/esm/Chatbox/index.scss +9 -0
- package/lib/esm/Chatbox/index.tsx +103 -15
- package/lib/esm/RootPortal/index.tsx +14 -8
- package/package.json +1 -1
package/CascadingSelect/index.js
CHANGED
|
@@ -171,7 +171,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
171
171
|
var RootPortal = function RootPortal(props) {
|
|
172
172
|
var containerClassName = props.containerClassName,
|
|
173
173
|
show = props.show,
|
|
174
|
-
children = props.children
|
|
174
|
+
children = props.children,
|
|
175
|
+
_props$usePortal = props.usePortal,
|
|
176
|
+
usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
|
|
175
177
|
var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
176
178
|
|
|
177
179
|
// Move HTML templates to tag end body </body>
|
|
@@ -182,15 +184,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
182
184
|
// Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
|
|
183
185
|
|
|
184
186
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
if (usePortal) {
|
|
188
|
+
containerRef.current = document.createElement('div');
|
|
189
|
+
containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
|
|
190
|
+
document.body.appendChild(containerRef.current);
|
|
191
|
+
}
|
|
188
192
|
return function () {
|
|
189
|
-
if (containerRef.current) {
|
|
193
|
+
if (usePortal && containerRef.current) {
|
|
190
194
|
containerRef.current.remove();
|
|
191
195
|
}
|
|
192
196
|
};
|
|
193
|
-
}, []);
|
|
197
|
+
}, [usePortal]);
|
|
198
|
+
if (!usePortal) {
|
|
199
|
+
return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
|
|
200
|
+
}
|
|
194
201
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
|
|
195
202
|
};
|
|
196
203
|
/* harmony default export */
|
|
@@ -171,7 +171,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
171
171
|
var RootPortal = function RootPortal(props) {
|
|
172
172
|
var containerClassName = props.containerClassName,
|
|
173
173
|
show = props.show,
|
|
174
|
-
children = props.children
|
|
174
|
+
children = props.children,
|
|
175
|
+
_props$usePortal = props.usePortal,
|
|
176
|
+
usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
|
|
175
177
|
var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
176
178
|
|
|
177
179
|
// Move HTML templates to tag end body </body>
|
|
@@ -182,15 +184,20 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
|
182
184
|
// Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
|
|
183
185
|
|
|
184
186
|
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
if (usePortal) {
|
|
188
|
+
containerRef.current = document.createElement('div');
|
|
189
|
+
containerRef.current.className = "root-portal-container ".concat(containerClassName || '');
|
|
190
|
+
document.body.appendChild(containerRef.current);
|
|
191
|
+
}
|
|
188
192
|
return function () {
|
|
189
|
-
if (containerRef.current) {
|
|
193
|
+
if (usePortal && containerRef.current) {
|
|
190
194
|
containerRef.current.remove();
|
|
191
195
|
}
|
|
192
196
|
};
|
|
193
|
-
}, []);
|
|
197
|
+
}, [usePortal]);
|
|
198
|
+
if (!usePortal) {
|
|
199
|
+
return show ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, children) : null;
|
|
200
|
+
}
|
|
194
201
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0___default().Fragment, null, containerRef.current && show && /*#__PURE__*/(0, react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, containerRef.current));
|
|
195
202
|
};
|
|
196
203
|
/* harmony default export */
|
package/Chatbox/index.css
CHANGED
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
right: 0;
|
|
155
155
|
z-index: 1031;
|
|
156
156
|
height: var(--custom-chatbox-h);
|
|
157
|
+
/* disable popup */
|
|
157
158
|
/* message list */
|
|
158
159
|
/* dot loading */
|
|
159
160
|
/* control area */
|
|
@@ -164,6 +165,12 @@
|
|
|
164
165
|
/* default questions */
|
|
165
166
|
/* Tooltip */
|
|
166
167
|
}
|
|
168
|
+
.custom-chatbox-container.popup-none {
|
|
169
|
+
position: relative;
|
|
170
|
+
bottom: auto;
|
|
171
|
+
right: auto;
|
|
172
|
+
box-shadow: none;
|
|
173
|
+
}
|
|
167
174
|
.custom-chatbox-container details {
|
|
168
175
|
font-style: italic;
|
|
169
176
|
margin: 0;
|
|
@@ -375,6 +382,7 @@
|
|
|
375
382
|
border: 1px solid var(--custom-chatbox-gray-color);
|
|
376
383
|
border-radius: 0.35rem;
|
|
377
384
|
transition: all 0.3s ease;
|
|
385
|
+
background: var(--custom-chatbox-input-bg);
|
|
378
386
|
}
|
|
379
387
|
.custom-chatbox-container .msgcontrol img, .custom-chatbox-container .msgcontrol svg, .custom-chatbox-container .msgcontrol video, .custom-chatbox-container .msgcontrol canvas, .custom-chatbox-container .msgcontrol audio, .custom-chatbox-container .msgcontrol iframe, .custom-chatbox-container .msgcontrol embed, .custom-chatbox-container .msgcontrol object {
|
|
380
388
|
display: inline;
|
package/Chatbox/index.d.ts
CHANGED
|
@@ -13,12 +13,19 @@ export declare type QuestionData = {
|
|
|
13
13
|
title: string;
|
|
14
14
|
list: Array<string>;
|
|
15
15
|
};
|
|
16
|
+
export declare type SelectedOption = {
|
|
17
|
+
[key: string]: string | number;
|
|
18
|
+
curIndex: number;
|
|
19
|
+
curValue: string;
|
|
20
|
+
};
|
|
16
21
|
export interface FloatingButton {
|
|
17
22
|
label: string;
|
|
18
23
|
value: string;
|
|
19
24
|
onClick: string;
|
|
25
|
+
active?: boolean;
|
|
20
26
|
isSelect?: boolean;
|
|
21
27
|
dynamicOptions?: boolean;
|
|
28
|
+
defaultSelected?: number;
|
|
22
29
|
[key: string]: any;
|
|
23
30
|
}
|
|
24
31
|
export interface FloatingButtonSelectOption {
|
|
@@ -76,6 +83,7 @@ export declare type ChatboxProps = {
|
|
|
76
83
|
defaultQuestions?: QuestionData;
|
|
77
84
|
showCopyBtn?: boolean;
|
|
78
85
|
autoCopyReply?: boolean;
|
|
86
|
+
usePopUp?: boolean;
|
|
79
87
|
customRequest?: CustomRequestFunction;
|
|
80
88
|
renderParser?: (input: string) => Promise<string>;
|
|
81
89
|
requestBodyFormatter?: (body: any, contextData: Record<string, any>, conversationHistory: MessageDetail[]) => Promise<Record<string, any>>;
|