@dnax/ui 0.0.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/README.md +15 -0
- package/components/QAccordion.vue +68 -0
- package/components/QAccordionContent.vue +62 -0
- package/components/QAccordionItem.vue +24 -0
- package/components/QAccordionTrigger.vue +51 -0
- package/components/QActionSheet.vue +159 -0
- package/components/QApp.vue +8 -0
- package/components/QAutocomplete.vue +316 -0
- package/components/QAvatar.vue +92 -0
- package/components/QBackHeader.vue +69 -0
- package/components/QBackTop.vue +125 -0
- package/components/QBadge.vue +55 -0
- package/components/QBottomSheet.vue +177 -0
- package/components/QBottomSheetFooter.vue +9 -0
- package/components/QBottomSheetHeader.vue +35 -0
- package/components/QBottomSheetProvider.vue +62 -0
- package/components/QBottomSheetTrigger.vue +18 -0
- package/components/QBtn.vue +144 -0
- package/components/QBtnGroup.vue +31 -0
- package/components/QBubble.vue +36 -0
- package/components/QBubbleContent.vue +28 -0
- package/components/QBubbleGroup.vue +25 -0
- package/components/QBubbleReactions.vue +40 -0
- package/components/QCard.vue +63 -0
- package/components/QCardActions.vue +27 -0
- package/components/QCardContent.vue +29 -0
- package/components/QCarousel.vue +115 -0
- package/components/QCarouselContent.vue +23 -0
- package/components/QCarouselItem.vue +20 -0
- package/components/QCarouselNav.vue +51 -0
- package/components/QCheckbox.vue +146 -0
- package/components/QChip.vue +91 -0
- package/components/QCircularProgress.vue +122 -0
- package/components/QCol.vue +52 -0
- package/components/QCollapse.vue +141 -0
- package/components/QConfigProvider.vue +164 -0
- package/components/QContainer.vue +201 -0
- package/components/QCountDown.vue +164 -0
- package/components/QCountryPicker.vue +593 -0
- package/components/QDataGrid.vue +491 -0
- package/components/QDatePicker.vue +250 -0
- package/components/QDialog.vue +163 -0
- package/components/QDialogFooter.vue +9 -0
- package/components/QDialogHeader.vue +41 -0
- package/components/QDialogProvider.vue +65 -0
- package/components/QDialogTrigger.vue +18 -0
- package/components/QFab.vue +80 -0
- package/components/QFabAction.vue +48 -0
- package/components/QFilePicker.vue +294 -0
- package/components/QFooter.vue +72 -0
- package/components/QGallery.vue +280 -0
- package/components/QGrid.vue +54 -0
- package/components/QHeader.vue +38 -0
- package/components/QIcon.vue +53 -0
- package/components/QImagePicker.vue +248 -0
- package/components/QImagePreview.vue +225 -0
- package/components/QImagePreviewProvider.vue +35 -0
- package/components/QImg.vue +142 -0
- package/components/QInfiniteScroll.vue +109 -0
- package/components/QInnerLoading.vue +67 -0
- package/components/QInput.vue +289 -0
- package/components/QInputOtp.vue +238 -0
- package/components/QInputPassword.vue +67 -0
- package/components/QInputTag.vue +281 -0
- package/components/QIntersection.vue +119 -0
- package/components/QItem.vue +60 -0
- package/components/QItemSection.vue +47 -0
- package/components/QLinearProgress.vue +94 -0
- package/components/QList.vue +39 -0
- package/components/QLoading.vue +77 -0
- package/components/QLoadingProvider.vue +41 -0
- package/components/QMarquee.vue +56 -0
- package/components/QMessageScroller.vue +10 -0
- package/components/QMessageScrollerButton.vue +48 -0
- package/components/QMessageScrollerContent.vue +31 -0
- package/components/QMessageScrollerItem.vue +49 -0
- package/components/QMessageScrollerProvider.vue +198 -0
- package/components/QMessageScrollerViewport.vue +109 -0
- package/components/QNavMenu.vue +75 -0
- package/components/QNavMenuContent.vue +10 -0
- package/components/QNavMenuItem.vue +60 -0
- package/components/QNavMenuTrigger.vue +96 -0
- package/components/QNotifyProvider.vue +33 -0
- package/components/QNotifyToast.vue +60 -0
- package/components/QPage.vue +56 -0
- package/components/QPagination.vue +195 -0
- package/components/QParallax.vue +124 -0
- package/components/QPullToRefresh.vue +138 -0
- package/components/QRadio.vue +99 -0
- package/components/QRating.vue +105 -0
- package/components/QReorder.vue +191 -0
- package/components/QRollingText.vue +225 -0
- package/components/QRow.vue +23 -0
- package/components/QSafeArea.vue +39 -0
- package/components/QScrollArea.vue +118 -0
- package/components/QSelect.vue +698 -0
- package/components/QSeparator.vue +39 -0
- package/components/QSidebar.vue +153 -0
- package/components/QSidebarContent.vue +14 -0
- package/components/QSidebarFooter.vue +14 -0
- package/components/QSidebarHeader.vue +14 -0
- package/components/QSidebarMenu.vue +9 -0
- package/components/QSidebarMenuButton.vue +59 -0
- package/components/QSidebarMenuItem.vue +9 -0
- package/components/QSidebarTrigger.vue +32 -0
- package/components/QSkeleton.vue +95 -0
- package/components/QSlider.vue +205 -0
- package/components/QSpace.vue +10 -0
- package/components/QSpinner.vue +172 -0
- package/components/QSplitter.vue +145 -0
- package/components/QSticky.vue +181 -0
- package/components/QSwipeCell.vue +217 -0
- package/components/QSwiper.vue +102 -0
- package/components/QSwiperSlide.vue +19 -0
- package/components/QSyntax.vue +171 -0
- package/components/QTab.vue +175 -0
- package/components/QTabPanel.vue +50 -0
- package/components/QTabPanels.vue +106 -0
- package/components/QTable.vue +575 -0
- package/components/QTabs.vue +188 -0
- package/components/QText.vue +316 -0
- package/components/QTextCaption.vue +122 -0
- package/components/QToolbar.vue +28 -0
- package/components/QTooltip.vue +313 -0
- package/components/QUploader.vue +473 -0
- package/components/QVideo.vue +289 -0
- package/components/QVirtualScroll.vue +190 -0
- package/components/internal/QDateCalendar.vue +153 -0
- package/index.ts +151 -0
- package/lib/breakpoints.ts +44 -0
- package/lib/colors.ts +24 -0
- package/lib/config.ts +34 -0
- package/lib/countries.ts +261 -0
- package/lib/formula.ts +630 -0
- package/lib/icons.ts +38 -0
- package/lib/loading.ts +75 -0
- package/lib/overlayBack.ts +124 -0
- package/lib/platform.ts +146 -0
- package/lib/primitive.ts +25 -0
- package/lib/q.ts +287 -0
- package/lib/screen.ts +105 -0
- package/lib/search.ts +35 -0
- package/lib/themeVars.ts +22 -0
- package/lib/useComponentProps.ts +54 -0
- package/lib/utils.ts +7 -0
- package/module.ts +89 -0
- package/package.json +41 -0
- package/scripts/generate-exports.ts +56 -0
- package/styles/main.css +7627 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// QTabPanel — panneau d'onglet : visible quand son `name` correspond au v-model des QTabPanels.
|
|
3
|
+
// v-show (en flux) : le switch est fiable ; `animated` ajoute un fondu à l'activation.
|
|
4
|
+
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
|
5
|
+
import { qTabPanelsKey, type QTabPanelsAnimation } from "./QTabPanels.vue"
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
/** Nom du panneau (comparé au v-model des QTabPanels) */
|
|
9
|
+
name: string | number
|
|
10
|
+
/** Ne monte le contenu qu'à la première activation */
|
|
11
|
+
lazyRender?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
15
|
+
lazyRender: false,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const panels = inject(qTabPanelsKey, null)
|
|
19
|
+
const el = ref<HTMLElement | null>(null)
|
|
20
|
+
|
|
21
|
+
onMounted(() => panels?.register({ name: props.name, el }))
|
|
22
|
+
onBeforeUnmount(() => panels?.unregister(props.name))
|
|
23
|
+
|
|
24
|
+
const isActive = computed(() => panels?.activeName.value === props.name)
|
|
25
|
+
|
|
26
|
+
// lazyRender : monté après la première activation
|
|
27
|
+
const activated = ref(false)
|
|
28
|
+
watch(isActive, (v) => {
|
|
29
|
+
if (v) activated.value = true
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Classe d'animation : q-tab-panel--fade | --slide-right | … (quand animated + actif)
|
|
33
|
+
const animationClass = computed<QTabPanelsAnimation | "">(() =>
|
|
34
|
+
panels?.animated.value && isActive.value ? (panels.animation.value ?? "fade") : "",
|
|
35
|
+
)
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div
|
|
40
|
+
v-if="!lazyRender || activated"
|
|
41
|
+
v-show="isActive"
|
|
42
|
+
ref="el"
|
|
43
|
+
class="q-tab-panel"
|
|
44
|
+
:class="animationClass && `q-tab-panel--${animationClass}`"
|
|
45
|
+
role="tabpanel"
|
|
46
|
+
:aria-hidden="isActive ? undefined : 'true'"
|
|
47
|
+
>
|
|
48
|
+
<slot />
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// QTabPanels — API Quasar : <q-tab-panels v-model="tab" animated swipeable> + QTabPanel enfants.
|
|
3
|
+
// Affiche le panneau dont le `name` correspond au v-model (partagé avec QTabs).
|
|
4
|
+
import type { InjectionKey, Ref } from "vue"
|
|
5
|
+
|
|
6
|
+
export interface QTabPanelRegistration {
|
|
7
|
+
name: string | number
|
|
8
|
+
el: Ref<HTMLElement | null>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface QTabPanelsContext {
|
|
12
|
+
activeName: Readonly<Ref<string | number | null>>
|
|
13
|
+
register: (panel: QTabPanelRegistration) => void
|
|
14
|
+
unregister: (name: string | number) => void
|
|
15
|
+
animated: Readonly<Ref<boolean>>
|
|
16
|
+
animation: Readonly<Ref<QTabPanelsAnimation>>
|
|
17
|
+
dark: Readonly<Ref<boolean>>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Type d'animation du panneau actif (mode animated) */
|
|
21
|
+
export type QTabPanelsAnimation = "fade" | "slide-right" | "slide-left" | "slide-up" | "slide-down"
|
|
22
|
+
|
|
23
|
+
export const qTabPanelsKey: InjectionKey<QTabPanelsContext> = Symbol("q-tab-panels")
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import { computed, onBeforeUnmount, provide, ref, shallowRef } from "vue"
|
|
28
|
+
import { cn } from "../lib/utils"
|
|
29
|
+
|
|
30
|
+
interface Props {
|
|
31
|
+
/** Panneau actif (v-model) — même valeur que QTabs */
|
|
32
|
+
modelValue?: string | number | null
|
|
33
|
+
/** Anime l'apparition du panneau actif */
|
|
34
|
+
animated?: boolean
|
|
35
|
+
/** Type d'animation : fade (défaut) | slide-right | slide-left | slide-up | slide-down */
|
|
36
|
+
animation?: QTabPanelsAnimation
|
|
37
|
+
/** Swipe tactile pour changer de panneau */
|
|
38
|
+
swipeable?: boolean
|
|
39
|
+
/** Thème sombre */
|
|
40
|
+
dark?: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
44
|
+
modelValue: null,
|
|
45
|
+
animated: false,
|
|
46
|
+
animation: "fade",
|
|
47
|
+
swipeable: false,
|
|
48
|
+
dark: false,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const emit = defineEmits<{ "update:modelValue": [value: string | number | null] }>()
|
|
52
|
+
|
|
53
|
+
const panelRegs = shallowRef<QTabPanelRegistration[]>([])
|
|
54
|
+
|
|
55
|
+
// — Swipe tactile (horizontal) : panneau suivant / précédent —
|
|
56
|
+
let touchStartX = 0
|
|
57
|
+
let touchStartY = 0
|
|
58
|
+
const onTouchStart = (e: TouchEvent) => {
|
|
59
|
+
touchStartX = e.touches[0]?.clientX ?? 0
|
|
60
|
+
touchStartY = e.touches[0]?.clientY ?? 0
|
|
61
|
+
}
|
|
62
|
+
const onTouchEnd = (e: TouchEvent) => {
|
|
63
|
+
const t = e.changedTouches[0]
|
|
64
|
+
if (!t) return
|
|
65
|
+
const dx = t.clientX - touchStartX
|
|
66
|
+
const dy = t.clientY - touchStartY
|
|
67
|
+
if (Math.abs(dx) < 40 || Math.abs(dx) < Math.abs(dy)) return
|
|
68
|
+
if (props.modelValue === null || props.modelValue === undefined) return
|
|
69
|
+
const order = panelRegs.value.map((p) => p.name)
|
|
70
|
+
const idx = order.indexOf(props.modelValue)
|
|
71
|
+
if (dx < 0 && idx < order.length - 1) emit("update:modelValue", order[idx + 1] ?? null)
|
|
72
|
+
else if (dx > 0 && idx > 0) emit("update:modelValue", order[idx - 1] ?? null)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
provide<QTabPanelsContext>(qTabPanelsKey, {
|
|
76
|
+
activeName: computed(() => props.modelValue),
|
|
77
|
+
register: (p) => {
|
|
78
|
+
panelRegs.value = [...panelRegs.value, p]
|
|
79
|
+
},
|
|
80
|
+
unregister: (name) => {
|
|
81
|
+
panelRegs.value = panelRegs.value.filter((p) => p.name !== name)
|
|
82
|
+
},
|
|
83
|
+
animated: computed(() => props.animated),
|
|
84
|
+
animation: computed(() => props.animation),
|
|
85
|
+
dark: computed(() => props.dark),
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
const panelsClasses = computed(() =>
|
|
89
|
+
cn(
|
|
90
|
+
"q-tab-panels",
|
|
91
|
+
props.animated && "q-tab-panels--animated",
|
|
92
|
+
props.dark && "q-tab-panels--dark",
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<div
|
|
99
|
+
class="q-tab-panels"
|
|
100
|
+
:class="panelsClasses"
|
|
101
|
+
@touchstart.passive="onTouchStart"
|
|
102
|
+
@touchend.passive="swipeable ? onTouchEnd : undefined"
|
|
103
|
+
>
|
|
104
|
+
<slot />
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|