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