@addsign/moje-agenda-shared-lib 2.0.0 → 2.0.1
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/Dialog-IPFWYptw.js +421 -0
- package/dist/Dialog-IPFWYptw.js.map +1 -0
- package/dist/assets/style.css +12 -7
- package/dist/components/datatable/DataTable.js +1 -2
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +1 -2
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +1 -2
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +1 -2
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/FileInput.js +1 -2
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +1 -2
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +1 -2
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +1 -2
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/SelectField.js +1 -2
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +1 -2
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.d.ts +14 -1
- package/dist/components/ui/Combobox.js +122 -98
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/command.js.map +1 -1
- package/dist/index-BF3Kkq7m.js +2212 -0
- package/dist/index-BF3Kkq7m.js.map +1 -0
- package/dist/index-Bm-YZac9.js +28864 -0
- package/dist/index-Bm-YZac9.js.map +1 -0
- package/dist/index-C4pkvuV-.js +1395 -0
- package/dist/index-C4pkvuV-.js.map +1 -0
- package/dist/index-M6rMtqtn.js +2203 -0
- package/dist/index-M6rMtqtn.js.map +1 -0
- package/dist/index.es-XWsfbnWC.js +9628 -0
- package/dist/index.es-XWsfbnWC.js.map +1 -0
- package/dist/jspdf.plugin.autotable-DXW3wQb-.js +11475 -0
- package/dist/jspdf.plugin.autotable-DXW3wQb-.js.map +1 -0
- package/dist/main.js +1 -4
- package/dist/main.js.map +1 -1
- package/lib/components/ui/Combobox.tsx +155 -102
- package/lib/components/ui/command.tsx +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -36,10 +36,7 @@ import { Input } from "./components/ui/input.js";
|
|
|
36
36
|
import { Form, FormControl, FormDescription, FormFieldCN, FormItem, FormLabel, FormMessage, useFormField } from "./components/ui/form.js";
|
|
37
37
|
import { RadioGroupCN, RadioGroupItem } from "./components/ui/radioGroup.js";
|
|
38
38
|
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "./components/ui/command.js";
|
|
39
|
-
import "
|
|
40
|
-
import "react";
|
|
41
|
-
import "./components/ui/button.js";
|
|
42
|
-
import "./components/ui/popover.js";
|
|
39
|
+
import "./components/ui/Combobox.js";
|
|
43
40
|
import { C } from "./Calendar-DWT4e7Th.js";
|
|
44
41
|
import { default as default22 } from "./components/ui/DateTimePicker.js";
|
|
45
42
|
import { default as default23 } from "./components/ui/DatePicker.js";
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Check, ChevronsUpDown, Plus } from "lucide-react";
|
|
4
|
+
import { Check, ChevronsUpDown, Plus, X } from "lucide-react";
|
|
5
5
|
|
|
6
6
|
import { cn } from "../../utils/utils";
|
|
7
7
|
import { Button } from "./button";
|
|
@@ -14,109 +14,162 @@ import {
|
|
|
14
14
|
CommandList,
|
|
15
15
|
} from "./command";
|
|
16
16
|
import { Popover, PopoverContent, PopoverTrigger } from "./popover";
|
|
17
|
+
import { IOptionItem } from "../../types";
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
value: "nuxt.js",
|
|
29
|
-
label: "Nuxt.js",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: "remix",
|
|
33
|
-
label: "Remix",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
value: "astro",
|
|
37
|
-
label: "Astro",
|
|
38
|
-
},
|
|
39
|
-
];
|
|
19
|
+
interface ComboboxProps {
|
|
20
|
+
value?: string;
|
|
21
|
+
onChange?: (value: string | undefined) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
placeholderSearch?: string;
|
|
25
|
+
clearable?: boolean;
|
|
26
|
+
options?: IOptionItem[];
|
|
27
|
+
allowAddNew?: boolean;
|
|
28
|
+
}
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
const Combobox = React.forwardRef<HTMLButtonElement, ComboboxProps>(
|
|
31
|
+
(
|
|
32
|
+
{
|
|
33
|
+
value: propValue,
|
|
34
|
+
onChange: propOnChange,
|
|
35
|
+
className,
|
|
36
|
+
placeholder,
|
|
37
|
+
placeholderSearch = "Vyhledejte položku",
|
|
38
|
+
clearable = false,
|
|
39
|
+
options = [],
|
|
40
|
+
allowAddNew = false,
|
|
41
|
+
},
|
|
42
|
+
ref
|
|
43
|
+
) => {
|
|
44
|
+
const [open, setOpen] = React.useState(false);
|
|
45
|
+
const [value, setValue] = React.useState(propValue || "");
|
|
46
|
+
const [inputValue, setInputValue] = React.useState("");
|
|
47
|
+
const [frameworks, setFrameworks] = React.useState<IOptionItem[]>(options);
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
inputValue &&
|
|
51
|
-
!frameworks.some((f) => f.value === inputValue.toLowerCase())
|
|
52
|
-
) {
|
|
53
|
-
const newFramework = {
|
|
54
|
-
value: inputValue.toLowerCase(),
|
|
55
|
-
label: inputValue,
|
|
56
|
-
};
|
|
57
|
-
setFrameworks([...frameworks, newFramework]);
|
|
58
|
-
setValue(newFramework.value);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (propValue !== undefined) {
|
|
51
|
+
setValue(propValue);
|
|
59
52
|
}
|
|
60
|
-
}
|
|
61
|
-
setValue(currentValue === value ? "" : currentValue);
|
|
62
|
-
}
|
|
63
|
-
setOpen(false);
|
|
64
|
-
};
|
|
53
|
+
}, [propValue]);
|
|
65
54
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
setFrameworks(options);
|
|
57
|
+
}, [options]);
|
|
58
|
+
|
|
59
|
+
const handleSelect = (currentValue: string) => {
|
|
60
|
+
if (currentValue === "add-custom") {
|
|
61
|
+
if (
|
|
62
|
+
inputValue &&
|
|
63
|
+
!frameworks.some((f) => f.value === inputValue.toLowerCase())
|
|
64
|
+
) {
|
|
65
|
+
const newFramework = {
|
|
66
|
+
value: inputValue.toLowerCase(),
|
|
67
|
+
label: inputValue,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
setFrameworks([...frameworks, newFramework]);
|
|
71
|
+
updateValue(newFramework.value);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
updateValue(currentValue === value ? "" : currentValue);
|
|
75
|
+
}
|
|
76
|
+
setOpen(false);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const updateValue = (newValue: string) => {
|
|
80
|
+
setValue(newValue);
|
|
81
|
+
propOnChange?.(newValue || undefined);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleClear = (e: React.MouseEvent) => {
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
updateValue("");
|
|
87
|
+
setInputValue("");
|
|
88
|
+
setOpen(false);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
value;
|
|
92
|
+
return (
|
|
93
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
94
|
+
<div className="relative w-full">
|
|
95
|
+
<PopoverTrigger asChild>
|
|
96
|
+
<Button
|
|
97
|
+
ref={ref}
|
|
98
|
+
type="button"
|
|
99
|
+
variant="outline"
|
|
100
|
+
role="combobox"
|
|
101
|
+
aria-expanded={open}
|
|
102
|
+
className={cn("w-full justify-between", className)}
|
|
103
|
+
>
|
|
104
|
+
{value ? (
|
|
105
|
+
frameworks.find((framework) => framework.value === value)?.label
|
|
106
|
+
) : (
|
|
107
|
+
<div className="text-muted-foreground font-normal">
|
|
108
|
+
{placeholder}
|
|
109
|
+
</div>
|
|
110
|
+
)}
|
|
111
|
+
<ChevronsUpDown className="h-4 w-4 shrink-0 opacity-50 ml-6" />
|
|
112
|
+
</Button>
|
|
113
|
+
</PopoverTrigger>
|
|
114
|
+
{clearable && value && (
|
|
115
|
+
<Button
|
|
116
|
+
type="button"
|
|
117
|
+
variant="ghost"
|
|
118
|
+
size="sm"
|
|
119
|
+
className="absolute right-6 top-0 h-full px-3 py-2 hover:bg-transparent"
|
|
120
|
+
onClick={handleClear}
|
|
121
|
+
>
|
|
122
|
+
<X className="h-4 w-4 shrink-0 opacity-50 hover:opacity-100" />
|
|
123
|
+
</Button>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
<PopoverContent className="min-w-[200px] w-full p-0">
|
|
127
|
+
<Command>
|
|
128
|
+
<CommandInput
|
|
129
|
+
placeholder={placeholderSearch}
|
|
130
|
+
className="h-9"
|
|
131
|
+
value={inputValue}
|
|
132
|
+
onValueChange={setInputValue}
|
|
133
|
+
/>
|
|
134
|
+
<CommandList>
|
|
135
|
+
<CommandEmpty>
|
|
136
|
+
{allowAddNew && (
|
|
137
|
+
<Button
|
|
138
|
+
variant="ghost"
|
|
139
|
+
className="w-full justify-start"
|
|
140
|
+
onClick={() => handleSelect("add-custom")}
|
|
141
|
+
>
|
|
142
|
+
<Plus className="mr-2 h-4 w-4" />
|
|
143
|
+
Přidat "{inputValue}"
|
|
144
|
+
</Button>
|
|
145
|
+
)}
|
|
146
|
+
</CommandEmpty>
|
|
147
|
+
|
|
148
|
+
<CommandGroup>
|
|
149
|
+
{frameworks.map((framework) => (
|
|
150
|
+
<CommandItem
|
|
151
|
+
key={framework.value}
|
|
152
|
+
value={framework.value as string}
|
|
153
|
+
onSelect={handleSelect}
|
|
154
|
+
>
|
|
155
|
+
{framework.label}
|
|
156
|
+
<Check
|
|
157
|
+
className={cn(
|
|
158
|
+
"ml-auto h-4 w-4",
|
|
159
|
+
value === framework.value ? "opacity-100" : "opacity-0"
|
|
160
|
+
)}
|
|
161
|
+
/>
|
|
162
|
+
</CommandItem>
|
|
163
|
+
))}
|
|
164
|
+
</CommandGroup>
|
|
165
|
+
</CommandList>
|
|
166
|
+
</Command>
|
|
167
|
+
</PopoverContent>
|
|
168
|
+
</Popover>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
Combobox.displayName = "Combobox";
|
|
174
|
+
|
|
175
|
+
export default Combobox;
|