@dnax/ui 0.0.5 → 0.0.7
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/components/QNotifyProvider.vue +1 -0
- package/components/QTab.vue +2 -0
- package/lib/q.ts +9 -4
- package/package.json +1 -1
- package/styles/main.css +6 -0
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// Intégré dans QConfigProvider (rendu automatiquement par le plus externe),
|
|
4
4
|
// mais utilisable aussi en autonome : <q-notify-provider />.
|
|
5
5
|
import { Toaster } from "vue-sonner"
|
|
6
|
+
import "vue-sonner/style.css" // styles du Toaster (sinon les toasts sont rendus mais invisibles)
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
8
9
|
/** Position des toasts (défaut : bottom-right) */
|
package/components/QTab.vue
CHANGED
|
@@ -96,6 +96,8 @@ const tabClasses = computed(() =>
|
|
|
96
96
|
(props.noCaps || tabs?.noCaps.value) && "q-tab--no-caps",
|
|
97
97
|
props.disable && "q-tab--disabled",
|
|
98
98
|
tabs?.inlineLabel.value && "q-tab--inline-label",
|
|
99
|
+
// Icône empilée au-dessus du label : padding vertical pour l'aérer du cadre
|
|
100
|
+
props.icon && !tabs?.inlineLabel.value && "q-tab--stacked-icon",
|
|
99
101
|
),
|
|
100
102
|
)
|
|
101
103
|
|
package/lib/q.ts
CHANGED
|
@@ -189,8 +189,9 @@ export interface NotifyOptions {
|
|
|
189
189
|
icon?: string
|
|
190
190
|
/** Couleur de fond : token (primary, negative…) ou hex */
|
|
191
191
|
color?: string
|
|
192
|
-
/** Type → couleur riche sonner
|
|
193
|
-
|
|
192
|
+
/** Type → couleur riche sonner. Tokens Quasar acceptés : positive = success,
|
|
193
|
+
* negative = error, warning, info (success/error aussi acceptés). */
|
|
194
|
+
type?: "default" | "success" | "error" | "warning" | "info" | "positive" | "negative"
|
|
194
195
|
/** Position (défaut : bottom-right, celle du QNotifyProvider) */
|
|
195
196
|
position?: ExternalToast["position"]
|
|
196
197
|
/** Durée d'affichage en ms (défaut : 4000) */
|
|
@@ -214,9 +215,13 @@ function notify(opts: NotifyOptions): NotifyController {
|
|
|
214
215
|
icon: icon ? h(icon) : undefined,
|
|
215
216
|
}
|
|
216
217
|
|
|
218
|
+
// Tokens Quasar → types sonner : positive = success, negative = error
|
|
219
|
+
const sonnerType =
|
|
220
|
+
type === "positive" ? "success" : type === "negative" ? "error" : type
|
|
221
|
+
|
|
217
222
|
let id: string | number | undefined
|
|
218
223
|
|
|
219
|
-
if (color &&
|
|
224
|
+
if (color && sonnerType === "default") {
|
|
220
225
|
// Couleur Quasar custom → rendu custom (QNotifyToast)
|
|
221
226
|
id = toast.custom(QNotifyToast, {
|
|
222
227
|
...data,
|
|
@@ -239,7 +244,7 @@ function notify(opts: NotifyOptions): NotifyController {
|
|
|
239
244
|
info: toast.info,
|
|
240
245
|
default: toast,
|
|
241
246
|
} as const
|
|
242
|
-
id = toasts[
|
|
247
|
+
id = toasts[sonnerType](message, {
|
|
243
248
|
...data,
|
|
244
249
|
action: action ? { label: action.label, onClick: () => action.handler() } : undefined,
|
|
245
250
|
})
|
package/package.json
CHANGED
package/styles/main.css
CHANGED
|
@@ -858,6 +858,12 @@ html.dark body {
|
|
|
858
858
|
gap: 8px;
|
|
859
859
|
}
|
|
860
860
|
|
|
861
|
+
/* Icône empilée au-dessus du label : aérer l'icône du haut du cadre (le tab
|
|
862
|
+
n'a que du padding horizontal par défaut) et le label du bas */
|
|
863
|
+
.q-tab--stacked-icon {
|
|
864
|
+
padding: 8px 16px;
|
|
865
|
+
}
|
|
866
|
+
|
|
861
867
|
.q-tab__icon {
|
|
862
868
|
width: 1.3em;
|
|
863
869
|
height: 1.3em;
|