TreeSelect.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. <!--
  2. Composant de sélection hiérarchique à plusieurs niveaux permettant de naviguer
  3. et sélectionner des éléments organisés en catégories et sous-catégories.
  4. ## Exemple d'utilisation
  5. ```vue
  6. <TreeSelect
  7. v-model="selectedValues"
  8. :items="hierarchicalItems"
  9. :max-visible-chips="3"
  10. label="Sélectionner des éléments"
  11. />
  12. ```
  13. -->
  14. <template>
  15. <v-select
  16. :model-value="modelValue"
  17. :label="$t(label)"
  18. v-bind="$attrs"
  19. :items="flattenedItems"
  20. item-title="label"
  21. item-value="value"
  22. :variant="variant"
  23. multiple
  24. :menu-props="{ maxHeight: 400 }"
  25. @update:menu="onMenuUpdate"
  26. @update:model-value="$emit('update:modelValue', $event)"
  27. >
  28. <template #prepend-item>
  29. <!-- Champs de recherche textuelle -->
  30. <v-text-field
  31. ref="searchInput"
  32. v-model="searchText"
  33. density="compact"
  34. hide-details
  35. :placeholder="$t('search') + '...'"
  36. prepend-inner-icon="fas fa-magnifying-glass"
  37. variant="outlined"
  38. clearable
  39. class="mx-2 my-2"
  40. @click.stop="focusSearchInput"
  41. @mousedown.stop
  42. @keydown.stop="onKeyDown"
  43. @input="onSearchInputDebounced"
  44. @click:clear.stop="onSearchClear"
  45. />
  46. <v-divider class="mt-2" />
  47. </template>
  48. <template #selection="{ item, index }">
  49. <v-chip
  50. v-if="maxVisibleChips && index < maxVisibleChips"
  51. :key="item.raw.value"
  52. closable
  53. @click:close="removeItem(item.raw.value!)"
  54. >
  55. {{ selectedItemsMap[item.raw] || selectedItemsMap[item.raw.value] }}
  56. </v-chip>
  57. <span
  58. v-if="
  59. maxVisibleChips &&
  60. index === maxVisibleChips &&
  61. modelValue.length > maxVisibleChips
  62. "
  63. class="text-grey text-caption align-self-center"
  64. >
  65. (+{{ modelValue.length - maxVisibleChips }} {{ $t('others') }})
  66. </span>
  67. </template>
  68. <template #item="{ item }">
  69. <template v-if="item.raw.type === 'category'">
  70. <v-list-item
  71. :ripple="false"
  72. :class="{
  73. 'v-list-item--active': expandedCategories.has(item.raw.id),
  74. }"
  75. @click.stop="toggleCategory(item.raw.id)"
  76. >
  77. <template #prepend>
  78. <v-icon
  79. :icon="
  80. 'fas ' +
  81. (expandedCategories.has(item.raw.id)
  82. ? 'fa-angle-down'
  83. : 'fa-angle-right')
  84. "
  85. size="small"
  86. />
  87. </template>
  88. <v-list-item-title class="font-weight-medium">
  89. {{ item.raw.label }}
  90. </v-list-item-title>
  91. </v-list-item>
  92. </template>
  93. <template v-else-if="item.raw.type === 'subcategory'">
  94. <v-list-item
  95. :ripple="false"
  96. :class="{
  97. 'v-list-item--active': expandedSubcategories.has(item.raw.id),
  98. 'pl-8': true,
  99. }"
  100. @click.stop="toggleSubcategory(item.raw.id)"
  101. >
  102. <template #prepend>
  103. <v-icon
  104. :icon="
  105. 'fas ' +
  106. (expandedSubcategories.has(item.raw.id)
  107. ? 'fa-angle-down'
  108. : 'fa-angle-right')
  109. "
  110. size="small"
  111. />
  112. </template>
  113. <v-list-item-title>
  114. {{ item.raw.label }}
  115. </v-list-item-title>
  116. </v-list-item>
  117. </template>
  118. <template v-else>
  119. <v-list-item
  120. :active="modelValue.includes(item.raw.value!)"
  121. :class="{
  122. 'd-flex': true,
  123. 'pl-12': item.raw.level === 2,
  124. 'pl-8': item.raw.level === 1,
  125. }"
  126. @click="toggleItem(item.raw.value!)"
  127. >
  128. <template #prepend>
  129. <v-checkbox
  130. :model-value="modelValue.includes(item.raw.value!)"
  131. color="primary"
  132. :hide-details="true"
  133. @click.stop="toggleItem(item.raw.value!)"
  134. />
  135. </template>
  136. <v-list-item-title>
  137. {{ item.raw.label }}
  138. </v-list-item-title>
  139. </v-list-item>
  140. </template>
  141. </template>
  142. </v-select>
  143. </template>
  144. <script setup lang="ts">
  145. import StringUtils from '~/services/utils/stringUtils'
  146. import _ from 'lodash'
  147. import type { PropType } from 'vue'
  148. interface SelectItem {
  149. id: string
  150. label: string
  151. normalizedLabel?: string
  152. value?: number
  153. type: 'category' | 'subcategory' | 'item'
  154. parentId?: string
  155. level: number
  156. }
  157. const props = defineProps({
  158. modelValue: {
  159. type: Array as PropType<string[]>,
  160. required: true,
  161. },
  162. items: {
  163. type: Array as PropType<SelectItem[]>,
  164. required: true,
  165. },
  166. maxVisibleChips: {
  167. type: Number,
  168. required: false,
  169. default: null,
  170. },
  171. nbLevel: {
  172. type: Number,
  173. required: false,
  174. default: 3,
  175. },
  176. /**
  177. * Label du champ
  178. * Si non défini, c'est le nom de propriété qui est utilisé
  179. */
  180. label: {
  181. type: String,
  182. required: false,
  183. default: null,
  184. },
  185. /**
  186. * @see https://vuetifyjs.com/en/api/v-autocomplete/#props-variant
  187. */
  188. variant: {
  189. type: String as PropType<
  190. | 'filled'
  191. | 'outlined'
  192. | 'plain'
  193. | 'underlined'
  194. | 'solo'
  195. | 'solo-inverted'
  196. | 'solo-filled'
  197. | undefined
  198. >,
  199. required: false,
  200. default: 'outlined',
  201. },
  202. })
  203. const searchInput = ref()
  204. /**
  205. * Force le focus sur l'input de recherche
  206. */
  207. const focusSearchInput = () => {
  208. nextTick(() => {
  209. if (searchInput.value?.$el) {
  210. const input = searchInput.value.$el.querySelector('input')
  211. if (input) {
  212. input.focus()
  213. }
  214. }
  215. })
  216. }
  217. /**
  218. * Gère les événements clavier pour éviter les conflits avec la navigation du menu
  219. */
  220. const onKeyDown = (event: KeyboardEvent) => {
  221. // Empêcher la propagation pour tous les caractères alphanumériques
  222. // et les touches spéciales de navigation
  223. if (
  224. event.key.length === 1 || // Caractères simples (a, c, etc.)
  225. ['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(
  226. event.key,
  227. )
  228. ) {
  229. event.stopPropagation()
  230. }
  231. // Empêcher également Escape de fermer le menu quand on est dans l'input
  232. if (event.key === 'Escape') {
  233. event.stopPropagation()
  234. // Optionnel : vider le texte de recherche
  235. if (searchText.value) {
  236. searchText.value = ''
  237. onSearchClear()
  238. }
  239. }
  240. }
  241. /**
  242. * A computed property that normalizes the labels of all items upfront.
  243. * This avoids having to normalize labels during each search operation.
  244. */
  245. const normalizedItems = computed(() => {
  246. return props.items.map((item) => ({
  247. ...item,
  248. normalizedLabel: StringUtils.normalize(item.label),
  249. }))
  250. })
  251. const emit = defineEmits(['update:modelValue'])
  252. const expandedCategories: Ref<Set<string>> = ref(new Set())
  253. const expandedSubcategories: Ref<Set<string>> = ref(new Set())
  254. const searchText: Ref<string> = ref('')
  255. /**
  256. * Expands all parent categories and subcategories of selected items.
  257. */
  258. const expandParentsOfSelectedItems = () => {
  259. expandedCategories.value.clear()
  260. expandedSubcategories.value.clear()
  261. for (const selectedId of props.modelValue) {
  262. const item = normalizedItems.value.find((i) => i.value === selectedId)
  263. if (!item) continue
  264. let parentId = null
  265. if(props.nbLevel === 3){
  266. // Trouver la sous-catégorie
  267. const subcategory = normalizedItems.value.find(
  268. (i) => i.id === item.parentId,
  269. )
  270. if (subcategory) {
  271. expandedSubcategories.value.add(subcategory.id)
  272. parentId = subcategory.parentId
  273. }
  274. }else{
  275. parentId = item.parentId
  276. }
  277. if (parentId) {
  278. // Trouver la catégorie
  279. const category = normalizedItems.value.find(
  280. (i) => i.id === parentId,
  281. )
  282. if (category) {
  283. expandedCategories.value.add(category.id)
  284. }
  285. }
  286. }
  287. }
  288. /**
  289. * A callback function that is triggered when the menu's open state is updated.
  290. */
  291. const onMenuUpdate = (isOpen: boolean) => {
  292. if (isOpen) {
  293. expandParentsOfSelectedItems()
  294. }
  295. // Réinitialiser la recherche quand le menu se ferme
  296. else if (searchText.value) {
  297. searchText.value = ''
  298. onSearchInput()
  299. }
  300. }
  301. /**
  302. * Toggles the expanded state of a given category. If the category is currently
  303. * expanded, it will collapse the category and also collapse its subcategories.
  304. * If the category is not expanded, it will expand the category.
  305. *
  306. * @param {string} categoryId - The unique identifier of the category to toggle.
  307. */
  308. const toggleCategory = (categoryId: string) => {
  309. if (expandedCategories.value.has(categoryId)) {
  310. expandedCategories.value.delete(categoryId)
  311. // Fermer aussi les sous-catégories
  312. const subcategories = normalizedItems.value.filter(
  313. (i) => i.parentId === categoryId && i.type === 'subcategory',
  314. )
  315. subcategories.forEach((sub) => {
  316. expandedSubcategories.value.delete(sub.id)
  317. })
  318. } else {
  319. expandedCategories.value.add(categoryId)
  320. }
  321. }
  322. /**
  323. * Toggles the expansion state of a subcategory.
  324. *
  325. * @param {string} subcategoryId - The unique identifier of the subcategory to be toggled.
  326. */
  327. const toggleSubcategory = (subcategoryId: string) => {
  328. if (expandedSubcategories.value.has(subcategoryId)) {
  329. expandedSubcategories.value.delete(subcategoryId)
  330. } else {
  331. expandedSubcategories.value.add(subcategoryId)
  332. }
  333. }
  334. /**
  335. * A function that toggles the inclusion of a specific value in
  336. * the selected items list.
  337. *
  338. * @param {string} value - The value to toggle in the selected items list.
  339. */
  340. const toggleItem = (value: string) => {
  341. const currentSelection = [...props.modelValue]
  342. const index = currentSelection.indexOf(value)
  343. if (index > -1) {
  344. currentSelection.splice(index, 1)
  345. } else {
  346. currentSelection.push(value)
  347. }
  348. emit('update:modelValue', currentSelection)
  349. }
  350. /**
  351. * Removes the specified item from the model value and emits an update event.
  352. *
  353. * @param {string} value - The item to be removed from the model value.
  354. * @emits update:modelValue - A custom event emitted with the updated model value
  355. * after the specified item has been removed.
  356. */
  357. const removeItem = (value: string) => {
  358. emit(
  359. 'update:modelValue',
  360. props.modelValue.filter((item) => item !== value),
  361. )
  362. }
  363. /**
  364. * Fonction appellée lorsque l'input de recherche textuelle est modifié
  365. */
  366. const onSearchInput = () => {
  367. // Réinitialiser les états d'expansion dans tous les cas
  368. expandedCategories.value.clear()
  369. expandedSubcategories.value.clear()
  370. if (searchText.value.trim()) {
  371. // Trouver tous les éléments qui correspondent à la recherche
  372. const matchingItems = normalizedItems.value.filter(
  373. (item) =>
  374. item.type === 'item' && item.level === (props.nbLevel - 1) && itemMatchesSearch(item),
  375. )
  376. // Pour chaque élément correspondant, ajouter ses parents aux ensembles d'expansion
  377. for (const item of matchingItems) {
  378. let category
  379. if(props.nbLevel === 3){
  380. // Trouver et ajouter la sous-catégorie parente
  381. const subcategory = normalizedItems.value.find(
  382. (i) => i.id === item.parentId,
  383. )
  384. if (subcategory) {
  385. expandedSubcategories.value.add(subcategory.id)
  386. // Trouver et ajouter la catégorie parente
  387. category = normalizedItems.value.find(
  388. (i) => i.id === subcategory.parentId,
  389. )
  390. }
  391. }else{
  392. // Trouver et ajouter la catégorie parente
  393. category = normalizedItems.value.find(
  394. (i) => i.id === item.parentId,
  395. )
  396. }
  397. if (category) {
  398. expandedCategories.value.add(category.id)
  399. }
  400. }
  401. }
  402. }
  403. const onSearchInputDebounced = _.debounce(onSearchInput, 200)
  404. const onSearchClear = () => {
  405. searchText.value = ''
  406. onSearchInput()
  407. }
  408. /**
  409. * Checks if any word in the normalized text starts with the normalized search term.
  410. *
  411. * @param {string} normalizedText - The normalized text to check.
  412. * @param {string} normalizedSearch - The normalized search term.
  413. * @returns {boolean} `true` if any word in the text starts with the search term; otherwise, `false`.
  414. */
  415. const anyWordStartsWith = (
  416. normalizedText: string,
  417. normalizedSearch: string,
  418. ): boolean => {
  419. if (normalizedText.indexOf(normalizedSearch) === 0) return true
  420. const spaceIndex = normalizedText.indexOf(' ')
  421. if (spaceIndex === -1) return false
  422. return normalizedText
  423. .split(' ')
  424. .some((word) => word.startsWith(normalizedSearch))
  425. }
  426. /**
  427. * Determines if a given item matches the current search text by checking its normalized label
  428. * and, for certain items, the normalized labels of its parent elements.
  429. *
  430. * The search text is normalized using `StringUtils.normalize` before comparison.
  431. * If no search text is provided, the item matches by default.
  432. *
  433. * For items of type `item` at level 2, the function checks:
  434. * - The normalized label of the item itself
  435. * - The normalized label of its parent subcategory
  436. * - The normalized label of the grandparent category (if applicable)
  437. *
  438. * For all other item types, only the item's normalized label is checked.
  439. *
  440. * The matching is done by checking if any word in the normalized label starts with the normalized search text.
  441. *
  442. * @param {SelectItem} item - The item to evaluate against the search text.
  443. * @returns {boolean} `true` if the item or its relevant parent(s) match the search text; otherwise, `false`.
  444. */
  445. const itemMatchesSearch = (item: SelectItem): boolean => {
  446. if (!searchText.value) return true
  447. const normalizedSearch = StringUtils.normalize(searchText.value)
  448. // Find the item with normalized label from our computed property
  449. const itemWithNormalizedLabel = normalizedItems.value.find(
  450. (i) => i.id === item.id,
  451. )
  452. if (!itemWithNormalizedLabel) return false
  453. // Si c'est un élément de niveau nbLevel - 1, vérifier son label et les labels de ses parents
  454. if (item.type === 'item' && item.level === (props.nbLevel - 1)) {
  455. // Vérifier le label de l'élément
  456. if (
  457. anyWordStartsWith(
  458. itemWithNormalizedLabel.normalizedLabel!,
  459. normalizedSearch,
  460. )
  461. )
  462. return true
  463. let parentId = item.parentId
  464. if(props.nbLevel === 3){
  465. // Trouver et vérifier le label de la sous-catégorie parente
  466. const subcategory = normalizedItems.value.find(
  467. (i) => i.id === parentId,
  468. )
  469. if (
  470. subcategory &&
  471. anyWordStartsWith(subcategory.normalizedLabel!, normalizedSearch)
  472. )
  473. return true
  474. // Trouver et vérifier le label de la catégorie parente
  475. if (subcategory && subcategory.parentId) {
  476. parentId = subcategory.parentId
  477. }
  478. }
  479. // Trouver et vérifier le label de la catégorie parente
  480. const category = normalizedItems.value.find(
  481. (i) => i.id === parentId,
  482. )
  483. if (
  484. category &&
  485. anyWordStartsWith(category.normalizedLabel!, normalizedSearch)
  486. )
  487. return true
  488. return false
  489. }
  490. // Pour les autres types d'éléments, vérifier simplement leur label
  491. return anyWordStartsWith(
  492. itemWithNormalizedLabel.normalizedLabel!,
  493. normalizedSearch,
  494. )
  495. }
  496. /**
  497. * Filtre les éléments de niveau 2 qui correspondent au texte de recherche.
  498. *
  499. * @returns {SelectItem[]} Les éléments de niveau 2 qui correspondent à la recherche.
  500. */
  501. const findMatchingLevel2Items = (): SelectItem[] => {
  502. return normalizedItems.value.filter(
  503. (item) =>
  504. item.type === 'item' && item.level === (props.nbLevel - 1) && itemMatchesSearch(item),
  505. )
  506. }
  507. /**
  508. * Construit une liste hiérarchique d'éléments basée sur les résultats de recherche.
  509. * Pour chaque élément correspondant, ajoute sa hiérarchie complète (catégorie et sous-catégorie).
  510. *
  511. * @param {SelectItem[]} matchingItems - Les éléments correspondant à la recherche.
  512. * @returns {SelectItem[]} Liste hiérarchique incluant les éléments et leurs parents.
  513. */
  514. const buildSearchResultsList = (matchingItems: SelectItem[]): SelectItem[] => {
  515. const result: SelectItem[] = []
  516. const addedCategoryIds = new Set<string>()
  517. const addedSubcategoryIds = new Set<string>()
  518. for (const item of matchingItems) {
  519. let parentId = item.parentId
  520. if(props.nbLevel === 3){
  521. // Trouver la sous-catégorie parente
  522. const subcategory = normalizedItems.value.find(
  523. (i) => i.id === parentId,
  524. )
  525. if (!subcategory) continue
  526. // Ajouter la sous-catégorie si elle n'est pas déjà présente
  527. if (!addedSubcategoryIds.has(subcategory.id)) {
  528. result.push(subcategory)
  529. addedSubcategoryIds.add(subcategory.id)
  530. expandedSubcategories.value.add(subcategory.id)
  531. }
  532. parentId = subcategory.parentId
  533. }
  534. // Trouver la catégorie parente
  535. const category = normalizedItems.value.find(
  536. (i) => i.id === parentId,
  537. )
  538. if (!category) continue
  539. // Ajouter la catégorie si elle n'est pas déjà présente
  540. if (!addedCategoryIds.has(category.id)) {
  541. result.push(category)
  542. addedCategoryIds.add(category.id)
  543. expandedCategories.value.add(category.id)
  544. }
  545. // Ajouter l'élément
  546. result.push(item)
  547. }
  548. return result
  549. }
  550. /**
  551. * Traite récursivement les éléments pour construire une liste hiérarchique
  552. * basée sur l'état d'expansion des catégories et sous-catégories.
  553. *
  554. * @param {SelectItem[]} items - Les éléments à traiter.
  555. * @param {SelectItem[]} result - Le tableau résultat à remplir.
  556. * @param {boolean} parentExpanded - Indique si le parent est développé.
  557. */
  558. const processItemsRecursively = (
  559. items: SelectItem[],
  560. result: SelectItem[],
  561. parentExpanded = true,
  562. ): void => {
  563. for (const item of items) {
  564. if (item.type === 'category') {
  565. result.push(item)
  566. if (expandedCategories.value.has(item.id)) {
  567. const subcategories = normalizedItems.value.filter(
  568. (i) => i.parentId === item.id
  569. && ((props.nbLevel == 2 && i.type === 'item') || (props.nbLevel == 3 && i.type === 'subcategory')),
  570. )
  571. processItemsRecursively(subcategories, result, true)
  572. }
  573. } else if (item.type === 'subcategory') {
  574. if (parentExpanded) {
  575. result.push(item)
  576. if (expandedSubcategories.value.has(item.id)) {
  577. const subItems = normalizedItems.value.filter(
  578. (i) => i.parentId === item.id && i.type === 'item',
  579. )
  580. processItemsRecursively(subItems, result, true)
  581. }
  582. }
  583. } else if (item.type === 'item' && parentExpanded) {
  584. result.push(item)
  585. }
  586. }
  587. }
  588. /**
  589. * Construit une liste hiérarchique d'éléments en mode normal (sans recherche).
  590. *
  591. * @returns {SelectItem[]} Liste hiérarchique basée sur l'état d'expansion.
  592. */
  593. const buildNormalModeList = (): SelectItem[] => {
  594. const result: SelectItem[] = []
  595. const topLevelItems = normalizedItems.value.filter((item) => !item.parentId)
  596. processItemsRecursively(topLevelItems, result)
  597. return result
  598. }
  599. /**
  600. * A computed property that generates a flattened and organized list of items
  601. * from a hierarchical structure, based on the current search text and
  602. * expanded categories/subcategories.
  603. *
  604. * @returns {SelectItem[]} Flattened and organized list of items.
  605. */
  606. const flattenedItems = computed(() => {
  607. const hasSearch = !!searchText.value.trim()
  608. if (hasSearch) {
  609. const matchingItems = findMatchingLevel2Items()
  610. return buildSearchResultsList(matchingItems)
  611. }
  612. return buildNormalModeList()
  613. })
  614. /**
  615. * A computed property that maps selected values to their corresponding labels.
  616. * This is used to display the correct labels in the chips when the dropdown is closed.
  617. *
  618. * @returns {Record<string, string>} A map of selected values to their labels.
  619. */
  620. const selectedItemsMap = computed(() => {
  621. const map: Record<string, string> = {}
  622. // Find all selectable items (type 'item') in the items array with normalized labels
  623. const selectableItems = normalizedItems.value.filter(
  624. (item) => item.type === 'item' && item.value,
  625. )
  626. // Create a map of values to labels
  627. selectableItems.forEach((item) => {
  628. if (item.value) {
  629. map[item.value] = item.label
  630. }
  631. })
  632. return map
  633. })
  634. </script>
  635. <style scoped lang="scss">
  636. .v-list-item--active {
  637. background-color: rgba(var(--v-theme-primary), 0.1);
  638. }
  639. .v-list-item {
  640. contain: layout style paint;
  641. height: 40px !important; /* Ensure consistent height for virtual scrolling */
  642. min-height: 40px !important;
  643. max-height: 40px !important;
  644. padding-top: 0 !important;
  645. padding-bottom: 0 !important;
  646. }
  647. .search-icon {
  648. color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
  649. }
  650. :deep(.v-field__prepend-inner) {
  651. padding-top: 0;
  652. }
  653. :deep(.v-list) {
  654. padding-top: 0;
  655. contain: content;
  656. will-change: transform;
  657. transform-style: preserve-3d;
  658. }
  659. </style>