@usssa/component-library 1.0.0-alpha.21 → 1.0.0-alpha.210

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 (97) hide show
  1. package/README.md +8 -5
  2. package/package.json +25 -6
  3. package/src/assets/fonts/CorneroRegular.woff +0 -0
  4. package/src/assets/fonts/CorneroRegular.woff2 +0 -0
  5. package/src/assets/logo.svg +19 -0
  6. package/src/assets/no-result.svg +25 -0
  7. package/src/assets/upload-illustration.svg +48 -0
  8. package/src/components/core/UAccordionSelect.vue +237 -0
  9. package/src/components/core/UAvatar.vue +90 -26
  10. package/src/components/core/UAvatarGroup.vue +62 -52
  11. package/src/components/core/UBadgeStd.vue +6 -1
  12. package/src/components/core/UBannerStd.vue +100 -31
  13. package/src/components/core/UBreadCrumbs.vue +171 -0
  14. package/src/components/core/UBtnIcon.vue +57 -52
  15. package/src/components/core/UBtnStd.vue +38 -31
  16. package/src/components/core/UBtnToggle.vue +11 -6
  17. package/src/components/core/UCheckboxStd.vue +26 -20
  18. package/src/components/core/UChip.vue +91 -43
  19. package/src/components/core/UDate.vue +581 -0
  20. package/src/components/core/UDialogStd.vue +452 -58
  21. package/src/components/core/UDrawer/UDrawer.vue +471 -0
  22. package/src/components/core/UDrawer/UDrawerMenuItem.vue +124 -0
  23. package/src/components/core/UEventCard.vue +419 -0
  24. package/src/components/core/UExpansionStd.vue +274 -0
  25. package/src/components/core/UExpansionTableStd.vue +297 -0
  26. package/src/components/core/UFilter.vue +89 -0
  27. package/src/components/core/UGameObject.vue +441 -0
  28. package/src/components/core/UInnerLoader.vue +69 -0
  29. package/src/components/core/UInputAddressLookup.vue +484 -0
  30. package/src/components/core/UInputPhoneStd.vue +74 -68
  31. package/src/components/core/UInputTextStd.vue +137 -116
  32. package/src/components/core/UInputTypeahead.vue +44 -0
  33. package/src/components/core/UInputTypeaheadAdvanceSearch.vue +134 -0
  34. package/src/components/core/UMenuButtonStd.vue +280 -0
  35. package/src/components/core/UMenuDropdown.vue +82 -0
  36. package/src/components/core/UMenuDropdownAdvancedSearch.vue +306 -0
  37. package/src/components/core/UMenuItem.vue +221 -0
  38. package/src/components/core/UMenuSearch.vue +73 -0
  39. package/src/components/core/UModal.vue +660 -0
  40. package/src/components/core/UMultiSelectStd.vue +501 -61
  41. package/src/components/core/UPagination.vue +84 -25
  42. package/src/components/core/URadioBtn.vue +66 -43
  43. package/src/components/core/URadioStd.vue +23 -14
  44. package/src/components/core/USelectStd.vue +415 -84
  45. package/src/components/core/USheet.vue +349 -0
  46. package/src/components/core/UStepper/UProgress.vue +157 -0
  47. package/src/components/core/UStepper/UStepper.vue +211 -0
  48. package/src/components/core/UTabBtnStd.vue +36 -22
  49. package/src/components/core/UTable/UTable.vue +2055 -57
  50. package/src/components/core/UTableStd.vue +1301 -273
  51. package/src/components/core/UTabsStd.vue +52 -23
  52. package/src/components/core/UToggleStd.vue +18 -13
  53. package/src/components/core/UToolbar/UCustomMenuIcon.vue +58 -0
  54. package/src/components/core/UToolbar/UToolbar.vue +226 -0
  55. package/src/components/core/UTooltip.vue +31 -10
  56. package/src/components/core/UTypeahead.vue +890 -0
  57. package/src/components/core/UUploader.vue +644 -0
  58. package/src/components/index.js +77 -26
  59. package/src/composables/useNotify.js +16 -16
  60. package/src/composables/useOverlayLoader.js +23 -0
  61. package/src/composables/useScreenType.js +30 -0
  62. package/src/css/app.sass +42 -25
  63. package/src/css/colors.sass +2 -0
  64. package/src/css/quasar.variables.sass +99 -68
  65. package/src/css/vars/colors.variables.sass +28 -41
  66. package/src/utils/data.ts +177 -0
  67. package/src/App.vue +0 -9
  68. package/src/boot/.gitkeep +0 -0
  69. package/src/layouts/MainLayout.vue +0 -137
  70. package/src/pages/Avatar.vue +0 -77
  71. package/src/pages/AvatarGroup.vue +0 -139
  72. package/src/pages/BadgeStd.vue +0 -83
  73. package/src/pages/BannerPage.vue +0 -76
  74. package/src/pages/BtnIcon.vue +0 -120
  75. package/src/pages/BtnStd.vue +0 -126
  76. package/src/pages/BtnToggle.vue +0 -131
  77. package/src/pages/CheckBox.vue +0 -62
  78. package/src/pages/Chip.vue +0 -92
  79. package/src/pages/ComponentBase.vue +0 -54
  80. package/src/pages/Dialog.vue +0 -206
  81. package/src/pages/ErrorNotFound.vue +0 -11
  82. package/src/pages/IndexPage.vue +0 -11
  83. package/src/pages/InputPhone.vue +0 -152
  84. package/src/pages/InputText.vue +0 -139
  85. package/src/pages/MultiSelectStd.vue +0 -174
  86. package/src/pages/NotifyPage.vue +0 -109
  87. package/src/pages/Pagination.vue +0 -71
  88. package/src/pages/Radio.vue +0 -80
  89. package/src/pages/RadioBtn.vue +0 -104
  90. package/src/pages/SelectStd.vue +0 -160
  91. package/src/pages/TabButtonPage.vue +0 -126
  92. package/src/pages/TablePage.vue +0 -371
  93. package/src/pages/TabsPage.vue +0 -261
  94. package/src/pages/TogglePage.vue +0 -58
  95. package/src/pages/TooltipPage.vue +0 -125
  96. package/src/router/index.js +0 -34
  97. package/src/router/routes.js +0 -113
package/README.md CHANGED
@@ -1,13 +1,16 @@
1
- # Component Library v1.0.0-alpha.21
1
+ # Component Library v1.0.0-alpha.210
2
2
 
3
- This library provides custom UI components for USSSA applications.
3
+ **This library provides custom UI components for USSSA applications**
4
4
 
5
5
  ## Installation
6
6
 
7
7
  1. Install the packge using command 'yarn'
8
8
  2. Go to specific page where you want to use a component from that library.
9
- a. Import the library in your Quasar project: `import { UBtnStd } from 'component-library'`
9
+ a. Import the component in your project: `import { UBtnStd } from '@usssa/component-library'`
10
10
  b. Use the BtnStd component in your Nuxt app: `<UBtnStd label="Test" size="lg" />`
11
+ 3. We need to import below file to support component library styling in our project
12
+ a. @import '@usssa/component-library/src/css/app.sass'
13
+ b. @import '@usssa/component-library/src/css/quasar.variables.sass'
11
14
 
12
15
  ## Development
13
16
 
@@ -22,11 +25,11 @@ yarn dev
22
25
 
23
26
  ## Usage in other local projects
24
27
 
25
- 1. Clone the component-library repo and install dependencies
28
+ 1. Clone the component-library repo and install dependencies.
26
29
  2. In component-library directory run `yarn link`
27
30
  3. In Nuxt or Quasar project directory run `yarn link @usssa/component-library`
28
31
 
29
32
  When done:
30
33
 
31
- 1. In Nuxt or Quasar project directory run `yarn unlink @usssa/component-library`
34
+ 1. In Nuxt or Quasar project directory run to unlink `yarn unlink @usssa/component-library`
32
35
  2. In component-library directory run `yarn unlink`
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "@usssa/component-library",
3
- "version": "1.0.0-alpha.21",
3
+ "version": "1.0.0-alpha.210",
4
4
  "description": "A Quasar component library project",
5
5
  "productName": "Quasar component library App",
6
- "author": "Troy Moreland <troy.moreland@usssa.com>",
6
+ "author": "Engineering Team <engineering@usssa.com>",
7
7
  "main": "src/components/index.js",
8
8
  "files": [
9
- "src",
10
- "README.md"
9
+ "src/assets",
10
+ "src/composables",
11
+ "src/components",
12
+ "src/css",
13
+ "src/utils",
14
+ "README.md",
15
+ "package.json"
11
16
  ],
12
17
  "publishConfig": {
13
18
  "access": "public"
@@ -20,10 +25,19 @@
20
25
  "deploy": "firebase deploy",
21
26
  "dev": "quasar dev",
22
27
  "build": "quasar build",
23
- "start": "node --experimental-detect-module index.js"
28
+ "start": "node --experimental-detect-module index.js",
29
+ "test:component:ci": "cypress run --component",
30
+ "test:component": "cypress open --component"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/usssa-org/component-library.git"
24
35
  },
25
36
  "dependencies": {
37
+ "@fawmi/vue-google-maps": "^0.9.79",
26
38
  "@quasar/extras": "^1.16.4",
39
+ "@usssa/core-client": "^0.0.19",
40
+ "algoliasearch": "4",
27
41
  "flag-icons": "^7.2.3",
28
42
  "quasar": "^2.16.0",
29
43
  "vue": "^3.4.18",
@@ -31,7 +45,10 @@
31
45
  },
32
46
  "devDependencies": {
33
47
  "@quasar/app-vite": "^1.9.0",
48
+ "@quasar/quasar-app-extension-testing-e2e-cypress": "^6.1.0",
34
49
  "autoprefixer": "^10.4.2",
50
+ "cypress": "^13.17.0",
51
+ "dotenv": "^16.4.5",
35
52
  "eslint": "^8.57.0",
36
53
  "eslint-config-prettier": "^8.1.0",
37
54
  "eslint-plugin-vue": "^9.0.0",
@@ -39,6 +56,7 @@
39
56
  "postcss": "^8.4.14",
40
57
  "prettier": "^2.5.1",
41
58
  "semantic-release": "^24.1.0",
59
+ "vite-plugin-alias": "^0.1.1",
42
60
  "vite-plugin-checker": "^0.6.4"
43
61
  },
44
62
  "engines": {
@@ -50,5 +68,6 @@
50
68
  "bugs": {
51
69
  "url": "https://github.com/usssa-org/component-library/issues"
52
70
  },
53
- "license": "ISC"
71
+ "license": "ISC",
72
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
54
73
  }
@@ -0,0 +1,19 @@
1
+ <svg width="95" height="24" viewBox="0 0 95 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Logo">
3
+ <g id="Lettering">
4
+ <path d="M3.80408 2.66675H8.95923L4.80595 13.2946L11.6168 13.2333L15.8059 2.66675H20.8L16.7704 12.978C15.8482 15.3379 13.5896 16.889 11.0754 16.889H3.24023L3.23972 16.8853C0.95221 16.7796 -0.597379 14.4417 0.221722 12.2504L3.80408 2.66675Z" fill="#234BA9"/>
5
+ <path d="M25.3431 2.66675C24.1871 2.66675 23.1592 3.40891 22.7861 4.5129L22.2017 6.24262L21.3962 8.1931L20.9479 9.20419C20.5153 10.1799 21.2229 11.2814 22.2822 11.2814H30.0955L29.3215 13.3117H19.4306L17.9807 16.8876H30.4658C31.6432 16.8876 32.7118 16.1933 33.199 15.1119L34.01 13.3117H33.9934L34.7674 11.2814H34.7746L35.0296 10.6669C35.5176 9.49105 34.6615 8.1931 33.398 8.1931H26.3902L27.1957 6.24262H36.3783L37.8282 2.66675H25.3431Z" fill="#234BA9"/>
6
+ <path d="M65.9075 2.66675C64.7515 2.66675 63.7235 3.40891 63.3505 4.5129L62.7661 6.24262L61.9606 8.1931L61.5123 9.20419C61.0797 10.1799 61.7873 11.2814 62.8466 11.2814H70.6599L69.8859 13.3117H59.995L58.5451 16.8876H71.0302C72.2076 16.8876 73.2762 16.1933 73.7634 15.1119L74.5744 13.3117H74.5578L75.3318 11.2814H75.339L75.594 10.6669C76.0819 9.49105 75.2259 8.1931 73.9624 8.1931H66.9546L67.7601 6.24262H76.9427L78.3926 2.66675H65.9075Z" fill="#234BA9"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M92.0723 2.66675H80.9702L79.6009 6.24262H89.5386L88.7205 8.27437H81.103C79.3981 8.27437 77.8944 9.40113 77.4017 11.0479L76.8451 12.908C76.2519 14.8906 77.7229 16.8889 79.7755 16.8888L90.3945 16.8883L93.6818 8.51818H93.697L94.5025 6.24262C95.162 4.52034 93.9023 2.66675 92.0723 2.66675ZM81.373 13.3131L82.259 11.2001H87.6558L86.7698 13.3131H81.373Z" fill="#234BA9"/>
8
+ </g>
9
+ <path id="top" d="M47.7783 0.00113767H62.8782C61.1471 3.8405 58.0313 4.88033 55.3948 4.88033H49.6691V1.41424L47.2456 4.88033H43.464L45.8076 6.95998L43.464 10.3994L47.3255 8.34642L49.6957 10.4794L49.6691 6.95998H54.5426C58.271 6.93332 58.8036 10.4794 58.1378 11.8125H42.7184C41.3069 11.8125 37.1258 10.7724 39.0166 5.76018C40.7743 1.78735 44.982 -0.0524702 47.7783 0.00113767Z" fill="#234BA9"/>
10
+ <g id="bottom">
11
+ <path d="M32.3588 20.1976C32.705 18.5712 34.7556 15.5317 38.484 15.2917H46.1804C46.3668 15.2917 46.8835 15.2704 47.2456 14.5452L47.7516 13.1987H57.6318C57.2324 14.2741 55.7943 16.5448 52.6518 16.7315H46.5532C46.5 16.7315 45.6899 16.8463 45.3282 17.6913C44.9287 18.6245 44.2097 18.7845 43.8368 18.8111H35.9007C35.2616 18.8378 33.7702 19.0511 32.3588 20.1976Z" fill="#CB2A3D"/>
12
+ <path d="M56.1937 16.7181C55.7943 18.3445 53.8875 21.4054 50.0952 21.5973H44.1032C43.5439 21.6507 42.9484 21.7679 42.6118 22.6105C42.2603 23.4904 41.4933 23.7037 40.9873 23.7037H30.8674C31.258 22.6372 32.7902 20.4455 35.7942 20.2109H43.5173C43.7658 20.202 44.2363 20.1842 44.6092 19.3044C44.982 18.4245 45.2217 18.1312 46.0639 18.1046H52.6252C53.1844 18.1135 54.8089 17.838 56.1937 16.7181Z" fill="#CB2A3D"/>
13
+ </g>
14
+ <g id="shadow">
15
+ <path d="M49.7491 13.1987L48.3643 16.7315H46.7132C46.367 16.7493 45.6394 16.9261 45.2985 17.758L46.2871 15.2864C46.4735 15.2784 46.8996 15.1611 47.2192 14.5852L47.7518 13.1987H49.7491Z" fill="#951F23"/>
16
+ <path d="M42.6119 22.6114L42.6274 22.5736C42.959 21.7945 43.8175 21.5982 44.2631 21.5982H45.6745L47.0594 18.1055H46.0474C45.1419 18.0788 44.8377 18.6727 44.5747 19.3844C44.4761 19.651 44.1299 20.1538 43.5973 20.2072L42.6274 22.5736C42.6221 22.586 42.617 22.5986 42.6119 22.6114Z" fill="#951F23"/>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,25 @@
1
+ <svg width="125" height="124" viewBox="0 0 125 124" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_11793_42180)">
3
+ <path d="M62.5 124C96.7417 124 124.5 96.2417 124.5 62C124.5 27.7583 96.7417 0 62.5 0C28.2583 0 0.5 27.7583 0.5 62C0.5 96.2417 28.2583 124 62.5 124Z" fill="#12316C"/>
4
+ <mask id="mask0_11793_42180" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="125" height="124">
5
+ <path d="M62.5 124C96.7417 124 124.5 96.2417 124.5 62C124.5 27.7583 96.7417 0 62.5 0C28.2583 0 0.5 27.7583 0.5 62C0.5 96.2417 28.2583 124 62.5 124Z" fill="#1048BD"/>
6
+ </mask>
7
+ <g mask="url(#mask0_11793_42180)">
8
+ <path d="M-41.5147 19.8398C-78.3898 19.8398 -119.384 46.858 -133.078 80.1865C-146.773 113.515 -127.981 140.533 -91.1059 140.533H68.2098C78.0276 116.747 60.037 90.8359 33.7036 90.8359H-20.6698V126.334L-45.3014 105.035L-86.2352 126.334L-61.0733 90.8359L-86.3264 69.5371H-45.9396L-20.6745 34.0391V69.5371H42.4827C75.6912 69.5371 105.554 49.8552 117.887 19.8398H-41.5147Z" fill="#1048BD"/>
9
+ <rect x="21.9932" y="30.5864" width="80.1867" height="107.467" rx="8" fill="white"/>
10
+ <rect x="30.2598" y="89.2798" width="63.6533" height="23" rx="3" fill="#B9E0FF"/>
11
+ <ellipse cx="39.7664" cy="100.78" rx="4.54667" ry="5.5" fill="white"/>
12
+ <rect x="47.6196" y="98.2798" width="26.4533" height="3" rx="1.5" fill="white"/>
13
+ <rect x="47.6196" y="102.28" width="9.92" height="2" rx="1" fill="white"/>
14
+ <rect x="30.2598" y="115.28" width="63.6533" height="23" rx="3" fill="#B9E0FF"/>
15
+ <ellipse cx="39.7664" cy="126.78" rx="4.54667" ry="5.5" fill="white"/>
16
+ </g>
17
+ <circle opacity="0.2" cx="62.5003" cy="62.0003" r="19.2889" fill="#CB2A3D"/>
18
+ <path d="M69.8603 56.3566C70.3343 55.8826 70.3343 55.1141 69.8603 54.6401C69.3863 54.1662 68.6179 54.1662 68.1439 54.6401L62.5002 60.2838L56.8566 54.6401C56.3826 54.1662 55.6141 54.1662 55.1401 54.6401C54.6662 55.1141 54.6662 55.8826 55.1401 56.3566L60.7838 62.0002L55.1401 67.6439C54.6662 68.1179 54.6662 68.8863 55.1401 69.3603C55.6141 69.8343 56.3826 69.8343 56.8566 69.3603L62.5002 63.7166L68.1439 69.3603C68.6179 69.8343 69.3863 69.8343 69.8603 69.3603C70.3343 68.8863 70.3343 68.1179 69.8603 67.6439L64.2166 62.0002L69.8603 56.3566Z" fill="#CB2A3D"/>
19
+ </g>
20
+ <defs>
21
+ <clipPath id="clip0_11793_42180">
22
+ <rect width="124" height="124" fill="white" transform="translate(0.5)"/>
23
+ </clipPath>
24
+ </defs>
25
+ </svg>
@@ -0,0 +1,48 @@
1
+ <svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_4523_215)">
3
+ <path d="M75 150C116.421 150 150 116.421 150 75C150 33.5786 116.421 0 75 0C33.5786 0 0 33.5786 0 75C0 116.421 33.5786 150 75 150Z" fill="#12316C"/>
4
+ <mask id="mask0_4523_215" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="150" height="150">
5
+ <path d="M75 150C116.421 150 150 116.421 150 75C150 33.5786 116.421 0 75 0C33.5786 0 0 33.5786 0 75C0 116.421 33.5786 150 75 150Z" fill="#0C5DF3"/>
6
+ </mask>
7
+ <g mask="url(#mask0_4523_215)">
8
+ <path d="M-50.8244 24C-95.4313 24 -145.021 56.6832 -161.587 97C-178.152 137.317 -155.421 170 -110.814 170H81.9069C93.7832 141.226 72.0204 109.882 40.1655 109.882H-25.6088V152.824L-55.4051 127.059L-104.922 152.824L-74.4839 109.882L-105.032 84.1177H-56.177L-25.6144 41.1765V84.1177H50.7853C90.9569 84.1177 127.081 60.3089 142 24H-50.8244Z" fill="#1048BD"/>
9
+ <rect x="55.5648" y="44.3368" width="89.4842" height="119.927" rx="8" transform="rotate(15 55.5648 44.3368)" fill="white"/>
10
+ </g>
11
+ <rect x="61.6106" y="57.4174" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(15 61.6106 57.4174)" fill="#B9E0FF"/>
12
+ <rect x="55.8801" y="78.8034" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(15 55.8801 78.8034)" fill="#B9E0FF"/>
13
+ <rect x="50.1498" y="100.189" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(15 50.1498 100.189)" fill="#52B3FF"/>
14
+ <rect x="44.4194" y="121.575" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(15 44.4194 121.575)" fill="#B9E0FF"/>
15
+ <rect x="38.6891" y="142.961" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(15 38.6891 142.961)" fill="#B9E0FF"/>
16
+ <rect x="58.7454" y="68.1104" width="59.9637" height="5.53511" rx="2.76755" transform="rotate(15 58.7454 68.1104)" fill="#52B3FF"/>
17
+ <rect x="53.015" y="89.4965" width="63.6537" height="5.53511" rx="2.76755" transform="rotate(15 53.015 89.4965)" fill="#B9E0FF"/>
18
+ <rect x="47.2847" y="110.882" width="67.3438" height="5.53511" rx="2.76755" transform="rotate(15 47.2847 110.882)" fill="#B9E0FF"/>
19
+ <rect x="41.5542" y="132.268" width="28.5981" height="5.53511" rx="2.76755" transform="rotate(15 41.5542 132.268)" fill="#52B3FF"/>
20
+ <g filter="url(#filter0_d_4523_215)">
21
+ <rect x="9" y="56.7385" width="89.4842" height="119.927" rx="8" transform="rotate(-15 9 56.7385)" fill="white"/>
22
+ </g>
23
+ <rect x="20.776" y="65.0439" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(-15 20.776 65.0439)" fill="#B9E0FF"/>
24
+ <rect x="26.5063" y="86.4299" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(-15 26.5063 86.4299)" fill="#B9E0FF"/>
25
+ <rect x="32.2367" y="107.816" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(-15 32.2367 107.816)" fill="#52B3FF"/>
26
+ <rect x="37.967" y="129.202" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(-15 37.967 129.202)" fill="#B9E0FF"/>
27
+ <rect x="43.6975" y="150.588" width="71.0339" height="5.53511" rx="2.76755" transform="rotate(-15 43.6975 150.588)" fill="#B9E0FF"/>
28
+ <rect x="23.6411" y="75.7369" width="59.9637" height="5.53511" rx="2.76755" transform="rotate(-15 23.6411 75.7369)" fill="#52B3FF"/>
29
+ <rect x="29.3716" y="97.1229" width="63.6537" height="5.53511" rx="2.76755" transform="rotate(-15 29.3716 97.1229)" fill="#B9E0FF"/>
30
+ <rect x="35.1019" y="118.509" width="67.3438" height="5.53511" rx="2.76755" transform="rotate(-15 35.1019 118.509)" fill="#B9E0FF"/>
31
+ <rect x="40.8323" y="139.895" width="28.5981" height="5.53511" rx="2.76755" transform="rotate(-15 40.8323 139.895)" fill="#52B3FF"/>
32
+ </g>
33
+ <defs>
34
+ <filter id="filter0_d_4523_215" x="2.79602" y="27.3742" width="129.883" height="151.409" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
35
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
36
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
37
+ <feOffset/>
38
+ <feGaussianBlur stdDeviation="4"/>
39
+ <feComposite in2="hardAlpha" operator="out"/>
40
+ <feColorMatrix type="matrix" values="0 0 0 0 0.0627451 0 0 0 0 0.0666667 0 0 0 0 0.0784314 0 0 0 0.12 0"/>
41
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4523_215"/>
42
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4523_215" result="shape"/>
43
+ </filter>
44
+ <clipPath id="clip0_4523_215">
45
+ <rect width="150" height="150" rx="75" fill="white"/>
46
+ </clipPath>
47
+ </defs>
48
+ </svg>
@@ -0,0 +1,237 @@
1
+ <script setup>
2
+ import { nextTick, ref, watch } from 'vue'
3
+ import UTooltip from './UTooltip.vue'
4
+
5
+ const emit = defineEmits(['onItemClick'])
6
+
7
+ const props = defineProps({
8
+ data: { type: Array, default: () => [] },
9
+ dataTestId: {
10
+ type: String,
11
+ default: 'accordion-select',
12
+ },
13
+ multiple: { type: Boolean, default: false },
14
+ title: { type: String, default: 'Select Division' },
15
+ })
16
+
17
+ const activeLineStyles = ref({})
18
+ const selectedRows = ref({})
19
+ const showTooltipFor = ref({})
20
+
21
+ //Tooltip handling
22
+ const checkEllipsis = (sectionIndex, rowIndex, el) => {
23
+ if (!el) return
24
+ setTimeout(() => {
25
+ const isEllipsed = el.scrollWidth > el.clientWidth
26
+ if (!showTooltipFor.value[sectionIndex]) {
27
+ showTooltipFor.value[sectionIndex] = {}
28
+ }
29
+ showTooltipFor.value[sectionIndex][rowIndex] = isEllipsed
30
+ }, 50)
31
+ }
32
+
33
+ //Selection handling
34
+ const isSelected = (sectionIndex, rowIndex) =>
35
+ selectedRows.value[sectionIndex]?.includes(rowIndex)
36
+
37
+ const selectItem = (sectionIndex, rowIndex, item) => {
38
+ if (item.disabled) return
39
+
40
+ let isSelected = false
41
+ if (props.multiple) {
42
+ if (!selectedRows.value[sectionIndex]) {
43
+ selectedRows.value[sectionIndex] = []
44
+ }
45
+ const idx = selectedRows.value[sectionIndex].indexOf(rowIndex)
46
+ if (idx > -1) {
47
+ selectedRows.value[sectionIndex].splice(idx, 1)
48
+ isSelected = false
49
+ } else {
50
+ selectedRows.value[sectionIndex].push(rowIndex)
51
+ isSelected = true
52
+ }
53
+
54
+ selectedRows.value[sectionIndex].sort((a, b) => a - b)
55
+ updateActiveLine(sectionIndex)
56
+ } else {
57
+ const alreadySelected =
58
+ selectedRows.value[sectionIndex]?.[0] === rowIndex &&
59
+ Object.keys(selectedRows.value).length === 1
60
+
61
+ if (alreadySelected) {
62
+ selectedRows.value = {}
63
+ activeLineStyles.value = {}
64
+ isSelected = false
65
+ } else {
66
+ selectedRows.value = { [sectionIndex]: [rowIndex] }
67
+ activeLineStyles.value = {}
68
+ updateActiveLine(sectionIndex)
69
+ isSelected = true
70
+ }
71
+ }
72
+
73
+ emit('onItemClick', { sectionIndex, item, selected: isSelected })
74
+ }
75
+
76
+ //Active line handling
77
+ const updateActiveLine = (sectionIndex) => {
78
+ nextTick(() => {
79
+ const container = document.querySelector(`[data-section="${sectionIndex}"]`)
80
+ const allRows = [...(container?.querySelectorAll('.row-item') || [])]
81
+
82
+ const selectedIndexes = selectedRows.value[sectionIndex] || []
83
+ const groups = []
84
+ let currentGroup = []
85
+
86
+ selectedIndexes.forEach((idx, i) => {
87
+ if (i === 0 || idx === selectedIndexes[i - 1] + 1) {
88
+ currentGroup.push(idx)
89
+ } else {
90
+ groups.push(currentGroup)
91
+ currentGroup = [idx]
92
+ }
93
+ })
94
+ if (currentGroup.length) groups.push(currentGroup)
95
+
96
+ activeLineStyles.value[sectionIndex] = groups.map((group) => {
97
+ const firstEl = allRows[group[0]]
98
+ const lastEl = allRows[group[group.length - 1]]
99
+ const top = firstEl.offsetTop
100
+ const height = lastEl.offsetTop + lastEl.offsetHeight - top
101
+ return { top: `${top}px`, height: `${height}px` }
102
+ })
103
+ })
104
+ }
105
+
106
+ //Reset when switching to single select
107
+ watch(
108
+ () => props.multiple,
109
+ (value) => {
110
+ if (!value) {
111
+ selectedRows.value = {}
112
+ activeLineStyles.value = {}
113
+ showTooltipFor.value = {}
114
+ }
115
+ }
116
+ )
117
+ </script>
118
+
119
+ <template>
120
+ <div class="u-accordion-select" :dataTestId="dataTestId">
121
+ <div class="q-pa-xs">
122
+ <span class="text-heading-xxs text-dark" tabindex="0">{{ title }}</span>
123
+ </div>
124
+
125
+ <q-expansion-item
126
+ v-bind="$attrs"
127
+ v-for="(item, sectionIndex) in data"
128
+ header-class="q-px-xxs accordion-header text-caption-md"
129
+ :caption="item.caption"
130
+ dataTestId="division-item"
131
+ :disable="item.disabled"
132
+ :key="sectionIndex"
133
+ :label="item.title"
134
+ switch-toggle-side
135
+ >
136
+ <div class="content-with-line q-mx-sm" :data-section="sectionIndex">
137
+ <template
138
+ v-for="styleObj in activeLineStyles[sectionIndex] || []"
139
+ :key="styleObj.index"
140
+ >
141
+ <div class="active-line" :style="styleObj" />
142
+ </template>
143
+
144
+ <div
145
+ v-for="(row, rowIndex) in item?.children"
146
+ :class="[
147
+ 'row-item q-py-xs',
148
+ row.disabled ? 'disabled' : '',
149
+ isSelected(sectionIndex, rowIndex) ? 'active' : '',
150
+ ]"
151
+ dataTestId="division-child"
152
+ :key="rowIndex"
153
+ role="option"
154
+ :tabindex="row.disabled ? -1 : 0"
155
+ @click="selectItem(sectionIndex, rowIndex, row)"
156
+ @keydown.enter.prevent="selectItem(sectionIndex, rowIndex, row)"
157
+ >
158
+ <span
159
+ class="text-body-sm row-text ellipsis"
160
+ dataTestId="child-item"
161
+ :ref="(el) => checkEllipsis(sectionIndex, rowIndex, el)"
162
+ >
163
+ {{ row.title }}
164
+ <UTooltip
165
+ v-if="showTooltipFor[sectionIndex]?.[rowIndex] && row?.title"
166
+ :description="row?.title"
167
+ />
168
+ </span>
169
+ </div>
170
+ </div>
171
+ </q-expansion-item>
172
+ </div>
173
+ </template>
174
+
175
+ <style lang="sass">
176
+ .u-accordion-select
177
+ border: 1.5px solid $neutral-4
178
+ border-radius: $xs
179
+ padding: $xxs
180
+
181
+ .accordion-header
182
+ .q-item__section--avatar
183
+ min-width: 0px
184
+ .q-item__section--side
185
+ padding-right: $xxs
186
+ border-radius: $xxs
187
+ .q-item__label
188
+ word-break: break-word
189
+
190
+ .q-expansion-item__toggle-icon
191
+ font-size: $ba
192
+ .q-expansion-item--expanded .q-expansion-item__toggle-icon
193
+ line-height: 4.5
194
+
195
+ .content-with-line
196
+ position: relative
197
+ padding-left: $sm
198
+
199
+ &::before
200
+ content: ''
201
+ position: absolute
202
+ top: 0
203
+ bottom: 2px
204
+ left: 0
205
+ width: 2px
206
+ background-color: $neutral-4
207
+
208
+ .active-line
209
+ position: absolute
210
+ left: 0
211
+ width: 2px
212
+ background-color: $primary
213
+ z-index: 1
214
+ border-radius: $xs
215
+
216
+ .row-text
217
+ flex: 1 1 auto
218
+ word-wrap: break-word
219
+ min-width: 0px
220
+ overflow: hidden
221
+ white-space: nowrap
222
+ text-overflow: ellipsis
223
+
224
+ .row-item
225
+ border: 0px
226
+ cursor: pointer
227
+ position: relative
228
+ display: flex
229
+ align-items: center
230
+ &:hover:not(.disabled)
231
+ .row-text
232
+ color: $primary
233
+ .row-item.disabled
234
+ opacity: 0.5
235
+ cursor: not-allowed
236
+ pointer-events: none
237
+ </style>
@@ -1,47 +1,71 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import UBadgeStd from './UBadgeStd.vue'
4
+ import UTooltip from './UTooltip.vue'
5
+
6
+ const emit = defineEmits(['onClick'])
4
7
  const props = defineProps({
8
+ bgColor: {
9
+ type: String,
10
+ },
5
11
  color: {
6
12
  type: String,
7
13
  default: 'primary',
8
14
  },
9
- icon: {
15
+ dataTestId: {
10
16
  type: String,
17
+ default: 'avatar',
11
18
  },
12
- size: {
19
+ icon: {
13
20
  type: String,
14
- default: 'xl',
15
21
  },
16
22
  image: {
17
23
  type: String,
18
24
  },
19
25
  indicatorColor: {
20
- type: String,
26
+ type: [Function, String, Object],
21
27
  default: 'neutral-4',
22
28
  },
29
+ indicatorIcon: {
30
+ type: [Function, String, Object],
31
+ default: '',
32
+ },
23
33
  name: {
24
34
  type: String,
25
35
  required: true,
26
36
  },
37
+ round: {
38
+ type: Boolean,
39
+ default: true,
40
+ },
27
41
  showIndicator: {
28
42
  type: Boolean,
29
43
  default: false,
30
44
  },
31
- icon: {
32
- type: String,
33
- },
34
- round: {
45
+ showTooltip: {
35
46
  type: Boolean,
36
- default: true,
47
+ default: false,
48
+ },
49
+ size: {
50
+ type: String,
51
+ default: 'xl',
37
52
  },
38
53
  })
39
54
 
40
- const emit = defineEmits(['onClick'])
55
+ // computed
56
+ const initials = computed(() => {
57
+ if (props.name) {
58
+ const name = props.name.replace(/\s+/g, ' ')
59
+ const parts = name.split(' ')
41
60
 
42
- const handleClick = () => {
43
- return emit('onClick')
44
- }
61
+ if (parts.length === 1) return parts[0].substring(0, 2).toUpperCase()
62
+
63
+ return `${parts[0].substring(0, 1).toUpperCase()}${parts[parts.length - 1]
64
+ .substring(0, 1)
65
+ .toUpperCase()}`
66
+ }
67
+ return props?.name
68
+ })
45
69
 
46
70
  const labelSize = computed(() => {
47
71
  if (props.size === 'sm') {
@@ -59,33 +83,49 @@ const labelSize = computed(() => {
59
83
 
60
84
  return props.size
61
85
  })
86
+
87
+ // custom functions
88
+ const handleClick = () => {
89
+ return emit('onClick')
90
+ }
62
91
  </script>
63
92
 
64
93
  <template>
65
94
  <q-avatar
66
- class="u-avatar"
67
- :class="`size-${size}`"
68
- @click="handleClick"
95
+ v-bind="$attrs"
96
+ :class="`u-avatar size-${size}`"
97
+ :aria-label="name"
98
+ :color="bgColor"
99
+ :dataTestId="dataTestId"
100
+ :icon="icon"
69
101
  :round="round"
70
102
  :rounded="!round"
71
- :icon="icon"
72
- v-bind="$attrs"
103
+ @click="handleClick"
73
104
  >
74
- <img v-if="image" :src="image" :alt="`avatar ${name}`" :aria-label="name" />
75
- <span
76
- v-if="!image"
77
- class="name"
78
- :class="`text-${color} text-caption-${labelSize}`"
105
+ <UTooltip
106
+ v-if="showTooltip"
107
+ anchor="bottom middle"
108
+ :description="name"
109
+ :offset="[4, 4]"
110
+ self="top middle"
79
111
  >
80
- {{ name }}
112
+ </UTooltip>
113
+ <img v-if="image" :alt="`avatar ${name}`" :aria-label="name" :src="image" />
114
+ <span v-if="!image" :class="`name text-${color} text-caption-${labelSize}`">
115
+ {{ initials }}
81
116
  </span>
82
117
  <UBadgeStd
83
- v-if="showIndicator"
84
- :color="indicatorColor"
118
+ v-if="!indicatorIcon && showIndicator && indicatorColor"
85
119
  :class="`indicator`"
120
+ :color="indicatorColor"
86
121
  size="xs"
122
+ tabindex="-1"
87
123
  type="indicator"
88
124
  />
125
+ <div v-if="showIndicator && indicatorIcon" class="indicator-icon">
126
+ <q-icon :class="`${indicatorIcon}`" :color="indicatorColor" />
127
+ </div>
128
+
89
129
  <slot name="item" />
90
130
  </q-avatar>
91
131
  </template>
@@ -108,6 +148,9 @@ const labelSize = computed(() => {
108
148
  width: $xs
109
149
  height: $xs
110
150
 
151
+ .q-icon
152
+ font-size: $xs
153
+
111
154
  .q-avatar__content .name
112
155
  line-height: $xs !important
113
156
 
@@ -119,6 +162,9 @@ const labelSize = computed(() => {
119
162
  width: $xs
120
163
  height: $xs
121
164
 
165
+ .q-icon
166
+ font-size: $sm
167
+
122
168
  &.size-lg
123
169
  width: $md
124
170
  height: $md
@@ -127,6 +173,9 @@ const labelSize = computed(() => {
127
173
  width: $sm
128
174
  height: $sm
129
175
 
176
+ .q-icon
177
+ font-size: $sm
178
+
130
179
  &.size-xl
131
180
  width: $lg
132
181
  height: $lg
@@ -135,6 +184,21 @@ const labelSize = computed(() => {
135
184
  width: $ba
136
185
  height: $ba
137
186
 
187
+ .q-icon
188
+ font-size: $ba
189
+
190
+ .indicator-icon
191
+ position: absolute
192
+ bottom: -$xxs
193
+ right: -$xxs
194
+ width: $sm
195
+ height: $sm
196
+ border-radius: 50%
197
+ background: $neutral-1
198
+ display: flex
199
+ justify-content: center
200
+ align-items: center
201
+
138
202
  .indicator
139
203
  position: absolute
140
204
  bottom: 0