@addsign/moje-agenda-shared-lib 2.0.52 → 2.0.53
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/dist/Combination-DK1PD8Kn.js +1162 -0
- package/dist/Combination-DK1PD8Kn.js.map +1 -0
- package/dist/Dialog-BCdHj5XF.js +424 -0
- package/dist/Dialog-BCdHj5XF.js.map +1 -0
- package/dist/assets/style.css +3 -3
- package/dist/components/Attachments.js +2 -2
- package/dist/components/datatable/DataTable.js +2 -2
- package/dist/components/datatable/DataTableServer.js +175 -141
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +2 -2
- package/dist/components/form/AutocompleteSearchBarServer.js +2 -2
- package/dist/components/form/FileInput.js +2 -2
- package/dist/components/form/FileInputMultiple.js +2 -2
- package/dist/components/form/FormField.js +2 -2
- package/dist/components/form/PositionsSelectorSingle.js +2 -2
- package/dist/components/form/SelectField.js +2 -2
- package/dist/components/layout/Neoptimizovano.js +2 -2
- package/dist/components/profiles/ProfileOverview.js +2 -2
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/index-BDmNRBtj.js +28864 -0
- package/dist/index-BDmNRBtj.js.map +1 -0
- package/dist/index-BE-ioJyt.js +2399 -0
- package/dist/index-BE-ioJyt.js.map +1 -0
- package/dist/index-BP2JKuhl.js +18 -0
- package/dist/index-BP2JKuhl.js.map +1 -0
- package/dist/index-BwPkj4HH.js +2203 -0
- package/dist/index-BwPkj4HH.js.map +1 -0
- package/dist/index-CZ8q92_F.js +234 -0
- package/dist/index-CZ8q92_F.js.map +1 -0
- package/dist/index-Cz20_uvt.js +36 -0
- package/dist/index-Cz20_uvt.js.map +1 -0
- package/dist/index.es-Dtj1Qgb9.js +9600 -0
- package/dist/index.es-Dtj1Qgb9.js.map +1 -0
- package/dist/jspdf.plugin.autotable-DuWOu3BU.js +11475 -0
- package/dist/jspdf.plugin.autotable-DuWOu3BU.js.map +1 -0
- package/dist/popover--cBqrVd7.js +319 -0
- package/dist/popover--cBqrVd7.js.map +1 -0
- package/lib/components/datatable/DataTableServer.tsx +86 -42
- package/lib/components/ui/select.tsx +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { c as createContextScope, b as composeEventHandlers } from "./index-NZPkObcw.js";
|
|
4
|
+
import { u as useComposedRefs, S as Slot } from "./index-D9mvqz1C.js";
|
|
5
|
+
import { D as DismissableLayer } from "./index-CZ8q92_F.js";
|
|
6
|
+
import { h as hideOthers, R as ReactRemoveScroll, u as useFocusGuards, F as FocusScope } from "./Combination-DK1PD8Kn.js";
|
|
7
|
+
import { u as useId } from "./index-DzfDO78K.js";
|
|
8
|
+
import { c as createPopperScope, A as Anchor, C as Content, a as Arrow, R as Root2$1 } from "./index-BwPkj4HH.js";
|
|
9
|
+
import { P as Portal$1 } from "./index-BP2JKuhl.js";
|
|
10
|
+
import { P as Presence } from "./index-wO-IHm1z.js";
|
|
11
|
+
import { P as Primitive } from "./index-BDmNRBtj.js";
|
|
12
|
+
import { u as useControllableState } from "./index-B0wyIFEr.js";
|
|
13
|
+
import { cn } from "./utils/utils.js";
|
|
14
|
+
var POPOVER_NAME = "Popover";
|
|
15
|
+
var [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [
|
|
16
|
+
createPopperScope
|
|
17
|
+
]);
|
|
18
|
+
var usePopperScope = createPopperScope();
|
|
19
|
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
20
|
+
var Popover$1 = (props) => {
|
|
21
|
+
const {
|
|
22
|
+
__scopePopover,
|
|
23
|
+
children,
|
|
24
|
+
open: openProp,
|
|
25
|
+
defaultOpen,
|
|
26
|
+
onOpenChange,
|
|
27
|
+
modal = false
|
|
28
|
+
} = props;
|
|
29
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
30
|
+
const triggerRef = React.useRef(null);
|
|
31
|
+
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
32
|
+
const [open = false, setOpen] = useControllableState({
|
|
33
|
+
prop: openProp,
|
|
34
|
+
defaultProp: defaultOpen,
|
|
35
|
+
onChange: onOpenChange
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsx(
|
|
38
|
+
PopoverProvider,
|
|
39
|
+
{
|
|
40
|
+
scope: __scopePopover,
|
|
41
|
+
contentId: useId(),
|
|
42
|
+
triggerRef,
|
|
43
|
+
open,
|
|
44
|
+
onOpenChange: setOpen,
|
|
45
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
46
|
+
hasCustomAnchor,
|
|
47
|
+
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
48
|
+
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
|
49
|
+
modal,
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
};
|
|
54
|
+
Popover$1.displayName = POPOVER_NAME;
|
|
55
|
+
var ANCHOR_NAME = "PopoverAnchor";
|
|
56
|
+
var PopoverAnchor = React.forwardRef(
|
|
57
|
+
(props, forwardedRef) => {
|
|
58
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
59
|
+
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
60
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
61
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
onCustomAnchorAdd();
|
|
64
|
+
return () => onCustomAnchorRemove();
|
|
65
|
+
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
66
|
+
return /* @__PURE__ */ jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
70
|
+
var TRIGGER_NAME = "PopoverTrigger";
|
|
71
|
+
var PopoverTrigger$1 = React.forwardRef(
|
|
72
|
+
(props, forwardedRef) => {
|
|
73
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
74
|
+
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
75
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
76
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
77
|
+
const trigger = /* @__PURE__ */ jsx(
|
|
78
|
+
Primitive.button,
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
"aria-haspopup": "dialog",
|
|
82
|
+
"aria-expanded": context.open,
|
|
83
|
+
"aria-controls": context.contentId,
|
|
84
|
+
"data-state": getState(context.open),
|
|
85
|
+
...triggerProps,
|
|
86
|
+
ref: composedTriggerRef,
|
|
87
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
PopoverTrigger$1.displayName = TRIGGER_NAME;
|
|
94
|
+
var PORTAL_NAME = "PopoverPortal";
|
|
95
|
+
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
|
96
|
+
forceMount: void 0
|
|
97
|
+
});
|
|
98
|
+
var PopoverPortal = (props) => {
|
|
99
|
+
const { __scopePopover, forceMount, children, container } = props;
|
|
100
|
+
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
|
101
|
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$1, { asChild: true, container, children }) }) });
|
|
102
|
+
};
|
|
103
|
+
PopoverPortal.displayName = PORTAL_NAME;
|
|
104
|
+
var CONTENT_NAME = "PopoverContent";
|
|
105
|
+
var PopoverContent$1 = React.forwardRef(
|
|
106
|
+
(props, forwardedRef) => {
|
|
107
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
|
108
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
109
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
110
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
PopoverContent$1.displayName = CONTENT_NAME;
|
|
114
|
+
var PopoverContentModal = React.forwardRef(
|
|
115
|
+
(props, forwardedRef) => {
|
|
116
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
117
|
+
const contentRef = React.useRef(null);
|
|
118
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
119
|
+
const isRightClickOutsideRef = React.useRef(false);
|
|
120
|
+
React.useEffect(() => {
|
|
121
|
+
const content = contentRef.current;
|
|
122
|
+
if (content)
|
|
123
|
+
return hideOthers(content);
|
|
124
|
+
}, []);
|
|
125
|
+
return /* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(
|
|
126
|
+
PopoverContentImpl,
|
|
127
|
+
{
|
|
128
|
+
...props,
|
|
129
|
+
ref: composedRefs,
|
|
130
|
+
trapFocus: context.open,
|
|
131
|
+
disableOutsidePointerEvents: true,
|
|
132
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
133
|
+
var _a;
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
if (!isRightClickOutsideRef.current)
|
|
136
|
+
(_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
137
|
+
}),
|
|
138
|
+
onPointerDownOutside: composeEventHandlers(
|
|
139
|
+
props.onPointerDownOutside,
|
|
140
|
+
(event) => {
|
|
141
|
+
const originalEvent = event.detail.originalEvent;
|
|
142
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
143
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
144
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
145
|
+
},
|
|
146
|
+
{ checkForDefaultPrevented: false }
|
|
147
|
+
),
|
|
148
|
+
onFocusOutside: composeEventHandlers(
|
|
149
|
+
props.onFocusOutside,
|
|
150
|
+
(event) => event.preventDefault(),
|
|
151
|
+
{ checkForDefaultPrevented: false }
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
) });
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
var PopoverContentNonModal = React.forwardRef(
|
|
158
|
+
(props, forwardedRef) => {
|
|
159
|
+
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
160
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
161
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
162
|
+
return /* @__PURE__ */ jsx(
|
|
163
|
+
PopoverContentImpl,
|
|
164
|
+
{
|
|
165
|
+
...props,
|
|
166
|
+
ref: forwardedRef,
|
|
167
|
+
trapFocus: false,
|
|
168
|
+
disableOutsidePointerEvents: false,
|
|
169
|
+
onCloseAutoFocus: (event) => {
|
|
170
|
+
var _a, _b;
|
|
171
|
+
(_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
|
|
172
|
+
if (!event.defaultPrevented) {
|
|
173
|
+
if (!hasInteractedOutsideRef.current)
|
|
174
|
+
(_b = context.triggerRef.current) == null ? void 0 : _b.focus();
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
}
|
|
177
|
+
hasInteractedOutsideRef.current = false;
|
|
178
|
+
hasPointerDownOutsideRef.current = false;
|
|
179
|
+
},
|
|
180
|
+
onInteractOutside: (event) => {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
(_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
|
|
183
|
+
if (!event.defaultPrevented) {
|
|
184
|
+
hasInteractedOutsideRef.current = true;
|
|
185
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
186
|
+
hasPointerDownOutsideRef.current = true;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const target = event.target;
|
|
190
|
+
const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
|
|
191
|
+
if (targetIsTrigger)
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
var PopoverContentImpl = React.forwardRef(
|
|
202
|
+
(props, forwardedRef) => {
|
|
203
|
+
const {
|
|
204
|
+
__scopePopover,
|
|
205
|
+
trapFocus,
|
|
206
|
+
onOpenAutoFocus,
|
|
207
|
+
onCloseAutoFocus,
|
|
208
|
+
disableOutsidePointerEvents,
|
|
209
|
+
onEscapeKeyDown,
|
|
210
|
+
onPointerDownOutside,
|
|
211
|
+
onFocusOutside,
|
|
212
|
+
onInteractOutside,
|
|
213
|
+
...contentProps
|
|
214
|
+
} = props;
|
|
215
|
+
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
|
216
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
217
|
+
useFocusGuards();
|
|
218
|
+
return /* @__PURE__ */ jsx(
|
|
219
|
+
FocusScope,
|
|
220
|
+
{
|
|
221
|
+
asChild: true,
|
|
222
|
+
loop: true,
|
|
223
|
+
trapped: trapFocus,
|
|
224
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
225
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
226
|
+
children: /* @__PURE__ */ jsx(
|
|
227
|
+
DismissableLayer,
|
|
228
|
+
{
|
|
229
|
+
asChild: true,
|
|
230
|
+
disableOutsidePointerEvents,
|
|
231
|
+
onInteractOutside,
|
|
232
|
+
onEscapeKeyDown,
|
|
233
|
+
onPointerDownOutside,
|
|
234
|
+
onFocusOutside,
|
|
235
|
+
onDismiss: () => context.onOpenChange(false),
|
|
236
|
+
children: /* @__PURE__ */ jsx(
|
|
237
|
+
Content,
|
|
238
|
+
{
|
|
239
|
+
"data-state": getState(context.open),
|
|
240
|
+
role: "dialog",
|
|
241
|
+
id: context.contentId,
|
|
242
|
+
...popperScope,
|
|
243
|
+
...contentProps,
|
|
244
|
+
ref: forwardedRef,
|
|
245
|
+
style: {
|
|
246
|
+
...contentProps.style,
|
|
247
|
+
// re-namespace exposed content custom properties
|
|
248
|
+
...{
|
|
249
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
250
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
251
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
252
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
253
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
var CLOSE_NAME = "PopoverClose";
|
|
265
|
+
var PopoverClose = React.forwardRef(
|
|
266
|
+
(props, forwardedRef) => {
|
|
267
|
+
const { __scopePopover, ...closeProps } = props;
|
|
268
|
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
269
|
+
return /* @__PURE__ */ jsx(
|
|
270
|
+
Primitive.button,
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
...closeProps,
|
|
274
|
+
ref: forwardedRef,
|
|
275
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
276
|
+
}
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
PopoverClose.displayName = CLOSE_NAME;
|
|
281
|
+
var ARROW_NAME = "PopoverArrow";
|
|
282
|
+
var PopoverArrow = React.forwardRef(
|
|
283
|
+
(props, forwardedRef) => {
|
|
284
|
+
const { __scopePopover, ...arrowProps } = props;
|
|
285
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
286
|
+
return /* @__PURE__ */ jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
PopoverArrow.displayName = ARROW_NAME;
|
|
290
|
+
function getState(open) {
|
|
291
|
+
return open ? "open" : "closed";
|
|
292
|
+
}
|
|
293
|
+
var Root2 = Popover$1;
|
|
294
|
+
var Trigger = PopoverTrigger$1;
|
|
295
|
+
var Portal = PopoverPortal;
|
|
296
|
+
var Content2 = PopoverContent$1;
|
|
297
|
+
const Popover = Root2;
|
|
298
|
+
const PopoverTrigger = Trigger;
|
|
299
|
+
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
|
|
300
|
+
Content2,
|
|
301
|
+
{
|
|
302
|
+
ref,
|
|
303
|
+
align,
|
|
304
|
+
sideOffset,
|
|
305
|
+
className: cn(
|
|
306
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
307
|
+
className
|
|
308
|
+
),
|
|
309
|
+
...props
|
|
310
|
+
}
|
|
311
|
+
) }));
|
|
312
|
+
PopoverContent.displayName = Content2.displayName;
|
|
313
|
+
export {
|
|
314
|
+
Popover as P,
|
|
315
|
+
PopoverTrigger as a,
|
|
316
|
+
PopoverContent as b,
|
|
317
|
+
PopoverClose as c
|
|
318
|
+
};
|
|
319
|
+
//# sourceMappingURL=popover--cBqrVd7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover--cBqrVd7.js","sources":["../node_modules/@radix-ui/react-popover/dist/index.mjs","../lib/components/ui/popover.tsx"],"sourcesContent":["\"use client\";\n\n// packages/react/popover/src/Popover.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar POPOVER_NAME = \"Popover\";\nvar [createPopoverContext, createPopoverScope] = createContextScope(POPOVER_NAME, [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);\nvar Popover = (props) => {\n const {\n __scopePopover,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = false\n } = props;\n const popperScope = usePopperScope(__scopePopover);\n const triggerRef = React.useRef(null);\n const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n PopoverProvider,\n {\n scope: __scopePopover,\n contentId: useId(),\n triggerRef,\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n hasCustomAnchor,\n onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),\n onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),\n modal,\n children\n }\n ) });\n};\nPopover.displayName = POPOVER_NAME;\nvar ANCHOR_NAME = \"PopoverAnchor\";\nvar PopoverAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...anchorProps } = props;\n const context = usePopoverContext(ANCHOR_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const { onCustomAnchorAdd, onCustomAnchorRemove } = context;\n React.useEffect(() => {\n onCustomAnchorAdd();\n return () => onCustomAnchorRemove();\n }, [onCustomAnchorAdd, onCustomAnchorRemove]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nPopoverAnchor.displayName = ANCHOR_NAME;\nvar TRIGGER_NAME = \"PopoverTrigger\";\nvar PopoverTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...triggerProps } = props;\n const context = usePopoverContext(TRIGGER_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n const trigger = /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: trigger });\n }\n);\nPopoverTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"PopoverPortal\";\nvar [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar PopoverPortal = (props) => {\n const { __scopePopover, forceMount, children, container } = props;\n const context = usePopoverContext(PORTAL_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nPopoverPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"PopoverContent\";\nvar PopoverContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nPopoverContent.displayName = CONTENT_NAME;\nvar PopoverContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const isRightClickOutsideRef = React.useRef(false);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(\n props.onPointerDownOutside,\n (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n isRightClickOutsideRef.current = isRightClick;\n },\n { checkForDefaultPrevented: false }\n ),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nvar PopoverContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n PopoverContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar PopoverContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopover,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n ...contentProps\n } = props;\n const context = usePopoverContext(CONTENT_NAME, __scopePopover);\n const popperScope = usePopperScope(__scopePopover);\n useFocusGuards();\n return /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onInteractOutside,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n \"data-state\": getState(context.open),\n role: \"dialog\",\n id: context.contentId,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-popover-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-popover-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-popover-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-popover-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-popover-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n )\n }\n )\n }\n );\n }\n);\nvar CLOSE_NAME = \"PopoverClose\";\nvar PopoverClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...closeProps } = props;\n const context = usePopoverContext(CLOSE_NAME, __scopePopover);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nPopoverClose.displayName = CLOSE_NAME;\nvar ARROW_NAME = \"PopoverArrow\";\nvar PopoverArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopover, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopePopover);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nPopoverArrow.displayName = ARROW_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Popover;\nvar Anchor2 = PopoverAnchor;\nvar Trigger = PopoverTrigger;\nvar Portal = PopoverPortal;\nvar Content2 = PopoverContent;\nvar Close = PopoverClose;\nvar Arrow2 = PopoverArrow;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n Close,\n Content2 as Content,\n Popover,\n PopoverAnchor,\n PopoverArrow,\n PopoverClose,\n PopoverContent,\n PopoverPortal,\n PopoverTrigger,\n Portal,\n Root2 as Root,\n Trigger,\n createPopoverScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\r\n\r\nimport { cn } from \"../../utils/utils\";\r\n\r\nconst Popover = PopoverPrimitive.Root;\r\n\r\nconst PopoverTrigger = PopoverPrimitive.Trigger;\r\n\r\nconst PopoverContent = React.forwardRef<\r\n React.ElementRef<typeof PopoverPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n <PopoverPrimitive.Portal>\r\n <PopoverPrimitive.Content\r\n ref={ref}\r\n align={align}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\r\n className\r\n )}\r\n {...props}\r\n />\r\n </PopoverPrimitive.Portal>\r\n));\r\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\r\n\r\nexport { Popover, PopoverTrigger, PopoverContent };\r\n"],"names":["Popover","PopperPrimitive.Root","PopperPrimitive.Anchor","PopoverTrigger","PortalPrimitive","PopoverContent","RemoveScroll","PopperPrimitive.Content","PopperPrimitive.Arrow","PopoverPrimitive.Root","PopoverPrimitive.Trigger","PopoverPrimitive.Portal","PopoverPrimitive.Content"],"mappings":";;;;;;;;;;;;;AAqBA,IAAI,eAAe;AACnB,IAAI,CAAC,sBAAsB,kBAAkB,IAAI,mBAAmB,cAAc;AAAA,EAChF;AACF,CAAC;AACD,IAAI,iBAAiB,kBAAiB;AACtC,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,qBAAqB,YAAY;AAC5E,IAAIA,YAAU,CAAC,UAAU;AACvB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACT,IAAG;AACJ,QAAM,cAAc,eAAe,cAAc;AACjD,QAAM,aAAa,MAAM,OAAO,IAAI;AACpC,QAAM,CAAC,iBAAiB,kBAAkB,IAAI,MAAM,SAAS,KAAK;AAClE,QAAM,CAAC,OAAO,OAAO,OAAO,IAAI,qBAAqB;AAAA,IACnD,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU;AAAA,EACd,CAAG;AACD,SAAuB,oBAAIC,SAAsB,EAAE,GAAG,aAAa,UAA0B;AAAA,IAC3F;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,WAAW,MAAO;AAAA,MAClB;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,cAAc,MAAM,YAAY,MAAM,QAAQ,CAAC,aAAa,CAAC,QAAQ,GAAG,CAAC,OAAO,C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MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,QAAQ,UAAU,aAAa,GAAG,GAAG,MAAM,GAAG,QAC3D,oBAAAC,QAAA,EACC,UAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA,EAAA;AACN,EAAA,CACF,CACD;AACD,eAAe,cAAcA,SAAyB;","x_google_ignoreList":[0]}
|
|
@@ -28,11 +28,17 @@ import {
|
|
|
28
28
|
MdOutlineUnfoldMore,
|
|
29
29
|
MdSearch,
|
|
30
30
|
} from "react-icons/md";
|
|
31
|
-
import
|
|
32
|
-
import InputField from "../form/InputField";
|
|
31
|
+
import { Input } from "../ui/input";
|
|
33
32
|
import { Resizable } from "./Resizable";
|
|
34
33
|
import { DatatableSettings } from "./DatatableSettings";
|
|
35
34
|
import { MultiSelect } from "../ui/multi-select";
|
|
35
|
+
import {
|
|
36
|
+
Select,
|
|
37
|
+
SelectContent,
|
|
38
|
+
SelectItem,
|
|
39
|
+
SelectTrigger,
|
|
40
|
+
SelectValue,
|
|
41
|
+
} from "../ui/select";
|
|
36
42
|
|
|
37
43
|
import * as XLSX from "xlsx";
|
|
38
44
|
|
|
@@ -339,9 +345,16 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
339
345
|
const options = await fetchFilterOptions(column);
|
|
340
346
|
|
|
341
347
|
if (options && column.filterType === "select") {
|
|
348
|
+
// Filter out empty values and add a "clear" option
|
|
349
|
+
const filteredOptions = options.filter(
|
|
350
|
+
(option: IOptionItem) =>
|
|
351
|
+
option.value !== null &&
|
|
352
|
+
option.value !== undefined &&
|
|
353
|
+
option.value !== ""
|
|
354
|
+
);
|
|
342
355
|
newFilterOptions[column.filterParam as string] = [
|
|
343
|
-
{ value: "", label: "" },
|
|
344
|
-
...
|
|
356
|
+
{ value: "__clear__", label: "Všechny" },
|
|
357
|
+
...filteredOptions,
|
|
345
358
|
];
|
|
346
359
|
} else if (options && column.filterType === "multi-select") {
|
|
347
360
|
newFilterOptions[column.filterParam as string] = options;
|
|
@@ -678,10 +691,8 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
678
691
|
};
|
|
679
692
|
}, [updateSyncWidth, data, isLoading]);
|
|
680
693
|
|
|
681
|
-
const handleItemsPerPageChange = (
|
|
682
|
-
|
|
683
|
-
) => {
|
|
684
|
-
const selectedItemsPerPage = Number(event.target.value);
|
|
694
|
+
const handleItemsPerPageChange = (value: string) => {
|
|
695
|
+
const selectedItemsPerPage = Number(value);
|
|
685
696
|
setItemsPerPageLocal(selectedItemsPerPage);
|
|
686
697
|
setCurrentPage(0); // Reset the current page to 0 when changing items per page
|
|
687
698
|
};
|
|
@@ -837,32 +848,57 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
837
848
|
<div
|
|
838
849
|
className="p-0 m-0 pb-2"
|
|
839
850
|
onClick={(e) => e.stopPropagation()}
|
|
851
|
+
data-cy={"datatable-filter-container-" + id + "-" + String(key)}
|
|
840
852
|
>
|
|
841
853
|
{filterType === "select" ? (
|
|
842
|
-
<
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
filterOptions[String(filterParam)] || []
|
|
854
|
-
}
|
|
854
|
+
<Select
|
|
855
|
+
onValueChange={(value) => {
|
|
856
|
+
if (value === "__clear__") {
|
|
857
|
+
filterHandler(filterParam as keyof T, "");
|
|
858
|
+
} else {
|
|
859
|
+
filterHandler(
|
|
860
|
+
filterParam as keyof T,
|
|
861
|
+
value
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
}}
|
|
855
865
|
value={
|
|
856
|
-
mergedFilters?.[
|
|
866
|
+
mergedFilters?.[
|
|
867
|
+
String(filterParam)
|
|
868
|
+
]?.toString() || "__clear__"
|
|
857
869
|
}
|
|
858
|
-
|
|
859
|
-
className="px-0"
|
|
860
|
-
placeholder={"Zadejte filtr"}
|
|
861
|
-
rounded={true}
|
|
870
|
+
|
|
862
871
|
disabled={Object.keys(
|
|
863
872
|
(filters as object) || {}
|
|
864
873
|
).includes(String(filterParam))}
|
|
865
|
-
|
|
874
|
+
>
|
|
875
|
+
<SelectTrigger
|
|
876
|
+
|
|
877
|
+
className="flex-1 w-full px-2 font-normal placeholder-muted-foreground"
|
|
878
|
+
>
|
|
879
|
+
<SelectValue placeholder="Zadejte filtr" />
|
|
880
|
+
</SelectTrigger>
|
|
881
|
+
<SelectContent>
|
|
882
|
+
{filterOptions[String(filterParam)]
|
|
883
|
+
?.filter(
|
|
884
|
+
(option: IOptionItem) =>
|
|
885
|
+
option.value !== null &&
|
|
886
|
+
option.value !== undefined &&
|
|
887
|
+
option.value !== ""
|
|
888
|
+
)
|
|
889
|
+
?.map((option: IOptionItem) => (
|
|
890
|
+
<SelectItem
|
|
891
|
+
key={option.value}
|
|
892
|
+
value={
|
|
893
|
+
option.value?.toString() ||
|
|
894
|
+
"unknown"
|
|
895
|
+
}
|
|
896
|
+
>
|
|
897
|
+
{option.label}
|
|
898
|
+
</SelectItem>
|
|
899
|
+
))}
|
|
900
|
+
</SelectContent>
|
|
901
|
+
</Select>
|
|
866
902
|
) : filterType === "multi-select" ? (
|
|
867
903
|
<MultiSelect
|
|
868
904
|
// key={JSON.stringify(mergedFilters)}
|
|
@@ -885,7 +921,7 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
885
921
|
).includes(String(filterParam))}
|
|
886
922
|
variant="secondary"
|
|
887
923
|
maxCount={0}
|
|
888
|
-
|
|
924
|
+
/>
|
|
889
925
|
) : filterType === "dateRange" ? (
|
|
890
926
|
<DateRangeField
|
|
891
927
|
// key={JSON.stringify(mergedFilters)}
|
|
@@ -937,16 +973,13 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
937
973
|
).includes(String(filterParam))}
|
|
938
974
|
/>
|
|
939
975
|
) : filterType === "text" ? (
|
|
940
|
-
<
|
|
941
|
-
|
|
942
|
-
name={String(key) + "_filter"}
|
|
943
|
-
onInputChange={(e) =>
|
|
976
|
+
<Input
|
|
977
|
+
onChange={(e) =>
|
|
944
978
|
filterHandler(
|
|
945
979
|
filterParam as keyof T,
|
|
946
980
|
e.target.value
|
|
947
981
|
)
|
|
948
982
|
}
|
|
949
|
-
type={filterType}
|
|
950
983
|
value={
|
|
951
984
|
mergedFilters?.[String(filterParam)] || ""
|
|
952
985
|
}
|
|
@@ -954,8 +987,8 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
954
987
|
(filters as object) || {}
|
|
955
988
|
).includes(String(filterParam))}
|
|
956
989
|
clearable
|
|
957
|
-
className="
|
|
958
|
-
|
|
990
|
+
className="min-w-[100px] px-2 font-normal placeholder-muted-foreground
|
|
991
|
+
"
|
|
959
992
|
placeholder={"Zadejte filtr"}
|
|
960
993
|
debounceTimeout={1000}
|
|
961
994
|
/>
|
|
@@ -1121,13 +1154,24 @@ function DataTableServer<T extends DataTableInternalItems>({
|
|
|
1121
1154
|
<span className=" whitespace-nowrap flex-grow">
|
|
1122
1155
|
Počet řádků na stránku:
|
|
1123
1156
|
</span>
|
|
1124
|
-
<
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1157
|
+
<Select
|
|
1158
|
+
onValueChange={handleItemsPerPageChange}
|
|
1159
|
+
value={itemsPerPageLocal?.toString()}
|
|
1160
|
+
>
|
|
1161
|
+
<SelectTrigger className="w-[100px]">
|
|
1162
|
+
<SelectValue placeholder="Vyberte počet" />
|
|
1163
|
+
</SelectTrigger>
|
|
1164
|
+
<SelectContent>
|
|
1165
|
+
{itemsPerPageOptions?.map((option) => (
|
|
1166
|
+
<SelectItem
|
|
1167
|
+
key={option.value}
|
|
1168
|
+
value={option.value?.toString() || ""}
|
|
1169
|
+
>
|
|
1170
|
+
{option.label}
|
|
1171
|
+
</SelectItem>
|
|
1172
|
+
))}
|
|
1173
|
+
</SelectContent>
|
|
1174
|
+
</Select>
|
|
1131
1175
|
</div>
|
|
1132
1176
|
</div>
|
|
1133
1177
|
)}
|
|
@@ -21,7 +21,7 @@ const SelectTrigger = React.forwardRef<
|
|
|
21
21
|
<SelectPrimitive.Trigger
|
|
22
22
|
ref={ref}
|
|
23
23
|
className={cn(
|
|
24
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-ring placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
24
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-ring placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 text-left",
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
{...props}
|