5htp-core 0.6.0-3 → 0.6.0-5

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.
@@ -101,15 +101,6 @@
101
101
  }
102
102
  }
103
103
 
104
- &.active {
105
-
106
- box-shadow: 0 0 0 3px @c1;
107
-
108
- > * {
109
- --cTxtImportant: @c1;
110
- }
111
- }
112
-
113
104
  /*----------------------------------
114
105
  - VARIANTS
115
106
  ----------------------------------*/
@@ -63,13 +63,14 @@
63
63
 
64
64
  .mantine-TextInput-input,
65
65
  .mantine-Input-input {
66
-
67
66
  border: solid 1px var(--cLine) !important;
67
+ }
68
68
 
69
- &:focus {
70
- border-color: @c1 !important;
71
- box-shadow: 0 0 0 4px fade(@c1, 20%) !important;
72
- }
69
+ .card.active,
70
+ .mantine-TextInput-input:focus,
71
+ .mantine-Input-input:focus {
72
+ border: solid 1px @c1 !important;
73
+ box-shadow: 0 0 0 4px fade(@c1, 20%) !important;
73
74
  }
74
75
 
75
76
  .mantine-MultiSelect-pill {
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+
3
+ import type { Choice } from '@client/components/Select';
4
+
5
+ const ConnectedInput = <TComponent extends React.ComponentType<any>>({
6
+ component: Component, data: dataInit, ...props
7
+ }: {
8
+ component: TComponent,
9
+ data?: Choice[] | ((search?: string) => Promise<Choice[]>),
10
+ } & Omit<React.ComponentProps<TComponent>, 'data' | 'onSearchChange'>) => {
11
+
12
+ const [data, setData] = React.useState<Choice[]>([]);
13
+ const [search, setSearch] = React.useState<string>('');
14
+
15
+ React.useEffect(() => {
16
+
17
+ if (!dataInit) return;
18
+ if (Array.isArray(dataInit))
19
+ setData(dataInit);
20
+ else
21
+ dataInit(search).then(setData);
22
+
23
+ }, [dataInit, search]);
24
+
25
+ return (
26
+ <Component
27
+ {...props}
28
+ data={data}
29
+ onSearchChange={setSearch}
30
+ />
31
+ )
32
+ }
33
+
34
+ export default ConnectedInput;
@@ -99,7 +99,7 @@ export default function Liste<TRow extends TDonneeInconnue>({
99
99
  <td>
100
100
  <Checkbox
101
101
  id={"selectionner" + iDonnee}
102
- value={selection.current.some(s => s.id === row.id)}
102
+ value={selection.current.some(s => s?.id === row?.id)}
103
103
  onChange={(isSelected: boolean) => {
104
104
  selection.set(current => isSelected
105
105
  // Ajoute
@@ -230,7 +230,7 @@ export default function Liste<TRow extends TDonneeInconnue>({
230
230
  <Checkbox
231
231
  value={selection.current.length >= rows.length}
232
232
  onChange={(status: boolean) => {
233
- selection.set(status ? rows : []);
233
+ selection.set(status ? rows.filter(r => r?.id) : []);
234
234
  }}
235
235
  />
236
236
  </th>
@@ -156,6 +156,8 @@ export default (props: Props) => {
156
156
  {React.cloneElement( children, {
157
157
  onClick: (e) => {
158
158
  show(isShown => !isShown);
159
+ e.stopPropagation();
160
+ return false;
159
161
  }
160
162
  })}
161
163
 
@@ -22,7 +22,9 @@ export { default as Date } from './Date';
22
22
  export { default as Select } from './Select';
23
23
  export { default as Checkbox } from './Checkbox';
24
24
  export { InputWrapper } from './utils';
25
- export { default as DropDown } from './DropDown';
25
+ export { default as DropDown } from './DropDown';
26
+
27
+ export { default as ConnectedInput } from './ConnectedInput';
26
28
 
27
29
  // Mantine
28
30
  export {
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-3",
4
+ "version": "0.6.0-5",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
package/types/icons.d.ts CHANGED
@@ -1 +1 @@
1
- export type TIcones = "solid/spinner-third"|"long-arrow-right"|"traffic-light-stop"|"times-circle"|"search"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"paper-plane"|"bookmark"|"download"|"times"|"angle-down"|"th-large"|"table"|"info-circle"|"check-circle"|"exclamation-circle"|"heart"|"bell"|"chart-bar"|"power-off"|"home"|"books"|"newspaper"|"box-full"|"planet-ringed"|"brands/linkedin"|"brands/twitter"|"brands/facebook"|"bars"|"rocket"|"database"|"brain"|"code"|"money-bill"|"check"|"at"|"image"|"key"|"seedling"|"palette"|"car"|"plane"|"university"|"briefcase"|"hard-hat"|"graduation-cap"|"bolt"|"cogs"|"film"|"leaf"|"tshirt"|"utensils"|"globe"|"map-marked-alt"|"dumbbell"|"stethoscope"|"concierge-bell"|"book"|"shield-alt"|"gavel"|"industry"|"square-root-alt"|"pills"|"medal"|"capsules"|"balance-scale"|"praying-hands"|"shopping-cart"|"flask"|"futbol"|"microchip"|"satellite-dish"|"shipping-fast"|"passport"|"tools"|"brands/google"|"brands/github"|"solid/heart"|"regular/heart"|"eye"|"trash"|"arrow-left"|"arrow-right"|"meh-rolling-eyes"|"link"|"file"|"unlink"|"pen"|"bold"|"italic"|"underline"|"strikethrough"|"subscript"|"superscript"|"font"|"empty-set"|"plus-circle"|"horizontal-rule"|"page-break"|"poll"|"columns"|"sticky-note"|"caret-right"|"plus"|"align-left"|"align-center"|"align-right"|"align-justify"|"indent"|"outdent"|"list-ul"|"check-square"|"h1"|"h2"|"h3"|"h4"|"list-ol"|"paragraph"|"quote-left"
1
+ export type TIcones = "times"|"solid/spinner-third"|"long-arrow-right"|"sack-dollar"|"bell"|"bullseye"|"project-diagram"|"user-friends"|"eye"|"lock"|"comments"|"phone"|"chalkboard-teacher"|"rocket"|"planet-ringed"|"brands/linkedin"|"user-circle"|"crosshairs"|"plus-circle"|"comments-alt"|"arrow-right"|"chart-bar"|"user-shield"|"shield-alt"|"chart-line"|"money-bill-wave"|"star"|"link"|"file-alt"|"long-arrow-left"|"calendar-alt"|"paper-plane"|"at"|"search"|"lightbulb"|"magnet"|"key"|"user"|"binoculars"|"times-circle"|"user-plus"|"mouse-pointer"|"thumbs-up"|"dollar-sign"|"angle-up"|"angle-down"|"solid/crown"|"brands/discord"|"pen"|"plus"|"file"|"envelope"|"info-circle"|"check-circle"|"exclamation-circle"|"check"|"arrow-left"|"meh-rolling-eyes"|"bars"|"trash"|"solid/star"|"solid/star-half-alt"|"regular/star"|"chevron-left"|"cog"|"power-off"|"question-circle"|"play"|"minus-circle"|"external-link"|"plane-departure"|"brands/whatsapp"|"wind"|"usd-circle"|"users"|"home"|"home-alt"|"trophy"|"map-marker-alt"|"clock"|"arrow-to-bottom"|"ellipsis-h"|"exclamation-triangle"|"industry"|"map-marker"|"calendar"|"briefcase"|"fire"|"globe"|"solid/magic"|"magic"|"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"