5htp-core 0.4.2 → 0.4.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.
- package/package.json +4 -12
- package/src/client/app/component.tsx +11 -2
- package/src/client/assets/css/components/button.less +10 -10
- package/src/client/assets/css/components/other.less +0 -1
- package/src/client/assets/css/core.less +0 -4
- package/src/client/assets/css/text/text.less +1 -2
- package/src/client/assets/css/text/titres.less +0 -5
- package/src/client/assets/css/utils/layouts.less +5 -5
- package/src/client/assets/css/utils/sizing.less +6 -6
- package/src/client/components/Dialog/card.tsx +1 -1
- package/src/client/components/button.tsx +1 -1
- package/src/client/components/containers/Popover/index.tsx +2 -2
- package/src/client/components/index.ts +5 -16
- package/src/client/components/inputv3/index.tsx +2 -5
- package/src/client/services/router/components/Page.tsx +1 -2
- package/src/client/services/router/components/router.tsx +4 -8
- package/src/client/services/router/request/api.ts +31 -52
- package/src/client/services/router/response/index.tsx +2 -0
- package/src/common/data/dates.ts +50 -6
- package/src/common/router/layouts.ts +14 -5
- package/src/common/router/response/page.ts +12 -6
- package/src/common/validation/validators.ts +0 -4
- package/src/server/app/container/config.ts +2 -1
- package/src/server/services/router/http/index.ts +16 -22
- package/src/server/services/router/response/page/index.tsx +0 -0
- package/src/client/assets/fonts/Inter/index.less +0 -77
- package/src/client/assets/fonts/Inter/latin-500.woff2 +0 -0
- package/src/client/assets/fonts/Inter/latin-600.woff2 +0 -0
- package/src/client/assets/fonts/Inter/latin-800.woff2 +0 -0
- package/src/client/assets/fonts/Inter/latin-ext-500.woff2 +0 -0
- package/src/client/assets/fonts/Inter/latin-ext-600.woff2 +0 -0
- package/src/client/assets/fonts/Inter/latin-ext-800.woff2 +0 -0
- package/src/client/assets/fonts/Rubik/cyrillic-ext.woff2 +0 -0
- package/src/client/assets/fonts/Rubik/cyrillic.woff2 +0 -0
- package/src/client/assets/fonts/Rubik/hebrew.woff2 +0 -0
- package/src/client/assets/fonts/Rubik/index.less +0 -30
- package/src/client/assets/fonts/Rubik/latin-ext.woff2 +0 -0
- package/src/client/assets/fonts/Rubik/latin.woff2 +0 -0
- package/src/client/components/Amount.tsx +0 -38
- package/src/client/components/Form_old/index.tsx +0 -450
- package/src/client/components/Form_old/index.tsx.old +0 -436
- package/src/client/components/dropdown.old/Manager.tsx +0 -164
- package/src/client/components/dropdown.old/getPosition.ts +0 -137
- package/src/client/components/dropdown.old/index.tsx +0 -99
- package/src/client/components/dropdown.old/popover.less +0 -56
- package/src/client/components/input/Base/Choix.ts +0 -48
- package/src/client/components/input/Base/index.tsx +0 -432
- package/src/client/components/input/BaseV2/index.tsx +0 -72
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
export type TSide = "left"|"top"|"right"|"bottom";
|
|
2
|
-
|
|
3
|
-
export type TPosition = {
|
|
4
|
-
css: {
|
|
5
|
-
top: string,
|
|
6
|
-
left: string,
|
|
7
|
-
},
|
|
8
|
-
cote: TSide
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const debug = true;
|
|
12
|
-
|
|
13
|
-
export default function corrigerPosition(
|
|
14
|
-
conteneur: HTMLElement,
|
|
15
|
-
popover: HTMLElement | [initialWidth: number, initialHeight: number], // NULL when the popover is not shown for now
|
|
16
|
-
cote: TSide = "bottom",
|
|
17
|
-
frame?: HTMLElement
|
|
18
|
-
): TPosition {
|
|
19
|
-
// RAPPEL: L'élement sera positionnée relativement à son conteneur
|
|
20
|
-
// Tous les calculs ici donnent donc des valeurs relatives au conteneur
|
|
21
|
-
|
|
22
|
-
const margeX = 5;
|
|
23
|
-
const margeY = 5;
|
|
24
|
-
|
|
25
|
-
const dimsPop = Array.isArray(popover)
|
|
26
|
-
? {
|
|
27
|
-
width: popover[0],
|
|
28
|
-
height: popover[1]
|
|
29
|
-
}
|
|
30
|
-
: {
|
|
31
|
-
width: popover.offsetWidth,
|
|
32
|
-
height: popover.offsetHeight
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
debug && console.log(`[positionnement] Conteneur =`, conteneur, `Popover =`, popover, `Coté =`, cote);
|
|
36
|
-
|
|
37
|
-
if (dimsPop.width === undefined || dimsPop.height === undefined)
|
|
38
|
-
console.error(`Impossible de récupérer les dimensions de la popover. popover est-il réelement n élement html, ou alors un composant react ? | dimsPop =`, dimsPop, 'popover =', popover);
|
|
39
|
-
|
|
40
|
-
/*----------------------------------
|
|
41
|
-
- POSITIONNEMENT INITIAL
|
|
42
|
-
----------------------------------*/
|
|
43
|
-
|
|
44
|
-
// Position & dimensions des élements
|
|
45
|
-
const posCont = conteneur.getBoundingClientRect();
|
|
46
|
-
let posInit = {
|
|
47
|
-
top: posCont.top,
|
|
48
|
-
left: posCont.left
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Placement
|
|
52
|
-
switch (cote) {
|
|
53
|
-
case 'top':
|
|
54
|
-
posInit.top += -dimsPop.height - margeY;
|
|
55
|
-
posInit.left += posCont.width / 2 - dimsPop.width / 2;
|
|
56
|
-
break;
|
|
57
|
-
case 'bottom':
|
|
58
|
-
posInit.top += posCont.height + margeY;
|
|
59
|
-
posInit.left += posCont.width / 2 - dimsPop.width / 2;
|
|
60
|
-
break;
|
|
61
|
-
case 'left':
|
|
62
|
-
posInit.left += -dimsPop.width - margeX;
|
|
63
|
-
posInit.top += posCont.height / 2 - dimsPop.height / 2;
|
|
64
|
-
break;
|
|
65
|
-
case 'right':
|
|
66
|
-
posInit.left += posCont.width + margeX;
|
|
67
|
-
posInit.top += posCont.height / 2 - dimsPop.height / 2;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/*----------------------------------
|
|
72
|
-
- CORRECTION
|
|
73
|
-
----------------------------------*/
|
|
74
|
-
let frontieres;
|
|
75
|
-
if (frame) { // Via conteneur spécifique
|
|
76
|
-
const posFrame = frame.getBoundingClientRect();
|
|
77
|
-
frontieres = {
|
|
78
|
-
top: Math.max(posFrame.top , 0) + margeY,
|
|
79
|
-
left: Math.max(posFrame.left, 0) + margeX,
|
|
80
|
-
right: Math.min(posFrame.right, window.innerWidth) - margeX,
|
|
81
|
-
bottom: Math.min(posFrame.bottom, window.innerHeight) - margeY
|
|
82
|
-
}
|
|
83
|
-
} else // Via fenêtre
|
|
84
|
-
frontieres = {
|
|
85
|
-
top: margeY,
|
|
86
|
-
left: margeX,
|
|
87
|
-
right: window.innerWidth - margeX,
|
|
88
|
-
bottom: window.innerHeight - margeY
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Position finale de la popover
|
|
92
|
-
let posFinale: {
|
|
93
|
-
top: number,
|
|
94
|
-
left: number
|
|
95
|
-
} = {
|
|
96
|
-
top: 0,
|
|
97
|
-
left: 0,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
debug && console.log(`[positionnement] Position initiale =`, posInit, `Frontières =`, frame, '=', frontieres);
|
|
101
|
-
|
|
102
|
-
// Extrémité Haut
|
|
103
|
-
if (posInit.top < frontieres.top) {
|
|
104
|
-
posFinale.top = frontieres.top;
|
|
105
|
-
debug && console.log(`[positionnement] Top: Extremité haut`, posFinale.top);
|
|
106
|
-
// Extrémité Bas
|
|
107
|
-
} else if (posInit.top + dimsPop.height >= frontieres.bottom) {
|
|
108
|
-
posFinale.top = (frontieres.bottom - dimsPop.height);
|
|
109
|
-
debug && console.log(`[positionnement] Top: Extremité bas`, posFinale.top);
|
|
110
|
-
} else {
|
|
111
|
-
posFinale.top = posInit.top;
|
|
112
|
-
debug && console.log(`[positionnement] Top: Conservation`, posFinale.top);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Extrémité Gauche
|
|
116
|
-
if (posInit.left < frontieres.left) {
|
|
117
|
-
posFinale.left = frontieres.left;
|
|
118
|
-
debug && console.log(`[positionnement] Left: Extremité gauche`, posFinale.left);
|
|
119
|
-
// Extrémité Droite
|
|
120
|
-
} else if (posInit.left + dimsPop.width >= frontieres.right) {
|
|
121
|
-
posFinale.left = (frontieres.right - dimsPop.width);
|
|
122
|
-
debug && console.log(`[positionnement] Left: Extremité droite`, posFinale.left);
|
|
123
|
-
} else {
|
|
124
|
-
posFinale.left = posInit.left;
|
|
125
|
-
debug && console.log(`[positionnement] Left: Conservation`, posFinale.left);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
debug && console.log({ posInit, dimsPop, frontieres }, { posFinale });
|
|
129
|
-
|
|
130
|
-
return {
|
|
131
|
-
css: {
|
|
132
|
-
left: (posFinale.left + window.pageXOffset) + 'px',
|
|
133
|
-
top: (posFinale.top + window.pageYOffset) + 'px',
|
|
134
|
-
},
|
|
135
|
-
cote: cote
|
|
136
|
-
};
|
|
137
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*----------------------------------
|
|
2
|
-
- DEPENDANCES
|
|
3
|
-
----------------------------------*/
|
|
4
|
-
|
|
5
|
-
// Npm
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { ComponentChild } from 'preact';
|
|
8
|
-
|
|
9
|
-
// Core
|
|
10
|
-
import Button, { Props as ButtonProps } from '../button';
|
|
11
|
-
|
|
12
|
-
// Libs
|
|
13
|
-
import { TPopover, PopoverProps } from './Manager';
|
|
14
|
-
import useContexte from '@client/context';
|
|
15
|
-
|
|
16
|
-
/*----------------------------------
|
|
17
|
-
- TYPES
|
|
18
|
-
----------------------------------*/
|
|
19
|
-
|
|
20
|
-
export type Props = ButtonProps & PopoverProps
|
|
21
|
-
|
|
22
|
-
export type TAction<TDonnee> = {
|
|
23
|
-
icone?: TIcons,
|
|
24
|
-
label: ComponentChild,
|
|
25
|
-
multi?: boolean,
|
|
26
|
-
|
|
27
|
-
onClick?: (donnees: TDonnee, index: number) => void,
|
|
28
|
-
lien?: (donnees: TDonnee, index: number) => string,
|
|
29
|
-
bouton?: (donnees: TDonnee, index: number) => ButtonProps
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type TActionsPopover = {
|
|
33
|
-
show: () => void,
|
|
34
|
-
hide: () => void,
|
|
35
|
-
toggle: () => void
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/*----------------------------------
|
|
39
|
-
- CONTROLEUR
|
|
40
|
-
----------------------------------*/
|
|
41
|
-
import "./popover.less";
|
|
42
|
-
export default (props: Props) => {
|
|
43
|
-
|
|
44
|
-
const ctx = useContexte();
|
|
45
|
-
|
|
46
|
-
let {
|
|
47
|
-
|
|
48
|
-
position,
|
|
49
|
-
frame,
|
|
50
|
-
content,
|
|
51
|
-
interactions,
|
|
52
|
-
|
|
53
|
-
...buttonProps
|
|
54
|
-
} = props;
|
|
55
|
-
|
|
56
|
-
const [visible, setVisible] = React.useState(false);
|
|
57
|
-
|
|
58
|
-
const toggle = () => {
|
|
59
|
-
|
|
60
|
-
if (!refButton.current)
|
|
61
|
-
return console.error("Unable to access to the button element");
|
|
62
|
-
|
|
63
|
-
/*if (refPopover.current)
|
|
64
|
-
refPopover.current.toggle();
|
|
65
|
-
else*/
|
|
66
|
-
if (!visible)
|
|
67
|
-
refPopover.current = ctx.popover({
|
|
68
|
-
origin: refButton.current,
|
|
69
|
-
content,
|
|
70
|
-
onVisibilityChange: setVisible,
|
|
71
|
-
position,
|
|
72
|
-
frame,
|
|
73
|
-
interactions
|
|
74
|
-
});
|
|
75
|
-
else
|
|
76
|
-
refPopover.current.close();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const refButton = React.useRef<HTMLElement>(null);
|
|
80
|
-
const refPopover = React.useRef<TPopover>(null);
|
|
81
|
-
|
|
82
|
-
let classe = buttonProps.class === undefined
|
|
83
|
-
? "dropdown"
|
|
84
|
-
: buttonProps.class + " dropdown";
|
|
85
|
-
|
|
86
|
-
if (!props.immutable) {
|
|
87
|
-
|
|
88
|
-
if (visible)
|
|
89
|
-
classe += ' selected';
|
|
90
|
-
|
|
91
|
-
if (buttonProps.children !== undefined && buttonProps.icon === undefined && buttonProps.iconR === undefined)
|
|
92
|
-
buttonProps.iconR = /* @icon */"chevron-down";
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<Button {...buttonProps} class={classe} onClick={toggle} refElem={refButton} />
|
|
98
|
-
)
|
|
99
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// La popover étant positionnée de manière relative à son conteneur,
|
|
2
|
-
// contPopover doit envelopper le bouton sans aucun espace
|
|
3
|
-
.contPopover {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
|
|
6
|
-
// Evite les dépassements à droite en en bas de la page
|
|
7
|
-
// Donc les espaces blancs et scrollbar inutiles
|
|
8
|
-
.popover {
|
|
9
|
-
top: -10000px;
|
|
10
|
-
left: -10000px;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.popover.card,
|
|
15
|
-
.bulle.card {
|
|
16
|
-
|
|
17
|
-
list-style: none;
|
|
18
|
-
text-align: left;
|
|
19
|
-
line-height: 2rem;
|
|
20
|
-
|
|
21
|
-
top: 100%;
|
|
22
|
-
max-height: 40rem;
|
|
23
|
-
|
|
24
|
-
// Doit être géré avec les classes w-<min>-<max>
|
|
25
|
-
/*min-width: 200px;
|
|
26
|
-
max-width: 50vw;*/
|
|
27
|
-
|
|
28
|
-
position: absolute;
|
|
29
|
-
z-index: 100;
|
|
30
|
-
|
|
31
|
-
transition: transform 0.2s cubic-bezier(0.75, -0.02, 0.2, 0.97), opacity 0.2s cubic-bezier(0.75, -0.02, 0.2, 0.97);
|
|
32
|
-
|
|
33
|
-
box-shadow: 0 25px 50px fade(#000, 10%);
|
|
34
|
-
|
|
35
|
-
> header {
|
|
36
|
-
position: sticky;
|
|
37
|
-
z-index: 1;
|
|
38
|
-
top: -@spacing;
|
|
39
|
-
|
|
40
|
-
margin-bottom: @spacing;
|
|
41
|
-
backdrop-filter: blur(0.80rem);
|
|
42
|
-
background: fade(#fff, 70%);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&.gris > header {
|
|
46
|
-
background: fade(#eee, 70%);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.contPopover.active > .popover,
|
|
51
|
-
.contPopover.active > .popover + .pointeur,
|
|
52
|
-
.popover li:hover > .popover.onHover {
|
|
53
|
-
opacity: 1;
|
|
54
|
-
visibility: visible;
|
|
55
|
-
transform: translate(0, 0px);
|
|
56
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ComponentChild } from 'preact';
|
|
2
|
-
import { Props as TPropsBouton } from '@client/components/button';
|
|
3
|
-
|
|
4
|
-
export type ChoixTbl = string | {[cle: string]: any};
|
|
5
|
-
export type Choix = ChoixTbl[] | {[label: string]: string | number | undefined};
|
|
6
|
-
|
|
7
|
-
export type Option = Partial<TPropsBouton> & {
|
|
8
|
-
icone?: ComponentChild,
|
|
9
|
-
label?: ComponentChild,
|
|
10
|
-
value: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Normalise les choix pour Select ou Radio
|
|
14
|
-
export default ( choix: Choix ) => {
|
|
15
|
-
|
|
16
|
-
// Création des options
|
|
17
|
-
let options: Option[] = [];
|
|
18
|
-
|
|
19
|
-
// Tableau de chaines, ou d'objects d'option
|
|
20
|
-
if (Array.isArray(choix)) {
|
|
21
|
-
|
|
22
|
-
options = choix.map(( elem: ChoixTbl ): Option => {
|
|
23
|
-
|
|
24
|
-
// Tableau de chaines
|
|
25
|
-
if (typeof elem === 'string')
|
|
26
|
-
return {
|
|
27
|
-
label: elem,
|
|
28
|
-
value: elem
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Tableau options déjà formatté: { label: xxx, value: xxx }
|
|
32
|
-
else if (!elem.label && !elem.icone)
|
|
33
|
-
throw new Error(`Une icone ou un label doit être défini pour chaque option.`);
|
|
34
|
-
else
|
|
35
|
-
return elem as Option;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Label via index
|
|
39
|
-
} else {
|
|
40
|
-
for (const cle in choix)
|
|
41
|
-
options.push({
|
|
42
|
-
label: cle,
|
|
43
|
-
value: choix[cle] as string
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return options;
|
|
48
|
-
}
|