lizaui 9.0.2 → 9.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/button/index.cjs.js +1 -1
  2. package/dist/button/index.es.js +1 -1
  3. package/dist/calendar/index.cjs.js +47 -796
  4. package/dist/calendar/index.cjs.js.map +1 -1
  5. package/dist/calendar/index.es.js +11 -760
  6. package/dist/calendar/index.es.js.map +1 -1
  7. package/dist/checkbox/index.cjs.js +1 -1
  8. package/dist/checkbox/index.es.js +1 -1
  9. package/dist/chip/index.cjs.js +9 -9
  10. package/dist/chip/index.cjs.js.map +1 -1
  11. package/dist/chip/index.es.js +2 -2
  12. package/dist/chunks/{button-MKhaqe0K.js → button-B0fpJrMg.js} +3 -3
  13. package/dist/chunks/{button-MKhaqe0K.js.map → button-B0fpJrMg.js.map} +1 -1
  14. package/dist/chunks/{button-BKebd9mx.js → button-d5z8H59K.js} +13 -13
  15. package/dist/chunks/{button-BKebd9mx.js.map → button-d5z8H59K.js.map} +1 -1
  16. package/dist/chunks/{checkbox-DpLEjjb9.js → checkbox-C1Sssumg.js} +3 -3
  17. package/dist/chunks/{checkbox-DpLEjjb9.js.map → checkbox-C1Sssumg.js.map} +1 -1
  18. package/dist/chunks/{checkbox-BoxBfskJ.js → checkbox-ovjcc7jF.js} +15 -15
  19. package/dist/chunks/{checkbox-BoxBfskJ.js.map → checkbox-ovjcc7jF.js.map} +1 -1
  20. package/dist/chunks/{index-BHpUy2Ix.js → index-CEKmKomA.js} +2 -2
  21. package/dist/chunks/{index-BHpUy2Ix.js.map → index-CEKmKomA.js.map} +1 -1
  22. package/dist/chunks/{index-CATvGmak.js → index-C_sOsPRt.js} +5 -5
  23. package/dist/chunks/{index-CATvGmak.js.map → index-C_sOsPRt.js.map} +1 -1
  24. package/dist/chunks/{index-CNDtGisb.js → index-DaMyCNJ8.js} +2 -2
  25. package/dist/chunks/{index-CNDtGisb.js.map → index-DaMyCNJ8.js.map} +1 -1
  26. package/dist/chunks/{label-error-DkVGsF5w.js → label-error-BTCuInp7.js} +2 -2
  27. package/dist/chunks/{label-error-DkVGsF5w.js.map → label-error-BTCuInp7.js.map} +1 -1
  28. package/dist/chunks/label-error-C8lIsfXu.js +9 -0
  29. package/dist/chunks/{label-error-2QXnvbxJ.js.map → label-error-C8lIsfXu.js.map} +1 -1
  30. package/dist/chunks/{ripple-CTAKSntE.js → ripple-Bm6QamOy.js} +4 -4
  31. package/dist/chunks/{ripple-CTAKSntE.js.map → ripple-Bm6QamOy.js.map} +1 -1
  32. package/dist/chunks/{scroll-area-CNEU8oOo.js → scroll-area-C0NhSIO2.js} +31 -31
  33. package/dist/chunks/{scroll-area-CNEU8oOo.js.map → scroll-area-C0NhSIO2.js.map} +1 -1
  34. package/dist/chunks/{scroll-area-3h3tgoqp.js → scroll-area-JgKF61tc.js} +3 -3
  35. package/dist/chunks/{scroll-area-3h3tgoqp.js.map → scroll-area-JgKF61tc.js.map} +1 -1
  36. package/dist/chunks/{select-BW-plZA9.js → select-DGnc8VJi.js} +73 -73
  37. package/dist/chunks/{select-BW-plZA9.js.map → select-DGnc8VJi.js.map} +1 -1
  38. package/dist/chunks/{select-wGmz50gN.js → select-Dpyj5dUk.js} +3 -3
  39. package/dist/chunks/{select-wGmz50gN.js.map → select-Dpyj5dUk.js.map} +1 -1
  40. package/dist/chunks/{styled-components.browser.esm-DbYXI9h_.js → styled-components.browser.esm-CPR7VH_x.js} +3 -3
  41. package/dist/chunks/{styled-components.browser.esm-DbYXI9h_.js.map → styled-components.browser.esm-CPR7VH_x.js.map} +1 -1
  42. package/dist/chunks/{textarea-CPHr2RpC.js → textarea-D2_KC-J4.js} +98 -98
  43. package/dist/chunks/{textarea-CPHr2RpC.js.map → textarea-D2_KC-J4.js.map} +1 -1
  44. package/dist/chunks/{textarea-CXQO1MMF.js → textarea-_HQpXiCX.js} +8 -8
  45. package/dist/chunks/{textarea-CXQO1MMF.js.map → textarea-_HQpXiCX.js.map} +1 -1
  46. package/dist/chunks/{tooltip-05Mv2hjx.js → tooltip-GGFk8ALK.js} +15 -15
  47. package/dist/chunks/{tooltip-05Mv2hjx.js.map → tooltip-GGFk8ALK.js.map} +1 -1
  48. package/dist/chunks/{tooltip-D3J0_sJU.js → tooltip-JwIbppjO.js} +3 -3
  49. package/dist/chunks/{tooltip-D3J0_sJU.js.map → tooltip-JwIbppjO.js.map} +1 -1
  50. package/dist/chunks/tv-B0li4IsO.js +41 -0
  51. package/dist/chunks/tv-B0li4IsO.js.map +1 -0
  52. package/dist/chunks/tv-CGbWb8zP.js +40 -0
  53. package/dist/chunks/tv-CGbWb8zP.js.map +1 -0
  54. package/dist/chunks/utils-H80jjgLf.js +9 -0
  55. package/dist/chunks/{utils-BnY7EXd5.js.map → utils-H80jjgLf.js.map} +1 -1
  56. package/dist/chunks/utils-ij3i9zTT.js +8 -0
  57. package/dist/chunks/{utils-nIKS3WsJ.js.map → utils-ij3i9zTT.js.map} +1 -1
  58. package/dist/divider/index.cjs.js +4 -4
  59. package/dist/divider/index.es.js +1 -1
  60. package/dist/modal/index.cjs.js +17 -17
  61. package/dist/modal/index.es.js +3 -3
  62. package/dist/pagination/index.cjs.js +29 -29
  63. package/dist/pagination/index.cjs.js.map +1 -1
  64. package/dist/pagination/index.es.js +5 -5
  65. package/dist/phone-input/index.cjs.js +32 -31
  66. package/dist/phone-input/index.cjs.js.map +1 -1
  67. package/dist/phone-input/index.es.js +7 -6
  68. package/dist/phone-input/index.es.js.map +1 -1
  69. package/dist/ripple/index.cjs.js +1 -1
  70. package/dist/select-input/index.cjs.js +39 -39
  71. package/dist/select-input/index.cjs.js.map +1 -1
  72. package/dist/select-input/index.es.js +5 -5
  73. package/dist/table/index.cjs.js +44 -44
  74. package/dist/table/index.cjs.js.map +1 -1
  75. package/dist/table/index.es.js +5 -5
  76. package/dist/time-input/index.cjs.js +53 -53
  77. package/dist/time-input/index.cjs.js.map +1 -1
  78. package/dist/time-input/index.es.js +5 -5
  79. package/dist/tooltip/index.cjs.js +1 -1
  80. package/dist/tooltip/index.es.js +1 -1
  81. package/dist/ui/index.cjs.js +324 -324
  82. package/dist/ui/index.es.js +10 -10
  83. package/package.json +8 -2
  84. package/dist/chunks/bundle-mjs-BWLS65yY.js +0 -3003
  85. package/dist/chunks/bundle-mjs-BWLS65yY.js.map +0 -1
  86. package/dist/chunks/bundle-mjs-DB1IOBLD.js +0 -3004
  87. package/dist/chunks/bundle-mjs-DB1IOBLD.js.map +0 -1
  88. package/dist/chunks/clsx-CBkIpawf.js +0 -16
  89. package/dist/chunks/clsx-CBkIpawf.js.map +0 -1
  90. package/dist/chunks/clsx-DgYk2OaC.js +0 -17
  91. package/dist/chunks/clsx-DgYk2OaC.js.map +0 -1
  92. package/dist/chunks/label-error-2QXnvbxJ.js +0 -9
  93. package/dist/chunks/tv-C-wpiWwh.js +0 -274
  94. package/dist/chunks/tv-C-wpiWwh.js.map +0 -1
  95. package/dist/chunks/tv-C4gJMNo3.js +0 -275
  96. package/dist/chunks/tv-C4gJMNo3.js.map +0 -1
  97. package/dist/chunks/utils-BnY7EXd5.js +0 -9
  98. package/dist/chunks/utils-nIKS3WsJ.js +0 -8
  99. package/dist/chunks/v4-BQ42ZlDJ.js +0 -39
  100. package/dist/chunks/v4-BQ42ZlDJ.js.map +0 -1
  101. package/dist/chunks/v4-C3omdoBX.js +0 -40
  102. package/dist/chunks/v4-C3omdoBX.js.map +0 -1
@@ -1,769 +1,20 @@
1
- import require$$0, { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import "react-calendar/dist/Calendar.css";
3
3
  import "react-date-picker/dist/DatePicker.css";
4
- import React__default, { useState, useRef, useEffect, useCallback, useMemo, createElement } from "react";
5
- import ReactDOM__default, { createPortal } from "react-dom";
4
+ import { Popover } from "react-tiny-popover";
6
5
  import { G as GenIcon } from "../chunks/iconBase-DHmg6m28.js";
7
6
  import Calendar from "react-calendar";
8
7
  import DatePicker from "react-date-picker";
9
- import { c as clsx } from "../chunks/clsx-DgYk2OaC.js";
8
+ import React__default, { useState, useRef, useEffect, useCallback, useMemo, createElement } from "react";
9
+ import { createPortal } from "react-dom";
10
+ import clsx from "clsx";
10
11
  import { m as makeEventProps, F as Fit, l as lt, d as dt } from "../chunks/styled-components.browser.esm-CYnGom5T.js";
11
12
  import DateInput from "react-date-picker/dist/DateInput";
12
- import { t as twMerge } from "../chunks/bundle-mjs-DB1IOBLD.js";
13
- import { L as LabelError } from "../chunks/label-error-DkVGsF5w.js";
14
- import { c as cn } from "../chunks/utils-BnY7EXd5.js";
15
- import { B as Button } from "../chunks/button-MKhaqe0K.js";
16
- import { v as v4 } from "../chunks/v4-C3omdoBX.js";
17
- var Popover = {};
18
- var PopoverPortal = {};
19
- var hasRequiredPopoverPortal;
20
- function requirePopoverPortal() {
21
- if (hasRequiredPopoverPortal) return PopoverPortal;
22
- hasRequiredPopoverPortal = 1;
23
- Object.defineProperty(PopoverPortal, "__esModule", { value: true });
24
- PopoverPortal.PopoverPortal = void 0;
25
- var react_1 = React__default;
26
- var react_dom_1 = ReactDOM__default;
27
- var PopoverPortal$1 = function(_a) {
28
- var container = _a.container, element = _a.element, scoutElement = _a.scoutElement, children = _a.children;
29
- (0, react_1.useLayoutEffect)(function() {
30
- container.appendChild(element);
31
- container.appendChild(scoutElement);
32
- return function() {
33
- container.removeChild(element);
34
- container.removeChild(scoutElement);
35
- };
36
- }, [container, element, scoutElement]);
37
- return (0, react_dom_1.createPortal)(children, element);
38
- };
39
- PopoverPortal.PopoverPortal = PopoverPortal$1;
40
- return PopoverPortal;
41
- }
42
- var util = {};
43
- var hasRequiredUtil;
44
- function requireUtil() {
45
- if (hasRequiredUtil) return util;
46
- hasRequiredUtil = 1;
47
- (function(exports) {
48
- var __assign = util && util.__assign || function() {
49
- __assign = Object.assign || function(t) {
50
- for (var s, i = 1, n = arguments.length; i < n; i++) {
51
- s = arguments[i];
52
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
53
- t[p] = s[p];
54
- }
55
- return t;
56
- };
57
- return __assign.apply(this, arguments);
58
- };
59
- Object.defineProperty(exports, "__esModule", { value: true });
60
- exports.getNudgedPopoverRect = exports.getNewPopoverRect = exports.popoverRectForPosition = exports.createContainer = exports.rectsAreEqual = exports.createRect = exports.EMPTY_RECT = void 0;
61
- exports.EMPTY_RECT = {
62
- top: 0,
63
- left: 0,
64
- right: 0,
65
- bottom: 0,
66
- width: 0,
67
- height: 0
68
- };
69
- var createRect = function(_a) {
70
- var top = _a.top, left = _a.left, width = _a.width, height = _a.height;
71
- return {
72
- top,
73
- left,
74
- width,
75
- height,
76
- right: left + width,
77
- bottom: top + height
78
- };
79
- };
80
- exports.createRect = createRect;
81
- var rectsAreEqual = function(rectA, rectB) {
82
- return rectA === rectB || (rectA === null || rectA === void 0 ? void 0 : rectA.bottom) === (rectB === null || rectB === void 0 ? void 0 : rectB.bottom) && (rectA === null || rectA === void 0 ? void 0 : rectA.height) === (rectB === null || rectB === void 0 ? void 0 : rectB.height) && (rectA === null || rectA === void 0 ? void 0 : rectA.left) === (rectB === null || rectB === void 0 ? void 0 : rectB.left) && (rectA === null || rectA === void 0 ? void 0 : rectA.right) === (rectB === null || rectB === void 0 ? void 0 : rectB.right) && (rectA === null || rectA === void 0 ? void 0 : rectA.top) === (rectB === null || rectB === void 0 ? void 0 : rectB.top) && (rectA === null || rectA === void 0 ? void 0 : rectA.width) === (rectB === null || rectB === void 0 ? void 0 : rectB.width);
83
- };
84
- exports.rectsAreEqual = rectsAreEqual;
85
- var createContainer = function(_a) {
86
- var containerStyle = _a.containerStyle, containerClassName = _a.containerClassName;
87
- var container = window.document.createElement("div");
88
- if (containerClassName)
89
- container.className = containerClassName;
90
- Object.assign(container.style, containerStyle);
91
- return container;
92
- };
93
- exports.createContainer = createContainer;
94
- var popoverRectForPosition = function(position, childRect, popoverRect, padding, align) {
95
- var targetMidX = childRect.left + childRect.width / 2;
96
- var targetMidY = childRect.top + childRect.height / 2;
97
- var width = popoverRect.width, height = popoverRect.height;
98
- var top;
99
- var left;
100
- switch (position) {
101
- case "left":
102
- top = targetMidY - height / 2;
103
- left = childRect.left - padding - width;
104
- if (align === "start") {
105
- top = childRect.top;
106
- }
107
- if (align === "end") {
108
- top = childRect.bottom - height;
109
- }
110
- break;
111
- case "bottom":
112
- top = childRect.bottom + padding;
113
- left = targetMidX - width / 2;
114
- if (align === "start") {
115
- left = childRect.left;
116
- }
117
- if (align === "end") {
118
- left = childRect.right - width;
119
- }
120
- break;
121
- case "right":
122
- top = targetMidY - height / 2;
123
- left = childRect.right + padding;
124
- if (align === "start") {
125
- top = childRect.top;
126
- }
127
- if (align === "end") {
128
- top = childRect.bottom - height;
129
- }
130
- break;
131
- default:
132
- top = childRect.top - height - padding;
133
- left = targetMidX - width / 2;
134
- if (align === "start") {
135
- left = childRect.left;
136
- }
137
- if (align === "end") {
138
- left = childRect.right - width;
139
- }
140
- break;
141
- }
142
- return (0, exports.createRect)({ left, top, width, height });
143
- };
144
- exports.popoverRectForPosition = popoverRectForPosition;
145
- var getNewPopoverRect = function(_a, boundaryInset) {
146
- var position = _a.position, align = _a.align, childRect = _a.childRect, popoverRect = _a.popoverRect, boundaryRect = _a.boundaryRect, padding = _a.padding, reposition = _a.reposition;
147
- var rect = (0, exports.popoverRectForPosition)(position, childRect, popoverRect, padding, align);
148
- var boundaryViolation = reposition && (position === "top" && rect.top < boundaryRect.top + boundaryInset || position === "left" && rect.left < boundaryRect.left + boundaryInset || position === "right" && rect.right > boundaryRect.right - boundaryInset || position === "bottom" && rect.bottom > boundaryRect.bottom - boundaryInset);
149
- return {
150
- rect,
151
- boundaryViolation
152
- };
153
- };
154
- exports.getNewPopoverRect = getNewPopoverRect;
155
- var getNudgedPopoverRect = function(popoverRect, boundaryRect, boundaryInset) {
156
- var topBoundary = boundaryRect.top + boundaryInset;
157
- var leftBoundary = boundaryRect.left + boundaryInset;
158
- var rightBoundary = boundaryRect.right - boundaryInset;
159
- var bottomBoundary = boundaryRect.bottom - boundaryInset;
160
- var top = popoverRect.top < topBoundary ? topBoundary : popoverRect.top;
161
- top = top + popoverRect.height > bottomBoundary ? bottomBoundary - popoverRect.height : top;
162
- var left = popoverRect.left < leftBoundary ? leftBoundary : popoverRect.left;
163
- left = left + popoverRect.width > rightBoundary ? rightBoundary - popoverRect.width : left;
164
- return (0, exports.createRect)(__assign(__assign({}, popoverRect), { top, left }));
165
- };
166
- exports.getNudgedPopoverRect = getNudgedPopoverRect;
167
- })(util);
168
- return util;
169
- }
170
- var usePopover = {};
171
- var useElementRef = {};
172
- var hasRequiredUseElementRef;
173
- function requireUseElementRef() {
174
- if (hasRequiredUseElementRef) return useElementRef;
175
- hasRequiredUseElementRef = 1;
176
- Object.defineProperty(useElementRef, "__esModule", { value: true });
177
- useElementRef.useElementRef = void 0;
178
- var react_1 = React__default;
179
- var util_1 = requireUtil();
180
- var useElementRef$1 = function(_a) {
181
- var containerClassName = _a.containerClassName, containerStyle = _a.containerStyle;
182
- var ref = (0, react_1.useRef)();
183
- var element = (0, react_1.useState)(function() {
184
- return (0, util_1.createContainer)({ containerStyle, containerClassName });
185
- })[0];
186
- (0, react_1.useLayoutEffect)(function() {
187
- element.className = containerClassName;
188
- }, [containerClassName, element]);
189
- (0, react_1.useLayoutEffect)(function() {
190
- Object.assign(element.style, containerStyle);
191
- }, [containerStyle, element]);
192
- ref.current = element;
193
- return ref;
194
- };
195
- useElementRef.useElementRef = useElementRef$1;
196
- return useElementRef;
197
- }
198
- var hasRequiredUsePopover;
199
- function requireUsePopover() {
200
- if (hasRequiredUsePopover) return usePopover;
201
- hasRequiredUsePopover = 1;
202
- Object.defineProperty(usePopover, "__esModule", { value: true });
203
- usePopover.usePopover = void 0;
204
- var react_1 = React__default;
205
- var util_1 = requireUtil();
206
- var useElementRef_1 = requireUseElementRef();
207
- var POPOVER_STYLE = {
208
- position: "fixed",
209
- overflow: "visible",
210
- top: "0px",
211
- left: "0px"
212
- };
213
- var SCOUT_STYLE = {
214
- position: "fixed",
215
- top: "0px",
216
- left: "0px",
217
- width: "0px",
218
- height: "0px",
219
- visibility: "hidden"
220
- };
221
- var usePopover$1 = function(_a) {
222
- var isOpen = _a.isOpen, childRef = _a.childRef, positions = _a.positions, containerClassName = _a.containerClassName, parentElement = _a.parentElement, transform = _a.transform, transformMode = _a.transformMode, align = _a.align, padding = _a.padding, reposition = _a.reposition, boundaryInset = _a.boundaryInset, boundaryElement = _a.boundaryElement, onPositionPopover = _a.onPositionPopover;
223
- var scoutRef = (0, useElementRef_1.useElementRef)({
224
- containerClassName: "react-tiny-popover-scout",
225
- containerStyle: SCOUT_STYLE
226
- });
227
- var popoverRef = (0, useElementRef_1.useElementRef)({
228
- containerClassName: containerClassName != null && containerClassName.length > 0 && containerClassName !== "react-tiny-popover-container" ? "react-tiny-popover-container ".concat(containerClassName) : "react-tiny-popover-container",
229
- containerStyle: POPOVER_STYLE
230
- });
231
- var positionPopover = (0, react_1.useCallback)(function(_a2) {
232
- var _b, _c;
233
- var _d = _a2 === void 0 ? {} : _a2, _e = _d.positionIndex, positionIndex = _e === void 0 ? 0 : _e, _f = _d.parentRect, parentRect = _f === void 0 ? parentElement.getBoundingClientRect() : _f, _g = _d.childRect, childRect = _g === void 0 ? (_b = childRef === null || childRef === void 0 ? void 0 : childRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect() : _g, _h = _d.scoutRect, scoutRect = _h === void 0 ? (_c = scoutRef === null || scoutRef === void 0 ? void 0 : scoutRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect() : _h, _j = _d.popoverRect, popoverRect = _j === void 0 ? popoverRef.current.getBoundingClientRect() : _j, _k = _d.boundaryRect, boundaryRect = _k === void 0 ? boundaryElement === parentElement ? parentRect : boundaryElement.getBoundingClientRect() : _k;
234
- if (!childRect || !parentRect || !isOpen) {
235
- return;
236
- }
237
- if (transform && transformMode === "absolute") {
238
- var _l = typeof transform === "function" ? transform({
239
- childRect,
240
- popoverRect,
241
- parentRect,
242
- boundaryRect,
243
- padding,
244
- align,
245
- nudgedTop: 0,
246
- nudgedLeft: 0,
247
- boundaryInset,
248
- violations: util_1.EMPTY_RECT,
249
- hasViolations: false
250
- }) : transform, inputTop = _l.top, inputLeft = _l.left;
251
- var finalLeft_1 = Math.round(parentRect.left + inputLeft - scoutRect.left);
252
- var finalTop_1 = Math.round(parentRect.top + inputTop - scoutRect.top);
253
- popoverRef.current.style.transform = "translate(".concat(finalLeft_1, "px, ").concat(finalTop_1, "px)");
254
- onPositionPopover({
255
- childRect,
256
- popoverRect: (0, util_1.createRect)({
257
- left: finalLeft_1,
258
- top: finalTop_1,
259
- width: popoverRect.width,
260
- height: popoverRect.height
261
- }),
262
- parentRect,
263
- boundaryRect,
264
- padding,
265
- align,
266
- transform: { top: inputTop, left: inputLeft },
267
- nudgedTop: 0,
268
- nudgedLeft: 0,
269
- boundaryInset,
270
- violations: util_1.EMPTY_RECT,
271
- hasViolations: false
272
- });
273
- return;
274
- }
275
- var isExhausted = positionIndex === positions.length;
276
- var position = isExhausted ? positions[0] : positions[positionIndex];
277
- var _m = (0, util_1.getNewPopoverRect)({
278
- childRect,
279
- popoverRect,
280
- boundaryRect,
281
- position,
282
- align,
283
- padding,
284
- reposition
285
- }, boundaryInset), rect = _m.rect, boundaryViolation = _m.boundaryViolation;
286
- if (boundaryViolation && reposition && !isExhausted) {
287
- positionPopover({
288
- positionIndex: positionIndex + 1,
289
- childRect,
290
- popoverRect,
291
- parentRect,
292
- boundaryRect
293
- });
294
- return;
295
- }
296
- var top = rect.top, left = rect.left, width = rect.width, height = rect.height;
297
- var shouldNudge = reposition && !isExhausted;
298
- var _o = (0, util_1.getNudgedPopoverRect)(rect, boundaryRect, boundaryInset), nudgedLeft = _o.left, nudgedTop = _o.top;
299
- var finalTop = top;
300
- var finalLeft = left;
301
- if (shouldNudge) {
302
- finalTop = nudgedTop;
303
- finalLeft = nudgedLeft;
304
- }
305
- finalTop = Math.round(finalTop - scoutRect.top);
306
- finalLeft = Math.round(finalLeft - scoutRect.left);
307
- popoverRef.current.style.transform = "translate(".concat(finalLeft, "px, ").concat(finalTop, "px)");
308
- var potentialViolations = {
309
- top: boundaryRect.top + boundaryInset - finalTop,
310
- left: boundaryRect.left + boundaryInset - finalLeft,
311
- right: finalLeft + width - boundaryRect.right + boundaryInset,
312
- bottom: finalTop + height - boundaryRect.bottom + boundaryInset
313
- };
314
- var popoverState = {
315
- childRect,
316
- popoverRect: (0, util_1.createRect)({ left: finalLeft, top: finalTop, width, height }),
317
- parentRect,
318
- boundaryRect,
319
- position,
320
- align,
321
- padding,
322
- nudgedTop: nudgedTop - top,
323
- nudgedLeft: nudgedLeft - left,
324
- boundaryInset,
325
- violations: {
326
- top: potentialViolations.top <= 0 ? 0 : potentialViolations.top,
327
- left: potentialViolations.left <= 0 ? 0 : potentialViolations.left,
328
- right: potentialViolations.right <= 0 ? 0 : potentialViolations.right,
329
- bottom: potentialViolations.bottom <= 0 ? 0 : potentialViolations.bottom
330
- },
331
- hasViolations: potentialViolations.top > 0 || potentialViolations.left > 0 || potentialViolations.right > 0 || potentialViolations.bottom > 0
332
- };
333
- if (transform) {
334
- onPositionPopover(popoverState);
335
- var _p = typeof transform === "function" ? transform(popoverState) : transform, transformTop = _p.top, transformLeft = _p.left;
336
- popoverRef.current.style.transform = "translate(".concat(Math.round(finalLeft + (transformLeft !== null && transformLeft !== void 0 ? transformLeft : 0)), "px, ").concat(Math.round(finalTop + (transformTop !== null && transformTop !== void 0 ? transformTop : 0)), "px)");
337
- popoverState.nudgedLeft += transformLeft !== null && transformLeft !== void 0 ? transformLeft : 0;
338
- popoverState.nudgedTop += transformTop !== null && transformTop !== void 0 ? transformTop : 0;
339
- popoverState.transform = { top: transformTop, left: transformLeft };
340
- }
341
- onPositionPopover(popoverState);
342
- }, [
343
- parentElement,
344
- childRef,
345
- scoutRef,
346
- popoverRef,
347
- boundaryElement,
348
- isOpen,
349
- transform,
350
- transformMode,
351
- positions,
352
- align,
353
- padding,
354
- reposition,
355
- boundaryInset,
356
- onPositionPopover
357
- ]);
358
- return { positionPopover, popoverRef, scoutRef };
359
- };
360
- usePopover.usePopover = usePopover$1;
361
- return usePopover;
362
- }
363
- var useMemoizedArray = {};
364
- var hasRequiredUseMemoizedArray;
365
- function requireUseMemoizedArray() {
366
- if (hasRequiredUseMemoizedArray) return useMemoizedArray;
367
- hasRequiredUseMemoizedArray = 1;
368
- Object.defineProperty(useMemoizedArray, "__esModule", { value: true });
369
- useMemoizedArray.useMemoizedArray = void 0;
370
- var react_1 = React__default;
371
- var useMemoizedArray$1 = function(externalArray) {
372
- var prevArrayRef = (0, react_1.useRef)(externalArray);
373
- var array = (0, react_1.useMemo)(function() {
374
- if (prevArrayRef.current === externalArray)
375
- return prevArrayRef.current;
376
- if (prevArrayRef.current.length !== externalArray.length) {
377
- prevArrayRef.current = externalArray;
378
- return externalArray;
379
- }
380
- for (var i = 0; i < externalArray.length; i += 1) {
381
- if (externalArray[i] !== prevArrayRef.current[i]) {
382
- prevArrayRef.current = externalArray;
383
- return externalArray;
384
- }
385
- }
386
- return prevArrayRef.current;
387
- }, [externalArray]);
388
- return array;
389
- };
390
- useMemoizedArray.useMemoizedArray = useMemoizedArray$1;
391
- return useMemoizedArray;
392
- }
393
- var useHandlePrevValues = {};
394
- var hasRequiredUseHandlePrevValues;
395
- function requireUseHandlePrevValues() {
396
- if (hasRequiredUseHandlePrevValues) return useHandlePrevValues;
397
- hasRequiredUseHandlePrevValues = 1;
398
- Object.defineProperty(useHandlePrevValues, "__esModule", { value: true });
399
- useHandlePrevValues.useHandlePrevValues = void 0;
400
- var react_1 = React__default;
401
- var useHandlePrevValues$1 = function(props) {
402
- var prevPositions = (0, react_1.useRef)(props.positions);
403
- var prevReposition = (0, react_1.useRef)(props.reposition);
404
- var prevTransformMode = (0, react_1.useRef)(props.transformMode);
405
- var prevTransform = (0, react_1.useRef)(props.transform);
406
- var prevBoundaryElement = (0, react_1.useRef)(props.boundaryElement);
407
- var prevBoundaryInset = (0, react_1.useRef)(props.boundaryInset);
408
- var updatePrevValues = (0, react_1.useCallback)(function() {
409
- prevPositions.current = props.positions;
410
- prevReposition.current = props.reposition;
411
- prevTransformMode.current = props.transformMode;
412
- prevTransform.current = props.transform;
413
- prevBoundaryElement.current = props.boundaryElement;
414
- prevBoundaryInset.current = props.boundaryInset;
415
- }, [
416
- props.boundaryElement,
417
- props.boundaryInset,
418
- props.positions,
419
- props.reposition,
420
- props.transform,
421
- props.transformMode
422
- ]);
423
- return {
424
- prev: {
425
- positions: prevPositions.current,
426
- reposition: prevReposition.current,
427
- transformMode: prevTransformMode.current,
428
- transform: prevTransform.current,
429
- boundaryElement: prevBoundaryElement.current,
430
- boundaryInset: prevBoundaryInset.current
431
- },
432
- updatePrevValues
433
- };
434
- };
435
- useHandlePrevValues.useHandlePrevValues = useHandlePrevValues$1;
436
- return useHandlePrevValues;
437
- }
438
- var useArrowContainer = {};
439
- var hasRequiredUseArrowContainer;
440
- function requireUseArrowContainer() {
441
- if (hasRequiredUseArrowContainer) return useArrowContainer;
442
- hasRequiredUseArrowContainer = 1;
443
- var __assign = useArrowContainer && useArrowContainer.__assign || function() {
444
- __assign = Object.assign || function(t) {
445
- for (var s, i = 1, n = arguments.length; i < n; i++) {
446
- s = arguments[i];
447
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
448
- t[p] = s[p];
449
- }
450
- return t;
451
- };
452
- return __assign.apply(this, arguments);
453
- };
454
- Object.defineProperty(useArrowContainer, "__esModule", { value: true });
455
- useArrowContainer.useArrowContainer = void 0;
456
- var react_1 = React__default;
457
- var useArrowContainer$1 = function(_a) {
458
- var childRect = _a.childRect, popoverRect = _a.popoverRect, position = _a.position, arrowSize = _a.arrowSize, arrowColor = _a.arrowColor;
459
- var arrowContainerStyle = (0, react_1.useMemo)(function() {
460
- return {
461
- padding: arrowSize
462
- };
463
- }, [arrowSize]);
464
- var arrowStyle = (0, react_1.useMemo)(function() {
465
- return __assign({ position: "absolute" }, (function() {
466
- var arrowWidth = arrowSize * 2;
467
- var top = childRect.top - popoverRect.top + childRect.height / 2 - arrowWidth / 2;
468
- var left = childRect.left - popoverRect.left + childRect.width / 2 - arrowWidth / 2;
469
- var lowerBound = arrowSize;
470
- var leftUpperBound = popoverRect.width - arrowSize;
471
- var topUpperBound = popoverRect.height - arrowSize;
472
- left = left < lowerBound ? lowerBound : left;
473
- left = left + arrowWidth > leftUpperBound ? leftUpperBound - arrowWidth : left;
474
- top = top < lowerBound ? lowerBound : top;
475
- top = top + arrowWidth > topUpperBound ? topUpperBound - arrowWidth : top;
476
- top = Number.isNaN(top) ? 0 : top;
477
- left = Number.isNaN(left) ? 0 : left;
478
- switch (position) {
479
- case "right":
480
- return {
481
- borderTop: "".concat(arrowSize, "px solid transparent"),
482
- borderBottom: "".concat(arrowSize, "px solid transparent"),
483
- borderRight: "".concat(arrowSize, "px solid ").concat(arrowColor),
484
- left: 0,
485
- top
486
- };
487
- case "left":
488
- return {
489
- borderTop: "".concat(arrowSize, "px solid transparent"),
490
- borderBottom: "".concat(arrowSize, "px solid transparent"),
491
- borderLeft: "".concat(arrowSize, "px solid ").concat(arrowColor),
492
- right: 0,
493
- top
494
- };
495
- case "bottom":
496
- return {
497
- borderLeft: "".concat(arrowSize, "px solid transparent"),
498
- borderRight: "".concat(arrowSize, "px solid transparent"),
499
- borderBottom: "".concat(arrowSize, "px solid ").concat(arrowColor),
500
- top: 0,
501
- left
502
- };
503
- case "top":
504
- return {
505
- borderLeft: "".concat(arrowSize, "px solid transparent"),
506
- borderRight: "".concat(arrowSize, "px solid transparent"),
507
- borderTop: "".concat(arrowSize, "px solid ").concat(arrowColor),
508
- bottom: 0,
509
- left
510
- };
511
- default:
512
- return {
513
- display: "hidden"
514
- };
515
- }
516
- })());
517
- }, [
518
- arrowColor,
519
- arrowSize,
520
- childRect.height,
521
- childRect.left,
522
- childRect.top,
523
- childRect.width,
524
- popoverRect.height,
525
- popoverRect.left,
526
- popoverRect.top,
527
- popoverRect.width,
528
- position
529
- ]);
530
- return {
531
- arrowContainerStyle,
532
- arrowStyle
533
- };
534
- };
535
- useArrowContainer.useArrowContainer = useArrowContainer$1;
536
- return useArrowContainer;
537
- }
538
- var ArrowContainer = {};
539
- var hasRequiredArrowContainer;
540
- function requireArrowContainer() {
541
- if (hasRequiredArrowContainer) return ArrowContainer;
542
- hasRequiredArrowContainer = 1;
543
- var __assign = ArrowContainer && ArrowContainer.__assign || function() {
544
- __assign = Object.assign || function(t) {
545
- for (var s, i = 1, n = arguments.length; i < n; i++) {
546
- s = arguments[i];
547
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
548
- t[p] = s[p];
549
- }
550
- return t;
551
- };
552
- return __assign.apply(this, arguments);
553
- };
554
- Object.defineProperty(ArrowContainer, "__esModule", { value: true });
555
- ArrowContainer.ArrowContainer = void 0;
556
- var jsx_runtime_1 = require$$0;
557
- var react_1 = React__default;
558
- var useArrowContainer_1 = requireUseArrowContainer();
559
- var ArrowContainer$1 = function(_a) {
560
- var childRect = _a.childRect, popoverRect = _a.popoverRect, position = _a.position, arrowColor = _a.arrowColor, arrowSize = _a.arrowSize, arrowClassName = _a.arrowClassName, externalArrowStyle = _a.arrowStyle, className = _a.className, children = _a.children, externalArrowContainerStyle = _a.style;
561
- var _b = (0, useArrowContainer_1.useArrowContainer)({
562
- childRect,
563
- popoverRect,
564
- position,
565
- arrowColor,
566
- arrowSize
567
- }), arrowContainerStyle = _b.arrowContainerStyle, arrowStyle = _b.arrowStyle;
568
- var mergedContainerStyle = (0, react_1.useMemo)(function() {
569
- return __assign(__assign({}, arrowContainerStyle), externalArrowContainerStyle);
570
- }, [arrowContainerStyle, externalArrowContainerStyle]);
571
- var mergedArrowStyle = (0, react_1.useMemo)(function() {
572
- return __assign(__assign({}, arrowStyle), externalArrowStyle);
573
- }, [arrowStyle, externalArrowStyle]);
574
- return (0, jsx_runtime_1.jsxs)("div", { className, style: mergedContainerStyle, children: [(0, jsx_runtime_1.jsx)("div", { style: mergedArrowStyle, className: arrowClassName }), children] });
575
- };
576
- ArrowContainer.ArrowContainer = ArrowContainer$1;
577
- return ArrowContainer;
578
- }
579
- var hasRequiredPopover;
580
- function requirePopover() {
581
- if (hasRequiredPopover) return Popover;
582
- hasRequiredPopover = 1;
583
- (function(exports) {
584
- var __assign = Popover && Popover.__assign || function() {
585
- __assign = Object.assign || function(t) {
586
- for (var s, i = 1, n = arguments.length; i < n; i++) {
587
- s = arguments[i];
588
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
589
- t[p] = s[p];
590
- }
591
- return t;
592
- };
593
- return __assign.apply(this, arguments);
594
- };
595
- Object.defineProperty(exports, "__esModule", { value: true });
596
- exports.Popover = exports.usePopover = exports.ArrowContainer = exports.useArrowContainer = void 0;
597
- var jsx_runtime_1 = require$$0;
598
- var react_1 = React__default;
599
- var PopoverPortal_1 = requirePopoverPortal();
600
- var util_1 = requireUtil();
601
- var usePopover_1 = requireUsePopover();
602
- Object.defineProperty(exports, "usePopover", { enumerable: true, get: function() {
603
- return usePopover_1.usePopover;
604
- } });
605
- var useMemoizedArray_1 = requireUseMemoizedArray();
606
- var useHandlePrevValues_1 = requireUseHandlePrevValues();
607
- var useArrowContainer_1 = requireUseArrowContainer();
608
- Object.defineProperty(exports, "useArrowContainer", { enumerable: true, get: function() {
609
- return useArrowContainer_1.useArrowContainer;
610
- } });
611
- var ArrowContainer_1 = requireArrowContainer();
612
- Object.defineProperty(exports, "ArrowContainer", { enumerable: true, get: function() {
613
- return ArrowContainer_1.ArrowContainer;
614
- } });
615
- var DEFAULT_POSITIONS = ["top", "left", "right", "bottom"];
616
- var PopoverInternal = (0, react_1.forwardRef)(function(_a, externalRef) {
617
- var isOpen = _a.isOpen, children = _a.children, content = _a.content, _b = _a.positions, externalPositions = _b === void 0 ? DEFAULT_POSITIONS : _b, _c = _a.align, align = _c === void 0 ? "center" : _c, _d = _a.padding, padding = _d === void 0 ? 0 : _d, _e = _a.reposition, reposition = _e === void 0 ? true : _e, _f = _a.parentElement, parentElement = _f === void 0 ? window.document.body : _f, _g = _a.boundaryElement, boundaryElement = _g === void 0 ? parentElement : _g, containerClassName = _a.containerClassName, containerStyle = _a.containerStyle, transform = _a.transform, _h = _a.transformMode, transformMode = _h === void 0 ? "absolute" : _h, _j = _a.boundaryInset, boundaryInset = _j === void 0 ? 0 : _j, onClickOutside = _a.onClickOutside, _k = _a.clickOutsideCapture, clickOutsideCapture = _k === void 0 ? false : _k;
618
- var positions = (0, useMemoizedArray_1.useMemoizedArray)(Array.isArray(externalPositions) ? externalPositions : [externalPositions]);
619
- var _l = (0, useHandlePrevValues_1.useHandlePrevValues)({
620
- positions,
621
- reposition,
622
- transformMode,
623
- transform,
624
- boundaryElement,
625
- boundaryInset
626
- }), prev = _l.prev, updatePrevValues = _l.updatePrevValues;
627
- var childRef = (0, react_1.useRef)();
628
- var _m = (0, react_1.useState)({
629
- align,
630
- nudgedLeft: 0,
631
- nudgedTop: 0,
632
- position: positions[0],
633
- padding,
634
- childRect: util_1.EMPTY_RECT,
635
- popoverRect: util_1.EMPTY_RECT,
636
- parentRect: util_1.EMPTY_RECT,
637
- boundaryRect: util_1.EMPTY_RECT,
638
- boundaryInset,
639
- violations: util_1.EMPTY_RECT,
640
- hasViolations: false
641
- }), popoverState = _m[0], setPopoverState = _m[1];
642
- var onPositionPopover = (0, react_1.useCallback)(function(popoverState2) {
643
- return setPopoverState(popoverState2);
644
- }, []);
645
- var _o = (0, usePopover_1.usePopover)({
646
- isOpen,
647
- childRef,
648
- containerClassName,
649
- parentElement,
650
- boundaryElement,
651
- transform,
652
- transformMode,
653
- positions,
654
- align,
655
- padding,
656
- boundaryInset,
657
- reposition,
658
- onPositionPopover
659
- }), positionPopover = _o.positionPopover, popoverRef = _o.popoverRef, scoutRef = _o.scoutRef;
660
- (0, react_1.useLayoutEffect)(function() {
661
- var shouldUpdate = true;
662
- var updatePopover = function() {
663
- var _a2, _b2;
664
- if (isOpen && shouldUpdate) {
665
- var childRect = (_a2 = childRef === null || childRef === void 0 ? void 0 : childRef.current) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect();
666
- var popoverRect = (_b2 = popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current) === null || _b2 === void 0 ? void 0 : _b2.getBoundingClientRect();
667
- if (childRect != null && popoverRect != null && (!(0, util_1.rectsAreEqual)(childRect, popoverState.childRect) || popoverRect.width !== popoverState.popoverRect.width || popoverRect.height !== popoverState.popoverRect.height || popoverState.padding !== padding || popoverState.align !== align || positions !== prev.positions || reposition !== prev.reposition || transformMode !== prev.transformMode || transform !== prev.transform || boundaryElement !== prev.boundaryElement || boundaryInset !== prev.boundaryInset)) {
668
- positionPopover();
669
- }
670
- updatePrevValues();
671
- if (shouldUpdate) {
672
- window.requestAnimationFrame(updatePopover);
673
- }
674
- }
675
- };
676
- updatePopover();
677
- return function() {
678
- shouldUpdate = false;
679
- };
680
- }, [
681
- align,
682
- boundaryElement,
683
- boundaryInset,
684
- isOpen,
685
- padding,
686
- popoverRef,
687
- popoverState.align,
688
- popoverState.childRect,
689
- popoverState.padding,
690
- popoverState.popoverRect.height,
691
- popoverState.popoverRect.width,
692
- positionPopover,
693
- positions,
694
- prev.boundaryElement,
695
- prev.boundaryInset,
696
- prev.positions,
697
- prev.reposition,
698
- prev.transform,
699
- prev.transformMode,
700
- reposition,
701
- transform,
702
- transformMode,
703
- updatePrevValues
704
- ]);
705
- (0, react_1.useEffect)(function() {
706
- var popoverElement = popoverRef.current;
707
- Object.assign(popoverElement.style, containerStyle);
708
- return function() {
709
- Object.keys(containerStyle !== null && containerStyle !== void 0 ? containerStyle : {}).forEach(function(key) {
710
- return delete popoverElement.style[key];
711
- });
712
- };
713
- }, [containerStyle, isOpen, popoverRef]);
714
- var handleOnClickOutside = (0, react_1.useCallback)(function(e) {
715
- var _a2, _b2;
716
- if (isOpen && !((_a2 = popoverRef.current) === null || _a2 === void 0 ? void 0 : _a2.contains(e.target)) && !((_b2 = childRef.current) === null || _b2 === void 0 ? void 0 : _b2.contains(e.target))) {
717
- onClickOutside === null || onClickOutside === void 0 ? void 0 : onClickOutside(e);
718
- }
719
- }, [isOpen, onClickOutside, popoverRef]);
720
- var handleWindowResize = (0, react_1.useCallback)(function() {
721
- if (childRef.current && isOpen) {
722
- window.requestAnimationFrame(function() {
723
- return positionPopover();
724
- });
725
- }
726
- }, [positionPopover, isOpen]);
727
- (0, react_1.useEffect)(function() {
728
- var body = parentElement.ownerDocument.body;
729
- body.addEventListener("click", handleOnClickOutside, clickOutsideCapture);
730
- body.addEventListener("contextmenu", handleOnClickOutside, clickOutsideCapture);
731
- window.addEventListener("resize", handleWindowResize);
732
- return function() {
733
- body.removeEventListener("click", handleOnClickOutside, clickOutsideCapture);
734
- body.removeEventListener("contextmenu", handleOnClickOutside, clickOutsideCapture);
735
- window.removeEventListener("resize", handleWindowResize);
736
- };
737
- }, [clickOutsideCapture, handleOnClickOutside, handleWindowResize, parentElement]);
738
- var handleRef = (0, react_1.useCallback)(function(node) {
739
- childRef.current = node;
740
- if (externalRef != null) {
741
- if (typeof externalRef === "object") {
742
- externalRef.current = node;
743
- } else if (typeof externalRef === "function") {
744
- externalRef(node);
745
- }
746
- }
747
- }, [externalRef]);
748
- var renderChild = function() {
749
- return (0, react_1.cloneElement)(children, { ref: handleRef });
750
- };
751
- var renderPopover = function() {
752
- if (!isOpen)
753
- return null;
754
- return (0, jsx_runtime_1.jsx)(PopoverPortal_1.PopoverPortal, { element: popoverRef.current, scoutElement: scoutRef.current, container: parentElement, children: typeof content === "function" ? content(popoverState) : content });
755
- };
756
- return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderChild(), renderPopover()] });
757
- });
758
- exports.Popover = (0, react_1.forwardRef)(function(props, ref) {
759
- if (typeof window === "undefined")
760
- return props.children;
761
- return (0, jsx_runtime_1.jsx)(PopoverInternal, __assign({}, props, { ref }));
762
- });
763
- })(Popover);
764
- return Popover;
765
- }
766
- var PopoverExports = requirePopover();
13
+ import { twMerge } from "tailwind-merge";
14
+ import { v4 } from "uuid";
15
+ import { L as LabelError } from "../chunks/label-error-BTCuInp7.js";
16
+ import { c as cn } from "../chunks/utils-H80jjgLf.js";
17
+ import { B as Button } from "../chunks/button-B0fpJrMg.js";
767
18
  function FaArrowLeft(props) {
768
19
  return GenIcon({ "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z" }, "child": [] }] })(props);
769
20
  }
@@ -1454,7 +705,7 @@ const CalendarPicker = ({
1454
705
  "text-danger": isInvalid
1455
706
  });
1456
707
  return /* @__PURE__ */ jsx(
1457
- PopoverExports.Popover,
708
+ Popover,
1458
709
  {
1459
710
  isOpen: show,
1460
711
  containerStyle: {