@poadio/app-vue 0.3.0 → 0.4.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.
Files changed (178) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/app-vue.css +54 -2
  3. package/dist/items.d.ts.map +1 -1
  4. package/dist/items.js +344 -85
  5. package/dist/items.js.map +1 -1
  6. package/dist/sections/grid.d.ts.map +1 -1
  7. package/dist/sections/grid.js +11 -2
  8. package/dist/sections/grid.js.map +1 -1
  9. package/package.json +2 -2
  10. package/runtime-dist/app.css +54 -2
  11. package/runtime-dist/app.js +2 -2
  12. package/runtime-dist/c-008ty6rk.js +2 -0
  13. package/runtime-dist/c-05mfa190.js +1 -0
  14. package/runtime-dist/c-0j0qq16x.js +1 -0
  15. package/runtime-dist/c-0q89m260.js +1 -0
  16. package/runtime-dist/{c-4mqnegk0.js → c-0s78cd21.js} +1 -1
  17. package/runtime-dist/{c-770ysy0b.js → c-1ceh9z6n.js} +1 -1
  18. package/runtime-dist/c-1hv05jxf.js +2 -0
  19. package/runtime-dist/c-2ad7era6.js +1 -0
  20. package/runtime-dist/c-2d4zg49c.js +1 -0
  21. package/runtime-dist/c-2e4pej9y.js +1 -0
  22. package/runtime-dist/c-2jaeb7hb.js +1 -0
  23. package/runtime-dist/{c-t31wwv0j.js → c-31k4h9e3.js} +1 -1
  24. package/runtime-dist/{c-6pfxp4ca.js → c-323cmvmr.js} +2 -2
  25. package/runtime-dist/{c-aebecc6a.js → c-38mbqn1q.js} +1 -1
  26. package/runtime-dist/{c-mb798tvv.js → c-3at1wc60.js} +2 -2
  27. package/runtime-dist/{c-0arc0hg5.js → c-3cbct4j0.js} +1 -1
  28. package/runtime-dist/c-4c6bp5ge.js +1 -0
  29. package/runtime-dist/c-4h6g9784.js +1 -0
  30. package/runtime-dist/{c-632d3gvm.js → c-4qan80kf.js} +1 -1
  31. package/runtime-dist/{c-z6dbvc3p.js → c-4xcsa9sp.js} +2 -2
  32. package/runtime-dist/c-5a6mxded.js +1 -0
  33. package/runtime-dist/c-5kyzr3hv.js +2 -0
  34. package/runtime-dist/{c-0x2e39ve.js → c-5vtfap6v.js} +2 -2
  35. package/runtime-dist/{c-hwgt6amh.js → c-5xrh3qmz.js} +2 -2
  36. package/runtime-dist/c-5zfmt59k.js +2 -0
  37. package/runtime-dist/c-6jjary0p.js +1 -0
  38. package/runtime-dist/c-6w1r241j.js +1 -0
  39. package/runtime-dist/{c-00cvgnxc.js → c-770qn5gr.js} +1 -1
  40. package/runtime-dist/{c-dzp10g67.js → c-7dq4rx1n.js} +3 -3
  41. package/runtime-dist/{c-nm6tjep8.js → c-80vaq27v.js} +1 -1
  42. package/runtime-dist/{c-ytpw5gj2.js → c-81zrdysm.js} +1 -1
  43. package/runtime-dist/c-8jrmqdq1.js +1 -0
  44. package/runtime-dist/c-8wdrb81n.js +1 -0
  45. package/runtime-dist/{c-ejgrzqe3.js → c-8wf8b0sr.js} +1 -1
  46. package/runtime-dist/{c-gty08djr.js → c-8zmpdrm5.js} +2 -2
  47. package/runtime-dist/{c-zbts8rvw.js → c-8zzjexhj.js} +2 -2
  48. package/runtime-dist/c-900h0yca.js +1 -0
  49. package/runtime-dist/{c-8cydj5g6.js → c-908e6t37.js} +3 -3
  50. package/runtime-dist/{c-170fz4v2.js → c-90cnzxxw.js} +1 -1
  51. package/runtime-dist/c-996zhc7v.js +1 -0
  52. package/runtime-dist/{c-an1sk7z5.js → c-9q0awp0g.js} +2 -2
  53. package/runtime-dist/c-afwe6e7h.js +1 -0
  54. package/runtime-dist/{c-tjk566f2.js → c-akbde6sp.js} +2 -2
  55. package/runtime-dist/c-bbkx8ha0.js +2 -0
  56. package/runtime-dist/{c-v73qt5av.js → c-bezqdzja.js} +1 -1
  57. package/runtime-dist/c-c6t3xp1f.js +1 -0
  58. package/runtime-dist/{c-m4wr50z4.js → c-d0w2v0ry.js} +1 -1
  59. package/runtime-dist/{c-6nx9xkc1.js → c-d10mvt3y.js} +1 -1
  60. package/runtime-dist/c-d15cp8ae.js +7 -0
  61. package/runtime-dist/{c-xyqqhx8j.js → c-darzv9dx.js} +7 -7
  62. package/runtime-dist/c-dfmaz8kq.js +1 -0
  63. package/runtime-dist/{c-8xc3fha3.js → c-e4eywyqm.js} +2 -2
  64. package/runtime-dist/{c-pager3te.js → c-e71rhzgd.js} +1 -1
  65. package/runtime-dist/{c-93kndqea.js → c-ehvh73gz.js} +1 -1
  66. package/runtime-dist/{c-2z768p0x.js → c-fgymwk56.js} +2 -2
  67. package/runtime-dist/{c-stez1fhk.js → c-fj70dzwc.js} +2 -2
  68. package/runtime-dist/c-fn3ddac2.js +1 -0
  69. package/runtime-dist/{c-zhvsa0wq.js → c-fye4ktyb.js} +2 -2
  70. package/runtime-dist/c-g1sapcjb.js +1 -0
  71. package/runtime-dist/{c-9pzq231t.js → c-gcp7pgzj.js} +1 -1
  72. package/runtime-dist/c-hga6v8y5.js +2 -0
  73. package/runtime-dist/{c-znyeph7c.js → c-hkqab6a9.js} +1 -1
  74. package/runtime-dist/{c-8v7c8j85.js → c-hqcvt3z9.js} +2 -2
  75. package/runtime-dist/{c-kt8hnx3r.js → c-htmgkvv5.js} +1 -1
  76. package/runtime-dist/{c-r539tr5f.js → c-htx6kd3m.js} +1 -1
  77. package/runtime-dist/c-hwv8e548.js +1 -0
  78. package/runtime-dist/{c-f4fpjjsk.js → c-j18jra7n.js} +1 -1
  79. package/runtime-dist/{c-fq9wga43.js → c-j2m0kaz5.js} +1 -1
  80. package/runtime-dist/c-jcnz4p9h.js +1 -0
  81. package/runtime-dist/c-jeke4j5f.js +1 -0
  82. package/runtime-dist/{c-5bxybf9g.js → c-jfhd21m0.js} +2 -2
  83. package/runtime-dist/{c-4w8c01x6.js → c-jgq8c478.js} +2 -2
  84. package/runtime-dist/{c-bbgsrr8m.js → c-jtbbtv7w.js} +1 -1
  85. package/runtime-dist/{c-x0evjwqg.js → c-jz0pz4sa.js} +2 -2
  86. package/runtime-dist/c-k473g4p1.js +1 -0
  87. package/runtime-dist/{c-76450e09.js → c-kge0a8jt.js} +1 -1
  88. package/runtime-dist/{c-n5896ck3.js → c-kkgxaaxx.js} +2 -2
  89. package/runtime-dist/{c-afjwwspe.js → c-kvaqyz6q.js} +1 -1
  90. package/runtime-dist/c-m1a3vb0b.js +1 -0
  91. package/runtime-dist/{c-q9h7pf4v.js → c-m61eyj12.js} +1 -1
  92. package/runtime-dist/c-mc9sevgd.js +1 -0
  93. package/runtime-dist/{c-ckkpv1ab.js → c-mttkd1hb.js} +1 -1
  94. package/runtime-dist/{c-v43kzdgm.js → c-mzfdqh06.js} +1 -1
  95. package/runtime-dist/{c-272dwppe.js → c-n6ngg2xw.js} +1 -1
  96. package/runtime-dist/{c-0x2jfka0.js → c-n77b13je.js} +1 -1
  97. package/runtime-dist/c-nc4950dr.js +1 -0
  98. package/runtime-dist/{c-bbqq1fmz.js → c-ndjpabjd.js} +2 -2
  99. package/runtime-dist/{c-bypwvtv5.js → c-ndqn9k3b.js} +1 -1
  100. package/runtime-dist/{c-hddfmemr.js → c-nh1crnme.js} +2 -2
  101. package/runtime-dist/{c-z00nq4vy.js → c-p1knyfjp.js} +2 -2
  102. package/runtime-dist/{c-d9eczdnp.js → c-p7exw6x4.js} +1 -1
  103. package/runtime-dist/c-p8gmqk2c.js +2 -0
  104. package/runtime-dist/{c-hcd75fdn.js → c-peqr6b73.js} +1 -1
  105. package/runtime-dist/c-pf0hf4z0.js +1 -0
  106. package/runtime-dist/{c-09vj399g.js → c-pwb1zdth.js} +1 -1
  107. package/runtime-dist/{c-22qerref.js → c-q9sz4140.js} +2 -2
  108. package/runtime-dist/c-qancp7fv.js +1 -0
  109. package/runtime-dist/{c-cyvq3zhq.js → c-r8caw0b4.js} +1 -1
  110. package/runtime-dist/{c-ncw09fhf.js → c-ra8vp32m.js} +1 -1
  111. package/runtime-dist/{c-ah4kckw8.js → c-rpantxdv.js} +2 -2
  112. package/runtime-dist/{c-b9npcc8v.js → c-sen28fd3.js} +1 -1
  113. package/runtime-dist/{c-9hk02377.js → c-t3at1w4r.js} +1 -1
  114. package/runtime-dist/c-t77hdys1.js +2 -0
  115. package/runtime-dist/{c-aetcxxs5.js → c-td669s77.js} +2 -2
  116. package/runtime-dist/{c-g0s6z8fh.js → c-tfkx1ms2.js} +1 -1
  117. package/runtime-dist/c-traxh6dd.js +2 -0
  118. package/runtime-dist/c-v13nz4jj.js +1 -0
  119. package/runtime-dist/c-v59gffnx.js +7 -0
  120. package/runtime-dist/c-wcm09eer.js +1 -0
  121. package/runtime-dist/c-wfexgh4m.js +2 -0
  122. package/runtime-dist/{c-sgr6dj0y.js → c-x7f6s1vz.js} +1 -1
  123. package/runtime-dist/{c-jpgfd99h.js → c-y0qqtc02.js} +1 -1
  124. package/runtime-dist/c-ydb0jv9k.js +1 -0
  125. package/runtime-dist/{c-1j1xssd8.js → c-yg69d4wg.js} +2 -2
  126. package/runtime-dist/c-yrfjn186.js +2 -0
  127. package/runtime-dist/{c-pca88tas.js → c-yz4h2z4n.js} +1 -1
  128. package/runtime-dist/{c-nacvp4ca.js → c-z9ry29gh.js} +1 -1
  129. package/runtime-dist/{c-jhscxp68.js → c-zbjpj2yd.js} +1 -1
  130. package/runtime-dist/version.json +1 -1
  131. package/src/items.ts +446 -95
  132. package/src/sections/grid.ts +10 -2
  133. package/runtime-dist/c-1aa5pzps.js +0 -1
  134. package/runtime-dist/c-1h3k0kb8.js +0 -1
  135. package/runtime-dist/c-1n6fcyf0.js +0 -1
  136. package/runtime-dist/c-38nmw75x.js +0 -1
  137. package/runtime-dist/c-3gqmyt95.js +0 -1
  138. package/runtime-dist/c-4s1xdsjj.js +0 -2
  139. package/runtime-dist/c-5crndmh8.js +0 -1
  140. package/runtime-dist/c-7eh8g4bg.js +0 -1
  141. package/runtime-dist/c-8g74gqn9.js +0 -2
  142. package/runtime-dist/c-96a9b7ys.js +0 -1
  143. package/runtime-dist/c-a3jhm7jm.js +0 -1
  144. package/runtime-dist/c-aenj05yt.js +0 -2
  145. package/runtime-dist/c-bemne227.js +0 -1
  146. package/runtime-dist/c-d3jg3nhc.js +0 -1
  147. package/runtime-dist/c-d68hg40s.js +0 -1
  148. package/runtime-dist/c-d8ba6h4e.js +0 -1
  149. package/runtime-dist/c-e5eq2szv.js +0 -2
  150. package/runtime-dist/c-e7rb0mk1.js +0 -1
  151. package/runtime-dist/c-ezj4yg2q.js +0 -1
  152. package/runtime-dist/c-f23v2025.js +0 -2
  153. package/runtime-dist/c-fps4599a.js +0 -1
  154. package/runtime-dist/c-g06g8vzv.js +0 -1
  155. package/runtime-dist/c-g0ncg08s.js +0 -7
  156. package/runtime-dist/c-hqtxax0h.js +0 -1
  157. package/runtime-dist/c-mpvzhygt.js +0 -1
  158. package/runtime-dist/c-mqwew5y8.js +0 -1
  159. package/runtime-dist/c-p1cbp7e1.js +0 -1
  160. package/runtime-dist/c-pp0qxmbz.js +0 -2
  161. package/runtime-dist/c-pttdwpdd.js +0 -1
  162. package/runtime-dist/c-qcz7q5fj.js +0 -2
  163. package/runtime-dist/c-qhv2qby2.js +0 -2
  164. package/runtime-dist/c-r7qgrz3b.js +0 -2
  165. package/runtime-dist/c-ra7b526a.js +0 -1
  166. package/runtime-dist/c-rm3pkjj7.js +0 -1
  167. package/runtime-dist/c-srccgg45.js +0 -2
  168. package/runtime-dist/c-tc2bxsyc.js +0 -1
  169. package/runtime-dist/c-tjqjxwfa.js +0 -1
  170. package/runtime-dist/c-tpa4vh9k.js +0 -1
  171. package/runtime-dist/c-w1cb3r8h.js +0 -1
  172. package/runtime-dist/c-wcha6k7x.js +0 -1
  173. package/runtime-dist/c-x2jj49ts.js +0 -1
  174. package/runtime-dist/c-xhyafw4q.js +0 -1
  175. package/runtime-dist/c-y7f2tjg6.js +0 -7
  176. package/runtime-dist/c-yf86vgtz.js +0 -2
  177. package/runtime-dist/c-yhzkcpdp.js +0 -1
  178. package/runtime-dist/c-zhwr1x02.js +0 -1
package/src/items.ts CHANGED
@@ -55,10 +55,33 @@ const frontLink = (nav: FrontNav): Component => {
55
55
  const fromPages = (p: ItemProps, ctx: ItemContext) => (str(p, 'source') !== 'custom' && ctx.nav ? ctx.nav : null);
56
56
 
57
57
  const str = (p: ItemProps, k: string): string => (typeof p[k] === 'string' ? (p[k] as string) : '');
58
+ /** Un texte, ou rien quand il est vide (le composant prend alors son texte par défaut) */
59
+ const opt = (p: ItemProps, k: string): string | undefined => str(p, k) || undefined;
58
60
  const num = (p: ItemProps, k: string): number => (typeof p[k] === 'number' ? (p[k] as number) : 0);
61
+ /** Un nombre facultatif (`optnumber`) : null, rien à passer au composant */
62
+ const onum = (p: ItemProps, k: string): number | undefined => (typeof p[k] === 'number' ? (p[k] as number) : undefined);
59
63
  const bool = (p: ItemProps, k: string): boolean => p[k] === true;
60
64
  const list = (p: ItemProps, k: string): string[] => (Array.isArray(p[k]) ? (p[k] as string[]).filter((s) => s.trim() !== '') : []);
61
- const options = (p: ItemProps, k = 'options') => list(p, k).map((l) => ({ label: l, value: l }));
65
+ const options = (p: ItemProps, k: string) => list(p, k).map((l) => ({ label: l, value: l }));
66
+ /** Choix à trois états (auto / oui / non) : null, true ou false */
67
+ const tri = (p: ItemProps, k: string): boolean | null => (str(p, k) === 'yes' ? true : str(p, k) === 'no' ? false : null);
68
+ /** Choix numérique écrit en texte (`'1'`, `'-1'`) ; `auto` ou vide : rien */
69
+ const numChoice = (p: ItemProps, k: string): number | undefined => (/^-?\d+$/.test(str(p, k)) ? Number(str(p, k)) : undefined);
70
+ /** Choix dont une valeur dit « aucun » (`none`, `never`…) : null pour le composant */
71
+ const orNull = (p: ItemProps, k: string, none = 'none'): string | null => (str(p, k) && str(p, k) !== none ? str(p, k) : null);
72
+
73
+ /** Couleurs du thème (COLOR_TOKENS de app-core) → variables CSS de @poadio/ui-core */
74
+ const THEME_COLORS: Record<string, string> = {
75
+ primary: 'var(--poad-accent)', secondary: 'var(--poad-fg-secondary)', success: 'var(--poad-success)', warning: 'var(--poad-warning)',
76
+ danger: 'var(--poad-danger)', info: 'var(--poad-info)', neutral: 'var(--poad-fg-muted)',
77
+ };
78
+ /** Une propriété `color` en couleur CSS : jeton du thème → sa variable, #hex tel quel, vide → rien */
79
+ const cssColor = (p: ItemProps, k: string): string | undefined => (str(p, k) ? (THEME_COLORS[str(p, k)] ?? str(p, k)) : undefined);
80
+ /** Une date AAAA-MM-JJ (`date`) en Date locale, ou null */
81
+ const day = (p: ItemProps, k: string): Date | null => {
82
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(str(p, k));
83
+ return m ? new Date(+m[1]!, +m[2]! - 1, +m[3]!) : null;
84
+ };
62
85
 
63
86
  /**
64
87
  * h() sans le typage strict des props de chaque composant : les valeurs viennent du catalogue (choix déjà vérifiés
@@ -84,7 +107,7 @@ const model = <T>(name: string, initial: (p: ItemProps) => T, render: (p: ItemPr
84
107
  },
85
108
  });
86
109
 
87
- const bind = <T>(v: Ref<T>) => ({ modelValue: v.value, 'onUpdate:modelValue': (x: T) => (v.value = x) });
110
+ const bind = <T>(v: Ref<T>, prop = 'modelValue') => ({ [prop]: v.value, [`onUpdate:${prop}`]: (x: T) => (v.value = x) });
88
111
 
89
112
  /** Texte d'un contenu de démonstration : « Contenu de « Onglet 1 ». » */
90
113
  const contentOf = (ctx: ItemContext, name: string) => ctx.t('item.content').replace('{name}', name);
@@ -92,169 +115,343 @@ const contentOf = (ctx: ItemContext, name: string) => ctx.t('item.content').repl
92
115
  const ui = {
93
116
  button: () => import('@poadio/ui-vue/button'),
94
117
  field: () => import('@poadio/ui-vue/field'),
118
+ icon: () => import('@poadio/ui-vue/icon'),
95
119
  };
96
120
 
97
- /** Libellé et contrôle, à la façon d'un champ de formulaire */
121
+ /** Props de l'enveloppe PoadField d'un champ : libellé, aide, obligatoire, mention facultatif, libellé à gauche, taille, désactivé */
122
+ const fieldShell = (p: ItemProps) => ({
123
+ label: opt(p, 'label'), hint: opt(p, 'hint'), required: bool(p, 'required'), optional: bool(p, 'optional'),
124
+ inline: bool(p, 'inline'), size: opt(p, 'size'), disabled: bool(p, 'disabled'),
125
+ });
126
+
127
+ /** Libellé et contrôle, à la façon d'un champ de formulaire ; le contrôle a sa propre boîte (`plain` : pas de double cadre) */
98
128
  const labelled = async <T>(name: string, load: () => Promise<Component>, initial: (p: ItemProps) => T, extra: (p: ItemProps) => Record<string, unknown> = () => ({})) => {
99
129
  const [{ PoadField }, control] = await Promise.all([ui.field(), load()]);
100
- return model(name, initial, (p, _ctx, v) =>
101
- el(PoadField, { label: str(p, 'label') || undefined, required: bool(p, 'required'), hint: str(p, 'hint') || undefined, bare: true }, () => el(control, { ...extra(p), ...bind(v) })),
102
- );
130
+ return model(name, initial, (p, _ctx, v) => el(PoadField, { ...fieldShell(p), plain: true }, () => el(control, { ...extra(p), ...bind(v) })));
103
131
  };
104
132
 
133
+ /** Éléments de menu (libellés seuls) à partir d'une liste */
134
+ const asItems = (p: ItemProps, k: string) => list(p, k).map((l) => ({ label: l }));
135
+
105
136
  /** Un chargeur par type : rend le composant Vue qui dessine ce type */
106
137
  export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
107
138
  // ---------------------------------------------------------------- Mise en page
108
139
  card: async () => {
109
140
  const { PoadCard } = await import('@poadio/ui-vue/card');
110
- return view('PoadItemCard', (p) => el(PoadCard, { header: str(p, 'header') || undefined, subheader: str(p, 'subheader') || undefined, class: 'poad-front__fill' }, () => h('p', { class: 'poad-front__body' }, str(p, 'body'))));
141
+ return view('PoadItemCard', (p) =>
142
+ el(PoadCard, { header: opt(p, 'header'), subheader: opt(p, 'subheader'), hoverable: bool(p, 'hoverable'), flat: bool(p, 'flat'), compact: bool(p, 'compact'), padding: opt(p, 'padding'), class: 'poad-front__fill' }, () =>
143
+ h('p', { class: 'poad-front__body' }, str(p, 'body')),
144
+ ),
145
+ );
111
146
  },
112
147
  panel: async () => {
113
148
  const { PoadPanel } = await import('@poadio/ui-vue/panel');
114
- return view('PoadItemPanel', (p) => el(PoadPanel, { header: str(p, 'header') || undefined, toggleable: bool(p, 'toggleable'), class: 'poad-front__fill' }, () => h('p', { class: 'poad-front__body' }, str(p, 'body'))));
149
+ return model('PoadItemPanel', (p) => bool(p, 'toggleable') && bool(p, 'collapsed'), (p, _ctx, v) =>
150
+ el(PoadPanel, { header: opt(p, 'header'), toggleable: bool(p, 'toggleable'), variant: opt(p, 'variant'), flat: bool(p, 'flat'), ...bind(v, 'collapsed'), class: 'poad-front__fill' }, () =>
151
+ h('p', { class: 'poad-front__body' }, str(p, 'body')),
152
+ ),
153
+ );
115
154
  },
116
155
  fieldset: async () => {
117
156
  const { PoadFieldset } = await import('@poadio/ui-vue/fieldset');
118
- return view('PoadItemFieldset', (p) => el(PoadFieldset, { legend: str(p, 'legend') || undefined, toggleable: bool(p, 'toggleable'), class: 'poad-front__fill' }, () => h('p', { class: 'poad-front__body' }, str(p, 'body'))));
157
+ return model('PoadItemFieldset', (p) => bool(p, 'toggleable') && bool(p, 'collapsed'), (p, _ctx, v) =>
158
+ el(PoadFieldset, { legend: opt(p, 'legend'), toggleable: bool(p, 'toggleable'), ...bind(v, 'collapsed'), class: 'poad-front__fill' }, () => h('p', { class: 'poad-front__body' }, str(p, 'body'))),
159
+ );
119
160
  },
120
161
  divider: async () => {
121
162
  const { PoadDivider } = await import('@poadio/ui-vue/divider');
122
- return view('PoadItemDivider', (p) => h('div', { class: 'poad-front__center-v' }, [el(PoadDivider, { align: str(p, 'align'), dashed: bool(p, 'dashed') }, str(p, 'label') ? () => str(p, 'label') : undefined)]));
163
+ return view('PoadItemDivider', (p) => {
164
+ const vertical = bool(p, 'vertical');
165
+ return h('div', vertical ? { class: 'poad-front__divider-v' } : { class: 'poad-front__center-v' }, [
166
+ el(PoadDivider, { align: str(p, 'align'), dashed: bool(p, 'dashed'), vertical }, str(p, 'label') ? () => str(p, 'label') : undefined),
167
+ ]);
168
+ });
123
169
  },
124
170
  tabs: async () => {
125
171
  const { PoadTabs, PoadTab } = await import('@poadio/ui-vue/tabs');
126
- return view('PoadItemTabs', (p, ctx) => el(PoadTabs, { variant: str(p, 'variant') }, () => list(p, 'tabs').map((l, i) => el(PoadTab, { key: i, value: i, label: l }, () => h('p', { class: 'poad-front__body' }, contentOf(ctx, l))))));
172
+ return model('PoadItemTabs', (p) => num(p, 'activeIndex'), (p, ctx, v) =>
173
+ el(PoadTabs, { variant: str(p, 'variant'), size: opt(p, 'size'), stretch: bool(p, 'stretch'), scrollable: bool(p, 'scrollable'), ...bind(v, 'activeIndex') }, () =>
174
+ list(p, 'tabs').map((l, i) => el(PoadTab, { key: i, label: l }, () => h('p', { class: 'poad-front__body' }, contentOf(ctx, l)))),
175
+ ),
176
+ );
127
177
  },
128
178
  accordion: async () => {
129
179
  const { PoadAccordion, PoadAccordionPanel } = await import('@poadio/ui-vue/accordion');
130
- return view('PoadItemAccordion', (p, ctx) =>
131
- el(PoadAccordion, { multiple: bool(p, 'multiple'), modelValue: bool(p, 'multiple') ? ['0'] : '0' }, () => list(p, 'panels').map((l, i) => el(PoadAccordionPanel, { key: i, value: String(i), header: l }, () => h('p', { class: 'poad-front__body' }, contentOf(ctx, l))))),
180
+ const open = (p: ItemProps): string | string[] | null => {
181
+ const i = onum(p, 'openIndex');
182
+ return bool(p, 'multiple') ? (i === undefined ? [] : [String(i)]) : i === undefined ? null : String(i);
183
+ };
184
+ return model('PoadItemAccordion', open, (p, ctx, v) =>
185
+ el(PoadAccordion, { multiple: bool(p, 'multiple'), expandIcon: opt(p, 'expandIcon'), flush: bool(p, 'flush'), ...bind(v) }, () =>
186
+ list(p, 'panels').map((l, i) => el(PoadAccordionPanel, { key: i, value: String(i), header: l }, () => h('p', { class: 'poad-front__body' }, contentOf(ctx, l)))),
187
+ ),
132
188
  );
133
189
  },
134
190
  stepper: async () => {
135
191
  const { PoadStepper, PoadStep } = await import('@poadio/ui-vue/stepper');
136
- return model('PoadItemStepper', (p) => num(p, 'current'), (p, _ctx, v) => el(PoadStepper, bind(v), () => list(p, 'steps').map((l, i) => el(PoadStep, { key: i, label: l }))));
192
+ return model('PoadItemStepper', (p) => num(p, 'current'), (p, _ctx, v) =>
193
+ el(PoadStepper, { orientation: str(p, 'orientation'), size: opt(p, 'size'), clickable: bool(p, 'clickable'), linear: bool(p, 'linear'), ariaLabel: opt(p, 'ariaLabel'), ...bind(v) }, () =>
194
+ list(p, 'steps').map((l, i) => el(PoadStep, { key: i, label: l })),
195
+ ),
196
+ );
137
197
  },
138
198
  splitter: async () => {
139
199
  const { PoadSplitter, PoadSplitterPanel } = await import('@poadio/ui-vue/splitter');
140
200
  return view('PoadItemSplitter', (p) =>
141
- el(PoadSplitter, { layout: str(p, 'layout'), class: 'poad-front__fill' }, () => list(p, 'panels').map((l, i) => el(PoadSplitterPanel, { key: i }, () => h('div', { class: 'poad-front__split' }, l)))),
201
+ el(PoadSplitter, { layout: str(p, 'layout'), gutterSize: num(p, 'gutterSize') || 6, stateKey: opt(p, 'stateKey'), class: 'poad-front__fill' }, () =>
202
+ list(p, 'panels').map((l, i) => el(PoadSplitterPanel, { key: i }, () => h('div', { class: 'poad-front__split' }, l))),
203
+ ),
142
204
  );
143
205
  },
144
206
 
145
207
  // ---------------------------------------------------------------- Formulaires
146
208
  field: async () => {
147
209
  const { PoadField, PoadInput } = await ui.field();
148
- return model('PoadItemField', () => '', (p, _ctx, v) =>
149
- el(PoadField, { label: str(p, 'label') || undefined, hint: str(p, 'hint') || undefined, required: bool(p, 'required') }, () =>
150
- el(PoadInput, { type: str(p, 'inputType') || 'text', placeholder: str(p, 'placeholder') || undefined, required: bool(p, 'required'), ...bind(v) }),
210
+ return model('PoadItemField', (p) => str(p, 'value'), (p, _ctx, v) =>
211
+ el(PoadField, fieldShell(p), () =>
212
+ el(PoadInput, {
213
+ type: str(p, 'inputType') || 'text', placeholder: opt(p, 'placeholder'), required: bool(p, 'required'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'),
214
+ maxlength: onum(p, 'maxLength'), mono: bool(p, 'mono'), size: opt(p, 'size'), ...bind(v),
215
+ }),
151
216
  ),
152
217
  );
153
218
  },
154
219
  textarea: async () => {
155
220
  const { PoadField, PoadTextarea } = await ui.field();
156
- return model('PoadItemTextarea', () => '', (p, _ctx, v) =>
157
- el(PoadField, { label: str(p, 'label') || undefined, required: bool(p, 'required'), class: 'poad-front__fill-field' }, () => el(PoadTextarea, { placeholder: str(p, 'placeholder') || undefined, ...bind(v) })),
221
+ return model('PoadItemTextarea', (p) => str(p, 'value'), (p, _ctx, v) =>
222
+ el(PoadField, { ...fieldShell(p), class: 'poad-front__fill-field' }, () =>
223
+ el(PoadTextarea, {
224
+ placeholder: opt(p, 'placeholder'), required: bool(p, 'required'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'),
225
+ maxlength: onum(p, 'maxLength'), mono: bool(p, 'mono'), size: opt(p, 'size'), ...bind(v),
226
+ }),
227
+ ),
158
228
  );
159
229
  },
160
230
  button: async () => {
161
- const { PoadButton } = await ui.button();
162
- return view('PoadItemButton', (p) => el(PoadButton, { severity: str(p, 'severity'), variant: str(p, 'variant'), block: bool(p, 'block') }, () => str(p, 'label')));
231
+ const [{ PoadButton }, { PoadIcon }] = await Promise.all([ui.button(), ui.icon()]);
232
+ return view('PoadItemButton', (p) => {
233
+ const name = str(p, 'icon');
234
+ const label = str(p, 'label');
235
+ return el(PoadButton, {
236
+ severity: str(p, 'severity'), variant: str(p, 'variant'), size: opt(p, 'size'), block: bool(p, 'block'), disabled: bool(p, 'disabled'), loading: bool(p, 'loading'),
237
+ // Une icône sans libellé : bouton carré, nommé pour les lecteurs d'écran par l'infobulle de la case
238
+ icon: !!name && !label,
239
+ }, () => [name ? el(PoadIcon, { name, size: 16 }) : null, label]);
240
+ });
163
241
  },
164
242
  'button-group': async () => {
165
243
  const [{ PoadButtonGroup }, { PoadButton }] = await Promise.all([import('@poadio/ui-vue/button-group'), ui.button()]);
166
- return model('PoadItemButtonGroup', (p) => list(p, 'buttons')[0] ?? null, (p, _ctx, v) =>
167
- el(PoadButtonGroup, { selectable: 'single', size: str(p, 'size'), ...bind(v) }, () => list(p, 'buttons').map((l) => el(PoadButton, { key: l, value: l }, () => l))),
244
+ return model('PoadItemButtonGroup', (p) => (str(p, 'selectable') === 'multiple' ? [] : (list(p, 'buttons')[0] ?? null)), (p, _ctx, v) =>
245
+ el(PoadButtonGroup, {
246
+ selectable: orNull(p, 'selectable'), size: str(p, 'size'), orientation: opt(p, 'orientation'), look: opt(p, 'look'), attached: bool(p, 'attached'), stretch: bool(p, 'stretch'),
247
+ ariaLabel: opt(p, 'ariaLabel'), ...bind(v),
248
+ }, () => list(p, 'buttons').map((l) => el(PoadButton, { key: l, value: l }, () => l))),
168
249
  );
169
250
  },
170
251
  checkbox: async () => {
171
252
  const { PoadCheckbox } = await import('@poadio/ui-vue/checkbox');
172
- return model('PoadItemCheckbox', (p) => bool(p, 'checked'), (p, _ctx, v) => h('div', { class: 'poad-front__center-v' }, [el(PoadCheckbox, { label: str(p, 'label'), ...bind(v) })]));
253
+ return model('PoadItemCheckbox', (p) => ({ checked: bool(p, 'checked'), indeterminate: bool(p, 'indeterminate') }), (p, _ctx, v) =>
254
+ h('div', { class: 'poad-front__center-v' }, [
255
+ el(PoadCheckbox, {
256
+ label: str(p, 'label'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'),
257
+ modelValue: v.value.checked, 'onUpdate:modelValue': (x: boolean) => (v.value = { ...v.value, checked: x }),
258
+ indeterminate: v.value.indeterminate, 'onUpdate:indeterminate': (x: boolean) => (v.value = { ...v.value, indeterminate: x }),
259
+ }),
260
+ ]),
261
+ );
173
262
  },
174
263
  radio: async () => {
175
264
  const { PoadRadioGroup, PoadRadio } = await import('@poadio/ui-vue/radio');
176
265
  return model('PoadItemRadio', (p) => list(p, 'options')[0] ?? null, (p, _ctx, v) =>
177
266
  h('div', { class: 'poad-front__group' }, [
178
267
  str(p, 'label') ? h('span', { class: 'poad-front__label' }, str(p, 'label')) : null,
179
- el(PoadRadioGroup, { orientation: str(p, 'orientation'), ariaLabel: str(p, 'label') || undefined, ...bind(v) }, () => list(p, 'options').map((o) => el(PoadRadio, { key: o, value: o, label: o }))),
268
+ el(PoadRadioGroup, { orientation: str(p, 'orientation'), disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'label'), ...bind(v) }, () => list(p, 'options').map((o) => el(PoadRadio, { key: o, value: o, label: o }))),
180
269
  ]),
181
270
  );
182
271
  },
183
272
  switch: async () => {
184
273
  const { PoadSwitch } = await import('@poadio/ui-vue/switch');
185
- return model('PoadItemSwitch', (p) => bool(p, 'checked'), (p, _ctx, v) => h('div', { class: 'poad-front__center-v' }, [el(PoadSwitch, { label: str(p, 'label'), ...bind(v) })]));
274
+ return model('PoadItemSwitch', (p) => bool(p, 'checked'), (p, _ctx, v) =>
275
+ h('div', { class: 'poad-front__center-v' }, [
276
+ el(PoadSwitch, { label: str(p, 'label'), labelPosition: opt(p, 'labelPosition'), size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'), ...bind(v) }),
277
+ ]),
278
+ );
186
279
  },
187
280
  'toggle-button': async () => {
188
281
  const { PoadToggleButton } = await import('@poadio/ui-vue/toggle-button');
189
- return model('PoadItemToggle', () => false, (p, _ctx, v) => el(PoadToggleButton, { onLabel: str(p, 'onLabel'), offLabel: str(p, 'offLabel'), ...bind(v) }));
282
+ return model('PoadItemToggle', (p) => bool(p, 'checked'), (p, _ctx, v) =>
283
+ el(PoadToggleButton, {
284
+ onLabel: str(p, 'onLabel'), offLabel: str(p, 'offLabel'), onIcon: opt(p, 'onIcon'), offIcon: opt(p, 'offIcon'), severity: opt(p, 'severity'), size: opt(p, 'size'),
285
+ disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'), ...bind(v),
286
+ }),
287
+ );
190
288
  },
191
289
  segmented: async () => {
192
290
  const { PoadSegmented } = await import('@poadio/ui-vue/segmented');
193
- return model('PoadItemSegmented', (p) => list(p, 'options')[0] ?? null, (p, _ctx, v) => el(PoadSegmented, { options: options(p), block: bool(p, 'block'), ...bind(v) }));
291
+ const first = (p: ItemProps) => list(p, 'options')[0] ?? null;
292
+ return model('PoadItemSegmented', (p) => (bool(p, 'multiple') ? (first(p) === null ? [] : [first(p)]) : first(p)), (p, _ctx, v) =>
293
+ el(PoadSegmented, {
294
+ options: options(p, 'options'), block: bool(p, 'block'), size: opt(p, 'size'), shape: opt(p, 'shape'), multiple: bool(p, 'multiple'), allowEmpty: bool(p, 'allowEmpty'),
295
+ disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'ariaLabel'), ...bind(v),
296
+ }),
297
+ );
194
298
  },
195
299
  select: async () =>
196
- labelled('PoadItemSelect', () => import('@poadio/ui-vue/select').then((m) => m.PoadSelect), () => null, (p) => ({ options: options(p), optionLabel: 'label', optionValue: 'value', placeholder: str(p, 'placeholder') || undefined })),
300
+ labelled('PoadItemSelect', () => import('@poadio/ui-vue/select').then((m) => m.PoadSelect), () => null, (p) => ({
301
+ options: options(p, 'options'), optionLabel: 'label', optionValue: 'value', placeholder: opt(p, 'placeholder'),
302
+ filter: bool(p, 'filter'), filterPlaceholder: opt(p, 'filterPlaceholder'), clearable: bool(p, 'clearable'), emptyMessage: opt(p, 'emptyMessage'), emptyFilterMessage: opt(p, 'emptyFilterMessage'),
303
+ size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), panelMaxHeight: num(p, 'panelMaxHeight') || 260, mobile: opt(p, 'mobile'), sheetTitle: opt(p, 'sheetTitle'),
304
+ ariaLabel: opt(p, 'ariaLabel'),
305
+ })),
197
306
  combo: async () =>
198
- labelled('PoadItemCombo', () => import('@poadio/ui-vue/combo').then((m) => m.PoadCombo), () => '', (p) => ({ suggestions: list(p, 'options'), placeholder: str(p, 'placeholder') || undefined, dropdown: true })),
307
+ labelled('PoadItemCombo', () => import('@poadio/ui-vue/combo').then((m) => m.PoadCombo), (p) => (bool(p, 'multiple') ? ([] as string[]) : ''), (p) => ({
308
+ suggestions: list(p, 'options'), placeholder: opt(p, 'placeholder'), dropdown: bool(p, 'dropdown'), forceSelection: bool(p, 'forceSelection'), multiple: bool(p, 'multiple'),
309
+ clearable: bool(p, 'clearable'), minLength: num(p, 'minLength'), delay: num(p, 'delay'), emptyMessage: opt(p, 'emptyMessage'), size: opt(p, 'size'), panelMaxHeight: num(p, 'panelMaxHeight') || 260,
310
+ disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'),
311
+ })),
199
312
  listbox: async () => {
200
- const { PoadListbox } = await import('@poadio/ui-vue/listbox');
201
- return model('PoadItemListbox', (p) => (bool(p, 'multiple') ? [] : null), (p, _ctx, v) =>
202
- el(PoadListbox, { options: options(p), optionLabel: 'label', optionValue: 'value', multiple: bool(p, 'multiple'), filter: bool(p, 'filter'), class: 'poad-front__fill', ...bind(v) }),
203
- );
313
+ const [{ PoadListbox }, { PoadField }] = await Promise.all([import('@poadio/ui-vue/listbox'), ui.field()]);
314
+ return model('PoadItemListbox', (p) => (bool(p, 'multiple') ? [] : null), (p, _ctx, v) => {
315
+ const box = el(PoadListbox, {
316
+ options: options(p, 'options'), optionLabel: 'label', optionValue: 'value', multiple: bool(p, 'multiple'), checkbox: bool(p, 'checkbox'), filter: bool(p, 'filter'),
317
+ filterPlaceholder: opt(p, 'filterPlaceholder'), emptyMessage: opt(p, 'emptyMessage'), emptyFilterMessage: opt(p, 'emptyFilterMessage'),
318
+ selectAll: bool(p, 'selectAll'), selectAllLabel: opt(p, 'selectAllLabel'), metaKeySelection: bool(p, 'metaKeySelection'),
319
+ size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel') ?? opt(p, 'label'), class: 'poad-front__fill', ...bind(v),
320
+ });
321
+ // Sans libellé, la liste seule (comme avant) ; avec, le libellé au-dessus et la liste qui remplit le reste
322
+ return str(p, 'label') ? el(PoadField, { label: str(p, 'label'), disabled: bool(p, 'disabled'), size: opt(p, 'size'), plain: true, class: 'poad-front__fill-field is-list' }, () => box) : box;
323
+ });
204
324
  },
205
325
  number: async () =>
206
- labelled('PoadItemNumber', () => import('@poadio/ui-vue/number').then((m) => m.PoadNumber), () => null as number | null, (p) => ({ min: num(p, 'min'), max: num(p, 'max'), suffix: str(p, 'suffix') ? ` ${str(p, 'suffix')}` : undefined })),
326
+ labelled('PoadItemNumber', () => import('@poadio/ui-vue/number').then((m) => m.PoadNumber), (p) => onum(p, 'value') ?? null, (p) => ({
327
+ min: onum(p, 'min'), max: onum(p, 'max'), step: onum(p, 'step'), decimals: onum(p, 'decimals'),
328
+ prefix: str(p, 'prefix') ? `${str(p, 'prefix')} ` : undefined, suffix: str(p, 'suffix') ? ` ${str(p, 'suffix')}` : undefined,
329
+ placeholder: opt(p, 'placeholder'), showButtons: bool(p, 'showButtons'), size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'),
330
+ })),
207
331
  password: async () =>
208
- labelled('PoadItemPassword', () => import('@poadio/ui-vue/password').then((m) => m.PoadPassword), () => '', (p) => ({ placeholder: str(p, 'placeholder') || undefined, feedback: bool(p, 'feedback'), autocomplete: 'new-password' })),
332
+ labelled('PoadItemPassword', () => import('@poadio/ui-vue/password').then((m) => m.PoadPassword), () => '', (p) => ({
333
+ placeholder: opt(p, 'placeholder'), feedback: bool(p, 'feedback'), toggleMask: bool(p, 'toggleMask'), autocomplete: str(p, 'autocomplete') || 'new-password', disabled: bool(p, 'disabled'),
334
+ })),
209
335
  mask: async () => {
210
336
  const [{ PoadField, PoadInput }, { vPoadMask }] = await Promise.all([ui.field(), import('@poadio/ui-vue/mask')]);
211
- return view('PoadItemMask', (p) => el(PoadField, { label: str(p, 'label') || undefined }, () => withDirectives(el(PoadInput, { key: str(p, 'preset'), inputmode: 'text' }), [[vPoadMask, { preset: str(p, 'preset') }]])));
337
+ return view('PoadItemMask', (p) => {
338
+ const mask = { preset: str(p, 'preset'), mask: opt(p, 'mask'), slotChar: opt(p, 'slotChar'), autoClear: bool(p, 'autoClear') };
339
+ return el(PoadField, fieldShell(p), () =>
340
+ withDirectives(el(PoadInput, { key: JSON.stringify(mask), inputmode: 'text', required: bool(p, 'required'), disabled: bool(p, 'disabled'), size: opt(p, 'size') }), [[vPoadMask, mask]]),
341
+ );
342
+ });
212
343
  },
213
344
  datepicker: async () =>
214
- labelled('PoadItemDate', () => import('@poadio/ui-vue/datepicker').then((m) => m.PoadDatepicker), () => null, (p) => ({ mode: str(p, 'mode'), selectionMode: bool(p, 'range') ? 'range' : 'single' })),
215
- color: async () => labelled('PoadItemColor', () => import('@poadio/ui-vue/colorpicker').then((m) => m.PoadColorpicker), () => null, (p) => ({ alpha: bool(p, 'alpha') })),
345
+ labelled('PoadItemDate', () => import('@poadio/ui-vue/datepicker').then((m) => m.PoadDatepicker), (p) => (str(p, 'mode') === 'date' && !bool(p, 'range') ? opt(p, 'value') ?? null : null), (p) => ({
346
+ mode: str(p, 'mode'), selectionMode: bool(p, 'range') ? 'range' : 'single', placeholder: opt(p, 'placeholder'), format: opt(p, 'format') ?? null,
347
+ min: opt(p, 'min') ?? null, max: opt(p, 'max') ?? null, showIcon: bool(p, 'showIcon'), showWeek: bool(p, 'showWeek'), showButtonBar: bool(p, 'showButtonBar'),
348
+ hourFormat: numChoice(p, 'hourFormat'), firstDayOfWeek: numChoice(p, 'firstDayOfWeek'), stepMinute: num(p, 'stepMinute') || 1, showSeconds: bool(p, 'showSeconds'),
349
+ clearable: bool(p, 'clearable'), manualInput: bool(p, 'manualInput'), readonlyInput: bool(p, 'readonlyInput'), closeOnSelect: tri(p, 'closeOnSelect'), mobile: opt(p, 'mobile'),
350
+ size: opt(p, 'size'), disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'ariaLabel'),
351
+ })),
352
+ color: async () =>
353
+ labelled('PoadItemColor', () => import('@poadio/ui-vue/colorpicker').then((m) => m.PoadColorpicker), () => null, (p) => ({
354
+ alpha: bool(p, 'alpha'), format: opt(p, 'format'), placeholder: opt(p, 'placeholder'), clearable: bool(p, 'clearable'), size: opt(p, 'size'), disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'ariaLabel'),
355
+ })),
216
356
  slider: async () =>
217
- labelled('PoadItemSlider', () => import('@poadio/ui-vue/slider').then((m) => m.PoadSlider), (p) => num(p, 'min'), (p) => ({ min: num(p, 'min'), max: num(p, 'max'), step: num(p, 'step') || 1, showValue: 'drag' })),
357
+ labelled('PoadItemSlider', () => import('@poadio/ui-vue/slider').then((m) => m.PoadSlider), (p) => (bool(p, 'range') ? [num(p, 'min'), num(p, 'max')] : num(p, 'min')), (p) => ({
358
+ min: num(p, 'min'), max: num(p, 'max'), step: num(p, 'step') || 1, range: bool(p, 'range'), showValue: str(p, 'showValue') || 'drag', marks: str(p, 'marks') === 'steps' ? 'steps' : undefined,
359
+ showTicks: bool(p, 'showTicks'), severity: opt(p, 'severity'), size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'),
360
+ })),
218
361
  rating: async () => {
219
- const { PoadRating } = await import('@poadio/ui-vue/rating');
220
- return model('PoadItemRating', () => null as number | null, (p, _ctx, v) => h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadRating, { max: num(p, 'max') || 5, readonly: bool(p, 'readonly'), ...bind(v) })]));
362
+ const [{ PoadRating }, { PoadField }] = await Promise.all([import('@poadio/ui-vue/rating'), ui.field()]);
363
+ return model('PoadItemRating', (p) => onum(p, 'value') ?? null, (p, _ctx, v) => {
364
+ const stars = el(PoadRating, {
365
+ max: num(p, 'max') || 5, readonly: bool(p, 'readonly'), disabled: bool(p, 'disabled'), allowHalf: bool(p, 'allowHalf'), clearable: bool(p, 'clearable'), icon: opt(p, 'icon'),
366
+ size: opt(p, 'size'), severity: opt(p, 'severity'), showValue: bool(p, 'showValue'), ariaLabel: opt(p, 'ariaLabel') ?? opt(p, 'label'), ...bind(v),
367
+ });
368
+ return h('div', { class: 'poad-front__center-v is-fit' }, [str(p, 'label') ? el(PoadField, { label: str(p, 'label'), disabled: bool(p, 'disabled'), plain: true }, () => stars) : stars]);
369
+ });
221
370
  },
222
371
  upload: async () => {
223
372
  const { PoadUpload } = await import('@poadio/ui-vue/upload');
373
+ const mb = (p: ItemProps) => (onum(p, 'maxFileSize') === undefined ? null : Math.round(onum(p, 'maxFileSize')! * 1024 * 1024));
224
374
  // Choix seulement : l'envoi vers le stockage du projet viendra avec la liaison aux données
225
- return view('PoadItemUpload', (p) => el(PoadUpload, { mode: str(p, 'mode'), multiple: bool(p, 'multiple'), accept: str(p, 'accept'), selectOnly: true }));
375
+ return view('PoadItemUpload', (p) =>
376
+ el(PoadUpload, {
377
+ mode: str(p, 'mode'), multiple: bool(p, 'multiple'), accept: str(p, 'accept'), selectOnly: true, maxFileSize: mb(p), maxFiles: onum(p, 'maxFiles') ?? null,
378
+ hint: opt(p, 'hint'), dropLabel: opt(p, 'dropLabel'), browseLabel: opt(p, 'browseLabel'), chooseLabel: opt(p, 'chooseLabel'), cancelLabel: opt(p, 'cancelLabel'),
379
+ invalidFileSizeMessage: opt(p, 'invalidFileSizeMessage'), invalidFileTypeMessage: opt(p, 'invalidFileTypeMessage'), invalidFileLimitMessage: opt(p, 'invalidFileLimitMessage'),
380
+ size: opt(p, 'size'), severity: opt(p, 'severity'), previews: bool(p, 'previews'), showCancelButton: bool(p, 'showCancelButton'), disabled: bool(p, 'disabled'),
381
+ }),
382
+ );
226
383
  },
227
384
  richtext: async () => {
228
385
  const { PoadRichText } = await import('@poadio/ui-vue/richtext');
229
- return model('PoadItemRichText', () => '', (p, _ctx, v) => el(PoadRichText, { placeholder: str(p, 'placeholder'), minHeight: '100%', maxHeight: '100%', class: 'poad-front__fill', ...bind(v) }));
386
+ return model('PoadItemRichText', () => '', (p, _ctx, v) =>
387
+ el(PoadRichText, {
388
+ placeholder: str(p, 'placeholder'), toolbar: list(p, 'toolbar'), showCount: bool(p, 'showCount'), format: opt(p, 'format'), markdown: bool(p, 'markdown'),
389
+ disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), maxLength: num(p, 'maxLength'), ariaLabel: opt(p, 'ariaLabel'),
390
+ minHeight: '100%', maxHeight: '100%', class: 'poad-front__fill', ...bind(v),
391
+ }),
392
+ );
230
393
  },
231
394
 
232
395
  multiselect: async () =>
233
- labelled('PoadItemMultiselect', () => import('@poadio/ui-vue/multiselect').then((m) => m.PoadMultiselect), () => [] as string[], (p) => ({ options: options(p), optionLabel: 'label', optionValue: 'value', placeholder: str(p, 'placeholder') || undefined })),
396
+ labelled('PoadItemMultiselect', () => import('@poadio/ui-vue/multiselect').then((m) => m.PoadMultiselect), () => [] as string[], (p) => ({
397
+ options: options(p, 'options'), optionLabel: 'label', optionValue: 'value', placeholder: opt(p, 'placeholder'), display: opt(p, 'display'),
398
+ maxSelectedLabels: onum(p, 'maxSelectedLabels') ?? null, selectedItemsLabel: opt(p, 'selectedItemsLabel'), showToggleAll: bool(p, 'showToggleAll'), selectionLimit: onum(p, 'selectionLimit') ?? null,
399
+ filter: bool(p, 'filter'), filterPlaceholder: opt(p, 'filterPlaceholder'), clearable: bool(p, 'clearable'), emptyMessage: opt(p, 'emptyMessage'), emptyFilterMessage: opt(p, 'emptyFilterMessage'),
400
+ panelMaxHeight: num(p, 'panelMaxHeight') || 260, mobile: opt(p, 'mobile'), sheetTitle: opt(p, 'sheetTitle'), size: opt(p, 'size'), disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'),
401
+ ariaLabel: opt(p, 'ariaLabel'),
402
+ })),
234
403
  picklist: async () => {
235
404
  const { PoadPicklist } = await import('@poadio/ui-vue/picklist');
236
405
  return model('PoadItemPicklist', () => [] as { label: string; value: string }[], (p, _ctx, v) =>
237
- el(PoadPicklist, { options: options(p), dataKey: 'value', optionLabel: 'label', sourceHeader: str(p, 'sourceHeader') || undefined, targetHeader: str(p, 'targetHeader') || undefined, class: 'poad-front__fill', ...bind(v) }),
406
+ el(PoadPicklist, {
407
+ options: options(p, 'options'), dataKey: 'value', optionLabel: 'label', sourceHeader: opt(p, 'sourceHeader'), targetHeader: opt(p, 'targetHeader'),
408
+ sourceEmpty: opt(p, 'sourceEmpty'), targetEmpty: opt(p, 'targetEmpty'), filter: bool(p, 'filter'), filterPlaceholder: opt(p, 'filterPlaceholder'),
409
+ showSourceControls: bool(p, 'showSourceControls'), showTargetControls: bool(p, 'showTargetControls'), listHeight: opt(p, 'listHeight'), stackAt: num(p, 'stackAt'),
410
+ metaKeySelection: bool(p, 'metaKeySelection'), disabled: bool(p, 'disabled'), class: 'poad-front__fill', ...bind(v),
411
+ }),
238
412
  );
239
413
  },
240
414
  orderlist: async () => {
241
415
  const { PoadOrderlist } = await import('@poadio/ui-vue/orderlist');
242
- return model('PoadItemOrderlist', (p) => options(p), (p, _ctx, v) => el(PoadOrderlist, { optionLabel: 'label', dataKey: 'value', header: str(p, 'header') || undefined, class: 'poad-front__fill', ...bind(v) }));
416
+ return model('PoadItemOrderlist', (p) => options(p, 'items'), (p, _ctx, v) =>
417
+ el(PoadOrderlist, {
418
+ optionLabel: 'label', dataKey: 'value', header: opt(p, 'header'), emptyMessage: opt(p, 'emptyMessage'), filterPlaceholder: opt(p, 'filterPlaceholder'),
419
+ controls: opt(p, 'controls'), striped: bool(p, 'striped'), listHeight: opt(p, 'listHeight'), dragHandle: bool(p, 'dragHandle'), filter: bool(p, 'filter'),
420
+ metaKeySelection: bool(p, 'metaKeySelection'), disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'ariaLabel'), class: 'poad-front__fill', ...bind(v),
421
+ }),
422
+ );
243
423
  },
244
424
  inplace: async () => {
245
425
  const [{ PoadInplace }, { PoadInput }] = await Promise.all([import('@poadio/ui-vue/inplace'), ui.field()]);
246
- return model('PoadItemInplace', (p) => str(p, 'display'), (_p, _ctx, v) =>
247
- h('div', { class: 'poad-front__center-v' }, [el(PoadInplace, { display: v.value }, { content: () => el(PoadInput, { ...bind(v) }) })]),
426
+ return model('PoadItemInplace', (p) => str(p, 'display'), (p, _ctx, v) =>
427
+ h('div', { class: 'poad-front__center-v' }, [
428
+ el(PoadInplace, {
429
+ display: v.value, showIcon: bool(p, 'showIcon'), closable: bool(p, 'closable'), closeOnEscape: bool(p, 'closeOnEscape'), closeOnBlur: bool(p, 'closeOnBlur'),
430
+ disabled: bool(p, 'disabled'), ariaLabel: opt(p, 'ariaLabel'),
431
+ }, { content: () => el(PoadInput, { ...bind(v) }) }),
432
+ ]),
248
433
  );
249
434
  },
250
435
  'split-button': async () => {
251
436
  const { PoadSplitButton } = await import('@poadio/ui-vue/split-button');
252
- return view('PoadItemSplitButton', (p) => h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadSplitButton, { label: str(p, 'label'), items: list(p, 'items').map((l) => ({ label: l })), severity: str(p, 'severity') })]));
437
+ return view('PoadItemSplitButton', (p) =>
438
+ h('div', { class: 'poad-front__center-v is-fit' }, [
439
+ el(PoadSplitButton, {
440
+ label: str(p, 'label'), items: asItems(p, 'items'), severity: str(p, 'severity'), variant: opt(p, 'variant'), size: opt(p, 'size'), icon: opt(p, 'icon'),
441
+ menuMinWidth: num(p, 'menuMinWidth') || 180, mobile: opt(p, 'mobile'), disabled: bool(p, 'disabled'), loading: bool(p, 'loading'), dropdownAriaLabel: opt(p, 'dropdownAriaLabel'),
442
+ }),
443
+ ]),
444
+ );
253
445
  },
254
446
  'filter-chip': async () => {
255
447
  const { PoadFilterChip } = await import('@poadio/ui-vue/filter-chip');
256
448
  return model('PoadItemFilterChip', (p) => bool(p, 'active'), (p, _ctx, v) =>
257
- h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadFilterChip, { label: str(p, 'label'), value: str(p, 'value'), active: v.value, onClick: () => (v.value = !v.value), onRemove: () => (v.value = false) })]),
449
+ h('div', { class: 'poad-front__center-v is-fit' }, [
450
+ el(PoadFilterChip, {
451
+ label: str(p, 'label'), value: str(p, 'value'), icon: opt(p, 'icon'), removable: bool(p, 'removable'), disabled: bool(p, 'disabled'),
452
+ active: v.value, onClick: () => (v.value = !v.value), onRemove: () => (v.value = false),
453
+ }),
454
+ ]),
258
455
  );
259
456
  },
260
457
 
@@ -263,22 +460,36 @@ export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
263
460
  const { PoadCodeEditor, providePoadMonaco } = await import('@poadio/ui-vue/code-editor');
264
461
  if (monacoBaseUrl) providePoadMonaco({ baseUrl: monacoBaseUrl });
265
462
  return model('PoadItemCode', (p) => str(p, 'value'), (p, _ctx, v) =>
266
- el(PoadCodeEditor, { language: str(p, 'language') || 'plaintext', readonly: bool(p, 'readonly'), height: '100%', class: 'poad-front__fill', ...bind(v) }),
463
+ el(PoadCodeEditor, {
464
+ language: str(p, 'language') || 'plaintext', readonly: bool(p, 'readonly'), disabled: bool(p, 'disabled'), toolbar: bool(p, 'toolbar'), themed: bool(p, 'themed'), ariaLabel: opt(p, 'ariaLabel'),
465
+ height: '100%', class: 'poad-front__fill', ...bind(v),
466
+ }),
267
467
  );
268
468
  },
269
469
  json: async () => {
270
470
  const { PoadJsonEditor } = await import('@poadio/ui-vue/json-editor');
271
- return model('PoadItemJson', (p) => str(p, 'value'), (p, _ctx, v) => el(PoadJsonEditor, { mode: 'string', readonly: bool(p, 'readonly'), height: '100%', class: 'poad-front__fill', ...bind(v) }));
471
+ return model('PoadItemJson', (p) => str(p, 'value'), (p, _ctx, v) =>
472
+ el(PoadJsonEditor, { mode: 'string', placeholder: opt(p, 'placeholder'), toolbar: bool(p, 'toolbar'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'), height: '100%', class: 'poad-front__fill', ...bind(v) }),
473
+ );
272
474
  },
273
475
  'block-editor': async () => {
274
476
  const { PoadBlockEditor } = await import('@poadio/ui-vue/block-editor');
275
- return model('PoadItemBlockEditor', () => null as object | null, (p, _ctx, v) => el(PoadBlockEditor, { placeholder: str(p, 'placeholder') || undefined, minHeight: '100%', class: 'poad-front__fill', ...bind(v) }));
477
+ return model('PoadItemBlockEditor', () => null as object | null, (p, ctx, v) => {
478
+ const levels = list(p, 'headerLevels').map(Number);
479
+ return el(PoadBlockEditor, {
480
+ placeholder: opt(p, 'placeholder'), maxWidth: opt(p, 'maxWidth'), headerLevels: levels.length ? levels : undefined,
481
+ // Sur le canevas, le curseur n'est jamais volé au designer
482
+ autofocus: bool(p, 'autofocus') && !ctx.canvas,
483
+ disabled: bool(p, 'disabled'), readonly: bool(p, 'readonly'), ariaLabel: opt(p, 'ariaLabel'), minHeight: '100%', class: 'poad-front__fill', ...bind(v),
484
+ });
485
+ });
276
486
  },
277
487
  'block-view': async () => {
278
488
  const { PoadBlockView } = await import('@poadio/ui-vue/block-view');
279
489
  return view('PoadItemBlockView', (p) =>
280
490
  el(PoadBlockView, {
281
491
  data: { blocks: [...(str(p, 'title') ? [{ type: 'header', data: { text: str(p, 'title'), level: 2 } }] : []), ...str(p, 'body').split(/\n+/).filter(Boolean).map((t) => ({ type: 'paragraph', data: { text: t } }))] },
492
+ externalLinksInNewTab: bool(p, 'externalLinksInNewTab'),
282
493
  class: 'poad-front__fill',
283
494
  }),
284
495
  );
@@ -291,26 +502,52 @@ export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
291
502
  el(PoadTable, {
292
503
  value: [],
293
504
  columns: list(p, 'columns').map((c, i) => ({ field: `c${i}`, header: c })),
294
- emptyMessage: str(p, 'emptyMessage') || undefined,
295
- paginator: bool(p, 'paginator'),
296
- striped: bool(p, 'striped'),
297
- // Sans source de données, la barre n'aurait qu'un compteur à 0 : elle reviendra avec la liaison au store
298
- showToolbar: false,
505
+ title: opt(p, 'title'), emptyMessage: opt(p, 'emptyMessage'), emptyHint: opt(p, 'emptyHint'), emptyIcon: str(p, 'emptyIcon'), searchPlaceholder: opt(p, 'searchPlaceholder'),
506
+ exportFilename: str(p, 'exportFilename') || 'export', currentPageReportTemplate: opt(p, 'currentPageReportTemplate'),
507
+ striped: bool(p, 'striped'), dense: bool(p, 'dense'), hoverable: bool(p, 'hoverable'), bordered: bool(p, 'bordered'), borderless: bool(p, 'borderless'),
508
+ stickyHeader: bool(p, 'stickyHeader'), stickyFirstColumn: bool(p, 'stickyFirstColumn'), showRowNumber: bool(p, 'showRowNumber'), scrollHeight: opt(p, 'scrollHeight'),
509
+ responsive: opt(p, 'responsive'), stackAt: num(p, 'stackAt'),
510
+ // Sans source de données, la barre n'aurait qu'un compteur à 0 : décochée par défaut (`showToolbar`)
511
+ showToolbar: bool(p, 'showToolbar'), showCount: bool(p, 'showCount'), showSearch: bool(p, 'showSearch'), showExport: bool(p, 'showExport'), showDensityToggle: bool(p, 'showDensityToggle'),
512
+ columnToggle: bool(p, 'columnToggle'), columnMenu: bool(p, 'columnMenu'), resizableColumns: bool(p, 'resizableColumns'), reorderableColumns: bool(p, 'reorderableColumns'),
513
+ sortMode: opt(p, 'sortMode'), defaultSortOrder: numChoice(p, 'defaultSortOrder'), selectionMode: orNull(p, 'selectionMode'), selectAll: bool(p, 'selectAll'), metaKeySelection: bool(p, 'metaKeySelection'),
514
+ paginator: bool(p, 'paginator'), rows: num(p, 'rows') || 25, pageLinks: num(p, 'pageLinks') || 5, showCurrentPageReport: bool(p, 'showCurrentPageReport'),
515
+ showFirstLastIcon: bool(p, 'showFirstLastIcon'), alwaysShowPaginator: bool(p, 'alwaysShowPaginator'),
299
516
  class: 'poad-front__fill',
300
517
  }),
301
518
  );
302
519
  },
303
520
  dataview: async () => {
304
521
  const { PoadDataview } = await import('@poadio/ui-vue/dataview');
305
- return view('PoadItemDataview', (p) => el(PoadDataview, { value: [], layout: str(p, 'layout'), emptyMessage: str(p, 'emptyMessage') || undefined, class: 'poad-front__fill' }));
522
+ return view('PoadItemDataview', (p) =>
523
+ el(PoadDataview, {
524
+ value: [], layout: str(p, 'layout'), emptyMessage: opt(p, 'emptyMessage'), gridMin: opt(p, 'gridMin'), showLayoutSwitch: bool(p, 'showLayoutSwitch'),
525
+ paginator: bool(p, 'paginator'), rows: num(p, 'rows') || 12, alwaysShowPaginator: bool(p, 'alwaysShowPaginator'), class: 'poad-front__fill',
526
+ }),
527
+ );
306
528
  },
307
529
  tree: async () => {
308
530
  const { PoadTree } = await import('@poadio/ui-vue/tree');
309
- return view('PoadItemTree', (p) => el(PoadTree, { value: list(p, 'nodes').map((l, i) => ({ key: String(i), label: l })), dataKey: 'key' }));
531
+ return view('PoadItemTree', (p) =>
532
+ el(PoadTree, {
533
+ value: list(p, 'nodes').map((l, i) => ({ key: String(i), label: l })), dataKey: 'key',
534
+ filterPlaceholder: opt(p, 'filterPlaceholder'), emptyMessage: opt(p, 'emptyMessage'), emptyFilterMessage: opt(p, 'emptyFilterMessage'), indent: opt(p, 'indent'), showLines: bool(p, 'showLines'),
535
+ selectionMode: orNull(p, 'selectionMode'), selectionPropagation: opt(p, 'selectionPropagation'), toggleOnClick: bool(p, 'toggleOnClick'), filter: bool(p, 'filter'), ariaLabel: opt(p, 'ariaLabel'),
536
+ }),
537
+ );
310
538
  },
311
539
  paginator: async () => {
312
540
  const { PoadPaginator } = await import('@poadio/ui-vue/paginator');
313
- return model('PoadItemPaginator', () => 0, (p, _ctx, v) => el(PoadPaginator, { totalRecords: num(p, 'totalRecords'), rows: num(p, 'rows') || 10, rowsPerPageOptions: [], first: v.value, 'onUpdate:first': (x: number) => (v.value = x) }));
541
+ return model('PoadItemPaginator', () => ({ first: 0, rows: 0 }), (p, _ctx, v) =>
542
+ el(PoadPaginator, {
543
+ totalRecords: num(p, 'totalRecords'), rows: v.value.rows || num(p, 'rows') || 10,
544
+ // Sans le choix, une liste vide (pas de liste) ; avec, celle du composant
545
+ rowsPerPageOptions: bool(p, 'showRowsPerPage') ? undefined : [], rowsPerPageLabel: opt(p, 'rowsPerPageLabel'),
546
+ currentPageReportTemplate: opt(p, 'currentPageReportTemplate'), pageLinks: num(p, 'pageLinks') || 5, showPageLinks: bool(p, 'showPageLinks'), showCurrentPageReport: bool(p, 'showCurrentPageReport'),
547
+ showFirstLastIcon: bool(p, 'showFirstLastIcon'), alwaysShow: bool(p, 'alwaysShow'),
548
+ first: v.value.first, 'onUpdate:first': (x: number) => (v.value = { ...v.value, first: x }), 'onUpdate:rows': (x: number) => (v.value = { ...v.value, rows: x }),
549
+ }),
550
+ );
314
551
  },
315
552
  chart: async () => {
316
553
  const { PoadChart } = await import('@poadio/ui-vue/chart');
@@ -318,6 +555,7 @@ export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
318
555
  el(PoadChart, {
319
556
  type: str(p, 'chartType'),
320
557
  data: { labels: list(p, 'labels'), datasets: [{ label: str(p, 'series'), data: list(p, 'values').map((v) => Number(v.replace(',', '.')) || 0) }] },
558
+ themed: bool(p, 'themed'), showTable: bool(p, 'showTable'), tableToggle: bool(p, 'tableToggle'), accessibleTable: bool(p, 'accessibleTable'), ariaLabel: opt(p, 'ariaLabel'),
321
559
  height: '100%',
322
560
  class: 'poad-front__fill',
323
561
  }),
@@ -325,45 +563,94 @@ export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
325
563
  },
326
564
  meter: async () => {
327
565
  const { PoadMeter } = await import('@poadio/ui-vue/meter');
328
- return view('PoadItemMeter', (p) => h('div', { class: 'poad-front__center-v' }, [el(PoadMeter, { values: [{ label: str(p, 'label') || '—', value: num(p, 'value') }], max: num(p, 'max') || 100, unit: str(p, 'unit') })]));
566
+ return view('PoadItemMeter', (p) =>
567
+ h('div', { class: 'poad-front__center-v' }, [
568
+ el(PoadMeter, {
569
+ values: [{ label: str(p, 'label') || '—', value: num(p, 'value'), ...(cssColor(p, 'color') ? { color: cssColor(p, 'color') } : {}) }],
570
+ min: num(p, 'min'), max: num(p, 'max') || 100, unit: str(p, 'unit'), remainingLabel: opt(p, 'remainingLabel'), size: opt(p, 'size'), labelPosition: opt(p, 'labelPosition'),
571
+ showLabels: bool(p, 'showLabels'), showRemaining: bool(p, 'showRemaining'), ariaLabel: opt(p, 'ariaLabel'),
572
+ }),
573
+ ]),
574
+ );
329
575
  },
330
576
  progress: async () => {
331
577
  const { PoadProgress } = await import('@poadio/ui-vue/progress');
332
- return view('PoadItemProgress', (p) => h('div', { class: 'poad-front__center-v' }, [el(PoadProgress, { value: num(p, 'value'), label: str(p, 'label') || undefined, showValue: bool(p, 'showValue'), severity: str(p, 'severity') })]));
578
+ return view('PoadItemProgress', (p) =>
579
+ h('div', { class: 'poad-front__center-v' }, [
580
+ el(PoadProgress, {
581
+ value: num(p, 'value'), max: num(p, 'max') || 100, label: opt(p, 'label'), showValue: bool(p, 'showValue'), severity: str(p, 'severity'), size: opt(p, 'size'),
582
+ striped: bool(p, 'striped'), indeterminate: bool(p, 'indeterminate'), ariaLabel: opt(p, 'ariaLabel'),
583
+ }),
584
+ ]),
585
+ );
333
586
  },
334
587
  timeline: async () => {
335
588
  const { PoadTimeline } = await import('@poadio/ui-vue/timeline');
336
- return view('PoadItemTimeline', (p) => el(PoadTimeline, { events: list(p, 'events').map((l) => ({ label: l })), layout: str(p, 'layout'), activeIndex: 0 }));
589
+ return view('PoadItemTimeline', (p) =>
590
+ el(PoadTimeline, { events: asItems(p, 'events'), layout: str(p, 'layout'), align: opt(p, 'align'), dense: bool(p, 'dense'), activeIndex: onum(p, 'activeIndex') ?? null }),
591
+ );
337
592
  },
338
593
  orgchart: async () => {
339
594
  const { PoadOrgchart } = await import('@poadio/ui-vue/orgchart');
340
595
  return view('PoadItemOrgchart', (p) =>
341
- el(PoadOrgchart, { value: [{ key: 'root', data: { label: str(p, 'root') }, children: list(p, 'children').map((l, i) => ({ key: `n${i}`, data: { label: l } })) }], class: 'poad-front__fill' }),
596
+ el(PoadOrgchart, {
597
+ value: [{ key: 'root', data: { label: str(p, 'root') }, children: list(p, 'children').map((l, i) => ({ key: `n${i}`, data: { label: l } })) }],
598
+ orientation: opt(p, 'orientation'), nodeWidth: opt(p, 'nodeWidth'), compact: tri(p, 'compact') ?? 'auto', compactAt: num(p, 'compactAt'), collapsible: bool(p, 'collapsible'),
599
+ zoomable: bool(p, 'zoomable'), selectionMode: orNull(p, 'selectionMode'), ariaLabel: opt(p, 'ariaLabel'),
600
+ class: 'poad-front__fill',
601
+ }),
342
602
  );
343
603
  },
344
604
 
345
605
  // ---------------------------------------------------------------- Carte (maplibre chargé à la demande, son propre morceau)
346
606
  map: async () => {
347
607
  const { PoadMap } = await import('@poadio/ui-vue/map');
348
- return view('PoadItemMap', (p) => el(PoadMap, { basemap: str(p, 'basemap') || 'ign-plan', zoom: num(p, 'zoom'), center: [2.4, 46.6], class: 'poad-front__fill' }));
608
+ return view('PoadItemMap', (p) =>
609
+ el(PoadMap, {
610
+ basemap: str(p, 'basemap') || 'ign-plan', overlays: list(p, 'overlays'), overlayOpacity: num(p, 'overlayOpacity'), followTheme: bool(p, 'followTheme'),
611
+ controls: list(p, 'controls'), controlPosition: opt(p, 'controlPosition'), scalePosition: opt(p, 'scalePosition'),
612
+ zoom: num(p, 'zoom'), bearing: num(p, 'bearing'), pitch: num(p, 'pitch'), minZoom: num(p, 'minZoom'), maxZoom: num(p, 'maxZoom') || 20,
613
+ interactive: bool(p, 'interactive'), cooperativeGestures: bool(p, 'cooperativeGestures'), ariaLabel: opt(p, 'ariaLabel'),
614
+ center: [2.4, 46.6], class: 'poad-front__fill',
615
+ }),
616
+ );
349
617
  },
350
618
 
351
619
  // ---------------------------------------------------------------- Planification (sans données : la liaison viendra avec le store)
352
620
  calendar: async () => {
353
621
  const { PoadCalendar } = await import('@poadio/ui-vue/calendar');
354
- return view('PoadItemCalendar', (p) => el(PoadCalendar, { view: str(p, 'view'), class: 'poad-front__fill' }));
622
+ return view('PoadItemCalendar', (p) =>
623
+ el(PoadCalendar, {
624
+ view: str(p, 'view'), date: day(p, 'date'), emptyText: opt(p, 'emptyText'), hourHeight: num(p, 'hourHeight') || 34, maxPerDay: num(p, 'maxPerDay') || 3, showNow: bool(p, 'showNow'),
625
+ firstDay: numChoice(p, 'firstDay') ?? null, dayStart: num(p, 'dayStart'), dayEnd: num(p, 'dayEnd') || 20, editable: bool(p, 'editable'), snap: num(p, 'snap') || 15,
626
+ class: 'poad-front__fill',
627
+ }),
628
+ );
355
629
  },
356
630
  scheduler: async () => {
357
631
  const { PoadScheduler } = await import('@poadio/ui-vue/scheduler');
358
- return view('PoadItemScheduler', (p) => el(PoadScheduler, { scale: str(p, 'scale'), class: 'poad-front__fill' }));
632
+ return view('PoadItemScheduler', (p) =>
633
+ el(PoadScheduler, {
634
+ scale: str(p, 'scale'), mode: opt(p, 'mode'), date: day(p, 'date'), emptyText: opt(p, 'emptyText'), tickWidth: onum(p, 'tickWidth') ?? null, showNow: bool(p, 'showNow'),
635
+ showUnplanned: bool(p, 'showUnplanned'), firstDay: numChoice(p, 'firstDay') ?? 1, dayStart: num(p, 'dayStart'), dayEnd: num(p, 'dayEnd') || 19, editable: bool(p, 'editable'),
636
+ snap: num(p, 'snap') || 30, class: 'poad-front__fill',
637
+ }),
638
+ );
359
639
  },
360
640
  gantt: async () => {
361
641
  const { PoadGantt } = await import('@poadio/ui-vue/gantt');
362
- return view('PoadItemGantt', (p) => el(PoadGantt, { scale: str(p, 'scale'), class: 'poad-front__fill' }));
642
+ return view('PoadItemGantt', (p) =>
643
+ el(PoadGantt, {
644
+ scale: str(p, 'scale'), emptyText: opt(p, 'emptyText'), taskColumnWidth: opt(p, 'taskColumnWidth'), tickWidth: onum(p, 'tickWidth') ?? null, showNow: bool(p, 'showNow'),
645
+ showUnplanned: bool(p, 'showUnplanned'), firstDay: numChoice(p, 'firstDay') ?? 1, editable: bool(p, 'editable'), class: 'poad-front__fill',
646
+ }),
647
+ );
363
648
  },
364
649
  taskboard: async () => {
365
650
  const { PoadTaskboard } = await import('@poadio/ui-vue/taskboard');
366
- return view('PoadItemTaskboard', (p) => el(PoadTaskboard, { mode: str(p, 'mode'), class: 'poad-front__fill' }));
651
+ return view('PoadItemTaskboard', (p) =>
652
+ el(PoadTaskboard, { mode: str(p, 'mode'), emptyText: opt(p, 'emptyText'), dateFormat: opt(p, 'dateFormat'), groupBy: opt(p, 'groupBy'), dragDisabled: bool(p, 'dragDisabled'), class: 'poad-front__fill' }),
653
+ );
367
654
  },
368
655
 
369
656
  // ---------------------------------------------------------------- Navigation
@@ -371,104 +658,168 @@ export const ITEM_LOADERS: Record<string, () => Promise<Component>> = {
371
658
  const { PoadMenubar } = await import('@poadio/ui-vue/menubar');
372
659
  return view('PoadItemMenubar', (p, ctx) => {
373
660
  const nav = fromPages(p, ctx);
661
+ const common = { breakpoint: str(p, 'breakpoint') === 'never' ? '' : str(p, 'breakpoint') || 'md', openOnHover: bool(p, 'openOnHover'), ariaLabel: opt(p, 'ariaLabel') ?? ctx.t('item.menu') };
374
662
  const bar = nav
375
- ? el(PoadMenubar, { items: nav.pages.map((pg) => ({ id: pg.id, label: pg.title, url: nav.href(pg.id) })), current: nav.current ? nav.href(nav.current) : null, linkAs: frontLink(nav), ariaLabel: ctx.t('item.menu') })
376
- : el(PoadMenubar, { items: list(p, 'items').map((l) => ({ label: l })), ariaLabel: ctx.t('item.menu') });
663
+ ? el(PoadMenubar, { items: nav.pages.map((pg) => ({ id: pg.id, label: pg.title, url: nav.href(pg.id) })), current: nav.current ? nav.href(nav.current) : null, linkAs: frontLink(nav), ...common })
664
+ : el(PoadMenubar, { items: asItems(p, 'items'), ...common });
377
665
  return h('div', { class: 'poad-front__center-v' }, [bar]);
378
666
  });
379
667
  },
380
668
  breadcrumb: async () => {
381
669
  const { PoadBreadcrumb } = await import('@poadio/ui-vue/breadcrumb');
382
- return view('PoadItemBreadcrumb', (p) => h('div', { class: 'poad-front__center-v' }, [el(PoadBreadcrumb, { items: list(p, 'items').map((l) => ({ label: l })) })]));
670
+ return view('PoadItemBreadcrumb', (p) =>
671
+ h('div', { class: 'poad-front__center-v' }, [el(PoadBreadcrumb, { items: asItems(p, 'items'), separatorIcon: opt(p, 'separatorIcon'), maxItems: num(p, 'maxItems') })]),
672
+ );
383
673
  },
384
674
  'bottom-nav': async () => {
385
675
  const { PoadBottomNav } = await import('@poadio/ui-vue/bottom-nav');
386
676
  const icons = ['home', 'search', 'user', 'settings', 'bell'];
387
677
  return model('PoadItemBottomNav', () => '0', (p, ctx, v) => {
388
678
  const nav = fromPages(p, ctx);
679
+ const common = {
680
+ labels: opt(p, 'labels'), maxItems: num(p, 'maxItems') || 5, breakpoint: opt(p, 'breakpoint'), alwaysShow: bool(p, 'alwaysShow'),
681
+ ariaLabel: opt(p, 'ariaLabel') ?? ctx.t('item.menu'), class: 'poad-front__inline-nav',
682
+ };
389
683
  return nav
390
684
  ? el(PoadBottomNav, {
391
685
  items: nav.pages.map((pg, i) => ({ value: pg.id, label: pg.title, icon: icons[i % icons.length]! })),
392
686
  modelValue: nav.current,
393
687
  'onUpdate:modelValue': (id: string) => nav.go(id),
394
- alwaysShow: true, ariaLabel: ctx.t('item.menu'), class: 'poad-front__inline-nav',
688
+ ...common,
395
689
  })
396
- : el(PoadBottomNav, { items: list(p, 'items').map((l, i) => ({ value: String(i), label: l, icon: icons[i % icons.length]! })), alwaysShow: true, ariaLabel: ctx.t('item.menu'), class: 'poad-front__inline-nav', ...bind(v) });
690
+ : el(PoadBottomNav, { items: list(p, 'items').map((l, i) => ({ value: String(i), label: l, icon: icons[i % icons.length]! })), ...common, ...bind(v) });
397
691
  });
398
692
  },
399
693
  'speed-dial': async () => {
400
694
  const { PoadSpeedDial } = await import('@poadio/ui-vue/speed-dial');
401
695
  const icons = ['pencil', 'share', 'trash'];
402
- return view('PoadItemSpeedDial', (p, ctx) => h('div', { class: 'poad-front__center' }, [el(PoadSpeedDial, { items: list(p, 'items').map((l, i) => ({ label: l, icon: icons[i % icons.length] })), direction: str(p, 'direction'), ariaLabel: ctx.t('item.actions') })]));
696
+ return view('PoadItemSpeedDial', (p, ctx) =>
697
+ h('div', { class: 'poad-front__center' }, [
698
+ el(PoadSpeedDial, {
699
+ items: list(p, 'items').map((l, i) => ({ label: l, icon: icons[i % icons.length] })), direction: str(p, 'direction'), type: opt(p, 'type'),
700
+ radius: num(p, 'radius') || 80, spacing: num(p, 'spacing') || 48, showIcon: opt(p, 'showIcon'), hideIcon: opt(p, 'hideIcon'), mask: bool(p, 'mask'), disabled: bool(p, 'disabled'),
701
+ ariaLabel: opt(p, 'ariaLabel') ?? ctx.t('item.actions'),
702
+ }),
703
+ ]),
704
+ );
403
705
  },
404
706
  'nav-drawer': async () => {
405
707
  const { PoadNavDrawer } = await import('@poadio/ui-vue/nav-drawer');
406
708
  const icons = ['layout-dashboard', 'home', 'users', 'settings', 'file-text'];
407
709
  return model('PoadItemNavDrawer', (p) => list(p, 'items')[0] ?? null, (p, ctx, v) =>
408
- el(PoadNavDrawer, { items: list(p, 'items').map((l, i) => ({ value: l, label: l, icon: icons[i % icons.length] })), mode: 'permanent', ariaLabel: ctx.t('item.menu'), class: 'poad-front__fill', ...bind(v) }),
710
+ el(PoadNavDrawer, {
711
+ items: list(p, 'items').map((l, i) => ({ value: l, label: l, icon: icons[i % icons.length] })), title: str(p, 'title'), icon: str(p, 'icon'),
712
+ mode: str(p, 'mode') || 'permanent', position: opt(p, 'position'), breakpoint: opt(p, 'breakpoint'),
713
+ closeOnNavigate: bool(p, 'closeOnNavigate'), closeOnEscape: bool(p, 'closeOnEscape'), dismissableScrim: bool(p, 'dismissableScrim'),
714
+ ariaLabel: opt(p, 'ariaLabel') ?? ctx.t('item.menu'), class: 'poad-front__fill', ...bind(v),
715
+ }),
409
716
  );
410
717
  },
411
718
  'scroll-top': async () => {
412
719
  const { PoadScrollTop } = await import('@poadio/ui-vue/scroll-top');
413
720
  // Sur le canevas, le bouton se montre à sa place ; en vrai, il paraît en bas de l'écran après le seuil
414
- return view('PoadItemScrollTop', (p, ctx) => h('div', { class: ['poad-front__center', ctx.canvas && 'poad-front__scrolltop-canvas'] }, [el(PoadScrollTop, { threshold: ctx.canvas ? 0 : num(p, 'threshold') })]));
721
+ return view('PoadItemScrollTop', (p, ctx) =>
722
+ h('div', { class: ['poad-front__center', ctx.canvas && 'poad-front__scrolltop-canvas'] }, [
723
+ el(PoadScrollTop, { threshold: ctx.canvas ? 0 : num(p, 'threshold'), icon: opt(p, 'icon'), behavior: opt(p, 'behavior'), ariaLabel: opt(p, 'ariaLabel') }),
724
+ ]),
725
+ );
415
726
  },
416
727
 
417
728
  // ---------------------------------------------------------------- Affichage
418
729
  heading: async () =>
419
- view('PoadItemHeading', (p) => h(str(p, 'level') || 'h2', { class: ['poad-front__heading', `is-${str(p, 'level') || 'h2'}`], style: { textAlign: str(p, 'align') || 'left' } }, str(p, 'text'))),
420
- text: async () => view('PoadItemText', (p) => h('p', { class: 'poad-front__text', style: { textAlign: str(p, 'align') || 'left' } }, str(p, 'text'))),
730
+ view('PoadItemHeading', (p) =>
731
+ h(str(p, 'level') || 'h2', { class: ['poad-front__heading', `is-${str(p, 'level') || 'h2'}`], style: { textAlign: str(p, 'align') || 'left', color: cssColor(p, 'color') } }, str(p, 'text')),
732
+ ),
733
+ text: async () => view('PoadItemText', (p) => h('p', { class: 'poad-front__text', style: { textAlign: str(p, 'align') || 'left', color: cssColor(p, 'color') } }, str(p, 'text'))),
421
734
  image: async () => {
422
- const [{ PoadImage }, { PoadIcon }] = await Promise.all([import('@poadio/ui-vue/image'), import('@poadio/ui-vue/icon')]);
735
+ const [{ PoadImage }, { PoadIcon }] = await Promise.all([import('@poadio/ui-vue/image'), ui.icon()]);
423
736
  return view('PoadItemImage', (p, ctx) =>
424
737
  str(p, 'src')
425
- ? el(PoadImage, { src: str(p, 'src'), alt: str(p, 'alt'), fit: str(p, 'fit'), rounded: bool(p, 'rounded'), width: '100%', height: '100%', class: 'poad-front__fill' })
738
+ ? el(PoadImage, {
739
+ src: str(p, 'src'), alt: str(p, 'alt'), caption: opt(p, 'caption'), fit: str(p, 'fit'), rounded: bool(p, 'rounded'), preview: bool(p, 'preview'), lazy: bool(p, 'lazy'),
740
+ width: '100%', height: '100%', class: 'poad-front__fill',
741
+ })
426
742
  : h('div', { class: 'poad-front__placeholder', role: 'img', 'aria-label': str(p, 'alt') || ctx.t('item.image.empty') }, [el(PoadIcon, { name: 'image', size: 28 }), h('span', ctx.t('item.image.empty'))]),
427
743
  );
428
744
  },
429
745
  avatar: async () => {
430
746
  const { PoadAvatar } = await import('@poadio/ui-vue/avatar');
431
- return view('PoadItemAvatar', (p) => h('div', { class: 'poad-front__center' }, [el(PoadAvatar, { text: str(p, 'text'), size: str(p, 'size'), shape: str(p, 'shape') })]));
747
+ return view('PoadItemAvatar', (p) =>
748
+ h('div', { class: 'poad-front__center' }, [el(PoadAvatar, { text: str(p, 'text'), size: str(p, 'size'), shape: str(p, 'shape'), color: cssColor(p, 'color'), icon: opt(p, 'icon'), label: opt(p, 'label') })]),
749
+ );
432
750
  },
433
751
  'avatar-group': async () => {
434
752
  const { PoadAvatar, PoadAvatarGroup } = await import('@poadio/ui-vue/avatar');
435
- return view('PoadItemAvatarGroup', (p) => h('div', { class: 'poad-front__center' }, [el(PoadAvatarGroup, { max: num(p, 'max') || undefined }, () => list(p, 'names').map((n) => el(PoadAvatar, { key: n, text: n })))]));
753
+ return view('PoadItemAvatarGroup', (p) =>
754
+ h('div', { class: 'poad-front__center' }, [
755
+ el(PoadAvatarGroup, { max: num(p, 'max') || undefined, size: opt(p, 'size'), moreColor: cssColor(p, 'moreColor') }, () =>
756
+ list(p, 'names').map((n) => el(PoadAvatar, { key: n, text: n, shape: opt(p, 'shape') })),
757
+ ),
758
+ ]),
759
+ );
436
760
  },
437
761
  spinner: async () => {
438
762
  const { PoadSpinner } = await import('@poadio/ui-vue/progress');
439
- return view('PoadItemSpinner', (p) => h('div', { class: 'poad-front__center' }, [el(PoadSpinner, { size: num(p, 'size') || 32 })]));
763
+ return view('PoadItemSpinner', (p) =>
764
+ h('div', { class: 'poad-front__center' }, [el(PoadSpinner, { size: num(p, 'size') || 32, strokeWidth: num(p, 'strokeWidth') || 2.5, severity: opt(p, 'severity'), ariaLabel: opt(p, 'ariaLabel') })]),
765
+ );
440
766
  },
441
767
  badge: async () => {
442
768
  const { PoadBadge } = await import('@poadio/ui-vue/badge');
443
- return view('PoadItemBadge', (p) => h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadBadge, { value: str(p, 'value'), severity: str(p, 'severity') })]));
769
+ return view('PoadItemBadge', (p) =>
770
+ h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadBadge, { value: str(p, 'value'), severity: str(p, 'severity'), size: opt(p, 'size'), dot: bool(p, 'dot'), max: num(p, 'max') || 99, ariaLabel: opt(p, 'ariaLabel') })]),
771
+ );
444
772
  },
445
773
  tag: async () => {
446
774
  const { PoadTag } = await import('@poadio/ui-vue/tag');
447
- return view('PoadItemTag', (p) => h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadTag, { value: str(p, 'value'), severity: str(p, 'severity'), rounded: bool(p, 'rounded') })]));
775
+ return view('PoadItemTag', (p) =>
776
+ h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadTag, { value: str(p, 'value'), severity: str(p, 'severity'), size: opt(p, 'size'), icon: opt(p, 'icon'), dot: bool(p, 'dot'), rounded: bool(p, 'rounded') })]),
777
+ );
448
778
  },
449
779
  chip: async () => {
450
780
  const { PoadChip } = await import('@poadio/ui-vue/chip');
451
- return view('PoadItemChip', (p) => h('div', { class: 'poad-front__center-v is-fit' }, [el(PoadChip, { label: str(p, 'label'), removable: bool(p, 'removable') })]));
781
+ return view('PoadItemChip', (p) =>
782
+ h('div', { class: 'poad-front__center-v is-fit' }, [
783
+ el(PoadChip, {
784
+ label: str(p, 'label'), avatarText: opt(p, 'avatarText'), icon: opt(p, 'icon'), severity: orNull(p, 'severity'), size: opt(p, 'size'), removable: bool(p, 'removable'),
785
+ clickable: bool(p, 'clickable'), selected: bool(p, 'selected'), disabled: bool(p, 'disabled'),
786
+ }),
787
+ ]),
788
+ );
452
789
  },
453
790
  carousel: async () => {
454
791
  const { PoadCarousel } = await import('@poadio/ui-vue/carousel');
455
792
  return view('PoadItemCarousel', (p) =>
456
- el(PoadCarousel, { items: list(p, 'slides'), numVisible: num(p, 'numVisible') || 1, class: 'poad-front__fill' }, { item: ({ item }: { item: string }) => h('div', { class: 'poad-front__slide' }, item) }),
793
+ el(PoadCarousel, {
794
+ items: list(p, 'slides'), numVisible: num(p, 'numVisible') || 1, numScroll: num(p, 'numScroll') || 1, orientation: opt(p, 'orientation'), showIndicators: bool(p, 'showIndicators'),
795
+ showNavigators: bool(p, 'showNavigators'), circular: bool(p, 'circular'), autoplay: num(p, 'autoplay'), ariaLabel: opt(p, 'ariaLabel'), class: 'poad-front__fill',
796
+ }, { item: ({ item }: { item: string }) => h('div', { class: 'poad-front__slide' }, item) }),
457
797
  );
458
798
  },
459
799
  icon: async () => {
460
- const { PoadIcon } = await import('@poadio/ui-vue/icon');
461
- return view('PoadItemIcon', (p) => h('div', { class: 'poad-front__center' }, [el(PoadIcon, { name: str(p, 'name') || 'star', size: num(p, 'size') || 24 })]));
800
+ const { PoadIcon } = await ui.icon();
801
+ // La couleur d'une icône est celle du texte autour (`currentColor`)
802
+ return view('PoadItemIcon', (p) =>
803
+ h('div', { class: 'poad-front__center', style: { color: cssColor(p, 'color') } }, [
804
+ el(PoadIcon, {
805
+ name: str(p, 'name') || 'star', size: num(p, 'size') || 24, strokeWidth: num(p, 'strokeWidth') || 2, filled: bool(p, 'filled'), flip: orNull(p, 'flip') ?? undefined,
806
+ rotate: num(p, 'rotate') || undefined, spin: bool(p, 'spin'), label: opt(p, 'label'),
807
+ }),
808
+ ]),
809
+ );
462
810
  },
463
811
  message: async () => {
464
812
  const { PoadMessage } = await import('@poadio/ui-vue/message');
465
- return view('PoadItemMessage', (p) => el(PoadMessage, { severity: str(p, 'severity'), text: str(p, 'text') }));
813
+ return view('PoadItemMessage', (p) =>
814
+ el(PoadMessage, { severity: str(p, 'severity'), text: str(p, 'text'), variant: opt(p, 'variant'), size: opt(p, 'size'), icon: bool(p, 'showIcon') ? opt(p, 'icon') : '', closable: bool(p, 'closable') }),
815
+ );
466
816
  },
467
817
  skeleton: async () => {
468
818
  const { PoadSkeleton } = await import('@poadio/ui-vue/skeleton');
469
819
  return view('PoadItemSkeleton', (p) => {
470
820
  const shape = str(p, 'shape') || 'text';
471
- return el(PoadSkeleton, shape === 'text' ? { shape, lines: num(p, 'lines') || 3 } : { shape, width: shape === 'circle' ? '48px' : '100%', height: shape === 'circle' ? '48px' : '100%' });
821
+ const look = { animation: bool(p, 'animation') };
822
+ return el(PoadSkeleton, shape === 'text' ? { shape, lines: num(p, 'lines') || 3, lastWidth: opt(p, 'lastWidth'), ...look } : { shape, width: shape === 'circle' ? '48px' : '100%', height: shape === 'circle' ? '48px' : '100%', ...look });
472
823
  });
473
824
  },
474
825
  };