5htp-core 0.6.0-7 → 0.6.0-72
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.
|
@@ -61,8 +61,8 @@ export default (initProps: Props) => {
|
|
|
61
61
|
props.min = props.min ?? 0;
|
|
62
62
|
} else if (props.type === 'longtext' && typeof document !== 'undefined') {
|
|
63
63
|
Component = Textarea;
|
|
64
|
-
props.autosize = true;
|
|
65
|
-
props.minRows = 2;
|
|
64
|
+
props.autosize = props.autosize || true;
|
|
65
|
+
props.minRows = props.minRows || 2;
|
|
66
66
|
} else {
|
|
67
67
|
Component = TextInput;
|
|
68
68
|
}
|
|
@@ -22,7 +22,8 @@ import Popover, { Props as PopoverProps } from '@client/components/containers/Po
|
|
|
22
22
|
----------------------------------*/
|
|
23
23
|
|
|
24
24
|
export type Props = SelectProps & InputBaseProps<ComboboxItem> & {
|
|
25
|
-
popoverProps?: PopoverProps
|
|
25
|
+
popoverProps?: PopoverProps,
|
|
26
|
+
buttonProps?: ButtonProps,
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export type Choice = ComboboxItem;
|
|
@@ -63,7 +64,7 @@ export default (initProps: Props) => {
|
|
|
63
64
|
onChange, value: current,
|
|
64
65
|
required
|
|
65
66
|
}, {
|
|
66
|
-
multiple, choices: initChoices, enableSearch, popoverProps,
|
|
67
|
+
multiple, choices: initChoices, enableSearch, popoverProps, buttonProps,
|
|
67
68
|
...props
|
|
68
69
|
}] = useMantineInput<Props, string|number>(initProps);
|
|
69
70
|
|
|
@@ -95,7 +96,8 @@ export default (initProps: Props) => {
|
|
|
95
96
|
/*----------------------------------
|
|
96
97
|
- ACTIONS
|
|
97
98
|
----------------------------------*/
|
|
98
|
-
|
|
99
|
+
|
|
100
|
+
// Load search results
|
|
99
101
|
React.useEffect(() => {
|
|
100
102
|
|
|
101
103
|
if (choicesViaFunc && opened) {
|
|
@@ -113,12 +115,16 @@ export default (initProps: Props) => {
|
|
|
113
115
|
|
|
114
116
|
}, [
|
|
115
117
|
opened,
|
|
116
|
-
search.keywords
|
|
117
|
-
// When initChoices is a function, React considers it's always different
|
|
118
|
-
// It avoids the choices are fetched everytimle the parent component is re-rendered
|
|
119
|
-
typeof initChoices === 'function' ? true : initChoices
|
|
118
|
+
search.keywords
|
|
120
119
|
]);
|
|
121
120
|
|
|
121
|
+
// When initChoices is not a function and has changed
|
|
122
|
+
React.useEffect(() => {
|
|
123
|
+
if (!choicesViaFunc) {
|
|
124
|
+
setChoices(initChoices);
|
|
125
|
+
}
|
|
126
|
+
}, [initChoices]);
|
|
127
|
+
|
|
122
128
|
/*----------------------------------
|
|
123
129
|
- RENDER
|
|
124
130
|
----------------------------------*/
|
|
@@ -189,6 +195,7 @@ export default (initProps: Props) => {
|
|
|
189
195
|
</div>
|
|
190
196
|
)}>
|
|
191
197
|
<Button
|
|
198
|
+
{...buttonProps}
|
|
192
199
|
prefix={(
|
|
193
200
|
(multiple && current?.length) ? (
|
|
194
201
|
<span class="badge bg info s">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp-core",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "0.6.0-
|
|
4
|
+
"version": "0.6.0-72",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-core.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,9 +34,9 @@ export default class Facet<
|
|
|
34
34
|
|
|
35
35
|
public findFirst(
|
|
36
36
|
...args: Parameters<S>
|
|
37
|
-
): Promise<R> {
|
|
37
|
+
): Promise<R | null> {
|
|
38
38
|
return this.delegate
|
|
39
39
|
.findFirst(this.subset(...args))
|
|
40
|
-
.then(this.transform)
|
|
40
|
+
.then(result => result ? this.transform(result) : null)
|
|
41
41
|
}
|
|
42
42
|
}
|
package/types/global/utils.d.ts
CHANGED
package/types/icons.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TIcones = "times"|"solid/spinner-third"|"
|
|
1
|
+
export type TIcones = "long-arrow-right"|"times"|"solid/spinner-third"|"sack-dollar"|"bell"|"bullseye"|"project-diagram"|"user-friends"|"eye"|"lock"|"comments"|"phone"|"chalkboard-teacher"|"rocket"|"chart-bar"|"planet-ringed"|"brands/linkedin"|"user-circle"|"crosshairs"|"arrow-right"|"plus-circle"|"comments-alt"|"user-shield"|"shield-alt"|"chart-line"|"money-bill-wave"|"star"|"link"|"file-alt"|"long-arrow-left"|"user-plus"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"key"|"user"|"at"|"magnet"|"paper-plane"|"plus"|"binoculars"|"times-circle"|"calendar-alt"|"search"|"lightbulb"|"angle-up"|"angle-down"|"solid/crown"|"brands/discord"|"pen"|"file"|"envelope"|"coins"|"angle-right"|"download"|"info-circle"|"check-circle"|"exclamation-circle"|"check"|"arrow-left"|"meh-rolling-eyes"|"trash"|"solid/star"|"solid/star-half-alt"|"regular/star"|"chevron-left"|"cog"|"power-off"|"users"|"bug"|"bars"|"question-circle"|"plane-departure"|"brands/whatsapp"|"wind"|"external-link"|"play"|"minus-circle"|"broom"|"exclamation-triangle"|"solid/check-circle"|"solid/exclamation-triangle"|"solid/times-circle"|"minus"|"clock"|"ellipsis-h"|"map-marker-alt"|"arrow-to-bottom"|"solid/magic"|"briefcase"|"map-marker"|"fire"|"globe"|"industry"|"calendar"|"magic"|"coin"|"building"|"graduation-cap"|"unlink"|"bold"|"italic"|"underline"|"strikethrough"|"subscript"|"superscript"|"code"|"font"|"empty-set"|"horizontal-rule"|"page-break"|"image"|"table"|"poll"|"columns"|"sticky-note"|"caret-right"|"align-left"|"align-center"|"align-right"|"align-justify"|"indent"|"outdent"|"list-ul"|"check-square"|"h1"|"h2"|"h3"|"h4"|"list-ol"|"paragraph"|"quote-left"
|