@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.
Files changed (150) hide show
  1. package/README.md +15 -0
  2. package/components/QAccordion.vue +68 -0
  3. package/components/QAccordionContent.vue +62 -0
  4. package/components/QAccordionItem.vue +24 -0
  5. package/components/QAccordionTrigger.vue +51 -0
  6. package/components/QActionSheet.vue +159 -0
  7. package/components/QApp.vue +8 -0
  8. package/components/QAutocomplete.vue +316 -0
  9. package/components/QAvatar.vue +92 -0
  10. package/components/QBackHeader.vue +69 -0
  11. package/components/QBackTop.vue +125 -0
  12. package/components/QBadge.vue +55 -0
  13. package/components/QBottomSheet.vue +177 -0
  14. package/components/QBottomSheetFooter.vue +9 -0
  15. package/components/QBottomSheetHeader.vue +35 -0
  16. package/components/QBottomSheetProvider.vue +62 -0
  17. package/components/QBottomSheetTrigger.vue +18 -0
  18. package/components/QBtn.vue +144 -0
  19. package/components/QBtnGroup.vue +31 -0
  20. package/components/QBubble.vue +36 -0
  21. package/components/QBubbleContent.vue +28 -0
  22. package/components/QBubbleGroup.vue +25 -0
  23. package/components/QBubbleReactions.vue +40 -0
  24. package/components/QCard.vue +63 -0
  25. package/components/QCardActions.vue +27 -0
  26. package/components/QCardContent.vue +29 -0
  27. package/components/QCarousel.vue +115 -0
  28. package/components/QCarouselContent.vue +23 -0
  29. package/components/QCarouselItem.vue +20 -0
  30. package/components/QCarouselNav.vue +51 -0
  31. package/components/QCheckbox.vue +146 -0
  32. package/components/QChip.vue +91 -0
  33. package/components/QCircularProgress.vue +122 -0
  34. package/components/QCol.vue +52 -0
  35. package/components/QCollapse.vue +141 -0
  36. package/components/QConfigProvider.vue +164 -0
  37. package/components/QContainer.vue +201 -0
  38. package/components/QCountDown.vue +164 -0
  39. package/components/QCountryPicker.vue +593 -0
  40. package/components/QDataGrid.vue +491 -0
  41. package/components/QDatePicker.vue +250 -0
  42. package/components/QDialog.vue +163 -0
  43. package/components/QDialogFooter.vue +9 -0
  44. package/components/QDialogHeader.vue +41 -0
  45. package/components/QDialogProvider.vue +65 -0
  46. package/components/QDialogTrigger.vue +18 -0
  47. package/components/QFab.vue +80 -0
  48. package/components/QFabAction.vue +48 -0
  49. package/components/QFilePicker.vue +294 -0
  50. package/components/QFooter.vue +72 -0
  51. package/components/QGallery.vue +280 -0
  52. package/components/QGrid.vue +54 -0
  53. package/components/QHeader.vue +38 -0
  54. package/components/QIcon.vue +53 -0
  55. package/components/QImagePicker.vue +248 -0
  56. package/components/QImagePreview.vue +225 -0
  57. package/components/QImagePreviewProvider.vue +35 -0
  58. package/components/QImg.vue +142 -0
  59. package/components/QInfiniteScroll.vue +109 -0
  60. package/components/QInnerLoading.vue +67 -0
  61. package/components/QInput.vue +289 -0
  62. package/components/QInputOtp.vue +238 -0
  63. package/components/QInputPassword.vue +67 -0
  64. package/components/QInputTag.vue +281 -0
  65. package/components/QIntersection.vue +119 -0
  66. package/components/QItem.vue +60 -0
  67. package/components/QItemSection.vue +47 -0
  68. package/components/QLinearProgress.vue +94 -0
  69. package/components/QList.vue +39 -0
  70. package/components/QLoading.vue +77 -0
  71. package/components/QLoadingProvider.vue +41 -0
  72. package/components/QMarquee.vue +56 -0
  73. package/components/QMessageScroller.vue +10 -0
  74. package/components/QMessageScrollerButton.vue +48 -0
  75. package/components/QMessageScrollerContent.vue +31 -0
  76. package/components/QMessageScrollerItem.vue +49 -0
  77. package/components/QMessageScrollerProvider.vue +198 -0
  78. package/components/QMessageScrollerViewport.vue +109 -0
  79. package/components/QNavMenu.vue +75 -0
  80. package/components/QNavMenuContent.vue +10 -0
  81. package/components/QNavMenuItem.vue +60 -0
  82. package/components/QNavMenuTrigger.vue +96 -0
  83. package/components/QNotifyProvider.vue +33 -0
  84. package/components/QNotifyToast.vue +60 -0
  85. package/components/QPage.vue +56 -0
  86. package/components/QPagination.vue +195 -0
  87. package/components/QParallax.vue +124 -0
  88. package/components/QPullToRefresh.vue +138 -0
  89. package/components/QRadio.vue +99 -0
  90. package/components/QRating.vue +105 -0
  91. package/components/QReorder.vue +191 -0
  92. package/components/QRollingText.vue +225 -0
  93. package/components/QRow.vue +23 -0
  94. package/components/QSafeArea.vue +39 -0
  95. package/components/QScrollArea.vue +118 -0
  96. package/components/QSelect.vue +698 -0
  97. package/components/QSeparator.vue +39 -0
  98. package/components/QSidebar.vue +153 -0
  99. package/components/QSidebarContent.vue +14 -0
  100. package/components/QSidebarFooter.vue +14 -0
  101. package/components/QSidebarHeader.vue +14 -0
  102. package/components/QSidebarMenu.vue +9 -0
  103. package/components/QSidebarMenuButton.vue +59 -0
  104. package/components/QSidebarMenuItem.vue +9 -0
  105. package/components/QSidebarTrigger.vue +32 -0
  106. package/components/QSkeleton.vue +95 -0
  107. package/components/QSlider.vue +205 -0
  108. package/components/QSpace.vue +10 -0
  109. package/components/QSpinner.vue +172 -0
  110. package/components/QSplitter.vue +145 -0
  111. package/components/QSticky.vue +181 -0
  112. package/components/QSwipeCell.vue +217 -0
  113. package/components/QSwiper.vue +102 -0
  114. package/components/QSwiperSlide.vue +19 -0
  115. package/components/QSyntax.vue +171 -0
  116. package/components/QTab.vue +175 -0
  117. package/components/QTabPanel.vue +50 -0
  118. package/components/QTabPanels.vue +106 -0
  119. package/components/QTable.vue +575 -0
  120. package/components/QTabs.vue +188 -0
  121. package/components/QText.vue +316 -0
  122. package/components/QTextCaption.vue +122 -0
  123. package/components/QToolbar.vue +28 -0
  124. package/components/QTooltip.vue +313 -0
  125. package/components/QUploader.vue +473 -0
  126. package/components/QVideo.vue +289 -0
  127. package/components/QVirtualScroll.vue +190 -0
  128. package/components/internal/QDateCalendar.vue +153 -0
  129. package/index.ts +151 -0
  130. package/lib/breakpoints.ts +44 -0
  131. package/lib/colors.ts +24 -0
  132. package/lib/config.ts +34 -0
  133. package/lib/countries.ts +261 -0
  134. package/lib/formula.ts +630 -0
  135. package/lib/icons.ts +38 -0
  136. package/lib/loading.ts +75 -0
  137. package/lib/overlayBack.ts +124 -0
  138. package/lib/platform.ts +146 -0
  139. package/lib/primitive.ts +25 -0
  140. package/lib/q.ts +287 -0
  141. package/lib/screen.ts +105 -0
  142. package/lib/search.ts +35 -0
  143. package/lib/themeVars.ts +22 -0
  144. package/lib/useComponentProps.ts +54 -0
  145. package/lib/utils.ts +7 -0
  146. package/module.ts +89 -0
  147. package/package.json +41 -0
  148. package/scripts/generate-exports.ts +56 -0
  149. package/styles/main.css +7627 -0
  150. 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>