funda-ui 4.7.625 → 4.7.711

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.
Files changed (90) hide show
  1. package/CascadingSelect/index.js +2 -2
  2. package/CascadingSelectE2E/index.js +2 -2
  3. package/Chatbox/index.js +3 -17
  4. package/Checkbox/index.js +3 -3
  5. package/ColorPicker/index.js +3 -18
  6. package/Date/index.js +3 -18
  7. package/EventCalendarTimeline/index.d.ts +2 -2
  8. package/EventCalendarTimeline/index.js +24 -6
  9. package/File/index.d.ts +9 -0
  10. package/File/index.js +245 -93
  11. package/Input/index.js +3 -18
  12. package/LiveSearch/index.js +3 -18
  13. package/NativeSelect/index.js +3 -3
  14. package/NumberInput/index.js +3 -18
  15. package/Popover/index.css +198 -0
  16. package/Popover/index.d.ts +4 -0
  17. package/Popover/index.js +1808 -0
  18. package/README.md +1 -0
  19. package/Radio/index.js +3 -3
  20. package/RangeSlider/index.js +3 -18
  21. package/SearchBar/index.js +3 -18
  22. package/Select/index.js +3 -2
  23. package/Switch/index.js +3 -3
  24. package/TagInput/index.css +31 -31
  25. package/TagInput/index.js +12 -23
  26. package/Textarea/index.js +3 -17
  27. package/Utils/usePageVisibility.d.ts +5 -0
  28. package/Utils/usePageVisibility.js +166 -0
  29. package/Utils/useSSE.d.ts +50 -0
  30. package/Utils/useSSE.js +235 -0
  31. package/all.d.ts +1 -0
  32. package/all.js +1 -0
  33. package/lib/cjs/CascadingSelect/index.js +2 -2
  34. package/lib/cjs/CascadingSelectE2E/index.js +2 -2
  35. package/lib/cjs/Chatbox/index.js +3 -17
  36. package/lib/cjs/Checkbox/index.js +3 -3
  37. package/lib/cjs/ColorPicker/index.js +3 -18
  38. package/lib/cjs/Date/index.js +3 -18
  39. package/lib/cjs/EventCalendarTimeline/index.d.ts +2 -2
  40. package/lib/cjs/EventCalendarTimeline/index.js +24 -6
  41. package/lib/cjs/File/index.d.ts +9 -0
  42. package/lib/cjs/File/index.js +245 -93
  43. package/lib/cjs/Input/index.js +3 -18
  44. package/lib/cjs/LiveSearch/index.js +3 -18
  45. package/lib/cjs/NativeSelect/index.js +3 -3
  46. package/lib/cjs/NumberInput/index.js +3 -18
  47. package/lib/cjs/Popover/index.d.ts +4 -0
  48. package/lib/cjs/Popover/index.js +1808 -0
  49. package/lib/cjs/Radio/index.js +3 -3
  50. package/lib/cjs/RangeSlider/index.js +3 -18
  51. package/lib/cjs/SearchBar/index.js +3 -18
  52. package/lib/cjs/Select/index.js +3 -2
  53. package/lib/cjs/Switch/index.js +3 -3
  54. package/lib/cjs/TagInput/index.js +12 -23
  55. package/lib/cjs/Textarea/index.js +3 -17
  56. package/lib/cjs/Utils/usePageVisibility.d.ts +5 -0
  57. package/lib/cjs/Utils/usePageVisibility.js +166 -0
  58. package/lib/cjs/Utils/useSSE.d.ts +50 -0
  59. package/lib/cjs/Utils/useSSE.js +235 -0
  60. package/lib/cjs/index.d.ts +1 -0
  61. package/lib/cjs/index.js +1 -0
  62. package/lib/css/Popover/index.css +198 -0
  63. package/lib/css/TagInput/index.css +31 -31
  64. package/lib/esm/CascadingSelect/index.tsx +2 -2
  65. package/lib/esm/CascadingSelectE2E/index.tsx +2 -2
  66. package/lib/esm/Checkbox/index.tsx +3 -3
  67. package/lib/esm/ColorPicker/index.tsx +4 -15
  68. package/lib/esm/EventCalendarTimeline/index.tsx +30 -13
  69. package/lib/esm/File/index.tsx +148 -23
  70. package/lib/esm/Input/index.tsx +6 -17
  71. package/lib/esm/ModalDialog/index.tsx +0 -1
  72. package/lib/esm/NativeSelect/index.tsx +3 -3
  73. package/lib/esm/NumberInput/index.tsx +7 -15
  74. package/lib/esm/Popover/Popover.tsx +251 -0
  75. package/lib/esm/Popover/PopoverClose.tsx +51 -0
  76. package/lib/esm/Popover/PopoverContent.tsx +72 -0
  77. package/lib/esm/Popover/PopoverTrigger.tsx +62 -0
  78. package/lib/esm/Popover/index.scss +272 -0
  79. package/lib/esm/Popover/index.tsx +4 -0
  80. package/lib/esm/Radio/index.tsx +3 -3
  81. package/lib/esm/SearchBar/index.tsx +8 -12
  82. package/lib/esm/Select/index.tsx +2 -2
  83. package/lib/esm/Switch/index.tsx +3 -3
  84. package/lib/esm/TagInput/index.scss +24 -24
  85. package/lib/esm/TagInput/index.tsx +13 -20
  86. package/lib/esm/Textarea/index.tsx +6 -14
  87. package/lib/esm/Utils/hooks/usePageVisibility.tsx +84 -0
  88. package/lib/esm/Utils/hooks/useSSE.tsx +134 -0
  89. package/lib/esm/index.js +1 -0
  90. package/package.json +1 -1
@@ -0,0 +1,235 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define(["react"], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["RPB"] = factory(require("react"));
8
+ else
9
+ root["RPB"] = factory(root["React"]);
10
+ })(this, (__WEBPACK_EXTERNAL_MODULE__787__) => {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ "use strict";
13
+ /******/ var __webpack_modules__ = ({
14
+
15
+ /***/ 787:
16
+ /***/ ((module) => {
17
+
18
+ module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
19
+
20
+ /***/ })
21
+
22
+ /******/ });
23
+ /************************************************************************/
24
+ /******/ // The module cache
25
+ /******/ var __webpack_module_cache__ = {};
26
+ /******/
27
+ /******/ // The require function
28
+ /******/ function __webpack_require__(moduleId) {
29
+ /******/ // Check if module is in cache
30
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
31
+ /******/ if (cachedModule !== undefined) {
32
+ /******/ return cachedModule.exports;
33
+ /******/ }
34
+ /******/ // Create a new module (and put it into the cache)
35
+ /******/ var module = __webpack_module_cache__[moduleId] = {
36
+ /******/ // no module.id needed
37
+ /******/ // no module.loaded needed
38
+ /******/ exports: {}
39
+ /******/ };
40
+ /******/
41
+ /******/ // Execute the module function
42
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
43
+ /******/
44
+ /******/ // Return the exports of the module
45
+ /******/ return module.exports;
46
+ /******/ }
47
+ /******/
48
+ /************************************************************************/
49
+ /******/ /* webpack/runtime/compat get default export */
50
+ /******/ (() => {
51
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
52
+ /******/ __webpack_require__.n = (module) => {
53
+ /******/ var getter = module && module.__esModule ?
54
+ /******/ () => (module['default']) :
55
+ /******/ () => (module);
56
+ /******/ __webpack_require__.d(getter, { a: getter });
57
+ /******/ return getter;
58
+ /******/ };
59
+ /******/ })();
60
+ /******/
61
+ /******/ /* webpack/runtime/define property getters */
62
+ /******/ (() => {
63
+ /******/ // define getter functions for harmony exports
64
+ /******/ __webpack_require__.d = (exports, definition) => {
65
+ /******/ for(var key in definition) {
66
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
67
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
68
+ /******/ }
69
+ /******/ }
70
+ /******/ };
71
+ /******/ })();
72
+ /******/
73
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
74
+ /******/ (() => {
75
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
76
+ /******/ })();
77
+ /******/
78
+ /******/ /* webpack/runtime/make namespace object */
79
+ /******/ (() => {
80
+ /******/ // define __esModule on exports
81
+ /******/ __webpack_require__.r = (exports) => {
82
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
83
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
84
+ /******/ }
85
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
86
+ /******/ };
87
+ /******/ })();
88
+ /******/
89
+ /************************************************************************/
90
+ var __webpack_exports__ = {};
91
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
92
+ (() => {
93
+ __webpack_require__.r(__webpack_exports__);
94
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
95
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
96
+ /* harmony export */ "useSSE": () => (/* binding */ useSSE)
97
+ /* harmony export */ });
98
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(787);
99
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
100
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
101
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
102
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
103
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
104
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
105
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
106
+ /**
107
+ * SSE
108
+ *
109
+ * @usage:
110
+ *
111
+ const App = () => {
112
+ const { connected, messages, disconnect, reconnect } = useSSE('http://localhost:3000/sse');
113
+
114
+ return (
115
+ <div>
116
+ <p>Status: {connected ? '✅ Connected' : '❌ Disconnected'}</p>
117
+ <button onClick={disconnect}>Disconnect</button>
118
+ <button onClick={reconnect}>Reconnect</button>
119
+ {messages.map((m, i) => <div key={i}>{m}</div>)}
120
+ </div>
121
+ );
122
+ };
123
+
124
+ * It is recommended to use it in conjunction with usePageVisibility, because in HTTP mode,
125
+ * browsers allow a maximum of 6 connections; otherwise, other normal interfaces will be suspended and inaccessible.
126
+
127
+ import usePageVisibility from 'funda-ui/Utils/usePageVisibility';
128
+
129
+ const App = () => {
130
+ const { connected, messages, disconnect, reconnect } = useSSE('http://localhost:3000/sse');
131
+
132
+ // add new
133
+ usePageVisibility(
134
+ () => {
135
+ reconnect();
136
+ },
137
+ () => {
138
+ disconnect();
139
+ },
140
+ () => console.log("🎬 Page initialized while visible.")
141
+ );
142
+
143
+ return '';
144
+ };
145
+
146
+ */
147
+
148
+
149
+ var useSSE = function useSSE(url) {
150
+ var retryDelay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;
151
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
152
+ _useState2 = _slicedToArray(_useState, 2),
153
+ connected = _useState2[0],
154
+ setConnected = _useState2[1];
155
+ var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
156
+ _useState4 = _slicedToArray(_useState3, 2),
157
+ messages = _useState4[0],
158
+ setMessages = _useState4[1];
159
+ var sourceRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
160
+ var reconnectTimerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
161
+ var manuallyClosedRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
162
+ var internalCleanup = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
163
+ if (reconnectTimerRef.current) {
164
+ clearTimeout(reconnectTimerRef.current);
165
+ reconnectTimerRef.current = null;
166
+ }
167
+ if (sourceRef.current) {
168
+ try {
169
+ sourceRef.current.close();
170
+ } catch (_) {
171
+ // Ignore errors during cleanup
172
+ }
173
+ sourceRef.current = null;
174
+ }
175
+ setConnected(false);
176
+ }, []);
177
+ var connect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
178
+ if (!url || manuallyClosedRef.current) return;
179
+
180
+ // Prevent duplicate connections
181
+ if (sourceRef.current) return;
182
+ var source = new EventSource(url);
183
+ sourceRef.current = source;
184
+ source.onopen = function () {
185
+ setConnected(true);
186
+ };
187
+ source.onmessage = function (event) {
188
+ setMessages([event.data]);
189
+ };
190
+ source.onerror = function (err) {
191
+ internalCleanup();
192
+ if (!manuallyClosedRef.current) {
193
+ reconnectTimerRef.current = setTimeout(function () {
194
+ connect();
195
+ }, retryDelay);
196
+ }
197
+ };
198
+ }, [internalCleanup, retryDelay, url]);
199
+ var disconnect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
200
+ manuallyClosedRef.current = true;
201
+ internalCleanup();
202
+ }, [internalCleanup]);
203
+ var reconnect = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
204
+ manuallyClosedRef.current = false;
205
+ internalCleanup();
206
+ connect();
207
+ }, [connect, internalCleanup]);
208
+ var resetMessages = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
209
+ return setMessages([]);
210
+ }, []);
211
+ (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
212
+ if (!url) return;
213
+ manuallyClosedRef.current = false;
214
+ connect();
215
+ return function () {
216
+ // Cleanup on unmount (does not mark manual close)
217
+ internalCleanup();
218
+ };
219
+ }, [url, connect, internalCleanup]);
220
+ return {
221
+ connected: connected,
222
+ messages: messages,
223
+ disconnect: disconnect,
224
+ reconnect: reconnect,
225
+ resetMessages: resetMessages
226
+ };
227
+ };
228
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useSSE);
229
+
230
+ })();
231
+
232
+ /******/ return __webpack_exports__;
233
+ /******/ })()
234
+ ;
235
+ });
@@ -27,6 +27,7 @@ export const MultipleSelect: any;
27
27
  export const NativeSelect: any;
28
28
  export const NumberInput: any;
29
29
  export const Pagination: any;
30
+ export const Popover: any;
30
31
  export const Radio: any;
31
32
  export const RangeSlider: any;
32
33
  export const Refresher: any;
package/lib/cjs/index.js CHANGED
@@ -29,6 +29,7 @@ exports.MultipleSelect = _interopRequireDefault(require("./MultipleSelect")).def
29
29
  exports.NativeSelect = _interopRequireDefault(require("./NativeSelect")).default;
30
30
  exports.NumberInput = _interopRequireDefault(require("./NumberInput")).default;
31
31
  exports.Pagination = _interopRequireDefault(require("./Pagination")).default;
32
+ exports.Popover = _interopRequireDefault(require("./Popover")).default;
32
33
  exports.Radio = _interopRequireDefault(require("./Radio")).default;
33
34
  exports.RangeSlider = _interopRequireDefault(require("./RangeSlider")).default;
34
35
  exports.Refresher = _interopRequireDefault(require("./Refresher")).default;
@@ -0,0 +1,198 @@
1
+ /* ======================================================
2
+ <!-- Popover -->
3
+ /* ====================================================== */
4
+ /*
5
+ * 1. Base Styles
6
+ * 2. Position Modifiers - Top
7
+ * 3. Position Modifiers - Top Left
8
+ * 4. Position Modifiers - Top Right
9
+ * 5. Position Modifiers - Bottom
10
+ * 6. Position Modifiers - Bottom Left
11
+ * 7. Position Modifiers - Bottom Right
12
+ * 8. Position Modifiers - Left
13
+ * 9. Position Modifiers - Right
14
+ * 10. Size
15
+ */
16
+ .cus-popover__wrapper {
17
+ --cus-popover-box-shadow: 0 5px 15px 0 rgba(0,0,0,.07), 0 15px 35px 0 rgba(50,50,93,.1);
18
+ --cus-popover-content-bg: rgba(17, 17, 17, 0.9);
19
+ --cus-popover-content-color: #fff;
20
+ --cus-popover-content-font-size: 0.75em;
21
+ --cus-popover-content-padding-x: 1em;
22
+ --cus-popover-content-padding-y: .5em;
23
+ --cus-popover-content-line-height: 1.5;
24
+ --cus-popover-arrow-bg-top: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
25
+ --cus-popover-arrow-bg-bottom: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
26
+ --cus-popover-arrow-bg-left: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
27
+ --cus-popover-arrow-bg-right: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
28
+ --cus-popover-arrow-width: 18px;
29
+ --cus-popover-arrow-height: 6px;
30
+ position: absolute;
31
+ z-index: 1055; /* --bs-modal-zindex */
32
+ pointer-events: none;
33
+ display: none;
34
+ margin-top: -0.2rem;
35
+ /*
36
+ ---------------------------
37
+ 1. Base Styles
38
+ ---------------------------
39
+ */
40
+ /*
41
+ ---------------------------
42
+ 2. Position Modifiers - Top
43
+ ---------------------------
44
+ */
45
+ /*
46
+ ---------------------------
47
+ 3. Position Modifiers - Top Left
48
+ ---------------------------
49
+ */
50
+ /*
51
+ ---------------------------
52
+ 4. Position Modifiers - Top Right
53
+ ---------------------------
54
+ */
55
+ /*
56
+ ---------------------------
57
+ 5. Position Modifiers - Bottom
58
+ ---------------------------
59
+ */
60
+ /*
61
+ ---------------------------
62
+ 6. Position Modifiers - Bottom Left
63
+ ---------------------------
64
+ */
65
+ /*
66
+ ---------------------------
67
+ 7. Position Modifiers - Bottom Right
68
+ ---------------------------
69
+ */
70
+ /*
71
+ ---------------------------
72
+ 10. Size
73
+ ---------------------------
74
+ */
75
+ }
76
+ .cus-popover__wrapper::before {
77
+ background-size: 100% auto !important;
78
+ content: "";
79
+ position: absolute;
80
+ }
81
+ .cus-popover__wrapper.active {
82
+ display: block !important;
83
+ }
84
+ .cus-popover__wrapper.active::before,
85
+ .cus-popover__wrapper.active > .cus-popover__content {
86
+ opacity: 1;
87
+ }
88
+ .cus-popover__wrapper:focus::before,
89
+ .cus-popover__wrapper:focus > .cus-popover__content {
90
+ opacity: 1;
91
+ }
92
+ .cus-popover__wrapper::before,
93
+ .cus-popover__wrapper > .cus-popover__content {
94
+ backface-visibility: hidden;
95
+ will-change: transform;
96
+ opacity: 0;
97
+ box-sizing: border-box;
98
+ z-index: 10;
99
+ transform-origin: top;
100
+ box-shadow: var(--cus-popover-box-shadow);
101
+ transition: none !important; /* Don't use transition if position is outside window */
102
+ }
103
+ .cus-popover__wrapper > .cus-popover__content {
104
+ pointer-events: auto;
105
+ background: var(--cus-popover-content-bg);
106
+ border-radius: 4px;
107
+ color: var(--cus-popover-content-color);
108
+ content: attr(aria-label);
109
+ font-size: var(--cus-popover-content-font-size);
110
+ font-weight: normal;
111
+ text-transform: none;
112
+ padding: var(--cus-popover-content-padding-y) var(--cus-popover-content-padding-x);
113
+ white-space: nowrap;
114
+ box-sizing: content-box;
115
+ line-height: var(--cus-popover-content-line-height);
116
+ }
117
+ .cus-popover__wrapper > .cus-popover__content img {
118
+ height: auto !important;
119
+ margin: 0.5rem 0;
120
+ }
121
+ .cus-popover__wrapper[data-microtip-position|=top]::before {
122
+ background: var(--cus-popover-arrow-bg-top);
123
+ height: var(--cus-popover-arrow-height);
124
+ width: var(--cus-popover-arrow-width);
125
+ }
126
+ .cus-popover__wrapper[data-microtip-position|=top] > .cus-popover__content {
127
+ margin-bottom: var(--cus-popover-arrow-height);
128
+ }
129
+ .cus-popover__wrapper[data-microtip-position|=top]::before {
130
+ top: calc(100% - var(--cus-popover-arrow-height));
131
+ left: calc(var(--cus-popover-arrow-width) / 2 * -1);
132
+ }
133
+ .cus-popover__wrapper[data-microtip-position|=top] > .cus-popover__content {
134
+ bottom: calc(100% + var(--cus-popover-arrow-height));
135
+ left: 50%;
136
+ transform: translateX(-50%);
137
+ }
138
+ .cus-popover__wrapper[data-microtip-position=top-left] > .cus-popover__content {
139
+ bottom: calc(100% + var(--cus-popover-arrow-height));
140
+ left: 50%;
141
+ transform: translateX(calc(-100% + var(--cus-popover-arrow-width)));
142
+ }
143
+ .cus-popover__wrapper[data-microtip-position=top-right] > .cus-popover__content {
144
+ bottom: calc(100% + var(--cus-popover-arrow-height));
145
+ left: 50%;
146
+ transform: translateX(calc(0% - var(--cus-popover-arrow-width)));
147
+ }
148
+ .cus-popover__wrapper[data-microtip-position|=bottom]::before {
149
+ background: var(--cus-popover-arrow-bg-bottom);
150
+ height: var(--cus-popover-arrow-height);
151
+ width: var(--cus-popover-arrow-width);
152
+ margin-top: 5px;
153
+ margin-bottom: 0;
154
+ }
155
+ .cus-popover__wrapper[data-microtip-position|=bottom] > .cus-popover__content {
156
+ margin-top: var(--cus-popover-arrow-height);
157
+ }
158
+ .cus-popover__wrapper[data-microtip-position|=bottom]::before {
159
+ bottom: calc(100% - var(--cus-popover-arrow-height));
160
+ left: calc(var(--cus-popover-arrow-width) / 2 * -1);
161
+ }
162
+ .cus-popover__wrapper[data-microtip-position|=bottom] > .cus-popover__content {
163
+ bottom: auto;
164
+ top: calc(100% + var(--cus-popover-arrow-height));
165
+ left: 50%;
166
+ transform: translateX(-50%);
167
+ }
168
+ .cus-popover__wrapper[data-microtip-position=bottom-left] > .cus-popover__content {
169
+ bottom: auto;
170
+ top: calc(100% + var(--cus-popover-arrow-height));
171
+ left: 50%;
172
+ transform: translateX(calc(-100% + var(--cus-popover-arrow-width)));
173
+ }
174
+ .cus-popover__wrapper[data-microtip-position=bottom-right] > .cus-popover__content {
175
+ bottom: auto;
176
+ top: calc(100% + var(--cus-popover-arrow-height));
177
+ left: 50%;
178
+ transform: translateX(calc(0% - var(--cus-popover-arrow-width)));
179
+ }
180
+ .cus-popover__wrapper[data-microtip-size=auto].cus-popover__content {
181
+ white-space: nowrap;
182
+ width: auto;
183
+ max-width: 530px;
184
+ overflow: hidden;
185
+ text-overflow: ellipsis;
186
+ }
187
+ .cus-popover__wrapper[data-microtip-size=small].cus-popover__content {
188
+ white-space: initial;
189
+ width: 80px;
190
+ }
191
+ .cus-popover__wrapper[data-microtip-size=medium].cus-popover__content {
192
+ white-space: initial;
193
+ width: 150px;
194
+ }
195
+ .cus-popover__wrapper[data-microtip-size=large].cus-popover__content {
196
+ white-space: initial;
197
+ width: 260px;
198
+ }
@@ -1,46 +1,46 @@
1
1
  /* ======================================================
2
2
  <!-- Tag Input -->
3
3
  /* ====================================================== */
4
- .tag-input__wrapper {
5
- --tag-input-control-border-radius: 0.375rem;
6
- --tag-input-control-wrapper-bg: #fff;
7
- --tag-input-control-wrapper-border-color: #dee2e6;
8
- --tag-input-control-color: #adb5bd;
9
- --tag-input-list-bg: #efefef;
10
- --tag-input-removebtn-fill: #000;
11
- --tag-input-removebtn-hover-fill: #f00;
12
- --tag-input-focus-border-color:#86b7fe;
13
- --tag-input-focus-box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
4
+ .taginput__wrapper {
5
+ --taginput-control-border-radius: 0.375rem;
6
+ --taginput-control-wrapper-bg: #fff;
7
+ --taginput-control-wrapper-border-color: #dee2e6;
8
+ --taginput-control-color: #adb5bd;
9
+ --taginput-list-bg: #efefef;
10
+ --taginput-removebtn-fill: #000;
11
+ --taginput-removebtn-hover-fill: #f00;
12
+ --taginput-focus-border-color:#86b7fe;
13
+ --taginput-focus-box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
14
14
  display: flex;
15
15
  }
16
- .tag-input__wrapper ul,
17
- .tag-input__wrapper li {
16
+ .taginput__wrapper ul,
17
+ .taginput__wrapper li {
18
18
  padding: 0;
19
19
  margin: 0;
20
20
  list-style: none;
21
21
  }
22
- .tag-input__wrapper .tag-input__control-wrapper {
22
+ .taginput__wrapper .taginput__control-wrapper {
23
23
  display: flex;
24
24
  }
25
- .tag-input__wrapper .tag-input__control-wrapper > div {
25
+ .taginput__wrapper .taginput__control-wrapper > div {
26
26
  position: relative;
27
27
  align-items: center;
28
28
  display: flex;
29
29
  flex-wrap: wrap;
30
30
  /* bootstrap style that match ".form-control" */
31
31
  padding: 0.375rem;
32
- background-color: var(--tag-input-control-wrapper-bg);
32
+ background-color: var(--taginput-control-wrapper-bg);
33
33
  background-clip: padding-box;
34
- border: 1px solid var(--tag-input-control-wrapper-border-color);
34
+ border: 1px solid var(--taginput-control-wrapper-border-color);
35
35
  appearance: none;
36
- border-radius: var(--tag-input-control-border-radius);
36
+ border-radius: var(--taginput-control-border-radius);
37
37
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
38
38
  padding-bottom: 1px;
39
39
  }
40
- .tag-input__wrapper .tag-input__control-wrapper > div .tag-input__control {
40
+ .taginput__wrapper .taginput__control-wrapper > div .taginput__control {
41
41
  margin-bottom: 0.375rem;
42
42
  }
43
- .tag-input__wrapper .tag-input__control-wrapper > div .tag-input__control input {
43
+ .taginput__wrapper .taginput__control-wrapper > div .taginput__control input {
44
44
  background: transparent;
45
45
  border: none;
46
46
  outline: none;
@@ -51,25 +51,25 @@
51
51
  font-size: 0.875rem;
52
52
  font-weight: 400;
53
53
  line-height: 1.5;
54
- color: var(--tag-input-control-color);
54
+ color: var(--taginput-control-color);
55
55
  }
56
- .tag-input__wrapper .tag-input__control-wrapper > div .tag-input__control input:focus {
56
+ .taginput__wrapper .taginput__control-wrapper > div .taginput__control input:focus {
57
57
  outline: none;
58
58
  box-shadow: none;
59
59
  }
60
- .tag-input__wrapper ul.tag-input__list li {
60
+ .taginput__wrapper ul.taginput__list li {
61
61
  display: inline-block;
62
62
  margin: 5px;
63
63
  margin-bottom: 0;
64
64
  padding: 0.1rem 1.5rem 0.1rem 1rem;
65
65
  font-size: 0.875rem;
66
- background: var(--tag-input-list-bg);
66
+ background: var(--taginput-list-bg);
67
67
  border-radius: 30px;
68
68
  overflow: hidden;
69
69
  text-overflow: ellipsis;
70
70
  position: relative;
71
71
  }
72
- .tag-input__wrapper ul.tag-input__list li > a {
72
+ .taginput__wrapper ul.taginput__list li > a {
73
73
  font-weight: 400;
74
74
  opacity: 0.6;
75
75
  font-size: 18px;
@@ -79,13 +79,13 @@
79
79
  top: 50%;
80
80
  transform: translateY(-50%);
81
81
  }
82
- .tag-input__wrapper ul.tag-input__list li > a path {
83
- fill: var(--tag-input-removebtn-fill);
82
+ .taginput__wrapper ul.taginput__list li > a path {
83
+ fill: var(--taginput-removebtn-fill);
84
84
  }
85
- .tag-input__wrapper ul.tag-input__list li > a:hover path {
86
- fill: var(--tag-input-removebtn-hover-fill);
85
+ .taginput__wrapper ul.taginput__list li > a:hover path {
86
+ fill: var(--taginput-removebtn-hover-fill);
87
87
  }
88
- .tag-input__wrapper.focus .tag-input__control-wrapper > div {
89
- box-shadow: var(--tag-input-focus-box-shadow);
90
- border-color: var(--tag-input-focus-border-color);
88
+ .taginput__wrapper.focus-floating .taginput__control-wrapper > div {
89
+ box-shadow: var(--taginput-focus-box-shadow);
90
+ border-color: var(--taginput-focus-border-color);
91
91
  }
@@ -499,7 +499,7 @@ const CascadingSelect = forwardRef((props: CascadingSelectProps, externalRef: an
499
499
 
500
500
 
501
501
  function handleFocus(event: any) {
502
- rootRef.current?.classList.add('focus');
502
+ rootRef.current?.classList.add('focus-floating');
503
503
 
504
504
  //
505
505
  handleDisplayOptions(null);
@@ -513,7 +513,7 @@ const CascadingSelect = forwardRef((props: CascadingSelectProps, externalRef: an
513
513
 
514
514
  //----
515
515
  //remove focus style
516
- rootRef.current?.classList.remove('focus');
516
+ rootRef.current?.classList.remove('focus-floating');
517
517
 
518
518
 
519
519
  //
@@ -630,7 +630,7 @@ const CascadingSelectE2E = forwardRef((props: CascadingSelectE2EProps, externalR
630
630
 
631
631
 
632
632
  function handleFocus(event: any) {
633
- rootRef.current?.classList.add('focus');
633
+ rootRef.current?.classList.add('focus-floating');
634
634
 
635
635
  //
636
636
  handleDisplayOptions(null);
@@ -644,7 +644,7 @@ const CascadingSelectE2E = forwardRef((props: CascadingSelectE2EProps, externalR
644
644
 
645
645
  //----
646
646
  //remove focus style
647
- rootRef.current?.classList.remove('focus');
647
+ rootRef.current?.classList.remove('focus-floating');
648
648
 
649
649
 
650
650
  //
@@ -93,7 +93,7 @@ const Checkbox = forwardRef((props: CheckboxProps, externalRef: any) => {
93
93
 
94
94
 
95
95
  function handleFocus(event: any) {
96
- rootRef.current?.classList.add('focus');
96
+ rootRef.current?.classList.add('focus-floating');
97
97
 
98
98
  //
99
99
  onFocus?.(event);
@@ -107,7 +107,7 @@ const Checkbox = forwardRef((props: CheckboxProps, externalRef: any) => {
107
107
 
108
108
  //----
109
109
  //remove focus style
110
- rootRef.current?.classList.remove('focus');
110
+ rootRef.current?.classList.remove('focus-floating');
111
111
 
112
112
  //
113
113
  if (typeof (onChange) === 'function') {
@@ -123,7 +123,7 @@ const Checkbox = forwardRef((props: CheckboxProps, externalRef: any) => {
123
123
 
124
124
  //----
125
125
  //remove focus style
126
- rootRef.current?.classList.remove('focus');
126
+ rootRef.current?.classList.remove('focus-floating');
127
127
 
128
128
  //
129
129
  onBlur?.(event);
@@ -79,7 +79,6 @@ const ColorPicker = forwardRef((props: ColorPickerProps, externalRef: any) => {
79
79
 
80
80
 
81
81
  function handleFocus(event: FocusEvent<HTMLInputElement>) {
82
- rootRef.current?.classList.add('focus');
83
82
 
84
83
  //
85
84
  onFocus?.(event);
@@ -91,12 +90,6 @@ const ColorPicker = forwardRef((props: ColorPickerProps, externalRef: any) => {
91
90
  setChangedVal(val);
92
91
 
93
92
 
94
- //----
95
- //remove focus style
96
- if (val === '') {
97
- rootRef.current?.classList.remove('focus');
98
- }
99
-
100
93
  //
101
94
  onChange?.(event);
102
95
 
@@ -106,13 +99,6 @@ const ColorPicker = forwardRef((props: ColorPickerProps, externalRef: any) => {
106
99
  const el = event.target;
107
100
  const val = event.target.value;
108
101
 
109
-
110
- //----
111
- //remove focus style
112
- if (val === '') {
113
- rootRef.current?.classList.remove('focus');
114
- }
115
-
116
102
  //
117
103
  onBlur?.(event);
118
104
  }
@@ -133,7 +119,10 @@ const ColorPicker = forwardRef((props: ColorPickerProps, externalRef: any) => {
133
119
  <div className={combinedCls(
134
120
  'custom-colorpicker__wrapper',
135
121
  shapeClassName,
136
- clsWrite(wrapperClassName, 'mb-3 position-relative')
122
+ clsWrite(wrapperClassName, 'mb-3 position-relative'),
123
+ {
124
+ 'focus-floating': changedVal !== ''
125
+ }
137
126
  )} ref={rootRef}>
138
127
  {label ? <>{typeof label === 'string' ? <label htmlFor={idRes} className="form-label" dangerouslySetInnerHTML={{ __html: `${label}` }}></label> : <label htmlFor={idRes} className="form-label">{label}</label>}</> : null}
139
128