@poadio/ui-elements 0.5.0 → 0.7.0
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/CHANGELOG.md +58 -0
- package/dist/app-shell.d.ts +34 -0
- package/dist/app-shell.d.ts.map +1 -0
- package/dist/app-shell.js +112 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/bottom-nav.d.ts +79 -0
- package/dist/bottom-nav.d.ts.map +1 -0
- package/dist/bottom-nav.js +86 -0
- package/dist/bottom-nav.js.map +1 -0
- package/dist/breakpoint.d.ts +47 -0
- package/dist/breakpoint.d.ts.map +1 -0
- package/dist/breakpoint.js +74 -0
- package/dist/breakpoint.js.map +1 -0
- package/dist/dataview.d.ts +114 -0
- package/dist/dataview.d.ts.map +1 -0
- package/dist/dataview.js +75 -0
- package/dist/dataview.js.map +1 -0
- package/dist/floating.d.ts +1 -0
- package/dist/floating.d.ts.map +1 -1
- package/dist/floating.js +3 -18
- package/dist/floating.js.map +1 -1
- package/dist/index.d.ts +32 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +262 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +137 -0
- package/dist/layout.js.map +1 -0
- package/dist/menubar.d.ts +96 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +326 -0
- package/dist/menubar.js.map +1 -0
- package/dist/nav-drawer.d.ts +141 -0
- package/dist/nav-drawer.d.ts.map +1 -0
- package/dist/nav-drawer.js +204 -0
- package/dist/nav-drawer.js.map +1 -0
- package/dist/table.d.ts +83 -5
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +134 -31
- package/dist/table.js.map +1 -1
- package/package.json +2 -2
- package/src/app-shell.ts +101 -0
- package/src/bottom-nav.ts +126 -0
- package/src/breakpoint.ts +84 -0
- package/src/dataview.ts +143 -0
- package/src/floating.ts +4 -19
- package/src/index.ts +23 -3
- package/src/layout.ts +272 -0
- package/src/menubar.ts +316 -0
- package/src/nav-drawer.ts +256 -0
- package/src/table.ts +170 -32
package/dist/layout.d.ts
ADDED
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <poad-stack gap="sm">…</poad-stack> pile verticale
|
|
3
|
+
* <poad-cluster justify="between">…</poad-cluster> groupe horizontal qui replie
|
|
4
|
+
* <poad-grid cols="1 sm:2 lg:4"><div poad-col="full">…</div>…</poad-grid>
|
|
5
|
+
* <poad-split ratio="2fr 1fr" stack-at="md">…</poad-split> deux zones
|
|
6
|
+
* <poad-sidebar collapse-at="md"><main>…</main><aside slot="panel">…</aside></poad-sidebar>
|
|
7
|
+
* <poad-center max-width="60ch">…</poad-center> <poad-container size="lg">…</poad-container> <poad-spacer></poad-spacer>
|
|
8
|
+
*
|
|
9
|
+
* Mise en page : l'hôte ne dessine rien (`display: contents`) ; il rend une `<div>` aux classes de
|
|
10
|
+
* `@poadio/ui-core/layout.css` et aux styles en ligne du module `layout` d'ui-core, qui contient les enfants de la page —
|
|
11
|
+
* même DOM que les composants de mise en page d'ui-angular. Grille : un enfant qui porte `poad-col` reçoit son
|
|
12
|
+
* `grid-column` ; panneau latéral : l'enfant `slot="panel"` reçoit la classe `poad-sidebar__panel`. Les valeurs
|
|
13
|
+
* responsive et les seuils suivent le point de rupture de la fenêtre (1280 px, `xl`, sans fenêtre).
|
|
14
|
+
*/
|
|
15
|
+
import { type Breakpoint, type LayoutAlign, type LayoutContainerSize, type LayoutGap, type LayoutJustify } from '@poadio/ui-core';
|
|
16
|
+
import { PoadElement } from './element.js';
|
|
17
|
+
/** Pièce de mise en page ; `responsive` : redessinée quand la fenêtre change de taille. */
|
|
18
|
+
declare abstract class PoadLayoutElement extends PoadElement {
|
|
19
|
+
protected static responsive: boolean;
|
|
20
|
+
private stop;
|
|
21
|
+
/** Point de rupture courant de la fenêtre. */
|
|
22
|
+
protected get bp(): Breakpoint;
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
disconnectedCallback(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Pile verticale : les enfants s'empilent avec un écart uniforme (jamais de marges).
|
|
28
|
+
* @slot default Les enfants empilés.
|
|
29
|
+
*/
|
|
30
|
+
export declare class PoadStackElement extends PoadLayoutElement {
|
|
31
|
+
static props: {
|
|
32
|
+
readonly gap: "string";
|
|
33
|
+
readonly align: "string";
|
|
34
|
+
readonly justify: "string";
|
|
35
|
+
readonly inline: "boolean";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Écart entre les enfants : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
39
|
+
* @default 'md'
|
|
40
|
+
*/
|
|
41
|
+
gap?: LayoutGap;
|
|
42
|
+
/**
|
|
43
|
+
* Alignement des enfants sur l'axe horizontal.
|
|
44
|
+
* @default 'stretch'
|
|
45
|
+
*/
|
|
46
|
+
align?: LayoutAlign;
|
|
47
|
+
/**
|
|
48
|
+
* Répartition des enfants sur l'axe vertical.
|
|
49
|
+
* @default 'start'
|
|
50
|
+
*/
|
|
51
|
+
justify?: LayoutJustify;
|
|
52
|
+
/** En ligne (`inline-flex`) plutôt qu'en bloc. */
|
|
53
|
+
inline?: boolean;
|
|
54
|
+
protected render(): import("./dom.js").VNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Groupe horizontal qui replie (boutons, puces, méta).
|
|
58
|
+
* @slot default Les enfants du groupe.
|
|
59
|
+
*/
|
|
60
|
+
export declare class PoadClusterElement extends PoadLayoutElement {
|
|
61
|
+
static props: {
|
|
62
|
+
readonly gap: "string";
|
|
63
|
+
readonly align: "string";
|
|
64
|
+
readonly justify: "string";
|
|
65
|
+
readonly wrap: "boolean";
|
|
66
|
+
readonly inline: "boolean";
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Écart entre les enfants : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
70
|
+
* @default 'sm'
|
|
71
|
+
*/
|
|
72
|
+
gap?: LayoutGap;
|
|
73
|
+
/**
|
|
74
|
+
* Alignement des enfants sur l'axe vertical.
|
|
75
|
+
* @default 'center'
|
|
76
|
+
*/
|
|
77
|
+
align?: LayoutAlign;
|
|
78
|
+
/**
|
|
79
|
+
* Répartition des enfants sur l'axe horizontal.
|
|
80
|
+
* @default 'start'
|
|
81
|
+
*/
|
|
82
|
+
justify?: LayoutJustify;
|
|
83
|
+
/**
|
|
84
|
+
* Passe à la ligne quand la place manque (`wrap="false"` : jamais).
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
wrap?: boolean;
|
|
88
|
+
/** En ligne (`inline-flex`) plutôt qu'en bloc. */
|
|
89
|
+
inline?: boolean;
|
|
90
|
+
protected render(): import("./dom.js").VNode;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Grille responsive (points de rupture de la fenêtre) ou « auto-fit » (`min`, largeur du conteneur).
|
|
94
|
+
* @slot default Les cellules ; `poad-col="2"` / `"1 md:2"` / `"full"` sur un enfant pour en occuper plusieurs.
|
|
95
|
+
*/
|
|
96
|
+
export declare class PoadGridElement extends PoadLayoutElement {
|
|
97
|
+
protected static responsive: boolean;
|
|
98
|
+
static props: {
|
|
99
|
+
readonly cols: "string";
|
|
100
|
+
readonly min: "string";
|
|
101
|
+
readonly gap: "string";
|
|
102
|
+
readonly rowGap: "string";
|
|
103
|
+
readonly align: "string";
|
|
104
|
+
readonly dense: "boolean";
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Nombre de colonnes, responsive au point de rupture de la fenêtre : `"1 sm:2 lg:4"`.
|
|
108
|
+
* @default '1'
|
|
109
|
+
*/
|
|
110
|
+
cols?: string;
|
|
111
|
+
/** Largeur minimale d'une colonne : grille « auto-fit » à la largeur du conteneur (`cols` ignoré). */
|
|
112
|
+
min?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Écart entre les cellules : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
115
|
+
* @default 'md'
|
|
116
|
+
*/
|
|
117
|
+
gap?: LayoutGap;
|
|
118
|
+
/** Écart entre les lignes, s'il diffère de `gap`. */
|
|
119
|
+
rowGap?: LayoutGap;
|
|
120
|
+
/**
|
|
121
|
+
* Alignement vertical des cellules.
|
|
122
|
+
* @default 'stretch'
|
|
123
|
+
*/
|
|
124
|
+
align?: LayoutAlign;
|
|
125
|
+
/** Remplissage « dense » : les cellules suivantes comblent les trous. */
|
|
126
|
+
dense?: boolean;
|
|
127
|
+
protected render(): import("./dom.js").VNode;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Deux zones côte à côte, empilées sous `stackAt`.
|
|
131
|
+
* @slot default Les deux zones.
|
|
132
|
+
*/
|
|
133
|
+
export declare class PoadSplitElement extends PoadLayoutElement {
|
|
134
|
+
protected static responsive: boolean;
|
|
135
|
+
static props: {
|
|
136
|
+
readonly ratio: "string";
|
|
137
|
+
readonly gap: "string";
|
|
138
|
+
readonly align: "string";
|
|
139
|
+
readonly stackAt: "string";
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Gabarit des deux colonnes (`grid-template-columns`).
|
|
143
|
+
* @default '1fr 1fr'
|
|
144
|
+
*/
|
|
145
|
+
ratio?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Écart entre les zones : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
148
|
+
* @default 'md'
|
|
149
|
+
*/
|
|
150
|
+
gap?: LayoutGap;
|
|
151
|
+
/**
|
|
152
|
+
* Alignement vertical des zones.
|
|
153
|
+
* @default 'stretch'
|
|
154
|
+
*/
|
|
155
|
+
align?: LayoutAlign;
|
|
156
|
+
/**
|
|
157
|
+
* En dessous de ce point de rupture de la fenêtre, une seule colonne (`stack-at=""` : jamais).
|
|
158
|
+
* @default 'sm'
|
|
159
|
+
*/
|
|
160
|
+
stackAt?: Breakpoint | '';
|
|
161
|
+
protected render(): import("./dom.js").VNode;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Contenu et panneau latéral : le panneau (`slot="panel"`) garde sa largeur, passe dessous faute de place.
|
|
165
|
+
* @slot default Le contenu.
|
|
166
|
+
* @slot panel Le panneau latéral.
|
|
167
|
+
*/
|
|
168
|
+
export declare class PoadSidebarElement extends PoadLayoutElement {
|
|
169
|
+
protected static responsive: boolean;
|
|
170
|
+
static props: {
|
|
171
|
+
readonly side: "string";
|
|
172
|
+
readonly width: "string";
|
|
173
|
+
readonly contentMin: "string";
|
|
174
|
+
readonly gap: "string";
|
|
175
|
+
readonly align: "string";
|
|
176
|
+
readonly collapseAt: "string";
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Côté du panneau.
|
|
180
|
+
* @default 'right'
|
|
181
|
+
*/
|
|
182
|
+
side?: 'left' | 'right';
|
|
183
|
+
/**
|
|
184
|
+
* Largeur du panneau.
|
|
185
|
+
* @default '280px'
|
|
186
|
+
*/
|
|
187
|
+
width?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Largeur minimale du contenu : en dessous, le panneau passe dessous.
|
|
190
|
+
* @default '60%'
|
|
191
|
+
*/
|
|
192
|
+
contentMin?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Écart entre le contenu et le panneau : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
195
|
+
* @default 'md'
|
|
196
|
+
*/
|
|
197
|
+
gap?: LayoutGap;
|
|
198
|
+
/**
|
|
199
|
+
* Alignement vertical du contenu et du panneau.
|
|
200
|
+
* @default 'stretch'
|
|
201
|
+
*/
|
|
202
|
+
align?: LayoutAlign;
|
|
203
|
+
/** En dessous de ce point de rupture de la fenêtre, toujours empilés (vide : seulement faute de place). */
|
|
204
|
+
collapseAt?: Breakpoint | '';
|
|
205
|
+
protected render(): import("./dom.js").VNode;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Centre horizontalement, avec une largeur maximale.
|
|
209
|
+
* @slot default Le contenu centré.
|
|
210
|
+
*/
|
|
211
|
+
export declare class PoadCenterElement extends PoadLayoutElement {
|
|
212
|
+
static props: {
|
|
213
|
+
readonly maxWidth: "string";
|
|
214
|
+
readonly gutters: "string";
|
|
215
|
+
readonly andText: "boolean";
|
|
216
|
+
readonly intrinsic: "boolean";
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Largeur maximale du contenu.
|
|
220
|
+
* @default '60ch'
|
|
221
|
+
*/
|
|
222
|
+
maxWidth?: string;
|
|
223
|
+
/** Marges intérieures latérales (longueur CSS). */
|
|
224
|
+
gutters?: string;
|
|
225
|
+
/** Centre aussi le texte. */
|
|
226
|
+
andText?: boolean;
|
|
227
|
+
/** Centre les enfants à leur largeur propre (colonne flex centrée). */
|
|
228
|
+
intrinsic?: boolean;
|
|
229
|
+
protected render(): import("./dom.js").VNode;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Conteneur de page centré, largeur maximale par taille.
|
|
233
|
+
* @slot default Le contenu de la page.
|
|
234
|
+
*/
|
|
235
|
+
export declare class PoadContainerElement extends PoadLayoutElement {
|
|
236
|
+
static props: {
|
|
237
|
+
readonly size: "string";
|
|
238
|
+
readonly padding: "string";
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Largeur maximale : un point de rupture, ou `full` (`--poad-container-max`).
|
|
242
|
+
* @default 'full'
|
|
243
|
+
*/
|
|
244
|
+
size?: LayoutContainerSize;
|
|
245
|
+
/**
|
|
246
|
+
* Marges intérieures latérales : `xs` … `xl`, `none`, ou une longueur CSS.
|
|
247
|
+
* @default 'lg'
|
|
248
|
+
*/
|
|
249
|
+
padding?: LayoutGap;
|
|
250
|
+
protected render(): import("./dom.js").VNode;
|
|
251
|
+
}
|
|
252
|
+
/** Espace flexible (pousse ce qui suit) ou fixe. */
|
|
253
|
+
export declare class PoadSpacerElement extends PoadLayoutElement {
|
|
254
|
+
static props: {
|
|
255
|
+
readonly size: "string";
|
|
256
|
+
};
|
|
257
|
+
/** Taille fixe (`xs` … `xl` ou longueur CSS) ; absente : flexible, pousse ce qui suit. */
|
|
258
|
+
size?: LayoutGap;
|
|
259
|
+
protected render(): import("./dom.js").VNode;
|
|
260
|
+
}
|
|
261
|
+
export {};
|
|
262
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAEuE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EACvJ,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,2FAA2F;AAC3F,uBAAe,iBAAkB,SAAQ,WAAW;IAClD,SAAS,CAAC,MAAM,CAAC,UAAU,UAAS;IACpC,OAAO,CAAC,IAAI,CAA6B;IACzC,8CAA8C;IAC9C,SAAS,KAAK,EAAE,IAAI,UAAU,CAE7B;IACQ,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;CAKtC;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,iBAAiB;IACrD,OAAgB,KAAK;;;;;MAAqF;IAC1G;;;OAGG;IACK,GAAG,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACK,KAAK,CAAC,EAAE,WAAW,CAAC;IAC5B;;;OAGG;IACK,OAAO,CAAC,EAAE,aAAa,CAAC;IAChC,kDAAkD;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,MAAM;CAGjB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAgB,KAAK;;;;;;MAAsG;IAC3H;;;OAGG;IACK,GAAG,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACK,KAAK,CAAC,EAAE,WAAW,CAAC;IAC5B;;;OAGG;IACK,OAAO,CAAC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;OAGG;IACK,GAAG,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACK,KAAK,CAAC,EAAE,WAAW,CAAC;IAC5B,2GAA2G;IACnG,UAAU,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC;IACrC,SAAS,CAAC,MAAM;CAOjB;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,OAAgB,KAAK;;;;;MAAgG;IACrH;;;OAGG;IACK,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACzB,6BAA6B;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,MAAM;CAGjB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAgB,KAAK;;;MAAkD;IACvE;;;OAGG;IACK,IAAI,CAAC,EAAE,mBAAmB,CAAC;IACnC;;;OAGG;IACK,OAAO,CAAC,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,MAAM;CAGjB;AAED,oDAAoD;AACpD,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,OAAgB,KAAK;;MAA+B;IACpD,0FAA0F;IAClF,IAAI,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,MAAM;CAGjB"}
|
package/dist/layout.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <poad-stack gap="sm">…</poad-stack> pile verticale
|
|
3
|
+
* <poad-cluster justify="between">…</poad-cluster> groupe horizontal qui replie
|
|
4
|
+
* <poad-grid cols="1 sm:2 lg:4"><div poad-col="full">…</div>…</poad-grid>
|
|
5
|
+
* <poad-split ratio="2fr 1fr" stack-at="md">…</poad-split> deux zones
|
|
6
|
+
* <poad-sidebar collapse-at="md"><main>…</main><aside slot="panel">…</aside></poad-sidebar>
|
|
7
|
+
* <poad-center max-width="60ch">…</poad-center> <poad-container size="lg">…</poad-container> <poad-spacer></poad-spacer>
|
|
8
|
+
*
|
|
9
|
+
* Mise en page : l'hôte ne dessine rien (`display: contents`) ; il rend une `<div>` aux classes de
|
|
10
|
+
* `@poadio/ui-core/layout.css` et aux styles en ligne du module `layout` d'ui-core, qui contient les enfants de la page —
|
|
11
|
+
* même DOM que les composants de mise en page d'ui-angular. Grille : un enfant qui porte `poad-col` reçoit son
|
|
12
|
+
* `grid-column` ; panneau latéral : l'enfant `slot="panel"` reçoit la classe `poad-sidebar__panel`. Les valeurs
|
|
13
|
+
* responsive et les seuils suivent le point de rupture de la fenêtre (1280 px, `xl`, sans fenêtre).
|
|
14
|
+
*/
|
|
15
|
+
import { breakpointOf, centerClasses, centerStyle, clusterStyle, containerStyle, gridColumn, gridStyle, layoutFlowClasses, sidebarClasses, sidebarCollapsed, sidebarStyle, spacerStyle, splitStyle, stackStyle, BREAKPOINT_SERVER_WIDTH, } from '@poadio/ui-core';
|
|
16
|
+
import { h } from './dom.js';
|
|
17
|
+
import { PoadElement } from './element.js';
|
|
18
|
+
/** Pièce de mise en page ; `responsive` : redessinée quand la fenêtre change de taille. */
|
|
19
|
+
class PoadLayoutElement extends PoadElement {
|
|
20
|
+
static responsive = false;
|
|
21
|
+
stop = null;
|
|
22
|
+
/** Point de rupture courant de la fenêtre. */
|
|
23
|
+
get bp() {
|
|
24
|
+
return breakpointOf(this.ownerDocument.defaultView?.innerWidth ?? BREAKPOINT_SERVER_WIDTH);
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
super.connectedCallback();
|
|
28
|
+
const win = this.ownerDocument.defaultView;
|
|
29
|
+
if (this.stop || !this.content || !win || !this.constructor.responsive)
|
|
30
|
+
return;
|
|
31
|
+
let last = this.bp;
|
|
32
|
+
const onResize = () => { if (this.bp !== last) {
|
|
33
|
+
last = this.bp;
|
|
34
|
+
this.update();
|
|
35
|
+
} };
|
|
36
|
+
win.addEventListener('resize', onResize, { passive: true });
|
|
37
|
+
this.stop = () => win.removeEventListener('resize', onResize);
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
super.disconnectedCallback();
|
|
41
|
+
this.stop?.();
|
|
42
|
+
this.stop = null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Pile verticale : les enfants s'empilent avec un écart uniforme (jamais de marges).
|
|
47
|
+
* @slot default Les enfants empilés.
|
|
48
|
+
*/
|
|
49
|
+
export class PoadStackElement extends PoadLayoutElement {
|
|
50
|
+
static props = { gap: 'string', align: 'string', justify: 'string', inline: 'boolean' };
|
|
51
|
+
render() {
|
|
52
|
+
return h('div', { class: layoutFlowClasses('poad-stack', !!this.inline), style: stackStyle(this) }, this.content ?? []);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Groupe horizontal qui replie (boutons, puces, méta).
|
|
57
|
+
* @slot default Les enfants du groupe.
|
|
58
|
+
*/
|
|
59
|
+
export class PoadClusterElement extends PoadLayoutElement {
|
|
60
|
+
static props = { gap: 'string', align: 'string', justify: 'string', wrap: 'boolean', inline: 'boolean' };
|
|
61
|
+
render() {
|
|
62
|
+
return h('div', { class: layoutFlowClasses('poad-cluster', !!this.inline), style: clusterStyle(this) }, this.content ?? []);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Grille responsive (points de rupture de la fenêtre) ou « auto-fit » (`min`, largeur du conteneur).
|
|
67
|
+
* @slot default Les cellules ; `poad-col="2"` / `"1 md:2"` / `"full"` sur un enfant pour en occuper plusieurs.
|
|
68
|
+
*/
|
|
69
|
+
export class PoadGridElement extends PoadLayoutElement {
|
|
70
|
+
static responsive = true;
|
|
71
|
+
static props = { cols: 'string', min: 'string', gap: 'string', rowGap: 'string', align: 'string', dense: 'boolean' };
|
|
72
|
+
render() {
|
|
73
|
+
const bp = this.bp;
|
|
74
|
+
for (const n of this.content ?? []) {
|
|
75
|
+
if (n instanceof Element && n.hasAttribute('poad-col'))
|
|
76
|
+
n.style.gridColumn = gridColumn(n.getAttribute('poad-col'), bp);
|
|
77
|
+
}
|
|
78
|
+
return h('div', { class: 'poad-grid', style: gridStyle({ cols: this.cols, min: this.min, gap: this.gap, rowGap: this.rowGap, align: this.align, dense: this.dense }, bp) }, this.content ?? []);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Deux zones côte à côte, empilées sous `stackAt`.
|
|
83
|
+
* @slot default Les deux zones.
|
|
84
|
+
*/
|
|
85
|
+
export class PoadSplitElement extends PoadLayoutElement {
|
|
86
|
+
static responsive = true;
|
|
87
|
+
static props = { ratio: 'string', gap: 'string', align: 'string', stackAt: 'string' };
|
|
88
|
+
render() {
|
|
89
|
+
return h('div', { class: 'poad-split', style: splitStyle({ ratio: this.ratio, gap: this.gap, align: this.align, stackAt: this.stackAt ?? 'sm' }, this.bp) }, this.content ?? []);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Contenu et panneau latéral : le panneau (`slot="panel"`) garde sa largeur, passe dessous faute de place.
|
|
94
|
+
* @slot default Le contenu.
|
|
95
|
+
* @slot panel Le panneau latéral.
|
|
96
|
+
*/
|
|
97
|
+
export class PoadSidebarElement extends PoadLayoutElement {
|
|
98
|
+
static responsive = true;
|
|
99
|
+
static props = { side: 'string', width: 'string', contentMin: 'string', gap: 'string', align: 'string', collapseAt: 'string' };
|
|
100
|
+
render() {
|
|
101
|
+
for (const n of this.content ?? [])
|
|
102
|
+
if (n instanceof Element && n.getAttribute('slot') === 'panel')
|
|
103
|
+
n.classList.add('poad-sidebar__panel');
|
|
104
|
+
return h('div', {
|
|
105
|
+
class: sidebarClasses(this.side === 'left' ? 'left' : 'right', sidebarCollapsed(this.collapseAt, this.bp)),
|
|
106
|
+
style: sidebarStyle({ width: this.width, contentMin: this.contentMin, gap: this.gap, align: this.align }),
|
|
107
|
+
}, this.content ?? []);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Centre horizontalement, avec une largeur maximale.
|
|
112
|
+
* @slot default Le contenu centré.
|
|
113
|
+
*/
|
|
114
|
+
export class PoadCenterElement extends PoadLayoutElement {
|
|
115
|
+
static props = { maxWidth: 'string', gutters: 'string', andText: 'boolean', intrinsic: 'boolean' };
|
|
116
|
+
render() {
|
|
117
|
+
return h('div', { class: centerClasses(!!this.andText, !!this.intrinsic), style: centerStyle(this) }, this.content ?? []);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Conteneur de page centré, largeur maximale par taille.
|
|
122
|
+
* @slot default Le contenu de la page.
|
|
123
|
+
*/
|
|
124
|
+
export class PoadContainerElement extends PoadLayoutElement {
|
|
125
|
+
static props = { size: 'string', padding: 'string' };
|
|
126
|
+
render() {
|
|
127
|
+
return h('div', { class: 'poad-container', style: containerStyle(this) }, this.content ?? []);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** Espace flexible (pousse ce qui suit) ou fixe. */
|
|
131
|
+
export class PoadSpacerElement extends PoadLayoutElement {
|
|
132
|
+
static props = { size: 'string' };
|
|
133
|
+
render() {
|
|
134
|
+
return h('div', { class: 'poad-spacer', style: spacerStyle(this.size) });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../src/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAClJ,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,GAE3E,MAAM,iBAA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E,SAAS,EAAE,SAAS,EAAW,CAAC;IAY3G,MAAM;QACd,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAC5H,CAAC;;AAGH;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACzD,MAAM,CAAU,KAAK,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAW,CAAC;IAW7D,MAAM;QACd,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;IAChG,CAAC;;AAGH,oDAAoD;AACpD,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACtD,MAAM,CAAU,KAAK,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAW,CAAC;IAG1C,MAAM;QACd,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* <poad-menubar items='[…]' aria-label="Main" current="/docs">
|
|
3
|
+
* <img slot="start" …> <poad-button slot="end">Sign in</poad-button>
|
|
4
|
+
* </poad-menubar>
|
|
5
|
+
*
|
|
6
|
+
* Barre de menus horizontale (`role="menubar"`, un seul arrêt de tabulation) : racines liens (`url`, en `<a href>`)
|
|
7
|
+
* ou boutons qui ouvrent un panneau flottant — une liste (`items`, un niveau de sous-menu) ou un méga-menu en colonnes
|
|
8
|
+
* (`columns`). Clavier : ← → entre racines, ↓ ↑ ouvrent et entrent dans le panneau, ← → y passent au panneau voisin,
|
|
9
|
+
* Échap ferme et rend le focus à la racine ; au survol, une fois un panneau ouvert, celui de la racine survolée le
|
|
10
|
+
* remplace. Sous `breakpoint` (fenêtre) : bouton « Menu » (`nav.menu`) et liste verticale dont les groupes se déplient
|
|
11
|
+
* sur place.
|
|
12
|
+
*
|
|
13
|
+
* Décisions : machines `menubar` et `menu` de @poadio/ui-core — même DOM, mêmes classes, même ARIA que `poad-menubar`
|
|
14
|
+
* d'ui-angular. L'évènement `itemclick` est annulable : `preventDefault()` empêche la navigation d'un lien (routeur de
|
|
15
|
+
* l'application). Styles : `menubar.css`, `menu.css`, `floating.css`, `icon.css`.
|
|
16
|
+
*/
|
|
17
|
+
import { type Breakpoint } from '@poadio/ui-core';
|
|
18
|
+
import { type Child } from './dom.js';
|
|
19
|
+
import { PoadElement } from './element.js';
|
|
20
|
+
import type { PoadMenuItem } from './menu.js';
|
|
21
|
+
/** Une colonne de méga-menu. */
|
|
22
|
+
export interface PoadMenubarColumn {
|
|
23
|
+
/** Intertitre de la colonne. */
|
|
24
|
+
readonly header?: string;
|
|
25
|
+
/** Éléments de la colonne. */
|
|
26
|
+
readonly items: readonly PoadMenuItem[];
|
|
27
|
+
}
|
|
28
|
+
/** Racine de la barre : un élément de menu, avec sa liste (`items`) ou ses colonnes de méga-menu (`columns`). */
|
|
29
|
+
export interface PoadMenubarItem extends PoadMenuItem {
|
|
30
|
+
/** Colonnes du méga-menu (quand la racine n'a pas de liste `items`). */
|
|
31
|
+
readonly columns?: readonly PoadMenubarColumn[];
|
|
32
|
+
/** Éléments du panneau (un niveau de sous-menu de plus par leurs propres `items`). */
|
|
33
|
+
readonly items?: readonly PoadMenubarItem[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Barre de menus.
|
|
37
|
+
* @slot start Contenu avant les racines (logo…).
|
|
38
|
+
* @slot end Contenu après les racines, poussé à la fin (recherche, compte…).
|
|
39
|
+
* @fires itemclick Un élément (racine sans panneau, élément d'un panneau, ligne du repli) est choisi, après sa `command` ; `detail` : `{ item, originalEvent }`. Annulable : `preventDefault()` empêche la navigation du lien.
|
|
40
|
+
* @fires openchange Le panneau d'une racine s'ouvre (`detail` : la racine) ou se ferme (`detail` : `null`).
|
|
41
|
+
*/
|
|
42
|
+
export declare class PoadMenubarElement extends PoadElement {
|
|
43
|
+
static props: {
|
|
44
|
+
readonly items: "json";
|
|
45
|
+
readonly ariaLabel: "string";
|
|
46
|
+
readonly breakpoint: "string";
|
|
47
|
+
readonly openOnHover: "boolean";
|
|
48
|
+
readonly current: "string";
|
|
49
|
+
};
|
|
50
|
+
/** Les racines de la barre. */
|
|
51
|
+
items?: readonly PoadMenubarItem[];
|
|
52
|
+
/** Nom accessible de la barre (attribut `aria-label`, porté par la barre). */
|
|
53
|
+
ariaLabel: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Sous ce point de rupture de la fenêtre : bouton « Menu » et liste verticale (`''` : jamais).
|
|
56
|
+
* @default 'md'
|
|
57
|
+
*/
|
|
58
|
+
breakpoint?: Breakpoint | '';
|
|
59
|
+
/**
|
|
60
|
+
* Une fois un panneau ouvert, survoler une autre racine ouvre le sien ; quitter la barre et le panneau le ferme.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
openOnHover?: boolean;
|
|
64
|
+
/** Adresse de la page courante : la racine (ou l'élément) dont `url` est égale est marquée (`aria-current="page"`). */
|
|
65
|
+
current?: string;
|
|
66
|
+
private state;
|
|
67
|
+
private panel;
|
|
68
|
+
private mobileOpen;
|
|
69
|
+
private expanded;
|
|
70
|
+
private lastCollapsed;
|
|
71
|
+
private pending;
|
|
72
|
+
private closeTimer;
|
|
73
|
+
private readonly pointer;
|
|
74
|
+
private stopResize;
|
|
75
|
+
private readonly tracker;
|
|
76
|
+
private readonly outside;
|
|
77
|
+
connectedCallback(): void;
|
|
78
|
+
disconnectedCallback(): void;
|
|
79
|
+
private roots;
|
|
80
|
+
private collapsed;
|
|
81
|
+
private rootEl;
|
|
82
|
+
private pane;
|
|
83
|
+
private setState;
|
|
84
|
+
private focusLater;
|
|
85
|
+
private focusTo;
|
|
86
|
+
private apply;
|
|
87
|
+
/** Ferme le panneau ouvert (`refocus` : le focus revient à sa racine). */
|
|
88
|
+
close(refocus?: boolean): void;
|
|
89
|
+
private cancelClose;
|
|
90
|
+
private scheduleClose;
|
|
91
|
+
private choose;
|
|
92
|
+
private setPanel;
|
|
93
|
+
protected updated(): void;
|
|
94
|
+
protected render(): Child;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=menubar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menubar.d.ts","sourceRoot":"","sources":["../src/menubar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,gCAAgC;AAChC,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAED,iHAAiH;AACjH,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,wEAAwE;IACxE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAChD,sFAAsF;IACtF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,O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