funda-ui 4.7.625 → 4.7.701
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 +2 -2
- package/CascadingSelectE2E/index.js +2 -2
- package/Chatbox/index.js +3 -17
- package/Checkbox/index.js +3 -3
- package/ColorPicker/index.js +3 -18
- package/Date/index.js +3 -18
- package/EventCalendarTimeline/index.d.ts +1 -1
- package/EventCalendarTimeline/index.js +11 -1
- package/File/index.d.ts +9 -0
- package/File/index.js +245 -93
- package/Input/index.js +3 -18
- package/LiveSearch/index.js +3 -18
- package/NativeSelect/index.js +3 -3
- package/NumberInput/index.js +3 -18
- package/Popover/index.css +198 -0
- package/Popover/index.d.ts +4 -0
- package/Popover/index.js +1808 -0
- package/README.md +1 -0
- package/Radio/index.js +3 -3
- package/RangeSlider/index.js +3 -18
- package/SearchBar/index.js +3 -18
- package/Select/index.js +3 -2
- package/Switch/index.js +3 -3
- package/TagInput/index.css +31 -31
- package/TagInput/index.js +12 -23
- package/Textarea/index.js +3 -17
- package/Utils/useSSE.d.ts +9 -0
- package/Utils/useSSE.js +211 -0
- package/all.d.ts +1 -0
- package/all.js +1 -0
- package/lib/cjs/CascadingSelect/index.js +2 -2
- package/lib/cjs/CascadingSelectE2E/index.js +2 -2
- package/lib/cjs/Chatbox/index.js +3 -17
- package/lib/cjs/Checkbox/index.js +3 -3
- package/lib/cjs/ColorPicker/index.js +3 -18
- package/lib/cjs/Date/index.js +3 -18
- package/lib/cjs/EventCalendarTimeline/index.d.ts +1 -1
- package/lib/cjs/EventCalendarTimeline/index.js +11 -1
- package/lib/cjs/File/index.d.ts +9 -0
- package/lib/cjs/File/index.js +245 -93
- package/lib/cjs/Input/index.js +3 -18
- package/lib/cjs/LiveSearch/index.js +3 -18
- package/lib/cjs/NativeSelect/index.js +3 -3
- package/lib/cjs/NumberInput/index.js +3 -18
- package/lib/cjs/Popover/index.d.ts +4 -0
- package/lib/cjs/Popover/index.js +1808 -0
- package/lib/cjs/Radio/index.js +3 -3
- package/lib/cjs/RangeSlider/index.js +3 -18
- package/lib/cjs/SearchBar/index.js +3 -18
- package/lib/cjs/Select/index.js +3 -2
- package/lib/cjs/Switch/index.js +3 -3
- package/lib/cjs/TagInput/index.js +12 -23
- package/lib/cjs/Textarea/index.js +3 -17
- package/lib/cjs/Utils/useSSE.d.ts +9 -0
- package/lib/cjs/Utils/useSSE.js +211 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/css/Popover/index.css +198 -0
- package/lib/css/TagInput/index.css +31 -31
- package/lib/esm/CascadingSelect/index.tsx +2 -2
- package/lib/esm/CascadingSelectE2E/index.tsx +2 -2
- package/lib/esm/Checkbox/index.tsx +3 -3
- package/lib/esm/ColorPicker/index.tsx +4 -15
- package/lib/esm/EventCalendarTimeline/index.tsx +11 -2
- package/lib/esm/File/index.tsx +148 -23
- package/lib/esm/Input/index.tsx +6 -17
- package/lib/esm/NativeSelect/index.tsx +3 -3
- package/lib/esm/NumberInput/index.tsx +7 -15
- package/lib/esm/Popover/Popover.tsx +251 -0
- package/lib/esm/Popover/PopoverClose.tsx +51 -0
- package/lib/esm/Popover/PopoverContent.tsx +72 -0
- package/lib/esm/Popover/PopoverTrigger.tsx +62 -0
- package/lib/esm/Popover/index.scss +272 -0
- package/lib/esm/Popover/index.tsx +4 -0
- package/lib/esm/Radio/index.tsx +3 -3
- package/lib/esm/SearchBar/index.tsx +8 -12
- package/lib/esm/Select/index.tsx +2 -2
- package/lib/esm/Switch/index.tsx +3 -3
- package/lib/esm/TagInput/index.scss +24 -24
- package/lib/esm/TagInput/index.tsx +13 -20
- package/lib/esm/Textarea/index.tsx +6 -14
- package/lib/esm/Utils/hooks/useSSE.tsx +109 -0
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1808 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("react"), require("react-dom"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["react", "react-dom"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["RPB"] = factory(require("react"), require("react-dom"));
|
|
8
|
+
else
|
|
9
|
+
root["RPB"] = factory(root["React"], root["ReactDOM"]);
|
|
10
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 909:
|
|
15
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
16
|
+
|
|
17
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
18
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
20
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787), __webpack_require__(156));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787), __webpack_require__(156)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
21
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
22
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
23
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
24
|
+
})(this, function (__WEBPACK_EXTERNAL_MODULE__787__, __WEBPACK_EXTERNAL_MODULE__156__) {
|
|
25
|
+
return (/******/function () {
|
|
26
|
+
// webpackBootstrap
|
|
27
|
+
/******/
|
|
28
|
+
"use strict";
|
|
29
|
+
|
|
30
|
+
/******/
|
|
31
|
+
var __webpack_modules__ = {
|
|
32
|
+
/***/787: /***/function _(module) {
|
|
33
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
34
|
+
|
|
35
|
+
/***/
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/***/156: /***/function _(module) {
|
|
39
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__156__;
|
|
40
|
+
|
|
41
|
+
/***/
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/******/
|
|
45
|
+
};
|
|
46
|
+
/************************************************************************/
|
|
47
|
+
/******/ // The module cache
|
|
48
|
+
/******/
|
|
49
|
+
var __webpack_module_cache__ = {};
|
|
50
|
+
/******/
|
|
51
|
+
/******/ // The require function
|
|
52
|
+
/******/
|
|
53
|
+
function __nested_webpack_require_1708__(moduleId) {
|
|
54
|
+
/******/ // Check if module is in cache
|
|
55
|
+
/******/var cachedModule = __webpack_module_cache__[moduleId];
|
|
56
|
+
/******/
|
|
57
|
+
if (cachedModule !== undefined) {
|
|
58
|
+
/******/return cachedModule.exports;
|
|
59
|
+
/******/
|
|
60
|
+
}
|
|
61
|
+
/******/ // Create a new module (and put it into the cache)
|
|
62
|
+
/******/
|
|
63
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
64
|
+
/******/ // no module.id needed
|
|
65
|
+
/******/ // no module.loaded needed
|
|
66
|
+
/******/exports: {}
|
|
67
|
+
/******/
|
|
68
|
+
};
|
|
69
|
+
/******/
|
|
70
|
+
/******/ // Execute the module function
|
|
71
|
+
/******/
|
|
72
|
+
__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1708__);
|
|
73
|
+
/******/
|
|
74
|
+
/******/ // Return the exports of the module
|
|
75
|
+
/******/
|
|
76
|
+
return module.exports;
|
|
77
|
+
/******/
|
|
78
|
+
}
|
|
79
|
+
/******/
|
|
80
|
+
/************************************************************************/
|
|
81
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
82
|
+
/******/
|
|
83
|
+
(function () {
|
|
84
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
85
|
+
/******/__nested_webpack_require_1708__.n = function (module) {
|
|
86
|
+
/******/var getter = module && module.__esModule ? /******/function () {
|
|
87
|
+
return module['default'];
|
|
88
|
+
} : /******/function () {
|
|
89
|
+
return module;
|
|
90
|
+
};
|
|
91
|
+
/******/
|
|
92
|
+
__nested_webpack_require_1708__.d(getter, {
|
|
93
|
+
a: getter
|
|
94
|
+
});
|
|
95
|
+
/******/
|
|
96
|
+
return getter;
|
|
97
|
+
/******/
|
|
98
|
+
};
|
|
99
|
+
/******/
|
|
100
|
+
})();
|
|
101
|
+
/******/
|
|
102
|
+
/******/ /* webpack/runtime/define property getters */
|
|
103
|
+
/******/
|
|
104
|
+
(function () {
|
|
105
|
+
/******/ // define getter functions for harmony exports
|
|
106
|
+
/******/__nested_webpack_require_1708__.d = function (exports, definition) {
|
|
107
|
+
/******/for (var key in definition) {
|
|
108
|
+
/******/if (__nested_webpack_require_1708__.o(definition, key) && !__nested_webpack_require_1708__.o(exports, key)) {
|
|
109
|
+
/******/Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: definition[key]
|
|
112
|
+
});
|
|
113
|
+
/******/
|
|
114
|
+
}
|
|
115
|
+
/******/
|
|
116
|
+
}
|
|
117
|
+
/******/
|
|
118
|
+
};
|
|
119
|
+
/******/
|
|
120
|
+
})();
|
|
121
|
+
/******/
|
|
122
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
123
|
+
/******/
|
|
124
|
+
(function () {
|
|
125
|
+
/******/__nested_webpack_require_1708__.o = function (obj, prop) {
|
|
126
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
127
|
+
};
|
|
128
|
+
/******/
|
|
129
|
+
})();
|
|
130
|
+
/******/
|
|
131
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
132
|
+
/******/
|
|
133
|
+
(function () {
|
|
134
|
+
/******/ // define __esModule on exports
|
|
135
|
+
/******/__nested_webpack_require_1708__.r = function (exports) {
|
|
136
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
137
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
138
|
+
value: 'Module'
|
|
139
|
+
});
|
|
140
|
+
/******/
|
|
141
|
+
}
|
|
142
|
+
/******/
|
|
143
|
+
Object.defineProperty(exports, '__esModule', {
|
|
144
|
+
value: true
|
|
145
|
+
});
|
|
146
|
+
/******/
|
|
147
|
+
};
|
|
148
|
+
/******/
|
|
149
|
+
})();
|
|
150
|
+
/******/
|
|
151
|
+
/************************************************************************/
|
|
152
|
+
var __webpack_exports__ = {};
|
|
153
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
154
|
+
(function () {
|
|
155
|
+
__nested_webpack_require_1708__.r(__webpack_exports__);
|
|
156
|
+
/* harmony export */
|
|
157
|
+
__nested_webpack_require_1708__.d(__webpack_exports__, {
|
|
158
|
+
/* harmony export */"default": function _default() {
|
|
159
|
+
return __WEBPACK_DEFAULT_EXPORT__;
|
|
160
|
+
}
|
|
161
|
+
/* harmony export */
|
|
162
|
+
});
|
|
163
|
+
/* harmony import */
|
|
164
|
+
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1708__(787);
|
|
165
|
+
/* harmony import */
|
|
166
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
167
|
+
/* harmony import */
|
|
168
|
+
var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __nested_webpack_require_1708__(156);
|
|
169
|
+
/* harmony import */
|
|
170
|
+
var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__nested_webpack_require_1708__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
|
|
171
|
+
var RootPortal = function RootPortal(props) {
|
|
172
|
+
var containerClassName = props.containerClassName,
|
|
173
|
+
show = props.show,
|
|
174
|
+
children = props.children,
|
|
175
|
+
_props$usePortal = props.usePortal,
|
|
176
|
+
usePortal = _props$usePortal === void 0 ? true : _props$usePortal;
|
|
177
|
+
var containerRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
178
|
+
|
|
179
|
+
// Move HTML templates to tag end body </body>
|
|
180
|
+
// render() don't use "Fragment", in order to avoid error "Failed to execute 'insertBefore' on 'Node'"
|
|
181
|
+
// prevent "transform", "filter", "perspective" attribute destruction fixed viewport orientation
|
|
182
|
+
// ###
|
|
183
|
+
// ###
|
|
184
|
+
// Use `containerRef.current` to ensure the correctness of the nextjs framework. It may report an error document as undefined
|
|
185
|
+
|
|
186
|
+
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
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
|
+
}
|
|
192
|
+
return function () {
|
|
193
|
+
if (usePortal && containerRef.current) {
|
|
194
|
+
containerRef.current.remove();
|
|
195
|
+
}
|
|
196
|
+
};
|
|
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
|
+
}
|
|
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));
|
|
202
|
+
};
|
|
203
|
+
/* harmony default export */
|
|
204
|
+
var __WEBPACK_DEFAULT_EXPORT__ = RootPortal;
|
|
205
|
+
})();
|
|
206
|
+
|
|
207
|
+
/******/
|
|
208
|
+
return __webpack_exports__;
|
|
209
|
+
/******/
|
|
210
|
+
}()
|
|
211
|
+
);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
/***/ }),
|
|
215
|
+
|
|
216
|
+
/***/ 188:
|
|
217
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
218
|
+
|
|
219
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
220
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
|
|
221
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
222
|
+
if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
223
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
224
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
225
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
226
|
+
})(this, function () {
|
|
227
|
+
return (/******/function () {
|
|
228
|
+
// webpackBootstrap
|
|
229
|
+
/******/
|
|
230
|
+
"use strict";
|
|
231
|
+
|
|
232
|
+
/******/ // The require scope
|
|
233
|
+
/******/
|
|
234
|
+
var __nested_webpack_require_993__ = {};
|
|
235
|
+
/******/
|
|
236
|
+
/************************************************************************/
|
|
237
|
+
/******/ /* webpack/runtime/define property getters */
|
|
238
|
+
/******/
|
|
239
|
+
(function () {
|
|
240
|
+
/******/ // define getter functions for harmony exports
|
|
241
|
+
/******/__nested_webpack_require_993__.d = function (exports, definition) {
|
|
242
|
+
/******/for (var key in definition) {
|
|
243
|
+
/******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
|
|
244
|
+
/******/Object.defineProperty(exports, key, {
|
|
245
|
+
enumerable: true,
|
|
246
|
+
get: definition[key]
|
|
247
|
+
});
|
|
248
|
+
/******/
|
|
249
|
+
}
|
|
250
|
+
/******/
|
|
251
|
+
}
|
|
252
|
+
/******/
|
|
253
|
+
};
|
|
254
|
+
/******/
|
|
255
|
+
})();
|
|
256
|
+
/******/
|
|
257
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
258
|
+
/******/
|
|
259
|
+
(function () {
|
|
260
|
+
/******/__nested_webpack_require_993__.o = function (obj, prop) {
|
|
261
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
262
|
+
};
|
|
263
|
+
/******/
|
|
264
|
+
})();
|
|
265
|
+
/******/
|
|
266
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
267
|
+
/******/
|
|
268
|
+
(function () {
|
|
269
|
+
/******/ // define __esModule on exports
|
|
270
|
+
/******/__nested_webpack_require_993__.r = function (exports) {
|
|
271
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
272
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
273
|
+
value: 'Module'
|
|
274
|
+
});
|
|
275
|
+
/******/
|
|
276
|
+
}
|
|
277
|
+
/******/
|
|
278
|
+
Object.defineProperty(exports, '__esModule', {
|
|
279
|
+
value: true
|
|
280
|
+
});
|
|
281
|
+
/******/
|
|
282
|
+
};
|
|
283
|
+
/******/
|
|
284
|
+
})();
|
|
285
|
+
/******/
|
|
286
|
+
/************************************************************************/
|
|
287
|
+
var __webpack_exports__ = {};
|
|
288
|
+
__nested_webpack_require_993__.r(__webpack_exports__);
|
|
289
|
+
/* harmony export */
|
|
290
|
+
__nested_webpack_require_993__.d(__webpack_exports__, {
|
|
291
|
+
/* harmony export */"clsWrite": function clsWrite() {
|
|
292
|
+
return (/* binding */_clsWrite
|
|
293
|
+
);
|
|
294
|
+
},
|
|
295
|
+
/* harmony export */"combinedCls": function combinedCls() {
|
|
296
|
+
return (/* binding */_combinedCls
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
/* harmony export */
|
|
300
|
+
});
|
|
301
|
+
function _slicedToArray(arr, i) {
|
|
302
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
303
|
+
}
|
|
304
|
+
function _nonIterableRest() {
|
|
305
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
306
|
+
}
|
|
307
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
308
|
+
if (!o) return;
|
|
309
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
310
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
311
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
312
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
313
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
314
|
+
}
|
|
315
|
+
function _arrayLikeToArray(arr, len) {
|
|
316
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
317
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
318
|
+
return arr2;
|
|
319
|
+
}
|
|
320
|
+
function _iterableToArrayLimit(arr, i) {
|
|
321
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
322
|
+
if (null != _i) {
|
|
323
|
+
var _s,
|
|
324
|
+
_e,
|
|
325
|
+
_x,
|
|
326
|
+
_r,
|
|
327
|
+
_arr = [],
|
|
328
|
+
_n = !0,
|
|
329
|
+
_d = !1;
|
|
330
|
+
try {
|
|
331
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
332
|
+
if (Object(_i) !== _i) return;
|
|
333
|
+
_n = !1;
|
|
334
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
335
|
+
} catch (err) {
|
|
336
|
+
_d = !0, _e = err;
|
|
337
|
+
} finally {
|
|
338
|
+
try {
|
|
339
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
340
|
+
} finally {
|
|
341
|
+
if (_d) throw _e;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return _arr;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function _arrayWithHoles(arr) {
|
|
348
|
+
if (Array.isArray(arr)) return arr;
|
|
349
|
+
}
|
|
350
|
+
function _typeof(obj) {
|
|
351
|
+
"@babel/helpers - typeof";
|
|
352
|
+
|
|
353
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
354
|
+
return typeof obj;
|
|
355
|
+
} : function (obj) {
|
|
356
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
357
|
+
}, _typeof(obj);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Output of class name
|
|
361
|
+
* @param {*} s - Any
|
|
362
|
+
* @param {String} defaultCls - Default string
|
|
363
|
+
* @param {?*} targetCls - Any
|
|
364
|
+
* @returns {*}
|
|
365
|
+
*/
|
|
366
|
+
function _clsWrite(s, defaultCls) {
|
|
367
|
+
var targetCls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
368
|
+
return s || s === '' ? typeof targetCls === 'undefined' ? s : targetCls : defaultCls;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Combined classnames
|
|
373
|
+
* @param {*} args
|
|
374
|
+
* @returns {String|undefined}
|
|
375
|
+
*/
|
|
376
|
+
/* Usage:
|
|
377
|
+
|
|
378
|
+
console.log(combinedCls('a-1', 'a-2', 'a-3', {
|
|
379
|
+
'p-1': null,
|
|
380
|
+
'p-2': undefined,
|
|
381
|
+
'p-3': true,
|
|
382
|
+
'p-4': false,
|
|
383
|
+
'p-5': 'kkk',
|
|
384
|
+
'p-6': 0,
|
|
385
|
+
'p-7': 1,
|
|
386
|
+
'p-8': '',
|
|
387
|
+
undefined
|
|
388
|
+
})); // a-1 a-2 a-3 p-3 p-5 p-7
|
|
389
|
+
*/
|
|
390
|
+
function _combinedCls() {
|
|
391
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
392
|
+
args[_key] = arguments[_key];
|
|
393
|
+
}
|
|
394
|
+
if (args) {
|
|
395
|
+
var classes = [];
|
|
396
|
+
for (var i = 0; i < args.length; i++) {
|
|
397
|
+
var className = args[i];
|
|
398
|
+
if (!className) {
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
var type = _typeof(className);
|
|
402
|
+
if (type === 'string' || type === 'number') {
|
|
403
|
+
classes.push(className);
|
|
404
|
+
} else if (type === 'object') {
|
|
405
|
+
var _classes = Array.isArray(className) ? className : Object.entries(className).map(function (_ref) {
|
|
406
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
407
|
+
key = _ref2[0],
|
|
408
|
+
value = _ref2[1];
|
|
409
|
+
return value ? key : null;
|
|
410
|
+
});
|
|
411
|
+
classes = _classes.length ? classes.concat(_classes.filter(function (c) {
|
|
412
|
+
return !!c;
|
|
413
|
+
})) : classes;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return classes.join(' ').trim();
|
|
417
|
+
}
|
|
418
|
+
return undefined;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/******/
|
|
422
|
+
return __webpack_exports__;
|
|
423
|
+
/******/
|
|
424
|
+
}()
|
|
425
|
+
);
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
/***/ }),
|
|
429
|
+
|
|
430
|
+
/***/ 767:
|
|
431
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
432
|
+
|
|
433
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
434
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof2(obj) { "@babel/helpers - typeof"; return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof2(obj); }
|
|
435
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
436
|
+
if (( false ? 0 : _typeof2(exports)) === 'object' && ( false ? 0 : _typeof2(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
437
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
438
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
439
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
440
|
+
})(this, function () {
|
|
441
|
+
return (/******/function () {
|
|
442
|
+
// webpackBootstrap
|
|
443
|
+
/******/
|
|
444
|
+
"use strict";
|
|
445
|
+
|
|
446
|
+
/******/ // The require scope
|
|
447
|
+
/******/
|
|
448
|
+
var __nested_webpack_require_993__ = {};
|
|
449
|
+
/******/
|
|
450
|
+
/************************************************************************/
|
|
451
|
+
/******/ /* webpack/runtime/define property getters */
|
|
452
|
+
/******/
|
|
453
|
+
(function () {
|
|
454
|
+
/******/ // define getter functions for harmony exports
|
|
455
|
+
/******/__nested_webpack_require_993__.d = function (exports, definition) {
|
|
456
|
+
/******/for (var key in definition) {
|
|
457
|
+
/******/if (__nested_webpack_require_993__.o(definition, key) && !__nested_webpack_require_993__.o(exports, key)) {
|
|
458
|
+
/******/Object.defineProperty(exports, key, {
|
|
459
|
+
enumerable: true,
|
|
460
|
+
get: definition[key]
|
|
461
|
+
});
|
|
462
|
+
/******/
|
|
463
|
+
}
|
|
464
|
+
/******/
|
|
465
|
+
}
|
|
466
|
+
/******/
|
|
467
|
+
};
|
|
468
|
+
/******/
|
|
469
|
+
})();
|
|
470
|
+
/******/
|
|
471
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
472
|
+
/******/
|
|
473
|
+
(function () {
|
|
474
|
+
/******/__nested_webpack_require_993__.o = function (obj, prop) {
|
|
475
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
476
|
+
};
|
|
477
|
+
/******/
|
|
478
|
+
})();
|
|
479
|
+
/******/
|
|
480
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
481
|
+
/******/
|
|
482
|
+
(function () {
|
|
483
|
+
/******/ // define __esModule on exports
|
|
484
|
+
/******/__nested_webpack_require_993__.r = function (exports) {
|
|
485
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
486
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
487
|
+
value: 'Module'
|
|
488
|
+
});
|
|
489
|
+
/******/
|
|
490
|
+
}
|
|
491
|
+
/******/
|
|
492
|
+
Object.defineProperty(exports, '__esModule', {
|
|
493
|
+
value: true
|
|
494
|
+
});
|
|
495
|
+
/******/
|
|
496
|
+
};
|
|
497
|
+
/******/
|
|
498
|
+
})();
|
|
499
|
+
/******/
|
|
500
|
+
/************************************************************************/
|
|
501
|
+
var __webpack_exports__ = {};
|
|
502
|
+
__nested_webpack_require_993__.r(__webpack_exports__);
|
|
503
|
+
/* harmony export */
|
|
504
|
+
__nested_webpack_require_993__.d(__webpack_exports__, {
|
|
505
|
+
/* harmony export */"getAbsoluteCoordinates": function getAbsoluteCoordinates() {
|
|
506
|
+
return (/* binding */_getAbsoluteCoordinates
|
|
507
|
+
);
|
|
508
|
+
},
|
|
509
|
+
/* harmony export */"getAbsolutePositionOfStage": function getAbsolutePositionOfStage() {
|
|
510
|
+
return (/* binding */_getAbsolutePositionOfStage
|
|
511
|
+
);
|
|
512
|
+
},
|
|
513
|
+
/* harmony export */"getOffset": function getOffset() {
|
|
514
|
+
return (/* binding */_getOffset
|
|
515
|
+
);
|
|
516
|
+
},
|
|
517
|
+
/* harmony export */"getPosition": function getPosition() {
|
|
518
|
+
return (/* binding */_getPosition
|
|
519
|
+
);
|
|
520
|
+
},
|
|
521
|
+
/* harmony export */"getTransitionDuration": function getTransitionDuration() {
|
|
522
|
+
return (/* binding */_getTransitionDuration
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
/* harmony export */
|
|
526
|
+
});
|
|
527
|
+
function _typeof(obj) {
|
|
528
|
+
"@babel/helpers - typeof";
|
|
529
|
+
|
|
530
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
531
|
+
return typeof obj;
|
|
532
|
+
} : function (obj) {
|
|
533
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
534
|
+
}, _typeof(obj);
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Get the -webkit-transition-duration property
|
|
538
|
+
*
|
|
539
|
+
* @param {HTMLElement} el - A DOM node containing one selector to match against.
|
|
540
|
+
* @return {number} - Returns a pure number.
|
|
541
|
+
*/
|
|
542
|
+
function _getTransitionDuration(el) {
|
|
543
|
+
if (_typeof(el) === ( true ? "undefined" : 0)) {
|
|
544
|
+
return 0;
|
|
545
|
+
}
|
|
546
|
+
var style = window.getComputedStyle(el),
|
|
547
|
+
duration = style.webkitTransitionDuration,
|
|
548
|
+
delay = style.webkitTransitionDelay;
|
|
549
|
+
if (_typeof(duration) != ( true ? "undefined" : 0)) {
|
|
550
|
+
// fix miliseconds vs seconds
|
|
551
|
+
duration = duration.indexOf("ms") > -1 ? parseFloat(duration) : parseFloat(duration) * 1000;
|
|
552
|
+
delay = delay.indexOf("ms") > -1 ? parseFloat(delay) : parseFloat(delay) * 1000;
|
|
553
|
+
return duration;
|
|
554
|
+
} else {
|
|
555
|
+
return 0;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Get an object's absolute position on the page
|
|
561
|
+
*
|
|
562
|
+
* @param {HTMLElement} el - A DOM node containing one selector to match against.
|
|
563
|
+
* @return {Json} - An object containing the properties top and left.
|
|
564
|
+
*/
|
|
565
|
+
function _getAbsoluteCoordinates(el) {
|
|
566
|
+
var windowWidth = window.innerWidth,
|
|
567
|
+
leftPos = null,
|
|
568
|
+
topPos = null;
|
|
569
|
+
var pEl = el.parentElement;
|
|
570
|
+
if (!document.getElementsByTagName('body')[0].className.match(/rtl/)) {
|
|
571
|
+
leftPos = el.offsetLeft == 0 ? pEl.offsetLeft : el.offsetLeft;
|
|
572
|
+
topPos = el.offsetTop == 0 ? pEl.offsetTop : el.offsetTop;
|
|
573
|
+
} else {
|
|
574
|
+
// width and height in pixels, including padding and border
|
|
575
|
+
// Corresponds to outerWidth(), outerHeight()
|
|
576
|
+
leftPos = el.offsetLeft == 0 ? windowWidth - (pEl.offsetLeft + pEl.offsetWidth) : windowWidth - (el.offsetLeft + el.offsetWidth);
|
|
577
|
+
topPos = el.offsetTop == 0 ? windowWidth - (pEl.offsetTop + pEl.offsetHeight) : windowWidth - (el.offsetTop + el.offsetHeight);
|
|
578
|
+
}
|
|
579
|
+
return {
|
|
580
|
+
'left': leftPos,
|
|
581
|
+
'top': topPos
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Get the current coordinates of the first element in the set of matched elements, relative to the document.
|
|
587
|
+
*
|
|
588
|
+
* @param {Element} el - A DOM node containing one selector to match against.
|
|
589
|
+
* @return {Json} - An object containing the properties top and left.
|
|
590
|
+
*/
|
|
591
|
+
function _getOffset(el) {
|
|
592
|
+
var res = {
|
|
593
|
+
top: 0,
|
|
594
|
+
left: 0
|
|
595
|
+
};
|
|
596
|
+
var box = el.getBoundingClientRect();
|
|
597
|
+
var top = 0,
|
|
598
|
+
left = 0;
|
|
599
|
+
|
|
600
|
+
//Include scrollbar and border
|
|
601
|
+
top = box.top + window.pageYOffset - document.documentElement.clientTop;
|
|
602
|
+
left = box.left + window.pageXOffset - document.documentElement.clientLeft;
|
|
603
|
+
res = {
|
|
604
|
+
top: top,
|
|
605
|
+
left: left
|
|
606
|
+
};
|
|
607
|
+
return res;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
|
|
612
|
+
*
|
|
613
|
+
* @param {HTMLElement} el - A DOM node containing one selector to match against.
|
|
614
|
+
* @return {Json} - An object containing the properties top and left.
|
|
615
|
+
*/
|
|
616
|
+
function _getPosition(el) {
|
|
617
|
+
var res = {
|
|
618
|
+
top: 0,
|
|
619
|
+
left: 0
|
|
620
|
+
};
|
|
621
|
+
var top = el.offsetTop ? el.offsetTop : 0,
|
|
622
|
+
left = el.offsetLeft ? el.offsetLeft : 0;
|
|
623
|
+
res = {
|
|
624
|
+
top: top,
|
|
625
|
+
left: left
|
|
626
|
+
};
|
|
627
|
+
return res;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Get the absolute position of the stage element
|
|
632
|
+
*
|
|
633
|
+
* @param {HTMLElement} domElement - A DOM node
|
|
634
|
+
* @param {Number | string} left - left offset
|
|
635
|
+
* @param {Number | string} top - top offset
|
|
636
|
+
* @returns
|
|
637
|
+
*/
|
|
638
|
+
function _getAbsolutePositionOfStage(domElement) {
|
|
639
|
+
var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
640
|
+
var top = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
641
|
+
if (!parseInt(left)) {
|
|
642
|
+
left = 0;
|
|
643
|
+
} else {
|
|
644
|
+
left = parseInt(left);
|
|
645
|
+
}
|
|
646
|
+
if (!parseInt(top)) {
|
|
647
|
+
top = 0;
|
|
648
|
+
} else {
|
|
649
|
+
top = parseInt(top);
|
|
650
|
+
}
|
|
651
|
+
var box = domElement.getBoundingClientRect();
|
|
652
|
+
var body = document.body;
|
|
653
|
+
var docElem = document.documentElement;
|
|
654
|
+
var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;
|
|
655
|
+
var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;
|
|
656
|
+
var clientTop = docElem.clientTop || body.clientTop || 0;
|
|
657
|
+
var clientLeft = docElem.clientLeft || body.clientLeft || 0;
|
|
658
|
+
var attr = {};
|
|
659
|
+
attr.y = box.top + scrollTop - clientTop + top;
|
|
660
|
+
attr.x = box.left + scrollLeft - clientLeft + left;
|
|
661
|
+
attr.width = box.width;
|
|
662
|
+
attr.height = box.height;
|
|
663
|
+
return attr;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/******/
|
|
667
|
+
return __webpack_exports__;
|
|
668
|
+
/******/
|
|
669
|
+
}()
|
|
670
|
+
);
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
/***/ }),
|
|
674
|
+
|
|
675
|
+
/***/ 954:
|
|
676
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
677
|
+
|
|
678
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
679
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
680
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
681
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory();else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
682
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
683
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
684
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
685
|
+
})(this, function () {
|
|
686
|
+
return (/******/function () {
|
|
687
|
+
// webpackBootstrap
|
|
688
|
+
/******/
|
|
689
|
+
"use strict";
|
|
690
|
+
|
|
691
|
+
/******/ // The require scope
|
|
692
|
+
/******/
|
|
693
|
+
var __nested_webpack_require_987__ = {};
|
|
694
|
+
/******/
|
|
695
|
+
/************************************************************************/
|
|
696
|
+
/******/ /* webpack/runtime/define property getters */
|
|
697
|
+
/******/
|
|
698
|
+
(function () {
|
|
699
|
+
/******/ // define getter functions for harmony exports
|
|
700
|
+
/******/__nested_webpack_require_987__.d = function (exports, definition) {
|
|
701
|
+
/******/for (var key in definition) {
|
|
702
|
+
/******/if (__nested_webpack_require_987__.o(definition, key) && !__nested_webpack_require_987__.o(exports, key)) {
|
|
703
|
+
/******/Object.defineProperty(exports, key, {
|
|
704
|
+
enumerable: true,
|
|
705
|
+
get: definition[key]
|
|
706
|
+
});
|
|
707
|
+
/******/
|
|
708
|
+
}
|
|
709
|
+
/******/
|
|
710
|
+
}
|
|
711
|
+
/******/
|
|
712
|
+
};
|
|
713
|
+
/******/
|
|
714
|
+
})();
|
|
715
|
+
/******/
|
|
716
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
717
|
+
/******/
|
|
718
|
+
(function () {
|
|
719
|
+
/******/__nested_webpack_require_987__.o = function (obj, prop) {
|
|
720
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
721
|
+
};
|
|
722
|
+
/******/
|
|
723
|
+
})();
|
|
724
|
+
/******/
|
|
725
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
726
|
+
/******/
|
|
727
|
+
(function () {
|
|
728
|
+
/******/ // define __esModule on exports
|
|
729
|
+
/******/__nested_webpack_require_987__.r = function (exports) {
|
|
730
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
731
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
732
|
+
value: 'Module'
|
|
733
|
+
});
|
|
734
|
+
/******/
|
|
735
|
+
}
|
|
736
|
+
/******/
|
|
737
|
+
Object.defineProperty(exports, '__esModule', {
|
|
738
|
+
value: true
|
|
739
|
+
});
|
|
740
|
+
/******/
|
|
741
|
+
};
|
|
742
|
+
/******/
|
|
743
|
+
})();
|
|
744
|
+
/******/
|
|
745
|
+
/************************************************************************/
|
|
746
|
+
var __webpack_exports__ = {};
|
|
747
|
+
__nested_webpack_require_987__.r(__webpack_exports__);
|
|
748
|
+
/* harmony export */
|
|
749
|
+
__nested_webpack_require_987__.d(__webpack_exports__, {
|
|
750
|
+
/* harmony export */"actualPropertyValue": function actualPropertyValue() {
|
|
751
|
+
return (/* binding */_actualPropertyValue
|
|
752
|
+
);
|
|
753
|
+
},
|
|
754
|
+
/* harmony export */"getElCSS": function getElCSS() {
|
|
755
|
+
return (/* binding */_getElCSS
|
|
756
|
+
);
|
|
757
|
+
},
|
|
758
|
+
/* harmony export */"getTextTop": function getTextTop() {
|
|
759
|
+
return (/* binding */_getTextTop
|
|
760
|
+
);
|
|
761
|
+
},
|
|
762
|
+
/* harmony export */"getTextWidth": function getTextWidth() {
|
|
763
|
+
return (/* binding */_getTextWidth
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
/* harmony export */
|
|
767
|
+
});
|
|
768
|
+
/**
|
|
769
|
+
* Gets the relative upside of the text
|
|
770
|
+
* @param {Element} el - A DOM node containing one selector to match against.
|
|
771
|
+
* @returns {Number} - Returns a pure number.
|
|
772
|
+
*/
|
|
773
|
+
function _getTextTop(el) {
|
|
774
|
+
var styles = window.getComputedStyle(el);
|
|
775
|
+
var fontSize = parseFloat(styles.fontSize);
|
|
776
|
+
var lineHeight = parseFloat(styles.lineHeight) || fontSize;
|
|
777
|
+
var paddingTop = parseFloat(styles.paddingTop);
|
|
778
|
+
var borderWidth = parseFloat(styles.borderWidth);
|
|
779
|
+
var textTop = paddingTop + (lineHeight - fontSize) / 2 - borderWidth * 2;
|
|
780
|
+
return textTop;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Get the actual value with user specific methed
|
|
785
|
+
* it can be 'width', 'height', 'outerWidth', 'outerHeight'
|
|
786
|
+
* @private
|
|
787
|
+
* @param {Element} el - A DOM node containing one selector to match against.
|
|
788
|
+
* @param {String} prop - A string naming the property of style.
|
|
789
|
+
* @param {?Json} config - Whether or not margin is included. The key `includeMargin`
|
|
790
|
+
takes effect when set to true
|
|
791
|
+
* @return {Number} - Returns a pure number.
|
|
792
|
+
*/
|
|
793
|
+
function _actualPropertyValue(el, prop) {
|
|
794
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
795
|
+
if (el === null) return 0;
|
|
796
|
+
var style = window.getComputedStyle ? window.getComputedStyle(el) : el.currentStyle,
|
|
797
|
+
display = style.display,
|
|
798
|
+
position = style.position,
|
|
799
|
+
visibility = style.visibility;
|
|
800
|
+
var marginWidth = 0;
|
|
801
|
+
var marginHeight = 0;
|
|
802
|
+
var maxVal;
|
|
803
|
+
var actualVal;
|
|
804
|
+
if (config && config.includeMargin === true) {
|
|
805
|
+
marginWidth = parseFloat(style.marginLeft) + parseFloat(style.marginRight);
|
|
806
|
+
marginHeight = parseFloat(style.marginTop) + parseFloat(style.marginBottom);
|
|
807
|
+
}
|
|
808
|
+
if (prop === 'fontSize') {
|
|
809
|
+
actualVal = parseFloat(style.fontSize);
|
|
810
|
+
}
|
|
811
|
+
if (prop === 'fontFamily') {
|
|
812
|
+
actualVal = style.fontFamily;
|
|
813
|
+
}
|
|
814
|
+
if (prop === 'letterSpacing') {
|
|
815
|
+
actualVal = style.letterSpacing;
|
|
816
|
+
}
|
|
817
|
+
if (prop === 'width') {
|
|
818
|
+
maxVal = parseFloat(style.maxWidth);
|
|
819
|
+
|
|
820
|
+
// if its not hidden we just return normal height
|
|
821
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
822
|
+
return el.clientWidth;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (prop === 'height') {
|
|
826
|
+
maxVal = parseFloat(style.maxHeight);
|
|
827
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
828
|
+
return el.clientHeight;
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (prop === 'outerWidth') {
|
|
832
|
+
maxVal = parseFloat(style.maxWidth);
|
|
833
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
834
|
+
return el.offsetWidth + marginWidth;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
if (prop === 'outerHeight') {
|
|
838
|
+
maxVal = parseFloat(style.maxHeight);
|
|
839
|
+
if (display !== 'none' && maxVal !== 0) {
|
|
840
|
+
return el.offsetHeight + marginHeight;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// the element is hidden so:
|
|
845
|
+
// making the el block so we can meassure its height but still be hidden
|
|
846
|
+
el.style.position = 'absolute';
|
|
847
|
+
el.style.visibility = 'hidden';
|
|
848
|
+
el.style.display = 'block';
|
|
849
|
+
if (prop === 'width') actualVal = el.clientWidth;
|
|
850
|
+
if (prop === 'height') actualVal = el.clientHeight;
|
|
851
|
+
if (prop === 'outerWidth') actualVal = el.offsetWidth + marginWidth;
|
|
852
|
+
if (prop === 'outerHeight') actualVal = el.offsetHeight + marginHeight;
|
|
853
|
+
|
|
854
|
+
// reverting to the original values
|
|
855
|
+
el.style.display = display;
|
|
856
|
+
el.style.position = position;
|
|
857
|
+
el.style.visibility = visibility;
|
|
858
|
+
return actualVal;
|
|
859
|
+
}
|
|
860
|
+
function _getElCSS(input, prop, isNumber) {
|
|
861
|
+
var _document$defaultView;
|
|
862
|
+
var val = (_document$defaultView = document.defaultView) === null || _document$defaultView === void 0 ? void 0 : _document$defaultView.getComputedStyle(input, null).getPropertyValue(prop);
|
|
863
|
+
return isNumber ? isNaN(parseFloat(val)) ? 0 : parseFloat(val) : val;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Get cursor or text position in pixels for input element
|
|
868
|
+
*
|
|
869
|
+
* @param {HTMLInputElement} input Required HTMLElement with `value` attribute
|
|
870
|
+
* @param {HTMLSpanElement} fauxContainer Container of faux.
|
|
871
|
+
* @param {HTMLElement} rawTextContainer The raw text container for the comparison
|
|
872
|
+
* @returns {Number}
|
|
873
|
+
*/
|
|
874
|
+
|
|
875
|
+
function _getTextWidth(input, fauxContainer, rawTextContainer) {
|
|
876
|
+
if (input === null || fauxContainer === null || rawTextContainer === null) return 0;
|
|
877
|
+
var _off = input.selectionStart;
|
|
878
|
+
var _faux = fauxContainer;
|
|
879
|
+
var _fauxContainer = rawTextContainer;
|
|
880
|
+
if (_faux && _fauxContainer) {
|
|
881
|
+
// Styles to simulate a node in an input field
|
|
882
|
+
// use pre-wrap instead of wrap for white-space to support wrapping in textareas
|
|
883
|
+
var listOfModifiers = ['direction', 'font-family', 'font-size', 'font-size-adjust', 'font-variant', 'font-weight', 'font-style', 'letter-spacing', 'line-height', 'text-align', 'text-indent', 'text-transform', 'word-wrap', 'word-spacing'];
|
|
884
|
+
|
|
885
|
+
// default styles
|
|
886
|
+
_faux.style.setProperty('white-space', 'pre-wrap');
|
|
887
|
+
_faux.style.setProperty('padding', '0');
|
|
888
|
+
_faux.style.setProperty('margin', '0');
|
|
889
|
+
_faux.style.setProperty('display', 'none');
|
|
890
|
+
for (var i = 0; i < listOfModifiers.length; i++) {
|
|
891
|
+
var propertyValue = _getElCSS(_fauxContainer, listOfModifiers[i], false);
|
|
892
|
+
_faux.style.setProperty(listOfModifiers[i], propertyValue);
|
|
893
|
+
}
|
|
894
|
+
_faux.textContent = input.value.substring(0, _off).replace(/\s/g, "\xA0");
|
|
895
|
+
return _actualPropertyValue(_faux, 'outerWidth');
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/******/
|
|
900
|
+
return __webpack_exports__;
|
|
901
|
+
/******/
|
|
902
|
+
}()
|
|
903
|
+
);
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
/***/ }),
|
|
907
|
+
|
|
908
|
+
/***/ 761:
|
|
909
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
910
|
+
|
|
911
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
912
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
913
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
914
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
915
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
916
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
917
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
918
|
+
})(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
|
|
919
|
+
return (/******/function () {
|
|
920
|
+
// webpackBootstrap
|
|
921
|
+
/******/
|
|
922
|
+
"use strict";
|
|
923
|
+
|
|
924
|
+
/******/
|
|
925
|
+
var __webpack_modules__ = {
|
|
926
|
+
/***/787: /***/function _(module) {
|
|
927
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
928
|
+
|
|
929
|
+
/***/
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/******/
|
|
933
|
+
};
|
|
934
|
+
/************************************************************************/
|
|
935
|
+
/******/ // The module cache
|
|
936
|
+
/******/
|
|
937
|
+
var __webpack_module_cache__ = {};
|
|
938
|
+
/******/
|
|
939
|
+
/******/ // The require function
|
|
940
|
+
/******/
|
|
941
|
+
function __nested_webpack_require_1465__(moduleId) {
|
|
942
|
+
/******/ // Check if module is in cache
|
|
943
|
+
/******/var cachedModule = __webpack_module_cache__[moduleId];
|
|
944
|
+
/******/
|
|
945
|
+
if (cachedModule !== undefined) {
|
|
946
|
+
/******/return cachedModule.exports;
|
|
947
|
+
/******/
|
|
948
|
+
}
|
|
949
|
+
/******/ // Create a new module (and put it into the cache)
|
|
950
|
+
/******/
|
|
951
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
952
|
+
/******/ // no module.id needed
|
|
953
|
+
/******/ // no module.loaded needed
|
|
954
|
+
/******/exports: {}
|
|
955
|
+
/******/
|
|
956
|
+
};
|
|
957
|
+
/******/
|
|
958
|
+
/******/ // Execute the module function
|
|
959
|
+
/******/
|
|
960
|
+
__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
|
|
961
|
+
/******/
|
|
962
|
+
/******/ // Return the exports of the module
|
|
963
|
+
/******/
|
|
964
|
+
return module.exports;
|
|
965
|
+
/******/
|
|
966
|
+
}
|
|
967
|
+
/******/
|
|
968
|
+
/************************************************************************/
|
|
969
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
970
|
+
/******/
|
|
971
|
+
(function () {
|
|
972
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
973
|
+
/******/__nested_webpack_require_1465__.n = function (module) {
|
|
974
|
+
/******/var getter = module && module.__esModule ? /******/function () {
|
|
975
|
+
return module['default'];
|
|
976
|
+
} : /******/function () {
|
|
977
|
+
return module;
|
|
978
|
+
};
|
|
979
|
+
/******/
|
|
980
|
+
__nested_webpack_require_1465__.d(getter, {
|
|
981
|
+
a: getter
|
|
982
|
+
});
|
|
983
|
+
/******/
|
|
984
|
+
return getter;
|
|
985
|
+
/******/
|
|
986
|
+
};
|
|
987
|
+
/******/
|
|
988
|
+
})();
|
|
989
|
+
/******/
|
|
990
|
+
/******/ /* webpack/runtime/define property getters */
|
|
991
|
+
/******/
|
|
992
|
+
(function () {
|
|
993
|
+
/******/ // define getter functions for harmony exports
|
|
994
|
+
/******/__nested_webpack_require_1465__.d = function (exports, definition) {
|
|
995
|
+
/******/for (var key in definition) {
|
|
996
|
+
/******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
|
|
997
|
+
/******/Object.defineProperty(exports, key, {
|
|
998
|
+
enumerable: true,
|
|
999
|
+
get: definition[key]
|
|
1000
|
+
});
|
|
1001
|
+
/******/
|
|
1002
|
+
}
|
|
1003
|
+
/******/
|
|
1004
|
+
}
|
|
1005
|
+
/******/
|
|
1006
|
+
};
|
|
1007
|
+
/******/
|
|
1008
|
+
})();
|
|
1009
|
+
/******/
|
|
1010
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1011
|
+
/******/
|
|
1012
|
+
(function () {
|
|
1013
|
+
/******/__nested_webpack_require_1465__.o = function (obj, prop) {
|
|
1014
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1015
|
+
};
|
|
1016
|
+
/******/
|
|
1017
|
+
})();
|
|
1018
|
+
/******/
|
|
1019
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1020
|
+
/******/
|
|
1021
|
+
(function () {
|
|
1022
|
+
/******/ // define __esModule on exports
|
|
1023
|
+
/******/__nested_webpack_require_1465__.r = function (exports) {
|
|
1024
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1025
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
1026
|
+
value: 'Module'
|
|
1027
|
+
});
|
|
1028
|
+
/******/
|
|
1029
|
+
}
|
|
1030
|
+
/******/
|
|
1031
|
+
Object.defineProperty(exports, '__esModule', {
|
|
1032
|
+
value: true
|
|
1033
|
+
});
|
|
1034
|
+
/******/
|
|
1035
|
+
};
|
|
1036
|
+
/******/
|
|
1037
|
+
})();
|
|
1038
|
+
/******/
|
|
1039
|
+
/************************************************************************/
|
|
1040
|
+
var __webpack_exports__ = {};
|
|
1041
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
1042
|
+
(function () {
|
|
1043
|
+
__nested_webpack_require_1465__.r(__webpack_exports__);
|
|
1044
|
+
/* harmony export */
|
|
1045
|
+
__nested_webpack_require_1465__.d(__webpack_exports__, {
|
|
1046
|
+
/* harmony export */"default": function _default() {
|
|
1047
|
+
return __WEBPACK_DEFAULT_EXPORT__;
|
|
1048
|
+
}
|
|
1049
|
+
/* harmony export */
|
|
1050
|
+
});
|
|
1051
|
+
/* harmony import */
|
|
1052
|
+
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
1053
|
+
/* harmony import */
|
|
1054
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1055
|
+
function _toConsumableArray(arr) {
|
|
1056
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
1057
|
+
}
|
|
1058
|
+
function _nonIterableSpread() {
|
|
1059
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1060
|
+
}
|
|
1061
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
1062
|
+
if (!o) return;
|
|
1063
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
1064
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
1065
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
1066
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
1067
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
1068
|
+
}
|
|
1069
|
+
function _iterableToArray(iter) {
|
|
1070
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
1071
|
+
}
|
|
1072
|
+
function _arrayWithoutHoles(arr) {
|
|
1073
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
1074
|
+
}
|
|
1075
|
+
function _arrayLikeToArray(arr, len) {
|
|
1076
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
1077
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
1078
|
+
return arr2;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Handles the event of clicking outside of the wrapped component
|
|
1082
|
+
*
|
|
1083
|
+
* @usage:
|
|
1084
|
+
|
|
1085
|
+
const App = () => {
|
|
1086
|
+
|
|
1087
|
+
const [show, setShow] = useState<boolean>(false);
|
|
1088
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
1089
|
+
|
|
1090
|
+
useClickOutside({
|
|
1091
|
+
enabled: show && dropdownRef.current,
|
|
1092
|
+
isOutside: (event: any) => {
|
|
1093
|
+
return event.target.closest(`.test__wrapper`) === null && event.target.closest(`.test__wrapper2`) === null;
|
|
1094
|
+
},
|
|
1095
|
+
handle: (event: any) => {
|
|
1096
|
+
// do something
|
|
1097
|
+
//...
|
|
1098
|
+
},
|
|
1099
|
+
spyElement: document
|
|
1100
|
+
}, [show, dropdownRef]);
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
*/
|
|
1104
|
+
|
|
1105
|
+
function useClickOutside(_ref, deps) {
|
|
1106
|
+
var enabled = _ref.enabled,
|
|
1107
|
+
isOutside = _ref.isOutside,
|
|
1108
|
+
handle = _ref.handle,
|
|
1109
|
+
_ref$spyElement = _ref.spyElement,
|
|
1110
|
+
spyElement = _ref$spyElement === void 0 ? typeof document === 'undefined' ? null : document : _ref$spyElement;
|
|
1111
|
+
var isOutsideRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(isOutside);
|
|
1112
|
+
var handleRef = (0, react__WEBPACK_IMPORTED_MODULE_0__.useRef)(handle);
|
|
1113
|
+
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
1114
|
+
isOutsideRef.current = isOutside;
|
|
1115
|
+
|
|
1116
|
+
// fix possible issue if clicking on a focusable element
|
|
1117
|
+
handleRef.current = handle;
|
|
1118
|
+
}, [isOutside, handle]);
|
|
1119
|
+
(0, react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
1120
|
+
if (enabled) {
|
|
1121
|
+
var eventHandler = function eventHandler(event) {
|
|
1122
|
+
var _isOutsideRef$current;
|
|
1123
|
+
if ((_isOutsideRef$current = isOutsideRef.current) !== null && _isOutsideRef$current !== void 0 && _isOutsideRef$current.call(isOutsideRef, event)) {
|
|
1124
|
+
var _handleRef$current;
|
|
1125
|
+
(_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 ? void 0 : _handleRef$current.call(handleRef, event);
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
spyElement === null || spyElement === void 0 ? void 0 : spyElement.addEventListener('pointerdown', eventHandler);
|
|
1129
|
+
return function () {
|
|
1130
|
+
spyElement === null || spyElement === void 0 ? void 0 : spyElement.removeEventListener('pointerdown', eventHandler);
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
}, [enabled].concat(_toConsumableArray(deps)));
|
|
1134
|
+
}
|
|
1135
|
+
/* harmony default export */
|
|
1136
|
+
var __WEBPACK_DEFAULT_EXPORT__ = useClickOutside;
|
|
1137
|
+
})();
|
|
1138
|
+
|
|
1139
|
+
/******/
|
|
1140
|
+
return __webpack_exports__;
|
|
1141
|
+
/******/
|
|
1142
|
+
}()
|
|
1143
|
+
);
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
/***/ }),
|
|
1147
|
+
|
|
1148
|
+
/***/ 85:
|
|
1149
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1150
|
+
|
|
1151
|
+
/* module decorator */ module = __webpack_require__.nmd(module);
|
|
1152
|
+
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1153
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
1154
|
+
if (( false ? 0 : _typeof(exports)) === 'object' && ( false ? 0 : _typeof(module)) === 'object') module.exports = factory(__webpack_require__(787));else if (true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(787)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
|
1155
|
+
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
|
1156
|
+
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
|
1157
|
+
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}
|
|
1158
|
+
})(this, function (__WEBPACK_EXTERNAL_MODULE__787__) {
|
|
1159
|
+
return (/******/function () {
|
|
1160
|
+
// webpackBootstrap
|
|
1161
|
+
/******/
|
|
1162
|
+
"use strict";
|
|
1163
|
+
|
|
1164
|
+
/******/
|
|
1165
|
+
var __webpack_modules__ = {
|
|
1166
|
+
/***/787: /***/function _(module) {
|
|
1167
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
1168
|
+
|
|
1169
|
+
/***/
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/******/
|
|
1173
|
+
};
|
|
1174
|
+
/************************************************************************/
|
|
1175
|
+
/******/ // The module cache
|
|
1176
|
+
/******/
|
|
1177
|
+
var __webpack_module_cache__ = {};
|
|
1178
|
+
/******/
|
|
1179
|
+
/******/ // The require function
|
|
1180
|
+
/******/
|
|
1181
|
+
function __nested_webpack_require_1465__(moduleId) {
|
|
1182
|
+
/******/ // Check if module is in cache
|
|
1183
|
+
/******/var cachedModule = __webpack_module_cache__[moduleId];
|
|
1184
|
+
/******/
|
|
1185
|
+
if (cachedModule !== undefined) {
|
|
1186
|
+
/******/return cachedModule.exports;
|
|
1187
|
+
/******/
|
|
1188
|
+
}
|
|
1189
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1190
|
+
/******/
|
|
1191
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
1192
|
+
/******/ // no module.id needed
|
|
1193
|
+
/******/ // no module.loaded needed
|
|
1194
|
+
/******/exports: {}
|
|
1195
|
+
/******/
|
|
1196
|
+
};
|
|
1197
|
+
/******/
|
|
1198
|
+
/******/ // Execute the module function
|
|
1199
|
+
/******/
|
|
1200
|
+
__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_1465__);
|
|
1201
|
+
/******/
|
|
1202
|
+
/******/ // Return the exports of the module
|
|
1203
|
+
/******/
|
|
1204
|
+
return module.exports;
|
|
1205
|
+
/******/
|
|
1206
|
+
}
|
|
1207
|
+
/******/
|
|
1208
|
+
/************************************************************************/
|
|
1209
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1210
|
+
/******/
|
|
1211
|
+
(function () {
|
|
1212
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1213
|
+
/******/__nested_webpack_require_1465__.n = function (module) {
|
|
1214
|
+
/******/var getter = module && module.__esModule ? /******/function () {
|
|
1215
|
+
return module['default'];
|
|
1216
|
+
} : /******/function () {
|
|
1217
|
+
return module;
|
|
1218
|
+
};
|
|
1219
|
+
/******/
|
|
1220
|
+
__nested_webpack_require_1465__.d(getter, {
|
|
1221
|
+
a: getter
|
|
1222
|
+
});
|
|
1223
|
+
/******/
|
|
1224
|
+
return getter;
|
|
1225
|
+
/******/
|
|
1226
|
+
};
|
|
1227
|
+
/******/
|
|
1228
|
+
})();
|
|
1229
|
+
/******/
|
|
1230
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1231
|
+
/******/
|
|
1232
|
+
(function () {
|
|
1233
|
+
/******/ // define getter functions for harmony exports
|
|
1234
|
+
/******/__nested_webpack_require_1465__.d = function (exports, definition) {
|
|
1235
|
+
/******/for (var key in definition) {
|
|
1236
|
+
/******/if (__nested_webpack_require_1465__.o(definition, key) && !__nested_webpack_require_1465__.o(exports, key)) {
|
|
1237
|
+
/******/Object.defineProperty(exports, key, {
|
|
1238
|
+
enumerable: true,
|
|
1239
|
+
get: definition[key]
|
|
1240
|
+
});
|
|
1241
|
+
/******/
|
|
1242
|
+
}
|
|
1243
|
+
/******/
|
|
1244
|
+
}
|
|
1245
|
+
/******/
|
|
1246
|
+
};
|
|
1247
|
+
/******/
|
|
1248
|
+
})();
|
|
1249
|
+
/******/
|
|
1250
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1251
|
+
/******/
|
|
1252
|
+
(function () {
|
|
1253
|
+
/******/__nested_webpack_require_1465__.o = function (obj, prop) {
|
|
1254
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1255
|
+
};
|
|
1256
|
+
/******/
|
|
1257
|
+
})();
|
|
1258
|
+
/******/
|
|
1259
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1260
|
+
/******/
|
|
1261
|
+
(function () {
|
|
1262
|
+
/******/ // define __esModule on exports
|
|
1263
|
+
/******/__nested_webpack_require_1465__.r = function (exports) {
|
|
1264
|
+
/******/if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1265
|
+
/******/Object.defineProperty(exports, Symbol.toStringTag, {
|
|
1266
|
+
value: 'Module'
|
|
1267
|
+
});
|
|
1268
|
+
/******/
|
|
1269
|
+
}
|
|
1270
|
+
/******/
|
|
1271
|
+
Object.defineProperty(exports, '__esModule', {
|
|
1272
|
+
value: true
|
|
1273
|
+
});
|
|
1274
|
+
/******/
|
|
1275
|
+
};
|
|
1276
|
+
/******/
|
|
1277
|
+
})();
|
|
1278
|
+
/******/
|
|
1279
|
+
/************************************************************************/
|
|
1280
|
+
var __webpack_exports__ = {};
|
|
1281
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
|
1282
|
+
(function () {
|
|
1283
|
+
__nested_webpack_require_1465__.r(__webpack_exports__);
|
|
1284
|
+
/* harmony export */
|
|
1285
|
+
__nested_webpack_require_1465__.d(__webpack_exports__, {
|
|
1286
|
+
/* harmony export */"default": function _default() {
|
|
1287
|
+
return __WEBPACK_DEFAULT_EXPORT__;
|
|
1288
|
+
}
|
|
1289
|
+
/* harmony export */
|
|
1290
|
+
});
|
|
1291
|
+
/* harmony import */
|
|
1292
|
+
var react__WEBPACK_IMPORTED_MODULE_0__ = __nested_webpack_require_1465__(787);
|
|
1293
|
+
/* harmony import */
|
|
1294
|
+
var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nested_webpack_require_1465__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1295
|
+
/**
|
|
1296
|
+
* Create an available ID
|
|
1297
|
+
*
|
|
1298
|
+
*/
|
|
1299
|
+
|
|
1300
|
+
var useComId = function useComId() {
|
|
1301
|
+
return "ID-".concat((0, react__WEBPACK_IMPORTED_MODULE_0__.useId)().replace(/\:/g, "-"));
|
|
1302
|
+
};
|
|
1303
|
+
/* harmony default export */
|
|
1304
|
+
var __WEBPACK_DEFAULT_EXPORT__ = useComId;
|
|
1305
|
+
})();
|
|
1306
|
+
|
|
1307
|
+
/******/
|
|
1308
|
+
return __webpack_exports__;
|
|
1309
|
+
/******/
|
|
1310
|
+
}()
|
|
1311
|
+
);
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1314
|
+
/***/ }),
|
|
1315
|
+
|
|
1316
|
+
/***/ 787:
|
|
1317
|
+
/***/ ((module) => {
|
|
1318
|
+
|
|
1319
|
+
"use strict";
|
|
1320
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__787__;
|
|
1321
|
+
|
|
1322
|
+
/***/ }),
|
|
1323
|
+
|
|
1324
|
+
/***/ 156:
|
|
1325
|
+
/***/ ((module) => {
|
|
1326
|
+
|
|
1327
|
+
"use strict";
|
|
1328
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__156__;
|
|
1329
|
+
|
|
1330
|
+
/***/ })
|
|
1331
|
+
|
|
1332
|
+
/******/ });
|
|
1333
|
+
/************************************************************************/
|
|
1334
|
+
/******/ // The module cache
|
|
1335
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1336
|
+
/******/
|
|
1337
|
+
/******/ // The require function
|
|
1338
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1339
|
+
/******/ // Check if module is in cache
|
|
1340
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1341
|
+
/******/ if (cachedModule !== undefined) {
|
|
1342
|
+
/******/ return cachedModule.exports;
|
|
1343
|
+
/******/ }
|
|
1344
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1345
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1346
|
+
/******/ id: moduleId,
|
|
1347
|
+
/******/ loaded: false,
|
|
1348
|
+
/******/ exports: {}
|
|
1349
|
+
/******/ };
|
|
1350
|
+
/******/
|
|
1351
|
+
/******/ // Execute the module function
|
|
1352
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1353
|
+
/******/
|
|
1354
|
+
/******/ // Flag the module as loaded
|
|
1355
|
+
/******/ module.loaded = true;
|
|
1356
|
+
/******/
|
|
1357
|
+
/******/ // Return the exports of the module
|
|
1358
|
+
/******/ return module.exports;
|
|
1359
|
+
/******/ }
|
|
1360
|
+
/******/
|
|
1361
|
+
/************************************************************************/
|
|
1362
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1363
|
+
/******/ (() => {
|
|
1364
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1365
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1366
|
+
/******/ var getter = module && module.__esModule ?
|
|
1367
|
+
/******/ () => (module['default']) :
|
|
1368
|
+
/******/ () => (module);
|
|
1369
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1370
|
+
/******/ return getter;
|
|
1371
|
+
/******/ };
|
|
1372
|
+
/******/ })();
|
|
1373
|
+
/******/
|
|
1374
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1375
|
+
/******/ (() => {
|
|
1376
|
+
/******/ // define getter functions for harmony exports
|
|
1377
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1378
|
+
/******/ for(var key in definition) {
|
|
1379
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1380
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1381
|
+
/******/ }
|
|
1382
|
+
/******/ }
|
|
1383
|
+
/******/ };
|
|
1384
|
+
/******/ })();
|
|
1385
|
+
/******/
|
|
1386
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
1387
|
+
/******/ (() => {
|
|
1388
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
1389
|
+
/******/ })();
|
|
1390
|
+
/******/
|
|
1391
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
1392
|
+
/******/ (() => {
|
|
1393
|
+
/******/ // define __esModule on exports
|
|
1394
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
1395
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
1396
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
1397
|
+
/******/ }
|
|
1398
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
1399
|
+
/******/ };
|
|
1400
|
+
/******/ })();
|
|
1401
|
+
/******/
|
|
1402
|
+
/******/ /* webpack/runtime/node module decorator */
|
|
1403
|
+
/******/ (() => {
|
|
1404
|
+
/******/ __webpack_require__.nmd = (module) => {
|
|
1405
|
+
/******/ module.paths = [];
|
|
1406
|
+
/******/ if (!module.children) module.children = [];
|
|
1407
|
+
/******/ return module;
|
|
1408
|
+
/******/ };
|
|
1409
|
+
/******/ })();
|
|
1410
|
+
/******/
|
|
1411
|
+
/************************************************************************/
|
|
1412
|
+
var __webpack_exports__ = {};
|
|
1413
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
1414
|
+
(() => {
|
|
1415
|
+
"use strict";
|
|
1416
|
+
// ESM COMPAT FLAG
|
|
1417
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1418
|
+
|
|
1419
|
+
// EXPORTS
|
|
1420
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1421
|
+
"PopoverClose": () => (/* reexport */ src_PopoverClose),
|
|
1422
|
+
"PopoverContent": () => (/* reexport */ src_PopoverContent),
|
|
1423
|
+
"PopoverTrigger": () => (/* reexport */ src_PopoverTrigger),
|
|
1424
|
+
"default": () => (/* reexport */ src_Popover)
|
|
1425
|
+
});
|
|
1426
|
+
|
|
1427
|
+
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"}
|
|
1428
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_ = __webpack_require__(787);
|
|
1429
|
+
var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_);
|
|
1430
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/useComId.js
|
|
1431
|
+
var useComId = __webpack_require__(85);
|
|
1432
|
+
var useComId_default = /*#__PURE__*/__webpack_require__.n(useComId);
|
|
1433
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/useClickOutside.js
|
|
1434
|
+
var useClickOutside = __webpack_require__(761);
|
|
1435
|
+
var useClickOutside_default = /*#__PURE__*/__webpack_require__.n(useClickOutside);
|
|
1436
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/getElementProperty.js
|
|
1437
|
+
var getElementProperty = __webpack_require__(767);
|
|
1438
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/inputsCalculation.js
|
|
1439
|
+
var inputsCalculation = __webpack_require__(954);
|
|
1440
|
+
;// CONCATENATED MODULE: ./src/Popover.tsx
|
|
1441
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
1442
|
+
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."); }
|
|
1443
|
+
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); }
|
|
1444
|
+
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; }
|
|
1445
|
+
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; } }
|
|
1446
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
|
|
1453
|
+
// Context for Popover state management
|
|
1454
|
+
|
|
1455
|
+
var PopoverContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)(null);
|
|
1456
|
+
var usePopoverContext = function usePopoverContext() {
|
|
1457
|
+
var context = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(PopoverContext);
|
|
1458
|
+
if (!context) {
|
|
1459
|
+
throw new Error('Popover components must be used within a Popover');
|
|
1460
|
+
}
|
|
1461
|
+
return context;
|
|
1462
|
+
};
|
|
1463
|
+
|
|
1464
|
+
// Main Popover component (container)
|
|
1465
|
+
|
|
1466
|
+
var Popover = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
|
|
1467
|
+
var direction = props.direction,
|
|
1468
|
+
offset = props.offset,
|
|
1469
|
+
exceededSidePosOffset = props.exceededSidePosOffset,
|
|
1470
|
+
size = props.size,
|
|
1471
|
+
popupArrowColor = props.popupArrowColor,
|
|
1472
|
+
popupContentStyle = props.popupContentStyle,
|
|
1473
|
+
wrapperClassName = props.wrapperClassName,
|
|
1474
|
+
id = props.id,
|
|
1475
|
+
open = props.open,
|
|
1476
|
+
onOpenChange = props.onOpenChange,
|
|
1477
|
+
children = props.children;
|
|
1478
|
+
var POS_OFFSET = Number(offset) || 4;
|
|
1479
|
+
var EXCEEDED_SIDE_POS_OFFSET = Number(exceededSidePosOffset) || 15;
|
|
1480
|
+
var uniqueID = useComId_default()();
|
|
1481
|
+
var idRes = id || uniqueID;
|
|
1482
|
+
var triggerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
1483
|
+
var contentRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
1484
|
+
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(false),
|
|
1485
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1486
|
+
uncontrolledOpen = _useState2[0],
|
|
1487
|
+
setUncontrolledOpen = _useState2[1];
|
|
1488
|
+
var isControlled = typeof open === 'boolean';
|
|
1489
|
+
var isOpen = isControlled ? !!open : uncontrolledOpen;
|
|
1490
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)({
|
|
1491
|
+
x: '0',
|
|
1492
|
+
y: '0'
|
|
1493
|
+
}),
|
|
1494
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1495
|
+
position = _useState4[0],
|
|
1496
|
+
setPosition = _useState4[1];
|
|
1497
|
+
var setIsOpen = function setIsOpen(nextOpen) {
|
|
1498
|
+
if (!isControlled) {
|
|
1499
|
+
setUncontrolledOpen(nextOpen);
|
|
1500
|
+
}
|
|
1501
|
+
if (typeof onOpenChange === 'function') {
|
|
1502
|
+
onOpenChange(nextOpen);
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
var popupArrowStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
1506
|
+
if (typeof popupArrowColor !== 'undefined' && Array.isArray(popupArrowColor) && popupArrowColor.length === 4) {
|
|
1507
|
+
return {
|
|
1508
|
+
'--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%28".concat(popupArrowColor[0], ",%20").concat(popupArrowColor[1], ",%20").concat(popupArrowColor[2], ",%20").concat(popupArrowColor[3], "%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"),
|
|
1509
|
+
'--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%28".concat(popupArrowColor[0], ",%20").concat(popupArrowColor[1], ",%20").concat(popupArrowColor[2], ",%20").concat(popupArrowColor[3], "%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"),
|
|
1510
|
+
'--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%28".concat(popupArrowColor[0], ",%20").concat(popupArrowColor[1], ",%20").concat(popupArrowColor[2], ",%20").concat(popupArrowColor[3], "%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"),
|
|
1511
|
+
'--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%28".concat(popupArrowColor[0], ",%20").concat(popupArrowColor[1], ",%20").concat(popupArrowColor[2], ",%20").concat(popupArrowColor[3], "%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")
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
return undefined;
|
|
1515
|
+
}, [popupArrowColor]);
|
|
1516
|
+
|
|
1517
|
+
// Calculate position based on trigger element
|
|
1518
|
+
var calculatePosition = function calculatePosition() {
|
|
1519
|
+
var triggerEl = triggerRef.current;
|
|
1520
|
+
if (!triggerEl) return;
|
|
1521
|
+
var _getAbsolutePositionO = (0,getElementProperty.getAbsolutePositionOfStage)(triggerEl),
|
|
1522
|
+
x = _getAbsolutePositionO.x,
|
|
1523
|
+
y = _getAbsolutePositionO.y,
|
|
1524
|
+
width = _getAbsolutePositionO.width,
|
|
1525
|
+
height = _getAbsolutePositionO.height;
|
|
1526
|
+
var pos = direction || 'top';
|
|
1527
|
+
if (pos.indexOf('top') >= 0) {
|
|
1528
|
+
setPosition({
|
|
1529
|
+
x: x + width / 2 + 'px',
|
|
1530
|
+
y: y - height - POS_OFFSET + 'px'
|
|
1531
|
+
});
|
|
1532
|
+
} else if (pos.indexOf('bottom') >= 0) {
|
|
1533
|
+
setPosition({
|
|
1534
|
+
x: x + width / 2 + 'px',
|
|
1535
|
+
y: y + height + POS_OFFSET + 'px'
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
// Expose show/hide methods to parent via ref
|
|
1541
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useImperativeHandle)(ref, function () {
|
|
1542
|
+
return {
|
|
1543
|
+
show: function show() {
|
|
1544
|
+
calculatePosition();
|
|
1545
|
+
setIsOpen(true);
|
|
1546
|
+
},
|
|
1547
|
+
hide: function hide() {
|
|
1548
|
+
setIsOpen(false);
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
}, [direction, POS_OFFSET]);
|
|
1552
|
+
|
|
1553
|
+
// Click outside to close
|
|
1554
|
+
useClickOutside_default()({
|
|
1555
|
+
enabled: isOpen && triggerRef.current !== null,
|
|
1556
|
+
isOutside: function isOutside(event) {
|
|
1557
|
+
var _triggerRef$current;
|
|
1558
|
+
// Prevent closing when clicking inside the popover wrapper
|
|
1559
|
+
if (contentRef.current && contentRef.current.contains(event.target)) {
|
|
1560
|
+
return false;
|
|
1561
|
+
}
|
|
1562
|
+
return triggerRef.current !== event.target && !((_triggerRef$current = triggerRef.current) !== null && _triggerRef$current !== void 0 && _triggerRef$current.contains(event.target));
|
|
1563
|
+
},
|
|
1564
|
+
handle: function handle() {
|
|
1565
|
+
setIsOpen(false);
|
|
1566
|
+
}
|
|
1567
|
+
}, [isOpen]);
|
|
1568
|
+
var exceededOffsetInit = function exceededOffsetInit() {
|
|
1569
|
+
// Determine whether it exceeds the far right or left side of the screen
|
|
1570
|
+
//------------------
|
|
1571
|
+
var _modalRef = contentRef.current;
|
|
1572
|
+
if (_modalRef === null) return;
|
|
1573
|
+
var _modalContent = _modalRef.querySelector('.cus-popover__content');
|
|
1574
|
+
if (!_modalContent) return;
|
|
1575
|
+
var _modalBox = _modalContent.getBoundingClientRect();
|
|
1576
|
+
if (typeof _modalContent.dataset.offset === 'undefined' && _modalBox.left > 0) {
|
|
1577
|
+
// Adjust the coordinates due to height
|
|
1578
|
+
//------------------
|
|
1579
|
+
var triggerEl = document.querySelector("[data-overlay-id=\"".concat(_modalRef.id, "\"]"));
|
|
1580
|
+
if (triggerEl !== null) {
|
|
1581
|
+
var _pos = triggerEl.dataset.microtipPosition;
|
|
1582
|
+
if (typeof _pos === 'undefined') _pos = 'top';
|
|
1583
|
+
var _offsetY = _modalBox.height - (0,inputsCalculation.getElCSS)(_modalContent, 'font-size', true) - (0,inputsCalculation.getElCSS)(_modalContent, 'padding-top', true) - (0,inputsCalculation.getElCSS)(_modalContent, 'padding-bottom', true);
|
|
1584
|
+
if (_pos.indexOf('top') >= 0) {
|
|
1585
|
+
_modalRef.style.transform = "translateY(-".concat(_offsetY, "px)");
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
// 10 pixels is used to account for some bias in mobile devices
|
|
1590
|
+
if (_modalBox.right + 10 > window.innerWidth) {
|
|
1591
|
+
var _modalOffsetPosition = _modalBox.right - window.innerWidth + EXCEEDED_SIDE_POS_OFFSET;
|
|
1592
|
+
_modalContent.dataset.offset = _modalOffsetPosition;
|
|
1593
|
+
_modalContent.style.marginLeft = "-".concat(_modalOffsetPosition, "px");
|
|
1594
|
+
}
|
|
1595
|
+
if (_modalBox.left - 10 < 0) {
|
|
1596
|
+
var _modalOffsetPosition2 = Math.abs(_modalBox.left) + EXCEEDED_SIDE_POS_OFFSET;
|
|
1597
|
+
_modalContent.dataset.offset = _modalOffsetPosition2;
|
|
1598
|
+
_modalContent.style.marginLeft = "".concat(_modalOffsetPosition2, "px");
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
// Update position when opening
|
|
1604
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
1605
|
+
if (isOpen) {
|
|
1606
|
+
calculatePosition();
|
|
1607
|
+
}
|
|
1608
|
+
}, [isOpen, direction, POS_OFFSET]);
|
|
1609
|
+
|
|
1610
|
+
// Prevent element data from being unable to be obtained when ref is null
|
|
1611
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
1612
|
+
exceededOffsetInit();
|
|
1613
|
+
});
|
|
1614
|
+
var contextValue = {
|
|
1615
|
+
isOpen: isOpen,
|
|
1616
|
+
setIsOpen: setIsOpen,
|
|
1617
|
+
triggerRef: triggerRef,
|
|
1618
|
+
contentRef: contentRef,
|
|
1619
|
+
id: idRes,
|
|
1620
|
+
direction: direction,
|
|
1621
|
+
offset: offset,
|
|
1622
|
+
exceededSidePosOffset: exceededSidePosOffset,
|
|
1623
|
+
size: size,
|
|
1624
|
+
popupArrowColor: popupArrowColor,
|
|
1625
|
+
popupContentStyle: popupContentStyle,
|
|
1626
|
+
wrapperClassName: wrapperClassName,
|
|
1627
|
+
position: position,
|
|
1628
|
+
setPosition: setPosition,
|
|
1629
|
+
popupArrowStyle: popupArrowStyle
|
|
1630
|
+
};
|
|
1631
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(PopoverContext.Provider, {
|
|
1632
|
+
value: contextValue
|
|
1633
|
+
}, children);
|
|
1634
|
+
});
|
|
1635
|
+
Popover.displayName = 'Popover';
|
|
1636
|
+
/* harmony default export */ const src_Popover = (Popover);
|
|
1637
|
+
// EXTERNAL MODULE: ../Utils/dist/cjs/cls.js
|
|
1638
|
+
var cls = __webpack_require__(188);
|
|
1639
|
+
;// CONCATENATED MODULE: ./src/PopoverTrigger.tsx
|
|
1640
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1641
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1642
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1643
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1644
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1645
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1646
|
+
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
// PopoverTrigger component
|
|
1651
|
+
|
|
1652
|
+
var PopoverTrigger = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
|
|
1653
|
+
var asChild = props.asChild,
|
|
1654
|
+
className = props.className,
|
|
1655
|
+
children = props.children;
|
|
1656
|
+
var _usePopoverContext = usePopoverContext(),
|
|
1657
|
+
triggerRef = _usePopoverContext.triggerRef,
|
|
1658
|
+
setIsOpen = _usePopoverContext.setIsOpen,
|
|
1659
|
+
isOpen = _usePopoverContext.isOpen,
|
|
1660
|
+
id = _usePopoverContext.id,
|
|
1661
|
+
direction = _usePopoverContext.direction,
|
|
1662
|
+
size = _usePopoverContext.size;
|
|
1663
|
+
var handleClick = function handleClick(e) {
|
|
1664
|
+
e.preventDefault();
|
|
1665
|
+
setIsOpen(!isOpen);
|
|
1666
|
+
};
|
|
1667
|
+
var setRefs = function setRefs(node) {
|
|
1668
|
+
if (node) {
|
|
1669
|
+
triggerRef.current = node;
|
|
1670
|
+
}
|
|
1671
|
+
if (typeof ref === 'function') {
|
|
1672
|
+
ref(node);
|
|
1673
|
+
} else if (ref && node) {
|
|
1674
|
+
ref.current = node;
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
var triggerProps = {
|
|
1678
|
+
ref: setRefs,
|
|
1679
|
+
'data-overlay-id': "cus-popover__wrapper-".concat(id),
|
|
1680
|
+
className: (0,cls.combinedCls)('cus-popover__trigger', (0,cls.clsWrite)(className, 'd-inline-block')),
|
|
1681
|
+
'data-microtip-position': direction || 'top',
|
|
1682
|
+
'data-microtip-size': size || 'auto',
|
|
1683
|
+
onClick: handleClick
|
|
1684
|
+
};
|
|
1685
|
+
if (asChild && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children)) {
|
|
1686
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, _objectSpread(_objectSpread({}, triggerProps), children.props || {}));
|
|
1687
|
+
}
|
|
1688
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", triggerProps, children);
|
|
1689
|
+
});
|
|
1690
|
+
PopoverTrigger.displayName = 'PopoverTrigger';
|
|
1691
|
+
/* harmony default export */ const src_PopoverTrigger = (PopoverTrigger);
|
|
1692
|
+
// EXTERNAL MODULE: ../RootPortal/dist/cjs/index.js
|
|
1693
|
+
var cjs = __webpack_require__(909);
|
|
1694
|
+
var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs);
|
|
1695
|
+
;// CONCATENATED MODULE: ./src/PopoverContent.tsx
|
|
1696
|
+
function PopoverContent_typeof(obj) { "@babel/helpers - typeof"; return PopoverContent_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PopoverContent_typeof(obj); }
|
|
1697
|
+
function PopoverContent_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1698
|
+
function PopoverContent_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? PopoverContent_ownKeys(Object(source), !0).forEach(function (key) { PopoverContent_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : PopoverContent_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1699
|
+
function PopoverContent_defineProperty(obj, key, value) { key = PopoverContent_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1700
|
+
function PopoverContent_toPropertyKey(arg) { var key = PopoverContent_toPrimitive(arg, "string"); return PopoverContent_typeof(key) === "symbol" ? key : String(key); }
|
|
1701
|
+
function PopoverContent_toPrimitive(input, hint) { if (PopoverContent_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (PopoverContent_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1702
|
+
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
// PopoverContent component
|
|
1708
|
+
|
|
1709
|
+
var PopoverContent = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
|
|
1710
|
+
var children = props.children,
|
|
1711
|
+
className = props.className;
|
|
1712
|
+
var _usePopoverContext = usePopoverContext(),
|
|
1713
|
+
isOpen = _usePopoverContext.isOpen,
|
|
1714
|
+
contentRef = _usePopoverContext.contentRef,
|
|
1715
|
+
id = _usePopoverContext.id,
|
|
1716
|
+
direction = _usePopoverContext.direction,
|
|
1717
|
+
size = _usePopoverContext.size,
|
|
1718
|
+
popupArrowStyle = _usePopoverContext.popupArrowStyle,
|
|
1719
|
+
popupContentStyle = _usePopoverContext.popupContentStyle,
|
|
1720
|
+
wrapperClassName = _usePopoverContext.wrapperClassName,
|
|
1721
|
+
position = _usePopoverContext.position;
|
|
1722
|
+
var wrapperRef = function wrapperRef(node) {
|
|
1723
|
+
if (node) {
|
|
1724
|
+
contentRef.current = node;
|
|
1725
|
+
}
|
|
1726
|
+
if (typeof ref === 'function') {
|
|
1727
|
+
ref(node);
|
|
1728
|
+
} else if (ref && node) {
|
|
1729
|
+
ref.current = node;
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((cjs_default()), {
|
|
1733
|
+
show: isOpen,
|
|
1734
|
+
containerClassName: "Popover"
|
|
1735
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
1736
|
+
ref: wrapperRef,
|
|
1737
|
+
id: "cus-popover__wrapper-".concat(id),
|
|
1738
|
+
className: (0,cls.combinedCls)('cus-popover__wrapper', wrapperClassName, 'active'),
|
|
1739
|
+
role: "popover",
|
|
1740
|
+
"data-microtip-position": direction || 'top',
|
|
1741
|
+
"data-microtip-size": size || 'auto',
|
|
1742
|
+
style: PopoverContent_objectSpread({
|
|
1743
|
+
left: position.x,
|
|
1744
|
+
top: position.y,
|
|
1745
|
+
display: 'none'
|
|
1746
|
+
}, popupArrowStyle)
|
|
1747
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
1748
|
+
className: (0,cls.combinedCls)('cus-popover__content', className),
|
|
1749
|
+
style: popupContentStyle
|
|
1750
|
+
}, children)));
|
|
1751
|
+
});
|
|
1752
|
+
PopoverContent.displayName = 'PopoverContent';
|
|
1753
|
+
/* harmony default export */ const src_PopoverContent = (PopoverContent);
|
|
1754
|
+
;// CONCATENATED MODULE: ./src/PopoverClose.tsx
|
|
1755
|
+
function PopoverClose_typeof(obj) { "@babel/helpers - typeof"; return PopoverClose_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, PopoverClose_typeof(obj); }
|
|
1756
|
+
var _excluded = ["asChild", "className", "children", "onClick"];
|
|
1757
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1758
|
+
function PopoverClose_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1759
|
+
function PopoverClose_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? PopoverClose_ownKeys(Object(source), !0).forEach(function (key) { PopoverClose_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : PopoverClose_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1760
|
+
function PopoverClose_defineProperty(obj, key, value) { key = PopoverClose_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1761
|
+
function PopoverClose_toPropertyKey(arg) { var key = PopoverClose_toPrimitive(arg, "string"); return PopoverClose_typeof(key) === "symbol" ? key : String(key); }
|
|
1762
|
+
function PopoverClose_toPrimitive(input, hint) { if (PopoverClose_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (PopoverClose_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1763
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1764
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
var PopoverClose = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.forwardRef)(function (props, ref) {
|
|
1769
|
+
var asChild = props.asChild,
|
|
1770
|
+
className = props.className,
|
|
1771
|
+
children = props.children,
|
|
1772
|
+
onClick = props.onClick,
|
|
1773
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
1774
|
+
var _usePopoverContext = usePopoverContext(),
|
|
1775
|
+
setIsOpen = _usePopoverContext.setIsOpen;
|
|
1776
|
+
var handleClick = function handleClick(event) {
|
|
1777
|
+
if (typeof onClick === 'function') {
|
|
1778
|
+
onClick(event);
|
|
1779
|
+
}
|
|
1780
|
+
if (!event.defaultPrevented) {
|
|
1781
|
+
setIsOpen(false);
|
|
1782
|
+
}
|
|
1783
|
+
};
|
|
1784
|
+
var closeProps = PopoverClose_objectSpread({
|
|
1785
|
+
ref: ref,
|
|
1786
|
+
className: (0,cls.combinedCls)('cus-popover__close', className),
|
|
1787
|
+
onClick: handleClick
|
|
1788
|
+
}, rest);
|
|
1789
|
+
if (asChild && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().isValidElement(children)) {
|
|
1790
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(children, PopoverClose_objectSpread(PopoverClose_objectSpread({}, closeProps), children.props || {}));
|
|
1791
|
+
}
|
|
1792
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("button", _extends({
|
|
1793
|
+
type: "button"
|
|
1794
|
+
}, closeProps), children || 'Close');
|
|
1795
|
+
});
|
|
1796
|
+
PopoverClose.displayName = 'PopoverClose';
|
|
1797
|
+
/* harmony default export */ const src_PopoverClose = (PopoverClose);
|
|
1798
|
+
;// CONCATENATED MODULE: ./src/index.tsx
|
|
1799
|
+
|
|
1800
|
+
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
})();
|
|
1804
|
+
|
|
1805
|
+
/******/ return __webpack_exports__;
|
|
1806
|
+
/******/ })()
|
|
1807
|
+
;
|
|
1808
|
+
});
|